summaryrefslogtreecommitdiff
path: root/chromium/gpu
diff options
context:
space:
mode:
authorAllan Sandfeld Jensen <allan.jensen@qt.io>2022-05-17 17:24:03 +0200
committerAllan Sandfeld Jensen <allan.jensen@qt.io>2022-06-22 07:51:41 +0000
commit774f54339e5db91f785733232d3950366db65d07 (patch)
tree068e1b47bd1af94d77094ed12b604a6b83d9c22a /chromium/gpu
parentf7eaed5286974984ba5f9e3189d8f49d03e99f81 (diff)
downloadqtwebengine-chromium-774f54339e5db91f785733232d3950366db65d07.tar.gz
BASELINE: Update Chromium to 102.0.5005.57
Change-Id: I885f714bb40ee724c28f94ca6bd8dbdb39915158 Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
Diffstat (limited to 'chromium/gpu')
-rw-r--r--chromium/gpu/command_buffer/PRESUBMIT.py6
-rw-r--r--chromium/gpu/command_buffer/build_cmd_buffer_lib.py54
-rwxr-xr-xchromium/gpu/command_buffer/build_gles2_cmd_buffer.py10
-rwxr-xr-xchromium/gpu/command_buffer/build_raster_cmd_buffer.py10
-rwxr-xr-xchromium/gpu/command_buffer/build_webgpu_cmd_buffer.py10
-rw-r--r--chromium/gpu/command_buffer/client/gl_helper_scaling.cc5
-rw-r--r--chromium/gpu/command_buffer/client/gles2_implementation.cc7
-rw-r--r--chromium/gpu/command_buffer/client/gles2_implementation_unittest.cc56
-rw-r--r--chromium/gpu/command_buffer/client/gles2_implementation_unittest_autogen.h64
-rw-r--r--chromium/gpu/command_buffer/client/program_info_manager_unittest.cc28
-rw-r--r--chromium/gpu/command_buffer/client/query_tracker_unittest.cc7
-rw-r--r--chromium/gpu/command_buffer/client/raster_cmd_helper_autogen.h3
-rw-r--r--chromium/gpu/command_buffer/client/raster_implementation.cc4
-rw-r--r--chromium/gpu/command_buffer/client/raster_implementation.h1
-rw-r--r--chromium/gpu/command_buffer/client/raster_implementation_gles.cc1
-rw-r--r--chromium/gpu/command_buffer/client/raster_implementation_gles.h1
-rw-r--r--chromium/gpu/command_buffer/client/raster_implementation_unittest.cc14
-rw-r--r--chromium/gpu/command_buffer/client/raster_implementation_unittest_autogen.h8
-rw-r--r--chromium/gpu/command_buffer/client/raster_interface.h1
-rw-r--r--chromium/gpu/command_buffer/client/vertex_array_object_manager_unittest.cc12
-rw-r--r--chromium/gpu/command_buffer/common/gles2_cmd_format.cc6
-rw-r--r--chromium/gpu/command_buffer/common/gles2_cmd_format_autogen.h4
-rw-r--r--chromium/gpu/command_buffer/common/gles2_cmd_format_test_autogen.h96
-rw-r--r--chromium/gpu/command_buffer/common/gles2_cmd_utils.cc3
-rw-r--r--chromium/gpu/command_buffer/common/gles2_cmd_utils_implementation_autogen.h182
-rw-r--r--chromium/gpu/command_buffer/common/gpu_memory_buffer_support.cc6
-rw-r--r--chromium/gpu/command_buffer/common/mailbox.cc3
-rw-r--r--chromium/gpu/command_buffer/common/raster_cmd_format.cc6
-rw-r--r--chromium/gpu/command_buffer/common/raster_cmd_format_autogen.h12
-rw-r--r--chromium/gpu/command_buffer/common/raster_cmd_format_test_autogen.h27
-rw-r--r--chromium/gpu/command_buffer/common/shared_image_usage.h5
-rw-r--r--chromium/gpu/command_buffer/common/webgpu_cmd_format.cc3
-rw-r--r--chromium/gpu/command_buffer/raster_cmd_buffer_functions.txt2
-rw-r--r--chromium/gpu/command_buffer/service/BUILD.gn3
-rw-r--r--chromium/gpu/command_buffer/service/buffer_manager_unittest.cc12
-rw-r--r--chromium/gpu/command_buffer/service/common_decoder.cc10
-rw-r--r--chromium/gpu/command_buffer/service/common_decoder.h24
-rw-r--r--chromium/gpu/command_buffer/service/external_semaphore.cc9
-rw-r--r--chromium/gpu/command_buffer/service/external_semaphore.h5
-rw-r--r--chromium/gpu/command_buffer/service/external_vk_image_backing.cc27
-rw-r--r--chromium/gpu/command_buffer/service/external_vk_image_dawn_representation.cc7
-rw-r--r--chromium/gpu/command_buffer/service/external_vk_image_factory_unittest.cc8
-rw-r--r--chromium/gpu/command_buffer/service/external_vk_image_skia_representation.cc12
-rw-r--r--chromium/gpu/command_buffer/service/feature_info.cc10
-rw-r--r--chromium/gpu/command_buffer/service/framebuffer_manager_unittest.cc8
-rw-r--r--chromium/gpu/command_buffer/service/gles2_cmd_decoder.cc4
-rw-r--r--chromium/gpu/command_buffer/service/gles2_cmd_decoder_passthrough.cc12
-rw-r--r--chromium/gpu/command_buffer/service/gles2_cmd_decoder_passthrough.h1
-rw-r--r--chromium/gpu/command_buffer/service/gles2_cmd_decoder_passthrough_doers.cc18
-rw-r--r--chromium/gpu/command_buffer/service/gles2_cmd_decoder_unittest.cc9
-rw-r--r--chromium/gpu/command_buffer/service/gles2_cmd_decoder_unittest_2_autogen.h8
-rw-r--r--chromium/gpu/command_buffer/service/gles2_cmd_decoder_unittest_attribs.cc12
-rw-r--r--chromium/gpu/command_buffer/service/gles2_cmd_decoder_unittest_base.cc31
-rw-r--r--chromium/gpu/command_buffer/service/gles2_cmd_decoder_unittest_framebuffers.cc6
-rw-r--r--chromium/gpu/command_buffer/service/gles2_cmd_decoder_unittest_programs.cc32
-rw-r--r--chromium/gpu/command_buffer/service/gles2_cmd_decoder_unittest_textures.cc12
-rw-r--r--chromium/gpu/command_buffer/service/gles2_cmd_validation_implementation_autogen.h147
-rw-r--r--chromium/gpu/command_buffer/service/gpu_tracer.cc3
-rw-r--r--chromium/gpu/command_buffer/service/gpu_tracer.h1
-rw-r--r--chromium/gpu/command_buffer/service/gpu_tracer_unittest.cc1
-rw-r--r--chromium/gpu/command_buffer/service/image_reader_gl_owner.cc23
-rw-r--r--chromium/gpu/command_buffer/service/image_reader_gl_owner.h7
-rw-r--r--chromium/gpu/command_buffer/service/image_reader_gl_owner_unittest.cc6
-rw-r--r--chromium/gpu/command_buffer/service/program_manager.cc5
-rw-r--r--chromium/gpu/command_buffer/service/program_manager_unittest.cc61
-rw-r--r--chromium/gpu/command_buffer/service/query_manager_unittest.cc1
-rw-r--r--chromium/gpu/command_buffer/service/raster_cmd_validation_implementation_autogen.h14
-rw-r--r--chromium/gpu/command_buffer/service/raster_decoder.cc95
-rw-r--r--chromium/gpu/command_buffer/service/raster_decoder.h2
-rw-r--r--chromium/gpu/command_buffer/service/raster_decoder_autogen.h3
-rw-r--r--chromium/gpu/command_buffer/service/raster_decoder_unittest.cc2
-rw-r--r--chromium/gpu/command_buffer/service/raster_decoder_unittest_base.cc3
-rw-r--r--chromium/gpu/command_buffer/service/scheduler_unittest.cc1
-rw-r--r--chromium/gpu/command_buffer/service/service_font_manager.cc57
-rw-r--r--chromium/gpu/command_buffer/service/service_font_manager.h21
-rw-r--r--chromium/gpu/command_buffer/service/service_utils.cc13
-rw-r--r--chromium/gpu/command_buffer/service/shader_translator.cc1
-rw-r--r--chromium/gpu/command_buffer/service/shared_context_state.cc3
-rw-r--r--chromium/gpu/command_buffer/service/shared_image_backing_d3d.cc53
-rw-r--r--chromium/gpu/command_buffer/service/shared_image_backing_d3d.h3
-rw-r--r--chromium/gpu/command_buffer/service/shared_image_backing_factory_angle_vulkan.cc13
-rw-r--r--chromium/gpu/command_buffer/service/shared_image_backing_factory_d3d.cc5
-rw-r--r--chromium/gpu/command_buffer/service/shared_image_backing_factory_d3d_unittest.cc1
-rw-r--r--chromium/gpu/command_buffer/service/shared_image_backing_factory_gl_common.cc1
-rw-r--r--chromium/gpu/command_buffer/service/shared_image_backing_factory_gl_common.h1
-rw-r--r--chromium/gpu/command_buffer/service/shared_image_backing_factory_gl_texture.cc16
-rw-r--r--chromium/gpu/command_buffer/service/shared_image_backing_factory_iosurface.mm7
-rw-r--r--chromium/gpu/command_buffer/service/shared_image_backing_factory_iosurface_unittest.cc1
-rw-r--r--chromium/gpu/command_buffer/service/shared_image_backing_factory_ozone.cc31
-rw-r--r--chromium/gpu/command_buffer/service/shared_image_backing_factory_ozone.h3
-rw-r--r--chromium/gpu/command_buffer/service/shared_image_backing_gl_image.cc14
-rw-r--r--chromium/gpu/command_buffer/service/shared_image_backing_gl_texture.cc41
-rw-r--r--chromium/gpu/command_buffer/service/shared_image_backing_gl_texture.h6
-rw-r--r--chromium/gpu/command_buffer/service/shared_image_backing_ozone.cc170
-rw-r--r--chromium/gpu/command_buffer/service/shared_image_backing_ozone.h22
-rw-r--r--chromium/gpu/command_buffer/service/shared_image_backing_raw_draw.cc62
-rw-r--r--chromium/gpu/command_buffer/service/shared_image_backing_raw_draw.h8
-rw-r--r--chromium/gpu/command_buffer/service/shared_image_factory.cc98
-rw-r--r--chromium/gpu/command_buffer/service/shared_image_factory.h2
-rw-r--r--chromium/gpu/command_buffer/service/shared_image_manager.cc1
-rw-r--r--chromium/gpu/command_buffer/service/shared_image_representation.cc11
-rw-r--r--chromium/gpu/command_buffer/service/shared_image_representation.h9
-rw-r--r--chromium/gpu/command_buffer/service/shared_image_representation_dawn_egl_image.cc64
-rw-r--r--chromium/gpu/command_buffer/service/shared_image_representation_dawn_egl_image.h8
-rw-r--r--chromium/gpu/command_buffer/service/shared_image_representation_dawn_ozone.cc41
-rw-r--r--chromium/gpu/command_buffer/service/shared_image_representation_gl_ozone.cc61
-rw-r--r--chromium/gpu/command_buffer/service/shared_image_representation_gl_ozone.h10
-rw-r--r--chromium/gpu/command_buffer/service/shared_image_representation_skia_gl.cc1
-rw-r--r--chromium/gpu/command_buffer/service/shared_image_representation_skia_vk_android.cc1
-rw-r--r--chromium/gpu/command_buffer/service/shared_image_representation_skia_vk_ozone.cc51
-rw-r--r--chromium/gpu/command_buffer/service/shared_image_representation_skia_vk_ozone.h1
-rw-r--r--chromium/gpu/command_buffer/service/shared_image_test_utils.cc1
-rw-r--r--chromium/gpu/command_buffer/service/shared_image_video.cc14
-rw-r--r--chromium/gpu/command_buffer/service/shared_image_video.h6
-rw-r--r--chromium/gpu/command_buffer/service/shared_image_video_image_reader.cc12
-rw-r--r--chromium/gpu/command_buffer/service/surface_texture_gl_owner_unittest.cc6
-rw-r--r--chromium/gpu/command_buffer/service/sync_point_manager.cc9
-rw-r--r--chromium/gpu/command_buffer/service/test_helper.cc3
-rw-r--r--chromium/gpu/command_buffer/service/texture_manager.cc9
-rw-r--r--chromium/gpu/command_buffer/service/texture_manager.h1
-rw-r--r--chromium/gpu/command_buffer/service/texture_owner.cc7
-rw-r--r--chromium/gpu/command_buffer/service/texture_owner.h4
-rw-r--r--chromium/gpu/command_buffer/service/webgpu_cmd_validation_implementation_autogen.h4
-rw-r--r--chromium/gpu/command_buffer/service/webgpu_decoder.h3
-rw-r--r--chromium/gpu/command_buffer/service/webgpu_decoder_impl.cc77
-rw-r--r--chromium/gpu/command_buffer/service/webgpu_decoder_unittest.cc2
-rw-r--r--chromium/gpu/command_buffer/service/wrapped_sk_image.cc17
-rw-r--r--chromium/gpu/config/BUILD.gn2
-rw-r--r--chromium/gpu/config/gpu_blocklist.cc2
-rw-r--r--chromium/gpu/config/gpu_blocklist_unittest.cc3
-rw-r--r--chromium/gpu/config/gpu_control_list.cc103
-rw-r--r--chromium/gpu/config/gpu_control_list.h2
-rw-r--r--chromium/gpu/config/gpu_control_list_entry_unittest.cc71
-rw-r--r--chromium/gpu/config/gpu_control_list_format.txt9
-rw-r--r--chromium/gpu/config/gpu_control_list_testing.json34
-rw-r--r--chromium/gpu/config/gpu_control_list_testing_arrays_and_structs_autogen.h74
-rw-r--r--chromium/gpu/config/gpu_control_list_testing_autogen.cc564
-rw-r--r--chromium/gpu/config/gpu_control_list_testing_entry_enums_autogen.h2
-rw-r--r--chromium/gpu/config/gpu_control_list_testing_exceptions_autogen.h10
-rw-r--r--chromium/gpu/config/gpu_control_list_version_unittest.cc17
-rw-r--r--chromium/gpu/config/gpu_crash_keys.cc2
-rw-r--r--chromium/gpu/config/gpu_crash_keys.h1
-rw-r--r--chromium/gpu/config/gpu_driver_bug_list.cc3
-rw-r--r--chromium/gpu/config/gpu_driver_bug_list.json37
-rw-r--r--chromium/gpu/config/gpu_dx_diagnostics_win.cc5
-rw-r--r--chromium/gpu/config/gpu_feature_type.h1
-rw-r--r--chromium/gpu/config/gpu_finch_features.cc71
-rw-r--r--chromium/gpu/config/gpu_finch_features.h9
-rw-r--r--chromium/gpu/config/gpu_info.cc86
-rw-r--r--chromium/gpu/config/gpu_info.h13
-rw-r--r--chromium/gpu/config/gpu_info_collector.cc26
-rw-r--r--chromium/gpu/config/gpu_info_collector.h29
-rw-r--r--chromium/gpu/config/gpu_info_collector_fuchsia.cc9
-rw-r--r--chromium/gpu/config/gpu_info_collector_win.cc33
-rw-r--r--chromium/gpu/config/gpu_lists_version.h2
-rw-r--r--chromium/gpu/config/gpu_preferences.h2
-rw-r--r--chromium/gpu/config/gpu_util.cc29
-rwxr-xr-xchromium/gpu/config/process_json.py18
-rw-r--r--chromium/gpu/config/software_rendering_list.json7
-rw-r--r--chromium/gpu/gles2_conform_support/egl/display.cc7
-rw-r--r--chromium/gpu/gles2_conform_support/egl/thread_state.cc3
-rw-r--r--chromium/gpu/ipc/client/command_buffer_proxy_impl.cc1
-rw-r--r--chromium/gpu/ipc/client/gpu_channel_host.cc1
-rw-r--r--chromium/gpu/ipc/client/image_decode_accelerator_proxy_unittest.cc6
-rw-r--r--chromium/gpu/ipc/client/raster_in_process_context_tests.cc4
-rw-r--r--chromium/gpu/ipc/common/context_creation_attribs_mojom_traits.h1
-rw-r--r--chromium/gpu/ipc/common/context_result_mojom_traits.h1
-rw-r--r--chromium/gpu/ipc/common/device_perf_info.mojom1
-rw-r--r--chromium/gpu/ipc/common/device_perf_info_mojom_traits.cc5
-rw-r--r--chromium/gpu/ipc/common/dxgi_helpers.cc7
-rw-r--r--chromium/gpu/ipc/common/dxgi_helpers.h3
-rw-r--r--chromium/gpu/ipc/common/gpu_channel.mojom8
-rw-r--r--chromium/gpu/ipc/common/gpu_feature_info_mojom_traits.h1
-rw-r--r--chromium/gpu/ipc/common/gpu_info.mojom4
-rw-r--r--chromium/gpu/ipc/common/gpu_info_mojom_traits.cc5
-rw-r--r--chromium/gpu/ipc/common/gpu_info_mojom_traits.h12
-rw-r--r--chromium/gpu/ipc/common/gpu_memory_buffer_impl_dxgi.cc42
-rw-r--r--chromium/gpu/ipc/common/gpu_memory_buffer_impl_dxgi.h9
-rw-r--r--chromium/gpu/ipc/common/gpu_memory_buffer_support.cc5
-rw-r--r--chromium/gpu/ipc/common/gpu_memory_buffer_support.h4
-rw-r--r--chromium/gpu/ipc/common/gpu_peak_memory_mojom_traits.h1
-rw-r--r--chromium/gpu/ipc/common/gpu_preferences.mojom1
-rw-r--r--chromium/gpu/ipc/common/gpu_preferences_mojom_traits.h5
-rw-r--r--chromium/gpu/ipc/common/mojom_traits_unittest.cc29
-rw-r--r--chromium/gpu/ipc/common/scheduling_priority_mojom_traits.h1
-rw-r--r--chromium/gpu/ipc/host/shader_disk_cache.cc7
-rw-r--r--chromium/gpu/ipc/host/shader_disk_cache_unittest.cc1
-rw-r--r--chromium/gpu/ipc/in_process_command_buffer.cc8
-rw-r--r--chromium/gpu/ipc/in_process_command_buffer.h1
-rw-r--r--chromium/gpu/ipc/service/command_buffer_stub.cc1
-rw-r--r--chromium/gpu/ipc/service/context_url.cc17
-rw-r--r--chromium/gpu/ipc/service/dcomp_texture_win.cc10
-rw-r--r--chromium/gpu/ipc/service/gpu_channel.cc1
-rw-r--r--chromium/gpu/ipc/service/gpu_channel_manager.h1
-rw-r--r--chromium/gpu/ipc/service/gpu_init.cc70
-rw-r--r--chromium/gpu/ipc/service/gpu_memory_buffer_factory_dxgi.cc10
-rw-r--r--chromium/gpu/ipc/service/gpu_watchdog_thread.cc120
-rw-r--r--chromium/gpu/ipc/service/gpu_watchdog_thread.h20
-rw-r--r--chromium/gpu/ipc/service/gpu_watchdog_thread_unittest.cc33
-rw-r--r--chromium/gpu/ipc/service/image_decode_accelerator_stub.cc1
-rw-r--r--chromium/gpu/ipc/service/image_transport_surface_mac.mm1
-rw-r--r--chromium/gpu/ipc/service/image_transport_surface_overlay_mac.mm1
-rw-r--r--chromium/gpu/ipc/service/pass_through_image_transport_surface.cc1
-rw-r--r--chromium/gpu/ipc/service/raster_command_buffer_stub.cc6
-rw-r--r--chromium/gpu/ipc/service/stream_texture_android.cc8
-rw-r--r--chromium/gpu/ipc/service/webgpu_command_buffer_stub.cc2
-rw-r--r--chromium/gpu/ipc/shared_image_interface_in_process.cc1
-rw-r--r--chromium/gpu/ipc/shared_image_interface_in_process.h4
-rw-r--r--chromium/gpu/perftests/run_all_tests.cc2
-rw-r--r--chromium/gpu/skia_bindings/gl_bindings_skia_cmd_buffer.cc4
-rw-r--r--chromium/gpu/skia_bindings/grcontext_for_gles2_interface.cc1
-rw-r--r--chromium/gpu/skia_bindings/grcontext_for_webgpu_interface.cc1
-rw-r--r--chromium/gpu/tools/compositor_model_bench/compositor_model_bench.cc2
-rw-r--r--chromium/gpu/vulkan/BUILD.gn11
-rw-r--r--chromium/gpu/vulkan/features.gni3
-rwxr-xr-xchromium/gpu/vulkan/generate_bindings.py12
-rw-r--r--chromium/gpu/vulkan/init/BUILD.gn3
-rw-r--r--chromium/gpu/vulkan/init/vulkan_factory.cc6
-rw-r--r--chromium/gpu/vulkan/mac/BUILD.gn36
-rw-r--r--chromium/gpu/vulkan/mac/vulkan_implementation_mac.cc123
-rw-r--r--chromium/gpu/vulkan/mac/vulkan_implementation_mac.h59
-rw-r--r--chromium/gpu/vulkan/vulkan_device_queue.cc2
-rw-r--r--chromium/gpu/vulkan/vulkan_fence_helper.h2
-rw-r--r--chromium/gpu/vulkan/vulkan_function_pointers.cc22
-rw-r--r--chromium/gpu/vulkan/vulkan_function_pointers.h33
-rw-r--r--chromium/gpu/vulkan/vulkan_image_linux.cc12
-rw-r--r--chromium/gpu/vulkan/vulkan_image_mac.cc24
-rw-r--r--chromium/gpu/vulkan/vulkan_surface.cc76
-rw-r--r--chromium/gpu/vulkan/vulkan_surface.h28
-rw-r--r--chromium/gpu/vulkan/vulkan_swap_chain.cc31
-rw-r--r--chromium/gpu/vulkan/vulkan_swap_chain.h8
231 files changed, 3049 insertions, 1619 deletions
diff --git a/chromium/gpu/command_buffer/PRESUBMIT.py b/chromium/gpu/command_buffer/PRESUBMIT.py
index 9c8df9fc678..e54d94b6bd6 100644
--- a/chromium/gpu/command_buffer/PRESUBMIT.py
+++ b/chromium/gpu/command_buffer/PRESUBMIT.py
@@ -65,7 +65,7 @@ def CommonChecks(input_api, output_api):
input_api.Command(
name='build_gles2_cmd_buffer',
cmd=[
- input_api.python_executable, 'build_gles2_cmd_buffer.py',
+ input_api.python3_executable, 'build_gles2_cmd_buffer.py',
'--check', '--output-dir=' + temp_dir
],
kwargs={},
@@ -75,7 +75,7 @@ def CommonChecks(input_api, output_api):
input_api.Command(
name='build_raster_cmd_buffer',
cmd=[
- input_api.python_executable, 'build_raster_cmd_buffer.py',
+ input_api.python3_executable, 'build_raster_cmd_buffer.py',
'--check', '--output-dir=' + temp_dir
],
kwargs={},
@@ -85,7 +85,7 @@ def CommonChecks(input_api, output_api):
input_api.Command(
name='build_webgpu_cmd_buffer',
cmd=[
- input_api.python_executable, 'build_webgpu_cmd_buffer.py',
+ input_api.python3_executable, 'build_webgpu_cmd_buffer.py',
'--check', '--output-dir=' + temp_dir
],
kwargs={},
diff --git a/chromium/gpu/command_buffer/build_cmd_buffer_lib.py b/chromium/gpu/command_buffer/build_cmd_buffer_lib.py
index b3f285f7b84..29cc27e945c 100644
--- a/chromium/gpu/command_buffer/build_cmd_buffer_lib.py
+++ b/chromium/gpu/command_buffer/build_cmd_buffer_lib.py
@@ -682,7 +682,7 @@ def _Namespace():
def Grouper(n, iterable, fillvalue=None):
"""Collect data into fixed-length chunks or blocks"""
args = [iter(iterable)] * n
- return itertools.izip_longest(fillvalue=fillvalue, *args)
+ return itertools.zip_longest(fillvalue=fillvalue, *args)
def SplitWords(input_string):
@@ -831,7 +831,7 @@ class CWriter(object):
except OSError as e:
if e.errno == errno.EEXIST:
pass
- self._file = open(filename, 'wb')
+ self._file = open(filename, 'w')
def __enter__(self):
self._file.write(self._ENTER_MSG)
@@ -1477,7 +1477,7 @@ TEST_F(%(prefix)sImplementationTest,
"""
for invalid_arg in constants:
gl_arg_strings = []
- invalid = invalid_arg.GetInvalidArg(func)
+ invalid = invalid_arg.GetInvalidArg(0)
for arg in func.GetOriginalArgs():
if arg is invalid_arg:
gl_arg_strings.append(invalid[0])
@@ -2245,10 +2245,10 @@ TEST_F(%(prefix)sImplementationTest, %(name)s) {
GLuint data[2];
};
Cmds expected;
- expected.gen.Init(base::size(ids), &ids[0]);
+ expected.gen.Init(std::size(ids), &ids[0]);
expected.data[0] = k%(types)sStartId;
expected.data[1] = k%(types)sStartId + 1;
- gl_->%(name)s(base::size(ids), &ids[0]);
+ gl_->%(name)s(std::size(ids), &ids[0]);
EXPECT_EQ(0, memcmp(&expected, commands_, sizeof(expected)));
EXPECT_EQ(k%(types)sStartId, ids[0]);
EXPECT_EQ(k%(types)sStartId + 1, ids[1]);
@@ -2394,17 +2394,17 @@ TEST_P(%(test_name)s, %(name)sInvalidArgs) {
f.write(" cmds::%s& cmd = *GetBufferAs<cmds::%s>();\n" %
(func.name, func.name))
f.write(" void* next_cmd = cmd.Set(\n")
- f.write(" &cmd, static_cast<GLsizei>(base::size(ids)), ids);\n")
+ f.write(" &cmd, static_cast<GLsizei>(std::size(ids)), ids);\n")
f.write(" EXPECT_EQ(static_cast<uint32_t>(cmds::%s::kCmdId),\n" %
func.name)
f.write(" cmd.header.command);\n")
f.write(" EXPECT_EQ(sizeof(cmd) +\n")
f.write(" RoundSizeToMultipleOfEntries(cmd.n * 4u),\n")
f.write(" cmd.header.size * 4u);\n")
- f.write(" EXPECT_EQ(static_cast<GLsizei>(base::size(ids)), cmd.n);\n");
+ f.write(" EXPECT_EQ(static_cast<GLsizei>(std::size(ids)), cmd.n);\n");
f.write(" CheckBytesWrittenMatchesExpectedSize(\n")
f.write(" next_cmd, sizeof(cmd) +\n")
- f.write(" RoundSizeToMultipleOfEntries(base::size(ids) * 4u));\n")
+ f.write(" RoundSizeToMultipleOfEntries(std::size(ids) * 4u));\n")
f.write(" EXPECT_EQ(0, memcmp(ids, ImmediateDataAddress(&cmd),\n")
f.write(" sizeof(ids)));\n")
f.write("}\n")
@@ -2623,10 +2623,10 @@ TEST_F(%(prefix)sImplementationTest, %(name)s) {
GLuint data[2];
};
Cmds expected;
- expected.del.Init(base::size(ids), &ids[0]);
+ expected.del.Init(std::size(ids), &ids[0]);
expected.data[0] = k%(types)sStartId;
expected.data[1] = k%(types)sStartId + 1;
- gl_->%(name)s(base::size(ids), &ids[0]);
+ gl_->%(name)s(std::size(ids), &ids[0]);
EXPECT_EQ(0, memcmp(&expected, commands_, sizeof(expected)));
}
"""
@@ -2830,17 +2830,17 @@ TEST_P(%(test_name)s, %(name)sInvalidArgs) {
f.write(" cmds::%s& cmd = *GetBufferAs<cmds::%s>();\n" %
(func.name, func.name))
f.write(" void* next_cmd = cmd.Set(\n")
- f.write(" &cmd, static_cast<GLsizei>(base::size(ids)), ids);\n")
+ f.write(" &cmd, static_cast<GLsizei>(std::size(ids)), ids);\n")
f.write(" EXPECT_EQ(static_cast<uint32_t>(cmds::%s::kCmdId),\n" %
func.name)
f.write(" cmd.header.command);\n")
f.write(" EXPECT_EQ(sizeof(cmd) +\n")
f.write(" RoundSizeToMultipleOfEntries(cmd.n * 4u),\n")
f.write(" cmd.header.size * 4u);\n")
- f.write(" EXPECT_EQ(static_cast<GLsizei>(base::size(ids)), cmd.n);\n");
+ f.write(" EXPECT_EQ(static_cast<GLsizei>(std::size(ids)), cmd.n);\n");
f.write(" CheckBytesWrittenMatchesExpectedSize(\n")
f.write(" next_cmd, sizeof(cmd) +\n")
- f.write(" RoundSizeToMultipleOfEntries(base::size(ids) * 4u));\n")
+ f.write(" RoundSizeToMultipleOfEntries(std::size(ids) * 4u));\n")
f.write(" EXPECT_EQ(0, memcmp(ids, ImmediateDataAddress(&cmd),\n")
f.write(" sizeof(ids)));\n")
f.write("}\n")
@@ -4139,14 +4139,14 @@ TEST_P(%(test_name)s, %(name)sInvalidHeader) {
const char kSource0[] = "hello";
const char* kSource[] = { kSource0 };
const char kValidStrEnd = 0;
- const GLsizei kCount = static_cast<GLsizei>(base::size(kSource));
+ const GLsizei kCount = static_cast<GLsizei>(std::size(kSource));
const GLsizei kTests[] = {
kCount + 1,
0,
std::numeric_limits<GLsizei>::max(),
-1,
};
- for (size_t ii = 0; ii < base::size(kTests); ++ii) {
+ for (size_t ii = 0; ii < std::size(kTests); ++ii) {
SetBucketAsCStrings(kBucketId, 1, kSource, kTests[ii], kValidStrEnd);
cmds::%(name)s cmd;
cmd.Init(%(cmd_args)s);
@@ -5923,7 +5923,7 @@ class Function(object):
"""Writes the cmd cmd_flags constant."""
# By default trace only at the highest level 3.
trace_level = int(self.GetInfo('trace_level', default = 3))
- if trace_level not in xrange(0, 4):
+ if trace_level not in range(0, 4):
raise KeyError("Unhandled trace_level: %d" % trace_level)
cmd_flags = ('CMD_FLAG_SET_TRACE_LEVEL(%d)' % trace_level)
@@ -6351,11 +6351,11 @@ class GLGenerator(object):
def Log(self, msg):
"""Prints something if verbose is true."""
if self.verbose:
- print msg
+ print(msg)
def Error(self, msg):
"""Prints an error."""
- print "Error: %s" % msg
+ print("Error: %s" % msg)
self.errors += 1
def ParseGLH(self, filename):
@@ -6703,7 +6703,7 @@ void ContextState::InitState(const ContextState *prev_state) const {
continue
if state['type'] == 'FrontBack':
num_states = len(state['states'])
- for ndx, group in enumerate(Grouper(num_states / 2,
+ for ndx, group in enumerate(Grouper(num_states // 2,
state['states'])):
if test_prev:
f.write(" if (")
@@ -6992,7 +6992,7 @@ void ContextStateTestHelpers::SetupInitStateExpectations(
state = _STATE_INFO[state_name]
if state['type'] == 'FrontBack':
num_states = len(state['states'])
- for ndx, group in enumerate(Grouper(num_states / 2,
+ for ndx, group in enumerate(Grouper(num_states // 2,
state['states'])):
args = []
for item in group:
@@ -7270,7 +7270,7 @@ extern const NameToFunc g_gles2_function_table[] = {
continue
if named_type.GetValidValues():
code = """%(pre)s%(name)s(
- valid_%(name)s_table, base::size(valid_%(name)s_table))"""
+ valid_%(name)s_table, std::size(valid_%(name)s_table))"""
else:
code = "%(pre)s%(name)s()"
f.write(code % {
@@ -7293,14 +7293,14 @@ extern const NameToFunc g_gles2_function_table[] = {
continue
if named_type.GetDeprecatedValuesES3():
code = """ %(name)s.RemoveValues(
- deprecated_%(name)s_table_es3, base::size(deprecated_%(name)s_table_es3));
+ deprecated_%(name)s_table_es3, std::size(deprecated_%(name)s_table_es3));
"""
f.write(code % {
'name': ToUnderscore(name),
})
if named_type.GetValidValuesES3():
code = """ %(name)s.AddValues(
- valid_%(name)s_table_es3, base::size(valid_%(name)s_table_es3));
+ valid_%(name)s_table_es3, std::size(valid_%(name)s_table_es3));
"""
f.write(code % {
'name': ToUnderscore(name),
@@ -7386,7 +7386,7 @@ const size_t %(p)sUtil::enum_to_string_table_len_ =
f.write(' { %s, "%s" },\n' % (value, value))
f.write(""" };
return %sUtil::GetQualifiedEnumString(
- string_table, base::size(string_table), value);
+ string_table, std::size(string_table), value);
}
""" % _prefix)
@@ -7424,13 +7424,13 @@ const size_t %(p)sUtil::enum_to_string_table_len_ =
f.write("#include \"ppapi/c/ppb_opengles2.h\"\n\n")
else:
f.write("\n#ifndef __gl2_h_\n")
- for (k, v) in _GL_TYPES.iteritems():
+ for (k, v) in _GL_TYPES.items():
f.write("typedef %s %s;\n" % (v, k))
f.write("#ifdef _WIN64\n")
- for (k, v) in _GL_TYPES_64.iteritems():
+ for (k, v) in _GL_TYPES_64.items():
f.write("typedef %s %s;\n" % (v, k))
f.write("#else\n")
- for (k, v) in _GL_TYPES_32.iteritems():
+ for (k, v) in _GL_TYPES_32.items():
f.write("typedef %s %s;\n" % (v, k))
f.write("#endif // _WIN64\n")
f.write("#endif // __gl2_h_\n\n")
diff --git a/chromium/gpu/command_buffer/build_gles2_cmd_buffer.py b/chromium/gpu/command_buffer/build_gles2_cmd_buffer.py
index f759df7f992..92e68825223 100755
--- a/chromium/gpu/command_buffer/build_gles2_cmd_buffer.py
+++ b/chromium/gpu/command_buffer/build_gles2_cmd_buffer.py
@@ -1,4 +1,4 @@
-#!/usr/bin/env python
+#!/usr/bin/env python3
# Copyright (c) 2012 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
@@ -4318,7 +4318,7 @@ def main(argv):
chromium_root_dir)
if gen.errors > 0:
- print "build_gles2_cmd_buffer.py: Failed with %d errors" % gen.errors
+ print("build_gles2_cmd_buffer.py: Failed with %d errors" % gen.errors)
return 1
check_failed_filenames = []
@@ -4329,10 +4329,10 @@ def main(argv):
check_failed_filenames.append(filename)
if len(check_failed_filenames) > 0:
- print 'Please run gpu/command_buffer/build_gles2_cmd_buffer.py'
- print 'Failed check on autogenerated command buffer files:'
+ print('Please run gpu/command_buffer/build_gles2_cmd_buffer.py')
+ print('Failed check on autogenerated command buffer files:')
for filename in check_failed_filenames:
- print filename
+ print(filename)
return 1
return 0
diff --git a/chromium/gpu/command_buffer/build_raster_cmd_buffer.py b/chromium/gpu/command_buffer/build_raster_cmd_buffer.py
index e3ad4527286..1a008945226 100755
--- a/chromium/gpu/command_buffer/build_raster_cmd_buffer.py
+++ b/chromium/gpu/command_buffer/build_raster_cmd_buffer.py
@@ -1,4 +1,4 @@
-#!/usr/bin/env python
+#!/usr/bin/env python3
# Copyright 2018 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
@@ -468,7 +468,7 @@ def main(argv):
chromium_root_dir)
if gen.errors > 0:
- print "build_raster_cmd_buffer.py: Failed with %d errors" % gen.errors
+ print("build_raster_cmd_buffer.py: Failed with %d errors" % gen.errors)
return 1
check_failed_filenames = []
@@ -479,10 +479,10 @@ def main(argv):
check_failed_filenames.append(filename)
if len(check_failed_filenames) > 0:
- print 'Please run gpu/command_buffer/build_raster_cmd_buffer.py'
- print 'Failed check on autogenerated command buffer files:'
+ print('Please run gpu/command_buffer/build_raster_cmd_buffer.py')
+ print('Failed check on autogenerated command buffer files:')
for filename in check_failed_filenames:
- print filename
+ print(filename)
return 1
return 0
diff --git a/chromium/gpu/command_buffer/build_webgpu_cmd_buffer.py b/chromium/gpu/command_buffer/build_webgpu_cmd_buffer.py
index 0902050698b..fdb171550be 100755
--- a/chromium/gpu/command_buffer/build_webgpu_cmd_buffer.py
+++ b/chromium/gpu/command_buffer/build_webgpu_cmd_buffer.py
@@ -1,4 +1,4 @@
-#!/usr/bin/env python
+#!/usr/bin/env python3
# Copyright 2018 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
@@ -168,7 +168,7 @@ def main(argv):
chromium_root_dir)
if gen.errors > 0:
- print "build_webgpu_cmd_buffer.py: Failed with %d errors" % gen.errors
+ print("build_webgpu_cmd_buffer.py: Failed with %d errors" % gen.errors)
return 1
check_failed_filenames = []
@@ -179,10 +179,10 @@ def main(argv):
check_failed_filenames.append(filename)
if len(check_failed_filenames) > 0:
- print 'Please run gpu/command_buffer/build_webgpu_cmd_buffer.py'
- print 'Failed check on autogenerated command buffer files:'
+ print('Please run gpu/command_buffer/build_webgpu_cmd_buffer.py')
+ print('Failed check on autogenerated command buffer files:')
for filename in check_failed_filenames:
- print filename
+ print(filename)
return 1
return 0
diff --git a/chromium/gpu/command_buffer/client/gl_helper_scaling.cc b/chromium/gpu/command_buffer/client/gl_helper_scaling.cc
index 6e8c3795c74..93a1f763081 100644
--- a/chromium/gpu/command_buffer/client/gl_helper_scaling.cc
+++ b/chromium/gpu/command_buffer/client/gl_helper_scaling.cc
@@ -37,8 +37,6 @@ namespace {
const GLfloat kRGBtoGrayscaleColorWeights[4] = {0.213f, 0.715f, 0.072f, 0.0f};
// Linear translation from RGB to YUV color space.
-// TODO(miu): This needs to stop being hardcoded...and need to identify to&from
-// color spaces.
const GLfloat kRGBtoYColorWeights[4] = {0.257f, 0.504f, 0.098f, 0.0625f};
const GLfloat kRGBtoUColorWeights[4] = {-0.148f, -0.291f, 0.439f, 0.5f};
const GLfloat kRGBtoVColorWeights[4] = {0.439f, -0.368f, -0.071f, 0.5f};
@@ -365,7 +363,8 @@ class ScalerImpl : public GLHelper::ScalerInterface {
}
// Because the texture sampler sometimes reads between pixels, an extra one
// must be accounted for.
- sampling_rect->Inset(-(overscan_x + 1.0f), -(overscan_y + 1.0f));
+ sampling_rect->Inset(
+ -gfx::InsetsF::VH(overscan_y + 1.0f, overscan_x + 1.0f));
}
// Returns the given |rect| in source coordinates.
diff --git a/chromium/gpu/command_buffer/client/gles2_implementation.cc b/chromium/gpu/command_buffer/client/gles2_implementation.cc
index 7081228508e..7c33d180419 100644
--- a/chromium/gpu/command_buffer/client/gles2_implementation.cc
+++ b/chromium/gpu/command_buffer/client/gles2_implementation.cc
@@ -23,16 +23,15 @@
#include "base/atomic_sequence_num.h"
#include "base/bind.h"
-#include "base/bits.h"
#include "base/compiler_specific.h"
#include "base/containers/span.h"
-#include "base/cxx17_backports.h"
#include "base/memory/raw_ptr.h"
#include "base/numerics/ostream_operators.h"
#include "base/numerics/safe_math.h"
#include "base/strings/string_split.h"
#include "base/system/sys_info.h"
#include "base/threading/thread_task_runner_handle.h"
+#include "base/time/time.h"
#include "base/trace_event/memory_allocator_dump.h"
#include "base/trace_event/memory_dump_manager.h"
#include "base/trace_event/process_memory_dump.h"
@@ -296,7 +295,7 @@ gpu::ContextResult GLES2Implementation::Initialize(
if (support_client_side_arrays_) {
GetIdHandler(SharedIdNamespaces::kBuffers)
- ->MakeIds(this, kClientSideArrayId, base::size(reserved_ids_),
+ ->MakeIds(this, kClientSideArrayId, std::size(reserved_ids_),
&reserved_ids_[0]);
}
@@ -330,7 +329,7 @@ GLES2Implementation::~GLES2Implementation() {
// GLES2Implementation::Initialize() could fail before allocating
// reserved_ids_, so we need delete them carefully.
if (support_client_side_arrays_ && reserved_ids_[0]) {
- DeleteBuffers(base::size(reserved_ids_), &reserved_ids_[0]);
+ DeleteBuffers(std::size(reserved_ids_), &reserved_ids_[0]);
}
// Release remaining BufferRange mem; This is when a MapBufferRange() is
diff --git a/chromium/gpu/command_buffer/client/gles2_implementation_unittest.cc b/chromium/gpu/command_buffer/client/gles2_implementation_unittest.cc
index 1d598a20bd4..c182abcba80 100644
--- a/chromium/gpu/command_buffer/client/gles2_implementation_unittest.cc
+++ b/chromium/gpu/command_buffer/client/gles2_implementation_unittest.cc
@@ -10,7 +10,6 @@
#include <GLES2/gl2ext.h>
#include <GLES2/gl2extchromium.h>
#include <GLES3/gl3.h>
-
#include <stddef.h>
#include <stdint.h>
@@ -18,7 +17,6 @@
#include "base/bind.h"
#include "base/compiler_specific.h"
-#include "base/cxx17_backports.h"
#include "base/memory/raw_ptr.h"
#include "gpu/command_buffer/client/client_test_helper.h"
#include "gpu/command_buffer/client/gles2_cmd_helper.h"
@@ -852,9 +850,9 @@ TEST_F(GLES2ImplementationTest, DrawArraysClientSideBuffers) {
const GLint kFirst = 1;
const GLsizei kCount = 2;
const GLsizei kSize1 =
- base::size(verts) * kNumComponents1 * sizeof(verts[0][0]);
+ std::size(verts) * kNumComponents1 * sizeof(verts[0][0]);
const GLsizei kSize2 =
- base::size(verts) * kNumComponents2 * sizeof(verts[0][0]);
+ std::size(verts) * kNumComponents2 * sizeof(verts[0][0]);
const GLsizei kEmuOffset1 = 0;
const GLsizei kEmuOffset2 = kSize1;
const GLsizei kTotalSize = kSize1 + kSize2;
@@ -920,7 +918,7 @@ TEST_F(GLES2ImplementationTest, DrawArraysInstancedANGLEClientSideBuffers) {
const GLsizei kCount = 2;
const GLuint kDivisor = 1;
const GLsizei kSize1 =
- base::size(verts) * kNumComponents1 * sizeof(verts[0][0]);
+ std::size(verts) * kNumComponents1 * sizeof(verts[0][0]);
const GLsizei kSize2 =
1 * kNumComponents2 * sizeof(verts[0][0]);
const GLsizei kEmuOffset1 = 0;
@@ -998,9 +996,9 @@ TEST_F(GLES2ImplementationTest, DrawElementsClientSideBuffers) {
const GLsizei kClientStride = sizeof(verts[0]);
const GLsizei kCount = 2;
const GLsizei kSize1 =
- base::size(verts) * kNumComponents1 * sizeof(verts[0][0]);
+ std::size(verts) * kNumComponents1 * sizeof(verts[0][0]);
const GLsizei kSize2 =
- base::size(verts) * kNumComponents2 * sizeof(verts[0][0]);
+ std::size(verts) * kNumComponents2 * sizeof(verts[0][0]);
const GLsizei kEmuOffset1 = 0;
const GLsizei kEmuOffset2 = kSize1;
const GLsizei kTotalSize = kSize1 + kSize2;
@@ -1082,9 +1080,9 @@ TEST_F(GLES2ImplementationTest, DrawElementsClientSideBuffersIndexUint) {
const GLsizei kClientStride = sizeof(verts[0]);
const GLsizei kCount = 2;
const GLsizei kSize1 =
- base::size(verts) * kNumComponents1 * sizeof(verts[0][0]);
+ std::size(verts) * kNumComponents1 * sizeof(verts[0][0]);
const GLsizei kSize2 =
- base::size(verts) * kNumComponents2 * sizeof(verts[0][0]);
+ std::size(verts) * kNumComponents2 * sizeof(verts[0][0]);
const GLsizei kEmuOffset1 = 0;
const GLsizei kEmuOffset2 = kSize1;
const GLsizei kTotalSize = kSize1 + kSize2;
@@ -1191,9 +1189,9 @@ TEST_F(GLES2ImplementationTest,
const GLsizei kClientStride = sizeof(verts[0]);
const GLsizei kCount = 2;
const GLsizei kSize1 =
- base::size(verts) * kNumComponents1 * sizeof(verts[0][0]);
+ std::size(verts) * kNumComponents1 * sizeof(verts[0][0]);
const GLsizei kSize2 =
- base::size(verts) * kNumComponents2 * sizeof(verts[0][0]);
+ std::size(verts) * kNumComponents2 * sizeof(verts[0][0]);
const GLsizei kEmuOffset1 = 0;
const GLsizei kEmuOffset2 = kSize1;
const GLsizei kTotalSize = kSize1 + kSize2;
@@ -1280,7 +1278,7 @@ TEST_F(GLES2ImplementationTest, DrawElementsInstancedANGLEClientSideBuffers) {
const GLsizei kClientStride = sizeof(verts[0]);
const GLsizei kCount = 2;
const GLsizei kSize1 =
- base::size(verts) * kNumComponents1 * sizeof(verts[0][0]);
+ std::size(verts) * kNumComponents1 * sizeof(verts[0][0]);
const GLsizei kSize2 =
1 * kNumComponents2 * sizeof(verts[0][0]);
const GLuint kDivisor = 1;
@@ -2372,7 +2370,7 @@ TEST_F(GLES2ImplementationTest, SubImage2DUnpack) {
}
for (int sub = 0; sub < 2; ++sub) {
- for (size_t a = 0; a < base::size(unpack_alignments); ++a) {
+ for (size_t a = 0; a < std::size(unpack_alignments); ++a) {
const void* commands = GetPut();
GLint alignment = unpack_alignments[a];
@@ -2513,7 +2511,7 @@ TEST_F(GLES3ImplementationTest, SubImage3DUnpack) {
}
for (int sub = 0; sub < 2; ++sub) {
- for (size_t a = 0; a < base::size(unpack_alignments); ++a) {
+ for (size_t a = 0; a < std::size(unpack_alignments); ++a) {
const void* commands = GetPut();
GLint alignment = unpack_alignments[a];
@@ -2675,9 +2673,9 @@ TEST_F(GLES2ImplementationTest, TextureInvalidArguments) {
// aux check.
const GLenum kCompressedFormat = GL_ETC1_RGB8_OES;
gl_->CompressedTexImage2D(kTarget, kLevel, kCompressedFormat, kWidth, kHeight,
- kBorder, base::size(pixels), pixels);
+ kBorder, std::size(pixels), pixels);
- // In the above, kCompressedFormat and base::size(pixels) are possibly wrong
+ // In the above, kCompressedFormat and std::size(pixels) are possibly wrong
// values. First ensure that these do not cause failures at the client. If
// this check ever fails, it probably means that client checks more than at
// the time of writing of this test. In this case, more code needs to be
@@ -2689,7 +2687,7 @@ TEST_F(GLES2ImplementationTest, TextureInvalidArguments) {
// Changing border to invalid border should make the call fail at the client
// checks.
gl_->CompressedTexImage2D(kTarget, kLevel, kCompressedFormat, kWidth, kHeight,
- kInvalidBorder, base::size(pixels), pixels);
+ kInvalidBorder, std::size(pixels), pixels);
EXPECT_TRUE(NoCommandsWritten());
EXPECT_EQ(GL_INVALID_VALUE, CheckError());
}
@@ -3071,7 +3069,7 @@ TEST_F(GLES2ImplementationTest, BufferDataLargerThanTransferBuffer) {
ExpectedMemoryInfo mem2 = GetExpectedMemory(kUsableSize);
Cmds expected;
- expected.set_size.Init(GL_ARRAY_BUFFER, base::size(buf), 0, 0,
+ expected.set_size.Init(GL_ARRAY_BUFFER, std::size(buf), 0, 0,
GL_DYNAMIC_DRAW);
expected.copy_data1.Init(
GL_ARRAY_BUFFER, 0, kUsableSize, mem1.id, mem1.offset);
@@ -3079,7 +3077,7 @@ TEST_F(GLES2ImplementationTest, BufferDataLargerThanTransferBuffer) {
expected.copy_data2.Init(
GL_ARRAY_BUFFER, kUsableSize, kUsableSize, mem2.id, mem2.offset);
expected.set_token2.Init(GetNextToken());
- gl_->BufferData(GL_ARRAY_BUFFER, base::size(buf), buf, GL_DYNAMIC_DRAW);
+ gl_->BufferData(GL_ARRAY_BUFFER, std::size(buf), buf, GL_DYNAMIC_DRAW);
EXPECT_EQ(0, memcmp(&expected, commands_, sizeof(expected)));
}
@@ -3133,7 +3131,7 @@ TEST_F(GLES2ImplementationTest, CapabilitiesAreCached) {
};
Cmds expected;
- for (size_t ii = 0; ii < base::size(kStates); ++ii) {
+ for (size_t ii = 0; ii < std::size(kStates); ++ii) {
GLenum state = kStates[ii];
expected.enable_cmd.Init(state);
GLboolean result = gl_->IsEnabled(state);
@@ -3182,11 +3180,11 @@ TEST_F(GLES2ImplementationTest, BeginEndQueryEXT) {
GLuint data[2];
};
GenCmds expected_gen_cmds;
- expected_gen_cmds.gen.Init(base::size(expected_ids), &expected_ids[0]);
- GLuint ids[base::size(expected_ids)] = {
+ expected_gen_cmds.gen.Init(std::size(expected_ids), &expected_ids[0]);
+ GLuint ids[std::size(expected_ids)] = {
0,
};
- gl_->GenQueriesEXT(base::size(expected_ids), &ids[0]);
+ gl_->GenQueriesEXT(std::size(expected_ids), &ids[0]);
EXPECT_EQ(0, memcmp(
&expected_gen_cmds, commands_, sizeof(expected_gen_cmds)));
GLuint id1 = ids[0];
@@ -3372,11 +3370,11 @@ TEST_F(GLES2ImplementationTest, QueryCounterEXT) {
GLuint data[3];
};
GenCmds expected_gen_cmds;
- expected_gen_cmds.gen.Init(base::size(expected_ids), &expected_ids[0]);
- GLuint ids[base::size(expected_ids)] = {
+ expected_gen_cmds.gen.Init(std::size(expected_ids), &expected_ids[0]);
+ GLuint ids[std::size(expected_ids)] = {
0,
};
- gl_->GenQueriesEXT(base::size(expected_ids), &ids[0]);
+ gl_->GenQueriesEXT(std::size(expected_ids), &ids[0]);
EXPECT_EQ(0, memcmp(
&expected_gen_cmds, commands_, sizeof(expected_gen_cmds)));
GLuint id1 = ids[0];
@@ -3964,7 +3962,7 @@ TEST_F(GLES2ImplementationTest, VerifySyncTokensCHROMIUM) {
EXPECT_CALL(*gpu_control_, CanWaitUnverifiedSyncToken(sync_token))
.WillOnce(Return(true));
EXPECT_CALL(*gpu_control_, EnsureWorkVisible());
- gl_->VerifySyncTokensCHROMIUM(sync_token_datas, base::size(sync_token_datas));
+ gl_->VerifySyncTokensCHROMIUM(sync_token_datas, std::size(sync_token_datas));
EXPECT_TRUE(NoCommandsWritten());
EXPECT_EQ(GL_NO_ERROR, CheckError());
@@ -4021,7 +4019,7 @@ TEST_F(GLES2ImplementationTest, VerifySyncTokensCHROMIUM_Sequence) {
.InSequence(sequence)
.WillOnce(Return(true));
EXPECT_CALL(*gpu_control_, EnsureWorkVisible()).InSequence(sequence);
- gl_->VerifySyncTokensCHROMIUM(sync_token_datas, base::size(sync_token_datas));
+ gl_->VerifySyncTokensCHROMIUM(sync_token_datas, std::size(sync_token_datas));
EXPECT_EQ(GL_NO_ERROR, CheckError());
EXPECT_TRUE(sync_token1.verified_flush());
@@ -4044,7 +4042,7 @@ TEST_F(GLES2ImplementationTest, VerifySyncTokensCHROMIUM_EmptySyncToken) {
// Ensure proper sequence of checking and validating.
EXPECT_CALL(*gpu_control_, CanWaitUnverifiedSyncToken(_)).Times(0);
EXPECT_CALL(*gpu_control_, EnsureWorkVisible()).Times(0);
- gl_->VerifySyncTokensCHROMIUM(sync_token_datas, base::size(sync_token_datas));
+ gl_->VerifySyncTokensCHROMIUM(sync_token_datas, std::size(sync_token_datas));
EXPECT_TRUE(NoCommandsWritten());
EXPECT_EQ(GL_NO_ERROR, CheckError());
diff --git a/chromium/gpu/command_buffer/client/gles2_implementation_unittest_autogen.h b/chromium/gpu/command_buffer/client/gles2_implementation_unittest_autogen.h
index c7c3b16a382..ea92758bb27 100644
--- a/chromium/gpu/command_buffer/client/gles2_implementation_unittest_autogen.h
+++ b/chromium/gpu/command_buffer/client/gles2_implementation_unittest_autogen.h
@@ -377,10 +377,10 @@ TEST_F(GLES2ImplementationTest, DeleteBuffers) {
GLuint data[2];
};
Cmds expected;
- expected.del.Init(base::size(ids), &ids[0]);
+ expected.del.Init(std::size(ids), &ids[0]);
expected.data[0] = kBuffersStartId;
expected.data[1] = kBuffersStartId + 1;
- gl_->DeleteBuffers(base::size(ids), &ids[0]);
+ gl_->DeleteBuffers(std::size(ids), &ids[0]);
EXPECT_EQ(0, memcmp(&expected, commands_, sizeof(expected)));
}
@@ -391,10 +391,10 @@ TEST_F(GLES2ImplementationTest, DeleteFramebuffers) {
GLuint data[2];
};
Cmds expected;
- expected.del.Init(base::size(ids), &ids[0]);
+ expected.del.Init(std::size(ids), &ids[0]);
expected.data[0] = kFramebuffersStartId;
expected.data[1] = kFramebuffersStartId + 1;
- gl_->DeleteFramebuffers(base::size(ids), &ids[0]);
+ gl_->DeleteFramebuffers(std::size(ids), &ids[0]);
EXPECT_EQ(0, memcmp(&expected, commands_, sizeof(expected)));
}
@@ -416,10 +416,10 @@ TEST_F(GLES2ImplementationTest, DeleteRenderbuffers) {
GLuint data[2];
};
Cmds expected;
- expected.del.Init(base::size(ids), &ids[0]);
+ expected.del.Init(std::size(ids), &ids[0]);
expected.data[0] = kRenderbuffersStartId;
expected.data[1] = kRenderbuffersStartId + 1;
- gl_->DeleteRenderbuffers(base::size(ids), &ids[0]);
+ gl_->DeleteRenderbuffers(std::size(ids), &ids[0]);
EXPECT_EQ(0, memcmp(&expected, commands_, sizeof(expected)));
}
@@ -430,10 +430,10 @@ TEST_F(GLES2ImplementationTest, DeleteSamplers) {
GLuint data[2];
};
Cmds expected;
- expected.del.Init(base::size(ids), &ids[0]);
+ expected.del.Init(std::size(ids), &ids[0]);
expected.data[0] = kSamplersStartId;
expected.data[1] = kSamplersStartId + 1;
- gl_->DeleteSamplers(base::size(ids), &ids[0]);
+ gl_->DeleteSamplers(std::size(ids), &ids[0]);
EXPECT_EQ(0, memcmp(&expected, commands_, sizeof(expected)));
}
@@ -466,10 +466,10 @@ TEST_F(GLES2ImplementationTest, DeleteTextures) {
GLuint data[2];
};
Cmds expected;
- expected.del.Init(base::size(ids), &ids[0]);
+ expected.del.Init(std::size(ids), &ids[0]);
expected.data[0] = kTexturesStartId;
expected.data[1] = kTexturesStartId + 1;
- gl_->DeleteTextures(base::size(ids), &ids[0]);
+ gl_->DeleteTextures(std::size(ids), &ids[0]);
EXPECT_EQ(0, memcmp(&expected, commands_, sizeof(expected)));
}
@@ -480,10 +480,10 @@ TEST_F(GLES2ImplementationTest, DeleteTransformFeedbacks) {
GLuint data[2];
};
Cmds expected;
- expected.del.Init(base::size(ids), &ids[0]);
+ expected.del.Init(std::size(ids), &ids[0]);
expected.data[0] = kTransformFeedbacksStartId;
expected.data[1] = kTransformFeedbacksStartId + 1;
- gl_->DeleteTransformFeedbacks(base::size(ids), &ids[0]);
+ gl_->DeleteTransformFeedbacks(std::size(ids), &ids[0]);
EXPECT_EQ(0, memcmp(&expected, commands_, sizeof(expected)));
}
@@ -630,10 +630,10 @@ TEST_F(GLES2ImplementationTest, GenBuffers) {
GLuint data[2];
};
Cmds expected;
- expected.gen.Init(base::size(ids), &ids[0]);
+ expected.gen.Init(std::size(ids), &ids[0]);
expected.data[0] = kBuffersStartId;
expected.data[1] = kBuffersStartId + 1;
- gl_->GenBuffers(base::size(ids), &ids[0]);
+ gl_->GenBuffers(std::size(ids), &ids[0]);
EXPECT_EQ(0, memcmp(&expected, commands_, sizeof(expected)));
EXPECT_EQ(kBuffersStartId, ids[0]);
EXPECT_EQ(kBuffersStartId + 1, ids[1]);
@@ -659,10 +659,10 @@ TEST_F(GLES2ImplementationTest, GenFramebuffers) {
GLuint data[2];
};
Cmds expected;
- expected.gen.Init(base::size(ids), &ids[0]);
+ expected.gen.Init(std::size(ids), &ids[0]);
expected.data[0] = kFramebuffersStartId;
expected.data[1] = kFramebuffersStartId + 1;
- gl_->GenFramebuffers(base::size(ids), &ids[0]);
+ gl_->GenFramebuffers(std::size(ids), &ids[0]);
EXPECT_EQ(0, memcmp(&expected, commands_, sizeof(expected)));
EXPECT_EQ(kFramebuffersStartId, ids[0]);
EXPECT_EQ(kFramebuffersStartId + 1, ids[1]);
@@ -677,10 +677,10 @@ TEST_F(GLES2ImplementationTest, GenRenderbuffers) {
GLuint data[2];
};
Cmds expected;
- expected.gen.Init(base::size(ids), &ids[0]);
+ expected.gen.Init(std::size(ids), &ids[0]);
expected.data[0] = kRenderbuffersStartId;
expected.data[1] = kRenderbuffersStartId + 1;
- gl_->GenRenderbuffers(base::size(ids), &ids[0]);
+ gl_->GenRenderbuffers(std::size(ids), &ids[0]);
EXPECT_EQ(0, memcmp(&expected, commands_, sizeof(expected)));
EXPECT_EQ(kRenderbuffersStartId, ids[0]);
EXPECT_EQ(kRenderbuffersStartId + 1, ids[1]);
@@ -695,10 +695,10 @@ TEST_F(GLES2ImplementationTest, GenSamplers) {
GLuint data[2];
};
Cmds expected;
- expected.gen.Init(base::size(ids), &ids[0]);
+ expected.gen.Init(std::size(ids), &ids[0]);
expected.data[0] = kSamplersStartId;
expected.data[1] = kSamplersStartId + 1;
- gl_->GenSamplers(base::size(ids), &ids[0]);
+ gl_->GenSamplers(std::size(ids), &ids[0]);
EXPECT_EQ(0, memcmp(&expected, commands_, sizeof(expected)));
EXPECT_EQ(kSamplersStartId, ids[0]);
EXPECT_EQ(kSamplersStartId + 1, ids[1]);
@@ -713,10 +713,10 @@ TEST_F(GLES2ImplementationTest, GenTextures) {
GLuint data[2];
};
Cmds expected;
- expected.gen.Init(base::size(ids), &ids[0]);
+ expected.gen.Init(std::size(ids), &ids[0]);
expected.data[0] = kTexturesStartId;
expected.data[1] = kTexturesStartId + 1;
- gl_->GenTextures(base::size(ids), &ids[0]);
+ gl_->GenTextures(std::size(ids), &ids[0]);
EXPECT_EQ(0, memcmp(&expected, commands_, sizeof(expected)));
EXPECT_EQ(kTexturesStartId, ids[0]);
EXPECT_EQ(kTexturesStartId + 1, ids[1]);
@@ -731,10 +731,10 @@ TEST_F(GLES2ImplementationTest, GenTransformFeedbacks) {
GLuint data[2];
};
Cmds expected;
- expected.gen.Init(base::size(ids), &ids[0]);
+ expected.gen.Init(std::size(ids), &ids[0]);
expected.data[0] = kTransformFeedbacksStartId;
expected.data[1] = kTransformFeedbacksStartId + 1;
- gl_->GenTransformFeedbacks(base::size(ids), &ids[0]);
+ gl_->GenTransformFeedbacks(std::size(ids), &ids[0]);
EXPECT_EQ(0, memcmp(&expected, commands_, sizeof(expected)));
EXPECT_EQ(kTransformFeedbacksStartId, ids[0]);
EXPECT_EQ(kTransformFeedbacksStartId + 1, ids[1]);
@@ -2602,10 +2602,10 @@ TEST_F(GLES2ImplementationTest, GenQueriesEXT) {
GLuint data[2];
};
Cmds expected;
- expected.gen.Init(base::size(ids), &ids[0]);
+ expected.gen.Init(std::size(ids), &ids[0]);
expected.data[0] = kQueriesStartId;
expected.data[1] = kQueriesStartId + 1;
- gl_->GenQueriesEXT(base::size(ids), &ids[0]);
+ gl_->GenQueriesEXT(std::size(ids), &ids[0]);
EXPECT_EQ(0, memcmp(&expected, commands_, sizeof(expected)));
EXPECT_EQ(kQueriesStartId, ids[0]);
EXPECT_EQ(kQueriesStartId + 1, ids[1]);
@@ -2618,10 +2618,10 @@ TEST_F(GLES2ImplementationTest, DeleteQueriesEXT) {
GLuint data[2];
};
Cmds expected;
- expected.del.Init(base::size(ids), &ids[0]);
+ expected.del.Init(std::size(ids), &ids[0]);
expected.data[0] = kQueriesStartId;
expected.data[1] = kQueriesStartId + 1;
- gl_->DeleteQueriesEXT(base::size(ids), &ids[0]);
+ gl_->DeleteQueriesEXT(std::size(ids), &ids[0]);
EXPECT_EQ(0, memcmp(&expected, commands_, sizeof(expected)));
}
@@ -2667,10 +2667,10 @@ TEST_F(GLES2ImplementationTest, GenVertexArraysOES) {
GLuint data[2];
};
Cmds expected;
- expected.gen.Init(base::size(ids), &ids[0]);
+ expected.gen.Init(std::size(ids), &ids[0]);
expected.data[0] = kVertexArraysStartId;
expected.data[1] = kVertexArraysStartId + 1;
- gl_->GenVertexArraysOES(base::size(ids), &ids[0]);
+ gl_->GenVertexArraysOES(std::size(ids), &ids[0]);
EXPECT_EQ(0, memcmp(&expected, commands_, sizeof(expected)));
EXPECT_EQ(kVertexArraysStartId, ids[0]);
EXPECT_EQ(kVertexArraysStartId + 1, ids[1]);
@@ -2683,10 +2683,10 @@ TEST_F(GLES2ImplementationTest, DeleteVertexArraysOES) {
GLuint data[2];
};
Cmds expected;
- expected.del.Init(base::size(ids), &ids[0]);
+ expected.del.Init(std::size(ids), &ids[0]);
expected.data[0] = kVertexArraysStartId;
expected.data[1] = kVertexArraysStartId + 1;
- gl_->DeleteVertexArraysOES(base::size(ids), &ids[0]);
+ gl_->DeleteVertexArraysOES(std::size(ids), &ids[0]);
EXPECT_EQ(0, memcmp(&expected, commands_, sizeof(expected)));
}
diff --git a/chromium/gpu/command_buffer/client/program_info_manager_unittest.cc b/chromium/gpu/command_buffer/client/program_info_manager_unittest.cc
index 812615aa4a7..e46ba1ea3e9 100644
--- a/chromium/gpu/command_buffer/client/program_info_manager_unittest.cc
+++ b/chromium/gpu/command_buffer/client/program_info_manager_unittest.cc
@@ -2,14 +2,14 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
+#include "gpu/command_buffer/client/program_info_manager.h"
+
#include <stddef.h>
#include <stdint.h>
#include <memory>
-#include "base/cxx17_backports.h"
#include "base/memory/raw_ptr.h"
-#include "gpu/command_buffer/client/program_info_manager.h"
#include "testing/gtest/include/gtest/gtest.h"
namespace {
@@ -102,8 +102,8 @@ class ProgramInfoManagerTest : public testing::Test {
data->uniform_loc0[0] = 1;
data->uniform_loc1[0] = 2;
data->uniform_loc1[1] = 3;
- memcpy(data->uniform_name0, kName[0], base::size(data->uniform_name0));
- memcpy(data->uniform_name1, kName[1], base::size(data->uniform_name1));
+ memcpy(data->uniform_name0, kName[0], std::size(data->uniform_name0));
+ memcpy(data->uniform_name1, kName[1], std::size(data->uniform_name1));
}
void SetupUniformBlocksData(UniformBlocksData* data) {
@@ -117,23 +117,23 @@ class ProgramInfoManagerTest : public testing::Test {
data->entry[0].binding = 0;
data->entry[0].data_size = 8;
data->entry[0].name_offset = ComputeOffset(data, data->name0);
- data->entry[0].name_length = base::size(data->name0);
- data->entry[0].active_uniforms = base::size(data->indices0);
+ data->entry[0].name_length = std::size(data->name0);
+ data->entry[0].active_uniforms = std::size(data->indices0);
data->entry[0].active_uniform_offset = ComputeOffset(data, data->indices0);
data->entry[0].referenced_by_vertex_shader = static_cast<uint32_t>(true);
data->entry[0].referenced_by_fragment_shader = static_cast<uint32_t>(false);
data->entry[1].binding = 1;
data->entry[1].data_size = 4;
data->entry[1].name_offset = ComputeOffset(data, data->name1);
- data->entry[1].name_length = base::size(data->name1);
- data->entry[1].active_uniforms = base::size(data->indices1);
+ data->entry[1].name_length = std::size(data->name1);
+ data->entry[1].active_uniforms = std::size(data->indices1);
data->entry[1].active_uniform_offset = ComputeOffset(data, data->indices1);
data->entry[1].referenced_by_vertex_shader = static_cast<uint32_t>(false);
data->entry[1].referenced_by_fragment_shader = static_cast<uint32_t>(true);
- memcpy(data->name0, kName[0], base::size(data->name0));
+ memcpy(data->name0, kName[0], std::size(data->name0));
data->indices0[0] = kIndices[0][0];
data->indices0[1] = kIndices[0][1];
- memcpy(data->name1, kName[1], base::size(data->name1));
+ memcpy(data->name1, kName[1], std::size(data->name1));
data->indices1[0] = kIndices[1][0];
}
@@ -160,13 +160,13 @@ class ProgramInfoManagerTest : public testing::Test {
data->entry[0].size = 1;
data->entry[0].type = GL_FLOAT_VEC2;
data->entry[0].name_offset = ComputeOffset(data, data->name0);
- data->entry[0].name_length = base::size(data->name0);
+ data->entry[0].name_length = std::size(data->name0);
data->entry[1].size = 2;
data->entry[1].type = GL_FLOAT;
data->entry[1].name_offset = ComputeOffset(data, data->name1);
- data->entry[1].name_length = base::size(data->name1);
- memcpy(data->name0, kName[0], base::size(data->name0));
- memcpy(data->name1, kName[1], base::size(data->name1));
+ data->entry[1].name_length = std::size(data->name1);
+ memcpy(data->name0, kName[0], std::size(data->name0));
+ memcpy(data->name1, kName[1], std::size(data->name1));
}
std::unique_ptr<ProgramInfoManager> program_info_manager_;
diff --git a/chromium/gpu/command_buffer/client/query_tracker_unittest.cc b/chromium/gpu/command_buffer/client/query_tracker_unittest.cc
index 2015578e610..2606edacc3a 100644
--- a/chromium/gpu/command_buffer/client/query_tracker_unittest.cc
+++ b/chromium/gpu/command_buffer/client/query_tracker_unittest.cc
@@ -13,7 +13,6 @@
#include <memory>
#include <vector>
-#include "base/cxx17_backports.h"
#include "gpu/command_buffer/client/client_test_helper.h"
#include "gpu/command_buffer/client/gles2_cmd_helper.h"
#include "gpu/command_buffer/client/mapped_memory.h"
@@ -60,7 +59,7 @@ TEST_F(QuerySyncManagerTest, Basic) {
QuerySyncManager::QueryInfo infos[4];
memset(&infos, 0xBD, sizeof(infos));
- for (size_t ii = 0; ii < base::size(infos); ++ii) {
+ for (size_t ii = 0; ii < std::size(infos); ++ii) {
EXPECT_TRUE(sync_manager_->Alloc(&infos[ii]));
ASSERT_TRUE(infos[ii].sync != nullptr);
EXPECT_EQ(0, infos[ii].sync->process_count);
@@ -68,7 +67,7 @@ TEST_F(QuerySyncManagerTest, Basic) {
EXPECT_EQ(0, infos[ii].submit_count);
}
- for (size_t ii = 0; ii < base::size(infos); ++ii) {
+ for (size_t ii = 0; ii < std::size(infos); ++ii) {
sync_manager_->Free(infos[ii]);
}
}
@@ -77,7 +76,7 @@ TEST_F(QuerySyncManagerTest, DontFree) {
QuerySyncManager::QueryInfo infos[4];
memset(&infos, 0xBD, sizeof(infos));
- for (size_t ii = 0; ii < base::size(infos); ++ii) {
+ for (size_t ii = 0; ii < std::size(infos); ++ii) {
EXPECT_TRUE(sync_manager_->Alloc(&infos[ii]));
}
}
diff --git a/chromium/gpu/command_buffer/client/raster_cmd_helper_autogen.h b/chromium/gpu/command_buffer/client/raster_cmd_helper_autogen.h
index 0c20f99c06e..e445c0255c0 100644
--- a/chromium/gpu/command_buffer/client/raster_cmd_helper_autogen.h
+++ b/chromium/gpu/command_buffer/client/raster_cmd_helper_autogen.h
@@ -93,6 +93,7 @@ void BeginRasterCHROMIUMImmediate(GLuint sk_color,
GLuint msaa_sample_count,
gpu::raster::MsaaMode msaa_mode,
GLboolean can_use_lcd_text,
+ GLboolean visible,
const GLbyte* mailbox) {
const uint32_t size =
raster::cmds::BeginRasterCHROMIUMImmediate::ComputeSize();
@@ -101,7 +102,7 @@ void BeginRasterCHROMIUMImmediate(GLuint sk_color,
size);
if (c) {
c->Init(sk_color, needs_clear, msaa_sample_count, msaa_mode,
- can_use_lcd_text, mailbox);
+ can_use_lcd_text, visible, mailbox);
}
}
diff --git a/chromium/gpu/command_buffer/client/raster_implementation.cc b/chromium/gpu/command_buffer/client/raster_implementation.cc
index 8069aa97de0..2a43b28a56c 100644
--- a/chromium/gpu/command_buffer/client/raster_implementation.cc
+++ b/chromium/gpu/command_buffer/client/raster_implementation.cc
@@ -42,6 +42,7 @@
#include "gpu/command_buffer/client/raster_cmd_helper.h"
#include "gpu/command_buffer/client/shared_memory_limits.h"
#include "gpu/command_buffer/client/transfer_buffer.h"
+#include "third_party/skia/include/core/SkColorSpace.h"
#include "ui/base/ui_base_features.h"
#include "ui/gfx/color_space.h"
#include "ui/gfx/geometry/rect.h"
@@ -1335,13 +1336,14 @@ void RasterImplementation::BeginRasterCHROMIUM(
GLuint msaa_sample_count,
MsaaMode msaa_mode,
GLboolean can_use_lcd_text,
+ GLboolean visible,
const gfx::ColorSpace& color_space,
const GLbyte* mailbox) {
DCHECK(!raster_properties_);
helper_->BeginRasterCHROMIUMImmediate(sk_color, needs_clear,
msaa_sample_count, msaa_mode,
- can_use_lcd_text, mailbox);
+ can_use_lcd_text, visible, mailbox);
raster_properties_.emplace(sk_color, can_use_lcd_text,
color_space.ToSkColorSpace());
diff --git a/chromium/gpu/command_buffer/client/raster_implementation.h b/chromium/gpu/command_buffer/client/raster_implementation.h
index 7116673f5d7..fdd547e776b 100644
--- a/chromium/gpu/command_buffer/client/raster_implementation.h
+++ b/chromium/gpu/command_buffer/client/raster_implementation.h
@@ -152,6 +152,7 @@ class RASTER_EXPORT RasterImplementation : public RasterInterface,
GLuint msaa_sample_count,
MsaaMode msaa_mode,
GLboolean can_use_lcd_text,
+ GLboolean visible,
const gfx::ColorSpace& color_space,
const GLbyte* mailbox) override;
void RasterCHROMIUM(const cc::DisplayItemList* list,
diff --git a/chromium/gpu/command_buffer/client/raster_implementation_gles.cc b/chromium/gpu/command_buffer/client/raster_implementation_gles.cc
index 24dc1efcf41..0adfbfeccac 100644
--- a/chromium/gpu/command_buffer/client/raster_implementation_gles.cc
+++ b/chromium/gpu/command_buffer/client/raster_implementation_gles.cc
@@ -221,6 +221,7 @@ void RasterImplementationGLES::BeginRasterCHROMIUM(
GLuint msaa_sample_count,
MsaaMode msaa_mode,
GLboolean can_use_lcd_text,
+ GLboolean visible,
const gfx::ColorSpace& color_space,
const GLbyte* mailbox) {
NOTREACHED();
diff --git a/chromium/gpu/command_buffer/client/raster_implementation_gles.h b/chromium/gpu/command_buffer/client/raster_implementation_gles.h
index f7505573acd..1142dbdef6b 100644
--- a/chromium/gpu/command_buffer/client/raster_implementation_gles.h
+++ b/chromium/gpu/command_buffer/client/raster_implementation_gles.h
@@ -95,6 +95,7 @@ class RASTER_EXPORT RasterImplementationGLES : public RasterInterface {
GLuint msaa_sample_count,
MsaaMode msaa_mode,
GLboolean can_use_lcd_text,
+ GLboolean visible,
const gfx::ColorSpace& color_space,
const GLbyte* mailbox) override;
void RasterCHROMIUM(const cc::DisplayItemList* list,
diff --git a/chromium/gpu/command_buffer/client/raster_implementation_unittest.cc b/chromium/gpu/command_buffer/client/raster_implementation_unittest.cc
index 14f9ab9c870..a3c33862e3e 100644
--- a/chromium/gpu/command_buffer/client/raster_implementation_unittest.cc
+++ b/chromium/gpu/command_buffer/client/raster_implementation_unittest.cc
@@ -8,7 +8,6 @@
#include <GLES2/gl2.h>
#include <GLES2/gl2extchromium.h>
-
#include <stddef.h>
#include <stdint.h>
@@ -16,7 +15,6 @@
#include "base/bind.h"
#include "base/compiler_specific.h"
-#include "base/cxx17_backports.h"
#include "base/memory/ptr_util.h"
#include "base/memory/raw_ptr.h"
#include "cc/paint/raw_memory_transfer_cache_entry.h"
@@ -398,11 +396,11 @@ TEST_F(RasterImplementationTest, BeginEndQueryEXT) {
GLuint data[2];
};
GenCmds expected_gen_cmds;
- expected_gen_cmds.gen.Init(base::size(expected_ids), &expected_ids[0]);
- GLuint ids[base::size(expected_ids)] = {
+ expected_gen_cmds.gen.Init(std::size(expected_ids), &expected_ids[0]);
+ GLuint ids[std::size(expected_ids)] = {
0,
};
- gl_->GenQueriesEXT(base::size(expected_ids), &ids[0]);
+ gl_->GenQueriesEXT(std::size(expected_ids), &ids[0]);
EXPECT_EQ(0,
memcmp(&expected_gen_cmds, commands_, sizeof(expected_gen_cmds)));
GLuint id1 = ids[0];
@@ -574,7 +572,7 @@ TEST_F(RasterImplementationTest, VerifySyncTokensCHROMIUM) {
EXPECT_CALL(*gpu_control_, CanWaitUnverifiedSyncToken(sync_token))
.WillOnce(Return(true));
EXPECT_CALL(*gpu_control_, EnsureWorkVisible());
- gl_->VerifySyncTokensCHROMIUM(sync_token_datas, base::size(sync_token_datas));
+ gl_->VerifySyncTokensCHROMIUM(sync_token_datas, std::size(sync_token_datas));
EXPECT_TRUE(NoCommandsWritten());
EXPECT_EQ(GL_NO_ERROR, CheckError());
@@ -631,7 +629,7 @@ TEST_F(RasterImplementationTest, VerifySyncTokensCHROMIUM_Sequence) {
.InSequence(sequence)
.WillOnce(Return(true));
EXPECT_CALL(*gpu_control_, EnsureWorkVisible()).InSequence(sequence);
- gl_->VerifySyncTokensCHROMIUM(sync_token_datas, base::size(sync_token_datas));
+ gl_->VerifySyncTokensCHROMIUM(sync_token_datas, std::size(sync_token_datas));
EXPECT_EQ(GL_NO_ERROR, CheckError());
EXPECT_TRUE(sync_token1.verified_flush());
@@ -654,7 +652,7 @@ TEST_F(RasterImplementationTest, VerifySyncTokensCHROMIUM_EmptySyncToken) {
// Ensure proper sequence of checking and validating.
EXPECT_CALL(*gpu_control_, CanWaitUnverifiedSyncToken(_)).Times(0);
EXPECT_CALL(*gpu_control_, EnsureWorkVisible()).Times(0);
- gl_->VerifySyncTokensCHROMIUM(sync_token_datas, base::size(sync_token_datas));
+ gl_->VerifySyncTokensCHROMIUM(sync_token_datas, std::size(sync_token_datas));
EXPECT_TRUE(NoCommandsWritten());
EXPECT_EQ(GL_NO_ERROR, CheckError());
diff --git a/chromium/gpu/command_buffer/client/raster_implementation_unittest_autogen.h b/chromium/gpu/command_buffer/client/raster_implementation_unittest_autogen.h
index bd95a044ab3..c5004a63827 100644
--- a/chromium/gpu/command_buffer/client/raster_implementation_unittest_autogen.h
+++ b/chromium/gpu/command_buffer/client/raster_implementation_unittest_autogen.h
@@ -33,10 +33,10 @@ TEST_F(RasterImplementationTest, GenQueriesEXT) {
GLuint data[2];
};
Cmds expected;
- expected.gen.Init(base::size(ids), &ids[0]);
+ expected.gen.Init(std::size(ids), &ids[0]);
expected.data[0] = kQueriesStartId;
expected.data[1] = kQueriesStartId + 1;
- gl_->GenQueriesEXT(base::size(ids), &ids[0]);
+ gl_->GenQueriesEXT(std::size(ids), &ids[0]);
EXPECT_EQ(0, memcmp(&expected, commands_, sizeof(expected)));
EXPECT_EQ(kQueriesStartId, ids[0]);
EXPECT_EQ(kQueriesStartId + 1, ids[1]);
@@ -49,10 +49,10 @@ TEST_F(RasterImplementationTest, DeleteQueriesEXT) {
GLuint data[2];
};
Cmds expected;
- expected.del.Init(base::size(ids), &ids[0]);
+ expected.del.Init(std::size(ids), &ids[0]);
expected.data[0] = kQueriesStartId;
expected.data[1] = kQueriesStartId + 1;
- gl_->DeleteQueriesEXT(base::size(ids), &ids[0]);
+ gl_->DeleteQueriesEXT(std::size(ids), &ids[0]);
EXPECT_EQ(0, memcmp(&expected, commands_, sizeof(expected)));
}
diff --git a/chromium/gpu/command_buffer/client/raster_interface.h b/chromium/gpu/command_buffer/client/raster_interface.h
index 96f90982dc6..e43b373e21f 100644
--- a/chromium/gpu/command_buffer/client/raster_interface.h
+++ b/chromium/gpu/command_buffer/client/raster_interface.h
@@ -89,6 +89,7 @@ class RasterInterface : public InterfaceBase {
GLuint msaa_sample_count,
MsaaMode msaa_mode,
GLboolean can_use_lcd_text,
+ GLboolean visible,
const gfx::ColorSpace& color_space,
const GLbyte* mailbox) = 0;
diff --git a/chromium/gpu/command_buffer/client/vertex_array_object_manager_unittest.cc b/chromium/gpu/command_buffer/client/vertex_array_object_manager_unittest.cc
index b536128506e..32c7e68be41 100644
--- a/chromium/gpu/command_buffer/client/vertex_array_object_manager_unittest.cc
+++ b/chromium/gpu/command_buffer/client/vertex_array_object_manager_unittest.cc
@@ -6,13 +6,11 @@
#include <GLES2/gl2ext.h>
#include <GLES3/gl3.h>
-
#include <stddef.h>
#include <stdint.h>
#include <memory>
-#include "base/cxx17_backports.h"
#include "testing/gtest/include/gtest/gtest.h"
namespace gpu {
@@ -79,9 +77,9 @@ TEST_F(VertexArrayObjectManagerTest, UnbindBuffer) {
const GLuint kElementArray = 789;
bool changed = false;
GLuint ids[2] = { 1, 3, };
- manager_->GenVertexArrays(base::size(ids), ids);
+ manager_->GenVertexArrays(std::size(ids), ids);
// Bind buffers to attribs on 2 vaos.
- for (size_t ii = 0; ii < base::size(ids); ++ii) {
+ for (size_t ii = 0; ii < std::size(ids); ++ii) {
EXPECT_TRUE(manager_->BindVertexArray(ids[ii], &changed));
EXPECT_TRUE(manager_->SetAttribPointer(
kBufferToUnbind, 0, 4, GL_FLOAT, false, 0, 0, GL_FALSE));
@@ -115,7 +113,7 @@ TEST_F(VertexArrayObjectManagerTest, UnbindBuffer) {
static const GLuint expected_element_array[] = {
0, kElementArray,
};
- for (size_t ii = 0; ii < base::size(ids); ++ii) {
+ for (size_t ii = 0; ii < std::size(ids); ++ii) {
EXPECT_TRUE(manager_->BindVertexArray(ids[ii], &changed));
for (size_t jj = 0; jj < 4; ++jj) {
uint32_t param = 1;
@@ -198,7 +196,7 @@ TEST_F(VertexArrayObjectManagerTest, HaveEnabledClientSideArrays) {
TEST_F(VertexArrayObjectManagerTest, BindElementArray) {
bool changed = false;
GLuint ids[2] = { 1, 3, };
- manager_->GenVertexArrays(base::size(ids), ids);
+ manager_->GenVertexArrays(std::size(ids), ids);
// Check the default element array is 0.
EXPECT_EQ(0u, manager_->bound_element_array_buffer());
@@ -238,7 +236,7 @@ TEST_F(VertexArrayObjectManagerTest, GenBindDelete) {
EXPECT_FALSE(changed);
GLuint ids[2] = { 1, 3, };
- manager_->GenVertexArrays(base::size(ids), ids);
+ manager_->GenVertexArrays(std::size(ids), ids);
// Check Genned arrays succeed.
EXPECT_TRUE(manager_->BindVertexArray(1, &changed));
EXPECT_TRUE(changed);
diff --git a/chromium/gpu/command_buffer/common/gles2_cmd_format.cc b/chromium/gpu/command_buffer/common/gles2_cmd_format.cc
index b66cf964e87..cdad2e1c8e1 100644
--- a/chromium/gpu/command_buffer/common/gles2_cmd_format.cc
+++ b/chromium/gpu/command_buffer/common/gles2_cmd_format.cc
@@ -8,11 +8,9 @@
// We explicitly do NOT include gles2_cmd_format.h here because client side
// and service side have different requirements.
-#include "gpu/command_buffer/common/cmd_buffer_common.h"
-
#include <stddef.h>
-#include "base/cxx17_backports.h"
+#include "gpu/command_buffer/common/cmd_buffer_common.h"
namespace gpu {
namespace gles2 {
@@ -29,7 +27,7 @@ const char* GetCommandName(CommandId id) {
};
size_t index = static_cast<size_t>(id) - kFirstGLES2Command;
- return (index < base::size(names)) ? names[index] : "*unknown-command*";
+ return (index < std::size(names)) ? names[index] : "*unknown-command*";
}
} // namespace gles2
diff --git a/chromium/gpu/command_buffer/common/gles2_cmd_format_autogen.h b/chromium/gpu/command_buffer/common/gles2_cmd_format_autogen.h
index 98961dbaef5..3c392f592bb 100644
--- a/chromium/gpu/command_buffer/common/gles2_cmd_format_autogen.h
+++ b/chromium/gpu/command_buffer/common/gles2_cmd_format_autogen.h
@@ -11,9 +11,9 @@
#ifndef GPU_COMMAND_BUFFER_COMMON_GLES2_CMD_FORMAT_AUTOGEN_H_
#define GPU_COMMAND_BUFFER_COMMON_GLES2_CMD_FORMAT_AUTOGEN_H_
-#define GL_SYNC_FLUSH_COMMANDS_BIT 0x00000001
-#define GL_SYNC_GPU_COMMANDS_COMPLETE 0x9117
#define GL_SCANOUT_CHROMIUM 0x6000
+#define GL_SYNC_GPU_COMMANDS_COMPLETE 0x9117
+#define GL_SYNC_FLUSH_COMMANDS_BIT 0x00000001
struct ActiveTexture {
typedef ActiveTexture ValueType;
diff --git a/chromium/gpu/command_buffer/common/gles2_cmd_format_test_autogen.h b/chromium/gpu/command_buffer/common/gles2_cmd_format_test_autogen.h
index e32c97f76ad..6f23f44bec6 100644
--- a/chromium/gpu/command_buffer/common/gles2_cmd_format_test_autogen.h
+++ b/chromium/gpu/command_buffer/common/gles2_cmd_format_test_autogen.h
@@ -733,15 +733,15 @@ TEST_F(GLES2FormatTest, DeleteBuffersImmediate) {
};
cmds::DeleteBuffersImmediate& cmd =
*GetBufferAs<cmds::DeleteBuffersImmediate>();
- void* next_cmd = cmd.Set(&cmd, static_cast<GLsizei>(base::size(ids)), ids);
+ void* next_cmd = cmd.Set(&cmd, static_cast<GLsizei>(std::size(ids)), ids);
EXPECT_EQ(static_cast<uint32_t>(cmds::DeleteBuffersImmediate::kCmdId),
cmd.header.command);
EXPECT_EQ(sizeof(cmd) + RoundSizeToMultipleOfEntries(cmd.n * 4u),
cmd.header.size * 4u);
- EXPECT_EQ(static_cast<GLsizei>(base::size(ids)), cmd.n);
+ EXPECT_EQ(static_cast<GLsizei>(std::size(ids)), cmd.n);
CheckBytesWrittenMatchesExpectedSize(
next_cmd,
- sizeof(cmd) + RoundSizeToMultipleOfEntries(base::size(ids) * 4u));
+ sizeof(cmd) + RoundSizeToMultipleOfEntries(std::size(ids) * 4u));
EXPECT_EQ(0, memcmp(ids, ImmediateDataAddress(&cmd), sizeof(ids)));
}
@@ -753,15 +753,15 @@ TEST_F(GLES2FormatTest, DeleteFramebuffersImmediate) {
};
cmds::DeleteFramebuffersImmediate& cmd =
*GetBufferAs<cmds::DeleteFramebuffersImmediate>();
- void* next_cmd = cmd.Set(&cmd, static_cast<GLsizei>(base::size(ids)), ids);
+ void* next_cmd = cmd.Set(&cmd, static_cast<GLsizei>(std::size(ids)), ids);
EXPECT_EQ(static_cast<uint32_t>(cmds::DeleteFramebuffersImmediate::kCmdId),
cmd.header.command);
EXPECT_EQ(sizeof(cmd) + RoundSizeToMultipleOfEntries(cmd.n * 4u),
cmd.header.size * 4u);
- EXPECT_EQ(static_cast<GLsizei>(base::size(ids)), cmd.n);
+ EXPECT_EQ(static_cast<GLsizei>(std::size(ids)), cmd.n);
CheckBytesWrittenMatchesExpectedSize(
next_cmd,
- sizeof(cmd) + RoundSizeToMultipleOfEntries(base::size(ids) * 4u));
+ sizeof(cmd) + RoundSizeToMultipleOfEntries(std::size(ids) * 4u));
EXPECT_EQ(0, memcmp(ids, ImmediateDataAddress(&cmd), sizeof(ids)));
}
@@ -783,15 +783,15 @@ TEST_F(GLES2FormatTest, DeleteRenderbuffersImmediate) {
};
cmds::DeleteRenderbuffersImmediate& cmd =
*GetBufferAs<cmds::DeleteRenderbuffersImmediate>();
- void* next_cmd = cmd.Set(&cmd, static_cast<GLsizei>(base::size(ids)), ids);
+ void* next_cmd = cmd.Set(&cmd, static_cast<GLsizei>(std::size(ids)), ids);
EXPECT_EQ(static_cast<uint32_t>(cmds::DeleteRenderbuffersImmediate::kCmdId),
cmd.header.command);
EXPECT_EQ(sizeof(cmd) + RoundSizeToMultipleOfEntries(cmd.n * 4u),
cmd.header.size * 4u);
- EXPECT_EQ(static_cast<GLsizei>(base::size(ids)), cmd.n);
+ EXPECT_EQ(static_cast<GLsizei>(std::size(ids)), cmd.n);
CheckBytesWrittenMatchesExpectedSize(
next_cmd,
- sizeof(cmd) + RoundSizeToMultipleOfEntries(base::size(ids) * 4u));
+ sizeof(cmd) + RoundSizeToMultipleOfEntries(std::size(ids) * 4u));
EXPECT_EQ(0, memcmp(ids, ImmediateDataAddress(&cmd), sizeof(ids)));
}
@@ -803,15 +803,15 @@ TEST_F(GLES2FormatTest, DeleteSamplersImmediate) {
};
cmds::DeleteSamplersImmediate& cmd =
*GetBufferAs<cmds::DeleteSamplersImmediate>();
- void* next_cmd = cmd.Set(&cmd, static_cast<GLsizei>(base::size(ids)), ids);
+ void* next_cmd = cmd.Set(&cmd, static_cast<GLsizei>(std::size(ids)), ids);
EXPECT_EQ(static_cast<uint32_t>(cmds::DeleteSamplersImmediate::kCmdId),
cmd.header.command);
EXPECT_EQ(sizeof(cmd) + RoundSizeToMultipleOfEntries(cmd.n * 4u),
cmd.header.size * 4u);
- EXPECT_EQ(static_cast<GLsizei>(base::size(ids)), cmd.n);
+ EXPECT_EQ(static_cast<GLsizei>(std::size(ids)), cmd.n);
CheckBytesWrittenMatchesExpectedSize(
next_cmd,
- sizeof(cmd) + RoundSizeToMultipleOfEntries(base::size(ids) * 4u));
+ sizeof(cmd) + RoundSizeToMultipleOfEntries(std::size(ids) * 4u));
EXPECT_EQ(0, memcmp(ids, ImmediateDataAddress(&cmd), sizeof(ids)));
}
@@ -843,15 +843,15 @@ TEST_F(GLES2FormatTest, DeleteTexturesImmediate) {
};
cmds::DeleteTexturesImmediate& cmd =
*GetBufferAs<cmds::DeleteTexturesImmediate>();
- void* next_cmd = cmd.Set(&cmd, static_cast<GLsizei>(base::size(ids)), ids);
+ void* next_cmd = cmd.Set(&cmd, static_cast<GLsizei>(std::size(ids)), ids);
EXPECT_EQ(static_cast<uint32_t>(cmds::DeleteTexturesImmediate::kCmdId),
cmd.header.command);
EXPECT_EQ(sizeof(cmd) + RoundSizeToMultipleOfEntries(cmd.n * 4u),
cmd.header.size * 4u);
- EXPECT_EQ(static_cast<GLsizei>(base::size(ids)), cmd.n);
+ EXPECT_EQ(static_cast<GLsizei>(std::size(ids)), cmd.n);
CheckBytesWrittenMatchesExpectedSize(
next_cmd,
- sizeof(cmd) + RoundSizeToMultipleOfEntries(base::size(ids) * 4u));
+ sizeof(cmd) + RoundSizeToMultipleOfEntries(std::size(ids) * 4u));
EXPECT_EQ(0, memcmp(ids, ImmediateDataAddress(&cmd), sizeof(ids)));
}
@@ -863,16 +863,16 @@ TEST_F(GLES2FormatTest, DeleteTransformFeedbacksImmediate) {
};
cmds::DeleteTransformFeedbacksImmediate& cmd =
*GetBufferAs<cmds::DeleteTransformFeedbacksImmediate>();
- void* next_cmd = cmd.Set(&cmd, static_cast<GLsizei>(base::size(ids)), ids);
+ void* next_cmd = cmd.Set(&cmd, static_cast<GLsizei>(std::size(ids)), ids);
EXPECT_EQ(
static_cast<uint32_t>(cmds::DeleteTransformFeedbacksImmediate::kCmdId),
cmd.header.command);
EXPECT_EQ(sizeof(cmd) + RoundSizeToMultipleOfEntries(cmd.n * 4u),
cmd.header.size * 4u);
- EXPECT_EQ(static_cast<GLsizei>(base::size(ids)), cmd.n);
+ EXPECT_EQ(static_cast<GLsizei>(std::size(ids)), cmd.n);
CheckBytesWrittenMatchesExpectedSize(
next_cmd,
- sizeof(cmd) + RoundSizeToMultipleOfEntries(base::size(ids) * 4u));
+ sizeof(cmd) + RoundSizeToMultipleOfEntries(std::size(ids) * 4u));
EXPECT_EQ(0, memcmp(ids, ImmediateDataAddress(&cmd), sizeof(ids)));
}
@@ -1076,15 +1076,15 @@ TEST_F(GLES2FormatTest, GenBuffersImmediate) {
34,
};
cmds::GenBuffersImmediate& cmd = *GetBufferAs<cmds::GenBuffersImmediate>();
- void* next_cmd = cmd.Set(&cmd, static_cast<GLsizei>(base::size(ids)), ids);
+ void* next_cmd = cmd.Set(&cmd, static_cast<GLsizei>(std::size(ids)), ids);
EXPECT_EQ(static_cast<uint32_t>(cmds::GenBuffersImmediate::kCmdId),
cmd.header.command);
EXPECT_EQ(sizeof(cmd) + RoundSizeToMultipleOfEntries(cmd.n * 4u),
cmd.header.size * 4u);
- EXPECT_EQ(static_cast<GLsizei>(base::size(ids)), cmd.n);
+ EXPECT_EQ(static_cast<GLsizei>(std::size(ids)), cmd.n);
CheckBytesWrittenMatchesExpectedSize(
next_cmd,
- sizeof(cmd) + RoundSizeToMultipleOfEntries(base::size(ids) * 4u));
+ sizeof(cmd) + RoundSizeToMultipleOfEntries(std::size(ids) * 4u));
EXPECT_EQ(0, memcmp(ids, ImmediateDataAddress(&cmd), sizeof(ids)));
}
@@ -1106,15 +1106,15 @@ TEST_F(GLES2FormatTest, GenFramebuffersImmediate) {
};
cmds::GenFramebuffersImmediate& cmd =
*GetBufferAs<cmds::GenFramebuffersImmediate>();
- void* next_cmd = cmd.Set(&cmd, static_cast<GLsizei>(base::size(ids)), ids);
+ void* next_cmd = cmd.Set(&cmd, static_cast<GLsizei>(std::size(ids)), ids);
EXPECT_EQ(static_cast<uint32_t>(cmds::GenFramebuffersImmediate::kCmdId),
cmd.header.command);
EXPECT_EQ(sizeof(cmd) + RoundSizeToMultipleOfEntries(cmd.n * 4u),
cmd.header.size * 4u);
- EXPECT_EQ(static_cast<GLsizei>(base::size(ids)), cmd.n);
+ EXPECT_EQ(static_cast<GLsizei>(std::size(ids)), cmd.n);
CheckBytesWrittenMatchesExpectedSize(
next_cmd,
- sizeof(cmd) + RoundSizeToMultipleOfEntries(base::size(ids) * 4u));
+ sizeof(cmd) + RoundSizeToMultipleOfEntries(std::size(ids) * 4u));
EXPECT_EQ(0, memcmp(ids, ImmediateDataAddress(&cmd), sizeof(ids)));
}
@@ -1126,15 +1126,15 @@ TEST_F(GLES2FormatTest, GenRenderbuffersImmediate) {
};
cmds::GenRenderbuffersImmediate& cmd =
*GetBufferAs<cmds::GenRenderbuffersImmediate>();
- void* next_cmd = cmd.Set(&cmd, static_cast<GLsizei>(base::size(ids)), ids);
+ void* next_cmd = cmd.Set(&cmd, static_cast<GLsizei>(std::size(ids)), ids);
EXPECT_EQ(static_cast<uint32_t>(cmds::GenRenderbuffersImmediate::kCmdId),
cmd.header.command);
EXPECT_EQ(sizeof(cmd) + RoundSizeToMultipleOfEntries(cmd.n * 4u),
cmd.header.size * 4u);
- EXPECT_EQ(static_cast<GLsizei>(base::size(ids)), cmd.n);
+ EXPECT_EQ(static_cast<GLsizei>(std::size(ids)), cmd.n);
CheckBytesWrittenMatchesExpectedSize(
next_cmd,
- sizeof(cmd) + RoundSizeToMultipleOfEntries(base::size(ids) * 4u));
+ sizeof(cmd) + RoundSizeToMultipleOfEntries(std::size(ids) * 4u));
EXPECT_EQ(0, memcmp(ids, ImmediateDataAddress(&cmd), sizeof(ids)));
}
@@ -1145,15 +1145,15 @@ TEST_F(GLES2FormatTest, GenSamplersImmediate) {
34,
};
cmds::GenSamplersImmediate& cmd = *GetBufferAs<cmds::GenSamplersImmediate>();
- void* next_cmd = cmd.Set(&cmd, static_cast<GLsizei>(base::size(ids)), ids);
+ void* next_cmd = cmd.Set(&cmd, static_cast<GLsizei>(std::size(ids)), ids);
EXPECT_EQ(static_cast<uint32_t>(cmds::GenSamplersImmediate::kCmdId),
cmd.header.command);
EXPECT_EQ(sizeof(cmd) + RoundSizeToMultipleOfEntries(cmd.n * 4u),
cmd.header.size * 4u);
- EXPECT_EQ(static_cast<GLsizei>(base::size(ids)), cmd.n);
+ EXPECT_EQ(static_cast<GLsizei>(std::size(ids)), cmd.n);
CheckBytesWrittenMatchesExpectedSize(
next_cmd,
- sizeof(cmd) + RoundSizeToMultipleOfEntries(base::size(ids) * 4u));
+ sizeof(cmd) + RoundSizeToMultipleOfEntries(std::size(ids) * 4u));
EXPECT_EQ(0, memcmp(ids, ImmediateDataAddress(&cmd), sizeof(ids)));
}
@@ -1164,15 +1164,15 @@ TEST_F(GLES2FormatTest, GenTexturesImmediate) {
34,
};
cmds::GenTexturesImmediate& cmd = *GetBufferAs<cmds::GenTexturesImmediate>();
- void* next_cmd = cmd.Set(&cmd, static_cast<GLsizei>(base::size(ids)), ids);
+ void* next_cmd = cmd.Set(&cmd, static_cast<GLsizei>(std::size(ids)), ids);
EXPECT_EQ(static_cast<uint32_t>(cmds::GenTexturesImmediate::kCmdId),
cmd.header.command);
EXPECT_EQ(sizeof(cmd) + RoundSizeToMultipleOfEntries(cmd.n * 4u),
cmd.header.size * 4u);
- EXPECT_EQ(static_cast<GLsizei>(base::size(ids)), cmd.n);
+ EXPECT_EQ(static_cast<GLsizei>(std::size(ids)), cmd.n);
CheckBytesWrittenMatchesExpectedSize(
next_cmd,
- sizeof(cmd) + RoundSizeToMultipleOfEntries(base::size(ids) * 4u));
+ sizeof(cmd) + RoundSizeToMultipleOfEntries(std::size(ids) * 4u));
EXPECT_EQ(0, memcmp(ids, ImmediateDataAddress(&cmd), sizeof(ids)));
}
@@ -1184,15 +1184,15 @@ TEST_F(GLES2FormatTest, GenTransformFeedbacksImmediate) {
};
cmds::GenTransformFeedbacksImmediate& cmd =
*GetBufferAs<cmds::GenTransformFeedbacksImmediate>();
- void* next_cmd = cmd.Set(&cmd, static_cast<GLsizei>(base::size(ids)), ids);
+ void* next_cmd = cmd.Set(&cmd, static_cast<GLsizei>(std::size(ids)), ids);
EXPECT_EQ(static_cast<uint32_t>(cmds::GenTransformFeedbacksImmediate::kCmdId),
cmd.header.command);
EXPECT_EQ(sizeof(cmd) + RoundSizeToMultipleOfEntries(cmd.n * 4u),
cmd.header.size * 4u);
- EXPECT_EQ(static_cast<GLsizei>(base::size(ids)), cmd.n);
+ EXPECT_EQ(static_cast<GLsizei>(std::size(ids)), cmd.n);
CheckBytesWrittenMatchesExpectedSize(
next_cmd,
- sizeof(cmd) + RoundSizeToMultipleOfEntries(base::size(ids) * 4u));
+ sizeof(cmd) + RoundSizeToMultipleOfEntries(std::size(ids) * 4u));
EXPECT_EQ(0, memcmp(ids, ImmediateDataAddress(&cmd), sizeof(ids)));
}
@@ -3969,15 +3969,15 @@ TEST_F(GLES2FormatTest, GenQueriesEXTImmediate) {
};
cmds::GenQueriesEXTImmediate& cmd =
*GetBufferAs<cmds::GenQueriesEXTImmediate>();
- void* next_cmd = cmd.Set(&cmd, static_cast<GLsizei>(base::size(ids)), ids);
+ void* next_cmd = cmd.Set(&cmd, static_cast<GLsizei>(std::size(ids)), ids);
EXPECT_EQ(static_cast<uint32_t>(cmds::GenQueriesEXTImmediate::kCmdId),
cmd.header.command);
EXPECT_EQ(sizeof(cmd) + RoundSizeToMultipleOfEntries(cmd.n * 4u),
cmd.header.size * 4u);
- EXPECT_EQ(static_cast<GLsizei>(base::size(ids)), cmd.n);
+ EXPECT_EQ(static_cast<GLsizei>(std::size(ids)), cmd.n);
CheckBytesWrittenMatchesExpectedSize(
next_cmd,
- sizeof(cmd) + RoundSizeToMultipleOfEntries(base::size(ids) * 4u));
+ sizeof(cmd) + RoundSizeToMultipleOfEntries(std::size(ids) * 4u));
EXPECT_EQ(0, memcmp(ids, ImmediateDataAddress(&cmd), sizeof(ids)));
}
@@ -3989,15 +3989,15 @@ TEST_F(GLES2FormatTest, DeleteQueriesEXTImmediate) {
};
cmds::DeleteQueriesEXTImmediate& cmd =
*GetBufferAs<cmds::DeleteQueriesEXTImmediate>();
- void* next_cmd = cmd.Set(&cmd, static_cast<GLsizei>(base::size(ids)), ids);
+ void* next_cmd = cmd.Set(&cmd, static_cast<GLsizei>(std::size(ids)), ids);
EXPECT_EQ(static_cast<uint32_t>(cmds::DeleteQueriesEXTImmediate::kCmdId),
cmd.header.command);
EXPECT_EQ(sizeof(cmd) + RoundSizeToMultipleOfEntries(cmd.n * 4u),
cmd.header.size * 4u);
- EXPECT_EQ(static_cast<GLsizei>(base::size(ids)), cmd.n);
+ EXPECT_EQ(static_cast<GLsizei>(std::size(ids)), cmd.n);
CheckBytesWrittenMatchesExpectedSize(
next_cmd,
- sizeof(cmd) + RoundSizeToMultipleOfEntries(base::size(ids) * 4u));
+ sizeof(cmd) + RoundSizeToMultipleOfEntries(std::size(ids) * 4u));
EXPECT_EQ(0, memcmp(ids, ImmediateDataAddress(&cmd), sizeof(ids)));
}
@@ -4114,15 +4114,15 @@ TEST_F(GLES2FormatTest, GenVertexArraysOESImmediate) {
};
cmds::GenVertexArraysOESImmediate& cmd =
*GetBufferAs<cmds::GenVertexArraysOESImmediate>();
- void* next_cmd = cmd.Set(&cmd, static_cast<GLsizei>(base::size(ids)), ids);
+ void* next_cmd = cmd.Set(&cmd, static_cast<GLsizei>(std::size(ids)), ids);
EXPECT_EQ(static_cast<uint32_t>(cmds::GenVertexArraysOESImmediate::kCmdId),
cmd.header.command);
EXPECT_EQ(sizeof(cmd) + RoundSizeToMultipleOfEntries(cmd.n * 4u),
cmd.header.size * 4u);
- EXPECT_EQ(static_cast<GLsizei>(base::size(ids)), cmd.n);
+ EXPECT_EQ(static_cast<GLsizei>(std::size(ids)), cmd.n);
CheckBytesWrittenMatchesExpectedSize(
next_cmd,
- sizeof(cmd) + RoundSizeToMultipleOfEntries(base::size(ids) * 4u));
+ sizeof(cmd) + RoundSizeToMultipleOfEntries(std::size(ids) * 4u));
EXPECT_EQ(0, memcmp(ids, ImmediateDataAddress(&cmd), sizeof(ids)));
}
@@ -4134,15 +4134,15 @@ TEST_F(GLES2FormatTest, DeleteVertexArraysOESImmediate) {
};
cmds::DeleteVertexArraysOESImmediate& cmd =
*GetBufferAs<cmds::DeleteVertexArraysOESImmediate>();
- void* next_cmd = cmd.Set(&cmd, static_cast<GLsizei>(base::size(ids)), ids);
+ void* next_cmd = cmd.Set(&cmd, static_cast<GLsizei>(std::size(ids)), ids);
EXPECT_EQ(static_cast<uint32_t>(cmds::DeleteVertexArraysOESImmediate::kCmdId),
cmd.header.command);
EXPECT_EQ(sizeof(cmd) + RoundSizeToMultipleOfEntries(cmd.n * 4u),
cmd.header.size * 4u);
- EXPECT_EQ(static_cast<GLsizei>(base::size(ids)), cmd.n);
+ EXPECT_EQ(static_cast<GLsizei>(std::size(ids)), cmd.n);
CheckBytesWrittenMatchesExpectedSize(
next_cmd,
- sizeof(cmd) + RoundSizeToMultipleOfEntries(base::size(ids) * 4u));
+ sizeof(cmd) + RoundSizeToMultipleOfEntries(std::size(ids) * 4u));
EXPECT_EQ(0, memcmp(ids, ImmediateDataAddress(&cmd), sizeof(ids)));
}
diff --git a/chromium/gpu/command_buffer/common/gles2_cmd_utils.cc b/chromium/gpu/command_buffer/common/gles2_cmd_utils.cc
index 6eb94e3bdf4..3791e031f85 100644
--- a/chromium/gpu/command_buffer/common/gles2_cmd_utils.cc
+++ b/chromium/gpu/command_buffer/common/gles2_cmd_utils.cc
@@ -16,7 +16,6 @@
#include <sstream>
#include "base/check_op.h"
-#include "base/cxx17_backports.h"
#include "base/notreached.h"
#include "base/numerics/safe_math.h"
@@ -1548,7 +1547,7 @@ std::string GLES2Util::GetStringError(uint32_t value) {
{ GL_NONE, "GL_NONE" },
};
return GLES2Util::GetQualifiedEnumString(string_table,
- base::size(string_table), value);
+ std::size(string_table), value);
}
std::string GLES2Util::GetStringBool(uint32_t value) {
diff --git a/chromium/gpu/command_buffer/common/gles2_cmd_utils_implementation_autogen.h b/chromium/gpu/command_buffer/common/gles2_cmd_utils_implementation_autogen.h
index 292165f72e8..2d98e4f2199 100644
--- a/chromium/gpu/command_buffer/common/gles2_cmd_utils_implementation_autogen.h
+++ b/chromium/gpu/command_buffer/common/gles2_cmd_utils_implementation_autogen.h
@@ -6790,6 +6790,10 @@ static const GLES2Util::EnumToString enum_to_string_table[] = {
"GL_FRAMEBUFFER_FETCH_NONCOHERENT_QCOM",
},
{
+ 0x96BA,
+ "GL_RGBX8_ANGLE",
+ },
+ {
0xC0,
"GL_SHARED_EDGE_NV",
},
@@ -6884,7 +6888,7 @@ std::string GLES2Util::GetStringAttachment(uint32_t value) {
{GL_DEPTH_STENCIL_ATTACHMENT, "GL_DEPTH_STENCIL_ATTACHMENT"},
};
return GLES2Util::GetQualifiedEnumString(string_table,
- base::size(string_table), value);
+ std::size(string_table), value);
}
std::string GLES2Util::GetStringAttachmentQuery(uint32_t value) {
@@ -6898,7 +6902,7 @@ std::string GLES2Util::GetStringAttachmentQuery(uint32_t value) {
{GL_STENCIL_EXT, "GL_STENCIL_EXT"},
};
return GLES2Util::GetQualifiedEnumString(string_table,
- base::size(string_table), value);
+ std::size(string_table), value);
}
std::string GLES2Util::GetStringBackbufferAttachment(uint32_t value) {
@@ -6908,7 +6912,7 @@ std::string GLES2Util::GetStringBackbufferAttachment(uint32_t value) {
{GL_STENCIL_EXT, "GL_STENCIL_EXT"},
};
return GLES2Util::GetQualifiedEnumString(string_table,
- base::size(string_table), value);
+ std::size(string_table), value);
}
std::string GLES2Util::GetStringBlitFilter(uint32_t value) {
@@ -6917,7 +6921,7 @@ std::string GLES2Util::GetStringBlitFilter(uint32_t value) {
{GL_LINEAR, "GL_LINEAR"},
};
return GLES2Util::GetQualifiedEnumString(string_table,
- base::size(string_table), value);
+ std::size(string_table), value);
}
std::string GLES2Util::GetStringBufferMode(uint32_t value) {
@@ -6926,7 +6930,7 @@ std::string GLES2Util::GetStringBufferMode(uint32_t value) {
{GL_SEPARATE_ATTRIBS, "GL_SEPARATE_ATTRIBS"},
};
return GLES2Util::GetQualifiedEnumString(string_table,
- base::size(string_table), value);
+ std::size(string_table), value);
}
std::string GLES2Util::GetStringBufferParameter(uint32_t value) {
@@ -6937,7 +6941,7 @@ std::string GLES2Util::GetStringBufferParameter(uint32_t value) {
{GL_BUFFER_MAPPED, "GL_BUFFER_MAPPED"},
};
return GLES2Util::GetQualifiedEnumString(string_table,
- base::size(string_table), value);
+ std::size(string_table), value);
}
std::string GLES2Util::GetStringBufferParameter64(uint32_t value) {
@@ -6947,7 +6951,7 @@ std::string GLES2Util::GetStringBufferParameter64(uint32_t value) {
{GL_BUFFER_MAP_OFFSET, "GL_BUFFER_MAP_OFFSET"},
};
return GLES2Util::GetQualifiedEnumString(string_table,
- base::size(string_table), value);
+ std::size(string_table), value);
}
std::string GLES2Util::GetStringBufferTarget(uint32_t value) {
@@ -6962,7 +6966,7 @@ std::string GLES2Util::GetStringBufferTarget(uint32_t value) {
{GL_UNIFORM_BUFFER, "GL_UNIFORM_BUFFER"},
};
return GLES2Util::GetQualifiedEnumString(string_table,
- base::size(string_table), value);
+ std::size(string_table), value);
}
std::string GLES2Util::GetStringBufferUsage(uint32_t value) {
@@ -6978,7 +6982,7 @@ std::string GLES2Util::GetStringBufferUsage(uint32_t value) {
{GL_DYNAMIC_COPY, "GL_DYNAMIC_COPY"},
};
return GLES2Util::GetQualifiedEnumString(string_table,
- base::size(string_table), value);
+ std::size(string_table), value);
}
std::string GLES2Util::GetStringBufferfi(uint32_t value) {
@@ -6986,7 +6990,7 @@ std::string GLES2Util::GetStringBufferfi(uint32_t value) {
{GL_DEPTH_STENCIL, "GL_DEPTH_STENCIL"},
};
return GLES2Util::GetQualifiedEnumString(string_table,
- base::size(string_table), value);
+ std::size(string_table), value);
}
std::string GLES2Util::GetStringBufferfv(uint32_t value) {
@@ -6995,7 +6999,7 @@ std::string GLES2Util::GetStringBufferfv(uint32_t value) {
{GL_DEPTH, "GL_DEPTH"},
};
return GLES2Util::GetQualifiedEnumString(string_table,
- base::size(string_table), value);
+ std::size(string_table), value);
}
std::string GLES2Util::GetStringBufferiv(uint32_t value) {
@@ -7004,7 +7008,7 @@ std::string GLES2Util::GetStringBufferiv(uint32_t value) {
{GL_STENCIL, "GL_STENCIL"},
};
return GLES2Util::GetQualifiedEnumString(string_table,
- base::size(string_table), value);
+ std::size(string_table), value);
}
std::string GLES2Util::GetStringBufferuiv(uint32_t value) {
@@ -7012,7 +7016,7 @@ std::string GLES2Util::GetStringBufferuiv(uint32_t value) {
{GL_COLOR, "GL_COLOR"},
};
return GLES2Util::GetQualifiedEnumString(string_table,
- base::size(string_table), value);
+ std::size(string_table), value);
}
std::string GLES2Util::GetStringCapability(uint32_t value) {
@@ -7030,7 +7034,7 @@ std::string GLES2Util::GetStringCapability(uint32_t value) {
{GL_PRIMITIVE_RESTART_FIXED_INDEX, "GL_PRIMITIVE_RESTART_FIXED_INDEX"},
};
return GLES2Util::GetQualifiedEnumString(string_table,
- base::size(string_table), value);
+ std::size(string_table), value);
}
std::string GLES2Util::GetStringClientBufferUsage(uint32_t value) {
@@ -7038,7 +7042,7 @@ std::string GLES2Util::GetStringClientBufferUsage(uint32_t value) {
{GL_SCANOUT_CHROMIUM, "GL_SCANOUT_CHROMIUM"},
};
return GLES2Util::GetQualifiedEnumString(string_table,
- base::size(string_table), value);
+ std::size(string_table), value);
}
std::string GLES2Util::GetStringCmpFunction(uint32_t value) {
@@ -7049,7 +7053,7 @@ std::string GLES2Util::GetStringCmpFunction(uint32_t value) {
{GL_GEQUAL, "GL_GEQUAL"}, {GL_ALWAYS, "GL_ALWAYS"},
};
return GLES2Util::GetQualifiedEnumString(string_table,
- base::size(string_table), value);
+ std::size(string_table), value);
}
std::string GLES2Util::GetStringCompressedTextureFormat(uint32_t value) {
@@ -7064,7 +7068,7 @@ std::string GLES2Util::GetStringCoverageModulationComponents(uint32_t value) {
{GL_NONE, "GL_NONE"},
};
return GLES2Util::GetQualifiedEnumString(string_table,
- base::size(string_table), value);
+ std::size(string_table), value);
}
std::string GLES2Util::GetStringDrawMode(uint32_t value) {
@@ -7078,7 +7082,7 @@ std::string GLES2Util::GetStringDrawMode(uint32_t value) {
{GL_TRIANGLES, "GL_TRIANGLES"},
};
return GLES2Util::GetQualifiedEnumString(string_table,
- base::size(string_table), value);
+ std::size(string_table), value);
}
std::string GLES2Util::GetStringDstBlendFactor(uint32_t value) {
@@ -7100,7 +7104,7 @@ std::string GLES2Util::GetStringDstBlendFactor(uint32_t value) {
{GL_SRC_ALPHA_SATURATE, "GL_SRC_ALPHA_SATURATE"},
};
return GLES2Util::GetQualifiedEnumString(string_table,
- base::size(string_table), value);
+ std::size(string_table), value);
}
std::string GLES2Util::GetStringEquation(uint32_t value) {
@@ -7112,7 +7116,7 @@ std::string GLES2Util::GetStringEquation(uint32_t value) {
{GL_MAX, "GL_MAX"},
};
return GLES2Util::GetQualifiedEnumString(string_table,
- base::size(string_table), value);
+ std::size(string_table), value);
}
std::string GLES2Util::GetStringFaceMode(uint32_t value) {
@@ -7121,7 +7125,7 @@ std::string GLES2Util::GetStringFaceMode(uint32_t value) {
{GL_CCW, "GL_CCW"},
};
return GLES2Util::GetQualifiedEnumString(string_table,
- base::size(string_table), value);
+ std::size(string_table), value);
}
std::string GLES2Util::GetStringFaceType(uint32_t value) {
@@ -7131,7 +7135,7 @@ std::string GLES2Util::GetStringFaceType(uint32_t value) {
{GL_FRONT_AND_BACK, "GL_FRONT_AND_BACK"},
};
return GLES2Util::GetQualifiedEnumString(string_table,
- base::size(string_table), value);
+ std::size(string_table), value);
}
std::string GLES2Util::GetStringFramebufferAttachmentParameter(uint32_t value) {
@@ -7164,7 +7168,7 @@ std::string GLES2Util::GetStringFramebufferAttachmentParameter(uint32_t value) {
"GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_LAYER"},
};
return GLES2Util::GetQualifiedEnumString(string_table,
- base::size(string_table), value);
+ std::size(string_table), value);
}
std::string GLES2Util::GetStringFramebufferParameter(uint32_t value) {
@@ -7178,7 +7182,7 @@ std::string GLES2Util::GetStringFramebufferTarget(uint32_t value) {
{GL_READ_FRAMEBUFFER, "GL_READ_FRAMEBUFFER"},
};
return GLES2Util::GetQualifiedEnumString(string_table,
- base::size(string_table), value);
+ std::size(string_table), value);
}
std::string GLES2Util::GetStringGLState(uint32_t value) {
@@ -7364,7 +7368,7 @@ std::string GLES2Util::GetStringGLState(uint32_t value) {
{GL_UNPACK_SKIP_ROWS, "GL_UNPACK_SKIP_ROWS"},
};
return GLES2Util::GetQualifiedEnumString(string_table,
- base::size(string_table), value);
+ std::size(string_table), value);
}
std::string GLES2Util::GetStringGetMaxIndexType(uint32_t value) {
@@ -7374,7 +7378,7 @@ std::string GLES2Util::GetStringGetMaxIndexType(uint32_t value) {
{GL_UNSIGNED_INT, "GL_UNSIGNED_INT"},
};
return GLES2Util::GetQualifiedEnumString(string_table,
- base::size(string_table), value);
+ std::size(string_table), value);
}
std::string GLES2Util::GetStringGetTexParamTarget(uint32_t value) {
@@ -7385,7 +7389,7 @@ std::string GLES2Util::GetStringGetTexParamTarget(uint32_t value) {
{GL_TEXTURE_3D, "GL_TEXTURE_3D"},
};
return GLES2Util::GetQualifiedEnumString(string_table,
- base::size(string_table), value);
+ std::size(string_table), value);
}
std::string GLES2Util::GetStringHintMode(uint32_t value) {
@@ -7395,7 +7399,7 @@ std::string GLES2Util::GetStringHintMode(uint32_t value) {
{GL_DONT_CARE, "GL_DONT_CARE"},
};
return GLES2Util::GetQualifiedEnumString(string_table,
- base::size(string_table), value);
+ std::size(string_table), value);
}
std::string GLES2Util::GetStringHintTarget(uint32_t value) {
@@ -7407,7 +7411,7 @@ std::string GLES2Util::GetStringHintTarget(uint32_t value) {
"GL_FRAGMENT_SHADER_DERIVATIVE_HINT"},
};
return GLES2Util::GetQualifiedEnumString(string_table,
- base::size(string_table), value);
+ std::size(string_table), value);
}
std::string GLES2Util::GetStringImageInternalFormat(uint32_t value) {
@@ -7420,7 +7424,7 @@ std::string GLES2Util::GetStringImageInternalFormat(uint32_t value) {
{GL_RGBA, "GL_RGBA"},
};
return GLES2Util::GetQualifiedEnumString(string_table,
- base::size(string_table), value);
+ std::size(string_table), value);
}
std::string GLES2Util::GetStringIndexType(uint32_t value) {
@@ -7430,7 +7434,7 @@ std::string GLES2Util::GetStringIndexType(uint32_t value) {
{GL_UNSIGNED_INT, "GL_UNSIGNED_INT"},
};
return GLES2Util::GetQualifiedEnumString(string_table,
- base::size(string_table), value);
+ std::size(string_table), value);
}
std::string GLES2Util::GetStringIndexedBufferTarget(uint32_t value) {
@@ -7439,7 +7443,7 @@ std::string GLES2Util::GetStringIndexedBufferTarget(uint32_t value) {
{GL_UNIFORM_BUFFER, "GL_UNIFORM_BUFFER"},
};
return GLES2Util::GetQualifiedEnumString(string_table,
- base::size(string_table), value);
+ std::size(string_table), value);
}
std::string GLES2Util::GetStringIndexedGLState(uint32_t value) {
@@ -7461,7 +7465,7 @@ std::string GLES2Util::GetStringIndexedGLState(uint32_t value) {
{GL_COLOR_WRITEMASK, "GL_COLOR_WRITEMASK"},
};
return GLES2Util::GetQualifiedEnumString(string_table,
- base::size(string_table), value);
+ std::size(string_table), value);
}
std::string GLES2Util::GetStringIndexedStringType(uint32_t value) {
@@ -7469,7 +7473,7 @@ std::string GLES2Util::GetStringIndexedStringType(uint32_t value) {
{GL_EXTENSIONS, "GL_EXTENSIONS"},
};
return GLES2Util::GetQualifiedEnumString(string_table,
- base::size(string_table), value);
+ std::size(string_table), value);
}
std::string GLES2Util::GetStringInternalFormatParameter(uint32_t value) {
@@ -7478,7 +7482,7 @@ std::string GLES2Util::GetStringInternalFormatParameter(uint32_t value) {
{GL_SAMPLES, "GL_SAMPLES"},
};
return GLES2Util::GetQualifiedEnumString(string_table,
- base::size(string_table), value);
+ std::size(string_table), value);
}
std::string GLES2Util::GetStringMapBufferAccess(uint32_t value) {
@@ -7491,7 +7495,7 @@ std::string GLES2Util::GetStringMapBufferAccess(uint32_t value) {
{GL_MAP_UNSYNCHRONIZED_BIT, "GL_MAP_UNSYNCHRONIZED_BIT"},
};
return GLES2Util::GetQualifiedEnumString(string_table,
- base::size(string_table), value);
+ std::size(string_table), value);
}
std::string GLES2Util::GetStringPixelStore(uint32_t value) {
@@ -7508,7 +7512,7 @@ std::string GLES2Util::GetStringPixelStore(uint32_t value) {
{GL_UNPACK_SKIP_IMAGES, "GL_UNPACK_SKIP_IMAGES"},
};
return GLES2Util::GetQualifiedEnumString(string_table,
- base::size(string_table), value);
+ std::size(string_table), value);
}
std::string GLES2Util::GetStringPixelType(uint32_t value) {
@@ -7531,7 +7535,7 @@ std::string GLES2Util::GetStringPixelType(uint32_t value) {
{GL_FLOAT_32_UNSIGNED_INT_24_8_REV, "GL_FLOAT_32_UNSIGNED_INT_24_8_REV"},
};
return GLES2Util::GetQualifiedEnumString(string_table,
- base::size(string_table), value);
+ std::size(string_table), value);
}
std::string GLES2Util::GetStringProgramParameter(uint32_t value) {
@@ -7554,7 +7558,7 @@ std::string GLES2Util::GetStringProgramParameter(uint32_t value) {
"GL_TRANSFORM_FEEDBACK_VARYING_MAX_LENGTH"},
};
return GLES2Util::GetQualifiedEnumString(string_table,
- base::size(string_table), value);
+ std::size(string_table), value);
}
std::string GLES2Util::GetStringQueryObjectParameter(uint32_t value) {
@@ -7565,7 +7569,7 @@ std::string GLES2Util::GetStringQueryObjectParameter(uint32_t value) {
"GL_QUERY_RESULT_AVAILABLE_NO_FLUSH_CHROMIUM_EXT"},
};
return GLES2Util::GetQualifiedEnumString(string_table,
- base::size(string_table), value);
+ std::size(string_table), value);
}
std::string GLES2Util::GetStringQueryParameter(uint32_t value) {
@@ -7573,7 +7577,7 @@ std::string GLES2Util::GetStringQueryParameter(uint32_t value) {
{GL_CURRENT_QUERY_EXT, "GL_CURRENT_QUERY_EXT"},
};
return GLES2Util::GetQualifiedEnumString(string_table,
- base::size(string_table), value);
+ std::size(string_table), value);
}
std::string GLES2Util::GetStringQueryTarget(uint32_t value) {
@@ -7595,7 +7599,7 @@ std::string GLES2Util::GetStringQueryTarget(uint32_t value) {
"GL_PROGRAM_COMPLETION_QUERY_CHROMIUM"},
};
return GLES2Util::GetQualifiedEnumString(string_table,
- base::size(string_table), value);
+ std::size(string_table), value);
}
std::string GLES2Util::GetStringReadBuffer(uint32_t value) {
@@ -7620,7 +7624,7 @@ std::string GLES2Util::GetStringReadBuffer(uint32_t value) {
{GL_COLOR_ATTACHMENT15, "GL_COLOR_ATTACHMENT15"},
};
return GLES2Util::GetQualifiedEnumString(string_table,
- base::size(string_table), value);
+ std::size(string_table), value);
}
std::string GLES2Util::GetStringReadPixelFormat(uint32_t value) {
@@ -7636,7 +7640,7 @@ std::string GLES2Util::GetStringReadPixelFormat(uint32_t value) {
{GL_RGBA_INTEGER, "GL_RGBA_INTEGER"},
};
return GLES2Util::GetQualifiedEnumString(string_table,
- base::size(string_table), value);
+ std::size(string_table), value);
}
std::string GLES2Util::GetStringReadPixelType(uint32_t value) {
@@ -7655,7 +7659,7 @@ std::string GLES2Util::GetStringReadPixelType(uint32_t value) {
{GL_UNSIGNED_INT_2_10_10_10_REV, "GL_UNSIGNED_INT_2_10_10_10_REV"},
};
return GLES2Util::GetQualifiedEnumString(string_table,
- base::size(string_table), value);
+ std::size(string_table), value);
}
std::string GLES2Util::GetStringRenderBufferFormat(uint32_t value) {
@@ -7696,7 +7700,7 @@ std::string GLES2Util::GetStringRenderBufferFormat(uint32_t value) {
{GL_DEPTH32F_STENCIL8, "GL_DEPTH32F_STENCIL8"},
};
return GLES2Util::GetQualifiedEnumString(string_table,
- base::size(string_table), value);
+ std::size(string_table), value);
}
std::string GLES2Util::GetStringRenderBufferParameter(uint32_t value) {
@@ -7713,7 +7717,7 @@ std::string GLES2Util::GetStringRenderBufferParameter(uint32_t value) {
{GL_RENDERBUFFER_SAMPLES, "GL_RENDERBUFFER_SAMPLES"},
};
return GLES2Util::GetQualifiedEnumString(string_table,
- base::size(string_table), value);
+ std::size(string_table), value);
}
std::string GLES2Util::GetStringRenderBufferTarget(uint32_t value) {
@@ -7721,7 +7725,7 @@ std::string GLES2Util::GetStringRenderBufferTarget(uint32_t value) {
{GL_RENDERBUFFER, "GL_RENDERBUFFER"},
};
return GLES2Util::GetQualifiedEnumString(string_table,
- base::size(string_table), value);
+ std::size(string_table), value);
}
std::string GLES2Util::GetStringResetStatus(uint32_t value) {
@@ -7731,7 +7735,7 @@ std::string GLES2Util::GetStringResetStatus(uint32_t value) {
{GL_UNKNOWN_CONTEXT_RESET_ARB, "GL_UNKNOWN_CONTEXT_RESET_ARB"},
};
return GLES2Util::GetQualifiedEnumString(string_table,
- base::size(string_table), value);
+ std::size(string_table), value);
}
std::string GLES2Util::GetStringSamplerParameter(uint32_t value) {
@@ -7747,7 +7751,7 @@ std::string GLES2Util::GetStringSamplerParameter(uint32_t value) {
{GL_TEXTURE_COMPARE_FUNC, "GL_TEXTURE_COMPARE_FUNC"},
};
return GLES2Util::GetQualifiedEnumString(string_table,
- base::size(string_table), value);
+ std::size(string_table), value);
}
std::string GLES2Util::GetStringShaderBinaryFormat(uint32_t value) {
@@ -7765,7 +7769,7 @@ std::string GLES2Util::GetStringShaderParameter(uint32_t value) {
"GL_TRANSLATED_SHADER_SOURCE_LENGTH_ANGLE"},
};
return GLES2Util::GetQualifiedEnumString(string_table,
- base::size(string_table), value);
+ std::size(string_table), value);
}
std::string GLES2Util::GetStringShaderPrecision(uint32_t value) {
@@ -7775,7 +7779,7 @@ std::string GLES2Util::GetStringShaderPrecision(uint32_t value) {
{GL_MEDIUM_INT, "GL_MEDIUM_INT"}, {GL_HIGH_INT, "GL_HIGH_INT"},
};
return GLES2Util::GetQualifiedEnumString(string_table,
- base::size(string_table), value);
+ std::size(string_table), value);
}
std::string GLES2Util::GetStringShaderType(uint32_t value) {
@@ -7784,7 +7788,7 @@ std::string GLES2Util::GetStringShaderType(uint32_t value) {
{GL_FRAGMENT_SHADER, "GL_FRAGMENT_SHADER"},
};
return GLES2Util::GetQualifiedEnumString(string_table,
- base::size(string_table), value);
+ std::size(string_table), value);
}
std::string GLES2Util::GetStringSharedImageAccessMode(uint32_t value) {
@@ -7797,7 +7801,7 @@ std::string GLES2Util::GetStringSharedImageAccessMode(uint32_t value) {
"GL_SHARED_IMAGE_ACCESS_MODE_READ_CHROMIUM"},
};
return GLES2Util::GetQualifiedEnumString(string_table,
- base::size(string_table), value);
+ std::size(string_table), value);
}
std::string GLES2Util::GetStringSrcBlendFactor(uint32_t value) {
@@ -7819,7 +7823,7 @@ std::string GLES2Util::GetStringSrcBlendFactor(uint32_t value) {
{GL_SRC_ALPHA_SATURATE, "GL_SRC_ALPHA_SATURATE"},
};
return GLES2Util::GetQualifiedEnumString(string_table,
- base::size(string_table), value);
+ std::size(string_table), value);
}
std::string GLES2Util::GetStringStencilOp(uint32_t value) {
@@ -7830,7 +7834,7 @@ std::string GLES2Util::GetStringStencilOp(uint32_t value) {
{GL_DECR_WRAP, "GL_DECR_WRAP"}, {GL_INVERT, "GL_INVERT"},
};
return GLES2Util::GetQualifiedEnumString(string_table,
- base::size(string_table), value);
+ std::size(string_table), value);
}
std::string GLES2Util::GetStringStringType(uint32_t value) {
@@ -7842,7 +7846,7 @@ std::string GLES2Util::GetStringStringType(uint32_t value) {
{GL_EXTENSIONS, "GL_EXTENSIONS"},
};
return GLES2Util::GetQualifiedEnumString(string_table,
- base::size(string_table), value);
+ std::size(string_table), value);
}
std::string GLES2Util::GetStringSyncCondition(uint32_t value) {
@@ -7850,7 +7854,7 @@ std::string GLES2Util::GetStringSyncCondition(uint32_t value) {
{GL_SYNC_GPU_COMMANDS_COMPLETE, "GL_SYNC_GPU_COMMANDS_COMPLETE"},
};
return GLES2Util::GetQualifiedEnumString(string_table,
- base::size(string_table), value);
+ std::size(string_table), value);
}
std::string GLES2Util::GetStringSyncParameter(uint32_t value) {
@@ -7861,7 +7865,7 @@ std::string GLES2Util::GetStringSyncParameter(uint32_t value) {
{GL_SYNC_FLAGS, "GL_SYNC_FLAGS"},
};
return GLES2Util::GetQualifiedEnumString(string_table,
- base::size(string_table), value);
+ std::size(string_table), value);
}
std::string GLES2Util::GetStringTexture3DTarget(uint32_t value) {
@@ -7870,7 +7874,7 @@ std::string GLES2Util::GetStringTexture3DTarget(uint32_t value) {
{GL_TEXTURE_2D_ARRAY, "GL_TEXTURE_2D_ARRAY"},
};
return GLES2Util::GetQualifiedEnumString(string_table,
- base::size(string_table), value);
+ std::size(string_table), value);
}
std::string GLES2Util::GetStringTextureBindTarget(uint32_t value) {
@@ -7881,7 +7885,7 @@ std::string GLES2Util::GetStringTextureBindTarget(uint32_t value) {
{GL_TEXTURE_2D_ARRAY, "GL_TEXTURE_2D_ARRAY"},
};
return GLES2Util::GetQualifiedEnumString(string_table,
- base::size(string_table), value);
+ std::size(string_table), value);
}
std::string GLES2Util::GetStringTextureCompareFunc(uint32_t value) {
@@ -7892,7 +7896,7 @@ std::string GLES2Util::GetStringTextureCompareFunc(uint32_t value) {
{GL_ALWAYS, "GL_ALWAYS"}, {GL_NEVER, "GL_NEVER"},
};
return GLES2Util::GetQualifiedEnumString(string_table,
- base::size(string_table), value);
+ std::size(string_table), value);
}
std::string GLES2Util::GetStringTextureCompareMode(uint32_t value) {
@@ -7901,7 +7905,7 @@ std::string GLES2Util::GetStringTextureCompareMode(uint32_t value) {
{GL_COMPARE_REF_TO_TEXTURE, "GL_COMPARE_REF_TO_TEXTURE"},
};
return GLES2Util::GetQualifiedEnumString(string_table,
- base::size(string_table), value);
+ std::size(string_table), value);
}
std::string GLES2Util::GetStringTextureDepthRenderableInternalFormat(
@@ -7914,7 +7918,7 @@ std::string GLES2Util::GetStringTextureDepthRenderableInternalFormat(
{GL_DEPTH32F_STENCIL8, "GL_DEPTH32F_STENCIL8"},
};
return GLES2Util::GetQualifiedEnumString(string_table,
- base::size(string_table), value);
+ std::size(string_table), value);
}
std::string GLES2Util::GetStringTextureFboTarget(uint32_t value) {
@@ -7928,7 +7932,7 @@ std::string GLES2Util::GetStringTextureFboTarget(uint32_t value) {
{GL_TEXTURE_CUBE_MAP_NEGATIVE_Z, "GL_TEXTURE_CUBE_MAP_NEGATIVE_Z"},
};
return GLES2Util::GetQualifiedEnumString(string_table,
- base::size(string_table), value);
+ std::size(string_table), value);
}
std::string GLES2Util::GetStringTextureFormat(uint32_t value) {
@@ -7948,7 +7952,7 @@ std::string GLES2Util::GetStringTextureFormat(uint32_t value) {
{GL_DEPTH_STENCIL, "GL_DEPTH_STENCIL"},
};
return GLES2Util::GetQualifiedEnumString(string_table,
- base::size(string_table), value);
+ std::size(string_table), value);
}
std::string GLES2Util::GetStringTextureInternalFormat(uint32_t value) {
@@ -8014,7 +8018,7 @@ std::string GLES2Util::GetStringTextureInternalFormat(uint32_t value) {
{GL_DEPTH32F_STENCIL8, "GL_DEPTH32F_STENCIL8"},
};
return GLES2Util::GetQualifiedEnumString(string_table,
- base::size(string_table), value);
+ std::size(string_table), value);
}
std::string GLES2Util::GetStringTextureInternalFormatStorage(uint32_t value) {
@@ -8080,7 +8084,7 @@ std::string GLES2Util::GetStringTextureInternalFormatStorage(uint32_t value) {
{GL_DEPTH32F_STENCIL8, "GL_DEPTH32F_STENCIL8"},
};
return GLES2Util::GetQualifiedEnumString(string_table,
- base::size(string_table), value);
+ std::size(string_table), value);
}
std::string GLES2Util::GetStringTextureMagFilterMode(uint32_t value) {
@@ -8089,7 +8093,7 @@ std::string GLES2Util::GetStringTextureMagFilterMode(uint32_t value) {
{GL_LINEAR, "GL_LINEAR"},
};
return GLES2Util::GetQualifiedEnumString(string_table,
- base::size(string_table), value);
+ std::size(string_table), value);
}
std::string GLES2Util::GetStringTextureMinFilterMode(uint32_t value) {
@@ -8102,7 +8106,7 @@ std::string GLES2Util::GetStringTextureMinFilterMode(uint32_t value) {
{GL_LINEAR_MIPMAP_LINEAR, "GL_LINEAR_MIPMAP_LINEAR"},
};
return GLES2Util::GetQualifiedEnumString(string_table,
- base::size(string_table), value);
+ std::size(string_table), value);
}
std::string GLES2Util::GetStringTextureParameter(uint32_t value) {
@@ -8122,7 +8126,7 @@ std::string GLES2Util::GetStringTextureParameter(uint32_t value) {
{GL_TEXTURE_WRAP_R, "GL_TEXTURE_WRAP_R"},
};
return GLES2Util::GetQualifiedEnumString(string_table,
- base::size(string_table), value);
+ std::size(string_table), value);
}
std::string GLES2Util::GetStringTextureSizedColorRenderableInternalFormat(
@@ -8158,7 +8162,7 @@ std::string GLES2Util::GetStringTextureSizedColorRenderableInternalFormat(
{GL_RGBA32I, "GL_RGBA32I"},
};
return GLES2Util::GetQualifiedEnumString(string_table,
- base::size(string_table), value);
+ std::size(string_table), value);
}
std::string GLES2Util::GetStringTextureSizedTextureFilterableInternalFormat(
@@ -8191,7 +8195,7 @@ std::string GLES2Util::GetStringTextureSizedTextureFilterableInternalFormat(
{GL_R16_EXT, "GL_R16_EXT"},
};
return GLES2Util::GetQualifiedEnumString(string_table,
- base::size(string_table), value);
+ std::size(string_table), value);
}
std::string GLES2Util::GetStringTextureSrgbDecodeExt(uint32_t value) {
@@ -8200,7 +8204,7 @@ std::string GLES2Util::GetStringTextureSrgbDecodeExt(uint32_t value) {
{GL_SKIP_DECODE_EXT, "GL_SKIP_DECODE_EXT"},
};
return GLES2Util::GetQualifiedEnumString(string_table,
- base::size(string_table), value);
+ std::size(string_table), value);
}
std::string GLES2Util::GetStringTextureStencilRenderableInternalFormat(
@@ -8211,7 +8215,7 @@ std::string GLES2Util::GetStringTextureStencilRenderableInternalFormat(
{GL_DEPTH32F_STENCIL8, "GL_DEPTH32F_STENCIL8"},
};
return GLES2Util::GetQualifiedEnumString(string_table,
- base::size(string_table), value);
+ std::size(string_table), value);
}
std::string GLES2Util::GetStringTextureSwizzle(uint32_t value) {
@@ -8220,7 +8224,7 @@ std::string GLES2Util::GetStringTextureSwizzle(uint32_t value) {
{GL_ALPHA, "GL_ALPHA"}, {GL_ZERO, "GL_ZERO"}, {GL_ONE, "GL_ONE"},
};
return GLES2Util::GetQualifiedEnumString(string_table,
- base::size(string_table), value);
+ std::size(string_table), value);
}
std::string GLES2Util::GetStringTextureTarget(uint32_t value) {
@@ -8234,7 +8238,7 @@ std::string GLES2Util::GetStringTextureTarget(uint32_t value) {
{GL_TEXTURE_CUBE_MAP_NEGATIVE_Z, "GL_TEXTURE_CUBE_MAP_NEGATIVE_Z"},
};
return GLES2Util::GetQualifiedEnumString(string_table,
- base::size(string_table), value);
+ std::size(string_table), value);
}
std::string GLES2Util::GetStringTextureUnsizedInternalFormat(uint32_t value) {
@@ -8246,7 +8250,7 @@ std::string GLES2Util::GetStringTextureUnsizedInternalFormat(uint32_t value) {
{GL_RGBA, "GL_RGBA"},
};
return GLES2Util::GetQualifiedEnumString(string_table,
- base::size(string_table), value);
+ std::size(string_table), value);
}
std::string GLES2Util::GetStringTextureUsage(uint32_t value) {
@@ -8255,7 +8259,7 @@ std::string GLES2Util::GetStringTextureUsage(uint32_t value) {
{GL_FRAMEBUFFER_ATTACHMENT_ANGLE, "GL_FRAMEBUFFER_ATTACHMENT_ANGLE"},
};
return GLES2Util::GetQualifiedEnumString(string_table,
- base::size(string_table), value);
+ std::size(string_table), value);
}
std::string GLES2Util::GetStringTextureWrapMode(uint32_t value) {
@@ -8265,7 +8269,7 @@ std::string GLES2Util::GetStringTextureWrapMode(uint32_t value) {
{GL_REPEAT, "GL_REPEAT"},
};
return GLES2Util::GetQualifiedEnumString(string_table,
- base::size(string_table), value);
+ std::size(string_table), value);
}
std::string GLES2Util::GetStringTransformFeedbackBindTarget(uint32_t value) {
@@ -8273,7 +8277,7 @@ std::string GLES2Util::GetStringTransformFeedbackBindTarget(uint32_t value) {
{GL_TRANSFORM_FEEDBACK, "GL_TRANSFORM_FEEDBACK"},
};
return GLES2Util::GetQualifiedEnumString(string_table,
- base::size(string_table), value);
+ std::size(string_table), value);
}
std::string GLES2Util::GetStringTransformFeedbackPrimitiveMode(uint32_t value) {
@@ -8283,7 +8287,7 @@ std::string GLES2Util::GetStringTransformFeedbackPrimitiveMode(uint32_t value) {
{GL_TRIANGLES, "GL_TRIANGLES"},
};
return GLES2Util::GetQualifiedEnumString(string_table,
- base::size(string_table), value);
+ std::size(string_table), value);
}
std::string GLES2Util::GetStringUniformBlockParameter(uint32_t value) {
@@ -8300,7 +8304,7 @@ std::string GLES2Util::GetStringUniformBlockParameter(uint32_t value) {
"GL_UNIFORM_BLOCK_REFERENCED_BY_FRAGMENT_SHADER"},
};
return GLES2Util::GetQualifiedEnumString(string_table,
- base::size(string_table), value);
+ std::size(string_table), value);
}
std::string GLES2Util::GetStringUniformParameter(uint32_t value) {
@@ -8315,7 +8319,7 @@ std::string GLES2Util::GetStringUniformParameter(uint32_t value) {
{GL_UNIFORM_IS_ROW_MAJOR, "GL_UNIFORM_IS_ROW_MAJOR"},
};
return GLES2Util::GetQualifiedEnumString(string_table,
- base::size(string_table), value);
+ std::size(string_table), value);
}
std::string GLES2Util::GetStringVertexAttribIType(uint32_t value) {
@@ -8325,7 +8329,7 @@ std::string GLES2Util::GetStringVertexAttribIType(uint32_t value) {
{GL_INT, "GL_INT"}, {GL_UNSIGNED_INT, "GL_UNSIGNED_INT"},
};
return GLES2Util::GetQualifiedEnumString(string_table,
- base::size(string_table), value);
+ std::size(string_table), value);
}
std::string GLES2Util::GetStringVertexAttribType(uint32_t value) {
@@ -8342,7 +8346,7 @@ std::string GLES2Util::GetStringVertexAttribType(uint32_t value) {
{GL_UNSIGNED_INT_2_10_10_10_REV, "GL_UNSIGNED_INT_2_10_10_10_REV"},
};
return GLES2Util::GetQualifiedEnumString(string_table,
- base::size(string_table), value);
+ std::size(string_table), value);
}
std::string GLES2Util::GetStringVertexAttribute(uint32_t value) {
@@ -8359,7 +8363,7 @@ std::string GLES2Util::GetStringVertexAttribute(uint32_t value) {
{GL_VERTEX_ATTRIB_ARRAY_DIVISOR, "GL_VERTEX_ATTRIB_ARRAY_DIVISOR"},
};
return GLES2Util::GetQualifiedEnumString(string_table,
- base::size(string_table), value);
+ std::size(string_table), value);
}
std::string GLES2Util::GetStringVertexPointer(uint32_t value) {
@@ -8367,7 +8371,7 @@ std::string GLES2Util::GetStringVertexPointer(uint32_t value) {
{GL_VERTEX_ATTRIB_ARRAY_POINTER, "GL_VERTEX_ATTRIB_ARRAY_POINTER"},
};
return GLES2Util::GetQualifiedEnumString(string_table,
- base::size(string_table), value);
+ std::size(string_table), value);
}
std::string GLES2Util::GetStringWindowRectanglesMode(uint32_t value) {
@@ -8376,7 +8380,7 @@ std::string GLES2Util::GetStringWindowRectanglesMode(uint32_t value) {
{GL_EXCLUSIVE_EXT, "GL_EXCLUSIVE_EXT"},
};
return GLES2Util::GetQualifiedEnumString(string_table,
- base::size(string_table), value);
+ std::size(string_table), value);
}
#endif // GPU_COMMAND_BUFFER_COMMON_GLES2_CMD_UTILS_IMPLEMENTATION_AUTOGEN_H_
diff --git a/chromium/gpu/command_buffer/common/gpu_memory_buffer_support.cc b/chromium/gpu/command_buffer/common/gpu_memory_buffer_support.cc
index bd556575e74..9ab8841ef7e 100644
--- a/chromium/gpu/command_buffer/common/gpu_memory_buffer_support.cc
+++ b/chromium/gpu/command_buffer/common/gpu_memory_buffer_support.cc
@@ -50,13 +50,13 @@ bool IsImageSizeValidForGpuMemoryBufferFormat(const gfx::Size& size,
#if BUILDFLAG(IS_CHROMEOS)
// Allow odd size for CrOS.
// TODO(https://crbug.com/1208788, https://crbug.com/1224781): Merge this
- // with the path that uses gfx::AllowOddHeightMultiPlanarBuffers.
+ // with the path that uses gfx::IsOddHeightMultiPlanarBuffersAllowed.
return true;
#else
// U and V planes are subsampled by a factor of 2.
- if (size.width() % 2)
+ if (size.width() % 2 && !gfx::IsOddWidthMultiPlanarBuffersAllowed())
return false;
- if (size.height() % 2 && !gfx::AllowOddHeightMultiPlanarBuffers())
+ if (size.height() % 2 && !gfx::IsOddHeightMultiPlanarBuffersAllowed())
return false;
return true;
#endif // BUILDFLAG(IS_CHROMEOS)
diff --git a/chromium/gpu/command_buffer/common/mailbox.cc b/chromium/gpu/command_buffer/common/mailbox.cc
index da8fda385c9..ac7f9dd54e2 100644
--- a/chromium/gpu/command_buffer/common/mailbox.cc
+++ b/chromium/gpu/command_buffer/common/mailbox.cc
@@ -9,7 +9,6 @@
#include <string.h>
#include "base/check.h"
-#include "base/cxx17_backports.h"
#include "base/rand_util.h"
#include "base/strings/stringprintf.h"
@@ -51,7 +50,7 @@ Mailbox::Mailbox() {
}
bool Mailbox::IsZero() const {
- for (size_t i = 0; i < base::size(name); ++i) {
+ for (size_t i = 0; i < std::size(name); ++i) {
if (name[i])
return false;
}
diff --git a/chromium/gpu/command_buffer/common/raster_cmd_format.cc b/chromium/gpu/command_buffer/common/raster_cmd_format.cc
index dab0c9e7716..bd9db9d0cc8 100644
--- a/chromium/gpu/command_buffer/common/raster_cmd_format.cc
+++ b/chromium/gpu/command_buffer/common/raster_cmd_format.cc
@@ -7,11 +7,9 @@
// We explicitly do NOT include raster_cmd_format.h here because client side
// and service side have different requirements.
-#include "gpu/command_buffer/common/cmd_buffer_common.h"
-
#include <stddef.h>
-#include "base/cxx17_backports.h"
+#include "gpu/command_buffer/common/cmd_buffer_common.h"
namespace gpu {
namespace raster {
@@ -28,7 +26,7 @@ const char* GetCommandName(CommandId id) {
};
size_t index = static_cast<size_t>(id) - kFirstRasterCommand;
- return (index < base::size(names)) ? names[index] : "*unknown-command*";
+ return (index < std::size(names)) ? names[index] : "*unknown-command*";
}
} // namespace raster
diff --git a/chromium/gpu/command_buffer/common/raster_cmd_format_autogen.h b/chromium/gpu/command_buffer/common/raster_cmd_format_autogen.h
index 729feb22c65..6351f48a894 100644
--- a/chromium/gpu/command_buffer/common/raster_cmd_format_autogen.h
+++ b/chromium/gpu/command_buffer/common/raster_cmd_format_autogen.h
@@ -393,6 +393,7 @@ struct BeginRasterCHROMIUMImmediate {
GLuint _msaa_sample_count,
gpu::raster::MsaaMode _msaa_mode,
GLboolean _can_use_lcd_text,
+ GLboolean _visible,
const GLbyte* _mailbox) {
SetHeader();
sk_color = _sk_color;
@@ -400,6 +401,7 @@ struct BeginRasterCHROMIUMImmediate {
msaa_sample_count = _msaa_sample_count;
msaa_mode = _msaa_mode;
can_use_lcd_text = _can_use_lcd_text;
+ visible = _visible;
memcpy(ImmediateDataAddress(this), _mailbox, ComputeDataSize());
}
@@ -409,10 +411,11 @@ struct BeginRasterCHROMIUMImmediate {
GLuint _msaa_sample_count,
gpu::raster::MsaaMode _msaa_mode,
GLboolean _can_use_lcd_text,
+ GLboolean _visible,
const GLbyte* _mailbox) {
static_cast<ValueType*>(cmd)->Init(_sk_color, _needs_clear,
_msaa_sample_count, _msaa_mode,
- _can_use_lcd_text, _mailbox);
+ _can_use_lcd_text, _visible, _mailbox);
const uint32_t size = ComputeSize();
return NextImmediateCmdAddressTotalSize<ValueType>(cmd, size);
}
@@ -423,10 +426,11 @@ struct BeginRasterCHROMIUMImmediate {
uint32_t msaa_sample_count;
uint32_t msaa_mode;
uint32_t can_use_lcd_text;
+ uint32_t visible;
};
-static_assert(sizeof(BeginRasterCHROMIUMImmediate) == 24,
- "size of BeginRasterCHROMIUMImmediate should be 24");
+static_assert(sizeof(BeginRasterCHROMIUMImmediate) == 28,
+ "size of BeginRasterCHROMIUMImmediate should be 28");
static_assert(offsetof(BeginRasterCHROMIUMImmediate, header) == 0,
"offset of BeginRasterCHROMIUMImmediate header should be 0");
static_assert(offsetof(BeginRasterCHROMIUMImmediate, sk_color) == 4,
@@ -441,6 +445,8 @@ static_assert(offsetof(BeginRasterCHROMIUMImmediate, msaa_mode) == 16,
static_assert(
offsetof(BeginRasterCHROMIUMImmediate, can_use_lcd_text) == 20,
"offset of BeginRasterCHROMIUMImmediate can_use_lcd_text should be 20");
+static_assert(offsetof(BeginRasterCHROMIUMImmediate, visible) == 24,
+ "offset of BeginRasterCHROMIUMImmediate visible should be 24");
struct RasterCHROMIUM {
typedef RasterCHROMIUM ValueType;
diff --git a/chromium/gpu/command_buffer/common/raster_cmd_format_test_autogen.h b/chromium/gpu/command_buffer/common/raster_cmd_format_test_autogen.h
index 7c79ba49332..9ba27ca197b 100644
--- a/chromium/gpu/command_buffer/common/raster_cmd_format_test_autogen.h
+++ b/chromium/gpu/command_buffer/common/raster_cmd_format_test_autogen.h
@@ -49,15 +49,15 @@ TEST_F(RasterFormatTest, GenQueriesEXTImmediate) {
};
cmds::GenQueriesEXTImmediate& cmd =
*GetBufferAs<cmds::GenQueriesEXTImmediate>();
- void* next_cmd = cmd.Set(&cmd, static_cast<GLsizei>(base::size(ids)), ids);
+ void* next_cmd = cmd.Set(&cmd, static_cast<GLsizei>(std::size(ids)), ids);
EXPECT_EQ(static_cast<uint32_t>(cmds::GenQueriesEXTImmediate::kCmdId),
cmd.header.command);
EXPECT_EQ(sizeof(cmd) + RoundSizeToMultipleOfEntries(cmd.n * 4u),
cmd.header.size * 4u);
- EXPECT_EQ(static_cast<GLsizei>(base::size(ids)), cmd.n);
+ EXPECT_EQ(static_cast<GLsizei>(std::size(ids)), cmd.n);
CheckBytesWrittenMatchesExpectedSize(
next_cmd,
- sizeof(cmd) + RoundSizeToMultipleOfEntries(base::size(ids) * 4u));
+ sizeof(cmd) + RoundSizeToMultipleOfEntries(std::size(ids) * 4u));
EXPECT_EQ(0, memcmp(ids, ImmediateDataAddress(&cmd), sizeof(ids)));
}
@@ -69,15 +69,15 @@ TEST_F(RasterFormatTest, DeleteQueriesEXTImmediate) {
};
cmds::DeleteQueriesEXTImmediate& cmd =
*GetBufferAs<cmds::DeleteQueriesEXTImmediate>();
- void* next_cmd = cmd.Set(&cmd, static_cast<GLsizei>(base::size(ids)), ids);
+ void* next_cmd = cmd.Set(&cmd, static_cast<GLsizei>(std::size(ids)), ids);
EXPECT_EQ(static_cast<uint32_t>(cmds::DeleteQueriesEXTImmediate::kCmdId),
cmd.header.command);
EXPECT_EQ(sizeof(cmd) + RoundSizeToMultipleOfEntries(cmd.n * 4u),
cmd.header.size * 4u);
- EXPECT_EQ(static_cast<GLsizei>(base::size(ids)), cmd.n);
+ EXPECT_EQ(static_cast<GLsizei>(std::size(ids)), cmd.n);
CheckBytesWrittenMatchesExpectedSize(
next_cmd,
- sizeof(cmd) + RoundSizeToMultipleOfEntries(base::size(ids) * 4u));
+ sizeof(cmd) + RoundSizeToMultipleOfEntries(std::size(ids) * 4u));
EXPECT_EQ(0, memcmp(ids, ImmediateDataAddress(&cmd), sizeof(ids)));
}
@@ -161,7 +161,7 @@ TEST_F(RasterFormatTest, BeginRasterCHROMIUMImmediate) {
void* next_cmd =
cmd.Set(&cmd, static_cast<GLuint>(11), static_cast<GLboolean>(12),
static_cast<GLuint>(13), static_cast<gpu::raster::MsaaMode>(14),
- static_cast<GLboolean>(15), data);
+ static_cast<GLboolean>(15), static_cast<GLboolean>(16), data);
EXPECT_EQ(static_cast<uint32_t>(cmds::BeginRasterCHROMIUMImmediate::kCmdId),
cmd.header.command);
EXPECT_EQ(sizeof(cmd) + RoundSizeToMultipleOfEntries(sizeof(data)),
@@ -171,6 +171,7 @@ TEST_F(RasterFormatTest, BeginRasterCHROMIUMImmediate) {
EXPECT_EQ(static_cast<GLuint>(13), cmd.msaa_sample_count);
EXPECT_EQ(static_cast<gpu::raster::MsaaMode>(14), cmd.msaa_mode);
EXPECT_EQ(static_cast<GLboolean>(15), cmd.can_use_lcd_text);
+ EXPECT_EQ(static_cast<GLboolean>(16), cmd.visible);
CheckBytesWrittenMatchesExpectedSize(
next_cmd, sizeof(cmd) + RoundSizeToMultipleOfEntries(sizeof(data)));
}
@@ -259,16 +260,16 @@ TEST_F(RasterFormatTest, DeletePaintCacheTextBlobsINTERNALImmediate) {
};
cmds::DeletePaintCacheTextBlobsINTERNALImmediate& cmd =
*GetBufferAs<cmds::DeletePaintCacheTextBlobsINTERNALImmediate>();
- void* next_cmd = cmd.Set(&cmd, static_cast<GLsizei>(base::size(ids)), ids);
+ void* next_cmd = cmd.Set(&cmd, static_cast<GLsizei>(std::size(ids)), ids);
EXPECT_EQ(static_cast<uint32_t>(
cmds::DeletePaintCacheTextBlobsINTERNALImmediate::kCmdId),
cmd.header.command);
EXPECT_EQ(sizeof(cmd) + RoundSizeToMultipleOfEntries(cmd.n * 4u),
cmd.header.size * 4u);
- EXPECT_EQ(static_cast<GLsizei>(base::size(ids)), cmd.n);
+ EXPECT_EQ(static_cast<GLsizei>(std::size(ids)), cmd.n);
CheckBytesWrittenMatchesExpectedSize(
next_cmd,
- sizeof(cmd) + RoundSizeToMultipleOfEntries(base::size(ids) * 4u));
+ sizeof(cmd) + RoundSizeToMultipleOfEntries(std::size(ids) * 4u));
EXPECT_EQ(0, memcmp(ids, ImmediateDataAddress(&cmd), sizeof(ids)));
}
@@ -280,16 +281,16 @@ TEST_F(RasterFormatTest, DeletePaintCachePathsINTERNALImmediate) {
};
cmds::DeletePaintCachePathsINTERNALImmediate& cmd =
*GetBufferAs<cmds::DeletePaintCachePathsINTERNALImmediate>();
- void* next_cmd = cmd.Set(&cmd, static_cast<GLsizei>(base::size(ids)), ids);
+ void* next_cmd = cmd.Set(&cmd, static_cast<GLsizei>(std::size(ids)), ids);
EXPECT_EQ(static_cast<uint32_t>(
cmds::DeletePaintCachePathsINTERNALImmediate::kCmdId),
cmd.header.command);
EXPECT_EQ(sizeof(cmd) + RoundSizeToMultipleOfEntries(cmd.n * 4u),
cmd.header.size * 4u);
- EXPECT_EQ(static_cast<GLsizei>(base::size(ids)), cmd.n);
+ EXPECT_EQ(static_cast<GLsizei>(std::size(ids)), cmd.n);
CheckBytesWrittenMatchesExpectedSize(
next_cmd,
- sizeof(cmd) + RoundSizeToMultipleOfEntries(base::size(ids) * 4u));
+ sizeof(cmd) + RoundSizeToMultipleOfEntries(std::size(ids) * 4u));
EXPECT_EQ(0, memcmp(ids, ImmediateDataAddress(&cmd), sizeof(ids)));
}
diff --git a/chromium/gpu/command_buffer/common/shared_image_usage.h b/chromium/gpu/command_buffer/common/shared_image_usage.h
index 128bfc380a0..ea0a49d9f86 100644
--- a/chromium/gpu/command_buffer/common/shared_image_usage.h
+++ b/chromium/gpu/command_buffer/common/shared_image_usage.h
@@ -54,6 +54,11 @@ enum SharedImageUsage : uint32_t {
SHARED_IMAGE_USAGE_CPU_WRITE = 1 << 14,
// Image will be used in RasterInterface with RawDraw.
SHARED_IMAGE_USAGE_RAW_DRAW = 1 << 15,
+ // Image will be used in RasterInterface for DelegatedCompositing.
+ // TODO(crbug.com/1254033): this usage shall be removed after cc is able to
+ // set a single (duplicated) fence for bunch of tiles instead of having the SI
+ // framework creating fences for each single message when write access ends.
+ SHARED_IMAGE_USAGE_RASTER_DELEGATED_COMPOSITING = 1 << 16,
};
// Create a string to label SharedImageUsage.
diff --git a/chromium/gpu/command_buffer/common/webgpu_cmd_format.cc b/chromium/gpu/command_buffer/common/webgpu_cmd_format.cc
index 468d828e659..2f05e1c296e 100644
--- a/chromium/gpu/command_buffer/common/webgpu_cmd_format.cc
+++ b/chromium/gpu/command_buffer/common/webgpu_cmd_format.cc
@@ -7,7 +7,6 @@
// We explicitly do NOT include webgpu_cmd_format.h here because client side
// and service side have different requirements.
-#include "base/cxx17_backports.h"
#include "gpu/command_buffer/common/cmd_buffer_common.h"
namespace gpu {
@@ -25,7 +24,7 @@ const char* GetCommandName(CommandId id) {
};
size_t index = static_cast<size_t>(id) - kFirstWebGPUCommand;
- return (index < base::size(names)) ? names[index] : "*unknown-command*";
+ return (index < std::size(names)) ? names[index] : "*unknown-command*";
}
} // namespace webgpu
diff --git a/chromium/gpu/command_buffer/raster_cmd_buffer_functions.txt b/chromium/gpu/command_buffer/raster_cmd_buffer_functions.txt
index a4149762673..b174fbc4b73 100644
--- a/chromium/gpu/command_buffer/raster_cmd_buffer_functions.txt
+++ b/chromium/gpu/command_buffer/raster_cmd_buffer_functions.txt
@@ -23,7 +23,7 @@ GL_APICALL void GL_APIENTRY glLoseContextCHROMIUM (GLenumResetStatus cur
GL_APICALL GLenum GL_APIENTRY glGetGraphicsResetStatusKHR (void);
// Extension CHROMIUM_raster_transport
-GL_APICALL void GL_APIENTRY glBeginRasterCHROMIUM (GLuint sk_color, GLboolean needs_clear, GLuint msaa_sample_count, gpu::raster::MsaaMode msaa_mode, GLboolean can_use_lcd_text, const GLbyte* mailbox);
+GL_APICALL void GL_APIENTRY glBeginRasterCHROMIUM (GLuint sk_color, GLboolean needs_clear, GLuint msaa_sample_count, gpu::raster::MsaaMode msaa_mode, GLboolean can_use_lcd_text, GLboolean visible, const GLbyte* mailbox);
GL_APICALL void GL_APIENTRY glRasterCHROMIUM (GLuint raster_shm_id, GLuint raster_shm_offset, GLuint raster_shm_size, GLuint font_shm_id, GLuint font_shm_offset, GLuint font_shm_size);
GL_APICALL void GL_APIENTRY glEndRasterCHROMIUM (void);
GL_APICALL void GL_APIENTRY glCreateTransferCacheEntryINTERNAL (GLuint entry_type, GLuint entry_id, GLuint handle_shm_id, GLuint handle_shm_offset, GLuint data_shm_id, GLuint data_shm_offset, GLuint data_size);
diff --git a/chromium/gpu/command_buffer/service/BUILD.gn b/chromium/gpu/command_buffer/service/BUILD.gn
index bf33c6f8009..a56a6c48a6a 100644
--- a/chromium/gpu/command_buffer/service/BUILD.gn
+++ b/chromium/gpu/command_buffer/service/BUILD.gn
@@ -366,7 +366,8 @@ target(link_target_type, "gles2_sources") {
"shared_image_backing_factory_angle_vulkan.h",
]
- if (is_linux || is_chromeos || is_fuchsia || is_android || is_win) {
+ if (is_linux || is_chromeos || is_fuchsia || is_android || is_win ||
+ is_apple) {
sources += [
"external_semaphore.cc",
"external_semaphore.h",
diff --git a/chromium/gpu/command_buffer/service/buffer_manager_unittest.cc b/chromium/gpu/command_buffer/service/buffer_manager_unittest.cc
index cffb86682bd..e9dc6ea19cb 100644
--- a/chromium/gpu/command_buffer/service/buffer_manager_unittest.cc
+++ b/chromium/gpu/command_buffer/service/buffer_manager_unittest.cc
@@ -2,13 +2,13 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
+#include "gpu/command_buffer/service/buffer_manager.h"
+
#include <stddef.h>
#include <stdint.h>
#include <memory>
-#include "base/cxx17_backports.h"
-#include "gpu/command_buffer/service/buffer_manager.h"
#include "gpu/command_buffer/service/error_state_mock.h"
#include "gpu/command_buffer/service/feature_info.h"
#include "gpu/command_buffer/service/gpu_service_test.h"
@@ -527,7 +527,7 @@ TEST_F(BufferManagerTest, BindBufferConflicts) {
GL_TRANSFORM_FEEDBACK_BUFFER,
GL_UNIFORM_BUFFER
};
- for (size_t ii = 0; ii < base::size(kTargets); ++ii) {
+ for (size_t ii = 0; ii < std::size(kTargets); ++ii) {
client_id++;
service_id++;
manager_->CreateBuffer(client_id, service_id);
@@ -535,7 +535,7 @@ TEST_F(BufferManagerTest, BindBufferConflicts) {
ASSERT_TRUE(buffer != nullptr);
EXPECT_TRUE(manager_->SetTarget(buffer, kTargets[ii]));
- for (size_t jj = 0; jj < base::size(kTargets); ++jj) {
+ for (size_t jj = 0; jj < std::size(kTargets); ++jj) {
EXPECT_TRUE(manager_->SetTarget(buffer, kTargets[jj]));
}
EXPECT_EQ(kTargets[ii], GetInitialTarget(buffer));
@@ -554,7 +554,7 @@ TEST_F(BufferManagerTest, BindBufferConflicts) {
GL_TRANSFORM_FEEDBACK_BUFFER,
GL_UNIFORM_BUFFER
};
- for (size_t ii = 0; ii < base::size(kTargets); ++ii) {
+ for (size_t ii = 0; ii < std::size(kTargets); ++ii) {
client_id++;
service_id++;
manager_->CreateBuffer(client_id, service_id);
@@ -562,7 +562,7 @@ TEST_F(BufferManagerTest, BindBufferConflicts) {
ASSERT_TRUE(buffer != nullptr);
EXPECT_TRUE(manager_->SetTarget(buffer, kTargets[ii]));
- for (size_t jj = 0; jj < base::size(kTargets); ++jj) {
+ for (size_t jj = 0; jj < std::size(kTargets); ++jj) {
EXPECT_TRUE(manager_->SetTarget(buffer, kTargets[jj]));
}
}
diff --git a/chromium/gpu/command_buffer/service/common_decoder.cc b/chromium/gpu/command_buffer/service/common_decoder.cc
index 82dea1cffc8..6edc3247ab3 100644
--- a/chromium/gpu/command_buffer/service/common_decoder.cc
+++ b/chromium/gpu/command_buffer/service/common_decoder.cc
@@ -9,7 +9,6 @@
#include <algorithm>
-#include "base/cxx17_backports.h"
#include "base/numerics/safe_math.h"
#include "gpu/command_buffer/service/command_buffer_service.h"
#include "gpu/command_buffer/service/decoder_client.h"
@@ -129,6 +128,13 @@ bool CommonDecoder::Bucket::GetAsStrings(
return true;
}
+bool CommonDecoder::Bucket::OffsetSizeValid(size_t offset, size_t size) const {
+ size_t end = 0;
+ if (!base::CheckAdd<size_t>(offset, size).AssignIfValid(&end))
+ return false;
+ return end <= size_;
+}
+
CommonDecoder::CommonDecoder(DecoderClient* client,
CommandBufferServiceBase* command_buffer_service)
: command_buffer_service_(command_buffer_service),
@@ -217,7 +223,7 @@ RETURN_TYPE GetImmediateDataAs(const volatile COMMAND_TYPE& pod) {
error::Error CommonDecoder::DoCommonCommand(unsigned int command,
unsigned int arg_count,
const volatile void* cmd_data) {
- if (command < base::size(command_info)) {
+ if (command < std::size(command_info)) {
const CommandInfo& info = command_info[command];
unsigned int info_arg_count = static_cast<unsigned int>(info.arg_count);
if ((info.arg_flags == cmd::kFixed && arg_count == info_arg_count) ||
diff --git a/chromium/gpu/command_buffer/service/common_decoder.h b/chromium/gpu/command_buffer/service/common_decoder.h
index 8096224b317..3f96002cce7 100644
--- a/chromium/gpu/command_buffer/service/common_decoder.h
+++ b/chromium/gpu/command_buffer/service/common_decoder.h
@@ -11,16 +11,17 @@
#include <map>
#include <memory>
#include <string>
+#include <vector>
#include "base/memory/raw_ptr.h"
#include "gpu/command_buffer/common/buffer.h"
#include "gpu/command_buffer/common/cmd_buffer_common.h"
-#include "gpu/command_buffer/service/async_api_interface.h"
+#include "gpu/command_buffer/common/constants.h"
#include "gpu/gpu_export.h"
// Forwardly declare a few GL types to avoid including GL header files.
-typedef int GLsizei;
-typedef int GLint;
+using GLsizei = int;
+using GLint = int;
namespace gfx {
class ColorSpace;
@@ -35,9 +36,9 @@ class DecoderClient;
// o3d/gl2 command buffer decoder.
class GPU_EXPORT CommonDecoder {
public:
- typedef error::Error Error;
+ using Error = error::Error;
- static const unsigned int kMaxStackDepth = 32;
+ static constexpr unsigned int kMaxStackDepth = 32;
// A bucket is a buffer to help collect memory across a command buffer. When
// creating a command buffer implementation of an existing API, sometimes that
@@ -107,12 +108,7 @@ class GPU_EXPORT CommonDecoder {
std::vector<GLint>* _length);
private:
- bool OffsetSizeValid(size_t offset, size_t size) const {
- size_t end = 0;
- if (!base::CheckAdd<size_t>(offset, size).AssignIfValid(&end))
- return false;
- return end <= size_;
- }
+ bool OffsetSizeValid(size_t offset, size_t size) const;
size_t size_;
::std::unique_ptr<int8_t[]> data_;
@@ -225,11 +221,11 @@ class GPU_EXPORT CommonDecoder {
raw_ptr<DecoderClient> client_;
size_t max_bucket_size_;
- typedef std::map<uint32_t, std::unique_ptr<Bucket>> BucketMap;
+ using BucketMap = std::map<uint32_t, std::unique_ptr<Bucket>>;
BucketMap buckets_;
- typedef Error (CommonDecoder::*CmdHandler)(uint32_t immediate_data_size,
- const volatile void* data);
+ using CmdHandler = Error (CommonDecoder::*)(uint32_t immediate_data_size,
+ const volatile void* data);
// A struct to hold info about each command.
struct CommandInfo {
diff --git a/chromium/gpu/command_buffer/service/external_semaphore.cc b/chromium/gpu/command_buffer/service/external_semaphore.cc
index 0c18fc505fd..bb14868f802 100644
--- a/chromium/gpu/command_buffer/service/external_semaphore.cc
+++ b/chromium/gpu/command_buffer/service/external_semaphore.cc
@@ -27,7 +27,7 @@ GLuint ImportSemaphoreHandleToGLSemaphore(SemaphoreHandle handle) {
if (!handle.is_valid())
return 0;
-#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_ANDROID)
+#if BUILDFLAG(IS_POSIX)
if (handle.vk_handle_type() !=
VK_EXTERNAL_SEMAPHORE_HANDLE_TYPE_OPAQUE_FD_BIT) {
DLOG(ERROR) << "Importing semaphore handle of unexpected type:"
@@ -187,4 +187,11 @@ VkSemaphore ExternalSemaphore::GetVkSemaphore() {
return semaphore_;
}
+SemaphoreHandle ExternalSemaphore::TakeSemaphoreHandle() {
+ SemaphoreHandle handle = std::move(handle_);
+ DCHECK(!handle_.is_valid());
+ Reset();
+ return handle;
+}
+
} // namespace gpu
diff --git a/chromium/gpu/command_buffer/service/external_semaphore.h b/chromium/gpu/command_buffer/service/external_semaphore.h
index 01a89502fd2..062f0e6e038 100644
--- a/chromium/gpu/command_buffer/service/external_semaphore.h
+++ b/chromium/gpu/command_buffer/service/external_semaphore.h
@@ -50,6 +50,9 @@ class GPU_GLES2_EXPORT ExternalSemaphore {
bool is_valid() const { return context_provider_ && handle_.is_valid(); }
SemaphoreHandle handle() { return handle_.Duplicate(); }
+ // Take ownership of semaphore handle and then calls Reset().
+ SemaphoreHandle TakeSemaphoreHandle();
+
private:
raw_ptr<viz::VulkanContextProvider> context_provider_ = nullptr;
VkSemaphore semaphore_ = VK_NULL_HANDLE;
@@ -59,4 +62,4 @@ class GPU_GLES2_EXPORT ExternalSemaphore {
} // namespace gpu
-#endif // GPU_COMMAND_BUFFER_SERVICE_EXTERNAL_SEMAPHORE_H_ \ No newline at end of file
+#endif // GPU_COMMAND_BUFFER_SERVICE_EXTERNAL_SEMAPHORE_H_
diff --git a/chromium/gpu/command_buffer/service/external_vk_image_backing.cc b/chromium/gpu/command_buffer/service/external_vk_image_backing.cc
index 703edc3f34e..86aeb50deb2 100644
--- a/chromium/gpu/command_buffer/service/external_vk_image_backing.cc
+++ b/chromium/gpu/command_buffer/service/external_vk_image_backing.cc
@@ -7,7 +7,6 @@
#include <utility>
#include <vector>
-#include "base/cxx17_backports.h"
#include "build/build_config.h"
#include "components/viz/common/resources/resource_sizes.h"
#include "gpu/command_buffer/service/external_vk_image_gl_representation.h"
@@ -80,7 +79,7 @@ static const struct {
{GL_ZERO, GL_ZERO, 0}, // YUV_420_BIPLANAR
{GL_ZERO, GL_ZERO, 0}, // P010
};
-static_assert(base::size(kFormatTable) == (viz::RESOURCE_FORMAT_MAX + 1),
+static_assert(std::size(kFormatTable) == (viz::RESOURCE_FORMAT_MAX + 1),
"kFormatTable does not handle all cases.");
class ScopedDedicatedMemoryObject {
@@ -425,14 +424,26 @@ bool ExternalVkImageBacking::BeginAccess(
GrBackendSurfaceMutableState(VK_IMAGE_LAYOUT_COLOR_ATTACHMENT_OPTIMAL,
VK_QUEUE_FAMILY_EXTERNAL));
- auto semaphore = external_semaphore_pool()->GetOrCreateSemaphore();
- if (!SubmitSignalVkSemaphore(
- context_provider()->GetDeviceQueue()->GetVulkanQueue(),
- semaphore.GetVkSemaphore())) {
+ ExternalSemaphore external_semaphore =
+ external_semaphore_pool()->GetOrCreateSemaphore();
+ GrBackendSemaphore semaphore;
+ semaphore.initVulkan(external_semaphore.GetVkSemaphore());
+
+ GrFlushInfo flush_info;
+ flush_info.fNumSemaphores = 1;
+ flush_info.fSignalSemaphores = &semaphore;
+
+ if (gr_context->flush(flush_info) != GrSemaphoresSubmitted::kYes) {
LOG(ERROR) << "Failed to create a signaled semaphore";
return false;
}
- external_semaphores->push_back(std::move(semaphore));
+
+ if (!gr_context->submit()) {
+ LOG(ERROR) << "Failed GrContext submit";
+ return false;
+ }
+
+ external_semaphores->push_back(std::move(external_semaphore));
}
if (readonly) {
@@ -592,7 +603,7 @@ GLuint ExternalVkImageBacking::ProduceGLTextureInternal() {
gl::GLApi* api = gl::g_current_gl_context;
absl::optional<ScopedDedicatedMemoryObject> memory_object;
if (!use_separate_gl_texture()) {
-#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_ANDROID)
+#if BUILDFLAG(IS_POSIX)
auto memory_fd = image_->GetMemoryFd();
if (!memory_fd.is_valid())
return 0;
diff --git a/chromium/gpu/command_buffer/service/external_vk_image_dawn_representation.cc b/chromium/gpu/command_buffer/service/external_vk_image_dawn_representation.cc
index fc633112bfb..5f8b5ed294d 100644
--- a/chromium/gpu/command_buffer/service/external_vk_image_dawn_representation.cc
+++ b/chromium/gpu/command_buffer/service/external_vk_image_dawn_representation.cc
@@ -55,11 +55,12 @@ WGPUTexture ExternalVkImageDawnRepresentation::BeginAccess(
texture_descriptor.mipLevelCount = 1;
texture_descriptor.sampleCount = 1;
- // We need to have an internal usage of CopySrc in order to use
- // CopyTextureToTextureInternal.
+ // We need to have internal usages of CopySrc for copies and
+ // RenderAttachment for clears.
WGPUDawnTextureInternalUsageDescriptor internalDesc = {};
internalDesc.chain.sType = WGPUSType_DawnTextureInternalUsageDescriptor;
- internalDesc.internalUsage = WGPUTextureUsage_CopySrc;
+ internalDesc.internalUsage =
+ WGPUTextureUsage_CopySrc | WGPUTextureUsage_RenderAttachment;
texture_descriptor.nextInChain =
reinterpret_cast<WGPUChainedStruct*>(&internalDesc);
diff --git a/chromium/gpu/command_buffer/service/external_vk_image_factory_unittest.cc b/chromium/gpu/command_buffer/service/external_vk_image_factory_unittest.cc
index ba630520c98..6cbd1d0f077 100644
--- a/chromium/gpu/command_buffer/service/external_vk_image_factory_unittest.cc
+++ b/chromium/gpu/command_buffer/service/external_vk_image_factory_unittest.cc
@@ -21,6 +21,7 @@
#include "gpu/vulkan/vulkan_implementation.h"
#include "testing/gtest/include/gtest/gtest.h"
#include "third_party/skia/include/core/SkCanvas.h"
+#include "third_party/skia/include/core/SkColorSpace.h"
#include "third_party/skia/include/core/SkImage.h"
#include "third_party/skia/include/core/SkPromiseImageTexture.h"
#include "third_party/skia/include/core/SkSurface.h"
@@ -251,6 +252,11 @@ TEST_F(ExternalVkImageFactoryTest, DawnWrite_SkiaVulkanRead) {
EXPECT_EQ(pixel[3], 255);
}
+ if (skia_scoped_access->end_state()) {
+ context_state_->gr_context()->setBackendTextureState(
+ backend_texture, *skia_scoped_access->end_state());
+ }
+
GrFlushInfo flush_info;
flush_info.fNumSemaphores = end_semaphores.size();
flush_info.fSignalSemaphores = end_semaphores.data();
@@ -294,7 +300,7 @@ TEST_F(ExternalVkImageFactoryTest, SkiaVulkanWrite_DawnRead) {
std::vector<GrBackendSemaphore> begin_semaphores;
std::vector<GrBackendSemaphore> end_semaphores;
auto skia_scoped_access = skia_representation->BeginScopedWriteAccess(
- 1 /* final_msaa_count */,
+ /*final_msaa_count=*/1,
SkSurfaceProps(0 /* flags */, kUnknown_SkPixelGeometry),
&begin_semaphores, &end_semaphores,
gpu::SharedImageRepresentation::AllowUnclearedAccess::kYes);
diff --git a/chromium/gpu/command_buffer/service/external_vk_image_skia_representation.cc b/chromium/gpu/command_buffer/service/external_vk_image_skia_representation.cc
index 41773dddca4..f8fcc75e7a6 100644
--- a/chromium/gpu/command_buffer/service/external_vk_image_skia_representation.cc
+++ b/chromium/gpu/command_buffer/service/external_vk_image_skia_representation.cc
@@ -11,6 +11,7 @@
#include "gpu/vulkan/vulkan_implementation.h"
#include "gpu/vulkan/vulkan_util.h"
#include "third_party/skia/include/core/SkCanvas.h"
+#include "third_party/skia/include/core/SkColorSpace.h"
#include "third_party/skia/include/core/SkPromiseImageTexture.h"
#include "third_party/skia/include/gpu/GrBackendSemaphore.h"
@@ -213,6 +214,17 @@ void ExternalVkImageSkiaRepresentation::EndAccess(bool readonly) {
DCHECK_NE(access_mode_, kNone);
DCHECK(backing_impl()->need_synchronization() || !end_access_semaphore_);
+ // TODO(crbug.com/1307914): This check is specific to the interop case i.e.
+ // when need_synchronization() is true, but we can generalize this by making
+ // the client TakeEndState() and asserting that the |end_state_| is null here.
+#if DCHECK_IS_ON()
+ GrVkImageInfo info;
+ auto result = backing_impl()->backend_texture().getVkImageInfo(&info);
+ DCHECK(result);
+ DCHECK(!backing_impl()->need_synchronization() ||
+ info.fCurrentQueueFamily == VK_QUEUE_FAMILY_EXTERNAL);
+#endif
+
backing_impl()->EndAccess(readonly, std::move(end_access_semaphore_),
false /* is_gl */);
diff --git a/chromium/gpu/command_buffer/service/feature_info.cc b/chromium/gpu/command_buffer/service/feature_info.cc
index 2c390f99b0c..cc7acaff09e 100644
--- a/chromium/gpu/command_buffer/service/feature_info.cc
+++ b/chromium/gpu/command_buffer/service/feature_info.cc
@@ -12,7 +12,6 @@
#include "base/command_line.h"
#include "base/containers/contains.h"
-#include "base/cxx17_backports.h"
#include "base/metrics/histogram_functions.h"
#include "base/metrics/histogram_macros.h"
#include "base/strings/string_number_conversions.h"
@@ -223,9 +222,8 @@ void FeatureInfo::InitializeBasicState(const base::CommandLine* command_line) {
const auto useANGLE = command_line->GetSwitchValueASCII(switches::kUseANGLE);
feature_flags_.is_swiftshader_for_webgl =
- (useGL == gl::kGLImplementationSwiftShaderForWebGLName) ||
- ((useGL == gl::kGLImplementationANGLEName) &&
- (useANGLE == gl::kANGLEImplementationSwiftShaderForWebGLName));
+ (useGL == gl::kGLImplementationANGLEName) &&
+ (useANGLE == gl::kANGLEImplementationSwiftShaderForWebGLName);
// The shader translator is needed to translate from WebGL-conformant GLES SL
// to normal GLES SL, enforce WebGL conformance, translate from GLES SL 1.0 to
@@ -1920,8 +1918,8 @@ void FeatureInfo::InitializeFloatAndHalfFloatFeatures(
"GPU.RenderableFormat.RG32F.FLOAT",
"GPU.RenderableFormat.R11F_G11F_B10F.FLOAT",
};
- DCHECK_EQ(base::size(kInternalFormats), base::size(kFormats));
- for (size_t i = 0; i < base::size(kFormats); ++i) {
+ DCHECK_EQ(std::size(kInternalFormats), std::size(kFormats));
+ for (size_t i = 0; i < std::size(kFormats); ++i) {
glTexImage2D(GL_TEXTURE_2D, 0, kInternalFormats[i], width, width, 0,
kFormats[i], GL_FLOAT, nullptr);
bool supported = glCheckFramebufferStatusEXT(GL_FRAMEBUFFER) ==
diff --git a/chromium/gpu/command_buffer/service/framebuffer_manager_unittest.cc b/chromium/gpu/command_buffer/service/framebuffer_manager_unittest.cc
index 079885001ab..569c0222b3f 100644
--- a/chromium/gpu/command_buffer/service/framebuffer_manager_unittest.cc
+++ b/chromium/gpu/command_buffer/service/framebuffer_manager_unittest.cc
@@ -2,17 +2,17 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
+#include "gpu/command_buffer/service/framebuffer_manager.h"
+
#include <stddef.h>
#include <stdint.h>
#include <memory>
-#include "base/cxx17_backports.h"
#include "base/memory/raw_ptr.h"
#include "gpu/command_buffer/client/client_test_helper.h"
#include "gpu/command_buffer/service/error_state_mock.h"
#include "gpu/command_buffer/service/feature_info.h"
-#include "gpu/command_buffer/service/framebuffer_manager.h"
#include "gpu/command_buffer/service/gles2_cmd_decoder_mock.h"
#include "gpu/command_buffer/service/gpu_service_test.h"
#include "gpu/command_buffer/service/gpu_tracer.h"
@@ -1087,7 +1087,7 @@ TEST_F(FramebufferInfoTest, DrawBuffers) {
framebuffer_->GetDrawBuffer(i));
}
- for (size_t ii = 0; ii < base::size(kTextureClientId); ++ii) {
+ for (size_t ii = 0; ii < std::size(kTextureClientId); ++ii) {
texture_manager_->CreateTexture(
kTextureClientId[ii], kTextureServiceId[ii]);
scoped_refptr<TextureRef> texture(
@@ -1190,7 +1190,7 @@ TEST_F(FramebufferInfoTest, DrawBufferMasks) {
GL_FLOAT,
GL_UNSIGNED_INT};
- for (size_t ii = 0; ii < base::size(kTextureClientId); ++ii) {
+ for (size_t ii = 0; ii < std::size(kTextureClientId); ++ii) {
texture_manager_->CreateTexture(
kTextureClientId[ii], kTextureServiceId[ii]);
scoped_refptr<TextureRef> texture(
diff --git a/chromium/gpu/command_buffer/service/gles2_cmd_decoder.cc b/chromium/gpu/command_buffer/service/gles2_cmd_decoder.cc
index 52817d55d83..4847ff3403f 100644
--- a/chromium/gpu/command_buffer/service/gles2_cmd_decoder.cc
+++ b/chromium/gpu/command_buffer/service/gles2_cmd_decoder.cc
@@ -5998,7 +5998,7 @@ error::Error GLES2DecoderImpl::DoCommandsImpl(unsigned int num_commands,
const unsigned int arg_count = size - 1;
unsigned int command_index = command - kFirstGLES2Command;
- if (command_index < base::size(command_info)) {
+ if (command_index < std::size(command_info)) {
const CommandInfo& info = command_info[command_index];
unsigned int info_arg_count = static_cast<unsigned int>(info.arg_count);
if ((info.arg_flags == cmd::kFixed && arg_count == info_arg_count) ||
@@ -14760,7 +14760,7 @@ const CompressedFormatInfo kCompressedFormatInfoArray[] = {
};
const CompressedFormatInfo* GetCompressedFormatInfo(GLenum format) {
- for (size_t i = 0; i < base::size(kCompressedFormatInfoArray); i++) {
+ for (size_t i = 0; i < std::size(kCompressedFormatInfoArray); i++) {
if (kCompressedFormatInfoArray[i].format == format) {
return &kCompressedFormatInfoArray[i];
}
diff --git a/chromium/gpu/command_buffer/service/gles2_cmd_decoder_passthrough.cc b/chromium/gpu/command_buffer/service/gles2_cmd_decoder_passthrough.cc
index bcb90de393e..4ca2428bc32 100644
--- a/chromium/gpu/command_buffer/service/gles2_cmd_decoder_passthrough.cc
+++ b/chromium/gpu/command_buffer/service/gles2_cmd_decoder_passthrough.cc
@@ -10,7 +10,6 @@
#include "base/bind.h"
#include "base/callback.h"
-#include "base/cxx17_backports.h"
#include "base/memory/raw_ptr.h"
#include "base/strings/string_split.h"
#include "build/build_config.h"
@@ -847,7 +846,7 @@ GLES2Decoder::Error GLES2DecoderPassthroughImpl::DoCommandsImpl(
const unsigned int arg_count = size - 1;
unsigned int command_index = command - kFirstGLES2Command;
- if (command_index < base::size(command_info)) {
+ if (command_index < std::size(command_info)) {
const CommandInfo& info = command_info[command_index];
unsigned int info_arg_count = static_cast<unsigned int>(info.arg_count);
if ((info.arg_flags == cmd::kFixed && arg_count == info_arg_count) ||
@@ -994,7 +993,7 @@ gpu::ContextResult GLES2DecoderPassthroughImpl::Initialize(
};
RequestExtensions(api(), requestable_extensions,
kRequiredFunctionalityExtensions,
- base::size(kRequiredFunctionalityExtensions));
+ std::size(kRequiredFunctionalityExtensions));
if (request_optional_extensions_) {
static constexpr const char* kOptionalFunctionalityExtensions[] = {
@@ -1039,7 +1038,7 @@ gpu::ContextResult GLES2DecoderPassthroughImpl::Initialize(
};
RequestExtensions(api(), requestable_extensions,
kOptionalFunctionalityExtensions,
- base::size(kOptionalFunctionalityExtensions));
+ std::size(kOptionalFunctionalityExtensions));
}
context->ReinitializeDynamicBindings();
@@ -1085,9 +1084,12 @@ gpu::ContextResult GLES2DecoderPassthroughImpl::Initialize(
IsWebGLContextType(attrib_helper.context_type),
"missing GL_ANGLE_webgl_compatibility");
FAIL_INIT_IF_NOT(feature_info_->feature_flags().angle_request_extension,
- "missing GL_ANGLE_request_extension");
+ "missing GL_ANGLE_request_extension");
FAIL_INIT_IF_NOT(feature_info_->feature_flags().khr_debug,
"missing GL_KHR_debug");
+ FAIL_INIT_IF_NOT(!attrib_helper.fail_if_major_perf_caveat ||
+ !feature_info_->feature_flags().is_swiftshader_for_webgl,
+ "fail_if_major_perf_caveat + swiftshader");
FAIL_INIT_IF_NOT(!attrib_helper.enable_oop_rasterization,
"oop rasterization not supported");
FAIL_INIT_IF_NOT(!IsES31ForTestingContextType(attrib_helper.context_type) ||
diff --git a/chromium/gpu/command_buffer/service/gles2_cmd_decoder_passthrough.h b/chromium/gpu/command_buffer/service/gles2_cmd_decoder_passthrough.h
index a11155b769a..685d44acdb6 100644
--- a/chromium/gpu/command_buffer/service/gles2_cmd_decoder_passthrough.h
+++ b/chromium/gpu/command_buffer/service/gles2_cmd_decoder_passthrough.h
@@ -901,6 +901,7 @@ class GPU_GLES2_EXPORT GLES2DecoderPassthroughImpl
// Include the prototypes of all the doer functions from a separate header to
// keep this file clean.
+#include "base/time/time.h"
#include "gpu/command_buffer/service/gles2_cmd_decoder_passthrough_doer_prototypes.h"
};
diff --git a/chromium/gpu/command_buffer/service/gles2_cmd_decoder_passthrough_doers.cc b/chromium/gpu/command_buffer/service/gles2_cmd_decoder_passthrough_doers.cc
index 7bda06215d8..59caeecc40d 100644
--- a/chromium/gpu/command_buffer/service/gles2_cmd_decoder_passthrough_doers.cc
+++ b/chromium/gpu/command_buffer/service/gles2_cmd_decoder_passthrough_doers.cc
@@ -2554,6 +2554,12 @@ error::Error GLES2DecoderPassthroughImpl::DoReadPixelsAsync(
}
pending_read_pixels.fence = gl::GLFence::Create();
+ if (!pending_read_pixels.fence) {
+ InsertError(GL_INVALID_OPERATION, "gl::GLFence::Create() failed.");
+ MarkContextLost(error::kUnknown);
+ group_->LoseContexts(error::kUnknown);
+ return error::kLostContext;
+ }
if (CheckErrorCallbackState()) {
return error::kNoError;
@@ -3724,10 +3730,22 @@ error::Error GLES2DecoderPassthroughImpl::DoEndQueryEXT(GLenum target,
switch (target) {
case GL_COMMANDS_COMPLETED_CHROMIUM:
pending_query.commands_completed_fence = gl::GLFence::Create();
+ if (!pending_query.commands_completed_fence) {
+ InsertError(GL_INVALID_OPERATION, "gl::GLFence::Create() failed.");
+ MarkContextLost(error::kUnknown);
+ group_->LoseContexts(error::kUnknown);
+ return error::kLostContext;
+ }
break;
case GL_READBACK_SHADOW_COPIES_UPDATED_CHROMIUM:
pending_query.buffer_shadow_update_fence = gl::GLFence::Create();
+ if (!pending_query.buffer_shadow_update_fence) {
+ InsertError(GL_INVALID_OPERATION, "gl::GLFence::Create() failed.");
+ MarkContextLost(error::kUnknown);
+ group_->LoseContexts(error::kUnknown);
+ return error::kLostContext;
+ }
pending_query.buffer_shadow_updates = std::move(buffer_shadow_updates_);
buffer_shadow_updates_.clear();
break;
diff --git a/chromium/gpu/command_buffer/service/gles2_cmd_decoder_unittest.cc b/chromium/gpu/command_buffer/service/gles2_cmd_decoder_unittest.cc
index baa0e9cb420..0973e010b9e 100644
--- a/chromium/gpu/command_buffer/service/gles2_cmd_decoder_unittest.cc
+++ b/chromium/gpu/command_buffer/service/gles2_cmd_decoder_unittest.cc
@@ -9,7 +9,6 @@
#include "base/bind.h"
#include "base/command_line.h"
-#include "base/cxx17_backports.h"
#include "base/strings/string_number_conversions.h"
#include "gpu/command_buffer/common/gles2_cmd_format.h"
#include "gpu/command_buffer/common/gles2_cmd_utils.h"
@@ -934,7 +933,7 @@ static void CheckBeginEndQueryBadMemoryFails(GLES2DecoderTestBase* test,
}
TEST_P(GLES2DecoderManualInitTest, BeginEndQueryEXTBadMemoryIdFails) {
- for (size_t i = 0; i < base::size(kQueryTypes); ++i) {
+ for (size_t i = 0; i < std::size(kQueryTypes); ++i) {
CheckBeginEndQueryBadMemoryFails(this, kNewClientId, kQueryTypes[i],
kInvalidSharedMemoryId,
kSharedMemoryOffset);
@@ -942,7 +941,7 @@ TEST_P(GLES2DecoderManualInitTest, BeginEndQueryEXTBadMemoryIdFails) {
}
TEST_P(GLES2DecoderManualInitTest, BeginEndQueryEXTBadMemoryOffsetFails) {
- for (size_t i = 0; i < base::size(kQueryTypes); ++i) {
+ for (size_t i = 0; i < std::size(kQueryTypes); ++i) {
// Out-of-bounds.
CheckBeginEndQueryBadMemoryFails(this, kNewClientId, kQueryTypes[i],
shared_memory_id_,
@@ -954,7 +953,7 @@ TEST_P(GLES2DecoderManualInitTest, BeginEndQueryEXTBadMemoryOffsetFails) {
}
TEST_P(GLES2DecoderManualInitTest, QueryReuseTest) {
- for (size_t i = 0; i < base::size(kQueryTypes); ++i) {
+ for (size_t i = 0; i < std::size(kQueryTypes); ++i) {
const QueryType& query_type = kQueryTypes[i];
GLES2DecoderTestBase::InitState init;
@@ -1289,7 +1288,7 @@ TEST_P(GLES2DecoderTest, IsEnabledReturnsCachedValue) {
static const GLenum kStates[] = {
GL_DEPTH_TEST, GL_STENCIL_TEST,
};
- for (size_t ii = 0; ii < base::size(kStates); ++ii) {
+ for (size_t ii = 0; ii < std::size(kStates); ++ii) {
cmds::Enable enable_cmd;
GLenum state = kStates[ii];
enable_cmd.Init(state);
diff --git a/chromium/gpu/command_buffer/service/gles2_cmd_decoder_unittest_2_autogen.h b/chromium/gpu/command_buffer/service/gles2_cmd_decoder_unittest_2_autogen.h
index fa45593b8f5..aca6653647c 100644
--- a/chromium/gpu/command_buffer/service/gles2_cmd_decoder_unittest_2_autogen.h
+++ b/chromium/gpu/command_buffer/service/gles2_cmd_decoder_unittest_2_autogen.h
@@ -919,14 +919,14 @@ TEST_P(GLES2DecoderTest2, ShaderSourceBucketInvalidHeader) {
const char kSource0[] = "hello";
const char* kSource[] = {kSource0};
const char kValidStrEnd = 0;
- const GLsizei kCount = static_cast<GLsizei>(base::size(kSource));
+ const GLsizei kCount = static_cast<GLsizei>(std::size(kSource));
const GLsizei kTests[] = {
kCount + 1,
0,
std::numeric_limits<GLsizei>::max(),
-1,
};
- for (size_t ii = 0; ii < base::size(kTests); ++ii) {
+ for (size_t ii = 0; ii < std::size(kTests); ++ii) {
SetBucketAsCStrings(kBucketId, 1, kSource, kTests[ii], kValidStrEnd);
cmds::ShaderSourceBucket cmd;
cmd.Init(client_shader_id_, kBucketId);
@@ -1221,14 +1221,14 @@ TEST_P(GLES3DecoderTest2, TransformFeedbackVaryingsBucketInvalidHeader) {
const char kSource0[] = "hello";
const char* kSource[] = {kSource0};
const char kValidStrEnd = 0;
- const GLsizei kCount = static_cast<GLsizei>(base::size(kSource));
+ const GLsizei kCount = static_cast<GLsizei>(std::size(kSource));
const GLsizei kTests[] = {
kCount + 1,
0,
std::numeric_limits<GLsizei>::max(),
-1,
};
- for (size_t ii = 0; ii < base::size(kTests); ++ii) {
+ for (size_t ii = 0; ii < std::size(kTests); ++ii) {
SetBucketAsCStrings(kBucketId, 1, kSource, kTests[ii], kValidStrEnd);
cmds::TransformFeedbackVaryingsBucket cmd;
cmd.Init(client_program_id_, kBucketId, GL_INTERLEAVED_ATTRIBS);
diff --git a/chromium/gpu/command_buffer/service/gles2_cmd_decoder_unittest_attribs.cc b/chromium/gpu/command_buffer/service/gles2_cmd_decoder_unittest_attribs.cc
index 2c9b7702ed0..ca361999f7b 100644
--- a/chromium/gpu/command_buffer/service/gles2_cmd_decoder_unittest_attribs.cc
+++ b/chromium/gpu/command_buffer/service/gles2_cmd_decoder_unittest_attribs.cc
@@ -2,18 +2,16 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-#include "gpu/command_buffer/service/gles2_cmd_decoder.h"
-
#include <stddef.h>
#include "base/command_line.h"
-#include "base/cxx17_backports.h"
#include "base/strings/string_number_conversions.h"
#include "gpu/command_buffer/common/gles2_cmd_format.h"
#include "gpu/command_buffer/common/gles2_cmd_utils.h"
#include "gpu/command_buffer/service/context_group.h"
#include "gpu/command_buffer/service/context_state.h"
#include "gpu/command_buffer/service/gl_surface_mock.h"
+#include "gpu/command_buffer/service/gles2_cmd_decoder.h"
#include "gpu/command_buffer/service/gles2_cmd_decoder_unittest.h"
#include "gpu/command_buffer/service/gpu_switches.h"
#include "gpu/command_buffer/service/image_manager.h"
@@ -205,15 +203,15 @@ TEST_P(GLES2DecoderWithShaderTest, VertexAttribPointer) {
static const GLsizei stride_offset[] = {
0, 0, 1, 0, 1, 0, 0,
};
- for (size_t tt = 0; tt < base::size(types); ++tt) {
+ for (size_t tt = 0; tt < std::size(types); ++tt) {
GLenum type = types[tt];
GLsizei num_bytes = sizes[tt];
- for (size_t ii = 0; ii < base::size(indices); ++ii) {
+ for (size_t ii = 0; ii < std::size(indices); ++ii) {
GLuint index = indices[ii];
for (GLint size = 0; size < 5; ++size) {
- for (size_t oo = 0; oo < base::size(offset_mult); ++oo) {
+ for (size_t oo = 0; oo < std::size(offset_mult); ++oo) {
GLuint offset = num_bytes * offset_mult[oo] + offset_offset[oo];
- for (size_t ss = 0; ss < base::size(stride_mult); ++ss) {
+ for (size_t ss = 0; ss < std::size(stride_mult); ++ss) {
GLsizei stride = num_bytes * stride_mult[ss] + stride_offset[ss];
for (int normalize = 0; normalize < 2; ++normalize) {
bool index_good = index < static_cast<GLuint>(kNumVertexAttribs);
diff --git a/chromium/gpu/command_buffer/service/gles2_cmd_decoder_unittest_base.cc b/chromium/gpu/command_buffer/service/gles2_cmd_decoder_unittest_base.cc
index 4f5e10072e4..8aa9a7703ce 100644
--- a/chromium/gpu/command_buffer/service/gles2_cmd_decoder_unittest_base.cc
+++ b/chromium/gpu/command_buffer/service/gles2_cmd_decoder_unittest_base.cc
@@ -13,7 +13,6 @@
#include <vector>
#include "base/command_line.h"
-#include "base/cxx17_backports.h"
#include "base/strings/string_number_conversions.h"
#include "base/strings/string_split.h"
#include "build/build_config.h"
@@ -61,7 +60,7 @@ void NormalizeInitState(gpu::gles2::GLES2DecoderTestBase::InitState* init) {
"GL_APPLE_vertex_array_object"
};
bool contains_vao_extension = false;
- for (size_t ii = 0; ii < base::size(kVAOExtensions); ++ii) {
+ for (size_t ii = 0; ii < std::size(kVAOExtensions); ++ii) {
if (init->extensions.find(kVAOExtensions[ii]) != std::string::npos) {
contains_vao_extension = true;
break;
@@ -291,9 +290,9 @@ ContextResult GLES2DecoderTestBase::MaybeInitDecoderWithWorkarounds(
static GLuint fixed_attrib_buffer_id[] = {
kServiceFixedAttribBufferId,
};
- EXPECT_CALL(*gl_, GenBuffersARB(base::size(attrib_0_id), _))
+ EXPECT_CALL(*gl_, GenBuffersARB(std::size(attrib_0_id), _))
.WillOnce(SetArrayArgument<1>(attrib_0_id,
- attrib_0_id + base::size(attrib_0_id)))
+ attrib_0_id + std::size(attrib_0_id)))
.RetiresOnSaturation();
EXPECT_CALL(*gl_, BindBuffer(GL_ARRAY_BUFFER, kServiceAttrib0BufferId))
.Times(1)
@@ -304,10 +303,10 @@ ContextResult GLES2DecoderTestBase::MaybeInitDecoderWithWorkarounds(
EXPECT_CALL(*gl_, BindBuffer(GL_ARRAY_BUFFER, 0))
.Times(1)
.RetiresOnSaturation();
- EXPECT_CALL(*gl_, GenBuffersARB(base::size(fixed_attrib_buffer_id), _))
+ EXPECT_CALL(*gl_, GenBuffersARB(std::size(fixed_attrib_buffer_id), _))
.WillOnce(SetArrayArgument<1>(
fixed_attrib_buffer_id,
- fixed_attrib_buffer_id + base::size(fixed_attrib_buffer_id)))
+ fixed_attrib_buffer_id + std::size(fixed_attrib_buffer_id)))
.RetiresOnSaturation();
for (GLint tt = 0; tt < TestHelper::kNumTextureUnits; ++tt) {
@@ -421,13 +420,13 @@ ContextResult GLES2DecoderTestBase::MaybeInitDecoderWithWorkarounds(
};
EXPECT_CALL(*gl_, GetIntegerv(GL_MAX_VIEWPORT_DIMS, _))
.WillOnce(SetArrayArgument<1>(
- max_viewport_dims, max_viewport_dims + base::size(max_viewport_dims)))
+ max_viewport_dims, max_viewport_dims + std::size(max_viewport_dims)))
.RetiresOnSaturation();
static GLfloat line_width_range[] = { 1.0f, 2.0f };
EXPECT_CALL(*gl_, GetFloatv(GL_ALIASED_LINE_WIDTH_RANGE, _))
.WillOnce(SetArrayArgument<1>(
- line_width_range, line_width_range + base::size(line_width_range)))
+ line_width_range, line_width_range + std::size(line_width_range)))
.RetiresOnSaturation();
if (group_->feature_info()->feature_flags().ext_window_rectangles) {
@@ -1056,7 +1055,7 @@ void GLES2DecoderTestBase::SetupShaderForUniform(GLenum uniform_type) {
const GLuint kTestServiceVertexShaderId = 6001;
const GLuint kTestClientFragmentShaderId = 5002;
const GLuint kTestServiceFragmentShaderId = 6002;
- SetupShader(attribs, base::size(attribs), uniforms, base::size(uniforms),
+ SetupShader(attribs, std::size(attribs), uniforms, std::size(uniforms),
client_program_id_, kServiceProgramId, kTestClientVertexShaderId,
kTestServiceVertexShaderId, kTestClientFragmentShaderId,
kTestServiceFragmentShaderId);
@@ -1972,7 +1971,7 @@ void GLES2DecoderTestBase::SetupDefaultProgram() {
kUniform8FakeLocation, kUniform8RealLocation,
kUniform8DesiredLocation },
};
- SetupShader(attribs, base::size(attribs), uniforms, base::size(uniforms),
+ SetupShader(attribs, std::size(attribs), uniforms, std::size(uniforms),
client_program_id_, kServiceProgramId, client_vertex_shader_id_,
kServiceVertexShaderId, client_fragment_shader_id_,
kServiceFragmentShaderId);
@@ -2018,7 +2017,7 @@ void GLES2DecoderTestBase::SetupCubemapProgram() {
kUniform7FakeLocation, kUniform7RealLocation,
kUniform7DesiredLocation },
};
- SetupShader(attribs, base::size(attribs), uniforms, base::size(uniforms),
+ SetupShader(attribs, std::size(attribs), uniforms, std::size(uniforms),
client_program_id_, kServiceProgramId, client_vertex_shader_id_,
kServiceVertexShaderId, client_fragment_shader_id_,
kServiceFragmentShaderId);
@@ -2064,7 +2063,7 @@ void GLES2DecoderTestBase::SetupSamplerExternalProgram() {
kUniform7FakeLocation, kUniform7RealLocation,
kUniform7DesiredLocation },
};
- SetupShader(attribs, base::size(attribs), uniforms, base::size(uniforms),
+ SetupShader(attribs, std::size(attribs), uniforms, std::size(uniforms),
client_program_id_, kServiceProgramId, client_vertex_shader_id_,
kServiceVertexShaderId, client_fragment_shader_id_,
kServiceFragmentShaderId);
@@ -2285,7 +2284,7 @@ void GLES2DecoderTestBase::SetupIndexBuffer() {
client_element_buffer_id_,
kServiceElementBufferId);
static const GLshort indices[] = {100, 1, 2, 3, 4, 5, 6, 7, 100, 9};
- static_assert(base::size(indices) == kNumIndices,
+ static_assert(std::size(indices) == kNumIndices,
"indices should have kNumIndices elements");
DoBufferData(GL_ELEMENT_ARRAY_BUFFER, sizeof(indices));
DoBufferSubData(GL_ELEMENT_ARRAY_BUFFER, 0, 2, indices);
@@ -2445,7 +2444,11 @@ void GLES2DecoderPassthroughTestBase::SetUp() {
gl::init::InitializeStaticGLBindingsImplementation(
gl::GLImplementationParts(gl::kGLImplementationEGLANGLE), false);
- gl::init::InitializeGLOneOffPlatformImplementation(false, false, true);
+ gl::init::InitializeGLOneOffPlatformImplementation(
+ /*fallback_to_software_gl=*/false,
+ /*disable_gl_drawing=*/false,
+ /*init_extensions=*/true,
+ /*system_device_id=*/0);
scoped_refptr<gles2::FeatureInfo> feature_info = new gles2::FeatureInfo();
group_ = new gles2::ContextGroup(
diff --git a/chromium/gpu/command_buffer/service/gles2_cmd_decoder_unittest_framebuffers.cc b/chromium/gpu/command_buffer/service/gles2_cmd_decoder_unittest_framebuffers.cc
index b2c6a075691..9a26a8999a2 100644
--- a/chromium/gpu/command_buffer/service/gles2_cmd_decoder_unittest_framebuffers.cc
+++ b/chromium/gpu/command_buffer/service/gles2_cmd_decoder_unittest_framebuffers.cc
@@ -1140,7 +1140,7 @@ TEST_P(GLES2DecoderTest, ReadPixelsOutOfRange) {
}, // completely off right
};
- for (size_t tt = 0; tt < base::size(tests); ++tt) {
+ for (size_t tt = 0; tt < std::size(tests); ++tt) {
CheckReadPixelsOutOfRange(
tests[tt][0], tests[tt][1], tests[tt][2], tests[tt][3], tt == 0);
}
@@ -3246,7 +3246,7 @@ TEST_P(GLES2DecoderTest, DrawBuffersEXTMainFramebuffer) {
auto& cmd = *GetImmediateAs<cmds::DrawBuffersEXTImmediate>();
{
const GLenum bufs[] = {GL_BACK};
- const GLsizei count = base::size(bufs);
+ const GLsizei count = std::size(bufs);
cmd.Init(count, bufs);
EXPECT_CALL(*gl_, DrawBuffersARB(count, Pointee(GL_BACK)))
@@ -3267,7 +3267,7 @@ TEST_P(GLES2DecoderTest, DrawBuffersEXTMainFramebuffer) {
}
{
const GLenum bufs[] = {GL_BACK, GL_NONE};
- const GLsizei count = base::size(bufs);
+ const GLsizei count = std::size(bufs);
cmd.Init(count, bufs);
EXPECT_CALL(*gl_, DrawBuffersARB(_, _)).Times(0).RetiresOnSaturation();
diff --git a/chromium/gpu/command_buffer/service/gles2_cmd_decoder_unittest_programs.cc b/chromium/gpu/command_buffer/service/gles2_cmd_decoder_unittest_programs.cc
index f0e63754668..1ef7c47dd85 100644
--- a/chromium/gpu/command_buffer/service/gles2_cmd_decoder_unittest_programs.cc
+++ b/chromium/gpu/command_buffer/service/gles2_cmd_decoder_unittest_programs.cc
@@ -2,19 +2,17 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-#include "gpu/command_buffer/service/gles2_cmd_decoder.h"
-
#include <stddef.h>
#include <stdint.h>
#include "base/command_line.h"
-#include "base/cxx17_backports.h"
#include "base/strings/string_number_conversions.h"
#include "gpu/command_buffer/common/gles2_cmd_format.h"
#include "gpu/command_buffer/common/gles2_cmd_utils.h"
#include "gpu/command_buffer/service/context_group.h"
#include "gpu/command_buffer/service/context_state.h"
#include "gpu/command_buffer/service/gl_surface_mock.h"
+#include "gpu/command_buffer/service/gles2_cmd_decoder.h"
#include "gpu/command_buffer/service/gles2_cmd_decoder_unittest.h"
#include "gpu/command_buffer/service/image_manager.h"
#include "gpu/command_buffer/service/mailbox_manager.h"
@@ -828,7 +826,7 @@ TEST_P(GLES3DecoderWithShaderTest, GetActiveUniformBlockivSucceeds) {
GL_UNIFORM_BLOCK_REFERENCED_BY_VERTEX_SHADER,
GL_UNIFORM_BLOCK_REFERENCED_BY_FRAGMENT_SHADER,
};
- for (size_t ii = 0; ii < base::size(kPname); ++ii) {
+ for (size_t ii = 0; ii < std::size(kPname); ++ii) {
result->SetNumResults(0);
cmd.Init(client_program_id_,
0,
@@ -1069,7 +1067,7 @@ TEST_P(GLES3DecoderWithShaderTest, GetUniformIndicesSucceeds) {
const char kName0[] = "Cow";
const char kName1[] = "Chicken";
const char* kNames[] = { kName0, kName1 };
- const size_t kCount = base::size(kNames);
+ const size_t kCount = std::size(kNames);
const char kValidStrEnd = 0;
const GLuint kIndices[] = { 1, 2 };
SetBucketAsCStrings(kBucketId, kCount, kNames, kCount, kValidStrEnd);
@@ -1102,7 +1100,7 @@ TEST_P(GLES3DecoderWithShaderTest, GetUniformIndicesBadProgramFails) {
const char kName0[] = "Cow";
const char kName1[] = "Chicken";
const char* kNames[] = { kName0, kName1 };
- const size_t kCount = base::size(kNames);
+ const size_t kCount = std::size(kNames);
const char kValidStrEnd = 0;
SetBucketAsCStrings(kBucketId, kCount, kNames, kCount, kValidStrEnd);
auto* result =
@@ -1131,7 +1129,7 @@ TEST_P(GLES3DecoderWithShaderTest, GetUniformIndicesBadParamsFails) {
const char kName0[] = "Cow";
const char kName1[] = "Chicken";
const char* kNames[] = { kName0, kName1 };
- const size_t kCount = base::size(kNames);
+ const size_t kCount = std::size(kNames);
const char kValidStrEnd = 0;
const GLuint kIndices[] = { 1, 2 };
SetBucketAsCStrings(kBucketId, kCount, kNames, kCount, kValidStrEnd);
@@ -1161,7 +1159,7 @@ TEST_P(GLES3DecoderWithShaderTest, GetUniformIndicesResultNotInitFails) {
const char kName0[] = "Cow";
const char kName1[] = "Chicken";
const char* kNames[] = { kName0, kName1 };
- const size_t kCount = base::size(kNames);
+ const size_t kCount = std::size(kNames);
const char kValidStrEnd = 0;
SetBucketAsCStrings(kBucketId, kCount, kNames, kCount, kValidStrEnd);
auto* result =
@@ -1177,7 +1175,7 @@ TEST_P(GLES3DecoderWithShaderTest, GetUniformIndicesBadSharedMemoryFails) {
const char kName0[] = "Cow";
const char kName1[] = "Chicken";
const char* kNames[] = { kName0, kName1 };
- const size_t kCount = base::size(kNames);
+ const size_t kCount = std::size(kNames);
const char kValidStrEnd = 0;
SetBucketAsCStrings(kBucketId, kCount, kNames, kCount, kValidStrEnd);
auto* result =
@@ -1199,7 +1197,7 @@ TEST_P(GLES3DecoderWithShaderTest, GetActiveUniformsivSucceeds) {
const uint32_t kBucketId = 123;
const GLuint kIndices[] = { 1, 2 };
const GLint kResults[] = { 1976, 321 };
- const size_t kCount = base::size(kIndices);
+ const size_t kCount = std::size(kIndices);
SetBucketData(kBucketId, kIndices, sizeof(GLuint) * kCount);
auto* result =
static_cast<cmds::GetActiveUniformsiv::Result*>(shared_memory_address_);
@@ -1226,7 +1224,7 @@ TEST_P(GLES3DecoderWithShaderTest, GetActiveUniformsivSucceeds) {
TEST_P(GLES3DecoderWithShaderTest, GetActiveUniformsivBadProgramFails) {
const uint32_t kBucketId = 123;
const GLuint kIndices[] = { 1, 2 };
- const size_t kCount = base::size(kIndices);
+ const size_t kCount = std::size(kIndices);
SetBucketData(kBucketId, kIndices, sizeof(GLuint) * kCount);
auto* result =
static_cast<cmds::GetActiveUniformsiv::Result*>(shared_memory_address_);
@@ -1253,7 +1251,7 @@ TEST_P(GLES3DecoderWithShaderTest, GetActiveUniformsivBadProgramFails) {
TEST_P(GLES3DecoderWithShaderTest, GetActiveUniformsivBadParamsFails) {
const uint32_t kBucketId = 123;
const GLuint kIndices[] = { 1, 100 };
- const size_t kCount = base::size(kIndices);
+ const size_t kCount = std::size(kIndices);
SetBucketData(kBucketId, kIndices, sizeof(GLuint) * kCount);
auto* result =
static_cast<cmds::GetActiveUniformsiv::Result*>(shared_memory_address_);
@@ -1269,7 +1267,7 @@ TEST_P(GLES3DecoderWithShaderTest, GetActiveUniformsivBadParamsFails) {
TEST_P(GLES3DecoderWithShaderTest, GetActiveUniformsivBadPnameFails) {
const uint32_t kBucketId = 123;
const GLuint kIndices[] = { 1, 2 };
- const size_t kCount = base::size(kIndices);
+ const size_t kCount = std::size(kIndices);
SetBucketData(kBucketId, kIndices, sizeof(GLuint) * kCount);
auto* result =
static_cast<cmds::GetActiveUniformsiv::Result*>(shared_memory_address_);
@@ -1293,7 +1291,7 @@ TEST_P(GLES3DecoderWithShaderTest, GetActiveUniformsivBadPnameFails) {
TEST_P(GLES3DecoderWithShaderTest, GetActiveUniformsivResultNotInitFails) {
const uint32_t kBucketId = 123;
const GLuint kIndices[] = { 1, 2 };
- const size_t kCount = base::size(kIndices);
+ const size_t kCount = std::size(kIndices);
SetBucketData(kBucketId, kIndices, sizeof(GLuint) * kCount);
auto* result =
static_cast<cmds::GetActiveUniformsiv::Result*>(shared_memory_address_);
@@ -1307,7 +1305,7 @@ TEST_P(GLES3DecoderWithShaderTest, GetActiveUniformsivResultNotInitFails) {
TEST_P(GLES3DecoderWithShaderTest, GetActiveUniformsivBadSharedMemoryFails) {
const uint32_t kBucketId = 123;
const GLuint kIndices[] = { 1, 2 };
- const size_t kCount = base::size(kIndices);
+ const size_t kCount = std::size(kIndices);
SetBucketData(kBucketId, kIndices, sizeof(GLuint) * kCount);
auto* result =
static_cast<cmds::GetActiveUniformsiv::Result*>(shared_memory_address_);
@@ -2074,12 +2072,12 @@ TEST_P(GLES2DecoderManualInitTest, ClearUniformsBeforeFirstProgramUse) {
{kUniform3Name, kUniform3Size, kUniform3Type, kUniform3FakeLocation,
kUniform3RealLocation, kUniform3DesiredLocation},
};
- SetupShader(attribs, base::size(attribs), uniforms, base::size(uniforms),
+ SetupShader(attribs, std::size(attribs), uniforms, std::size(uniforms),
client_program_id_, kServiceProgramId, client_vertex_shader_id_,
kServiceVertexShaderId, client_fragment_shader_id_,
kServiceFragmentShaderId);
TestHelper::SetupExpectationsForClearingUniforms(gl_.get(), uniforms,
- base::size(uniforms));
+ std::size(uniforms));
}
{
diff --git a/chromium/gpu/command_buffer/service/gles2_cmd_decoder_unittest_textures.cc b/chromium/gpu/command_buffer/service/gles2_cmd_decoder_unittest_textures.cc
index cd70a37a47a..564478c38e1 100644
--- a/chromium/gpu/command_buffer/service/gles2_cmd_decoder_unittest_textures.cc
+++ b/chromium/gpu/command_buffer/service/gles2_cmd_decoder_unittest_textures.cc
@@ -2,13 +2,10 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-#include "gpu/command_buffer/service/gles2_cmd_decoder.h"
-
#include <stddef.h>
#include <stdint.h>
#include "base/command_line.h"
-#include "base/cxx17_backports.h"
#include "base/strings/string_number_conversions.h"
#include "components/viz/common/resources/resource_format_utils.h"
#include "gpu/command_buffer/common/gles2_cmd_format.h"
@@ -17,6 +14,7 @@
#include "gpu/command_buffer/service/context_group.h"
#include "gpu/command_buffer/service/context_state.h"
#include "gpu/command_buffer/service/gl_surface_mock.h"
+#include "gpu/command_buffer/service/gles2_cmd_decoder.h"
#include "gpu/command_buffer/service/gles2_cmd_decoder_unittest.h"
#include "gpu/command_buffer/service/image_manager.h"
#include "gpu/command_buffer/service/mailbox_manager.h"
@@ -668,7 +666,7 @@ TEST_P(GLES2DecoderManualInitTest, CopyTexImage2DUnsizedInternalFormat) {
EXPECT_CALL(*gl_, GetError()).WillRepeatedly(Return(GL_NO_ERROR));
EXPECT_CALL(*gl_, CheckFramebufferStatusEXT(_))
.WillRepeatedly(Return(GL_FRAMEBUFFER_COMPLETE));
- for (size_t i = 0; i < base::size(kUnsizedInternalFormats); ++i) {
+ for (size_t i = 0; i < std::size(kUnsizedInternalFormats); ++i) {
// Copy from main framebuffer to texture, using the unsized internal format.
DoBindFramebuffer(GL_FRAMEBUFFER, 0, 0);
GLenum internal_format = kUnsizedInternalFormats[i];
@@ -749,7 +747,7 @@ TEST_P(GLES2DecoderManualInitTest, CopyTexImage2DUnsizedInternalFormatES3) {
EXPECT_CALL(*gl_, GetError()).WillRepeatedly(Return(GL_NO_ERROR));
EXPECT_CALL(*gl_, CheckFramebufferStatusEXT(_))
.WillRepeatedly(Return(GL_FRAMEBUFFER_COMPLETE));
- for (size_t i = 0; i < base::size(kUnsizedInternalFormats); ++i) {
+ for (size_t i = 0; i < std::size(kUnsizedInternalFormats); ++i) {
// Copy from main framebuffer to texture, using the unsized internal format.
DoBindFramebuffer(GL_FRAMEBUFFER, 0, 0);
GLenum internal_format = kUnsizedInternalFormats[i].unsized;
@@ -1691,7 +1689,7 @@ TEST_P(GLES2DecoderManualInitTest, CompressedTexImage2DS3TCWebGL) {
},
};
- for (size_t ii = 0; ii < base::size(test_data); ++ii) {
+ for (size_t ii = 0; ii < std::size(test_data); ++ii) {
const S3TCTestData& test = test_data[ii];
cmds::CompressedTexImage2DBucket cmd;
// test small width.
@@ -1848,7 +1846,7 @@ TEST_P(GLES2DecoderManualInitTest, CompressedTexImage2DS3TC) {
},
};
- for (size_t ii = 0; ii < base::size(test_data); ++ii) {
+ for (size_t ii = 0; ii < std::size(test_data); ++ii) {
const S3TCTestData& test = test_data[ii];
cmds::CompressedTexImage2DBucket cmd;
// test small width.
diff --git a/chromium/gpu/command_buffer/service/gles2_cmd_validation_implementation_autogen.h b/chromium/gpu/command_buffer/service/gles2_cmd_validation_implementation_autogen.h
index 2c648473058..22af6b867ab 100644
--- a/chromium/gpu/command_buffer/service/gles2_cmd_validation_implementation_autogen.h
+++ b/chromium/gpu/command_buffer/service/gles2_cmd_validation_implementation_autogen.h
@@ -1303,168 +1303,167 @@ bool Validators::WindowRectanglesModeValidator::IsValid(
}
Validators::Validators()
- : attachment(valid_attachment_table, base::size(valid_attachment_table)),
+ : attachment(valid_attachment_table, std::size(valid_attachment_table)),
attachment_query(valid_attachment_query_table,
- base::size(valid_attachment_query_table)),
- bufferfi(valid_bufferfi_table, base::size(valid_bufferfi_table)),
- bufferuiv(valid_bufferuiv_table, base::size(valid_bufferuiv_table)),
- capability(valid_capability_table, base::size(valid_capability_table)),
+ std::size(valid_attachment_query_table)),
+ bufferfi(valid_bufferfi_table, std::size(valid_bufferfi_table)),
+ bufferuiv(valid_bufferuiv_table, std::size(valid_bufferuiv_table)),
+ capability(valid_capability_table, std::size(valid_capability_table)),
compressed_texture_format(),
coverage_modulation_components(
valid_coverage_modulation_components_table,
- base::size(valid_coverage_modulation_components_table)),
+ std::size(valid_coverage_modulation_components_table)),
dst_blend_factor(valid_dst_blend_factor_table,
- base::size(valid_dst_blend_factor_table)),
- equation(valid_equation_table, base::size(valid_equation_table)),
+ std::size(valid_dst_blend_factor_table)),
+ equation(valid_equation_table, std::size(valid_equation_table)),
framebuffer_attachment_parameter(
valid_framebuffer_attachment_parameter_table,
- base::size(valid_framebuffer_attachment_parameter_table)),
+ std::size(valid_framebuffer_attachment_parameter_table)),
framebuffer_parameter(),
framebuffer_target(valid_framebuffer_target_table,
- base::size(valid_framebuffer_target_table)),
- g_l_state(valid_g_l_state_table, base::size(valid_g_l_state_table)),
+ std::size(valid_framebuffer_target_table)),
+ g_l_state(valid_g_l_state_table, std::size(valid_g_l_state_table)),
get_tex_param_target(valid_get_tex_param_target_table,
- base::size(valid_get_tex_param_target_table)),
- hint_target(valid_hint_target_table, base::size(valid_hint_target_table)),
+ std::size(valid_get_tex_param_target_table)),
+ hint_target(valid_hint_target_table, std::size(valid_hint_target_table)),
image_internal_format(valid_image_internal_format_table,
- base::size(valid_image_internal_format_table)),
- index_type(valid_index_type_table, base::size(valid_index_type_table)),
+ std::size(valid_image_internal_format_table)),
+ index_type(valid_index_type_table, std::size(valid_index_type_table)),
indexed_g_l_state(valid_indexed_g_l_state_table,
- base::size(valid_indexed_g_l_state_table)),
- pixel_store(valid_pixel_store_table, base::size(valid_pixel_store_table)),
- pixel_type(valid_pixel_type_table, base::size(valid_pixel_type_table)),
+ std::size(valid_indexed_g_l_state_table)),
+ pixel_store(valid_pixel_store_table, std::size(valid_pixel_store_table)),
+ pixel_type(valid_pixel_type_table, std::size(valid_pixel_type_table)),
program_parameter(valid_program_parameter_table,
- base::size(valid_program_parameter_table)),
- read_buffer(valid_read_buffer_table, base::size(valid_read_buffer_table)),
+ std::size(valid_program_parameter_table)),
+ read_buffer(valid_read_buffer_table, std::size(valid_read_buffer_table)),
read_pixel_format(valid_read_pixel_format_table,
- base::size(valid_read_pixel_format_table)),
+ std::size(valid_read_pixel_format_table)),
read_pixel_type(valid_read_pixel_type_table,
- base::size(valid_read_pixel_type_table)),
+ std::size(valid_read_pixel_type_table)),
render_buffer_format(valid_render_buffer_format_table,
- base::size(valid_render_buffer_format_table)),
+ std::size(valid_render_buffer_format_table)),
render_buffer_parameter(valid_render_buffer_parameter_table,
- base::size(valid_render_buffer_parameter_table)),
+ std::size(valid_render_buffer_parameter_table)),
render_buffer_target(valid_render_buffer_target_table,
- base::size(valid_render_buffer_target_table)),
+ std::size(valid_render_buffer_target_table)),
sampler_parameter(valid_sampler_parameter_table,
- base::size(valid_sampler_parameter_table)),
+ std::size(valid_sampler_parameter_table)),
shader_binary_format(),
shader_parameter(valid_shader_parameter_table,
- base::size(valid_shader_parameter_table)),
+ std::size(valid_shader_parameter_table)),
src_blend_factor(valid_src_blend_factor_table,
- base::size(valid_src_blend_factor_table)),
+ std::size(valid_src_blend_factor_table)),
sync_flush_flags(valid_sync_flush_flags_table,
- base::size(valid_sync_flush_flags_table)),
+ std::size(valid_sync_flush_flags_table)),
texture_bind_target(valid_texture_bind_target_table,
- base::size(valid_texture_bind_target_table)),
+ std::size(valid_texture_bind_target_table)),
texture_compare_mode(valid_texture_compare_mode_table,
- base::size(valid_texture_compare_mode_table)),
+ std::size(valid_texture_compare_mode_table)),
texture_depth_renderable_internal_format(),
texture_fbo_target(valid_texture_fbo_target_table,
- base::size(valid_texture_fbo_target_table)),
+ std::size(valid_texture_fbo_target_table)),
texture_format(valid_texture_format_table,
- base::size(valid_texture_format_table)),
+ std::size(valid_texture_format_table)),
texture_internal_format(valid_texture_internal_format_table,
- base::size(valid_texture_internal_format_table)),
+ std::size(valid_texture_internal_format_table)),
texture_internal_format_storage(
valid_texture_internal_format_storage_table,
- base::size(valid_texture_internal_format_storage_table)),
+ std::size(valid_texture_internal_format_storage_table)),
texture_parameter(valid_texture_parameter_table,
- base::size(valid_texture_parameter_table)),
+ std::size(valid_texture_parameter_table)),
texture_sized_color_renderable_internal_format(
valid_texture_sized_color_renderable_internal_format_table,
- base::size(
+ std::size(
valid_texture_sized_color_renderable_internal_format_table)),
texture_sized_texture_filterable_internal_format(
valid_texture_sized_texture_filterable_internal_format_table,
- base::size(
+ std::size(
valid_texture_sized_texture_filterable_internal_format_table)),
texture_stencil_renderable_internal_format(),
texture_target(valid_texture_target_table,
- base::size(valid_texture_target_table)),
+ std::size(valid_texture_target_table)),
texture_unsized_internal_format(
valid_texture_unsized_internal_format_table,
- base::size(valid_texture_unsized_internal_format_table)),
+ std::size(valid_texture_unsized_internal_format_table)),
transform_feedback_bind_target(
valid_transform_feedback_bind_target_table,
- base::size(valid_transform_feedback_bind_target_table)),
+ std::size(valid_transform_feedback_bind_target_table)),
vertex_attrib_type(valid_vertex_attrib_type_table,
- base::size(valid_vertex_attrib_type_table)),
+ std::size(valid_vertex_attrib_type_table)),
vertex_attribute(valid_vertex_attribute_table,
- base::size(valid_vertex_attribute_table)),
+ std::size(valid_vertex_attribute_table)),
vertex_pointer(valid_vertex_pointer_table,
- base::size(valid_vertex_pointer_table)) {}
+ std::size(valid_vertex_pointer_table)) {}
void Validators::UpdateValuesES3() {
attachment.AddValues(valid_attachment_table_es3,
- base::size(valid_attachment_table_es3));
+ std::size(valid_attachment_table_es3));
attachment_query.AddValues(valid_attachment_query_table_es3,
- base::size(valid_attachment_query_table_es3));
+ std::size(valid_attachment_query_table_es3));
buffer_parameter.SetIsES3(true);
buffer_target.SetIsES3(true);
buffer_usage.SetIsES3(true);
capability.AddValues(valid_capability_table_es3,
- base::size(valid_capability_table_es3));
+ std::size(valid_capability_table_es3));
dst_blend_factor.AddValues(valid_dst_blend_factor_table_es3,
- base::size(valid_dst_blend_factor_table_es3));
+ std::size(valid_dst_blend_factor_table_es3));
equation.AddValues(valid_equation_table_es3,
- base::size(valid_equation_table_es3));
+ std::size(valid_equation_table_es3));
framebuffer_attachment_parameter.AddValues(
valid_framebuffer_attachment_parameter_table_es3,
- base::size(valid_framebuffer_attachment_parameter_table_es3));
+ std::size(valid_framebuffer_attachment_parameter_table_es3));
framebuffer_target.AddValues(valid_framebuffer_target_table_es3,
- base::size(valid_framebuffer_target_table_es3));
+ std::size(valid_framebuffer_target_table_es3));
g_l_state.AddValues(valid_g_l_state_table_es3,
- base::size(valid_g_l_state_table_es3));
+ std::size(valid_g_l_state_table_es3));
get_tex_param_target.AddValues(
valid_get_tex_param_target_table_es3,
- base::size(valid_get_tex_param_target_table_es3));
+ std::size(valid_get_tex_param_target_table_es3));
hint_target.AddValues(valid_hint_target_table_es3,
- base::size(valid_hint_target_table_es3));
+ std::size(valid_hint_target_table_es3));
index_type.AddValues(valid_index_type_table_es3,
- base::size(valid_index_type_table_es3));
+ std::size(valid_index_type_table_es3));
pixel_store.AddValues(valid_pixel_store_table_es3,
- base::size(valid_pixel_store_table_es3));
+ std::size(valid_pixel_store_table_es3));
pixel_type.AddValues(valid_pixel_type_table_es3,
- base::size(valid_pixel_type_table_es3));
+ std::size(valid_pixel_type_table_es3));
program_parameter.AddValues(valid_program_parameter_table_es3,
- base::size(valid_program_parameter_table_es3));
+ std::size(valid_program_parameter_table_es3));
read_pixel_format.AddValues(valid_read_pixel_format_table_es3,
- base::size(valid_read_pixel_format_table_es3));
+ std::size(valid_read_pixel_format_table_es3));
read_pixel_type.AddValues(valid_read_pixel_type_table_es3,
- base::size(valid_read_pixel_type_table_es3));
+ std::size(valid_read_pixel_type_table_es3));
render_buffer_format.AddValues(
valid_render_buffer_format_table_es3,
- base::size(valid_render_buffer_format_table_es3));
+ std::size(valid_render_buffer_format_table_es3));
render_buffer_parameter.AddValues(
valid_render_buffer_parameter_table_es3,
- base::size(valid_render_buffer_parameter_table_es3));
- texture_bind_target.AddValues(
- valid_texture_bind_target_table_es3,
- base::size(valid_texture_bind_target_table_es3));
+ std::size(valid_render_buffer_parameter_table_es3));
+ texture_bind_target.AddValues(valid_texture_bind_target_table_es3,
+ std::size(valid_texture_bind_target_table_es3));
texture_depth_renderable_internal_format.AddValues(
valid_texture_depth_renderable_internal_format_table_es3,
- base::size(valid_texture_depth_renderable_internal_format_table_es3));
+ std::size(valid_texture_depth_renderable_internal_format_table_es3));
texture_format.AddValues(valid_texture_format_table_es3,
- base::size(valid_texture_format_table_es3));
+ std::size(valid_texture_format_table_es3));
texture_internal_format.AddValues(
valid_texture_internal_format_table_es3,
- base::size(valid_texture_internal_format_table_es3));
+ std::size(valid_texture_internal_format_table_es3));
texture_internal_format_storage.RemoveValues(
deprecated_texture_internal_format_storage_table_es3,
- base::size(deprecated_texture_internal_format_storage_table_es3));
+ std::size(deprecated_texture_internal_format_storage_table_es3));
texture_internal_format_storage.AddValues(
valid_texture_internal_format_storage_table_es3,
- base::size(valid_texture_internal_format_storage_table_es3));
+ std::size(valid_texture_internal_format_storage_table_es3));
texture_parameter.AddValues(valid_texture_parameter_table_es3,
- base::size(valid_texture_parameter_table_es3));
+ std::size(valid_texture_parameter_table_es3));
texture_stencil_renderable_internal_format.AddValues(
valid_texture_stencil_renderable_internal_format_table_es3,
- base::size(valid_texture_stencil_renderable_internal_format_table_es3));
+ std::size(valid_texture_stencil_renderable_internal_format_table_es3));
vertex_attrib_type.AddValues(valid_vertex_attrib_type_table_es3,
- base::size(valid_vertex_attrib_type_table_es3));
+ std::size(valid_vertex_attrib_type_table_es3));
vertex_attribute.AddValues(valid_vertex_attribute_table_es3,
- base::size(valid_vertex_attribute_table_es3));
+ std::size(valid_vertex_attribute_table_es3));
}
void Validators::UpdateETCCompressedTextureFormats() {
diff --git a/chromium/gpu/command_buffer/service/gpu_tracer.cc b/chromium/gpu/command_buffer/service/gpu_tracer.cc
index 62befc71011..df067f447d0 100644
--- a/chromium/gpu/command_buffer/service/gpu_tracer.cc
+++ b/chromium/gpu/command_buffer/service/gpu_tracer.cc
@@ -8,7 +8,6 @@
#include <stdint.h>
#include "base/bind.h"
-#include "base/cxx17_backports.h"
#include "base/location.h"
#include "base/strings/string_util.h"
#include "base/strings/stringprintf.h"
@@ -32,7 +31,7 @@ constexpr const char* kGpuTraceSourceNames[] = {
"TraceCmd", // kTraceDecoder,
"Disjoint", // kTraceDisjoint, // Used internally.
};
-static_assert(NUM_TRACER_SOURCES == base::size(kGpuTraceSourceNames),
+static_assert(NUM_TRACER_SOURCES == std::size(kGpuTraceSourceNames),
"Trace source names must match enumeration.");
TraceMarker::TraceMarker(const std::string& category, const std::string& name)
diff --git a/chromium/gpu/command_buffer/service/gpu_tracer.h b/chromium/gpu/command_buffer/service/gpu_tracer.h
index 24b1b6d0395..26319426fd0 100644
--- a/chromium/gpu/command_buffer/service/gpu_tracer.h
+++ b/chromium/gpu/command_buffer/service/gpu_tracer.h
@@ -16,6 +16,7 @@
#include "base/containers/stack.h"
#include "base/memory/raw_ptr.h"
#include "base/threading/thread.h"
+#include "base/time/time.h"
#include "gpu/gpu_gles2_export.h"
namespace gl {
diff --git a/chromium/gpu/command_buffer/service/gpu_tracer_unittest.cc b/chromium/gpu/command_buffer/service/gpu_tracer_unittest.cc
index 67e8e654bf3..f3b1c52eb45 100644
--- a/chromium/gpu/command_buffer/service/gpu_tracer_unittest.cc
+++ b/chromium/gpu/command_buffer/service/gpu_tracer_unittest.cc
@@ -7,6 +7,7 @@
#include <memory>
#include "base/bind.h"
+#include "base/time/time.h"
#include "gpu/command_buffer/client/client_test_helper.h"
#include "gpu/command_buffer/service/gles2_cmd_decoder_mock.h"
#include "gpu/command_buffer/service/gpu_service_test.h"
diff --git a/chromium/gpu/command_buffer/service/image_reader_gl_owner.cc b/chromium/gpu/command_buffer/service/image_reader_gl_owner.cc
index ee7047142a1..ababa06c624 100644
--- a/chromium/gpu/command_buffer/service/image_reader_gl_owner.cc
+++ b/chromium/gpu/command_buffer/service/image_reader_gl_owner.cc
@@ -128,10 +128,12 @@ class ImageReaderGLOwner::ScopedHardwareBufferImpl
ImageReaderGLOwner::ImageReaderGLOwner(
std::unique_ptr<gles2::AbstractTexture> texture,
Mode mode,
- scoped_refptr<SharedContextState> context_state)
+ scoped_refptr<SharedContextState> context_state,
+ scoped_refptr<RefCountedLock> drdc_lock)
: TextureOwner(false /* binds_texture_on_image_update */,
std::move(texture),
std::move(context_state)),
+ RefCountedLockHelperDrDc(std::move(drdc_lock)),
loader_(base::android::AndroidImageReader::GetInstance()),
context_(gl::GLContext::GetCurrent()),
surface_(gl::GLSurface::GetCurrent()) {
@@ -399,11 +401,18 @@ void ImageReaderGLOwner::ReleaseRefOnImage(AImage* image,
void ImageReaderGLOwner::ReleaseRefOnImageLocked(AImage* image,
base::ScopedFD fence_fd) {
lock_.AssertAcquired();
+
// During cleanup on losing the texture, all images are synchronously released
// and the |image_reader_| is destroyed.
if (!image_reader_)
return;
+ // Ensure that DrDc lock is held when |buffer_available_cb| can be triggered
+ // because we do not want any other thread to steal the free buffer slot which
+ // is meant to be used by |buffer_available_cb| and hence resulting in wrong
+ // FrameInfo for all future frames.
+ AssertAcquiredDrDcLock();
+
auto it = image_refs_.find(image);
DCHECK(it != image_refs_.end());
@@ -492,14 +501,16 @@ void ImageReaderGLOwner::RunWhenBufferIsAvailable(base::OnceClosure callback) {
// queue to become full. In that case callback will not be able to render
// and acquire updated image and hence will use FrameInfo of the previous
// image which will result in wrong coded size for all future frames. To
- // avoid, this no other threads should try to UpdateTexImage() when this
- // callback is run. lock held by the caller (GetFrameInfo()) of this
- // method ensures that this never happens.
+ // avoid this, no other thread should try to UpdateTexImage() when this
+ // callback is run. Hence drdc_lock should be held from all the places from
+ // where the callback could be run which is either OnGpu::GetFrameInfo() or
+ // ImageReaderGLOwner::ReleaseRefOnImageLocked() and
+ // OnGpu::GetFrameInfoImpl() should assume that the drdc_lock is always
+ // held.
std::move(callback).Run();
} else {
base::AutoLock auto_lock(lock_);
- buffer_available_cb_ = base::BindPostTask(
- base::ThreadTaskRunnerHandle::Get(), std::move(callback));
+ buffer_available_cb_ = std::move(callback);
}
}
diff --git a/chromium/gpu/command_buffer/service/image_reader_gl_owner.h b/chromium/gpu/command_buffer/service/image_reader_gl_owner.h
index 0efcccc27b0..f6cbc4d9cd6 100644
--- a/chromium/gpu/command_buffer/service/image_reader_gl_owner.h
+++ b/chromium/gpu/command_buffer/service/image_reader_gl_owner.h
@@ -10,6 +10,7 @@
#include "base/android/android_image_reader_compat.h"
#include "base/containers/flat_map.h"
#include "base/memory/raw_ptr.h"
+#include "gpu/command_buffer/service/ref_counted_lock.h"
#include "gpu/command_buffer/service/texture_owner.h"
#include "gpu/gpu_gles2_export.h"
#include "ui/gl/gl_fence_egl.h"
@@ -29,7 +30,8 @@ namespace gpu {
// decoded media frames. Media frames can update the attached surface handle
// with image data and this class helps to create an eglImage using that image
// data present in the surface.
-class GPU_GLES2_EXPORT ImageReaderGLOwner : public TextureOwner {
+class GPU_GLES2_EXPORT ImageReaderGLOwner : public TextureOwner,
+ public RefCountedLockHelperDrDc {
public:
ImageReaderGLOwner(const ImageReaderGLOwner&) = delete;
ImageReaderGLOwner& operator=(const ImageReaderGLOwner&) = delete;
@@ -90,7 +92,8 @@ class GPU_GLES2_EXPORT ImageReaderGLOwner : public TextureOwner {
ImageReaderGLOwner(std::unique_ptr<gles2::AbstractTexture> texture,
Mode secure_mode,
- scoped_refptr<SharedContextState> context_state);
+ scoped_refptr<SharedContextState> context_state,
+ scoped_refptr<RefCountedLock> drdc_lock = nullptr);
~ImageReaderGLOwner() override;
// Registers and releases a ref on the image. Once the ref-count for an image
diff --git a/chromium/gpu/command_buffer/service/image_reader_gl_owner_unittest.cc b/chromium/gpu/command_buffer/service/image_reader_gl_owner_unittest.cc
index 6f0be3e442d..1e17975b55e 100644
--- a/chromium/gpu/command_buffer/service/image_reader_gl_owner_unittest.cc
+++ b/chromium/gpu/command_buffer/service/image_reader_gl_owner_unittest.cc
@@ -38,7 +38,11 @@ class ImageReaderGLOwnerTest : public testing::Test {
gl::init::InitializeStaticGLBindingsImplementation(
gl::GLImplementationParts(gl::kGLImplementationEGLGLES2), false);
- gl::init::InitializeGLOneOffPlatformImplementation(false, false, true);
+ gl::init::InitializeGLOneOffPlatformImplementation(
+ /*fallback_to_software_gl=*/false,
+ /*disable_gl_drawing=*/false,
+ /*init_extensions=*/true,
+ /*system_device_id=*/0);
surface_ = new gl::PbufferGLSurfaceEGL(gfx::Size(320, 240));
surface_->Initialize();
diff --git a/chromium/gpu/command_buffer/service/program_manager.cc b/chromium/gpu/command_buffer/service/program_manager.cc
index 1b128f06cd7..39fbae2de15 100644
--- a/chromium/gpu/command_buffer/service/program_manager.cc
+++ b/chromium/gpu/command_buffer/service/program_manager.cc
@@ -15,7 +15,6 @@
#include <vector>
#include "base/command_line.h"
-#include "base/cxx17_backports.h"
#include "base/logging.h"
#include "base/metrics/histogram_macros.h"
#include "base/numerics/safe_math.h"
@@ -97,7 +96,7 @@ bool IsBuiltInFragmentVarying(const std::string& name) {
"gl_FrontFacing",
"gl_PointCoord"
};
- for (size_t ii = 0; ii < base::size(kBuiltInVaryings); ++ii) {
+ for (size_t ii = 0; ii < std::size(kBuiltInVaryings); ++ii) {
if (name == kBuiltInVaryings[ii])
return true;
}
@@ -2385,7 +2384,7 @@ bool Program::GetUniformsES3(CommonDecoder::Bucket* bucket) const {
GL_UNIFORM_IS_ROW_MAJOR,
};
const GLint kDefaultValue[] = { -1, -1, -1, -1, 0 };
- const size_t kNumPnames = base::size(kPname);
+ const size_t kNumPnames = std::size(kPname);
std::vector<GLuint> indices(count);
for (GLsizei ii = 0; ii < count; ++ii) {
indices[ii] = ii;
diff --git a/chromium/gpu/command_buffer/service/program_manager_unittest.cc b/chromium/gpu/command_buffer/service/program_manager_unittest.cc
index cf0768d169c..d7251edbea5 100644
--- a/chromium/gpu/command_buffer/service/program_manager_unittest.cc
+++ b/chromium/gpu/command_buffer/service/program_manager_unittest.cc
@@ -11,7 +11,6 @@
#include <memory>
#include "base/command_line.h"
-#include "base/cxx17_backports.h"
#include "base/memory/raw_ptr.h"
#include "base/strings/string_number_conversions.h"
#include "base/strings/string_util.h"
@@ -526,7 +525,7 @@ const GLint ProgramManagerWithShaderTest::kBadUniformIndex;
#endif
const size_t ProgramManagerWithShaderTest::kNumAttribs =
- base::size(ProgramManagerWithShaderTest::kAttribs);
+ std::size(ProgramManagerWithShaderTest::kAttribs);
ProgramManagerWithShaderTest::UniformInfo
ProgramManagerWithShaderTest::kUniforms[] = {
@@ -557,7 +556,7 @@ ProgramManagerWithShaderTest::UniformInfo
};
const size_t ProgramManagerWithShaderTest::kNumUniforms =
- base::size(ProgramManagerWithShaderTest::kUniforms);
+ std::size(ProgramManagerWithShaderTest::kUniforms);
const char* ProgramManagerWithShaderTest::kAttrib1Name = "attrib1";
const char* ProgramManagerWithShaderTest::kAttrib2Name = "attrib2";
@@ -820,7 +819,7 @@ TEST_F(ProgramManagerWithShaderTest, GLDriverReturnsGLUnderscoreUniform) {
kUniform3NameWithArrayIndex,
},
};
- const size_t kNumUniforms = base::size(kUniforms);
+ const size_t kNumUniforms = std::size(kUniforms);
SetupShaderExpectations(kAttribs, kNumAttribs, kUniforms, kNumUniforms,
kServiceProgramId);
Shader* vshader = shader_manager_.CreateShader(
@@ -884,7 +883,7 @@ TEST_F(ProgramManagerWithShaderTest, SimilarArrayNames) {
kUniform3Name,
},
};
- const size_t kNumUniforms = base::size(kUniforms);
+ const size_t kNumUniforms = std::size(kUniforms);
SetupShaderExpectations(kAttribs, kNumAttribs, kUniforms, kNumUniforms,
kServiceProgramId);
Shader* vshader = shader_manager_.CreateShader(
@@ -985,8 +984,8 @@ TEST_F(ProgramManagerWithShaderTest, GLDriverReturnsWrongTypeInfo) {
kUniform3NameWithArrayIndex,
},
};
- const size_t kNumAttribs = base::size(kAttribs);
- const size_t kNumUniforms = base::size(kUniforms);
+ const size_t kNumAttribs = std::size(kAttribs);
+ const size_t kNumUniforms = std::size(kUniforms);
SetupShaderExpectations(kAttribs, kNumAttribs, kUniforms, kNumUniforms,
kServiceProgramId);
Program* program =
@@ -1136,8 +1135,8 @@ TEST_F(ProgramManagerWithShaderTest, ProgramInfoGetProgramInfo) {
bucket.GetDataAs<ProgramInfoHeader*>(0, sizeof(ProgramInfoHeader));
ASSERT_TRUE(header != nullptr);
EXPECT_EQ(1u, header->link_status);
- EXPECT_EQ(base::size(kAttribs), header->num_attribs);
- EXPECT_EQ(base::size(kUniforms), header->num_uniforms);
+ EXPECT_EQ(std::size(kAttribs), header->num_attribs);
+ EXPECT_EQ(std::size(kUniforms), header->num_uniforms);
const ProgramInput* inputs = bucket.GetDataAs<const ProgramInput*>(
sizeof(*header),
sizeof(ProgramInput) * (header->num_attribs + header->num_uniforms));
@@ -1238,23 +1237,23 @@ TEST_F(ProgramManagerWithShaderTest, ProgramInfoGetUniformBlocksValid) {
data.entry[0].binding = 0;
data.entry[0].data_size = 8;
data.entry[0].name_offset = ComputeOffset(&data, data.name0);
- data.entry[0].name_length = base::size(data.name0);
- data.entry[0].active_uniforms = base::size(data.indices0);
+ data.entry[0].name_length = std::size(data.name0);
+ data.entry[0].active_uniforms = std::size(data.indices0);
data.entry[0].active_uniform_offset = ComputeOffset(&data, data.indices0);
data.entry[0].referenced_by_vertex_shader = static_cast<uint32_t>(true);
data.entry[0].referenced_by_fragment_shader = static_cast<uint32_t>(false);
data.entry[1].binding = 1;
data.entry[1].data_size = 4;
data.entry[1].name_offset = ComputeOffset(&data, data.name1);
- data.entry[1].name_length = base::size(data.name1);
- data.entry[1].active_uniforms = base::size(data.indices1);
+ data.entry[1].name_length = std::size(data.name1);
+ data.entry[1].active_uniforms = std::size(data.indices1);
data.entry[1].active_uniform_offset = ComputeOffset(&data, data.indices1);
data.entry[1].referenced_by_vertex_shader = static_cast<uint32_t>(false);
data.entry[1].referenced_by_fragment_shader = static_cast<uint32_t>(true);
- memcpy(data.name0, kName[0], base::size(data.name0));
+ memcpy(data.name0, kName[0], std::size(data.name0));
data.indices0[0] = kIndices[0][0];
data.indices0[1] = kIndices[0][1];
- memcpy(data.name1, kName[1], base::size(data.name1));
+ memcpy(data.name1, kName[1], std::size(data.name1));
data.indices1[0] = kIndices[1][0];
EXPECT_CALL(*(gl_.get()),
@@ -1401,13 +1400,13 @@ TEST_F(ProgramManagerWithShaderTest,
data.entry[0].size = 1;
data.entry[0].type = GL_FLOAT_VEC2;
data.entry[0].name_offset = ComputeOffset(&data, data.name0);
- data.entry[0].name_length = base::size(data.name0);
+ data.entry[0].name_length = std::size(data.name0);
data.entry[1].size = 2;
data.entry[1].type = GL_FLOAT;
data.entry[1].name_offset = ComputeOffset(&data, data.name1);
- data.entry[1].name_length = base::size(data.name1);
- memcpy(data.name0, kName[0], base::size(data.name0));
- memcpy(data.name1, kName[1], base::size(data.name1));
+ data.entry[1].name_length = std::size(data.name1);
+ memcpy(data.name0, kName[0], std::size(data.name0));
+ memcpy(data.name1, kName[1], std::size(data.name1));
EXPECT_CALL(*(gl_.get()),
GetProgramiv(kServiceProgramId,
@@ -1528,7 +1527,7 @@ TEST_F(ProgramManagerWithShaderTest, ProgramInfoGetUniformsES3Valid) {
kMatrixStride,
kIsRowMajor,
};
- const size_t kNumIterations = base::size(kPname);
+ const size_t kNumIterations = std::size(kPname);
for (size_t ii = 0; ii < kNumIterations; ++ii) {
EXPECT_CALL(*(gl_.get()),
GetActiveUniformsiv(
@@ -1554,7 +1553,7 @@ TEST_F(ProgramManagerWithShaderTest, UnusedUniformArrayElements) {
ASSERT_TRUE(program != nullptr);
// Emulate the situation that only the first element has a valid location.
// TODO(zmo): Don't assume these are in order.
- for (size_t ii = 0; ii < base::size(kUniforms); ++ii) {
+ for (size_t ii = 0; ii < std::size(kUniforms); ++ii) {
Program::UniformInfo* uniform = const_cast<Program::UniformInfo*>(
program->GetUniformInfo(ii));
ASSERT_TRUE(uniform != nullptr);
@@ -1568,8 +1567,8 @@ TEST_F(ProgramManagerWithShaderTest, UnusedUniformArrayElements) {
bucket.GetDataAs<ProgramInfoHeader*>(0, sizeof(ProgramInfoHeader));
ASSERT_TRUE(header != nullptr);
EXPECT_EQ(1u, header->link_status);
- EXPECT_EQ(base::size(kAttribs), header->num_attribs);
- EXPECT_EQ(base::size(kUniforms), header->num_uniforms);
+ EXPECT_EQ(std::size(kAttribs), header->num_attribs);
+ EXPECT_EQ(std::size(kUniforms), header->num_uniforms);
const ProgramInput* inputs = bucket.GetDataAs<const ProgramInput*>(
sizeof(*header),
sizeof(ProgramInput) * (header->num_attribs + header->num_uniforms));
@@ -2011,7 +2010,7 @@ TEST_F(ProgramManagerWithShaderTest, ClearWithSamplerTypes) {
GL_SAMPLER_3D_OES,
GL_SAMPLER_2D_RECT_ARB,
};
- const size_t kNumSamplerTypes = base::size(kSamplerTypes);
+ const size_t kNumSamplerTypes = std::size(kSamplerTypes);
for (size_t ii = 0; ii < kNumSamplerTypes; ++ii) {
static ProgramManagerWithShaderTest::AttribInfo kAttribs[] = {
{ kAttrib1Name, kAttrib1Size, kAttrib1Type, kAttrib1Location, },
@@ -2044,8 +2043,8 @@ TEST_F(ProgramManagerWithShaderTest, ClearWithSamplerTypes) {
kUniform3NameWithArrayIndex,
},
};
- const size_t kNumAttribs = base::size(kAttribs);
- const size_t kNumUniforms = base::size(kUniforms);
+ const size_t kNumAttribs = std::size(kAttribs);
+ const size_t kNumUniforms = std::size(kUniforms);
SetupShaderExpectations(kAttribs, kNumAttribs, kUniforms, kNumUniforms,
kServiceProgramId);
program->Link(nullptr, Program::kCountOnlyStaticallyUsed, this);
@@ -2109,8 +2108,8 @@ TEST_F(ProgramManagerWithShaderTest, BindUniformLocation) {
},
};
- const size_t kNumAttribs = base::size(kAttribs);
- const size_t kNumUniforms = base::size(kUniforms);
+ const size_t kNumAttribs = std::size(kAttribs);
+ const size_t kNumUniforms = std::size(kUniforms);
SetupShaderExpectations(kAttribs, kNumAttribs, kUniforms, kNumUniforms,
kServiceProgramId);
program->Link(nullptr, Program::kCountOnlyStaticallyUsed, this);
@@ -2131,7 +2130,7 @@ TEST_F(ProgramManagerWithShaderTest, ZeroSizeUniformMarkedInvalid) {
kUniform1DesiredLocation, kUniform1Name,
},
};
- const size_t kNumInvalidUniforms = base::size(kInvalidUniforms);
+ const size_t kNumInvalidUniforms = std::size(kInvalidUniforms);
SetupShaderExpectations(kAttribs, kNumAttribs, kInvalidUniforms,
kNumInvalidUniforms, kServiceProgramId);
@@ -2446,7 +2445,7 @@ TEST_P(ProgramManagerDualSourceBlendingES2Test, UseSecondaryFragCoord) {
int shader_version = 100;
Program* program =
SetupProgramForVariables(nullptr, 0, kFragmentVaryings,
- base::size(kFragmentVaryings), &shader_version);
+ std::size(kFragmentVaryings), &shader_version);
const gl::GLVersionInfo& gl_version = feature_info_->gl_version_info();
if (!gl_version.is_es) {
@@ -2473,7 +2472,7 @@ TEST_P(ProgramManagerDualSourceBlendingES2Test, UseSecondaryFragData) {
int shader_version = 100;
Program* program =
SetupProgramForVariables(nullptr, 0, kFragmentVaryings,
- base::size(kFragmentVaryings), &shader_version);
+ std::size(kFragmentVaryings), &shader_version);
const gl::GLVersionInfo& gl_version = feature_info_->gl_version_info();
if (!gl_version.is_es) {
diff --git a/chromium/gpu/command_buffer/service/query_manager_unittest.cc b/chromium/gpu/command_buffer/service/query_manager_unittest.cc
index 959c8d646cf..40c55dfb981 100644
--- a/chromium/gpu/command_buffer/service/query_manager_unittest.cc
+++ b/chromium/gpu/command_buffer/service/query_manager_unittest.cc
@@ -8,6 +8,7 @@
#include <memory>
#include "base/bind.h"
+#include "base/time/time.h"
#include "gpu/command_buffer/client/client_test_helper.h"
#include "gpu/command_buffer/common/gles2_cmd_format.h"
#include "gpu/command_buffer/service/error_state_mock.h"
diff --git a/chromium/gpu/command_buffer/service/raster_cmd_validation_implementation_autogen.h b/chromium/gpu/command_buffer/service/raster_cmd_validation_implementation_autogen.h
index 4c34cae7a30..d2517c0cffc 100644
--- a/chromium/gpu/command_buffer/service/raster_cmd_validation_implementation_autogen.h
+++ b/chromium/gpu/command_buffer/service/raster_cmd_validation_implementation_autogen.h
@@ -96,18 +96,18 @@ static const viz::ResourceFormat valid_viz_resource_format_table[] = {
};
Validators::Validators()
- : g_l_state(valid_g_l_state_table, base::size(valid_g_l_state_table)),
+ : g_l_state(valid_g_l_state_table, std::size(valid_g_l_state_table)),
texture_mag_filter_mode(valid_texture_mag_filter_mode_table,
- base::size(valid_texture_mag_filter_mode_table)),
+ std::size(valid_texture_mag_filter_mode_table)),
texture_min_filter_mode(valid_texture_min_filter_mode_table,
- base::size(valid_texture_min_filter_mode_table)),
+ std::size(valid_texture_min_filter_mode_table)),
texture_parameter(valid_texture_parameter_table,
- base::size(valid_texture_parameter_table)),
+ std::size(valid_texture_parameter_table)),
texture_wrap_mode(valid_texture_wrap_mode_table,
- base::size(valid_texture_wrap_mode_table)),
+ std::size(valid_texture_wrap_mode_table)),
gfx_buffer_usage(valid_gfx_buffer_usage_table,
- base::size(valid_gfx_buffer_usage_table)),
+ std::size(valid_gfx_buffer_usage_table)),
viz_resource_format(valid_viz_resource_format_table,
- base::size(valid_viz_resource_format_table)) {}
+ std::size(valid_viz_resource_format_table)) {}
#endif // GPU_COMMAND_BUFFER_SERVICE_RASTER_CMD_VALIDATION_IMPLEMENTATION_AUTOGEN_H_
diff --git a/chromium/gpu/command_buffer/service/raster_decoder.cc b/chromium/gpu/command_buffer/service/raster_decoder.cc
index 6003a509325..4e135a30ded 100644
--- a/chromium/gpu/command_buffer/service/raster_decoder.cc
+++ b/chromium/gpu/command_buffer/service/raster_decoder.cc
@@ -14,9 +14,7 @@
#include "base/atomic_sequence_num.h"
#include "base/bind.h"
-#include "base/bits.h"
#include "base/containers/flat_map.h"
-#include "base/cxx17_backports.h"
#include "base/debug/crash_logging.h"
#include "base/logging.h"
#include "base/memory/raw_ptr.h"
@@ -49,6 +47,7 @@
#include "gpu/command_buffer/service/gles2_cmd_copy_tex_image.h"
#include "gpu/command_buffer/service/gles2_cmd_copy_texture_chromium.h"
#include "gpu/command_buffer/service/gpu_tracer.h"
+#include "gpu/command_buffer/service/image_factory.h"
#include "gpu/command_buffer/service/logger.h"
#include "gpu/command_buffer/service/mailbox_manager.h"
#include "gpu/command_buffer/service/query_manager.h"
@@ -67,7 +66,7 @@
#include "skia/ext/rgba_to_yuva.h"
#include "third_party/libyuv/include/libyuv/planar_functions.h"
#include "third_party/skia/include/core/SkCanvas.h"
-#include "third_party/skia/include/core/SkDeferredDisplayListRecorder.h"
+#include "third_party/skia/include/core/SkColorSpace.h"
#include "third_party/skia/include/core/SkPromiseImageTexture.h"
#include "third_party/skia/include/core/SkSurface.h"
#include "third_party/skia/include/core/SkSurfaceProps.h"
@@ -438,6 +437,7 @@ class RasterDecoderImpl final : public RasterDecoder,
const GpuPreferences& gpu_preferences,
MemoryTracker* memory_tracker,
SharedImageManager* shared_image_manager,
+ ImageFactory* image_factory,
scoped_refptr<SharedContextState> shared_context_state,
bool is_privileged);
@@ -785,6 +785,7 @@ class RasterDecoderImpl final : public RasterDecoder,
GLuint msaa_sample_count,
MsaaMode msaa_mode,
GLboolean can_use_lcd_text,
+ GLboolean visible,
const volatile GLbyte* key);
void DoRasterCHROMIUM(GLuint raster_shm_id,
GLuint raster_shm_offset,
@@ -922,9 +923,8 @@ class RasterDecoderImpl final : public RasterDecoder,
bool gpu_raster_enabled_ = false;
bool use_gpu_raster_ = false;
bool supports_oop_canvas_ = false;
+ bool texture_storage_image_enabled_ = false;
bool use_passthrough_ = false;
- bool use_ddl_ = false;
- bool use_ddl_in_current_raster_session_ = false;
// The current decoder error communicates the decoder error through command
// processing functions that do not return the error value. Should be set
@@ -976,11 +976,7 @@ class RasterDecoderImpl final : public RasterDecoder,
std::vector<GrBackendSemaphore> end_semaphores_;
std::unique_ptr<cc::ServicePaintCache> paint_cache_;
- std::unique_ptr<SkDeferredDisplayListRecorder> recorder_;
- sk_sp<SkDeferredDisplayList> ddl_;
- absl::optional<SkDeferredDisplayList::ProgramIterator> program_iterator_;
- raw_ptr<SkCanvas> raster_canvas_ =
- nullptr; // ptr into recorder_ or sk_surface_
+ raw_ptr<SkCanvas> raster_canvas_ = nullptr;
std::vector<SkDiscardableHandleId> locked_handles_;
// Tracing helpers.
@@ -1024,12 +1020,13 @@ RasterDecoder* RasterDecoder::Create(
const GpuPreferences& gpu_preferences,
MemoryTracker* memory_tracker,
SharedImageManager* shared_image_manager,
+ ImageFactory* image_factory,
scoped_refptr<SharedContextState> shared_context_state,
bool is_privileged) {
- return new RasterDecoderImpl(client, command_buffer_service, outputter,
- gpu_feature_info, gpu_preferences,
- memory_tracker, shared_image_manager,
- std::move(shared_context_state), is_privileged);
+ return new RasterDecoderImpl(
+ client, command_buffer_service, outputter, gpu_feature_info,
+ gpu_preferences, memory_tracker, shared_image_manager, image_factory,
+ std::move(shared_context_state), is_privileged);
}
RasterDecoder::RasterDecoder(DecoderClient* client,
@@ -1081,6 +1078,7 @@ RasterDecoderImpl::RasterDecoderImpl(
const GpuPreferences& gpu_preferences,
MemoryTracker* memory_tracker,
SharedImageManager* shared_image_manager,
+ ImageFactory* image_factory,
scoped_refptr<SharedContextState> shared_context_state,
bool is_privileged)
: RasterDecoder(client, command_buffer_service, outputter),
@@ -1095,6 +1093,8 @@ RasterDecoderImpl::RasterDecoderImpl(
gpu_feature_info
.status_values[GPU_FEATURE_TYPE_CANVAS_OOP_RASTERIZATION] ==
kGpuFeatureStatusEnabled),
+ texture_storage_image_enabled_(
+ image_factory && image_factory->SupportsCreateAnonymousImage()),
use_passthrough_(gles2::PassthroughCommandDecoderSupported() &&
gpu_preferences.use_passthrough_cmd_decoder),
gpu_preferences_(gpu_preferences),
@@ -1176,7 +1176,6 @@ ContextResult RasterDecoderImpl::Initialize(
DCHECK(gr_context());
use_gpu_raster_ = true;
paint_cache_ = std::make_unique<cc::ServicePaintCache>();
- use_ddl_ = gpu_preferences_.enable_oop_rasterization_ddl;
}
return ContextResult::kSuccess;
@@ -1288,8 +1287,7 @@ Capabilities RasterDecoderImpl::GetCapabilities() {
gpu_preferences_.texture_target_exception_list;
caps.texture_format_bgra8888 =
feature_info()->feature_flags().ext_texture_format_bgra8888;
- caps.texture_storage_image =
- feature_info()->feature_flags().chromium_texture_storage_image;
+ caps.texture_storage_image = texture_storage_image_enabled_;
caps.texture_storage = feature_info()->feature_flags().ext_texture_storage;
// TODO(piman): have a consistent limit in shared image backings.
// https://crbug.com/960588
@@ -1583,7 +1581,7 @@ error::Error RasterDecoderImpl::DoCommandsImpl(unsigned int num_commands,
const unsigned int arg_count = size - 1;
unsigned int command_index = command - kFirstRasterCommand;
- if (command_index < base::size(command_info)) {
+ if (command_index < std::size(command_info)) {
const CommandInfo& info = command_info[command_index];
if (sk_surface_) {
if (!AllowedBetweenBeginEndRaster(command)) {
@@ -3515,6 +3513,7 @@ void RasterDecoderImpl::DoBeginRasterCHROMIUM(GLuint sk_color,
GLuint msaa_sample_count,
MsaaMode msaa_mode,
GLboolean can_use_lcd_text,
+ GLboolean visible,
const volatile GLbyte* key) {
// Workaround for https://crbug.com/906453: Flush before BeginRaster (the
// commands between BeginRaster and EndRaster will not flush).
@@ -3580,7 +3579,6 @@ void RasterDecoderImpl::DoBeginRasterCHROMIUM(GLuint sk_color,
case kNoMSAA:
final_msaa_count = 0;
flags = 0;
- use_ddl_in_current_raster_session_ = use_ddl_;
break;
case kMSAA:
// If we can't match requested MSAA samples, don't use MSAA.
@@ -3589,13 +3587,10 @@ void RasterDecoderImpl::DoBeginRasterCHROMIUM(GLuint sk_color,
gr_context()->maxSurfaceSampleCountForColorType(sk_color_type))
final_msaa_count = 0;
flags = 0;
- use_ddl_in_current_raster_session_ = use_ddl_;
break;
case kDMSAA:
final_msaa_count = 1;
flags = SkSurfaceProps::kDynamicMSAA_Flag;
- // DMSAA is not compatible with DDL
- use_ddl_in_current_raster_session_ = false;
break;
}
@@ -3611,7 +3606,8 @@ void RasterDecoderImpl::DoBeginRasterCHROMIUM(GLuint sk_color,
clear_color.emplace(sk_color);
scoped_shared_image_raster_write_ =
shared_image_raster_->BeginScopedWriteAccess(
- final_msaa_count, surface_props, clear_color);
+ shared_context_state_, final_msaa_count, surface_props, clear_color,
+ visible);
if (!scoped_shared_image_raster_write_) {
LOCAL_SET_GL_ERROR(GL_INVALID_OPERATION, "glBeginRasterCHROMIUM",
"failed to create surface");
@@ -3649,16 +3645,7 @@ void RasterDecoderImpl::DoBeginRasterCHROMIUM(GLuint sk_color,
DCHECK(result);
}
- if (use_ddl_in_current_raster_session_) {
- SkSurfaceCharacterization characterization;
- bool result = sk_surface_->characterize(&characterization);
- DCHECK(result) << "Failed to characterize raster SkSurface.";
- recorder_ =
- std::make_unique<SkDeferredDisplayListRecorder>(characterization);
- raster_canvas_ = recorder_->getCanvas();
- } else {
- raster_canvas_ = sk_surface_->getCanvas();
- }
+ raster_canvas_ = sk_surface_->getCanvas();
paint_op_shared_image_provider_ = std::make_unique<SharedImageProviderImpl>(
&shared_image_representation_factory_, shared_context_state_, sk_surface_,
@@ -3780,33 +3767,6 @@ void RasterDecoderImpl::DoRasterCHROMIUM(GLuint raster_shm_id,
}
}
-bool RasterDecoderImpl::EnsureDDLReadyForRaster() {
- DCHECK(use_ddl_in_current_raster_session_);
- DCHECK_EQ(current_decoder_error_, error::kNoError);
-
- if (!ddl_) {
- DCHECK(recorder_);
- DCHECK(!program_iterator_);
-
- TRACE_EVENT0("gpu",
- "RasterDecoderImpl::EnsureDDLReadyForRaster::DetachDDL");
- ddl_ = recorder_->detach();
- program_iterator_.emplace(shared_context_state_->gr_context(), ddl_.get());
- }
-
- while (!program_iterator_->done()) {
- TRACE_EVENT0("gpu",
- "RasterDecoderImpl::EnsureDDLReadyForRaster::MaybeCompile");
- bool did_compile = program_iterator_->compile();
- program_iterator_->next();
- if (did_compile)
- return false;
- }
-
- program_iterator_.reset();
- return true;
-}
-
void RasterDecoderImpl::DoEndRasterCHROMIUM() {
TRACE_EVENT0("gpu", "RasterDecoderImpl::DoEndRasterCHROMIUM");
if (!sk_surface_ && !scoped_shared_image_raster_write_) {
@@ -3819,8 +3779,7 @@ void RasterDecoderImpl::DoEndRasterCHROMIUM() {
scoped_shared_image_raster_write_->set_callback(base::BindOnce(
[](scoped_refptr<ServiceFontManager> font_manager,
std::vector<SkDiscardableHandleId> handles) {
- if (!font_manager->is_destroyed())
- font_manager->Unlock(handles);
+ font_manager->Unlock(handles);
},
font_manager_, std::move(locked_handles_)));
scoped_shared_image_raster_write_.reset();
@@ -3831,18 +3790,6 @@ void RasterDecoderImpl::DoEndRasterCHROMIUM() {
raster_canvas_ = nullptr;
- if (use_ddl_in_current_raster_session_) {
- if (!EnsureDDLReadyForRaster()) {
- // This decoder error indicates that this command has not finished
- // executing. The decoder will yield and re-execute this command when it
- // resumes decoding.
- current_decoder_error_ = error::kDeferCommandUntilLater;
- return;
- }
- TRACE_EVENT0("gpu", "RasterDecoderImpl::DoEndRasterCHROMIUM::DrawDDL");
- sk_surface_->draw(std::move(ddl_));
- }
-
{
TRACE_EVENT0("gpu", "RasterDecoderImpl::DoEndRasterCHROMIUM::Flush");
// This is a slow operation since skia will execute the GPU work for the
diff --git a/chromium/gpu/command_buffer/service/raster_decoder.h b/chromium/gpu/command_buffer/service/raster_decoder.h
index 33b67252839..9848cd382fc 100644
--- a/chromium/gpu/command_buffer/service/raster_decoder.h
+++ b/chromium/gpu/command_buffer/service/raster_decoder.h
@@ -15,6 +15,7 @@ namespace gpu {
class DecoderClient;
struct GpuFeatureInfo;
struct GpuPreferences;
+class ImageFactory;
class MemoryTracker;
class ServiceTransferCache;
class SharedContextState;
@@ -43,6 +44,7 @@ class GPU_GLES2_EXPORT RasterDecoder : public DecoderContext,
const GpuPreferences& gpu_preferences,
MemoryTracker* memory_tracker,
SharedImageManager* shared_image_manager,
+ ImageFactory* image_factory,
scoped_refptr<SharedContextState> shared_context_state,
bool is_priviliged);
diff --git a/chromium/gpu/command_buffer/service/raster_decoder_autogen.h b/chromium/gpu/command_buffer/service/raster_decoder_autogen.h
index d900eebaba6..c7a59c1bf3e 100644
--- a/chromium/gpu/command_buffer/service/raster_decoder_autogen.h
+++ b/chromium/gpu/command_buffer/service/raster_decoder_autogen.h
@@ -117,6 +117,7 @@ error::Error RasterDecoderImpl::HandleBeginRasterCHROMIUMImmediate(
gpu::raster::MsaaMode msaa_mode =
static_cast<gpu::raster::MsaaMode>(c.msaa_mode);
GLboolean can_use_lcd_text = static_cast<GLboolean>(c.can_use_lcd_text);
+ GLboolean visible = static_cast<GLboolean>(c.visible);
uint32_t mailbox_size;
if (!gles2::GLES2Util::ComputeDataSize<GLbyte, 16>(1, &mailbox_size)) {
return error::kOutOfBounds;
@@ -131,7 +132,7 @@ error::Error RasterDecoderImpl::HandleBeginRasterCHROMIUMImmediate(
return error::kOutOfBounds;
}
DoBeginRasterCHROMIUM(sk_color, needs_clear, msaa_sample_count, msaa_mode,
- can_use_lcd_text, mailbox);
+ can_use_lcd_text, visible, mailbox);
return error::kNoError;
}
diff --git a/chromium/gpu/command_buffer/service/raster_decoder_unittest.cc b/chromium/gpu/command_buffer/service/raster_decoder_unittest.cc
index 33faefe2333..315dcedccb3 100644
--- a/chromium/gpu/command_buffer/service/raster_decoder_unittest.cc
+++ b/chromium/gpu/command_buffer/service/raster_decoder_unittest.cc
@@ -275,7 +275,7 @@ class RasterDecoderOOPTest : public testing::Test, DecoderClient {
auto decoder = base::WrapUnique(RasterDecoder::Create(
this, command_buffer_service_.get(), &outputter_, gpu_feature_info_,
GpuPreferences(), nullptr /* memory_tracker */, &shared_image_manager_,
- context_state_, true /* is_privileged */));
+ /*image_factory=*/nullptr, context_state_, true /* is_privileged */));
ContextCreationAttribs attribs;
attribs.enable_oop_rasterization = true;
attribs.enable_raster_interface = true;
diff --git a/chromium/gpu/command_buffer/service/raster_decoder_unittest_base.cc b/chromium/gpu/command_buffer/service/raster_decoder_unittest_base.cc
index e8098a68dc3..95c5de3e5a5 100644
--- a/chromium/gpu/command_buffer/service/raster_decoder_unittest_base.cc
+++ b/chromium/gpu/command_buffer/service/raster_decoder_unittest_base.cc
@@ -155,7 +155,8 @@ void RasterDecoderTestBase::InitDecoder(const InitState& init) {
decoder_.reset(RasterDecoder::Create(
this, command_buffer_service_.get(), &outputter_, gpu_feature_info,
gpu_preferences_, nullptr /* memory_tracker */, &shared_image_manager_,
- shared_context_state_, true /* is_privileged */));
+ /*image_factory=*/nullptr, shared_context_state_,
+ true /* is_privileged */));
decoder_->SetIgnoreCachedStateForTest(ignore_cached_state_for_test_);
decoder_->DisableFlushWorkaroundForTest();
decoder_->GetLogger()->set_log_synthesized_gl_errors(false);
diff --git a/chromium/gpu/command_buffer/service/scheduler_unittest.cc b/chromium/gpu/command_buffer/service/scheduler_unittest.cc
index e921d556bbd..3cc920c7bf0 100644
--- a/chromium/gpu/command_buffer/service/scheduler_unittest.cc
+++ b/chromium/gpu/command_buffer/service/scheduler_unittest.cc
@@ -7,7 +7,6 @@
#include <algorithm>
#include "base/bind.h"
-#include "base/task/post_task.h"
#include "base/test/task_environment.h"
#include "base/test/test_simple_task_runner.h"
#include "base/time/time.h"
diff --git a/chromium/gpu/command_buffer/service/service_font_manager.cc b/chromium/gpu/command_buffer/service/service_font_manager.cc
index bc68171b79a..042b61ed1a8 100644
--- a/chromium/gpu/command_buffer/service/service_font_manager.cc
+++ b/chromium/gpu/command_buffer/service/service_font_manager.cc
@@ -153,6 +153,8 @@ ServiceFontManager::ServiceFontManager(Client* client,
ServiceFontManager::~ServiceFontManager() {
DCHECK(destroyed_);
+ DLOG_IF(ERROR, !discardable_handle_map_.empty())
+ << "discardable_handle_map_ is not empty.";
}
void ServiceFontManager::Destroy() {
@@ -160,7 +162,6 @@ void ServiceFontManager::Destroy() {
client_ = nullptr;
strike_client_.reset();
- discardable_handle_map_.clear();
destroyed_ = true;
}
@@ -168,7 +169,7 @@ bool ServiceFontManager::Deserialize(
const volatile char* memory,
uint32_t memory_size,
std::vector<SkDiscardableHandleId>* locked_handles) {
- base::AutoLock hold(lock_);
+ base::ReleasableAutoLock hold(&lock_);
DCHECK_EQ(client_thread_id_, base::PlatformThread::CurrentId());
DCHECK(locked_handles->empty());
@@ -187,8 +188,9 @@ bool ServiceFontManager::Deserialize(
scoped_refptr<gpu::Buffer> buffer = client_->GetShmBuffer(handle.shm_id);
if (!DiscardableHandleBase::ValidateParameters(buffer.get(),
- handle.byte_offset))
+ handle.byte_offset)) {
return false;
+ }
if (!AddHandle(handle.handle_id,
ServiceDiscardableHandle(
@@ -207,9 +209,15 @@ bool ServiceFontManager::Deserialize(
return false;
locked_handles->resize(num_locked_handles);
- for (uint32_t i = 0; i < num_locked_handles; ++i) {
- if (!deserializer.Read<SkDiscardableHandleId>(&locked_handles->at(i)))
+ for (auto& locked_handle : *locked_handles) {
+ if (!deserializer.Read<SkDiscardableHandleId>(&locked_handle))
return false;
+ auto it = discardable_handle_map_.find(locked_handle);
+ if (it == discardable_handle_map_.end()) {
+ DLOG(ERROR) << "Got an invalid SkDiscardableHandleId:" << locked_handle;
+ continue;
+ }
+ it->second.Lock();
}
// Skia font data.
@@ -217,11 +225,9 @@ bool ServiceFontManager::Deserialize(
if (!deserializer.Read<uint32_t>(&skia_data_size))
return false;
- {
- base::AutoUnlock release(lock_);
- if (!deserializer.ReadStrikeData(strike_client_.get(), skia_data_size))
- return false;
- }
+ hold.Release();
+ if (!deserializer.ReadStrikeData(strike_client_.get(), skia_data_size))
+ return false;
return true;
}
@@ -229,18 +235,15 @@ bool ServiceFontManager::Deserialize(
bool ServiceFontManager::AddHandle(SkDiscardableHandleId handle_id,
ServiceDiscardableHandle handle) {
lock_.AssertAcquired();
-
- if (discardable_handle_map_.find(handle_id) != discardable_handle_map_.end())
- return false;
- discardable_handle_map_[handle_id] = std::move(handle);
- return true;
+ bool inserted;
+ std::tie(std::ignore, inserted) =
+ discardable_handle_map_.try_emplace(handle_id, std::move(handle));
+ return inserted;
}
bool ServiceFontManager::Unlock(
const std::vector<SkDiscardableHandleId>& handles) {
base::AutoLock hold(lock_);
- DCHECK(!destroyed_);
-
for (auto handle_id : handles) {
auto it = discardable_handle_map_.find(handle_id);
if (it == discardable_handle_map_.end())
@@ -252,10 +255,6 @@ bool ServiceFontManager::Unlock(
bool ServiceFontManager::DeleteHandle(SkDiscardableHandleId handle_id) {
base::AutoLock hold(lock_);
-
- if (destroyed_)
- return true;
-
// If this method returns true, the strike associated with the handle will be
// deleted which deletes the memory for all glyphs cached by the strike. On
// mac this is resulting in hangs during strike deserialization when a bunch
@@ -265,24 +264,32 @@ bool ServiceFontManager::DeleteHandle(SkDiscardableHandleId handle_id) {
// where skia is used, except for single process webview where the renderer
// and GPU run in the same process.
const bool report_progress =
- base::PlatformThread::CurrentId() == client_thread_id_;
+ base::PlatformThread::CurrentId() == client_thread_id_ && !destroyed_;
auto it = discardable_handle_map_.find(handle_id);
if (it == discardable_handle_map_.end()) {
LOG(ERROR) << "Tried to delete invalid SkDiscardableHandleId: "
<< handle_id;
- if (report_progress)
+ if (report_progress) {
+ DCHECK(client_);
client_->ReportProgress();
+ }
return true;
}
- bool deleted = it->second.Delete();
+ // If the renderer is destroyed, we just need check if the local ref count is
+ // 0.
+ bool deleted = destroyed_ ? it->second.ref_count() == 0 : it->second.Delete();
if (!deleted)
return false;
+ DCHECK_EQ(it->second.ref_count(), 0);
discardable_handle_map_.erase(it);
- if (report_progress)
+ if (report_progress) {
+ DCHECK(client_);
client_->ReportProgress();
+ }
+
return true;
}
diff --git a/chromium/gpu/command_buffer/service/service_font_manager.h b/chromium/gpu/command_buffer/service/service_font_manager.h
index cc428b65505..400e561aaa1 100644
--- a/chromium/gpu/command_buffer/service/service_font_manager.h
+++ b/chromium/gpu/command_buffer/service/service_font_manager.h
@@ -55,8 +55,25 @@ class GPU_GLES2_EXPORT ServiceFontManager
raw_ptr<Client> client_;
const base::PlatformThreadId client_thread_id_;
std::unique_ptr<SkStrikeClient> strike_client_;
- base::flat_map<SkDiscardableHandleId, ServiceDiscardableHandle>
- discardable_handle_map_;
+
+ class Handle {
+ public:
+ explicit Handle(ServiceDiscardableHandle handle)
+ : handle_(std::move(handle)) {}
+ void Unlock() {
+ --ref_count_;
+ handle_.Unlock();
+ }
+ void Lock() { ++ref_count_; }
+ bool Delete() { return handle_.Delete(); }
+ int ref_count() const { return ref_count_; }
+
+ private:
+ ServiceDiscardableHandle handle_;
+ // ref count hold by GPU service.
+ int ref_count_ = 0;
+ };
+ base::flat_map<SkDiscardableHandleId, Handle> discardable_handle_map_;
bool destroyed_ = false;
const bool disable_oopr_debug_crash_dump_;
};
diff --git a/chromium/gpu/command_buffer/service/service_utils.cc b/chromium/gpu/command_buffer/service/service_utils.cc
index d31e06a7707..2d6dfcda219 100644
--- a/chromium/gpu/command_buffer/service/service_utils.cc
+++ b/chromium/gpu/command_buffer/service/service_utils.cc
@@ -198,13 +198,16 @@ GrContextType ParseGrContextType() {
if (base::FeatureList::IsEnabled(features::kSkiaDawn))
return GrContextType::kDawn;
#endif
+
#if BUILDFLAG(IS_MAC)
- return base::FeatureList::IsEnabled(features::kMetal) ? GrContextType::kMetal
- : GrContextType::kGL;
-#else
- return features::IsUsingVulkan() ? GrContextType::kVulkan
- : GrContextType::kGL;
+ if (base::FeatureList::IsEnabled(features::kMetal))
+ return GrContextType::kMetal;
#endif
+
+ if (features::IsUsingVulkan())
+ return GrContextType::kVulkan;
+
+ return GrContextType::kGL;
}
VulkanImplementationName ParseVulkanImplementationName(
diff --git a/chromium/gpu/command_buffer/service/shader_translator.cc b/chromium/gpu/command_buffer/service/shader_translator.cc
index 08f4ec14a4b..9f96d5b226a 100644
--- a/chromium/gpu/command_buffer/service/shader_translator.cc
+++ b/chromium/gpu/command_buffer/service/shader_translator.cc
@@ -12,6 +12,7 @@
#include "base/check.h"
#include "base/command_line.h"
#include "base/lazy_instance.h"
+#include "base/observer_list.h"
#include "base/strings/string_number_conversions.h"
#include "base/trace_event/trace_event.h"
#include "ui/gl/gl_bindings.h"
diff --git a/chromium/gpu/command_buffer/service/shared_context_state.cc b/chromium/gpu/command_buffer/service/shared_context_state.cc
index d58e8281008..9917d51469a 100644
--- a/chromium/gpu/command_buffer/service/shared_context_state.cc
+++ b/chromium/gpu/command_buffer/service/shared_context_state.cc
@@ -4,6 +4,7 @@
#include "gpu/command_buffer/service/shared_context_state.h"
+#include "base/observer_list.h"
#include "base/strings/stringprintf.h"
#include "base/system/sys_info.h"
#include "base/threading/thread_task_runner_handle.h"
@@ -700,7 +701,7 @@ void SharedContextState::StoreVkPipelineCacheIfNeeded() {
// main thread. Hence using |created_on_compositor_gpu_thread_| to avoid
// calling it for CompositorGpuThread when DrDc is enabled. See
// GrShaderCache::StoreVkPipelineCacheIfNeeded for more details.
- if (gr_context_ && GrContextIsVulkan() &&
+ if (gr_context_ && gr_shader_cache_ && GrContextIsVulkan() &&
!created_on_compositor_gpu_thread_) {
gpu::raster::GrShaderCache::ScopedCacheUse use(gr_shader_cache_,
kDisplayCompositorClientId);
diff --git a/chromium/gpu/command_buffer/service/shared_image_backing_d3d.cc b/chromium/gpu/command_buffer/service/shared_image_backing_d3d.cc
index e858456701a..0b2477bfc7b 100644
--- a/chromium/gpu/command_buffer/service/shared_image_backing_d3d.cc
+++ b/chromium/gpu/command_buffer/service/shared_image_backing_d3d.cc
@@ -580,12 +580,22 @@ bool SharedImageBackingD3D::ProduceLegacyMailbox(
return true;
}
-uint32_t SharedImageBackingD3D::GetAllowedDawnUsages() const {
+WGPUTextureUsageFlags SharedImageBackingD3D::GetAllowedDawnUsages(
+ const WGPUTextureFormat wgpu_format) const {
// TODO(crbug.com/2709243): Figure out other SI flags, if any.
DCHECK(usage() & gpu::SHARED_IMAGE_USAGE_WEBGPU);
- return static_cast<uint32_t>(
+ const WGPUTextureUsageFlags kBasicUsage =
WGPUTextureUsage_CopySrc | WGPUTextureUsage_CopyDst |
- WGPUTextureUsage_TextureBinding | WGPUTextureUsage_RenderAttachment);
+ WGPUTextureUsage_TextureBinding | WGPUTextureUsage_RenderAttachment;
+ switch (wgpu_format) {
+ case WGPUTextureFormat_BGRA8Unorm:
+ return kBasicUsage;
+ case WGPUTextureFormat_RGBA8Unorm:
+ case WGPUTextureFormat_RGBA16Float:
+ return kBasicUsage | WGPUTextureUsage_StorageBinding;
+ default:
+ return WGPUTextureUsage_None;
+ }
}
std::unique_ptr<SharedImageRepresentationDawn>
@@ -594,45 +604,44 @@ SharedImageBackingD3D::ProduceDawn(SharedImageManager* manager,
WGPUDevice device,
WGPUBackendType backend_type) {
#if BUILDFLAG(USE_DAWN)
+#if BUILDFLAG(DAWN_ENABLE_BACKEND_OPENGLES)
+ if (backend_type == WGPUBackendType_OpenGLES) {
+ return std::make_unique<SharedImageRepresentationDawnEGLImage>(
+ ProduceGLTexturePassthrough(manager, tracker), manager, this, tracker,
+ device);
+ }
+#endif
const viz::ResourceFormat viz_resource_format = format();
const WGPUTextureFormat wgpu_format = viz::ToWGPUFormat(viz_resource_format);
if (wgpu_format == WGPUTextureFormat_Undefined) {
DLOG(ERROR) << "Unsupported viz format found: " << viz_resource_format;
return nullptr;
}
+ const WGPUTextureUsageFlags usage = GetAllowedDawnUsages(wgpu_format);
+ if (usage == WGPUTextureUsage_None) {
+ DLOG(ERROR) << "WGPUTextureUsage is unknown for viz format: "
+ << viz_resource_format;
+ return nullptr;
+ }
WGPUTextureDescriptor texture_descriptor = {};
texture_descriptor.format = wgpu_format;
- texture_descriptor.usage = GetAllowedDawnUsages();
+ texture_descriptor.usage = static_cast<uint32_t>(usage);
texture_descriptor.dimension = WGPUTextureDimension_2D;
texture_descriptor.size = {static_cast<uint32_t>(size().width()),
static_cast<uint32_t>(size().height()), 1};
texture_descriptor.mipLevelCount = 1;
texture_descriptor.sampleCount = 1;
- // We need to have an internal usage of CopySrc in order to use
- // CopyTextureToTextureInternal.
+ // We need to have internal usages of CopySrc for copies and
+ // RenderAttachment for clears.
WGPUDawnTextureInternalUsageDescriptor internalDesc = {};
internalDesc.chain.sType = WGPUSType_DawnTextureInternalUsageDescriptor;
- internalDesc.internalUsage = WGPUTextureUsage_CopySrc;
+ internalDesc.internalUsage =
+ WGPUTextureUsage_CopySrc | WGPUTextureUsage_RenderAttachment;
texture_descriptor.nextInChain =
reinterpret_cast<WGPUChainedStruct*>(&internalDesc);
-#if BUILDFLAG(DAWN_ENABLE_BACKEND_OPENGLES)
- if (backend_type == WGPUBackendType_OpenGLES) {
- // EGLImage textures do not support sampling, at the moment.
- texture_descriptor.usage &= ~WGPUTextureUsage_TextureBinding;
- EGLImage egl_image =
- static_cast<gl::GLImageD3D*>(GetGLImage())->egl_image();
- if (!egl_image) {
- DLOG(ERROR) << "Failed to create EGLImage";
- return nullptr;
- }
- return std::make_unique<SharedImageRepresentationDawnEGLImage>(
- manager, this, tracker, device, egl_image, texture_descriptor);
- }
-#endif
-
// Persistently open the shared handle by caching it on this backing.
if (!external_image_) {
DCHECK(dxgi_shared_handle_state_);
diff --git a/chromium/gpu/command_buffer/service/shared_image_backing_d3d.h b/chromium/gpu/command_buffer/service/shared_image_backing_d3d.h
index f15c196ec45..ae1873e5cc7 100644
--- a/chromium/gpu/command_buffer/service/shared_image_backing_d3d.h
+++ b/chromium/gpu/command_buffer/service/shared_image_backing_d3d.h
@@ -168,7 +168,8 @@ class GPU_GLES2_EXPORT SharedImageBackingD3D
Microsoft::WRL::ComPtr<IDXGISwapChain1> swap_chain = nullptr,
bool is_back_buffer = false);
- uint32_t GetAllowedDawnUsages() const;
+ WGPUTextureUsageFlags GetAllowedDawnUsages(
+ const WGPUTextureFormat wgpu_format) const;
gl::GLImage* GetGLImage() const;
diff --git a/chromium/gpu/command_buffer/service/shared_image_backing_factory_angle_vulkan.cc b/chromium/gpu/command_buffer/service/shared_image_backing_factory_angle_vulkan.cc
index cdf5d2809af..c4ac92ccb9d 100644
--- a/chromium/gpu/command_buffer/service/shared_image_backing_factory_angle_vulkan.cc
+++ b/chromium/gpu/command_buffer/service/shared_image_backing_factory_angle_vulkan.cc
@@ -24,6 +24,7 @@
#include "gpu/vulkan/vulkan_image.h"
#include "gpu/vulkan/vulkan_util.h"
#include "third_party/skia/include/core/SkCanvas.h"
+#include "third_party/skia/include/core/SkColorSpace.h"
#include "third_party/skia/include/core/SkPromiseImageTexture.h"
#include "ui/gl/gl_context.h"
#include "ui/gl/gl_image_egl_angle_vulkan.h"
@@ -80,11 +81,13 @@ class AngleVulkanBacking : public ClearTrackingSharedImageBacking,
passthrough_texture_.reset();
egl_image_.reset();
}
- auto* fence_helper = context_state_->vk_context_provider()
- ->GetDeviceQueue()
- ->GetFenceHelper();
- fence_helper->EnqueueVulkanObjectCleanupForSubmittedWork(
- std::move(vulkan_image_));
+ if (vulkan_image_) {
+ auto* fence_helper = context_state_->vk_context_provider()
+ ->GetDeviceQueue()
+ ->GetFenceHelper();
+ fence_helper->EnqueueVulkanObjectCleanupForSubmittedWork(
+ std::move(vulkan_image_));
+ }
}
bool Initialize(
diff --git a/chromium/gpu/command_buffer/service/shared_image_backing_factory_d3d.cc b/chromium/gpu/command_buffer/service/shared_image_backing_factory_d3d.cc
index 5d70e3441a1..ec198c1f394 100644
--- a/chromium/gpu/command_buffer/service/shared_image_backing_factory_d3d.cc
+++ b/chromium/gpu/command_buffer/service/shared_image_backing_factory_d3d.cc
@@ -330,6 +330,11 @@ SharedImageBackingFactoryD3D::CreateSharedImage(
desc.SampleDesc.Quality = 0;
desc.Usage = D3D11_USAGE_DEFAULT;
desc.BindFlags = D3D11_BIND_SHADER_RESOURCE | D3D11_BIND_RENDER_TARGET;
+ // WebGPU can use RGBA_8888 and RGBA_16 for STORAGE_BINDING.
+ if ((usage & gpu::SHARED_IMAGE_USAGE_WEBGPU) &&
+ (format == viz::RGBA_8888 || format == viz::RGBA_F16)) {
+ desc.BindFlags |= D3D11_BIND_UNORDERED_ACCESS;
+ }
desc.CPUAccessFlags = 0;
desc.MiscFlags = D3D11_RESOURCE_MISC_SHARED_NTHANDLE |
D3D11_RESOURCE_MISC_SHARED_KEYEDMUTEX;
diff --git a/chromium/gpu/command_buffer/service/shared_image_backing_factory_d3d_unittest.cc b/chromium/gpu/command_buffer/service/shared_image_backing_factory_d3d_unittest.cc
index fe4bf60b7ba..8b5d4d52093 100644
--- a/chromium/gpu/command_buffer/service/shared_image_backing_factory_d3d_unittest.cc
+++ b/chromium/gpu/command_buffer/service/shared_image_backing_factory_d3d_unittest.cc
@@ -22,6 +22,7 @@
#include "gpu/command_buffer/service/shared_image_representation.h"
#include "gpu/config/gpu_test_config.h"
#include "testing/gtest/include/gtest/gtest.h"
+#include "third_party/skia/include/core/SkColorSpace.h"
#include "third_party/skia/include/core/SkImage.h"
#include "third_party/skia/include/core/SkPromiseImageTexture.h"
#include "third_party/skia/include/core/SkSurface.h"
diff --git a/chromium/gpu/command_buffer/service/shared_image_backing_factory_gl_common.cc b/chromium/gpu/command_buffer/service/shared_image_backing_factory_gl_common.cc
index e6915d93746..b57aa8b90a2 100644
--- a/chromium/gpu/command_buffer/service/shared_image_backing_factory_gl_common.cc
+++ b/chromium/gpu/command_buffer/service/shared_image_backing_factory_gl_common.cc
@@ -29,6 +29,7 @@ SharedImageBackingFactoryGLCommon::SharedImageBackingFactoryGLCommon(
: use_passthrough_(gpu_preferences.use_passthrough_cmd_decoder &&
gles2::PassthroughCommandDecoderSupported()),
workarounds_(workarounds),
+ use_webgpu_adapter_(gpu_preferences.use_webgpu_adapter),
progress_reporter_(progress_reporter) {
gl::GLApi* api = gl::g_current_gl_context;
api->glGetIntegervFn(GL_MAX_TEXTURE_SIZE, &max_texture_size_);
diff --git a/chromium/gpu/command_buffer/service/shared_image_backing_factory_gl_common.h b/chromium/gpu/command_buffer/service/shared_image_backing_factory_gl_common.h
index f7546a70cba..de9f28fb443 100644
--- a/chromium/gpu/command_buffer/service/shared_image_backing_factory_gl_common.h
+++ b/chromium/gpu/command_buffer/service/shared_image_backing_factory_gl_common.h
@@ -77,6 +77,7 @@ class GPU_GLES2_EXPORT SharedImageBackingFactoryGLCommon
bool texture_usage_angle_ = false;
SharedImageBackingGLCommon::UnpackStateAttribs attribs_;
GpuDriverBugWorkarounds workarounds_;
+ WebGPUAdapterName use_webgpu_adapter_ = WebGPUAdapterName::kDefault;
// Used to notify the watchdog before a buffer allocation in case it takes
// long.
diff --git a/chromium/gpu/command_buffer/service/shared_image_backing_factory_gl_texture.cc b/chromium/gpu/command_buffer/service/shared_image_backing_factory_gl_texture.cc
index 89f22cf5011..26c8e6f499a 100644
--- a/chromium/gpu/command_buffer/service/shared_image_backing_factory_gl_texture.cc
+++ b/chromium/gpu/command_buffer/service/shared_image_backing_factory_gl_texture.cc
@@ -141,9 +141,21 @@ bool SharedImageBackingFactoryGLTexture::IsSupported(
(usage & SHARED_IMAGE_USAGE_RASTER))) {
return false;
}
+
+ // Linux and ChromeOS support WebGPU/Compat on GL. All other platforms
+ // do not support WebGPU on GL.
+ if (usage & SHARED_IMAGE_USAGE_WEBGPU) {
+#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || defined(USE_OZONE)
+ if (use_webgpu_adapter_ != WebGPUAdapterName::kCompat) {
+ return false;
+ }
+#else
+ return false;
+#endif
+ }
+
// Needs interop factory
- if ((usage & SHARED_IMAGE_USAGE_WEBGPU) ||
- (usage & SHARED_IMAGE_USAGE_VIDEO_DECODE) ||
+ if ((usage & SHARED_IMAGE_USAGE_VIDEO_DECODE) ||
(usage & SHARED_IMAGE_USAGE_SCANOUT)) {
return false;
}
diff --git a/chromium/gpu/command_buffer/service/shared_image_backing_factory_iosurface.mm b/chromium/gpu/command_buffer/service/shared_image_backing_factory_iosurface.mm
index 66598f29815..5cfcad94621 100644
--- a/chromium/gpu/command_buffer/service/shared_image_backing_factory_iosurface.mm
+++ b/chromium/gpu/command_buffer/service/shared_image_backing_factory_iosurface.mm
@@ -120,11 +120,12 @@ class SharedImageRepresentationDawnIOSurface
texture_descriptor.mipLevelCount = 1;
texture_descriptor.sampleCount = 1;
- // We need to have an internal usage of CopySrc in order to use
- // CopyTextureToTextureInternal.
+ // We need to have internal usages of CopySrc for copies and
+ // RenderAttachment for clears.
WGPUDawnTextureInternalUsageDescriptor internalDesc = {};
internalDesc.chain.sType = WGPUSType_DawnTextureInternalUsageDescriptor;
- internalDesc.internalUsage = WGPUTextureUsage_CopySrc;
+ internalDesc.internalUsage =
+ WGPUTextureUsage_CopySrc | WGPUTextureUsage_RenderAttachment;
texture_descriptor.nextInChain =
reinterpret_cast<WGPUChainedStruct*>(&internalDesc);
diff --git a/chromium/gpu/command_buffer/service/shared_image_backing_factory_iosurface_unittest.cc b/chromium/gpu/command_buffer/service/shared_image_backing_factory_iosurface_unittest.cc
index 9a33dbe745b..8c5b4242149 100644
--- a/chromium/gpu/command_buffer/service/shared_image_backing_factory_iosurface_unittest.cc
+++ b/chromium/gpu/command_buffer/service/shared_image_backing_factory_iosurface_unittest.cc
@@ -20,6 +20,7 @@
#include "gpu/config/gpu_test_config.h"
#include "gpu/ipc/service/gpu_memory_buffer_factory_io_surface.h"
#include "testing/gtest/include/gtest/gtest.h"
+#include "third_party/skia/include/core/SkColorSpace.h"
#include "third_party/skia/include/core/SkImage.h"
#include "third_party/skia/include/core/SkPromiseImageTexture.h"
#include "third_party/skia/include/core/SkSurface.h"
diff --git a/chromium/gpu/command_buffer/service/shared_image_backing_factory_ozone.cc b/chromium/gpu/command_buffer/service/shared_image_backing_factory_ozone.cc
index 24c65656347..4d22df65537 100644
--- a/chromium/gpu/command_buffer/service/shared_image_backing_factory_ozone.cc
+++ b/chromium/gpu/command_buffer/service/shared_image_backing_factory_ozone.cc
@@ -190,16 +190,31 @@ bool SharedImageBackingFactoryOzone::IsSupported(
GrContextType gr_context_type,
bool* allow_legacy_mailbox,
bool is_pixel_used) {
- if (gmb_type != gfx::EMPTY_BUFFER && gmb_type != gfx::NATIVE_PIXMAP &&
- gmb_type != gfx::SHARED_MEMORY_BUFFER) {
- return false;
- }
// TODO(crbug.com/969114): Not all shared image factory implementations
// support concurrent read/write usage.
if (usage & SHARED_IMAGE_USAGE_CONCURRENT_READ_WRITE) {
return false;
}
+#if BUILDFLAG(IS_FUCHSIA)
+ DCHECK_EQ(gr_context_type, GrContextType::kVulkan);
+
+ // For now just use SharedImageBackingOzone for primary plane buffers.
+ // TODO(crbug.com/1310026): When Vulkan/GL interop is supported on Fuchsia
+ // SharedImageBackingOzone should be used for all scanout buffers.
+ constexpr uint32_t kPrimaryPlaneUsageFlags = SHARED_IMAGE_USAGE_DISPLAY |
+ SHARED_IMAGE_USAGE_SCANOUT |
+ SHARED_IMAGE_USAGE_RASTER;
+ if (usage != kPrimaryPlaneUsageFlags ||
+ !CanImportGpuMemoryBufferToVulkan(gmb_type)) {
+ return false;
+ }
+#else
+ if (gmb_type != gfx::EMPTY_BUFFER && gmb_type != gfx::NATIVE_PIXMAP &&
+ gmb_type != gfx::SHARED_MEMORY_BUFFER) {
+ return false;
+ }
+
// TODO(hitawala): Until SharedImageBackingOzone supports all use cases prefer
// using SharedImageBackingGLImage instead
bool needs_interop_factory = (gr_context_type == GrContextType::kVulkan &&
@@ -209,9 +224,17 @@ bool SharedImageBackingFactoryOzone::IsSupported(
if (!needs_interop_factory) {
return false;
}
+#endif
*allow_legacy_mailbox = false;
return true;
}
+bool SharedImageBackingFactoryOzone::CanImportGpuMemoryBufferToVulkan(
+ gfx::GpuMemoryBufferType memory_buffer_type) {
+ return shared_context_state_->vk_context_provider()
+ ->GetVulkanImplementation()
+ ->CanImportGpuMemoryBuffer(memory_buffer_type);
+}
+
} // namespace gpu
diff --git a/chromium/gpu/command_buffer/service/shared_image_backing_factory_ozone.h b/chromium/gpu/command_buffer/service/shared_image_backing_factory_ozone.h
index 8fee442e053..48a3e82af4c 100644
--- a/chromium/gpu/command_buffer/service/shared_image_backing_factory_ozone.h
+++ b/chromium/gpu/command_buffer/service/shared_image_backing_factory_ozone.h
@@ -71,6 +71,9 @@ class GPU_GLES2_EXPORT SharedImageBackingFactoryOzone
bool is_pixel_used) override;
private:
+ bool CanImportGpuMemoryBufferToVulkan(
+ gfx::GpuMemoryBufferType memory_buffer_type);
+
SharedContextState* const shared_context_state_;
scoped_refptr<base::RefCountedData<DawnProcTable>> dawn_procs_;
diff --git a/chromium/gpu/command_buffer/service/shared_image_backing_gl_image.cc b/chromium/gpu/command_buffer/service/shared_image_backing_gl_image.cc
index 19d60c386e4..8707942d2b2 100644
--- a/chromium/gpu/command_buffer/service/shared_image_backing_gl_image.cc
+++ b/chromium/gpu/command_buffer/service/shared_image_backing_gl_image.cc
@@ -13,6 +13,7 @@
#include "gpu/command_buffer/service/mailbox_manager.h"
#include "gpu/command_buffer/service/shared_context_state.h"
#include "gpu/command_buffer/service/skia_utils.h"
+#include "third_party/skia/include/core/SkColorSpace.h"
#include "third_party/skia/include/core/SkPromiseImageTexture.h"
#include "third_party/skia/include/gpu/GrContextThreadSafeProxy.h"
#include "ui/gl/gl_context.h"
@@ -729,10 +730,23 @@ void SharedImageBackingGLImage::SharedImageRepresentationGLTextureEndAccess(
}
}
#else
+
// If the image will be used for an overlay, we insert a fence that can be
// used by OutputPresenter to synchronize image writes with presentation.
if (!readonly && usage() & SHARED_IMAGE_USAGE_SCANOUT &&
gl::GLFence::IsGpuFenceSupported()) {
+ // If the image will be used for delegated compositing, no need to put
+ // fences at this moment as there are many raster tasks in the CPU gl
+ // context that end up creating a big number of fences, which may have some
+ // performance overhead depending on the gpu. Instead, when these images
+ // will be scheduled as overlays, a single fence will be created.
+ // TODO(crbug.com/1254033): this block of code shall be removed after cc is
+ // able to set a single (duplicated) fence for bunch of tiles instead of
+ // having the SI framework creating fences for each single message when
+ // write access ends.
+ if (usage() & SHARED_IMAGE_USAGE_RASTER_DELEGATED_COMPOSITING)
+ return;
+
last_write_gl_fence_ = gl::GLFence::CreateForGpuFence();
DCHECK(last_write_gl_fence_);
}
diff --git a/chromium/gpu/command_buffer/service/shared_image_backing_gl_texture.cc b/chromium/gpu/command_buffer/service/shared_image_backing_gl_texture.cc
index a58dd2af19f..58f69f0925e 100644
--- a/chromium/gpu/command_buffer/service/shared_image_backing_gl_texture.cc
+++ b/chromium/gpu/command_buffer/service/shared_image_backing_gl_texture.cc
@@ -13,7 +13,6 @@
#include "base/trace_event/memory_dump_manager.h"
#include "base/trace_event/trace_event.h"
#include "build/build_config.h"
-#include "components/viz/common/resources/resource_format_utils.h"
#include "components/viz/common/resources/resource_sizes.h"
#include "gpu/command_buffer/common/gles2_cmd_utils.h"
#include "gpu/command_buffer/common/shared_image_trace_utils.h"
@@ -46,6 +45,7 @@
#include "ui/gl/gl_implementation.h"
#include "ui/gl/gl_version_info.h"
#include "ui/gl/scoped_binders.h"
+#include "ui/gl/scoped_make_current.h"
#include "ui/gl/shared_gl_fence_egl.h"
#include "ui/gl/trace_util.h"
@@ -58,6 +58,10 @@
#include "gpu/command_buffer/service/shared_image_backing_factory_iosurface.h"
#endif
+#if BUILDFLAG(USE_DAWN) && BUILDFLAG(DAWN_ENABLE_BACKEND_OPENGLES)
+#include "gpu/command_buffer/service/shared_image_representation_dawn_egl_image.h"
+#endif
+
namespace gpu {
namespace {
@@ -186,6 +190,22 @@ SharedImageBackingGLTexture::ProduceDawn(SharedImageManager* manager,
MemoryTypeTracker* tracker,
WGPUDevice device,
WGPUBackendType backend_type) {
+#if BUILDFLAG(USE_DAWN) && BUILDFLAG(DAWN_ENABLE_BACKEND_OPENGLES)
+ if (backend_type == WGPUBackendType_OpenGLES) {
+ if (!image_egl_) {
+ CreateEGLImage();
+ }
+ std::unique_ptr<SharedImageRepresentationGLTextureBase> texture;
+ if (IsPassthrough()) {
+ texture = ProduceGLTexturePassthrough(manager, tracker);
+ } else {
+ texture = ProduceGLTexture(manager, tracker);
+ }
+ return std::make_unique<SharedImageRepresentationDawnEGLImage>(
+ std::move(texture), manager, this, tracker, device);
+ }
+#endif
+
if (!factory()) {
DLOG(ERROR) << "No SharedImageFactory to create a dawn representation.";
return nullptr;
@@ -236,6 +256,25 @@ void SharedImageBackingGLTexture::InitializeGLTexture(
}
}
+void SharedImageBackingGLTexture::CreateEGLImage() {
+#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || defined(USE_OZONE)
+ SharedContextState* shared_context_state = factory()->GetSharedContextState();
+ ui::ScopedMakeCurrent smc(shared_context_state->context(),
+ shared_context_state->surface());
+ auto image_np = base::MakeRefCounted<gl::GLImageNativePixmap>(
+ size(), viz::BufferFormat(format()));
+ image_np->InitializeFromTexture(GetGLServiceId());
+ image_egl_ = image_np;
+ if (passthrough_texture_) {
+ passthrough_texture_->SetLevelImage(passthrough_texture_->target(), 0,
+ image_egl_.get());
+ } else if (texture_) {
+ texture_->SetLevelImage(texture_->target(), 0, image_egl_.get(),
+ gles2::Texture::ImageState::BOUND);
+ }
+#endif
+}
+
void SharedImageBackingGLTexture::SetCompatibilitySwizzle(
const gles2::Texture::CompatibilitySwizzle* swizzle) {
if (!IsPassthrough())
diff --git a/chromium/gpu/command_buffer/service/shared_image_backing_gl_texture.h b/chromium/gpu/command_buffer/service/shared_image_backing_gl_texture.h
index 0475952f4a4..70a03714833 100644
--- a/chromium/gpu/command_buffer/service/shared_image_backing_gl_texture.h
+++ b/chromium/gpu/command_buffer/service/shared_image_backing_gl_texture.h
@@ -7,6 +7,10 @@
#include "gpu/command_buffer/service/shared_image_backing_gl_common.h"
+namespace gl {
+class GLImageEGL;
+}
+
namespace gpu {
// Implementation of SharedImageBacking that creates a GL Texture that is not
@@ -34,6 +38,7 @@ class SharedImageBackingGLTexture : public ClearTrackingSharedImageBacking {
GLenum GetGLTarget() const;
GLuint GetGLServiceId() const;
+ void CreateEGLImage();
private:
// SharedImageBacking:
@@ -68,6 +73,7 @@ class SharedImageBackingGLTexture : public ClearTrackingSharedImageBacking {
scoped_refptr<gles2::TexturePassthrough> passthrough_texture_;
sk_sp<SkPromiseImageTexture> cached_promise_texture_;
+ scoped_refptr<gl::GLImageEGL> image_egl_;
};
} // namespace gpu
diff --git a/chromium/gpu/command_buffer/service/shared_image_backing_ozone.cc b/chromium/gpu/command_buffer/service/shared_image_backing_ozone.cc
index be0249aca23..db8f6a11ab9 100644
--- a/chromium/gpu/command_buffer/service/shared_image_backing_ozone.cc
+++ b/chromium/gpu/command_buffer/service/shared_image_backing_ozone.cc
@@ -84,20 +84,21 @@ class SharedImageBackingOzone::SharedImageRepresentationVaapiOzone
class SharedImageBackingOzone::SharedImageRepresentationOverlayOzone
: public SharedImageRepresentationOverlay {
public:
- SharedImageRepresentationOverlayOzone(
- SharedImageManager* manager,
- SharedImageBacking* backing,
- MemoryTypeTracker* tracker,
- scoped_refptr<gl::GLImageNativePixmap> image)
- : SharedImageRepresentationOverlay(manager, backing, tracker),
- gl_image_(image) {}
+ SharedImageRepresentationOverlayOzone(SharedImageManager* manager,
+ SharedImageBacking* backing,
+ MemoryTypeTracker* tracker)
+ : SharedImageRepresentationOverlay(manager, backing, tracker) {}
~SharedImageRepresentationOverlayOzone() override = default;
private:
bool BeginReadAccess(std::vector<gfx::GpuFence>* acquire_fences) override {
auto* ozone_backing = static_cast<SharedImageBackingOzone*>(backing());
std::vector<gfx::GpuFenceHandle> fences;
- ozone_backing->BeginAccess(&fences);
+ bool need_end_fence;
+ ozone_backing->BeginAccess(/*readonly=*/true, AccessStream::kOverlay,
+ &fences, need_end_fence);
+ // Always need an end fence when finish reading from overlays.
+ DCHECK(need_end_fence);
for (auto& fence : fences) {
acquire_fences->emplace_back(std::move(fence));
}
@@ -105,9 +106,22 @@ class SharedImageBackingOzone::SharedImageRepresentationOverlayOzone
}
void EndReadAccess(gfx::GpuFenceHandle release_fence) override {
auto* ozone_backing = static_cast<SharedImageBackingOzone*>(backing());
- ozone_backing->EndAccess(true, std::move(release_fence));
+ ozone_backing->EndAccess(/*readonly=*/true, AccessStream::kOverlay,
+ std::move(release_fence));
+ }
+
+ gl::GLImage* GetGLImage() override {
+ if (!gl_image_) {
+ gfx::BufferFormat buffer_format = viz::BufferFormat(format());
+ auto pixmap =
+ static_cast<SharedImageBackingOzone*>(backing())->GetNativePixmap();
+ gl_image_ = base::MakeRefCounted<gl::GLImageNativePixmap>(
+ pixmap->GetBufferSize(), buffer_format);
+ gl_image_->InitializeForOverlay(pixmap);
+ }
+
+ return gl_image_.get();
}
- gl::GLImage* GetGLImage() override { return gl_image_.get(); }
scoped_refptr<gl::GLImageNativePixmap> gl_image_;
};
@@ -222,12 +236,8 @@ SharedImageBackingOzone::ProduceSkia(
std::unique_ptr<SharedImageRepresentationOverlay>
SharedImageBackingOzone::ProduceOverlay(SharedImageManager* manager,
MemoryTypeTracker* tracker) {
- gfx::BufferFormat buffer_format = viz::BufferFormat(format());
- auto image = base::MakeRefCounted<gl::GLImageNativePixmap>(
- pixmap_->GetBufferSize(), buffer_format);
- image->Initialize(pixmap_);
- return std::make_unique<SharedImageRepresentationOverlayOzone>(
- manager, this, tracker, image);
+ return std::make_unique<SharedImageRepresentationOverlayOzone>(manager, this,
+ tracker);
}
SharedImageBackingOzone::SharedImageBackingOzone(
@@ -254,7 +264,31 @@ SharedImageBackingOzone::SharedImageBackingOzone(
plane_(plane),
pixmap_(std::move(pixmap)),
dawn_procs_(std::move(dawn_procs)),
- context_state_(std::move(context_state)) {}
+ context_state_(std::move(context_state)) {
+ bool used_by_skia = (usage & SHARED_IMAGE_USAGE_RASTER) ||
+ (usage & SHARED_IMAGE_USAGE_DISPLAY);
+ bool used_by_gl =
+ (usage & SHARED_IMAGE_USAGE_GLES2) ||
+ (used_by_skia && context_state_->gr_context_type() == GrContextType::kGL);
+ bool used_by_vulkan = used_by_skia && context_state_->gr_context_type() ==
+ GrContextType::kVulkan;
+ bool used_by_webgpu = usage & SHARED_IMAGE_USAGE_WEBGPU;
+ write_streams_count_ = 0;
+ if (used_by_gl)
+ write_streams_count_++; // gl can write
+ if (used_by_vulkan)
+ write_streams_count_++; // vulkan can write
+ if (used_by_webgpu)
+ write_streams_count_++; // webgpu can write
+
+ if (write_streams_count_ == 1) {
+ // Initialize last_write_stream_ if its a single stream for cases where
+ // read happens before write eg. video decoder with usage set as SCANOUT.
+ last_write_stream_ = used_by_gl ? AccessStream::kGL
+ : (used_by_vulkan ? AccessStream::kVulkan
+ : AccessStream::kWebGPU);
+ }
+}
std::unique_ptr<SharedImageRepresentationVaapi>
SharedImageBackingOzone::ProduceVASurface(
@@ -347,37 +381,91 @@ void SharedImageBackingOzone::FlushAndSubmitIfNecessary(
}
}
-bool SharedImageBackingOzone::NeedsSynchronization() const {
- return (usage() & SHARED_IMAGE_USAGE_WEBGPU) ||
- (usage() & SHARED_IMAGE_USAGE_SCANOUT);
-}
+bool SharedImageBackingOzone::BeginAccess(
+ bool readonly,
+ AccessStream access_stream,
+ std::vector<gfx::GpuFenceHandle>* fences,
+ bool& need_end_fence) {
+ if (is_write_in_progress_) {
+ DLOG(ERROR) << "Unable to begin read or write access because another write "
+ "access is in progress";
+ return false;
+ }
-void SharedImageBackingOzone::BeginAccess(
- std::vector<gfx::GpuFenceHandle>* fences) {
- if (NeedsSynchronization()) {
- // Technically, we don't need to wait on other read fences when performing
- // a read access, but like in the case of |ExternalVkImageBacking|, reading
- // repeatedly without a write access will cause us to run out of FDs.
- // TODO(penghuang): Avoid waiting on read semaphores.
- *fences = std::move(read_fences_);
- read_fences_.clear();
- if (!write_fence_.is_null()) {
- fences->push_back(std::move(write_fence_));
- write_fence_ = gfx::GpuFenceHandle();
+ if (reads_in_progress_ && !readonly) {
+ DLOG(ERROR)
+ << "Unable to begin write access because a read access is in progress";
+ return false;
+ }
+
+ if (readonly) {
+ ++reads_in_progress_;
+ } else {
+ is_write_in_progress_ = true;
+ }
+
+ // We don't wait for read-after-read.
+ if (!readonly) {
+ for (auto& fence : read_fences_) {
+ // Wait on fence only if reading from stream different than current
+ // stream.
+ if (fence.first != access_stream) {
+ fences->emplace_back(std::move(fence.second));
+ }
}
+ read_fences_.clear();
+ }
+
+ // If current stream is different than last_write_stream_ then wait on that
+ // stream's write_fence_.
+ if (last_write_stream_ != access_stream && !write_fence_.is_null()) {
+ // For write access we expect new write_fence_ so we can move the old fence
+ // here.
+ if (!readonly)
+ fences->emplace_back(std::move(write_fence_));
+ else
+ fences->emplace_back(write_fence_.Clone());
}
+
+ if (readonly) {
+ // Optimization for single write streams. Normally we need a read fence to
+ // wait before write on a write stream. But if it single write stream, we
+ // can skip read fence for it because there's no need to wait for fences on
+ // the same stream.
+ need_end_fence =
+ (write_streams_count_ > 1) || (last_write_stream_ != access_stream);
+ } else {
+ // Log if it's a single write stream and write comes from a different stream
+ // than expected (GL, Vulkan or WebGPU).
+ LOG_IF(DFATAL,
+ write_streams_count_ == 1 && last_write_stream_ != access_stream)
+ << "Unexpected write stream: " << static_cast<int>(access_stream)
+ << ", " << static_cast<int>(last_write_stream_) << ", "
+ << write_streams_count_;
+ // Always need end fence for writes.
+ need_end_fence = true;
+ }
+
+ return true;
}
void SharedImageBackingOzone::EndAccess(bool readonly,
+ AccessStream access_stream,
gfx::GpuFenceHandle fence) {
- if (NeedsSynchronization() && !fence.is_null()) {
- if (readonly) {
- read_fences_.push_back(std::move(fence));
- } else {
- DCHECK(write_fence_.is_null());
- DCHECK(read_fences_.empty());
- write_fence_ = std::move(fence);
- }
+ if (readonly) {
+ DCHECK_GT(reads_in_progress_, 0u);
+ --reads_in_progress_;
+ } else {
+ DCHECK(is_write_in_progress_);
+ is_write_in_progress_ = false;
+ }
+
+ if (readonly) {
+ read_fences_[access_stream] = std::move(fence);
+ } else {
+ DCHECK(read_fences_.find(access_stream) == read_fences_.end());
+ write_fence_ = std::move(fence);
+ last_write_stream_ = access_stream;
}
}
diff --git a/chromium/gpu/command_buffer/service/shared_image_backing_ozone.h b/chromium/gpu/command_buffer/service/shared_image_backing_ozone.h
index 5c424cea464..a1c91f761de 100644
--- a/chromium/gpu/command_buffer/service/shared_image_backing_ozone.h
+++ b/chromium/gpu/command_buffer/service/shared_image_backing_ozone.h
@@ -9,6 +9,7 @@
#include <memory>
+#include "base/containers/flat_map.h"
#include "base/memory/ref_counted.h"
#include "base/memory/scoped_refptr.h"
#include "components/viz/common/resources/resource_format.h"
@@ -25,6 +26,7 @@
#include "ui/gfx/color_space.h"
#include "ui/gfx/geometry/size.h"
#include "ui/gfx/gpu_fence.h"
+#include "ui/gfx/gpu_fence_handle.h"
#include "ui/gfx/native_pixmap.h"
namespace gpu {
@@ -64,6 +66,8 @@ class SharedImageBackingOzone final : public ClearTrackingSharedImageBacking {
SkAlphaType alpha_type);
void SetSharedMemoryWrapper(SharedMemoryRegionWrapper wrapper);
+ enum class AccessStream { kGL, kVulkan, kWebGPU, kOverlay, kLast };
+
protected:
std::unique_ptr<SharedImageRepresentationDawn> ProduceDawn(
SharedImageManager* manager,
@@ -101,19 +105,27 @@ class SharedImageBackingOzone final : public ClearTrackingSharedImageBacking {
std::vector<GrBackendSemaphore> signal_semaphores,
SharedContextState* const shared_context_state);
- bool NeedsSynchronization() const;
-
- void BeginAccess(std::vector<gfx::GpuFenceHandle>* fences);
- void EndAccess(bool readonly, gfx::GpuFenceHandle fence);
+ bool BeginAccess(bool readonly,
+ AccessStream access_stream,
+ std::vector<gfx::GpuFenceHandle>* fences,
+ bool& need_end_fence);
+ void EndAccess(bool readonly,
+ AccessStream access_stream,
+ gfx::GpuFenceHandle fence);
// Indicates if this backing produced a VASurface that may have pending work.
bool has_pending_va_writes_ = false;
std::unique_ptr<VaapiDependencies> vaapi_deps_;
gfx::BufferPlane plane_;
+ uint32_t reads_in_progress_ = 0;
+ bool is_write_in_progress_ = false;
+ int write_streams_count_;
+
scoped_refptr<gfx::NativePixmap> pixmap_;
scoped_refptr<base::RefCountedData<DawnProcTable>> dawn_procs_;
gfx::GpuFenceHandle write_fence_;
- std::vector<gfx::GpuFenceHandle> read_fences_;
+ base::flat_map<AccessStream, gfx::GpuFenceHandle> read_fences_;
+ AccessStream last_write_stream_;
// Set for shared memory GMB.
SharedMemoryRegionWrapper shared_memory_wrapper_;
scoped_refptr<SharedContextState> context_state_;
diff --git a/chromium/gpu/command_buffer/service/shared_image_backing_raw_draw.cc b/chromium/gpu/command_buffer/service/shared_image_backing_raw_draw.cc
index 48b9300e0b4..f59667371bc 100644
--- a/chromium/gpu/command_buffer/service/shared_image_backing_raw_draw.cc
+++ b/chromium/gpu/command_buffer/service/shared_image_backing_raw_draw.cc
@@ -14,6 +14,7 @@
#include "gpu/command_buffer/service/shared_context_state.h"
#include "gpu/command_buffer/service/shared_image_representation.h"
#include "gpu/command_buffer/service/skia_utils.h"
+#include "third_party/skia/include/core/SkColorSpace.h"
#include "third_party/skia/include/core/SkPromiseImageTexture.h"
#include "ui/gl/trace_util.h"
@@ -38,11 +39,14 @@ class SharedImageBackingRawDraw::RepresentationRaster
~RepresentationRaster() override = default;
cc::PaintOpBuffer* BeginWriteAccess(
+ scoped_refptr<SharedContextState> context_state,
int final_msaa_count,
const SkSurfaceProps& surface_props,
- const absl::optional<SkColor>& clear_color) override {
+ const absl::optional<SkColor>& clear_color,
+ bool visible) override {
return raw_draw_backing()->BeginRasterWriteAccess(
- final_msaa_count, surface_props, clear_color);
+ std::move(context_state), final_msaa_count, surface_props, clear_color,
+ visible);
}
void EndWriteAccess(base::OnceClosure callback) override {
@@ -198,11 +202,15 @@ void SharedImageBackingRawDraw::ResetPaintOpBuffer() {
std::move(paint_op_release_callback_).Run();
}
-bool SharedImageBackingRawDraw::CreateBackendTextureAndFlushPaintOps() {
+bool SharedImageBackingRawDraw::CreateBackendTextureAndFlushPaintOps(
+ bool flush) {
DCHECK_CALLED_ON_VALID_THREAD(thread_checker_);
DCHECK(!backend_texture_.isValid());
DCHECK(!promise_texture_);
+ if (context_state_->context_lost())
+ return false;
+
auto mipmap = usage() & SHARED_IMAGE_USAGE_MIPMAP ? GrMipMapped::kYes
: GrMipMapped::kNo;
auto sk_color = viz::ResourceFormatToClosestSkColorType(
@@ -221,6 +229,12 @@ bool SharedImageBackingRawDraw::CreateBackendTextureAndFlushPaintOps() {
context_state_->gr_context(), backend_texture_, surface_origin(),
final_msaa_count_, sk_color, color_space().ToSkColorSpace(),
&surface_props_);
+ if (!surface) {
+ DLOG(ERROR) << "SkSurface::MakeFromBackendTexture() failed! SkColorType:"
+ << sk_color;
+ DestroyBackendTexture();
+ return false;
+ }
if (clear_color_)
surface->getCanvas()->clear(*clear_color_);
@@ -230,10 +244,16 @@ bool SharedImageBackingRawDraw::CreateBackendTextureAndFlushPaintOps() {
paint_op_buffer_->Playback(surface->getCanvas(), playback_params);
}
- // Insert resolveMSAA in surface's command stream, so if the surface,
- // otherwise gr_context->flush() call will not resolve to the wrapped
- // backend_texture_.
- surface->resolveMSAA();
+ if (flush) {
+ surface->flush();
+ } else {
+ // For a MSAA SkSurface, if gr_context->flush() is called, all draws on the
+ // SkSurface will be flush into a temp MSAA buffer, but the it will not
+ // resolved the temp MSAA buffer to the wrapped backend texture.
+ // So call resolveMSAA() to insert resolve op in surface's command stream,
+ // and when gr_context->flush() is call, the surface will be resolved.
+ surface->resolveMSAA();
+ }
return true;
}
@@ -249,9 +269,11 @@ void SharedImageBackingRawDraw::DestroyBackendTexture() {
}
cc::PaintOpBuffer* SharedImageBackingRawDraw::BeginRasterWriteAccess(
+ scoped_refptr<SharedContextState> context_state,
int final_msaa_count,
const SkSurfaceProps& surface_props,
- const absl::optional<SkColor>& clear_color) {
+ const absl::optional<SkColor>& clear_color,
+ bool visible) {
DCHECK_CALLED_ON_VALID_THREAD(thread_checker_);
AutoLock auto_lock(this);
if (read_count_) {
@@ -273,9 +295,13 @@ cc::PaintOpBuffer* SharedImageBackingRawDraw::BeginRasterWriteAccess(
if (!paint_op_buffer_)
paint_op_buffer_ = sk_make_sp<cc::PaintOpBuffer>();
+ DCHECK(!context_state_ || context_state_ == context_state);
+ context_state_ = std::move(context_state);
+
final_msaa_count_ = final_msaa_count;
surface_props_ = surface_props;
clear_color_ = clear_color;
+ visible_ = visible;
return paint_op_buffer_.get();
}
@@ -286,11 +312,26 @@ void SharedImageBackingRawDraw::EndRasterWriteAccess(
AutoLock auto_lock(this);
DCHECK_EQ(read_count_, 0);
DCHECK(is_write_);
+ DCHECK(!paint_op_release_callback_);
is_write_ = false;
+ // If |paint_op_buffer_| contains SaveLayerOps, it usually means a SVG image
+ // is drawn. For some complex SVG re-rasterizing is expensive, it causes
+ // janky scrolling for some page which SVG images are heavily used.
+ // Workaround the problem by return nullptr here, and then SkiaRenderer will
+ // fallback to using |backing_texture_|.
+ // TODO(crbug.com/1292068): only cache raster results for the SaveLayerOp
+ // covered area.
+ if (visible_ && paint_op_buffer_->has_save_layer_ops()) {
+ // If the raster task priority is high, we will execute paint ops
+ // immediately.
+ CreateBackendTextureAndFlushPaintOps(/*flush=*/true);
+ if (callback)
+ std::move(callback).Run();
+ }
+
if (callback) {
- DCHECK(!paint_op_release_callback_);
paint_op_release_callback_ = std::move(callback);
}
}
@@ -335,7 +376,8 @@ cc::PaintOpBuffer* SharedImageBackingRawDraw::BeginRasterReadAccess(
sk_sp<SkPromiseImageTexture> SharedImageBackingRawDraw::BeginSkiaReadAccess() {
DCHECK_CALLED_ON_VALID_THREAD(thread_checker_);
AutoLock auto_lock(this);
- if (!backend_texture_.isValid() && !CreateBackendTextureAndFlushPaintOps())
+ if (!backend_texture_.isValid() &&
+ !CreateBackendTextureAndFlushPaintOps(/*flush=*/false))
return nullptr;
DCHECK(promise_texture_);
diff --git a/chromium/gpu/command_buffer/service/shared_image_backing_raw_draw.h b/chromium/gpu/command_buffer/service/shared_image_backing_raw_draw.h
index aa1aac57140..b7b4205a72b 100644
--- a/chromium/gpu/command_buffer/service/shared_image_backing_raw_draw.h
+++ b/chromium/gpu/command_buffer/service/shared_image_backing_raw_draw.h
@@ -54,13 +54,16 @@ class SharedImageBackingRawDraw : public ClearTrackingSharedImageBacking {
class RepresentationSkia;
void ResetPaintOpBuffer() EXCLUSIVE_LOCKS_REQUIRED(lock_);
- bool CreateBackendTextureAndFlushPaintOps() EXCLUSIVE_LOCKS_REQUIRED(lock_);
+ bool CreateBackendTextureAndFlushPaintOps(bool flush)
+ EXCLUSIVE_LOCKS_REQUIRED(lock_);
void DestroyBackendTexture() EXCLUSIVE_LOCKS_REQUIRED(lock_);
cc::PaintOpBuffer* BeginRasterWriteAccess(
+ scoped_refptr<SharedContextState> context_state,
int final_msaa_count,
const SkSurfaceProps& surface_props,
- const absl::optional<SkColor>& clear_color);
+ const absl::optional<SkColor>& clear_color,
+ bool visible);
void EndRasterWriteAccess(base::OnceClosure callback);
cc::PaintOpBuffer* BeginRasterReadAccess(
absl::optional<SkColor>& clear_color);
@@ -70,6 +73,7 @@ class SharedImageBackingRawDraw : public ClearTrackingSharedImageBacking {
int32_t final_msaa_count_ GUARDED_BY_CONTEXT(thread_checker_) = 0;
SkSurfaceProps surface_props_ GUARDED_BY_CONTEXT(thread_checker_){};
absl::optional<SkColor> clear_color_ GUARDED_BY(lock_);
+ bool visible_ GUARDED_BY(lock_) = false;
sk_sp<cc::PaintOpBuffer> paint_op_buffer_ GUARDED_BY(lock_);
base::OnceClosure paint_op_release_callback_
GUARDED_BY_CONTEXT(thread_checker_);
diff --git a/chromium/gpu/command_buffer/service/shared_image_factory.cc b/chromium/gpu/command_buffer/service/shared_image_factory.cc
index fe3b7510a54..b098108d976 100644
--- a/chromium/gpu/command_buffer/service/shared_image_factory.cc
+++ b/chromium/gpu/command_buffer/service/shared_image_factory.cc
@@ -7,6 +7,7 @@
#include <inttypes.h>
#include <memory>
+#include "base/metrics/histogram_macros.h"
#include "base/trace_event/memory_dump_manager.h"
#include "build/build_config.h"
#include "build/chromecast_buildflags.h"
@@ -31,14 +32,17 @@
#include "gpu/config/gpu_preferences.h"
#include "ui/base/ui_base_features.h"
#include "ui/gl/gl_implementation.h"
+#include "ui/gl/gl_surface_egl.h"
#include "ui/gl/gl_switches.h"
#include "ui/gl/trace_util.h"
#if BUILDFLAG(ENABLE_VULKAN)
+#include "components/viz/common/gpu/vulkan_context_provider.h"
#include "gpu/command_buffer/service/shared_image_backing_factory_angle_vulkan.h"
+#include "gpu/vulkan/vulkan_device_queue.h"
#endif
-#if BUILDFLAG(IS_LINUX) && defined(USE_OZONE) && BUILDFLAG(ENABLE_VULKAN)
+#if defined(USE_OZONE)
#include "ui/ozone/public/ozone_platform.h"
#endif
@@ -48,7 +52,6 @@
#elif BUILDFLAG(IS_ANDROID) && BUILDFLAG(ENABLE_VULKAN)
#include "gpu/command_buffer/service/external_vk_image_factory.h"
#include "gpu/command_buffer/service/shared_image_backing_factory_ahardwarebuffer.h"
-#include "gpu/vulkan/vulkan_device_queue.h"
#elif BUILDFLAG(IS_MAC)
#include "gpu/command_buffer/service/shared_image_backing_factory_iosurface.h"
#elif BUILDFLAG(IS_CHROMEOS_ASH)
@@ -64,7 +67,7 @@
#if BUILDFLAG(IS_FUCHSIA)
#include <lib/zx/channel.h>
-#include "components/viz/common/gpu/vulkan_context_provider.h"
+#include "gpu/command_buffer/service/shared_image_backing_factory_ozone.h"
#include "gpu/vulkan/vulkan_device_queue.h"
#include "gpu/vulkan/vulkan_implementation.h"
#endif // BUILDFLAG(IS_FUCHSIA)
@@ -98,6 +101,64 @@ bool ShouldUseExternalVulkanImageFactory() {
#endif
+namespace {
+
+bool ShouldUseOzoneFactory() {
+#if defined(USE_OZONE)
+ return ui::OzonePlatform::GetInstance()
+ ->GetPlatformRuntimeProperties()
+ .supports_native_pixmaps;
+#else
+ return false;
+#endif
+}
+
+enum DmaBufSupportedType {
+ // These values are persisted to logs. Entries should not be renumbered and
+ // numeric values should never be reused.
+ kNoPixmapNoVulkanExtNoGlExt = 0,
+ kNoPixmapNoVulkanExtYesGlExt = 1,
+ kNoPixmapYesVulkanExtNoGlExt = 2,
+ kNoPixmapYesVulkanExtYesGlExt = 3,
+ kYesPixmapNoVulkanExtNoGlExt = 4,
+ kYesPixmapNoVulkanExtYesGlExt = 5,
+ kYesPixmapYesVulkanExtNoGlExt = 6,
+ kYesPixmapYesVulkanExtYesGlExt = 7,
+ kMaxValue = kYesPixmapYesVulkanExtYesGlExt
+};
+
+DmaBufSupportedType GetDmaBufSupportedType(bool pixmap_supported,
+ bool vulkan_ext_supported,
+ bool gl_ext_supported) {
+ if (pixmap_supported) {
+ if (vulkan_ext_supported) {
+ return gl_ext_supported ? kYesPixmapYesVulkanExtYesGlExt
+ : kYesPixmapYesVulkanExtNoGlExt;
+ } else {
+ return gl_ext_supported ? kYesPixmapNoVulkanExtYesGlExt
+ : kYesPixmapNoVulkanExtNoGlExt;
+ }
+ } else {
+ if (vulkan_ext_supported) {
+ return gl_ext_supported ? kNoPixmapYesVulkanExtYesGlExt
+ : kNoPixmapYesVulkanExtNoGlExt;
+ } else {
+ return gl_ext_supported ? kNoPixmapNoVulkanExtYesGlExt
+ : kNoPixmapNoVulkanExtNoGlExt;
+ }
+ }
+}
+
+void ReportDmaBufSupportMetric(bool pixmap_supported,
+ bool vulkan_ext_supported,
+ bool gl_ext_supported) {
+ DmaBufSupportedType type = GetDmaBufSupportedType(
+ pixmap_supported, vulkan_ext_supported, gl_ext_supported);
+ UMA_HISTOGRAM_ENUMERATION("GPU.SharedImage.DmaBufSupportedType", type);
+}
+
+} // namespace
+
// Overrides for flat_set lookups:
bool operator<(
const std::unique_ptr<SharedImageRepresentationFactoryRef>& lhs,
@@ -116,6 +177,8 @@ bool operator<(const std::unique_ptr<SharedImageRepresentationFactoryRef>& lhs,
return lhs->mailbox() < rhs;
}
+bool SharedImageFactory::set_dmabuf_supported_metric_ = false;
+
SharedImageFactory::SharedImageFactory(
const GpuPreferences& gpu_preferences,
const GpuDriverBugWorkarounds& workarounds,
@@ -137,9 +200,31 @@ SharedImageFactory::SharedImageFactory(
#if BUILDFLAG(IS_MAC)
// OSX
DCHECK(gr_context_type_ == GrContextType::kGL ||
- gr_context_type_ == GrContextType::kMetal);
+ gr_context_type_ == GrContextType::kMetal ||
+ gr_context_type_ == GrContextType::kVulkan);
#endif
+ if (!set_dmabuf_supported_metric_) {
+ bool pixmap_supported = ShouldUseOzoneFactory();
+ bool vulkan_ext_supported = false;
+#if BUILDFLAG(ENABLE_VULKAN)
+ if (gr_context_type_ == GrContextType::kVulkan && context_state) {
+ const auto& enabled_extensions = context_state->vk_context_provider()
+ ->GetDeviceQueue()
+ ->enabled_extensions();
+ vulkan_ext_supported =
+ gfx::HasExtension(enabled_extensions,
+ VK_EXT_EXTERNAL_MEMORY_DMA_BUF_EXTENSION_NAME) &&
+ gfx::HasExtension(enabled_extensions,
+ VK_EXT_IMAGE_DRM_FORMAT_MODIFIER_EXTENSION_NAME);
+ }
+#endif
+ bool gl_ext_supported = gl::GLSurfaceEGL::HasEGLExtension("EGL_KHR_image");
+ ReportDmaBufSupportMetric(pixmap_supported, vulkan_ext_supported,
+ gl_ext_supported);
+ set_dmabuf_supported_metric_ = true;
+ }
+
auto shared_memory_backing_factory =
std::make_unique<SharedImageBackingFactorySharedMemory>();
factories_.push_back(std::move(shared_memory_backing_factory));
@@ -251,6 +336,9 @@ SharedImageFactory::SharedImageFactory(
}
#elif BUILDFLAG(IS_FUCHSIA)
if (gr_context_type_ == GrContextType::kVulkan) {
+ auto ozone_factory =
+ std::make_unique<SharedImageBackingFactoryOzone>(context_state);
+ factories_.push_back(std::move(ozone_factory));
auto external_vk_image_factory =
std::make_unique<ExternalVkImageFactory>(context_state);
factories_.push_back(std::move(external_vk_image_factory));
@@ -556,6 +644,8 @@ void SharedImageFactory::RegisterSharedImageBackingFactoryForTesting(
bool SharedImageFactory::IsSharedBetweenThreads(uint32_t usage) {
// Ignore for mipmap usage.
usage &= ~SHARED_IMAGE_USAGE_MIPMAP;
+ // Ignore for delegated compositing.
+ usage &= ~SHARED_IMAGE_USAGE_RASTER_DELEGATED_COMPOSITING;
// Raw Draw backings will be write accessed on the GPU main thread, and
// be read accessed on the compositor thread.
diff --git a/chromium/gpu/command_buffer/service/shared_image_factory.h b/chromium/gpu/command_buffer/service/shared_image_factory.h
index 9195d067e2a..f6e1227ae2a 100644
--- a/chromium/gpu/command_buffer/service/shared_image_factory.h
+++ b/chromium/gpu/command_buffer/service/shared_image_factory.h
@@ -146,6 +146,8 @@ class GPU_GLES2_EXPORT SharedImageFactory {
MailboxManager* mailbox_manager() { return mailbox_manager_; }
+ static bool set_dmabuf_supported_metric_;
+
private:
bool IsSharedBetweenThreads(uint32_t usage);
SharedImageBackingFactory* GetFactoryByUsage(
diff --git a/chromium/gpu/command_buffer/service/shared_image_manager.cc b/chromium/gpu/command_buffer/service/shared_image_manager.cc
index 95255b2c6a4..9e1a68c0957 100644
--- a/chromium/gpu/command_buffer/service/shared_image_manager.cc
+++ b/chromium/gpu/command_buffer/service/shared_image_manager.cc
@@ -12,6 +12,7 @@
#include "base/logging.h"
#include "base/metrics/histogram_macros.h"
#include "base/strings/stringprintf.h"
+#include "base/time/time.h"
#include "base/trace_event/memory_dump_manager.h"
#include "base/trace_event/process_memory_dump.h"
#include "base/trace_event/trace_event.h"
diff --git a/chromium/gpu/command_buffer/service/shared_image_representation.cc b/chromium/gpu/command_buffer/service/shared_image_representation.cc
index 1ac37cdca9c..1b308b544ec 100644
--- a/chromium/gpu/command_buffer/service/shared_image_representation.cc
+++ b/chromium/gpu/command_buffer/service/shared_image_representation.cc
@@ -7,7 +7,9 @@
#include "base/strings/stringprintf.h"
#include "build/build_config.h"
#include "components/viz/common/resources/resource_format_utils.h"
+#include "gpu/command_buffer/service/shared_context_state.h"
#include "gpu/command_buffer/service/texture_manager.h"
+#include "third_party/skia/include/core/SkColorSpace.h"
#include "third_party/skia/include/core/SkPromiseImageTexture.h"
#include "third_party/skia/include/gpu/GrBackendSurfaceMutableState.h"
#include "third_party/skia/include/gpu/GrDirectContext.h"
@@ -179,7 +181,7 @@ SharedImageRepresentationSkia::BeginScopedWriteAccess(
AllowUnclearedAccess allow_uncleared,
bool use_sk_surface) {
return BeginScopedWriteAccess(
- 0 /* final_msaa_count */,
+ /*final_msaa_count=*/1,
SkSurfaceProps(0 /* flags */, kUnknown_SkPixelGeometry), begin_semaphores,
end_semaphores, allow_uncleared, use_sk_surface);
}
@@ -440,12 +442,15 @@ SharedImageRepresentationRaster::BeginScopedReadAccess() {
std::unique_ptr<SharedImageRepresentationRaster::ScopedWriteAccess>
SharedImageRepresentationRaster::BeginScopedWriteAccess(
+ scoped_refptr<SharedContextState> context_state,
int final_msaa_count,
const SkSurfaceProps& surface_props,
- const absl::optional<SkColor>& clear_color) {
+ const absl::optional<SkColor>& clear_color,
+ bool visible) {
return std::make_unique<ScopedWriteAccess>(
base::PassKey<SharedImageRepresentationRaster>(), this,
- BeginWriteAccess(final_msaa_count, surface_props, clear_color));
+ BeginWriteAccess(std::move(context_state), final_msaa_count,
+ surface_props, clear_color, visible));
}
} // namespace gpu
diff --git a/chromium/gpu/command_buffer/service/shared_image_representation.h b/chromium/gpu/command_buffer/service/shared_image_representation.h
index 12d7872ce2f..b4972844818 100644
--- a/chromium/gpu/command_buffer/service/shared_image_representation.h
+++ b/chromium/gpu/command_buffer/service/shared_image_representation.h
@@ -201,6 +201,7 @@ class GPU_GLES2_EXPORT SharedImageRepresentationGLTextureBase
protected:
friend class SharedImageRepresentationSkiaGL;
+ friend class SharedImageRepresentationDawnEGLImage;
friend class SharedImageRepresentationGLTextureImpl;
// Can be overridden to handle clear state tracking when GL access begins or
@@ -650,18 +651,22 @@ class GPU_GLES2_EXPORT SharedImageRepresentationRaster
std::unique_ptr<ScopedReadAccess> BeginScopedReadAccess();
std::unique_ptr<ScopedWriteAccess> BeginScopedWriteAccess(
+ scoped_refptr<SharedContextState> context_state,
int final_msaa_count,
const SkSurfaceProps& surface_props,
- const absl::optional<SkColor>& clear_color);
+ const absl::optional<SkColor>& clear_color,
+ bool visible);
protected:
virtual cc::PaintOpBuffer* BeginReadAccess(
absl::optional<SkColor>& clear_color) = 0;
virtual void EndReadAccess() = 0;
virtual cc::PaintOpBuffer* BeginWriteAccess(
+ scoped_refptr<SharedContextState> context_state,
int final_msaa_count,
const SkSurfaceProps& surface_props,
- const absl::optional<SkColor>& clear_color) = 0;
+ const absl::optional<SkColor>& clear_color,
+ bool visible) = 0;
virtual void EndWriteAccess(base::OnceClosure callback) = 0;
};
diff --git a/chromium/gpu/command_buffer/service/shared_image_representation_dawn_egl_image.cc b/chromium/gpu/command_buffer/service/shared_image_representation_dawn_egl_image.cc
index 31463369436..698543ee836 100644
--- a/chromium/gpu/command_buffer/service/shared_image_representation_dawn_egl_image.cc
+++ b/chromium/gpu/command_buffer/service/shared_image_representation_dawn_egl_image.cc
@@ -5,28 +5,35 @@
#include "gpu/command_buffer/service/shared_image_representation_dawn_egl_image.h"
#include "build/build_config.h"
-#if BUILDFLAG(IS_WIN)
-#include "gpu/command_buffer/service/shared_image_backing_d3d.h"
-#endif
+#include "components/viz/common/resources/resource_format_utils.h"
+#include "gpu/command_buffer/service/texture_manager.h"
#include <dawn/native/OpenGLBackend.h>
+namespace {
+GLenum ToSharedImageAccessGLMode(WGPUTextureUsage usage) {
+ if (usage & (WGPUTextureUsage_CopyDst | WGPUTextureUsage_RenderAttachment |
+ WGPUTextureUsage_StorageBinding | WGPUTextureUsage_Present)) {
+ return GL_SHARED_IMAGE_ACCESS_MODE_READWRITE_CHROMIUM;
+ } else {
+ return GL_SHARED_IMAGE_ACCESS_MODE_READ_CHROMIUM;
+ }
+}
+} // namespace
+
namespace gpu {
SharedImageRepresentationDawnEGLImage::SharedImageRepresentationDawnEGLImage(
+ std::unique_ptr<SharedImageRepresentationGLTextureBase> gl_representation,
SharedImageManager* manager,
SharedImageBacking* backing,
MemoryTypeTracker* tracker,
- WGPUDevice device,
- EGLImage image,
- const WGPUTextureDescriptor& texture_descriptor)
+ WGPUDevice device)
: SharedImageRepresentationDawn(manager, backing, tracker),
+ gl_representation_(std::move(gl_representation)),
device_(device),
- image_(image),
- texture_descriptor_(texture_descriptor),
dawn_procs_(dawn::native::GetProcs()) {
DCHECK(device_);
- DCHECK(image_);
// Keep a reference to the device so that it stays valid.
dawn_procs_.deviceReference(device_);
@@ -41,16 +48,31 @@ SharedImageRepresentationDawnEGLImage::
WGPUTexture SharedImageRepresentationDawnEGLImage::BeginAccess(
WGPUTextureUsage usage) {
-#if BUILDFLAG(IS_WIN)
- // On D3D11 backings, we must acquire the keyed mutex to do interop. If we
- // ever switch to non-D3D backings on Windows, this code will break horribly.
- // TODO(senorblanco): This should probably be a virtual on SharedImageBacking
- // to avoid this cast.
- static_cast<SharedImageBackingD3D*>(backing())->BeginAccessD3D11();
-#endif
+ gl_representation_->BeginAccess(ToSharedImageAccessGLMode(usage));
+ WGPUTextureDescriptor texture_descriptor = {};
+ texture_descriptor.nextInChain = nullptr;
+ texture_descriptor.format = viz::ToWGPUFormat(format());
+ texture_descriptor.usage = WGPUTextureUsage_CopySrc |
+ WGPUTextureUsage_CopyDst |
+ WGPUTextureUsage_RenderAttachment;
+ texture_descriptor.dimension = WGPUTextureDimension_2D;
+ texture_descriptor.size = {static_cast<uint32_t>(size().width()),
+ static_cast<uint32_t>(size().height()), 1};
+ texture_descriptor.mipLevelCount = 1;
+ texture_descriptor.sampleCount = 1;
dawn::native::opengl::ExternalImageDescriptorEGLImage externalImageDesc;
- externalImageDesc.cTextureDescriptor = &texture_descriptor_;
- externalImageDesc.image = image_;
+ externalImageDesc.cTextureDescriptor = &texture_descriptor;
+ const gl::GLImage* image;
+ gpu::TextureBase* texture = gl_representation_->GetTextureBase();
+ if (texture->GetType() == gpu::TextureBase::Type::kPassthrough) {
+ image = static_cast<gles2::TexturePassthrough*>(texture)->GetLevelImage(
+ texture->target(), 0u);
+ } else {
+ image = static_cast<gles2::Texture*>(texture)->GetLevelImage(
+ texture->target(), 0u);
+ }
+ externalImageDesc.image = image->GetEGLImage();
+ DCHECK(externalImageDesc.image);
externalImageDesc.isInitialized = true;
texture_ =
dawn::native::opengl::WrapExternalEGLImage(device_, &externalImageDesc);
@@ -64,11 +86,7 @@ void SharedImageRepresentationDawnEGLImage::EndAccess() {
if (dawn::native::IsTextureSubresourceInitialized(texture_, 0, 1, 0, 1)) {
SetCleared();
}
-#if BUILDFLAG(IS_WIN)
- // TODO(senorblanco): This should probably be a virtual on SharedImageBacking
- // to avoid this cast.
- static_cast<SharedImageBackingD3D*>(backing())->EndAccessD3D11();
-#endif
+ gl_representation_->EndAccess();
// All further operations on the textures are errors (they would be racy
// with other backings).
dawn_procs_.textureDestroy(texture_);
diff --git a/chromium/gpu/command_buffer/service/shared_image_representation_dawn_egl_image.h b/chromium/gpu/command_buffer/service/shared_image_representation_dawn_egl_image.h
index baa82154884..4fda76a582f 100644
--- a/chromium/gpu/command_buffer/service/shared_image_representation_dawn_egl_image.h
+++ b/chromium/gpu/command_buffer/service/shared_image_representation_dawn_egl_image.h
@@ -15,12 +15,11 @@ class GPU_GLES2_EXPORT SharedImageRepresentationDawnEGLImage
: public SharedImageRepresentationDawn {
public:
SharedImageRepresentationDawnEGLImage(
+ std::unique_ptr<SharedImageRepresentationGLTextureBase> gl_representation,
SharedImageManager* manager,
SharedImageBacking* backing,
MemoryTypeTracker* tracker,
- WGPUDevice device,
- EGLImage image,
- const WGPUTextureDescriptor& texture_descriptor);
+ WGPUDevice device);
~SharedImageRepresentationDawnEGLImage() override;
private:
@@ -28,9 +27,8 @@ class GPU_GLES2_EXPORT SharedImageRepresentationDawnEGLImage
void EndAccess() override;
private:
+ std::unique_ptr<SharedImageRepresentationGLTextureBase> gl_representation_;
WGPUDevice device_;
- EGLImage image_;
- WGPUTextureDescriptor texture_descriptor_;
DawnProcTable dawn_procs_;
WGPUTexture texture_ = nullptr;
};
diff --git a/chromium/gpu/command_buffer/service/shared_image_representation_dawn_ozone.cc b/chromium/gpu/command_buffer/service/shared_image_representation_dawn_ozone.cc
index 6e3ddef6b17..e3d2b12e595 100644
--- a/chromium/gpu/command_buffer/service/shared_image_representation_dawn_ozone.cc
+++ b/chromium/gpu/command_buffer/service/shared_image_representation_dawn_ozone.cc
@@ -51,14 +51,28 @@ WGPUTexture SharedImageRepresentationDawnOzone::BeginAccess(
if (texture_) {
return nullptr;
}
+
+ // For multi-planar formats, Mesa is yet to support to allocate and bind
+ // vkmemory for each plane respectively.
+ // https://gitlab.freedesktop.org/mesa/mesa/-/blob/main/src/intel/vulkan/anv_formats.c#L765
+ // For now we assume all plane handles are same, and we don't use the
+ // VK_IMAGE_CREATE_DISJOINT_BIT when creating the vkimage for the pixmap.
+ DCHECK(pixmap_->SupportsZeroCopyWebGPUImport() ||
+ pixmap_->GetNumberOfPlanes() == 1)
+ << "Disjoint Multi-plane importing is not supported.";
+
if (!ozone_backing()->VaSync()) {
return nullptr;
}
- DCHECK(pixmap_->GetNumberOfPlanes() == 1)
- << "Multi-plane formats are not supported.";
std::vector<gfx::GpuFenceHandle> fences;
- ozone_backing()->BeginAccess(&fences);
+ bool need_end_fence;
+ if (!ozone_backing()->BeginAccess(
+ /*readonly=*/false, SharedImageBackingOzone::AccessStream::kWebGPU,
+ &fences, need_end_fence)) {
+ return nullptr;
+ }
+ DCHECK(need_end_fence);
gfx::Size pixmap_size = pixmap_->GetBufferSize();
WGPUTextureDescriptor texture_descriptor = {};
@@ -70,11 +84,12 @@ WGPUTexture SharedImageRepresentationDawnOzone::BeginAccess(
texture_descriptor.mipLevelCount = 1;
texture_descriptor.sampleCount = 1;
- // We need to have an internal usage of CopySrc in order to use
- // CopyTextureToTextureInternal.
+ // We need to have internal usages of CopySrc for copies and
+ // RenderAttachment for clears.
WGPUDawnTextureInternalUsageDescriptor internalDesc = {};
internalDesc.chain.sType = WGPUSType_DawnTextureInternalUsageDescriptor;
- internalDesc.internalUsage = WGPUTextureUsage_CopySrc;
+ internalDesc.internalUsage =
+ WGPUTextureUsage_CopySrc | WGPUTextureUsage_RenderAttachment;
texture_descriptor.nextInChain =
reinterpret_cast<WGPUChainedStruct*>(&internalDesc);
@@ -89,18 +104,20 @@ WGPUTexture SharedImageRepresentationDawnOzone::BeginAccess(
// closed twice (once by ScopedFD and once by the Vulkan implementation).
int fd = dup(pixmap_->GetDmaBufFd(0));
descriptor.memoryFD = fd;
+ // stride is not required for multi-planar formats.
descriptor.stride = pixmap_->GetDmaBufPitch(0);
descriptor.drmModifier = pixmap_->GetBufferFormatModifier();
descriptor.waitFDs = {};
- if (ozone_backing()->NeedsSynchronization()) {
- for (auto& fence : fences) {
- descriptor.waitFDs.push_back(fence.owned_fd.release());
- }
+ for (auto& fence : fences) {
+ descriptor.waitFDs.push_back(fence.owned_fd.release());
}
texture_ = dawn::native::vulkan::WrapVulkanImage(device_, &descriptor);
if (!texture_) {
+ ozone_backing()->EndAccess(/*readonly=*/false,
+ SharedImageBackingOzone::AccessStream::kWebGPU,
+ gfx::GpuFenceHandle());
close(fd);
}
@@ -126,7 +143,9 @@ void SharedImageRepresentationDawnOzone::EndAccess() {
DCHECK(export_info.semaphoreHandles.size() == 1);
gfx::GpuFenceHandle fence;
fence.owned_fd = base::ScopedFD(export_info.semaphoreHandles[0]);
- ozone_backing()->EndAccess(false /* readonly */, std::move(fence));
+ ozone_backing()->EndAccess(/*readonly=*/false,
+ SharedImageBackingOzone::AccessStream::kWebGPU,
+ std::move(fence));
}
dawn_procs_->data.textureDestroy(texture_);
dawn_procs_->data.textureRelease(texture_);
diff --git a/chromium/gpu/command_buffer/service/shared_image_representation_gl_ozone.cc b/chromium/gpu/command_buffer/service/shared_image_representation_gl_ozone.cc
index 37bba64c7a3..1d99a396934 100644
--- a/chromium/gpu/command_buffer/service/shared_image_representation_gl_ozone.cc
+++ b/chromium/gpu/command_buffer/service/shared_image_representation_gl_ozone.cc
@@ -30,20 +30,23 @@
namespace gpu {
bool SharedImageRepresentationGLOzoneShared::BeginAccess(
- SharedImageBackingOzone* ozone_backing) {
+ GLenum mode,
+ SharedImageBackingOzone* ozone_backing,
+ bool& need_end_fence) {
+ bool readonly = mode != GL_SHARED_IMAGE_ACCESS_MODE_READWRITE_CHROMIUM;
std::vector<gfx::GpuFenceHandle> fences;
- ozone_backing->BeginAccess(&fences);
-
- if (ozone_backing->NeedsSynchronization()) {
- // ChromeOS VMs don't support gpu fences, so there is no good way to
- // synchronize with GL.
- if (gl::GLFence::IsGpuFenceSupported()) {
- for (auto& fence : fences) {
- gfx::GpuFence gpu_fence = gfx::GpuFence(std::move(fence));
- std::unique_ptr<gl::GLFence> gl_fence =
- gl::GLFence::CreateFromGpuFence(gpu_fence);
- gl_fence->ServerWait();
- }
+ ozone_backing->BeginAccess(readonly,
+ SharedImageBackingOzone::AccessStream::kGL,
+ &fences, need_end_fence);
+
+ // ChromeOS VMs don't support gpu fences, so there is no good way to
+ // synchronize with GL.
+ if (gl::GLFence::IsGpuFenceSupported()) {
+ for (auto& fence : fences) {
+ gfx::GpuFence gpu_fence = gfx::GpuFence(std::move(fence));
+ std::unique_ptr<gl::GLFence> gl_fence =
+ gl::GLFence::CreateFromGpuFence(gpu_fence);
+ gl_fence->ServerWait();
}
}
@@ -53,20 +56,20 @@ bool SharedImageRepresentationGLOzoneShared::BeginAccess(
}
void SharedImageRepresentationGLOzoneShared::EndAccess(
+ bool need_end_fence,
GLenum mode,
SharedImageBackingOzone* ozone_backing) {
gfx::GpuFenceHandle fence;
- if (ozone_backing->NeedsSynchronization()) {
- // ChromeOS VMs don't support gpu fences, so there is no good way to
- // synchronize with GL.
- if (gl::GLFence::IsGpuFenceSupported()) {
- auto gl_fence = gl::GLFence::CreateForGpuFence();
- DCHECK(gl_fence);
- fence = gl_fence->GetGpuFence()->GetGpuFenceHandle().Clone();
- }
+ // ChromeOS VMs don't support gpu fences, so there is no good way to
+ // synchronize with GL.
+ if (gl::GLFence::IsGpuFenceSupported() && need_end_fence) {
+ auto gl_fence = gl::GLFence::CreateForGpuFence();
+ DCHECK(gl_fence);
+ fence = gl_fence->GetGpuFence()->GetGpuFenceHandle().Clone();
}
bool readonly = mode != GL_SHARED_IMAGE_ACCESS_MODE_READWRITE_CHROMIUM;
- ozone_backing->EndAccess(readonly, std::move(fence));
+ ozone_backing->EndAccess(readonly, SharedImageBackingOzone::AccessStream::kGL,
+ std::move(fence));
}
scoped_refptr<gl::GLImageNativePixmap>
@@ -176,12 +179,13 @@ gles2::Texture* SharedImageRepresentationGLTextureOzone::GetTexture() {
bool SharedImageRepresentationGLTextureOzone::BeginAccess(GLenum mode) {
DCHECK(!current_access_mode_);
current_access_mode_ = mode;
- return SharedImageRepresentationGLOzoneShared::BeginAccess(ozone_backing());
+ return SharedImageRepresentationGLOzoneShared::BeginAccess(
+ current_access_mode_, ozone_backing(), need_end_fence_);
}
void SharedImageRepresentationGLTextureOzone::EndAccess() {
- SharedImageRepresentationGLOzoneShared::EndAccess(current_access_mode_,
- ozone_backing());
+ SharedImageRepresentationGLOzoneShared::EndAccess(
+ need_end_fence_, current_access_mode_, ozone_backing());
current_access_mode_ = 0;
}
@@ -247,12 +251,13 @@ bool SharedImageRepresentationGLTexturePassthroughOzone::BeginAccess(
GLenum mode) {
DCHECK(!current_access_mode_);
current_access_mode_ = mode;
- return SharedImageRepresentationGLOzoneShared::BeginAccess(ozone_backing());
+ return SharedImageRepresentationGLOzoneShared::BeginAccess(
+ current_access_mode_, ozone_backing(), need_end_fence_);
}
void SharedImageRepresentationGLTexturePassthroughOzone::EndAccess() {
- SharedImageRepresentationGLOzoneShared::EndAccess(current_access_mode_,
- ozone_backing());
+ SharedImageRepresentationGLOzoneShared::EndAccess(
+ need_end_fence_, current_access_mode_, ozone_backing());
current_access_mode_ = 0;
}
diff --git a/chromium/gpu/command_buffer/service/shared_image_representation_gl_ozone.h b/chromium/gpu/command_buffer/service/shared_image_representation_gl_ozone.h
index b9d14cb37bc..707e55d2d70 100644
--- a/chromium/gpu/command_buffer/service/shared_image_representation_gl_ozone.h
+++ b/chromium/gpu/command_buffer/service/shared_image_representation_gl_ozone.h
@@ -21,8 +21,12 @@ namespace gpu {
class SharedImageRepresentationGLOzoneShared {
public:
- static bool BeginAccess(SharedImageBackingOzone* ozone_backing);
- static void EndAccess(GLenum mode, SharedImageBackingOzone* ozone_backing);
+ static bool BeginAccess(GLenum mode,
+ SharedImageBackingOzone* ozone_backing,
+ bool& need_end_fence);
+ static void EndAccess(bool need_end_fence,
+ GLenum mode,
+ SharedImageBackingOzone* ozone_backing);
static absl::optional<GLuint> SetupTexture(
scoped_refptr<gl::GLImageNativePixmap> image,
GLenum target);
@@ -67,6 +71,7 @@ class SharedImageRepresentationGLTextureOzone
gles2::Texture* texture_;
GLenum current_access_mode_ = 0;
+ bool need_end_fence_;
};
// Representation of an Ozone-backed SharedImage that can be accessed as a
@@ -106,6 +111,7 @@ class SharedImageRepresentationGLTexturePassthroughOzone
scoped_refptr<gles2::TexturePassthrough> texture_passthrough_;
GLenum current_access_mode_ = 0;
+ bool need_end_fence_;
};
} // namespace gpu
diff --git a/chromium/gpu/command_buffer/service/shared_image_representation_skia_gl.cc b/chromium/gpu/command_buffer/service/shared_image_representation_skia_gl.cc
index cdc45b270b1..ad36b9a6e91 100644
--- a/chromium/gpu/command_buffer/service/shared_image_representation_skia_gl.cc
+++ b/chromium/gpu/command_buffer/service/shared_image_representation_skia_gl.cc
@@ -9,6 +9,7 @@
#include "gpu/command_buffer/service/shared_context_state.h"
#include "gpu/command_buffer/service/skia_utils.h"
#include "gpu/command_buffer/service/texture_manager.h"
+#include "third_party/skia/include/core/SkColorSpace.h"
#include "third_party/skia/include/core/SkPromiseImageTexture.h"
#include "third_party/skia/include/gpu/GrBackendSurface.h"
#include "third_party/skia/include/gpu/GrContextThreadSafeProxy.h"
diff --git a/chromium/gpu/command_buffer/service/shared_image_representation_skia_vk_android.cc b/chromium/gpu/command_buffer/service/shared_image_representation_skia_vk_android.cc
index 4c00d0e2d27..ba8523cdf72 100644
--- a/chromium/gpu/command_buffer/service/shared_image_representation_skia_vk_android.cc
+++ b/chromium/gpu/command_buffer/service/shared_image_representation_skia_vk_android.cc
@@ -23,6 +23,7 @@
#include "gpu/vulkan/vulkan_image.h"
#include "gpu/vulkan/vulkan_implementation.h"
#include "gpu/vulkan/vulkan_util.h"
+#include "third_party/skia/include/core/SkColorSpace.h"
#include "third_party/skia/include/core/SkPromiseImageTexture.h"
#include "third_party/skia/include/gpu/GrBackendSemaphore.h"
#include "third_party/skia/include/gpu/GrBackendSurface.h"
diff --git a/chromium/gpu/command_buffer/service/shared_image_representation_skia_vk_ozone.cc b/chromium/gpu/command_buffer/service/shared_image_representation_skia_vk_ozone.cc
index 0dbbe3bdc7a..5afd70c4708 100644
--- a/chromium/gpu/command_buffer/service/shared_image_representation_skia_vk_ozone.cc
+++ b/chromium/gpu/command_buffer/service/shared_image_representation_skia_vk_ozone.cc
@@ -21,6 +21,7 @@
#include "gpu/vulkan/vulkan_image.h"
#include "gpu/vulkan/vulkan_implementation.h"
#include "gpu/vulkan/vulkan_util.h"
+#include "third_party/skia/include/core/SkColorSpace.h"
#include "third_party/skia/include/core/SkPromiseImageTexture.h"
#include "third_party/skia/include/gpu/GrBackendSemaphore.h"
@@ -74,6 +75,9 @@ sk_sp<SkSurface> SharedImageRepresentationSkiaVkOzone::BeginWriteAccess(
auto* gr_context = context_state_->gr_context();
if (gr_context->abandoned()) {
LOG(ERROR) << "GrContext is abandoned.";
+ ozone_backing()->EndAccess(/*readonly=*/false,
+ SharedImageBackingOzone::AccessStream::kVulkan,
+ gfx::GpuFenceHandle());
return nullptr;
}
@@ -87,6 +91,9 @@ sk_sp<SkSurface> SharedImageRepresentationSkiaVkOzone::BeginWriteAccess(
&surface_props);
if (!surface_) {
LOG(ERROR) << "MakeFromBackendTexture() failed.";
+ ozone_backing()->EndAccess(/*readonly=*/false,
+ SharedImageBackingOzone::AccessStream::kVulkan,
+ gfx::GpuFenceHandle());
return nullptr;
}
surface_msaa_count_ = final_msaa_count;
@@ -164,12 +171,33 @@ bool SharedImageRepresentationSkiaVkOzone::BeginAccess(
DCHECK(begin_semaphores);
DCHECK(end_access_semaphore_ == VK_NULL_HANDLE);
- if (end_semaphores) {
+ std::vector<gfx::GpuFenceHandle> fences;
+ if (!ozone_backing()->BeginAccess(
+ readonly, SharedImageBackingOzone::AccessStream::kVulkan, &fences,
+ need_end_fence_))
+ return false;
+
+ VkDevice device = vk_device();
+ auto* implementation = vk_implementation();
+
+ for (auto& fence : fences) {
+ VkSemaphore vk_semaphore = implementation->ImportSemaphoreHandle(
+ device, SemaphoreHandle(std::move(fence)));
+
+ begin_access_semaphores_.emplace_back(vk_semaphore);
+ begin_semaphores->emplace_back();
+ begin_semaphores->back().initVulkan(vk_semaphore);
+ }
+
+ if (end_semaphores && need_end_fence_) {
end_access_semaphore_ =
vk_implementation()->CreateExternalSemaphore(vk_device());
if (end_access_semaphore_ == VK_NULL_HANDLE) {
DLOG(ERROR) << "Failed to create the external semaphore.";
+ ozone_backing()->EndAccess(readonly,
+ SharedImageBackingOzone::AccessStream::kVulkan,
+ gfx::GpuFenceHandle());
return false;
}
@@ -177,19 +205,6 @@ bool SharedImageRepresentationSkiaVkOzone::BeginAccess(
end_semaphores->back().initVulkan(end_access_semaphore_);
}
- std::vector<gfx::GpuFenceHandle> fences;
- ozone_backing()->BeginAccess(&fences);
-
- for (auto& fence : fences) {
- VkSemaphore vk_semaphore = ExternalSemaphore::CreateFromHandle(
- context_state_->vk_context_provider(),
- SemaphoreHandle(std::move(fence)))
- .GetVkSemaphore();
- begin_access_semaphores_.emplace_back(vk_semaphore);
- begin_semaphores->emplace_back();
- begin_semaphores->back().initVulkan(vk_semaphore);
- }
-
mode_ = readonly ? RepresentationAccessMode::kRead
: RepresentationAccessMode::kWrite;
return true;
@@ -204,9 +219,11 @@ void SharedImageRepresentationSkiaVkOzone::EndAccess(bool readonly) {
DCHECK(!fence.is_null());
}
- ozone_backing()->EndAccess(readonly, std::move(fence));
+ ozone_backing()->EndAccess(readonly,
+ SharedImageBackingOzone::AccessStream::kVulkan,
+ std::move(fence));
- std::vector<VkSemaphore> semaphores = begin_access_semaphores_;
+ std::vector<VkSemaphore> semaphores = std::move(begin_access_semaphores_);
begin_access_semaphores_.clear();
if (end_access_semaphore_ != VK_NULL_HANDLE) {
semaphores.emplace_back(end_access_semaphore_);
@@ -240,6 +257,8 @@ SharedImageRepresentationSkiaVkOzone::GetEndAccessState() {
// create new vkImage each time.
if ((ozone_backing()->usage() & ~kSingleDeviceUsage) ||
ozone_backing()->is_thread_safe()) {
+ DCHECK_NE(vulkan_image_->queue_family_index(), VK_QUEUE_FAMILY_IGNORED);
+
return std::make_unique<GrBackendSurfaceMutableState>(
VK_IMAGE_LAYOUT_UNDEFINED, vulkan_image_->queue_family_index());
}
diff --git a/chromium/gpu/command_buffer/service/shared_image_representation_skia_vk_ozone.h b/chromium/gpu/command_buffer/service/shared_image_representation_skia_vk_ozone.h
index ae64df4089f..bc5ef273e90 100644
--- a/chromium/gpu/command_buffer/service/shared_image_representation_skia_vk_ozone.h
+++ b/chromium/gpu/command_buffer/service/shared_image_representation_skia_vk_ozone.h
@@ -74,6 +74,7 @@ class SharedImageRepresentationSkiaVkOzone
scoped_refptr<SharedContextState> context_state_;
std::vector<VkSemaphore> begin_access_semaphores_;
VkSemaphore end_access_semaphore_ = VK_NULL_HANDLE;
+ bool need_end_fence_;
};
} // namespace gpu
diff --git a/chromium/gpu/command_buffer/service/shared_image_test_utils.cc b/chromium/gpu/command_buffer/service/shared_image_test_utils.cc
index a19b15ab07d..d586390d2af 100644
--- a/chromium/gpu/command_buffer/service/shared_image_test_utils.cc
+++ b/chromium/gpu/command_buffer/service/shared_image_test_utils.cc
@@ -8,6 +8,7 @@
#include "gpu/command_buffer/service/shared_context_state.h"
#include "gpu/command_buffer/service/shared_image_factory.h"
#include "testing/gtest/include/gtest/gtest.h"
+#include "third_party/skia/include/core/SkColorSpace.h"
#include "third_party/skia/include/core/SkPromiseImageTexture.h"
#include "third_party/skia/include/gpu/GrBackendSemaphore.h"
#include "ui/gfx/geometry/size.h"
diff --git a/chromium/gpu/command_buffer/service/shared_image_video.cc b/chromium/gpu/command_buffer/service/shared_image_video.cc
index a1fc7389b02..5313809e617 100644
--- a/chromium/gpu/command_buffer/service/shared_image_video.cc
+++ b/chromium/gpu/command_buffer/service/shared_image_video.cc
@@ -69,22 +69,20 @@ std::unique_ptr<SharedImageVideo> SharedImageVideo::Create(
// Static.
absl::optional<VulkanYCbCrInfo> SharedImageVideo::GetYcbcrInfo(
TextureOwner* texture_owner,
- scoped_refptr<SharedContextState> context_state) {
- // For non-vulkan context, return null.
- if (!context_state->GrContextIsVulkan())
+ viz::VulkanContextProvider* vulkan_context_provider) {
+ if (!vulkan_context_provider)
return absl::nullopt;
// Get AHardwareBuffer from the latest frame.
auto scoped_hardware_buffer = texture_owner->GetAHardwareBuffer();
- if (!scoped_hardware_buffer) {
+ if (!scoped_hardware_buffer)
return absl::nullopt;
- }
DCHECK(scoped_hardware_buffer->buffer());
- auto* context_provider = context_state->vk_context_provider();
VulkanImplementation* vk_implementation =
- context_provider->GetVulkanImplementation();
- VkDevice vk_device = context_provider->GetDeviceQueue()->GetVulkanDevice();
+ vulkan_context_provider->GetVulkanImplementation();
+ VkDevice vk_device =
+ vulkan_context_provider->GetDeviceQueue()->GetVulkanDevice();
VulkanYCbCrInfo ycbcr_info;
if (!vk_implementation->GetSamplerYcbcrConversionInfo(
diff --git a/chromium/gpu/command_buffer/service/shared_image_video.h b/chromium/gpu/command_buffer/service/shared_image_video.h
index 5287f622642..b3ea069e3de 100644
--- a/chromium/gpu/command_buffer/service/shared_image_video.h
+++ b/chromium/gpu/command_buffer/service/shared_image_video.h
@@ -12,6 +12,10 @@
#include "gpu/ipc/common/vulkan_ycbcr_info.h"
#include "third_party/abseil-cpp/absl/types/optional.h"
+namespace viz {
+class VulkanContextProvider;
+} // namespace viz
+
namespace gpu {
struct Mailbox;
struct VulkanYCbCrInfo;
@@ -42,7 +46,7 @@ class GPU_GLES2_EXPORT SharedImageVideo : public SharedImageBackingAndroid {
// nullopt for other context.
static absl::optional<VulkanYCbCrInfo> GetYcbcrInfo(
TextureOwner* texture_owner,
- scoped_refptr<SharedContextState> context_state);
+ viz::VulkanContextProvider* vulkan_context_provider);
~SharedImageVideo() override;
diff --git a/chromium/gpu/command_buffer/service/shared_image_video_image_reader.cc b/chromium/gpu/command_buffer/service/shared_image_video_image_reader.cc
index 5054bc5a23e..f5bf02a313f 100644
--- a/chromium/gpu/command_buffer/service/shared_image_video_image_reader.cc
+++ b/chromium/gpu/command_buffer/service/shared_image_video_image_reader.cc
@@ -226,6 +226,7 @@ class SharedImageVideoImageReader::SharedImageRepresentationGLTextureVideo
base::ScopedFD sync_fd = CreateEglFenceAndExportFd();
scoped_hardware_buffer_->SetReadFence(std::move(sync_fd), true);
+ base::AutoLockMaybe auto_lock(GetDrDcLockPtr());
scoped_hardware_buffer_ = nullptr;
}
@@ -294,6 +295,7 @@ class SharedImageVideoImageReader::
base::ScopedFD sync_fd = CreateEglFenceAndExportFd();
scoped_hardware_buffer_->SetReadFence(std::move(sync_fd), true);
+ base::AutoLockMaybe auto_lock(GetDrDcLockPtr());
scoped_hardware_buffer_ = nullptr;
}
@@ -542,14 +544,6 @@ class SharedImageVideoImageReader::SharedImageRepresentationOverlayVideo
}
void EndReadAccess(gfx::GpuFenceHandle release_fence) override {
- // Note that we dont need to hold onto DrDc lock here. If we add DrDc lock
- // here then there could be a situation where
- // FrameInfoHelper::GetFrameInfo() can hold DrDc lock from gpu main thread
- // while waiting for the buffer to be available and EndReadAccess could
- // wait on the same lock here from drdc thread, resulting in buffer not
- // being released and hence deadlock.
- // crbug.com/1262990 for more details.
-
if (gl_image_) {
DCHECK(release_fence.is_null());
if (scoped_hardware_buffer_) {
@@ -561,6 +555,8 @@ class SharedImageVideoImageReader::SharedImageRepresentationOverlayVideo
scoped_hardware_buffer_->SetReadFence(std::move(release_fence.owned_fd),
true);
}
+
+ base::AutoLockMaybe auto_lock(GetDrDcLockPtr());
scoped_hardware_buffer_.reset();
}
diff --git a/chromium/gpu/command_buffer/service/surface_texture_gl_owner_unittest.cc b/chromium/gpu/command_buffer/service/surface_texture_gl_owner_unittest.cc
index de50e0e5005..5ddb2fa5c8f 100644
--- a/chromium/gpu/command_buffer/service/surface_texture_gl_owner_unittest.cc
+++ b/chromium/gpu/command_buffer/service/surface_texture_gl_owner_unittest.cc
@@ -39,7 +39,11 @@ class SurfaceTextureGLOwnerTest : public testing::Test {
void SetUp() override {
gl::init::InitializeStaticGLBindingsImplementation(
gl::GLImplementationParts(gl::kGLImplementationEGLGLES2), false);
- gl::init::InitializeGLOneOffPlatformImplementation(false, false, true);
+ gl::init::InitializeGLOneOffPlatformImplementation(
+ /*fallback_to_software_gl=*/false,
+ /*disable_gl_drawing=*/false,
+ /*init_extensions=*/true,
+ /*system_device_id=*/0);
surface_ = new gl::PbufferGLSurfaceEGL(gfx::Size(320, 240));
surface_->Initialize();
diff --git a/chromium/gpu/command_buffer/service/sync_point_manager.cc b/chromium/gpu/command_buffer/service/sync_point_manager.cc
index f022b7ee3c2..1f8c8fe89e4 100644
--- a/chromium/gpu/command_buffer/service/sync_point_manager.cc
+++ b/chromium/gpu/command_buffer/service/sync_point_manager.cc
@@ -9,7 +9,6 @@
#include <stdint.h>
#include "base/bind.h"
-#include "base/cxx17_backports.h"
#include "base/location.h"
#include "base/logging.h"
#include "base/memory/ref_counted.h"
@@ -370,8 +369,7 @@ SyncPointManager::CreateSyncPointClientState(
{
base::AutoLock auto_lock(lock_);
DCHECK_GE(namespace_id, 0);
- DCHECK_LT(static_cast<size_t>(namespace_id),
- base::size(client_state_maps_));
+ DCHECK_LT(static_cast<size_t>(namespace_id), std::size(client_state_maps_));
DCHECK(!client_state_maps_[namespace_id].count(command_buffer_id));
client_state_maps_[namespace_id].insert(
std::make_pair(command_buffer_id, client_state));
@@ -385,7 +383,7 @@ void SyncPointManager::DestroyedSyncPointClientState(
CommandBufferId command_buffer_id) {
base::AutoLock auto_lock(lock_);
DCHECK_GE(namespace_id, 0);
- DCHECK_LT(static_cast<size_t>(namespace_id), base::size(client_state_maps_));
+ DCHECK_LT(static_cast<size_t>(namespace_id), std::size(client_state_maps_));
DCHECK(client_state_maps_[namespace_id].count(command_buffer_id));
client_state_maps_[namespace_id].erase(command_buffer_id);
}
@@ -475,8 +473,7 @@ scoped_refptr<SyncPointClientState> SyncPointManager::GetSyncPointClientState(
CommandBufferNamespace namespace_id,
CommandBufferId command_buffer_id) {
if (namespace_id >= 0) {
- DCHECK_LT(static_cast<size_t>(namespace_id),
- base::size(client_state_maps_));
+ DCHECK_LT(static_cast<size_t>(namespace_id), std::size(client_state_maps_));
base::AutoLock auto_lock(lock_);
ClientStateMap& client_state_map = client_state_maps_[namespace_id];
auto it = client_state_map.find(command_buffer_id);
diff --git a/chromium/gpu/command_buffer/service/test_helper.cc b/chromium/gpu/command_buffer/service/test_helper.cc
index 1f86e16c92c..b7566dc204c 100644
--- a/chromium/gpu/command_buffer/service/test_helper.cc
+++ b/chromium/gpu/command_buffer/service/test_helper.cc
@@ -10,7 +10,6 @@
#include <algorithm>
#include <string>
-#include "base/cxx17_backports.h"
#include "base/strings/string_number_conversions.h"
#include "build/build_config.h"
#include "gpu/command_buffer/service/buffer_manager.h"
@@ -176,7 +175,7 @@ void TestHelper::SetupTextureInitializationExpectations(
GL_TEXTURE_CUBE_MAP_POSITIVE_Z,
GL_TEXTURE_CUBE_MAP_NEGATIVE_Z,
};
- for (size_t face = 0; face < base::size(faces); ++face) {
+ for (size_t face = 0; face < std::size(faces); ++face) {
EXPECT_CALL(*gl, TexImage2D(faces[face], 0, GL_RGBA, 1, 1, 0, GL_RGBA,
GL_UNSIGNED_BYTE, _))
.Times(1)
diff --git a/chromium/gpu/command_buffer/service/texture_manager.cc b/chromium/gpu/command_buffer/service/texture_manager.cc
index 8985b7c7425..b20b875b6b3 100644
--- a/chromium/gpu/command_buffer/service/texture_manager.cc
+++ b/chromium/gpu/command_buffer/service/texture_manager.cc
@@ -13,7 +13,6 @@
#include <utility>
#include "base/bits.h"
-#include "base/cxx17_backports.h"
#include "base/format_macros.h"
#include "base/lazy_instance.h"
#include "base/memory/raw_ptr.h"
@@ -262,11 +261,11 @@ class FormatTypeValidator {
{GL_RG, GL_RG, GL_HALF_FLOAT_OES},
};
- for (size_t ii = 0; ii < base::size(kSupportedFormatTypes); ++ii) {
+ for (size_t ii = 0; ii < std::size(kSupportedFormatTypes); ++ii) {
supported_combinations_.insert(kSupportedFormatTypes[ii]);
}
- for (size_t ii = 0; ii < base::size(kSupportedFormatTypesES2Only); ++ii) {
+ for (size_t ii = 0; ii < std::size(kSupportedFormatTypesES2Only); ++ii) {
supported_combinations_es2_only_.insert(kSupportedFormatTypesES2Only[ii]);
}
}
@@ -316,7 +315,7 @@ static const Texture::CompatibilitySwizzle kSwizzledFormats[] = {
const Texture::CompatibilitySwizzle* GetCompatibilitySwizzleInternal(
GLenum format) {
- size_t count = base::size(kSwizzledFormats);
+ size_t count = std::size(kSwizzledFormats);
for (size_t i = 0; i < count; ++i) {
if (kSwizzledFormats[i].format == format)
return &kSwizzledFormats[i];
@@ -500,7 +499,7 @@ void TextureManager::Destroy() {
}
if (have_context_) {
- glDeleteTextures(base::size(black_texture_ids_), black_texture_ids_);
+ glDeleteTextures(std::size(black_texture_ids_), black_texture_ids_);
}
DCHECK_EQ(0u, memory_type_tracker_->GetMemRepresented());
diff --git a/chromium/gpu/command_buffer/service/texture_manager.h b/chromium/gpu/command_buffer/service/texture_manager.h
index e4b2dbf47b5..c78c914cbad 100644
--- a/chromium/gpu/command_buffer/service/texture_manager.h
+++ b/chromium/gpu/command_buffer/service/texture_manager.h
@@ -19,6 +19,7 @@
#include "base/memory/raw_ptr.h"
#include "base/memory/ref_counted.h"
#include "base/memory/weak_ptr.h"
+#include "base/notreached.h"
#include "gpu/command_buffer/service/feature_info.h"
#include "gpu/command_buffer/service/gl_utils.h"
#include "gpu/command_buffer/service/memory_tracking.h"
diff --git a/chromium/gpu/command_buffer/service/texture_owner.cc b/chromium/gpu/command_buffer/service/texture_owner.cc
index 9b69860eea1..8dea494309b 100644
--- a/chromium/gpu/command_buffer/service/texture_owner.cc
+++ b/chromium/gpu/command_buffer/service/texture_owner.cc
@@ -67,15 +67,18 @@ TextureOwner::~TextureOwner() {
scoped_refptr<TextureOwner> TextureOwner::Create(
std::unique_ptr<gles2::AbstractTexture> texture,
Mode mode,
- scoped_refptr<SharedContextState> context_state) {
+ scoped_refptr<SharedContextState> context_state,
+ scoped_refptr<RefCountedLock> drdc_lock) {
switch (mode) {
case Mode::kAImageReaderInsecure:
case Mode::kAImageReaderInsecureMultithreaded:
case Mode::kAImageReaderInsecureSurfaceControl:
case Mode::kAImageReaderSecureSurfaceControl:
return new ImageReaderGLOwner(std::move(texture), mode,
- std::move(context_state));
+ std::move(context_state),
+ std::move(drdc_lock));
case Mode::kSurfaceTextureInsecure:
+ DCHECK(!drdc_lock);
return new SurfaceTextureGLOwner(std::move(texture),
std::move(context_state));
}
diff --git a/chromium/gpu/command_buffer/service/texture_owner.h b/chromium/gpu/command_buffer/service/texture_owner.h
index 509944efc17..568c57e1f39 100644
--- a/chromium/gpu/command_buffer/service/texture_owner.h
+++ b/chromium/gpu/command_buffer/service/texture_owner.h
@@ -10,6 +10,7 @@
#include "base/memory/ref_counted.h"
#include "base/memory/ref_counted_delete_on_sequence.h"
#include "base/task/single_thread_task_runner.h"
+#include "gpu/command_buffer/service/ref_counted_lock.h"
#include "gpu/command_buffer/service/shared_context_state.h"
#include "gpu/gpu_gles2_export.h"
#include "ui/gl/android/scoped_java_surface.h"
@@ -64,7 +65,8 @@ class GPU_GLES2_EXPORT TextureOwner
static scoped_refptr<TextureOwner> Create(
std::unique_ptr<gles2::AbstractTexture> texture,
Mode mode,
- scoped_refptr<SharedContextState> context_state);
+ scoped_refptr<SharedContextState> context_state,
+ scoped_refptr<RefCountedLock> drdc_lock = nullptr);
TextureOwner(const TextureOwner&) = delete;
TextureOwner& operator=(const TextureOwner&) = delete;
diff --git a/chromium/gpu/command_buffer/service/webgpu_cmd_validation_implementation_autogen.h b/chromium/gpu/command_buffer/service/webgpu_cmd_validation_implementation_autogen.h
index 756d10ee280..3f4a73809c3 100644
--- a/chromium/gpu/command_buffer/service/webgpu_cmd_validation_implementation_autogen.h
+++ b/chromium/gpu/command_buffer/service/webgpu_cmd_validation_implementation_autogen.h
@@ -24,8 +24,8 @@ static const PowerPreference valid_power_preference_table[] = {
Validators::Validators()
: mailbox_flags(valid_mailbox_flags_table,
- base::size(valid_mailbox_flags_table)),
+ std::size(valid_mailbox_flags_table)),
power_preference(valid_power_preference_table,
- base::size(valid_power_preference_table)) {}
+ std::size(valid_power_preference_table)) {}
#endif // GPU_COMMAND_BUFFER_SERVICE_WEBGPU_CMD_VALIDATION_IMPLEMENTATION_AUTOGEN_H_
diff --git a/chromium/gpu/command_buffer/service/webgpu_decoder.h b/chromium/gpu/command_buffer/service/webgpu_decoder.h
index 2761be0356d..8e994ccb1a4 100644
--- a/chromium/gpu/command_buffer/service/webgpu_decoder.h
+++ b/chromium/gpu/command_buffer/service/webgpu_decoder.h
@@ -12,6 +12,7 @@
namespace gpu {
class DecoderClient;
+struct GpuFeatureInfo;
struct GpuPreferences;
class MemoryTracker;
class SharedContextState;
@@ -42,7 +43,7 @@ class GPU_GLES2_EXPORT WebGPUDecoder : public DecoderContext,
// WebGPU-specific initialization that's different than DecoderContext's
// Initialize that is tied to GLES2 concepts and a noop for WebGPU decoders.
- virtual ContextResult Initialize() = 0;
+ virtual ContextResult Initialize(const GpuFeatureInfo& gpu_feature_info) = 0;
ContextResult Initialize(const scoped_refptr<gl::GLSurface>& surface,
const scoped_refptr<gl::GLContext>& context,
diff --git a/chromium/gpu/command_buffer/service/webgpu_decoder_impl.cc b/chromium/gpu/command_buffer/service/webgpu_decoder_impl.cc
index 126c04fce18..9762f5aeada 100644
--- a/chromium/gpu/command_buffer/service/webgpu_decoder_impl.cc
+++ b/chromium/gpu/command_buffer/service/webgpu_decoder_impl.cc
@@ -17,6 +17,7 @@
#include "base/bits.h"
#include "base/files/file_path.h"
#include "base/logging.h"
+#include "base/memory/ptr_util.h"
#include "base/memory/raw_ptr.h"
#include "base/numerics/checked_math.h"
#include "base/path_service.h"
@@ -37,6 +38,7 @@
#include "gpu/command_buffer/service/webgpu_decoder.h"
#include "gpu/config/gpu_preferences.h"
#include "ipc/ipc_channel.h"
+#include "third_party/skia/include/core/SkPromiseImageTexture.h"
#include "third_party/skia/include/gpu/GrBackendSemaphore.h"
#include "ui/gl/gl_context_egl.h"
#include "ui/gl/gl_surface_egl.h"
@@ -66,10 +68,10 @@ constexpr size_t kDawnReturnCmdsOffset =
static_assert(kDawnReturnCmdsOffset < kMaxWireBufferSize, "");
-// TODO(crbug.com/1266549): Support Storage usage
static constexpr uint32_t kAllowedWritableMailboxTextureUsages =
static_cast<uint32_t>(WGPUTextureUsage_CopyDst |
- WGPUTextureUsage_RenderAttachment);
+ WGPUTextureUsage_RenderAttachment |
+ WGPUTextureUsage_StorageBinding);
static constexpr uint32_t kAllowedReadableMailboxTextureUsages =
static_cast<uint32_t>(WGPUTextureUsage_CopySrc |
@@ -184,7 +186,7 @@ class WebGPUDecoderImpl final : public WebGPUDecoder {
~WebGPUDecoderImpl() override;
// WebGPUDecoder implementation
- ContextResult Initialize() override;
+ ContextResult Initialize(const GpuFeatureInfo& gpu_feature_info) override;
// DecoderContext implementation.
base::WeakPtr<DecoderContext> AsWeakPtr() override {
@@ -531,6 +533,7 @@ class WebGPUDecoderImpl final : public WebGPUDecoder {
case viz::ResourceFormat::RGBA_8888:
#endif // !BUILDFLAG(IS_MAC)
case viz::ResourceFormat::BGRA_8888:
+ case viz::ResourceFormat::RGBA_F16:
break;
default:
return nullptr;
@@ -691,6 +694,17 @@ class WebGPUDecoderImpl final : public WebGPUDecoder {
// Unmap the buffer.
procs_.bufferUnmap(buffer);
+ // Transition the image back to the desired end state. This is used for
+ // transitioning the image to the external queue for Vulkan/GL interop.
+ if (scoped_read_access->end_state()) {
+ if (!shared_context_state_->gr_context()->setBackendTextureState(
+ scoped_read_access->promise_image_texture()->backendTexture(),
+ *scoped_read_access->end_state())) {
+ DLOG(ERROR) << "setBackendTextureState() failed.";
+ return false;
+ }
+ }
+
// ReadPixels finished; signal the semaphores.
SignalSemaphores(std::move(end_semaphores));
@@ -832,6 +846,16 @@ class WebGPUDecoderImpl final : public WebGPUDecoder {
/*x*/ 0, /*y*/ 0);
procs_.bufferRelease(buffer);
+
+ // Transition the image back to the desired end state. This is used for
+ // transitioning the image to the external queue for Vulkan/GL interop.
+ if (scoped_write_access->end_state()) {
+ // It's ok to pass in empty GrFlushInfo here since SignalSemaphores()
+ // will populate it with semaphores and call GrDirectContext::flush.
+ scoped_write_access->surface()->flush(/*info=*/{},
+ scoped_write_access->end_state());
+ }
+
SignalSemaphores(std::move(end_semaphores));
return true;
@@ -1008,7 +1032,13 @@ void WebGPUDecoderImpl::Destroy(bool have_context) {
destroyed_ = true;
}
-ContextResult WebGPUDecoderImpl::Initialize() {
+ContextResult WebGPUDecoderImpl::Initialize(
+ const GpuFeatureInfo& gpu_feature_info) {
+ if (kGpuFeatureStatusSoftware ==
+ gpu_feature_info.status_values[GPU_FEATURE_TYPE_ACCELERATED_WEBGPU]) {
+ use_webgpu_adapter_ = WebGPUAdapterName::kSwiftShader;
+ }
+
if (use_webgpu_adapter_ == WebGPUAdapterName::kCompat) {
gl_surface_ = new gl::SurfacelessEGL(gfx::Size(1, 1));
gl::GLContextAttribs attribs;
@@ -1033,7 +1063,7 @@ error::Error WebGPUDecoderImpl::DoRequestDevice(
return error::kOutOfBounds;
}
- WGPUDeviceDescriptor device_descriptor;
+ WGPUDeviceDescriptor device_descriptor = {};
// We need to request internal usage to be able to do operations with internal
// methods that would need specific usages.
@@ -1060,16 +1090,31 @@ error::Error WebGPUDecoderImpl::DoRequestDevice(
if (request_device_properties.depthClamping) {
required_features.push_back(WGPUFeatureName_DepthClamping);
}
+ if (request_device_properties.depth24UnormStencil8) {
+ required_features.push_back(WGPUFeatureName_Depth24UnormStencil8);
+ }
+ if (request_device_properties.depth32FloatStencil8) {
+ required_features.push_back(WGPUFeatureName_Depth32FloatStencil8);
+ }
if (request_device_properties.invalidFeature) {
// Pass something invalid.
required_features.push_back(static_cast<WGPUFeatureName>(-1));
}
+
+ // Always enable "multi-planar-formats" as long as available.
+ if (dawn_adapters_[requested_adapter_index]
+ .GetAdapterProperties()
+ .multiPlanarFormats) {
+ required_features.push_back(WGPUFeatureName_DawnMultiPlanarFormats);
+ }
+
device_descriptor.requiredFeatures = required_features.data();
device_descriptor.requiredFeaturesCount = required_features.size();
// If a new toggle is added here, ForceDawnTogglesForWebGPU() which collects
// info for about:gpu should be updated as well.
WGPUDawnTogglesDeviceDescriptor dawn_toggles;
+ dawn_toggles.chain.next = nullptr;
std::vector<const char*> force_enabled_toggles;
std::vector<const char*> force_disabled_toggles;
@@ -1365,7 +1410,7 @@ error::Error WebGPUDecoderImpl::DoCommands(unsigned int num_commands,
const unsigned int arg_count = size - 1;
unsigned int command_index = command - kFirstWebGPUCommand;
- if (command_index < base::size(command_info)) {
+ if (command_index < std::size(command_info)) {
// Prevent all further WebGPU commands from being processed if the server
// is destroyed.
if (destroyed_) {
@@ -1500,7 +1545,8 @@ error::Error WebGPUDecoderImpl::HandleRequestAdapter(
force_fallback_adapter = true;
}
- if (gr_context_type_ != GrContextType::kVulkan) {
+ if (gr_context_type_ != GrContextType::kVulkan &&
+ use_webgpu_adapter_ != WebGPUAdapterName::kCompat) {
#if BUILDFLAG(IS_LINUX)
SendAdapterProperties(request_adapter_serial, -1, nullptr,
"WebGPU on Linux requires command-line flag "
@@ -1631,6 +1677,14 @@ WebGPUDecoderImpl::AssociateMailboxDawn(const Mailbox& mailbox,
return nullptr;
}
+#if !BUILDFLAG(IS_WIN)
+ if (usage & WGPUTextureUsage_StorageBinding) {
+ DLOG(ERROR) << "AssociateMailbox: WGPUTextureUsage_StorageBinding is NOT "
+ "supported yet.";
+ return nullptr;
+ }
+#endif
+
if (flags & WEBGPU_MAILBOX_DISCARD) {
// Set contents to uncleared.
shared_image->SetClearedRect(gfx::Rect());
@@ -1807,8 +1861,15 @@ error::Error WebGPUDecoderImpl::HandleDissociateMailboxForPresent(
render_pass_descriptor.colorAttachmentCount = 1;
render_pass_descriptor.colorAttachments = &color_attachment;
+ WGPUDawnEncoderInternalUsageDescriptor internal_usage_desc = {
+ .chain = {.sType = WGPUSType_DawnEncoderInternalUsageDescriptor},
+ .useInternalUsages = true,
+ };
+ WGPUCommandEncoderDescriptor command_encoder_desc = {
+ .nextInChain = &internal_usage_desc.chain,
+ };
WGPUCommandEncoder encoder =
- procs.deviceCreateCommandEncoder(device, nullptr);
+ procs.deviceCreateCommandEncoder(device, &command_encoder_desc);
WGPURenderPassEncoder pass =
procs.commandEncoderBeginRenderPass(encoder, &render_pass_descriptor);
procs.renderPassEncoderEndPass(pass);
diff --git a/chromium/gpu/command_buffer/service/webgpu_decoder_unittest.cc b/chromium/gpu/command_buffer/service/webgpu_decoder_unittest.cc
index 6f77250c320..b7fd515df44 100644
--- a/chromium/gpu/command_buffer/service/webgpu_decoder_unittest.cc
+++ b/chromium/gpu/command_buffer/service/webgpu_decoder_unittest.cc
@@ -37,7 +37,7 @@ class WebGPUDecoderTest : public ::testing::Test {
decoder_.reset(WebGPUDecoder::Create(
decoder_client_.get(), command_buffer_service_.get(), nullptr, nullptr,
&outputter_, GpuPreferences(), nullptr));
- ASSERT_EQ(decoder_->Initialize(), ContextResult::kSuccess);
+ ASSERT_EQ(decoder_->Initialize(GpuFeatureInfo()), ContextResult::kSuccess);
constexpr uint32_t kAdapterClientID = 0;
cmds::RequestAdapter requestAdapterCmd;
diff --git a/chromium/gpu/command_buffer/service/wrapped_sk_image.cc b/chromium/gpu/command_buffer/service/wrapped_sk_image.cc
index 5944ca5c53b..140b85eb6fd 100644
--- a/chromium/gpu/command_buffer/service/wrapped_sk_image.cc
+++ b/chromium/gpu/command_buffer/service/wrapped_sk_image.cc
@@ -32,6 +32,7 @@
#include "gpu/config/gpu_finch_features.h"
#include "skia/buildflags.h"
#include "third_party/skia/include/core/SkCanvas.h"
+#include "third_party/skia/include/core/SkColorSpace.h"
#include "third_party/skia/include/core/SkPromiseImageTexture.h"
#include "third_party/skia/include/core/SkSurface.h"
#include "third_party/skia/include/core/SkSurfaceProps.h"
@@ -165,6 +166,7 @@ class WrappedSkImage : public ClearTrackingSharedImageBacking {
SkImageInfo info = MakeSkImageInfo(size(), format());
SkPixmap pixmap(info, shared_memory_wrapper_.GetMemory(),
shared_memory_wrapper_.GetStride());
+
if (!context_state_->gr_context()->updateBackendTexture(
backend_texture_, &pixmap, /*numLevels=*/1, nullptr, nullptr)) {
DLOG(ERROR) << "Failed to update WrappedSkImage texture";
@@ -337,6 +339,21 @@ class WrappedSkImage : public ClearTrackingSharedImageBacking {
promise_texture_ = SkPromiseImageTexture::Make(backend_texture_);
tracing_id_ = GrBackendTextureTracingID(backend_texture_);
+ // Note that if the backing is meant to be thread safe (when DrDc and Vulkan
+ // is enabled), we need to do additional submit here in order to send the
+ // gpu commands in the correct order as per sync token dependencies. For eg
+ // tapping a tab tile creates a WrappedSkImage mailbox with the the pixel
+ // data in LayerTreeHostImpl::CreateUIResource() which was showing corrupt
+ // data without this added synchronization.
+ if (is_thread_safe()) {
+ auto* gr_context = context_state_->gr_context();
+ // Note that all skia calls to GrBackendTexture does not require any
+ // flush() since the commands are already recorded by skia into the
+ // command buffer. Hence only calling submit here since pushing data to a
+ // texture will require sending commands to gpu.
+ gr_context->submit();
+ }
+
return true;
}
diff --git a/chromium/gpu/config/BUILD.gn b/chromium/gpu/config/BUILD.gn
index 51562fdd8dd..ea8dc139926 100644
--- a/chromium/gpu/config/BUILD.gn
+++ b/chromium/gpu/config/BUILD.gn
@@ -239,7 +239,7 @@ source_set("config_sources") {
if (is_linux || is_chromeos) {
sources += [ "gpu_info_collector_linux.cc" ]
}
- if (is_linux || is_chromeos || is_mac) {
+ if (is_linux || is_chromeos || is_mac || is_fuchsia) {
deps += [ "//third_party/angle:angle_gpu_info_util" ]
}
if (use_ozone) {
diff --git a/chromium/gpu/config/gpu_blocklist.cc b/chromium/gpu/config/gpu_blocklist.cc
index 35e1ff3b4bb..9efcafda64c 100644
--- a/chromium/gpu/config/gpu_blocklist.cc
+++ b/chromium/gpu/config/gpu_blocklist.cc
@@ -44,6 +44,8 @@ std::unique_ptr<GpuBlocklist> GpuBlocklist::Create(
list->AddSupportedFeature("vulkan", GPU_FEATURE_TYPE_VULKAN);
list->AddSupportedFeature("canvas_oop_rasterization",
GPU_FEATURE_TYPE_CANVAS_OOP_RASTERIZATION);
+ list->AddSupportedFeature("accelerated_webgpu",
+ GPU_FEATURE_TYPE_ACCELERATED_WEBGPU);
return list;
}
diff --git a/chromium/gpu/config/gpu_blocklist_unittest.cc b/chromium/gpu/config/gpu_blocklist_unittest.cc
index c0bae6bd2b3..aaf8b712f80 100644
--- a/chromium/gpu/config/gpu_blocklist_unittest.cc
+++ b/chromium/gpu/config/gpu_blocklist_unittest.cc
@@ -101,6 +101,9 @@ GPU_BLOCKLIST_FEATURE_TEST(GL, GPU_FEATURE_TYPE_ACCELERATED_GL)
GPU_BLOCKLIST_FEATURE_TEST(Vulkan, GPU_FEATURE_TYPE_VULKAN)
+GPU_BLOCKLIST_FEATURE_TEST(AcceleratedWebGPU,
+ GPU_FEATURE_TYPE_ACCELERATED_WEBGPU)
+
// Test for invariant "Assume the newly last added entry has the largest ID".
// See GpuControlList::GpuControlList.
// It checks software_rendering_list.json
diff --git a/chromium/gpu/config/gpu_control_list.cc b/chromium/gpu/config/gpu_control_list.cc
index 12b263e1733..f3d5845509d 100644
--- a/chromium/gpu/config/gpu_control_list.cc
+++ b/chromium/gpu/config/gpu_control_list.cc
@@ -146,21 +146,6 @@ bool GpuControlList::Version::Contains(const std::string& version_string,
if (op == kBetween)
ref_version2.erase(ref_version2.begin());
}
-
- // No comparison should be run if two being-compared versions do not match
- // Intel driver version schema.
- if (Version::Compare({version[0]}, {"100"}, style) >= 0) {
- if ((Version::Compare({ref_version1[0]}, {"100"}, style) < 0) ||
- (op == kBetween
- ? Version::Compare({ref_version2[0]}, {"100"}, style) < 0
- : false))
- return false;
- } else if ((Version::Compare({ref_version1[0]}, {"100"}, style) >= 0) ||
- (op == kBetween
- ? Version::Compare({ref_version2[0]}, {"100"}, style) >= 0
- : false)) {
- return false;
- }
} else if (schema == kVersionSchemaNvidiaDriver) {
// The driver version we get from the os is "XX.XX.XXXA.BBCC", while the
// workaround is of the form "ABB.CC". Drop the first two stanzas from the
@@ -297,16 +282,19 @@ void GpuControlList::Entry::LogControlListMatch(
control_list_logging_name.c_str());
}
-bool GpuControlList::DriverInfo::Contains(const GPUInfo& gpu_info) const {
- const GPUInfo::GPUDevice& active_gpu = gpu_info.active_gpu();
- if (StringMismatch(active_gpu.driver_vendor, driver_vendor)) {
- return false;
- }
- if (driver_version.IsSpecified() && !active_gpu.driver_version.empty() &&
- !driver_version.Contains(active_gpu.driver_version)) {
- return false;
+bool GpuControlList::DriverInfo::Contains(
+ const std::vector<GPUInfo::GPUDevice>& gpus) const {
+ for (auto& gpu : gpus) {
+ if (StringMismatch(gpu.driver_vendor, driver_vendor))
+ continue;
+
+ if (driver_version.IsSpecified() && !gpu.driver_version.empty() &&
+ !driver_version.Contains(gpu.driver_version)) {
+ continue;
+ }
+ return true;
}
- return true;
+ return false;
}
bool GpuControlList::GLStrings::Contains(const GPUInfo& gpu_info) const {
@@ -405,33 +393,34 @@ bool GpuControlList::Conditions::Contains(OsType target_os_type,
if (os_version.IsSpecified() && !os_version.Contains(target_os_version))
return false;
}
- if (vendor_id != 0 || intel_gpu_series_list_size > 0 ||
- intel_gpu_generation.IsSpecified()) {
- std::vector<GPUInfo::GPUDevice> candidates;
- switch (multi_gpu_category) {
- case kMultiGpuCategoryPrimary:
+
+ std::vector<GPUInfo::GPUDevice> candidates;
+ switch (multi_gpu_category) {
+ case kMultiGpuCategoryPrimary:
+ candidates.push_back(gpu_info.gpu);
+ break;
+ case kMultiGpuCategorySecondary:
+ candidates = gpu_info.secondary_gpus;
+ break;
+ case kMultiGpuCategoryAny:
+ candidates = gpu_info.secondary_gpus;
+ candidates.push_back(gpu_info.gpu);
+ break;
+ case kMultiGpuCategoryActive:
+ case kMultiGpuCategoryNone:
+ // If gpu category is not specified, default to the active gpu.
+ if (gpu_info.gpu.active || gpu_info.secondary_gpus.empty())
candidates.push_back(gpu_info.gpu);
- break;
- case kMultiGpuCategorySecondary:
- candidates = gpu_info.secondary_gpus;
- break;
- case kMultiGpuCategoryAny:
- candidates = gpu_info.secondary_gpus;
+ for (auto& gpu : gpu_info.secondary_gpus) {
+ if (gpu.active)
+ candidates.push_back(gpu);
+ }
+ if (candidates.empty())
candidates.push_back(gpu_info.gpu);
- break;
- case kMultiGpuCategoryActive:
- case kMultiGpuCategoryNone:
- // If gpu category is not specified, default to the active gpu.
- if (gpu_info.gpu.active || gpu_info.secondary_gpus.empty())
- candidates.push_back(gpu_info.gpu);
- for (size_t ii = 0; ii < gpu_info.secondary_gpus.size(); ++ii) {
- if (gpu_info.secondary_gpus[ii].active)
- candidates.push_back(gpu_info.secondary_gpus[ii]);
- }
- if (candidates.empty())
- candidates.push_back(gpu_info.gpu);
- }
+ }
+ if (vendor_id != 0 || intel_gpu_series_list_size > 0 ||
+ intel_gpu_generation.IsSpecified()) {
bool found = false;
if (intel_gpu_series_list_size > 0) {
for (size_t ii = 0; !found && ii < candidates.size(); ++ii) {
@@ -516,8 +505,22 @@ bool GpuControlList::Conditions::Contains(OsType target_os_type,
case kMultiGpuStyleNone:
break;
}
- if (driver_info && !driver_info->Contains(gpu_info)) {
- return false;
+
+ if (driver_info) {
+ // We don't have a reliable way to check driver version without
+ // also checking for vendor.
+ DCHECK(vendor_id != 0 || candidates.size() < 2);
+
+ // Remove candidate GPUs made by different vendors.
+ auto behind_last =
+ std::remove_if(candidates.begin(), candidates.end(),
+ [vendor_id = vendor_id](const GPUInfo::GPUDevice& gpu) {
+ return (vendor_id && vendor_id != gpu.vendor_id);
+ });
+ candidates.erase(behind_last, candidates.end());
+
+ if (!driver_info->Contains(candidates))
+ return false;
}
if (gl_strings && !gl_strings->Contains(gpu_info)) {
return false;
diff --git a/chromium/gpu/config/gpu_control_list.h b/chromium/gpu/config/gpu_control_list.h
index 772e5c0b41c..ccf8453759a 100644
--- a/chromium/gpu/config/gpu_control_list.h
+++ b/chromium/gpu/config/gpu_control_list.h
@@ -139,7 +139,7 @@ class GPU_EXPORT GpuControlList {
const char* driver_vendor;
Version driver_version;
- bool Contains(const GPUInfo& gpu_info) const;
+ bool Contains(const std::vector<GPUInfo::GPUDevice>& gpus) const;
};
struct GPU_EXPORT GLStrings {
diff --git a/chromium/gpu/config/gpu_control_list_entry_unittest.cc b/chromium/gpu/config/gpu_control_list_entry_unittest.cc
index 6adbb87057b..289bb3444c3 100644
--- a/chromium/gpu/config/gpu_control_list_entry_unittest.cc
+++ b/chromium/gpu/config/gpu_control_list_entry_unittest.cc
@@ -4,7 +4,6 @@
#include <stddef.h>
-#include "base/cxx17_backports.h"
#include "build/build_config.h"
#include "gpu/config/gpu_control_list.h"
#include "gpu/config/gpu_control_list_testing_data.h"
@@ -20,8 +19,12 @@ constexpr auto kOsMacosx = GpuControlList::kOsMacosx;
constexpr auto kOsWin = GpuControlList::kOsWin;
constexpr auto kOsChromeOS = GpuControlList::kOsChromeOS;
constexpr auto kOsAndroid = GpuControlList::kOsAndroid;
+constexpr auto kOsFuchsia = GpuControlList::kOsFuchsia;
constexpr auto kOsAny = GpuControlList::kOsAny;
+constexpr GpuControlList::OsType kAllOsType[] = {
+ kOsMacosx, kOsWin, kOsLinux, kOsChromeOS, kOsAndroid, kOsFuchsia};
+
} // namespace anonymous
class GpuControlListEntryTest : public testing::Test {
@@ -85,19 +88,17 @@ TEST_F(GpuControlListEntryTest, DetailedEntry) {
TEST_F(GpuControlListEntryTest, VendorOnAllOsEntry) {
const Entry& entry = GetEntry(kGpuControlListEntryTest_VendorOnAllOsEntry);
EXPECT_EQ(kOsAny, entry.conditions.os_type);
- const GpuControlList::OsType os_type[] = {kOsMacosx, kOsWin, kOsLinux,
- kOsChromeOS, kOsAndroid};
- for (size_t i = 0; i < base::size(os_type); ++i)
- EXPECT_TRUE(entry.Contains(os_type[i], "10.6", gpu_info()));
+ for (auto os_type : kAllOsType)
+ EXPECT_TRUE(entry.Contains(os_type, "10.6", gpu_info()));
}
TEST_F(GpuControlListEntryTest, VendorOnLinuxEntry) {
const Entry& entry = GetEntry(kGpuControlListEntryTest_VendorOnLinuxEntry);
EXPECT_EQ(kOsLinux, entry.conditions.os_type);
- const GpuControlList::OsType os_type[] = {kOsMacosx, kOsWin, kOsChromeOS,
- kOsAndroid};
- for (size_t i = 0; i < base::size(os_type); ++i)
- EXPECT_FALSE(entry.Contains(os_type[i], "10.6", gpu_info()));
+ const GpuControlList::OsType os_types[] = {kOsMacosx, kOsWin, kOsChromeOS,
+ kOsAndroid, kOsFuchsia};
+ for (auto os_type : os_types)
+ EXPECT_FALSE(entry.Contains(os_type, "10.6", gpu_info()));
EXPECT_TRUE(entry.Contains(kOsLinux, "10.6", gpu_info()));
}
@@ -107,7 +108,7 @@ TEST_F(GpuControlListEntryTest, AllExceptNVidiaOnLinuxEntry) {
EXPECT_EQ(kOsLinux, entry.conditions.os_type);
const GpuControlList::OsType os_type[] = {kOsMacosx, kOsWin, kOsLinux,
kOsChromeOS, kOsAndroid};
- for (size_t i = 0; i < base::size(os_type); ++i)
+ for (size_t i = 0; i < std::size(os_type); ++i)
EXPECT_FALSE(entry.Contains(os_type[i], "10.6", gpu_info()));
}
@@ -115,29 +116,27 @@ TEST_F(GpuControlListEntryTest, AllExceptIntelOnLinuxEntry) {
const Entry& entry =
GetEntry(kGpuControlListEntryTest_AllExceptIntelOnLinuxEntry);
EXPECT_EQ(kOsLinux, entry.conditions.os_type);
- const GpuControlList::OsType os_type[] = {kOsMacosx, kOsWin, kOsChromeOS,
- kOsAndroid};
- for (size_t i = 0; i < base::size(os_type); ++i)
- EXPECT_FALSE(entry.Contains(os_type[i], "10.6", gpu_info()));
+ const GpuControlList::OsType os_types[] = {kOsMacosx, kOsWin, kOsChromeOS,
+ kOsAndroid, kOsFuchsia};
+ for (auto os_type : os_types)
+ EXPECT_FALSE(entry.Contains(os_type, "10.6", gpu_info()));
EXPECT_TRUE(entry.Contains(kOsLinux, "10.6", gpu_info()));
}
TEST_F(GpuControlListEntryTest, MultipleDevicesEntry) {
const Entry& entry = GetEntry(kGpuControlListEntryTest_MultipleDevicesEntry);
EXPECT_EQ(kOsAny, entry.conditions.os_type);
- const GpuControlList::OsType os_type[] = {kOsMacosx, kOsWin, kOsLinux,
- kOsChromeOS, kOsAndroid};
- for (size_t i = 0; i < base::size(os_type); ++i)
- EXPECT_TRUE(entry.Contains(os_type[i], "10.6", gpu_info()));
+ for (auto os_type : kAllOsType)
+ EXPECT_TRUE(entry.Contains(os_type, "10.6", gpu_info()));
}
TEST_F(GpuControlListEntryTest, ChromeOSEntry) {
const Entry& entry = GetEntry(kGpuControlListEntryTest_ChromeOSEntry);
EXPECT_EQ(kOsChromeOS, entry.conditions.os_type);
- const GpuControlList::OsType os_type[] = {kOsMacosx, kOsWin, kOsLinux,
- kOsAndroid};
- for (size_t i = 0; i < base::size(os_type); ++i)
- EXPECT_FALSE(entry.Contains(os_type[i], "10.6", gpu_info()));
+ const GpuControlList::OsType os_types[] = {kOsMacosx, kOsWin, kOsLinux,
+ kOsAndroid, kOsFuchsia};
+ for (auto os_type : os_types)
+ EXPECT_FALSE(entry.Contains(os_type, "10.6", gpu_info()));
EXPECT_TRUE(entry.Contains(kOsChromeOS, "10.6", gpu_info()));
}
@@ -261,6 +260,7 @@ TEST_F(GpuControlListEntryTest, AMDSwitchableEntry) {
TEST_F(GpuControlListEntryTest, DriverVendorBeginWith) {
const Entry& entry = GetEntry(kGpuControlListEntryTest_DriverVendorBeginWith);
GPUInfo gpu_info;
+ gpu_info.gpu.vendor_id = 0x10de;
gpu_info.gpu.driver_vendor = "NVIDIA Corporation";
EXPECT_TRUE(entry.Contains(kOsMacosx, "10.9", gpu_info));
// Case sensitive.
@@ -419,10 +419,12 @@ class GpuControlListEntryDualGPUTest : public GpuControlListEntryTest {
// secondary, and initially Intel is active.
gpu_info_.gpu.vendor_id = 0x10de;
gpu_info_.gpu.device_id = 0x0640;
+ gpu_info_.gpu.driver_version = "24.21.13.9811";
gpu_info_.gpu.active = false;
GPUInfo::GPUDevice second_gpu;
second_gpu.vendor_id = 0x8086;
second_gpu.device_id = 0x0166;
+ second_gpu.driver_version = "30.0.101.1660";
second_gpu.active = true;
gpu_info_.secondary_gpus.push_back(second_gpu);
}
@@ -505,6 +507,20 @@ TEST_F(GpuControlListEntryDualGPUTest, VendorOnlyActivePrimaryGPU) {
EntryShouldApply(entry);
}
+TEST_F(GpuControlListEntryDualGPUTest, AnyDriverVersion) {
+ const Entry& entry = GetEntry(kGpuControlListEntryTest_AnyDriverVersion);
+ EntryShouldApply(entry);
+ ActivatePrimaryGPU();
+ EntryShouldApply(entry);
+}
+
+TEST_F(GpuControlListEntryDualGPUTest, ActiveDriverVersion) {
+ const Entry& entry = GetEntry(kGpuControlListEntryTest_ActiveDriverVersion);
+ EntryShouldNotApply(entry);
+ ActivatePrimaryGPU();
+ EntryShouldApply(entry);
+}
+
TEST_F(GpuControlListEntryTest, PixelShaderVersion) {
const Entry& entry = GetEntry(kGpuControlListEntryTest_PixelShaderVersion);
EXPECT_EQ(kOsAny, entry.conditions.os_type);
@@ -534,11 +550,9 @@ TEST_F(GpuControlListEntryTest, OsVersionZero) {
TEST_F(GpuControlListEntryTest, OsComparison) {
{
const Entry& entry = GetEntry(kGpuControlListEntryTest_OsComparisonAny);
- const GpuControlList::OsType os_type[] = {kOsWin, kOsLinux, kOsMacosx,
- kOsChromeOS, kOsAndroid};
- for (size_t i = 0; i < base::size(os_type); ++i) {
- EXPECT_TRUE(entry.Contains(os_type[i], std::string(), gpu_info()));
- EXPECT_TRUE(entry.Contains(os_type[i], "7.8", gpu_info()));
+ for (auto os_type : kAllOsType) {
+ EXPECT_TRUE(entry.Contains(os_type, std::string(), gpu_info()));
+ EXPECT_TRUE(entry.Contains(os_type, "7.8", gpu_info()));
}
}
{
@@ -1115,6 +1129,7 @@ TEST_F(GpuControlListEntryTest, IntelDriverVendorEntry) {
const Entry& entry =
GetEntry(kGpuControlListEntryTest_IntelDriverVendorEntry);
GPUInfo gpu_info;
+ gpu_info.gpu.vendor_id = 0x8086;
gpu_info.gpu.driver_vendor = "Intel(R) UHD Graphics 630";
gpu_info.gpu.driver_version = "25.20.100.5000";
EXPECT_FALSE(entry.Contains(kOsWin, "", gpu_info));
@@ -1132,7 +1147,7 @@ TEST_F(GpuControlListEntryTest, IntelDriverVersionEntry) {
gpu_info.gpu.driver_version = "25.20.100.6000";
EXPECT_TRUE(entry.Contains(kOsWin, "", gpu_info));
gpu_info.gpu.driver_version = "24.20.99.6000";
- EXPECT_FALSE(entry.Contains(kOsWin, "", gpu_info));
+ EXPECT_TRUE(entry.Contains(kOsWin, "", gpu_info));
gpu_info.gpu.driver_version = "24.20.101.6000";
EXPECT_FALSE(entry.Contains(kOsWin, "", gpu_info));
gpu_info.gpu.driver_version = "25.20.100.7000";
diff --git a/chromium/gpu/config/gpu_control_list_format.txt b/chromium/gpu/config/gpu_control_list_format.txt
index 45b38540ac9..5d8b1195e78 100644
--- a/chromium/gpu/config/gpu_control_list_format.txt
+++ b/chromium/gpu/config/gpu_control_list_format.txt
@@ -108,11 +108,10 @@
// in that case, major is still numerical, but minor is lexical.
// Only "driver_version" supports "(intel|nvidia)_driver" schema.
//
-// intel_driver schema versions have two forms: AA.BB.CC.DDDD (legacy) and
-// AA.BB.CCC.DDDD (new). Of these, the last two fields are most relevant, and
-// the first two can be ignored by setting them to 0. The two forms must not be
-// mixed e.g. < 0.0.100.0 does not include legacy driver versions - the correct
-// constraint is <= 0.0.99.9999.
+// intel_driver schema versions have the form like "AA.BB.(CC|CCC).DDDD". The
+// last two fields are most relevant, and the first two will be ignored by
+// setting them to 0. Thus "0.0.(CC|CCC).DDDD" will be used in comparison
+// following the general rule.
//
// FLOAT includes "op" "value", and "value2". "op" can be any of the
// following values: "=", "<", "<=", ">", ">=", "any", "between". "value2" is
diff --git a/chromium/gpu/config/gpu_control_list_testing.json b/chromium/gpu/config/gpu_control_list_testing.json
index 86606a8ed51..61244523e19 100644
--- a/chromium/gpu/config/gpu_control_list_testing.json
+++ b/chromium/gpu/config/gpu_control_list_testing.json
@@ -197,6 +197,7 @@
{
"id": 18,
"description": "GpuControlListEntryTest.DriverVendorBeginWith",
+ "vendor_id": "0x10de",
"driver_vendor": "NVIDIA.*",
"features": [
"test_feature_0"
@@ -906,6 +907,7 @@
"os": {
"type": "win"
},
+ "vendor_id": "0x8086",
"driver_vendor": "Intel.*",
"driver_version": {
"schema": "intel_driver",
@@ -973,6 +975,38 @@
"features": [
"test_feature_0"
]
+ },
+ {
+ "id": 79,
+ "description": "GpuControlListEntryTest.AnyDriverVersion",
+ "os": {
+ "type": "macosx"
+ },
+ "vendor_id": "0x10de",
+ "multi_gpu_category": "any",
+ "driver_version": {
+ "op": "<=",
+ "value": "24.21.13.9826"
+ },
+ "features": [
+ "test_feature_0"
+ ]
+ },
+ {
+ "id": 80,
+ "description": "GpuControlListEntryTest.ActiveDriverVersion",
+ "os": {
+ "type": "macosx"
+ },
+ "vendor_id": "0x10de",
+ "multi_gpu_category": "active",
+ "driver_version": {
+ "op": "<=",
+ "value": "24.21.13.9826"
+ },
+ "features": [
+ "test_feature_0"
+ ]
}
]
}
diff --git a/chromium/gpu/config/gpu_control_list_testing_arrays_and_structs_autogen.h b/chromium/gpu/config/gpu_control_list_testing_arrays_and_structs_autogen.h
index c28b3e00744..bd52748349a 100644
--- a/chromium/gpu/config/gpu_control_list_testing_arrays_and_structs_autogen.h
+++ b/chromium/gpu/config/gpu_control_list_testing_arrays_and_structs_autogen.h
@@ -753,8 +753,8 @@ const char* const kMachineModelNameForEntry26[4] = {
};
const GpuControlList::MachineModelInfo kMachineModelInfoForEntry26 = {
- base::size(kMachineModelNameForEntry26), // machine model name size
- kMachineModelNameForEntry26, // machine model names
+ std::size(kMachineModelNameForEntry26), // machine model name size
+ kMachineModelNameForEntry26, // machine model names
{GpuControlList::kUnknown, GpuControlList::kVersionStyleNumerical,
GpuControlList::kVersionSchemaCommon, nullptr,
nullptr}, // machine model version
@@ -807,7 +807,7 @@ const char* const kMachineModelNameForEntry27Exception0[1] = {
};
const GpuControlList::MachineModelInfo kMachineModelInfoForEntry27Exception0 = {
- base::size(
+ std::size(
kMachineModelNameForEntry27Exception0), // machine model name size
kMachineModelNameForEntry27Exception0, // machine model names
{GpuControlList::kUnknown, GpuControlList::kVersionStyleNumerical,
@@ -843,8 +843,8 @@ const char* const kMachineModelNameForEntry28[1] = {
};
const GpuControlList::MachineModelInfo kMachineModelInfoForEntry28 = {
- base::size(kMachineModelNameForEntry28), // machine model name size
- kMachineModelNameForEntry28, // machine model names
+ std::size(kMachineModelNameForEntry28), // machine model name size
+ kMachineModelNameForEntry28, // machine model names
{GpuControlList::kEQ, GpuControlList::kVersionStyleNumerical,
GpuControlList::kVersionSchemaCommon, "7.1",
nullptr}, // machine model version
@@ -878,8 +878,8 @@ const char* const kMachineModelNameForEntry29[1] = {
};
const GpuControlList::MachineModelInfo kMachineModelInfoForEntry29 = {
- base::size(kMachineModelNameForEntry29), // machine model name size
- kMachineModelNameForEntry29, // machine model names
+ std::size(kMachineModelNameForEntry29), // machine model name size
+ kMachineModelNameForEntry29, // machine model names
{GpuControlList::kUnknown, GpuControlList::kVersionStyleNumerical,
GpuControlList::kVersionSchemaCommon, nullptr,
nullptr}, // machine model version
@@ -2423,6 +2423,66 @@ const GpuControlList::More kMoreForEntry78_1440601243 = {
GpuControlList::kDontCare, // subpixel_font_rendering
};
+const int kFeatureListForGpuControlTestingEntry79[1] = {
+ TEST_FEATURE_0,
+};
+
+const GpuControlList::DriverInfo kDriverInfoForGpuControlTestingEntry79 = {
+ nullptr, // driver_vendor
+ {GpuControlList::kLE, GpuControlList::kVersionStyleNumerical,
+ GpuControlList::kVersionSchemaCommon, "24.21.13.9826",
+ nullptr}, // driver_version
+};
+
+const GpuControlList::More kMoreForEntry79_1440601243 = {
+ GpuControlList::kGLTypeNone, // gl_type
+ {GpuControlList::kUnknown, GpuControlList::kVersionStyleNumerical,
+ GpuControlList::kVersionSchemaCommon, nullptr, nullptr}, // gl_version
+ {GpuControlList::kUnknown, GpuControlList::kVersionStyleNumerical,
+ GpuControlList::kVersionSchemaCommon, nullptr,
+ nullptr}, // pixel_shader_version
+ false, // in_process_gpu
+ 0, // gl_reset_notification_strategy
+ {GpuControlList::kUnknown, GpuControlList::kVersionStyleNumerical,
+ GpuControlList::kVersionSchemaCommon, nullptr,
+ nullptr}, // direct_rendering_version
+ {GpuControlList::kUnknown, GpuControlList::kVersionStyleNumerical,
+ GpuControlList::kVersionSchemaCommon, nullptr, nullptr}, // gpu_count
+ GpuControlList::kDontCare, // hardware_overlay
+ 0, // test_group
+ GpuControlList::kDontCare, // subpixel_font_rendering
+};
+
+const int kFeatureListForGpuControlTestingEntry80[1] = {
+ TEST_FEATURE_0,
+};
+
+const GpuControlList::DriverInfo kDriverInfoForGpuControlTestingEntry80 = {
+ nullptr, // driver_vendor
+ {GpuControlList::kLE, GpuControlList::kVersionStyleNumerical,
+ GpuControlList::kVersionSchemaCommon, "24.21.13.9826",
+ nullptr}, // driver_version
+};
+
+const GpuControlList::More kMoreForEntry80_1440601243 = {
+ GpuControlList::kGLTypeNone, // gl_type
+ {GpuControlList::kUnknown, GpuControlList::kVersionStyleNumerical,
+ GpuControlList::kVersionSchemaCommon, nullptr, nullptr}, // gl_version
+ {GpuControlList::kUnknown, GpuControlList::kVersionStyleNumerical,
+ GpuControlList::kVersionSchemaCommon, nullptr,
+ nullptr}, // pixel_shader_version
+ false, // in_process_gpu
+ 0, // gl_reset_notification_strategy
+ {GpuControlList::kUnknown, GpuControlList::kVersionStyleNumerical,
+ GpuControlList::kVersionSchemaCommon, nullptr,
+ nullptr}, // direct_rendering_version
+ {GpuControlList::kUnknown, GpuControlList::kVersionStyleNumerical,
+ GpuControlList::kVersionSchemaCommon, nullptr, nullptr}, // gpu_count
+ GpuControlList::kDontCare, // hardware_overlay
+ 0, // test_group
+ GpuControlList::kDontCare, // subpixel_font_rendering
+};
+
} // namespace gpu
#endif // GPU_CONFIG_GPU_CONTROL_LIST_TESTING_ARRAYS_AND_STRUCTS_AUTOGEN_H_
diff --git a/chromium/gpu/config/gpu_control_list_testing_autogen.cc b/chromium/gpu/config/gpu_control_list_testing_autogen.cc
index 5355724f3ed..014d606581e 100644
--- a/chromium/gpu/config/gpu_control_list_testing_autogen.cc
+++ b/chromium/gpu/config/gpu_control_list_testing_autogen.cc
@@ -10,6 +10,8 @@
#include "gpu/config/gpu_control_list_testing_autogen.h"
+#include <iterator>
+
#include "gpu/config/gpu_control_list_testing_arrays_and_structs_autogen.h"
#include "gpu/config/gpu_control_list_testing_exceptions_autogen.h"
@@ -19,22 +21,22 @@ const GpuControlList::Entry kGpuControlListTestingEntries[] = {
{
1, // id
"GpuControlListEntryTest.DetailedEntry",
- base::size(kFeatureListForGpuControlTestingEntry1), // features size
- kFeatureListForGpuControlTestingEntry1, // features
- base::size(kDisabledExtensionsForEntry1), // DisabledExtensions size
- kDisabledExtensionsForEntry1, // DisabledExtensions
+ std::size(kFeatureListForGpuControlTestingEntry1), // features size
+ kFeatureListForGpuControlTestingEntry1, // features
+ std::size(kDisabledExtensionsForEntry1), // DisabledExtensions size
+ kDisabledExtensionsForEntry1, // DisabledExtensions
0, // DisabledWebGLExtensions size
nullptr, // DisabledWebGLExtensions
- base::size(kCrBugsForGpuControlTestingEntry1), // CrBugs size
- kCrBugsForGpuControlTestingEntry1, // CrBugs
+ std::size(kCrBugsForGpuControlTestingEntry1), // CrBugs size
+ kCrBugsForGpuControlTestingEntry1, // CrBugs
{
GpuControlList::kOsMacosx, // os_type
{GpuControlList::kEQ, GpuControlList::kVersionStyleNumerical,
GpuControlList::kVersionSchemaCommon, "10.6.4",
- nullptr}, // os_version
- 0x10de, // vendor_id
- base::size(kDevicesForGpuControlTestingEntry1), // Devices size
- kDevicesForGpuControlTestingEntry1, // Devices
+ nullptr}, // os_version
+ 0x10de, // vendor_id
+ std::size(kDevicesForGpuControlTestingEntry1), // Devices size
+ kDevicesForGpuControlTestingEntry1, // Devices
GpuControlList::kMultiGpuCategoryNone, // multi_gpu_category
GpuControlList::kMultiGpuStyleNone, // multi_gpu_style
&kDriverInfoForGpuControlTestingEntry1, // driver info
@@ -53,8 +55,8 @@ const GpuControlList::Entry kGpuControlListTestingEntries[] = {
{
2, // id
"GpuControlListEntryTest.VendorOnAllOsEntry",
- base::size(kFeatureListForGpuControlTestingEntry2), // features size
- kFeatureListForGpuControlTestingEntry2, // features
+ std::size(kFeatureListForGpuControlTestingEntry2), // features size
+ kFeatureListForGpuControlTestingEntry2, // features
0, // DisabledExtensions size
nullptr, // DisabledExtensions
0, // DisabledWebGLExtensions size
@@ -87,8 +89,8 @@ const GpuControlList::Entry kGpuControlListTestingEntries[] = {
{
3, // id
"GpuControlListEntryTest.VendorOnLinuxEntry",
- base::size(kFeatureListForGpuControlTestingEntry3), // features size
- kFeatureListForGpuControlTestingEntry3, // features
+ std::size(kFeatureListForGpuControlTestingEntry3), // features size
+ kFeatureListForGpuControlTestingEntry3, // features
0, // DisabledExtensions size
nullptr, // DisabledExtensions
0, // DisabledWebGLExtensions size
@@ -121,8 +123,8 @@ const GpuControlList::Entry kGpuControlListTestingEntries[] = {
{
4, // id
"GpuControlListEntryTest.AllExceptNVidiaOnLinuxEntry",
- base::size(kFeatureListForGpuControlTestingEntry4), // features size
- kFeatureListForGpuControlTestingEntry4, // features
+ std::size(kFeatureListForGpuControlTestingEntry4), // features size
+ kFeatureListForGpuControlTestingEntry4, // features
0, // DisabledExtensions size
nullptr, // DisabledExtensions
0, // DisabledWebGLExtensions size
@@ -149,14 +151,14 @@ const GpuControlList::Entry kGpuControlListTestingEntries[] = {
nullptr}, // intel_gpu_generation
&kMoreForEntry4_1440601243, // more data
},
- base::size(kExceptionsForEntry4), // exceptions count
- kExceptionsForEntry4, // exceptions
+ std::size(kExceptionsForEntry4), // exceptions count
+ kExceptionsForEntry4, // exceptions
},
{
5, // id
"GpuControlListEntryTest.AllExceptIntelOnLinuxEntry",
- base::size(kFeatureListForGpuControlTestingEntry5), // features size
- kFeatureListForGpuControlTestingEntry5, // features
+ std::size(kFeatureListForGpuControlTestingEntry5), // features size
+ kFeatureListForGpuControlTestingEntry5, // features
0, // DisabledExtensions size
nullptr, // DisabledExtensions
0, // DisabledWebGLExtensions size
@@ -183,14 +185,14 @@ const GpuControlList::Entry kGpuControlListTestingEntries[] = {
nullptr}, // intel_gpu_generation
&kMoreForEntry5_1440601243, // more data
},
- base::size(kExceptionsForEntry5), // exceptions count
- kExceptionsForEntry5, // exceptions
+ std::size(kExceptionsForEntry5), // exceptions count
+ kExceptionsForEntry5, // exceptions
},
{
6, // id
"GpuControlListEntryTest.MultipleDevicesEntry",
- base::size(kFeatureListForGpuControlTestingEntry6), // features size
- kFeatureListForGpuControlTestingEntry6, // features
+ std::size(kFeatureListForGpuControlTestingEntry6), // features size
+ kFeatureListForGpuControlTestingEntry6, // features
0, // DisabledExtensions size
nullptr, // DisabledExtensions
0, // DisabledWebGLExtensions size
@@ -201,10 +203,10 @@ const GpuControlList::Entry kGpuControlListTestingEntries[] = {
GpuControlList::kOsAny, // os_type
{GpuControlList::kUnknown, GpuControlList::kVersionStyleNumerical,
GpuControlList::kVersionSchemaCommon, nullptr,
- nullptr}, // os_version
- 0x10de, // vendor_id
- base::size(kDevicesForGpuControlTestingEntry6), // Devices size
- kDevicesForGpuControlTestingEntry6, // Devices
+ nullptr}, // os_version
+ 0x10de, // vendor_id
+ std::size(kDevicesForGpuControlTestingEntry6), // Devices size
+ kDevicesForGpuControlTestingEntry6, // Devices
GpuControlList::kMultiGpuCategoryNone, // multi_gpu_category
GpuControlList::kMultiGpuStyleNone, // multi_gpu_style
nullptr, // driver info
@@ -223,8 +225,8 @@ const GpuControlList::Entry kGpuControlListTestingEntries[] = {
{
7, // id
"GpuControlListEntryTest.ChromeOSEntry",
- base::size(kFeatureListForGpuControlTestingEntry7), // features size
- kFeatureListForGpuControlTestingEntry7, // features
+ std::size(kFeatureListForGpuControlTestingEntry7), // features size
+ kFeatureListForGpuControlTestingEntry7, // features
0, // DisabledExtensions size
nullptr, // DisabledExtensions
0, // DisabledWebGLExtensions size
@@ -257,8 +259,8 @@ const GpuControlList::Entry kGpuControlListTestingEntries[] = {
{
8, // id
"GpuControlListEntryTest.GlVersionGLESEntry",
- base::size(kFeatureListForGpuControlTestingEntry8), // features size
- kFeatureListForGpuControlTestingEntry8, // features
+ std::size(kFeatureListForGpuControlTestingEntry8), // features size
+ kFeatureListForGpuControlTestingEntry8, // features
0, // DisabledExtensions size
nullptr, // DisabledExtensions
0, // DisabledWebGLExtensions size
@@ -291,8 +293,8 @@ const GpuControlList::Entry kGpuControlListTestingEntries[] = {
{
9, // id
"GpuControlListEntryTest.GlVersionANGLEEntry",
- base::size(kFeatureListForGpuControlTestingEntry9), // features size
- kFeatureListForGpuControlTestingEntry9, // features
+ std::size(kFeatureListForGpuControlTestingEntry9), // features size
+ kFeatureListForGpuControlTestingEntry9, // features
0, // DisabledExtensions size
nullptr, // DisabledExtensions
0, // DisabledWebGLExtensions size
@@ -325,8 +327,8 @@ const GpuControlList::Entry kGpuControlListTestingEntries[] = {
{
10, // id
"GpuControlListEntryTest.GlVersionGLEntry",
- base::size(kFeatureListForGpuControlTestingEntry10), // features size
- kFeatureListForGpuControlTestingEntry10, // features
+ std::size(kFeatureListForGpuControlTestingEntry10), // features size
+ kFeatureListForGpuControlTestingEntry10, // features
0, // DisabledExtensions size
nullptr, // DisabledExtensions
0, // DisabledWebGLExtensions size
@@ -359,8 +361,8 @@ const GpuControlList::Entry kGpuControlListTestingEntries[] = {
{
11, // id
"GpuControlListEntryTest.GlVendorEqual",
- base::size(kFeatureListForGpuControlTestingEntry11), // features size
- kFeatureListForGpuControlTestingEntry11, // features
+ std::size(kFeatureListForGpuControlTestingEntry11), // features size
+ kFeatureListForGpuControlTestingEntry11, // features
0, // DisabledExtensions size
nullptr, // DisabledExtensions
0, // DisabledWebGLExtensions size
@@ -393,8 +395,8 @@ const GpuControlList::Entry kGpuControlListTestingEntries[] = {
{
12, // id
"GpuControlListEntryTest.GlVendorWithDot",
- base::size(kFeatureListForGpuControlTestingEntry12), // features size
- kFeatureListForGpuControlTestingEntry12, // features
+ std::size(kFeatureListForGpuControlTestingEntry12), // features size
+ kFeatureListForGpuControlTestingEntry12, // features
0, // DisabledExtensions size
nullptr, // DisabledExtensions
0, // DisabledWebGLExtensions size
@@ -427,8 +429,8 @@ const GpuControlList::Entry kGpuControlListTestingEntries[] = {
{
13, // id
"GpuControlListEntryTest.GlRendererContains",
- base::size(kFeatureListForGpuControlTestingEntry13), // features size
- kFeatureListForGpuControlTestingEntry13, // features
+ std::size(kFeatureListForGpuControlTestingEntry13), // features size
+ kFeatureListForGpuControlTestingEntry13, // features
0, // DisabledExtensions size
nullptr, // DisabledExtensions
0, // DisabledWebGLExtensions size
@@ -461,8 +463,8 @@ const GpuControlList::Entry kGpuControlListTestingEntries[] = {
{
14, // id
"GpuControlListEntryTest.GlRendererCaseInsensitive",
- base::size(kFeatureListForGpuControlTestingEntry14), // features size
- kFeatureListForGpuControlTestingEntry14, // features
+ std::size(kFeatureListForGpuControlTestingEntry14), // features size
+ kFeatureListForGpuControlTestingEntry14, // features
0, // DisabledExtensions size
nullptr, // DisabledExtensions
0, // DisabledWebGLExtensions size
@@ -495,8 +497,8 @@ const GpuControlList::Entry kGpuControlListTestingEntries[] = {
{
15, // id
"GpuControlListEntryTest.GlExtensionsEndWith",
- base::size(kFeatureListForGpuControlTestingEntry15), // features size
- kFeatureListForGpuControlTestingEntry15, // features
+ std::size(kFeatureListForGpuControlTestingEntry15), // features size
+ kFeatureListForGpuControlTestingEntry15, // features
0, // DisabledExtensions size
nullptr, // DisabledExtensions
0, // DisabledWebGLExtensions size
@@ -529,8 +531,8 @@ const GpuControlList::Entry kGpuControlListTestingEntries[] = {
{
16, // id
"GpuControlListEntryTest.OptimusEntry",
- base::size(kFeatureListForGpuControlTestingEntry16), // features size
- kFeatureListForGpuControlTestingEntry16, // features
+ std::size(kFeatureListForGpuControlTestingEntry16), // features size
+ kFeatureListForGpuControlTestingEntry16, // features
0, // DisabledExtensions size
nullptr, // DisabledExtensions
0, // DisabledWebGLExtensions size
@@ -563,8 +565,8 @@ const GpuControlList::Entry kGpuControlListTestingEntries[] = {
{
17, // id
"GpuControlListEntryTest.AMDSwitchableEntry",
- base::size(kFeatureListForGpuControlTestingEntry17), // features size
- kFeatureListForGpuControlTestingEntry17, // features
+ std::size(kFeatureListForGpuControlTestingEntry17), // features size
+ kFeatureListForGpuControlTestingEntry17, // features
0, // DisabledExtensions size
nullptr, // DisabledExtensions
0, // DisabledWebGLExtensions size
@@ -597,8 +599,8 @@ const GpuControlList::Entry kGpuControlListTestingEntries[] = {
{
18, // id
"GpuControlListEntryTest.DriverVendorBeginWith",
- base::size(kFeatureListForGpuControlTestingEntry18), // features size
- kFeatureListForGpuControlTestingEntry18, // features
+ std::size(kFeatureListForGpuControlTestingEntry18), // features size
+ kFeatureListForGpuControlTestingEntry18, // features
0, // DisabledExtensions size
nullptr, // DisabledExtensions
0, // DisabledWebGLExtensions size
@@ -610,7 +612,7 @@ const GpuControlList::Entry kGpuControlListTestingEntries[] = {
{GpuControlList::kUnknown, GpuControlList::kVersionStyleNumerical,
GpuControlList::kVersionSchemaCommon, nullptr,
nullptr}, // os_version
- 0x00, // vendor_id
+ 0x10de, // vendor_id
0, // Devices size
nullptr, // Devices
GpuControlList::kMultiGpuCategoryNone, // multi_gpu_category
@@ -631,8 +633,8 @@ const GpuControlList::Entry kGpuControlListTestingEntries[] = {
{
19, // id
"GpuControlListEntryTest.LexicalDriverVersionEntry",
- base::size(kFeatureListForGpuControlTestingEntry19), // features size
- kFeatureListForGpuControlTestingEntry19, // features
+ std::size(kFeatureListForGpuControlTestingEntry19), // features size
+ kFeatureListForGpuControlTestingEntry19, // features
0, // DisabledExtensions size
nullptr, // DisabledExtensions
0, // DisabledWebGLExtensions size
@@ -665,8 +667,8 @@ const GpuControlList::Entry kGpuControlListTestingEntries[] = {
{
20, // id
"GpuControlListEntryTest.NeedsMoreInfoEntry",
- base::size(kFeatureListForGpuControlTestingEntry20), // features size
- kFeatureListForGpuControlTestingEntry20, // features
+ std::size(kFeatureListForGpuControlTestingEntry20), // features size
+ kFeatureListForGpuControlTestingEntry20, // features
0, // DisabledExtensions size
nullptr, // DisabledExtensions
0, // DisabledWebGLExtensions size
@@ -699,8 +701,8 @@ const GpuControlList::Entry kGpuControlListTestingEntries[] = {
{
21, // id
"GpuControlListEntryTest.NeedsMoreInfoForExceptionsEntry",
- base::size(kFeatureListForGpuControlTestingEntry21), // features size
- kFeatureListForGpuControlTestingEntry21, // features
+ std::size(kFeatureListForGpuControlTestingEntry21), // features size
+ kFeatureListForGpuControlTestingEntry21, // features
0, // DisabledExtensions size
nullptr, // DisabledExtensions
0, // DisabledWebGLExtensions size
@@ -727,14 +729,14 @@ const GpuControlList::Entry kGpuControlListTestingEntries[] = {
nullptr}, // intel_gpu_generation
&kMoreForEntry21_1440601243, // more data
},
- base::size(kExceptionsForEntry21), // exceptions count
- kExceptionsForEntry21, // exceptions
+ std::size(kExceptionsForEntry21), // exceptions count
+ kExceptionsForEntry21, // exceptions
},
{
22, // id
"GpuControlListEntryTest.NeedsMoreInfoForGlVersionEntry",
- base::size(kFeatureListForGpuControlTestingEntry22), // features size
- kFeatureListForGpuControlTestingEntry22, // features
+ std::size(kFeatureListForGpuControlTestingEntry22), // features size
+ kFeatureListForGpuControlTestingEntry22, // features
0, // DisabledExtensions size
nullptr, // DisabledExtensions
0, // DisabledWebGLExtensions size
@@ -767,8 +769,8 @@ const GpuControlList::Entry kGpuControlListTestingEntries[] = {
{
23, // id
"GpuControlListEntryTest.FeatureTypeAllEntry",
- base::size(kFeatureListForGpuControlTestingEntry23), // features size
- kFeatureListForGpuControlTestingEntry23, // features
+ std::size(kFeatureListForGpuControlTestingEntry23), // features size
+ kFeatureListForGpuControlTestingEntry23, // features
0, // DisabledExtensions size
nullptr, // DisabledExtensions
0, // DisabledWebGLExtensions size
@@ -801,8 +803,8 @@ const GpuControlList::Entry kGpuControlListTestingEntries[] = {
{
24, // id
"GpuControlListEntryTest.FeatureTypeAllEntryWithExceptions",
- base::size(kFeatureListForGpuControlTestingEntry24), // features size
- kFeatureListForGpuControlTestingEntry24, // features
+ std::size(kFeatureListForGpuControlTestingEntry24), // features size
+ kFeatureListForGpuControlTestingEntry24, // features
0, // DisabledExtensions size
nullptr, // DisabledExtensions
0, // DisabledWebGLExtensions size
@@ -835,8 +837,8 @@ const GpuControlList::Entry kGpuControlListTestingEntries[] = {
{
25, // id
"GpuControlListEntryTest.SingleActiveGPU",
- base::size(kFeatureListForGpuControlTestingEntry25), // features size
- kFeatureListForGpuControlTestingEntry25, // features
+ std::size(kFeatureListForGpuControlTestingEntry25), // features size
+ kFeatureListForGpuControlTestingEntry25, // features
0, // DisabledExtensions size
nullptr, // DisabledExtensions
0, // DisabledWebGLExtensions size
@@ -847,10 +849,10 @@ const GpuControlList::Entry kGpuControlListTestingEntries[] = {
GpuControlList::kOsMacosx, // os_type
{GpuControlList::kUnknown, GpuControlList::kVersionStyleNumerical,
GpuControlList::kVersionSchemaCommon, nullptr,
- nullptr}, // os_version
- 0x10de, // vendor_id
- base::size(kDevicesForGpuControlTestingEntry25), // Devices size
- kDevicesForGpuControlTestingEntry25, // Devices
+ nullptr}, // os_version
+ 0x10de, // vendor_id
+ std::size(kDevicesForGpuControlTestingEntry25), // Devices size
+ kDevicesForGpuControlTestingEntry25, // Devices
GpuControlList::kMultiGpuCategoryActive, // multi_gpu_category
GpuControlList::kMultiGpuStyleNone, // multi_gpu_style
nullptr, // driver info
@@ -869,8 +871,8 @@ const GpuControlList::Entry kGpuControlListTestingEntries[] = {
{
26, // id
"GpuControlListEntryTest.MachineModelName",
- base::size(kFeatureListForGpuControlTestingEntry26), // features size
- kFeatureListForGpuControlTestingEntry26, // features
+ std::size(kFeatureListForGpuControlTestingEntry26), // features size
+ kFeatureListForGpuControlTestingEntry26, // features
0, // DisabledExtensions size
nullptr, // DisabledExtensions
0, // DisabledWebGLExtensions size
@@ -903,8 +905,8 @@ const GpuControlList::Entry kGpuControlListTestingEntries[] = {
{
27, // id
"GpuControlListEntryTest.MachineModelNameException",
- base::size(kFeatureListForGpuControlTestingEntry27), // features size
- kFeatureListForGpuControlTestingEntry27, // features
+ std::size(kFeatureListForGpuControlTestingEntry27), // features size
+ kFeatureListForGpuControlTestingEntry27, // features
0, // DisabledExtensions size
nullptr, // DisabledExtensions
0, // DisabledWebGLExtensions size
@@ -931,14 +933,14 @@ const GpuControlList::Entry kGpuControlListTestingEntries[] = {
nullptr}, // intel_gpu_generation
&kMoreForEntry27_1440601243, // more data
},
- base::size(kExceptionsForEntry27), // exceptions count
- kExceptionsForEntry27, // exceptions
+ std::size(kExceptionsForEntry27), // exceptions count
+ kExceptionsForEntry27, // exceptions
},
{
28, // id
"GpuControlListEntryTest.MachineModelVersion",
- base::size(kFeatureListForGpuControlTestingEntry28), // features size
- kFeatureListForGpuControlTestingEntry28, // features
+ std::size(kFeatureListForGpuControlTestingEntry28), // features size
+ kFeatureListForGpuControlTestingEntry28, // features
0, // DisabledExtensions size
nullptr, // DisabledExtensions
0, // DisabledWebGLExtensions size
@@ -971,8 +973,8 @@ const GpuControlList::Entry kGpuControlListTestingEntries[] = {
{
29, // id
"GpuControlListEntryTest.MachineModelVersionException",
- base::size(kFeatureListForGpuControlTestingEntry29), // features size
- kFeatureListForGpuControlTestingEntry29, // features
+ std::size(kFeatureListForGpuControlTestingEntry29), // features size
+ kFeatureListForGpuControlTestingEntry29, // features
0, // DisabledExtensions size
nullptr, // DisabledExtensions
0, // DisabledWebGLExtensions size
@@ -999,14 +1001,14 @@ const GpuControlList::Entry kGpuControlListTestingEntries[] = {
nullptr}, // intel_gpu_generation
&kMoreForEntry29_1440601243, // more data
},
- base::size(kExceptionsForEntry29), // exceptions count
- kExceptionsForEntry29, // exceptions
+ std::size(kExceptionsForEntry29), // exceptions count
+ kExceptionsForEntry29, // exceptions
},
{
30, // id
"GpuControlListEntryDualGPUTest.CategoryAny.Intel",
- base::size(kFeatureListForGpuControlTestingEntry30), // features size
- kFeatureListForGpuControlTestingEntry30, // features
+ std::size(kFeatureListForGpuControlTestingEntry30), // features size
+ kFeatureListForGpuControlTestingEntry30, // features
0, // DisabledExtensions size
nullptr, // DisabledExtensions
0, // DisabledWebGLExtensions size
@@ -1017,10 +1019,10 @@ const GpuControlList::Entry kGpuControlListTestingEntries[] = {
GpuControlList::kOsMacosx, // os_type
{GpuControlList::kUnknown, GpuControlList::kVersionStyleNumerical,
GpuControlList::kVersionSchemaCommon, nullptr,
- nullptr}, // os_version
- 0x8086, // vendor_id
- base::size(kDevicesForGpuControlTestingEntry30), // Devices size
- kDevicesForGpuControlTestingEntry30, // Devices
+ nullptr}, // os_version
+ 0x8086, // vendor_id
+ std::size(kDevicesForGpuControlTestingEntry30), // Devices size
+ kDevicesForGpuControlTestingEntry30, // Devices
GpuControlList::kMultiGpuCategoryAny, // multi_gpu_category
GpuControlList::kMultiGpuStyleNone, // multi_gpu_style
nullptr, // driver info
@@ -1039,8 +1041,8 @@ const GpuControlList::Entry kGpuControlListTestingEntries[] = {
{
31, // id
"GpuControlListEntryDualGPUTest.CategoryAny.NVidia",
- base::size(kFeatureListForGpuControlTestingEntry31), // features size
- kFeatureListForGpuControlTestingEntry31, // features
+ std::size(kFeatureListForGpuControlTestingEntry31), // features size
+ kFeatureListForGpuControlTestingEntry31, // features
0, // DisabledExtensions size
nullptr, // DisabledExtensions
0, // DisabledWebGLExtensions size
@@ -1051,10 +1053,10 @@ const GpuControlList::Entry kGpuControlListTestingEntries[] = {
GpuControlList::kOsMacosx, // os_type
{GpuControlList::kUnknown, GpuControlList::kVersionStyleNumerical,
GpuControlList::kVersionSchemaCommon, nullptr,
- nullptr}, // os_version
- 0x10de, // vendor_id
- base::size(kDevicesForGpuControlTestingEntry31), // Devices size
- kDevicesForGpuControlTestingEntry31, // Devices
+ nullptr}, // os_version
+ 0x10de, // vendor_id
+ std::size(kDevicesForGpuControlTestingEntry31), // Devices size
+ kDevicesForGpuControlTestingEntry31, // Devices
GpuControlList::kMultiGpuCategoryAny, // multi_gpu_category
GpuControlList::kMultiGpuStyleNone, // multi_gpu_style
nullptr, // driver info
@@ -1073,8 +1075,8 @@ const GpuControlList::Entry kGpuControlListTestingEntries[] = {
{
32, // id
"GpuControlListEntryDualGPUTest.CategorySecondary",
- base::size(kFeatureListForGpuControlTestingEntry32), // features size
- kFeatureListForGpuControlTestingEntry32, // features
+ std::size(kFeatureListForGpuControlTestingEntry32), // features size
+ kFeatureListForGpuControlTestingEntry32, // features
0, // DisabledExtensions size
nullptr, // DisabledExtensions
0, // DisabledWebGLExtensions size
@@ -1085,10 +1087,10 @@ const GpuControlList::Entry kGpuControlListTestingEntries[] = {
GpuControlList::kOsMacosx, // os_type
{GpuControlList::kUnknown, GpuControlList::kVersionStyleNumerical,
GpuControlList::kVersionSchemaCommon, nullptr,
- nullptr}, // os_version
- 0x8086, // vendor_id
- base::size(kDevicesForGpuControlTestingEntry32), // Devices size
- kDevicesForGpuControlTestingEntry32, // Devices
+ nullptr}, // os_version
+ 0x8086, // vendor_id
+ std::size(kDevicesForGpuControlTestingEntry32), // Devices size
+ kDevicesForGpuControlTestingEntry32, // Devices
GpuControlList::kMultiGpuCategorySecondary, // multi_gpu_category
GpuControlList::kMultiGpuStyleNone, // multi_gpu_style
nullptr, // driver info
@@ -1107,8 +1109,8 @@ const GpuControlList::Entry kGpuControlListTestingEntries[] = {
{
33, // id
"GpuControlListEntryDualGPUTest.CategoryPrimary",
- base::size(kFeatureListForGpuControlTestingEntry33), // features size
- kFeatureListForGpuControlTestingEntry33, // features
+ std::size(kFeatureListForGpuControlTestingEntry33), // features size
+ kFeatureListForGpuControlTestingEntry33, // features
0, // DisabledExtensions size
nullptr, // DisabledExtensions
0, // DisabledWebGLExtensions size
@@ -1119,10 +1121,10 @@ const GpuControlList::Entry kGpuControlListTestingEntries[] = {
GpuControlList::kOsMacosx, // os_type
{GpuControlList::kUnknown, GpuControlList::kVersionStyleNumerical,
GpuControlList::kVersionSchemaCommon, nullptr,
- nullptr}, // os_version
- 0x8086, // vendor_id
- base::size(kDevicesForGpuControlTestingEntry33), // Devices size
- kDevicesForGpuControlTestingEntry33, // Devices
+ nullptr}, // os_version
+ 0x8086, // vendor_id
+ std::size(kDevicesForGpuControlTestingEntry33), // Devices size
+ kDevicesForGpuControlTestingEntry33, // Devices
GpuControlList::kMultiGpuCategoryPrimary, // multi_gpu_category
GpuControlList::kMultiGpuStyleNone, // multi_gpu_style
nullptr, // driver info
@@ -1141,8 +1143,8 @@ const GpuControlList::Entry kGpuControlListTestingEntries[] = {
{
34, // id
"GpuControlListEntryDualGPUTest.CategoryDefault",
- base::size(kFeatureListForGpuControlTestingEntry34), // features size
- kFeatureListForGpuControlTestingEntry34, // features
+ std::size(kFeatureListForGpuControlTestingEntry34), // features size
+ kFeatureListForGpuControlTestingEntry34, // features
0, // DisabledExtensions size
nullptr, // DisabledExtensions
0, // DisabledWebGLExtensions size
@@ -1153,10 +1155,10 @@ const GpuControlList::Entry kGpuControlListTestingEntries[] = {
GpuControlList::kOsMacosx, // os_type
{GpuControlList::kUnknown, GpuControlList::kVersionStyleNumerical,
GpuControlList::kVersionSchemaCommon, nullptr,
- nullptr}, // os_version
- 0x8086, // vendor_id
- base::size(kDevicesForGpuControlTestingEntry34), // Devices size
- kDevicesForGpuControlTestingEntry34, // Devices
+ nullptr}, // os_version
+ 0x8086, // vendor_id
+ std::size(kDevicesForGpuControlTestingEntry34), // Devices size
+ kDevicesForGpuControlTestingEntry34, // Devices
GpuControlList::kMultiGpuCategoryNone, // multi_gpu_category
GpuControlList::kMultiGpuStyleNone, // multi_gpu_style
nullptr, // driver info
@@ -1175,8 +1177,8 @@ const GpuControlList::Entry kGpuControlListTestingEntries[] = {
{
35, // id
"GpuControlListEntryDualGPUTest.ActiveSecondaryGPU",
- base::size(kFeatureListForGpuControlTestingEntry35), // features size
- kFeatureListForGpuControlTestingEntry35, // features
+ std::size(kFeatureListForGpuControlTestingEntry35), // features size
+ kFeatureListForGpuControlTestingEntry35, // features
0, // DisabledExtensions size
nullptr, // DisabledExtensions
0, // DisabledWebGLExtensions size
@@ -1187,10 +1189,10 @@ const GpuControlList::Entry kGpuControlListTestingEntries[] = {
GpuControlList::kOsMacosx, // os_type
{GpuControlList::kUnknown, GpuControlList::kVersionStyleNumerical,
GpuControlList::kVersionSchemaCommon, nullptr,
- nullptr}, // os_version
- 0x8086, // vendor_id
- base::size(kDevicesForGpuControlTestingEntry35), // Devices size
- kDevicesForGpuControlTestingEntry35, // Devices
+ nullptr}, // os_version
+ 0x8086, // vendor_id
+ std::size(kDevicesForGpuControlTestingEntry35), // Devices size
+ kDevicesForGpuControlTestingEntry35, // Devices
GpuControlList::kMultiGpuCategoryActive, // multi_gpu_category
GpuControlList::kMultiGpuStyleNone, // multi_gpu_style
nullptr, // driver info
@@ -1209,8 +1211,8 @@ const GpuControlList::Entry kGpuControlListTestingEntries[] = {
{
36, // id
"GpuControlListEntryDualGPUTest.VendorOnlyActiveSecondaryGPU",
- base::size(kFeatureListForGpuControlTestingEntry36), // features size
- kFeatureListForGpuControlTestingEntry36, // features
+ std::size(kFeatureListForGpuControlTestingEntry36), // features size
+ kFeatureListForGpuControlTestingEntry36, // features
0, // DisabledExtensions size
nullptr, // DisabledExtensions
0, // DisabledWebGLExtensions size
@@ -1243,8 +1245,8 @@ const GpuControlList::Entry kGpuControlListTestingEntries[] = {
{
37, // id
"GpuControlListEntryDualGPUTest.ActivePrimaryGPU",
- base::size(kFeatureListForGpuControlTestingEntry37), // features size
- kFeatureListForGpuControlTestingEntry37, // features
+ std::size(kFeatureListForGpuControlTestingEntry37), // features size
+ kFeatureListForGpuControlTestingEntry37, // features
0, // DisabledExtensions size
nullptr, // DisabledExtensions
0, // DisabledWebGLExtensions size
@@ -1255,10 +1257,10 @@ const GpuControlList::Entry kGpuControlListTestingEntries[] = {
GpuControlList::kOsMacosx, // os_type
{GpuControlList::kUnknown, GpuControlList::kVersionStyleNumerical,
GpuControlList::kVersionSchemaCommon, nullptr,
- nullptr}, // os_version
- 0x10de, // vendor_id
- base::size(kDevicesForGpuControlTestingEntry37), // Devices size
- kDevicesForGpuControlTestingEntry37, // Devices
+ nullptr}, // os_version
+ 0x10de, // vendor_id
+ std::size(kDevicesForGpuControlTestingEntry37), // Devices size
+ kDevicesForGpuControlTestingEntry37, // Devices
GpuControlList::kMultiGpuCategoryActive, // multi_gpu_category
GpuControlList::kMultiGpuStyleNone, // multi_gpu_style
nullptr, // driver info
@@ -1277,8 +1279,8 @@ const GpuControlList::Entry kGpuControlListTestingEntries[] = {
{
38, // id
"GpuControlListEntryDualGPUTest.VendorOnlyActivePrimaryGPU",
- base::size(kFeatureListForGpuControlTestingEntry38), // features size
- kFeatureListForGpuControlTestingEntry38, // features
+ std::size(kFeatureListForGpuControlTestingEntry38), // features size
+ kFeatureListForGpuControlTestingEntry38, // features
0, // DisabledExtensions size
nullptr, // DisabledExtensions
0, // DisabledWebGLExtensions size
@@ -1311,8 +1313,8 @@ const GpuControlList::Entry kGpuControlListTestingEntries[] = {
{
39, // id
"GpuControlListEntryTest.PixelShaderVersion",
- base::size(kFeatureListForGpuControlTestingEntry39), // features size
- kFeatureListForGpuControlTestingEntry39, // features
+ std::size(kFeatureListForGpuControlTestingEntry39), // features size
+ kFeatureListForGpuControlTestingEntry39, // features
0, // DisabledExtensions size
nullptr, // DisabledExtensions
0, // DisabledWebGLExtensions size
@@ -1345,8 +1347,8 @@ const GpuControlList::Entry kGpuControlListTestingEntries[] = {
{
40, // id
"GpuControlListEntryTest.OsVersionZeroLT",
- base::size(kFeatureListForGpuControlTestingEntry40), // features size
- kFeatureListForGpuControlTestingEntry40, // features
+ std::size(kFeatureListForGpuControlTestingEntry40), // features size
+ kFeatureListForGpuControlTestingEntry40, // features
0, // DisabledExtensions size
nullptr, // DisabledExtensions
0, // DisabledWebGLExtensions size
@@ -1379,8 +1381,8 @@ const GpuControlList::Entry kGpuControlListTestingEntries[] = {
{
41, // id
"GpuControlListEntryTest.OsVersionZeroAny",
- base::size(kFeatureListForGpuControlTestingEntry41), // features size
- kFeatureListForGpuControlTestingEntry41, // features
+ std::size(kFeatureListForGpuControlTestingEntry41), // features size
+ kFeatureListForGpuControlTestingEntry41, // features
0, // DisabledExtensions size
nullptr, // DisabledExtensions
0, // DisabledWebGLExtensions size
@@ -1413,8 +1415,8 @@ const GpuControlList::Entry kGpuControlListTestingEntries[] = {
{
42, // id
"GpuControlListEntryTest.OsComparisonAny",
- base::size(kFeatureListForGpuControlTestingEntry42), // features size
- kFeatureListForGpuControlTestingEntry42, // features
+ std::size(kFeatureListForGpuControlTestingEntry42), // features size
+ kFeatureListForGpuControlTestingEntry42, // features
0, // DisabledExtensions size
nullptr, // DisabledExtensions
0, // DisabledWebGLExtensions size
@@ -1447,8 +1449,8 @@ const GpuControlList::Entry kGpuControlListTestingEntries[] = {
{
43, // id
"GpuControlListEntryTest.OsComparisonGE",
- base::size(kFeatureListForGpuControlTestingEntry43), // features size
- kFeatureListForGpuControlTestingEntry43, // features
+ std::size(kFeatureListForGpuControlTestingEntry43), // features size
+ kFeatureListForGpuControlTestingEntry43, // features
0, // DisabledExtensions size
nullptr, // DisabledExtensions
0, // DisabledWebGLExtensions size
@@ -1480,8 +1482,8 @@ const GpuControlList::Entry kGpuControlListTestingEntries[] = {
{
44, // id
"GpuControlListEntryTest.ExceptionWithoutVendorId",
- base::size(kFeatureListForGpuControlTestingEntry44), // features size
- kFeatureListForGpuControlTestingEntry44, // features
+ std::size(kFeatureListForGpuControlTestingEntry44), // features size
+ kFeatureListForGpuControlTestingEntry44, // features
0, // DisabledExtensions size
nullptr, // DisabledExtensions
0, // DisabledWebGLExtensions size
@@ -1508,14 +1510,14 @@ const GpuControlList::Entry kGpuControlListTestingEntries[] = {
nullptr}, // intel_gpu_generation
&kMoreForEntry44_1440601243, // more data
},
- base::size(kExceptionsForEntry44), // exceptions count
- kExceptionsForEntry44, // exceptions
+ std::size(kExceptionsForEntry44), // exceptions count
+ kExceptionsForEntry44, // exceptions
},
{
45, // id
"GpuControlListEntryTest.MultiGpuStyleAMDSwitchableDiscrete",
- base::size(kFeatureListForGpuControlTestingEntry45), // features size
- kFeatureListForGpuControlTestingEntry45, // features
+ std::size(kFeatureListForGpuControlTestingEntry45), // features size
+ kFeatureListForGpuControlTestingEntry45, // features
0, // DisabledExtensions size
nullptr, // DisabledExtensions
0, // DisabledWebGLExtensions size
@@ -1549,8 +1551,8 @@ const GpuControlList::Entry kGpuControlListTestingEntries[] = {
{
46, // id
"GpuControlListEntryTest.MultiGpuStyleAMDSwitchableIntegrated",
- base::size(kFeatureListForGpuControlTestingEntry46), // features size
- kFeatureListForGpuControlTestingEntry46, // features
+ std::size(kFeatureListForGpuControlTestingEntry46), // features size
+ kFeatureListForGpuControlTestingEntry46, // features
0, // DisabledExtensions size
nullptr, // DisabledExtensions
0, // DisabledWebGLExtensions size
@@ -1584,8 +1586,8 @@ const GpuControlList::Entry kGpuControlListTestingEntries[] = {
{
47, // id
"GpuControlListEntryTest.InProcessGPU",
- base::size(kFeatureListForGpuControlTestingEntry47), // features size
- kFeatureListForGpuControlTestingEntry47, // features
+ std::size(kFeatureListForGpuControlTestingEntry47), // features size
+ kFeatureListForGpuControlTestingEntry47, // features
0, // DisabledExtensions size
nullptr, // DisabledExtensions
0, // DisabledWebGLExtensions size
@@ -1618,8 +1620,8 @@ const GpuControlList::Entry kGpuControlListTestingEntries[] = {
{
48, // id
"GpuControlListEntryTest.SameGPUTwiceTest",
- base::size(kFeatureListForGpuControlTestingEntry48), // features size
- kFeatureListForGpuControlTestingEntry48, // features
+ std::size(kFeatureListForGpuControlTestingEntry48), // features size
+ kFeatureListForGpuControlTestingEntry48, // features
0, // DisabledExtensions size
nullptr, // DisabledExtensions
0, // DisabledWebGLExtensions size
@@ -1652,8 +1654,8 @@ const GpuControlList::Entry kGpuControlListTestingEntries[] = {
{
49, // id
"GpuControlListEntryTest.NVidiaNumberingScheme",
- base::size(kFeatureListForGpuControlTestingEntry49), // features size
- kFeatureListForGpuControlTestingEntry49, // features
+ std::size(kFeatureListForGpuControlTestingEntry49), // features size
+ kFeatureListForGpuControlTestingEntry49, // features
0, // DisabledExtensions size
nullptr, // DisabledExtensions
0, // DisabledWebGLExtensions size
@@ -1686,8 +1688,8 @@ const GpuControlList::Entry kGpuControlListTestingEntries[] = {
{
50, // id
"GpuControlListTest.NeedsMoreInfo",
- base::size(kFeatureListForGpuControlTestingEntry50), // features size
- kFeatureListForGpuControlTestingEntry50, // features
+ std::size(kFeatureListForGpuControlTestingEntry50), // features size
+ kFeatureListForGpuControlTestingEntry50, // features
0, // DisabledExtensions size
nullptr, // DisabledExtensions
0, // DisabledWebGLExtensions size
@@ -1720,8 +1722,8 @@ const GpuControlList::Entry kGpuControlListTestingEntries[] = {
{
51, // id
"GpuControlListTest.NeedsMoreInfoForExceptions",
- base::size(kFeatureListForGpuControlTestingEntry51), // features size
- kFeatureListForGpuControlTestingEntry51, // features
+ std::size(kFeatureListForGpuControlTestingEntry51), // features size
+ kFeatureListForGpuControlTestingEntry51, // features
0, // DisabledExtensions size
nullptr, // DisabledExtensions
0, // DisabledWebGLExtensions size
@@ -1748,14 +1750,14 @@ const GpuControlList::Entry kGpuControlListTestingEntries[] = {
nullptr}, // intel_gpu_generation
&kMoreForEntry51_1440601243, // more data
},
- base::size(kExceptionsForEntry51), // exceptions count
- kExceptionsForEntry51, // exceptions
+ std::size(kExceptionsForEntry51), // exceptions count
+ kExceptionsForEntry51, // exceptions
},
{
52, // id
"GpuControlListTest.IgnorableEntries.0",
- base::size(kFeatureListForGpuControlTestingEntry52), // features size
- kFeatureListForGpuControlTestingEntry52, // features
+ std::size(kFeatureListForGpuControlTestingEntry52), // features size
+ kFeatureListForGpuControlTestingEntry52, // features
0, // DisabledExtensions size
nullptr, // DisabledExtensions
0, // DisabledWebGLExtensions size
@@ -1788,8 +1790,8 @@ const GpuControlList::Entry kGpuControlListTestingEntries[] = {
{
53, // id
"GpuControlListTest.IgnorableEntries.1",
- base::size(kFeatureListForGpuControlTestingEntry53), // features size
- kFeatureListForGpuControlTestingEntry53, // features
+ std::size(kFeatureListForGpuControlTestingEntry53), // features size
+ kFeatureListForGpuControlTestingEntry53, // features
0, // DisabledExtensions size
nullptr, // DisabledExtensions
0, // DisabledWebGLExtensions size
@@ -1822,10 +1824,10 @@ const GpuControlList::Entry kGpuControlListTestingEntries[] = {
{
54, // id
"GpuControlListTest.DisabledExtensionTest.0",
- 0, // feature size
- nullptr, // features
- base::size(kDisabledExtensionsForEntry54), // DisabledExtensions size
- kDisabledExtensionsForEntry54, // DisabledExtensions
+ 0, // feature size
+ nullptr, // features
+ std::size(kDisabledExtensionsForEntry54), // DisabledExtensions size
+ kDisabledExtensionsForEntry54, // DisabledExtensions
0, // DisabledWebGLExtensions size
nullptr, // DisabledWebGLExtensions
0, // CrBugs size
@@ -1856,10 +1858,10 @@ const GpuControlList::Entry kGpuControlListTestingEntries[] = {
{
55, // id
"GpuControlListTest.DisabledExtensionTest.1",
- 0, // feature size
- nullptr, // features
- base::size(kDisabledExtensionsForEntry55), // DisabledExtensions size
- kDisabledExtensionsForEntry55, // DisabledExtensions
+ 0, // feature size
+ nullptr, // features
+ std::size(kDisabledExtensionsForEntry55), // DisabledExtensions size
+ kDisabledExtensionsForEntry55, // DisabledExtensions
0, // DisabledWebGLExtensions size
nullptr, // DisabledWebGLExtensions
0, // CrBugs size
@@ -1890,8 +1892,8 @@ const GpuControlList::Entry kGpuControlListTestingEntries[] = {
{
56, // id
"GpuControlListEntryTest.DirectRendering",
- base::size(kFeatureListForGpuControlTestingEntry56), // features size
- kFeatureListForGpuControlTestingEntry56, // features
+ std::size(kFeatureListForGpuControlTestingEntry56), // features size
+ kFeatureListForGpuControlTestingEntry56, // features
0, // DisabledExtensions size
nullptr, // DisabledExtensions
0, // DisabledWebGLExtensions size
@@ -1924,8 +1926,8 @@ const GpuControlList::Entry kGpuControlListTestingEntries[] = {
{
57, // id
"GpuControlListTest.LinuxKernelVersion",
- base::size(kFeatureListForGpuControlTestingEntry57), // features size
- kFeatureListForGpuControlTestingEntry57, // features
+ std::size(kFeatureListForGpuControlTestingEntry57), // features size
+ kFeatureListForGpuControlTestingEntry57, // features
0, // DisabledExtensions size
nullptr, // DisabledExtensions
0, // DisabledWebGLExtensions size
@@ -1958,8 +1960,8 @@ const GpuControlList::Entry kGpuControlListTestingEntries[] = {
{
58, // id
"GpuControlListTest.TestGroup.0",
- base::size(kFeatureListForGpuControlTestingEntry58), // features size
- kFeatureListForGpuControlTestingEntry58, // features
+ std::size(kFeatureListForGpuControlTestingEntry58), // features size
+ kFeatureListForGpuControlTestingEntry58, // features
0, // DisabledExtensions size
nullptr, // DisabledExtensions
0, // DisabledWebGLExtensions size
@@ -1992,8 +1994,8 @@ const GpuControlList::Entry kGpuControlListTestingEntries[] = {
{
59, // id
"GpuControlListTest.TestGroup.1",
- base::size(kFeatureListForGpuControlTestingEntry59), // features size
- kFeatureListForGpuControlTestingEntry59, // features
+ std::size(kFeatureListForGpuControlTestingEntry59), // features size
+ kFeatureListForGpuControlTestingEntry59, // features
0, // DisabledExtensions size
nullptr, // DisabledExtensions
0, // DisabledWebGLExtensions size
@@ -2026,8 +2028,8 @@ const GpuControlList::Entry kGpuControlListTestingEntries[] = {
{
60, // id
"GpuControlListEntryTest.GpuSeries",
- base::size(kFeatureListForGpuControlTestingEntry60), // features size
- kFeatureListForGpuControlTestingEntry60, // features
+ std::size(kFeatureListForGpuControlTestingEntry60), // features size
+ kFeatureListForGpuControlTestingEntry60, // features
0, // DisabledExtensions size
nullptr, // DisabledExtensions
0, // DisabledWebGLExtensions size
@@ -2047,7 +2049,7 @@ const GpuControlList::Entry kGpuControlListTestingEntries[] = {
nullptr, // driver info
nullptr, // GL strings
nullptr, // machine model info
- base::size(kIntelGpuSeriesForEntry60), // intel_gpu_series size
+ std::size(kIntelGpuSeriesForEntry60), // intel_gpu_series size
kIntelGpuSeriesForEntry60, // intel_gpu_series
{GpuControlList::kUnknown, GpuControlList::kVersionStyleNumerical,
GpuControlList::kVersionSchemaCommon, nullptr,
@@ -2060,8 +2062,8 @@ const GpuControlList::Entry kGpuControlListTestingEntries[] = {
{
61, // id
"GpuControlListEntryTest.GpuSeriesActive",
- base::size(kFeatureListForGpuControlTestingEntry61), // features size
- kFeatureListForGpuControlTestingEntry61, // features
+ std::size(kFeatureListForGpuControlTestingEntry61), // features size
+ kFeatureListForGpuControlTestingEntry61, // features
0, // DisabledExtensions size
nullptr, // DisabledExtensions
0, // DisabledWebGLExtensions size
@@ -2081,7 +2083,7 @@ const GpuControlList::Entry kGpuControlListTestingEntries[] = {
nullptr, // driver info
nullptr, // GL strings
nullptr, // machine model info
- base::size(kIntelGpuSeriesForEntry61), // intel_gpu_series size
+ std::size(kIntelGpuSeriesForEntry61), // intel_gpu_series size
kIntelGpuSeriesForEntry61, // intel_gpu_series
{GpuControlList::kUnknown, GpuControlList::kVersionStyleNumerical,
GpuControlList::kVersionSchemaCommon, nullptr,
@@ -2094,8 +2096,8 @@ const GpuControlList::Entry kGpuControlListTestingEntries[] = {
{
62, // id
"GpuControlListEntryTest.GpuSeriesAny",
- base::size(kFeatureListForGpuControlTestingEntry62), // features size
- kFeatureListForGpuControlTestingEntry62, // features
+ std::size(kFeatureListForGpuControlTestingEntry62), // features size
+ kFeatureListForGpuControlTestingEntry62, // features
0, // DisabledExtensions size
nullptr, // DisabledExtensions
0, // DisabledWebGLExtensions size
@@ -2106,17 +2108,17 @@ const GpuControlList::Entry kGpuControlListTestingEntries[] = {
GpuControlList::kOsAny, // os_type
{GpuControlList::kUnknown, GpuControlList::kVersionStyleNumerical,
GpuControlList::kVersionSchemaCommon, nullptr,
- nullptr}, // os_version
- 0x00, // vendor_id
- 0, // Devices size
- nullptr, // Devices
- GpuControlList::kMultiGpuCategoryAny, // multi_gpu_category
- GpuControlList::kMultiGpuStyleNone, // multi_gpu_style
- nullptr, // driver info
- nullptr, // GL strings
- nullptr, // machine model info
- base::size(kIntelGpuSeriesForEntry62), // intel_gpu_series size
- kIntelGpuSeriesForEntry62, // intel_gpu_series
+ nullptr}, // os_version
+ 0x00, // vendor_id
+ 0, // Devices size
+ nullptr, // Devices
+ GpuControlList::kMultiGpuCategoryAny, // multi_gpu_category
+ GpuControlList::kMultiGpuStyleNone, // multi_gpu_style
+ nullptr, // driver info
+ nullptr, // GL strings
+ nullptr, // machine model info
+ std::size(kIntelGpuSeriesForEntry62), // intel_gpu_series size
+ kIntelGpuSeriesForEntry62, // intel_gpu_series
{GpuControlList::kUnknown, GpuControlList::kVersionStyleNumerical,
GpuControlList::kVersionSchemaCommon, nullptr,
nullptr}, // intel_gpu_generation
@@ -2128,8 +2130,8 @@ const GpuControlList::Entry kGpuControlListTestingEntries[] = {
{
63, // id
"GpuControlListEntryTest.GpuSeriesPrimary",
- base::size(kFeatureListForGpuControlTestingEntry63), // features size
- kFeatureListForGpuControlTestingEntry63, // features
+ std::size(kFeatureListForGpuControlTestingEntry63), // features size
+ kFeatureListForGpuControlTestingEntry63, // features
0, // DisabledExtensions size
nullptr, // DisabledExtensions
0, // DisabledWebGLExtensions size
@@ -2149,7 +2151,7 @@ const GpuControlList::Entry kGpuControlListTestingEntries[] = {
nullptr, // driver info
nullptr, // GL strings
nullptr, // machine model info
- base::size(kIntelGpuSeriesForEntry63), // intel_gpu_series size
+ std::size(kIntelGpuSeriesForEntry63), // intel_gpu_series size
kIntelGpuSeriesForEntry63, // intel_gpu_series
{GpuControlList::kUnknown, GpuControlList::kVersionStyleNumerical,
GpuControlList::kVersionSchemaCommon, nullptr,
@@ -2162,8 +2164,8 @@ const GpuControlList::Entry kGpuControlListTestingEntries[] = {
{
64, // id
"GpuControlListEntryTest.GpuSeriesSecondary",
- base::size(kFeatureListForGpuControlTestingEntry64), // features size
- kFeatureListForGpuControlTestingEntry64, // features
+ std::size(kFeatureListForGpuControlTestingEntry64), // features size
+ kFeatureListForGpuControlTestingEntry64, // features
0, // DisabledExtensions size
nullptr, // DisabledExtensions
0, // DisabledWebGLExtensions size
@@ -2183,8 +2185,8 @@ const GpuControlList::Entry kGpuControlListTestingEntries[] = {
nullptr, // driver info
nullptr, // GL strings
nullptr, // machine model info
- base::size(kIntelGpuSeriesForEntry64), // intel_gpu_series size
- kIntelGpuSeriesForEntry64, // intel_gpu_series
+ std::size(kIntelGpuSeriesForEntry64), // intel_gpu_series size
+ kIntelGpuSeriesForEntry64, // intel_gpu_series
{GpuControlList::kUnknown, GpuControlList::kVersionStyleNumerical,
GpuControlList::kVersionSchemaCommon, nullptr,
nullptr}, // intel_gpu_generation
@@ -2196,8 +2198,8 @@ const GpuControlList::Entry kGpuControlListTestingEntries[] = {
{
65, // id
"GpuControlListEntryTest.GpuSeriesInException",
- base::size(kFeatureListForGpuControlTestingEntry65), // features size
- kFeatureListForGpuControlTestingEntry65, // features
+ std::size(kFeatureListForGpuControlTestingEntry65), // features size
+ kFeatureListForGpuControlTestingEntry65, // features
0, // DisabledExtensions size
nullptr, // DisabledExtensions
0, // DisabledWebGLExtensions size
@@ -2224,14 +2226,14 @@ const GpuControlList::Entry kGpuControlListTestingEntries[] = {
nullptr}, // intel_gpu_generation
&kMoreForEntry65_1440601243, // more data
},
- base::size(kExceptionsForEntry65), // exceptions count
- kExceptionsForEntry65, // exceptions
+ std::size(kExceptionsForEntry65), // exceptions count
+ kExceptionsForEntry65, // exceptions
},
{
66, // id
"GpuControlListEntryTest.MultipleDrivers",
- base::size(kFeatureListForGpuControlTestingEntry66), // features size
- kFeatureListForGpuControlTestingEntry66, // features
+ std::size(kFeatureListForGpuControlTestingEntry66), // features size
+ kFeatureListForGpuControlTestingEntry66, // features
0, // DisabledExtensions size
nullptr, // DisabledExtensions
0, // DisabledWebGLExtensions size
@@ -2264,8 +2266,8 @@ const GpuControlList::Entry kGpuControlListTestingEntries[] = {
{
67, // id
"GpuControlListEntryTest.HardwareOverlay",
- base::size(kFeatureListForGpuControlTestingEntry67), // features size
- kFeatureListForGpuControlTestingEntry67, // features
+ std::size(kFeatureListForGpuControlTestingEntry67), // features size
+ kFeatureListForGpuControlTestingEntry67, // features
0, // DisabledExtensions size
nullptr, // DisabledExtensions
0, // DisabledWebGLExtensions size
@@ -2298,8 +2300,8 @@ const GpuControlList::Entry kGpuControlListTestingEntries[] = {
{
68, // id
"GpuControlListEntryTest.GpuGeneration",
- base::size(kFeatureListForGpuControlTestingEntry68), // features size
- kFeatureListForGpuControlTestingEntry68, // features
+ std::size(kFeatureListForGpuControlTestingEntry68), // features size
+ kFeatureListForGpuControlTestingEntry68, // features
0, // DisabledExtensions size
nullptr, // DisabledExtensions
0, // DisabledWebGLExtensions size
@@ -2332,8 +2334,8 @@ const GpuControlList::Entry kGpuControlListTestingEntries[] = {
{
69, // id
"GpuControlListEntryTest.GpuGenerationActive",
- base::size(kFeatureListForGpuControlTestingEntry69), // features size
- kFeatureListForGpuControlTestingEntry69, // features
+ std::size(kFeatureListForGpuControlTestingEntry69), // features size
+ kFeatureListForGpuControlTestingEntry69, // features
0, // DisabledExtensions size
nullptr, // DisabledExtensions
0, // DisabledWebGLExtensions size
@@ -2366,8 +2368,8 @@ const GpuControlList::Entry kGpuControlListTestingEntries[] = {
{
70, // id
"GpuControlListEntryTest.GpuGenerationAny",
- base::size(kFeatureListForGpuControlTestingEntry70), // features size
- kFeatureListForGpuControlTestingEntry70, // features
+ std::size(kFeatureListForGpuControlTestingEntry70), // features size
+ kFeatureListForGpuControlTestingEntry70, // features
0, // DisabledExtensions size
nullptr, // DisabledExtensions
0, // DisabledWebGLExtensions size
@@ -2400,8 +2402,8 @@ const GpuControlList::Entry kGpuControlListTestingEntries[] = {
{
71, // id
"GpuControlListEntryTest.GpuGenerationPrimary",
- base::size(kFeatureListForGpuControlTestingEntry71), // features size
- kFeatureListForGpuControlTestingEntry71, // features
+ std::size(kFeatureListForGpuControlTestingEntry71), // features size
+ kFeatureListForGpuControlTestingEntry71, // features
0, // DisabledExtensions size
nullptr, // DisabledExtensions
0, // DisabledWebGLExtensions size
@@ -2434,8 +2436,8 @@ const GpuControlList::Entry kGpuControlListTestingEntries[] = {
{
72, // id
"GpuControlListEntryTest.GpuGenerationSecondary",
- base::size(kFeatureListForGpuControlTestingEntry72), // features size
- kFeatureListForGpuControlTestingEntry72, // features
+ std::size(kFeatureListForGpuControlTestingEntry72), // features size
+ kFeatureListForGpuControlTestingEntry72, // features
0, // DisabledExtensions size
nullptr, // DisabledExtensions
0, // DisabledWebGLExtensions size
@@ -2468,8 +2470,8 @@ const GpuControlList::Entry kGpuControlListTestingEntries[] = {
{
73, // id
"GpuControlListEntryTest.SubpixelFontRendering",
- base::size(kFeatureListForGpuControlTestingEntry73), // features size
- kFeatureListForGpuControlTestingEntry73, // features
+ std::size(kFeatureListForGpuControlTestingEntry73), // features size
+ kFeatureListForGpuControlTestingEntry73, // features
0, // DisabledExtensions size
nullptr, // DisabledExtensions
0, // DisabledWebGLExtensions size
@@ -2496,14 +2498,14 @@ const GpuControlList::Entry kGpuControlListTestingEntries[] = {
nullptr}, // intel_gpu_generation
&kMoreForEntry73_1440601243, // more data
},
- base::size(kExceptionsForEntry73), // exceptions count
- kExceptionsForEntry73, // exceptions
+ std::size(kExceptionsForEntry73), // exceptions count
+ kExceptionsForEntry73, // exceptions
},
{
74, // id
"GpuControlListEntryTest.SubpixelFontRenderingDontCare",
- base::size(kFeatureListForGpuControlTestingEntry74), // features size
- kFeatureListForGpuControlTestingEntry74, // features
+ std::size(kFeatureListForGpuControlTestingEntry74), // features size
+ kFeatureListForGpuControlTestingEntry74, // features
0, // DisabledExtensions size
nullptr, // DisabledExtensions
0, // DisabledWebGLExtensions size
@@ -2536,8 +2538,8 @@ const GpuControlList::Entry kGpuControlListTestingEntries[] = {
{
75, // id
"GpuControlListEntryTest.IntelDriverVendorEntry",
- base::size(kFeatureListForGpuControlTestingEntry75), // features size
- kFeatureListForGpuControlTestingEntry75, // features
+ std::size(kFeatureListForGpuControlTestingEntry75), // features size
+ kFeatureListForGpuControlTestingEntry75, // features
0, // DisabledExtensions size
nullptr, // DisabledExtensions
0, // DisabledWebGLExtensions size
@@ -2549,7 +2551,7 @@ const GpuControlList::Entry kGpuControlListTestingEntries[] = {
{GpuControlList::kUnknown, GpuControlList::kVersionStyleNumerical,
GpuControlList::kVersionSchemaCommon, nullptr,
nullptr}, // os_version
- 0x00, // vendor_id
+ 0x8086, // vendor_id
0, // Devices size
nullptr, // Devices
GpuControlList::kMultiGpuCategoryNone, // multi_gpu_category
@@ -2570,8 +2572,8 @@ const GpuControlList::Entry kGpuControlListTestingEntries[] = {
{
76, // id
"GpuControlListEntryTest.IntelDriverVersionEntry",
- base::size(kFeatureListForGpuControlTestingEntry76), // features size
- kFeatureListForGpuControlTestingEntry76, // features
+ std::size(kFeatureListForGpuControlTestingEntry76), // features size
+ kFeatureListForGpuControlTestingEntry76, // features
0, // DisabledExtensions size
nullptr, // DisabledExtensions
0, // DisabledWebGLExtensions size
@@ -2604,8 +2606,8 @@ const GpuControlList::Entry kGpuControlListTestingEntries[] = {
{
77, // id
"GpuControlListEntryTest.DeviceRevisionEntry",
- base::size(kFeatureListForGpuControlTestingEntry77), // features size
- kFeatureListForGpuControlTestingEntry77, // features
+ std::size(kFeatureListForGpuControlTestingEntry77), // features size
+ kFeatureListForGpuControlTestingEntry77, // features
0, // DisabledExtensions size
nullptr, // DisabledExtensions
0, // DisabledWebGLExtensions size
@@ -2632,14 +2634,14 @@ const GpuControlList::Entry kGpuControlListTestingEntries[] = {
nullptr}, // intel_gpu_generation
&kMoreForEntry77_1440601243, // more data
},
- base::size(kExceptionsForEntry77), // exceptions count
- kExceptionsForEntry77, // exceptions
+ std::size(kExceptionsForEntry77), // exceptions count
+ kExceptionsForEntry77, // exceptions
},
{
78, // id
"GpuControlListEntryTest.DeviceRevisionUnspecifiedEntry",
- base::size(kFeatureListForGpuControlTestingEntry78), // features size
- kFeatureListForGpuControlTestingEntry78, // features
+ std::size(kFeatureListForGpuControlTestingEntry78), // features size
+ kFeatureListForGpuControlTestingEntry78, // features
0, // DisabledExtensions size
nullptr, // DisabledExtensions
0, // DisabledWebGLExtensions size
@@ -2650,10 +2652,10 @@ const GpuControlList::Entry kGpuControlListTestingEntries[] = {
GpuControlList::kOsWin, // os_type
{GpuControlList::kUnknown, GpuControlList::kVersionStyleNumerical,
GpuControlList::kVersionSchemaCommon, nullptr,
- nullptr}, // os_version
- 0x1002, // vendor_id
- base::size(kDevicesForGpuControlTestingEntry78), // Devices size
- kDevicesForGpuControlTestingEntry78, // Devices
+ nullptr}, // os_version
+ 0x1002, // vendor_id
+ std::size(kDevicesForGpuControlTestingEntry78), // Devices size
+ kDevicesForGpuControlTestingEntry78, // Devices
GpuControlList::kMultiGpuCategoryNone, // multi_gpu_category
GpuControlList::kMultiGpuStyleNone, // multi_gpu_style
nullptr, // driver info
@@ -2669,6 +2671,74 @@ const GpuControlList::Entry kGpuControlListTestingEntries[] = {
0, // exceptions count
nullptr, // exceptions
},
+ {
+ 79, // id
+ "GpuControlListEntryTest.AnyDriverVersion",
+ std::size(kFeatureListForGpuControlTestingEntry79), // features size
+ kFeatureListForGpuControlTestingEntry79, // features
+ 0, // DisabledExtensions size
+ nullptr, // DisabledExtensions
+ 0, // DisabledWebGLExtensions size
+ nullptr, // DisabledWebGLExtensions
+ 0, // CrBugs size
+ nullptr, // CrBugs
+ {
+ GpuControlList::kOsMacosx, // os_type
+ {GpuControlList::kUnknown, GpuControlList::kVersionStyleNumerical,
+ GpuControlList::kVersionSchemaCommon, nullptr,
+ nullptr}, // os_version
+ 0x10de, // vendor_id
+ 0, // Devices size
+ nullptr, // Devices
+ GpuControlList::kMultiGpuCategoryAny, // multi_gpu_category
+ GpuControlList::kMultiGpuStyleNone, // multi_gpu_style
+ &kDriverInfoForGpuControlTestingEntry79, // driver info
+ nullptr, // GL strings
+ nullptr, // machine model info
+ 0, // intel_gpu_series size
+ nullptr, // intel_gpu_series
+ {GpuControlList::kUnknown, GpuControlList::kVersionStyleNumerical,
+ GpuControlList::kVersionSchemaCommon, nullptr,
+ nullptr}, // intel_gpu_generation
+ &kMoreForEntry79_1440601243, // more data
+ },
+ 0, // exceptions count
+ nullptr, // exceptions
+ },
+ {
+ 80, // id
+ "GpuControlListEntryTest.ActiveDriverVersion",
+ std::size(kFeatureListForGpuControlTestingEntry80), // features size
+ kFeatureListForGpuControlTestingEntry80, // features
+ 0, // DisabledExtensions size
+ nullptr, // DisabledExtensions
+ 0, // DisabledWebGLExtensions size
+ nullptr, // DisabledWebGLExtensions
+ 0, // CrBugs size
+ nullptr, // CrBugs
+ {
+ GpuControlList::kOsMacosx, // os_type
+ {GpuControlList::kUnknown, GpuControlList::kVersionStyleNumerical,
+ GpuControlList::kVersionSchemaCommon, nullptr,
+ nullptr}, // os_version
+ 0x10de, // vendor_id
+ 0, // Devices size
+ nullptr, // Devices
+ GpuControlList::kMultiGpuCategoryActive, // multi_gpu_category
+ GpuControlList::kMultiGpuStyleNone, // multi_gpu_style
+ &kDriverInfoForGpuControlTestingEntry80, // driver info
+ nullptr, // GL strings
+ nullptr, // machine model info
+ 0, // intel_gpu_series size
+ nullptr, // intel_gpu_series
+ {GpuControlList::kUnknown, GpuControlList::kVersionStyleNumerical,
+ GpuControlList::kVersionSchemaCommon, nullptr,
+ nullptr}, // intel_gpu_generation
+ &kMoreForEntry80_1440601243, // more data
+ },
+ 0, // exceptions count
+ nullptr, // exceptions
+ },
};
-const size_t kGpuControlListTestingEntryCount = 78;
+const size_t kGpuControlListTestingEntryCount = 80;
} // namespace gpu
diff --git a/chromium/gpu/config/gpu_control_list_testing_entry_enums_autogen.h b/chromium/gpu/config/gpu_control_list_testing_entry_enums_autogen.h
index fde6b8f0d89..f8f7b7a8d96 100644
--- a/chromium/gpu/config/gpu_control_list_testing_entry_enums_autogen.h
+++ b/chromium/gpu/config/gpu_control_list_testing_entry_enums_autogen.h
@@ -91,6 +91,8 @@ enum GpuControlListTestingEntryEnum {
kGpuControlListEntryTest_IntelDriverVersionEntry = 75,
kGpuControlListEntryTest_DeviceRevisionEntry = 76,
kGpuControlListEntryTest_DeviceRevisionUnspecifiedEntry = 77,
+ kGpuControlListEntryTest_AnyDriverVersion = 78,
+ kGpuControlListEntryTest_ActiveDriverVersion = 79,
};
} // namespace gpu
diff --git a/chromium/gpu/config/gpu_control_list_testing_exceptions_autogen.h b/chromium/gpu/config/gpu_control_list_testing_exceptions_autogen.h
index d49de69cc57..8c24fd9ac56 100644
--- a/chromium/gpu/config/gpu_control_list_testing_exceptions_autogen.h
+++ b/chromium/gpu/config/gpu_control_list_testing_exceptions_autogen.h
@@ -128,7 +128,7 @@ const GpuControlList::Conditions kExceptionsForEntry44[2] = {
{GpuControlList::kUnknown, GpuControlList::kVersionStyleNumerical,
GpuControlList::kVersionSchemaCommon, nullptr, nullptr}, // os_version
0x8086, // vendor_id
- base::size(
+ std::size(
kDevicesForGpuControlTestingEntry44Exception0), // Devices size
kDevicesForGpuControlTestingEntry44Exception0, // Devices
GpuControlList::kMultiGpuCategoryNone, // multi_gpu_category
@@ -148,7 +148,7 @@ const GpuControlList::Conditions kExceptionsForEntry44[2] = {
{GpuControlList::kUnknown, GpuControlList::kVersionStyleNumerical,
GpuControlList::kVersionSchemaCommon, nullptr, nullptr}, // os_version
0x8086, // vendor_id
- base::size(
+ std::size(
kDevicesForGpuControlTestingEntry44Exception1), // Devices size
kDevicesForGpuControlTestingEntry44Exception1, // Devices
GpuControlList::kMultiGpuCategoryNone, // multi_gpu_category
@@ -200,7 +200,7 @@ const GpuControlList::Conditions kExceptionsForEntry65[1] = {
nullptr, // driver info
nullptr, // GL strings
nullptr, // machine model info
- base::size(
+ std::size(
kIntelGpuSeriesForEntry65Exception0), // intel_gpu_series size
kIntelGpuSeriesForEntry65Exception0, // intel_gpu_series
{GpuControlList::kUnknown, GpuControlList::kVersionStyleNumerical,
@@ -276,7 +276,7 @@ const GpuControlList::Conditions kExceptionsForEntry77[2] = {
{GpuControlList::kUnknown, GpuControlList::kVersionStyleNumerical,
GpuControlList::kVersionSchemaCommon, nullptr, nullptr}, // os_version
0x1002, // vendor_id
- base::size(
+ std::size(
kDevicesForGpuControlTestingEntry77Exception0), // Devices size
kDevicesForGpuControlTestingEntry77Exception0, // Devices
GpuControlList::kMultiGpuCategoryNone, // multi_gpu_category
@@ -296,7 +296,7 @@ const GpuControlList::Conditions kExceptionsForEntry77[2] = {
{GpuControlList::kUnknown, GpuControlList::kVersionStyleNumerical,
GpuControlList::kVersionSchemaCommon, nullptr, nullptr}, // os_version
0x1002, // vendor_id
- base::size(
+ std::size(
kDevicesForGpuControlTestingEntry77Exception1), // Devices size
kDevicesForGpuControlTestingEntry77Exception1, // Devices
GpuControlList::kMultiGpuCategoryNone, // multi_gpu_category
diff --git a/chromium/gpu/config/gpu_control_list_version_unittest.cc b/chromium/gpu/config/gpu_control_list_version_unittest.cc
index e3d8675ed01..0c633c4264b 100644
--- a/chromium/gpu/config/gpu_control_list_version_unittest.cc
+++ b/chromium/gpu/config/gpu_control_list_version_unittest.cc
@@ -194,33 +194,22 @@ TEST_F(VersionTest, LexicalComparison) {
TEST_F(VersionTest, IntelDriverSchema) {
{
- // New drivers, AA.BB.CCC.DDDD
Version info = {kLT, kNumerical, kIntelDriver, "25.20.100.6952", nullptr};
EXPECT_TRUE(info.Contains("0.0.100.6000"));
EXPECT_FALSE(info.Contains("0.0.100.7000"));
EXPECT_FALSE(info.Contains("0.0.200.6000"));
EXPECT_TRUE(info.Contains("26.20.100.6000"));
EXPECT_FALSE(info.Contains("24.20.100.7000"));
+ EXPECT_TRUE(info.Contains("23.20.16.5037"));
}
{
- // Old drivers, AA.BB.CC.DDDD
Version info = {kGT, kNumerical, kIntelDriver, "10.18.15.4256", nullptr};
EXPECT_TRUE(info.Contains("0.0.15.6000"));
EXPECT_FALSE(info.Contains("0.0.15.4000"));
EXPECT_TRUE(info.Contains("10.18.15.4279"));
EXPECT_FALSE(info.Contains("15.40.15.4058"));
- }
- {
- // Old driver versions cannot be compared against new driver versions.
- Version info = {kLT, kNumerical, kIntelDriver, "0.0.100.0", nullptr};
- EXPECT_FALSE(info.Contains("23.20.16.4973"));
- EXPECT_FALSE(info.Contains("20.19.15.4364"));
- }
- {
- // Old driver versions can only be compared against old driver versions.
- Version info = {kLE, kNumerical, kIntelDriver, "0.0.99.9999", nullptr};
- EXPECT_TRUE(info.Contains("23.20.16.4973"));
- EXPECT_TRUE(info.Contains("20.19.15.4364"));
+ EXPECT_TRUE(info.Contains("26.20.100.6000"));
+ EXPECT_TRUE(info.Contains("26.20.100.4000"));
}
}
diff --git a/chromium/gpu/config/gpu_crash_keys.cc b/chromium/gpu/config/gpu_crash_keys.cc
index 4d922b2596f..b7e89a6fca6 100644
--- a/chromium/gpu/config/gpu_crash_keys.cc
+++ b/chromium/gpu/config/gpu_crash_keys.cc
@@ -41,6 +41,8 @@ crash_reporter::CrashKeyString<4> gpu_watchdog_crashed_in_gpu_init(
"gpu-watchdog-crashed-in-gpu-init");
crash_reporter::CrashKeyString<16> num_of_processors("num-of-processors");
crash_reporter::CrashKeyString<64> gpu_thread("gpu-thread");
+crash_reporter::CrashKeyString<128> list_of_hung_threads(
+ "list-of-hung-threads");
} // namespace crash_keys
} // namespace gpu
diff --git a/chromium/gpu/config/gpu_crash_keys.h b/chromium/gpu/config/gpu_crash_keys.h
index cc79da7aa99..6999b03588c 100644
--- a/chromium/gpu/config/gpu_crash_keys.h
+++ b/chromium/gpu/config/gpu_crash_keys.h
@@ -43,6 +43,7 @@ extern GPU_EXPORT crash_reporter::CrashKeyString<4>
gpu_watchdog_crashed_in_gpu_init;
extern GPU_EXPORT crash_reporter::CrashKeyString<16> num_of_processors;
extern GPU_EXPORT crash_reporter::CrashKeyString<64> gpu_thread;
+extern GPU_EXPORT crash_reporter::CrashKeyString<128> list_of_hung_threads;
} // namespace crash_keys
} // namespace gpu
diff --git a/chromium/gpu/config/gpu_driver_bug_list.cc b/chromium/gpu/config/gpu_driver_bug_list.cc
index f2c233365c8..e16195be991 100644
--- a/chromium/gpu/config/gpu_driver_bug_list.cc
+++ b/chromium/gpu/config/gpu_driver_bug_list.cc
@@ -5,7 +5,6 @@
#include "gpu/config/gpu_driver_bug_list.h"
#include "base/check_op.h"
-#include "base/cxx17_backports.h"
#include "gpu/config/gpu_driver_bug_list_autogen.h"
#include "gpu/config/gpu_driver_bug_workaround_type.h"
#include "gpu/config/gpu_switches.h"
@@ -45,7 +44,7 @@ std::unique_ptr<GpuDriverBugList> GpuDriverBugList::Create(
const GpuControlListData& data) {
std::unique_ptr<GpuDriverBugList> list(new GpuDriverBugList(data));
- DCHECK_EQ(static_cast<int>(base::size(kFeatureList)),
+ DCHECK_EQ(static_cast<int>(std::size(kFeatureList)),
NUMBER_OF_GPU_DRIVER_BUG_WORKAROUND_TYPES);
for (int i = 0; i < NUMBER_OF_GPU_DRIVER_BUG_WORKAROUND_TYPES; ++i) {
list->AddSupportedFeature(kFeatureList[i].name,
diff --git a/chromium/gpu/config/gpu_driver_bug_list.json b/chromium/gpu/config/gpu_driver_bug_list.json
index 0ad195694a3..efb7ab5b3cb 100644
--- a/chromium/gpu/config/gpu_driver_bug_list.json
+++ b/chromium/gpu/config/gpu_driver_bug_list.json
@@ -638,6 +638,7 @@
"value": "10"
}
},
+ "vendor_id": "0x1002",
"driver_version": {
"op": "<",
"value": "20.19.0.32837"
@@ -965,9 +966,16 @@
{
"id": 132,
"description": "On Intel GPUs MSAA performance is not acceptable for GPU rasterization",
- "cr_bugs": [527565],
+ "cr_bugs": [527565, 1298585],
"vendor_id": "0x8086",
"multi_gpu_category": "active",
+ "exceptions": [
+ {
+ "os": {
+ "type": "fuchsia"
+ }
+ }
+ ],
"features": [
"msaa_is_slow"
]
@@ -3202,6 +3210,7 @@
"device_id": ["0x15d8", "0x15dd"],
"exceptions": [
{
+ "vendor_id": "0x1002",
"driver_version": {
"op": "between",
"value": "26.20.11030.2",
@@ -3947,6 +3956,32 @@
"features": [
"disable_skia_reduce_ops_task_splitting"
]
+ },
+ {
+ "id": 392,
+ "cr_bugs": [1305679],
+ "description": "OOPR Canvas is unreliable on MacOS 10.12 and older.",
+ "os": {
+ "type" : "macosx",
+ "version": {
+ "op": "<",
+ "value": "10.13"
+ }
+ },
+ "features": [
+ "disable_canvas_oop_rasterization"
+ ]
+ },
+ {
+ "id": 393,
+ "description": "GL Contexts heavy / exhaust resources",
+ "os": {
+ "type": "chromeos"
+ },
+ "gl_vendor": "freedreno",
+ "features": [
+ "use_virtualized_gl_contexts"
+ ]
}
]
}
diff --git a/chromium/gpu/config/gpu_dx_diagnostics_win.cc b/chromium/gpu/config/gpu_dx_diagnostics_win.cc
index becf06e7461..64ae167f5a5 100644
--- a/chromium/gpu/config/gpu_dx_diagnostics_win.cc
+++ b/chromium/gpu/config/gpu_dx_diagnostics_win.cc
@@ -9,7 +9,6 @@
#include <dxdiag.h>
#include <windows.h>
-#include "base/cxx17_backports.h"
#include "base/strings/string_number_conversions.h"
#include "base/strings/utf_string_conversions.h"
#include "base/win/com_init_util.h"
@@ -35,7 +34,7 @@ void RecurseDiagnosticTree(DxDiagNode* output,
if (SUCCEEDED(hr)) {
for (DWORD i = 0; i < prop_count; i++) {
WCHAR prop_name16[256];
- hr = container->EnumPropNames(i, prop_name16, base::size(prop_name16));
+ hr = container->EnumPropNames(i, prop_name16, std::size(prop_name16));
if (SUCCEEDED(hr)) {
std::string prop_name8 = base::WideToUTF8(prop_name16);
@@ -72,7 +71,7 @@ void RecurseDiagnosticTree(DxDiagNode* output,
for (DWORD i = 0; i < child_count; i++) {
WCHAR child_name16[256];
hr = container->EnumChildContainerNames(i, child_name16,
- base::size(child_name16));
+ std::size(child_name16));
if (SUCCEEDED(hr)) {
std::string child_name8 = base::WideToUTF8(child_name16);
DxDiagNode* output_child = &output->children[child_name8];
diff --git a/chromium/gpu/config/gpu_feature_type.h b/chromium/gpu/config/gpu_feature_type.h
index 8c3f94f209e..56d13b3ac4a 100644
--- a/chromium/gpu/config/gpu_feature_type.h
+++ b/chromium/gpu/config/gpu_feature_type.h
@@ -22,6 +22,7 @@ enum GpuFeatureType {
GPU_FEATURE_TYPE_METAL,
GPU_FEATURE_TYPE_VULKAN,
GPU_FEATURE_TYPE_CANVAS_OOP_RASTERIZATION,
+ GPU_FEATURE_TYPE_ACCELERATED_WEBGPU,
NUMBER_OF_GPU_FEATURE_TYPES
};
diff --git a/chromium/gpu/config/gpu_finch_features.cc b/chromium/gpu/config/gpu_finch_features.cc
index 48bcfe1f6b7..24bb3103759 100644
--- a/chromium/gpu/config/gpu_finch_features.cc
+++ b/chromium/gpu/config/gpu_finch_features.cc
@@ -78,10 +78,20 @@ const base::FeatureParam<std::string> kAndroidSurfaceControlModelBlocklist{
const base::Feature kWebViewSurfaceControl{"WebViewSurfaceControl",
base::FEATURE_DISABLED_BY_DEFAULT};
+// Same as kWebViewSurfaceControl, but affects only Android T+, used for
+// targeting pre-release version.
+const base::Feature kWebViewSurfaceControlForT{
+ "WebViewSurfaceControlForT", base::FEATURE_DISABLED_BY_DEFAULT};
+
// Use thread-safe media path on WebView.
const base::Feature kWebViewThreadSafeMedia{"WebViewThreadSafeMedia",
base::FEATURE_DISABLED_BY_DEFAULT};
+// This is used as default state because it's different for webview and chrome.
+// WebView hardcodes this as enabled in AwMainDelegate.
+const base::Feature kWebViewThreadSafeMediaDefault{
+ "WebViewThreadSafeMediaDefault", base::FEATURE_DISABLED_BY_DEFAULT};
+
// Use AImageReader for MediaCodec and MediaPlyer on android.
const base::Feature kAImageReader{"AImageReader",
base::FEATURE_ENABLED_BY_DEFAULT};
@@ -155,7 +165,7 @@ const base::Feature kGpuProcessHighPriorityWin{
// Use ThreadPriority::DISPLAY for GPU main, viz compositor and IO threads.
const base::Feature kGpuUseDisplayThreadPriority{
"GpuUseDisplayThreadPriority",
-#if BUILDFLAG(IS_ANDROID) || BUILDFLAG(IS_CHROMEOS_ASH) || BUILDFLAG(IS_WIN)
+#if BUILDFLAG(IS_ANDROID) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_WIN)
base::FEATURE_ENABLED_BY_DEFAULT
#else
base::FEATURE_DISABLED_BY_DEFAULT
@@ -167,10 +177,6 @@ const base::Feature kGpuUseDisplayThreadPriority{
const base::Feature kMetal{"Metal", base::FEATURE_DISABLED_BY_DEFAULT};
#endif
-// Turns on skia deferred display list for out of process raster.
-const base::Feature kOopRasterizationDDL{"OopRasterizationDDL",
- base::FEATURE_DISABLED_BY_DEFAULT};
-
// Causes us to use the SharedImageManager, removing support for the old
// mailbox system. Any consumers of the GPU process using the old mailbox
// system will experience undefined results.
@@ -207,6 +213,11 @@ const base::Feature kVulkan {
const base::Feature kEnableDrDc{"EnableDrDc",
base::FEATURE_DISABLED_BY_DEFAULT};
+#if BUILDFLAG(IS_ANDROID)
+const base::Feature kEnableDrDcVulkan{"EnableDrDcVulkan",
+ base::FEATURE_DISABLED_BY_DEFAULT};
+#endif // BUILDFLAG(IS_ANDROID)
+
// Enable WebGPU on gpu service side only. This is used with origin trial
// before gpu service is enabled by default.
const base::Feature kWebGPUService{"WebGPUService",
@@ -323,13 +334,11 @@ bool IsDrDcEnabled() {
return false;
}
- // Currently not supported for vulkan until crbug.com/1291298 is fixed.
- if (IsUsingVulkan())
- return false;
-
// DrDc is supported on android MediaPlayer and MCVD path only when
- // AImageReader is enabled.
- if (!IsAImageReaderEnabled())
+ // AImageReader is enabled. Also DrDc requires AImageReader max size to be
+ // at least 2 for each gpu thread. Hence DrDc is disabled on devices which has
+ // only 1 image.
+ if (!IsAImageReaderEnabled() || LimitAImageReaderMaxSizeToOne())
return false;
// Check block list against build info.
@@ -337,7 +346,11 @@ bool IsDrDcEnabled() {
if (IsDeviceBlocked(build_info->device(), kDrDcBlockListByDevice.Get()))
return false;
- return base::FeatureList::IsEnabled(kEnableDrDc);
+ if (!base::FeatureList::IsEnabled(kEnableDrDc))
+ return false;
+
+ return IsUsingVulkan() ? base::FeatureList::IsEnabled(kEnableDrDcVulkan)
+ : true;
#else
return false;
#endif
@@ -345,15 +358,21 @@ bool IsDrDcEnabled() {
bool IsUsingThreadSafeMediaForWebView() {
#if BUILDFLAG(IS_ANDROID)
- // SurfaceTexture can't be thread-safe.
- if (!IsAImageReaderEnabled())
+ // SurfaceTexture can't be thread-safe. Also thread safe media code currently
+ // requires AImageReader max size to be at least 2 since one image could be
+ // accessed by each gpu thread in webview.
+ if (!IsAImageReaderEnabled() || LimitAImageReaderMaxSizeToOne())
return false;
- // Not yet compatible with Vulkan.
- if (IsUsingVulkan())
- return false;
+ // If the feature is overridden from command line or finch we will use its
+ // value. If not we use kWebViewThreadSafeMediaDefault which is set in
+ // AwMainDelegate for WebView.
+ base::FeatureList* feature_list = base::FeatureList::GetInstance();
+ if (feature_list &&
+ feature_list->IsFeatureOverridden(kWebViewThreadSafeMedia.name))
+ return base::FeatureList::IsEnabled(kWebViewThreadSafeMedia);
- return base::FeatureList::IsEnabled(kWebViewThreadSafeMedia);
+ return base::FeatureList::IsEnabled(kWebViewThreadSafeMediaDefault);
#else
return false;
#endif
@@ -399,9 +418,19 @@ bool IsAndroidSurfaceControlEnabled() {
// On WebView we also require zero copy or thread-safe media to use
// SurfaceControl
- if ((IsWebViewZeroCopyVideoEnabled() || IsUsingThreadSafeMediaForWebView()) &&
- base::FeatureList::IsEnabled(kWebViewSurfaceControl))
- return true;
+ if (IsWebViewZeroCopyVideoEnabled() || IsUsingThreadSafeMediaForWebView()) {
+ // If main feature is not overridden from command line and we're running T+
+ // use kWebViewSurfaceControlForT to decide feature status instead so we
+ // can target pre-release android to fish out platform side bugs.
+ base::FeatureList* feature_list = base::FeatureList::GetInstance();
+ if ((!feature_list || !feature_list->IsFeatureOverriddenFromCommandLine(
+ features::kWebViewSurfaceControl.name)) &&
+ build_info->is_at_least_t()) {
+ return base::FeatureList::IsEnabled(kWebViewSurfaceControlForT);
+ }
+
+ return base::FeatureList::IsEnabled(kWebViewSurfaceControl);
+ }
return base::FeatureList::IsEnabled(kAndroidSurfaceControl);
}
diff --git a/chromium/gpu/config/gpu_finch_features.h b/chromium/gpu/config/gpu_finch_features.h
index c135ff1ef03..7dfd5baac0d 100644
--- a/chromium/gpu/config/gpu_finch_features.h
+++ b/chromium/gpu/config/gpu_finch_features.h
@@ -24,6 +24,7 @@ GPU_EXPORT extern const base::Feature kAImageReader;
GPU_EXPORT extern const base::Feature kWebViewVulkan;
GPU_EXPORT extern const base::Feature kLimitAImageReaderMaxSizeToOne;
GPU_EXPORT extern const base::Feature kWebViewZeroCopyVideo;
+GPU_EXPORT extern const base::Feature kWebViewThreadSafeMediaDefault;
GPU_EXPORT extern const base::Feature kIncreaseBufferCountForHighFrameRate;
#endif // BUILDFLAG(IS_ANDROID)
@@ -45,8 +46,6 @@ GPU_EXPORT extern const base::Feature kGpuUseDisplayThreadPriority;
GPU_EXPORT extern const base::Feature kMetal;
#endif
-GPU_EXPORT extern const base::Feature kOopRasterizationDDL;
-
GPU_EXPORT extern const base::Feature kSharedImageManager;
GPU_EXPORT extern const base::Feature kVaapiJpegImageDecodeAcceleration;
@@ -65,6 +64,12 @@ GPU_EXPORT extern const base::Feature kReduceOpsTaskSplitting;
GPU_EXPORT extern const base::Feature kEnableDrDc;
+#if BUILDFLAG(IS_ANDROID)
+// This flag is use additionally with kEnableDrDc to enable the feature for
+// vulkan enabled android devices.
+GPU_EXPORT extern const base::Feature kEnableDrDcVulkan;
+#endif // BUILDFLAG(IS_ANDROID)
+
GPU_EXPORT extern const base::Feature kWebGPUService;
GPU_EXPORT bool IsUsingVulkan();
diff --git a/chromium/gpu/config/gpu_info.cc b/chromium/gpu/config/gpu_info.cc
index 5e8b28de5a6..87cbb8b7304 100644
--- a/chromium/gpu/config/gpu_info.cc
+++ b/chromium/gpu/config/gpu_info.cc
@@ -141,6 +141,20 @@ bool IsSoftwareRenderer(uint32_t vendor_id) {
}
}
+bool IsIntegratedGpu(const gpu::GPUInfo::GPUDevice& gpu) {
+ // TODO(crbug.com/1291675): handle M1 with eGPU situation.
+ switch (gpu.vendor_id) {
+ case 0x8086: // Intel
+ return true;
+ default:
+ return false;
+ }
+}
+
+bool IsDiscreteGpu(const gpu::GPUInfo::GPUDevice& gpu) {
+ return !IsSoftwareRenderer(gpu.vendor_id) && !IsIntegratedGpu(gpu);
+}
+
} // namespace
namespace gpu {
@@ -268,6 +282,61 @@ unsigned int GPUInfo::GpuCount() const {
return gpu_count;
}
+bool GPUInfo::GetIntegratedGpu(GPUDevice* output_integrated_gpu) const {
+ unsigned int integrated_gpu_count = 0;
+ unsigned int discrete_gpu_count = 0;
+ GPUDevice integrated_gpu;
+ if (IsIntegratedGpu(gpu)) {
+ ++integrated_gpu_count;
+ integrated_gpu = gpu;
+ } else if (IsDiscreteGpu(gpu)) {
+ ++discrete_gpu_count;
+ }
+ for (const auto& secondary_gpu : secondary_gpus) {
+ if (IsIntegratedGpu(secondary_gpu)) {
+ ++integrated_gpu_count;
+ if (integrated_gpu_count == 1)
+ integrated_gpu = secondary_gpu;
+ } else if (IsDiscreteGpu(secondary_gpu)) {
+ ++discrete_gpu_count;
+ }
+ }
+ if (integrated_gpu_count == 1 && discrete_gpu_count >= 1) {
+ if (output_integrated_gpu)
+ *output_integrated_gpu = integrated_gpu;
+ return true;
+ }
+ return false;
+}
+
+bool GPUInfo::GetDiscreteGpu(GPUDevice* output_discrete_gpu) const {
+ unsigned int integrated_gpu_count = 0;
+ unsigned int discrete_gpu_count = 0;
+ GPUDevice discrete_gpu;
+ if (IsIntegratedGpu(gpu)) {
+ ++integrated_gpu_count;
+ } else if (IsDiscreteGpu(gpu)) {
+ ++discrete_gpu_count;
+ discrete_gpu = gpu;
+ }
+ for (const auto& secondary_gpu : secondary_gpus) {
+ if (IsIntegratedGpu(secondary_gpu)) {
+ ++integrated_gpu_count;
+ } else if (IsDiscreteGpu(secondary_gpu)) {
+ ++discrete_gpu_count;
+ if (discrete_gpu_count == 1)
+ discrete_gpu = secondary_gpu;
+ }
+ }
+ if (integrated_gpu_count + discrete_gpu_count > 1 &&
+ discrete_gpu_count >= 1) {
+ if (output_discrete_gpu)
+ *output_discrete_gpu = discrete_gpu;
+ return true;
+ }
+ return false;
+}
+
void GPUInfo::EnumerateFields(Enumerator* enumerator) const {
struct GPUInfoKnownFields {
base::TimeDelta initialization_time;
@@ -305,11 +374,8 @@ void GPUInfo::EnumerateFields(Enumerator* enumerator) const {
OverlayInfo overlay_info;
#endif
- // Accelerated video decoding supported capabilities. "video_decoder..."
- // refers to the direct VideoDecoder API and "video_decode_accelerator..."
- // to the legacy VideoDecodeAccelerator API.
- VideoDecodeAcceleratorCapabilities video_decode_accelerator_capabilities;
- VideoDecodeAcceleratorSupportedProfiles video_decoder_capabilities;
+ VideoDecodeAcceleratorSupportedProfiles
+ video_decode_accelerator_supported_profiles;
VideoEncodeAcceleratorSupportedProfiles
video_encode_accelerator_supported_profiles;
@@ -380,15 +446,7 @@ void GPUInfo::EnumerateFields(Enumerator* enumerator) const {
enumerator->AddString("vulkanVersion",
gpu::VulkanVersionToString(vulkan_version));
#endif
- enumerator->AddInt("videoDecodeAcceleratorFlags",
- video_decode_accelerator_capabilities.flags);
-
- // TODO(crbug.com/966839): Fix the two supported profile dumping below.
- for (const auto& profile :
- video_decode_accelerator_capabilities.supported_profiles) {
- EnumerateVideoDecodeAcceleratorSupportedProfile(profile, enumerator);
- }
- for (const auto& profile : video_decoder_capabilities)
+ for (const auto& profile : video_decode_accelerator_supported_profiles)
EnumerateVideoDecodeAcceleratorSupportedProfile(profile, enumerator);
for (const auto& profile : video_encode_accelerator_supported_profiles)
EnumerateVideoEncodeAcceleratorSupportedProfile(profile, enumerator);
diff --git a/chromium/gpu/config/gpu_info.h b/chromium/gpu/config/gpu_info.h
index 3e76ca1cd33..0a0c9684161 100644
--- a/chromium/gpu/config/gpu_info.h
+++ b/chromium/gpu/config/gpu_info.h
@@ -303,6 +303,13 @@ struct GPU_EXPORT GPUInfo {
unsigned int GpuCount() const;
+ // Return true if it's a multi-gpu system and there is a single integrated
+ // GPU identified.
+ bool GetIntegratedGpu(GPUDevice* output_integrated_gpu) const;
+ // Return true if it's a multi-gpu system and there is a discrete GPU.
+ // |output_discrete_gpu| is the first non-Intel GPU.
+ bool GetDiscreteGpu(GPUDevice* output_discrete_gpu) const;
+
// The amount of time taken to get from the process starting to the message
// loop being pumped.
base::TimeDelta initialization_time;
@@ -415,10 +422,8 @@ struct GPU_EXPORT GPUInfo {
// The GPU hardware overlay info.
OverlayInfo overlay_info;
#endif
-
- // Video decoding uses two backends: the legacy VDA and the new VideoDecoder.
- VideoDecodeAcceleratorCapabilities video_decode_accelerator_capabilities;
- VideoDecodeAcceleratorSupportedProfiles video_decoder_capabilities;
+ VideoDecodeAcceleratorSupportedProfiles
+ video_decode_accelerator_supported_profiles;
VideoEncodeAcceleratorSupportedProfiles
video_encode_accelerator_supported_profiles;
diff --git a/chromium/gpu/config/gpu_info_collector.cc b/chromium/gpu/config/gpu_info_collector.cc
index f2100d10eca..4d1a80ecf29 100644
--- a/chromium/gpu/config/gpu_info_collector.cc
+++ b/chromium/gpu/config/gpu_info_collector.cc
@@ -13,7 +13,6 @@
#include "base/base_paths.h"
#include "base/command_line.h"
-#include "base/cxx17_backports.h"
#include "base/files/file_path.h"
#include "base/logging.h"
#include "base/metrics/histogram_functions.h"
@@ -300,16 +299,14 @@ bool CollectBasicGraphicsInfo(const base::CommandLine* command_line,
&fallback_to_software);
// If GL is disabled then we don't need GPUInfo.
- if (implementation && *implementation == gl::kGLImplementationDisabled) {
+ if (implementation == gl::kGLImplementationDisabled) {
gpu_info->gl_vendor = "Disabled";
gpu_info->gl_renderer = "Disabled";
gpu_info->gl_version = "Disabled";
return true;
}
- gl::GLImplementationParts legacy_impl =
- gl::GetLegacySoftwareGLImplementation();
- if (implementation && *implementation == legacy_impl) {
+ if (implementation == gl::GetSoftwareGLImplementation()) {
// If using the software GL implementation, use fake vendor and
// device ids to make sure it never gets blocklisted. It allows us
// to proceed with loading the blocklist which may have non-device
@@ -318,21 +315,6 @@ bool CollectBasicGraphicsInfo(const base::CommandLine* command_line,
gpu_info->gpu.vendor_id = 0xffff;
gpu_info->gpu.device_id = 0xffff;
- // Also declare the driver_vendor to be <software GL> to be able to
- // specify exceptions based on driver_vendor==<software GL> for some
- // blocklist rules.
- gpu_info->gpu.driver_vendor = gl::GetGLImplementationGLName(legacy_impl);
-
- return true;
- }
-
- if (implementation &&
- *implementation == gl::ANGLEImplementation::kSwiftShader) {
- // Similarly to the above, use fake vendor and device ids
- // to make sure they never gets blocklisted for SwANGLE as well.
- gpu_info->gpu.vendor_id = 0xffff;
- gpu_info->gpu.device_id = 0xffff;
-
// Also declare the driver_vendor to be <SwANGLE> to be able to
// specify exceptions based on driver_vendor==<SwANGLE> for some
// blocklist rules.
@@ -473,7 +455,7 @@ void IdentifyActiveGPU(GPUInfo* gpu_info) {
if (!gpu_info->gl_vendor.empty()) {
std::string gl_vendor_lower = base::ToLowerASCII(gpu_info->gl_vendor);
int index = StringContainsName(gl_vendor_lower, kVendorNames,
- base::size(kVendorNames));
+ std::size(kVendorNames));
if (index >= 0) {
active_vendor_id = kVendorIDs[index];
}
@@ -481,7 +463,7 @@ void IdentifyActiveGPU(GPUInfo* gpu_info) {
if (active_vendor_id == 0 && !gpu_info->gl_renderer.empty()) {
std::string gl_renderer_lower = base::ToLowerASCII(gpu_info->gl_renderer);
int index = StringContainsName(gl_renderer_lower, kVendorNames,
- base::size(kVendorNames));
+ std::size(kVendorNames));
if (index >= 0) {
active_vendor_id = kVendorIDs[index];
}
diff --git a/chromium/gpu/config/gpu_info_collector.h b/chromium/gpu/config/gpu_info_collector.h
index c59c7bf2f60..a589192f034 100644
--- a/chromium/gpu/config/gpu_info_collector.h
+++ b/chromium/gpu/config/gpu_info_collector.h
@@ -26,35 +26,6 @@ class CommandLine;
}
namespace gpu {
-
-#if BUILDFLAG(IS_WIN)
-// TODO(magchen@): Remove D3D_FEATURE_LEVEL_CHROMIUM and
-// D3D_SHADER_MODEL_CHROMIUM and use D3D_FEATURE_LEVEL directly once the Windows
-// Kits is updated from version 19041 to a newer version 20170 or later.
-// D3D_FEATURE_LEVEL is defined in
-// third_party\depot_tools\win_toolchain\vs_files\ 20d5f2553f\Windows
-// Kits\10\Include\10.0.19041.0\um\d3dcommon.h
-
-// This is a temporary solution for adding D3D_FEATURE_LEVEL_12_2 to D3D12 API.
-// Do not use enum D3D_FEATURE_LEVEL_CHROMIUM for D3D11 now. The support for
-// D3D_FEATURE_LEVEL_12_2 has not been surfaced through D3D11 API.
-
-typedef enum D3D_FEATURE_LEVEL_CHROMIUM {
- D3D12_FEATURE_LEVEL_1_0_CORE = 0x1000,
- D3D12_FEATURE_LEVEL_9_1 = 0x9100,
- D3D12_FEATURE_LEVEL_9_2 = 0x9200,
- D3D12_FEATURE_LEVEL_9_3 = 0x9300,
- D3D12_FEATURE_LEVEL_10_0 = 0xa000,
- D3D12_FEATURE_LEVEL_10_1 = 0xa100,
- D3D12_FEATURE_LEVEL_11_0 = 0xb000,
- D3D12_FEATURE_LEVEL_11_1 = 0xb100,
- D3D12_FEATURE_LEVEL_12_0 = 0xc000,
- D3D12_FEATURE_LEVEL_12_1 = 0xc100,
- D3D12_FEATURE_LEVEL_12_2 = 0xc200,
-} D3D_FEATURE_LEVEL_CHROMIUM;
-
-#endif // BUILDFLAG(IS_WIN)
-
// Collects basic GPU info without creating a GL/DirectX context (and without
// the danger of crashing), including vendor_id and device_id.
// This is called at browser process startup time.
diff --git a/chromium/gpu/config/gpu_info_collector_fuchsia.cc b/chromium/gpu/config/gpu_info_collector_fuchsia.cc
index 0288191a68c..1065114398d 100644
--- a/chromium/gpu/config/gpu_info_collector_fuchsia.cc
+++ b/chromium/gpu/config/gpu_info_collector_fuchsia.cc
@@ -5,6 +5,7 @@
#include "gpu/config/gpu_info_collector.h"
#include "base/trace_event/trace_event.h"
+#include "third_party/angle/src/gpu_info_util/SystemInfo.h"
namespace gpu {
@@ -17,8 +18,12 @@ bool CollectContextGraphicsInfo(GPUInfo* gpu_info) {
}
bool CollectBasicGraphicsInfo(GPUInfo* gpu_info) {
- // TODO(https://crbug.com/950587): Implement this.
- return false;
+ DCHECK(gpu_info);
+
+ angle::SystemInfo system_info;
+ bool success = angle::GetSystemInfo(&system_info);
+ FillGPUInfoFromSystemInfo(gpu_info, &system_info);
+ return success;
}
} // namespace gpu
diff --git a/chromium/gpu/config/gpu_info_collector_win.cc b/chromium/gpu/config/gpu_info_collector_win.cc
index f871480eef7..4a24a9fbe00 100644
--- a/chromium/gpu/config/gpu_info_collector_win.cc
+++ b/chromium/gpu/config/gpu_info_collector_win.cc
@@ -42,18 +42,6 @@ namespace gpu {
namespace {
-// TODO(magchen@): Remove PFN_D3D12_CREATE_DEVICE_CHROMIUM and use
-// PFN_D3D12_CREATE_DEVICE from d3d12.h directly once the Windows toolchain is
-// updated.
-
-// Declaration for D3D12CreateDevice() with D3D_FEATURE_LEVEL_12_2 support in
-// D3D_FEATURE_LEVEL_CHROMIUM.
-typedef HRESULT(WINAPI* PFN_D3D12_CREATE_DEVICE_CHROMIUM)(
- _In_opt_ IUnknown*,
- D3D_FEATURE_LEVEL_CHROMIUM,
- _In_ REFIID,
- _COM_Outptr_opt_ void**);
-
// These values are persisted to logs. Entries should not be renumbered and
// numeric values should never be reused.
// This should match enum D3D12FeatureLevel in
@@ -73,15 +61,15 @@ inline D3D12FeatureLevel ConvertToHistogramFeatureLevel(
switch (d3d_feature_level) {
case 0:
return D3D12FeatureLevel::kD3DFeatureLevelUnknown;
- case D3D12_FEATURE_LEVEL_12_0:
+ case D3D_FEATURE_LEVEL_12_0:
return D3D12FeatureLevel::kD3DFeatureLevel_12_0;
- case D3D12_FEATURE_LEVEL_12_1:
+ case D3D_FEATURE_LEVEL_12_1:
return D3D12FeatureLevel::kD3DFeatureLevel_12_1;
- case D3D12_FEATURE_LEVEL_12_2:
+ case D3D_FEATURE_LEVEL_12_2:
return D3D12FeatureLevel::kD3DFeatureLevel_12_2;
- case D3D12_FEATURE_LEVEL_11_0:
+ case D3D_FEATURE_LEVEL_11_0:
return D3D12FeatureLevel::kD3DFeatureLevel_11_0;
- case D3D12_FEATURE_LEVEL_11_1:
+ case D3D_FEATURE_LEVEL_11_1:
return D3D12FeatureLevel::kD3DFeatureLevel_11_1;
default:
NOTREACHED();
@@ -347,13 +335,12 @@ void GetGpuSupportedD3D12Version(uint32_t& d3d12_feature_level,
return;
// The order of feature levels to attempt to create in D3D CreateDevice
- const D3D_FEATURE_LEVEL_CHROMIUM feature_levels[] = {
- D3D12_FEATURE_LEVEL_12_2, D3D12_FEATURE_LEVEL_12_1,
- D3D12_FEATURE_LEVEL_12_0, D3D12_FEATURE_LEVEL_11_1,
- D3D12_FEATURE_LEVEL_11_0};
+ const D3D_FEATURE_LEVEL feature_levels[] = {
+ D3D_FEATURE_LEVEL_12_2, D3D_FEATURE_LEVEL_12_1, D3D_FEATURE_LEVEL_12_0,
+ D3D_FEATURE_LEVEL_11_1, D3D_FEATURE_LEVEL_11_0};
- PFN_D3D12_CREATE_DEVICE_CHROMIUM D3D12CreateDevice =
- reinterpret_cast<PFN_D3D12_CREATE_DEVICE_CHROMIUM>(
+ PFN_D3D12_CREATE_DEVICE D3D12CreateDevice =
+ reinterpret_cast<PFN_D3D12_CREATE_DEVICE>(
d3d12_library.GetFunctionPointer("D3D12CreateDevice"));
Microsoft::WRL::ComPtr<ID3D12Device> d3d12_device;
if (D3D12CreateDevice) {
diff --git a/chromium/gpu/config/gpu_lists_version.h b/chromium/gpu/config/gpu_lists_version.h
index 2d21dc36e35..e58a7f6fa95 100644
--- a/chromium/gpu/config/gpu_lists_version.h
+++ b/chromium/gpu/config/gpu_lists_version.h
@@ -3,6 +3,6 @@
#ifndef GPU_CONFIG_GPU_LISTS_VERSION_H_
#define GPU_CONFIG_GPU_LISTS_VERSION_H_
-#define GPU_LISTS_VERSION "c36020807021cc81db1026df414f551ad0c5d24f"
+#define GPU_LISTS_VERSION "76de02bc398043843909a8da1c2bc69ad3d2e5bf"
#endif // GPU_CONFIG_GPU_LISTS_VERSION_H_
diff --git a/chromium/gpu/config/gpu_preferences.h b/chromium/gpu/config/gpu_preferences.h
index 17f2c704291..3ea2191b50a 100644
--- a/chromium/gpu/config/gpu_preferences.h
+++ b/chromium/gpu/config/gpu_preferences.h
@@ -203,8 +203,6 @@ struct GPU_EXPORT GpuPreferences {
// Ignores GPU blocklist.
bool ignore_gpu_blocklist = false;
- bool enable_oop_rasterization_ddl = false;
-
// Start the watchdog suspended, as the app is already backgrounded and won't
// send a background/suspend signal.
bool watchdog_starts_backgrounded = false;
diff --git a/chromium/gpu/config/gpu_util.cc b/chromium/gpu/config/gpu_util.cc
index f5150ef2412..972db1c91db 100644
--- a/chromium/gpu/config/gpu_util.cc
+++ b/chromium/gpu/config/gpu_util.cc
@@ -78,7 +78,8 @@ enum class D3D11FeatureLevel {
k11_1 = 10,
k12_0 = 11,
k12_1 = 12,
- kMaxValue = k12_1,
+ k12_2 = 13,
+ kMaxValue = k12_2,
};
inline D3D11FeatureLevel ConvertToHistogramD3D11FeatureLevel(
@@ -104,6 +105,8 @@ inline D3D11FeatureLevel ConvertToHistogramD3D11FeatureLevel(
return D3D11FeatureLevel::k12_0;
case D3D_FEATURE_LEVEL_12_1:
return D3D11FeatureLevel::k12_1;
+ case D3D_FEATURE_LEVEL_12_2:
+ return D3D11FeatureLevel::k12_2;
default:
NOTREACHED();
return D3D11FeatureLevel::kUnknown;
@@ -217,6 +220,16 @@ GpuFeatureStatus GetWebGL2FeatureStatus(
return kGpuFeatureStatusEnabled;
}
+GpuFeatureStatus GetWebGPUFeatureStatus(
+ const std::set<int>& blocklisted_features,
+ bool use_swift_shader) {
+ if (use_swift_shader)
+ return kGpuFeatureStatusSoftware;
+ if (blocklisted_features.count(GPU_FEATURE_TYPE_ACCELERATED_WEBGPU))
+ return kGpuFeatureStatusSoftware;
+ return kGpuFeatureStatusEnabled;
+}
+
GpuFeatureStatus Get2DCanvasFeatureStatus(
const std::set<int>& blocklisted_features,
bool use_swift_shader) {
@@ -429,6 +442,8 @@ GpuFeatureInfo ComputeGpuFeatureInfoWithHardwareAccelerationDisabled() {
kGpuFeatureStatusDisabled;
gpu_feature_info.status_values[GPU_FEATURE_TYPE_CANVAS_OOP_RASTERIZATION] =
kGpuFeatureStatusDisabled;
+ gpu_feature_info.status_values[GPU_FEATURE_TYPE_ACCELERATED_WEBGPU] =
+ kGpuFeatureStatusSoftware;
#if DCHECK_IS_ON()
for (int ii = 0; ii < NUMBER_OF_GPU_FEATURE_TYPES; ++ii) {
DCHECK_NE(kGpuFeatureStatusUndefined, gpu_feature_info.status_values[ii]);
@@ -461,6 +476,8 @@ GpuFeatureInfo ComputeGpuFeatureInfoWithNoGpu() {
kGpuFeatureStatusDisabled;
gpu_feature_info.status_values[GPU_FEATURE_TYPE_CANVAS_OOP_RASTERIZATION] =
kGpuFeatureStatusDisabled;
+ gpu_feature_info.status_values[GPU_FEATURE_TYPE_ACCELERATED_WEBGPU] =
+ kGpuFeatureStatusSoftware;
#if DCHECK_IS_ON()
for (int ii = 0; ii < NUMBER_OF_GPU_FEATURE_TYPES; ++ii) {
DCHECK_NE(kGpuFeatureStatusUndefined, gpu_feature_info.status_values[ii]);
@@ -493,6 +510,8 @@ GpuFeatureInfo ComputeGpuFeatureInfoForSwiftShader() {
kGpuFeatureStatusDisabled;
gpu_feature_info.status_values[GPU_FEATURE_TYPE_CANVAS_OOP_RASTERIZATION] =
kGpuFeatureStatusDisabled;
+ gpu_feature_info.status_values[GPU_FEATURE_TYPE_ACCELERATED_WEBGPU] =
+ kGpuFeatureStatusSoftware;
#if DCHECK_IS_ON()
for (int ii = 0; ii < NUMBER_OF_GPU_FEATURE_TYPES; ++ii) {
DCHECK_NE(kGpuFeatureStatusUndefined, gpu_feature_info.status_values[ii]);
@@ -521,8 +540,7 @@ GpuFeatureInfo ComputeGpuFeatureInfo(const GPUInfo& gpu_info,
std::string use_gl = command_line->GetSwitchValueASCII(switches::kUseGL);
std::string use_angle =
command_line->GetSwitchValueASCII(switches::kUseANGLE);
- if (use_gl == gl::kGLImplementationSwiftShaderForWebGLName ||
- use_angle == gl::kANGLEImplementationSwiftShaderForWebGLName) {
+ if (use_angle == gl::kANGLEImplementationSwiftShaderForWebGLName) {
return ComputeGpuFeatureInfoForSwiftShader();
}
}
@@ -570,6 +588,8 @@ GpuFeatureInfo ComputeGpuFeatureInfo(const GPUInfo& gpu_info,
GetWebGLFeatureStatus(blocklisted_features, use_swift_shader);
gpu_feature_info.status_values[GPU_FEATURE_TYPE_ACCELERATED_WEBGL2] =
GetWebGL2FeatureStatus(blocklisted_features, use_swift_shader);
+ gpu_feature_info.status_values[GPU_FEATURE_TYPE_ACCELERATED_WEBGPU] =
+ GetWebGPUFeatureStatus(blocklisted_features, use_swift_shader);
gpu_feature_info.status_values[GPU_FEATURE_TYPE_ACCELERATED_2D_CANVAS] =
Get2DCanvasFeatureStatus(blocklisted_features, use_swift_shader);
#if !BUILDFLAG(IS_CHROMEOS)
@@ -745,7 +765,8 @@ bool InitializeGLThreadSafe(base::CommandLine* command_line,
}
if (gl::GetGLImplementation() == gl::kGLImplementationNone) {
// Some tests initialize bindings by themselves.
- if (!gl::init::InitializeGLNoExtensionsOneOff(/*init_bindings*/ true)) {
+ if (!gl::init::InitializeGLNoExtensionsOneOff(/*init_bindings=*/true,
+ /*system_device_id=*/0)) {
VLOG(1) << "gl::init::InitializeGLNoExtensionsOneOff failed";
return false;
}
diff --git a/chromium/gpu/config/process_json.py b/chromium/gpu/config/process_json.py
index 119f8c0c700..af2c699661f 100755
--- a/chromium/gpu/config/process_json.py
+++ b/chromium/gpu/config/process_json.py
@@ -33,6 +33,7 @@ _OS_TYPE_MAP = {
'android': 'kOsAndroid',
'linux': 'kOsLinux',
'chromeos': 'kOsChromeOS',
+ 'fuchsia': 'kOsFuchsia',
'': 'kOsAny',
}
@@ -187,7 +188,7 @@ def write_disabled_extension_list(entry_kind, entry_id, data, data_file,
data_helper_file.write(',\n')
data_helper_file.write('};\n\n')
# use the list
- data_file.write('base::size(%s), // %s size\n' % (var_name, entry_kind))
+ data_file.write('std::size(%s), // %s size\n' % (var_name, entry_kind))
data_file.write('%s, // %s\n' % (var_name, entry_kind))
else:
data_file.write('0, // %s size\n' % entry_kind)
@@ -293,7 +294,7 @@ def write_number_list(entry_id, data_type, name_tag, data, is_exception,
data_helper_file.write(',\n')
data_helper_file.write('};\n\n')
# reference the list
- data_file.write('base::size(%s), // %s size\n' % (var_name, name_tag))
+ data_file.write('std::size(%s), // %s size\n' % (var_name, name_tag))
data_file.write('%s, // %s\n' % (var_name, name_tag))
else:
data_file.write('0, // %s size\n' % name_tag)
@@ -349,7 +350,7 @@ def write_device_list(entry_id, device_id, device_revision, is_exception,
(device_id[ii], device_revision[ii]))
data_helper_file.write('};\n\n')
# reference the list
- data_file.write('base::size(%s), // Devices size\n' % var_name)
+ data_file.write('std::size(%s), // Devices size\n' % var_name)
data_file.write('%s, // Devices\n' % var_name)
else:
assert not device_revision
@@ -381,7 +382,7 @@ def write_machine_model_info(entry_id, is_exception, exception_id,
data_helper_file.write(
'const GpuControlList::MachineModelInfo %s = {\n' % var_name)
if machine_model_name:
- data_helper_file.write('base::size(%s), // machine model name size\n' %
+ data_helper_file.write('std::size(%s), // machine model name size\n' %
model_name_var_name)
data_helper_file.write('%s, // machine model names\n' %
model_name_var_name)
@@ -589,6 +590,8 @@ def write_conditions(entry_id, is_exception, exception_id, entry,
write_multi_gpu_style(multi_gpu_style, data_file)
# group driver info
if driver_vendor != '' or driver_version != None:
+ if multi_gpu_category != '':
+ assert vendor_id != 0, 'Need vendor_id in entry with id: '+ str(entry_id)
if driver_version and driver_version.get('schema') == 'intel_driver':
assert os_type == 'win', 'Intel driver schema is only for Windows'
is_intel = (format(vendor_id, '#04x') == '0x8086' or
@@ -690,7 +693,7 @@ def write_intel_gpu_series_list(entry_id, is_exception, exception_id,
intel_gpu_series_map[series])
data_helper_file.write('};\n\n')
- data_file.write('base::size(%s), // intel_gpu_series size\n' % var_name)
+ data_file.write('std::size(%s), // intel_gpu_series size\n' % var_name)
data_file.write('%s, // intel_gpu_series\n' % var_name)
else:
data_file.write('0, // intel_gpu_series size\n')
@@ -752,7 +755,7 @@ def write_entry(entry, total_feature_set, feature_name_prefix,
var_name = 'kFeatureListFor%sEntry%d' % (unique_symbol_id, entry_id)
features = entry['features']
feature_set = get_feature_set(features, total_feature_set)
- data_file.write('base::size(%s), // features size\n' % var_name)
+ data_file.write('std::size(%s), // features size\n' % var_name)
data_file.write('%s, // features\n' % var_name)
write_features(feature_set, feature_name_prefix, var_name, data_helper_file)
else:
@@ -795,7 +798,7 @@ def write_entry(entry, total_feature_set, feature_name_prefix,
data_exception_file, data_helper_file, None)
data_exception_file.write('},\n')
data_exception_file.write('};\n\n')
- data_file.write('base::size(%s), // exceptions count\n' % exception_var)
+ data_file.write('std::size(%s), // exceptions count\n' % exception_var)
data_file.write('%s, // exceptions\n' % exception_var)
else:
data_file.write('0, // exceptions count\n')
@@ -836,6 +839,7 @@ def process_json_file(json_filepath, list_tag,
data_file.write(_LICENSE)
data_file.write(_DO_NOT_EDIT_WARNING)
data_file.write('#include "%s/%s"\n\n' % (path, output_header_filename))
+ data_file.write('#include <iterator>\n\n')
data_file.write('#include "%s/%s"\n' % (path, output_helper_filename))
data_file.write('#include "%s/%s"\n\n' % (path, output_exception_filename))
data_helper_file = open(output_helper_filepath, 'w')
diff --git a/chromium/gpu/config/software_rendering_list.json b/chromium/gpu/config/software_rendering_list.json
index 4494ebaebda..8ed8faf0a07 100644
--- a/chromium/gpu/config/software_rendering_list.json
+++ b/chromium/gpu/config/software_rendering_list.json
@@ -989,6 +989,7 @@
},
"exceptions": [
{
+ "vendor_id": "0x1002",
"driver_version": {
"comment": "INF_version: 21.19.384.0; date: 12/04/2016",
"op": ">=",
@@ -1279,6 +1280,7 @@
"value": "10"
}
},
+ "vendor_id": "0x1002",
"driver_version": {
"op": "<",
"value": "20.19.0.32837"
@@ -1528,6 +1530,7 @@
},
"exceptions": [
{
+ "vendor_id": "0x1002",
"driver_version": {
"op": ">=",
"value": "8.17.10.1433"
@@ -1670,12 +1673,12 @@
},
{
"id": 174,
- "description": "Disable canvas acceleration on a specific Haswell GPU on ChromeOS",
+ "description": "Disable canvas acceleration on some Haswell GPUs on ChromeOS",
"os": {
"type": "chromeos"
},
"vendor_id": "0x8086",
- "device_id": ["0x0a16"],
+ "device_id": ["0x0a16", "0x0a1e"],
"features": [
"accelerated_2d_canvas"
]
diff --git a/chromium/gpu/gles2_conform_support/egl/display.cc b/chromium/gpu/gles2_conform_support/egl/display.cc
index 422dc385e6f..6ff47fca417 100644
--- a/chromium/gpu/gles2_conform_support/egl/display.cc
+++ b/chromium/gpu/gles2_conform_support/egl/display.cc
@@ -6,7 +6,6 @@
#include <memory>
-#include "base/cxx17_backports.h"
#include "build/build_config.h"
#include "gpu/gles2_conform_support/egl/config.h"
#include "gpu/gles2_conform_support/egl/context.h"
@@ -90,7 +89,7 @@ EGLBoolean Display::ChooseConfig(ThreadState* ts,
if (!configs)
config_size = 0;
*num_config = 0;
- for (size_t i = 0; i < base::size(configs_); ++i) {
+ for (size_t i = 0; i < std::size(configs_); ++i) {
if (configs_[i]->Matches(attrib_list)) {
if (*num_config < config_size) {
configs[*num_config] = configs_[i].get();
@@ -113,9 +112,9 @@ EGLBoolean Display::GetConfigs(ThreadState* ts,
InitializeConfigsIfNeeded();
if (!configs)
config_size = 0;
- *num_config = base::size(configs_);
+ *num_config = std::size(configs_);
size_t count =
- std::min(base::size(configs_), static_cast<size_t>(config_size));
+ std::min(std::size(configs_), static_cast<size_t>(config_size));
for (size_t i = 0; i < count; ++i)
configs[i] = configs_[i].get();
return ts->ReturnSuccess(EGL_TRUE);
diff --git a/chromium/gpu/gles2_conform_support/egl/thread_state.cc b/chromium/gpu/gles2_conform_support/egl/thread_state.cc
index 4013ebe0cfd..624b9dc0488 100644
--- a/chromium/gpu/gles2_conform_support/egl/thread_state.cc
+++ b/chromium/gpu/gles2_conform_support/egl/thread_state.cc
@@ -88,7 +88,8 @@ egl::ThreadState* ThreadState::Get() {
#if defined(USE_OZONE)
ui::OzonePlatform::InitializeForGPU(ui::OzonePlatform::InitParams());
#endif
- gl::init::InitializeGLNoExtensionsOneOff(/*init_bindings*/ true);
+ gl::init::InitializeGLNoExtensionsOneOff(/*init_bindings=*/true,
+ /*system_device_id=*/0);
gpu::GpuFeatureInfo gpu_feature_info;
if (!command_line->HasSwitch(switches::kDisableGpuDriverBugWorkarounds)) {
gpu::GPUInfo gpu_info;
diff --git a/chromium/gpu/ipc/client/command_buffer_proxy_impl.cc b/chromium/gpu/ipc/client/command_buffer_proxy_impl.cc
index 2a3fac8ca76..cb0701abd3f 100644
--- a/chromium/gpu/ipc/client/command_buffer_proxy_impl.cc
+++ b/chromium/gpu/ipc/client/command_buffer_proxy_impl.cc
@@ -13,6 +13,7 @@
#include "base/logging.h"
#include "base/metrics/histogram.h"
#include "base/metrics/histogram_macros.h"
+#include "base/observer_list.h"
#include "base/threading/thread_task_runner_handle.h"
#include "base/timer/elapsed_timer.h"
#include "base/trace_event/trace_event.h"
diff --git a/chromium/gpu/ipc/client/gpu_channel_host.cc b/chromium/gpu/ipc/client/gpu_channel_host.cc
index 05eedf30140..53a1e54531d 100644
--- a/chromium/gpu/ipc/client/gpu_channel_host.cc
+++ b/chromium/gpu/ipc/client/gpu_channel_host.cc
@@ -19,6 +19,7 @@
#include "gpu/ipc/common/gpu_watchdog_timeout.h"
#include "ipc/ipc_channel_mojo.h"
#include "mojo/public/cpp/bindings/lib/message_quota_checker.h"
+#include "mojo/public/cpp/bindings/sync_call_restrictions.h"
#include "url/gurl.h"
using base::AutoLock;
diff --git a/chromium/gpu/ipc/client/image_decode_accelerator_proxy_unittest.cc b/chromium/gpu/ipc/client/image_decode_accelerator_proxy_unittest.cc
index 3c9da22ee1e..050e3b0baf5 100644
--- a/chromium/gpu/ipc/client/image_decode_accelerator_proxy_unittest.cc
+++ b/chromium/gpu/ipc/client/image_decode_accelerator_proxy_unittest.cc
@@ -2,15 +2,15 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
+#include "gpu/ipc/client/image_decode_accelerator_proxy.h"
+
#include <memory>
#include <utility>
#include <vector>
-#include "base/cxx17_backports.h"
#include "base/test/task_environment.h"
#include "cc/paint/paint_image.h"
#include "gpu/ipc/client/gpu_channel_host.h"
-#include "gpu/ipc/client/image_decode_accelerator_proxy.h"
#include "gpu/ipc/common/command_buffer_id.h"
#include "gpu/ipc/common/mock_gpu_channel.h"
#include "testing/gmock/include/gmock/gmock.h"
@@ -76,7 +76,7 @@ class ImageDecodeAcceleratorProxyTest : public ::testing::Test {
TEST_F(ImageDecodeAcceleratorProxyTest, ScheduleImageDecodeSendsMessage) {
const uint8_t image[4] = {1, 2, 3, 4};
base::span<const uint8_t> encoded_data =
- base::span<const uint8_t>(image, base::size(image));
+ base::span<const uint8_t>(image, std::size(image));
const gfx::ColorSpace color_space = gfx::ColorSpace::CreateSRGB();
diff --git a/chromium/gpu/ipc/client/raster_in_process_context_tests.cc b/chromium/gpu/ipc/client/raster_in_process_context_tests.cc
index 0750a6a1c0f..b77e9f2caf1 100644
--- a/chromium/gpu/ipc/client/raster_in_process_context_tests.cc
+++ b/chromium/gpu/ipc/client/raster_in_process_context_tests.cc
@@ -106,8 +106,8 @@ TEST_F(RasterInProcessCommandBufferTest, AllowedBetweenBeginEndRasterCHROMIUM) {
// Call BeginRasterCHROMIUM.
ri_->BeginRasterCHROMIUM(
/*sk_color=*/0, /*needs_clear=*/true, /*msaa_sample_count=*/0,
- gpu::raster::kNoMSAA, /*can_use_lcd_text=*/false, color_space,
- mailbox.name);
+ gpu::raster::kNoMSAA, /*can_use_lcd_text=*/false, /*visible=*/true,
+ color_space, mailbox.name);
EXPECT_EQ(static_cast<GLenum>(GL_NO_ERROR), ri_->GetError());
// Should flag an error this command is not allowed between a Begin and
diff --git a/chromium/gpu/ipc/common/context_creation_attribs_mojom_traits.h b/chromium/gpu/ipc/common/context_creation_attribs_mojom_traits.h
index 3f786ebf2e3..4175047af44 100644
--- a/chromium/gpu/ipc/common/context_creation_attribs_mojom_traits.h
+++ b/chromium/gpu/ipc/common/context_creation_attribs_mojom_traits.h
@@ -5,6 +5,7 @@
#ifndef GPU_IPC_COMMON_CONTEXT_CREATION_ATTRIBS_MOJOM_TRAITS_H_
#define GPU_IPC_COMMON_CONTEXT_CREATION_ATTRIBS_MOJOM_TRAITS_H_
+#include "base/notreached.h"
#include "gpu/command_buffer/common/context_creation_attribs.h"
#include "gpu/gpu_export.h"
#include "gpu/ipc/common/gpu_channel.mojom-shared.h"
diff --git a/chromium/gpu/ipc/common/context_result_mojom_traits.h b/chromium/gpu/ipc/common/context_result_mojom_traits.h
index c2db4ac0478..70d3c274ced 100644
--- a/chromium/gpu/ipc/common/context_result_mojom_traits.h
+++ b/chromium/gpu/ipc/common/context_result_mojom_traits.h
@@ -5,6 +5,7 @@
#ifndef GPU_IPC_COMMON_CONTEXT_RESULT_MOJOM_TRAITS_H_
#define GPU_IPC_COMMON_CONTEXT_RESULT_MOJOM_TRAITS_H_
+#include "base/notreached.h"
#include "gpu/command_buffer/common/context_result.h"
#include "gpu/gpu_export.h"
#include "gpu/ipc/common/context_result.mojom-shared.h"
diff --git a/chromium/gpu/ipc/common/device_perf_info.mojom b/chromium/gpu/ipc/common/device_perf_info.mojom
index de7b95826f8..54f3606ffe2 100644
--- a/chromium/gpu/ipc/common/device_perf_info.mojom
+++ b/chromium/gpu/ipc/common/device_perf_info.mojom
@@ -16,6 +16,7 @@ enum Direct3DFeatureLevel {
k11_1,
k12_0,
k12_1,
+ k12_2,
};
// Corresponds to |gpu::HasDisceretGpu| in "gpu/config/device_perf_info.h"
diff --git a/chromium/gpu/ipc/common/device_perf_info_mojom_traits.cc b/chromium/gpu/ipc/common/device_perf_info_mojom_traits.cc
index 0300de17777..eed53f4e3ae 100644
--- a/chromium/gpu/ipc/common/device_perf_info_mojom_traits.cc
+++ b/chromium/gpu/ipc/common/device_perf_info_mojom_traits.cc
@@ -34,6 +34,8 @@ EnumTraits<gpu::mojom::Direct3DFeatureLevel, D3D_FEATURE_LEVEL>::ToMojom(
return gpu::mojom::Direct3DFeatureLevel::k12_0;
case D3D_FEATURE_LEVEL_12_1:
return gpu::mojom::Direct3DFeatureLevel::k12_1;
+ case D3D_FEATURE_LEVEL_12_2:
+ return gpu::mojom::Direct3DFeatureLevel::k12_2;
}
NOTREACHED() << "Invalid D3D_FEATURE_LEVEL:" << d3d_feature_level;
return gpu::mojom::Direct3DFeatureLevel::k1_0_Core;
@@ -74,6 +76,9 @@ bool EnumTraits<gpu::mojom::Direct3DFeatureLevel, D3D_FEATURE_LEVEL>::FromMojom(
case gpu::mojom::Direct3DFeatureLevel::k12_1:
*out = D3D_FEATURE_LEVEL_12_1;
return true;
+ case gpu::mojom::Direct3DFeatureLevel::k12_2:
+ *out = D3D_FEATURE_LEVEL_12_2;
+ return true;
}
NOTREACHED() << "Invalid D3D_FEATURE_LEVEL: " << input;
return false;
diff --git a/chromium/gpu/ipc/common/dxgi_helpers.cc b/chromium/gpu/ipc/common/dxgi_helpers.cc
index 066d205418f..811fb1e995c 100644
--- a/chromium/gpu/ipc/common/dxgi_helpers.cc
+++ b/chromium/gpu/ipc/common/dxgi_helpers.cc
@@ -68,7 +68,7 @@ DXGIScopedReleaseKeyedMutex::~DXGIScopedReleaseKeyedMutex() {
bool CopyDXGIBufferToShMem(
HANDLE dxgi_handle,
- base::UnsafeSharedMemoryRegion shared_memory,
+ base::span<uint8_t> shared_memory,
ID3D11Device* d3d11_device,
Microsoft::WRL::ComPtr<ID3D11Texture2D>* staging_texture) {
DCHECK(d3d11_device);
@@ -149,12 +149,11 @@ bool CopyDXGIBufferToShMem(
// Copy mapped texture to shared memory region for client
size_t buffer_size = texture_desc.Height * texture_desc.Width * 3 / 2;
- if (shared_memory.GetSize() < buffer_size)
+ if (shared_memory.size() < buffer_size)
return false;
- base::WritableSharedMemoryMapping mapping = shared_memory.Map();
const uint8_t* source_buffer = static_cast<uint8_t*>(mapped_resource.pData);
- uint8_t* dest_buffer = mapping.GetMemoryAsSpan<uint8_t>().data();
+ uint8_t* dest_buffer = shared_memory.data();
const uint32_t source_stride = mapped_resource.RowPitch;
const uint32_t dest_stride = texture_desc.Width;
diff --git a/chromium/gpu/ipc/common/dxgi_helpers.h b/chromium/gpu/ipc/common/dxgi_helpers.h
index e2797e2a950..4adb9293957 100644
--- a/chromium/gpu/ipc/common/dxgi_helpers.h
+++ b/chromium/gpu/ipc/common/dxgi_helpers.h
@@ -9,6 +9,7 @@
#include <dxgi.h>
#include <wrl/client.h>
+#include "base/containers/span.h"
#include "base/memory/unsafe_shared_memory_region.h"
#include "gpu/gpu_export.h"
@@ -60,7 +61,7 @@ class GPU_EXPORT DXGIScopedReleaseKeyedMutex {
// format. Returns true if succeeded.
GPU_EXPORT bool CopyDXGIBufferToShMem(
HANDLE dxgi_handle,
- base::UnsafeSharedMemoryRegion shared_memory,
+ base::span<uint8_t> shared_memory,
ID3D11Device* d3d11_device,
Microsoft::WRL::ComPtr<ID3D11Texture2D>* staging_texture);
diff --git a/chromium/gpu/ipc/common/gpu_channel.mojom b/chromium/gpu/ipc/common/gpu_channel.mojom
index cccc79fb63c..c9c11d0aae9 100644
--- a/chromium/gpu/ipc/common/gpu_channel.mojom
+++ b/chromium/gpu/ipc/common/gpu_channel.mojom
@@ -324,6 +324,10 @@ interface CommandBufferClient {
// Interface to control a single StreamTexture instance. Implemented in the GPU
// process and called by renderer clients.
+//
+// NOTE: Due to limitations of Channel-associated interfaces, message replies on
+// this interface must not be used to pass other associated interface remotes or
+// receivers.
[EnableIf=is_android]
interface StreamTexture {
// Tells the StreamTexture to send its SurfaceTexture to the browser process,
@@ -344,6 +348,10 @@ interface StreamTexture {
// Interface used by GPU to notify the client of a StreamTexture instance about
// new frame availability. Implemented by renderer clients and called by
// StreamTexture instances in the GPU process.
+//
+// NOTE: Due to limitations of Channel-associated interfaces, messages on this
+// interface must not be used to pass other associated interface remotes or
+// receivers.
[EnableIf=is_android]
interface StreamTextureClient {
// Informs the client that a new frame is available.
diff --git a/chromium/gpu/ipc/common/gpu_feature_info_mojom_traits.h b/chromium/gpu/ipc/common/gpu_feature_info_mojom_traits.h
index 9a8f47ccc60..d66c8e43416 100644
--- a/chromium/gpu/ipc/common/gpu_feature_info_mojom_traits.h
+++ b/chromium/gpu/ipc/common/gpu_feature_info_mojom_traits.h
@@ -5,6 +5,7 @@
#ifndef GPU_IPC_COMMON_GPU_FEATURE_INFO_MOJOM_TRAITS_H_
#define GPU_IPC_COMMON_GPU_FEATURE_INFO_MOJOM_TRAITS_H_
+#include "base/notreached.h"
#include "gpu/config/gpu_blocklist.h"
#include "gpu/config/gpu_driver_bug_list.h"
#include "gpu/config/gpu_feature_info.h"
diff --git a/chromium/gpu/ipc/common/gpu_info.mojom b/chromium/gpu/ipc/common/gpu_info.mojom
index d82b5bbfddb..307e64d2069 100644
--- a/chromium/gpu/ipc/common/gpu_info.mojom
+++ b/chromium/gpu/ipc/common/gpu_info.mojom
@@ -170,8 +170,8 @@ struct GpuInfo {
[EnableIf=is_win]
OverlayInfo overlay_info;
- VideoDecodeAcceleratorCapabilities video_decode_accelerator_capabilities;
- array<VideoDecodeAcceleratorSupportedProfile> video_decoder_capabilities;
+ array<VideoDecodeAcceleratorSupportedProfile>
+ video_decode_accelerator_supported_profiles;
array<VideoEncodeAcceleratorSupportedProfile>
video_encode_accelerator_supported_profiles;
bool jpeg_decode_accelerator_supported;
diff --git a/chromium/gpu/ipc/common/gpu_info_mojom_traits.cc b/chromium/gpu/ipc/common/gpu_info_mojom_traits.cc
index 99dd1cf7578..4cf025912e5 100644
--- a/chromium/gpu/ipc/common/gpu_info_mojom_traits.cc
+++ b/chromium/gpu/ipc/common/gpu_info_mojom_traits.cc
@@ -422,9 +422,8 @@ bool StructTraits<gpu::mojom::GpuInfoDataView, gpu::GPUInfo>::Read(
data.ReadOverlayInfo(&out->overlay_info) &&
data.ReadDxDiagnostics(&out->dx_diagnostics) &&
#endif
- data.ReadVideoDecodeAcceleratorCapabilities(
- &out->video_decode_accelerator_capabilities) &&
- data.ReadVideoDecoderCapabilities(&out->video_decoder_capabilities) &&
+ data.ReadVideoDecodeAcceleratorSupportedProfiles(
+ &out->video_decode_accelerator_supported_profiles) &&
data.ReadVideoEncodeAcceleratorSupportedProfiles(
&out->video_encode_accelerator_supported_profiles) &&
data.ReadImageDecodeAcceleratorSupportedProfiles(
diff --git a/chromium/gpu/ipc/common/gpu_info_mojom_traits.h b/chromium/gpu/ipc/common/gpu_info_mojom_traits.h
index 85c61ba5ddd..2dde0463f48 100644
--- a/chromium/gpu/ipc/common/gpu_info_mojom_traits.h
+++ b/chromium/gpu/ipc/common/gpu_info_mojom_traits.h
@@ -381,15 +381,9 @@ struct GPU_EXPORT StructTraits<gpu::mojom::GpuInfoDataView, gpu::GPUInfo> {
return input.overlay_info;
}
#endif
-
- static const gpu::VideoDecodeAcceleratorCapabilities&
- video_decode_accelerator_capabilities(const gpu::GPUInfo& input) {
- return input.video_decode_accelerator_capabilities;
- }
-
static const gpu::VideoDecodeAcceleratorSupportedProfiles&
- video_decoder_capabilities(const gpu::GPUInfo& input) {
- return input.video_decoder_capabilities;
+ video_decode_accelerator_supported_profiles(const gpu::GPUInfo& input) {
+ return input.video_decode_accelerator_supported_profiles;
}
static std::vector<gpu::VideoEncodeAcceleratorSupportedProfile>
@@ -415,7 +409,7 @@ struct GPU_EXPORT StructTraits<gpu::mojom::GpuInfoDataView, gpu::GPUInfo> {
}
#if BUILDFLAG(ENABLE_VULKAN)
- static const absl::optional<gpu::VulkanInfo> vulkan_info(
+ static const absl::optional<gpu::VulkanInfo>& vulkan_info(
const gpu::GPUInfo& input) {
return input.vulkan_info;
}
diff --git a/chromium/gpu/ipc/common/gpu_memory_buffer_impl_dxgi.cc b/chromium/gpu/ipc/common/gpu_memory_buffer_impl_dxgi.cc
index bf9897143d9..12f546291af 100644
--- a/chromium/gpu/ipc/common/gpu_memory_buffer_impl_dxgi.cc
+++ b/chromium/gpu/ipc/common/gpu_memory_buffer_impl_dxgi.cc
@@ -30,13 +30,14 @@ GpuMemoryBufferImplDXGI::CreateFromHandle(
gfx::BufferUsage usage,
DestructionCallback callback,
GpuMemoryBufferManager* gpu_memory_buffer_manager,
- scoped_refptr<base::UnsafeSharedMemoryPool> pool) {
+ scoped_refptr<base::UnsafeSharedMemoryPool> pool,
+ base::span<uint8_t> premapped_memory) {
DCHECK(handle.dxgi_handle.IsValid());
DCHECK(handle.dxgi_token.has_value());
return base::WrapUnique(new GpuMemoryBufferImplDXGI(
handle.id, size, format, std::move(callback),
std::move(handle.dxgi_handle), std::move(handle.dxgi_token.value()),
- gpu_memory_buffer_manager, std::move(pool), std::move(handle.region)));
+ gpu_memory_buffer_manager, std::move(pool), premapped_memory));
}
base::OnceClosure GpuMemoryBufferImplDXGI::AllocateForTesting(
@@ -96,13 +97,8 @@ bool GpuMemoryBufferImplDXGI::Map() {
if (map_count_++)
return true;
- if (unowned_region_.IsValid()) {
- unowned_mapping_ = unowned_region_.Map();
- if (unowned_mapping_.IsValid()) {
- return true;
- }
- // If failed to map unowned region - try to do manual copy as if the region
- // was not provided.
+ if (premapped_memory_.data()) {
+ return true;
}
DCHECK(!shared_memory_handle_);
@@ -131,15 +127,15 @@ void* GpuMemoryBufferImplDXGI::memory(size_t plane) {
AssertMapped();
if (plane > gfx::NumberOfPlanesForLinearBufferFormat(format_) ||
- (!shared_memory_handle_ && !unowned_mapping_.IsValid())) {
+ (!shared_memory_handle_ && !premapped_memory_.data())) {
return nullptr;
}
uint8_t* plane_addr =
- (shared_memory_handle_ ? shared_memory_handle_->GetMapping()
- : unowned_mapping_)
- .GetMemoryAsSpan<uint8_t>()
- .data();
+ (premapped_memory_.data() ? premapped_memory_.data()
+ : shared_memory_handle_->GetMapping()
+ .GetMemoryAsSpan<uint8_t>()
+ .data());
// This is safe, since we already checked that the requested plane is
// valid for current buffer format.
plane_addr += gfx::BufferOffsetForBufferFormat(size_, format_, plane);
@@ -154,8 +150,6 @@ void GpuMemoryBufferImplDXGI::Unmap() {
if (shared_memory_handle_) {
shared_memory_handle_.reset();
- } else {
- unowned_mapping_ = base::WritableSharedMemoryMapping();
}
}
@@ -182,9 +176,7 @@ gfx::GpuMemoryBufferHandle GpuMemoryBufferImplDXGI::CloneHandle() const {
DPLOG(ERROR) << "Failed to duplicate DXGI resource handle.";
handle.dxgi_handle.Set(duplicated_handle);
handle.dxgi_token = dxgi_token_;
- if (unowned_region_.IsValid()) {
- handle.region = unowned_region_.Duplicate();
- }
+
return handle;
}
@@ -201,11 +193,19 @@ GpuMemoryBufferImplDXGI::GpuMemoryBufferImplDXGI(
gfx::DXGIHandleToken dxgi_token,
gpu::GpuMemoryBufferManager* gpu_memory_buffer_manager,
scoped_refptr<base::UnsafeSharedMemoryPool> pool,
- base::UnsafeSharedMemoryRegion region)
+ base::span<uint8_t> premapped_memory)
: GpuMemoryBufferImpl(id, size, format, std::move(callback)),
dxgi_handle_(std::move(dxgi_handle)),
dxgi_token_(std::move(dxgi_token)),
gpu_memory_buffer_manager_(gpu_memory_buffer_manager),
shared_memory_pool_(std::move(pool)),
- unowned_region_(std::move(region)) {}
+ premapped_memory_(premapped_memory) {
+ if (premapped_memory_.data() &&
+ premapped_memory_.size() <
+ gfx::BufferSizeForBufferFormat(size_, format_)) {
+ LOG(ERROR)
+ << "GpuMemoryBufferImplDXGI: Premapped memory has insufficient size.";
+ premapped_memory_ = base::span<uint8_t>();
+ }
+}
} // namespace gpu
diff --git a/chromium/gpu/ipc/common/gpu_memory_buffer_impl_dxgi.h b/chromium/gpu/ipc/common/gpu_memory_buffer_impl_dxgi.h
index adb8202dd19..32159783a2b 100644
--- a/chromium/gpu/ipc/common/gpu_memory_buffer_impl_dxgi.h
+++ b/chromium/gpu/ipc/common/gpu_memory_buffer_impl_dxgi.h
@@ -9,6 +9,7 @@
#include <stdint.h>
#include <memory>
+#include "base/containers/span.h"
#include "base/memory/raw_ptr.h"
#include "base/memory/scoped_refptr.h"
#include "base/memory/unsafe_shared_memory_pool.h"
@@ -40,7 +41,8 @@ class GPU_EXPORT GpuMemoryBufferImplDXGI : public GpuMemoryBufferImpl {
gfx::BufferUsage usage,
DestructionCallback callback,
gpu::GpuMemoryBufferManager* gpu_memory_buffer_manager,
- scoped_refptr<base::UnsafeSharedMemoryPool> pool);
+ scoped_refptr<base::UnsafeSharedMemoryPool> pool,
+ base::span<uint8_t> premapped_memory = base::span<uint8_t>());
static base::OnceClosure AllocateForTesting(
const gfx::Size& size,
@@ -66,7 +68,7 @@ class GPU_EXPORT GpuMemoryBufferImplDXGI : public GpuMemoryBufferImpl {
gfx::DXGIHandleToken dxgi_token,
GpuMemoryBufferManager* gpu_memory_buffer_manager,
scoped_refptr<base::UnsafeSharedMemoryPool> pool,
- base::UnsafeSharedMemoryRegion region);
+ base::span<uint8_t> premapped_memory);
base::win::ScopedHandle dxgi_handle_;
gfx::DXGIHandleToken dxgi_token_;
@@ -78,8 +80,7 @@ class GPU_EXPORT GpuMemoryBufferImplDXGI : public GpuMemoryBufferImpl {
std::unique_ptr<base::UnsafeSharedMemoryPool::Handle> shared_memory_handle_;
// Used to store shared memory passed from the capturer.
- base::UnsafeSharedMemoryRegion unowned_region_;
- base::WritableSharedMemoryMapping unowned_mapping_;
+ base::span<uint8_t> premapped_memory_;
};
} // namespace gpu
diff --git a/chromium/gpu/ipc/common/gpu_memory_buffer_support.cc b/chromium/gpu/ipc/common/gpu_memory_buffer_support.cc
index fd2bc09d40d..c38a0215314 100644
--- a/chromium/gpu/ipc/common/gpu_memory_buffer_support.cc
+++ b/chromium/gpu/ipc/common/gpu_memory_buffer_support.cc
@@ -165,7 +165,8 @@ GpuMemoryBufferSupport::CreateGpuMemoryBufferImplFromHandle(
gfx::BufferUsage usage,
GpuMemoryBufferImpl::DestructionCallback callback,
gpu::GpuMemoryBufferManager* gpu_memory_buffer_manager,
- scoped_refptr<base::UnsafeSharedMemoryPool> pool) {
+ scoped_refptr<base::UnsafeSharedMemoryPool> pool,
+ base::span<uint8_t> premapped_memory) {
switch (handle.type) {
case gfx::SHARED_MEMORY_BUFFER:
return GpuMemoryBufferImplSharedMemory::CreateFromHandle(
@@ -185,7 +186,7 @@ GpuMemoryBufferSupport::CreateGpuMemoryBufferImplFromHandle(
case gfx::DXGI_SHARED_HANDLE:
return GpuMemoryBufferImplDXGI::CreateFromHandle(
std::move(handle), size, format, usage, std::move(callback),
- gpu_memory_buffer_manager, std::move(pool));
+ gpu_memory_buffer_manager, std::move(pool), premapped_memory);
#endif
#if BUILDFLAG(IS_ANDROID)
case gfx::ANDROID_HARDWARE_BUFFER:
diff --git a/chromium/gpu/ipc/common/gpu_memory_buffer_support.h b/chromium/gpu/ipc/common/gpu_memory_buffer_support.h
index 55a565a9091..0a2f3a37020 100644
--- a/chromium/gpu/ipc/common/gpu_memory_buffer_support.h
+++ b/chromium/gpu/ipc/common/gpu_memory_buffer_support.h
@@ -8,6 +8,7 @@
#include <memory>
#include "base/callback.h"
+#include "base/containers/span.h"
#include "base/memory/scoped_refptr.h"
#include "base/memory/unsafe_shared_memory_pool.h"
#include "build/build_config.h"
@@ -70,7 +71,8 @@ class GPU_EXPORT GpuMemoryBufferSupport {
gfx::BufferUsage usage,
GpuMemoryBufferImpl::DestructionCallback callback,
gpu::GpuMemoryBufferManager* gpu_memory_buffer_manager = nullptr,
- scoped_refptr<base::UnsafeSharedMemoryPool> pool = nullptr);
+ scoped_refptr<base::UnsafeSharedMemoryPool> pool = nullptr,
+ base::span<uint8_t> premapped_memory = base::span<uint8_t>());
private:
#if defined(USE_OZONE)
diff --git a/chromium/gpu/ipc/common/gpu_peak_memory_mojom_traits.h b/chromium/gpu/ipc/common/gpu_peak_memory_mojom_traits.h
index cfc04508581..c809dd41a8e 100644
--- a/chromium/gpu/ipc/common/gpu_peak_memory_mojom_traits.h
+++ b/chromium/gpu/ipc/common/gpu_peak_memory_mojom_traits.h
@@ -5,6 +5,7 @@
#ifndef GPU_IPC_COMMON_GPU_PEAK_MEMORY_MOJOM_TRAITS_H_
#define GPU_IPC_COMMON_GPU_PEAK_MEMORY_MOJOM_TRAITS_H_
+#include "base/notreached.h"
#include "gpu/gpu_export.h"
#include "gpu/ipc/common/gpu_peak_memory.h"
#include "gpu/ipc/common/gpu_peak_memory.mojom-shared.h"
diff --git a/chromium/gpu/ipc/common/gpu_preferences.mojom b/chromium/gpu/ipc/common/gpu_preferences.mojom
index fd28170ea9f..42d6e035229 100644
--- a/chromium/gpu/ipc/common/gpu_preferences.mojom
+++ b/chromium/gpu/ipc/common/gpu_preferences.mojom
@@ -84,7 +84,6 @@ struct GpuPreferences {
array<gfx.mojom.BufferUsageAndFormat> texture_target_exception_list;
bool ignore_gpu_blocklist;
- bool enable_oop_rasterization_ddl;
bool watchdog_starts_backgrounded;
GrContextType gr_context_type;
VulkanImplementationName use_vulkan;
diff --git a/chromium/gpu/ipc/common/gpu_preferences_mojom_traits.h b/chromium/gpu/ipc/common/gpu_preferences_mojom_traits.h
index 7480cd6d5a5..a1aa8a496b6 100644
--- a/chromium/gpu/ipc/common/gpu_preferences_mojom_traits.h
+++ b/chromium/gpu/ipc/common/gpu_preferences_mojom_traits.h
@@ -7,6 +7,7 @@
#include <vector>
+#include "base/notreached.h"
#include "build/build_config.h"
#include "build/chromeos_buildflags.h"
#include "gpu/config/gpu_preferences.h"
@@ -221,7 +222,6 @@ struct GPU_EXPORT
}
out->ignore_gpu_blocklist = prefs.ignore_gpu_blocklist();
- out->enable_oop_rasterization_ddl = prefs.enable_oop_rasterization_ddl();
out->watchdog_starts_backgrounded = prefs.watchdog_starts_backgrounded();
if (!prefs.ReadGrContextType(&out->gr_context_type))
return false;
@@ -383,9 +383,6 @@ struct GPU_EXPORT
static bool ignore_gpu_blocklist(const gpu::GpuPreferences& prefs) {
return prefs.ignore_gpu_blocklist;
}
- static bool enable_oop_rasterization_ddl(const gpu::GpuPreferences& prefs) {
- return prefs.enable_oop_rasterization_ddl;
- }
static bool watchdog_starts_backgrounded(const gpu::GpuPreferences& prefs) {
return prefs.watchdog_starts_backgrounded;
}
diff --git a/chromium/gpu/ipc/common/mojom_traits_unittest.cc b/chromium/gpu/ipc/common/mojom_traits_unittest.cc
index c159eaddfbb..dd08724fd5c 100644
--- a/chromium/gpu/ipc/common/mojom_traits_unittest.cc
+++ b/chromium/gpu/ipc/common/mojom_traits_unittest.cc
@@ -174,9 +174,9 @@ TEST_F(StructTraitsTest, GpuInfo) {
const OverlaySupport nv12_overlay_support = OverlaySupport::kNone;
const DxDiagNode dx_diagnostics;
#endif
- const gpu::VideoDecodeAcceleratorCapabilities
- video_decode_accelerator_capabilities;
- const std::vector<gpu::VideoEncodeAcceleratorSupportedProfile>
+ const VideoDecodeAcceleratorSupportedProfiles
+ video_decode_accelerator_supported_profiles;
+ const VideoEncodeAcceleratorSupportedProfiles
video_encode_accelerator_supported_profiles;
const bool jpeg_decode_accelerator_supported = true;
@@ -213,8 +213,8 @@ TEST_F(StructTraitsTest, GpuInfo) {
input.overlay_info.nv12_overlay_support = nv12_overlay_support;
input.dx_diagnostics = dx_diagnostics;
#endif
- input.video_decode_accelerator_capabilities =
- video_decode_accelerator_capabilities;
+ input.video_decode_accelerator_supported_profiles =
+ video_decode_accelerator_supported_profiles;
input.video_encode_accelerator_supported_profiles =
video_encode_accelerator_supported_profiles;
input.jpeg_decode_accelerator_supported = jpeg_decode_accelerator_supported;
@@ -276,23 +276,16 @@ TEST_F(StructTraitsTest, GpuInfo) {
EXPECT_EQ(nv12_overlay_support, output.overlay_info.nv12_overlay_support);
EXPECT_EQ(dx_diagnostics.values, output.dx_diagnostics.values);
#endif
- EXPECT_EQ(output.video_decode_accelerator_capabilities.flags,
- video_decode_accelerator_capabilities.flags);
- EXPECT_EQ(
- video_decode_accelerator_capabilities.supported_profiles.size(),
- output.video_decode_accelerator_capabilities.supported_profiles.size());
- for (size_t i = 0;
- i < video_decode_accelerator_capabilities.supported_profiles.size();
- ++i) {
+ for (size_t i = 0; i < video_decode_accelerator_supported_profiles.size();
+ i++) {
const gpu::VideoDecodeAcceleratorSupportedProfile& expected =
- video_decode_accelerator_capabilities.supported_profiles[i];
+ video_decode_accelerator_supported_profiles[i];
const gpu::VideoDecodeAcceleratorSupportedProfile& actual =
- output.video_decode_accelerator_capabilities.supported_profiles[i];
+ output.video_decode_accelerator_supported_profiles[i];
EXPECT_EQ(expected.encrypted_only, actual.encrypted_only);
}
- EXPECT_EQ(
- output.video_decode_accelerator_capabilities.supported_profiles.size(),
- video_decode_accelerator_capabilities.supported_profiles.size());
+ EXPECT_EQ(output.video_decode_accelerator_supported_profiles.size(),
+ video_decode_accelerator_supported_profiles.size());
EXPECT_EQ(output.video_encode_accelerator_supported_profiles.size(),
video_encode_accelerator_supported_profiles.size());
}
diff --git a/chromium/gpu/ipc/common/scheduling_priority_mojom_traits.h b/chromium/gpu/ipc/common/scheduling_priority_mojom_traits.h
index 85cfa1030c5..6b9900a923c 100644
--- a/chromium/gpu/ipc/common/scheduling_priority_mojom_traits.h
+++ b/chromium/gpu/ipc/common/scheduling_priority_mojom_traits.h
@@ -5,6 +5,7 @@
#ifndef GPU_IPC_COMMON_SCHEDULING_PRIORITY_MOJOM_TRAITS_H_
#define GPU_IPC_COMMON_SCHEDULING_PRIORITY_MOJOM_TRAITS_H_
+#include "base/notreached.h"
#include "gpu/command_buffer/common/scheduling_priority.h"
#include "gpu/gpu_export.h"
#include "gpu/ipc/common/gpu_channel.mojom-shared.h"
diff --git a/chromium/gpu/ipc/host/shader_disk_cache.cc b/chromium/gpu/ipc/host/shader_disk_cache.cc
index 854013f4c94..f5c6feb89c4 100644
--- a/chromium/gpu/ipc/host/shader_disk_cache.cc
+++ b/chromium/gpu/ipc/host/shader_disk_cache.cc
@@ -11,6 +11,7 @@
#include "base/strings/string_number_conversions.h"
#include "base/system/sys_info.h"
#include "base/threading/thread_checker.h"
+#include "base/time/time.h"
#include "build/build_config.h"
#include "gpu/command_buffer/common/constants.h"
#include "gpu/config/gpu_preferences.h"
@@ -562,9 +563,9 @@ void ShaderDiskCache::Init() {
int rv = disk_cache::CreateCacheBackend(
net::SHADER_CACHE, net::CACHE_BACKEND_DEFAULT,
- cache_path_.Append(kGpuCachePath), CacheSizeBytes(),
- disk_cache::ResetHandling::kResetOnError, nullptr, &backend_,
- base::BindOnce(&ShaderDiskCache::CacheCreatedCallback, this));
+ /*file_operations=*/nullptr, cache_path_.Append(kGpuCachePath),
+ CacheSizeBytes(), disk_cache::ResetHandling::kResetOnError, nullptr,
+ &backend_, base::BindOnce(&ShaderDiskCache::CacheCreatedCallback, this));
if (rv == net::OK)
cache_available_ = true;
diff --git a/chromium/gpu/ipc/host/shader_disk_cache_unittest.cc b/chromium/gpu/ipc/host/shader_disk_cache_unittest.cc
index 2a33f843861..b7d50d0bec3 100644
--- a/chromium/gpu/ipc/host/shader_disk_cache_unittest.cc
+++ b/chromium/gpu/ipc/host/shader_disk_cache_unittest.cc
@@ -7,6 +7,7 @@
#include "base/files/scoped_temp_dir.h"
#include "base/test/bind.h"
#include "base/test/task_environment.h"
+#include "base/time/time.h"
#include "net/base/test_completion_callback.h"
#include "testing/gtest/include/gtest/gtest.h"
diff --git a/chromium/gpu/ipc/in_process_command_buffer.cc b/chromium/gpu/ipc/in_process_command_buffer.cc
index a767aadd273..d0bb7081c31 100644
--- a/chromium/gpu/ipc/in_process_command_buffer.cc
+++ b/chromium/gpu/ipc/in_process_command_buffer.cc
@@ -21,6 +21,7 @@
#include "base/memory/weak_ptr.h"
#include "base/numerics/safe_conversions.h"
#include "base/sequence_checker.h"
+#include "base/synchronization/waitable_event.h"
#include "base/task/single_thread_task_runner.h"
#include "base/threading/thread.h"
#include "base/threading/thread_task_runner_handle.h"
@@ -497,7 +498,8 @@ gpu::ContextResult InProcessCommandBuffer::InitializeOnGpuThread(
this, command_buffer_.get(), task_executor_->shared_image_manager(),
gpu_dependency_->memory_tracker(), task_executor_->outputter(),
task_executor_->gpu_preferences(), context_state_));
- gpu::ContextResult result = webgpu_decoder->Initialize();
+ gpu::ContextResult result =
+ webgpu_decoder->Initialize(task_executor_->gpu_feature_info());
if (result != gpu::ContextResult::kSuccess) {
DestroyOnGpuThread();
DLOG(ERROR) << "Failed to initialize WebGPU decoder.";
@@ -566,8 +568,8 @@ gpu::ContextResult InProcessCommandBuffer::InitializeOnGpuThread(
this, command_buffer_.get(), task_executor_->outputter(),
task_executor_->gpu_feature_info(), task_executor_->gpu_preferences(),
gpu_dependency_->memory_tracker(),
- task_executor_->shared_image_manager(), context_state_,
- true /*is_privileged*/));
+ task_executor_->shared_image_manager(), params.image_factory,
+ context_state_, true /*is_privileged*/));
} else {
decoder_.reset(gles2::GLES2Decoder::Create(this, command_buffer_.get(),
task_executor_->outputter(),
diff --git a/chromium/gpu/ipc/in_process_command_buffer.h b/chromium/gpu/ipc/in_process_command_buffer.h
index adb65b8e056..20b099de02c 100644
--- a/chromium/gpu/ipc/in_process_command_buffer.h
+++ b/chromium/gpu/ipc/in_process_command_buffer.h
@@ -23,6 +23,7 @@
#include "base/synchronization/lock.h"
#include "base/synchronization/waitable_event.h"
#include "base/task/single_thread_task_runner.h"
+#include "base/time/time.h"
#include "build/build_config.h"
#include "components/viz/common/display/update_vsync_parameters_callback.h"
#include "components/viz/common/gpu/gpu_vsync_callback.h"
diff --git a/chromium/gpu/ipc/service/command_buffer_stub.cc b/chromium/gpu/ipc/service/command_buffer_stub.cc
index bf9697cc05b..0c08d33a7eb 100644
--- a/chromium/gpu/ipc/service/command_buffer_stub.cc
+++ b/chromium/gpu/ipc/service/command_buffer_stub.cc
@@ -13,6 +13,7 @@
#include "base/memory/ptr_util.h"
#include "base/memory/unsafe_shared_memory_region.h"
#include "base/no_destructor.h"
+#include "base/observer_list.h"
#include "base/task/single_thread_task_runner.h"
#include "base/time/time.h"
#include "base/trace_event/trace_event.h"
diff --git a/chromium/gpu/ipc/service/context_url.cc b/chromium/gpu/ipc/service/context_url.cc
index 4fd16df8412..9fb4a766217 100644
--- a/chromium/gpu/ipc/service/context_url.cc
+++ b/chromium/gpu/ipc/service/context_url.cc
@@ -13,6 +13,17 @@ namespace gpu {
// static
void ContextUrl::SetActiveUrl(const gpu::ContextUrl& active_url) {
+ bool is_skia_renderer = active_url.url() == "chrome://gpu/SkiaRenderer";
+
+ {
+ static crash_reporter::CrashKeyString<8> crash_key(
+ "gpu-context-is-skia-renderer");
+ crash_key.Set(is_skia_renderer ? "true" : "false");
+ }
+
+ if (is_skia_renderer)
+ return;
+
// Skip setting crash key when URL hash hasn't changed.
static size_t last_url_hash = 0;
if (active_url.hash() == last_url_hash)
@@ -23,8 +34,10 @@ void ContextUrl::SetActiveUrl(const gpu::ContextUrl& active_url) {
// Note that the url is intentionally excluded from WebView and WebLayer
// crash dumps using an allowlist for privacy reasons. See
// kWebViewCrashKeyAllowList and kWebLayerCrashKeyAllowList.
- static crash_reporter::CrashKeyString<1024> crash_key("gpu-url-chunk");
- crash_key.Set(active_url.url().possibly_invalid_spec());
+ {
+ static crash_reporter::CrashKeyString<1024> crash_key("gpu-url-chunk");
+ crash_key.Set(active_url.url().possibly_invalid_spec());
+ }
}
ContextUrl::ContextUrl(GURL url)
diff --git a/chromium/gpu/ipc/service/dcomp_texture_win.cc b/chromium/gpu/ipc/service/dcomp_texture_win.cc
index 49db244732b..0cd1bb04053 100644
--- a/chromium/gpu/ipc/service/dcomp_texture_win.cc
+++ b/chromium/gpu/ipc/service/dcomp_texture_win.cc
@@ -231,7 +231,15 @@ void DCOMPTexture::SendOutputRect() {
output_rect.set_x(window_relative_rect_.x() + parent_window_rect_.x());
output_rect.set_y(window_relative_rect_.y() + parent_window_rect_.y());
if (last_output_rect_ != output_rect) {
- client_->OnOutputRectChange(output_rect);
+ if (!output_rect.IsEmpty()) {
+ // The initial `OnUpdateParentWindowRect()` call can cause an empty
+ // `output_rect`.
+ // Set MFMediaEngine's `UpdateVideoStream()` with an non-empty destination
+ // rectangle. Otherwise, the next `EnableWindowlessSwapchainMode()` call
+ // to MFMediaEngine will skip the creation of the DCOMP surface handle.
+ // Then, the next `GetVideoSwapchainHandle()` call returns S_FALSE.
+ client_->OnOutputRectChange(output_rect);
+ }
last_output_rect_ = output_rect;
}
}
diff --git a/chromium/gpu/ipc/service/gpu_channel.cc b/chromium/gpu/ipc/service/gpu_channel.cc
index 5fc5e64416d..c8757fe39e7 100644
--- a/chromium/gpu/ipc/service/gpu_channel.cc
+++ b/chromium/gpu/ipc/service/gpu_channel.cc
@@ -29,6 +29,7 @@
#include "base/process/process.h"
#include "base/strings/string_util.h"
#include "base/synchronization/lock.h"
+#include "base/synchronization/waitable_event.h"
#include "base/task/bind_post_task.h"
#include "base/task/single_thread_task_runner.h"
#include "base/threading/thread_checker.h"
diff --git a/chromium/gpu/ipc/service/gpu_channel_manager.h b/chromium/gpu/ipc/service/gpu_channel_manager.h
index 3788f0a1b20..5ede05a062a 100644
--- a/chromium/gpu/ipc/service/gpu_channel_manager.h
+++ b/chromium/gpu/ipc/service/gpu_channel_manager.h
@@ -19,6 +19,7 @@
#include "base/process/process_handle.h"
#include "base/task/single_thread_task_runner.h"
#include "base/threading/thread_checker.h"
+#include "base/time/time.h"
#include "base/unguessable_token.h"
#include "build/build_config.h"
#include "gpu/command_buffer/common/activity_flags.h"
diff --git a/chromium/gpu/ipc/service/gpu_init.cc b/chromium/gpu/ipc/service/gpu_init.cc
index 184f6b3f5eb..d8e576d6f8b 100644
--- a/chromium/gpu/ipc/service/gpu_init.cc
+++ b/chromium/gpu/ipc/service/gpu_init.cc
@@ -165,13 +165,13 @@ class GpuWatchdogInit {
void DisableInProcessGpuVulkan(GpuFeatureInfo* gpu_feature_info,
GpuPreferences* gpu_preferences) {
if (gpu_feature_info->status_values[GPU_FEATURE_TYPE_VULKAN] ==
- kGpuFeatureStatusEnabled) {
+ kGpuFeatureStatusEnabled ||
+ gpu_preferences->gr_context_type == GrContextType::kVulkan) {
LOG(ERROR) << "Vulkan not supported with in process gpu";
gpu_preferences->use_vulkan = VulkanImplementationName::kNone;
gpu_feature_info->status_values[GPU_FEATURE_TYPE_VULKAN] =
kGpuFeatureStatusDisabled;
- if (gpu_preferences->gr_context_type == GrContextType::kVulkan)
- gpu_preferences->gr_context_type = GrContextType::kGL;
+ gpu_preferences->gr_context_type = GrContextType::kGL;
}
}
@@ -185,7 +185,14 @@ bool MatchGLRenderer(const GPUInfo& gpu_info, const std::string& patterns) {
}
return false;
}
-#endif // !BUILDFLAG(ENABLE_VULKAN)
+#endif // BUILDFLAG(ENABLE_VULKAN)
+
+#if BUILDFLAG(IS_WIN)
+uint64_t CHROME_LUID_to_uint64_t(const CHROME_LUID& luid) {
+ uint64_t id64 = static_cast<uint32_t>(luid.HighPart);
+ return (id64 << 32) | (luid.LowPart & 0xFFFFFFFF);
+}
+#endif // BUILDFLAG(IS_WIN)
} // namespace
@@ -202,6 +209,7 @@ bool GpuInit::InitializeAndStartSandbox(base::CommandLine* command_line,
// need more context based GPUInfo. In such situations, switching to
// SwiftShader needs to wait until creating a context.
bool needs_more_info = true;
+ uint64_t system_device_id = 0;
#if !BUILDFLAG(IS_ANDROID) && !BUILDFLAG(IS_CHROMECAST)
needs_more_info = false;
if (!PopGPUInfoCache(&gpu_info_)) {
@@ -238,6 +246,33 @@ bool GpuInit::InitializeAndStartSandbox(base::CommandLine* command_line,
gpu_feature_info_ = ComputeGpuFeatureInfo(gpu_info_, gpu_preferences_,
command_line, &needs_more_info);
}
+
+ // GPU picking is only effective with ANGLE/Metal backend on Mac and
+ // on Windows.
+ GPUInfo::GPUDevice preferred_gpu;
+ bool force_integrated_gpu =
+ gpu_feature_info_.IsWorkaroundEnabled(FORCE_LOW_POWER_GPU);
+ bool force_discrete_gpu =
+ gpu_feature_info_.IsWorkaroundEnabled(FORCE_HIGH_PERFORMANCE_GPU);
+#if BUILDFLAG(IS_MAC)
+ // Default to the integrated gpu on a multi-gpu Mac.
+ if (!force_discrete_gpu)
+ force_integrated_gpu = true;
+#endif // BUILDFLAG(IS_MAC)
+ if (force_discrete_gpu && gpu_info_.GetDiscreteGpu(&preferred_gpu)) {
+#if BUILDFLAG(IS_MAC)
+ system_device_id = preferred_gpu.register_id;
+#elif BUILDFLAG(IS_WIN)
+ system_device_id = CHROME_LUID_to_uint64_t(preferred_gpu.luid);
+#endif
+ } else if (force_integrated_gpu &&
+ gpu_info_.GetIntegratedGpu(&preferred_gpu)) {
+#if BUILDFLAG(IS_MAC)
+ system_device_id = preferred_gpu.register_id;
+#elif BUILDFLAG(IS_WIN)
+ system_device_id = CHROME_LUID_to_uint64_t(preferred_gpu.luid);
+#endif
+ }
#endif // !BUILDFLAG(IS_ANDROID) && !BUILDFLAG(IS_CHROMECAST)
gpu_info_.in_process_gpu = false;
@@ -401,8 +436,8 @@ bool GpuInit::InitializeAndStartSandbox(base::CommandLine* command_line,
if (watchdog_thread_)
watchdog_thread_->ResumeWatchdog();
if (gl::GetGLImplementation() != gl::kGLImplementationDisabled) {
- gl_initialized =
- gl::init::InitializeGLNoExtensionsOneOff(/*init_bindings*/ false);
+ gl_initialized = gl::init::InitializeGLNoExtensionsOneOff(
+ /*init_bindings*/ false, system_device_id);
if (!gl_initialized) {
VLOG(1) << "gl::init::InitializeGLNoExtensionsOneOff failed";
return false;
@@ -478,7 +513,8 @@ bool GpuInit::InitializeAndStartSandbox(base::CommandLine* command_line,
gl::init::ShutdownGL(true);
watchdog_thread_ = nullptr;
watchdog_init.SetGpuWatchdogPtr(nullptr);
- if (!gl::init::InitializeGLNoExtensionsOneOff(/*init_bindings*/ true)) {
+ if (!gl::init::InitializeGLNoExtensionsOneOff(/*init_bindings*/ true,
+ system_device_id)) {
VLOG(1)
<< "gl::init::InitializeGLNoExtensionsOneOff with SwiftShader "
<< "failed";
@@ -631,18 +667,15 @@ bool GpuInit::InitializeAndStartSandbox(base::CommandLine* command_line,
UMA_HISTOGRAM_MEDIUM_TIMES("GPU.InitializeOneOffMediumTime",
elapsed_timer.Elapsed());
- // Software GL is expected to run slowly, so disable the watchdog
+ // SwANGLE is expected to run slowly, so disable the watchdog
// in that case.
- // In SwiftShader case, the implementation is actually EGLGLES2.
if (!gl_use_swiftshader_ && command_line->HasSwitch(switches::kUseGL)) {
std::string use_gl = command_line->GetSwitchValueASCII(switches::kUseGL);
std::string use_angle =
command_line->GetSwitchValueASCII(switches::kUseANGLE);
- if (use_gl == gl::kGLImplementationSwiftShaderName ||
- use_gl == gl::kGLImplementationSwiftShaderForWebGLName ||
- (use_gl == gl::kGLImplementationANGLEName &&
- (use_angle == gl::kANGLEImplementationSwiftShaderName ||
- use_angle == gl::kANGLEImplementationSwiftShaderForWebGLName))) {
+ if (use_gl == gl::kGLImplementationANGLEName &&
+ (use_angle == gl::kANGLEImplementationSwiftShaderName ||
+ use_angle == gl::kANGLEImplementationSwiftShaderForWebGLName)) {
gl_use_swiftshader_ = true;
}
}
@@ -766,7 +799,8 @@ void GpuInit::InitializeInProcess(base::CommandLine* command_line,
gl_use_swiftshader_ = EnableSwiftShaderIfNeeded(
command_line, gpu_feature_info_,
gpu_preferences_.disable_software_rasterizer, needs_more_info);
- if (!gl::init::InitializeGLNoExtensionsOneOff(/*init_bindings*/ true)) {
+ if (!gl::init::InitializeGLNoExtensionsOneOff(/*init_bindings=*/true,
+ /*system_device_id=*/0)) {
VLOG(1) << "gl::init::InitializeGLNoExtensionsOneOff failed";
return;
}
@@ -782,7 +816,8 @@ void GpuInit::InitializeInProcess(base::CommandLine* command_line,
if (gl_use_swiftshader_) {
SaveHardwareGpuInfoAndGpuFeatureInfo();
gl::init::ShutdownGL(true);
- if (!gl::init::InitializeGLNoExtensionsOneOff(/*init_bindings*/ true)) {
+ if (!gl::init::InitializeGLNoExtensionsOneOff(/*init_bindings=*/true,
+ /*system_device_id=*/0)) {
VLOG(1) << "gl::init::InitializeGLNoExtensionsOneOff failed "
<< "with SwiftShader";
return;
@@ -836,7 +871,8 @@ void GpuInit::InitializeInProcess(base::CommandLine* command_line,
if (gl_use_swiftshader_) {
SaveHardwareGpuInfoAndGpuFeatureInfo();
gl::init::ShutdownGL(true);
- if (!gl::init::InitializeGLNoExtensionsOneOff(/*init_bindings*/ true)) {
+ if (!gl::init::InitializeGLNoExtensionsOneOff(/*init_bindings=*/true,
+ /*system_device_id=*/0)) {
VLOG(1) << "gl::init::InitializeGLNoExtensionsOneOff failed "
<< "with SwiftShader";
return;
diff --git a/chromium/gpu/ipc/service/gpu_memory_buffer_factory_dxgi.cc b/chromium/gpu/ipc/service/gpu_memory_buffer_factory_dxgi.cc
index 01ccb3ab8c0..af8364900c8 100644
--- a/chromium/gpu/ipc/service/gpu_memory_buffer_factory_dxgi.cc
+++ b/chromium/gpu/ipc/service/gpu_memory_buffer_factory_dxgi.cc
@@ -66,7 +66,7 @@ GpuMemoryBufferFactoryDXGI::GetOrCreateD3D11Device() {
hr = D3D11CreateDevice(dxgi_adapter.Get(), driver_type,
/*Software=*/nullptr, flags, feature_levels,
- base::size(feature_levels), D3D11_SDK_VERSION,
+ std::size(feature_levels), D3D11_SDK_VERSION,
&d3d11_device_, /*pFeatureLevel=*/nullptr,
/*ppImmediateContext=*/nullptr);
if (FAILED(hr)) {
@@ -168,9 +168,13 @@ bool GpuMemoryBufferFactoryDXGI::FillSharedMemoryRegionWithBufferContents(
if (!d3d11_device)
return false;
+ base::WritableSharedMemoryMapping mapping = shared_memory.Map();
+ if (!mapping.IsValid())
+ return false;
+
return CopyDXGIBufferToShMem(buffer_handle.dxgi_handle.Get(),
- std::move(shared_memory), d3d11_device.Get(),
- &staging_texture_);
+ mapping.GetMemoryAsSpan<uint8_t>(),
+ d3d11_device.Get(), &staging_texture_);
}
ImageFactory* GpuMemoryBufferFactoryDXGI::AsImageFactory() {
diff --git a/chromium/gpu/ipc/service/gpu_watchdog_thread.cc b/chromium/gpu/ipc/service/gpu_watchdog_thread.cc
index 155f7c05172..5b9f0a4b622 100644
--- a/chromium/gpu/ipc/service/gpu_watchdog_thread.cc
+++ b/chromium/gpu/ipc/service/gpu_watchdog_thread.cc
@@ -72,10 +72,28 @@ GpuWatchdogThread::GpuWatchdogThread(base::TimeDelta timeout,
watchdog_timeout_(timeout),
watchdog_init_factor_(init_factor),
watchdog_restart_factor_(restart_factor),
- thread_name_(thread_name),
- is_test_mode_(is_test_mode),
- watched_gpu_task_runner_(base::ThreadTaskRunnerHandle::Get()) {
+ is_test_mode_(is_test_mode) {
base::CurrentThread::Get()->AddTaskObserver(this);
+ DETACH_FROM_SEQUENCE(watchdog_thread_sequence_checker_);
+
+ // DO NOT CHANGE |watched_thread_name_str_uma_|. It's used for UMA and crash
+ // report.
+ if (thread_name == "GpuWatchdog_Compositor")
+ watched_thread_name_str_uma_ = "compositor";
+ else
+ watched_thread_name_str_uma_ = "main";
+
+#if BUILDFLAG(IS_MAC)
+ // TODO(crbug.com/1223033): Remove this once macOS uses system-wide ids.
+ // On macOS the thread ids used by CrashPad are not the same as the ones
+ // provided by PlatformThread
+ uint64_t watched_thread_id;
+ pthread_threadid_np(pthread_self(), &watched_thread_id);
+ watched_thread_id_str_ = base::NumberToString(watched_thread_id);
+#else
+ watched_thread_id_str_ =
+ base::NumberToString(base::PlatformThread::CurrentId());
+#endif
#if BUILDFLAG(IS_WIN)
// GetCurrentThread returns a pseudo-handle that cannot be used by one thread
@@ -99,7 +117,7 @@ GpuWatchdogThread::GpuWatchdogThread(base::TimeDelta timeout,
}
GpuWatchdogThread::~GpuWatchdogThread() {
- DCHECK(watched_gpu_task_runner_->BelongsToCurrentThread());
+ DCHECK_CALLED_ON_VALID_SEQUENCE(watched_thread_sequence_checker_);
// Stop() might take too long and the watchdog timeout is triggered.
// Disarm first before calling Stop() to avoid a crash.
if (IsArmed())
@@ -110,7 +128,7 @@ GpuWatchdogThread::~GpuWatchdogThread() {
base::CurrentThread::Get()->RemoveTaskObserver(this);
base::PowerMonitor::RemovePowerSuspendObserver(this);
- GpuWatchdogHistogram(GpuWatchdogThreadEvent::kGpuWatchdogEnd);
+ GpuWatchdogThreadEventHistogram(GpuWatchdogThreadEvent::kGpuWatchdogEnd);
#if BUILDFLAG(IS_WIN)
if (watched_thread_handle_)
CloseHandle(watched_thread_handle_);
@@ -148,7 +166,7 @@ std::unique_ptr<GpuWatchdogThread> GpuWatchdogThread::Create(
kRestartFactor, /*test_mode=*/false, thread_name);
}
-// Android Chrome goes to the background. Called from the gpu thread.
+// Android Chrome goes to the background. Called from the gpu io thread.
void GpuWatchdogThread::OnBackgrounded() {
task_runner()->PostTask(
FROM_HERE,
@@ -156,7 +174,7 @@ void GpuWatchdogThread::OnBackgrounded() {
base::Unretained(this), kAndroidBackgroundForeground));
}
-// Android Chrome goes to the foreground. Called from the gpu thread.
+// Android Chrome goes to the foreground. Called from the gpu io thread.
void GpuWatchdogThread::OnForegrounded() {
task_runner()->PostTask(
FROM_HERE,
@@ -166,7 +184,7 @@ void GpuWatchdogThread::OnForegrounded() {
// Called from the gpu thread when gpu init has completed.
void GpuWatchdogThread::OnInitComplete() {
- DCHECK(watched_gpu_task_runner_->BelongsToCurrentThread());
+ DCHECK_CALLED_ON_VALID_SEQUENCE(watched_thread_sequence_checker_);
task_runner()->PostTask(
FROM_HERE, base::BindOnce(&GpuWatchdogThread::UpdateInitializationFlag,
@@ -185,25 +203,25 @@ void GpuWatchdogThread::OnInitComplete() {
// destroyed. If this destruction takes too long, the watchdog timeout
// will be triggered.
void GpuWatchdogThread::OnGpuProcessTearDown() {
- DCHECK(watched_gpu_task_runner_->BelongsToCurrentThread());
+ DCHECK_CALLED_ON_VALID_SEQUENCE(watched_thread_sequence_checker_);
in_gpu_process_teardown_ = true;
if (!IsArmed())
Arm();
}
-// Called from the gpu main thread.
+// Called from the watched gpu thread.
void GpuWatchdogThread::PauseWatchdog() {
- DCHECK(watched_gpu_task_runner_->BelongsToCurrentThread());
+ DCHECK_CALLED_ON_VALID_SEQUENCE(watched_thread_sequence_checker_);
task_runner()->PostTask(
FROM_HERE, base::BindOnce(&GpuWatchdogThread::StopWatchdogTimeoutTask,
base::Unretained(this), kGeneralGpuFlow));
}
-// Called from the gpu main thread.
+// Called from the watched gpu thread.
void GpuWatchdogThread::ResumeWatchdog() {
- DCHECK(watched_gpu_task_runner_->BelongsToCurrentThread());
+ DCHECK_CALLED_ON_VALID_SEQUENCE(watched_thread_sequence_checker_);
task_runner()->PostTask(
FROM_HERE, base::BindOnce(&GpuWatchdogThread::RestartWatchdogTimeoutTask,
@@ -215,8 +233,6 @@ void GpuWatchdogThread::ResumeWatchdog() {
// watchdog is stopped and then restarted in StartSandboxLinux(). Everything
// should be the same and continue after the second init().
void GpuWatchdogThread::Init() {
- watchdog_thread_task_runner_ = base::ThreadTaskRunnerHandle::Get();
-
// Get and Invalidate weak_ptr should be done on the watchdog thread only.
weak_ptr_ = weak_factory_.GetWeakPtr();
base::TimeDelta timeout = watchdog_timeout_ * kInitFactor;
@@ -243,18 +259,18 @@ void GpuWatchdogThread::Init() {
// Running on the watchdog thread.
void GpuWatchdogThread::CleanUp() {
- DCHECK(watchdog_thread_task_runner_->BelongsToCurrentThread());
+ DCHECK_CALLED_ON_VALID_SEQUENCE(watchdog_thread_sequence_checker_);
weak_factory_.InvalidateWeakPtrs();
}
void GpuWatchdogThread::ReportProgress() {
- DCHECK(watched_gpu_task_runner_->BelongsToCurrentThread());
+ DCHECK_CALLED_ON_VALID_SEQUENCE(watched_thread_sequence_checker_);
InProgress();
}
void GpuWatchdogThread::WillProcessTask(const base::PendingTask& pending_task,
bool was_blocked_or_low_priority) {
- DCHECK(watched_gpu_task_runner_->BelongsToCurrentThread());
+ DCHECK_CALLED_ON_VALID_SEQUENCE(watched_thread_sequence_checker_);
// The watchdog is armed at the beginning of the gpu process teardown.
// Do not call Arm() during teardown.
@@ -265,7 +281,7 @@ void GpuWatchdogThread::WillProcessTask(const base::PendingTask& pending_task,
}
void GpuWatchdogThread::DidProcessTask(const base::PendingTask& pending_task) {
- DCHECK(watched_gpu_task_runner_->BelongsToCurrentThread());
+ DCHECK_CALLED_ON_VALID_SEQUENCE(watched_thread_sequence_checker_);
// Keep the watchdog armed during tear down.
if (in_gpu_process_teardown_)
@@ -276,11 +292,13 @@ void GpuWatchdogThread::DidProcessTask(const base::PendingTask& pending_task) {
// Power Suspends. Running on the watchdog thread.
void GpuWatchdogThread::OnSuspend() {
+ DCHECK_CALLED_ON_VALID_SEQUENCE(watchdog_thread_sequence_checker_);
StopWatchdogTimeoutTask(kPowerSuspendResume);
}
// Power Resumes. Running on the watchdog thread.
void GpuWatchdogThread::OnResume() {
+ DCHECK_CALLED_ON_VALID_SEQUENCE(watchdog_thread_sequence_checker_);
RestartWatchdogTimeoutTask(kPowerSuspendResume);
}
@@ -288,7 +306,7 @@ void GpuWatchdogThread::OnResume() {
// Call AddPowerSuspendObserver on the watchdog thread so that OnSuspend() and
// OnResume() will be called on this thread.
void GpuWatchdogThread::AddPowerObserver() {
- DCHECK(watchdog_thread_task_runner_->BelongsToCurrentThread());
+ DCHECK_CALLED_ON_VALID_SEQUENCE(watchdog_thread_sequence_checker_);
// Adding the Observer to the power monitor is safe even if power monitor is
// not yet initialized.
@@ -301,7 +319,7 @@ void GpuWatchdogThread::AddPowerObserver() {
// Running on the watchdog thread.
void GpuWatchdogThread::RestartWatchdogTimeoutTask(
PauseResumeSource source_of_request) {
- DCHECK(watchdog_thread_task_runner_->BelongsToCurrentThread());
+ DCHECK_CALLED_ON_VALID_SEQUENCE(watchdog_thread_sequence_checker_);
base::TimeDelta timeout;
switch (source_of_request) {
@@ -352,7 +370,7 @@ void GpuWatchdogThread::RestartWatchdogTimeoutTask(
void GpuWatchdogThread::StopWatchdogTimeoutTask(
PauseResumeSource source_of_request) {
- DCHECK(watchdog_thread_task_runner_->BelongsToCurrentThread());
+ DCHECK_CALLED_ON_VALID_SEQUENCE(watchdog_thread_sequence_checker_);
switch (source_of_request) {
case kAndroidBackgroundForeground:
@@ -383,15 +401,15 @@ void GpuWatchdogThread::StopWatchdogTimeoutTask(
// On the watchdog thread only.
void GpuWatchdogThread::UpdateInitializationFlag() {
- DCHECK(watchdog_thread_task_runner_->BelongsToCurrentThread());
+ DCHECK_CALLED_ON_VALID_SEQUENCE(watchdog_thread_sequence_checker_);
in_gpu_initialization_ = false;
}
-// Called from the gpu main thread.
+// Called from the watched gpu thread.
// The watchdog is armed only in these three functions -
// GpuWatchdogThread(), WillProcessTask(), and OnGpuProcessTearDown()
void GpuWatchdogThread::Arm() {
- DCHECK(watched_gpu_task_runner_->BelongsToCurrentThread());
+ DCHECK_CALLED_ON_VALID_SEQUENCE(watched_thread_sequence_checker_);
base::subtle::NoBarrier_AtomicIncrement(&arm_disarm_counter_, 1);
@@ -400,7 +418,7 @@ void GpuWatchdogThread::Arm() {
}
void GpuWatchdogThread::Disarm() {
- DCHECK(watched_gpu_task_runner_->BelongsToCurrentThread());
+ DCHECK_CALLED_ON_VALID_SEQUENCE(watched_thread_sequence_checker_);
base::subtle::NoBarrier_AtomicIncrement(&arm_disarm_counter_, 1);
@@ -409,7 +427,7 @@ void GpuWatchdogThread::Disarm() {
}
void GpuWatchdogThread::InProgress() {
- DCHECK(watched_gpu_task_runner_->BelongsToCurrentThread());
+ DCHECK_CALLED_ON_VALID_SEQUENCE(watched_thread_sequence_checker_);
// Increment by 2. This is equivalent to Disarm() + Arm().
base::subtle::NoBarrier_AtomicIncrement(&arm_disarm_counter_, 2);
@@ -429,7 +447,7 @@ base::subtle::Atomic32 GpuWatchdogThread::ReadArmDisarmCounter() {
// Running on the watchdog thread.
void GpuWatchdogThread::OnWatchdogTimeout() {
- DCHECK(watchdog_thread_task_runner_->BelongsToCurrentThread());
+ DCHECK_CALLED_ON_VALID_SEQUENCE(watchdog_thread_sequence_checker_);
DCHECK(!is_backgrounded_);
DCHECK(!in_power_suspension_);
DCHECK(!is_paused_);
@@ -441,7 +459,7 @@ void GpuWatchdogThread::OnWatchdogTimeout() {
// memory.
if (!is_watchdog_start_histogram_recorded_) {
is_watchdog_start_histogram_recorded_ = true;
- GpuWatchdogHistogram(GpuWatchdogThreadEvent::kGpuWatchdogStart);
+ GpuWatchdogThreadEventHistogram(GpuWatchdogThreadEvent::kGpuWatchdogStart);
}
GpuWatchdogTimeoutHistogram(GpuWatchdogTimeoutEvent::kTimeout);
@@ -493,7 +511,8 @@ bool GpuWatchdogThread::SlowWatchdogThread() {
// OnWatchdogTimeout() calls, the system is considered slow and it's not a GPU
// hang.
bool slow_watchdog_thread =
- (base::Time::Now() - next_on_watchdog_timeout_time_) >= base::Seconds(15);
+ (base::Time::Now() - next_on_watchdog_timeout_time_) >=
+ kUnreasonableTimeoutDelay;
// Record this case only when a GPU hang is detected and the thread is slow.
if (slow_watchdog_thread)
@@ -582,7 +601,7 @@ base::ThreadTicks GpuWatchdogThread::GetWatchedThreadTime() {
#endif
void GpuWatchdogThread::DeliberatelyTerminateToRecoverFromHang() {
- DCHECK(watchdog_thread_task_runner_->BelongsToCurrentThread());
+ DCHECK_CALLED_ON_VALID_SEQUENCE(watchdog_thread_sequence_checker_);
// If this is for gpu testing, do not terminate the gpu process.
// Just signal and quit.
@@ -622,7 +641,9 @@ void GpuWatchdogThread::DeliberatelyTerminateToRecoverFromHang() {
base::debug::Alias(&less_than_full_thread_time_after_capped_);
#endif
- GpuWatchdogHistogram(GpuWatchdogThreadEvent::kGpuWatchdogKill);
+ // The watchdog currently doesn't watch multiple threads. If multiple threads
+ // are supported, use '|' to separate thread ids in "list_of_hung_threads".
+ crash_keys::list_of_hung_threads.Set(watched_thread_id_str_);
crash_keys::gpu_watchdog_crashed_in_gpu_init.Set(
in_gpu_initialization_ ? "1" : "0");
@@ -633,10 +654,7 @@ void GpuWatchdogThread::DeliberatelyTerminateToRecoverFromHang() {
const int num_of_processors = base::SysInfo::NumberOfProcessors();
crash_keys::num_of_processors.Set(base::NumberToString(num_of_processors));
- if (thread_name_ == "GpuWatchdog_Compositor")
- crash_keys::gpu_thread.Set("compositor");
- else
- crash_keys::gpu_thread.Set("main");
+ crash_keys::gpu_thread.Set(watched_thread_name_str_uma_);
// Check the arm_disarm_counter value one more time.
auto last_arm_disarm_counter = ReadArmDisarmCounter();
@@ -645,12 +663,18 @@ void GpuWatchdogThread::DeliberatelyTerminateToRecoverFromHang() {
// Create a crash dump first
base::debug::DumpWithoutCrashing();
+ // A kKill event is triggered and DumpWithoutCrashing() is called in the
+ // watchdog timeout routine OnWatchdogTimeout(). If it turns out
+ // gpu does not hang after the crash dump, another histogram
+ // kNoKillForGpuProgressDuringCrashDumping will be recorded later.
+ GpuWatchdogTimeoutHistogram(GpuWatchdogTimeoutEvent::kKill);
+
// Final check after the crash dump. If the watched thread makes a progress
// (disarmed) during generating crash dump, no need to crash the GPU process.
bool gpu_hang = IsArmed();
if (gpu_hang) {
- // Still armed without any progress. GPU possibly hangs.
- GpuWatchdogTimeoutHistogram(GpuWatchdogTimeoutEvent::kKill);
+ // Still armed without any progress. The GPU process is now killed.
+ GpuWatchdogThreadEventHistogram(GpuWatchdogThreadEvent::kGpuWatchdogKill);
#if BUILDFLAG(IS_WIN)
if (less_than_full_thread_time_after_capped_)
GpuWatchdogTimeoutHistogram(
@@ -663,6 +687,7 @@ void GpuWatchdogThread::DeliberatelyTerminateToRecoverFromHang() {
base::Process::TerminateCurrentProcessImmediately(RESULT_CODE_HUNG);
// The end of the GPU process.
} else {
+ crash_keys::list_of_hung_threads.Clear();
crash_keys::gpu_watchdog_crashed_in_gpu_init.Clear();
crash_keys::gpu_watchdog_kill_after_power_resume.Clear();
crash_keys::gpu_thread.Clear();
@@ -679,37 +704,54 @@ void GpuWatchdogThread::DeliberatelyTerminateToRecoverFromHang() {
}
}
-void GpuWatchdogThread::GpuWatchdogHistogram(
+void GpuWatchdogThread::GpuWatchdogThreadEventHistogram(
GpuWatchdogThreadEvent thread_event) {
base::UmaHistogramEnumeration("GPU.WatchdogThread.Event", thread_event);
+ base::UmaHistogramEnumeration(
+ "GPU.WatchdogThread.Event" + watched_thread_name_str_uma_, thread_event);
}
void GpuWatchdogThread::GpuWatchdogTimeoutHistogram(
GpuWatchdogTimeoutEvent timeout_event) {
base::UmaHistogramEnumeration("GPU.WatchdogThread.Timeout", timeout_event);
+ base::UmaHistogramEnumeration(
+ "GPU.WatchdogThread.Timeout" + watched_thread_name_str_uma_,
+ timeout_event);
bool recorded = false;
if (in_gpu_initialization_) {
base::UmaHistogramEnumeration("GPU.WatchdogThread.Timeout.Init",
timeout_event);
+ base::UmaHistogramEnumeration(
+ "GPU.WatchdogThread.Timeout.Init" + watched_thread_name_str_uma_,
+ timeout_event);
recorded = true;
}
if (WithinOneMinFromPowerResumed()) {
base::UmaHistogramEnumeration("GPU.WatchdogThread.Timeout.PowerResume",
timeout_event);
+ base::UmaHistogramEnumeration(
+ "GPU.WatchdogThread.Timeout.PowerResume" + watched_thread_name_str_uma_,
+ timeout_event);
recorded = true;
}
if (WithinOneMinFromForegrounded()) {
base::UmaHistogramEnumeration("GPU.WatchdogThread.Timeout.Foregrounded",
timeout_event);
+ base::UmaHistogramEnumeration("GPU.WatchdogThread.Timeout.Foregrounded" +
+ watched_thread_name_str_uma_,
+ timeout_event);
recorded = true;
}
if (!recorded) {
base::UmaHistogramEnumeration("GPU.WatchdogThread.Timeout.Normal",
timeout_event);
+ base::UmaHistogramEnumeration(
+ "GPU.WatchdogThread.Timeout.Normal" + watched_thread_name_str_uma_,
+ timeout_event);
}
}
diff --git a/chromium/gpu/ipc/service/gpu_watchdog_thread.h b/chromium/gpu/ipc/service/gpu_watchdog_thread.h
index d25ab17288f..65bc1c70abb 100644
--- a/chromium/gpu/ipc/service/gpu_watchdog_thread.h
+++ b/chromium/gpu/ipc/service/gpu_watchdog_thread.h
@@ -75,6 +75,13 @@ constexpr int kMaxCountOfMoreGpuThreadTimeAllowed = 3;
#endif
constexpr int kMaxExtraCyclesBeforeKill = 0;
+// If the scheduled timeout function is delayed by more than
+// kUnreasonableTimeoutDelay, we assume the system is in a unexpected state and
+// the GPU watchdog will NOT terminate the GPU process if no progress is made in
+// the GPU main thread or in the GPU display compositor thread. This is used in
+// determining SlowWatchdogThread.
+constexpr base::TimeDelta kUnreasonableTimeoutDelay = base::Seconds(5);
+
// A thread that intermitently sends tasks to a group of watched message loops
// and deliberately crashes if one of them does not respond after a timeout.
class GPU_IPC_SERVICE_EXPORT GpuWatchdogThread
@@ -177,7 +184,7 @@ class GPU_IPC_SERVICE_EXPORT GpuWatchdogThread
void ContinueWithNextWatchdogTimeoutTask();
// Records "GPU.WatchdogThread.Event".
- void GpuWatchdogHistogram(GpuWatchdogThreadEvent thread_event);
+ void GpuWatchdogThreadEventHistogram(GpuWatchdogThreadEvent thread_event);
// Histogram recorded in OnWatchdogTimeout()
// Records "GPU.WatchdogThread.Timeout"
@@ -295,15 +302,20 @@ class GPU_IPC_SERVICE_EXPORT GpuWatchdogThread
bool foregrounded_event_ = false;
bool power_resumed_event_ = false;
- const std::string thread_name_;
+ // The watched thread name string used for UMA and crash key.
+ std::string watched_thread_name_str_uma_;
+
+ // The thread id string of the watched thread.
+ std::string watched_thread_id_str_;
// For gpu testing only.
const bool is_test_mode_;
+
// Set by the watchdog thread and Read by the test thread.
base::AtomicFlag test_result_timeout_and_gpu_hang_;
- scoped_refptr<base::SingleThreadTaskRunner> watched_gpu_task_runner_;
- scoped_refptr<base::SingleThreadTaskRunner> watchdog_thread_task_runner_;
+ SEQUENCE_CHECKER(watchdog_thread_sequence_checker_);
+ SEQUENCE_CHECKER(watched_thread_sequence_checker_);
base::WeakPtr<GpuWatchdogThread> weak_ptr_;
base::WeakPtrFactory<GpuWatchdogThread> weak_factory_{this};
diff --git a/chromium/gpu/ipc/service/gpu_watchdog_thread_unittest.cc b/chromium/gpu/ipc/service/gpu_watchdog_thread_unittest.cc
index 9a1f7b957f7..fc1e946f1eb 100644
--- a/chromium/gpu/ipc/service/gpu_watchdog_thread_unittest.cc
+++ b/chromium/gpu/ipc/service/gpu_watchdog_thread_unittest.cc
@@ -40,6 +40,13 @@ constexpr auto kExtraGPUJobTimeForTesting = base::Milliseconds(500);
[[maybe_unused]] constexpr auto kExtraGPUJobTimeForTestingSlow =
base::Milliseconds(1000);
+// For Fuchsia in which GpuWatchdogTest.GpuInitializationAndRunningTasks test
+// is flaky.
+[[maybe_unused]] constexpr auto kGpuWatchdogTimeoutForTestingSlowest =
+ base::Milliseconds(1000);
+[[maybe_unused]] constexpr auto kExtraGPUJobTimeForTestingSlowest =
+ base::Milliseconds(4000);
+
// On Windows, the gpu watchdog check if the main thread has used the full
// thread time. We want to detect the case in which the main thread is swapped
// out by the OS scheduler. The task on windows is simiulated by reading
@@ -105,12 +112,19 @@ class GpuWatchdogPowerTest : public GpuWatchdogTest {
void GpuWatchdogTest::SetUp() {
ASSERT_TRUE(base::ThreadTaskRunnerHandle::IsSet());
ASSERT_TRUE(base::CurrentThread::IsSet());
- bool use_slow_timeout = false;
+
+ enum TimeOutType {
+ kNormal,
+ kSlow,
+ kSlowest,
+ };
+
+ TimeOutType timeout_type = kNormal;
#if BUILDFLAG(IS_WIN)
// Win7
if (base::win::GetVersion() < base::win::Version::WIN10) {
- use_slow_timeout = true;
+ timeout_type = kSlow;
}
#elif BUILDFLAG(IS_MAC)
@@ -119,8 +133,10 @@ void GpuWatchdogTest::SetUp() {
int os_version = base::mac::internal::MacOSVersion();
if (os_version <= 1100) {
- use_slow_timeout = true;
+ // Check MacOS version.
+ timeout_type = kSlow;
} else {
+ // Check Mac machine model version.
std::string model_str = base::SysInfo::HardwareModelName();
size_t found_position = model_str.find("MacBookPro");
constexpr size_t model_version_pos = 10;
@@ -132,7 +148,7 @@ void GpuWatchdogTest::SetUp() {
int major_model_ver = std::atoi(model_ver_str.c_str());
// For version < 14,1
if (major_model_ver < 14) {
- use_slow_timeout = true;
+ timeout_type = kSlow;
}
}
}
@@ -146,16 +162,19 @@ void GpuWatchdogTest::SetUp() {
// For Android version < Android Pie (Version 9)
if (major_version < 9) {
- use_slow_timeout = true;
+ timeout_type = kSlow;
}
#elif BUILDFLAG(IS_FUCHSIA)
- use_slow_timeout = true;
+ timeout_type = kSlowest;
#endif
- if (use_slow_timeout) {
+ if (timeout_type == kSlow) {
timeout_ = kGpuWatchdogTimeoutForTestingSlow;
extra_gpu_job_time_ = kExtraGPUJobTimeForTestingSlow;
+ } else if (timeout_type == kSlowest) {
+ timeout_ = kGpuWatchdogTimeoutForTestingSlowest;
+ extra_gpu_job_time_ = kExtraGPUJobTimeForTestingSlowest;
}
#if BUILDFLAG(IS_WIN)
diff --git a/chromium/gpu/ipc/service/image_decode_accelerator_stub.cc b/chromium/gpu/ipc/service/image_decode_accelerator_stub.cc
index a87c2d6c7fd..446518339c5 100644
--- a/chromium/gpu/ipc/service/image_decode_accelerator_stub.cc
+++ b/chromium/gpu/ipc/service/image_decode_accelerator_stub.cc
@@ -42,6 +42,7 @@
#include "gpu/ipc/service/gpu_channel.h"
#include "gpu/ipc/service/gpu_channel_manager.h"
#include "third_party/abseil-cpp/absl/types/optional.h"
+#include "third_party/skia/include/core/SkColorSpace.h"
#include "third_party/skia/include/core/SkImage.h"
#include "third_party/skia/include/core/SkImageInfo.h"
#include "third_party/skia/include/core/SkRefCnt.h"
diff --git a/chromium/gpu/ipc/service/image_transport_surface_mac.mm b/chromium/gpu/ipc/service/image_transport_surface_mac.mm
index e22456c7a58..ff2e62d1ed9 100644
--- a/chromium/gpu/ipc/service/image_transport_surface_mac.mm
+++ b/chromium/gpu/ipc/service/image_transport_surface_mac.mm
@@ -29,7 +29,6 @@ scoped_refptr<gl::GLSurface> ImageTransportSurface::CreateNativeSurface(
#if defined(USE_EGL)
case gl::kGLImplementationEGLGLES2:
case gl::kGLImplementationEGLANGLE:
- case gl::kGLImplementationSwiftShaderGL:
return base::WrapRefCounted<gl::GLSurface>(
new ImageTransportSurfaceOverlayMacEGL(delegate));
#endif
diff --git a/chromium/gpu/ipc/service/image_transport_surface_overlay_mac.mm b/chromium/gpu/ipc/service/image_transport_surface_overlay_mac.mm
index 224542e2a70..767d3f6454e 100644
--- a/chromium/gpu/ipc/service/image_transport_surface_overlay_mac.mm
+++ b/chromium/gpu/ipc/service/image_transport_surface_overlay_mac.mm
@@ -12,6 +12,7 @@
#include "base/command_line.h"
#include "base/metrics/histogram_macros.h"
#include "base/threading/thread_task_runner_handle.h"
+#include "base/time/time.h"
#include "base/trace_event/trace_event.h"
#include "gpu/command_buffer/common/swap_buffers_complete_params.h"
#include "gpu/ipc/service/gpu_channel_manager.h"
diff --git a/chromium/gpu/ipc/service/pass_through_image_transport_surface.cc b/chromium/gpu/ipc/service/pass_through_image_transport_surface.cc
index a05d004caae..01c2cba1b8f 100644
--- a/chromium/gpu/ipc/service/pass_through_image_transport_surface.cc
+++ b/chromium/gpu/ipc/service/pass_through_image_transport_surface.cc
@@ -10,6 +10,7 @@
#include "base/callback_helpers.h"
#include "base/metrics/histogram_macros.h"
#include "base/metrics/histogram_macros_local.h"
+#include "base/time/time.h"
#include "build/build_config.h"
#include "gpu/command_buffer/common/swap_buffers_complete_params.h"
#include "ui/gfx/vsync_provider.h"
diff --git a/chromium/gpu/ipc/service/raster_command_buffer_stub.cc b/chromium/gpu/ipc/service/raster_command_buffer_stub.cc
index df3297d53a5..7bfed081037 100644
--- a/chromium/gpu/ipc/service/raster_command_buffer_stub.cc
+++ b/chromium/gpu/ipc/service/raster_command_buffer_stub.cc
@@ -111,10 +111,14 @@ gpu::ContextResult RasterCommandBufferStub::Initialize(
command_buffer_ =
std::make_unique<CommandBufferService>(this, memory_tracker_.get());
+ ImageFactory* image_factory =
+ manager->gpu_memory_buffer_factory()
+ ? manager->gpu_memory_buffer_factory()->AsImageFactory()
+ : nullptr;
std::unique_ptr<raster::RasterDecoder> decoder(raster::RasterDecoder::Create(
this, command_buffer_.get(), manager->outputter(),
manager->gpu_feature_info(), manager->gpu_preferences(),
- memory_tracker_.get(), manager->shared_image_manager(),
+ memory_tracker_.get(), manager->shared_image_manager(), image_factory,
shared_context_state, channel()->is_gpu_host()));
sync_point_client_state_ =
diff --git a/chromium/gpu/ipc/service/stream_texture_android.cc b/chromium/gpu/ipc/service/stream_texture_android.cc
index 1e2a5a7c4d3..9cfe594a8a2 100644
--- a/chromium/gpu/ipc/service/stream_texture_android.cc
+++ b/chromium/gpu/ipc/service/stream_texture_android.cc
@@ -224,8 +224,12 @@ void StreamTexture::OnFrameAvailable() {
visible_rect_ = visible_rect;
auto mailbox = CreateSharedImage(coded_size);
- auto ycbcr_info =
- SharedImageVideo::GetYcbcrInfo(texture_owner_.get(), context_state_);
+ viz::VulkanContextProvider* vulkan_context_provider = nullptr;
+ if (context_state_->GrContextIsVulkan()) {
+ vulkan_context_provider = context_state_->vk_context_provider();
+ }
+ auto ycbcr_info = SharedImageVideo::GetYcbcrInfo(texture_owner_.get(),
+ vulkan_context_provider);
client_->OnFrameWithInfoAvailable(mailbox, coded_size, visible_rect,
ycbcr_info);
diff --git a/chromium/gpu/ipc/service/webgpu_command_buffer_stub.cc b/chromium/gpu/ipc/service/webgpu_command_buffer_stub.cc
index 40008497b45..08aa826fc09 100644
--- a/chromium/gpu/ipc/service/webgpu_command_buffer_stub.cc
+++ b/chromium/gpu/ipc/service/webgpu_command_buffer_stub.cc
@@ -127,7 +127,7 @@ gpu::ContextResult WebGPUCommandBufferStub::Initialize(
channel_->sync_point_manager()->CreateSyncPointClientState(
CommandBufferNamespace::GPU_IO, command_buffer_id_, sequence_id_);
- result = decoder->Initialize();
+ result = decoder->Initialize(manager->gpu_feature_info());
if (result != gpu::ContextResult::kSuccess) {
DLOG(ERROR) << "Failed to initialize decoder.";
return result;
diff --git a/chromium/gpu/ipc/shared_image_interface_in_process.cc b/chromium/gpu/ipc/shared_image_interface_in_process.cc
index 9e268cf3ecb..ad81d66a963 100644
--- a/chromium/gpu/ipc/shared_image_interface_in_process.cc
+++ b/chromium/gpu/ipc/shared_image_interface_in_process.cc
@@ -6,6 +6,7 @@
#include "base/bind.h"
#include "base/memory/raw_ptr.h"
+#include "base/synchronization/waitable_event.h"
#include "build/build_config.h"
#include "gpu/command_buffer/client/gpu_memory_buffer_manager.h"
#include "gpu/command_buffer/common/sync_token.h"
diff --git a/chromium/gpu/ipc/shared_image_interface_in_process.h b/chromium/gpu/ipc/shared_image_interface_in_process.h
index f8a271c1967..13c4498b1cd 100644
--- a/chromium/gpu/ipc/shared_image_interface_in_process.h
+++ b/chromium/gpu/ipc/shared_image_interface_in_process.h
@@ -11,6 +11,10 @@
#include "gpu/command_buffer/common/command_buffer_id.h"
#include "gpu/ipc/in_process_command_buffer.h"
+namespace base {
+class WaitableEvent;
+}
+
namespace gpu {
class MailboxManager;
class SharedContextState;
diff --git a/chromium/gpu/perftests/run_all_tests.cc b/chromium/gpu/perftests/run_all_tests.cc
index 3c8ac1aad0a..2decc61779f 100644
--- a/chromium/gpu/perftests/run_all_tests.cc
+++ b/chromium/gpu/perftests/run_all_tests.cc
@@ -30,7 +30,7 @@ static int RunHelper(base::TestSuite* test_suite) {
base::MessagePumpType::IO);
#endif
- CHECK(gl::init::InitializeGLOneOff());
+ CHECK(gl::init::InitializeGLOneOff(/*system_device_id=*/0));
return test_suite->Run();
}
diff --git a/chromium/gpu/skia_bindings/gl_bindings_skia_cmd_buffer.cc b/chromium/gpu/skia_bindings/gl_bindings_skia_cmd_buffer.cc
index 9e720735ff5..d2fc9fb7740 100644
--- a/chromium/gpu/skia_bindings/gl_bindings_skia_cmd_buffer.cc
+++ b/chromium/gpu/skia_bindings/gl_bindings_skia_cmd_buffer.cc
@@ -181,6 +181,8 @@ sk_sp<GrGLInterface> CreateGLES2InterfaceBindings(
gles_bind(&GLES2Interface::GetBufferParameteriv, impl, context_support);
functions->fGetError =
gles_bind(&GLES2Interface::GetError, impl, context_support);
+ functions->fGetFloatv =
+ gles_bind(&GLES2Interface::GetFloatv, impl, context_support);
functions->fGetIntegerv = get_integerv;
functions->fGetInternalformativ =
gles_bind(&GLES2Interface::GetInternalformativ, impl, context_support);
@@ -232,6 +234,8 @@ sk_sp<GrGLInterface> CreateGLES2InterfaceBindings(
gles_bind(&GLES2Interface::ReadBuffer, impl, context_support);
functions->fReadPixels =
gles_bind(&GLES2Interface::ReadPixels, impl, context_support);
+ functions->fSamplerParameterf =
+ gles_bind(&GLES2Interface::SamplerParameterf, impl, context_support);
functions->fSamplerParameteri =
gles_bind(&GLES2Interface::SamplerParameteri, impl, context_support);
functions->fSamplerParameteriv =
diff --git a/chromium/gpu/skia_bindings/grcontext_for_gles2_interface.cc b/chromium/gpu/skia_bindings/grcontext_for_gles2_interface.cc
index b808d2195ce..2e033526afe 100644
--- a/chromium/gpu/skia_bindings/grcontext_for_gles2_interface.cc
+++ b/chromium/gpu/skia_bindings/grcontext_for_gles2_interface.cc
@@ -33,7 +33,6 @@ GrContextForGLES2Interface::GrContextForGLES2Interface(
options.fGlyphCacheTextureMaximumBytes = max_glyph_cache_texture_bytes;
options.fAvoidStencilBuffers = capabilities.avoid_stencil_buffers;
options.fAllowPathMaskCaching = false;
- options.fSharpenMipmappedTextures = true;
options.fShaderErrorHandler = this;
// TODO(csmartdalton): enable internal multisampling after the related Skia
// rolls are in.
diff --git a/chromium/gpu/skia_bindings/grcontext_for_webgpu_interface.cc b/chromium/gpu/skia_bindings/grcontext_for_webgpu_interface.cc
index 6db7f0d43d1..f9b25eb28bc 100644
--- a/chromium/gpu/skia_bindings/grcontext_for_webgpu_interface.cc
+++ b/chromium/gpu/skia_bindings/grcontext_for_webgpu_interface.cc
@@ -31,7 +31,6 @@ GrContextForWebGPUInterface::GrContextForWebGPUInterface(
options.fGlyphCacheTextureMaximumBytes = max_glyph_cache_texture_bytes;
options.fAvoidStencilBuffers = capabilities.avoid_stencil_buffers;
options.fAllowPathMaskCaching = false;
- options.fSharpenMipmappedTextures = true;
options.fShaderErrorHandler = this;
options.fInternalMultisampleCount = 0;
// TODO(senorblanco): create an actual passed-in Device, rather than this
diff --git a/chromium/gpu/tools/compositor_model_bench/compositor_model_bench.cc b/chromium/gpu/tools/compositor_model_bench/compositor_model_bench.cc
index 1e5bc0d609b..c34ddf3abe2 100644
--- a/chromium/gpu/tools/compositor_model_bench/compositor_model_bench.cc
+++ b/chromium/gpu/tools/compositor_model_bench/compositor_model_bench.cc
@@ -187,7 +187,7 @@ class Simulator {
// Initialize the OpenGL context.
bool InitGLContext() {
- if (!gl::init::InitializeGLOneOff()) {
+ if (!gl::init::InitializeGLOneOff(/*system_device_id=*/0)) {
LOG(FATAL) << "gl::init::InitializeGLOneOff failed";
return false;
}
diff --git a/chromium/gpu/vulkan/BUILD.gn b/chromium/gpu/vulkan/BUILD.gn
index ad422d5f4a2..7535d53405d 100644
--- a/chromium/gpu/vulkan/BUILD.gn
+++ b/chromium/gpu/vulkan/BUILD.gn
@@ -9,6 +9,10 @@ import("//build/config/ui.gni")
import("//testing/test.gni")
import("features.gni")
+if (ozone_platform_wayland) {
+ import("//third_party/wayland/features.gni")
+}
+
# Generate a buildflag header for compile-time checking of Vulkan support.
buildflag_header("buildflags") {
header = "buildflags.h"
@@ -22,6 +26,9 @@ if (enable_vulkan) {
if (use_vulkan_xcb) {
defines += [ "USE_VULKAN_XCB" ]
}
+ if (ozone_platform_wayland && !use_system_libwayland) {
+ configs = [ "//third_party/wayland:wayland_config" ]
+ }
}
source_set("vulkan_function_pointers") {
@@ -154,6 +161,10 @@ if (enable_vulkan) {
data_deps += [ "//third_party/fuchsia-sdk/sdk/pkg/vulkan_layers:VkLayer_khronos_validation" ]
}
}
+
+ if (is_apple) {
+ sources += [ "vulkan_image_mac.cc" ]
+ }
}
static_library("test_support") {
diff --git a/chromium/gpu/vulkan/features.gni b/chromium/gpu/vulkan/features.gni
index 7a98011f983..38cf1f0220c 100644
--- a/chromium/gpu/vulkan/features.gni
+++ b/chromium/gpu/vulkan/features.gni
@@ -8,7 +8,8 @@ import("//build/config/ui.gni")
# For details see declare_args() in build/config/BUILDCONFIG.gn.
declare_args() {
# Enable experimental vulkan backend.
- enable_vulkan = is_linux || is_chromeos || is_android || is_fuchsia || is_win
+ enable_vulkan =
+ is_linux || is_chromeos || is_android || is_fuchsia || is_win || is_apple
# Enable swiftshader vulkan. Disabling it can save build time, however
# --use-vulkan=swiftshader and some tests which use swiftshader vulkan will
diff --git a/chromium/gpu/vulkan/generate_bindings.py b/chromium/gpu/vulkan/generate_bindings.py
index f0cc6afd68b..6b506da2fad 100755
--- a/chromium/gpu/vulkan/generate_bindings.py
+++ b/chromium/gpu/vulkan/generate_bindings.py
@@ -74,6 +74,12 @@ VULKAN_INSTANCE_FUNCTIONS = [
]
},
{
+ 'extension': 'VK_EXT_HEADLESS_SURFACE_EXTENSION_NAME',
+ 'functions': [
+ 'vkCreateHeadlessSurfaceEXT',
+ ]
+ },
+ {
'ifdef': 'defined(USE_VULKAN_XCB)',
'extension': 'VK_KHR_XCB_SURFACE_EXTENSION_NAME',
'functions': [
@@ -185,7 +191,7 @@ VULKAN_DEVICE_FUNCTIONS = [
},
{
'ifdef':
- 'BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_ANDROID)',
+ 'BUILDFLAG(IS_POSIX)',
'extension': 'VK_KHR_EXTERNAL_SEMAPHORE_FD_EXTENSION_NAME',
'functions': [
'vkGetSemaphoreFdKHR',
@@ -202,7 +208,7 @@ VULKAN_DEVICE_FUNCTIONS = [
},
{
'ifdef':
- 'BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_ANDROID)',
+ 'BUILDFLAG(IS_POSIX)',
'extension': 'VK_KHR_EXTERNAL_MEMORY_FD_EXTENSION_NAME',
'functions': [
'vkGetMemoryFdKHR',
@@ -383,6 +389,8 @@ def GenerateHeaderFile(out_file):
#include <vulkan/vulkan.h>
+#include <memory>
+
#include "base/compiler_specific.h"
#include "base/component_export.h"
#include "base/containers/flat_map.h"
diff --git a/chromium/gpu/vulkan/init/BUILD.gn b/chromium/gpu/vulkan/init/BUILD.gn
index bea4c072736..3d10115d536 100644
--- a/chromium/gpu/vulkan/init/BUILD.gn
+++ b/chromium/gpu/vulkan/init/BUILD.gn
@@ -35,6 +35,9 @@ component("init") {
if (is_win) {
deps += [ "//gpu/vulkan/win32" ]
}
+ if (is_apple) {
+ deps += [ "//gpu/vulkan/mac" ]
+ }
}
component("skia") {
diff --git a/chromium/gpu/vulkan/init/vulkan_factory.cc b/chromium/gpu/vulkan/init/vulkan_factory.cc
index 4c0526d317b..64e06d0ff16 100644
--- a/chromium/gpu/vulkan/init/vulkan_factory.cc
+++ b/chromium/gpu/vulkan/init/vulkan_factory.cc
@@ -20,6 +20,10 @@
#include "ui/ozone/public/surface_factory_ozone.h"
#endif
+#if BUILDFLAG(IS_APPLE)
+#include "gpu/vulkan/mac/vulkan_implementation_mac.h"
+#endif
+
namespace gpu {
std::unique_ptr<VulkanImplementation> CreateVulkanImplementation(
@@ -47,6 +51,8 @@ std::unique_ptr<VulkanImplementation> CreateVulkanImplementation(
return std::make_unique<VulkanImplementationAndroid>();
#elif BUILDFLAG(IS_WIN)
return std::make_unique<VulkanImplementationWin32>(use_swiftshader);
+#elif BUILDFLAG(IS_APPLE)
+ return std::make_unique<VulkanImplementationMac>(use_swiftshader);
#else
NOTREACHED();
return {};
diff --git a/chromium/gpu/vulkan/mac/BUILD.gn b/chromium/gpu/vulkan/mac/BUILD.gn
new file mode 100644
index 00000000000..510388686ba
--- /dev/null
+++ b/chromium/gpu/vulkan/mac/BUILD.gn
@@ -0,0 +1,36 @@
+# Copyright 2022 The Chromium Authors. All rights reserved.
+# Use of this source code is governed by a BSD-style license that can be
+# found in the LICENSE file.
+
+import("//build/config/ui.gni")
+import("//gpu/vulkan/features.gni")
+
+assert(enable_vulkan)
+assert(is_apple)
+
+config("vulkan_mac") {
+ defines = [ "VK_USE_PLATFORM_METAL_EXT" ]
+}
+
+component("mac") {
+ output_name = "vulkan_mac"
+
+ sources = [
+ "vulkan_implementation_mac.cc",
+ "vulkan_implementation_mac.h",
+ ]
+
+ defines = [ "IS_VULKAN_MAC_IMPL" ]
+
+ public_configs = [ ":vulkan_mac" ]
+
+ deps = [
+ "//base",
+ "//ui/gfx",
+ ]
+
+ public_deps = [
+ "//base",
+ "//gpu/vulkan",
+ ]
+}
diff --git a/chromium/gpu/vulkan/mac/vulkan_implementation_mac.cc b/chromium/gpu/vulkan/mac/vulkan_implementation_mac.cc
new file mode 100644
index 00000000000..c129104cad3
--- /dev/null
+++ b/chromium/gpu/vulkan/mac/vulkan_implementation_mac.cc
@@ -0,0 +1,123 @@
+// Copyright 2022 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#include "gpu/vulkan/mac/vulkan_implementation_mac.h"
+
+#include "base/check.h"
+#include "base/files/file_path.h"
+#include "base/notreached.h"
+#include "gpu/vulkan/vulkan_function_pointers.h"
+#include "gpu/vulkan/vulkan_image.h"
+#include "gpu/vulkan/vulkan_instance.h"
+#include "gpu/vulkan/vulkan_util.h"
+#include "ui/gfx/gpu_fence.h"
+#include "ui/gfx/gpu_memory_buffer.h"
+
+namespace gpu {
+
+VulkanImplementationMac::VulkanImplementationMac(bool use_swiftshader)
+ : VulkanImplementation(use_swiftshader) {}
+
+VulkanImplementationMac::~VulkanImplementationMac() = default;
+
+bool VulkanImplementationMac::InitializeVulkanInstance(bool using_surface) {
+ DCHECK(using_surface);
+
+ base::FilePath loader_path(use_swiftshader() ? "libvk_swiftshader.dylib"
+ : "libvulkan.1.dylib");
+ std::vector<const char*> required_extensions = {
+ VK_KHR_EXTERNAL_MEMORY_CAPABILITIES_EXTENSION_NAME,
+ VK_KHR_EXTERNAL_SEMAPHORE_CAPABILITIES_EXTENSION_NAME,
+ VK_KHR_SURFACE_EXTENSION_NAME,
+ VK_EXT_METAL_SURFACE_EXTENSION_NAME,
+ };
+ return vulkan_instance_.Initialize(loader_path, required_extensions, {});
+}
+
+VulkanInstance* VulkanImplementationMac::GetVulkanInstance() {
+ return &vulkan_instance_;
+}
+
+std::unique_ptr<VulkanSurface> VulkanImplementationMac::CreateViewSurface(
+ gfx::AcceleratedWidget window) {
+ NOTIMPLEMENTED();
+ return nullptr;
+}
+
+bool VulkanImplementationMac::GetPhysicalDevicePresentationSupport(
+ VkPhysicalDevice device,
+ const std::vector<VkQueueFamilyProperties>& queue_family_properties,
+ uint32_t queue_family_index) {
+ return true;
+}
+
+std::vector<const char*>
+VulkanImplementationMac::GetRequiredDeviceExtensions() {
+ return {
+ VK_KHR_SWAPCHAIN_EXTENSION_NAME,
+ };
+}
+
+std::vector<const char*>
+VulkanImplementationMac::GetOptionalDeviceExtensions() {
+ return {
+ VK_KHR_EXTERNAL_MEMORY_EXTENSION_NAME,
+ VK_KHR_EXTERNAL_MEMORY_FD_EXTENSION_NAME,
+ VK_KHR_EXTERNAL_SEMAPHORE_EXTENSION_NAME,
+ VK_KHR_EXTERNAL_SEMAPHORE_FD_EXTENSION_NAME,
+ };
+}
+
+VkFence VulkanImplementationMac::CreateVkFenceForGpuFence(VkDevice vk_device) {
+ NOTREACHED();
+ return VK_NULL_HANDLE;
+}
+
+std::unique_ptr<gfx::GpuFence> VulkanImplementationMac::ExportVkFenceToGpuFence(
+ VkDevice vk_device,
+ VkFence vk_fence) {
+ NOTREACHED();
+ return nullptr;
+}
+
+VkSemaphore VulkanImplementationMac::CreateExternalSemaphore(
+ VkDevice vk_device) {
+ return CreateExternalVkSemaphore(
+ vk_device, VK_EXTERNAL_SEMAPHORE_HANDLE_TYPE_OPAQUE_FD_BIT);
+}
+
+VkSemaphore VulkanImplementationMac::ImportSemaphoreHandle(
+ VkDevice vk_device,
+ SemaphoreHandle handle) {
+ return ImportVkSemaphoreHandle(vk_device, std::move(handle));
+}
+
+SemaphoreHandle VulkanImplementationMac::GetSemaphoreHandle(
+ VkDevice vk_device,
+ VkSemaphore vk_semaphore) {
+ return GetVkSemaphoreHandle(vk_device, vk_semaphore,
+ VK_EXTERNAL_SEMAPHORE_HANDLE_TYPE_OPAQUE_FD_BIT);
+}
+
+VkExternalMemoryHandleTypeFlagBits
+VulkanImplementationMac::GetExternalImageHandleType() {
+ return VK_EXTERNAL_MEMORY_HANDLE_TYPE_OPAQUE_FD_BIT;
+}
+
+bool VulkanImplementationMac::CanImportGpuMemoryBuffer(
+ gfx::GpuMemoryBufferType memory_buffer_type) {
+ return false;
+}
+
+std::unique_ptr<VulkanImage>
+VulkanImplementationMac::CreateImageFromGpuMemoryHandle(
+ VulkanDeviceQueue* device_queue,
+ gfx::GpuMemoryBufferHandle gmb_handle,
+ gfx::Size size,
+ VkFormat vk_formae) {
+ NOTIMPLEMENTED();
+ return nullptr;
+}
+
+} // namespace gpu
diff --git a/chromium/gpu/vulkan/mac/vulkan_implementation_mac.h b/chromium/gpu/vulkan/mac/vulkan_implementation_mac.h
new file mode 100644
index 00000000000..c8bf2524ef2
--- /dev/null
+++ b/chromium/gpu/vulkan/mac/vulkan_implementation_mac.h
@@ -0,0 +1,59 @@
+// Copyright 2022 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef GPU_VULKAN_MAC_VULKAN_IMPLEMENTATION_MAC_H_
+#define GPU_VULKAN_MAC_VULKAN_IMPLEMENTATION_MAC_H_
+
+#include "base/component_export.h"
+#include "gpu/vulkan/vulkan_implementation.h"
+#include "gpu/vulkan/vulkan_instance.h"
+
+namespace gpu {
+
+class COMPONENT_EXPORT(VULKAN_MAC) VulkanImplementationMac
+ : public VulkanImplementation {
+ public:
+ explicit VulkanImplementationMac(bool use_swiftshader);
+
+ VulkanImplementationMac(const VulkanImplementationMac&) = delete;
+ VulkanImplementationMac& operator=(const VulkanImplementationMac&) = delete;
+
+ ~VulkanImplementationMac() override;
+
+ // VulkanImplementation:
+ bool InitializeVulkanInstance(bool using_surface) override;
+ VulkanInstance* GetVulkanInstance() override;
+ std::unique_ptr<VulkanSurface> CreateViewSurface(
+ gfx::AcceleratedWidget window) override;
+ bool GetPhysicalDevicePresentationSupport(
+ VkPhysicalDevice device,
+ const std::vector<VkQueueFamilyProperties>& queue_family_properties,
+ uint32_t queue_family_index) override;
+ std::vector<const char*> GetRequiredDeviceExtensions() override;
+ std::vector<const char*> GetOptionalDeviceExtensions() override;
+ VkFence CreateVkFenceForGpuFence(VkDevice vk_device) override;
+ std::unique_ptr<gfx::GpuFence> ExportVkFenceToGpuFence(
+ VkDevice vk_device,
+ VkFence vk_fence) override;
+ VkSemaphore CreateExternalSemaphore(VkDevice vk_device) override;
+ VkSemaphore ImportSemaphoreHandle(VkDevice vk_device,
+ SemaphoreHandle handle) override;
+ SemaphoreHandle GetSemaphoreHandle(VkDevice vk_device,
+ VkSemaphore vk_semaphore) override;
+ VkExternalMemoryHandleTypeFlagBits GetExternalImageHandleType() override;
+ bool CanImportGpuMemoryBuffer(
+ gfx::GpuMemoryBufferType memory_buffer_type) override;
+ std::unique_ptr<VulkanImage> CreateImageFromGpuMemoryHandle(
+ VulkanDeviceQueue* device_queue,
+ gfx::GpuMemoryBufferHandle gmb_handle,
+ gfx::Size size,
+ VkFormat vk_formae) override;
+
+ private:
+ VulkanInstance vulkan_instance_;
+};
+
+} // namespace gpu
+
+#endif // GPU_VULKAN_MAC_VULKAN_IMPLEMENTATION_MAC_H_
diff --git a/chromium/gpu/vulkan/vulkan_device_queue.cc b/chromium/gpu/vulkan/vulkan_device_queue.cc
index d46eb425a49..45049c7d258 100644
--- a/chromium/gpu/vulkan/vulkan_device_queue.cc
+++ b/chromium/gpu/vulkan/vulkan_device_queue.cc
@@ -220,7 +220,7 @@ bool VulkanDeviceQueue::Initialize(
"other", "integrated", "discrete", "virtual", "cpu",
};
uint32_t gpu_type = vk_physical_device_properties_.deviceType;
- if (gpu_type >= base::size(kDeviceTypeNames))
+ if (gpu_type >= std::size(kDeviceTypeNames))
gpu_type = 0;
crash_keys::vulkan_device_type.Set(kDeviceTypeNames[gpu_type]);
crash_keys::vulkan_device_name.Set(vk_physical_device_properties_.deviceName);
diff --git a/chromium/gpu/vulkan/vulkan_fence_helper.h b/chromium/gpu/vulkan/vulkan_fence_helper.h
index 24d9c976c3a..7ca65ee850e 100644
--- a/chromium/gpu/vulkan/vulkan_fence_helper.h
+++ b/chromium/gpu/vulkan/vulkan_fence_helper.h
@@ -155,6 +155,8 @@ class COMPONENT_EXPORT(VULKAN) VulkanFenceHelper {
template <typename T>
void VulkanFenceHelper::EnqueueVulkanObjectCleanupForSubmittedWork(
std::unique_ptr<T> obj) {
+ if (!obj)
+ return;
EnqueueCleanupTaskForSubmittedWork(
base::BindOnce([](std::unique_ptr<T> obj, VulkanDeviceQueue* device_queue,
bool device_lost) { obj->Destroy(); },
diff --git a/chromium/gpu/vulkan/vulkan_function_pointers.cc b/chromium/gpu/vulkan/vulkan_function_pointers.cc
index e94c32e7ee4..2733bb32e5c 100644
--- a/chromium/gpu/vulkan/vulkan_function_pointers.cc
+++ b/chromium/gpu/vulkan/vulkan_function_pointers.cc
@@ -298,6 +298,18 @@ bool VulkanFunctionPointers::BindInstanceFunctionPointers(
}
}
+ if (gfx::HasExtension(enabled_extensions,
+ VK_EXT_HEADLESS_SURFACE_EXTENSION_NAME)) {
+ vkCreateHeadlessSurfaceEXT =
+ reinterpret_cast<PFN_vkCreateHeadlessSurfaceEXT>(
+ vkGetInstanceProcAddr(vk_instance, "vkCreateHeadlessSurfaceEXT"));
+ if (!vkCreateHeadlessSurfaceEXT) {
+ DLOG(WARNING) << "Failed to bind vulkan entrypoint: "
+ << "vkCreateHeadlessSurfaceEXT";
+ return false;
+ }
+ }
+
#if defined(USE_VULKAN_XCB)
if (gfx::HasExtension(enabled_extensions,
VK_KHR_XCB_SURFACE_EXTENSION_NAME)) {
@@ -926,7 +938,7 @@ bool VulkanFunctionPointers::BindDeviceFunctionPointers(
}
#endif // BUILDFLAG(IS_ANDROID)
-#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_ANDROID)
+#if BUILDFLAG(IS_POSIX)
if (gfx::HasExtension(enabled_extensions,
VK_KHR_EXTERNAL_SEMAPHORE_FD_EXTENSION_NAME)) {
vkGetSemaphoreFdKHR = reinterpret_cast<PFN_vkGetSemaphoreFdKHR>(
@@ -945,8 +957,7 @@ bool VulkanFunctionPointers::BindDeviceFunctionPointers(
return false;
}
}
-#endif // BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) ||
- // BUILDFLAG(IS_ANDROID)
+#endif // BUILDFLAG(IS_POSIX)
#if BUILDFLAG(IS_WIN)
if (gfx::HasExtension(enabled_extensions,
@@ -971,7 +982,7 @@ bool VulkanFunctionPointers::BindDeviceFunctionPointers(
}
#endif // BUILDFLAG(IS_WIN)
-#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_ANDROID)
+#if BUILDFLAG(IS_POSIX)
if (gfx::HasExtension(enabled_extensions,
VK_KHR_EXTERNAL_MEMORY_FD_EXTENSION_NAME)) {
vkGetMemoryFdKHR = reinterpret_cast<PFN_vkGetMemoryFdKHR>(
@@ -991,8 +1002,7 @@ bool VulkanFunctionPointers::BindDeviceFunctionPointers(
return false;
}
}
-#endif // BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) ||
- // BUILDFLAG(IS_ANDROID)
+#endif // BUILDFLAG(IS_POSIX)
#if BUILDFLAG(IS_WIN)
if (gfx::HasExtension(enabled_extensions,
diff --git a/chromium/gpu/vulkan/vulkan_function_pointers.h b/chromium/gpu/vulkan/vulkan_function_pointers.h
index bfcfda0924f..f6b05566689 100644
--- a/chromium/gpu/vulkan/vulkan_function_pointers.h
+++ b/chromium/gpu/vulkan/vulkan_function_pointers.h
@@ -13,6 +13,8 @@
#include <vulkan/vulkan.h>
+#include <memory>
+
#include "base/compiler_specific.h"
#include "base/component_export.h"
#include "base/containers/flat_map.h"
@@ -153,6 +155,8 @@ struct COMPONENT_EXPORT(VULKAN) VulkanFunctionPointers {
VulkanFunction<PFN_vkGetPhysicalDeviceSurfaceSupportKHR>
vkGetPhysicalDeviceSurfaceSupportKHR;
+ VulkanFunction<PFN_vkCreateHeadlessSurfaceEXT> vkCreateHeadlessSurfaceEXT;
+
#if defined(USE_VULKAN_XCB)
VulkanFunction<PFN_vkCreateXcbSurfaceKHR> vkCreateXcbSurfaceKHR;
VulkanFunction<PFN_vkGetPhysicalDeviceXcbPresentationSupportKHR>
@@ -250,11 +254,10 @@ struct COMPONENT_EXPORT(VULKAN) VulkanFunctionPointers {
vkGetAndroidHardwareBufferPropertiesANDROID;
#endif // BUILDFLAG(IS_ANDROID)
-#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_ANDROID)
+#if BUILDFLAG(IS_POSIX)
VulkanFunction<PFN_vkGetSemaphoreFdKHR> vkGetSemaphoreFdKHR;
VulkanFunction<PFN_vkImportSemaphoreFdKHR> vkImportSemaphoreFdKHR;
-#endif // BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) ||
- // BUILDFLAG(IS_ANDROID)
+#endif // BUILDFLAG(IS_POSIX)
#if BUILDFLAG(IS_WIN)
VulkanFunction<PFN_vkGetSemaphoreWin32HandleKHR> vkGetSemaphoreWin32HandleKHR;
@@ -262,11 +265,10 @@ struct COMPONENT_EXPORT(VULKAN) VulkanFunctionPointers {
vkImportSemaphoreWin32HandleKHR;
#endif // BUILDFLAG(IS_WIN)
-#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_ANDROID)
+#if BUILDFLAG(IS_POSIX)
VulkanFunction<PFN_vkGetMemoryFdKHR> vkGetMemoryFdKHR;
VulkanFunction<PFN_vkGetMemoryFdPropertiesKHR> vkGetMemoryFdPropertiesKHR;
-#endif // BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) ||
- // BUILDFLAG(IS_ANDROID)
+#endif // BUILDFLAG(IS_POSIX)
#if BUILDFLAG(IS_WIN)
VulkanFunction<PFN_vkGetMemoryWin32HandleKHR> vkGetMemoryWin32HandleKHR;
@@ -502,6 +504,15 @@ vkGetPhysicalDeviceSurfaceSupportKHR(VkPhysicalDevice physicalDevice,
physicalDevice, queueFamilyIndex, surface, pSupported);
}
+ALWAYS_INLINE VkResult
+vkCreateHeadlessSurfaceEXT(VkInstance instance,
+ const VkHeadlessSurfaceCreateInfoEXT* pCreateInfo,
+ const VkAllocationCallbacks* pAllocator,
+ VkSurfaceKHR* pSurface) {
+ return gpu::GetVulkanFunctionPointers()->vkCreateHeadlessSurfaceEXT(
+ instance, pCreateInfo, pAllocator, pSurface);
+}
+
#if defined(USE_VULKAN_XCB)
ALWAYS_INLINE VkResult
vkCreateXcbSurfaceKHR(VkInstance instance,
@@ -1033,7 +1044,7 @@ ALWAYS_INLINE VkResult vkGetAndroidHardwareBufferPropertiesANDROID(
}
#endif // BUILDFLAG(IS_ANDROID)
-#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_ANDROID)
+#if BUILDFLAG(IS_POSIX)
ALWAYS_INLINE VkResult
vkGetSemaphoreFdKHR(VkDevice device,
const VkSemaphoreGetFdInfoKHR* pGetFdInfo,
@@ -1047,8 +1058,7 @@ ALWAYS_INLINE VkResult vkImportSemaphoreFdKHR(
return gpu::GetVulkanFunctionPointers()->vkImportSemaphoreFdKHR(
device, pImportSemaphoreFdInfo);
}
-#endif // BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) ||
- // BUILDFLAG(IS_ANDROID)
+#endif // BUILDFLAG(IS_POSIX)
#if BUILDFLAG(IS_WIN)
ALWAYS_INLINE VkResult vkGetSemaphoreWin32HandleKHR(
@@ -1067,7 +1077,7 @@ vkImportSemaphoreWin32HandleKHR(VkDevice device,
}
#endif // BUILDFLAG(IS_WIN)
-#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_ANDROID)
+#if BUILDFLAG(IS_POSIX)
ALWAYS_INLINE VkResult vkGetMemoryFdKHR(VkDevice device,
const VkMemoryGetFdInfoKHR* pGetFdInfo,
int* pFd) {
@@ -1082,8 +1092,7 @@ vkGetMemoryFdPropertiesKHR(VkDevice device,
return gpu::GetVulkanFunctionPointers()->vkGetMemoryFdPropertiesKHR(
device, handleType, fd, pMemoryFdProperties);
}
-#endif // BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) ||
- // BUILDFLAG(IS_ANDROID)
+#endif // BUILDFLAG(IS_POSIX)
#if BUILDFLAG(IS_WIN)
ALWAYS_INLINE VkResult vkGetMemoryWin32HandleKHR(
diff --git a/chromium/gpu/vulkan/vulkan_image_linux.cc b/chromium/gpu/vulkan/vulkan_image_linux.cc
index f1e6c29bb35..b4567d76321 100644
--- a/chromium/gpu/vulkan/vulkan_image_linux.cc
+++ b/chromium/gpu/vulkan/vulkan_image_linux.cc
@@ -43,6 +43,7 @@ bool VulkanImage::InitializeFromGpuMemoryBufferHandle(
return false;
}
+ queue_family_index_ = queue_family_index;
auto& native_pixmap_handle = gmb_handle.native_pixmap_handle;
// 2 plane images are ok, they just need ycbcr set up.
@@ -91,19 +92,22 @@ bool VulkanImage::InitializeFromGpuMemoryBufferHandle(
external_image_create_info.pNext = &modifier_info;
}
+ int memory_fd = scoped_fd.release();
VkImportMemoryFdInfoKHR import_memory_fd_info = {
.sType = VK_STRUCTURE_TYPE_IMPORT_MEMORY_FD_INFO_KHR,
.handleType = VK_EXTERNAL_MEMORY_HANDLE_TYPE_DMA_BUF_BIT_EXT,
- .fd = scoped_fd.get(),
+ .fd = memory_fd,
};
VkMemoryRequirements* requirements = nullptr;
bool result = Initialize(device_queue, size, format, usage, flags,
image_tiling, &external_image_create_info,
&import_memory_fd_info, requirements);
- // If Initialize successfully, the fd in scoped_fd should be owned by vulkan.
- if (result)
- std::ignore = scoped_fd.release();
+ // If Initialize successfully, the fd in scoped_fd should be owned by vulkan,
+ // otherwise take the ownership of the fd back.
+ if (!result) {
+ scoped_fd.reset(memory_fd);
+ }
return result;
}
diff --git a/chromium/gpu/vulkan/vulkan_image_mac.cc b/chromium/gpu/vulkan/vulkan_image_mac.cc
new file mode 100644
index 00000000000..cca8087e43d
--- /dev/null
+++ b/chromium/gpu/vulkan/vulkan_image_mac.cc
@@ -0,0 +1,24 @@
+// Copyright 2022 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#include "gpu/vulkan/vulkan_image.h"
+
+#include "base/notreached.h"
+
+namespace gpu {
+
+bool VulkanImage::InitializeFromGpuMemoryBufferHandle(
+ VulkanDeviceQueue* device_queue,
+ gfx::GpuMemoryBufferHandle gmb_handle,
+ const gfx::Size& size,
+ VkFormat format,
+ VkImageUsageFlags usage,
+ VkImageCreateFlags flags,
+ VkImageTiling image_tiling,
+ uint32_t queue_family_index) {
+ NOTIMPLEMENTED();
+ return false;
+}
+
+} // namespace gpu
diff --git a/chromium/gpu/vulkan/vulkan_surface.cc b/chromium/gpu/vulkan/vulkan_surface.cc
index 2194268927f..5cb845c6d2d 100644
--- a/chromium/gpu/vulkan/vulkan_surface.cc
+++ b/chromium/gpu/vulkan/vulkan_surface.cc
@@ -8,9 +8,9 @@
#include <algorithm>
-#include "base/cxx17_backports.h"
#include "base/logging.h"
#include "base/threading/scoped_blocking_call.h"
+#include "base/threading/thread_task_runner_handle.h"
#include "build/build_config.h"
#include "gpu/vulkan/vulkan_device_queue.h"
#include "gpu/vulkan/vulkan_function_pointers.h"
@@ -90,12 +90,18 @@ VulkanSurface::~VulkanSurface() {
VulkanSurface::VulkanSurface(VkInstance vk_instance,
gfx::AcceleratedWidget accelerated_widget,
VkSurfaceKHR surface,
- uint64_t acquire_next_image_timeout_ns)
+ uint64_t acquire_next_image_timeout_ns,
+ std::unique_ptr<gfx::VSyncProvider> vsync_provider)
: vk_instance_(vk_instance),
accelerated_widget_(accelerated_widget),
surface_(surface),
- acquire_next_image_timeout_ns_(acquire_next_image_timeout_ns) {
+ acquire_next_image_timeout_ns_(acquire_next_image_timeout_ns),
+ vsync_provider_(std::move(vsync_provider)) {
DCHECK_NE(static_cast<VkSurfaceKHR>(VK_NULL_HANDLE), surface_);
+ if (!vsync_provider_) {
+ vsync_provider_ = std::make_unique<gfx::FixedVSyncProvider>(
+ base::TimeTicks(), base::Seconds(1) / 60);
+ }
#if BUILDFLAG(IS_ANDROID)
if (accelerated_widget_)
@@ -147,8 +153,8 @@ bool VulkanSurface::Initialize(VulkanDeviceQueue* device_queue,
? kPreferredVkFormats32
: kPreferredVkFormats16;
unsigned int size = (format == FORMAT_RGBA_32)
- ? base::size(kPreferredVkFormats32)
- : base::size(kPreferredVkFormats16);
+ ? std::size(kPreferredVkFormats32)
+ : std::size(kPreferredVkFormats16);
if (formats.size() == 1 && VK_FORMAT_UNDEFINED == formats[0].format) {
surface_format_.format = preferred_formats[0];
@@ -209,18 +215,28 @@ void VulkanSurface::Destroy() {
surface_ = VK_NULL_HANDLE;
}
-gfx::SwapResult VulkanSurface::SwapBuffers() {
- return PostSubBuffer(gfx::Rect(image_size_));
+gfx::SwapResult VulkanSurface::SwapBuffers(
+ PresentationCallback presentation_callback) {
+ return PostSubBuffer(gfx::Rect(image_size_),
+ std::move(presentation_callback));
}
-gfx::SwapResult VulkanSurface::PostSubBuffer(const gfx::Rect& rect) {
- return swap_chain_->PostSubBuffer(rect);
+gfx::SwapResult VulkanSurface::PostSubBuffer(
+ const gfx::Rect& rect,
+ PresentationCallback presentation_callback) {
+ auto result = swap_chain_->PostSubBuffer(rect);
+ PostSubBufferCompleted({}, std::move(presentation_callback), result);
+ return result;
}
void VulkanSurface::PostSubBufferAsync(
const gfx::Rect& rect,
- VulkanSwapChain::PostSubBufferCompletionCallback callback) {
- swap_chain_->PostSubBufferAsync(rect, std::move(callback));
+ VulkanSwapChain::PostSubBufferCompletionCallback completion_callback,
+ PresentationCallback presentation_callback) {
+ completion_callback = base::BindOnce(
+ &VulkanSurface::PostSubBufferCompleted, weak_ptr_factory_.GetWeakPtr(),
+ std::move(completion_callback), std::move(presentation_callback));
+ swap_chain_->PostSubBufferAsync(rect, std::move(completion_callback));
}
void VulkanSurface::Finish() {
@@ -234,6 +250,14 @@ bool VulkanSurface::Reshape(const gfx::Size& size,
return CreateSwapChain(size, transform);
}
+base::TimeDelta VulkanSurface::GetDisplayRefreshInterval() {
+ DCHECK(vsync_provider_->SupportGetVSyncParametersIfAvailable());
+ base::TimeTicks timestamp;
+ base::TimeDelta interval;
+ vsync_provider_->GetVSyncParametersIfAvailable(&timestamp, &interval);
+ return interval;
+}
+
bool VulkanSurface::CreateSwapChain(const gfx::Size& size,
gfx::OverlayTransform transform) {
// Get Surface Information.
@@ -311,4 +335,34 @@ bool VulkanSurface::CreateSwapChain(const gfx::Size& size,
return true;
}
+void VulkanSurface::PostSubBufferCompleted(
+ VulkanSwapChain::PostSubBufferCompletionCallback completion_callback,
+ PresentationCallback presentation_callback,
+ gfx::SwapResult result) {
+ if (completion_callback)
+ std::move(completion_callback).Run(result);
+
+ gfx::PresentationFeedback feedback;
+ if (result == gfx::SwapResult::SWAP_FAILED) {
+ feedback = gfx::PresentationFeedback::Failure();
+ } else {
+ DCHECK(vsync_provider_->SupportGetVSyncParametersIfAvailable());
+ base::TimeTicks timestamp;
+ base::TimeDelta interval;
+ vsync_provider_->GetVSyncParametersIfAvailable(&timestamp, &interval);
+ if (timestamp.is_null())
+ timestamp = base::TimeTicks::Now();
+ feedback = gfx::PresentationFeedback(timestamp, interval, /*flags=*/0);
+ }
+
+ if (base::ThreadTaskRunnerHandle::IsSet()) {
+ base::ThreadTaskRunnerHandle::Get()->PostTask(
+ FROM_HERE, base::BindOnce(std::move(presentation_callback), feedback));
+ } else {
+ // For webview_instrumentation_test, ThreadTaskRunnerHandle is not set, so
+ // we have to call the callback directly.
+ std::move(presentation_callback).Run(feedback);
+ }
+}
+
} // namespace gpu
diff --git a/chromium/gpu/vulkan/vulkan_surface.h b/chromium/gpu/vulkan/vulkan_surface.h
index 74a67b31fb2..981103b01c9 100644
--- a/chromium/gpu/vulkan/vulkan_surface.h
+++ b/chromium/gpu/vulkan/vulkan_surface.h
@@ -10,12 +10,15 @@
#include "base/callback.h"
#include "base/component_export.h"
#include "base/memory/raw_ptr.h"
+#include "base/memory/weak_ptr.h"
#include "gpu/vulkan/vulkan_device_queue.h"
#include "gpu/vulkan/vulkan_swap_chain.h"
#include "ui/gfx/geometry/size.h"
#include "ui/gfx/native_widget_types.h"
#include "ui/gfx/overlay_transform.h"
+#include "ui/gfx/presentation_feedback.h"
#include "ui/gfx/swap_result.h"
+#include "ui/gfx/vsync_provider.h"
namespace gpu {
@@ -33,10 +36,14 @@ class COMPONENT_EXPORT(VULKAN) VulkanSurface {
DEFAULT_SURFACE_FORMAT = FORMAT_RGBA_32
};
+ using PresentationCallback =
+ base::OnceCallback<void(const gfx::PresentationFeedback&)>;
+
VulkanSurface(VkInstance vk_instance,
gfx::AcceleratedWidget accelerated_widget,
VkSurfaceKHR surface,
- uint64_t acquire_next_image_timeout_ns = UINT64_MAX);
+ uint64_t acquire_next_image_timeout_ns = UINT64_MAX,
+ std::unique_ptr<gfx::VSyncProvider> vsync_provider = nullptr);
VulkanSurface(const VulkanSurface&) = delete;
VulkanSurface& operator=(const VulkanSurface&) = delete;
@@ -48,11 +55,13 @@ class COMPONENT_EXPORT(VULKAN) VulkanSurface {
// Destroy() should be called when all related GPU tasks have been finished.
virtual void Destroy();
- gfx::SwapResult SwapBuffers();
- gfx::SwapResult PostSubBuffer(const gfx::Rect& rect);
+ gfx::SwapResult SwapBuffers(PresentationCallback presentation_callback);
+ gfx::SwapResult PostSubBuffer(const gfx::Rect& rect,
+ PresentationCallback presentation_callback);
void PostSubBufferAsync(
const gfx::Rect& rect,
- VulkanSwapChain::PostSubBufferCompletionCallback callback);
+ VulkanSwapChain::PostSubBufferCompletionCallback completion_callback,
+ PresentationCallback presentation_callback);
void Finish();
@@ -62,6 +71,9 @@ class COMPONENT_EXPORT(VULKAN) VulkanSurface {
// See VkSwapchainCreateInfoKHR::preTransform for detail.
virtual bool Reshape(const gfx::Size& size, gfx::OverlayTransform transform);
+ // Return display refresh interval.
+ base::TimeDelta GetDisplayRefreshInterval();
+
gfx::AcceleratedWidget accelerated_widget() const {
return accelerated_widget_;
}
@@ -74,6 +86,10 @@ class COMPONENT_EXPORT(VULKAN) VulkanSurface {
private:
bool CreateSwapChain(const gfx::Size& size, gfx::OverlayTransform transform);
+ void PostSubBufferCompleted(
+ VulkanSwapChain::PostSubBufferCompletionCallback completion_callback,
+ PresentationCallback presentation_callback,
+ gfx::SwapResult result);
const VkInstance vk_instance_;
@@ -81,8 +97,8 @@ class COMPONENT_EXPORT(VULKAN) VulkanSurface {
VkSurfaceKHR surface_ = VK_NULL_HANDLE;
VkSurfaceFormatKHR surface_format_ = {};
raw_ptr<VulkanDeviceQueue> device_queue_ = nullptr;
-
const uint64_t acquire_next_image_timeout_ns_;
+ std::unique_ptr<gfx::VSyncProvider> vsync_provider_;
// The generation of |swap_chain_|, it will be increased if a new
// |swap_chain_| is created due to resizing, etc.
@@ -97,6 +113,8 @@ class COMPONENT_EXPORT(VULKAN) VulkanSurface {
gfx::OverlayTransform transform_ = gfx::OVERLAY_TRANSFORM_INVALID;
std::unique_ptr<VulkanSwapChain> swap_chain_;
+
+ base::WeakPtrFactory<VulkanSurface> weak_ptr_factory_{this};
};
} // namespace gpu
diff --git a/chromium/gpu/vulkan/vulkan_swap_chain.cc b/chromium/gpu/vulkan/vulkan_swap_chain.cc
index 07e86d3b799..c8fa2b83656 100644
--- a/chromium/gpu/vulkan/vulkan_swap_chain.cc
+++ b/chromium/gpu/vulkan/vulkan_swap_chain.cc
@@ -12,7 +12,6 @@
#include "base/task/thread_pool.h"
#include "base/threading/scoped_blocking_call.h"
#include "base/threading/thread_task_runner_handle.h"
-#include "base/time/time.h"
#include "gpu/vulkan/vulkan_device_queue.h"
#include "gpu/vulkan/vulkan_fence_helper.h"
#include "gpu/vulkan/vulkan_function_pointers.h"
@@ -540,7 +539,29 @@ VulkanSwapChain::ScopedWrite::ScopedWrite(VulkanSwapChain* swap_chain)
}
}
+VulkanSwapChain::ScopedWrite::ScopedWrite(ScopedWrite&& other) {
+ *this = std::move(other);
+}
+
VulkanSwapChain::ScopedWrite::~ScopedWrite() {
+ Reset();
+}
+
+const VulkanSwapChain::ScopedWrite& VulkanSwapChain::ScopedWrite::operator=(
+ ScopedWrite&& other) {
+ Reset();
+ std::swap(swap_chain_, other.swap_chain_);
+ std::swap(success_, other.success_);
+ std::swap(image_, other.image_);
+ std::swap(image_index_, other.image_index_);
+ std::swap(image_layout_, other.image_layout_);
+ std::swap(image_usage_, other.image_usage_);
+ std::swap(begin_semaphore_, other.begin_semaphore_);
+ std::swap(end_semaphore_, other.end_semaphore_);
+ return *this;
+}
+
+void VulkanSwapChain::ScopedWrite::Reset() {
if (LIKELY(success_)) {
DCHECK(begin_semaphore_ != VK_NULL_HANDLE);
DCHECK(end_semaphore_ != VK_NULL_HANDLE);
@@ -549,6 +570,14 @@ VulkanSwapChain::ScopedWrite::~ScopedWrite() {
DCHECK(begin_semaphore_ == VK_NULL_HANDLE);
DCHECK(end_semaphore_ == VK_NULL_HANDLE);
}
+ swap_chain_ = nullptr;
+ success_ = false;
+ image_ = VK_NULL_HANDLE;
+ image_index_ = 0;
+ image_layout_ = VK_IMAGE_LAYOUT_UNDEFINED;
+ image_usage_ = 0;
+ begin_semaphore_ = VK_NULL_HANDLE;
+ end_semaphore_ = VK_NULL_HANDLE;
}
} // namespace gpu
diff --git a/chromium/gpu/vulkan/vulkan_swap_chain.h b/chromium/gpu/vulkan/vulkan_swap_chain.h
index 42e12742b80..d26c1eb9404 100644
--- a/chromium/gpu/vulkan/vulkan_swap_chain.h
+++ b/chromium/gpu/vulkan/vulkan_swap_chain.h
@@ -32,11 +32,15 @@ class COMPONENT_EXPORT(VULKAN) VulkanSwapChain {
class COMPONENT_EXPORT(VULKAN) ScopedWrite {
public:
explicit ScopedWrite(VulkanSwapChain* swap_chain);
+ ScopedWrite(ScopedWrite&& other);
+ ~ScopedWrite();
ScopedWrite(const ScopedWrite&) = delete;
ScopedWrite& operator=(const ScopedWrite&) = delete;
- ~ScopedWrite();
+ const ScopedWrite& operator=(ScopedWrite&& other);
+
+ void Reset();
bool success() const { return success_; }
VkImage image() const { return image_; }
@@ -47,7 +51,7 @@ class COMPONENT_EXPORT(VULKAN) VulkanSwapChain {
VkSemaphore end_semaphore() const { return end_semaphore_; }
private:
- VulkanSwapChain* const swap_chain_;
+ VulkanSwapChain* swap_chain_ = nullptr;
bool success_ = false;
VkImage image_ = VK_NULL_HANDLE;
uint32_t image_index_ = 0;