update to 113.0.5672.63

epel9
Than Ngo 2 years ago
parent b5a8d88748
commit d89936fb37

@ -1,62 +0,0 @@
diff -up chromium-104.0.5112.101/chrome/browser/about_flags.cc.accel-mjpeg chromium-104.0.5112.101/chrome/browser/about_flags.cc
--- chromium-104.0.5112.101/chrome/browser/about_flags.cc.accel-mjpeg 2022-08-16 23:29:08.000000000 +0000
+++ chromium-104.0.5112.101/chrome/browser/about_flags.cc 2022-08-18 14:21:36.762266571 +0000
@@ -4485,12 +4485,12 @@ const FeatureEntry kFeatureEntries[] = {
flag_descriptions::kWebXrForceRuntimeDescription, kOsDesktop,
MULTI_VALUE_TYPE(kWebXrForceRuntimeChoices)},
#endif // ENABLE_VR
-#if BUILDFLAG(IS_CHROMEOS_ASH)
+#if BUILDFLAG(IS_CHROMEOS_ASH) || BUILDFLAG(IS_LINUX)
{"disable-accelerated-mjpeg-decode",
flag_descriptions::kAcceleratedMjpegDecodeName,
- flag_descriptions::kAcceleratedMjpegDecodeDescription, kOsCrOS,
+ flag_descriptions::kAcceleratedMjpegDecodeDescription, kOsCrOS | kOsLinux,
SINGLE_DISABLE_VALUE_TYPE(switches::kDisableAcceleratedMjpegDecode)},
-#endif // BUILDFLAG(IS_CHROMEOS_ASH)
+#endif // BUILDFLAG(IS_CHROMEOS_ASH) || BUILDFLAG(IS_LINUX)
{"system-keyboard-lock", flag_descriptions::kSystemKeyboardLockName,
flag_descriptions::kSystemKeyboardLockDescription, kOsDesktop,
FEATURE_VALUE_TYPE(features::kSystemKeyboardLock)},
diff -up chromium-104.0.5112.101/chrome/browser/flag_descriptions.cc.accel-mjpeg chromium-104.0.5112.101/chrome/browser/flag_descriptions.cc
--- chromium-104.0.5112.101/chrome/browser/flag_descriptions.cc.accel-mjpeg 2022-08-16 23:29:09.000000000 +0000
+++ chromium-104.0.5112.101/chrome/browser/flag_descriptions.cc 2022-08-18 14:25:23.609572649 +0000
@@ -4170,7 +4170,7 @@ const char kUseAngleGL[] = "OpenGL";
// ChromeOS -------------------------------------------------------------------
-#if BUILDFLAG(IS_CHROMEOS_ASH)
+#if BUILDFLAG(IS_CHROMEOS_ASH) || BUILDFLAG(IS_LINUX)
const char kAcceleratedMjpegDecodeName[] =
"Hardware-accelerated mjpeg decode for captured frame";
@@ -4178,6 +4178,10 @@ const char kAcceleratedMjpegDecodeDescri
"Enable hardware-accelerated mjpeg decode for captured frame where "
"available.";
+#endif
+
+#if BUILDFLAG(IS_CHROMEOS_ASH)
+
const char kAdaptiveChargingForTestingName[] =
"Show adaptive charging notifications for testing";
const char kAdaptiveChargingForTestingDescription[] =
diff -up chromium-104.0.5112.101/chrome/browser/flag_descriptions.h.accel-mjpeg chromium-104.0.5112.101/chrome/browser/flag_descriptions.h
--- chromium-104.0.5112.101/chrome/browser/flag_descriptions.h.accel-mjpeg 2022-08-18 14:21:36.765266469 +0000
+++ chromium-104.0.5112.101/chrome/browser/flag_descriptions.h 2022-08-18 14:26:10.469983301 +0000
@@ -2390,11 +2390,15 @@ extern const char kUseAngleGL[];
// ChromeOS -------------------------------------------------------------------
-#if BUILDFLAG(IS_CHROMEOS_ASH)
+#if BUILDFLAG(IS_CHROMEOS_ASH) || BUILDFLAG(IS_LINUX)
extern const char kAcceleratedMjpegDecodeName[];
extern const char kAcceleratedMjpegDecodeDescription[];
+#endif // BUILDFLAG(IS_CHROMEOS_ASH) || BUILDFLAG(IS_LINUX)
+
+#if BUILDFLAG(IS_CHROMEOS_ASH)
+
extern const char kAdaptiveChargingName[];
extern const char kAdaptiveChargingDescription[];

@ -1,19 +0,0 @@
diff -up chromium-109.0.5414.74/chrome/browser/media/router/media_router_feature.cc.disable-GlobalMediaControlsCastStartStop chromium-109.0.5414.74/chrome/browser/media/router/media_router_feature.cc
--- chromium-109.0.5414.74/chrome/browser/media/router/media_router_feature.cc.disable-GlobalMediaControlsCastStartStop 2023-01-11 15:27:50.587737070 +0100
+++ chromium-109.0.5414.74/chrome/browser/media/router/media_router_feature.cc 2023-01-11 15:30:35.136829951 +0100
@@ -48,15 +48,9 @@ BASE_FEATURE(kMediaRemotingWithoutFullsc
"MediaRemotingWithoutFullscreen",
base::FEATURE_DISABLED_BY_DEFAULT);
-#if BUILDFLAG(IS_CHROMEOS)
BASE_FEATURE(kGlobalMediaControlsCastStartStop,
"GlobalMediaControlsCastStartStop",
base::FEATURE_DISABLED_BY_DEFAULT);
-#else
-BASE_FEATURE(kGlobalMediaControlsCastStartStop,
- "GlobalMediaControlsCastStartStop",
- base::FEATURE_ENABLED_BY_DEFAULT);
-#endif // BUILDFLAG(IS_CHROMEOS)
#endif // BUILDFLAG(IS_ANDROID)

@ -1,71 +0,0 @@
From 041cb248e818823caaaabc67db92b16499d0416d Mon Sep 17 00:00:00 2001
From: Vasiliy Telezhnikov <vasilyt@chromium.org>
Date: Thu, 02 Feb 2023 15:42:28 +0000
Subject: [PATCH] CHECK that passthrough command decoder is used on launched platforms
This CL adds enforces that validating command decoder is not used on
platforms where passthrough is fully launched. We still allow to use it
by tests on linux
Bug: 1406585
Change-Id: Id6bc1d748fdf9c953dde76c8d4b5f59ddef60857
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/4212134
Reviewed-by: Kyle Charbonneau <kylechar@chromium.org>
Commit-Queue: Vasiliy Telezhnikov <vasilyt@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1100440}
---
diff --git a/gpu/command_buffer/service/gles2_cmd_decoder.cc b/gpu/command_buffer/service/gles2_cmd_decoder.cc
index eb710696..b22dffb 100644
--- a/gpu/command_buffer/service/gles2_cmd_decoder.cc
+++ b/gpu/command_buffer/service/gles2_cmd_decoder.cc
@@ -3447,7 +3447,13 @@
outputter, group);
}
+// Allow linux to run fuzzers.
+#if BUILDFLAG(ENABLE_VALIDATING_COMMAND_DECODER) || BUILDFLAG(IS_LINUX)
return new GLES2DecoderImpl(client, command_buffer_service, outputter, group);
+#else
+ LOG(FATAL) << "Validating command decoder is not supported.";
+ return nullptr;
+#endif
}
GLES2DecoderImpl::GLES2DecoderImpl(
diff --git a/gpu/ipc/service/gpu_init.cc b/gpu/ipc/service/gpu_init.cc
index 40977d9b..50171e20 100644
--- a/gpu/ipc/service/gpu_init.cc
+++ b/gpu/ipc/service/gpu_init.cc
@@ -510,8 +510,9 @@
auto impl = gl::GetGLImplementationParts();
bool gl_disabled = impl == gl::kGLImplementationDisabled;
- bool is_swangle = impl == gl::ANGLEImplementation::kSwiftShader;
+#if BUILDFLAG(ENABLE_VALIDATING_COMMAND_DECODER)
+ bool is_swangle = impl == gl::ANGLEImplementation::kSwiftShader;
// Compute passthrough decoder status before ComputeGpuFeatureInfo below.
// Do this after GL is initialized so extensions can be queried.
// Using SwANGLE forces the passthrough command decoder.
@@ -533,6 +534,20 @@
}
gpu_preferences_.use_passthrough_cmd_decoder =
gpu_info_.passthrough_cmd_decoder;
+#else
+ // If gl is disabled passthrough/validating command decoder doesn't matter. If
+ // it's not ensure that passthrough command decoder is supported as it's our
+ // only option.
+ if (!gl_disabled) {
+ LOG_IF(FATAL, !gles2::PassthroughCommandDecoderSupported())
+ << "Passthrough is not supported, GL is "
+ << gl::GetGLImplementationGLName(gl::GetGLImplementationParts())
+ << ", ANGLE is "
+ << gl::GetGLImplementationANGLEName(gl::GetGLImplementationParts());
+ gpu_info_.passthrough_cmd_decoder = true;
+ gpu_preferences_.use_passthrough_cmd_decoder = true;
+ }
+#endif
// We need to collect GL strings (VENDOR, RENDERER) for blocklisting purposes.
if (!gl_disabled) {

@ -1,21 +0,0 @@
author Yaowei Zhou <yaowei.zhou@intel.com> Thu Feb 02 06:18:34 2023
committer Yaowei Zhou <yaowei.zhou@intel.com> Thu Feb 02 06:18:34 2023
tree 62a79c7f155fc32140d3aa4c4a6b01b8d7eddfcc
parent 98e427b87ff8447180a60f20ee3792dcbd649481 [diff]
Enable VA-API flag on ozone wayland
Bug: POC
Change-Id: I09f696bfe3be82930161ce005152d1397b93f636
diff --git a/ui/ozone/platform/wayland/ozone_platform_wayland.cc b/ui/ozone/platform/wayland/ozone_platform_wayland.cc
index b3190c6b..4a2c3bb 100644
--- a/ui/ozone/platform/wayland/ozone_platform_wayland.cc
+++ b/ui/ozone/platform/wayland/ozone_platform_wayland.cc
@@ -309,6 +309,8 @@
properties->supports_global_screen_coordinates =
features::IsWaylandScreenCoordinatesEnabled();
+ properties->supports_vaapi_x11 = true;
+
initialised = true;
}

@ -1,27 +1,29 @@
diff -up chromium-108.0.5359.124/AUTHORS.first_dts chromium-108.0.5359.124/AUTHORS
--- chromium-108.0.5359.124/AUTHORS.first_dts 2022-12-31 15:30:52.923006393 +0100
+++ chromium-108.0.5359.124/AUTHORS 2022-12-31 15:32:50.431215836 +0100
@@ -97,6 +97,7 @@ Andra Paraschiv <andra.paraschiv@intel.c
Andras Tokodi <a.tokodi@eyeo.com>
Andreas Nazlidis <andreas221b@gmail.com>
Andreas Papacharalampous <andreas@apap04.com>
+Andreas Schneider <asn@cryptomilk.org>
Andrei Borza <andrei.borza@gmail.com>
Andrei Parvu <andrei.prv@gmail.com>
Andrei Parvu <parvu@adobe.com>
diff -up chromium-108.0.5359.124/media/filters/ffmpeg_demuxer.cc.first_dts chromium-108.0.5359.124/media/filters/ffmpeg_demuxer.cc
--- chromium-108.0.5359.124/media/filters/ffmpeg_demuxer.cc.first_dts 2022-12-14 01:39:52.000000000 +0100
+++ chromium-108.0.5359.124/media/filters/ffmpeg_demuxer.cc 2022-12-31 15:30:52.923006393 +0100
@@ -58,7 +58,7 @@ namespace media {
namespace {
-constexpr int64_t kInvalidPTSMarker = static_cast<int64_t>(0x8000000000000000);
+constexpr int64_t kRelativeTsBase = static_cast<int64_t>(0x7ffeffffffffffff);
void SetAVStreamDiscard(AVStream* stream, AVDiscard discard) {
DCHECK(stream);
@@ -91,7 +91,7 @@ static base::TimeDelta FramesToTimeDelta
From 2aef9000a1c8d76d3072365ffcb471ebffa20d3d Mon Sep 17 00:00:00 2001
From: Andreas Schneider <asn@cryptomilk.org>
Date: Tue, 15 Mar 2022 14:26:16 +0100
Subject: [PATCH] Track first_dts instead of using non-upstream functions
The function av_stream_get_first_dts() is not an upstream ffmpeg function and
is not available if you build with system ffmpeg. We can easily track the
first_dts on our own.
See also
https://ffmpeg.org/pipermail/ffmpeg-devel/2021-September/285401.html
Bug: 1306560
Signed-off-by: Andreas Schneider <asn@cryptomilk.org>
Change-Id: I90ba3cf2f2e16f56a0b405f26c67f911349fb71d
---
media/filters/ffmpeg_demuxer.cc | 18 ++++++++++++------
media/filters/ffmpeg_demuxer.h | 3 +++
3 files changed, 16 insertions(+), 6 deletions(-)
diff --git a/media/filters/ffmpeg_demuxer.cc b/media/filters/ffmpeg_demuxer.cc
index 111899b661..799fc6e941 100644
--- a/media/filters/ffmpeg_demuxer.cc
+++ b/media/filters/ffmpeg_demuxer.cc
@@ -97,7 +97,7 @@ static base::TimeDelta FramesToTimeDelta(int frames, double sample_rate) {
sample_rate);
}
@ -30,7 +32,7 @@ diff -up chromium-108.0.5359.124/media/filters/ffmpeg_demuxer.cc.first_dts chrom
// The default start time is zero.
base::TimeDelta start_time;
@@ -101,12 +101,12 @@ static base::TimeDelta ExtractStartTime(
@@ -107,12 +107,12 @@ static base::TimeDelta ExtractStartTime(AVStream* stream) {
// Next try to use the first DTS value, for codecs where we know PTS == DTS
// (excludes all H26x codecs). The start time must be returned in PTS.
@ -45,7 +47,7 @@ diff -up chromium-108.0.5359.124/media/filters/ffmpeg_demuxer.cc.first_dts chrom
if (first_pts < start_time)
start_time = first_pts;
}
@@ -275,6 +275,7 @@ FFmpegDemuxerStream::FFmpegDemuxerStream
@@ -283,6 +283,7 @@ FFmpegDemuxerStream::FFmpegDemuxerStream(
fixup_negative_timestamps_(false),
fixup_chained_ogg_(false),
num_discarded_packet_warnings_(0),
@ -53,27 +55,18 @@ diff -up chromium-108.0.5359.124/media/filters/ffmpeg_demuxer.cc.first_dts chrom
last_packet_pos_(AV_NOPTS_VALUE),
last_packet_dts_(AV_NOPTS_VALUE) {
DCHECK(demuxer_);
@@ -341,6 +342,11 @@ void FFmpegDemuxerStream::EnqueuePacket(
@@ -349,6 +350,10 @@ void FFmpegDemuxerStream::EnqueuePacket(ScopedAVPacket packet) {
int64_t packet_dts =
packet->dts == AV_NOPTS_VALUE ? packet->pts : packet->dts;
+ if (first_dts_ == AV_NOPTS_VALUE && packet->dts != AV_NOPTS_VALUE &&
+ last_packet_dts_ != AV_NOPTS_VALUE) {
+ first_dts_ = packet->dts - (last_packet_dts_ + kRelativeTsBase);
+ if (first_dts_ == AV_NOPTS_VALUE) {
+ first_dts_ = packet_dts;
+ }
+
// Chained ogg files have non-monotonically increasing position and time stamp
// values, which prevents us from using them to determine if a packet should
// be dropped. Since chained ogg is only allowed on single track audio only
@@ -683,6 +689,7 @@ void FFmpegDemuxerStream::FlushBuffers(b
ResetBitstreamConverter();
if (!preserve_packet_position) {
+ first_dts_ = AV_NOPTS_VALUE;
last_packet_pos_ = AV_NOPTS_VALUE;
last_packet_dts_ = AV_NOPTS_VALUE;
}
@@ -1434,7 +1441,8 @@ void FFmpegDemuxer::OnFindStreamInfoDone
@@ -1442,7 +1447,8 @@ void FFmpegDemuxer::OnFindStreamInfoDone(int result) {
max_duration = std::max(max_duration, streams_[i]->duration());
@ -83,7 +76,7 @@ diff -up chromium-108.0.5359.124/media/filters/ffmpeg_demuxer.cc.first_dts chrom
// Note: This value is used for seeking, so we must take the true value and
// not the one possibly clamped to zero below.
@@ -1591,7 +1599,7 @@ FFmpegDemuxerStream* FFmpegDemuxer::Find
@@ -1599,7 +1605,7 @@ FFmpegDemuxerStream* FFmpegDemuxer::FindStreamWithLowestStartTimestamp(
for (const auto& stream : streams_) {
if (!stream || stream->IsEnabled() != enabled)
continue;
@ -92,7 +85,7 @@ diff -up chromium-108.0.5359.124/media/filters/ffmpeg_demuxer.cc.first_dts chrom
continue;
if (!lowest_start_time_stream ||
stream->start_time() < lowest_start_time_stream->start_time()) {
@@ -1612,7 +1620,7 @@ FFmpegDemuxerStream* FFmpegDemuxer::Find
@@ -1620,7 +1626,7 @@ FFmpegDemuxerStream* FFmpegDemuxer::FindPreferredStreamForSeeking(
if (stream->type() != DemuxerStream::VIDEO)
continue;
@ -101,17 +94,11 @@ diff -up chromium-108.0.5359.124/media/filters/ffmpeg_demuxer.cc.first_dts chrom
continue;
if (!stream->IsEnabled())
@@ -1926,4 +1934,4 @@ void FFmpegDemuxer::RunPendingSeekCB(Pip
std::move(pending_seek_cb_).Run(status);
}
-} // namespace media
+} // namespace media
\ Kein Zeilenumbruch am Dateiende.
diff -up chromium-108.0.5359.124/media/filters/ffmpeg_demuxer.h.first_dts chromium-108.0.5359.124/media/filters/ffmpeg_demuxer.h
--- chromium-108.0.5359.124/media/filters/ffmpeg_demuxer.h.first_dts 2022-12-14 01:39:52.000000000 +0100
+++ chromium-108.0.5359.124/media/filters/ffmpeg_demuxer.h 2022-12-31 15:30:52.924006403 +0100
@@ -145,6 +145,8 @@ class MEDIA_EXPORT FFmpegDemuxerStream :
diff --git a/media/filters/ffmpeg_demuxer.h b/media/filters/ffmpeg_demuxer.h
index c147309d6f..48a8f6ad8c 100644
--- a/media/filters/ffmpeg_demuxer.h
+++ b/media/filters/ffmpeg_demuxer.h
@@ -151,6 +151,8 @@ class MEDIA_EXPORT FFmpegDemuxerStream : public DemuxerStream {
base::TimeDelta start_time() const { return start_time_; }
void set_start_time(base::TimeDelta time) { start_time_ = time; }
@ -120,7 +107,7 @@ diff -up chromium-108.0.5359.124/media/filters/ffmpeg_demuxer.h.first_dts chromi
private:
friend class FFmpegDemuxerTest;
@@ -202,6 +204,7 @@ class MEDIA_EXPORT FFmpegDemuxerStream :
@@ -208,6 +210,7 @@ class MEDIA_EXPORT FFmpegDemuxerStream : public DemuxerStream {
bool fixup_chained_ogg_;
int num_discarded_packet_warnings_;
@ -128,3 +115,6 @@ diff -up chromium-108.0.5359.124/media/filters/ffmpeg_demuxer.h.first_dts chromi
int64_t last_packet_pos_;
int64_t last_packet_dts_;
};
--
2.35.1

@ -1,630 +0,0 @@
commit 7f0858c08dcef70ca26ce8527bbedfcc5c5218d3
Author: Colin Blundell <blundell@chromium.org>
Date: Thu Feb 23 14:19:33 2023 +0000
[Ozone] Invert layering of GLImageNativePixmap & NativePixmapEGLBinding
NativePixmapEGLBinding is currently a thin layer on top of
GLImageNativePixmap. This CL inverts the layering so that
GLImageNativePixmap instead sits on top of NativePixmapEGLBinding
(via the public Ozone ImportNativePixmap() method, for which all
implementations return NativePixmapEGLBinding). Note that this entails
moving GLImageNativePixmap into //gpu, as //ui/gl cannot depend on
//ozone/public.
This inversion means that
(a) the SharedImage Ozone backing/representations no longer use GLImage
(b) when we no longer need GLImageNativePixmap we can simply directly
eliminate it.
Followup CLs will fold NativePixmapEGLBindingHelper into
NativePixmapEGLBinding and make GLImageNativePixmap creation private
with friending to ensure that no more usage of the deprecated class
creeps in.
Bug: 1412692
Change-Id: I5f01e9b1f616dd99b61cd203662d0d02d3da7b3e
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/4262390
Reviewed-by: Vasiliy Telezhnikov <vasilyt@chromium.org>
Reviewed-by: ccameron chromium <ccameron@chromium.org>
Reviewed-by: Andres Calderon Jaramillo <andrescj@chromium.org>
Commit-Queue: Colin Blundell <blundell@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1108909}
diff --git a/gpu/command_buffer/service/BUILD.gn b/gpu/command_buffer/service/BUILD.gn
index d08be597e3e5d..5ad724dd57bbb 100644
--- a/gpu/command_buffer/service/BUILD.gn
+++ b/gpu/command_buffer/service/BUILD.gn
@@ -397,6 +397,8 @@ target(link_target_type, "gles2_sources") {
if (use_ozone) {
sources += [
+ "shared_image/gl_image_native_pixmap.cc",
+ "shared_image/gl_image_native_pixmap.h",
"shared_image/gl_ozone_image_representation.cc",
"shared_image/gl_ozone_image_representation.h",
"shared_image/ozone_image_backing.cc",
diff --git a/gpu/command_buffer/service/gles2_cmd_decoder.cc b/gpu/command_buffer/service/gles2_cmd_decoder.cc
index e3f5b3c5721cf..a297347c19670 100644
--- a/gpu/command_buffer/service/gles2_cmd_decoder.cc
+++ b/gpu/command_buffer/service/gles2_cmd_decoder.cc
@@ -120,10 +120,10 @@
#endif
#if BUILDFLAG(IS_OZONE)
+#include "gpu/command_buffer/service/shared_image/gl_image_native_pixmap.h"
#include "ui/gfx/buffer_format_util.h"
#include "ui/gfx/buffer_usage_util.h"
#include "ui/gfx/native_pixmap.h"
-#include "ui/gl/gl_image_native_pixmap.h"
#include "ui/ozone/public/ozone_platform.h"
#include "ui/ozone/public/surface_factory_ozone.h"
#endif
@@ -499,7 +499,7 @@ class BackTexture {
#if BUILDFLAG(IS_OZONE)
// The image that backs the texture, if its backed by a native
// GpuMemoryBuffer.
- scoped_refptr<gl::GLImageNativePixmap> image_;
+ scoped_refptr<GLImageNativePixmap> image_;
#endif
};
@@ -2522,7 +2522,7 @@ class GLES2DecoderImpl : public GLES2Decoder,
// Note: Creation of anonymous images is possible only on Ozone.
#if BUILDFLAG(IS_OZONE)
bool SupportsCreateAnonymousImage();
- scoped_refptr<gl::GLImageNativePixmap> CreateAnonymousImage(
+ scoped_refptr<GLImageNativePixmap> CreateAnonymousImage(
const gfx::Size& size,
gfx::BufferFormat format,
bool* is_cleared,
@@ -3242,7 +3242,7 @@ bool BackTexture::AllocateNativeGpuMemoryBuffer(const gfx::Size& size,
// duplicate BGRX_8888.
buffer_format = gfx::BufferFormat::BGRX_8888;
}
- scoped_refptr<gl::GLImageNativePixmap> image = decoder_->CreateAnonymousImage(
+ scoped_refptr<GLImageNativePixmap> image = decoder_->CreateAnonymousImage(
size, buffer_format, &is_cleared, Target(), id());
if (!image)
return false;
@@ -19592,7 +19592,7 @@ bool GLES2DecoderImpl::SupportsCreateAnonymousImage() {
.supports_native_pixmaps;
}
-scoped_refptr<gl::GLImageNativePixmap> GLES2DecoderImpl::CreateAnonymousImage(
+scoped_refptr<GLImageNativePixmap> GLES2DecoderImpl::CreateAnonymousImage(
const gfx::Size& size,
gfx::BufferFormat format,
bool* is_cleared,
@@ -19612,8 +19612,8 @@ scoped_refptr<gl::GLImageNativePixmap> GLES2DecoderImpl::CreateAnonymousImage(
<< gfx::BufferUsageToString(usage);
return nullptr;
}
- auto image = gl::GLImageNativePixmap::Create(size, format, std::move(pixmap),
- target, texture_id);
+ auto image = GLImageNativePixmap::Create(size, format, std::move(pixmap),
+ target, texture_id);
if (!image) {
LOG(ERROR) << "Failed to create GLImage " << size.ToString() << ", "
<< gfx::BufferFormatToString(format) << ", usage "
diff --git a/ui/gl/gl_image_native_pixmap.cc b/gpu/command_buffer/service/shared_image/gl_image_native_pixmap.cc
similarity index 73%
rename from ui/gl/gl_image_native_pixmap.cc
rename to gpu/command_buffer/service/shared_image/gl_image_native_pixmap.cc
index 6cbe7be2899de..d9101fbda893b 100644
--- a/ui/gl/gl_image_native_pixmap.cc
+++ b/gpu/command_buffer/service/shared_image/gl_image_native_pixmap.cc
@@ -2,9 +2,13 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-#include "ui/gl/gl_image_native_pixmap.h"
+#include "gpu/command_buffer/service/shared_image/gl_image_native_pixmap.h"
-namespace gl {
+#include "ui/ozone/public/native_pixmap_gl_binding.h"
+#include "ui/ozone/public/ozone_platform.h"
+#include "ui/ozone/public/surface_factory_ozone.h"
+
+namespace gpu {
scoped_refptr<GLImageNativePixmap> GLImageNativePixmap::Create(
const gfx::Size& size,
@@ -47,18 +51,18 @@ bool GLImageNativePixmap::InitializeFromNativePixmap(
const gfx::ColorSpace& color_space,
GLenum target,
GLuint texture_id) {
- binding_helper_ = NativePixmapEGLBindingHelper::CreateForPlane(
- size_, format, plane, std::move(pixmap), color_space, target, texture_id);
+ pixmap_gl_binding_ =
+ ui::OzonePlatform::GetInstance()
+ ->GetSurfaceFactoryOzone()
+ ->GetCurrentGLOzone()
+ ->ImportNativePixmap(std::move(pixmap), format, plane, size_,
+ color_space, target, texture_id);
- return !!binding_helper_;
+ return !!pixmap_gl_binding_;
}
gfx::Size GLImageNativePixmap::GetSize() {
return size_;
}
-unsigned GLImageNativePixmap::GetInternalFormat() {
- return binding_helper_->GetInternalFormat();
-}
-
-} // namespace gl
+} // namespace gpu
diff --git a/ui/gl/gl_image_native_pixmap.h b/gpu/command_buffer/service/shared_image/gl_image_native_pixmap.h
similarity index 72%
rename from ui/gl/gl_image_native_pixmap.h
rename to gpu/command_buffer/service/shared_image/gl_image_native_pixmap.h
index 5ff5e91b3ec18..4087360b04b45 100644
--- a/ui/gl/gl_image_native_pixmap.h
+++ b/gpu/command_buffer/service/shared_image/gl_image_native_pixmap.h
@@ -2,21 +2,24 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-#ifndef UI_GL_GL_IMAGE_NATIVE_PIXMAP_H_
-#define UI_GL_GL_IMAGE_NATIVE_PIXMAP_H_
+#ifndef GPU_COMMAND_BUFFER_SERVICE_SHARED_IMAGE_GL_IMAGE_NATIVE_PIXMAP_H_
+#define GPU_COMMAND_BUFFER_SERVICE_SHARED_IMAGE_GL_IMAGE_NATIVE_PIXMAP_H_
#include <stdint.h>
+#include "gpu/gpu_gles2_export.h"
#include "ui/gfx/color_space.h"
#include "ui/gfx/native_pixmap.h"
#include "ui/gl/gl_bindings.h"
-#include "ui/gl/gl_export.h"
#include "ui/gl/gl_image.h"
-#include "ui/gl/native_pixmap_egl_binding_helper.h"
-namespace gl {
+namespace ui {
+class NativePixmapGLBinding;
+}
-class GL_EXPORT GLImageNativePixmap : public GLImage {
+namespace gpu {
+
+class GPU_GLES2_EXPORT GLImageNativePixmap : public gl::GLImage {
public:
// Create an EGLImage from a given NativePixmap and bind |texture_id| to
// |target| following by binding the image to |target|.
@@ -41,22 +44,15 @@ class GL_EXPORT GLImageNativePixmap : public GLImage {
GLenum target,
GLuint texture_id);
- // Get the GL internal format of the image.
- // It is aligned with glTexImage{2|3}D's parameter |internalformat|.
- unsigned GetInternalFormat();
-
// Overridden from GLImage:
gfx::Size GetSize() override;
- protected:
- ~GLImageNativePixmap() override;
-
private:
explicit GLImageNativePixmap(const gfx::Size& size);
+ ~GLImageNativePixmap() override;
- // Create an EGLImage from a given NativePixmap and bind |texture_id| to
- // |target| followed by binding the image to |target|. This EGLImage can be
- // converted to a GL texture.
+ // Create a NativePixmapGLBinding from a given NativePixmap. Returns true iff
+ // the binding was successfully created.
bool InitializeFromNativePixmap(gfx::BufferFormat format,
gfx::BufferPlane plane,
scoped_refptr<gfx::NativePixmap> pixmap,
@@ -64,10 +60,10 @@ class GL_EXPORT GLImageNativePixmap : public GLImage {
GLenum target,
GLuint texture_id);
- std::unique_ptr<NativePixmapEGLBindingHelper> binding_helper_;
+ std::unique_ptr<ui::NativePixmapGLBinding> pixmap_gl_binding_;
const gfx::Size size_;
};
-} // namespace gl
+} // namespace gpu
-#endif // UI_GL_GL_IMAGE_NATIVE_PIXMAP_H_
+#endif // GPU_COMMAND_BUFFER_SERVICE_SHARED_IMAGE_GL_IMAGE_NATIVE_PIXMAP_H_
diff --git a/gpu/command_buffer/service/shared_image/gl_ozone_image_representation.h b/gpu/command_buffer/service/shared_image/gl_ozone_image_representation.h
index 31723894088e1..ade337bde9966 100644
--- a/gpu/command_buffer/service/shared_image/gl_ozone_image_representation.h
+++ b/gpu/command_buffer/service/shared_image/gl_ozone_image_representation.h
@@ -14,7 +14,6 @@
#include "gpu/command_buffer/service/shared_image/shared_image_representation.h"
#include "gpu/command_buffer/service/texture_manager.h"
#include "ui/gfx/native_pixmap.h"
-#include "ui/gl/gl_image_native_pixmap.h"
#include "ui/ozone/public/native_pixmap_gl_binding.h"
namespace gpu {
diff --git a/gpu/command_buffer/service/shared_image/ozone_image_backing.cc b/gpu/command_buffer/service/shared_image/ozone_image_backing.cc
index 8d4a7d9306eb1..7a652ae425c0e 100644
--- a/gpu/command_buffer/service/shared_image/ozone_image_backing.cc
+++ b/gpu/command_buffer/service/shared_image/ozone_image_backing.cc
@@ -36,7 +36,6 @@
#include "ui/gfx/native_pixmap.h"
#include "ui/gfx/native_widget_types.h"
#include "ui/gl/buildflags.h"
-#include "ui/gl/gl_image_native_pixmap.h"
#if BUILDFLAG(ENABLE_VULKAN)
#include "gpu/command_buffer/service/shared_image/skia_vk_ozone_image_representation.h"
diff --git a/media/gpu/v4l2/BUILD.gn b/media/gpu/v4l2/BUILD.gn
index 12e6b66cf7b89..ff7b5a1a50a38 100644
--- a/media/gpu/v4l2/BUILD.gn
+++ b/media/gpu/v4l2/BUILD.gn
@@ -98,6 +98,7 @@ source_set("v4l2") {
":libv4l2_stubs",
":v4l2_status",
"//base",
+ "//gpu/command_buffer/service:gles2",
"//gpu/ipc/common",
"//gpu/ipc/service",
"//media",
diff --git a/media/gpu/v4l2/generic_v4l2_device.cc b/media/gpu/v4l2/generic_v4l2_device.cc
index bdbb256ed578c..337ec0e7b372b 100644
--- a/media/gpu/v4l2/generic_v4l2_device.cc
+++ b/media/gpu/v4l2/generic_v4l2_device.cc
@@ -23,6 +23,7 @@
#include "base/strings/stringprintf.h"
#include "base/trace_event/trace_event.h"
#include "build/build_config.h"
+#include "gpu/command_buffer/service/shared_image/gl_image_native_pixmap.h"
#include "media/base/video_types.h"
#include "media/gpu/buildflags.h"
#include "media/gpu/chromeos/fourcc.h"
@@ -32,7 +33,6 @@
#include "ui/gfx/native_pixmap_handle.h"
#include "ui/gl/egl_util.h"
#include "ui/gl/gl_bindings.h"
-#include "ui/gl/gl_image_native_pixmap.h"
#include "ui/ozone/public/ozone_platform.h"
#include "ui/ozone/public/surface_factory_ozone.h"
@@ -281,7 +281,7 @@ EGLImageKHR GenericV4L2Device::CreateEGLImage(
return egl_image;
}
-scoped_refptr<gl::GLImageNativePixmap> GenericV4L2Device::CreateGLImage(
+scoped_refptr<gpu::GLImageNativePixmap> GenericV4L2Device::CreateGLImage(
const gfx::Size& size,
const Fourcc fourcc,
gfx::NativePixmapHandle handle,
@@ -317,7 +317,7 @@ scoped_refptr<gl::GLImageNativePixmap> GenericV4L2Device::CreateGLImage(
DCHECK(pixmap);
// TODO(b/220336463): plumb the right color space.
- auto image = gl::GLImageNativePixmap::Create(
+ auto image = gpu::GLImageNativePixmap::Create(
size, buffer_format, std::move(pixmap), target, texture_id);
DCHECK(image);
return image;
diff --git a/media/gpu/v4l2/generic_v4l2_device.h b/media/gpu/v4l2/generic_v4l2_device.h
index bb9ce391c15bd..fd84aee27097e 100644
--- a/media/gpu/v4l2/generic_v4l2_device.h
+++ b/media/gpu/v4l2/generic_v4l2_device.h
@@ -55,7 +55,7 @@ class GenericV4L2Device : public V4L2Device {
const Fourcc fourcc,
gfx::NativePixmapHandle handle) const override;
- scoped_refptr<gl::GLImageNativePixmap> CreateGLImage(
+ scoped_refptr<gpu::GLImageNativePixmap> CreateGLImage(
const gfx::Size& size,
const Fourcc fourcc,
gfx::NativePixmapHandle handle,
diff --git a/media/gpu/v4l2/v4l2_device.h b/media/gpu/v4l2/v4l2_device.h
index bdc39bf65ae38..ee74cbcd39957 100644
--- a/media/gpu/v4l2/v4l2_device.h
+++ b/media/gpu/v4l2/v4l2_device.h
@@ -28,6 +28,7 @@
#include "base/files/scoped_file.h"
#include "base/memory/ref_counted.h"
#include "base/sequence_checker.h"
+#include "gpu/command_buffer/service/shared_image/gl_image_native_pixmap.h"
#include "media/base/video_codecs.h"
#include "media/base/video_decoder_config.h"
#include "media/base/video_frame.h"
@@ -42,7 +43,6 @@
#include "ui/gfx/geometry/size.h"
#include "ui/gfx/native_pixmap_handle.h"
#include "ui/gl/gl_bindings.h"
-#include "ui/gl/gl_image_native_pixmap.h"
// TODO(mojahsu): remove this once V4L2 headers are updated.
#ifndef V4L2_PIX_FMT_JPEG_RAW
@@ -777,7 +777,7 @@ class MEDIA_GPU_EXPORT V4L2Device
// Create a GLImageNativePixmap from provided |handle|, taking full ownership
// of it.
- virtual scoped_refptr<gl::GLImageNativePixmap> CreateGLImage(
+ virtual scoped_refptr<gpu::GLImageNativePixmap> CreateGLImage(
const gfx::Size& size,
const Fourcc fourcc,
gfx::NativePixmapHandle handle,
diff --git a/media/gpu/v4l2/v4l2_slice_video_decode_accelerator.cc b/media/gpu/v4l2/v4l2_slice_video_decode_accelerator.cc
index a51acedc105b7..78cc605e986e6 100644
--- a/media/gpu/v4l2/v4l2_slice_video_decode_accelerator.cc
+++ b/media/gpu/v4l2/v4l2_slice_video_decode_accelerator.cc
@@ -30,6 +30,7 @@
#include "base/time/time.h"
#include "base/trace_event/memory_dump_manager.h"
#include "base/trace_event/trace_event.h"
+#include "gpu/command_buffer/service/shared_image/gl_image_native_pixmap.h"
#include "media/base/bind_to_current_loop.h"
#include "media/base/media_switches.h"
#include "media/base/scopedfd_helper.h"
@@ -49,7 +50,6 @@
#include "ui/gl/gl_bindings.h"
#include "ui/gl/gl_context.h"
#include "ui/gl/gl_display.h"
-#include "ui/gl/gl_image_native_pixmap.h"
#include "ui/gl/gl_surface_egl.h"
#include "ui/gl/scoped_binders.h"
@@ -1444,7 +1444,7 @@ void V4L2SliceVideoDecodeAccelerator::CreateGLImageFor(
return;
}
- scoped_refptr<gl::GLImageNativePixmap> gl_image =
+ scoped_refptr<gpu::GLImageNativePixmap> gl_image =
gl_device->CreateGLImage(visible_size, fourcc, std::move(handle),
gl_device->GetTextureTarget(), texture_id);
if (!gl_image) {
diff --git a/media/gpu/vaapi/BUILD.gn b/media/gpu/vaapi/BUILD.gn
index 1ecf8854d02e7..7687384553806 100644
--- a/media/gpu/vaapi/BUILD.gn
+++ b/media/gpu/vaapi/BUILD.gn
@@ -96,6 +96,7 @@ source_set("vaapi") {
":vaapi_status",
"//base",
"//build:chromeos_buildflags",
+ "//gpu/command_buffer/service:gles2",
"//gpu/config",
"//gpu/ipc/common",
"//gpu/ipc/service",
diff --git a/media/gpu/vaapi/vaapi_picture_native_pixmap_ozone.cc b/media/gpu/vaapi/vaapi_picture_native_pixmap_ozone.cc
index 06617ffec8e5a..626dda6312213 100644
--- a/media/gpu/vaapi/vaapi_picture_native_pixmap_ozone.cc
+++ b/media/gpu/vaapi/vaapi_picture_native_pixmap_ozone.cc
@@ -4,6 +4,7 @@
#include "media/gpu/vaapi/vaapi_picture_native_pixmap_ozone.h"
+#include "gpu/command_buffer/service/shared_image/gl_image_native_pixmap.h"
#include "media/base/format_utils.h"
#include "media/gpu/buffer_validation.h"
#include "media/gpu/chromeos/platform_video_frame_utils.h"
@@ -15,7 +16,6 @@
#include "ui/gfx/linux/native_pixmap_dmabuf.h"
#include "ui/gfx/native_pixmap.h"
#include "ui/gl/gl_bindings.h"
-#include "ui/gl/gl_image_native_pixmap.h"
#include "ui/gl/scoped_binders.h"
#include "ui/ozone/public/ozone_platform.h"
#include "ui/ozone/public/surface_factory_ozone.h"
@@ -87,7 +87,7 @@ VaapiStatus VaapiPictureNativePixmapOzone::Initialize(
const gfx::BufferFormat format = pixmap->GetBufferFormat();
// TODO(b/220336463): plumb the right color space.
- auto image = gl::GLImageNativePixmap::Create(
+ auto image = gpu::GLImageNativePixmap::Create(
visible_size_, format, std::move(pixmap),
base::strict_cast<GLenum>(texture_target_),
base::strict_cast<GLuint>(texture_id_));
diff --git a/media/gpu/vaapi/vaapi_picture_native_pixmap_ozone.h b/media/gpu/vaapi/vaapi_picture_native_pixmap_ozone.h
index 101728f36c1e1..eaced9a8ccadf 100644
--- a/media/gpu/vaapi/vaapi_picture_native_pixmap_ozone.h
+++ b/media/gpu/vaapi/vaapi_picture_native_pixmap_ozone.h
@@ -17,7 +17,7 @@ namespace gfx {
class NativePixmap;
} // namespace gfx
-namespace gl {
+namespace gpu {
class GLImageNativePixmap;
}
@@ -55,7 +55,7 @@ class VaapiPictureNativePixmapOzone : public VaapiPictureNativePixmap {
VaapiStatus Initialize(scoped_refptr<gfx::NativePixmap> pixmap);
// GLImage bound to the GL textures used by the VDA client.
- scoped_refptr<gl::GLImageNativePixmap> gl_image_;
+ scoped_refptr<gpu::GLImageNativePixmap> gl_image_;
};
} // namespace media
diff --git a/ui/gfx/linux/native_pixmap_dmabuf.h b/ui/gfx/linux/native_pixmap_dmabuf.h
index 7f134110417ea..f12d4f5eac89d 100644
--- a/ui/gfx/linux/native_pixmap_dmabuf.h
+++ b/ui/gfx/linux/native_pixmap_dmabuf.h
@@ -17,7 +17,7 @@
namespace gfx {
// This class converts a gfx::NativePixmapHandle to a gfx::NativePixmap.
-// It is useful because gl::GLImageNativePixmap::Initialize only takes
+// It is useful because gpu::GLImageNativePixmap::Initialize only takes
// a gfx::NativePixmap as input.
class GFX_EXPORT NativePixmapDmaBuf : public gfx::NativePixmap {
public:
diff --git a/ui/gl/BUILD.gn b/ui/gl/BUILD.gn
index cc23c0a8b4c64..2a07859c4dad8 100644
--- a/ui/gl/BUILD.gn
+++ b/ui/gl/BUILD.gn
@@ -226,8 +226,6 @@ component("gl") {
if (is_linux || is_chromeos || use_ozone) {
sources += [
- "gl_image_native_pixmap.cc",
- "gl_image_native_pixmap.h",
"native_pixmap_egl_binding_helper.cc",
"native_pixmap_egl_binding_helper.h",
]
diff --git a/ui/ozone/common/native_pixmap_egl_binding.cc b/ui/ozone/common/native_pixmap_egl_binding.cc
index 8dce01a41281e..2e18e73eb6cbb 100644
--- a/ui/ozone/common/native_pixmap_egl_binding.cc
+++ b/ui/ozone/common/native_pixmap_egl_binding.cc
@@ -8,7 +8,7 @@
#include "base/memory/scoped_refptr.h"
#include "base/notreached.h"
#include "ui/gl/gl_bindings.h"
-#include "ui/gl/gl_image_native_pixmap.h"
+#include "ui/gl/native_pixmap_egl_binding_helper.h"
namespace ui {
@@ -50,9 +50,9 @@ unsigned BufferFormatToGLDataType(gfx::BufferFormat format) {
} // namespace
NativePixmapEGLBinding::NativePixmapEGLBinding(
- scoped_refptr<gl::GLImageNativePixmap> gl_image,
+ std::unique_ptr<gl::NativePixmapEGLBindingHelper> binding_helper,
gfx::BufferFormat format)
- : gl_image_(std::move(gl_image)), format_(format) {}
+ : binding_helper_(std::move(binding_helper)), format_(format) {}
NativePixmapEGLBinding::~NativePixmapEGLBinding() = default;
// static
@@ -64,22 +64,22 @@ std::unique_ptr<NativePixmapGLBinding> NativePixmapEGLBinding::Create(
const gfx::ColorSpace& color_space,
GLenum target,
GLuint texture_id) {
- auto gl_image = gl::GLImageNativePixmap::CreateForPlane(
+ auto binding_helper = gl::NativePixmapEGLBindingHelper::CreateForPlane(
plane_size, plane_format, plane, std::move(pixmap), color_space, target,
texture_id);
- if (!gl_image) {
- LOG(ERROR) << "Unable to initialize GL image from pixmap";
+ if (!binding_helper) {
+ LOG(ERROR) << "Unable to initialize binding from pixmap";
return nullptr;
}
- auto binding = std::make_unique<NativePixmapEGLBinding>(std::move(gl_image),
- plane_format);
+ auto binding = std::make_unique<NativePixmapEGLBinding>(
+ std::move(binding_helper), plane_format);
return binding;
}
GLuint NativePixmapEGLBinding::GetInternalFormat() {
- return gl_image_->GetInternalFormat();
+ return binding_helper_->GetInternalFormat();
}
GLenum NativePixmapEGLBinding::GetDataType() {
diff --git a/ui/ozone/common/native_pixmap_egl_binding.h b/ui/ozone/common/native_pixmap_egl_binding.h
index 44d68be3527a4..c0382b1068426 100644
--- a/ui/ozone/common/native_pixmap_egl_binding.h
+++ b/ui/ozone/common/native_pixmap_egl_binding.h
@@ -15,16 +15,17 @@ class ColorSpace;
}
namespace gl {
-class GLImageNativePixmap;
+class NativePixmapEGLBindingHelper;
}
namespace ui {
-// A binding maintained between GLImageNativePixmap and GL Textures in Ozone.
+// A binding maintained between NativePixmap and GL Textures in Ozone.
class NativePixmapEGLBinding : public NativePixmapGLBinding {
public:
- NativePixmapEGLBinding(scoped_refptr<gl::GLImageNativePixmap> gl_image,
- gfx::BufferFormat format);
+ NativePixmapEGLBinding(
+ std::unique_ptr<gl::NativePixmapEGLBindingHelper> binding_helper,
+ gfx::BufferFormat format);
~NativePixmapEGLBinding() override;
static std::unique_ptr<NativePixmapGLBinding> Create(
@@ -41,10 +42,7 @@ class NativePixmapEGLBinding : public NativePixmapGLBinding {
GLenum GetDataType() override;
private:
- // TODO(hitawala): Merge BindTexImage, Initialize from GLImage and its
- // subclass NativePixmap to NativePixmapEGLBinding once we stop using them
- // elsewhere eg. VDA decoders in media.
- scoped_refptr<gl::GLImageNativePixmap> gl_image_;
+ std::unique_ptr<gl::NativePixmapEGLBindingHelper> binding_helper_;
gfx::BufferFormat format_;
};
diff --git a/ui/ozone/gl/BUILD.gn b/ui/ozone/gl/BUILD.gn
index 4fc90f0471362..6064eb6f83a8c 100644
--- a/ui/ozone/gl/BUILD.gn
+++ b/ui/ozone/gl/BUILD.gn
@@ -9,6 +9,14 @@ test("ozone_gl_unittests") {
deps = [
"//base/test:test_support",
+
+ # NOTE: The above tests of gpu::GLImageNativePixmap cannot easily be made
+ # to run as part of //gpu's gl_tests or gpu_unittests: they crash when run
+ # with the former due to differences in GL configuration, and they are
+ # skipped when run with the latter due to differences in Ozone
+ # configuration. Simply leave them here with this dependency for the short
+ # time remaining until GLImageNativePixmap is eliminated altogether.
+ "//gpu/command_buffer/service:gles2",
"//testing/gtest",
"//ui/gfx",
"//ui/gl:run_all_unittests",
diff --git a/ui/ozone/gl/DEPS b/ui/ozone/gl/DEPS
new file mode 100644
index 0000000000000..e6142e85d2154
--- /dev/null
+++ b/ui/ozone/gl/DEPS
@@ -0,0 +1,6 @@
+specific_include_rules = {
+ # NOTE: See comment in ./BUILD.gn with respect to this dependency.
+ "gl_image_ozone_native_pixmap_unittest\.cc": [
+ "+gpu/command_buffer/service/shared_image/gl_image_native_pixmap.h",
+ ],
+}
diff --git a/ui/ozone/gl/gl_image_ozone_native_pixmap_unittest.cc b/ui/ozone/gl/gl_image_ozone_native_pixmap_unittest.cc
index 9a538903c8ff0..1527df91a3238 100644
--- a/ui/ozone/gl/gl_image_ozone_native_pixmap_unittest.cc
+++ b/ui/ozone/gl/gl_image_ozone_native_pixmap_unittest.cc
@@ -5,10 +5,10 @@
#include <stdint.h>
#include <memory>
+#include "gpu/command_buffer/service/shared_image/gl_image_native_pixmap.h"
#include "testing/gtest/include/gtest/gtest.h"
#include "ui/gfx/buffer_types.h"
#include "ui/gfx/client_native_pixmap.h"
-#include "ui/gl/gl_image_native_pixmap.h"
#include "ui/gl/test/gl_image_test_template.h"
#include "ui/ozone/public/client_native_pixmap_factory_ozone.h"
#include "ui/ozone/public/ozone_platform.h"
@@ -83,7 +83,7 @@ class GLImageNativePixmapTestDelegate : public GLImageTestDelegateBase {
glGenTextures(1, &texture_id_);
}
- auto image = gl::GLImageNativePixmap::Create(
+ auto image = gpu::GLImageNativePixmap::Create(
size, format, std::move(pixmap), GetTextureTarget(), texture_id_);
EXPECT_TRUE(image);
return image;
@@ -100,8 +100,9 @@ class GLImageNativePixmapTestDelegate : public GLImageTestDelegateBase {
format == gfx::BufferFormat::YUV_420_BIPLANAR) {
return 1;
}
- if (format == gfx::BufferFormat::P010)
+ if (format == gfx::BufferFormat::P010) {
return 3;
+ }
return 0;
}

@ -1,79 +0,0 @@
diff -up chromium-112.0.5615.20/chrome/common/safe_browsing/BUILD.gn.nounrar chromium-112.0.5615.20/chrome/common/safe_browsing/BUILD.gn
--- chromium-112.0.5615.20/chrome/common/safe_browsing/BUILD.gn.nounrar 2023-03-08 23:00:09.000000000 +0100
+++ chromium-112.0.5615.20/chrome/common/safe_browsing/BUILD.gn 2023-03-10 16:02:12.970759171 +0100
@@ -58,25 +58,6 @@ if (safe_browsing_mode == 1) {
public_deps = [ "//components/safe_browsing/core/common/proto:csd_proto" ]
}
- source_set("rar_analyzer") {
- sources = [
- "rar_analyzer.cc",
- "rar_analyzer.h",
- ]
-
- deps = [
- ":archive_analyzer_results",
- ":download_type_util",
- "//base",
- "//base:i18n",
- "//components/safe_browsing/content/common:file_type_policies",
- "//components/safe_browsing/core/common",
- "//third_party/unrar:unrar",
- ]
-
- public_deps = [ "//components/safe_browsing/core/common/proto:csd_proto" ]
- }
-
if (is_linux || is_win) {
source_set("document_analyzer") {
sources = [
@@ -172,7 +153,6 @@ source_set("safe_browsing") {
":archive_analyzer_results",
":binary_feature_extractor",
":download_type_util",
- ":rar_analyzer",
"//components/safe_browsing/core/common",
"//third_party/lzma_sdk/google:seven_zip_reader",
]
diff -up chromium-112.0.5615.20/chrome/common/safe_browsing/DEPS.nounrar chromium-112.0.5615.20/chrome/common/safe_browsing/DEPS
--- chromium-112.0.5615.20/chrome/common/safe_browsing/DEPS.nounrar 2023-03-08 23:00:09.000000000 +0100
+++ chromium-112.0.5615.20/chrome/common/safe_browsing/DEPS 2023-03-10 13:20:06.558188423 +0100
@@ -3,7 +3,6 @@ include_rules = [
"+components/safe_browsing/core/common",
"+third_party/maldoca",
"+third_party/protobuf",
- "+third_party/unrar",
"+third_party/zlib",
"+third_party/lzma_sdk/google",
]
diff -up chromium-112.0.5615.20/chrome/services/file_util/BUILD.gn.nounrar chromium-112.0.5615.20/chrome/services/file_util/BUILD.gn
--- chromium-112.0.5615.20/chrome/services/file_util/BUILD.gn.nounrar 2023-03-08 23:00:09.000000000 +0100
+++ chromium-112.0.5615.20/chrome/services/file_util/BUILD.gn 2023-03-10 13:20:06.558188423 +0100
@@ -60,7 +60,6 @@ source_set("file_util") {
deps += [
"//chrome/common/safe_browsing",
"//chrome/common/safe_browsing:archive_analyzer_results",
- "//chrome/common/safe_browsing:rar_analyzer",
]
if (is_linux || is_win) {
diff -up chromium-112.0.5615.20/chrome/services/file_util/safe_archive_analyzer.cc.nounrar chromium-112.0.5615.20/chrome/services/file_util/safe_archive_analyzer.cc
--- chromium-112.0.5615.20/chrome/services/file_util/safe_archive_analyzer.cc.nounrar 2023-03-08 23:00:09.000000000 +0100
+++ chromium-112.0.5615.20/chrome/services/file_util/safe_archive_analyzer.cc 2023-03-10 13:20:06.558188423 +0100
@@ -45,12 +45,16 @@ void SafeArchiveAnalyzer::AnalyzeDmgFile
void SafeArchiveAnalyzer::AnalyzeRarFile(base::File rar_file,
base::File temporary_file,
AnalyzeRarFileCallback callback) {
+#if 0
DCHECK(rar_file.IsValid());
safe_browsing::ArchiveAnalyzerResults results;
safe_browsing::rar_analyzer::AnalyzeRarFile(
std::move(rar_file), std::move(temporary_file), &results);
std::move(callback).Run(results);
+#else
+ NOTREACHED();
+#endif
}
void SafeArchiveAnalyzer::AnalyzeSevenZipFile(

@ -1,625 +0,0 @@
diff -up chromium-112.0.5615.49/media/gpu/args.gni.wayland-vaapi chromium-112.0.5615.49/media/gpu/args.gni
--- chromium-112.0.5615.49/media/gpu/args.gni.wayland-vaapi 2023-03-30 02:33:53.000000000 +0200
+++ chromium-112.0.5615.49/media/gpu/args.gni 2023-04-14 21:29:41.776328044 +0200
@@ -6,10 +6,14 @@ import("//build/config/chromeos/ui_mode.
import("//build/config/ozone.gni")
declare_args() {
- # Indicates if X11 VA-API-based hardware acceleration is to be used.
- # See also the comment near the |use_vaapi| arg.
- use_vaapi_x11 = is_linux && ozone_platform_x11 &&
- (target_cpu == "x86" || target_cpu == "x64") && !is_castos
+ # Build Chrome support for using VA-API over X11. Note that setting this to true is
+ # not a guarantee that Chrome will use (or even try to use) VA-API over X11. In
+ # particular, it is possible to build Chrome with support for VA-API over X11 but
+ # pick Wayland as the Ozone backend at runtime. In this case, Chrome will try to
+ # use VA-API over DRM.
+ support_vaapi_over_x11 =
+ is_linux && ozone_platform_x11 &&
+ (target_cpu == "x86" || target_cpu == "x64") && !is_castos
}
declare_args() {
@@ -29,8 +33,9 @@ declare_args() {
# is typically the case on x86-based ChromeOS devices.
# VA-API should also be compiled by default on x11-using linux devices
# using x86/x64.
- use_vaapi = use_vaapi_x11 || (is_chromeos_lacros &&
- (target_cpu == "x86" || target_cpu == "x64"))
+ use_vaapi =
+ support_vaapi_over_x11 ||
+ (is_chromeos_lacros && (target_cpu == "x86" || target_cpu == "x64"))
# Indicates if ChromeOS protected media support exists. This is used
# to enable the CDM daemon in Chrome OS as well as support for
diff -up chromium-112.0.5615.49/media/gpu/BUILD.gn.wayland-vaapi chromium-112.0.5615.49/media/gpu/BUILD.gn
--- chromium-112.0.5615.49/media/gpu/BUILD.gn.wayland-vaapi 2023-03-30 02:33:53.000000000 +0200
+++ chromium-112.0.5615.49/media/gpu/BUILD.gn 2023-04-14 21:29:41.776328044 +0200
@@ -20,7 +20,7 @@ buildflag_header("buildflags") {
"USE_VAAPI_IMAGE_CODECS=$use_vaapi_image_codecs",
"USE_V4L2_CODEC=$use_v4l2_codec",
"USE_LIBV4L2=$use_v4lplugin",
- "USE_VAAPI_X11=$use_vaapi_x11",
+ "SUPPORT_VAAPI_OVER_X11=$support_vaapi_over_x11",
]
}
diff -up chromium-112.0.5615.49/media/gpu/vaapi/BUILD.gn.wayland-vaapi chromium-112.0.5615.49/media/gpu/vaapi/BUILD.gn
--- chromium-112.0.5615.49/media/gpu/vaapi/BUILD.gn.wayland-vaapi 2023-03-30 02:33:53.000000000 +0200
+++ chromium-112.0.5615.49/media/gpu/vaapi/BUILD.gn 2023-04-14 21:29:41.776328044 +0200
@@ -17,7 +17,7 @@ assert(use_vaapi)
generate_stubs("libva_stubs") {
extra_header = "va_stub_header.fragment"
sigs = [ "va.sigs" ]
- if (use_vaapi_x11) {
+ if (support_vaapi_over_x11) {
sigs += [ "va_x11.sigs" ]
}
if (is_chromeos_ash) {
@@ -139,7 +139,7 @@ source_set("vaapi") {
]
}
- if (use_vaapi_x11) {
+ if (support_vaapi_over_x11) {
deps += [ "//ui/gfx/x" ]
sources += [
"vaapi_picture_native_pixmap_angle.cc",
@@ -213,7 +213,7 @@ source_set("common") {
deps += [ "//ui/ozone" ]
}
- if (use_vaapi_x11) {
+ if (support_vaapi_over_x11) {
deps += [ "//ui/gfx/x" ]
}
diff -up chromium-112.0.5615.49/media/gpu/vaapi/vaapi_picture_factory.cc.wayland-vaapi chromium-112.0.5615.49/media/gpu/vaapi/vaapi_picture_factory.cc
--- chromium-112.0.5615.49/media/gpu/vaapi/vaapi_picture_factory.cc.wayland-vaapi 2023-03-30 02:33:53.000000000 +0200
+++ chromium-112.0.5615.49/media/gpu/vaapi/vaapi_picture_factory.cc 2023-04-15 07:14:05.573796794 +0200
@@ -13,9 +13,9 @@
#if BUILDFLAG(IS_OZONE)
#include "media/gpu/vaapi/vaapi_picture_native_pixmap_ozone.h"
#endif // BUILDFLAG(IS_OZONE)
-#if BUILDFLAG(USE_VAAPI_X11)
+#if BUILDFLAG(SUPPORT_VAAPI_OVER_X11)
#include "media/gpu/vaapi/vaapi_picture_native_pixmap_angle.h"
-#endif // BUILDFLAG(USE_VAAPI_X11)
+#endif // BUILDFLAG(SUPPORT_VAAPI_OVER_X11)
#if defined(USE_EGL)
#include "media/gpu/vaapi/vaapi_picture_native_pixmap_egl.h"
#endif
@@ -41,19 +41,28 @@ std::unique_ptr<VaapiPicture> CreateVaap
} // namespace
+#if BUILDFLAG(SUPPORT_VAAPI_OVER_X11)
+VaapiPictureFactory::VaapiPictureFactory(
+ absl::optional<bool> may_use_vaapi_over_x11)
+ : may_use_vaapi_over_x11_(may_use_vaapi_over_x11) {
+#else
VaapiPictureFactory::VaapiPictureFactory() {
+#endif // BUILDFLAG(SUPPORT_VAAPI_OVER_X11)
vaapi_impl_pairs_.insert(
std::make_pair(gl::kGLImplementationEGLGLES2,
VaapiPictureFactory::kVaapiImplementationDrm));
-#if BUILDFLAG(USE_VAAPI_X11)
- vaapi_impl_pairs_.insert(
- std::make_pair(gl::kGLImplementationEGLANGLE,
- VaapiPictureFactory::kVaapiImplementationAngle));
-#elif BUILDFLAG(IS_OZONE)
+#if BUILDFLAG(SUPPORT_VAAPI_OVER_X11)
+ CHECK(may_use_vaapi_over_x11_.has_value());
+ if (may_use_vaapi_over_x11_.value()) {
+ vaapi_impl_pairs_.insert(
+ std::make_pair(gl::kGLImplementationEGLANGLE,
+ VaapiPictureFactory::kVaapiImplementationAngle));
+ }
+#else
vaapi_impl_pairs_.insert(
std::make_pair(gl::kGLImplementationEGLANGLE,
VaapiPictureFactory::kVaapiImplementationDrm));
-#endif
+#endif // BUILDFLAG(SUPPORT_VAAPI_OVER_X11)
DeterminePictureCreationAndDownloadingMechanism();
}
@@ -93,19 +102,19 @@ VaapiPictureFactory::GetVaapiImplementat
}
uint32_t VaapiPictureFactory::GetGLTextureTarget() {
-#if BUILDFLAG(USE_VAAPI_X11)
- return GL_TEXTURE_2D;
-#else
+#if BUILDFLAG(IS_CHROMEOS)
return GL_TEXTURE_EXTERNAL_OES;
-#endif
+#else
+ return GL_TEXTURE_2D;
+#endif // BUILDFLAG(IS_CHROMEOS)
}
gfx::BufferFormat VaapiPictureFactory::GetBufferFormat() {
-#if BUILDFLAG(USE_VAAPI_X11)
- return gfx::BufferFormat::RGBX_8888;
-#else
+#if BUILDFLAG(IS_CHROMEOS)
return gfx::BufferFormat::YUV_420_BIPLANAR;
-#endif
+#else
+ return gfx::BufferFormat::RGBX_8888;
+#endif // BUILDFLAG(IS_CHROMEOS)
}
void VaapiPictureFactory::DeterminePictureCreationAndDownloadingMechanism() {
@@ -113,19 +122,23 @@ void VaapiPictureFactory::DeterminePictu
#if BUILDFLAG(IS_OZONE)
// We can be called without GL initialized, which is valid if we use Ozone.
case kVaapiImplementationNone:
+#if BUILDFLAG(SUPPORT_VAAPI_OVER_X11)
+ DCHECK(may_use_vaapi_over_x11_.value_or(false));
+#endif
create_picture_cb_ = base::BindRepeating(
&CreateVaapiPictureNativeImpl<VaapiPictureNativePixmapOzone>);
needs_vpp_for_downloading_ = true;
break;
#endif // BUILDFLAG(IS_OZONE)
-#if BUILDFLAG(USE_VAAPI_X11)
+#if BUILDFLAG(SUPPORT_VAAPI_OVER_X11)
case kVaapiImplementationAngle:
+ DCHECK(may_use_vaapi_over_x11_.value_or(false));
create_picture_cb_ = base::BindRepeating(
&CreateVaapiPictureNativeImpl<VaapiPictureNativePixmapAngle>);
// Neither VaapiTFPPicture or VaapiPictureNativePixmapAngle needs the VPP.
needs_vpp_for_downloading_ = false;
break;
-#endif // BUILDFLAG(USE_VAAPI_X11)
+#endif // BUILDFLAG(SUPPORT_VAAPI_OVER_X11)
case kVaapiImplementationDrm:
#if BUILDFLAG(IS_OZONE)
create_picture_cb_ = base::BindRepeating(
diff -up chromium-112.0.5615.49/media/gpu/vaapi/vaapi_picture_factory.h.wayland-vaapi chromium-112.0.5615.49/media/gpu/vaapi/vaapi_picture_factory.h
--- chromium-112.0.5615.49/media/gpu/vaapi/vaapi_picture_factory.h.wayland-vaapi 2023-03-30 02:33:53.000000000 +0200
+++ chromium-112.0.5615.49/media/gpu/vaapi/vaapi_picture_factory.h 2023-04-14 21:29:41.777328062 +0200
@@ -35,7 +35,11 @@ class MEDIA_GPU_EXPORT VaapiPictureFacto
kVaapiImplementationAngle,
};
+#if BUILDFLAG(SUPPORT_VAAPI_OVER_X11)
+ explicit VaapiPictureFactory(absl::optional<bool> may_use_vaapi_over_x11);
+#else
VaapiPictureFactory();
+#endif // BUILDFLAG(SUPPORT_VAAPI_OVER_X11)
VaapiPictureFactory(const VaapiPictureFactory&) = delete;
VaapiPictureFactory& operator=(const VaapiPictureFactory&) = delete;
@@ -84,6 +88,11 @@ class MEDIA_GPU_EXPORT VaapiPictureFacto
CreatePictureCB create_picture_cb_;
bool needs_vpp_for_downloading_ = false;
+
+#if BUILDFLAG(SUPPORT_VAAPI_OVER_X11)
+ // See comment in `VaapiWrapper::MayUseVaapiOverX11()`.
+ absl::optional<bool> may_use_vaapi_over_x11_;
+#endif // BUILDFLAG(SUPPORT_VAAPI_OVER_X11)
};
} // namespace media
diff -up chromium-112.0.5615.49/media/gpu/vaapi/vaapi_picture_native_pixmap_ozone.cc.wayland-vaapi chromium-112.0.5615.49/media/gpu/vaapi/vaapi_picture_native_pixmap_ozone.cc
--- chromium-112.0.5615.49/media/gpu/vaapi/vaapi_picture_native_pixmap_ozone.cc.wayland-vaapi 2023-03-30 02:33:53.000000000 +0200
+++ chromium-112.0.5615.49/media/gpu/vaapi/vaapi_picture_native_pixmap_ozone.cc 2023-04-14 21:29:41.777328062 +0200
@@ -113,7 +113,7 @@ VaapiStatus VaapiPictureNativePixmapOzon
ui::OzonePlatform* platform = ui::OzonePlatform::GetInstance();
ui::SurfaceFactoryOzone* factory = platform->GetSurfaceFactoryOzone();
gfx::BufferUsage buffer_usage = gfx::BufferUsage::SCANOUT_VDA_WRITE;
-#if BUILDFLAG(USE_VAAPI_X11)
+#if BUILDFLAG(SUPPORT_VAAPI_OVER_X11)
// The 'VaapiVideoDecodeAccelerator' requires the VPP to download the decoded
// frame from the internal surface to the allocated native pixmap.
// 'SCANOUT_VDA_WRITE' is used for 'YUV_420_BIPLANAR' on ChromeOS; For Linux,
diff -up chromium-112.0.5615.49/media/gpu/vaapi/vaapi_video_decode_accelerator.cc.wayland-vaapi chromium-112.0.5615.49/media/gpu/vaapi/vaapi_video_decode_accelerator.cc
--- chromium-112.0.5615.49/media/gpu/vaapi/vaapi_video_decode_accelerator.cc.wayland-vaapi 2023-04-14 21:29:41.775328024 +0200
+++ chromium-112.0.5615.49/media/gpu/vaapi/vaapi_video_decode_accelerator.cc 2023-04-14 21:29:41.777328062 +0200
@@ -185,7 +185,12 @@ bool VaapiVideoDecodeAccelerator::Initia
Client* client) {
DCHECK(task_runner_->BelongsToCurrentThread());
+#if BUILDFLAG(SUPPORT_VAAPI_OVER_X11)
+ vaapi_picture_factory_ =
+ std::make_unique<VaapiPictureFactory>(VaapiWrapper::MayUseVaapiOverX11());
+#else
vaapi_picture_factory_ = std::make_unique<VaapiPictureFactory>();
+#endif // BUILDFLAG(SUPPORT_VAAPI_OVER_X11)
if (config.is_encrypted()) {
NOTREACHED() << "Encrypted streams are not supported for this VDA";
@@ -1211,7 +1216,7 @@ VaapiVideoDecodeAccelerator::GetSupporte
VaapiVideoDecodeAccelerator::BufferAllocationMode
VaapiVideoDecodeAccelerator::DecideBufferAllocationMode() {
-#if BUILDFLAG(USE_VAAPI_X11)
+#if BUILDFLAG(SUPPORT_VAAPI_OVER_X11)
// The IMPORT mode is used for Android on Chrome OS, so this doesn't apply
// here.
DCHECK_NE(output_mode_, VideoDecodeAccelerator::Config::OutputMode::IMPORT);
diff -up chromium-112.0.5615.49/media/gpu/vaapi/vaapi_video_decode_accelerator_unittest.cc.wayland-vaapi chromium-112.0.5615.49/media/gpu/vaapi/vaapi_video_decode_accelerator_unittest.cc
--- chromium-112.0.5615.49/media/gpu/vaapi/vaapi_video_decode_accelerator_unittest.cc.wayland-vaapi 2023-03-30 02:33:53.000000000 +0200
+++ chromium-112.0.5615.49/media/gpu/vaapi/vaapi_video_decode_accelerator_unittest.cc 2023-04-15 07:38:19.058957112 +0200
@@ -41,6 +41,11 @@ struct TestParams {
bool decode_using_client_picture_buffers;
};
+#if BUILDFLAG(SUPPORT_VAAPI_OVER_X11)
+// TODO: Add it in TestParams to cover Ozone/Wayland.
+bool kMayUseVaapiOverX11 = true;
+#endif // BUILDFLAG(SUPPORT_VAAPI_OVER_X11)
+
constexpr int32_t kBitstreamId = 123;
constexpr size_t kInputSize = 256;
@@ -134,7 +139,13 @@ class MockVaapiPicture : public VaapiPic
class MockVaapiPictureFactory : public VaapiPictureFactory {
public:
+#if BUILDFLAG(SUPPORT_VAAPI_OVER_X11)
+ explicit MockVaapiPictureFactory(absl::optional<bool> may_use_vaapi_over_x11)
+ : VaapiPictureFactory(may_use_vaapi_over_x11) {}
+#else
MockVaapiPictureFactory() = default;
+#endif // BUILDFLAG(SUPPORT_VAAPI_OVER_X11)
+
~MockVaapiPictureFactory() override = default;
MOCK_METHOD3(MockCreateVaapiPicture,
@@ -167,7 +178,12 @@ class VaapiVideoDecodeAcceleratorTest :
const scoped_refptr<gl::GLImage>& image) { return true; })),
decoder_thread_("VaapiVideoDecodeAcceleratorTestThread"),
mock_decoder_(new ::testing::StrictMock<MockAcceleratedVideoDecoder>),
+#if BUILDFLAG(SUPPORT_VAAPI_OVER_X11)
+ mock_vaapi_picture_factory_(
+ new MockVaapiPictureFactory(kMayUseVaapiOverX11)),
+#else
mock_vaapi_picture_factory_(new MockVaapiPictureFactory()),
+#endif // BUILDFLAG(SUPPORT_VAAPI_OVER_X11)
mock_vaapi_wrapper_(new MockVaapiWrapper(VaapiWrapper::kDecode)),
mock_vpp_vaapi_wrapper_(new MockVaapiWrapper(VaapiWrapper::kDecode)),
weak_ptr_factory_(this) {
@@ -422,11 +438,13 @@ TEST_P(VaapiVideoDecodeAcceleratorTest,
mock_vaapi_picture_factory_->GetVaapiImplementation(
gl::kGLImplementationEGLGLES2));
-#if BUILDFLAG(USE_VAAPI_X11)
- EXPECT_EQ(VaapiPictureFactory::kVaapiImplementationAngle,
- mock_vaapi_picture_factory_->GetVaapiImplementation(
- gl::kGLImplementationEGLANGLE));
-#elif BUILDFLAG(IS_OZONE)
+#if BUILDFLAG(SUPPORT_VAAPI_OVER_X11)
+ if (kMayUseVaapiOverX11) {
+ EXPECT_EQ(VaapiPictureFactory::kVaapiImplementationAngle,
+ mock_vaapi_picture_factory_->GetVaapiImplementation(
+ gl::kGLImplementationEGLANGLE));
+ }
+#else
EXPECT_EQ(VaapiPictureFactory::kVaapiImplementationDrm,
mock_vaapi_picture_factory_->GetVaapiImplementation(
gl::kGLImplementationEGLANGLE));
diff -up chromium-112.0.5615.49/media/gpu/vaapi/vaapi_wrapper.cc.wayland-vaapi chromium-112.0.5615.49/media/gpu/vaapi/vaapi_wrapper.cc
--- chromium-112.0.5615.49/media/gpu/vaapi/vaapi_wrapper.cc.wayland-vaapi 2023-03-30 02:33:53.000000000 +0200
+++ chromium-112.0.5615.49/media/gpu/vaapi/vaapi_wrapper.cc 2023-04-14 21:29:41.777328062 +0200
@@ -62,7 +62,7 @@
#include "ui/gl/gl_bindings.h"
#include "ui/gl/gl_implementation.h"
-#if BUILDFLAG(USE_VAAPI_X11)
+#if BUILDFLAG(SUPPORT_VAAPI_OVER_X11)
typedef XID Drawable;
extern "C" {
@@ -70,7 +70,7 @@ extern "C" {
}
#include "ui/gfx/x/connection.h" // nogncheck
-#endif // BUILDFLAG(USE_VAAPI_X11)
+#endif // BUILDFLAG(SUPPORT_VAAPI_OVER_X11)
#if BUILDFLAG(IS_OZONE)
#include "ui/ozone/public/ozone_platform.h"
@@ -84,14 +84,14 @@ using media_gpu_vaapi::kModuleVa_prot;
using media_gpu_vaapi::kModuleVa;
using media_gpu_vaapi::kModuleVa_drm;
-#if BUILDFLAG(USE_VAAPI_X11)
+#if BUILDFLAG(SUPPORT_VAAPI_OVER_X11)
using media_gpu_vaapi::kModuleVa_x11;
-#endif // BUILDFLAG(USE_VAAPI_X11)
+#endif // BUILDFLAG(SUPPORT_VAAPI_OVER_X11)
using media_gpu_vaapi::InitializeStubs;
using media_gpu_vaapi::IsVaInitialized;
-#if BUILDFLAG(USE_VAAPI_X11)
+#if BUILDFLAG(SUPPORT_VAAPI_OVER_X11)
using media_gpu_vaapi::IsVa_x11Initialized;
-#endif // BUILDFLAG(USE_VAAPI_X11)
+#endif // BUILDFLAG(SUPPORT_VAAPI_OVER_X11)
using media_gpu_vaapi::IsVa_drmInitialized;
using media_gpu_vaapi::StubPathMap;
@@ -680,6 +680,12 @@ class VADisplayState {
void SetDrmFd(base::PlatformFile fd) { drm_fd_.reset(HANDLE_EINTR(dup(fd))); }
+#if BUILDFLAG(SUPPORT_VAAPI_OVER_X11)
+ absl::optional<bool> MayUseVaapiOverX11() const {
+ return may_use_vaapi_over_x11_;
+ }
+#endif
+
private:
friend class base::NoDestructor<VADisplayState>;
@@ -702,6 +708,13 @@ class VADisplayState {
// Drm fd used to obtain access to the driver interface by VA.
base::ScopedFD drm_fd_;
+#if BUILDFLAG(SUPPORT_VAAPI_OVER_X11)
+ // Whether we'll be possibly using VA-API over Ozone/X11. This should only be
+ // set (if at all) during the pre-sandbox initialization. If absl::nullopt,
+ // all calls to Initialize() will return false immediately.
+ absl::optional<bool> may_use_vaapi_over_x11_;
+#endif
+
// The VADisplay handle. Valid between Initialize() and Deinitialize().
VADisplay va_display_;
@@ -723,6 +736,15 @@ VADisplayState* VADisplayState::Get() {
// static
void VADisplayState::PreSandboxInitialization() {
+#if BUILDFLAG(SUPPORT_VAAPI_OVER_X11)
+ if (ui::OzonePlatform::IsInitialized()) {
+ VADisplayState::Get()->may_use_vaapi_over_x11_ =
+ ui::OzonePlatform::GetInstance()
+ ->GetPlatformProperties()
+ .supports_vaapi_x11;
+ }
+#endif
+
constexpr char kRenderNodeFilePattern[] = "/dev/dri/renderD%d";
// This loop ends on either the first card that does not exist or the first
// render node that is not vgem.
@@ -755,20 +777,18 @@ VADisplayState::VADisplayState()
bool VADisplayState::Initialize() {
base::AutoLock auto_lock(va_lock_);
-#if BUILDFLAG(IS_OZONE) && BUILDFLAG(IS_LINUX)
- // TODO(crbug.com/1116701): add vaapi support for other Ozone platforms on
- // Linux. See comment in OzonePlatform::PlatformProperties::supports_vaapi
- // for more details. This will also require revisiting everything that's
- // guarded by USE_VAAPI_X11. For example, if USE_VAAPI_X11 is true, but the
- // user chooses the Wayland backend for Ozone at runtime, then many things (if
- // not all) that we do for X11 won't apply.
- if (!ui::OzonePlatform::GetInstance()->GetPlatformProperties().supports_vaapi)
+#if BUILDFLAG(SUPPORT_VAAPI_OVER_X11)
+ if (!may_use_vaapi_over_x11_.has_value())
return false;
#endif
bool libraries_initialized = IsVaInitialized() && IsVa_drmInitialized();
-#if BUILDFLAG(USE_VAAPI_X11)
- libraries_initialized = libraries_initialized && IsVa_x11Initialized();
+#if BUILDFLAG(SUPPORT_VAAPI_OVER_X11)
+ // Initialize VA-API X11 display backend for Linux Ozone/X11.
+ // See comment in OzonePlatform::PlatformProperties::supports_vaapi_x11 for
+ // more details.
+ if (may_use_vaapi_over_x11_.value())
+ libraries_initialized = libraries_initialized && IsVa_x11Initialized();
#endif
if (!libraries_initialized)
return false;
@@ -783,7 +803,7 @@ bool VADisplayState::Initialize() {
return success;
}
-#if BUILDFLAG(USE_VAAPI_X11)
+#if BUILDFLAG(SUPPORT_VAAPI_OVER_X11)
absl::optional<VADisplay> GetVADisplayStateX11(const base::ScopedFD& drm_fd) {
switch (gl::GetGLImplementation()) {
@@ -809,13 +829,19 @@ absl::optional<VADisplay> GetVADisplaySt
}
}
-#else
+#endif // BUILDFLAG(SUPPORT_VAAPI_OVER_X11)
absl::optional<VADisplay> GetVADisplayState(const base::ScopedFD& drm_fd) {
switch (gl::GetGLImplementation()) {
case gl::kGLImplementationEGLGLES2:
+#if BUILDFLAG(IS_CHROMEOS)
+ // GetVADisplayState() should not get called on Linux with Ozone/X11
+ // (GetVADisplayStateX11() should get called instead), and we haven't tried
+ // VA-API decoding on Linux with Ozone/Wayland and anything other than
+ // native EGL/GLES2.
case gl::kGLImplementationEGLANGLE:
case gl::kGLImplementationNone:
+#endif
return vaGetDisplayDRM(drm_fd.get());
default:
LOG(WARNING) << "VAAPI video acceleration not available for "
@@ -825,18 +851,23 @@ absl::optional<VADisplay> GetVADisplaySt
}
}
-#endif // BUILDFLAG(USE_VAAPI_X11)
-
bool VADisplayState::InitializeVaDisplay_Locked() {
- absl::optional<VADisplay> display =
-#if BUILDFLAG(USE_VAAPI_X11)
- GetVADisplayStateX11(drm_fd_);
-#else
- GetVADisplayState(drm_fd_);
-#endif
+ absl::optional<VADisplay> display;
- if (!display)
- return false;
+#if BUILDFLAG(SUPPORT_VAAPI_OVER_X11)
+ DCHECK(may_use_vaapi_over_x11_.has_value());
+ if (may_use_vaapi_over_x11_.value()) {
+ display = GetVADisplayStateX11(drm_fd_);
+ if (!display)
+ return false;
+ }
+#endif // BUILDFLAG(SUPPORT_VAAPI_OVER_X11)
+
+ if (!display) {
+ display = GetVADisplayState(drm_fd_);
+ if (!display)
+ return false;
+ }
va_display_ = *display;
if (!vaDisplayIsValid(va_display_)) {
@@ -1671,6 +1702,13 @@ scoped_refptr<VaapiWrapper> VaapiWrapper
enforce_sequence_affinity);
}
+#if BUILDFLAG(SUPPORT_VAAPI_OVER_X11)
+// static
+absl::optional<bool> VaapiWrapper::MayUseVaapiOverX11() {
+ return VADisplayState::Get()->MayUseVaapiOverX11();
+}
+#endif
+
// static
std::vector<SVCScalabilityMode> VaapiWrapper::GetSupportedScalabilityModes(
VideoCodecProfile media_profile,
@@ -2684,12 +2722,13 @@ bool VaapiWrapper::MapAndCopyAndExecute(
return Execute_Locked(va_surface_id, va_buffer_ids);
}
-#if BUILDFLAG(USE_VAAPI_X11)
+#if BUILDFLAG(SUPPORT_VAAPI_OVER_X11)
bool VaapiWrapper::PutSurfaceIntoPixmap(VASurfaceID va_surface_id,
x11::Pixmap x_pixmap,
gfx::Size dest_size) {
CHECK(!enforce_sequence_affinity_ ||
sequence_checker_.CalledOnValidSequence());
+ CHECK(MayUseVaapiOverX11().value_or(false));
base::AutoLockMaybe auto_lock(va_lock_.get());
VAStatus va_res = vaSyncSurface(va_display_, va_surface_id);
@@ -2703,7 +2742,7 @@ bool VaapiWrapper::PutSurfaceIntoPixmap(
VA_SUCCESS_OR_RETURN(va_res, VaapiFunctions::kVAPutSurface, false);
return true;
}
-#endif // BUILDFLAG(USE_VAAPI_X11)
+#endif // BUILDFLAG(SUPPORT_VAAPI_OVER_X11)
std::unique_ptr<ScopedVAImage> VaapiWrapper::CreateVaImage(
VASurfaceID va_surface_id,
@@ -3105,7 +3144,7 @@ void VaapiWrapper::PreSandboxInitializat
paths[kModuleVa].push_back(std::string("libva.so.") + va_suffix);
paths[kModuleVa_drm].push_back(std::string("libva-drm.so.") + va_suffix);
-#if BUILDFLAG(USE_VAAPI_X11)
+#if BUILDFLAG(SUPPORT_VAAPI_OVER_X11)
paths[kModuleVa_x11].push_back(std::string("libva-x11.so.") + va_suffix);
#endif
#if BUILDFLAG(IS_CHROMEOS_ASH)
diff -up chromium-112.0.5615.49/media/gpu/vaapi/vaapi_wrapper.h.wayland-vaapi chromium-112.0.5615.49/media/gpu/vaapi/vaapi_wrapper.h
--- chromium-112.0.5615.49/media/gpu/vaapi/vaapi_wrapper.h.wayland-vaapi 2023-03-30 02:33:53.000000000 +0200
+++ chromium-112.0.5615.49/media/gpu/vaapi/vaapi_wrapper.h 2023-04-14 21:29:41.777328062 +0200
@@ -36,9 +36,9 @@
#include "third_party/abseil-cpp/absl/types/optional.h"
#include "ui/gfx/geometry/size.h"
-#if BUILDFLAG(USE_VAAPI_X11)
+#if BUILDFLAG(SUPPORT_VAAPI_OVER_X11)
#include "ui/gfx/x/xproto.h" // nogncheck
-#endif // BUILDFLAG(USE_VAAPI_X11)
+#endif // BUILDFLAG(SUPPORT_VAAPI_OVER_X11)
namespace gfx {
enum class BufferFormat;
@@ -186,6 +186,16 @@ class MEDIA_GPU_EXPORT VaapiWrapper
VaapiWrapper(const VaapiWrapper&) = delete;
VaapiWrapper& operator=(const VaapiWrapper&) = delete;
+#if BUILDFLAG(SUPPORT_VAAPI_OVER_X11)
+ // Returns true if VaapiWrapper instances may use VA-API over X11 and false
+ // otherwise (VA-API over DRM will be used). If this returns absl::nullopt,
+ // it's because it was not possible to determine how VA-API may be used. This
+ // should only be called after PreSandboxInitialization() (which is assumed to
+ // be called only once during the GPU process startup) and is safe to call
+ // from any thread. Additionally, this should always return the same value.
+ static absl::optional<bool> MayUseVaapiOverX11();
+#endif
+
// Returns the supported SVC scalability modes for specified profile.
static std::vector<SVCScalabilityMode> GetSupportedScalabilityModes(
VideoCodecProfile media_profile,
@@ -439,13 +449,13 @@ class MEDIA_GPU_EXPORT VaapiWrapper
VASurfaceID va_surface_id,
const std::vector<std::pair<VABufferID, VABufferDescriptor>>& va_buffers);
-#if BUILDFLAG(USE_VAAPI_X11)
+#if BUILDFLAG(SUPPORT_VAAPI_OVER_X11)
// Put data from |va_surface_id| into |x_pixmap| of size
// |dest_size|, converting/scaling to it.
[[nodiscard]] bool PutSurfaceIntoPixmap(VASurfaceID va_surface_id,
x11::Pixmap x_pixmap,
gfx::Size dest_size);
-#endif // BUILDFLAG(USE_VAAPI_X11)
+#endif // BUILDFLAG(SUPPORT_VAAPI_OVER_X11)
// Creates a ScopedVAImage from a VASurface |va_surface_id| and map it into
// memory with the given |format| and |size|. If |format| is not equal to the
diff -up chromium-112.0.5615.49/media/gpu/vaapi/va_stub_header.fragment.wayland-vaapi chromium-112.0.5615.49/media/gpu/vaapi/va_stub_header.fragment
--- chromium-112.0.5615.49/media/gpu/vaapi/va_stub_header.fragment.wayland-vaapi 2023-03-30 02:33:53.000000000 +0200
+++ chromium-112.0.5615.49/media/gpu/vaapi/va_stub_header.fragment 2023-04-14 21:29:41.777328062 +0200
@@ -7,8 +7,8 @@ extern "C" {
#include <va/va_drm.h>
#include <va/va.h>
-#if BUILDFLAG(USE_VAAPI_X11)
+#if BUILDFLAG(SUPPORT_VAAPI_OVER_X11)
#include <va/va_x11.h>
-#endif // BUILDFLAG(USE_VAAPI_X11)
+#endif // BUILDFLAG(SUPPORT_VAAPI_OVER_X11)
}
diff -up chromium-112.0.5615.49/ui/ozone/platform/x11/ozone_platform_x11.cc.wayland-vaapi chromium-112.0.5615.49/ui/ozone/platform/x11/ozone_platform_x11.cc
--- chromium-112.0.5615.49/ui/ozone/platform/x11/ozone_platform_x11.cc.wayland-vaapi 2023-03-30 02:34:19.000000000 +0200
+++ chromium-112.0.5615.49/ui/ozone/platform/x11/ozone_platform_x11.cc 2023-04-14 21:29:41.778328082 +0200
@@ -197,7 +197,7 @@ class OzonePlatformX11 : public OzonePla
properties->app_modal_dialogs_use_event_blocker = true;
properties->fetch_buffer_formats_for_gmb_on_gpu = true;
#if BUILDFLAG(IS_LINUX)
- properties->supports_vaapi = true;
+ properties->supports_vaapi_x11 = true;
#endif
initialised = true;
diff -up chromium-112.0.5615.49/ui/ozone/public/ozone_platform.h.wayland-vaapi chromium-112.0.5615.49/ui/ozone/public/ozone_platform.h
--- chromium-112.0.5615.49/ui/ozone/public/ozone_platform.h.wayland-vaapi 2023-03-30 02:34:19.000000000 +0200
+++ chromium-112.0.5615.49/ui/ozone/public/ozone_platform.h 2023-04-14 21:29:41.778328082 +0200
@@ -145,12 +145,13 @@ class COMPONENT_EXPORT(OZONE) OzonePlatf
bool fetch_buffer_formats_for_gmb_on_gpu = false;
#if BUILDFLAG(IS_LINUX)
- // TODO(crbug.com/1116701): add vaapi support for other Ozone platforms on
- // Linux. At the moment, VA-API Linux implementation supports only X11
- // backend. This implementation must be refactored to support Ozone
- // properly. As a temporary solution, VA-API on Linux checks if vaapi is
- // supported (which implicitly means that it is Ozone/X11).
- bool supports_vaapi = false;
+ // VA-API supports different display backends.
+ // See https://github.com/intel/libva/blob/master/va/va_backend.h
+ //
+ // VA/DRM and VA/X11 are used by Chromium at the moment. All Ozone platforms
+ // support VA/DRM by default. `supports_vaapi_x11` indicates if VA/X11
+ // supported; it is true only on Ozone/X11 platform.
+ bool supports_vaapi_x11 = false;
#endif
// Indicates that the platform allows client applications to manipulate

@ -0,0 +1,12 @@
diff -up chromium-113.0.5672.24/chrome/browser/media/router/media_router_feature.cc.disable-GlobalMediaControlsCastStartStop chromium-113.0.5672.24/chrome/browser/media/router/media_router_feature.cc
--- chromium-113.0.5672.24/chrome/browser/media/router/media_router_feature.cc.disable-GlobalMediaControlsCastStartStop 2023-04-07 13:54:52.562292026 +0200
+++ chromium-113.0.5672.24/chrome/browser/media/router/media_router_feature.cc 2023-04-07 13:57:41.470414086 +0200
@@ -68,7 +68,7 @@ BASE_FEATURE(kGlobalMediaControlsCastSta
#else
BASE_FEATURE(kGlobalMediaControlsCastStartStop,
"GlobalMediaControlsCastStartStop",
- base::FEATURE_ENABLED_BY_DEFAULT);
+ base::FEATURE_DISABLED_BY_DEFAULT);
#endif // BUILDFLAG(IS_CHROMEOS)
#endif // BUILDFLAG(IS_ANDROID)

@ -54,17 +54,6 @@ diff -up chromium-109.0.5414.74/net/base/net_export.h.me chromium-109.0.5414.74/
// Defines NET_EXPORT so that functionality implemented by the net module can
// be exported to consumers, and NET_EXPORT_PRIVATE that allows unit tests to
// access features not intended to be used directly by real consumers.
diff -up chromium-109.0.5414.74/net/third_party/quiche/src/quiche/quic/core/quic_connection_id.h.me chromium-109.0.5414.74/net/third_party/quiche/src/quiche/quic/core/quic_connection_id.h
--- chromium-109.0.5414.74/net/third_party/quiche/src/quiche/quic/core/quic_connection_id.h.me 2023-01-17 17:46:30.830283261 +0100
+++ chromium-109.0.5414.74/net/third_party/quiche/src/quiche/quic/core/quic_connection_id.h 2023-01-17 17:46:40.158407274 +0100
@@ -5,6 +5,7 @@
#ifndef QUICHE_QUIC_CORE_QUIC_CONNECTION_ID_H_
#define QUICHE_QUIC_CORE_QUIC_CONNECTION_ID_H_
+#include <cstdint>
#include <string>
#include <vector>
diff -up chromium-109.0.5414.74/sandbox/linux/syscall_broker/broker_file_permission.h.me chromium-109.0.5414.74/sandbox/linux/syscall_broker/broker_file_permission.h
--- chromium-109.0.5414.74/sandbox/linux/syscall_broker/broker_file_permission.h.me 2023-01-17 17:12:34.184686515 +0100
+++ chromium-109.0.5414.74/sandbox/linux/syscall_broker/broker_file_permission.h 2023-01-17 17:13:16.537162420 +0100
@ -386,3 +375,48 @@ diff -up chromium-109.0.5414.74/base/cpu.h.me chromium-109.0.5414.74/base/cpu.h
#include <string>
#include "base/base_export.h"
diff -up chromium-113.0.5672.24/third_party/vulkan-deps/vulkan-validation-layers/src/layers/external/vma/vk_mem_alloc.h.me chromium-113.0.5672.24/third_party/vulkan-deps/vulkan-validation-layers/src/layers/external/vma/vk_mem_alloc.h
--- chromium-113.0.5672.24/third_party/vulkan-deps/vulkan-validation-layers/src/layers/external/vma/vk_mem_alloc.h.me 2023-04-15 16:44:55.344305412 +0200
+++ chromium-113.0.5672.24/third_party/vulkan-deps/vulkan-validation-layers/src/layers/external/vma/vk_mem_alloc.h 2023-04-15 16:47:09.028666995 +0200
@@ -2854,6 +2854,7 @@ static void vma_aligned_free(void* VMA_N
// Define this macro to 1 to enable functions: vmaBuildStatsString, vmaFreeStatsString.
#if VMA_STATS_STRING_ENABLED
+#include <stdio.h>
static inline void VmaUint32ToStr(char* VMA_NOT_NULL outStr, size_t strLen, uint32_t num)
{
snprintf(outStr, strLen, "%u", static_cast<unsigned int>(num));
diff -up chromium-113.0.5672.37/chrome/browser/webauthn/authenticator_request_dialog_model.h.me chromium-113.0.5672.37/chrome/browser/webauthn/authenticator_request_dialog_model.h
--- chromium-113.0.5672.37/chrome/browser/webauthn/authenticator_request_dialog_model.h.me 2023-04-18 15:55:44.774916319 +0200
+++ chromium-113.0.5672.37/chrome/browser/webauthn/authenticator_request_dialog_model.h 2023-04-18 15:55:54.441085882 +0200
@@ -8,6 +8,7 @@
#include <memory>
#include <string>
#include <vector>
+#include <variant>
#include "base/containers/span.h"
#include "base/functional/callback_forward.h"
diff -up chromium-113.0.5672.37/gin/time_clamper.h.me chromium-113.0.5672.37/gin/time_clamper.h
--- chromium-113.0.5672.37/gin/time_clamper.h.me 2023-04-18 16:38:41.180437467 +0200
+++ chromium-113.0.5672.37/gin/time_clamper.h 2023-04-18 16:39:43.857049432 +0200
@@ -48,7 +48,7 @@ class GIN_EXPORT TimeClamper {
const int64_t micros = now_micros % 1000;
// abs() is necessary for devices with times before unix-epoch (most likely
// configured incorrectly).
- if (abs(micros) + kResolutionMicros < 1000) {
+ if (std::abs(micros) + kResolutionMicros < 1000) {
return now_micros / 1000;
}
return ClampTimeResolution(now_micros) / 1000;
diff -up chromium-113.0.5672.53/chrome/test/chromedriver/chrome/web_view_impl.cc.me chromium-113.0.5672.53/chrome/test/chromedriver/chrome/web_view_impl.cc
--- chromium-113.0.5672.53/chrome/test/chromedriver/chrome/web_view_impl.cc.me 2023-04-21 08:07:55.362714544 +0200
+++ chromium-113.0.5672.53/chrome/test/chromedriver/chrome/web_view_impl.cc 2023-04-21 08:14:35.424158693 +0200
@@ -10,6 +10,7 @@
#include <queue>
#include <utility>
#include <vector>
+#include <cstring>
#include "base/check.h"
#include "base/files/file_path.h"

@ -0,0 +1,115 @@
diff -up chromium-113.0.5672.24/chrome/common/safe_browsing/BUILD.gn.nounrar chromium-113.0.5672.24/chrome/common/safe_browsing/BUILD.gn
--- chromium-113.0.5672.24/chrome/common/safe_browsing/BUILD.gn.nounrar 2023-04-07 13:11:59.495927476 +0200
+++ chromium-113.0.5672.24/chrome/common/safe_browsing/BUILD.gn 2023-04-07 13:47:57.004758029 +0200
@@ -143,8 +143,6 @@ source_set("safe_browsing") {
"protobuf_message_log_macros.h",
"protobuf_message_read_macros.h",
"protobuf_message_write_macros.h",
- "rar_analyzer.cc",
- "rar_analyzer.h",
"seven_zip_analyzer.cc",
"seven_zip_analyzer.h",
"zip_analyzer.cc",
@@ -160,7 +158,6 @@ source_set("safe_browsing") {
"//components/safe_browsing/content/common:file_type_policies",
"//components/safe_browsing/core/common",
"//third_party/lzma_sdk/google:seven_zip_reader",
- "//third_party/unrar:unrar",
]
if (is_linux) {
diff -up chromium-113.0.5672.24/chrome/common/safe_browsing/DEPS.nounrar chromium-113.0.5672.24/chrome/common/safe_browsing/DEPS
--- chromium-113.0.5672.24/chrome/common/safe_browsing/DEPS.nounrar 2023-04-04 20:41:26.000000000 +0200
+++ chromium-113.0.5672.24/chrome/common/safe_browsing/DEPS 2023-04-07 13:11:59.495927476 +0200
@@ -3,7 +3,6 @@ include_rules = [
"+components/safe_browsing/core/common",
"+third_party/maldoca",
"+third_party/protobuf",
- "+third_party/unrar",
"+third_party/zlib",
"+third_party/lzma_sdk/google",
]
diff -up chromium-113.0.5672.24/chrome/services/file_util/BUILD.gn.nounrar chromium-113.0.5672.24/chrome/services/file_util/BUILD.gn
diff -up chromium-113.0.5672.24/chrome/services/file_util/safe_archive_analyzer.cc.nounrar chromium-113.0.5672.24/chrome/services/file_util/safe_archive_analyzer.cc
--- chromium-113.0.5672.24/chrome/services/file_util/safe_archive_analyzer.cc.nounrar 2023-04-07 13:11:59.495927476 +0200
+++ chromium-113.0.5672.24/chrome/services/file_util/safe_archive_analyzer.cc 2023-04-07 13:52:52.998109006 +0200
@@ -61,6 +61,7 @@ void SafeArchiveAnalyzer::AnalyzeRarFile
base::File rar_file,
mojo::PendingRemote<chrome::mojom::TemporaryFileGetter> temp_file_getter,
AnalyzeRarFileCallback callback) {
+#if 0
DCHECK(rar_file.IsValid());
temp_file_getter_.Bind(std::move(temp_file_getter));
callback_ = std::move(callback);
@@ -76,6 +77,9 @@ void SafeArchiveAnalyzer::AnalyzeRarFile
rar_analyzer_.Init(std::move(rar_file), base::FilePath(),
std::move(analysis_finished_callback),
std::move(temp_file_getter_callback), &results_);
+#else
+ NOTREACHED();
+#endif
}
void SafeArchiveAnalyzer::AnalyzeSevenZipFile(
diff -up chromium-113.0.5672.53/chrome/common/safe_browsing/zip_analyzer.cc.me chromium-113.0.5672.53/chrome/common/safe_browsing/zip_analyzer.cc
--- chromium-113.0.5672.53/chrome/common/safe_browsing/zip_analyzer.cc.me 2023-04-23 18:10:06.103858362 +0200
+++ chromium-113.0.5672.53/chrome/common/safe_browsing/zip_analyzer.cc 2023-04-23 18:12:05.428092347 +0200
@@ -18,7 +18,7 @@
#include "base/time/time.h"
#include "build/build_config.h"
#include "chrome/common/safe_browsing/archive_analyzer_results.h"
-#include "chrome/common/safe_browsing/rar_analyzer.h"
+//#include "chrome/common/safe_browsing/rar_analyzer.h"
#include "components/safe_browsing/content/common/file_type_policies.h"
#include "components/safe_browsing/core/common/features.h"
#include "components/safe_browsing/core/common/proto/csd.pb.h"
@@ -132,14 +132,14 @@ bool ZipAnalyzer::AnalyzeNestedArchive(
std::move(nested_analysis_finished_callback),
get_temp_file_callback_, results_);
return true;
- } else if (file_type == DownloadFileType::RAR) {
+ } /* else if (file_type == DownloadFileType::RAR) {
nested_rar_analyzer_ = std::make_unique<safe_browsing::RarAnalyzer>();
nested_rar_analyzer_->Init(temp_file_.Duplicate(),
root_zip_path_.Append(path),
std::move(nested_analysis_finished_callback),
get_temp_file_callback_, results_);
return true;
- }
+ }*/
return false;
}
diff -up chromium-113.0.5672.53/chrome/common/safe_browsing/zip_analyzer.h.me chromium-113.0.5672.53/chrome/common/safe_browsing/zip_analyzer.h
--- chromium-113.0.5672.53/chrome/common/safe_browsing/zip_analyzer.h.me 2023-04-23 18:12:11.316203496 +0200
+++ chromium-113.0.5672.53/chrome/common/safe_browsing/zip_analyzer.h 2023-04-23 18:12:26.827498082 +0200
@@ -78,7 +78,7 @@ class ZipAnalyzer {
// DFS.
// TODO(crbug.com/1426164) Create a common class to hold all analyzers.
std::unique_ptr<safe_browsing::ZipAnalyzer> nested_zip_analyzer_;
- std::unique_ptr<safe_browsing::RarAnalyzer> nested_rar_analyzer_;
+// std::unique_ptr<safe_browsing::RarAnalyzer> nested_rar_analyzer_;
base::WeakPtrFactory<ZipAnalyzer> weak_factory_{this};
};
diff -up chromium-113.0.5672.53/chrome/services/file_util/safe_archive_analyzer.h.me chromium-113.0.5672.53/chrome/services/file_util/safe_archive_analyzer.h
--- chromium-113.0.5672.53/chrome/services/file_util/safe_archive_analyzer.h.me 2023-04-23 18:06:26.476791520 +0200
+++ chromium-113.0.5672.53/chrome/services/file_util/safe_archive_analyzer.h 2023-04-23 18:08:58.594606171 +0200
@@ -6,7 +6,7 @@
#define CHROME_SERVICES_FILE_UTIL_SAFE_ARCHIVE_ANALYZER_H_
#include "chrome/common/safe_browsing/archive_analyzer_results.h"
-#include "chrome/common/safe_browsing/rar_analyzer.h"
+//#include "chrome/common/safe_browsing/rar_analyzer.h"
#include "chrome/services/file_util/public/mojom/safe_archive_analyzer.mojom.h"
#include "mojo/public/cpp/bindings/remote.h"
@@ -59,7 +59,7 @@ class SafeArchiveAnalyzer : public chrom
void Timeout();
safe_browsing::ZipAnalyzer zip_analyzer_;
- safe_browsing::RarAnalyzer rar_analyzer_;
+// safe_browsing::RarAnalyzer rar_analyzer_;
// A timer to ensure no archive takes too long to unpack.
base::OneShotTimer timeout_timer_;

@ -1,6 +1,6 @@
diff -up chromium-99.0.4844.51/components/os_crypt/features.gni.disblegnomekeyring chromium-99.0.4844.51/components/os_crypt/features.gni
--- chromium-99.0.4844.51/components/os_crypt/features.gni.disblegnomekeyring 2022-03-05 14:24:15.073877597 -0500
+++ chromium-99.0.4844.51/components/os_crypt/features.gni 2022-03-05 14:25:04.174183483 -0500
diff -up chromium-113.0.5672.24/components/os_crypt/sync/features.gni.disblegnomekeyring chromium-113.0.5672.24/components/os_crypt/sync/features.gni
--- chromium-113.0.5672.24/components/os_crypt/sync/features.gni.disblegnomekeyring 2023-04-07 14:23:11.083985460 +0200
+++ chromium-113.0.5672.24/components/os_crypt/sync/features.gni 2023-04-07 14:23:44.276599353 +0200
@@ -8,7 +8,7 @@ import("//build/config/ui.gni")
declare_args() {
# Whether to use libgnome-keyring (deprecated by libsecret).

@ -1,10 +0,0 @@
diff -upr chromium-71.0.3578.80.orig/third_party/widevine/cdm/widevine_cdm_version.h chromium-71.0.3578.80/third_party/widevine/cdm/widevine_cdm_version.h
--- chromium-71.0.3578.80.orig/third_party/widevine/cdm/widevine_cdm_version.h 2018-12-21 20:18:01.000000000 +0000
+++ chromium-71.0.3578.80/third_party/widevine/cdm/widevine_cdm_version.h 2018-12-21 21:37:45.635374949 +0000
@@ -12,4 +12,6 @@
// - WIDEVINE_CDM_VERSION_STRING (with the version of the CDM that's available
// as a string, e.g., "1.0.123.456").
+#define WIDEVINE_CDM_VERSION_STRING "unknown"
+
#endif // WIDEVINE_CDM_VERSION_H_

@ -1,36 +0,0 @@
diff -up chromium-86.0.4240.75/media/gpu/vaapi/vaapi_video_decode_accelerator.cc.vaapi-intel-fix chromium-86.0.4240.75/media/gpu/vaapi/vaapi_video_decode_accelerator.cc
--- chromium-86.0.4240.75/media/gpu/vaapi/vaapi_video_decode_accelerator.cc.vaapi-intel-fix 2020-10-07 12:38:47.000000000 -0400
+++ chromium-86.0.4240.75/media/gpu/vaapi/vaapi_video_decode_accelerator.cc 2020-10-14 16:20:46.938556042 -0400
@@ -58,6 +58,7 @@ unsigned int GetVaFormatForVideoCodecPro
return VA_RT_FORMAT_YUV420;
}
+#if defined(OS_ANDROID) || defined(OS_CHROMEOS)
// Returns true if the CPU is an Intel Gemini Lake or later (including Kaby
// Lake) Cpu platform id's are referenced from the following file in kernel
// source arch/x86/include/asm/intel-family.h
@@ -70,6 +71,7 @@ bool IsGeminiLakeOrLater() {
cpuid.model() >= kGeminiLakeModelId;
return is_geminilake_or_later;
}
+#endif
} // namespace
@@ -1214,6 +1216,8 @@ VaapiVideoDecodeAccelerator::DecideBuffe
if (output_mode_ == VideoDecodeAccelerator::Config::OutputMode::IMPORT)
return BufferAllocationMode::kNormal;
+#if defined(OS_ANDROID) || defined(OS_CHROMEOS)
+ // Move this to chromeOs only as it is causing problem in some intel linux drivers
// On Gemini Lake, Kaby Lake and later we can pass to libva the client's
// PictureBuffers to decode onto, which skips the use of the Vpp unit and its
// associated format reconciliation copy, avoiding all internal buffer
@@ -1229,6 +1233,7 @@ VaapiVideoDecodeAccelerator::DecideBuffe
num_extra_pics_ = 3;
return BufferAllocationMode::kNone;
}
+#endif
// For H.264 on older devices, another +1 is experimentally needed for
// high-to-high resolution changes.

@ -1,14 +0,0 @@
diff -up chromium-99.0.4844.51/chrome/browser/component_updater/registration.cc.widevine-no-download chromium-99.0.4844.51/chrome/browser/component_updater/registration.cc
--- chromium-99.0.4844.51/chrome/browser/component_updater/registration.cc.widevine-no-download 2022-03-04 14:57:16.459599123 +0000
+++ chromium-99.0.4844.51/chrome/browser/component_updater/registration.cc 2022-03-04 14:58:39.560763939 +0000
@@ -105,10 +105,6 @@ void RegisterComponentsForUpdate() {
RegisterMediaFoundationWidevineCdmComponent(cus);
#endif
-#if BUILDFLAG(ENABLE_WIDEVINE_CDM_COMPONENT)
- RegisterWidevineCdmComponent(cus);
-#endif // BUILDFLAG(ENABLE_WIDEVINE_CDM_COMPONENT)
-
#if BUILDFLAG(ENABLE_NACL) && !BUILDFLAG(IS_ANDROID)
#if BUILDFLAG(IS_CHROMEOS_ASH)
// PNaCl on Chrome OS is on rootfs and there is no need to download it. But

@ -1,5 +1,4 @@
# system wide chromium flags
CHROMIUM_FLAGS=""
CHROMIUM_FLAGS+=" --disable-features=AudioServiceSandbox,UseChromeOSDirectVideoDecoder"
CHROMIUM_FLAGS+=" --enable-features=VaapiVideoDecoder,VaapiVideoEncoder"
CHROMIUM_FLAGS+=" --use-gl=egl"
CHROMIUM_FLAGS+=" --disable-features=AudioServiceSandbox,Vulkan,AllowQt"
CHROMIUM_FLAGS+=" --enable-features=VaapiVideoDecoder,VaapiVideoEncoder,VaapiVideoDecodeLinuxGL"

@ -241,8 +241,8 @@
%endif
Name: chromium%{chromium_channel}
Version: 112.0.5615.165
Release: 2%{?dist}
Version: 113.0.5672.63
Release: 1%{?dist}
Summary: A WebKit (Blink) powered web browser that Google doesn't want you to use
Url: http://www.chromium.org/Home
License: BSD-3-Clause AND LGPL-2.1-or-later AND Apache-2.0 AND IJG AND MIT AND GPL-2.0-or-later AND ISC AND OpenSSL AND (MPL-1.1 OR GPL-2.0-only OR LGPL-2.0-only)
@ -260,18 +260,11 @@ Patch2: chromium-107.0.5304.110-gn-system.patch
Patch5: chromium-77.0.3865.75-no-zlib-mangle.patch
# Do not use unrar code, it is non-free
Patch6: chromium-112-norar.patch
# Use Gentoo's Widevine hack
# https://gitweb.gentoo.org/repo/gentoo.git/tree/www-client/chromium/files/chromium-widevine-r3.patch
Patch7: chromium-71.0.3578.98-widevine-r3.patch
Patch6: chromium-113-norar.patch
# Try to load widevine from other places
Patch8: chromium-108-widevine-other-locations.patch
# Do not download proprietary widevine module in the background (thanks Debian)
Patch9: chromium-99.0.4844.51-widevine-no-download.patch
# Tell bootstrap.py to always use the version of Python we specify
Patch11: chromium-93.0.4577.63-py3-bootstrap.patch
@ -314,7 +307,7 @@ Patch89: chromium-108-system-brotli.patch
# disable GlobalMediaControlsCastStartStop to avoid crash
# when using the address bar media player button
Patch90: chromium-109-disable-GlobalMediaControlsCastStartStop.patch
Patch90: chromium-113-disable-GlobalMediaControlsCastStartStop.patch
# patch for using system opus
Patch91: chromium-108-system-opus.patch
@ -351,12 +344,12 @@ Patch107: chromium-99.0.4844.51-el7-extra-operator==.patch
Patch114: chromium-107-ffmpeg-duration.patch
Patch115: chromium-107-proprietary-codecs.patch
# drop av_stream_get_first_dts from internal ffmpeg
Patch116: chromium-108-ffmpeg-first_dts.patch
Patch116: chromium-112-ffmpeg-first_dts.patch
# revert new-channel-layout-api on f36, old ffmpeg-free
Patch117: chromium-108-ffmpeg-revert-new-channel-layout-api.patch
# gcc13
Patch122: chromium-109-gcc13.patch
Patch122: chromium-113-gcc13.patch
# Patches by Stephan Hartmann, https://github.com/stha09/chromium-patches
Patch130: chromium-103-VirtualCursor-std-layout.patch
@ -364,17 +357,8 @@ Patch130: chromium-103-VirtualCursor-std-layout.patch
# Pagesize > 4kb
Patch146: chromium-110-LargerThan4k.patch
# VAAPI
# Upstream turned VAAPI on in Linux in 86
Patch202: chromium-104.0.5112.101-enable-hardware-accelerated-mjpeg.patch
Patch203: chromium-112-check-passthrough-command-decoder.patch
Patch204: chromium-112-invert_of_GLImageNativePixmap_NativePixmapEGLBinding.patch
Patch205: chromium-86.0.4240.75-fix-vaapi-on-intel.patch
Patch206: chromium-112-ozone-wayland-vaapi-support.patch
Patch207: chromium-112-enable-vaapi-ozone-wayland.patch
# Apply these patches to work around EPEL8 issues
Patch300: chromium-99.0.4844.51-rhel8-force-disable-use_gnome_keyring.patch
Patch300: chromium-113-rhel8-force-disable-use_gnome_keyring.patch
# workaround for bug in clang 14 with c++20 on rhel9, linker errors std::u16string
Patch301: chromium-112-workaround-llvm14-c++20-epel8.patch
@ -896,9 +880,7 @@ udev.
%patch -P2 -p1 -b .gnsystem
%patch -P5 -p1 -b .nozlibmangle
%patch -P6 -p1 -b .nounrar
%patch -P7 -p1 -b .widevine-hack
%patch -P8 -p1 -b .widevine-other-locations
%patch -P9 -p1 -b .widevine-no-download
%patch -P11 -p1 -b .py3
%patch -P20 -p1 -b .disable-font-test
@ -963,16 +945,6 @@ udev.
%patch -P122 -p1 -b .gcc13
# Feature specific patches
%if %{use_vaapi}
%patch -P202 -p1 -b .accel-mjpeg
%patch -P203 -p1 -R -b .revert
%patch -P204 -p1 -R -b .revert
%patch -P205 -p1 -b .vaapi-intel-fix
%patch -P206 -p1 -b .wayland-vaapi
%patch -P207 -p1 -b .enable-wayland-vaapi
%endif
%if 0%{?rhel} >= 8
%patch -P300 -p1 -b .disblegnomekeyring
%endif
@ -1040,7 +1012,7 @@ export LANG=en_US.UTF-8
%if %{clang}
FLAGS=' -Wno-deprecated-declarations -Wno-unknown-warning-option -Wno-unused-command-line-argument'
FLAGS+=' -Wno-unused-but-set-variable -Wno-unused-result -Wno-unused-function -Wno-unused-variable'
FLAGS+=' -Wno-unused-const-variable -Wno-unneeded-internal-declaration'
FLAGS+=' -Wno-unused-const-variable -Wno-unneeded-internal-declaration -Wno-unknown-attributes'
%endif
%if %{system_build_flags}
@ -1258,7 +1230,7 @@ build/linux/unbundle/replace_gn_files.py --system-libraries \
flac
# Check that there is no system 'google' module, shadowing bundled ones:
if python3 -c 'import google ; print(google.__path__)' 2> /dev/null ; then \
if python3 -c 'import google ; print google.__path__' 2> /dev/null ; then \
echo "Python 3 'google' module is defined, this will shadow modules of this build"; \
exit 1 ; \
fi
@ -1655,6 +1627,9 @@ getent group chrome-remote-desktop >/dev/null || groupadd -r chrome-remote-deskt
%{chromium_path}/chromedriver
%changelog
* Wed May 03 2023 Than Ngo <than@redhat.com> - 113.0.5672.63-1
- update to 113.0.5672.63
* Sun Apr 23 2023 Than Ngo <than@redhat.com> - 112.0.5615.165-2
- make --use-gl=egl default for x11/wayland
- enable WebUIDarkMode

@ -1,3 +1,3 @@
SHA512 (node-v19.8.1-linux-arm64.tar.xz) = 86ff19085669e92ce7afe2fd7d4df0c5441df2d88c00f29d5463b805f3cf5625626db8aebf98349c9a495b772da1ce6d68263730018207ea98815058a1c81397
SHA512 (node-v19.8.1-linux-x64.tar.xz) = 925c0037c6b7074d0b0245bced20d0a0d9b1300f53b808106f16b5018d763f5f5b00bc321b33fa1033d736b1e1076608da9b7fcae66aed53d27b100b1186e2c6
SHA512 (chromium-112.0.5615.165-clean.tar.xz) = 68f8f4f0e8add04e608c1d285351b38de0199ac5635b29dcce653b30435e68431f92ea7b381d6fe6cb4ffd5b1910e66ed6f82aab62a8fab952cb969a40f7456a
SHA512 (chromium-113.0.5672.63-clean.tar.xz) = f172496e8569864db26872a4762564f094c3ca726f340d69c9dfaca6c260b0a4bbb37ad711f6ab6b9efd9ee58510b1a2a130f829183ae6a3bd711e7d1478954b

Loading…
Cancel
Save