summaryrefslogtreecommitdiff
path: root/chromium/gpu
diff options
context:
space:
mode:
authorAllan Sandfeld Jensen <allan.jensen@theqtcompany.com>2015-10-13 13:24:50 +0200
committerAllan Sandfeld Jensen <allan.jensen@theqtcompany.com>2015-10-14 10:57:25 +0000
commitaf3d4809763ef308f08ced947a73b624729ac7ea (patch)
tree4402b911e30383f6c6dace1e8cf3b8e85355db3a /chromium/gpu
parent0e8ff63a407fe323e215bb1a2c423c09a4747c8a (diff)
downloadqtwebengine-chromium-af3d4809763ef308f08ced947a73b624729ac7ea.tar.gz
BASELINE: Update Chromium to 47.0.2526.14
Also adding in sources needed for spellchecking. Change-Id: Idd44170fa1616f26315188970a8d5ba7d472b18a Reviewed-by: Michael BrĂ¼ning <michael.bruning@theqtcompany.com>
Diffstat (limited to 'chromium/gpu')
-rw-r--r--chromium/gpu/BUILD.gn92
-rw-r--r--chromium/gpu/GLES2/extensions/CHROMIUM/CHROMIUM_bind_uniform_location.txt12
-rw-r--r--chromium/gpu/GLES2/extensions/CHROMIUM/CHROMIUM_compressed_copy_texture.txt45
-rw-r--r--chromium/gpu/GLES2/extensions/CHROMIUM/CHROMIUM_copy_texture.txt31
-rw-r--r--chromium/gpu/GLES2/extensions/CHROMIUM/CHROMIUM_path_rendering.txt568
-rw-r--r--chromium/gpu/GLES2/extensions/CHROMIUM/CHROMIUM_screen_space_antialiasing.txt48
-rw-r--r--chromium/gpu/GLES2/extensions/CHROMIUM/CHROMIUM_sync_point.txt66
-rw-r--r--chromium/gpu/GLES2/extensions/CHROMIUM/CHROMIUM_ycbcr_422_image.txt48
-rw-r--r--chromium/gpu/GLES2/gl2chromium.h4
-rw-r--r--chromium/gpu/GLES2/gl2chromium_autogen.h32
-rw-r--r--chromium/gpu/GLES2/gl2extchromium.h207
-rw-r--r--chromium/gpu/blink/webgraphicscontext3d_impl.cc36
-rw-r--r--chromium/gpu/blink/webgraphicscontext3d_impl.h1667
-rw-r--r--chromium/gpu/blink/webgraphicscontext3d_in_process_command_buffer_impl.h2
-rwxr-xr-xchromium/gpu/command_buffer/build_gles2_cmd_buffer.py4497
-rw-r--r--chromium/gpu/command_buffer/client/buffer_tracker_unittest.cc9
-rw-r--r--chromium/gpu/command_buffer/client/client_context_state_impl_autogen.h3
-rw-r--r--chromium/gpu/command_buffer/client/client_test_helper.h2
-rw-r--r--chromium/gpu/command_buffer/client/cmd_buffer_helper.cc56
-rw-r--r--chromium/gpu/command_buffer/client/cmd_buffer_helper.h12
-rw-r--r--chromium/gpu/command_buffer/client/cmd_buffer_helper_test.cc2
-rw-r--r--chromium/gpu/command_buffer/client/context_support.h10
-rw-r--r--chromium/gpu/command_buffer/client/fenced_allocator.cc23
-rw-r--r--chromium/gpu/command_buffer/client/fenced_allocator.h15
-rw-r--r--chromium/gpu/command_buffer/client/fenced_allocator_test.cc69
-rw-r--r--chromium/gpu/command_buffer/client/gles2_c_lib.cc1
-rw-r--r--chromium/gpu/command_buffer/client/gles2_c_lib_autogen.h2885
-rw-r--r--chromium/gpu/command_buffer/client/gles2_cmd_helper_autogen.h233
-rw-r--r--chromium/gpu/command_buffer/client/gles2_implementation.cc575
-rw-r--r--chromium/gpu/command_buffer/client/gles2_implementation.h56
-rw-r--r--chromium/gpu/command_buffer/client/gles2_implementation_autogen.h91
-rw-r--r--chromium/gpu/command_buffer/client/gles2_implementation_impl_autogen.h207
-rw-r--r--chromium/gpu/command_buffer/client/gles2_implementation_unittest.cc188
-rw-r--r--chromium/gpu/command_buffer/client/gles2_implementation_unittest_autogen.h166
-rw-r--r--chromium/gpu/command_buffer/client/gles2_interface_autogen.h70
-rw-r--r--chromium/gpu/command_buffer/client/gles2_interface_stub_autogen.h66
-rw-r--r--chromium/gpu/command_buffer/client/gles2_interface_stub_impl_autogen.h860
-rw-r--r--chromium/gpu/command_buffer/client/gles2_lib.h2
-rw-r--r--chromium/gpu/command_buffer/client/gles2_trace_implementation_autogen.h66
-rw-r--r--chromium/gpu/command_buffer/client/gles2_trace_implementation_impl_autogen.h194
-rw-r--r--chromium/gpu/command_buffer/client/gpu_control.h7
-rw-r--r--chromium/gpu/command_buffer/client/gpu_memory_buffer_manager.h4
-rw-r--r--chromium/gpu/command_buffer/client/mapped_memory.cc64
-rw-r--r--chromium/gpu/command_buffer/client/mapped_memory.h21
-rw-r--r--chromium/gpu/command_buffer/client/mapped_memory_unittest.cc76
-rw-r--r--chromium/gpu/command_buffer/client/program_info_manager.cc9
-rw-r--r--chromium/gpu/command_buffer/client/program_info_manager.h1
-rw-r--r--chromium/gpu/command_buffer/client/program_info_manager_unittest.cc6
-rw-r--r--chromium/gpu/command_buffer/client/query_tracker.cc73
-rw-r--r--chromium/gpu/command_buffer/client/query_tracker.h19
-rw-r--r--chromium/gpu/command_buffer/client/query_tracker_unittest.cc14
-rw-r--r--chromium/gpu/command_buffer/client/ring_buffer.cc10
-rw-r--r--chromium/gpu/command_buffer/client/ring_buffer.h3
-rw-r--r--chromium/gpu/command_buffer/client/ring_buffer_test.cc2
-rw-r--r--chromium/gpu/command_buffer/client/share_group.cc37
-rw-r--r--chromium/gpu/command_buffer/client/share_group.h37
-rw-r--r--chromium/gpu/command_buffer/client/transfer_buffer.cc8
-rw-r--r--chromium/gpu/command_buffer/client/transfer_buffer.h6
-rw-r--r--chromium/gpu/command_buffer/cmd_buffer_functions.txt29
-rw-r--r--chromium/gpu/command_buffer/common/buffer.cc10
-rw-r--r--chromium/gpu/command_buffer/common/buffer.h6
-rw-r--r--chromium/gpu/command_buffer/common/capabilities.cc7
-rw-r--r--chromium/gpu/command_buffer/common/capabilities.h3
-rw-r--r--chromium/gpu/command_buffer/common/constants.h12
-rw-r--r--chromium/gpu/command_buffer/common/gles2_cmd_format.h21
-rw-r--r--chromium/gpu/command_buffer/common/gles2_cmd_format_autogen.h1137
-rw-r--r--chromium/gpu/command_buffer/common/gles2_cmd_format_test_autogen.h383
-rw-r--r--chromium/gpu/command_buffer/common/gles2_cmd_ids_autogen.h404
-rw-r--r--chromium/gpu/command_buffer/common/gles2_cmd_utils.cc190
-rw-r--r--chromium/gpu/command_buffer/common/gles2_cmd_utils.h21
-rw-r--r--chromium/gpu/command_buffer/common/gles2_cmd_utils_autogen.h6
-rw-r--r--chromium/gpu/command_buffer/common/gles2_cmd_utils_implementation_autogen.h3533
-rw-r--r--chromium/gpu/command_buffer/common/gles2_cmd_utils_unittest.cc12
-rw-r--r--chromium/gpu/command_buffer/common/mailbox.h7
-rw-r--r--chromium/gpu/command_buffer/common/mailbox_holder.h7
-rw-r--r--chromium/gpu/command_buffer/service/BUILD.gn37
-rw-r--r--chromium/gpu/command_buffer/service/async_pixel_transfer_delegate.cc43
-rw-r--r--chromium/gpu/command_buffer/service/async_pixel_transfer_delegate.h117
-rw-r--r--chromium/gpu/command_buffer/service/async_pixel_transfer_delegate_mock.cc17
-rw-r--r--chromium/gpu/command_buffer/service/async_pixel_transfer_delegate_mock.h39
-rw-r--r--chromium/gpu/command_buffer/service/async_pixel_transfer_manager.cc87
-rw-r--r--chromium/gpu/command_buffer/service/async_pixel_transfer_manager.h110
-rw-r--r--chromium/gpu/command_buffer/service/async_pixel_transfer_manager_android.cc118
-rw-r--r--chromium/gpu/command_buffer/service/async_pixel_transfer_manager_egl.cc733
-rw-r--r--chromium/gpu/command_buffer/service/async_pixel_transfer_manager_egl.h58
-rw-r--r--chromium/gpu/command_buffer/service/async_pixel_transfer_manager_idle.cc334
-rw-r--r--chromium/gpu/command_buffer/service/async_pixel_transfer_manager_idle.h70
-rw-r--r--chromium/gpu/command_buffer/service/async_pixel_transfer_manager_linux.cc40
-rw-r--r--chromium/gpu/command_buffer/service/async_pixel_transfer_manager_mac.cc31
-rw-r--r--chromium/gpu/command_buffer/service/async_pixel_transfer_manager_mock.cc15
-rw-r--r--chromium/gpu/command_buffer/service/async_pixel_transfer_manager_mock.h39
-rw-r--r--chromium/gpu/command_buffer/service/async_pixel_transfer_manager_share_group.cc549
-rw-r--r--chromium/gpu/command_buffer/service/async_pixel_transfer_manager_share_group.h60
-rw-r--r--chromium/gpu/command_buffer/service/async_pixel_transfer_manager_stub.cc89
-rw-r--r--chromium/gpu/command_buffer/service/async_pixel_transfer_manager_stub.h39
-rw-r--r--chromium/gpu/command_buffer/service/async_pixel_transfer_manager_sync.cc139
-rw-r--r--chromium/gpu/command_buffer/service/async_pixel_transfer_manager_sync.h50
-rw-r--r--chromium/gpu/command_buffer/service/async_pixel_transfer_manager_win.cc30
-rw-r--r--chromium/gpu/command_buffer/service/buffer_manager.cc101
-rw-r--r--chromium/gpu/command_buffer/service/buffer_manager.h18
-rw-r--r--chromium/gpu/command_buffer/service/buffer_manager_unittest.cc2
-rw-r--r--chromium/gpu/command_buffer/service/command_buffer_service.cc7
-rw-r--r--chromium/gpu/command_buffer/service/command_buffer_service.h1
-rw-r--r--chromium/gpu/command_buffer/service/command_buffer_service_unittest.cc2
-rw-r--r--chromium/gpu/command_buffer/service/context_group.cc98
-rw-r--r--chromium/gpu/command_buffer/service/context_group.h47
-rw-r--r--chromium/gpu/command_buffer/service/context_group_unittest.cc29
-rw-r--r--chromium/gpu/command_buffer/service/context_state.cc52
-rw-r--r--chromium/gpu/command_buffer/service/context_state.h26
-rw-r--r--chromium/gpu/command_buffer/service/context_state_autogen.h3
-rw-r--r--chromium/gpu/command_buffer/service/context_state_impl_autogen.h51
-rw-r--r--chromium/gpu/command_buffer/service/disk_cache_proto.proto1
-rw-r--r--chromium/gpu/command_buffer/service/feature_info.cc230
-rw-r--r--chromium/gpu/command_buffer/service/feature_info.h34
-rw-r--r--chromium/gpu/command_buffer/service/feature_info_unittest.cc144
-rw-r--r--chromium/gpu/command_buffer/service/framebuffer_completeness_cache.cc24
-rw-r--r--chromium/gpu/command_buffer/service/framebuffer_completeness_cache.h42
-rw-r--r--chromium/gpu/command_buffer/service/framebuffer_manager.cc162
-rw-r--r--chromium/gpu/command_buffer/service/framebuffer_manager.h57
-rw-r--r--chromium/gpu/command_buffer/service/framebuffer_manager_unittest.cc154
-rw-r--r--chromium/gpu/command_buffer/service/gl_context_virtual.cc3
-rw-r--r--chromium/gpu/command_buffer/service/gl_context_virtual.h13
-rw-r--r--chromium/gpu/command_buffer/service/gl_state_restorer_impl.cc12
-rw-r--r--chromium/gpu/command_buffer/service/gl_state_restorer_impl.h2
-rw-r--r--chromium/gpu/command_buffer/service/gles2_cmd_copy_texture_chromium.cc8
-rw-r--r--chromium/gpu/command_buffer/service/gles2_cmd_decoder.cc2741
-rw-r--r--chromium/gpu/command_buffer/service/gles2_cmd_decoder.h19
-rw-r--r--chromium/gpu/command_buffer/service/gles2_cmd_decoder_autogen.h194
-rw-r--r--chromium/gpu/command_buffer/service/gles2_cmd_decoder_mock.h12
-rw-r--r--chromium/gpu/command_buffer/service/gles2_cmd_decoder_unittest.cc361
-rw-r--r--chromium/gpu/command_buffer/service/gles2_cmd_decoder_unittest_0_autogen.h5
-rw-r--r--chromium/gpu/command_buffer/service/gles2_cmd_decoder_unittest_1.cc80
-rw-r--r--chromium/gpu/command_buffer/service/gles2_cmd_decoder_unittest_1_autogen.h151
-rw-r--r--chromium/gpu/command_buffer/service/gles2_cmd_decoder_unittest_2.cc353
-rw-r--r--chromium/gpu/command_buffer/service/gles2_cmd_decoder_unittest_2_autogen.h211
-rw-r--r--chromium/gpu/command_buffer/service/gles2_cmd_decoder_unittest_3.cc29
-rw-r--r--chromium/gpu/command_buffer/service/gles2_cmd_decoder_unittest_3_autogen.h31
-rw-r--r--chromium/gpu/command_buffer/service/gles2_cmd_decoder_unittest_4_autogen.h15
-rw-r--r--chromium/gpu/command_buffer/service/gles2_cmd_decoder_unittest_async_pixel.cc388
-rw-r--r--chromium/gpu/command_buffer/service/gles2_cmd_decoder_unittest_attribs.cc3
-rw-r--r--chromium/gpu/command_buffer/service/gles2_cmd_decoder_unittest_base.cc148
-rw-r--r--chromium/gpu/command_buffer/service/gles2_cmd_decoder_unittest_base.h27
-rw-r--r--chromium/gpu/command_buffer/service/gles2_cmd_decoder_unittest_context_state.cc3
-rw-r--r--chromium/gpu/command_buffer/service/gles2_cmd_decoder_unittest_drawing.cc12
-rw-r--r--chromium/gpu/command_buffer/service/gles2_cmd_decoder_unittest_extensions.cc941
-rw-r--r--chromium/gpu/command_buffer/service/gles2_cmd_decoder_unittest_extensions_autogen.h50
-rw-r--r--chromium/gpu/command_buffer/service/gles2_cmd_decoder_unittest_framebuffers.cc237
-rw-r--r--chromium/gpu/command_buffer/service/gles2_cmd_decoder_unittest_programs.cc176
-rw-r--r--chromium/gpu/command_buffer/service/gles2_cmd_decoder_unittest_textures.cc165
-rw-r--r--chromium/gpu/command_buffer/service/gles2_cmd_validation_autogen.h8
-rw-r--r--chromium/gpu/command_buffer/service/gles2_cmd_validation_implementation_autogen.h501
-rw-r--r--chromium/gpu/command_buffer/service/gpu_scheduler.cc105
-rw-r--r--chromium/gpu/command_buffer/service/gpu_scheduler.h43
-rw-r--r--chromium/gpu/command_buffer/service/gpu_service_test.cc6
-rw-r--r--chromium/gpu/command_buffer/service/gpu_switches.cc42
-rw-r--r--chromium/gpu/command_buffer/service/gpu_switches.h1
-rw-r--r--chromium/gpu/command_buffer/service/gpu_tracer.cc86
-rw-r--r--chromium/gpu/command_buffer/service/gpu_tracer.h10
-rw-r--r--chromium/gpu/command_buffer/service/gpu_tracer_unittest.cc17
-rw-r--r--chromium/gpu/command_buffer/service/image_factory.cc112
-rw-r--r--chromium/gpu/command_buffer/service/image_factory.h13
-rw-r--r--chromium/gpu/command_buffer/service/in_process_command_buffer.cc292
-rw-r--r--chromium/gpu/command_buffer/service/in_process_command_buffer.h61
-rw-r--r--chromium/gpu/command_buffer/service/mailbox_manager.cc25
-rw-r--r--chromium/gpu/command_buffer/service/mailbox_manager.h2
-rw-r--r--chromium/gpu/command_buffer/service/mailbox_manager_sync.cc1
-rw-r--r--chromium/gpu/command_buffer/service/mailbox_manager_unittest.cc3
-rw-r--r--chromium/gpu/command_buffer/service/memory_tracking.h10
-rw-r--r--chromium/gpu/command_buffer/service/mocks.h15
-rw-r--r--chromium/gpu/command_buffer/service/path_manager.cc252
-rw-r--r--chromium/gpu/command_buffer/service/path_manager.h68
-rw-r--r--chromium/gpu/command_buffer/service/path_manager_unittest.cc164
-rw-r--r--chromium/gpu/command_buffer/service/program_cache.cc8
-rw-r--r--chromium/gpu/command_buffer/service/program_manager.cc295
-rw-r--r--chromium/gpu/command_buffer/service/program_manager.h29
-rw-r--r--chromium/gpu/command_buffer/service/program_manager_unittest.cc26
-rw-r--r--chromium/gpu/command_buffer/service/query_manager.cc589
-rw-r--r--chromium/gpu/command_buffer/service/query_manager.h107
-rw-r--r--chromium/gpu/command_buffer/service/query_manager_unittest.cc455
-rw-r--r--chromium/gpu/command_buffer/service/renderbuffer_manager.cc60
-rw-r--r--chromium/gpu/command_buffer/service/renderbuffer_manager.h14
-rw-r--r--chromium/gpu/command_buffer/service/renderbuffer_manager_unittest.cc2
-rw-r--r--chromium/gpu/command_buffer/service/shader_manager.cc22
-rw-r--r--chromium/gpu/command_buffer/service/shader_manager.h8
-rw-r--r--chromium/gpu/command_buffer/service/shader_translator.cc76
-rw-r--r--chromium/gpu/command_buffer/service/shader_translator.h26
-rw-r--r--chromium/gpu/command_buffer/service/shader_translator_cache.cc12
-rw-r--r--chromium/gpu/command_buffer/service/shader_translator_cache.h11
-rw-r--r--chromium/gpu/command_buffer/service/shader_translator_cache_unittest.cc10
-rw-r--r--chromium/gpu/command_buffer/service/shader_translator_unittest.cc147
-rw-r--r--chromium/gpu/command_buffer/service/stream_texture_manager_in_process_android.cc9
-rw-r--r--chromium/gpu/command_buffer/service/sync_point_manager.cc129
-rw-r--r--chromium/gpu/command_buffer/service/sync_point_manager.h136
-rw-r--r--chromium/gpu/command_buffer/service/test_helper.cc84
-rw-r--r--chromium/gpu/command_buffer/service/test_helper.h18
-rw-r--r--chromium/gpu/command_buffer/service/texture_definition.cc38
-rw-r--r--chromium/gpu/command_buffer/service/texture_definition.h10
-rw-r--r--chromium/gpu/command_buffer/service/texture_manager.cc227
-rw-r--r--chromium/gpu/command_buffer/service/texture_manager.h56
-rw-r--r--chromium/gpu/command_buffer/service/texture_manager_unittest.cc281
-rw-r--r--chromium/gpu/command_buffer/service/transfer_buffer_manager.cc48
-rw-r--r--chromium/gpu/command_buffer/service/transfer_buffer_manager.h15
-rw-r--r--chromium/gpu/command_buffer/service/transfer_buffer_manager_unittest.cc2
-rw-r--r--chromium/gpu/command_buffer/service/vertex_attrib_manager.cc6
-rw-r--r--chromium/gpu/command_buffer_service.gypi28
-rw-r--r--chromium/gpu/config/BUILD.gn9
-rw-r--r--chromium/gpu/config/gpu_blacklist_unittest.cc4
-rw-r--r--chromium/gpu/config/gpu_control_list.cc24
-rw-r--r--chromium/gpu/config/gpu_control_list.h3
-rw-r--r--chromium/gpu/config/gpu_control_list_unittest.cc35
-rw-r--r--chromium/gpu/config/gpu_driver_bug_list.cc52
-rw-r--r--chromium/gpu/config/gpu_driver_bug_list_json.cc136
-rw-r--r--chromium/gpu/config/gpu_driver_bug_workaround_type.h12
-rw-r--r--chromium/gpu/config/gpu_info.cc13
-rw-r--r--chromium/gpu/config/gpu_info.h5
-rw-r--r--chromium/gpu/config/gpu_info_collector.cc11
-rw-r--r--chromium/gpu/config/gpu_info_collector_android.cc4
-rw-r--r--chromium/gpu/config/gpu_info_collector_linux.cc10
-rw-r--r--chromium/gpu/config/gpu_info_collector_mac.mm6
-rw-r--r--chromium/gpu/config/gpu_info_collector_unittest.cc242
-rw-r--r--chromium/gpu/config/gpu_info_collector_win.cc12
-rw-r--r--chromium/gpu/config/gpu_test_config.cc14
-rw-r--r--chromium/gpu/config/gpu_test_config.h16
-rw-r--r--chromium/gpu/config/gpu_test_config_unittest.cc22
-rw-r--r--chromium/gpu/config/gpu_test_expectations_parser.cc127
-rw-r--r--chromium/gpu/config/gpu_test_expectations_parser_unittest.cc27
-rw-r--r--chromium/gpu/config/gpu_util.cc8
-rw-r--r--chromium/gpu/config/software_rendering_list_json.cc21
-rw-r--r--chromium/gpu/gl_tests_apk.isolate17
-rw-r--r--chromium/gpu/gles2_conform_support/BUILD.gn66
-rw-r--r--chromium/gpu/gles2_conform_support/egl/display.cc26
-rw-r--r--chromium/gpu/gles2_conform_support/egl/display.h14
-rw-r--r--chromium/gpu/gles2_conform_support/egl/egl.cc208
-rw-r--r--chromium/gpu/gles2_conform_support/gles2_conform_support.gyp1
-rw-r--r--chromium/gpu/gles2_conform_support/gles2_conform_test.cc41
-rw-r--r--chromium/gpu/gles2_conform_support/gles2_conform_test.gyp2
-rw-r--r--chromium/gpu/gles2_conform_support/gles2_conform_test_expectations.txt15
-rw-r--r--chromium/gpu/gpu.gyp115
-rw-r--r--chromium/gpu/gpu_unittests.isolate3
-rw-r--r--chromium/gpu/gpu_unittests_apk.isolate17
-rw-r--r--chromium/gpu/ipc/gpu_command_buffer_traits_multi.h2
-rw-r--r--chromium/gpu/khronos_glcts_support/BUILD.gn6
-rw-r--r--chromium/gpu/skia_bindings/gl_bindings_skia_cmd_buffer.cc23
-rw-r--r--chromium/gpu/skia_runner/BUILD.gn1
-rw-r--r--chromium/gpu/skia_runner/in_process_graphics_system.cc22
-rw-r--r--chromium/gpu/tools/compositor_model_bench/BUILD.gn1
-rw-r--r--chromium/gpu/tools/compositor_model_bench/render_tree.cc2
-rw-r--r--chromium/gpu/tools/compositor_model_bench/render_tree.h2
-rw-r--r--chromium/gpu/tools/compositor_model_bench/shaders.cc2
-rw-r--r--chromium/gpu/tools/compositor_model_bench/shaders.h2
250 files changed, 20718 insertions, 15424 deletions
diff --git a/chromium/gpu/BUILD.gn b/chromium/gpu/BUILD.gn
index dd737e7ce4f..34ca8cba89e 100644
--- a/chromium/gpu/BUILD.gn
+++ b/chromium/gpu/BUILD.gn
@@ -49,6 +49,45 @@ component("gpu") {
]
}
+# GYP version: //gpu/gpu.gyp:command_buffer_gles2
+shared_library("command_buffer_gles2") {
+ sources = [
+ # TODO(hendrikw): Move egl out of gles2_conform_support.
+ "gles2_conform_support/egl/config.cc",
+ "gles2_conform_support/egl/config.h",
+ "gles2_conform_support/egl/display.cc",
+ "gles2_conform_support/egl/display.h",
+ "gles2_conform_support/egl/egl.cc",
+ "gles2_conform_support/egl/surface.cc",
+ "gles2_conform_support/egl/surface.h",
+ ]
+
+ deps = [
+ "//base",
+ "//gpu/command_buffer/client:gles2_c_lib",
+ "//gpu/command_buffer/client:gles2_implementation",
+ "//gpu/command_buffer/service",
+ "//ui/gl:gl",
+ ]
+
+ if (!is_component_build) {
+ deps += [
+ "//gpu/command_buffer/client:client_sources",
+ "//gpu/command_buffer/client:gles2_cmd_helper_sources",
+ ]
+ }
+
+ defines = [
+ "COMMAND_BUFFER_GLES_LIB_SUPPORT_ONLY",
+ "EGLAPIENTRY=",
+ ]
+ if (current_os == "win") {
+ defines += [ "EGLAPI=__declspec(dllexport)" ]
+ } else {
+ defines += [ "EGLAPI=__attribute__((visibility(\"default\")))" ]
+ }
+}
+
source_set("test_support") {
testonly = true
sources = [
@@ -69,15 +108,24 @@ source_set("test_support") {
]
}
+group("gl_tests_run") {
+ testonly = true
+ deps = [
+ ":gl_tests",
+ ]
+}
+
test("gl_tests") {
sources = [
"command_buffer/tests/compressed_texture_test.cc",
+ "command_buffer/tests/es3_misc_functions_unittest.cc",
"command_buffer/tests/gl_bind_uniform_location_unittest.cc",
"command_buffer/tests/gl_chromium_framebuffer_multisample_unittest.cc",
"command_buffer/tests/gl_chromium_path_rendering_unittest.cc",
"command_buffer/tests/gl_clear_framebuffer_unittest.cc",
"command_buffer/tests/gl_compressed_copy_texture_CHROMIUM_unittest.cc",
"command_buffer/tests/gl_copy_texture_CHROMIUM_unittest.cc",
+ "command_buffer/tests/gl_cube_map_texture_unittest.cc",
"command_buffer/tests/gl_depth_texture_unittest.cc",
"command_buffer/tests/gl_gpu_memory_buffer_unittest.cc",
"command_buffer/tests/gl_lose_context_chromium_unittest.cc",
@@ -130,6 +178,15 @@ test("gl_tests") {
}
}
+# TODO(GYP): Delete this after we've converted everything to GN.
+# The _run targets exist only for compatibility w/ GYP.
+group("gpu_unittests_run") {
+ testonly = true
+ deps = [
+ ":gpu_unittests",
+ ]
+}
+
test("gpu_unittests") {
sources = [
"command_buffer/client/buffer_tracker_unittest.cc",
@@ -155,10 +212,6 @@ test("gpu_unittests") {
"command_buffer/common/id_allocator_test.cc",
"command_buffer/common/trace_event.h",
"command_buffer/common/unittest_main.cc",
- "command_buffer/service/async_pixel_transfer_delegate_mock.cc",
- "command_buffer/service/async_pixel_transfer_delegate_mock.h",
- "command_buffer/service/async_pixel_transfer_manager_mock.cc",
- "command_buffer/service/async_pixel_transfer_manager_mock.h",
"command_buffer/service/buffer_manager_unittest.cc",
"command_buffer/service/cmd_parser_test.cc",
"command_buffer/service/command_buffer_service_unittest.cc",
@@ -180,7 +233,6 @@ test("gpu_unittests") {
"command_buffer/service/gles2_cmd_decoder_unittest_2_autogen.h",
"command_buffer/service/gles2_cmd_decoder_unittest_3.cc",
"command_buffer/service/gles2_cmd_decoder_unittest_3_autogen.h",
- "command_buffer/service/gles2_cmd_decoder_unittest_async_pixel.cc",
"command_buffer/service/gles2_cmd_decoder_unittest_attribs.cc",
"command_buffer/service/gles2_cmd_decoder_unittest_base.cc",
"command_buffer/service/gles2_cmd_decoder_unittest_base.h",
@@ -202,6 +254,7 @@ test("gpu_unittests") {
"command_buffer/service/memory_program_cache_unittest.cc",
"command_buffer/service/mocks.cc",
"command_buffer/service/mocks.h",
+ "command_buffer/service/path_manager_unittest.cc",
"command_buffer/service/program_cache_unittest.cc",
"command_buffer/service/program_manager_unittest.cc",
"command_buffer/service/query_manager_unittest.cc",
@@ -230,7 +283,12 @@ test("gpu_unittests") {
"config/gpu_util_unittest.cc",
]
- configs += [ "//build/config/compiler:no_size_t_to_int_warning" ]
+ configs += [
+ "//build/config:precompiled_headers",
+
+ # TODO(jschuh): crbug.com/167187 fix size_t to int truncations.
+ "//build/config/compiler:no_size_t_to_int_warning",
+ ]
deps = [
":gpu",
@@ -246,6 +304,7 @@ test("gpu_unittests") {
"//ui/gfx:test_support",
"//ui/gl",
"//ui/gl:gl_unittest_utils",
+ "//ui/gl:test_support",
"//gpu/command_buffer/common:gles2_utils",
"//gpu/command_buffer/client:gles2_c_lib",
"//gpu/command_buffer/client:gles2_implementation",
@@ -271,17 +330,20 @@ test("gpu_perftests") {
]
}
-test("angle_unittests") {
- sources = [
- "angle_unittest_main.cc",
+# TODO(GYP): Delete this after we've converted everything to GN.
+# The _run targets exist only for compatibility w/ GYP.
+group("angle_unittests_run") {
+ testonly = true
+ deps = [
+ "//third_party/angle/src/tests:angle_unittests",
]
+}
+# TODO(GYP): Delete this after we've converted everything to GN.
+# The _run targets exist only for compatibility w/ GYP.
+group("angle_end2end_tests_run") {
+ testonly = true
deps = [
- "//base",
- "//base/test:test_support",
- "//base/third_party/dynamic_annotations",
- "//testing/gmock",
- "//testing/gtest",
- "//third_party/angle:translator_static",
+ "//third_party/angle/src/tests:angle_end2end_tests",
]
}
diff --git a/chromium/gpu/GLES2/extensions/CHROMIUM/CHROMIUM_bind_uniform_location.txt b/chromium/gpu/GLES2/extensions/CHROMIUM/CHROMIUM_bind_uniform_location.txt
index c6619bb5462..ef4e6629c7e 100644
--- a/chromium/gpu/GLES2/extensions/CHROMIUM/CHROMIUM_bind_uniform_location.txt
+++ b/chromium/gpu/GLES2/extensions/CHROMIUM/CHROMIUM_bind_uniform_location.txt
@@ -8,7 +8,7 @@ Name Strings
Version
- Last Modifed Date: June 20, 2012
+ Last Modifed Date: September 8, 2015
Dependencies
@@ -110,12 +110,8 @@ New Procedures and Functions
the same location. This is referred to as aliasing. This will only work
if only one of the aliased uniforms is active in the executable program,
or if no path through the shader consumes more than one uniform of a set
- of uniforms aliased to the same location. A link error can occur if the
- linker determines that every path through the shader consumes multiple
- aliased uniforms, but implementations are not required to generate an
- error in this case. The compiler and linker are allowed to assume that no
- aliasing is done, and may employ optimizations that work only in the
- absence of aliasing.
+ of uniforms aliased to the same location. If two statically used uniforms
+ in a program are bound to the name location, link must fail.
Errors
@@ -128,4 +124,6 @@ New State
Revision History
7/20/2012 Documented the extension
+ 9/8/2015 Require program link to fail if two statically used uniforms
+ are bound to the same location.
diff --git a/chromium/gpu/GLES2/extensions/CHROMIUM/CHROMIUM_compressed_copy_texture.txt b/chromium/gpu/GLES2/extensions/CHROMIUM/CHROMIUM_compressed_copy_texture.txt
index c236ce3835b..d4f823ea970 100644
--- a/chromium/gpu/GLES2/extensions/CHROMIUM/CHROMIUM_compressed_copy_texture.txt
+++ b/chromium/gpu/GLES2/extensions/CHROMIUM/CHROMIUM_compressed_copy_texture.txt
@@ -8,7 +8,7 @@ Name Strings
Version
- Last Modifed Date: Jun 15, 2015
+ Last Modifed Date: August 5, 2015
Dependencies
@@ -71,6 +71,48 @@ New Procedures and Functions
INVALID_VALUE is generated if level 0 of the source texture is not defined.
+ The command
+
+ void glCompressedCopySubTextureCHROMIUM (GLenum target,
+ GLenum source_id,
+ GLenum dest_id,
+ GLint xoffset, GLint yoffset,
+ GLint x, GLint y,
+ GLsizei width, GLsizei height)
+
+ Copies the sub contents of texture referred to by <source_id> to <dest_id>
+ texture without redefining <dest_id> texture.
+
+ <target> uses the same parameters as TexImage2D.
+
+ <xoffset> and <yoffset> specify a texel offset in the x and y direction
+ respectively within the destination texture.
+
+ <x> and <y> specify a texel offset in the x and y direction respectively
+ within the source texture.
+
+ <width> specifies the width of the texture subimage.
+
+ <height> specifies the width of the texture subimage.
+
+ INVALID_OPERATION is generated if internal format of source texture is not
+ one of the following: GL_ATC_RGB_AMD, GL_ATC_RGBA_INTERPOLATED_ALPHA_AMD,
+ GL_COMPRESSED_RGB_S3TC_DXT1_EXT, GL_COMPRESSED_RGBA_S3TC_DXT5_EXT,
+ GL_ETC1_RGB8_OES
+
+ INVALID_VALUE is generated if <target> is not GL_TEXTURE_2D.
+
+ INVALID_OPERATION is generated if the destination texture has not been
+ defined.
+
+ INVALID_VALUE is generated if level 0 of the source texture or
+ the destination texture is not defined.
+
+ INVALID_VALUE is generated if <xoffset> < 0 , or <yoffset> < 0.
+
+ INVALID_VALUE is generated if (<xoffset> + <width>) > dest_width,
+ or (<yoffset> + <height>) > dest_height.
+
Errors
None.
@@ -86,3 +128,4 @@ New State
Revision History
15/6/2015 Documented the extension.
+ 5/8/2015 Added glCompressedCopySubTextureCHROMIUM.
diff --git a/chromium/gpu/GLES2/extensions/CHROMIUM/CHROMIUM_copy_texture.txt b/chromium/gpu/GLES2/extensions/CHROMIUM/CHROMIUM_copy_texture.txt
index be60af22dbb..101c0f6491d 100644
--- a/chromium/gpu/GLES2/extensions/CHROMIUM/CHROMIUM_copy_texture.txt
+++ b/chromium/gpu/GLES2/extensions/CHROMIUM/CHROMIUM_copy_texture.txt
@@ -16,6 +16,7 @@ Dependencies
EXT_texture_format_BGRA8888 affects the definition of this extension.
ARB_texture_rg affects the definition of this extension.
+ CHROMIUM_ycbcr_422_image affects the definition of this extension.
Overview
@@ -51,19 +52,20 @@ New Procedures and Functions
constants: GL_RGB, GL_RGBA
The internal format of <source_id> texture must be one of the following
symbolic constants: GL_R8, GL_ALPHA, GL_LUMINANCE, GL_LUMINANCE_ALPHA,
- GL_RGB, GL_RGBA, GL_BGRA_EXT
+ GL_RGB, GL_RGBA, GL_BGRA_EXT, GL_RGB_YCBCR_422_CHROMIUM
When <source_id> texture doens't contain a superset of the component
required by <internal_format>, fill the components by following rules.
- source format color components
- =================================================
- GL_ALPHA (0, 0, 0, A)
- GL_R8 (R, 0, 0, 1)
- GL_LUMINANCE (L, L, L, 1)
- GL_LUMINANCE_ALPHA (L, L, L, A)
- GL_RGB (R, G, B, 1)
- GL_RGBA (R, G, B, A)
- GL_BGRA_EXT (R, G, B, A)
+ source format color components
+ =====================================================
+ GL_ALPHA (0, 0, 0, A)
+ GL_R8 (R, 0, 0, 1)
+ GL_LUMINANCE (L, L, L, 1)
+ GL_LUMINANCE_ALPHA (L, L, L, A)
+ GL_RGB (R, G, B, 1)
+ GL_RGBA (R, G, B, A)
+ GL_BGRA_EXT (R, G, B, A)
+ GL_RGB_YCBCR_422_CHROMIUM (R, G, B, 1)
The format type of the destination texture is converted to that specified
by <dest_type>.
@@ -136,14 +138,19 @@ New Procedures and Functions
INVALID_VALUE is generated if <xoffset> < 0 , or <yoffset> < 0.
- INVALID_VALUE is generated if (<xoffset> + source_width) > dest_width,
- or (<yoffset> + source_height) > dest_height.
+ INVALID_VALUE is generated if (<xoffset> + <width>) > dest_width,
+ or (<yoffset> + <height>) > dest_height.
Dependencies on ARB_texture_rg
If ARB_texture_rg is not supported:
* delete any reference to the R8 format.
+Dependencies on CHROMIUM_ycbcr_422_image
+
+ If CHROMIUM_ycbcr_422_image is not supported:
+ * delete any reference to the RGB_YCBCR_422_CHROMIUM format.
+
Errors
None.
diff --git a/chromium/gpu/GLES2/extensions/CHROMIUM/CHROMIUM_path_rendering.txt b/chromium/gpu/GLES2/extensions/CHROMIUM/CHROMIUM_path_rendering.txt
index d2e8c93a027..824ee916aca 100644
--- a/chromium/gpu/GLES2/extensions/CHROMIUM/CHROMIUM_path_rendering.txt
+++ b/chromium/gpu/GLES2/extensions/CHROMIUM/CHROMIUM_path_rendering.txt
@@ -26,11 +26,44 @@ New Tokens
PATH_MODELVIEW_CHROMIUM 0x1700
PATH_PROJECTION_CHROMIUM 0x1701
+ Accepted in elements of the <commands> array parameter of
+ PathCommandsCHROMIUM:
+ CLOSE_PATH_CHROMIUM 0x00
+ MOVE_TO_CHROMIUM 0x02
+ LINE_TO_CHROMIUM 0x04
+ QUADRATIC_CURVE_TO_CHROMIUM 0x0A
+ CUBIC_CURVE_TO_CHROMIUM 0x0C
+ CONIC_CURVE_TO_CHROMIUM 0x1A
+
Accepted by the <pname> parameter of GetIntegerv,
GetFloatv:
PATH_MODELVIEW_MATRIX_CHROMIUM 0x0BA6
PATH_PROJECTION_MATRIX_CHROMIUM 0x0BA7
+ Accepted by the <pname> parameter of PathParameter{if}CHROMIUM:
+ PATH_STROKE_WIDTH_CHROMIUM 0x9075
+ PATH_END_CAPS_CHROMIUM 0x9076
+ PATH_JOIN_STYLE_CHROMIUM 0x9079
+ PATH_MITER_LIMIT_CHROMIUM 0x907a
+ PATH_STROKE_BOUND_CHROMIUM 0x9086
+
+ Accepted by the <value> parameter of PathParameter{if}CHROMIUM:
+ FLAT_CHROMIUM 0x1D00
+ SQUARE_CHROMIUM 0x90a3
+ ROUND_CHROMIUM 0x90a4
+ BEVEL_CHROMIUM 0x90A6
+ MITER_REVERT_CHROMIUM 0x90A7
+
+ Accepted by the <fillMode> parameter of StencilFillPathCHROMIUM:
+ COUNT_UP_CHROMIUM 0x9088
+ COUNT_DOWN_CHROMIUM 0x9089
+
+ Accepted by the <coverMode> parameter of CoverFillPathCHROMIUM,
+ CoverStrokePath, StencilThenCoverFillPathCHROMIUM and
+ StencilThenCoverStrokePathCHROMIUM:
+ CONVEX_HULL_CHROMIUM 0x908B
+ BOUNDING_BOX_CHROMIUM 0x908D
+
New Procedures and Functions
@@ -47,6 +80,445 @@ New Procedures and Functions
Effectively calls MatrixLoadf with the identity matrix.
+ uint GenPathsCHROMIUM(sizei range)
+
+ Returns an integer /n/ such that names /n/, ..., /n+range-1/ are
+ previously unused (i.e. there are /range/ previously unused path object
+ names starting at /n/). These names are marked as used, for the
+ purposes of subsequent GenPathsCHROMIUM only, but they do not acquire
+ path object state until each particular name is used to specify
+ a path object.
+
+ Returns 0 if no new path name was marked as used. Reasons for this
+ include lack of free path names or range being 0 or a GL error
+ was generated.
+
+ INVALID_VALUE error is generated if range is negative.
+
+ INVALID_OPERATION error is generated if range does not fit in
+ 32-bit uint.
+
+ void DeletePathsCHROMIUM(uint path, sizei range)
+
+ Deletes a path object where /path/ contains /range/ names of path objects to
+ be delete. After a path object is deleted, its name is again unused.
+ Unused names in /paths/ are silently ignored.
+
+ INVALID_VALUE error is generated if /range/ is negative.
+
+ INVALID_OPERATION error is generated if /range/ does not
+ fit in 32-bit uint.
+
+ INVALID_OPERATION error is generated if /path/ + /range/ does not fit
+ 32-bit uint.
+
+ boolean IsPathCHROMIUM(uint path);
+
+ The query returns TRUE if /path/ is the name of a path object. If path is
+ not the name of a path object, or if an error condition occurs,
+ IsPathCHROMIUM returns FALSE. A name retuned by GenPathsCHROMIUM, but
+ without a path specified for it yet, is not the name of a path object.
+
+ void PathCommandsCHROMIUM(uint path, sizei numCommands,
+ const ubyte* commands, sizei numCoords,
+ enum coordType, const GLvoid* coords)
+
+ Specifies a path object commands for /path/ where /numCommands/
+ indicates the number of path commands, read from the array
+ /commands/, with which to initialize that path's command sequence.
+ The type of the coordinates read from the /coords/ array is
+ determined by the /coordType/ parameter which must be one of BYTE,
+ UNSIGNED_BYTE, SHORT, UNSIGNED_SHORT, or FLOAT, otherwise the
+ INVALID_ENUM error is generated. These path commands reference
+ coordinates read sequentially from the /coords/ array.
+
+ The /numCommands/ elements of the /commands/ array must be tokens
+ in Table 5.pathCommands. The command sequence matches
+ the element order of the /commands/ array. Each command references
+ a number of coordinates specified by "Coordinate count" column of
+ Table 5.pathCommands, starting with the first (zero) element of
+ the /coords/ array and advancing by the coordinate count for each
+ command. If any of these /numCommands/ command values are not
+ listed in the "Token" column of Table
+ 5.pathCommands, the INVALID_ENUM error is generated.
+
+ The INVALID_OPERATION error is generated if /numCoords/ does not
+ equal the number of coordinates referenced by the command sequence
+ specified by /numCommands/ and /commands/ (so /numCoords/ provides a
+ sanity check that the /coords/ array is being interpreted properly).
+ The error INVALID_VALUE is generated if either /numCommands/ or
+ /numCoords/ is negative.
+
+ The error INVALID_OPERATION is generated if /path/ is
+ not an existing path object.
+
+ The error INVALID_OPERATION is generated if
+ /numCommands/ + (size of /coordType/ data type) * /numCoords/
+ does not fit in 32-bit uint.
+
+ If the PathCommandsCHROMIUM command results in an error, the path object
+ named /path/ is not changed; if there is no error, the prior contents
+ of /path/, if /path/ was an existent path object, are lost and the
+ path object name /path/ becomes used.
+
+ void PathParameterfCHROMIUM(uint path, enum pname, float value)
+ void PathParameteriCHROMIUM(uint path, enum pname, int value)
+
+ The commands specify the value of path parameters for the specified path
+ object named /path/. The error INVALID_OPERATION is generated if /path/ is
+ not an existing path object.
+
+ Each parameter has a single (scalar) value.
+
+ /pname/ must be one of the tokens in the "Name" column of
+ Table 5.pathParameters.
+ The required values or range of each allowed parameter name token
+ is listed in Table 5.pathParameter's "Required Values/Range" column.
+
+ For values of /pname/ listed in Table 5.pathsParameters, the specified
+ parameter is specified by /value/ when /value/ is a float or int,
+ or if /value/ is a pointer to a float or int, accessed through that
+ pointer. The error INVALID_VALUE is generated if the specified
+ value is negative for parameters required to be non-negative in
+ Table 5.pathParameters.
+
+ The error INVALID_VALUE is generated if the specified parameter value
+ is not within the require range for parameters typed float or integer.
+ The error INVALID_ENUM is generated if the specified parameter value
+ is not one of the listed tokens for parameters typed enum.
+
+ void PathStencilFuncCHROMIUM(enum func, int ref, uint mask)
+
+ Configures the stencil function, stencil reference value, and stencil read
+ mask to be used by the StencilFillPathCHROMIUM and StencilStrokePathCHROMIUM
+ commands described subsequently. The parameters accept the same values
+ allowed by the StencilFunc command.
+
+ void StencilFillPathCHROMIUM(uint path, enum fillMode, uint mask)
+
+ The function transforms into window space the outline of the path object
+ named /path/ based on the current modelview, projection and viewport,
+ transforms (ignoring any vertex and/or geometry shader or program that might
+ be active/enabled) and then updates the stencil values of all /accessible
+ samples/ (explained below) in the framebuffer. Each sample's stencil buffer
+ value is updated based on the winding number of that sample with respect to
+ the transformed outline of the path object with any non-closed subpath
+ forced closed and the specified /fillMode/.
+
+ If /path/ does not name an existing path object, the command does
+ nothing (and no error is generated).
+
+ If the path's command sequence specifies unclosed subpaths (so not
+ contours) due to MOVE_TO_CHROMIUM commands, such subpaths are trivially
+ closed by connecting with a line segment the initial and terminal
+ control points of each such path command subsequence.
+
+ Transformation of a path's outline works by taking all positions on the
+ path's outline in 2D path space (x,y) and constructing an object space
+ position (x,y,0,1) that is then used similar to as with the (xo,yo,zo,wo)
+ position in section 2.12 ("Fixed-Function Vertex Transformation") of OpenGL
+ 3.2 (unabridged) Specification (Special Functions) to compute corresponding
+ eye-space coordinates (xe,ye,ze,we) and clip-space coordinates
+ (xc,yc,zc,wc). A path outline's clip-space coordinates are further
+ transformed into window space similar to as described in section 2.16
+ ("Coordinate Transformations"). This process provides a mapping 2D path
+ coordinates to 2D window coordinates. The resulting 2D window coordinates
+ are undefined if any of the transformations involved are singular or may be
+ inaccurate if any of the transformations (or their combination) are
+ ill-conditioned.
+
+ The winding number for a sample with respect to the path outline,
+ transformed into window space, is computed by counting the (signed)
+ number of revolutions around the sample point when traversing each
+ (trivially closed if necessary) contour once in the transformed path.
+ This traversal is performed in the order of the path's command
+ sequence. Starting from an initially zero winding count, each
+ counterclockwise revolution when the front face mode is CCW (or
+ clockwise revolution when the front face mode is CW) around the sample
+ point increments the winding count by one; while each clockwise
+ revolution when the front face mode is CCW (or counterclockwise
+ revolution when the front face mode is CW) around the sample point
+ decrements the winding count by one.
+
+ The /mask/ parameter controls what subset of stencil bits are affected
+ by the command.
+
+ The /fillMode/ parameter must be one of INVERT, COUNT_UP_CHROMIUM
+ or COUNT_DOWN_CHROMIUM; otherwise the INVALID_ENUM error
+ is generated. INVERT inverts the bits set in the effective /mask/
+ value for each sample's stencil value if the winding number for the
+ given sample is odd. COUNT_UP_CHROMIUM adds with modulo n arithmetic the
+ winding number of each sample with the sample's prior stencil buffer
+ value; the result of this addition is written into the sample's
+ stencil value but the bits of the stencil value not set in the
+ effective /mask/ value are left unchanged. COUNT_DOWN_CHROMIUM subtracts
+ with modulo /n/ arithmetic the winding number of each sample with the
+ sample's prior stencil buffer value; the result of this subtraction is
+ written into the sample's stencil value but the bits of the stencil
+ value not set in the effective /mask/ value are left unchanged.
+
+ The value of /n/ for the modulo /n/ arithmetic used by COUNT_UP_CHROMIUM
+ and COUNT_DOWN_CHROMIUM is the effective /mask/+1. The error INVALID_VALUE
+ is generated if /fillMode/ is COUNT_UP_CHROMIUM or COUNT_DOWN_CHROMIUM and
+ the effective /mask/+1 is not an integer power of two.
+
+ ACCESSIBLE SAMPLES WITH RESPECT TO A TRANSFORMED PATH
+
+ The accessible samples of a transformed path that are updated are
+ the samples that remain after discarding the following samples:
+
+ * Any sample that would be clipped similar to as specified in section
+ 2.22 ("Primitive Clipping") of OpenGL 3.2 (unabridged) Specification
+ (Special Functions) because its corresponding position in clip space
+ (xc,yc,zc,wc) or (xe,ye,ze,we) would be clipped by the clip volume
+ or enabled client-defined clip planes.
+
+ * Any sample that would fail the pixel ownership test (section
+ 4.1.1) if rasterized.
+
+ * Any sample that would fail the scissor test (section 4.1.2)
+ if SCISSOR_TEST is enabled.
+
+ And for the StencilFillPathCHROMIUM and StencilStrokePathCHROMIUM commands
+ (so not applicable to the CoverFillPathCHROMIUM and CoverStrokePathCHROMIUM
+ commands):
+ * Any sample that would fail the (implicitly enabled) stencil test
+ with the stencil function configured based on the path stencil
+ function state configured by PathStencilFuncCHROMIUM. In the case
+ of the StencilFillPathCHROMIUM and StencilStrokePathCHROMIUM
+ commands, the effective stencil read
+ mask for the stencil mask is treated as the value of
+ PATH_STENCIL_VALUE_MASK bit-wise ANDed with the bit-invert of the
+ effective /mask/ parameter value; otherwise, for the cover commands,
+ the stencil test operates normally. In the case the stencil test
+ fails during a path stencil operation, the stencil fail operation is
+ ignored and the pixel's stencil value is left undisturbed (as if the
+ stencil operation was KEEP).
+
+ * The state of the face culling (CULL_FACE) enable is ignored.
+
+ void StencilStrokePathCHROMIUM(uint path, int reference, uint mask)
+
+ Transforms into window space the stroked region of the path object named
+ /path/ based on the current modelview, projection and viewport transforms
+ (ignoring any vertex and/or geometry shader or program that might be
+ active/enabled) and then updates the stencil values of a subset of the
+ accessible samples (see above) in the framebuffer.
+
+ If /path/ does not name an existing path object, the command does
+ nothing (and no error is generated).
+
+ The path object's specified stroke width (in path space) determines
+ the width of the path's stroked region.
+
+ The stroke of a transformed path's outline
+ is the region of window space defined by the union of:
+
+ * Sweeping an orthogonal centered line segment of the (above
+ determined) effective stroke width along each path segment
+ in the path's transformed outline.
+
+ * End cap regions (explained below) appended to the initial
+ and terminal control points of non-closed command sequences
+ in the path. For a sequence of commands that form a closed
+ contour, the end cap regions are ignored.
+
+ * Join style regions (explained below) between connected path
+ segments meet.
+
+ Any accessible samples within the union of these three regions are
+ considered within the path object's stroke.
+
+ If the stroke width is zero, each of the regions in the union will
+ be empty and there are no accessible samples within the stroke.
+
+ The /mask/ parameter controls what subset of stencil bits are affected
+ by the command.
+
+ A sample's stencil bits that are set in the effective /mask/ value
+ are updated with the specified stencil /reference/ value if the
+ sample is accessible (as specified above) and within the stroke of
+ the transformed path's outline.
+
+ Every path object has an end caps parameter
+ PATH_END_CAPS_CHROMIUM) that is one of FLAT_CHROMIUM,
+ SQUARE_CHROMIUM or ROUND_CHROMIUM. This parameter defines the
+ initial and terminal caps type. There are no samples within a
+ FLAT_CHROMIUM cap. The SQUARE_CHROMIUM cap extends centered and
+ tangent to the given end (initial or terminal) of the subpath for
+ half the effective stroke width; in other words, a square cap is a
+ half-square that kisses watertightly the end of a subpath. The
+ ROUND_CHROMIUM cap appends a semi-circle, centered and tangent,
+ with the diameter of the effective stroke width to the given end
+ (initial or terminal) of the subpath; in other words, a round cap
+ is a semi-circle that kisses watertightly the end of a subpath.
+
+ Every path object has a join style that is one of BEVEL_CHROMIUM,
+ ROUND_CHROMIUM or MITER_REVERT_CHROMIUM. Each path object also has a miter
+ limit value. The BEVEL_CHROMIUM join style inserts a triangle with two
+ vertices at the outside corners where two connected path segments join and a
+ third vertex at the common end point shared by the two path segments. The
+ ROUND_CHROMIUM join style inserts a wedge-shaped portion of a circle
+ centered at the common end point shared by the two path segments; the radius
+ of the circle is half the effective stroke width. The MITER_REVERT_CHROMIUM
+ join style inserts a quadrilateral with two opposite vertices at the outside
+ corners where the two connected path segments join and two opposite vertices
+ with one on the path's junction between the two joining path segments and
+ the other at the common end point shared by the two path segments. However,
+ the MITER_REVERT_CHROMIUM join style behaves as the BEVEL_CHROMIUM style if
+ the sine of half the angle between the two joined segments is less than the
+ path object's PATH_STROKE_WIDTH value divided by the path's
+ PATH_MITER_LIMIT_CHROMIUM value.
+
+ Every path object has a stroke approximation bound parameter
+ (PATH_STROKE_BOUND_CHROMIUM) that is a floating-point value /sab/ clamped
+ between 0.0 and 1.0 and set and queried with the PATH_STROKE_BOUND_CHROMIUM
+ path parameter. Exact determination of samples swept an orthogonal
+ centered line segment along cubic Bezier segments and rational
+ quadratic Bezier curves (so non-circular partial elliptical arcs) is
+ intractable for real-time rendering so an approximation is required;
+ /sab/ intuitively bounds the approximation error as a percentage of
+ the path object's stroke width. Specifically, this path parameter
+ requests the implementation to stencil any samples within /sweep/
+ object space units of the exact sweep of the path's cubic Bezier
+ segments or partial elliptical arcs to be sampled by the stroke where
+
+ sweep = ((1-sab)*sw)/2
+
+ where /sw/ is the path object's stroke width. The initial value
+ of /sab/ when a path is created is 0.2. In practical terms, this
+ initial value means the stencil sample positions coverage within 80%
+ (100%-20%) of the stroke width of cubic and rational quadratic stroke
+ segments should be sampled.
+
+
+ void CoverFillPathCHROMIUM(uint path, enum coverMode)
+
+ The command transforms into window space the outline of the path object
+ named /path/ based on the current modelview, projection and viewport
+ transforms (ignoring any vertex and/or geometry shader or program that might
+ be active/enabled) and rasterizes a subset of the accessible samples in the
+ framebuffer guaranteed to include all samples that would have a net
+ stencil value change if StencilFillPathCHROMIUM were issued with the same
+ modelview, projection, and viewport state. During this rasterization, the
+ stencil test operates normally and as configured; the expectation is the
+ stencil test will be used to discard samples not determined "covered" by a
+ prior StencilFillPathCHROMIUM command.
+
+ If /path/ does not name an existing path object, the command does
+ nothing (and no error is generated).
+
+ /coverMode/ must be one of CONVEX_HULL_CHROMIUM or BOUNDING_BOX_CHROMIUM.
+ Otherwise, INVALID_ENUM error is generated.
+
+ The subset of accessible pixels that are rasterized are within a bounding
+ box (expected to be reasonably tight) surrounding all the samples guaranteed
+ to be rasterized by CoverFillPathCHROMIUM. The bounding box must be
+ orthogonally aligned to the path space coordinate system. (The area of the
+ bounding box in path space is guaranteed to be greater than or equal the
+ area of the convex hull in path space.) Each rasterized sample will be
+ rasterized once and exactly once.
+
+ While samples with a net stencil change /must/ be rasterized,
+ implementations are explicitly allowed to vary in the rasterization
+ of samples for which StencilFillPathCHROMIUM would /not/ change sample's
+ net stencil value. This means implementations are allowed to (and,
+ in fact, are expected to) conservatively "exceed" the region strictly
+ stenciled by the path object.
+
+ CoverFillPathCHROMIUM /requires/ the following rasterization invariance:
+ calling CoverFillPathCHROMIUM for the same (unchanged) path object with
+ fixed (unchanged) modelview, projection, and viewport transform state
+ with the same (unchanged) set of accessible samples will rasterize
+ the exact same set of samples with identical interpolated values
+ for respective fragment/sample locations.
+
+ void CoverStrokePathCHROMIUM(uint path, enum coverMode)
+
+ The command operates in the same manner as CoverFillPathCHROMIUM except the
+ region guaranteed to be rasterized is, rather than the region within
+ /path/'s filled outline, instead the region within the /path/'s stroked
+ region as determined by StencilStrokePathCHROMIUM. During this
+ rasterization, the stencil test operates normally and as configured; the
+ expectation is the stencil test will be used to discard samples not
+ determined "covered" by a prior StencilStrokePathCHROMIUM command.
+
+ If /path/ does not name an existing path object, the command does
+ nothing (and no error is generated).
+
+ /coverMode/ must be one of CONVEX_HULL_CHROMIUM or BOUNDING_BOX_CHROMIUM.
+ Otherwise, INVALID_ENUM error is generated.
+
+ Analogous to the rasterization guarantee of CoverFillPathCHROMIUM with
+ respect to StencilFillPathCHROMIUM, CoverStrokePathCHROMIUM guarantees that
+ all samples rasterized by StencilStrokePathCHROMIUM, given the same
+ transforms and accessible pixels and stroke width, will also be rasterized
+ by the corresponding CoverStrokePathCHROMIUM.
+
+ CoverStrokePathCHROMIUM /requires/ the following rasterization invariance:
+ calling CoverStrokePathCHROMIUM for the same (unchanged) path object with
+ fixed (unchanged) modelview, projection, and viewport transform state and
+ with the same (unchanged) set of accessible samples will rasterize the exact
+ same set of samples with identical interpolated values for respective
+ fragment/sample locations.
+
+ void StencilThenCoverFillPathCHROMIUM(uint path, enum fillMode, uint mask, enum coverMode)
+
+ The command is equivalent to the two commands
+
+ StencilFillPathCHROMIUM(path, fillMode, mask);
+ CoverFillPathCHROMIUM(path, coverMode);
+
+ unless either command would generate an error; for any such error
+ other than OUT_OF_MEMORY, only that error is generated.
+
+ void StencilThenCoverStrokePathCHROMIUM(uint path, int reference, uint mask, enum coverMode)
+
+ The command is equivalent to the two commands
+
+ StencilStrokePathCHROMIUM(path, reference, mask);
+ CoverStrokePathCHROMIUM(path, coverMode);
+
+ unless either command would generate an error; for any such error
+ other than OUT_OF_MEMORY, only that error is generated.
+
+
+ PATH COVERING RASTERIZATION DETAILS
+
+ The GL processes fragments rasterized by path cover commands in
+ much the same manner as fragments generated by conventional polygon
+ rasterization. However path rendering /ignores/ the following
+ operations:
+
+ * Interpolation of per-vertex data (section 3.6.1). Path
+ primitives have neither conventional vertices nor per-vertex
+ data. Instead fragments generate interpolated per-fragment
+ colors, texture coordinate sets, as a
+ linear function of object-space or eye-space path coordinate's
+ or using the current color or texture coordinate set state
+ directly.
+
+ Depth offset (section 3.6.2) and polygon multisample rasterization
+ (3.6.3) do apply to path covering.
+
+ Front and back face determination (explained in section 3.6.1 for
+ polygons) operates somewhat differently for transformed paths than
+ polygons. The path's convex hull or bounding box
+ (depending on the /coverMode/) is specified to wind counterclockwise
+ in object space, though the transformation of the convex hull into
+ window space could reverse this winding. Whether the GL's front face
+ state is CW or CCW (as set by the FrontFace command) determines
+ if the path is front facing or not. Because the specific vertices
+ that belong to the covering geometry are implementation-dependent,
+ when the signed area of the covering geometry (computed with equation
+ 3.6) is sufficiently near zero, the facingness of the path in such
+ situations is ill-defined.
+
+ The determination of whether a path transformed into window space is
+ front facing or not affects face culling if enabled (section 3.6.1),
+ the gl_FrontFacing built-in variable (section 3.9.2), and separate
+ (two-sided) stencil testing (section 4.1.4).
+
Errors
None.
@@ -59,6 +531,102 @@ New State
matrix for path rendering
PATH_PROJECTION_MATRIX_CHROMIUM 16xR GetFloatv all 0's Current projection
matrix for path rendering
+ PATH_STENCIL_FUNC_CHROMIUM Z8 GetIntegerv ALWAYS path stenciling function
+ PATH_STENCIL_REF_CHROMIUM Z+ GetIntegerv 0 path stenciling
+ reference value
+ PATH_STENCIL_VALUE_MASK_CHROMIUM path stencil read
+ Z+ GetIntegerv 1's mask
+
+Tables
+ Table 5.pathCommands: Path Commands
+
+ Coordinate
+ Token Description count
+ ========================== ===================== ==========
+ MOVE_TO_CHROMIUM Absolute move 2
+ current point
+ -------------------------- --------------------- ----------
+ CLOSE_PATH_CHROMIUM Close path 0
+ -------------------------- --------------------- ----------
+ LINE_TO_CHROMIUM Absolute line 2
+ -------------------------- --------------------- ----------
+ QUADRATIC_CURVE_TO_CHROMIUM Absolute quadratic 4
+ -------------------------- --------------------- ----------
+ CUBIC_CURVE_TO_CHROMIUM Absolute cubic 6
+ Bezier segment
+ -------------------------- --------------------- ----------
+ CONIC_CURVE_TO_CHROMIUM Absolute conic 5
+ (rational Bezier)
+ segment
+
+
+ Table 5.pathParameters
+ Name Type Required Values or Range
+ ------------------------------- ------- -----------------------------------------------
+ PATH_STROKE_WIDTH_CHROMIUM float non-negative
+ PATH_END_CAPS_CHROMIUM enum FLAT, SQUARE_CHROMIUM, ROUND_CHROMIUM
+ PATH_JOIN_STYLE_CHROMIUM enum MITER_REVERT_CHROMIUM, BEVEL_CHROMIUM, ROUND_CHROMIUM
+ PATH_MITER_LIMIT_CHROMIUM float non-negative
+ PATH_STROKE_BOUND_CHROMIUM float will be clamped to [0, 1.0], initially 0.2 (20%)
+
+
+Issues
+
+ 1. Should there be a distinct stencil function state for path
+ stenciling?
+
+ RESOLVED: YES. glPathStencilFunc sets the state. How the
+ stencil state needs to be configured for path covering is
+ different than how the stencil function is configured typically
+ for path stenciling.
+
+ For example, stencil covering might use
+ StencilFunc(NOT_EQUAL,0,~0) while path stenciling would
+ use ALWAYS for the path stenciling stencil test.
+
+ However there are other situations such as path clipping where it
+ is useful to have the path stencil function configured differently
+ such as PathStencilFunc(NOT_EQUAL, 0x00, 0x80) or other
+ similar path clipping test.
+
+ 2. Since Cover*Path* skips the vertex shader, what does it mean exactly
+ wrt a fully linked program? What happens to the fragment shader's input
+ varyings that are not filled by the vertex shader + rasterizer?
+
+ It is possible that input varyings from a shader may not be written
+ as output varyings of a preceding shader. In this case, the unwritten
+ input varying values are set to constant zeros.
+
+ 3. What is the defined behavior when stroking if PATH_STROKE_WIDTH is
+ zero?
+
+ There will not be any samples within the stroke. I.e. the stroke does
+ not produce any visible results.
+
+ 4. How do you define a program that's valid to use with these calls.
+
+ There is no change with respect to validity of the programs. All
+ programs that are valid before this extension are valid after.
+ All programs that are invalid before this extension is invalid
+ after.
+
+ 5. Can same programs be used to render regular GL primitives as well
+ as in covering paths?
+
+ Yes.
+
+ 6. How is the fragment shader called when covering paths, and with
+ which values for the inputs?
+
+ gl_FragCoord: Interpolated coordinate of the path coverage.
+
+ gl_FrontFacing:
+ * Paths wind by default counterclockwise
+ * Window space transform can reverse this winding
+ * GL front face state CW/CCW selects whether the variable is true
+ or false
+
+ user-defined varyings: constant zeros.
Revision History
diff --git a/chromium/gpu/GLES2/extensions/CHROMIUM/CHROMIUM_screen_space_antialiasing.txt b/chromium/gpu/GLES2/extensions/CHROMIUM/CHROMIUM_screen_space_antialiasing.txt
new file mode 100644
index 00000000000..89574abd4a9
--- /dev/null
+++ b/chromium/gpu/GLES2/extensions/CHROMIUM/CHROMIUM_screen_space_antialiasing.txt
@@ -0,0 +1,48 @@
+Name
+
+ CHROMIUM_screen_space_antialiasing
+
+Name Strings
+
+ GL_CHROMIUM_screen_space_antialiasing
+
+Version
+
+ Last Modifed Date: August 27, 2015
+
+Dependencies
+
+ OpenGL ES 2.0 is required.
+
+Overview
+
+ This extension performs the antialiasing to all color attachments of
+ the currently bound draw framebuffer. Reference GL_INTEL_framebuffer_CMAA
+ for more details.
+
+New Tokens
+
+ None
+
+New Procedures and Functions
+
+ void ApplyScreenSpaceAntialiasingCHROMIUM(void);
+
+ Apply antialiasing to all color attachments of the currently bound draw framebuffer.
+
+ INVALID_OPERATION is generated if any of the current draw buffers is multisampled.
+
+ OUT_OF_MEMORY may be generated if fail to allocate internal resources necessary to
+ perform the requested operation.
+
+Errors
+
+ None.
+
+New State
+
+ None.
+
+Revision History
+
+ 27/8/2015 Documented the extension
diff --git a/chromium/gpu/GLES2/extensions/CHROMIUM/CHROMIUM_sync_point.txt b/chromium/gpu/GLES2/extensions/CHROMIUM/CHROMIUM_sync_point.txt
index 965cb44b0c0..9f1863cc005 100644
--- a/chromium/gpu/GLES2/extensions/CHROMIUM/CHROMIUM_sync_point.txt
+++ b/chromium/gpu/GLES2/extensions/CHROMIUM/CHROMIUM_sync_point.txt
@@ -8,7 +8,7 @@ Name Strings
Version
- Last Modifed Date: February 25, 2013
+ Last Modifed Date: September 8, 2015
Dependencies
@@ -18,6 +18,13 @@ Overview
This extension allows a client to order operations between contexts.
+ This extension introduces the concept of "fence syncs" and "sync token".
+ Inserted fence syncs represents a position in the command stream of a
+ context. Sync tokens are generated from fence syncs and allows another
+ context to issue a "wait" command on the sync token. This wait command
+ will then guarantee that commands before the inserted fence sync are
+ submitted before commands after the sync token wait.
+
This extension implements a small subset of ARB_sync, with weaker
guarantees. In particular it doesn't ensure commands are actually executed
by the server, it only guarantees submission order.
@@ -30,39 +37,57 @@ Issues
None
-New Tokens
+New Procedures and Functions
- None
+ The command
-New Procedures and Functions
+ uint InsertFenceSyncCHROMIUM()
+
+ inserts a fence sync in the current command stream. The fence sync is
+ signaled when previous commands have been submitted to the server, or when
+ the context is destroyed, whichever happens first. The fence sync name is
+ only visible for the current context. The returned fence sync name cannot
+ be waited upon directly, but once the command is flushed to the server it
+ can be converted to a sync token using GenSyncTokenCHROMIUM which is
+ waitable.
The command
- uint InsertSyncPointCHROMIUM()
+ void GenSyncTokenCHROMIUM(uint fence_sync, GLbyte *sync_token)
- flushes the stream of commands for the current context and creates and
- inserts a sync point. The sync point acts as a fence, which is signaled when
- previous commands have been submitted to the server, or when the context is
- destroyed, whichever happens first. The sync point name is returned. The
- sync point is implicitly deleted when it becomes signaled. The sync point
- namespace is shared between all contexts on the same server, including other
- context groups.
+ converts <fence_sync> which is only visible to the current context to a
+ sync token which may be waited upon by any contexts on the same server.
+ The <fence_sync> command must be flushed before this function may be
+ called, otherwise an INVALID_OPERATION error is generated. The generated
+ <sync_token> must be generated on the same context as when
+ InsertSyncPointCHROMIUM was called. The <sync_token> can be passed and
+ used by any context on the same server, including other context groups.
+ <sync_token> returns a GL_SYNC_POINT_SIZE_CHROMIUM byte sized name.
The command
- void WaitSyncPointCHROMIUM(uint sync_point)
+ void WaitSyncTokenCHROMIUM(GLbyte *sync_token)
causes the current context to stop submitting commands until the specified
- sync point becomes signaled. This is implemented as a server-side wait.
- <sync_point> is the name of the sync point to wait for. If <sync_point>
- isn't a valid sync point returned by InsertSyncPointCHROMIUM, or if the sync
- point has already been deleted, the command is equivalent to a no-op and no
- error is generated.
+ fence sync becomes signaled. This is implemented as a server-side wait.
+ <sync_token> is a sync token generated by GenSyncPointCHROMIUM. If
+ <sync_token> isn't a valid sync token returned by GenSyncPointCHROMIUM, the
+ command is equivalent to a no-op and no error is generated.
+
+New Tokens
+
+ The size of a sync token name in bytes.
+
+ GL_SYNC_TOKEN_SIZE_CHROMIUM 12
Errors
- None.
+ INVALID_VALUE is generated if the <fence_sync> parameter of
+ GenSyncPointCHROMIUM is not a valid local fence sync name.
+
+ INVALID_OPERATION is generated if the <fence_sync> parameter of
+ GenSyncPointCHROMIUM has not been flushed to the server.
New State
@@ -71,3 +96,6 @@ New State
Revision History
2/25/2013 Documented the extension
+
+ 9/8/2015 Modified functions to InsertFenceSyncCHROMIUM,
+ GenSyncTokenCHROMIUM, and WaitSyncTokenCHROMIUM.
diff --git a/chromium/gpu/GLES2/extensions/CHROMIUM/CHROMIUM_ycbcr_422_image.txt b/chromium/gpu/GLES2/extensions/CHROMIUM/CHROMIUM_ycbcr_422_image.txt
new file mode 100644
index 00000000000..546d783976d
--- /dev/null
+++ b/chromium/gpu/GLES2/extensions/CHROMIUM/CHROMIUM_ycbcr_422_image.txt
@@ -0,0 +1,48 @@
+Name
+
+ CHROMIUM_ycbcr_422_image
+
+Name Strings
+
+ GL_CHROMIUM_ycbcr_422_image
+
+Version
+
+ Last Modifed Date: August 26, 2015
+
+Dependencies
+
+ OpenGL ES 2.0 is required.
+
+ GL_CHROMIUM_image is required.
+
+Overview
+
+ This extension provides a new internal image format to use when creating an
+ image from underlying '2vuy' buffers.
+
+ This extension is useful in conjunction with CreateImageCHROMIUM and
+ CreateGpuMemoryBufferImageCHROMIUM to define the format of GpuMemoryBuffer
+ backing the image.
+
+New Procedures and Functions
+
+ None.
+
+Errors
+
+ None.
+
+New Tokens
+
+ Accepted by the <internalformat> parameter of CreateImageCHROMIUM, and
+ <internalformat> parameter of CreateGpuMemoryBufferImageCHROMIUM:
+ GL_RGB_YCBCR_422_CHROMIUM 0x78FB
+
+New State
+
+ None.
+
+Revision History
+
+ 8/26/2015 Documented the extension
diff --git a/chromium/gpu/GLES2/gl2chromium.h b/chromium/gpu/GLES2/gl2chromium.h
index 0dc648d6608..42889dd3fa3 100644
--- a/chromium/gpu/GLES2/gl2chromium.h
+++ b/chromium/gpu/GLES2/gl2chromium.h
@@ -10,10 +10,6 @@
#include <GLES2/gl2platform.h>
#define GL_CONTEXT_LOST 0x300E
-#define GL_PATH_MODELVIEW_CHROMIUM 0x1700
-#define GL_PATH_PROJECTION_CHROMIUM 0x1701
-#define GL_PATH_MODELVIEW_MATRIX_CHROMIUM 0x0BA6
-#define GL_PATH_PROJECTION_MATRIX_CHROMIUM 0x0BA7
#if defined(GLES2_USE_MOJO)
#define GLES2_GET_FUN(name) MojoGLES2gl ## name
diff --git a/chromium/gpu/GLES2/gl2chromium_autogen.h b/chromium/gpu/GLES2/gl2chromium_autogen.h
index 05a7c50b93e..2e6ed9ba9b8 100644
--- a/chromium/gpu/GLES2/gl2chromium_autogen.h
+++ b/chromium/gpu/GLES2/gl2chromium_autogen.h
@@ -96,6 +96,7 @@
#define glGetAttachedShaders GLES2_GET_FUN(GetAttachedShaders)
#define glGetAttribLocation GLES2_GET_FUN(GetAttribLocation)
#define glGetBooleanv GLES2_GET_FUN(GetBooleanv)
+#define glGetBufferParameteri64v GLES2_GET_FUN(GetBufferParameteri64v)
#define glGetBufferParameteriv GLES2_GET_FUN(GetBufferParameteriv)
#define glGetError GLES2_GET_FUN(GetError)
#define glGetFloatv GLES2_GET_FUN(GetFloatv)
@@ -244,14 +245,19 @@
#define glTexStorage2DEXT GLES2_GET_FUN(TexStorage2DEXT)
#define glGenQueriesEXT GLES2_GET_FUN(GenQueriesEXT)
#define glDeleteQueriesEXT GLES2_GET_FUN(DeleteQueriesEXT)
+#define glQueryCounterEXT GLES2_GET_FUN(QueryCounterEXT)
#define glIsQueryEXT GLES2_GET_FUN(IsQueryEXT)
#define glBeginQueryEXT GLES2_GET_FUN(BeginQueryEXT)
#define glBeginTransformFeedback GLES2_GET_FUN(BeginTransformFeedback)
#define glEndQueryEXT GLES2_GET_FUN(EndQueryEXT)
#define glEndTransformFeedback GLES2_GET_FUN(EndTransformFeedback)
#define glGetQueryivEXT GLES2_GET_FUN(GetQueryivEXT)
+#define glGetQueryObjectivEXT GLES2_GET_FUN(GetQueryObjectivEXT)
#define glGetQueryObjectuivEXT GLES2_GET_FUN(GetQueryObjectuivEXT)
+#define glGetQueryObjecti64vEXT GLES2_GET_FUN(GetQueryObjecti64vEXT)
#define glGetQueryObjectui64vEXT GLES2_GET_FUN(GetQueryObjectui64vEXT)
+#define glSetDisjointValueSyncCHROMIUM \
+ GLES2_GET_FUN(SetDisjointValueSyncCHROMIUM)
#define glInsertEventMarkerEXT GLES2_GET_FUN(InsertEventMarkerEXT)
#define glPushGroupMarkerEXT GLES2_GET_FUN(PushGroupMarkerEXT)
#define glPopGroupMarkerEXT GLES2_GET_FUN(PopGroupMarkerEXT)
@@ -274,8 +280,6 @@
#define glGetRequestableExtensionsCHROMIUM \
GLES2_GET_FUN(GetRequestableExtensionsCHROMIUM)
#define glRequestExtensionCHROMIUM GLES2_GET_FUN(RequestExtensionCHROMIUM)
-#define glRateLimitOffscreenContextCHROMIUM \
- GLES2_GET_FUN(RateLimitOffscreenContextCHROMIUM)
#define glGetProgramInfoCHROMIUM GLES2_GET_FUN(GetProgramInfoCHROMIUM)
#define glGetUniformBlocksCHROMIUM GLES2_GET_FUN(GetUniformBlocksCHROMIUM)
#define glGetTransformFeedbackVaryingsCHROMIUM \
@@ -294,6 +298,8 @@
#define glCopySubTextureCHROMIUM GLES2_GET_FUN(CopySubTextureCHROMIUM)
#define glCompressedCopyTextureCHROMIUM \
GLES2_GET_FUN(CompressedCopyTextureCHROMIUM)
+#define glCompressedCopySubTextureCHROMIUM \
+ GLES2_GET_FUN(CompressedCopySubTextureCHROMIUM)
#define glDrawArraysInstancedANGLE GLES2_GET_FUN(DrawArraysInstancedANGLE)
#define glDrawElementsInstancedANGLE GLES2_GET_FUN(DrawElementsInstancedANGLE)
#define glVertexAttribDivisorANGLE GLES2_GET_FUN(VertexAttribDivisorANGLE)
@@ -317,11 +323,6 @@
#define glReleaseTexImage2DCHROMIUM GLES2_GET_FUN(ReleaseTexImage2DCHROMIUM)
#define glTraceBeginCHROMIUM GLES2_GET_FUN(TraceBeginCHROMIUM)
#define glTraceEndCHROMIUM GLES2_GET_FUN(TraceEndCHROMIUM)
-#define glAsyncTexSubImage2DCHROMIUM GLES2_GET_FUN(AsyncTexSubImage2DCHROMIUM)
-#define glAsyncTexImage2DCHROMIUM GLES2_GET_FUN(AsyncTexImage2DCHROMIUM)
-#define glWaitAsyncTexImage2DCHROMIUM GLES2_GET_FUN(WaitAsyncTexImage2DCHROMIUM)
-#define glWaitAllAsyncTexImage2DCHROMIUM \
- GLES2_GET_FUN(WaitAllAsyncTexImage2DCHROMIUM)
#define glDiscardFramebufferEXT GLES2_GET_FUN(DiscardFramebufferEXT)
#define glLoseContextCHROMIUM GLES2_GET_FUN(LoseContextCHROMIUM)
#define glInsertSyncPointCHROMIUM GLES2_GET_FUN(InsertSyncPointCHROMIUM)
@@ -334,7 +335,24 @@
#define glFlushDriverCachesCHROMIUM GLES2_GET_FUN(FlushDriverCachesCHROMIUM)
#define glMatrixLoadfCHROMIUM GLES2_GET_FUN(MatrixLoadfCHROMIUM)
#define glMatrixLoadIdentityCHROMIUM GLES2_GET_FUN(MatrixLoadIdentityCHROMIUM)
+#define glGenPathsCHROMIUM GLES2_GET_FUN(GenPathsCHROMIUM)
+#define glDeletePathsCHROMIUM GLES2_GET_FUN(DeletePathsCHROMIUM)
+#define glIsPathCHROMIUM GLES2_GET_FUN(IsPathCHROMIUM)
+#define glPathCommandsCHROMIUM GLES2_GET_FUN(PathCommandsCHROMIUM)
+#define glPathParameterfCHROMIUM GLES2_GET_FUN(PathParameterfCHROMIUM)
+#define glPathParameteriCHROMIUM GLES2_GET_FUN(PathParameteriCHROMIUM)
+#define glPathStencilFuncCHROMIUM GLES2_GET_FUN(PathStencilFuncCHROMIUM)
+#define glStencilFillPathCHROMIUM GLES2_GET_FUN(StencilFillPathCHROMIUM)
+#define glStencilStrokePathCHROMIUM GLES2_GET_FUN(StencilStrokePathCHROMIUM)
+#define glCoverFillPathCHROMIUM GLES2_GET_FUN(CoverFillPathCHROMIUM)
+#define glCoverStrokePathCHROMIUM GLES2_GET_FUN(CoverStrokePathCHROMIUM)
+#define glStencilThenCoverFillPathCHROMIUM \
+ GLES2_GET_FUN(StencilThenCoverFillPathCHROMIUM)
+#define glStencilThenCoverStrokePathCHROMIUM \
+ GLES2_GET_FUN(StencilThenCoverStrokePathCHROMIUM)
#define glGetGraphicsResetStatusKHR GLES2_GET_FUN(GetGraphicsResetStatusKHR)
#define glBlendBarrierKHR GLES2_GET_FUN(BlendBarrierKHR)
+#define glApplyScreenSpaceAntialiasingCHROMIUM \
+ GLES2_GET_FUN(ApplyScreenSpaceAntialiasingCHROMIUM)
#endif // GPU_GLES2_GL2CHROMIUM_AUTOGEN_H_
diff --git a/chromium/gpu/GLES2/gl2extchromium.h b/chromium/gpu/GLES2/gl2extchromium.h
index 038a303669a..74988dc6847 100644
--- a/chromium/gpu/GLES2/gl2extchromium.h
+++ b/chromium/gpu/GLES2/gl2extchromium.h
@@ -140,6 +140,10 @@ typedef void (
#define GL_RGB_YUV_420_CHROMIUM 0x78FA
#endif
+#ifndef GL_RGB_YCBCR_422_CHROMIUM
+#define GL_RGB_YCBCR_422_CHROMIUM 0x78FB
+#endif
+
#ifdef GL_GLEXT_PROTOTYPES
GL_APICALL GLuint GL_APIENTRY glCreateGpuMemoryBufferImageCHROMIUM(
GLsizei width,
@@ -223,15 +227,6 @@ typedef void (GL_APIENTRYP PFNGLRELEASETEXIMAGE2DCHROMIUMPROC) (
GLenum target, GLint imageId);
#endif /* GL_CHROMIUM_texture_from_image */
-/* GL_CHROMIUM_rate_limit_offscreen_context */
-#ifndef GL_CHROMIUM_rate_limit_offscreen_context
-#define GL_CHROMIUM_rate_limit_offscreen_context 1
-#ifdef GL_GLEXT_PROTOTYPES
-GL_APICALL void GL_APIENTRY glRateLimitOffscreenContextCHROMIUM();
-#endif
-typedef void (GL_APIENTRYP PFNGLRATELIMITOFFSCREENCONTEXTCHROMIUMPROC) ();
-#endif /* GL_CHROMIUM_rate_limit_offscreen_context */
-
/* GL_CHROMIUM_post_sub_buffer */
#ifndef GL_CHROMIUM_post_sub_buffer
#define GL_CHROMIUM_post_sub_buffer 1
@@ -370,9 +365,6 @@ typedef void (GL_APIENTRYP PFNGLBLITFRAMEBUFFERCHROMIUMPROC) (GLint srcX0, GLint
#ifndef GL_CHROMIUM_async_pixel_transfers
#define GL_CHROMIUM_async_pixel_transfers 1
-#ifndef GL_ASYNC_PIXEL_UNPACK_COMPLETED_CHROMIUM
-#define GL_ASYNC_PIXEL_UNPACK_COMPLETED_CHROMIUM 0x6005
-#endif
#ifndef GL_ASYNC_PIXEL_PACK_COMPLETED_CHROMIUM
#define GL_ASYNC_PIXEL_PACK_COMPLETED_CHROMIUM 0x6006
#endif
@@ -446,9 +438,31 @@ typedef void(GL_APIENTRYP PFNGLCOPYSUBTEXTURECHROMIUMPROC)(
#ifdef GL_GLEXT_PROTOTYPES
GL_APICALL void GL_APIENTRY glCompressedCopyTextureCHROMIUM(
GLenum target, GLenum source_id, GLenum dest_id);
+
+GL_APICALL void GL_APIENTRY glCompressedCopySubTextureCHROMIUM(
+ GLenum target,
+ GLenum source_id,
+ GLenum dest_id,
+ GLint xoffset,
+ GLint yoffset,
+ GLint x,
+ GLint y,
+ GLsizei width,
+ GLsizei height);
#endif
typedef void(GL_APIENTRYP PFNGLCOMPRESSEDCOPYTEXTURECHROMIUMPROC)(
GLenum target, GLenum source_id, GLenum dest_id);
+
+typedef void(GL_APIENTRYP PFNGLCOMPRESSEDCOPYSUBTEXTURECHROMIUMPROC)(
+ GLenum target,
+ GLenum source_id,
+ GLenum dest_id,
+ GLint xoffset,
+ GLint yoffset,
+ GLint x,
+ GLint y,
+ GLsizei width,
+ GLsizei height);
#endif /* GL_CHROMIUM_compressed_copy_texture */
/* GL_CHROMIUM_lose_context */
@@ -498,6 +512,15 @@ typedef GLboolean (GL_APIENTRYP PFNGLENABLEFEATURECHROMIUMPROC) (
#endif
#endif /* GL_CHROMIUM_command_buffer_latency_query */
+/* GL_CHROMIUM_screen_space_antialiasing */
+#ifndef GL_CHROMIUM_screen_space_antialiasing
+#define GL_CHROMIUM_screen_space_antialiasing 1
+#ifdef GL_GLEXT_PROTOTYPES
+GL_APICALL void GL_APIENTRY glApplyScreenSpaceAntialiasingCHROMIUM();
+#endif
+typedef void(GL_APIENTRYP PFNGLAPPLYSCREENSPACEANTIALIASINGCHROMIUMPROC)();
+#endif /* GL_CHROMIUM_screen_space_antialiasing */
+
/* GL_ARB_robustness */
#ifndef GL_ARB_robustness
#define GL_ARB_robustness 1
@@ -795,12 +818,172 @@ typedef void(GL_APIENTRYP PFNGLSCHEDULEOVERLAYPLANECHROMIUMPROC)(
GL_APICALL void GL_APIENTRY
glMatrixLoadfCHROMIUM(GLenum mode, const GLfloat* m);
GL_APICALL void GL_APIENTRY glMatrixLoadIdentityCHROMIUM(GLenum mode);
+GL_APICALL GLuint GL_APIENTRY glGenPathsCHROMIUM(GLsizei range);
+GL_APICALL void GL_APIENTRY glDeletePathsCHROMIUM(GLuint path, GLsizei range);
+GL_APICALL GLboolean GL_APIENTRY glIsPathCHROMIUM(GLuint path);
+GL_APICALL void GL_APIENTRY glPathCommandsCHROMIUM(GLuint path,
+ GLsizei numCommands,
+ const GLubyte* commands,
+ GLsizei numCoords,
+ GLenum coordType,
+ const void* coords);
+GL_APICALL void GL_APIENTRY
+glPathParameteriCHROMIUM(GLuint path, GLenum pname, GLint value);
+GL_APICALL void GL_APIENTRY
+glPathParameterfCHROMIUM(GLuint path, GLenum pname, GLfloat value);
+GL_APICALL void GL_APIENTRY
+glPathStencilFuncCHROMIUM(GLenum func, GLint ref, GLuint mask);
+GL_APICALL void GL_APIENTRY
+glStencilFillPathCHROMIUM(GLuint path, GLenum fillMode, GLuint mask);
+GL_APICALL void GL_APIENTRY
+glStencilStrokePathCHROMIUM(GLuint path, GLint reference, GLuint mask);
+GL_APICALL void GL_APIENTRY
+glCoverFillPathCHROMIUM(GLuint path, GLenum coverMode);
+GL_APICALL void GL_APIENTRY
+glCoverStrokePathCHROMIUM(GLuint name, GLenum coverMode);
+GL_APICALL void GL_APIENTRY
+glStencilThenCoverFillPathCHROMIUM(GLuint path,
+ GLenum fillMode,
+ GLuint mask,
+ GLenum coverMode);
+GL_APICALL void GL_APIENTRY
+glStencilThenCoverStrokePathCHROMIUM(GLuint path,
+ GLint reference,
+ GLuint mask,
+ GLenum coverMode);
+
#endif
typedef void(GL_APIENTRYP PFNGLMATRIXLOADFCHROMIUMPROC)(GLenum matrixMode,
const GLfloat* m);
typedef void(GL_APIENTRYP PFNGLMATRIXLOADIDENTITYCHROMIUMPROC)(
GLenum matrixMode);
+typedef GLuint(GL_APIENTRYP* PFNGLGENPATHSCHROMIUMPROC)(GLsizei range);
+typedef void(GL_APIENTRYP* PFNGLDELETEPATHSCHROMIUMPROC)(GLuint path,
+ GLsizei range);
+typedef GLboolean(GL_APIENTRYP* PFNGLISPATHCHROMIUMPROC)(GLuint path);
+typedef void(GL_APIENTRYP* PFNGLPATHCOMMANDSCHROMIUMPROC)(
+ GLuint path,
+ GLsizei numCommands,
+ const GLubyte* commands,
+ GLsizei numCoords,
+ GLenum coordType,
+ const GLvoid* coords);
+typedef void(GL_APIENTRYP* PFNGLPATHPARAMETERICHROMIUMPROC)(GLuint path,
+ GLenum pname,
+ GLint value);
+typedef void(GL_APIENTRYP* PFNGLPATHPARAMETERFCHROMIUMPROC)(GLuint path,
+ GLenum pname,
+ GLfloat value);
+typedef void(GL_APIENTRYP* PFNGLPATHSTENCILFUNCCHROMIUMPROC)(GLenum func,
+ GLint ref,
+ GLuint mask);
+typedef void(GL_APIENTRYP* PFNGLSTENCILFILLPATHCHROMIUMPROC)(GLuint path,
+ GLenum fillMode,
+ GLuint mask);
+typedef void(GL_APIENTRYP* PFNGLSTENCILSTROKEPATHCHROMIUMPROC)(GLuint path,
+ GLint reference,
+ GLuint mask);
+typedef void(GL_APIENTRYP* PFNGLCOVERFILLPATHCHROMIUMPROC)(GLuint path,
+ GLenum coverMode);
+typedef void(GL_APIENTRYP* PFNGLCOVERSTROKEPATHCHROMIUMPROC)(GLuint name,
+ GLenum coverMode);
+
+typedef void(GL_APIENTRYP* PFNGLSTENCILTHENCOVERFILLPATHCHROMIUMPROC)(
+ GLuint path,
+ GLenum fillMode,
+ GLuint mask,
+ GLenum coverMode);
+typedef void(GL_APIENTRYP* PFNGLSTENCILTHENCOVERSTROKEPATHCHROMIUMPROC)(
+ GLuint path,
+ GLint reference,
+ GLuint mask,
+ GLenum coverMode);
+
+#ifndef GL_CLOSE_PATH_CHROMIUM
+#define GL_CLOSE_PATH_CHROMIUM 0x00
+#endif
+#ifndef GL_MOVE_TO_CHROMIUM
+#define GL_MOVE_TO_CHROMIUM 0x02
+#endif
+#ifndef GL_LINE_TO_CHROMIUM
+#define GL_LINE_TO_CHROMIUM 0x04
+#endif
+#ifndef GL_QUADRATIC_CURVE_TO_CHROMIUM
+#define GL_QUADRATIC_CURVE_TO_CHROMIUM 0x0A
+#endif
+#ifndef GL_CUBIC_CURVE_TO_CHROMIUM
+#define GL_CUBIC_CURVE_TO_CHROMIUM 0x0C
+#endif
+#ifndef GL_CONIC_CURVE_TO_CHROMIUM
+#define GL_CONIC_CURVE_TO_CHROMIUM 0x1A
+#endif
+#ifndef GL_PATH_MODELVIEW_MATRIX_CHROMIUM
+#define GL_PATH_MODELVIEW_MATRIX_CHROMIUM 0x0BA6
+#endif
+#ifndef GL_PATH_PROJECTION_MATRIX_CHROMIUM
+#define GL_PATH_PROJECTION_MATRIX_CHROMIUM 0x0BA7
+#endif
+#ifndef GL_PATH_MODELVIEW_CHROMIUM
+#define GL_PATH_MODELVIEW_CHROMIUM 0x1700
+#endif
+#ifndef GL_PATH_PROJECTION_CHROMIUM
+#define GL_PATH_PROJECTION_CHROMIUM 0x1701
+#endif
+#ifndef GL_FLAT_CHROMIUM
+#define GL_FLAT_CHROMIUM 0x1D00
+#endif
+#ifndef GL_PATH_STROKE_WIDTH_CHROMIUM
+#define GL_PATH_STROKE_WIDTH_CHROMIUM 0x9075
+#endif
+#ifndef GL_PATH_END_CAPS_CHROMIUM
+#define GL_PATH_END_CAPS_CHROMIUM 0x9076
+#endif
+#ifndef GL_PATH_JOIN_STYLE_CHROMIUM
+#define GL_PATH_JOIN_STYLE_CHROMIUM 0x9079
+#endif
+#ifndef GL_PATH_MITER_LIMIT_CHROMIUM
+#define GL_PATH_MITER_LIMIT_CHROMIUM 0x907a
+#endif
+#ifndef GL_PATH_STROKE_BOUND_CHROMIUM
+#define GL_PATH_STROKE_BOUND_CHROMIUM 0x9086
+#endif
+#ifndef GL_COUNT_UP_CHROMIUM
+#define GL_COUNT_UP_CHROMIUM 0x9088
+#endif
+#ifndef GL_COUNT_DOWN_CHROMIUM
+#define GL_COUNT_DOWN_CHROMIUM 0x9089
+#endif
+#ifndef GL_CONVEX_HULL_CHROMIUM
+#define GL_CONVEX_HULL_CHROMIUM 0x908B
+#endif
+#ifndef GL_BOUNDING_BOX_CHROMIUM
+#define GL_BOUNDING_BOX_CHROMIUM 0x908D
+#endif
+#ifndef GL_SQUARE_CHROMIUM
+#define GL_SQUARE_CHROMIUM 0x90a3
+#endif
+#ifndef GL_ROUND_CHROMIUM
+#define GL_ROUND_CHROMIUM 0x90a4
+#endif
+#ifndef GL_ROUND_CHROMIUM
+#define GL_ROUND_CHROMIUM 0x90A4
+#endif
+#ifndef GL_BEVEL_CHROMIUM
+#define GL_BEVEL_CHROMIUM 0x90A6
+#endif
+#ifndef GL_MITER_REVERT_CHROMIUM
+#define GL_MITER_REVERT_CHROMIUM 0x90A7
+#endif
+#ifndef GL_PATH_STENCIL_FUNC_CHROMIUM
+#define GL_PATH_STENCIL_FUNC_CHROMIUM 0x90B7
+#endif
+#ifndef GL_PATH_STENCIL_REF_CHROMIUM
+#define GL_PATH_STENCIL_REF_CHROMIUM 0x90B8
+#endif
+#ifndef GL_PATH_STENCIL_VALUE_MASK_CHROMIUM
+#define GL_PATH_STENCIL_VALUE_MASK_CHROMIUM 0x90B9
+#endif
#endif /* GL_CHROMIUM_path_rendering */
diff --git a/chromium/gpu/blink/webgraphicscontext3d_impl.cc b/chromium/gpu/blink/webgraphicscontext3d_impl.cc
index 30fa260bb16..72131303300 100644
--- a/chromium/gpu/blink/webgraphicscontext3d_impl.cc
+++ b/chromium/gpu/blink/webgraphicscontext3d_impl.cc
@@ -258,6 +258,9 @@ DELEGATE_TO_GL_5(renderbufferStorageMultisampleCHROMIUM,
DELEGATE_TO_GL_1(activeTexture, ActiveTexture, WGC3Denum)
+DELEGATE_TO_GL(applyScreenSpaceAntialiasingCHROMIUM,
+ ApplyScreenSpaceAntialiasingCHROMIUM);
+
DELEGATE_TO_GL_2(attachShader, AttachShader, WebGLId, WebGLId)
DELEGATE_TO_GL_3(bindAttribLocation, BindAttribLocation, WebGLId,
@@ -826,6 +829,13 @@ DELEGATE_TO_GL_3(getQueryivEXT, GetQueryivEXT, WGC3Denum, WGC3Denum, WGC3Dint*)
DELEGATE_TO_GL_3(getQueryObjectuivEXT, GetQueryObjectuivEXT,
WebGLId, WGC3Denum, WGC3Duint*)
+DELEGATE_TO_GL_2(queryCounterEXT, QueryCounterEXT, WebGLId, WGC3Denum)
+DELEGATE_TO_GL_3(getQueryObjectui64vEXT,
+ GetQueryObjectui64vEXT,
+ WebGLId,
+ WGC3Denum,
+ WGC3Duint64*)
+
DELEGATE_TO_GL_8(copyTextureCHROMIUM,
CopyTextureCHROMIUM,
WGC3Denum,
@@ -966,16 +976,6 @@ DELEGATE_TO_GL_2R(mapBufferCHROMIUM, MapBufferCHROMIUM, WGC3Denum, WGC3Denum,
DELEGATE_TO_GL_1R(unmapBufferCHROMIUM, UnmapBufferCHROMIUM, WGC3Denum,
WGC3Dboolean)
-DELEGATE_TO_GL_9(asyncTexImage2DCHROMIUM, AsyncTexImage2DCHROMIUM, WGC3Denum,
- WGC3Dint, WGC3Denum, WGC3Dsizei, WGC3Dsizei, WGC3Dint,
- WGC3Denum, WGC3Denum, const void*)
-DELEGATE_TO_GL_9(asyncTexSubImage2DCHROMIUM, AsyncTexSubImage2DCHROMIUM,
- WGC3Denum, WGC3Dint, WGC3Dint, WGC3Dint, WGC3Dsizei,
- WGC3Dsizei, WGC3Denum, WGC3Denum, const void*)
-
-DELEGATE_TO_GL_1(waitAsyncTexImage2DCHROMIUM, WaitAsyncTexImage2DCHROMIUM,
- WGC3Denum)
-
DELEGATE_TO_GL_2(drawBuffersEXT, DrawBuffersEXT, WGC3Dsizei, const WGC3Denum*)
DELEGATE_TO_GL_4(drawArraysInstancedANGLE, DrawArraysInstancedANGLE, WGC3Denum,
@@ -1254,7 +1254,21 @@ void WebGraphicsContext3DImpl::ConvertAttributes(
output_attribs->fail_if_major_perf_caveat =
attributes.failIfMajorPerformanceCaveat;
output_attribs->bind_generates_resource = false;
- output_attribs->webgl_version = attributes.webGLVersion;
+ switch (attributes.webGLVersion) {
+ case 0:
+ output_attribs->context_type = ::gpu::gles2::CONTEXT_TYPE_OPENGLES2;
+ break;
+ case 1:
+ output_attribs->context_type = ::gpu::gles2::CONTEXT_TYPE_WEBGL1;
+ break;
+ case 2:
+ output_attribs->context_type = ::gpu::gles2::CONTEXT_TYPE_WEBGL2;
+ break;
+ default:
+ NOTREACHED();
+ output_attribs->context_type = ::gpu::gles2::CONTEXT_TYPE_OPENGLES2;
+ break;
+ }
}
} // namespace gpu_blink
diff --git a/chromium/gpu/blink/webgraphicscontext3d_impl.h b/chromium/gpu/blink/webgraphicscontext3d_impl.h
index f3d03d34a74..d5199dd6a2b 100644
--- a/chromium/gpu/blink/webgraphicscontext3d_impl.h
+++ b/chromium/gpu/blink/webgraphicscontext3d_impl.h
@@ -30,493 +30,500 @@ class WebGraphicsContext3DErrorMessageCallback;
class GPU_BLINK_EXPORT WebGraphicsContext3DImpl
: public NON_EXPORTED_BASE(blink::WebGraphicsContext3D) {
public:
- virtual ~WebGraphicsContext3DImpl();
+ ~WebGraphicsContext3DImpl() override;
//----------------------------------------------------------------------
// WebGraphicsContext3D methods
- virtual uint32_t lastFlushID();
-
- virtual unsigned int insertSyncPoint();
- virtual void waitSyncPoint(unsigned int sync_point);
-
- virtual void loseContextCHROMIUM(blink::WGC3Denum current,
- blink::WGC3Denum other);
-
- virtual void reshapeWithScaleFactor(
- int width, int height, float scale_factor);
-
- virtual void prepareTexture();
- virtual void postSubBufferCHROMIUM(int x, int y, int width, int height);
-
- virtual void activeTexture(blink::WGC3Denum texture);
- virtual void attachShader(blink::WebGLId program, blink::WebGLId shader);
- virtual void bindAttribLocation(blink::WebGLId program,
- blink::WGC3Duint index,
- const blink::WGC3Dchar* name);
- virtual void bindBuffer(blink::WGC3Denum target, blink::WebGLId buffer);
- virtual void bindFramebuffer(blink::WGC3Denum target,
- blink::WebGLId framebuffer);
- virtual void bindRenderbuffer(blink::WGC3Denum target,
- blink::WebGLId renderbuffer);
- virtual void bindTexture(blink::WGC3Denum target, blink::WebGLId texture);
- virtual void blendColor(blink::WGC3Dclampf red,
- blink::WGC3Dclampf green,
- blink::WGC3Dclampf blue,
- blink::WGC3Dclampf alpha);
- virtual void blendEquation(blink::WGC3Denum mode);
- virtual void blendEquationSeparate(blink::WGC3Denum modeRGB,
- blink::WGC3Denum modeAlpha);
- virtual void blendFunc(blink::WGC3Denum sfactor, blink::WGC3Denum dfactor);
- virtual void blendFuncSeparate(blink::WGC3Denum srcRGB,
- blink::WGC3Denum dstRGB,
- blink::WGC3Denum srcAlpha,
- blink::WGC3Denum dstAlpha);
-
- virtual void bufferData(blink::WGC3Denum target,
- blink::WGC3Dsizeiptr size,
- const void* data,
- blink::WGC3Denum usage);
- virtual void bufferSubData(blink::WGC3Denum target,
- blink::WGC3Dintptr offset,
- blink::WGC3Dsizeiptr size,
- const void* data);
-
- virtual blink::WGC3Denum checkFramebufferStatus(blink::WGC3Denum target);
- virtual void clear(blink::WGC3Dbitfield mask);
- virtual void clearColor(blink::WGC3Dclampf red,
- blink::WGC3Dclampf green,
- blink::WGC3Dclampf blue,
- blink::WGC3Dclampf alpha);
- virtual void clearDepth(blink::WGC3Dclampf depth);
- virtual void clearStencil(blink::WGC3Dint s);
- virtual void colorMask(blink::WGC3Dboolean red,
- blink::WGC3Dboolean green,
- blink::WGC3Dboolean blue,
- blink::WGC3Dboolean alpha);
- virtual void compileShader(blink::WebGLId shader);
-
- virtual void compressedTexImage2D(blink::WGC3Denum target,
- blink::WGC3Dint level,
- blink::WGC3Denum internalformat,
- blink::WGC3Dsizei width,
- blink::WGC3Dsizei height,
- blink::WGC3Dint border,
- blink::WGC3Dsizei imageSize,
- const void* data);
- virtual void compressedTexSubImage2D(blink::WGC3Denum target,
- blink::WGC3Dint level,
- blink::WGC3Dint xoffset,
- blink::WGC3Dint yoffset,
- blink::WGC3Dsizei width,
- blink::WGC3Dsizei height,
- blink::WGC3Denum format,
- blink::WGC3Dsizei imageSize,
- const void* data);
- virtual void copyTexImage2D(blink::WGC3Denum target,
- blink::WGC3Dint level,
- blink::WGC3Denum internalformat,
- blink::WGC3Dint x,
- blink::WGC3Dint y,
- blink::WGC3Dsizei width,
- blink::WGC3Dsizei height,
- blink::WGC3Dint border);
- virtual void copyTexSubImage2D(blink::WGC3Denum target,
- blink::WGC3Dint level,
- blink::WGC3Dint xoffset,
- blink::WGC3Dint yoffset,
- blink::WGC3Dint x,
- blink::WGC3Dint y,
- blink::WGC3Dsizei width,
- blink::WGC3Dsizei height);
- virtual void cullFace(blink::WGC3Denum mode);
- virtual void depthFunc(blink::WGC3Denum func);
- virtual void depthMask(blink::WGC3Dboolean flag);
- virtual void depthRange(blink::WGC3Dclampf zNear, blink::WGC3Dclampf zFar);
- virtual void detachShader(blink::WebGLId program, blink::WebGLId shader);
- virtual void disable(blink::WGC3Denum cap);
- virtual void disableVertexAttribArray(blink::WGC3Duint index);
- virtual void drawArrays(blink::WGC3Denum mode,
- blink::WGC3Dint first,
- blink::WGC3Dsizei count);
- virtual void drawElements(blink::WGC3Denum mode,
- blink::WGC3Dsizei count,
- blink::WGC3Denum type,
- blink::WGC3Dintptr offset);
-
- virtual void enable(blink::WGC3Denum cap);
- virtual void enableVertexAttribArray(blink::WGC3Duint index);
- virtual void finish();
- virtual void flush();
- virtual void framebufferRenderbuffer(blink::WGC3Denum target,
- blink::WGC3Denum attachment,
- blink::WGC3Denum renderbuffertarget,
- blink::WebGLId renderbuffer);
- virtual void framebufferTexture2D(blink::WGC3Denum target,
- blink::WGC3Denum attachment,
- blink::WGC3Denum textarget,
- blink::WebGLId texture,
- blink::WGC3Dint level);
- virtual void frontFace(blink::WGC3Denum mode);
- virtual void generateMipmap(blink::WGC3Denum target);
-
- virtual bool getActiveAttrib(blink::WebGLId program,
- blink::WGC3Duint index,
- ActiveInfo&);
- virtual bool getActiveUniform(blink::WebGLId program,
- blink::WGC3Duint index,
- ActiveInfo&);
-
- virtual void getAttachedShaders(blink::WebGLId program,
- blink::WGC3Dsizei maxCount,
- blink::WGC3Dsizei* count,
- blink::WebGLId* shaders);
-
- virtual blink::WGC3Dint getAttribLocation(blink::WebGLId program,
- const blink::WGC3Dchar* name);
-
- virtual void getBooleanv(blink::WGC3Denum pname, blink::WGC3Dboolean* value);
-
- virtual void getBufferParameteriv(blink::WGC3Denum target,
- blink::WGC3Denum pname,
- blink::WGC3Dint* value);
-
- virtual blink::WGC3Denum getError();
-
- virtual void getFloatv(blink::WGC3Denum pname, blink::WGC3Dfloat* value);
-
- virtual void getFramebufferAttachmentParameteriv(blink::WGC3Denum target,
- blink::WGC3Denum attachment,
- blink::WGC3Denum pname,
- blink::WGC3Dint* value);
-
- virtual void getIntegerv(blink::WGC3Denum pname, blink::WGC3Dint* value);
-
- virtual void getInteger64v(blink::WGC3Denum pname, blink::WGC3Dint64* value);
-
- virtual void getProgramiv(blink::WebGLId program,
+ uint32_t lastFlushID() override;
+
+ unsigned int insertSyncPoint() override;
+ void waitSyncPoint(unsigned int sync_point) override;
+
+ void loseContextCHROMIUM(blink::WGC3Denum current,
+ blink::WGC3Denum other) override;
+
+ void reshapeWithScaleFactor(
+ int width, int height, float scale_factor) override;
+
+ void prepareTexture() override;
+ void postSubBufferCHROMIUM(int x, int y, int width, int height) override;
+
+ void activeTexture(blink::WGC3Denum texture) override;
+ void applyScreenSpaceAntialiasingCHROMIUM() override;
+ void attachShader(blink::WebGLId program, blink::WebGLId shader) override;
+ void bindAttribLocation(blink::WebGLId program,
+ blink::WGC3Duint index,
+ const blink::WGC3Dchar* name) override;
+ void bindBuffer(blink::WGC3Denum target, blink::WebGLId buffer) override;
+ void bindFramebuffer(blink::WGC3Denum target,
+ blink::WebGLId framebuffer) override;
+ void bindRenderbuffer(blink::WGC3Denum target,
+ blink::WebGLId renderbuffer) override;
+ void bindTexture(blink::WGC3Denum target, blink::WebGLId texture) override;
+ void blendColor(blink::WGC3Dclampf red,
+ blink::WGC3Dclampf green,
+ blink::WGC3Dclampf blue,
+ blink::WGC3Dclampf alpha) override;
+ void blendEquation(blink::WGC3Denum mode) override;
+ void blendEquationSeparate(blink::WGC3Denum modeRGB,
+ blink::WGC3Denum modeAlpha) override;
+ void blendFunc(blink::WGC3Denum sfactor, blink::WGC3Denum dfactor) override;
+ void blendFuncSeparate(blink::WGC3Denum srcRGB,
+ blink::WGC3Denum dstRGB,
+ blink::WGC3Denum srcAlpha,
+ blink::WGC3Denum dstAlpha) override;
+
+ void bufferData(blink::WGC3Denum target,
+ blink::WGC3Dsizeiptr size,
+ const void* data,
+ blink::WGC3Denum usage) override;
+ void bufferSubData(blink::WGC3Denum target,
+ blink::WGC3Dintptr offset,
+ blink::WGC3Dsizeiptr size,
+ const void* data) override;
+
+ blink::WGC3Denum checkFramebufferStatus(blink::WGC3Denum target) override;
+ void clear(blink::WGC3Dbitfield mask) override;
+ void clearColor(blink::WGC3Dclampf red,
+ blink::WGC3Dclampf green,
+ blink::WGC3Dclampf blue,
+ blink::WGC3Dclampf alpha) override;
+ void clearDepth(blink::WGC3Dclampf depth) override;
+ void clearStencil(blink::WGC3Dint s) override;
+ void colorMask(blink::WGC3Dboolean red,
+ blink::WGC3Dboolean green,
+ blink::WGC3Dboolean blue,
+ blink::WGC3Dboolean alpha) override;
+ void compileShader(blink::WebGLId shader) override;
+
+ void compressedTexImage2D(blink::WGC3Denum target,
+ blink::WGC3Dint level,
+ blink::WGC3Denum internalformat,
+ blink::WGC3Dsizei width,
+ blink::WGC3Dsizei height,
+ blink::WGC3Dint border,
+ blink::WGC3Dsizei imageSize,
+ const void* data) override;
+ void compressedTexSubImage2D(blink::WGC3Denum target,
+ blink::WGC3Dint level,
+ blink::WGC3Dint xoffset,
+ blink::WGC3Dint yoffset,
+ blink::WGC3Dsizei width,
+ blink::WGC3Dsizei height,
+ blink::WGC3Denum format,
+ blink::WGC3Dsizei imageSize,
+ const void* data) override;
+ void copyTexImage2D(blink::WGC3Denum target,
+ blink::WGC3Dint level,
+ blink::WGC3Denum internalformat,
+ blink::WGC3Dint x,
+ blink::WGC3Dint y,
+ blink::WGC3Dsizei width,
+ blink::WGC3Dsizei height,
+ blink::WGC3Dint border) override;
+ void copyTexSubImage2D(blink::WGC3Denum target,
+ blink::WGC3Dint level,
+ blink::WGC3Dint xoffset,
+ blink::WGC3Dint yoffset,
+ blink::WGC3Dint x,
+ blink::WGC3Dint y,
+ blink::WGC3Dsizei width,
+ blink::WGC3Dsizei height) override;
+ void cullFace(blink::WGC3Denum mode) override;
+ void depthFunc(blink::WGC3Denum func) override;
+ void depthMask(blink::WGC3Dboolean flag) override;
+ void depthRange(blink::WGC3Dclampf zNear, blink::WGC3Dclampf zFar) override;
+ void detachShader(blink::WebGLId program, blink::WebGLId shader) override;
+ void disable(blink::WGC3Denum cap) override;
+ void disableVertexAttribArray(blink::WGC3Duint index) override;
+ void drawArrays(blink::WGC3Denum mode,
+ blink::WGC3Dint first,
+ blink::WGC3Dsizei count) override;
+ void drawElements(blink::WGC3Denum mode,
+ blink::WGC3Dsizei count,
+ blink::WGC3Denum type,
+ blink::WGC3Dintptr offset) override;
+
+ void enable(blink::WGC3Denum cap) override;
+ void enableVertexAttribArray(blink::WGC3Duint index) override;
+ void finish() override;
+ void flush() override;
+ void framebufferRenderbuffer(blink::WGC3Denum target,
+ blink::WGC3Denum attachment,
+ blink::WGC3Denum renderbuffertarget,
+ blink::WebGLId renderbuffer) override;
+ void framebufferTexture2D(blink::WGC3Denum target,
+ blink::WGC3Denum attachment,
+ blink::WGC3Denum textarget,
+ blink::WebGLId texture,
+ blink::WGC3Dint level) override;
+ void frontFace(blink::WGC3Denum mode) override;
+ void generateMipmap(blink::WGC3Denum target) override;
+
+ bool getActiveAttrib(blink::WebGLId program,
+ blink::WGC3Duint index,
+ ActiveInfo&) override;
+ bool getActiveUniform(blink::WebGLId program,
+ blink::WGC3Duint index,
+ ActiveInfo&) override;
+
+ void getAttachedShaders(blink::WebGLId program,
+ blink::WGC3Dsizei maxCount,
+ blink::WGC3Dsizei* count,
+ blink::WebGLId* shaders) override;
+
+ blink::WGC3Dint getAttribLocation(blink::WebGLId program,
+ const blink::WGC3Dchar* name) override;
+
+ void getBooleanv(blink::WGC3Denum pname, blink::WGC3Dboolean* value) override;
+
+ void getBufferParameteriv(blink::WGC3Denum target,
blink::WGC3Denum pname,
- blink::WGC3Dint* value);
+ blink::WGC3Dint* value) override;
- virtual blink::WebString getProgramInfoLog(blink::WebGLId program);
+ blink::WGC3Denum getError() override;
- virtual void getRenderbufferParameteriv(blink::WGC3Denum target,
- blink::WGC3Denum pname,
- blink::WGC3Dint* value);
+ void getFloatv(blink::WGC3Denum pname, blink::WGC3Dfloat* value) override;
- virtual void getShaderiv(blink::WebGLId shader,
- blink::WGC3Denum pname,
- blink::WGC3Dint* value);
-
- virtual blink::WebString getShaderInfoLog(blink::WebGLId shader);
-
- virtual void getShaderPrecisionFormat(blink::WGC3Denum shadertype,
- blink::WGC3Denum precisiontype,
- blink::WGC3Dint* range,
- blink::WGC3Dint* precision);
-
- virtual blink::WebString getShaderSource(blink::WebGLId shader);
- virtual blink::WebString getString(blink::WGC3Denum name);
-
- virtual void getTexParameterfv(blink::WGC3Denum target,
- blink::WGC3Denum pname,
- blink::WGC3Dfloat* value);
- virtual void getTexParameteriv(blink::WGC3Denum target,
- blink::WGC3Denum pname,
- blink::WGC3Dint* value);
-
- virtual void getUniformfv(blink::WebGLId program,
- blink::WGC3Dint location,
- blink::WGC3Dfloat* value);
- virtual void getUniformiv(blink::WebGLId program,
- blink::WGC3Dint location,
- blink::WGC3Dint* value);
-
- virtual blink::WGC3Dint getUniformLocation(blink::WebGLId program,
- const blink::WGC3Dchar* name);
-
- virtual void getVertexAttribfv(blink::WGC3Duint index,
- blink::WGC3Denum pname,
- blink::WGC3Dfloat* value);
- virtual void getVertexAttribiv(blink::WGC3Duint index,
- blink::WGC3Denum pname,
- blink::WGC3Dint* value);
-
- virtual blink::WGC3Dsizeiptr getVertexAttribOffset(blink::WGC3Duint index,
- blink::WGC3Denum pname);
-
- virtual void hint(blink::WGC3Denum target, blink::WGC3Denum mode);
- virtual blink::WGC3Dboolean isBuffer(blink::WebGLId buffer);
- virtual blink::WGC3Dboolean isEnabled(blink::WGC3Denum cap);
- virtual blink::WGC3Dboolean isFramebuffer(blink::WebGLId framebuffer);
- virtual blink::WGC3Dboolean isProgram(blink::WebGLId program);
- virtual blink::WGC3Dboolean isRenderbuffer(blink::WebGLId renderbuffer);
- virtual blink::WGC3Dboolean isShader(blink::WebGLId shader);
- virtual blink::WGC3Dboolean isTexture(blink::WebGLId texture);
- virtual void lineWidth(blink::WGC3Dfloat);
- virtual void linkProgram(blink::WebGLId program);
- virtual void pixelStorei(blink::WGC3Denum pname, blink::WGC3Dint param);
- virtual void polygonOffset(blink::WGC3Dfloat factor, blink::WGC3Dfloat units);
-
- virtual void readPixels(blink::WGC3Dint x,
- blink::WGC3Dint y,
- blink::WGC3Dsizei width,
- blink::WGC3Dsizei height,
- blink::WGC3Denum format,
- blink::WGC3Denum type,
- void* pixels);
-
- virtual void releaseShaderCompiler();
- virtual void renderbufferStorage(blink::WGC3Denum target,
- blink::WGC3Denum internalformat,
- blink::WGC3Dsizei width,
- blink::WGC3Dsizei height);
- virtual void sampleCoverage(blink::WGC3Dfloat value,
- blink::WGC3Dboolean invert);
- virtual void scissor(blink::WGC3Dint x,
- blink::WGC3Dint y,
- blink::WGC3Dsizei width,
- blink::WGC3Dsizei height);
- virtual void shaderSource(blink::WebGLId shader,
- const blink::WGC3Dchar* string);
- virtual void stencilFunc(blink::WGC3Denum func,
+ void getFramebufferAttachmentParameteriv(blink::WGC3Denum target,
+ blink::WGC3Denum attachment,
+ blink::WGC3Denum pname,
+ blink::WGC3Dint* value) override;
+
+ void getIntegerv(blink::WGC3Denum pname, blink::WGC3Dint* value) override;
+
+ void getInteger64v(blink::WGC3Denum pname, blink::WGC3Dint64* value) override;
+
+ void getProgramiv(blink::WebGLId program,
+ blink::WGC3Denum pname,
+ blink::WGC3Dint* value) override;
+
+ blink::WebString getProgramInfoLog(blink::WebGLId program) override;
+
+ void getRenderbufferParameteriv(blink::WGC3Denum target,
+ blink::WGC3Denum pname,
+ blink::WGC3Dint* value) override;
+
+ void getShaderiv(blink::WebGLId shader,
+ blink::WGC3Denum pname,
+ blink::WGC3Dint* value) override;
+
+ blink::WebString getShaderInfoLog(blink::WebGLId shader) override;
+
+ void getShaderPrecisionFormat(blink::WGC3Denum shadertype,
+ blink::WGC3Denum precisiontype,
+ blink::WGC3Dint* range,
+ blink::WGC3Dint* precision) override;
+
+ blink::WebString getShaderSource(blink::WebGLId shader) override;
+ blink::WebString getString(blink::WGC3Denum name) override;
+
+ void getTexParameterfv(blink::WGC3Denum target,
+ blink::WGC3Denum pname,
+ blink::WGC3Dfloat* value) override;
+ void getTexParameteriv(blink::WGC3Denum target,
+ blink::WGC3Denum pname,
+ blink::WGC3Dint* value) override;
+
+ void getUniformfv(blink::WebGLId program,
+ blink::WGC3Dint location,
+ blink::WGC3Dfloat* value) override;
+ void getUniformiv(blink::WebGLId program,
+ blink::WGC3Dint location,
+ blink::WGC3Dint* value) override;
+
+ blink::WGC3Dint getUniformLocation(blink::WebGLId program,
+ const blink::WGC3Dchar* name) override;
+
+ void getVertexAttribfv(blink::WGC3Duint index,
+ blink::WGC3Denum pname,
+ blink::WGC3Dfloat* value) override;
+ void getVertexAttribiv(blink::WGC3Duint index,
+ blink::WGC3Denum pname,
+ blink::WGC3Dint* value) override;
+
+ blink::WGC3Dsizeiptr getVertexAttribOffset(blink::WGC3Duint index,
+ blink::WGC3Denum pname) override;
+
+ void hint(blink::WGC3Denum target, blink::WGC3Denum mode) override;
+ blink::WGC3Dboolean isBuffer(blink::WebGLId buffer) override;
+ blink::WGC3Dboolean isEnabled(blink::WGC3Denum cap) override;
+ blink::WGC3Dboolean isFramebuffer(blink::WebGLId framebuffer) override;
+ blink::WGC3Dboolean isProgram(blink::WebGLId program) override;
+ blink::WGC3Dboolean isRenderbuffer(blink::WebGLId renderbuffer) override;
+ blink::WGC3Dboolean isShader(blink::WebGLId shader) override;
+ blink::WGC3Dboolean isTexture(blink::WebGLId texture) override;
+ void lineWidth(blink::WGC3Dfloat) override;
+ void linkProgram(blink::WebGLId program) override;
+ void pixelStorei(blink::WGC3Denum pname, blink::WGC3Dint param) override;
+ void polygonOffset(blink::WGC3Dfloat factor,
+ blink::WGC3Dfloat units) override;
+
+ void readPixels(blink::WGC3Dint x,
+ blink::WGC3Dint y,
+ blink::WGC3Dsizei width,
+ blink::WGC3Dsizei height,
+ blink::WGC3Denum format,
+ blink::WGC3Denum type,
+ void* pixels) override;
+
+ void releaseShaderCompiler() override;
+ void renderbufferStorage(blink::WGC3Denum target,
+ blink::WGC3Denum internalformat,
+ blink::WGC3Dsizei width,
+ blink::WGC3Dsizei height) override;
+ void sampleCoverage(blink::WGC3Dfloat value,
+ blink::WGC3Dboolean invert) override;
+ void scissor(blink::WGC3Dint x,
+ blink::WGC3Dint y,
+ blink::WGC3Dsizei width,
+ blink::WGC3Dsizei height) override;
+ void shaderSource(blink::WebGLId shader,
+ const blink::WGC3Dchar* string) override;
+ void stencilFunc(blink::WGC3Denum func,
+ blink::WGC3Dint ref,
+ blink::WGC3Duint mask) override;
+ void stencilFuncSeparate(blink::WGC3Denum face,
+ blink::WGC3Denum func,
blink::WGC3Dint ref,
- blink::WGC3Duint mask);
- virtual void stencilFuncSeparate(blink::WGC3Denum face,
- blink::WGC3Denum func,
- blink::WGC3Dint ref,
- blink::WGC3Duint mask);
- virtual void stencilMask(blink::WGC3Duint mask);
- virtual void stencilMaskSeparate(blink::WGC3Denum face,
- blink::WGC3Duint mask);
- virtual void stencilOp(blink::WGC3Denum fail,
+ blink::WGC3Duint mask) override;
+ void stencilMask(blink::WGC3Duint mask) override;
+ void stencilMaskSeparate(blink::WGC3Denum face,
+ blink::WGC3Duint mask) override;
+ void stencilOp(blink::WGC3Denum fail,
+ blink::WGC3Denum zfail,
+ blink::WGC3Denum zpass) override;
+ void stencilOpSeparate(blink::WGC3Denum face,
+ blink::WGC3Denum fail,
blink::WGC3Denum zfail,
- blink::WGC3Denum zpass);
- virtual void stencilOpSeparate(blink::WGC3Denum face,
- blink::WGC3Denum fail,
- blink::WGC3Denum zfail,
- blink::WGC3Denum zpass);
-
- virtual void texImage2D(blink::WGC3Denum target,
- blink::WGC3Dint level,
- blink::WGC3Denum internalformat,
- blink::WGC3Dsizei width,
- blink::WGC3Dsizei height,
- blink::WGC3Dint border,
- blink::WGC3Denum format,
- blink::WGC3Denum type,
- const void* pixels);
-
- virtual void texParameterf(blink::WGC3Denum target,
- blink::WGC3Denum pname,
- blink::WGC3Dfloat param);
- virtual void texParameteri(blink::WGC3Denum target,
- blink::WGC3Denum pname,
- blink::WGC3Dint param);
-
- virtual void texSubImage2D(blink::WGC3Denum target,
- blink::WGC3Dint level,
- blink::WGC3Dint xoffset,
- blink::WGC3Dint yoffset,
- blink::WGC3Dsizei width,
- blink::WGC3Dsizei height,
- blink::WGC3Denum format,
- blink::WGC3Denum type,
- const void* pixels);
-
- virtual void uniform1f(blink::WGC3Dint location, blink::WGC3Dfloat x);
- virtual void uniform1fv(blink::WGC3Dint location,
- blink::WGC3Dsizei count,
- const blink::WGC3Dfloat* v);
- virtual void uniform1i(blink::WGC3Dint location, blink::WGC3Dint x);
- virtual void uniform1iv(blink::WGC3Dint location,
- blink::WGC3Dsizei count,
- const blink::WGC3Dint* v);
- virtual void uniform2f(blink::WGC3Dint location,
- blink::WGC3Dfloat x,
- blink::WGC3Dfloat y);
- virtual void uniform2fv(blink::WGC3Dint location,
- blink::WGC3Dsizei count,
- const blink::WGC3Dfloat* v);
- virtual void uniform2i(blink::WGC3Dint location,
- blink::WGC3Dint x,
- blink::WGC3Dint y);
- virtual void uniform2iv(blink::WGC3Dint location,
- blink::WGC3Dsizei count,
- const blink::WGC3Dint* v);
- virtual void uniform3f(blink::WGC3Dint location,
- blink::WGC3Dfloat x,
- blink::WGC3Dfloat y,
- blink::WGC3Dfloat z);
- virtual void uniform3fv(blink::WGC3Dint location,
- blink::WGC3Dsizei count,
- const blink::WGC3Dfloat* v);
- virtual void uniform3i(blink::WGC3Dint location,
- blink::WGC3Dint x,
- blink::WGC3Dint y,
- blink::WGC3Dint z);
- virtual void uniform3iv(blink::WGC3Dint location,
- blink::WGC3Dsizei count,
- const blink::WGC3Dint* v);
- virtual void uniform4f(blink::WGC3Dint location,
- blink::WGC3Dfloat x,
- blink::WGC3Dfloat y,
- blink::WGC3Dfloat z,
- blink::WGC3Dfloat w);
- virtual void uniform4fv(blink::WGC3Dint location,
- blink::WGC3Dsizei count,
- const blink::WGC3Dfloat* v);
- virtual void uniform4i(blink::WGC3Dint location,
- blink::WGC3Dint x,
- blink::WGC3Dint y,
- blink::WGC3Dint z,
- blink::WGC3Dint w);
- virtual void uniform4iv(blink::WGC3Dint location,
- blink::WGC3Dsizei count,
- const blink::WGC3Dint* v);
- virtual void uniformMatrix2fv(blink::WGC3Dint location,
- blink::WGC3Dsizei count,
- blink::WGC3Dboolean transpose,
- const blink::WGC3Dfloat* value);
- virtual void uniformMatrix3fv(blink::WGC3Dint location,
- blink::WGC3Dsizei count,
- blink::WGC3Dboolean transpose,
- const blink::WGC3Dfloat* value);
- virtual void uniformMatrix4fv(blink::WGC3Dint location,
- blink::WGC3Dsizei count,
- blink::WGC3Dboolean transpose,
- const blink::WGC3Dfloat* value);
-
- virtual void useProgram(blink::WebGLId program);
- virtual void validateProgram(blink::WebGLId program);
-
- virtual void vertexAttrib1f(blink::WGC3Duint index, blink::WGC3Dfloat x);
- virtual void vertexAttrib1fv(blink::WGC3Duint index,
- const blink::WGC3Dfloat* values);
- virtual void vertexAttrib2f(blink::WGC3Duint index,
- blink::WGC3Dfloat x,
- blink::WGC3Dfloat y);
- virtual void vertexAttrib2fv(blink::WGC3Duint index,
- const blink::WGC3Dfloat* values);
- virtual void vertexAttrib3f(blink::WGC3Duint index,
- blink::WGC3Dfloat x,
- blink::WGC3Dfloat y,
- blink::WGC3Dfloat z);
- virtual void vertexAttrib3fv(blink::WGC3Duint index,
- const blink::WGC3Dfloat* values);
- virtual void vertexAttrib4f(blink::WGC3Duint index,
- blink::WGC3Dfloat x,
- blink::WGC3Dfloat y,
- blink::WGC3Dfloat z,
- blink::WGC3Dfloat w);
- virtual void vertexAttrib4fv(blink::WGC3Duint index,
- const blink::WGC3Dfloat* values);
- virtual void vertexAttribPointer(blink::WGC3Duint index,
- blink::WGC3Dint size,
- blink::WGC3Denum type,
- blink::WGC3Dboolean normalized,
- blink::WGC3Dsizei stride,
- blink::WGC3Dintptr offset);
-
- virtual void viewport(blink::WGC3Dint x,
- blink::WGC3Dint y,
- blink::WGC3Dsizei width,
- blink::WGC3Dsizei height);
-
- virtual blink::WebGLId createBuffer();
- virtual blink::WebGLId createFramebuffer();
- virtual blink::WebGLId createRenderbuffer();
- virtual blink::WebGLId createTexture();
-
- virtual void deleteBuffer(blink::WebGLId);
- virtual void deleteFramebuffer(blink::WebGLId);
- virtual void deleteRenderbuffer(blink::WebGLId);
- virtual void deleteTexture(blink::WebGLId);
-
- virtual blink::WebGLId createProgram();
- virtual blink::WebGLId createShader(blink::WGC3Denum);
-
- virtual void deleteProgram(blink::WebGLId);
- virtual void deleteShader(blink::WebGLId);
-
- virtual void synthesizeGLError(blink::WGC3Denum);
-
- virtual void* mapBufferSubDataCHROMIUM(blink::WGC3Denum target,
- blink::WGC3Dintptr offset,
- blink::WGC3Dsizeiptr size,
- blink::WGC3Denum access);
- virtual void unmapBufferSubDataCHROMIUM(const void*);
- virtual void* mapTexSubImage2DCHROMIUM(blink::WGC3Denum target,
- blink::WGC3Dint level,
- blink::WGC3Dint xoffset,
- blink::WGC3Dint yoffset,
- blink::WGC3Dsizei width,
- blink::WGC3Dsizei height,
- blink::WGC3Denum format,
- blink::WGC3Denum type,
- blink::WGC3Denum access);
- virtual void unmapTexSubImage2DCHROMIUM(const void*);
-
- virtual void setVisibilityCHROMIUM(bool visible);
-
- virtual void discardFramebufferEXT(blink::WGC3Denum target,
- blink::WGC3Dsizei numAttachments,
- const blink::WGC3Denum* attachments);
+ blink::WGC3Denum zpass) override;
+
+ void texImage2D(blink::WGC3Denum target,
+ blink::WGC3Dint level,
+ blink::WGC3Denum internalformat,
+ blink::WGC3Dsizei width,
+ blink::WGC3Dsizei height,
+ blink::WGC3Dint border,
+ blink::WGC3Denum format,
+ blink::WGC3Denum type,
+ const void* pixels) override;
+
+ void texParameterf(blink::WGC3Denum target,
+ blink::WGC3Denum pname,
+ blink::WGC3Dfloat param) override;
+ void texParameteri(blink::WGC3Denum target,
+ blink::WGC3Denum pname,
+ blink::WGC3Dint param) override;
+
+ void texSubImage2D(blink::WGC3Denum target,
+ blink::WGC3Dint level,
+ blink::WGC3Dint xoffset,
+ blink::WGC3Dint yoffset,
+ blink::WGC3Dsizei width,
+ blink::WGC3Dsizei height,
+ blink::WGC3Denum format,
+ blink::WGC3Denum type,
+ const void* pixels) override;
+
+ void uniform1f(blink::WGC3Dint location, blink::WGC3Dfloat x) override;
+ void uniform1fv(blink::WGC3Dint location,
+ blink::WGC3Dsizei count,
+ const blink::WGC3Dfloat* v) override;
+ void uniform1i(blink::WGC3Dint location, blink::WGC3Dint x) override;
+ void uniform1iv(blink::WGC3Dint location,
+ blink::WGC3Dsizei count,
+ const blink::WGC3Dint* v) override;
+ void uniform2f(blink::WGC3Dint location,
+ blink::WGC3Dfloat x,
+ blink::WGC3Dfloat y) override;
+ void uniform2fv(blink::WGC3Dint location,
+ blink::WGC3Dsizei count,
+ const blink::WGC3Dfloat* v) override;
+ void uniform2i(blink::WGC3Dint location,
+ blink::WGC3Dint x,
+ blink::WGC3Dint y) override;
+ void uniform2iv(blink::WGC3Dint location,
+ blink::WGC3Dsizei count,
+ const blink::WGC3Dint* v) override;
+ void uniform3f(blink::WGC3Dint location,
+ blink::WGC3Dfloat x,
+ blink::WGC3Dfloat y,
+ blink::WGC3Dfloat z) override;
+ void uniform3fv(blink::WGC3Dint location,
+ blink::WGC3Dsizei count,
+ const blink::WGC3Dfloat* v) override;
+ void uniform3i(blink::WGC3Dint location,
+ blink::WGC3Dint x,
+ blink::WGC3Dint y,
+ blink::WGC3Dint z) override;
+ void uniform3iv(blink::WGC3Dint location,
+ blink::WGC3Dsizei count,
+ const blink::WGC3Dint* v) override;
+ void uniform4f(blink::WGC3Dint location,
+ blink::WGC3Dfloat x,
+ blink::WGC3Dfloat y,
+ blink::WGC3Dfloat z,
+ blink::WGC3Dfloat w) override;
+ void uniform4fv(blink::WGC3Dint location,
+ blink::WGC3Dsizei count,
+ const blink::WGC3Dfloat* v) override;
+ void uniform4i(blink::WGC3Dint location,
+ blink::WGC3Dint x,
+ blink::WGC3Dint y,
+ blink::WGC3Dint z,
+ blink::WGC3Dint w) override;
+ void uniform4iv(blink::WGC3Dint location,
+ blink::WGC3Dsizei count,
+ const blink::WGC3Dint* v) override;
+ void uniformMatrix2fv(blink::WGC3Dint location,
+ blink::WGC3Dsizei count,
+ blink::WGC3Dboolean transpose,
+ const blink::WGC3Dfloat* value) override;
+ void uniformMatrix3fv(blink::WGC3Dint location,
+ blink::WGC3Dsizei count,
+ blink::WGC3Dboolean transpose,
+ const blink::WGC3Dfloat* value) override;
+ void uniformMatrix4fv(blink::WGC3Dint location,
+ blink::WGC3Dsizei count,
+ blink::WGC3Dboolean transpose,
+ const blink::WGC3Dfloat* value) override;
+
+ void useProgram(blink::WebGLId program) override;
+ void validateProgram(blink::WebGLId program) override;
+
+ void vertexAttrib1f(blink::WGC3Duint index, blink::WGC3Dfloat x) override;
+ void vertexAttrib1fv(blink::WGC3Duint index,
+ const blink::WGC3Dfloat* values) override;
+ void vertexAttrib2f(blink::WGC3Duint index,
+ blink::WGC3Dfloat x,
+ blink::WGC3Dfloat y) override;
+ void vertexAttrib2fv(blink::WGC3Duint index,
+ const blink::WGC3Dfloat* values) override;
+ void vertexAttrib3f(blink::WGC3Duint index,
+ blink::WGC3Dfloat x,
+ blink::WGC3Dfloat y,
+ blink::WGC3Dfloat z) override;
+ void vertexAttrib3fv(blink::WGC3Duint index,
+ const blink::WGC3Dfloat* values) override;
+ void vertexAttrib4f(blink::WGC3Duint index,
+ blink::WGC3Dfloat x,
+ blink::WGC3Dfloat y,
+ blink::WGC3Dfloat z,
+ blink::WGC3Dfloat w) override;
+ void vertexAttrib4fv(blink::WGC3Duint index,
+ const blink::WGC3Dfloat* values) override;
+ void vertexAttribPointer(blink::WGC3Duint index,
+ blink::WGC3Dint size,
+ blink::WGC3Denum type,
+ blink::WGC3Dboolean normalized,
+ blink::WGC3Dsizei stride,
+ blink::WGC3Dintptr offset) override;
+
+ void viewport(blink::WGC3Dint x,
+ blink::WGC3Dint y,
+ blink::WGC3Dsizei width,
+ blink::WGC3Dsizei height) override;
+
+ blink::WebGLId createBuffer() override;
+ blink::WebGLId createFramebuffer() override;
+ blink::WebGLId createRenderbuffer() override;
+ blink::WebGLId createTexture() override;
+
+ void deleteBuffer(blink::WebGLId) override;
+ void deleteFramebuffer(blink::WebGLId) override;
+ void deleteRenderbuffer(blink::WebGLId) override;
+ void deleteTexture(blink::WebGLId) override;
+
+ blink::WebGLId createProgram() override;
+ blink::WebGLId createShader(blink::WGC3Denum) override;
+
+ void deleteProgram(blink::WebGLId) override;
+ void deleteShader(blink::WebGLId) override;
+
+ void synthesizeGLError(blink::WGC3Denum) override;
+
+ void* mapBufferSubDataCHROMIUM(blink::WGC3Denum target,
+ blink::WGC3Dintptr offset,
+ blink::WGC3Dsizeiptr size,
+ blink::WGC3Denum access) override;
+ void unmapBufferSubDataCHROMIUM(const void*) override;
+ void* mapTexSubImage2DCHROMIUM(blink::WGC3Denum target,
+ blink::WGC3Dint level,
+ blink::WGC3Dint xoffset,
+ blink::WGC3Dint yoffset,
+ blink::WGC3Dsizei width,
+ blink::WGC3Dsizei height,
+ blink::WGC3Denum format,
+ blink::WGC3Denum type,
+ blink::WGC3Denum access) override;
+ void unmapTexSubImage2DCHROMIUM(const void*) override;
+
+ void setVisibilityCHROMIUM(bool visible) override;
+
+ void discardFramebufferEXT(blink::WGC3Denum target,
+ blink::WGC3Dsizei numAttachments,
+ const blink::WGC3Denum* attachments) override;
virtual void copyTextureToParentTextureCHROMIUM(blink::WebGLId texture,
blink::WebGLId parentTexture);
- virtual blink::WebString getRequestableExtensionsCHROMIUM();
- virtual void requestExtensionCHROMIUM(const char*);
-
- virtual void blitFramebufferCHROMIUM(blink::WGC3Dint srcX0,
- blink::WGC3Dint srcY0,
- blink::WGC3Dint srcX1,
- blink::WGC3Dint srcY1,
- blink::WGC3Dint dstX0,
- blink::WGC3Dint dstY0,
- blink::WGC3Dint dstX1,
- blink::WGC3Dint dstY1,
- blink::WGC3Dbitfield mask,
- blink::WGC3Denum filter);
- virtual void renderbufferStorageMultisampleCHROMIUM(
+ blink::WebString getRequestableExtensionsCHROMIUM() override;
+ void requestExtensionCHROMIUM(const char*) override;
+
+ void blitFramebufferCHROMIUM(blink::WGC3Dint srcX0,
+ blink::WGC3Dint srcY0,
+ blink::WGC3Dint srcX1,
+ blink::WGC3Dint srcY1,
+ blink::WGC3Dint dstX0,
+ blink::WGC3Dint dstY0,
+ blink::WGC3Dint dstX1,
+ blink::WGC3Dint dstY1,
+ blink::WGC3Dbitfield mask,
+ blink::WGC3Denum filter) override;
+ void renderbufferStorageMultisampleCHROMIUM(
blink::WGC3Denum target,
blink::WGC3Dsizei samples,
blink::WGC3Denum internalformat,
blink::WGC3Dsizei width,
- blink::WGC3Dsizei height);
-
- virtual blink::WebString getTranslatedShaderSourceANGLE(
- blink::WebGLId shader);
-
- virtual void setContextLostCallback(
- WebGraphicsContext3D::WebGraphicsContextLostCallback* callback);
-
- virtual void setErrorMessageCallback(
- WebGraphicsContext3D::WebGraphicsErrorMessageCallback* callback);
-
- virtual void texImageIOSurface2DCHROMIUM(blink::WGC3Denum target,
- blink::WGC3Dint width,
- blink::WGC3Dint height,
- blink::WGC3Duint ioSurfaceId,
- blink::WGC3Duint plane);
-
- virtual void texStorage2DEXT(blink::WGC3Denum target,
- blink::WGC3Dint levels,
- blink::WGC3Duint internalformat,
- blink::WGC3Dint width,
- blink::WGC3Dint height);
-
- virtual blink::WebGLId createQueryEXT();
- virtual void deleteQueryEXT(blink::WebGLId query);
- virtual blink::WGC3Dboolean isQueryEXT(blink::WGC3Duint query);
- virtual void beginQueryEXT(blink::WGC3Denum target, blink::WebGLId query);
- virtual void endQueryEXT(blink::WGC3Denum target);
- virtual void getQueryivEXT(blink::WGC3Denum target,
- blink::WGC3Denum pname,
- blink::WGC3Dint* params);
- virtual void getQueryObjectuivEXT(blink::WebGLId query,
- blink::WGC3Denum pname,
- blink::WGC3Duint* params);
+ blink::WGC3Dsizei height) override;
+
+ blink::WebString getTranslatedShaderSourceANGLE(
+ blink::WebGLId shader) override;
+
+ void setContextLostCallback(
+ WebGraphicsContext3D::WebGraphicsContextLostCallback* callback) override;
+
+ void setErrorMessageCallback(
+ WebGraphicsContext3D::WebGraphicsErrorMessageCallback* callback) override;
+
+ void texImageIOSurface2DCHROMIUM(blink::WGC3Denum target,
+ blink::WGC3Dint width,
+ blink::WGC3Dint height,
+ blink::WGC3Duint ioSurfaceId,
+ blink::WGC3Duint plane) override;
+
+ void texStorage2DEXT(blink::WGC3Denum target,
+ blink::WGC3Dint levels,
+ blink::WGC3Duint internalformat,
+ blink::WGC3Dint width,
+ blink::WGC3Dint height) override;
+
+ blink::WebGLId createQueryEXT() override;
+ void deleteQueryEXT(blink::WebGLId query) override;
+ blink::WGC3Dboolean isQueryEXT(blink::WGC3Duint query) override;
+ void beginQueryEXT(blink::WGC3Denum target, blink::WebGLId query) override;
+ void endQueryEXT(blink::WGC3Denum target) override;
+ void getQueryivEXT(blink::WGC3Denum target,
+ blink::WGC3Denum pname,
+ blink::WGC3Dint* params) override;
+ void getQueryObjectuivEXT(blink::WebGLId query,
+ blink::WGC3Denum pname,
+ blink::WGC3Duint* params) override;
+
+ void queryCounterEXT(blink::WebGLId query, blink::WGC3Denum target) override;
+ void getQueryObjectui64vEXT(blink::WebGLId query,
+ blink::WGC3Denum pname,
+ blink::WGC3Duint64* params) override;
void copyTextureCHROMIUM(
blink::WGC3Denum target,
@@ -542,402 +549,382 @@ class GPU_BLINK_EXPORT WebGraphicsContext3DImpl
blink::WGC3Dboolean unpack_premultiply_alpha,
blink::WGC3Dboolean unpack_unmultiply_alpha) override;
- virtual void bindUniformLocationCHROMIUM(blink::WebGLId program,
- blink::WGC3Dint location,
- const blink::WGC3Dchar* uniform);
-
- virtual void shallowFlushCHROMIUM();
- virtual void shallowFinishCHROMIUM();
-
- virtual void genMailboxCHROMIUM(blink::WGC3Dbyte* mailbox);
- virtual void produceTextureCHROMIUM(blink::WGC3Denum target,
- const blink::WGC3Dbyte* mailbox);
- virtual void produceTextureDirectCHROMIUM(blink::WebGLId texture,
- blink::WGC3Denum target,
- const blink::WGC3Dbyte* mailbox);
- virtual void consumeTextureCHROMIUM(blink::WGC3Denum target,
- const blink::WGC3Dbyte* mailbox);
- virtual blink::WebGLId createAndConsumeTextureCHROMIUM(
+ void bindUniformLocationCHROMIUM(blink::WebGLId program,
+ blink::WGC3Dint location,
+ const blink::WGC3Dchar* uniform) override;
+
+ void shallowFlushCHROMIUM() override;
+ void shallowFinishCHROMIUM() override;
+
+ void genMailboxCHROMIUM(blink::WGC3Dbyte* mailbox) override;
+ void produceTextureCHROMIUM(blink::WGC3Denum target,
+ const blink::WGC3Dbyte* mailbox) override;
+ void produceTextureDirectCHROMIUM(blink::WebGLId texture,
+ blink::WGC3Denum target,
+ const blink::WGC3Dbyte* mailbox) override;
+ void consumeTextureCHROMIUM(blink::WGC3Denum target,
+ const blink::WGC3Dbyte* mailbox) override;
+ blink::WebGLId createAndConsumeTextureCHROMIUM(
blink::WGC3Denum target,
- const blink::WGC3Dbyte* mailbox);
-
- virtual void genValuebuffersCHROMIUM(blink::WGC3Dsizei count,
- blink::WebGLId* ids);
- virtual blink::WebGLId createValuebufferCHROMIUM();
- virtual void deleteValuebuffersCHROMIUM(blink::WGC3Dsizei count,
- blink::WebGLId* ids);
- virtual void deleteValuebufferCHROMIUM(blink::WebGLId);
- virtual void bindValuebufferCHROMIUM(blink::WGC3Denum target,
- blink::WebGLId valuebuffer);
- virtual blink::WGC3Dboolean isValuebufferCHROMIUM(
- blink::WebGLId renderbuffer);
- virtual void subscribeValueCHROMIUM(blink::WGC3Denum target,
- blink::WGC3Denum subscription);
- virtual void populateSubscribedValuesCHROMIUM(blink::WGC3Denum target);
- virtual void uniformValuebufferCHROMIUM(blink::WGC3Dint location,
- blink::WGC3Denum target,
- blink::WGC3Denum subscription);
- virtual void traceBeginCHROMIUM(const blink::WGC3Dchar* category_name,
- const blink::WGC3Dchar* trace_name);
- virtual void traceEndCHROMIUM();
-
- virtual void insertEventMarkerEXT(const blink::WGC3Dchar* marker);
- virtual void pushGroupMarkerEXT(const blink::WGC3Dchar* marker);
- virtual void popGroupMarkerEXT();
+ const blink::WGC3Dbyte* mailbox) override;
+
+ void genValuebuffersCHROMIUM(blink::WGC3Dsizei count,
+ blink::WebGLId* ids) override;
+ blink::WebGLId createValuebufferCHROMIUM() override;
+ void deleteValuebuffersCHROMIUM(blink::WGC3Dsizei count,
+ blink::WebGLId* ids) override;
+ void deleteValuebufferCHROMIUM(blink::WebGLId) override;
+ void bindValuebufferCHROMIUM(blink::WGC3Denum target,
+ blink::WebGLId valuebuffer) override;
+ blink::WGC3Dboolean isValuebufferCHROMIUM(
+ blink::WebGLId renderbuffer) override;
+ void subscribeValueCHROMIUM(blink::WGC3Denum target,
+ blink::WGC3Denum subscription) override;
+ void populateSubscribedValuesCHROMIUM(blink::WGC3Denum target) override;
+ void uniformValuebufferCHROMIUM(blink::WGC3Dint location,
+ blink::WGC3Denum target,
+ blink::WGC3Denum subscription) override;
+ void traceBeginCHROMIUM(const blink::WGC3Dchar* category_name,
+ const blink::WGC3Dchar* trace_name) override;
+ void traceEndCHROMIUM() override;
+
+ void insertEventMarkerEXT(const blink::WGC3Dchar* marker) override;
+ void pushGroupMarkerEXT(const blink::WGC3Dchar* marker) override;
+ void popGroupMarkerEXT() override;
// GL_OES_vertex_array_object
- virtual blink::WebGLId createVertexArrayOES();
- virtual void deleteVertexArrayOES(blink::WebGLId array);
- virtual blink::WGC3Dboolean isVertexArrayOES(blink::WebGLId array);
- virtual void bindVertexArrayOES(blink::WebGLId array);
-
- virtual void bindTexImage2DCHROMIUM(blink::WGC3Denum target,
- blink::WGC3Dint image_id);
- virtual void releaseTexImage2DCHROMIUM(blink::WGC3Denum target,
- blink::WGC3Dint image_id);
-
- virtual void* mapBufferCHROMIUM(blink::WGC3Denum target,
- blink::WGC3Denum access);
- virtual blink::WGC3Dboolean unmapBufferCHROMIUM(blink::WGC3Denum target);
-
- // Async pixel transfer functions.
- virtual void asyncTexImage2DCHROMIUM(blink::WGC3Denum target,
- blink::WGC3Dint level,
- blink::WGC3Denum internalformat,
- blink::WGC3Dsizei width,
- blink::WGC3Dsizei height,
- blink::WGC3Dint border,
- blink::WGC3Denum format,
- blink::WGC3Denum type,
- const void* pixels);
- virtual void asyncTexSubImage2DCHROMIUM(blink::WGC3Denum target,
- blink::WGC3Dint level,
- blink::WGC3Dint xoffset,
- blink::WGC3Dint yoffset,
- blink::WGC3Dsizei width,
- blink::WGC3Dsizei height,
- blink::WGC3Denum format,
- blink::WGC3Denum type,
- const void* pixels);
- virtual void waitAsyncTexImage2DCHROMIUM(blink::WGC3Denum target);
+ blink::WebGLId createVertexArrayOES() override;
+ void deleteVertexArrayOES(blink::WebGLId array) override;
+ blink::WGC3Dboolean isVertexArrayOES(blink::WebGLId array) override;
+ void bindVertexArrayOES(blink::WebGLId array) override;
+
+ void bindTexImage2DCHROMIUM(blink::WGC3Denum target,
+ blink::WGC3Dint image_id) override;
+ void releaseTexImage2DCHROMIUM(blink::WGC3Denum target,
+ blink::WGC3Dint image_id) override;
+
+ void* mapBufferCHROMIUM(blink::WGC3Denum target,
+ blink::WGC3Denum access) override;
+ blink::WGC3Dboolean unmapBufferCHROMIUM(blink::WGC3Denum target) override;
// GL_EXT_draw_buffers
- virtual void drawBuffersEXT(blink::WGC3Dsizei n,
- const blink::WGC3Denum* bufs);
+ void drawBuffersEXT(blink::WGC3Dsizei n,
+ const blink::WGC3Denum* bufs) override;
// GL_ANGLE_instanced_arrays
- virtual void drawArraysInstancedANGLE(blink::WGC3Denum mode,
- blink::WGC3Dint first,
- blink::WGC3Dsizei count,
- blink::WGC3Dsizei primcount);
- virtual void drawElementsInstancedANGLE(blink::WGC3Denum mode,
- blink::WGC3Dsizei count,
- blink::WGC3Denum type,
- blink::WGC3Dintptr offset,
- blink::WGC3Dsizei primcount);
- virtual void vertexAttribDivisorANGLE(blink::WGC3Duint index,
- blink::WGC3Duint divisor);
+ void drawArraysInstancedANGLE(blink::WGC3Denum mode,
+ blink::WGC3Dint first,
+ blink::WGC3Dsizei count,
+ blink::WGC3Dsizei primcount) override;
+ void drawElementsInstancedANGLE(blink::WGC3Denum mode,
+ blink::WGC3Dsizei count,
+ blink::WGC3Denum type,
+ blink::WGC3Dintptr offset,
+ blink::WGC3Dsizei primcount) override;
+ void vertexAttribDivisorANGLE(blink::WGC3Duint index,
+ blink::WGC3Duint divisor) override;
// GL_CHROMIUM_gpu_memory_buffer_image
- virtual blink::WGC3Duint createGpuMemoryBufferImageCHROMIUM(
+ blink::WGC3Duint createGpuMemoryBufferImageCHROMIUM(
blink::WGC3Dsizei width,
blink::WGC3Dsizei height,
blink::WGC3Denum internalformat,
- blink::WGC3Denum usage);
- virtual void destroyImageCHROMIUM(blink::WGC3Duint image_id);
+ blink::WGC3Denum usage) override;
+ void destroyImageCHROMIUM(blink::WGC3Duint image_id) override;
// GL_EXT_multisampled_render_to_texture
- virtual void framebufferTexture2DMultisampleEXT(blink::WGC3Denum target,
- blink::WGC3Denum attachment,
- blink::WGC3Denum textarget,
- blink::WebGLId texture,
- blink::WGC3Dint level,
- blink::WGC3Dsizei samples);
- virtual void renderbufferStorageMultisampleEXT(
+ void framebufferTexture2DMultisampleEXT(blink::WGC3Denum target,
+ blink::WGC3Denum attachment,
+ blink::WGC3Denum textarget,
+ blink::WebGLId texture,
+ blink::WGC3Dint level,
+ blink::WGC3Dsizei samples) override;
+ void renderbufferStorageMultisampleEXT(
blink::WGC3Denum target,
blink::WGC3Dsizei samples,
blink::WGC3Denum internalformat,
blink::WGC3Dsizei width,
- blink::WGC3Dsizei height);
+ blink::WGC3Dsizei height) override;
// OpenGL ES 3.0 functions not represented by pre-existing extensions
- virtual void beginTransformFeedback(blink::WGC3Denum primitiveMode);
- virtual void bindBufferBase(blink::WGC3Denum target,
- blink::WGC3Duint index,
- blink::WGC3Duint buffer);
- virtual void bindBufferRange(blink::WGC3Denum target,
- blink::WGC3Duint index,
- blink::WGC3Duint buffer,
- blink::WGC3Dintptr offset,
- blink::WGC3Dsizeiptr size);
- virtual void bindSampler(blink::WGC3Duint unit, blink::WebGLId sampler);
- virtual void bindTransformFeedback(blink::WGC3Denum target,
- blink::WebGLId transformfeedback);
- virtual void clearBufferfi(blink::WGC3Denum buffer,
- blink::WGC3Dint drawbuffer,
- blink::WGC3Dfloat depth,
- blink::WGC3Dint stencil);
- virtual void clearBufferfv(blink::WGC3Denum buffer,
- blink::WGC3Dint drawbuffer,
- const blink::WGC3Dfloat* value);
- virtual void clearBufferiv(blink::WGC3Denum buffer,
- blink::WGC3Dint drawbuffer,
- const blink::WGC3Dint* value);
- virtual void clearBufferuiv(blink::WGC3Denum buffer,
- blink::WGC3Dint drawbuffer,
- const blink::WGC3Duint* value);
- virtual blink::WGC3Denum clientWaitSync(blink::WGC3Dsync sync,
- blink::WGC3Dbitfield flags,
- blink::WGC3Duint64 timeout);
- virtual void compressedTexImage3D(blink::WGC3Denum target,
- blink::WGC3Dint level,
- blink::WGC3Denum internalformat,
- blink::WGC3Dsizei width,
- blink::WGC3Dsizei height,
- blink::WGC3Dsizei depth,
- blink::WGC3Dint border,
- blink::WGC3Dsizei imageSize,
- const void *data);
- virtual void compressedTexSubImage3D(blink::WGC3Denum target,
- blink::WGC3Dint level,
- blink::WGC3Dint xoffset,
- blink::WGC3Dint yoffset,
- blink::WGC3Dint zoffset,
- blink::WGC3Dsizei width,
- blink::WGC3Dsizei height,
- blink::WGC3Dsizei depth,
- blink::WGC3Denum format,
- blink::WGC3Dsizei imageSize,
- const void *data);
- virtual void copyBufferSubData(blink::WGC3Denum readTarget,
- blink::WGC3Denum writeTarget,
- blink::WGC3Dintptr readOffset,
- blink::WGC3Dintptr writeOffset,
- blink::WGC3Dsizeiptr size);
- virtual void copyTexSubImage3D(blink::WGC3Denum target,
- blink::WGC3Dint level,
- blink::WGC3Dint xoffset,
- blink::WGC3Dint yoffset,
- blink::WGC3Dint zoffset,
- blink::WGC3Dint x,
- blink::WGC3Dint y,
- blink::WGC3Dsizei width,
- blink::WGC3Dsizei height);
- virtual blink::WebGLId createSampler();
- virtual blink::WebGLId createTransformFeedback();
- virtual void deleteSampler(blink::WebGLId sampler);
- virtual void deleteSync(blink::WGC3Dsync sync);
- virtual void deleteTransformFeedback(blink::WebGLId transformfeedback);
- virtual void drawRangeElements(blink::WGC3Denum mode,
- blink::WGC3Duint start,
- blink::WGC3Duint end,
- blink::WGC3Dsizei count,
- blink::WGC3Denum type,
- blink::WGC3Dintptr offset);
- virtual void endTransformFeedback(void);
- virtual blink::WGC3Dsync fenceSync(blink::WGC3Denum condition,
- blink::WGC3Dbitfield flags);
- virtual void framebufferTextureLayer(blink::WGC3Denum target,
- blink::WGC3Denum attachment,
- blink::WGC3Duint texture,
- blink::WGC3Dint level,
- blink::WGC3Dint layer);
- virtual void getActiveUniformBlockName(blink::WGC3Duint program,
- blink::WGC3Duint uniformBlockIndex,
- blink::WGC3Dsizei bufSize,
- blink::WGC3Dsizei* length,
- blink::WGC3Dchar* uniformBlockName);
- virtual void getActiveUniformBlockiv(blink::WGC3Duint program,
- blink::WGC3Duint uniformBlockIndex,
- blink::WGC3Denum pname,
- blink::WGC3Dint* params);
- virtual void getActiveUniformsiv(blink::WGC3Duint program,
- blink::WGC3Dsizei uniformCount,
- const blink::WGC3Duint *uniformIndices,
- blink::WGC3Denum pname,
- blink::WGC3Dint *params);
- virtual blink::WGC3Dint getFragDataLocation(blink::WGC3Duint program,
- const blink::WGC3Dchar* name);
- virtual void getInternalformativ(blink::WGC3Denum target,
- blink::WGC3Denum internalformat,
- blink::WGC3Denum pname,
- blink::WGC3Dsizei bufSize,
- blink::WGC3Dint* params);
- virtual void getSamplerParameterfv(blink::WGC3Duint sampler,
- blink::WGC3Denum pname,
- blink::WGC3Dfloat* params);
- virtual void getSamplerParameteriv(blink::WGC3Duint sampler,
- blink::WGC3Denum pname,
- blink::WGC3Dint* params);
- virtual void getTransformFeedbackVarying(blink::WGC3Duint program,
- blink::WGC3Duint index,
- blink::WGC3Dsizei bufSize,
- blink::WGC3Dsizei *length,
- blink::WGC3Dsizei *size,
- blink::WGC3Denum *type,
- blink::WGC3Dchar *name);
- virtual blink::WGC3Duint getUniformBlockIndex(
- blink::WGC3Duint program, const blink::WGC3Dchar* uniformBlockName);
- virtual void getUniformIndices(blink::WGC3Duint program,
- blink::WGC3Dsizei uniformCount,
- const blink::WGC3Dchar *const*uniformNames,
- blink::WGC3Duint *uniformIndices);
- virtual void getUniformuiv(blink::WGC3Duint program,
- blink::WGC3Dint location,
- blink::WGC3Duint *params);
- virtual void getVertexAttribIiv(blink::WGC3Duint index,
- blink::WGC3Denum pname,
- blink::WGC3Dint *params);
- virtual void getVertexAttribIuiv(blink::WGC3Duint index,
- blink::WGC3Denum pname,
- blink::WGC3Duint *params);
- virtual void invalidateFramebuffer(blink::WGC3Denum target,
- blink::WGC3Dsizei numAttachments,
- const blink::WGC3Denum* attachments);
- virtual void invalidateSubFramebuffer(blink::WGC3Denum target,
- blink::WGC3Dsizei numAttachments,
- const blink::WGC3Denum* attachments,
- blink::WGC3Dint x,
- blink::WGC3Dint y,
- blink::WGC3Dsizei width,
- blink::WGC3Dsizei height);
- virtual blink::WGC3Dboolean isSampler(blink::WebGLId sampler);
- virtual blink::WGC3Dboolean isSync(blink::WGC3Dsync sync);
- virtual blink::WGC3Dboolean isTransformFeedback(blink::WGC3Duint id);
- virtual void* mapBufferRange(blink::WGC3Denum target,
- blink::WGC3Dintptr offset,
- blink::WGC3Dsizeiptr length,
- blink::WGC3Dbitfield access);
- virtual void pauseTransformFeedback(void);
- //virtual void programParameteri(blink::WGC3Duint program,
- // blink::WGC3Denum pname,
- // blink::WGC3Dint value);
- virtual void readBuffer(blink::WGC3Denum src);
- virtual void resumeTransformFeedback(void);
- virtual void samplerParameterf(blink::WGC3Duint sampler,
- blink::WGC3Denum pname,
- blink::WGC3Dfloat param);
- virtual void samplerParameterfv(blink::WGC3Duint sampler,
- blink::WGC3Denum pname,
- const blink::WGC3Dfloat* param);
- virtual void samplerParameteri(blink::WGC3Duint sampler,
- blink::WGC3Denum pname,
- blink::WGC3Dint param);
- virtual void samplerParameteriv(blink::WGC3Duint sampler,
- blink::WGC3Denum pname,
- const blink::WGC3Dint* param);
- virtual void texImage3D(blink::WGC3Denum target,
- blink::WGC3Dint level,
- blink::WGC3Dint internalformat,
- blink::WGC3Dsizei width,
- blink::WGC3Dsizei height,
- blink::WGC3Dsizei depth,
- blink::WGC3Dint border,
- blink::WGC3Denum format,
- blink::WGC3Denum type,
- const void* pixels);
- virtual void texStorage3D(blink::WGC3Denum target,
- blink::WGC3Dsizei levels,
+ void beginTransformFeedback(blink::WGC3Denum primitiveMode) override;
+ void bindBufferBase(blink::WGC3Denum target,
+ blink::WGC3Duint index,
+ blink::WGC3Duint buffer) override;
+ void bindBufferRange(blink::WGC3Denum target,
+ blink::WGC3Duint index,
+ blink::WGC3Duint buffer,
+ blink::WGC3Dintptr offset,
+ blink::WGC3Dsizeiptr size) override;
+ void bindSampler(blink::WGC3Duint unit, blink::WebGLId sampler) override;
+ void bindTransformFeedback(blink::WGC3Denum target,
+ blink::WebGLId transformfeedback) override;
+ void clearBufferfi(blink::WGC3Denum buffer,
+ blink::WGC3Dint drawbuffer,
+ blink::WGC3Dfloat depth,
+ blink::WGC3Dint stencil) override;
+ void clearBufferfv(blink::WGC3Denum buffer,
+ blink::WGC3Dint drawbuffer,
+ const blink::WGC3Dfloat* value) override;
+ void clearBufferiv(blink::WGC3Denum buffer,
+ blink::WGC3Dint drawbuffer,
+ const blink::WGC3Dint* value) override;
+ void clearBufferuiv(blink::WGC3Denum buffer,
+ blink::WGC3Dint drawbuffer,
+ const blink::WGC3Duint* value) override;
+ blink::WGC3Denum clientWaitSync(blink::WGC3Dsync sync,
+ blink::WGC3Dbitfield flags,
+ blink::WGC3Duint64 timeout) override;
+ void compressedTexImage3D(blink::WGC3Denum target,
+ blink::WGC3Dint level,
blink::WGC3Denum internalformat,
blink::WGC3Dsizei width,
blink::WGC3Dsizei height,
- blink::WGC3Dsizei depth);
- virtual void texSubImage3D(blink::WGC3Denum target,
- blink::WGC3Dint level,
- blink::WGC3Dint xoffset,
- blink::WGC3Dint yoffset,
- blink::WGC3Dint zoffset,
- blink::WGC3Dsizei width,
- blink::WGC3Dsizei height,
- blink::WGC3Dsizei depth,
- blink::WGC3Denum format,
- blink::WGC3Denum type,
- const void* pixels);
- virtual void transformFeedbackVaryings(
+ blink::WGC3Dsizei depth,
+ blink::WGC3Dint border,
+ blink::WGC3Dsizei imageSize,
+ const void *data) override;
+ void compressedTexSubImage3D(blink::WGC3Denum target,
+ blink::WGC3Dint level,
+ blink::WGC3Dint xoffset,
+ blink::WGC3Dint yoffset,
+ blink::WGC3Dint zoffset,
+ blink::WGC3Dsizei width,
+ blink::WGC3Dsizei height,
+ blink::WGC3Dsizei depth,
+ blink::WGC3Denum format,
+ blink::WGC3Dsizei imageSize,
+ const void *data) override;
+ void copyBufferSubData(blink::WGC3Denum readTarget,
+ blink::WGC3Denum writeTarget,
+ blink::WGC3Dintptr readOffset,
+ blink::WGC3Dintptr writeOffset,
+ blink::WGC3Dsizeiptr size) override;
+ void copyTexSubImage3D(blink::WGC3Denum target,
+ blink::WGC3Dint level,
+ blink::WGC3Dint xoffset,
+ blink::WGC3Dint yoffset,
+ blink::WGC3Dint zoffset,
+ blink::WGC3Dint x,
+ blink::WGC3Dint y,
+ blink::WGC3Dsizei width,
+ blink::WGC3Dsizei height) override;
+ blink::WebGLId createSampler() override;
+ blink::WebGLId createTransformFeedback() override;
+ void deleteSampler(blink::WebGLId sampler) override;
+ void deleteSync(blink::WGC3Dsync sync) override;
+ void deleteTransformFeedback(blink::WebGLId transformfeedback) override;
+ void drawRangeElements(blink::WGC3Denum mode,
+ blink::WGC3Duint start,
+ blink::WGC3Duint end,
+ blink::WGC3Dsizei count,
+ blink::WGC3Denum type,
+ blink::WGC3Dintptr offset) override;
+ void endTransformFeedback(void) override;
+ blink::WGC3Dsync fenceSync(blink::WGC3Denum condition,
+ blink::WGC3Dbitfield flags) override;
+ void framebufferTextureLayer(blink::WGC3Denum target,
+ blink::WGC3Denum attachment,
+ blink::WGC3Duint texture,
+ blink::WGC3Dint level,
+ blink::WGC3Dint layer) override;
+ void getActiveUniformBlockName(blink::WGC3Duint program,
+ blink::WGC3Duint uniformBlockIndex,
+ blink::WGC3Dsizei bufSize,
+ blink::WGC3Dsizei* length,
+ blink::WGC3Dchar* uniformBlockName) override;
+ void getActiveUniformBlockiv(blink::WGC3Duint program,
+ blink::WGC3Duint uniformBlockIndex,
+ blink::WGC3Denum pname,
+ blink::WGC3Dint* params) override;
+ void getActiveUniformsiv(blink::WGC3Duint program,
+ blink::WGC3Dsizei uniformCount,
+ const blink::WGC3Duint *uniformIndices,
+ blink::WGC3Denum pname,
+ blink::WGC3Dint *params) override;
+ blink::WGC3Dint getFragDataLocation(blink::WGC3Duint program,
+ const blink::WGC3Dchar* name) override;
+ void getInternalformativ(blink::WGC3Denum target,
+ blink::WGC3Denum internalformat,
+ blink::WGC3Denum pname,
+ blink::WGC3Dsizei bufSize,
+ blink::WGC3Dint* params) override;
+ void getSamplerParameterfv(blink::WGC3Duint sampler,
+ blink::WGC3Denum pname,
+ blink::WGC3Dfloat* params) override;
+ void getSamplerParameteriv(blink::WGC3Duint sampler,
+ blink::WGC3Denum pname,
+ blink::WGC3Dint* params) override;
+ void getTransformFeedbackVarying(blink::WGC3Duint program,
+ blink::WGC3Duint index,
+ blink::WGC3Dsizei bufSize,
+ blink::WGC3Dsizei *length,
+ blink::WGC3Dsizei *size,
+ blink::WGC3Denum *type,
+ blink::WGC3Dchar *name) override;
+ blink::WGC3Duint getUniformBlockIndex(
+ blink::WGC3Duint program,
+ const blink::WGC3Dchar* uniformBlockName) override;
+ void getUniformIndices(blink::WGC3Duint program,
+ blink::WGC3Dsizei uniformCount,
+ const blink::WGC3Dchar *const*uniformNames,
+ blink::WGC3Duint *uniformIndices) override;
+ void getUniformuiv(blink::WGC3Duint program,
+ blink::WGC3Dint location,
+ blink::WGC3Duint *params) override;
+ void getVertexAttribIiv(blink::WGC3Duint index,
+ blink::WGC3Denum pname,
+ blink::WGC3Dint *params) override;
+ void getVertexAttribIuiv(blink::WGC3Duint index,
+ blink::WGC3Denum pname,
+ blink::WGC3Duint *params) override;
+ void invalidateFramebuffer(blink::WGC3Denum target,
+ blink::WGC3Dsizei numAttachments,
+ const blink::WGC3Denum* attachments) override;
+ void invalidateSubFramebuffer(blink::WGC3Denum target,
+ blink::WGC3Dsizei numAttachments,
+ const blink::WGC3Denum* attachments,
+ blink::WGC3Dint x,
+ blink::WGC3Dint y,
+ blink::WGC3Dsizei width,
+ blink::WGC3Dsizei height) override;
+ blink::WGC3Dboolean isSampler(blink::WebGLId sampler) override;
+ blink::WGC3Dboolean isSync(blink::WGC3Dsync sync) override;
+ blink::WGC3Dboolean isTransformFeedback(blink::WGC3Duint id) override;
+ void* mapBufferRange(blink::WGC3Denum target,
+ blink::WGC3Dintptr offset,
+ blink::WGC3Dsizeiptr length,
+ blink::WGC3Dbitfield access) override;
+ void pauseTransformFeedback(void) override;
+ //void programParameteri(blink::WGC3Duint program,
+ // blink::WGC3Denum pname,
+ // blink::WGC3Dint value) override;
+ void readBuffer(blink::WGC3Denum src) override;
+ void resumeTransformFeedback(void) override;
+ void samplerParameterf(blink::WGC3Duint sampler,
+ blink::WGC3Denum pname,
+ blink::WGC3Dfloat param) override;
+ void samplerParameterfv(blink::WGC3Duint sampler,
+ blink::WGC3Denum pname,
+ const blink::WGC3Dfloat* param) override;
+ void samplerParameteri(blink::WGC3Duint sampler,
+ blink::WGC3Denum pname,
+ blink::WGC3Dint param) override;
+ void samplerParameteriv(blink::WGC3Duint sampler,
+ blink::WGC3Denum pname,
+ const blink::WGC3Dint* param) override;
+ void texImage3D(blink::WGC3Denum target,
+ blink::WGC3Dint level,
+ blink::WGC3Dint internalformat,
+ blink::WGC3Dsizei width,
+ blink::WGC3Dsizei height,
+ blink::WGC3Dsizei depth,
+ blink::WGC3Dint border,
+ blink::WGC3Denum format,
+ blink::WGC3Denum type,
+ const void* pixels) override;
+ void texStorage3D(blink::WGC3Denum target,
+ blink::WGC3Dsizei levels,
+ blink::WGC3Denum internalformat,
+ blink::WGC3Dsizei width,
+ blink::WGC3Dsizei height,
+ blink::WGC3Dsizei depth) override;
+ void texSubImage3D(blink::WGC3Denum target,
+ blink::WGC3Dint level,
+ blink::WGC3Dint xoffset,
+ blink::WGC3Dint yoffset,
+ blink::WGC3Dint zoffset,
+ blink::WGC3Dsizei width,
+ blink::WGC3Dsizei height,
+ blink::WGC3Dsizei depth,
+ blink::WGC3Denum format,
+ blink::WGC3Denum type,
+ const void* pixels) override;
+ void transformFeedbackVaryings(
blink::WGC3Duint program,
blink::WGC3Dsizei count,
const blink::WGC3Dchar* const* varyings,
- blink::WGC3Denum bufferMode);
- virtual void uniform1ui(blink::WGC3Dint location, blink::WGC3Duint x);
- virtual void uniform1uiv(blink::WGC3Dint location,
- blink::WGC3Dsizei count,
- const blink::WGC3Duint* value);
- virtual void uniform2ui(blink::WGC3Dint location,
- blink::WGC3Duint x,
- blink::WGC3Duint y);
- virtual void uniform2uiv(blink::WGC3Dint location,
- blink::WGC3Dsizei count,
- const blink::WGC3Duint* value);
- virtual void uniform3ui(blink::WGC3Dint location,
- blink::WGC3Duint x,
- blink::WGC3Duint y,
- blink::WGC3Duint z);
- virtual void uniform3uiv(blink::WGC3Dint location,
- blink::WGC3Dsizei count,
- const blink::WGC3Duint* value);
- virtual void uniform4ui(blink::WGC3Dint location,
- blink::WGC3Duint x,
- blink::WGC3Duint y,
- blink::WGC3Duint z,
- blink::WGC3Duint w);
- virtual void uniform4uiv(blink::WGC3Dint location,
- blink::WGC3Dsizei count,
- const blink::WGC3Duint* value);
- virtual void uniformBlockBinding(blink::WGC3Duint program,
- blink::WGC3Duint uniformBlockIndex,
- blink::WGC3Duint uniformBlockBinding);
- virtual void uniformMatrix2x3fv(blink::WGC3Dint location,
- blink::WGC3Dsizei count,
- blink::WGC3Dboolean transpose,
- const blink::WGC3Dfloat* value);
- virtual void uniformMatrix2x4fv(blink::WGC3Dint location,
- blink::WGC3Dsizei count,
- blink::WGC3Dboolean transpose,
- const blink::WGC3Dfloat* value);
- virtual void uniformMatrix3x2fv(blink::WGC3Dint location,
- blink::WGC3Dsizei count,
- blink::WGC3Dboolean transpose,
- const blink::WGC3Dfloat* value);
- virtual void uniformMatrix3x4fv(blink::WGC3Dint location,
- blink::WGC3Dsizei count,
- blink::WGC3Dboolean transpose,
- const blink::WGC3Dfloat* value);
- virtual void uniformMatrix4x2fv(blink::WGC3Dint location,
- blink::WGC3Dsizei count,
- blink::WGC3Dboolean transpose,
- const blink::WGC3Dfloat* value);
- virtual void uniformMatrix4x3fv(blink::WGC3Dint location,
- blink::WGC3Dsizei count,
- blink::WGC3Dboolean transpose,
- const blink::WGC3Dfloat* value);
- virtual blink::WGC3Dboolean unmapBuffer(blink::WGC3Denum target);
- virtual void vertexAttribI4i(blink::WGC3Duint index,
- blink::WGC3Dint x,
- blink::WGC3Dint y,
- blink::WGC3Dint z,
- blink::WGC3Dint w);
- virtual void vertexAttribI4iv(blink::WGC3Duint index,
- const blink::WGC3Dint* v);
- virtual void vertexAttribI4ui(blink::WGC3Duint index,
- blink::WGC3Duint x,
- blink::WGC3Duint y,
- blink::WGC3Duint z,
- blink::WGC3Duint w);
- virtual void vertexAttribI4uiv(blink::WGC3Duint index,
- const blink::WGC3Duint* v);
- virtual void vertexAttribIPointer(blink::WGC3Duint index,
- blink::WGC3Dint size,
- blink::WGC3Denum type,
- blink::WGC3Dsizei stride,
- blink::WGC3Dintptr pointer);
- virtual void waitSync(blink::WGC3Dsync sync,
- blink::WGC3Dbitfield flags,
- blink::WGC3Duint64 timeout);
-
- virtual bool isContextLost();
- virtual blink::WGC3Denum getGraphicsResetStatusARB();
-
- virtual GrGLInterface* createGrGLInterface();
+ blink::WGC3Denum bufferMode) override;
+ void uniform1ui(blink::WGC3Dint location, blink::WGC3Duint x) override;
+ void uniform1uiv(blink::WGC3Dint location,
+ blink::WGC3Dsizei count,
+ const blink::WGC3Duint* value) override;
+ void uniform2ui(blink::WGC3Dint location,
+ blink::WGC3Duint x,
+ blink::WGC3Duint y) override;
+ void uniform2uiv(blink::WGC3Dint location,
+ blink::WGC3Dsizei count,
+ const blink::WGC3Duint* value) override;
+ void uniform3ui(blink::WGC3Dint location,
+ blink::WGC3Duint x,
+ blink::WGC3Duint y,
+ blink::WGC3Duint z) override;
+ void uniform3uiv(blink::WGC3Dint location,
+ blink::WGC3Dsizei count,
+ const blink::WGC3Duint* value) override;
+ void uniform4ui(blink::WGC3Dint location,
+ blink::WGC3Duint x,
+ blink::WGC3Duint y,
+ blink::WGC3Duint z,
+ blink::WGC3Duint w) override;
+ void uniform4uiv(blink::WGC3Dint location,
+ blink::WGC3Dsizei count,
+ const blink::WGC3Duint* value) override;
+ void uniformBlockBinding(blink::WGC3Duint program,
+ blink::WGC3Duint uniformBlockIndex,
+ blink::WGC3Duint uniformBlockBinding) override;
+ void uniformMatrix2x3fv(blink::WGC3Dint location,
+ blink::WGC3Dsizei count,
+ blink::WGC3Dboolean transpose,
+ const blink::WGC3Dfloat* value) override;
+ void uniformMatrix2x4fv(blink::WGC3Dint location,
+ blink::WGC3Dsizei count,
+ blink::WGC3Dboolean transpose,
+ const blink::WGC3Dfloat* value) override;
+ void uniformMatrix3x2fv(blink::WGC3Dint location,
+ blink::WGC3Dsizei count,
+ blink::WGC3Dboolean transpose,
+ const blink::WGC3Dfloat* value) override;
+ void uniformMatrix3x4fv(blink::WGC3Dint location,
+ blink::WGC3Dsizei count,
+ blink::WGC3Dboolean transpose,
+ const blink::WGC3Dfloat* value) override;
+ void uniformMatrix4x2fv(blink::WGC3Dint location,
+ blink::WGC3Dsizei count,
+ blink::WGC3Dboolean transpose,
+ const blink::WGC3Dfloat* value) override;
+ void uniformMatrix4x3fv(blink::WGC3Dint location,
+ blink::WGC3Dsizei count,
+ blink::WGC3Dboolean transpose,
+ const blink::WGC3Dfloat* value) override;
+ blink::WGC3Dboolean unmapBuffer(blink::WGC3Denum target) override;
+ void vertexAttribI4i(blink::WGC3Duint index,
+ blink::WGC3Dint x,
+ blink::WGC3Dint y,
+ blink::WGC3Dint z,
+ blink::WGC3Dint w) override;
+ void vertexAttribI4iv(blink::WGC3Duint index,
+ const blink::WGC3Dint* v) override;
+ void vertexAttribI4ui(blink::WGC3Duint index,
+ blink::WGC3Duint x,
+ blink::WGC3Duint y,
+ blink::WGC3Duint z,
+ blink::WGC3Duint w) override;
+ void vertexAttribI4uiv(blink::WGC3Duint index,
+ const blink::WGC3Duint* v) override;
+ void vertexAttribIPointer(blink::WGC3Duint index,
+ blink::WGC3Dint size,
+ blink::WGC3Denum type,
+ blink::WGC3Dsizei stride,
+ blink::WGC3Dintptr pointer) override;
+ void waitSync(blink::WGC3Dsync sync,
+ blink::WGC3Dbitfield flags,
+ blink::WGC3Duint64 timeout) override;
+
+ bool isContextLost() override;
+ blink::WGC3Denum getGraphicsResetStatusARB() override;
+
+ GrGLInterface* createGrGLInterface() override;
::gpu::gles2::GLES2Interface* GetGLInterface() {
return gl_;
diff --git a/chromium/gpu/blink/webgraphicscontext3d_in_process_command_buffer_impl.h b/chromium/gpu/blink/webgraphicscontext3d_in_process_command_buffer_impl.h
index d463582beaf..8500a7f6335 100644
--- a/chromium/gpu/blink/webgraphicscontext3d_in_process_command_buffer_impl.h
+++ b/chromium/gpu/blink/webgraphicscontext3d_in_process_command_buffer_impl.h
@@ -52,7 +52,7 @@ class GPU_BLINK_EXPORT WebGraphicsContext3DInProcessCommandBufferImpl
scoped_ptr< ::gpu::GLInProcessContext> context,
const blink::WebGraphicsContext3D::Attributes& attributes);
- virtual ~WebGraphicsContext3DInProcessCommandBufferImpl();
+ ~WebGraphicsContext3DInProcessCommandBufferImpl() override;
size_t GetMappedMemoryLimit();
diff --git a/chromium/gpu/command_buffer/build_gles2_cmd_buffer.py b/chromium/gpu/command_buffer/build_gles2_cmd_buffer.py
index c3bf80e8a68..597f5259e5f 100755
--- a/chromium/gpu/command_buffer/build_gles2_cmd_buffer.py
+++ b/chromium/gpu/command_buffer/build_gles2_cmd_buffer.py
@@ -540,6 +540,31 @@ _STATES = {
},
],
},
+ 'PathStencilFuncCHROMIUM': {
+ 'type': 'Normal',
+ 'func': 'PathStencilFuncNV',
+ 'extension_flag': 'chromium_path_rendering',
+ 'states': [
+ {
+ 'name': 'stencil_path_func',
+ 'type': 'GLenum',
+ 'enum': 'GL_PATH_STENCIL_FUNC_CHROMIUM',
+ 'default': 'GL_ALWAYS',
+ },
+ {
+ 'name': 'stencil_path_ref',
+ 'type': 'GLint',
+ 'enum': 'GL_PATH_STENCIL_REF_CHROMIUM',
+ 'default': '0',
+ },
+ {
+ 'name': 'stencil_path_mask',
+ 'type': 'GLuint',
+ 'enum': 'GL_PATH_STENCIL_VALUE_MASK_CHROMIUM',
+ 'default': '0xFFFFFFFFU',
+ },
+ ],
+ },
}
# Named type info object represents a named type that is used in OpenGL call
@@ -787,6 +812,7 @@ _NAMED_TYPE_INFO = {
'GL_DRAW_BUFFER15',
'GL_DRAW_FRAMEBUFFER_BINDING',
'GL_FRAGMENT_SHADER_DERIVATIVE_HINT',
+ 'GL_GPU_DISJOINT_EXT',
'GL_MAJOR_VERSION',
'GL_MAX_3D_TEXTURE_SIZE',
'GL_MAX_ARRAY_TEXTURE_LAYERS',
@@ -827,6 +853,7 @@ _NAMED_TYPE_INFO = {
'GL_READ_BUFFER',
'GL_READ_FRAMEBUFFER_BINDING',
'GL_SAMPLER_BINDING',
+ 'GL_TIMESTAMP_EXT',
'GL_TEXTURE_BINDING_2D_ARRAY',
'GL_TEXTURE_BINDING_3D',
'GL_TRANSFORM_FEEDBACK_BINDING',
@@ -879,6 +906,32 @@ _NAMED_TYPE_INFO = {
'GL_PROXY_TEXTURE_CUBE_MAP',
]
},
+ 'ReadBuffer': {
+ 'type': 'GLenum',
+ 'valid': [
+ 'GL_NONE',
+ 'GL_BACK',
+ 'GL_COLOR_ATTACHMENT0',
+ 'GL_COLOR_ATTACHMENT1',
+ 'GL_COLOR_ATTACHMENT2',
+ 'GL_COLOR_ATTACHMENT3',
+ 'GL_COLOR_ATTACHMENT4',
+ 'GL_COLOR_ATTACHMENT5',
+ 'GL_COLOR_ATTACHMENT6',
+ 'GL_COLOR_ATTACHMENT7',
+ 'GL_COLOR_ATTACHMENT8',
+ 'GL_COLOR_ATTACHMENT9',
+ 'GL_COLOR_ATTACHMENT10',
+ 'GL_COLOR_ATTACHMENT11',
+ 'GL_COLOR_ATTACHMENT12',
+ 'GL_COLOR_ATTACHMENT13',
+ 'GL_COLOR_ATTACHMENT14',
+ 'GL_COLOR_ATTACHMENT15',
+ ],
+ 'invalid': [
+ 'GL_RENDERBUFFER',
+ ]
+ },
'TextureTarget': {
'type': 'GLenum',
'valid': [
@@ -1091,6 +1144,10 @@ _NAMED_TYPE_INFO = {
],
'valid_es3': [
'GL_DEPTH_STENCIL_ATTACHMENT',
+ # For backbuffer.
+ 'GL_COLOR_EXT',
+ 'GL_DEPTH_EXT',
+ 'GL_STENCIL_EXT',
],
},
'BackbufferAttachment': {
@@ -1110,6 +1167,15 @@ _NAMED_TYPE_INFO = {
'valid_es3': [
'GL_BUFFER_ACCESS_FLAGS',
'GL_BUFFER_MAPPED',
+ ],
+ 'invalid': [
+ 'GL_PIXEL_PACK_BUFFER',
+ ],
+ },
+ 'BufferParameter64': {
+ 'type': 'GLenum',
+ 'valid': [
+ 'GL_BUFFER_SIZE',
'GL_BUFFER_MAP_LENGTH',
'GL_BUFFER_MAP_OFFSET',
],
@@ -1198,7 +1264,6 @@ _NAMED_TYPE_INFO = {
'GL_ANY_SAMPLES_PASSED_CONSERVATIVE_EXT',
'GL_COMMANDS_ISSUED_CHROMIUM',
'GL_LATENCY_QUERY_CHROMIUM',
- 'GL_ASYNC_PIXEL_UNPACK_COMPLETED_CHROMIUM',
'GL_ASYNC_PIXEL_PACK_COMPLETED_CHROMIUM',
'GL_COMMANDS_COMPLETED_CHROMIUM',
],
@@ -1446,12 +1511,13 @@ _NAMED_TYPE_INFO = {
'GL_RGBA',
],
'valid_es3': [
+ 'GL_RED',
+ 'GL_RED_INTEGER',
+ 'GL_RG',
+ 'GL_RG_INTEGER',
+ 'GL_RGB_INTEGER',
'GL_RGBA_INTEGER',
],
- 'deprecated_es3': [
- 'GL_ALPHA',
- 'GL_RGB',
- ],
},
'PixelType': {
'type': 'GLenum',
@@ -1479,6 +1545,57 @@ _NAMED_TYPE_INFO = {
'GL_UNSIGNED_BYTE_3_3_2',
],
},
+ 'PathCoordType': {
+ 'type': 'GLenum',
+ 'valid': [
+ 'GL_BYTE',
+ 'GL_UNSIGNED_BYTE',
+ 'GL_SHORT',
+ 'GL_UNSIGNED_SHORT',
+ 'GL_FLOAT',
+ ],
+ },
+ 'PathCoverMode': {
+ 'type': 'GLenum',
+ 'valid': [
+ 'GL_CONVEX_HULL_CHROMIUM',
+ 'GL_BOUNDING_BOX_CHROMIUM',
+ ],
+ },
+ 'PathFillMode': {
+ 'type': 'GLenum',
+ 'valid': [
+ 'GL_INVERT',
+ 'GL_COUNT_UP_CHROMIUM',
+ 'GL_COUNT_DOWN_CHROMIUM',
+ ],
+ },
+ 'PathParameter': {
+ 'type': 'GLenum',
+ 'valid': [
+ 'GL_PATH_STROKE_WIDTH_CHROMIUM',
+ 'GL_PATH_END_CAPS_CHROMIUM',
+ 'GL_PATH_JOIN_STYLE_CHROMIUM',
+ 'GL_PATH_MITER_LIMIT_CHROMIUM',
+ 'GL_PATH_STROKE_BOUND_CHROMIUM',
+ ]
+ },
+ 'PathParameterCapValues': {
+ 'type': 'GLint',
+ 'valid': [
+ 'GL_FLAT',
+ 'GL_SQUARE_CHROMIUM',
+ 'GL_ROUND_CHROMIUM',
+ ]
+ },
+ 'PathParameterJoinValues': {
+ 'type': 'GLint',
+ 'valid': [
+ 'GL_MITER_REVERT_CHROMIUM',
+ 'GL_BEVEL_CHROMIUM',
+ 'GL_ROUND_CHROMIUM',
+ ]
+ },
'ReadPixelType': {
'type': 'GLenum',
'valid': [
@@ -1487,18 +1604,15 @@ _NAMED_TYPE_INFO = {
'GL_UNSIGNED_SHORT_4_4_4_4',
'GL_UNSIGNED_SHORT_5_5_5_1',
],
- 'invalid': [
- 'GL_SHORT',
- ],
'valid_es3': [
+ 'GL_BYTE',
+ 'GL_UNSIGNED_SHORT',
+ 'GL_SHORT',
'GL_UNSIGNED_INT',
'GL_INT',
+ 'GL_HALF_FLOAT',
'GL_FLOAT',
- ],
- 'deprecated_es3': [
- 'GL_UNSIGNED_SHORT_5_6_5',
- 'GL_UNSIGNED_SHORT_4_4_4_4',
- 'GL_UNSIGNED_SHORT_5_5_5_1',
+ 'GL_UNSIGNED_INT_2_10_10_10_REV',
],
},
'RenderBufferFormat': {
@@ -1748,6 +1862,7 @@ _NAMED_TYPE_INFO = {
'valid': [
'GL_RGB',
'GL_RGB_YUV_420_CHROMIUM',
+ 'GL_RGB_YCBCR_422_CHROMIUM',
'GL_RGBA',
],
},
@@ -2019,6 +2134,13 @@ _FUNCTION_INFO = {
'impl_func': False,
'client_test': False,
},
+ 'ApplyScreenSpaceAntialiasingCHROMIUM': {
+ 'decoder_func': 'DoApplyScreenSpaceAntialiasingCHROMIUM',
+ 'extension': 'CHROMIUM_screen_space_antialiasing',
+ 'extension_flag': 'chromium_screen_space_antialiasing',
+ 'unit_test': False,
+ 'client_test': False,
+ },
'AttachShader': {'decoder_func': 'DoAttachShader'},
'BindAttribLocation': {
'type': 'GLchar',
@@ -2032,13 +2154,13 @@ _FUNCTION_INFO = {
},
'BindBufferBase': {
'type': 'Bind',
- 'id_mapping': [ 'Buffer' ],
+ 'decoder_func': 'DoBindBufferBase',
'gen_func': 'GenBuffersARB',
'unsafe': True,
},
'BindBufferRange': {
'type': 'Bind',
- 'id_mapping': [ 'Buffer' ],
+ 'decoder_func': 'DoBindBufferRange',
'gen_func': 'GenBuffersARB',
'valid_args': {
'3': '4',
@@ -2080,6 +2202,7 @@ _FUNCTION_INFO = {
'BlitFramebufferCHROMIUM': {
'decoder_func': 'DoBlitFramebufferCHROMIUM',
'unit_test': False,
+ 'extension': 'chromium_framebuffer_multisample',
'extension_flag': 'chromium_framebuffer_multisample',
'pepper_interface': 'FramebufferBlit',
'pepper_name': 'BlitFramebufferEXT',
@@ -2116,12 +2239,16 @@ _FUNCTION_INFO = {
'type': 'PUT',
'use_count_func': True,
'count': 4,
+ 'decoder_func': 'DoClearBufferiv',
+ 'unit_test': False,
'unsafe': True,
'trace_level': 2,
},
'ClearBufferuiv': {
'type': 'PUT',
'count': 4,
+ 'decoder_func': 'DoClearBufferuiv',
+ 'unit_test': False,
'unsafe': True,
'trace_level': 2,
},
@@ -2129,11 +2256,15 @@ _FUNCTION_INFO = {
'type': 'PUT',
'use_count_func': True,
'count': 4,
+ 'decoder_func': 'DoClearBufferfv',
+ 'unit_test': False,
'unsafe': True,
'trace_level': 2,
},
'ClearBufferfi': {
'unsafe': True,
+ 'decoder_func': 'DoClearBufferfi',
+ 'unit_test': False,
'trace_level': 2,
},
'ClearColor': {
@@ -2195,7 +2326,7 @@ _FUNCTION_INFO = {
'resource_type': 'Valuebuffer',
'resource_types': 'Valuebuffers',
'unit_test': False,
- 'extension': True,
+ 'extension': 'CHROMIUM_subscribe_uniform',
'chromium': True,
},
'DeleteValuebuffersCHROMIUM': {
@@ -2204,14 +2335,14 @@ _FUNCTION_INFO = {
'resource_type': 'Valuebuffer',
'resource_types': 'Valuebuffers',
'unit_test': False,
- 'extension': True,
+ 'extension': 'CHROMIUM_subscribe_uniform',
'chromium': True,
},
'IsValuebufferCHROMIUM': {
'type': 'Is',
'decoder_func': 'DoIsValuebufferCHROMIUM',
'expectation': False,
- 'extension': True,
+ 'extension': 'CHROMIUM_subscribe_uniform',
'chromium': True,
},
'BindValuebufferCHROMIUM': {
@@ -2219,25 +2350,25 @@ _FUNCTION_INFO = {
'decoder_func': 'DoBindValueBufferCHROMIUM',
'gen_func': 'GenValueBuffersCHROMIUM',
'unit_test': False,
- 'extension': True,
+ 'extension': 'CHROMIUM_subscribe_uniform',
'chromium': True,
},
'SubscribeValueCHROMIUM': {
'decoder_func': 'DoSubscribeValueCHROMIUM',
'unit_test': False,
- 'extension': True,
+ 'extension': 'CHROMIUM_subscribe_uniform',
'chromium': True,
},
'PopulateSubscribedValuesCHROMIUM': {
'decoder_func': 'DoPopulateSubscribedValuesCHROMIUM',
'unit_test': False,
- 'extension': True,
+ 'extension': 'CHROMIUM_subscribe_uniform',
'chromium': True,
},
'UniformValuebufferCHROMIUM': {
'decoder_func': 'DoUniformValueBufferCHROMIUM',
'unit_test': False,
- 'extension': True,
+ 'extension': 'CHROMIUM_subscribe_uniform',
'chromium': True,
},
'ClearStencil': {
@@ -2251,7 +2382,7 @@ _FUNCTION_INFO = {
'expectation': False,
'cmd_args': 'GLuint bucket_id, GLint* result',
'result': ['GLint'],
- 'extension': True,
+ 'extension': 'GL_CHROMIUM_enable_feature',
'chromium': True,
'pepper_interface': 'ChromiumEnableFeature',
},
@@ -2325,7 +2456,7 @@ _FUNCTION_INFO = {
'client_test': False,
'gen_cmd': False,
'expectation': False,
- 'extension': "CHROMIUM_image",
+ 'extension': "CHROMIUM_gpu_memory_buffer_image",
'chromium': True,
'trace_level': 1,
},
@@ -2365,7 +2496,7 @@ _FUNCTION_INFO = {
},
'BlendBarrierKHR': {
'gl_test_func': 'glBlendBarrierKHR',
- 'extension': True,
+ 'extension': 'KHR_blend_equation_advanced',
'extension_flag': 'blend_equation_advanced',
'client_test': False,
},
@@ -2536,6 +2667,7 @@ _FUNCTION_INFO = {
'gl_test_func': 'glFramebufferTexture2DMultisampleEXT',
'expectation': False,
'unit_test': False,
+ 'extension': 'EXT_multisampled_render_to_texture',
'extension_flag': 'multisampled_render_to_texture',
'trace_level': 1,
},
@@ -2669,6 +2801,14 @@ _FUNCTION_INFO = {
'decoder_func': 'DoGetBooleanv',
'gl_test_func': 'glGetBooleanv',
},
+ 'GetBufferParameteri64v': {
+ 'type': 'GETn',
+ 'result': ['SizedResult<GLint64>'],
+ 'decoder_func': 'DoGetBufferParameteri64v',
+ 'expectation': False,
+ 'shadowed': True,
+ 'unsafe': True,
+ },
'GetBufferParameteriv': {
'type': 'GETn',
'result': ['SizedResult<GLint>'],
@@ -2755,7 +2895,7 @@ _FUNCTION_INFO = {
'type': 'Custom',
'expectation': False,
'impl_func': False,
- 'extension': True,
+ 'extension': 'CHROMIUM_get_multiple',
'chromium': True,
'client_test': False,
'cmd_args': 'GLidProgram program, uint32_t bucket_id',
@@ -3058,7 +3198,7 @@ _FUNCTION_INFO = {
},
'MapBufferSubDataCHROMIUM': {
'gen_cmd': False,
- 'extension': True,
+ 'extension': 'CHROMIUM_map_sub',
'chromium': True,
'client_test': False,
'pepper_interface': 'ChromiumMapSub',
@@ -3130,6 +3270,7 @@ _FUNCTION_INFO = {
'gl_test_func': 'glRenderbufferStorageMultisampleCHROMIUM',
'expectation': False,
'unit_test': False,
+ 'extension': 'chromium_framebuffer_multisample',
'extension_flag': 'chromium_framebuffer_multisample',
'pepper_interface': 'FramebufferMultisample',
'pepper_name': 'RenderbufferStorageMultisampleEXT',
@@ -3142,11 +3283,13 @@ _FUNCTION_INFO = {
'gl_test_func': 'glRenderbufferStorageMultisampleEXT',
'expectation': False,
'unit_test': False,
+ 'extension': 'EXT_multisampled_render_to_texture',
'extension_flag': 'multisampled_render_to_texture',
'trace_level': 1,
},
'ReadBuffer': {
'unsafe': True,
+ 'decoder_func': 'DoReadBuffer',
'trace_level': 1,
},
'ReadPixels': {
@@ -3324,6 +3467,7 @@ _FUNCTION_INFO = {
'decoder_func': 'DoTransformFeedbackVaryings',
'cmd_args':
'GLuint program, const char** varyings, GLenum buffermode',
+ 'expectation': False,
'unsafe': True,
},
'Uniform1f': {'type': 'PUTXn', 'count': 1},
@@ -3342,11 +3486,14 @@ _FUNCTION_INFO = {
'Uniform1ui': {
'type': 'PUTXn',
'count': 1,
+ 'unit_test': False,
'unsafe': True,
},
'Uniform1uiv': {
'type': 'PUTn',
'count': 1,
+ 'decoder_func': 'DoUniform1uiv',
+ 'unit_test': False,
'unsafe': True,
},
'Uniform2i': {'type': 'PUTXn', 'count': 2},
@@ -3364,11 +3511,14 @@ _FUNCTION_INFO = {
'Uniform2ui': {
'type': 'PUTXn',
'count': 2,
+ 'unit_test': False,
'unsafe': True,
},
'Uniform2uiv': {
'type': 'PUTn',
'count': 2,
+ 'decoder_func': 'DoUniform2uiv',
+ 'unit_test': False,
'unsafe': True,
},
'Uniform3i': {'type': 'PUTXn', 'count': 3},
@@ -3386,11 +3536,14 @@ _FUNCTION_INFO = {
'Uniform3ui': {
'type': 'PUTXn',
'count': 3,
+ 'unit_test': False,
'unsafe': True,
},
'Uniform3uiv': {
'type': 'PUTn',
'count': 3,
+ 'decoder_func': 'DoUniform3uiv',
+ 'unit_test': False,
'unsafe': True,
},
'Uniform4i': {'type': 'PUTXn', 'count': 4},
@@ -3408,11 +3561,14 @@ _FUNCTION_INFO = {
'Uniform4ui': {
'type': 'PUTXn',
'count': 4,
+ 'unit_test': False,
'unsafe': True,
},
'Uniform4uiv': {
'type': 'PUTn',
'count': 4,
+ 'decoder_func': 'DoUniform4uiv',
+ 'unit_test': False,
'unsafe': True,
},
'UniformMatrix2fv': {
@@ -3423,11 +3579,13 @@ _FUNCTION_INFO = {
'UniformMatrix2x3fv': {
'type': 'PUTn',
'count': 6,
+ 'decoder_func': 'DoUniformMatrix2x3fv',
'unsafe': True,
},
'UniformMatrix2x4fv': {
'type': 'PUTn',
'count': 8,
+ 'decoder_func': 'DoUniformMatrix2x4fv',
'unsafe': True,
},
'UniformMatrix3fv': {
@@ -3438,11 +3596,13 @@ _FUNCTION_INFO = {
'UniformMatrix3x2fv': {
'type': 'PUTn',
'count': 6,
+ 'decoder_func': 'DoUniformMatrix3x2fv',
'unsafe': True,
},
'UniformMatrix3x4fv': {
'type': 'PUTn',
'count': 12,
+ 'decoder_func': 'DoUniformMatrix3x4fv',
'unsafe': True,
},
'UniformMatrix4fv': {
@@ -3453,11 +3613,13 @@ _FUNCTION_INFO = {
'UniformMatrix4x2fv': {
'type': 'PUTn',
'count': 8,
+ 'decoder_func': 'DoUniformMatrix4x2fv',
'unsafe': True,
},
'UniformMatrix4x3fv': {
'type': 'PUTn',
'count': 12,
+ 'decoder_func': 'DoUniformMatrix4x3fv',
'unsafe': True,
},
'UniformBlockBinding': {
@@ -3474,7 +3636,7 @@ _FUNCTION_INFO = {
},
'UnmapBufferSubDataCHROMIUM': {
'gen_cmd': False,
- 'extension': True,
+ 'extension': 'CHROMIUM_map_sub',
'chromium': True,
'client_test': False,
'pepper_interface': 'ChromiumMapSub',
@@ -3593,15 +3755,9 @@ _FUNCTION_INFO = {
'impl_func': False,
'client_test': False,
'cmd_args': 'uint32_t bucket_id',
- 'extension': True,
+ 'extension': 'CHROMIUM_request_extension',
'chromium': True,
},
- 'RateLimitOffscreenContextCHROMIUM': {
- 'gen_cmd': False,
- 'extension': True,
- 'chromium': True,
- 'client_test': False,
- },
'CreateStreamTextureCHROMIUM': {
'type': 'HandWritten',
'impl_func': False,
@@ -3634,12 +3790,18 @@ _FUNCTION_INFO = {
'CompressedCopyTextureCHROMIUM': {
'decoder_func': 'DoCompressedCopyTextureCHROMIUM',
'unit_test': False,
- 'extension': True,
+ 'extension': 'CHROMIUM_copy_compressed_texture',
+ 'chromium': True,
+ },
+ 'CompressedCopySubTextureCHROMIUM': {
+ 'decoder_func': 'DoCompressedCopySubTextureCHROMIUM',
+ 'unit_test': False,
+ 'extension': 'CHROMIUM_copy_compressed_texture',
'chromium': True,
},
'TexStorage2DEXT': {
'unit_test': False,
- 'extension': True,
+ 'extension': 'EXT_texture_storage',
'decoder_func': 'DoTexStorage2DEXT',
'trace_level': 2,
},
@@ -3647,7 +3809,7 @@ _FUNCTION_INFO = {
'type': 'Manual',
'cmd_args': 'GLenumDrawMode mode, GLint first, GLsizei count, '
'GLsizei primcount',
- 'extension': True,
+ 'extension': 'ANGLE_instanced_arrays',
'unit_test': False,
'pepper_interface': 'InstancedArrays',
'defer_draws': True,
@@ -3661,7 +3823,7 @@ _FUNCTION_INFO = {
'unit_test': False,
# could use 'extension_flag': 'ext_draw_buffers' but currently expected to
# work without.
- 'extension': True,
+ 'extension': 'EXT_draw_buffers',
'pepper_interface': 'DrawBuffers',
'trace_level': 2,
},
@@ -3669,7 +3831,7 @@ _FUNCTION_INFO = {
'type': 'Manual',
'cmd_args': 'GLenumDrawMode mode, GLsizei count, '
'GLenumIndexType type, GLuint index_offset, GLsizei primcount',
- 'extension': True,
+ 'extension': 'ANGLE_instanced_arrays',
'unit_test': False,
'client_test': False,
'pepper_interface': 'InstancedArrays',
@@ -3679,7 +3841,7 @@ _FUNCTION_INFO = {
'VertexAttribDivisorANGLE': {
'type': 'Manual',
'cmd_args': 'GLuint index, GLuint divisor',
- 'extension': True,
+ 'extension': 'ANGLE_instanced_arrays',
'unit_test': False,
'pepper_interface': 'InstancedArrays',
},
@@ -3744,6 +3906,20 @@ _FUNCTION_INFO = {
'pepper_interface': 'Query',
'extension': "occlusion_query_EXT",
},
+ 'QueryCounterEXT' : {
+ 'type': 'Manual',
+ 'cmd_args': 'GLidQuery id, GLenumQueryTarget target, '
+ 'void* sync_data, GLuint submit_count',
+ 'data_transfer_methods': ['shm'],
+ 'gl_test_func': 'glQueryCounter',
+ 'extension': "disjoint_timer_query_EXT",
+ },
+ 'GetQueryObjectivEXT': {
+ 'gen_cmd': False,
+ 'client_test': False,
+ 'gl_test_func': 'glGetQueryObjectiv',
+ 'extension': "disjoint_timer_query_EXT",
+ },
'GetQueryObjectuivEXT': {
'gen_cmd': False,
'client_test': False,
@@ -3751,15 +3927,29 @@ _FUNCTION_INFO = {
'pepper_interface': 'Query',
'extension': "occlusion_query_EXT",
},
+ 'GetQueryObjecti64vEXT': {
+ 'gen_cmd': False,
+ 'client_test': False,
+ 'gl_test_func': 'glGetQueryObjecti64v',
+ 'extension': "disjoint_timer_query_EXT",
+ },
'GetQueryObjectui64vEXT': {
'gen_cmd': False,
'client_test': False,
'gl_test_func': 'glGetQueryObjectui64v',
'extension': "disjoint_timer_query_EXT",
},
+ 'SetDisjointValueSyncCHROMIUM': {
+ 'type': 'Manual',
+ 'data_transfer_methods': ['shm'],
+ 'client_test': False,
+ 'cmd_args': 'void* sync_data',
+ 'extension': True,
+ 'chromium': True,
+ },
'BindUniformLocationCHROMIUM': {
'type': 'GLchar',
- 'extension': True,
+ 'extension': 'CHROMIUM_bind_uniform_location',
'data_transfer_methods': ['bucket'],
'needs_size': True,
'gl_test_func': 'DoBindUniformLocationCHROMIUM',
@@ -3768,24 +3958,24 @@ _FUNCTION_INFO = {
'type': 'GLcharN',
'decoder_func': 'DoInsertEventMarkerEXT',
'expectation': False,
- 'extension': True,
+ 'extension': 'EXT_debug_marker',
},
'PushGroupMarkerEXT': {
'type': 'GLcharN',
'decoder_func': 'DoPushGroupMarkerEXT',
'expectation': False,
- 'extension': True,
+ 'extension': 'EXT_debug_marker',
},
'PopGroupMarkerEXT': {
'decoder_func': 'DoPopGroupMarkerEXT',
'expectation': False,
- 'extension': True,
+ 'extension': 'EXT_debug_marker',
'impl_func': False,
},
'GenVertexArraysOES': {
'type': 'GENn',
- 'extension': True,
+ 'extension': 'OES_vertex_array_object',
'gl_test_func': 'glGenVertexArraysOES',
'resource_type': 'VertexArray',
'resource_types': 'VertexArrays',
@@ -3794,7 +3984,7 @@ _FUNCTION_INFO = {
},
'BindVertexArrayOES': {
'type': 'Bind',
- 'extension': True,
+ 'extension': 'OES_vertex_array_object',
'gl_test_func': 'glBindVertexArrayOES',
'decoder_func': 'DoBindVertexArrayOES',
'gen_func': 'GenVertexArraysOES',
@@ -3804,7 +3994,7 @@ _FUNCTION_INFO = {
},
'DeleteVertexArraysOES': {
'type': 'DELn',
- 'extension': True,
+ 'extension': 'OES_vertex_array_object',
'gl_test_func': 'glDeleteVertexArraysOES',
'resource_type': 'VertexArray',
'resource_types': 'VertexArrays',
@@ -3813,7 +4003,7 @@ _FUNCTION_INFO = {
},
'IsVertexArrayOES': {
'type': 'Is',
- 'extension': True,
+ 'extension': 'OES_vertex_array_object',
'gl_test_func': 'glIsVertexArrayOES',
'decoder_func': 'DoIsVertexArrayOES',
'expectation': False,
@@ -3849,7 +4039,7 @@ _FUNCTION_INFO = {
'OrderingBarrierCHROMIUM': {
'impl_func': False,
'gen_cmd': False,
- 'extension': True,
+ 'extension': "CHROMIUM_miscellaneous",
'chromium': True,
'client_test': False,
},
@@ -3858,7 +4048,7 @@ _FUNCTION_INFO = {
'impl_func': False,
'client_test': False,
'cmd_args': 'GLuint category_bucket_id, GLuint name_bucket_id',
- 'extension': True,
+ 'extension': 'CHROMIUM_trace_marker',
'chromium': True,
},
'TraceEndCHROMIUM': {
@@ -3866,53 +4056,8 @@ _FUNCTION_INFO = {
'client_test': False,
'decoder_func': 'DoTraceEndCHROMIUM',
'unit_test': False,
- 'extension': True,
- 'chromium': True,
- },
- 'AsyncTexImage2DCHROMIUM': {
- 'type': 'Manual',
- 'data_transfer_methods': ['shm'],
- 'client_test': False,
- 'cmd_args': 'GLenumTextureTarget target, GLint level, '
- 'GLintTextureInternalFormat internalformat, '
- 'GLsizei width, GLsizei height, '
- 'GLintTextureBorder border, '
- 'GLenumTextureFormat format, GLenumPixelType type, '
- 'const void* pixels, '
- 'uint32_t async_upload_token, '
- 'void* sync_data',
- 'extension': True,
- 'chromium': True,
- 'trace_level': 2,
- },
- 'AsyncTexSubImage2DCHROMIUM': {
- 'type': 'Manual',
- 'data_transfer_methods': ['shm'],
- 'client_test': False,
- 'cmd_args': 'GLenumTextureTarget target, GLint level, '
- 'GLint xoffset, GLint yoffset, '
- 'GLsizei width, GLsizei height, '
- 'GLenumTextureFormat format, GLenumPixelType type, '
- 'const void* data, '
- 'uint32_t async_upload_token, '
- 'void* sync_data',
- 'extension': True,
- 'chromium': True,
- 'trace_level': 2,
- },
- 'WaitAsyncTexImage2DCHROMIUM': {
- 'type': 'Manual',
- 'client_test': False,
- 'extension': True,
+ 'extension': 'CHROMIUM_trace_marker',
'chromium': True,
- 'trace_level': 1,
- },
- 'WaitAllAsyncTexImage2DCHROMIUM': {
- 'type': 'Manual',
- 'client_test': False,
- 'extension': True,
- 'chromium': True,
- 'trace_level': 1,
},
'DiscardFramebufferEXT': {
'type': 'PUTn',
@@ -3920,13 +4065,14 @@ _FUNCTION_INFO = {
'decoder_func': 'DoDiscardFramebufferEXT',
'unit_test': False,
'client_test': False,
+ 'extension': 'EXT_discard_framebuffer',
'extension_flag': 'ext_discard_framebuffer',
'trace_level': 2,
},
'LoseContextCHROMIUM': {
'decoder_func': 'DoLoseContextCHROMIUM',
'unit_test': False,
- 'extension': True,
+ 'extension': 'CHROMIUM_lose_context',
'chromium': True,
'trace_level': 1,
},
@@ -3956,7 +4102,7 @@ _FUNCTION_INFO = {
'impl_func': True,
'unit_test': False,
'client_test': False,
- 'extension': True,
+ 'extension': 'CHROMIUM_schedule_overlay_plane',
'chromium': True,
},
'MatrixLoadfCHROMIUM': {
@@ -3966,16 +4112,104 @@ _FUNCTION_INFO = {
'decoder_func': 'DoMatrixLoadfCHROMIUM',
'gl_test_func': 'glMatrixLoadfEXT',
'chromium': True,
- 'extension': True,
+ 'extension': 'CHROMIUM_path_rendering',
'extension_flag': 'chromium_path_rendering',
},
'MatrixLoadIdentityCHROMIUM': {
'decoder_func': 'DoMatrixLoadIdentityCHROMIUM',
'gl_test_func': 'glMatrixLoadIdentityEXT',
'chromium': True,
- 'extension': True,
+ 'extension': 'CHROMIUM_path_rendering',
+ 'extension_flag': 'chromium_path_rendering',
+ },
+ 'GenPathsCHROMIUM': {
+ 'type': 'Custom',
+ 'cmd_args': 'GLuint first_client_id, GLsizei range',
+ 'chromium': True,
+ 'extension': 'CHROMIUM_path_rendering',
+ 'extension_flag': 'chromium_path_rendering',
+ },
+ 'DeletePathsCHROMIUM': {
+ 'type': 'Custom',
+ 'cmd_args': 'GLuint first_client_id, GLsizei range',
+ 'impl_func': False,
+ 'unit_test': False,
+ 'chromium': True,
+ 'extension': 'CHROMIUM_path_rendering',
+ 'extension_flag': 'chromium_path_rendering',
+ },
+ 'IsPathCHROMIUM': {
+ 'type': 'Is',
+ 'decoder_func': 'DoIsPathCHROMIUM',
+ 'gl_test_func': 'glIsPathNV',
+ 'chromium': True,
+ 'extension': 'CHROMIUM_path_rendering',
+ 'extension_flag': 'chromium_path_rendering',
+ },
+ 'PathCommandsCHROMIUM': {
+ 'type': 'Manual',
+ 'immediate': False,
+ 'chromium': True,
+ 'extension': 'CHROMIUM_path_rendering',
+ 'extension_flag': 'chromium_path_rendering',
+ },
+ 'PathParameterfCHROMIUM': {
+ 'type': 'Custom',
+ 'chromium': True,
+ 'extension': 'CHROMIUM_path_rendering',
+ 'extension_flag': 'chromium_path_rendering',
+ },
+ 'PathParameteriCHROMIUM': {
+ 'type': 'Custom',
+ 'chromium': True,
+ 'extension': 'CHROMIUM_path_rendering',
+ 'extension_flag': 'chromium_path_rendering',
+ },
+ 'PathStencilFuncCHROMIUM': {
+ 'type': 'StateSet',
+ 'state': 'PathStencilFuncCHROMIUM',
+ 'decoder_func': 'glPathStencilFuncNV',
+ 'chromium': True,
+ 'extension': 'CHROMIUM_path_rendering',
+ 'extension_flag': 'chromium_path_rendering',
+ },
+ 'StencilFillPathCHROMIUM': {
+ 'type': 'Custom',
+ 'chromium': True,
+ 'extension': 'CHROMIUM_path_rendering',
+ 'extension_flag': 'chromium_path_rendering',
+ },
+ 'StencilStrokePathCHROMIUM': {
+ 'type': 'Custom',
+ 'chromium': True,
+ 'extension': 'CHROMIUM_path_rendering',
+ 'extension_flag': 'chromium_path_rendering',
+ },
+ 'CoverFillPathCHROMIUM': {
+ 'type': 'Custom',
+ 'chromium': True,
+ 'extension': 'CHROMIUM_path_rendering',
+ 'extension_flag': 'chromium_path_rendering',
+ },
+ 'CoverStrokePathCHROMIUM': {
+ 'type': 'Custom',
+ 'chromium': True,
+ 'extension': 'CHROMIUM_path_rendering',
'extension_flag': 'chromium_path_rendering',
},
+ 'StencilThenCoverFillPathCHROMIUM': {
+ 'type': 'Custom',
+ 'chromium': True,
+ 'extension': 'CHROMIUM_path_rendering',
+ 'extension_flag': 'chromium_path_rendering',
+ },
+ 'StencilThenCoverStrokePathCHROMIUM': {
+ 'type': 'Custom',
+ 'chromium': True,
+ 'extension': 'CHROMIUM_path_rendering',
+ 'extension_flag': 'chromium_path_rendering',
+ },
+
}
@@ -4052,74 +4286,67 @@ def GetGLGetTypeConversion(result_type, value_type, value):
return 'static_cast<GLint>(round(%s))' % value
return 'static_cast<%s>(%s)' % (result_type, value)
+
class CWriter(object):
- """Writes to a file formatting it for Google's style guidelines."""
+ """Context manager that creates a C source file.
+ To be used with the `with` statement. Returns a normal `file` type, open only
+ for writing - any existing files with that name will be overwritten. It will
+ automatically write the contents of `_LICENSE` and `_DO_NOT_EDIT_WARNING`
+ at the beginning.
+
+ Example:
+ with CWriter("file.cpp") as myfile:
+ myfile.write("hello")
+ # type(myfile) == file
+ """
def __init__(self, filename):
self.filename = filename
- self.content = []
-
- def Write(self, string):
- """Writes a string to a file spliting if it's > 80 characters."""
- lines = string.splitlines()
- num_lines = len(lines)
- for ii in range(0, num_lines):
- self.content.append(lines[ii])
- if ii < (num_lines - 1) or string[-1] == '\n':
- self.content.append('\n')
-
- def Close(self):
- """Close the file."""
- content = "".join(self.content)
- write_file = True
- if os.path.exists(self.filename):
- old_file = open(self.filename, "rb");
- old_content = old_file.read()
- old_file.close();
- if content == old_content:
- write_file = False
- if write_file:
- file = open(self.filename, "wb")
- file.write(content)
- file.close()
+ self._file = open(filename, 'w')
+ self._ENTER_MSG = _LICENSE + _DO_NOT_EDIT_WARNING
+ self._EXIT_MSG = ""
+ def __enter__(self):
+ self._file.write(self._ENTER_MSG)
+ return self._file
-class CHeaderWriter(CWriter):
- """Writes a C Header file."""
+ def __exit__(self, exc_type, exc_value, traceback):
+ self._file.write(self._EXIT_MSG)
+ self._file.close()
- _non_alnum_re = re.compile(r'[^a-zA-Z0-9]')
- def __init__(self, filename, file_comment = None):
- CWriter.__init__(self, filename)
+class CHeaderWriter(CWriter):
+ """Context manager that creates a C header file.
- base = os.path.abspath(filename)
+ Works the same way as CWriter, except it will also add the #ifdef guard
+ around it. If `file_comment` is set, it will write that before the #ifdef
+ guard.
+ """
+ def __init__(self, filename, file_comment=None):
+ super(CHeaderWriter, self).__init__(filename)
+ guard = self._get_guard()
+ if file_comment is None:
+ file_comment = ""
+ self._ENTER_MSG = self._ENTER_MSG + file_comment \
+ + "#ifndef %s\n#define %s\n\n" % (guard, guard)
+ self._EXIT_MSG = self._EXIT_MSG + "#endif // %s\n" % guard
+
+ def _get_guard(self):
+ non_alnum_re = re.compile(r'[^a-zA-Z0-9]')
+ base = os.path.abspath(self.filename)
while os.path.basename(base) != 'src':
new_base = os.path.dirname(base)
assert new_base != base # Prevent infinite loop.
base = new_base
+ hpath = os.path.relpath(self.filename, base)
+ return non_alnum_re.sub('_', hpath).upper() + '_'
- hpath = os.path.relpath(filename, base)
- self.guard = self._non_alnum_re.sub('_', hpath).upper() + '_'
-
- self.Write(_LICENSE)
- self.Write(_DO_NOT_EDIT_WARNING)
- if not file_comment == None:
- self.Write(file_comment)
- self.Write("#ifndef %s\n" % self.guard)
- self.Write("#define %s\n\n" % self.guard)
-
- def Close(self):
- self.Write("#endif // %s\n\n" % self.guard)
- CWriter.Close(self)
class TypeHandler(object):
"""This class emits code for a particular type of function."""
_remove_expected_call_re = re.compile(r' EXPECT_CALL.*?;\n', re.S)
- def __init__(self):
- pass
-
def InitFunction(self, func):
"""Add or adjust anything type specific for this function."""
if func.GetInfo('needs_size') and not func.name.endswith('Bucket'):
@@ -4129,57 +4356,57 @@ class TypeHandler(object):
"""Overriden from TypeHandler."""
return func.num_pointer_args >= 1
- def WriteStruct(self, func, file):
+ def WriteStruct(self, func, f):
"""Writes a structure that matches the arguments to a function."""
comment = func.GetInfo('cmd_comment')
if not comment == None:
- file.Write(comment)
- file.Write("struct %s {\n" % func.name)
- file.Write(" typedef %s ValueType;\n" % func.name)
- file.Write(" static const CommandId kCmdId = k%s;\n" % func.name)
- func.WriteCmdArgFlag(file)
- func.WriteCmdFlag(file)
- file.Write("\n")
+ f.write(comment)
+ f.write("struct %s {\n" % func.name)
+ f.write(" typedef %s ValueType;\n" % func.name)
+ f.write(" static const CommandId kCmdId = k%s;\n" % func.name)
+ func.WriteCmdArgFlag(f)
+ func.WriteCmdFlag(f)
+ f.write("\n")
result = func.GetInfo('result')
if not result == None:
if len(result) == 1:
- file.Write(" typedef %s Result;\n\n" % result[0])
+ f.write(" typedef %s Result;\n\n" % result[0])
else:
- file.Write(" struct Result {\n")
+ f.write(" struct Result {\n")
for line in result:
- file.Write(" %s;\n" % line)
- file.Write(" };\n\n")
+ f.write(" %s;\n" % line)
+ f.write(" };\n\n")
- func.WriteCmdComputeSize(file)
- func.WriteCmdSetHeader(file)
- func.WriteCmdInit(file)
- func.WriteCmdSet(file)
+ func.WriteCmdComputeSize(f)
+ func.WriteCmdSetHeader(f)
+ func.WriteCmdInit(f)
+ func.WriteCmdSet(f)
- file.Write(" gpu::CommandHeader header;\n")
+ f.write(" gpu::CommandHeader header;\n")
args = func.GetCmdArgs()
for arg in args:
- file.Write(" %s %s;\n" % (arg.cmd_type, arg.name))
+ f.write(" %s %s;\n" % (arg.cmd_type, arg.name))
consts = func.GetCmdConstants()
for const in consts:
- file.Write(" static const %s %s = %s;\n" %
+ f.write(" static const %s %s = %s;\n" %
(const.cmd_type, const.name, const.GetConstantValue()))
- file.Write("};\n")
- file.Write("\n")
+ f.write("};\n")
+ f.write("\n")
size = len(args) * _SIZE_OF_UINT32 + _SIZE_OF_COMMAND_HEADER
- file.Write("static_assert(sizeof(%s) == %d,\n" % (func.name, size))
- file.Write(" \"size of %s should be %d\");\n" %
+ f.write("static_assert(sizeof(%s) == %d,\n" % (func.name, size))
+ f.write(" \"size of %s should be %d\");\n" %
(func.name, size))
- file.Write("static_assert(offsetof(%s, header) == 0,\n" % func.name)
- file.Write(" \"offset of %s header should be 0\");\n" %
+ f.write("static_assert(offsetof(%s, header) == 0,\n" % func.name)
+ f.write(" \"offset of %s header should be 0\");\n" %
func.name)
offset = _SIZE_OF_COMMAND_HEADER
for arg in args:
- file.Write("static_assert(offsetof(%s, %s) == %d,\n" %
+ f.write("static_assert(offsetof(%s, %s) == %d,\n" %
(func.name, arg.name, offset))
- file.Write(" \"offset of %s %s should be %d\");\n" %
+ f.write(" \"offset of %s %s should be %d\");\n" %
(func.name, arg.name, offset))
offset += _SIZE_OF_UINT32
if not result == None and len(result) > 1:
@@ -4192,15 +4419,15 @@ static_assert(offsetof(%(cmd_name)s::Result, %(field_name)s) == %(offset)d,
"offset of %(cmd_name)s Result %(field_name)s should be "
"%(offset)d");
"""
- file.Write((check.strip() + "\n") % {
+ f.write((check.strip() + "\n") % {
'cmd_name': func.name,
'field_name': name,
'offset': offset,
})
offset += _SIZE_OF_UINT32
- file.Write("\n")
+ f.write("\n")
- def WriteHandlerImplementation(self, func, file):
+ def WriteHandlerImplementation(self, func, f):
"""Writes the handler implementation for this command."""
if func.IsUnsafe() and func.GetInfo('id_mapping'):
code_no_gen = """ if (!group_->Get%(type)sServiceId(
@@ -4226,15 +4453,24 @@ static_assert(offsetof(%(cmd_name)s::Result, %(field_name)s) == %(offset)d,
service_var = id_type.lower()
if id_type == 'Sync':
service_var = "service_%s" % service_var
- file.Write(" GLsync %s = 0;\n" % service_var)
+ f.write(" GLsync %s = 0;\n" % service_var)
+ if id_type == 'Sampler' and func.IsType('Bind'):
+ # No error generated when binding a reserved zero sampler.
+ args = [arg.name for arg in func.GetOriginalArgs()]
+ f.write(""" if(%(var)s == 0) {
+ %(func)s(%(args)s);
+ return error::kNoError;
+ }""" % { 'var': id_type.lower(),
+ 'func': func.GetGLFunctionName(),
+ 'args': ", ".join(args) })
if gen_func and id_type in gen_func:
- file.Write(code_gen % { 'type': id_type,
+ f.write(code_gen % { 'type': id_type,
'var': id_type.lower(),
'service_var': service_var,
'func': func.GetGLFunctionName(),
'gen_func': gen_func })
else:
- file.Write(code_no_gen % { 'type': id_type,
+ f.write(code_no_gen % { 'type': id_type,
'var': id_type.lower(),
'service_var': service_var,
'func': func.GetGLFunctionName() })
@@ -4248,157 +4484,148 @@ static_assert(offsetof(%(cmd_name)s::Result, %(field_name)s) == %(offset)d,
args.append("nullptr")
else:
args.append(arg.name)
- file.Write(" %s(%s);\n" %
+ f.write(" %s(%s);\n" %
(func.GetGLFunctionName(), ", ".join(args)))
- def WriteCmdSizeTest(self, func, file):
+ def WriteCmdSizeTest(self, func, f):
"""Writes the size test for a command."""
- file.Write(" EXPECT_EQ(sizeof(cmd), cmd.header.size * 4u);\n")
+ f.write(" EXPECT_EQ(sizeof(cmd), cmd.header.size * 4u);\n")
- def WriteFormatTest(self, func, file):
+ def WriteFormatTest(self, func, f):
"""Writes a format test for a command."""
- file.Write("TEST_F(GLES2FormatTest, %s) {\n" % func.name)
- file.Write(" cmds::%s& cmd = *GetBufferAs<cmds::%s>();\n" %
+ f.write("TEST_F(GLES2FormatTest, %s) {\n" % func.name)
+ f.write(" cmds::%s& cmd = *GetBufferAs<cmds::%s>();\n" %
(func.name, func.name))
- file.Write(" void* next_cmd = cmd.Set(\n")
- file.Write(" &cmd")
+ f.write(" void* next_cmd = cmd.Set(\n")
+ f.write(" &cmd")
args = func.GetCmdArgs()
for value, arg in enumerate(args):
- file.Write(",\n static_cast<%s>(%d)" % (arg.type, value + 11))
- file.Write(");\n")
- file.Write(" EXPECT_EQ(static_cast<uint32_t>(cmds::%s::kCmdId),\n" %
+ f.write(",\n static_cast<%s>(%d)" % (arg.type, value + 11))
+ f.write(");\n")
+ f.write(" EXPECT_EQ(static_cast<uint32_t>(cmds::%s::kCmdId),\n" %
func.name)
- file.Write(" cmd.header.command);\n")
- func.type_handler.WriteCmdSizeTest(func, file)
+ f.write(" cmd.header.command);\n")
+ func.type_handler.WriteCmdSizeTest(func, f)
for value, arg in enumerate(args):
- file.Write(" EXPECT_EQ(static_cast<%s>(%d), cmd.%s);\n" %
+ f.write(" EXPECT_EQ(static_cast<%s>(%d), cmd.%s);\n" %
(arg.type, value + 11, arg.name))
- file.Write(" CheckBytesWrittenMatchesExpectedSize(\n")
- file.Write(" next_cmd, sizeof(cmd));\n")
- file.Write("}\n")
- file.Write("\n")
+ f.write(" CheckBytesWrittenMatchesExpectedSize(\n")
+ f.write(" next_cmd, sizeof(cmd));\n")
+ f.write("}\n")
+ f.write("\n")
- def WriteImmediateFormatTest(self, func, file):
+ def WriteImmediateFormatTest(self, func, f):
"""Writes a format test for an immediate version of a command."""
pass
- def WriteBucketFormatTest(self, func, file):
- """Writes a format test for a bucket version of a command."""
- pass
-
- def WriteGetDataSizeCode(self, func, file):
+ def WriteGetDataSizeCode(self, func, f):
"""Writes the code to set data_size used in validation"""
pass
- def WriteImmediateCmdSizeTest(self, func, file):
- """Writes a size test for an immediate version of a command."""
- file.Write(" // TODO(gman): Compute correct size.\n")
- file.Write(" EXPECT_EQ(sizeof(cmd), cmd.header.size * 4u);\n")
-
- def __WriteIdMapping(self, func, file):
+ def __WriteIdMapping(self, func, f):
"""Writes client side / service side ID mapping."""
if not func.IsUnsafe() or not func.GetInfo('id_mapping'):
return
for id_type in func.GetInfo('id_mapping'):
- file.Write(" group_->Get%sServiceId(%s, &%s);\n" %
+ f.write(" group_->Get%sServiceId(%s, &%s);\n" %
(id_type, id_type.lower(), id_type.lower()))
- def WriteImmediateHandlerImplementation (self, func, file):
+ def WriteImmediateHandlerImplementation (self, func, f):
"""Writes the handler impl for the immediate version of a command."""
- self.__WriteIdMapping(func, file)
- file.Write(" %s(%s);\n" %
+ self.__WriteIdMapping(func, f)
+ f.write(" %s(%s);\n" %
(func.GetGLFunctionName(), func.MakeOriginalArgString("")))
- def WriteBucketHandlerImplementation (self, func, file):
+ def WriteBucketHandlerImplementation (self, func, f):
"""Writes the handler impl for the bucket version of a command."""
- self.__WriteIdMapping(func, file)
- file.Write(" %s(%s);\n" %
+ self.__WriteIdMapping(func, f)
+ f.write(" %s(%s);\n" %
(func.GetGLFunctionName(), func.MakeOriginalArgString("")))
- def WriteServiceHandlerFunctionHeader(self, func, file):
+ def WriteServiceHandlerFunctionHeader(self, func, f):
"""Writes function header for service implementation handlers."""
- file.Write("""error::Error GLES2DecoderImpl::Handle%(name)s(
+ f.write("""error::Error GLES2DecoderImpl::Handle%(name)s(
uint32_t immediate_data_size, const void* cmd_data) {
""" % {'name': func.name})
if func.IsUnsafe():
- file.Write("""if (!unsafe_es3_apis_enabled())
+ f.write("""if (!unsafe_es3_apis_enabled())
return error::kUnknownCommand;
""")
- file.Write("""const gles2::cmds::%(name)s& c =
+ f.write("""const gles2::cmds::%(name)s& c =
*static_cast<const gles2::cmds::%(name)s*>(cmd_data);
(void)c;
""" % {'name': func.name})
- def WriteServiceImplementation(self, func, file):
+ def WriteServiceImplementation(self, func, f):
"""Writes the service implementation for a command."""
- self.WriteServiceHandlerFunctionHeader(func, file)
- self.WriteHandlerExtensionCheck(func, file)
- self.WriteHandlerDeferReadWrite(func, file);
+ self.WriteServiceHandlerFunctionHeader(func, f)
+ self.WriteHandlerExtensionCheck(func, f)
+ self.WriteHandlerDeferReadWrite(func, f);
if len(func.GetOriginalArgs()) > 0:
last_arg = func.GetLastOriginalArg()
all_but_last_arg = func.GetOriginalArgs()[:-1]
for arg in all_but_last_arg:
- arg.WriteGetCode(file)
- self.WriteGetDataSizeCode(func, file)
- last_arg.WriteGetCode(file)
- func.WriteHandlerValidation(file)
- func.WriteHandlerImplementation(file)
- file.Write(" return error::kNoError;\n")
- file.Write("}\n")
- file.Write("\n")
-
- def WriteImmediateServiceImplementation(self, func, file):
+ arg.WriteGetCode(f)
+ self.WriteGetDataSizeCode(func, f)
+ last_arg.WriteGetCode(f)
+ func.WriteHandlerValidation(f)
+ func.WriteHandlerImplementation(f)
+ f.write(" return error::kNoError;\n")
+ f.write("}\n")
+ f.write("\n")
+
+ def WriteImmediateServiceImplementation(self, func, f):
"""Writes the service implementation for an immediate version of command."""
- self.WriteServiceHandlerFunctionHeader(func, file)
- self.WriteHandlerExtensionCheck(func, file)
- self.WriteHandlerDeferReadWrite(func, file);
+ self.WriteServiceHandlerFunctionHeader(func, f)
+ self.WriteHandlerExtensionCheck(func, f)
+ self.WriteHandlerDeferReadWrite(func, f);
for arg in func.GetOriginalArgs():
if arg.IsPointer():
- self.WriteGetDataSizeCode(func, file)
- arg.WriteGetCode(file)
- func.WriteHandlerValidation(file)
- func.WriteHandlerImplementation(file)
- file.Write(" return error::kNoError;\n")
- file.Write("}\n")
- file.Write("\n")
-
- def WriteBucketServiceImplementation(self, func, file):
+ self.WriteGetDataSizeCode(func, f)
+ arg.WriteGetCode(f)
+ func.WriteHandlerValidation(f)
+ func.WriteHandlerImplementation(f)
+ f.write(" return error::kNoError;\n")
+ f.write("}\n")
+ f.write("\n")
+
+ def WriteBucketServiceImplementation(self, func, f):
"""Writes the service implementation for a bucket version of command."""
- self.WriteServiceHandlerFunctionHeader(func, file)
- self.WriteHandlerExtensionCheck(func, file)
- self.WriteHandlerDeferReadWrite(func, file);
+ self.WriteServiceHandlerFunctionHeader(func, f)
+ self.WriteHandlerExtensionCheck(func, f)
+ self.WriteHandlerDeferReadWrite(func, f);
for arg in func.GetCmdArgs():
- arg.WriteGetCode(file)
- func.WriteHandlerValidation(file)
- func.WriteHandlerImplementation(file)
- file.Write(" return error::kNoError;\n")
- file.Write("}\n")
- file.Write("\n")
-
- def WriteHandlerExtensionCheck(self, func, file):
+ arg.WriteGetCode(f)
+ func.WriteHandlerValidation(f)
+ func.WriteHandlerImplementation(f)
+ f.write(" return error::kNoError;\n")
+ f.write("}\n")
+ f.write("\n")
+
+ def WriteHandlerExtensionCheck(self, func, f):
if func.GetInfo('extension_flag'):
- file.Write(" if (!features().%s) {\n" % func.GetInfo('extension_flag'))
- file.Write(" LOCAL_SET_GL_ERROR(GL_INVALID_OPERATION, \"gl%s\","
+ f.write(" if (!features().%s) {\n" % func.GetInfo('extension_flag'))
+ f.write(" LOCAL_SET_GL_ERROR(GL_INVALID_OPERATION, \"gl%s\","
" \"function not available\");\n" % func.original_name)
- file.Write(" return error::kNoError;")
- file.Write(" }\n\n")
+ f.write(" return error::kNoError;")
+ f.write(" }\n\n")
- def WriteHandlerDeferReadWrite(self, func, file):
+ def WriteHandlerDeferReadWrite(self, func, f):
"""Writes the code to handle deferring reads or writes."""
defer_draws = func.GetInfo('defer_draws')
defer_reads = func.GetInfo('defer_reads')
if defer_draws or defer_reads:
- file.Write(" error::Error error;\n")
+ f.write(" error::Error error;\n")
if defer_draws:
- file.Write(" error = WillAccessBoundFramebufferForDraw();\n")
- file.Write(" if (error != error::kNoError)\n")
- file.Write(" return error;\n")
+ f.write(" error = WillAccessBoundFramebufferForDraw();\n")
+ f.write(" if (error != error::kNoError)\n")
+ f.write(" return error;\n")
if defer_reads:
- file.Write(" error = WillAccessBoundFramebufferForRead();\n")
- file.Write(" if (error != error::kNoError)\n")
- file.Write(" return error;\n")
+ f.write(" error = WillAccessBoundFramebufferForRead();\n")
+ f.write(" if (error != error::kNoError)\n")
+ f.write(" return error;\n")
- def WriteValidUnitTest(self, func, file, test, *extras):
+ def WriteValidUnitTest(self, func, f, test, *extras):
"""Writes a valid unit test for the service implementation."""
if func.GetInfo('expectation') == False:
test = self._remove_expected_call_re.sub('', test)
@@ -4424,9 +4651,9 @@ static_assert(offsetof(%(cmd_name)s::Result, %(field_name)s) == %(offset)d,
while (old_test != test):
old_test = test
test = test % vars
- file.Write(test % vars)
+ f.write(test % vars)
- def WriteInvalidUnitTest(self, func, file, test, *extras):
+ def WriteInvalidUnitTest(self, func, f, test, *extras):
"""Writes an invalid unit test for the service implementation."""
if func.IsUnsafe():
return
@@ -4471,9 +4698,9 @@ static_assert(offsetof(%(cmd_name)s::Result, %(field_name)s) == %(offset)d,
}
for extra in extras:
vars.update(extra)
- file.Write(test % vars)
+ f.write(test % vars)
- def WriteServiceUnitTest(self, func, file, *extras):
+ def WriteServiceUnitTest(self, func, f, *extras):
"""Writes the service unit test for a command."""
if func.name == 'Enable':
@@ -4512,7 +4739,7 @@ TEST_P(%(test_name)s, %(name)sValidArgs) {
EXPECT_EQ(GL_NO_ERROR, GetGLError());
}
"""
- self.WriteValidUnitTest(func, file, valid_test, *extras)
+ self.WriteValidUnitTest(func, f, valid_test, *extras)
if not func.IsUnsafe():
invalid_test = """
@@ -4524,89 +4751,85 @@ TEST_P(%(test_name)s, %(name)sInvalidArgs%(arg_index)d_%(value_index)d) {
EXPECT_EQ(error::%(parse_result)s, ExecuteCmd(cmd));%(gl_error_test)s
}
"""
- self.WriteInvalidUnitTest(func, file, invalid_test, *extras)
+ self.WriteInvalidUnitTest(func, f, invalid_test, *extras)
- def WriteImmediateServiceUnitTest(self, func, file, *extras):
+ def WriteImmediateServiceUnitTest(self, func, f, *extras):
"""Writes the service unit test for an immediate command."""
- file.Write("// TODO(gman): %s\n" % func.name)
+ f.write("// TODO(gman): %s\n" % func.name)
- def WriteImmediateValidationCode(self, func, file):
+ def WriteImmediateValidationCode(self, func, f):
"""Writes the validation code for an immediate version of a command."""
pass
- def WriteBucketServiceUnitTest(self, func, file, *extras):
+ def WriteBucketServiceUnitTest(self, func, f, *extras):
"""Writes the service unit test for a bucket command."""
- file.Write("// TODO(gman): %s\n" % func.name)
-
- def WriteBucketValidationCode(self, func, file):
- """Writes the validation code for a bucket version of a command."""
- file.Write("// TODO(gman): %s\n" % func.name)
+ f.write("// TODO(gman): %s\n" % func.name)
- def WriteGLES2ImplementationDeclaration(self, func, file):
+ def WriteGLES2ImplementationDeclaration(self, func, f):
"""Writes the GLES2 Implemention declaration."""
impl_decl = func.GetInfo('impl_decl')
if impl_decl == None or impl_decl == True:
- file.Write("%s %s(%s) override;\n" %
+ f.write("%s %s(%s) override;\n" %
(func.return_type, func.original_name,
func.MakeTypedOriginalArgString("")))
- file.Write("\n")
+ f.write("\n")
- def WriteGLES2CLibImplementation(self, func, file):
- file.Write("%s GLES2%s(%s) {\n" %
+ def WriteGLES2CLibImplementation(self, func, f):
+ f.write("%s GL_APIENTRY GLES2%s(%s) {\n" %
(func.return_type, func.name,
func.MakeTypedOriginalArgString("")))
result_string = "return "
if func.return_type == "void":
result_string = ""
- file.Write(" %sgles2::GetGLContext()->%s(%s);\n" %
+ f.write(" %sgles2::GetGLContext()->%s(%s);\n" %
(result_string, func.original_name,
func.MakeOriginalArgString("")))
- file.Write("}\n")
+ f.write("}\n")
- def WriteGLES2Header(self, func, file):
+ def WriteGLES2Header(self, func, f):
"""Writes a re-write macro for GLES"""
- file.Write("#define gl%s GLES2_GET_FUN(%s)\n" %(func.name, func.name))
+ f.write("#define gl%s GLES2_GET_FUN(%s)\n" %(func.name, func.name))
- def WriteClientGLCallLog(self, func, file):
+ def WriteClientGLCallLog(self, func, f):
"""Writes a logging macro for the client side code."""
comma = ""
if len(func.GetOriginalArgs()):
comma = " << "
- file.Write(
+ f.write(
' GPU_CLIENT_LOG("[" << GetLogPrefix() << "] gl%s("%s%s << ")");\n' %
(func.original_name, comma, func.MakeLogArgString()))
- def WriteClientGLReturnLog(self, func, file):
+ def WriteClientGLReturnLog(self, func, f):
"""Writes the return value logging code."""
if func.return_type != "void":
- file.Write(' GPU_CLIENT_LOG("return:" << result)\n')
+ f.write(' GPU_CLIENT_LOG("return:" << result)\n')
- def WriteGLES2ImplementationHeader(self, func, file):
+ def WriteGLES2ImplementationHeader(self, func, f):
"""Writes the GLES2 Implemention."""
- self.WriteGLES2ImplementationDeclaration(func, file)
+ self.WriteGLES2ImplementationDeclaration(func, f)
- def WriteGLES2TraceImplementationHeader(self, func, file):
+ def WriteGLES2TraceImplementationHeader(self, func, f):
"""Writes the GLES2 Trace Implemention header."""
- file.Write("%s %s(%s) override;\n" %
+ f.write("%s %s(%s) override;\n" %
(func.return_type, func.original_name,
func.MakeTypedOriginalArgString("")))
- def WriteGLES2TraceImplementation(self, func, file):
+ def WriteGLES2TraceImplementation(self, func, f):
"""Writes the GLES2 Trace Implemention."""
- file.Write("%s GLES2TraceImplementation::%s(%s) {\n" %
+ f.write("%s GLES2TraceImplementation::%s(%s) {\n" %
(func.return_type, func.original_name,
func.MakeTypedOriginalArgString("")))
result_string = "return "
if func.return_type == "void":
result_string = ""
- file.Write(' TRACE_EVENT_BINARY_EFFICIENT0("gpu", "GLES2Trace::%s");\n' %
+ f.write(' TRACE_EVENT_BINARY_EFFICIENT0("gpu", "GLES2Trace::%s");\n' %
func.name)
- file.Write(" %sgl_->%s(%s);\n" %
+ f.write(" %sgl_->%s(%s);\n" %
(result_string, func.name, func.MakeOriginalArgString("")))
- file.Write("}\n")
- file.Write("\n")
+ f.write("}\n")
+ f.write("\n")
- def WriteGLES2Implementation(self, func, file):
+ def WriteGLES2Implementation(self, func, f):
"""Writes the GLES2 Implemention."""
impl_func = func.GetInfo('impl_func')
impl_decl = func.GetInfo('impl_decl')
@@ -4615,76 +4838,74 @@ TEST_P(%(test_name)s, %(name)sInvalidArgs%(arg_index)d_%(value_index)d) {
(impl_func == None or impl_func == True) and
(impl_decl == None or impl_decl == True) and
(gen_cmd == None or gen_cmd == True)):
- file.Write("%s GLES2Implementation::%s(%s) {\n" %
+ f.write("%s GLES2Implementation::%s(%s) {\n" %
(func.return_type, func.original_name,
func.MakeTypedOriginalArgString("")))
- file.Write(" GPU_CLIENT_SINGLE_THREAD_CHECK();\n")
- self.WriteClientGLCallLog(func, file)
- func.WriteDestinationInitalizationValidation(file)
+ f.write(" GPU_CLIENT_SINGLE_THREAD_CHECK();\n")
+ self.WriteClientGLCallLog(func, f)
+ func.WriteDestinationInitalizationValidation(f)
for arg in func.GetOriginalArgs():
- arg.WriteClientSideValidationCode(file, func)
- file.Write(" helper_->%s(%s);\n" %
+ arg.WriteClientSideValidationCode(f, func)
+ f.write(" helper_->%s(%s);\n" %
(func.name, func.MakeHelperArgString("")))
- file.Write(" CheckGLError();\n")
- self.WriteClientGLReturnLog(func, file)
- file.Write("}\n")
- file.Write("\n")
+ f.write(" CheckGLError();\n")
+ self.WriteClientGLReturnLog(func, f)
+ f.write("}\n")
+ f.write("\n")
- def WriteGLES2InterfaceHeader(self, func, file):
+ def WriteGLES2InterfaceHeader(self, func, f):
"""Writes the GLES2 Interface."""
- file.Write("virtual %s %s(%s) = 0;\n" %
+ f.write("virtual %s %s(%s) = 0;\n" %
(func.return_type, func.original_name,
func.MakeTypedOriginalArgString("")))
- def WriteMojoGLES2ImplHeader(self, func, file):
+ def WriteMojoGLES2ImplHeader(self, func, f):
"""Writes the Mojo GLES2 implementation header."""
- file.Write("%s %s(%s) override;\n" %
+ f.write("%s %s(%s) override;\n" %
(func.return_type, func.original_name,
func.MakeTypedOriginalArgString("")))
- def WriteMojoGLES2Impl(self, func, file):
+ def WriteMojoGLES2Impl(self, func, f):
"""Writes the Mojo GLES2 implementation."""
- file.Write("%s MojoGLES2Impl::%s(%s) {\n" %
+ f.write("%s MojoGLES2Impl::%s(%s) {\n" %
(func.return_type, func.original_name,
func.MakeTypedOriginalArgString("")))
- extensions = ["CHROMIUM_sync_point", "CHROMIUM_texture_mailbox",
- "CHROMIUM_sub_image", "CHROMIUM_miscellaneous",
- "occlusion_query_EXT", "CHROMIUM_image",
- "CHROMIUM_copy_texture",
- "CHROMIUM_pixel_transfer_buffer_object"]
- if func.IsCoreGLFunction() or func.GetInfo("extension") in extensions:
- file.Write("MojoGLES2MakeCurrent(context_);");
+ is_core_gl_func = func.IsCoreGLFunction()
+ is_ext = bool(func.GetInfo("extension"))
+ is_safe = not func.IsUnsafe()
+ if is_core_gl_func or (is_safe and is_ext):
+ f.write("MojoGLES2MakeCurrent(context_);");
func_return = "gl" + func.original_name + "(" + \
func.MakeOriginalArgString("") + ");"
if func.return_type == "void":
- file.Write(func_return);
+ f.write(func_return);
else:
- file.Write("return " + func_return);
+ f.write("return " + func_return);
else:
- file.Write("NOTREACHED() << \"Unimplemented %s.\";\n" %
+ f.write("NOTREACHED() << \"Unimplemented %s.\";\n" %
func.original_name);
if func.return_type != "void":
- file.Write("return 0;")
- file.Write("}")
+ f.write("return 0;")
+ f.write("}")
- def WriteGLES2InterfaceStub(self, func, file):
+ def WriteGLES2InterfaceStub(self, func, f):
"""Writes the GLES2 Interface stub declaration."""
- file.Write("%s %s(%s) override;\n" %
+ f.write("%s %s(%s) override;\n" %
(func.return_type, func.original_name,
func.MakeTypedOriginalArgString("")))
- def WriteGLES2InterfaceStubImpl(self, func, file):
+ def WriteGLES2InterfaceStubImpl(self, func, f):
"""Writes the GLES2 Interface stub declaration."""
args = func.GetOriginalArgs()
arg_string = ", ".join(
["%s /* %s */" % (arg.type, arg.name) for arg in args])
- file.Write("%s GLES2InterfaceStub::%s(%s) {\n" %
+ f.write("%s GLES2InterfaceStub::%s(%s) {\n" %
(func.return_type, func.original_name, arg_string))
if func.return_type != "void":
- file.Write(" return 0;\n")
- file.Write("}\n")
+ f.write(" return 0;\n")
+ f.write("}\n")
- def WriteGLES2ImplementationUnitTest(self, func, file):
+ def WriteGLES2ImplementationUnitTest(self, func, f):
"""Writes the GLES2 Implemention unit test."""
client_test = func.GetInfo('client_test')
if (func.can_auto_generate and
@@ -4709,7 +4930,7 @@ TEST_F(GLES2ImplementationTest, %(name)s) {
arg.GetValidClientSideArg(func) for arg in func.GetOriginalArgs()
]
- file.Write(code % {
+ f.write(code % {
'name': func.name,
'args': ", ".join(gl_arg_strings),
'cmd_args': ", ".join(cmd_arg_strings),
@@ -4735,7 +4956,7 @@ TEST_F(GLES2ImplementationTest, %(name)sInvalidConstantArg%(invalid_index)d) {
else:
gl_arg_strings.append(arg.GetValidClientSideArg(func))
- file.Write(code % {
+ f.write(code % {
'name': func.name,
'invalid_index': func.GetOriginalArgs().index(invalid_arg),
'args': ", ".join(gl_arg_strings),
@@ -4743,42 +4964,42 @@ TEST_F(GLES2ImplementationTest, %(name)sInvalidConstantArg%(invalid_index)d) {
})
else:
if client_test != False:
- file.Write("// TODO(zmo): Implement unit test for %s\n" % func.name)
+ f.write("// TODO(zmo): Implement unit test for %s\n" % func.name)
- def WriteDestinationInitalizationValidation(self, func, file):
+ def WriteDestinationInitalizationValidation(self, func, f):
"""Writes the client side destintion initialization validation."""
for arg in func.GetOriginalArgs():
- arg.WriteDestinationInitalizationValidation(file, func)
+ arg.WriteDestinationInitalizationValidation(f, func)
- def WriteTraceEvent(self, func, file):
- file.Write(' TRACE_EVENT0("gpu", "GLES2Implementation::%s");\n' %
+ def WriteTraceEvent(self, func, f):
+ f.write(' TRACE_EVENT0("gpu", "GLES2Implementation::%s");\n' %
func.original_name)
- def WriteImmediateCmdComputeSize(self, func, file):
+ def WriteImmediateCmdComputeSize(self, func, f):
"""Writes the size computation code for the immediate version of a cmd."""
- file.Write(" static uint32_t ComputeSize(uint32_t size_in_bytes) {\n")
- file.Write(" return static_cast<uint32_t>(\n")
- file.Write(" sizeof(ValueType) + // NOLINT\n")
- file.Write(" RoundSizeToMultipleOfEntries(size_in_bytes));\n")
- file.Write(" }\n")
- file.Write("\n")
-
- def WriteImmediateCmdSetHeader(self, func, file):
+ f.write(" static uint32_t ComputeSize(uint32_t size_in_bytes) {\n")
+ f.write(" return static_cast<uint32_t>(\n")
+ f.write(" sizeof(ValueType) + // NOLINT\n")
+ f.write(" RoundSizeToMultipleOfEntries(size_in_bytes));\n")
+ f.write(" }\n")
+ f.write("\n")
+
+ def WriteImmediateCmdSetHeader(self, func, f):
"""Writes the SetHeader function for the immediate version of a cmd."""
- file.Write(" void SetHeader(uint32_t size_in_bytes) {\n")
- file.Write(" header.SetCmdByTotalSize<ValueType>(size_in_bytes);\n")
- file.Write(" }\n")
- file.Write("\n")
+ f.write(" void SetHeader(uint32_t size_in_bytes) {\n")
+ f.write(" header.SetCmdByTotalSize<ValueType>(size_in_bytes);\n")
+ f.write(" }\n")
+ f.write("\n")
- def WriteImmediateCmdInit(self, func, file):
+ def WriteImmediateCmdInit(self, func, f):
"""Writes the Init function for the immediate version of a command."""
raise NotImplementedError(func.name)
- def WriteImmediateCmdSet(self, func, file):
+ def WriteImmediateCmdSet(self, func, f):
"""Writes the Set function for the immediate version of a command."""
raise NotImplementedError(func.name)
- def WriteCmdHelper(self, func, file):
+ def WriteCmdHelper(self, func, f):
"""Writes the cmd helper definition for a cmd."""
code = """ void %(name)s(%(typed_args)s) {
gles2::cmds::%(name)s* c = GetCmdSpace<gles2::cmds::%(name)s>();
@@ -4788,13 +5009,13 @@ TEST_F(GLES2ImplementationTest, %(name)sInvalidConstantArg%(invalid_index)d) {
}
"""
- file.Write(code % {
+ f.write(code % {
"name": func.name,
"typed_args": func.MakeTypedCmdArgString(""),
"args": func.MakeCmdArgString(""),
})
- def WriteImmediateCmdHelper(self, func, file):
+ def WriteImmediateCmdHelper(self, func, f):
"""Writes the cmd helper definition for the immediate version of a cmd."""
code = """ void %(name)s(%(typed_args)s) {
const uint32_t s = 0; // TODO(gman): compute correct size
@@ -4806,7 +5027,7 @@ TEST_F(GLES2ImplementationTest, %(name)sInvalidConstantArg%(invalid_index)d) {
}
"""
- file.Write(code % {
+ f.write(code % {
"name": func.name,
"typed_args": func.MakeTypedCmdArgString(""),
"args": func.MakeCmdArgString(""),
@@ -4816,10 +5037,7 @@ TEST_F(GLES2ImplementationTest, %(name)sInvalidConstantArg%(invalid_index)d) {
class StateSetHandler(TypeHandler):
"""Handler for commands that simply set state."""
- def __init__(self):
- TypeHandler.__init__(self)
-
- def WriteHandlerImplementation(self, func, file):
+ def WriteHandlerImplementation(self, func, f):
"""Overrriden from TypeHandler."""
state_name = func.GetInfo('state')
state = _STATES[state_name]
@@ -4839,33 +5057,33 @@ class StateSetHandler(TypeHandler):
# letting the GL driver generate it.
code.append("std::isnan(%s)" % args[ndx].name)
if len(code):
- file.Write(" if (%s) {\n" % " ||\n ".join(code))
- file.Write(
+ f.write(" if (%s) {\n" % " ||\n ".join(code))
+ f.write(
' LOCAL_SET_GL_ERROR(GL_INVALID_VALUE,'
' "%s", "%s out of range");\n' %
(func.name, args[ndx].name))
- file.Write(" return error::kNoError;\n")
- file.Write(" }\n")
+ f.write(" return error::kNoError;\n")
+ f.write(" }\n")
code = []
for ndx,item in enumerate(states):
code.append("state_.%s != %s" % (item['name'], args[ndx].name))
- file.Write(" if (%s) {\n" % " ||\n ".join(code))
+ f.write(" if (%s) {\n" % " ||\n ".join(code))
for ndx,item in enumerate(states):
- file.Write(" state_.%s = %s;\n" % (item['name'], args[ndx].name))
+ f.write(" state_.%s = %s;\n" % (item['name'], args[ndx].name))
if 'state_flag' in state:
- file.Write(" %s = true;\n" % state['state_flag'])
+ f.write(" %s = true;\n" % state['state_flag'])
if not func.GetInfo("no_gl"):
for ndx,item in enumerate(states):
if item.get('cached', False):
- file.Write(" state_.%s = %s;\n" %
+ f.write(" state_.%s = %s;\n" %
(CachedStateName(item), args[ndx].name))
- file.Write(" %s(%s);\n" %
+ f.write(" %s(%s);\n" %
(func.GetGLFunctionName(), func.MakeOriginalArgString("")))
- file.Write(" }\n")
+ f.write(" }\n")
- def WriteServiceUnitTest(self, func, file, *extras):
+ def WriteServiceUnitTest(self, func, f, *extras):
"""Overrriden from TypeHandler."""
- TypeHandler.WriteServiceUnitTest(self, func, file, *extras)
+ TypeHandler.WriteServiceUnitTest(self, func, f, *extras)
state_name = func.GetInfo('state')
state = _STATES[state_name]
states = state['states']
@@ -4896,7 +5114,7 @@ TEST_P(%(test_name)s, %(name)sInvalidValue%(ndx)d_%(check_ndx)d) {
}
for extra in extras:
vars.update(extra)
- file.Write(valid_test % vars)
+ f.write(valid_test % vars)
if 'nan_check' in item:
valid_test = """
TEST_P(%(test_name)s, %(name)sNaNValue%(ndx)d) {
@@ -4921,16 +5139,13 @@ TEST_P(%(test_name)s, %(name)sNaNValue%(ndx)d) {
}
for extra in extras:
vars.update(extra)
- file.Write(valid_test % vars)
+ f.write(valid_test % vars)
class StateSetRGBAlphaHandler(TypeHandler):
"""Handler for commands that simply set state that have rgb/alpha."""
- def __init__(self):
- TypeHandler.__init__(self)
-
- def WriteHandlerImplementation(self, func, file):
+ def WriteHandlerImplementation(self, func, f):
"""Overrriden from TypeHandler."""
state_name = func.GetInfo('state')
state = _STATES[state_name]
@@ -4940,25 +5155,22 @@ class StateSetRGBAlphaHandler(TypeHandler):
code = []
for ndx,item in enumerate(states):
code.append("state_.%s != %s" % (item['name'], args[ndx % num_args].name))
- file.Write(" if (%s) {\n" % " ||\n ".join(code))
+ f.write(" if (%s) {\n" % " ||\n ".join(code))
for ndx, item in enumerate(states):
- file.Write(" state_.%s = %s;\n" %
+ f.write(" state_.%s = %s;\n" %
(item['name'], args[ndx % num_args].name))
if 'state_flag' in state:
- file.Write(" %s = true;\n" % state['state_flag'])
+ f.write(" %s = true;\n" % state['state_flag'])
if not func.GetInfo("no_gl"):
- file.Write(" %s(%s);\n" %
+ f.write(" %s(%s);\n" %
(func.GetGLFunctionName(), func.MakeOriginalArgString("")))
- file.Write(" }\n")
+ f.write(" }\n")
class StateSetFrontBackSeparateHandler(TypeHandler):
"""Handler for commands that simply set state that have front/back."""
- def __init__(self):
- TypeHandler.__init__(self)
-
- def WriteHandlerImplementation(self, func, file):
+ def WriteHandlerImplementation(self, func, f):
"""Overrriden from TypeHandler."""
state_name = func.GetInfo('state')
state = _STATES[state_name]
@@ -4966,38 +5178,35 @@ class StateSetFrontBackSeparateHandler(TypeHandler):
args = func.GetOriginalArgs()
face = args[0].name
num_args = len(args)
- file.Write(" bool changed = false;\n")
+ f.write(" bool changed = false;\n")
for group_ndx, group in enumerate(Grouper(num_args - 1, states)):
- file.Write(" if (%s == %s || %s == GL_FRONT_AND_BACK) {\n" %
+ f.write(" if (%s == %s || %s == GL_FRONT_AND_BACK) {\n" %
(face, ('GL_FRONT', 'GL_BACK')[group_ndx], face))
code = []
for ndx, item in enumerate(group):
code.append("state_.%s != %s" % (item['name'], args[ndx + 1].name))
- file.Write(" changed |= %s;\n" % " ||\n ".join(code))
- file.Write(" }\n")
- file.Write(" if (changed) {\n")
+ f.write(" changed |= %s;\n" % " ||\n ".join(code))
+ f.write(" }\n")
+ f.write(" if (changed) {\n")
for group_ndx, group in enumerate(Grouper(num_args - 1, states)):
- file.Write(" if (%s == %s || %s == GL_FRONT_AND_BACK) {\n" %
+ f.write(" if (%s == %s || %s == GL_FRONT_AND_BACK) {\n" %
(face, ('GL_FRONT', 'GL_BACK')[group_ndx], face))
for ndx, item in enumerate(group):
- file.Write(" state_.%s = %s;\n" %
+ f.write(" state_.%s = %s;\n" %
(item['name'], args[ndx + 1].name))
- file.Write(" }\n")
+ f.write(" }\n")
if 'state_flag' in state:
- file.Write(" %s = true;\n" % state['state_flag'])
+ f.write(" %s = true;\n" % state['state_flag'])
if not func.GetInfo("no_gl"):
- file.Write(" %s(%s);\n" %
+ f.write(" %s(%s);\n" %
(func.GetGLFunctionName(), func.MakeOriginalArgString("")))
- file.Write(" }\n")
+ f.write(" }\n")
class StateSetFrontBackHandler(TypeHandler):
"""Handler for commands that simply set state that set both front/back."""
- def __init__(self):
- TypeHandler.__init__(self)
-
- def WriteHandlerImplementation(self, func, file):
+ def WriteHandlerImplementation(self, func, f):
"""Overrriden from TypeHandler."""
state_name = func.GetInfo('state')
state = _STATES[state_name]
@@ -5008,25 +5217,22 @@ class StateSetFrontBackHandler(TypeHandler):
for group_ndx, group in enumerate(Grouper(num_args, states)):
for ndx, item in enumerate(group):
code.append("state_.%s != %s" % (item['name'], args[ndx].name))
- file.Write(" if (%s) {\n" % " ||\n ".join(code))
+ f.write(" if (%s) {\n" % " ||\n ".join(code))
for group_ndx, group in enumerate(Grouper(num_args, states)):
for ndx, item in enumerate(group):
- file.Write(" state_.%s = %s;\n" % (item['name'], args[ndx].name))
+ f.write(" state_.%s = %s;\n" % (item['name'], args[ndx].name))
if 'state_flag' in state:
- file.Write(" %s = true;\n" % state['state_flag'])
+ f.write(" %s = true;\n" % state['state_flag'])
if not func.GetInfo("no_gl"):
- file.Write(" %s(%s);\n" %
+ f.write(" %s(%s);\n" %
(func.GetGLFunctionName(), func.MakeOriginalArgString("")))
- file.Write(" }\n")
+ f.write(" }\n")
class StateSetNamedParameter(TypeHandler):
"""Handler for commands that set a state chosen with an enum parameter."""
- def __init__(self):
- TypeHandler.__init__(self)
-
- def WriteHandlerImplementation(self, func, file):
+ def WriteHandlerImplementation(self, func, f):
"""Overridden from TypeHandler."""
state_name = func.GetInfo('state')
state = _STATES[state_name]
@@ -5034,118 +5240,72 @@ class StateSetNamedParameter(TypeHandler):
args = func.GetOriginalArgs()
num_args = len(args)
assert num_args == 2
- file.Write(" switch (%s) {\n" % args[0].name)
+ f.write(" switch (%s) {\n" % args[0].name)
for state in states:
- file.Write(" case %s:\n" % state['enum'])
- file.Write(" if (state_.%s != %s) {\n" %
+ f.write(" case %s:\n" % state['enum'])
+ f.write(" if (state_.%s != %s) {\n" %
(state['name'], args[1].name))
- file.Write(" state_.%s = %s;\n" % (state['name'], args[1].name))
+ f.write(" state_.%s = %s;\n" % (state['name'], args[1].name))
if not func.GetInfo("no_gl"):
- file.Write(" %s(%s);\n" %
+ f.write(" %s(%s);\n" %
(func.GetGLFunctionName(), func.MakeOriginalArgString("")))
- file.Write(" }\n")
- file.Write(" break;\n")
- file.Write(" default:\n")
- file.Write(" NOTREACHED();\n")
- file.Write(" }\n")
+ f.write(" }\n")
+ f.write(" break;\n")
+ f.write(" default:\n")
+ f.write(" NOTREACHED();\n")
+ f.write(" }\n")
class CustomHandler(TypeHandler):
"""Handler for commands that are auto-generated but require minor tweaks."""
- def __init__(self):
- TypeHandler.__init__(self)
-
- def WriteServiceImplementation(self, func, file):
+ def WriteServiceImplementation(self, func, f):
"""Overrriden from TypeHandler."""
pass
- def WriteImmediateServiceImplementation(self, func, file):
+ def WriteImmediateServiceImplementation(self, func, f):
"""Overrriden from TypeHandler."""
pass
- def WriteBucketServiceImplementation(self, func, file):
+ def WriteBucketServiceImplementation(self, func, f):
"""Overrriden from TypeHandler."""
pass
- def WriteServiceUnitTest(self, func, file, *extras):
+ def WriteServiceUnitTest(self, func, f, *extras):
"""Overrriden from TypeHandler."""
- file.Write("// TODO(gman): %s\n\n" % func.name)
+ f.write("// TODO(gman): %s\n\n" % func.name)
- def WriteImmediateServiceUnitTest(self, func, file, *extras):
+ def WriteImmediateServiceUnitTest(self, func, f, *extras):
"""Overrriden from TypeHandler."""
- file.Write("// TODO(gman): %s\n\n" % func.name)
+ f.write("// TODO(gman): %s\n\n" % func.name)
- def WriteImmediateCmdGetTotalSize(self, func, file):
+ def WriteImmediateCmdGetTotalSize(self, func, f):
"""Overrriden from TypeHandler."""
- file.Write(
+ f.write(
" uint32_t total_size = 0; // TODO(gman): get correct size.\n")
- def WriteImmediateCmdInit(self, func, file):
+ def WriteImmediateCmdInit(self, func, f):
"""Overrriden from TypeHandler."""
- file.Write(" void Init(%s) {\n" % func.MakeTypedCmdArgString("_"))
- self.WriteImmediateCmdGetTotalSize(func, file)
- file.Write(" SetHeader(total_size);\n")
+ f.write(" void Init(%s) {\n" % func.MakeTypedCmdArgString("_"))
+ self.WriteImmediateCmdGetTotalSize(func, f)
+ f.write(" SetHeader(total_size);\n")
args = func.GetCmdArgs()
for arg in args:
- file.Write(" %s = _%s;\n" % (arg.name, arg.name))
- file.Write(" }\n")
- file.Write("\n")
+ f.write(" %s = _%s;\n" % (arg.name, arg.name))
+ f.write(" }\n")
+ f.write("\n")
- def WriteImmediateCmdSet(self, func, file):
+ def WriteImmediateCmdSet(self, func, f):
"""Overrriden from TypeHandler."""
copy_args = func.MakeCmdArgString("_", False)
- file.Write(" void* Set(void* cmd%s) {\n" %
+ f.write(" void* Set(void* cmd%s) {\n" %
func.MakeTypedCmdArgString("_", True))
- self.WriteImmediateCmdGetTotalSize(func, file)
- file.Write(" static_cast<ValueType*>(cmd)->Init(%s);\n" % copy_args)
- file.Write(" return NextImmediateCmdAddressTotalSize<ValueType>("
+ self.WriteImmediateCmdGetTotalSize(func, f)
+ f.write(" static_cast<ValueType*>(cmd)->Init(%s);\n" % copy_args)
+ f.write(" return NextImmediateCmdAddressTotalSize<ValueType>("
"cmd, total_size);\n")
- file.Write(" }\n")
- file.Write("\n")
-
-
-class TodoHandler(CustomHandler):
- """Handle for commands that are not yet implemented."""
-
- def NeedsDataTransferFunction(self, func):
- """Overriden from TypeHandler."""
- return False
-
- def WriteImmediateFormatTest(self, func, file):
- """Overrriden from TypeHandler."""
- pass
-
- def WriteGLES2ImplementationUnitTest(self, func, file):
- """Overrriden from TypeHandler."""
- pass
-
- def WriteGLES2Implementation(self, func, file):
- """Overrriden from TypeHandler."""
- file.Write("%s GLES2Implementation::%s(%s) {\n" %
- (func.return_type, func.original_name,
- func.MakeTypedOriginalArgString("")))
- file.Write(" // TODO: for now this is a no-op\n")
- file.Write(
- " SetGLError("
- "GL_INVALID_OPERATION, \"gl%s\", \"not implemented\");\n" %
- func.name)
- if func.return_type != "void":
- file.Write(" return 0;\n")
- file.Write("}\n")
- file.Write("\n")
-
- def WriteServiceImplementation(self, func, file):
- """Overrriden from TypeHandler."""
- self.WriteServiceHandlerFunctionHeader(func, file)
- file.Write(" // TODO: for now this is a no-op\n")
- file.Write(
- " LOCAL_SET_GL_ERROR("
- "GL_INVALID_OPERATION, \"gl%s\", \"not implemented\");\n" %
- func.name)
- file.Write(" return error::kNoError;\n")
- file.Write("}\n")
- file.Write("\n")
+ f.write(" }\n")
+ f.write("\n")
class HandWrittenHandler(CustomHandler):
@@ -5163,66 +5323,58 @@ class HandWrittenHandler(CustomHandler):
return True
return False
- def WriteStruct(self, func, file):
+ def WriteStruct(self, func, f):
"""Overrriden from TypeHandler."""
pass
- def WriteDocs(self, func, file):
+ def WriteDocs(self, func, f):
"""Overrriden from TypeHandler."""
pass
- def WriteServiceUnitTest(self, func, file, *extras):
+ def WriteServiceUnitTest(self, func, f, *extras):
"""Overrriden from TypeHandler."""
- file.Write("// TODO(gman): %s\n\n" % func.name)
+ f.write("// TODO(gman): %s\n\n" % func.name)
- def WriteImmediateServiceUnitTest(self, func, file, *extras):
+ def WriteImmediateServiceUnitTest(self, func, f, *extras):
"""Overrriden from TypeHandler."""
- file.Write("// TODO(gman): %s\n\n" % func.name)
+ f.write("// TODO(gman): %s\n\n" % func.name)
- def WriteBucketServiceUnitTest(self, func, file, *extras):
+ def WriteBucketServiceUnitTest(self, func, f, *extras):
"""Overrriden from TypeHandler."""
- file.Write("// TODO(gman): %s\n\n" % func.name)
+ f.write("// TODO(gman): %s\n\n" % func.name)
- def WriteServiceImplementation(self, func, file):
+ def WriteServiceImplementation(self, func, f):
"""Overrriden from TypeHandler."""
pass
- def WriteImmediateServiceImplementation(self, func, file):
+ def WriteImmediateServiceImplementation(self, func, f):
"""Overrriden from TypeHandler."""
pass
- def WriteBucketServiceImplementation(self, func, file):
+ def WriteBucketServiceImplementation(self, func, f):
"""Overrriden from TypeHandler."""
pass
- def WriteImmediateCmdHelper(self, func, file):
+ def WriteImmediateCmdHelper(self, func, f):
"""Overrriden from TypeHandler."""
pass
- def WriteCmdHelper(self, func, file):
+ def WriteCmdHelper(self, func, f):
"""Overrriden from TypeHandler."""
pass
- def WriteFormatTest(self, func, file):
- """Overrriden from TypeHandler."""
- file.Write("// TODO(gman): Write test for %s\n" % func.name)
-
- def WriteImmediateFormatTest(self, func, file):
+ def WriteFormatTest(self, func, f):
"""Overrriden from TypeHandler."""
- file.Write("// TODO(gman): Write test for %s\n" % func.name)
+ f.write("// TODO(gman): Write test for %s\n" % func.name)
- def WriteBucketFormatTest(self, func, file):
+ def WriteImmediateFormatTest(self, func, f):
"""Overrriden from TypeHandler."""
- file.Write("// TODO(gman): Write test for %s\n" % func.name)
-
+ f.write("// TODO(gman): Write test for %s\n" % func.name)
class ManualHandler(CustomHandler):
"""Handler for commands who's handlers must be written by hand."""
- def __init__(self):
- CustomHandler.__init__(self)
-
def InitFunction(self, func):
"""Overrriden from TypeHandler."""
if (func.name == 'CompressedTexImage2DBucket' or
@@ -5232,53 +5384,51 @@ class ManualHandler(CustomHandler):
else:
CustomHandler.InitFunction(self, func)
- def WriteServiceImplementation(self, func, file):
+ def WriteServiceImplementation(self, func, f):
"""Overrriden from TypeHandler."""
pass
- def WriteBucketServiceImplementation(self, func, file):
+ def WriteBucketServiceImplementation(self, func, f):
"""Overrriden from TypeHandler."""
pass
- def WriteServiceUnitTest(self, func, file, *extras):
+ def WriteServiceUnitTest(self, func, f, *extras):
"""Overrriden from TypeHandler."""
- file.Write("// TODO(gman): %s\n\n" % func.name)
+ f.write("// TODO(gman): %s\n\n" % func.name)
- def WriteImmediateServiceUnitTest(self, func, file, *extras):
+ def WriteImmediateServiceUnitTest(self, func, f, *extras):
"""Overrriden from TypeHandler."""
- file.Write("// TODO(gman): %s\n\n" % func.name)
+ f.write("// TODO(gman): %s\n\n" % func.name)
- def WriteImmediateServiceImplementation(self, func, file):
+ def WriteImmediateServiceImplementation(self, func, f):
"""Overrriden from TypeHandler."""
pass
- def WriteImmediateFormatTest(self, func, file):
+ def WriteImmediateFormatTest(self, func, f):
"""Overrriden from TypeHandler."""
- file.Write("// TODO(gman): Implement test for %s\n" % func.name)
+ f.write("// TODO(gman): Implement test for %s\n" % func.name)
- def WriteGLES2Implementation(self, func, file):
+ def WriteGLES2Implementation(self, func, f):
"""Overrriden from TypeHandler."""
if func.GetInfo('impl_func'):
- super(ManualHandler, self).WriteGLES2Implementation(func, file)
+ super(ManualHandler, self).WriteGLES2Implementation(func, f)
- def WriteGLES2ImplementationHeader(self, func, file):
+ def WriteGLES2ImplementationHeader(self, func, f):
"""Overrriden from TypeHandler."""
- file.Write("%s %s(%s) override;\n" %
+ f.write("%s %s(%s) override;\n" %
(func.return_type, func.original_name,
func.MakeTypedOriginalArgString("")))
- file.Write("\n")
+ f.write("\n")
- def WriteImmediateCmdGetTotalSize(self, func, file):
+ def WriteImmediateCmdGetTotalSize(self, func, f):
"""Overrriden from TypeHandler."""
# TODO(gman): Move this data to _FUNCTION_INFO?
- CustomHandler.WriteImmediateCmdGetTotalSize(self, func, file)
+ CustomHandler.WriteImmediateCmdGetTotalSize(self, func, f)
class DataHandler(TypeHandler):
"""Handler for glBufferData, glBufferSubData, glTexImage*D, glTexSubImage*D,
glCompressedTexImage*D, glCompressedTexImageSub*D."""
- def __init__(self):
- TypeHandler.__init__(self)
def InitFunction(self, func):
"""Overrriden from TypeHandler."""
@@ -5287,24 +5437,24 @@ class DataHandler(TypeHandler):
func.cmd_args = func.cmd_args[:-1]
func.AddCmdArg(Argument('bucket_id', 'GLuint'))
- def WriteGetDataSizeCode(self, func, file):
+ def WriteGetDataSizeCode(self, func, f):
"""Overrriden from TypeHandler."""
# TODO(gman): Move this data to _FUNCTION_INFO?
name = func.name
if name.endswith("Immediate"):
name = name[0:-9]
if name == 'BufferData' or name == 'BufferSubData':
- file.Write(" uint32_t data_size = size;\n")
+ f.write(" uint32_t data_size = size;\n")
elif (name == 'CompressedTexImage2D' or
name == 'CompressedTexSubImage2D' or
name == 'CompressedTexImage3D' or
name == 'CompressedTexSubImage3D'):
- file.Write(" uint32_t data_size = imageSize;\n")
+ f.write(" uint32_t data_size = imageSize;\n")
elif (name == 'CompressedTexSubImage2DBucket' or
name == 'CompressedTexSubImage3DBucket'):
- file.Write(" Bucket* bucket = GetBucket(c.bucket_id);\n")
- file.Write(" uint32_t data_size = bucket->size();\n")
- file.Write(" GLsizei imageSize = data_size;\n")
+ f.write(" Bucket* bucket = GetBucket(c.bucket_id);\n")
+ f.write(" uint32_t data_size = bucket->size();\n")
+ f.write(" GLsizei imageSize = data_size;\n")
elif name == 'TexImage2D' or name == 'TexSubImage2D':
code = """ uint32_t data_size;
if (!GLES2Util::ComputeImageDataSize(
@@ -5312,70 +5462,63 @@ class DataHandler(TypeHandler):
return error::kOutOfBounds;
}
"""
- file.Write(code)
+ f.write(code)
else:
- file.Write(
+ f.write(
"// uint32_t data_size = 0; // TODO(gman): get correct size!\n")
- def WriteImmediateCmdGetTotalSize(self, func, file):
+ def WriteImmediateCmdGetTotalSize(self, func, f):
"""Overrriden from TypeHandler."""
pass
- def WriteImmediateCmdSizeTest(self, func, file):
+ def WriteImmediateCmdInit(self, func, f):
"""Overrriden from TypeHandler."""
- file.Write(" EXPECT_EQ(sizeof(cmd), total_size);\n")
-
- def WriteImmediateCmdInit(self, func, file):
- """Overrriden from TypeHandler."""
- file.Write(" void Init(%s) {\n" % func.MakeTypedCmdArgString("_"))
- self.WriteImmediateCmdGetTotalSize(func, file)
- file.Write(" SetHeader(total_size);\n")
+ f.write(" void Init(%s) {\n" % func.MakeTypedCmdArgString("_"))
+ self.WriteImmediateCmdGetTotalSize(func, f)
+ f.write(" SetHeader(total_size);\n")
args = func.GetCmdArgs()
for arg in args:
- file.Write(" %s = _%s;\n" % (arg.name, arg.name))
- file.Write(" }\n")
- file.Write("\n")
+ f.write(" %s = _%s;\n" % (arg.name, arg.name))
+ f.write(" }\n")
+ f.write("\n")
- def WriteImmediateCmdSet(self, func, file):
+ def WriteImmediateCmdSet(self, func, f):
"""Overrriden from TypeHandler."""
copy_args = func.MakeCmdArgString("_", False)
- file.Write(" void* Set(void* cmd%s) {\n" %
+ f.write(" void* Set(void* cmd%s) {\n" %
func.MakeTypedCmdArgString("_", True))
- self.WriteImmediateCmdGetTotalSize(func, file)
- file.Write(" static_cast<ValueType*>(cmd)->Init(%s);\n" % copy_args)
- file.Write(" return NextImmediateCmdAddressTotalSize<ValueType>("
+ self.WriteImmediateCmdGetTotalSize(func, f)
+ f.write(" static_cast<ValueType*>(cmd)->Init(%s);\n" % copy_args)
+ f.write(" return NextImmediateCmdAddressTotalSize<ValueType>("
"cmd, total_size);\n")
- file.Write(" }\n")
- file.Write("\n")
+ f.write(" }\n")
+ f.write("\n")
- def WriteImmediateFormatTest(self, func, file):
+ def WriteImmediateFormatTest(self, func, f):
"""Overrriden from TypeHandler."""
# TODO(gman): Remove this exception.
- file.Write("// TODO(gman): Implement test for %s\n" % func.name)
+ f.write("// TODO(gman): Implement test for %s\n" % func.name)
return
- def WriteServiceUnitTest(self, func, file, *extras):
+ def WriteServiceUnitTest(self, func, f, *extras):
"""Overrriden from TypeHandler."""
- file.Write("// TODO(gman): %s\n\n" % func.name)
+ f.write("// TODO(gman): %s\n\n" % func.name)
- def WriteImmediateServiceUnitTest(self, func, file, *extras):
+ def WriteImmediateServiceUnitTest(self, func, f, *extras):
"""Overrriden from TypeHandler."""
- file.Write("// TODO(gman): %s\n\n" % func.name)
+ f.write("// TODO(gman): %s\n\n" % func.name)
- def WriteBucketServiceImplementation(self, func, file):
+ def WriteBucketServiceImplementation(self, func, f):
"""Overrriden from TypeHandler."""
if ((not func.name == 'CompressedTexSubImage2DBucket') and
(not func.name == 'CompressedTexSubImage3DBucket')):
- TypeHandler.WriteBucketServiceImplemenation(self, func, file)
+ TypeHandler.WriteBucketServiceImplemenation(self, func, f)
class BindHandler(TypeHandler):
"""Handler for glBind___ type functions."""
- def __init__(self):
- TypeHandler.__init__(self)
-
- def WriteServiceUnitTest(self, func, file, *extras):
+ def WriteServiceUnitTest(self, func, f, *extras):
"""Overrriden from TypeHandler."""
if len(func.GetOriginalArgs()) == 1:
@@ -5414,7 +5557,7 @@ TEST_P(%(test_name)s, %(name)sValidArgsNewId) {
EXPECT_TRUE(Get%(resource_type)s(kNewClientId) != NULL);
}
"""
- self.WriteValidUnitTest(func, file, valid_test, {
+ self.WriteValidUnitTest(func, f, valid_test, {
'resource_type': func.GetOriginalArgs()[0].resource_type,
'gl_gen_func_name': func.GetInfo("gen_func"),
}, *extras)
@@ -5477,7 +5620,7 @@ TEST_P(%(test_name)s, %(name)sValidArgsNewId) {
else:
gl_args_with_new_id.append(arg.GetValidGLArg(func))
args_with_new_id.append(arg.GetValidArg(func))
- self.WriteValidUnitTest(func, file, valid_test, {
+ self.WriteValidUnitTest(func, f, valid_test, {
'args_with_new_id': ", ".join(args_with_new_id),
'gl_args_with_new_id': ", ".join(gl_args_with_new_id),
'resource_type': func.GetResourceIdArg().resource_type,
@@ -5493,9 +5636,9 @@ TEST_P(%(test_name)s, %(name)sInvalidArgs%(arg_index)d_%(value_index)d) {
EXPECT_EQ(error::%(parse_result)s, ExecuteCmd(cmd));%(gl_error_test)s
}
"""
- self.WriteInvalidUnitTest(func, file, invalid_test, *extras)
+ self.WriteInvalidUnitTest(func, f, invalid_test, *extras)
- def WriteGLES2Implementation(self, func, file):
+ def WriteGLES2Implementation(self, func, f):
"""Writes the GLES2 Implemention."""
impl_func = func.GetInfo('impl_func')
@@ -5505,14 +5648,14 @@ TEST_P(%(test_name)s, %(name)sInvalidArgs%(arg_index)d_%(value_index)d) {
(impl_func == None or impl_func == True) and
(impl_decl == None or impl_decl == True)):
- file.Write("%s GLES2Implementation::%s(%s) {\n" %
+ f.write("%s GLES2Implementation::%s(%s) {\n" %
(func.return_type, func.original_name,
func.MakeTypedOriginalArgString("")))
- file.Write(" GPU_CLIENT_SINGLE_THREAD_CHECK();\n")
- func.WriteDestinationInitalizationValidation(file)
- self.WriteClientGLCallLog(func, file)
+ f.write(" GPU_CLIENT_SINGLE_THREAD_CHECK();\n")
+ func.WriteDestinationInitalizationValidation(f)
+ self.WriteClientGLCallLog(func, f)
for arg in func.GetOriginalArgs():
- arg.WriteClientSideValidationCode(file, func)
+ arg.WriteClientSideValidationCode(f, func)
code = """ if (Is%(type)sReservedId(%(id)s)) {
SetGLError(GL_INVALID_OPERATION, "%(name)s\", \"%(id)s reserved id");
@@ -5524,7 +5667,7 @@ TEST_P(%(test_name)s, %(name)sInvalidArgs%(arg_index)d_%(value_index)d) {
"""
name_arg = func.GetResourceIdArg()
- file.Write(code % {
+ f.write(code % {
'name': func.name,
'arg_string': func.MakeOriginalArgString(""),
'id': name_arg.name,
@@ -5532,7 +5675,7 @@ TEST_P(%(test_name)s, %(name)sInvalidArgs%(arg_index)d_%(value_index)d) {
'lc_type': name_arg.resource_type.lower(),
})
- def WriteGLES2ImplementationUnitTest(self, func, file):
+ def WriteGLES2ImplementationUnitTest(self, func, f):
"""Overrriden from TypeHandler."""
client_test = func.GetInfo('client_test')
if client_test == False:
@@ -5562,7 +5705,7 @@ TEST_F(GLES2ImplementationTest, %(name)s) {
arg.GetValidClientSideArg(func) for arg in func.GetOriginalArgs()
]
- file.Write(code % {
+ f.write(code % {
'name': func.name,
'args': ", ".join(gl_arg_strings),
'cmd_args': ", ".join(cmd_arg_strings),
@@ -5572,33 +5715,30 @@ TEST_F(GLES2ImplementationTest, %(name)s) {
class GENnHandler(TypeHandler):
"""Handler for glGen___ type functions."""
- def __init__(self):
- TypeHandler.__init__(self)
-
def InitFunction(self, func):
"""Overrriden from TypeHandler."""
pass
- def WriteGetDataSizeCode(self, func, file):
+ def WriteGetDataSizeCode(self, func, f):
"""Overrriden from TypeHandler."""
code = """ uint32_t data_size;
if (!SafeMultiplyUint32(n, sizeof(GLuint), &data_size)) {
return error::kOutOfBounds;
}
"""
- file.Write(code)
+ f.write(code)
- def WriteHandlerImplementation (self, func, file):
+ def WriteHandlerImplementation (self, func, f):
"""Overrriden from TypeHandler."""
- file.Write(" if (!%sHelper(n, %s)) {\n"
+ f.write(" if (!%sHelper(n, %s)) {\n"
" return error::kInvalidArguments;\n"
" }\n" %
(func.name, func.GetLastOriginalArg().name))
- def WriteImmediateHandlerImplementation(self, func, file):
+ def WriteImmediateHandlerImplementation(self, func, f):
"""Overrriden from TypeHandler."""
if func.IsUnsafe():
- file.Write(""" for (GLsizei ii = 0; ii < n; ++ii) {
+ f.write(""" for (GLsizei ii = 0; ii < n; ++ii) {
if (group_->Get%(resource_name)sServiceId(%(last_arg_name)s[ii], NULL)) {
return error::kInvalidArguments;
}
@@ -5612,12 +5752,12 @@ class GENnHandler(TypeHandler):
'last_arg_name': func.GetLastOriginalArg().name,
'resource_name': func.GetInfo('resource_type') })
else:
- file.Write(" if (!%sHelper(n, %s)) {\n"
+ f.write(" if (!%sHelper(n, %s)) {\n"
" return error::kInvalidArguments;\n"
" }\n" %
(func.original_name, func.GetLastOriginalArg().name))
- def WriteGLES2Implementation(self, func, file):
+ def WriteGLES2Implementation(self, func, f):
"""Overrriden from TypeHandler."""
log_code = (""" GPU_CLIENT_LOG_CODE_BLOCK({
for (GLsizei i = 0; i < n; ++i) {
@@ -5633,13 +5773,13 @@ class GENnHandler(TypeHandler):
'resource_types': func.GetInfo('resource_types'),
'count_name': func.GetOriginalArgs()[0].name,
}
- file.Write(
+ f.write(
"%(return_type)s GLES2Implementation::%(name)s(%(typed_args)s) {\n" %
args)
- func.WriteDestinationInitalizationValidation(file)
- self.WriteClientGLCallLog(func, file)
+ func.WriteDestinationInitalizationValidation(f)
+ self.WriteClientGLCallLog(func, f)
for arg in func.GetOriginalArgs():
- arg.WriteClientSideValidationCode(file, func)
+ arg.WriteClientSideValidationCode(f, func)
not_shared = func.GetInfo('not_shared')
if not_shared:
alloc_code = (
@@ -5664,9 +5804,9 @@ class GENnHandler(TypeHandler):
}
"""
- file.Write(code % args)
+ f.write(code % args)
- def WriteGLES2ImplementationUnitTest(self, func, file):
+ def WriteGLES2ImplementationUnitTest(self, func, f):
"""Overrriden from TypeHandler."""
code = """
TEST_F(GLES2ImplementationTest, %(name)s) {
@@ -5685,12 +5825,12 @@ TEST_F(GLES2ImplementationTest, %(name)s) {
EXPECT_EQ(k%(types)sStartId + 1, ids[1]);
}
"""
- file.Write(code % {
+ f.write(code % {
'name': func.name,
'types': func.GetInfo('resource_types'),
})
- def WriteServiceUnitTest(self, func, file, *extras):
+ def WriteServiceUnitTest(self, func, f, *extras):
"""Overrriden from TypeHandler."""
valid_test = """
TEST_P(%(test_name)s, %(name)sValidArgs) {
@@ -5714,7 +5854,7 @@ TEST_P(%(test_name)s, %(name)sValidArgs) {
EXPECT_TRUE(Get%(resource_name)s(kNewClientId, &service_id) != NULL);
}
"""
- self.WriteValidUnitTest(func, file, valid_test, {
+ self.WriteValidUnitTest(func, f, valid_test, {
'resource_name': func.GetInfo('resource_type'),
}, *extras)
invalid_test = """
@@ -5727,11 +5867,11 @@ TEST_P(%(test_name)s, %(name)sInvalidArgs) {
EXPECT_EQ(error::kInvalidArguments, ExecuteCmd(cmd));
}
"""
- self.WriteValidUnitTest(func, file, invalid_test, {
+ self.WriteValidUnitTest(func, f, invalid_test, {
'resource_name': func.GetInfo('resource_type').lower(),
}, *extras)
- def WriteImmediateServiceUnitTest(self, func, file, *extras):
+ def WriteImmediateServiceUnitTest(self, func, f, *extras):
"""Overrriden from TypeHandler."""
valid_test = """
TEST_P(%(test_name)s, %(name)sValidArgs) {
@@ -5763,7 +5903,7 @@ TEST_P(%(test_name)s, %(name)sValidArgs) {
EXPECT_TRUE(Get%(resource_name)s(kNewClientId) != NULL);
}
"""
- self.WriteValidUnitTest(func, file, valid_test, {
+ self.WriteValidUnitTest(func, f, valid_test, {
'resource_name': func.GetInfo('resource_type'),
}, *extras)
invalid_test = """
@@ -5786,61 +5926,61 @@ TEST_P(%(test_name)s, %(name)sInvalidArgs) {
ExecuteImmediateCmd(*cmd, sizeof(&client_%(resource_name)s_id_)));
}
"""
- self.WriteValidUnitTest(func, file, invalid_test, {
+ self.WriteValidUnitTest(func, f, invalid_test, {
'resource_name': func.GetInfo('resource_type').lower(),
}, *extras)
- def WriteImmediateCmdComputeSize(self, func, file):
+ def WriteImmediateCmdComputeSize(self, func, f):
"""Overrriden from TypeHandler."""
- file.Write(" static uint32_t ComputeDataSize(GLsizei n) {\n")
- file.Write(
+ f.write(" static uint32_t ComputeDataSize(GLsizei n) {\n")
+ f.write(
" return static_cast<uint32_t>(sizeof(GLuint) * n); // NOLINT\n")
- file.Write(" }\n")
- file.Write("\n")
- file.Write(" static uint32_t ComputeSize(GLsizei n) {\n")
- file.Write(" return static_cast<uint32_t>(\n")
- file.Write(" sizeof(ValueType) + ComputeDataSize(n)); // NOLINT\n")
- file.Write(" }\n")
- file.Write("\n")
-
- def WriteImmediateCmdSetHeader(self, func, file):
+ f.write(" }\n")
+ f.write("\n")
+ f.write(" static uint32_t ComputeSize(GLsizei n) {\n")
+ f.write(" return static_cast<uint32_t>(\n")
+ f.write(" sizeof(ValueType) + ComputeDataSize(n)); // NOLINT\n")
+ f.write(" }\n")
+ f.write("\n")
+
+ def WriteImmediateCmdSetHeader(self, func, f):
"""Overrriden from TypeHandler."""
- file.Write(" void SetHeader(GLsizei n) {\n")
- file.Write(" header.SetCmdByTotalSize<ValueType>(ComputeSize(n));\n")
- file.Write(" }\n")
- file.Write("\n")
+ f.write(" void SetHeader(GLsizei n) {\n")
+ f.write(" header.SetCmdByTotalSize<ValueType>(ComputeSize(n));\n")
+ f.write(" }\n")
+ f.write("\n")
- def WriteImmediateCmdInit(self, func, file):
+ def WriteImmediateCmdInit(self, func, f):
"""Overrriden from TypeHandler."""
last_arg = func.GetLastOriginalArg()
- file.Write(" void Init(%s, %s _%s) {\n" %
+ f.write(" void Init(%s, %s _%s) {\n" %
(func.MakeTypedCmdArgString("_"),
last_arg.type, last_arg.name))
- file.Write(" SetHeader(_n);\n")
+ f.write(" SetHeader(_n);\n")
args = func.GetCmdArgs()
for arg in args:
- file.Write(" %s = _%s;\n" % (arg.name, arg.name))
- file.Write(" memcpy(ImmediateDataAddress(this),\n")
- file.Write(" _%s, ComputeDataSize(_n));\n" % last_arg.name)
- file.Write(" }\n")
- file.Write("\n")
+ f.write(" %s = _%s;\n" % (arg.name, arg.name))
+ f.write(" memcpy(ImmediateDataAddress(this),\n")
+ f.write(" _%s, ComputeDataSize(_n));\n" % last_arg.name)
+ f.write(" }\n")
+ f.write("\n")
- def WriteImmediateCmdSet(self, func, file):
+ def WriteImmediateCmdSet(self, func, f):
"""Overrriden from TypeHandler."""
last_arg = func.GetLastOriginalArg()
copy_args = func.MakeCmdArgString("_", False)
- file.Write(" void* Set(void* cmd%s, %s _%s) {\n" %
+ f.write(" void* Set(void* cmd%s, %s _%s) {\n" %
(func.MakeTypedCmdArgString("_", True),
last_arg.type, last_arg.name))
- file.Write(" static_cast<ValueType*>(cmd)->Init(%s, _%s);\n" %
+ f.write(" static_cast<ValueType*>(cmd)->Init(%s, _%s);\n" %
(copy_args, last_arg.name))
- file.Write(" const uint32_t size = ComputeSize(_n);\n")
- file.Write(" return NextImmediateCmdAddressTotalSize<ValueType>("
+ f.write(" const uint32_t size = ComputeSize(_n);\n")
+ f.write(" return NextImmediateCmdAddressTotalSize<ValueType>("
"cmd, size);\n")
- file.Write(" }\n")
- file.Write("\n")
+ f.write(" }\n")
+ f.write("\n")
- def WriteImmediateCmdHelper(self, func, file):
+ def WriteImmediateCmdHelper(self, func, f):
"""Overrriden from TypeHandler."""
code = """ void %(name)s(%(typed_args)s) {
const uint32_t size = gles2::cmds::%(name)s::ComputeSize(n);
@@ -5852,41 +5992,39 @@ TEST_P(%(test_name)s, %(name)sInvalidArgs) {
}
"""
- file.Write(code % {
+ f.write(code % {
"name": func.name,
"typed_args": func.MakeTypedOriginalArgString(""),
"args": func.MakeOriginalArgString(""),
})
- def WriteImmediateFormatTest(self, func, file):
+ def WriteImmediateFormatTest(self, func, f):
"""Overrriden from TypeHandler."""
- file.Write("TEST_F(GLES2FormatTest, %s) {\n" % func.name)
- file.Write(" static GLuint ids[] = { 12, 23, 34, };\n")
- file.Write(" cmds::%s& cmd = *GetBufferAs<cmds::%s>();\n" %
+ f.write("TEST_F(GLES2FormatTest, %s) {\n" % func.name)
+ f.write(" static GLuint ids[] = { 12, 23, 34, };\n")
+ f.write(" cmds::%s& cmd = *GetBufferAs<cmds::%s>();\n" %
(func.name, func.name))
- file.Write(" void* next_cmd = cmd.Set(\n")
- file.Write(" &cmd, static_cast<GLsizei>(arraysize(ids)), ids);\n")
- file.Write(" EXPECT_EQ(static_cast<uint32_t>(cmds::%s::kCmdId),\n" %
+ f.write(" void* next_cmd = cmd.Set(\n")
+ f.write(" &cmd, static_cast<GLsizei>(arraysize(ids)), ids);\n")
+ f.write(" EXPECT_EQ(static_cast<uint32_t>(cmds::%s::kCmdId),\n" %
func.name)
- file.Write(" cmd.header.command);\n")
- file.Write(" EXPECT_EQ(sizeof(cmd) +\n")
- file.Write(" RoundSizeToMultipleOfEntries(cmd.n * 4u),\n")
- file.Write(" cmd.header.size * 4u);\n")
- file.Write(" EXPECT_EQ(static_cast<GLsizei>(arraysize(ids)), cmd.n);\n");
- file.Write(" CheckBytesWrittenMatchesExpectedSize(\n")
- file.Write(" next_cmd, sizeof(cmd) +\n")
- file.Write(" RoundSizeToMultipleOfEntries(arraysize(ids) * 4u));\n")
- file.Write(" // TODO(gman): Check that ids were inserted;\n")
- file.Write("}\n")
- file.Write("\n")
+ 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>(arraysize(ids)), cmd.n);\n");
+ f.write(" CheckBytesWrittenMatchesExpectedSize(\n")
+ f.write(" next_cmd, sizeof(cmd) +\n")
+ f.write(" RoundSizeToMultipleOfEntries(arraysize(ids) * 4u));\n")
+ f.write(" EXPECT_EQ(0, memcmp(ids, ImmediateDataAddress(&cmd),\n")
+ f.write(" sizeof(ids)));\n")
+ f.write("}\n")
+ f.write("\n")
class CreateHandler(TypeHandler):
"""Handler for glCreate___ type functions."""
- def __init__(self):
- TypeHandler.__init__(self)
-
def InitFunction(self, func):
"""Overrriden from TypeHandler."""
func.AddCmdArg(Argument("client_id", 'uint32_t'))
@@ -5897,7 +6035,7 @@ class CreateHandler(TypeHandler):
else:
return func.name[6:] # Create*
- def WriteServiceUnitTest(self, func, file, *extras):
+ def WriteServiceUnitTest(self, func, f, *extras):
"""Overrriden from TypeHandler."""
valid_test = """
TEST_P(%(test_name)s, %(name)sValidArgs) {
@@ -5940,7 +6078,7 @@ TEST_P(%(test_name)s, %(name)sValidArgs) {
else:
id_type_cast = ""
const_service_id = "kNewServiceId"
- self.WriteValidUnitTest(func, file, valid_test, {
+ self.WriteValidUnitTest(func, f, valid_test, {
'comma': comma,
'resource_type': self.__GetResourceType(func),
'return_type': func.return_type,
@@ -5956,11 +6094,11 @@ TEST_P(%(test_name)s, %(name)sInvalidArgs%(arg_index)d_%(value_index)d) {
EXPECT_EQ(error::kNoError, ExecuteCmd(cmd));%(gl_error_test)s
}
"""
- self.WriteInvalidUnitTest(func, file, invalid_test, {
+ self.WriteInvalidUnitTest(func, f, invalid_test, {
'comma': comma,
}, *extras)
- def WriteHandlerImplementation (self, func, file):
+ def WriteHandlerImplementation (self, func, f):
"""Overrriden from TypeHandler."""
if func.IsUnsafe():
code = """ uint32_t client_id = c.client_id;
@@ -5983,80 +6121,77 @@ TEST_P(%(test_name)s, %(name)sInvalidArgs%(arg_index)d_%(value_index)d) {
Create%(resource_name)s(client_id, service_id%(gl_args_with_comma)s);
}
"""
- file.Write(code % {
+ f.write(code % {
'resource_name': self.__GetResourceType(func),
'return_type': func.return_type,
'gl_func_name': func.GetGLFunctionName(),
'gl_args': func.MakeOriginalArgString(""),
'gl_args_with_comma': func.MakeOriginalArgString("", True) })
- def WriteGLES2Implementation(self, func, file):
+ def WriteGLES2Implementation(self, func, f):
"""Overrriden from TypeHandler."""
- file.Write("%s GLES2Implementation::%s(%s) {\n" %
+ f.write("%s GLES2Implementation::%s(%s) {\n" %
(func.return_type, func.original_name,
func.MakeTypedOriginalArgString("")))
- file.Write(" GPU_CLIENT_SINGLE_THREAD_CHECK();\n")
- func.WriteDestinationInitalizationValidation(file)
- self.WriteClientGLCallLog(func, file)
+ f.write(" GPU_CLIENT_SINGLE_THREAD_CHECK();\n")
+ func.WriteDestinationInitalizationValidation(f)
+ self.WriteClientGLCallLog(func, f)
for arg in func.GetOriginalArgs():
- arg.WriteClientSideValidationCode(file, func)
- file.Write(" GLuint client_id;\n")
+ arg.WriteClientSideValidationCode(f, func)
+ f.write(" GLuint client_id;\n")
if func.return_type == "GLsync":
- file.Write(
+ f.write(
" GetIdHandler(id_namespaces::kSyncs)->\n")
else:
- file.Write(
+ f.write(
" GetIdHandler(id_namespaces::kProgramsAndShaders)->\n")
- file.Write(" MakeIds(this, 0, 1, &client_id);\n")
- file.Write(" helper_->%s(%s);\n" %
+ f.write(" MakeIds(this, 0, 1, &client_id);\n")
+ f.write(" helper_->%s(%s);\n" %
(func.name, func.MakeCmdArgString("")))
- file.Write(' GPU_CLIENT_LOG("returned " << client_id);\n')
- file.Write(" CheckGLError();\n")
+ f.write(' GPU_CLIENT_LOG("returned " << client_id);\n')
+ f.write(" CheckGLError();\n")
if func.return_type == "GLsync":
- file.Write(" return reinterpret_cast<GLsync>(client_id);\n")
+ f.write(" return reinterpret_cast<GLsync>(client_id);\n")
else:
- file.Write(" return client_id;\n")
- file.Write("}\n")
- file.Write("\n")
+ f.write(" return client_id;\n")
+ f.write("}\n")
+ f.write("\n")
class DeleteHandler(TypeHandler):
"""Handler for glDelete___ single resource type functions."""
- def __init__(self):
- TypeHandler.__init__(self)
-
- def WriteServiceImplementation(self, func, file):
+ def WriteServiceImplementation(self, func, f):
"""Overrriden from TypeHandler."""
if func.IsUnsafe():
- TypeHandler.WriteServiceImplementation(self, func, file)
+ TypeHandler.WriteServiceImplementation(self, func, f)
# HandleDeleteShader and HandleDeleteProgram are manually written.
pass
- def WriteGLES2Implementation(self, func, file):
+ def WriteGLES2Implementation(self, func, f):
"""Overrriden from TypeHandler."""
- file.Write("%s GLES2Implementation::%s(%s) {\n" %
+ f.write("%s GLES2Implementation::%s(%s) {\n" %
(func.return_type, func.original_name,
func.MakeTypedOriginalArgString("")))
- file.Write(" GPU_CLIENT_SINGLE_THREAD_CHECK();\n")
- func.WriteDestinationInitalizationValidation(file)
- self.WriteClientGLCallLog(func, file)
+ f.write(" GPU_CLIENT_SINGLE_THREAD_CHECK();\n")
+ func.WriteDestinationInitalizationValidation(f)
+ self.WriteClientGLCallLog(func, f)
for arg in func.GetOriginalArgs():
- arg.WriteClientSideValidationCode(file, func)
- file.Write(
+ arg.WriteClientSideValidationCode(f, func)
+ f.write(
" GPU_CLIENT_DCHECK(%s != 0);\n" % func.GetOriginalArgs()[-1].name)
- file.Write(" %sHelper(%s);\n" %
+ f.write(" %sHelper(%s);\n" %
(func.original_name, func.GetOriginalArgs()[-1].name))
- file.Write(" CheckGLError();\n")
- file.Write("}\n")
- file.Write("\n")
+ f.write(" CheckGLError();\n")
+ f.write("}\n")
+ f.write("\n")
- def WriteHandlerImplementation (self, func, file):
+ def WriteHandlerImplementation (self, func, f):
"""Overrriden from TypeHandler."""
assert len(func.GetOriginalArgs()) == 1
arg = func.GetOriginalArgs()[0]
if func.IsUnsafe():
- file.Write(""" %(arg_type)s service_id = 0;
+ f.write(""" %(arg_type)s service_id = 0;
if (group_->Get%(resource_type)sServiceId(%(arg_name)s, &service_id)) {
glDelete%(resource_type)s(service_id);
group_->Remove%(resource_type)sId(%(arg_name)s);
@@ -6069,24 +6204,21 @@ class DeleteHandler(TypeHandler):
'arg_type': arg.type,
'func_name': func.original_name })
else:
- file.Write(" %sHelper(%s);\n" % (func.original_name, arg.name))
+ f.write(" %sHelper(%s);\n" % (func.original_name, arg.name))
class DELnHandler(TypeHandler):
"""Handler for glDelete___ type functions."""
- def __init__(self):
- TypeHandler.__init__(self)
-
- def WriteGetDataSizeCode(self, func, file):
+ def WriteGetDataSizeCode(self, func, f):
"""Overrriden from TypeHandler."""
code = """ uint32_t data_size;
if (!SafeMultiplyUint32(n, sizeof(GLuint), &data_size)) {
return error::kOutOfBounds;
}
"""
- file.Write(code)
+ f.write(code)
- def WriteGLES2ImplementationUnitTest(self, func, file):
+ def WriteGLES2ImplementationUnitTest(self, func, f):
"""Overrriden from TypeHandler."""
code = """
TEST_F(GLES2ImplementationTest, %(name)s) {
@@ -6103,12 +6235,12 @@ TEST_F(GLES2ImplementationTest, %(name)s) {
EXPECT_EQ(0, memcmp(&expected, commands_, sizeof(expected)));
}
"""
- file.Write(code % {
+ f.write(code % {
'name': func.name,
'types': func.GetInfo('resource_types'),
})
- def WriteServiceUnitTest(self, func, file, *extras):
+ def WriteServiceUnitTest(self, func, f, *extras):
"""Overrriden from TypeHandler."""
valid_test = """
TEST_P(%(test_name)s, %(name)sValidArgs) {
@@ -6126,7 +6258,7 @@ TEST_P(%(test_name)s, %(name)sValidArgs) {
Get%(upper_resource_name)s(client_%(resource_name)s_id_) == NULL);
}
"""
- self.WriteValidUnitTest(func, file, valid_test, {
+ self.WriteValidUnitTest(func, f, valid_test, {
'resource_name': func.GetInfo('resource_type').lower(),
'upper_resource_name': func.GetInfo('resource_type'),
}, *extras)
@@ -6139,9 +6271,9 @@ TEST_P(%(test_name)s, %(name)sInvalidArgs) {
EXPECT_EQ(error::kNoError, ExecuteCmd(cmd));
}
"""
- self.WriteValidUnitTest(func, file, invalid_test, *extras)
+ self.WriteValidUnitTest(func, f, invalid_test, *extras)
- def WriteImmediateServiceUnitTest(self, func, file, *extras):
+ def WriteImmediateServiceUnitTest(self, func, f, *extras):
"""Overrriden from TypeHandler."""
valid_test = """
TEST_P(%(test_name)s, %(name)sValidArgs) {
@@ -6174,7 +6306,7 @@ TEST_P(%(test_name)s, %(name)sValidArgs) {
Get%(upper_resource_name)s(client_%(resource_name)s_id_) == NULL);
}
"""
- self.WriteValidUnitTest(func, file, valid_test, {
+ self.WriteValidUnitTest(func, f, valid_test, {
'resource_name': func.GetInfo('resource_type').lower(),
'upper_resource_name': func.GetInfo('resource_type'),
}, *extras)
@@ -6200,17 +6332,17 @@ TEST_P(%(test_name)s, %(name)sInvalidArgs) {
ExecuteImmediateCmd(cmd, sizeof(temp)));
}
"""
- self.WriteValidUnitTest(func, file, invalid_test, *extras)
+ self.WriteValidUnitTest(func, f, invalid_test, *extras)
- def WriteHandlerImplementation (self, func, file):
+ def WriteHandlerImplementation (self, func, f):
"""Overrriden from TypeHandler."""
- file.Write(" %sHelper(n, %s);\n" %
+ f.write(" %sHelper(n, %s);\n" %
(func.name, func.GetLastOriginalArg().name))
- def WriteImmediateHandlerImplementation (self, func, file):
+ def WriteImmediateHandlerImplementation (self, func, f):
"""Overrriden from TypeHandler."""
if func.IsUnsafe():
- file.Write(""" for (GLsizei ii = 0; ii < n; ++ii) {
+ f.write(""" for (GLsizei ii = 0; ii < n; ++ii) {
GLuint service_id = 0;
if (group_->Get%(resource_type)sServiceId(
%(last_arg_name)s[ii], &service_id)) {
@@ -6221,10 +6353,10 @@ TEST_P(%(test_name)s, %(name)sInvalidArgs) {
""" % { 'resource_type': func.GetInfo('resource_type'),
'last_arg_name': func.GetLastOriginalArg().name })
else:
- file.Write(" %sHelper(n, %s);\n" %
+ f.write(" %sHelper(n, %s);\n" %
(func.original_name, func.GetLastOriginalArg().name))
- def WriteGLES2Implementation(self, func, file):
+ def WriteGLES2Implementation(self, func, f):
"""Overrriden from TypeHandler."""
impl_decl = func.GetInfo('impl_decl')
if impl_decl == None or impl_decl == True:
@@ -6236,84 +6368,84 @@ TEST_P(%(test_name)s, %(name)sInvalidArgs) {
'resource_type': func.GetInfo('resource_type').lower(),
'count_name': func.GetOriginalArgs()[0].name,
}
- file.Write(
+ f.write(
"%(return_type)s GLES2Implementation::%(name)s(%(typed_args)s) {\n" %
args)
- file.Write(" GPU_CLIENT_SINGLE_THREAD_CHECK();\n")
- func.WriteDestinationInitalizationValidation(file)
- self.WriteClientGLCallLog(func, file)
- file.Write(""" GPU_CLIENT_LOG_CODE_BLOCK({
+ f.write(" GPU_CLIENT_SINGLE_THREAD_CHECK();\n")
+ func.WriteDestinationInitalizationValidation(f)
+ self.WriteClientGLCallLog(func, f)
+ f.write(""" GPU_CLIENT_LOG_CODE_BLOCK({
for (GLsizei i = 0; i < n; ++i) {
GPU_CLIENT_LOG(" " << i << ": " << %s[i]);
}
});
""" % func.GetOriginalArgs()[1].name)
- file.Write(""" GPU_CLIENT_DCHECK_CODE_BLOCK({
+ f.write(""" GPU_CLIENT_DCHECK_CODE_BLOCK({
for (GLsizei i = 0; i < n; ++i) {
DCHECK(%s[i] != 0);
}
});
""" % func.GetOriginalArgs()[1].name)
for arg in func.GetOriginalArgs():
- arg.WriteClientSideValidationCode(file, func)
+ arg.WriteClientSideValidationCode(f, func)
code = """ %(name)sHelper(%(args)s);
CheckGLError();
}
"""
- file.Write(code % args)
+ f.write(code % args)
- def WriteImmediateCmdComputeSize(self, func, file):
+ def WriteImmediateCmdComputeSize(self, func, f):
"""Overrriden from TypeHandler."""
- file.Write(" static uint32_t ComputeDataSize(GLsizei n) {\n")
- file.Write(
+ f.write(" static uint32_t ComputeDataSize(GLsizei n) {\n")
+ f.write(
" return static_cast<uint32_t>(sizeof(GLuint) * n); // NOLINT\n")
- file.Write(" }\n")
- file.Write("\n")
- file.Write(" static uint32_t ComputeSize(GLsizei n) {\n")
- file.Write(" return static_cast<uint32_t>(\n")
- file.Write(" sizeof(ValueType) + ComputeDataSize(n)); // NOLINT\n")
- file.Write(" }\n")
- file.Write("\n")
-
- def WriteImmediateCmdSetHeader(self, func, file):
+ f.write(" }\n")
+ f.write("\n")
+ f.write(" static uint32_t ComputeSize(GLsizei n) {\n")
+ f.write(" return static_cast<uint32_t>(\n")
+ f.write(" sizeof(ValueType) + ComputeDataSize(n)); // NOLINT\n")
+ f.write(" }\n")
+ f.write("\n")
+
+ def WriteImmediateCmdSetHeader(self, func, f):
"""Overrriden from TypeHandler."""
- file.Write(" void SetHeader(GLsizei n) {\n")
- file.Write(" header.SetCmdByTotalSize<ValueType>(ComputeSize(n));\n")
- file.Write(" }\n")
- file.Write("\n")
+ f.write(" void SetHeader(GLsizei n) {\n")
+ f.write(" header.SetCmdByTotalSize<ValueType>(ComputeSize(n));\n")
+ f.write(" }\n")
+ f.write("\n")
- def WriteImmediateCmdInit(self, func, file):
+ def WriteImmediateCmdInit(self, func, f):
"""Overrriden from TypeHandler."""
last_arg = func.GetLastOriginalArg()
- file.Write(" void Init(%s, %s _%s) {\n" %
+ f.write(" void Init(%s, %s _%s) {\n" %
(func.MakeTypedCmdArgString("_"),
last_arg.type, last_arg.name))
- file.Write(" SetHeader(_n);\n")
+ f.write(" SetHeader(_n);\n")
args = func.GetCmdArgs()
for arg in args:
- file.Write(" %s = _%s;\n" % (arg.name, arg.name))
- file.Write(" memcpy(ImmediateDataAddress(this),\n")
- file.Write(" _%s, ComputeDataSize(_n));\n" % last_arg.name)
- file.Write(" }\n")
- file.Write("\n")
+ f.write(" %s = _%s;\n" % (arg.name, arg.name))
+ f.write(" memcpy(ImmediateDataAddress(this),\n")
+ f.write(" _%s, ComputeDataSize(_n));\n" % last_arg.name)
+ f.write(" }\n")
+ f.write("\n")
- def WriteImmediateCmdSet(self, func, file):
+ def WriteImmediateCmdSet(self, func, f):
"""Overrriden from TypeHandler."""
last_arg = func.GetLastOriginalArg()
copy_args = func.MakeCmdArgString("_", False)
- file.Write(" void* Set(void* cmd%s, %s _%s) {\n" %
+ f.write(" void* Set(void* cmd%s, %s _%s) {\n" %
(func.MakeTypedCmdArgString("_", True),
last_arg.type, last_arg.name))
- file.Write(" static_cast<ValueType*>(cmd)->Init(%s, _%s);\n" %
+ f.write(" static_cast<ValueType*>(cmd)->Init(%s, _%s);\n" %
(copy_args, last_arg.name))
- file.Write(" const uint32_t size = ComputeSize(_n);\n")
- file.Write(" return NextImmediateCmdAddressTotalSize<ValueType>("
+ f.write(" const uint32_t size = ComputeSize(_n);\n")
+ f.write(" return NextImmediateCmdAddressTotalSize<ValueType>("
"cmd, size);\n")
- file.Write(" }\n")
- file.Write("\n")
+ f.write(" }\n")
+ f.write("\n")
- def WriteImmediateCmdHelper(self, func, file):
+ def WriteImmediateCmdHelper(self, func, f):
"""Overrriden from TypeHandler."""
code = """ void %(name)s(%(typed_args)s) {
const uint32_t size = gles2::cmds::%(name)s::ComputeSize(n);
@@ -6325,53 +6457,51 @@ TEST_P(%(test_name)s, %(name)sInvalidArgs) {
}
"""
- file.Write(code % {
+ f.write(code % {
"name": func.name,
"typed_args": func.MakeTypedOriginalArgString(""),
"args": func.MakeOriginalArgString(""),
})
- def WriteImmediateFormatTest(self, func, file):
+ def WriteImmediateFormatTest(self, func, f):
"""Overrriden from TypeHandler."""
- file.Write("TEST_F(GLES2FormatTest, %s) {\n" % func.name)
- file.Write(" static GLuint ids[] = { 12, 23, 34, };\n")
- file.Write(" cmds::%s& cmd = *GetBufferAs<cmds::%s>();\n" %
+ f.write("TEST_F(GLES2FormatTest, %s) {\n" % func.name)
+ f.write(" static GLuint ids[] = { 12, 23, 34, };\n")
+ f.write(" cmds::%s& cmd = *GetBufferAs<cmds::%s>();\n" %
(func.name, func.name))
- file.Write(" void* next_cmd = cmd.Set(\n")
- file.Write(" &cmd, static_cast<GLsizei>(arraysize(ids)), ids);\n")
- file.Write(" EXPECT_EQ(static_cast<uint32_t>(cmds::%s::kCmdId),\n" %
+ f.write(" void* next_cmd = cmd.Set(\n")
+ f.write(" &cmd, static_cast<GLsizei>(arraysize(ids)), ids);\n")
+ f.write(" EXPECT_EQ(static_cast<uint32_t>(cmds::%s::kCmdId),\n" %
func.name)
- file.Write(" cmd.header.command);\n")
- file.Write(" EXPECT_EQ(sizeof(cmd) +\n")
- file.Write(" RoundSizeToMultipleOfEntries(cmd.n * 4u),\n")
- file.Write(" cmd.header.size * 4u);\n")
- file.Write(" EXPECT_EQ(static_cast<GLsizei>(arraysize(ids)), cmd.n);\n");
- file.Write(" CheckBytesWrittenMatchesExpectedSize(\n")
- file.Write(" next_cmd, sizeof(cmd) +\n")
- file.Write(" RoundSizeToMultipleOfEntries(arraysize(ids) * 4u));\n")
- file.Write(" // TODO(gman): Check that ids were inserted;\n")
- file.Write("}\n")
- file.Write("\n")
+ 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>(arraysize(ids)), cmd.n);\n");
+ f.write(" CheckBytesWrittenMatchesExpectedSize(\n")
+ f.write(" next_cmd, sizeof(cmd) +\n")
+ f.write(" RoundSizeToMultipleOfEntries(arraysize(ids) * 4u));\n")
+ f.write(" EXPECT_EQ(0, memcmp(ids, ImmediateDataAddress(&cmd),\n")
+ f.write(" sizeof(ids)));\n")
+ f.write("}\n")
+ f.write("\n")
class GETnHandler(TypeHandler):
"""Handler for GETn for glGetBooleanv, glGetFloatv, ... type functions."""
- def __init__(self):
- TypeHandler.__init__(self)
-
def NeedsDataTransferFunction(self, func):
"""Overriden from TypeHandler."""
return False
- def WriteServiceImplementation(self, func, file):
+ def WriteServiceImplementation(self, func, f):
"""Overrriden from TypeHandler."""
- self.WriteServiceHandlerFunctionHeader(func, file)
+ self.WriteServiceHandlerFunctionHeader(func, f)
last_arg = func.GetLastOriginalArg()
# All except shm_id and shm_offset.
all_but_last_args = func.GetCmdArgs()[:-2]
for arg in all_but_last_args:
- arg.WriteGetCode(file)
+ arg.WriteGetCode(f)
code = """ typedef cmds::%(func_name)s::Result Result;
GLsizei num_values = 0;
@@ -6381,12 +6511,12 @@ class GETnHandler(TypeHandler):
Result::ComputeSize(num_values));
%(last_arg_type)s %(last_arg_name)s = result ? result->GetData() : NULL;
"""
- file.Write(code % {
+ f.write(code % {
'last_arg_type': last_arg.type,
'last_arg_name': last_arg.name,
'func_name': func.name,
})
- func.WriteHandlerValidation(file)
+ func.WriteHandlerValidation(f)
code = """ // Check that the client initialized the result.
if (result->size != 0) {
return error::kInvalidArguments;
@@ -6394,9 +6524,9 @@ class GETnHandler(TypeHandler):
"""
shadowed = func.GetInfo('shadowed')
if not shadowed:
- file.Write(' LOCAL_COPY_REAL_GL_ERRORS_TO_WRAPPER("%s");\n' % func.name)
- file.Write(code)
- func.WriteHandlerImplementation(file)
+ f.write(' LOCAL_COPY_REAL_GL_ERRORS_TO_WRAPPER("%s");\n' % func.name)
+ f.write(code)
+ func.WriteHandlerImplementation(f)
if shadowed:
code = """ result->SetNumResults(num_values);
return error::kNoError;
@@ -6411,20 +6541,20 @@ class GETnHandler(TypeHandler):
}
"""
- file.Write(code % {'func_name': func.name})
+ f.write(code % {'func_name': func.name})
- def WriteGLES2Implementation(self, func, file):
+ def WriteGLES2Implementation(self, func, f):
"""Overrriden from TypeHandler."""
impl_decl = func.GetInfo('impl_decl')
if impl_decl == None or impl_decl == True:
- file.Write("%s GLES2Implementation::%s(%s) {\n" %
+ f.write("%s GLES2Implementation::%s(%s) {\n" %
(func.return_type, func.original_name,
func.MakeTypedOriginalArgString("")))
- file.Write(" GPU_CLIENT_SINGLE_THREAD_CHECK();\n")
- func.WriteDestinationInitalizationValidation(file)
- self.WriteClientGLCallLog(func, file)
+ f.write(" GPU_CLIENT_SINGLE_THREAD_CHECK();\n")
+ func.WriteDestinationInitalizationValidation(f)
+ self.WriteClientGLCallLog(func, f)
for arg in func.GetOriginalArgs():
- arg.WriteClientSideValidationCode(file, func)
+ arg.WriteClientSideValidationCode(f, func)
all_but_last_args = func.GetOriginalArgs()[:-1]
args = []
has_length_arg = False
@@ -6443,7 +6573,7 @@ class GETnHandler(TypeHandler):
", ".join([
"%s" % arg.name
for arg in func.GetOriginalArgs() if not arg.IsConstant()]))
- self.WriteTraceEvent(func, file)
+ self.WriteTraceEvent(func, f)
code = """ if (%(func_name)sHelper(%(all_arg_string)s)) {
return;
}
@@ -6471,14 +6601,14 @@ class GETnHandler(TypeHandler):
CheckGLError();
}
"""
- file.Write(code % {
+ f.write(code % {
'func_name': func.name,
'arg_string': arg_string,
'all_arg_string': all_arg_string,
'last_arg_name': func.GetLastOriginalArg().name,
})
- def WriteGLES2ImplementationUnitTest(self, func, file):
+ def WriteGLES2ImplementationUnitTest(self, func, f):
"""Writes the GLES2 Implemention unit test."""
code = """
TEST_F(GLES2ImplementationTest, %(name)s) {
@@ -6513,20 +6643,18 @@ TEST_F(GLES2ImplementationTest, %(name)s) {
for arg in func.GetOriginalArgs()[1:-1]:
gl_arg_strings.append(arg.GetValidClientSideArg(func))
- file.Write(code % {
+ f.write(code % {
'name': func.name,
'args': ", ".join(gl_arg_strings),
'cmd_args': ", ".join(cmd_arg_strings),
})
- def WriteServiceUnitTest(self, func, file, *extras):
+ def WriteServiceUnitTest(self, func, f, *extras):
"""Overrriden from TypeHandler."""
valid_test = """
TEST_P(%(test_name)s, %(name)sValidArgs) {
EXPECT_CALL(*gl_, GetError())
- .WillOnce(Return(GL_NO_ERROR))
- .WillOnce(Return(GL_NO_ERROR))
- .RetiresOnSaturation();
+ .WillRepeatedly(Return(GL_NO_ERROR));
SpecializedSetup<cmds::%(name)s, 0>(true);
typedef cmds::%(name)s::Result Result;
Result* result = static_cast<Result*>(shared_memory_address_);
@@ -6580,7 +6708,7 @@ TEST_P(%(test_name)s, %(name)sValidArgs) {
cmd_arg_strings.append("shared_memory_id_")
cmd_arg_strings.append("shared_memory_offset_")
- self.WriteValidUnitTest(func, file, valid_test, {
+ self.WriteValidUnitTest(func, f, valid_test, {
'local_gl_args': ", ".join(gl_arg_strings),
'cmd_args': ", ".join(cmd_arg_strings),
'valid_pname': valid_pname,
@@ -6600,14 +6728,11 @@ TEST_P(%(test_name)s, %(name)sInvalidArgs%(arg_index)d_%(value_index)d) {
EXPECT_EQ(0u, result->size);%(gl_error_test)s
}
"""
- self.WriteInvalidUnitTest(func, file, invalid_test, *extras)
+ self.WriteInvalidUnitTest(func, f, invalid_test, *extras)
class ArrayArgTypeHandler(TypeHandler):
"""Base class for type handlers that handle args that are arrays"""
- def __init__(self):
- TypeHandler.__init__(self)
-
def GetArrayType(self, func):
"""Returns the type of the element in the element array being PUT to."""
for arg in func.GetOriginalArgs():
@@ -6629,10 +6754,7 @@ class ArrayArgTypeHandler(TypeHandler):
class PUTHandler(ArrayArgTypeHandler):
"""Handler for glTexParameter_v, glVertexAttrib_v functions."""
- def __init__(self):
- ArrayArgTypeHandler.__init__(self)
-
- def WriteServiceUnitTest(self, func, file, *extras):
+ def WriteServiceUnitTest(self, func, f, *extras):
"""Writes the service unit test for a command."""
expected_call = "EXPECT_CALL(*gl_, %(gl_func_name)s(%(gl_args)s));"
if func.GetInfo("first_element_only"):
@@ -6658,7 +6780,7 @@ TEST_P(%(test_name)s, %(name)sValidArgs) {
'data_value': func.GetInfo('data_value') or '0',
'expected_call': expected_call,
}
- self.WriteValidUnitTest(func, file, valid_test, extra, *extras)
+ self.WriteValidUnitTest(func, f, valid_test, extra, *extras)
invalid_test = """
TEST_P(%(test_name)s, %(name)sInvalidArgs%(arg_index)d_%(value_index)d) {
@@ -6670,9 +6792,9 @@ TEST_P(%(test_name)s, %(name)sInvalidArgs%(arg_index)d_%(value_index)d) {
EXPECT_EQ(error::%(parse_result)s, ExecuteCmd(cmd));%(gl_error_test)s
}
"""
- self.WriteInvalidUnitTest(func, file, invalid_test, extra, *extras)
+ self.WriteInvalidUnitTest(func, f, invalid_test, extra, *extras)
- def WriteImmediateServiceUnitTest(self, func, file, *extras):
+ def WriteImmediateServiceUnitTest(self, func, f, *extras):
"""Writes the service unit test for a command."""
valid_test = """
TEST_P(%(test_name)s, %(name)sValidArgs) {
@@ -6712,7 +6834,7 @@ TEST_P(%(test_name)s, %(name)sValidArgs) {
'gl_args': ", ".join(gl_arg_strings),
'gl_any_args': ", ".join(gl_any_strings),
}
- self.WriteValidUnitTest(func, file, valid_test, extra, *extras)
+ self.WriteValidUnitTest(func, f, valid_test, extra, *extras)
invalid_test = """
TEST_P(%(test_name)s, %(name)sInvalidArgs%(arg_index)d_%(value_index)d) {
@@ -6744,55 +6866,55 @@ TEST_P(%(test_name)s, %(name)sInvalidArgs%(arg_index)d_%(value_index)d) {
%(gl_error_test)s
}
"""
- self.WriteInvalidUnitTest(func, file, invalid_test, extra, *extras)
+ self.WriteInvalidUnitTest(func, f, invalid_test, extra, *extras)
- def WriteGetDataSizeCode(self, func, file):
+ def WriteGetDataSizeCode(self, func, f):
"""Overrriden from TypeHandler."""
code = """ uint32_t data_size;
if (!ComputeDataSize(1, sizeof(%s), %d, &data_size)) {
return error::kOutOfBounds;
}
"""
- file.Write(code % (self.GetArrayType(func), self.GetArrayCount(func)))
+ f.write(code % (self.GetArrayType(func), self.GetArrayCount(func)))
if func.IsImmediate():
- file.Write(" if (data_size > immediate_data_size) {\n")
- file.Write(" return error::kOutOfBounds;\n")
- file.Write(" }\n")
+ f.write(" if (data_size > immediate_data_size) {\n")
+ f.write(" return error::kOutOfBounds;\n")
+ f.write(" }\n")
def __NeedsToCalcDataCount(self, func):
use_count_func = func.GetInfo('use_count_func')
return use_count_func != None and use_count_func != False
- def WriteGLES2Implementation(self, func, file):
+ def WriteGLES2Implementation(self, func, f):
"""Overrriden from TypeHandler."""
impl_func = func.GetInfo('impl_func')
if (impl_func != None and impl_func != True):
return;
- file.Write("%s GLES2Implementation::%s(%s) {\n" %
+ f.write("%s GLES2Implementation::%s(%s) {\n" %
(func.return_type, func.original_name,
func.MakeTypedOriginalArgString("")))
- file.Write(" GPU_CLIENT_SINGLE_THREAD_CHECK();\n")
- func.WriteDestinationInitalizationValidation(file)
- self.WriteClientGLCallLog(func, file)
+ f.write(" GPU_CLIENT_SINGLE_THREAD_CHECK();\n")
+ func.WriteDestinationInitalizationValidation(f)
+ self.WriteClientGLCallLog(func, f)
if self.__NeedsToCalcDataCount(func):
- file.Write(" size_t count = GLES2Util::Calc%sDataCount(%s);\n" %
+ f.write(" size_t count = GLES2Util::Calc%sDataCount(%s);\n" %
(func.name, func.GetOriginalArgs()[0].name))
- file.Write(" DCHECK_LE(count, %du);\n" % self.GetArrayCount(func))
+ f.write(" DCHECK_LE(count, %du);\n" % self.GetArrayCount(func))
else:
- file.Write(" size_t count = %d;" % self.GetArrayCount(func))
- file.Write(" for (size_t ii = 0; ii < count; ++ii)\n")
- file.Write(' GPU_CLIENT_LOG("value[" << ii << "]: " << %s[ii]);\n' %
+ f.write(" size_t count = %d;" % self.GetArrayCount(func))
+ f.write(" for (size_t ii = 0; ii < count; ++ii)\n")
+ f.write(' GPU_CLIENT_LOG("value[" << ii << "]: " << %s[ii]);\n' %
func.GetLastOriginalArg().name)
for arg in func.GetOriginalArgs():
- arg.WriteClientSideValidationCode(file, func)
- file.Write(" helper_->%sImmediate(%s);\n" %
+ arg.WriteClientSideValidationCode(f, func)
+ f.write(" helper_->%sImmediate(%s);\n" %
(func.name, func.MakeOriginalArgString("")))
- file.Write(" CheckGLError();\n")
- file.Write("}\n")
- file.Write("\n")
+ f.write(" CheckGLError();\n")
+ f.write("}\n")
+ f.write("\n")
- def WriteGLES2ImplementationUnitTest(self, func, file):
+ def WriteGLES2ImplementationUnitTest(self, func, f):
"""Writes the GLES2 Implemention unit test."""
client_test = func.GetInfo('client_test')
if (client_test != None and client_test != True):
@@ -6821,7 +6943,7 @@ TEST_F(GLES2ImplementationTest, %(name)s) {
arg.GetValidClientSideArg(func) for arg in func.GetOriginalArgs()[0:-1]
]
- file.Write(code % {
+ f.write(code % {
'name': func.name,
'type': self.GetArrayType(func),
'count': self.GetArrayCount(func),
@@ -6829,80 +6951,80 @@ TEST_F(GLES2ImplementationTest, %(name)s) {
'cmd_args': ", ".join(cmd_arg_strings),
})
- def WriteImmediateCmdComputeSize(self, func, file):
+ def WriteImmediateCmdComputeSize(self, func, f):
"""Overrriden from TypeHandler."""
- file.Write(" static uint32_t ComputeDataSize() {\n")
- file.Write(" return static_cast<uint32_t>(\n")
- file.Write(" sizeof(%s) * %d);\n" %
+ f.write(" static uint32_t ComputeDataSize() {\n")
+ f.write(" return static_cast<uint32_t>(\n")
+ f.write(" sizeof(%s) * %d);\n" %
(self.GetArrayType(func), self.GetArrayCount(func)))
- file.Write(" }\n")
- file.Write("\n")
+ f.write(" }\n")
+ f.write("\n")
if self.__NeedsToCalcDataCount(func):
- file.Write(" static uint32_t ComputeEffectiveDataSize(%s %s) {\n" %
+ f.write(" static uint32_t ComputeEffectiveDataSize(%s %s) {\n" %
(func.GetOriginalArgs()[0].type,
func.GetOriginalArgs()[0].name))
- file.Write(" return static_cast<uint32_t>(\n")
- file.Write(" sizeof(%s) * GLES2Util::Calc%sDataCount(%s));\n" %
+ f.write(" return static_cast<uint32_t>(\n")
+ f.write(" sizeof(%s) * GLES2Util::Calc%sDataCount(%s));\n" %
(self.GetArrayType(func), func.original_name,
func.GetOriginalArgs()[0].name))
- file.Write(" }\n")
- file.Write("\n")
- file.Write(" static uint32_t ComputeSize() {\n")
- file.Write(" return static_cast<uint32_t>(\n")
- file.Write(
+ f.write(" }\n")
+ f.write("\n")
+ f.write(" static uint32_t ComputeSize() {\n")
+ f.write(" return static_cast<uint32_t>(\n")
+ f.write(
" sizeof(ValueType) + ComputeDataSize());\n")
- file.Write(" }\n")
- file.Write("\n")
+ f.write(" }\n")
+ f.write("\n")
- def WriteImmediateCmdSetHeader(self, func, file):
+ def WriteImmediateCmdSetHeader(self, func, f):
"""Overrriden from TypeHandler."""
- file.Write(" void SetHeader() {\n")
- file.Write(
+ f.write(" void SetHeader() {\n")
+ f.write(
" header.SetCmdByTotalSize<ValueType>(ComputeSize());\n")
- file.Write(" }\n")
- file.Write("\n")
+ f.write(" }\n")
+ f.write("\n")
- def WriteImmediateCmdInit(self, func, file):
+ def WriteImmediateCmdInit(self, func, f):
"""Overrriden from TypeHandler."""
last_arg = func.GetLastOriginalArg()
- file.Write(" void Init(%s, %s _%s) {\n" %
+ f.write(" void Init(%s, %s _%s) {\n" %
(func.MakeTypedCmdArgString("_"),
last_arg.type, last_arg.name))
- file.Write(" SetHeader();\n")
+ f.write(" SetHeader();\n")
args = func.GetCmdArgs()
for arg in args:
- file.Write(" %s = _%s;\n" % (arg.name, arg.name))
- file.Write(" memcpy(ImmediateDataAddress(this),\n")
+ f.write(" %s = _%s;\n" % (arg.name, arg.name))
+ f.write(" memcpy(ImmediateDataAddress(this),\n")
if self.__NeedsToCalcDataCount(func):
- file.Write(" _%s, ComputeEffectiveDataSize(%s));" %
+ f.write(" _%s, ComputeEffectiveDataSize(%s));" %
(last_arg.name, func.GetOriginalArgs()[0].name))
- file.Write("""
+ f.write("""
DCHECK_GE(ComputeDataSize(), ComputeEffectiveDataSize(%(arg)s));
char* pointer = reinterpret_cast<char*>(ImmediateDataAddress(this)) +
ComputeEffectiveDataSize(%(arg)s);
memset(pointer, 0, ComputeDataSize() - ComputeEffectiveDataSize(%(arg)s));
""" % { 'arg': func.GetOriginalArgs()[0].name, })
else:
- file.Write(" _%s, ComputeDataSize());\n" % last_arg.name)
- file.Write(" }\n")
- file.Write("\n")
+ f.write(" _%s, ComputeDataSize());\n" % last_arg.name)
+ f.write(" }\n")
+ f.write("\n")
- def WriteImmediateCmdSet(self, func, file):
+ def WriteImmediateCmdSet(self, func, f):
"""Overrriden from TypeHandler."""
last_arg = func.GetLastOriginalArg()
copy_args = func.MakeCmdArgString("_", False)
- file.Write(" void* Set(void* cmd%s, %s _%s) {\n" %
+ f.write(" void* Set(void* cmd%s, %s _%s) {\n" %
(func.MakeTypedCmdArgString("_", True),
last_arg.type, last_arg.name))
- file.Write(" static_cast<ValueType*>(cmd)->Init(%s, _%s);\n" %
+ f.write(" static_cast<ValueType*>(cmd)->Init(%s, _%s);\n" %
(copy_args, last_arg.name))
- file.Write(" const uint32_t size = ComputeSize();\n")
- file.Write(" return NextImmediateCmdAddressTotalSize<ValueType>("
+ f.write(" const uint32_t size = ComputeSize();\n")
+ f.write(" return NextImmediateCmdAddressTotalSize<ValueType>("
"cmd, size);\n")
- file.Write(" }\n")
- file.Write("\n")
+ f.write(" }\n")
+ f.write("\n")
- def WriteImmediateCmdHelper(self, func, file):
+ def WriteImmediateCmdHelper(self, func, f):
"""Overrriden from TypeHandler."""
code = """ void %(name)s(%(typed_args)s) {
const uint32_t size = gles2::cmds::%(name)s::ComputeSize();
@@ -6914,56 +7036,53 @@ TEST_F(GLES2ImplementationTest, %(name)s) {
}
"""
- file.Write(code % {
+ f.write(code % {
"name": func.name,
"typed_args": func.MakeTypedOriginalArgString(""),
"args": func.MakeOriginalArgString(""),
})
- def WriteImmediateFormatTest(self, func, file):
+ def WriteImmediateFormatTest(self, func, f):
"""Overrriden from TypeHandler."""
- file.Write("TEST_F(GLES2FormatTest, %s) {\n" % func.name)
- file.Write(" const int kSomeBaseValueToTestWith = 51;\n")
- file.Write(" static %s data[] = {\n" % self.GetArrayType(func))
+ f.write("TEST_F(GLES2FormatTest, %s) {\n" % func.name)
+ f.write(" const int kSomeBaseValueToTestWith = 51;\n")
+ f.write(" static %s data[] = {\n" % self.GetArrayType(func))
for v in range(0, self.GetArrayCount(func)):
- file.Write(" static_cast<%s>(kSomeBaseValueToTestWith + %d),\n" %
+ f.write(" static_cast<%s>(kSomeBaseValueToTestWith + %d),\n" %
(self.GetArrayType(func), v))
- file.Write(" };\n")
- file.Write(" cmds::%s& cmd = *GetBufferAs<cmds::%s>();\n" %
+ f.write(" };\n")
+ f.write(" cmds::%s& cmd = *GetBufferAs<cmds::%s>();\n" %
(func.name, func.name))
- file.Write(" void* next_cmd = cmd.Set(\n")
- file.Write(" &cmd")
+ f.write(" void* next_cmd = cmd.Set(\n")
+ f.write(" &cmd")
args = func.GetCmdArgs()
for value, arg in enumerate(args):
- file.Write(",\n static_cast<%s>(%d)" % (arg.type, value + 11))
- file.Write(",\n data);\n")
+ f.write(",\n static_cast<%s>(%d)" % (arg.type, value + 11))
+ f.write(",\n data);\n")
args = func.GetCmdArgs()
- file.Write(" EXPECT_EQ(static_cast<uint32_t>(cmds::%s::kCmdId),\n"
+ f.write(" EXPECT_EQ(static_cast<uint32_t>(cmds::%s::kCmdId),\n"
% func.name)
- file.Write(" cmd.header.command);\n")
- file.Write(" EXPECT_EQ(sizeof(cmd) +\n")
- file.Write(" RoundSizeToMultipleOfEntries(sizeof(data)),\n")
- file.Write(" cmd.header.size * 4u);\n")
+ f.write(" cmd.header.command);\n")
+ f.write(" EXPECT_EQ(sizeof(cmd) +\n")
+ f.write(" RoundSizeToMultipleOfEntries(sizeof(data)),\n")
+ f.write(" cmd.header.size * 4u);\n")
for value, arg in enumerate(args):
- file.Write(" EXPECT_EQ(static_cast<%s>(%d), cmd.%s);\n" %
+ f.write(" EXPECT_EQ(static_cast<%s>(%d), cmd.%s);\n" %
(arg.type, value + 11, arg.name))
- file.Write(" CheckBytesWrittenMatchesExpectedSize(\n")
- file.Write(" next_cmd, sizeof(cmd) +\n")
- file.Write(" RoundSizeToMultipleOfEntries(sizeof(data)));\n")
- file.Write(" // TODO(gman): Check that data was inserted;\n")
- file.Write("}\n")
- file.Write("\n")
+ f.write(" CheckBytesWrittenMatchesExpectedSize(\n")
+ f.write(" next_cmd, sizeof(cmd) +\n")
+ f.write(" RoundSizeToMultipleOfEntries(sizeof(data)));\n")
+ f.write(" // TODO(gman): Check that data was inserted;\n")
+ f.write("}\n")
+ f.write("\n")
class PUTnHandler(ArrayArgTypeHandler):
"""Handler for PUTn 'glUniform__v' type functions."""
- def __init__(self):
- ArrayArgTypeHandler.__init__(self)
-
- def WriteServiceUnitTest(self, func, file, *extras):
+ def WriteServiceUnitTest(self, func, f, *extras):
"""Overridden from TypeHandler."""
- ArrayArgTypeHandler.WriteServiceUnitTest(self, func, file, *extras)
+ ArrayArgTypeHandler.WriteServiceUnitTest(self, func, f, *extras)
valid_test = """
TEST_P(%(test_name)s, %(name)sValidArgsCountTooLarge) {
@@ -6997,9 +7116,9 @@ TEST_P(%(test_name)s, %(name)sValidArgsCountTooLarge) {
'gl_args': ", ".join(gl_arg_strings),
'args': ", ".join(arg_strings),
}
- self.WriteValidUnitTest(func, file, valid_test, extra, *extras)
+ self.WriteValidUnitTest(func, f, valid_test, extra, *extras)
- def WriteImmediateServiceUnitTest(self, func, file, *extras):
+ def WriteImmediateServiceUnitTest(self, func, f, *extras):
"""Overridden from TypeHandler."""
valid_test = """
TEST_P(%(test_name)s, %(name)sValidArgs) {
@@ -7041,7 +7160,7 @@ TEST_P(%(test_name)s, %(name)sValidArgs) {
'gl_args': ", ".join(gl_arg_strings),
'gl_any_args': ", ".join(gl_any_strings),
}
- self.WriteValidUnitTest(func, file, valid_test, extra, *extras)
+ self.WriteValidUnitTest(func, f, valid_test, extra, *extras)
invalid_test = """
TEST_P(%(test_name)s, %(name)sInvalidArgs%(arg_index)d_%(value_index)d) {
@@ -7054,48 +7173,48 @@ TEST_P(%(test_name)s, %(name)sInvalidArgs%(arg_index)d_%(value_index)d) {
ExecuteImmediateCmd(cmd, sizeof(temp)));%(gl_error_test)s
}
"""
- self.WriteInvalidUnitTest(func, file, invalid_test, extra, *extras)
+ self.WriteInvalidUnitTest(func, f, invalid_test, extra, *extras)
- def WriteGetDataSizeCode(self, func, file):
+ def WriteGetDataSizeCode(self, func, f):
"""Overrriden from TypeHandler."""
code = """ uint32_t data_size;
if (!ComputeDataSize(count, sizeof(%s), %d, &data_size)) {
return error::kOutOfBounds;
}
"""
- file.Write(code % (self.GetArrayType(func), self.GetArrayCount(func)))
+ f.write(code % (self.GetArrayType(func), self.GetArrayCount(func)))
if func.IsImmediate():
- file.Write(" if (data_size > immediate_data_size) {\n")
- file.Write(" return error::kOutOfBounds;\n")
- file.Write(" }\n")
+ f.write(" if (data_size > immediate_data_size) {\n")
+ f.write(" return error::kOutOfBounds;\n")
+ f.write(" }\n")
- def WriteGLES2Implementation(self, func, file):
+ def WriteGLES2Implementation(self, func, f):
"""Overrriden from TypeHandler."""
- file.Write("%s GLES2Implementation::%s(%s) {\n" %
+ f.write("%s GLES2Implementation::%s(%s) {\n" %
(func.return_type, func.original_name,
func.MakeTypedOriginalArgString("")))
- file.Write(" GPU_CLIENT_SINGLE_THREAD_CHECK();\n")
- func.WriteDestinationInitalizationValidation(file)
- self.WriteClientGLCallLog(func, file)
+ f.write(" GPU_CLIENT_SINGLE_THREAD_CHECK();\n")
+ func.WriteDestinationInitalizationValidation(f)
+ self.WriteClientGLCallLog(func, f)
last_pointer_name = func.GetLastOriginalPointerArg().name
- file.Write(""" GPU_CLIENT_LOG_CODE_BLOCK({
+ f.write(""" GPU_CLIENT_LOG_CODE_BLOCK({
for (GLsizei i = 0; i < count; ++i) {
""")
values_str = ' << ", " << '.join(
["%s[%d + i * %d]" % (
last_pointer_name, ndx, self.GetArrayCount(func)) for ndx in range(
0, self.GetArrayCount(func))])
- file.Write(' GPU_CLIENT_LOG(" " << i << ": " << %s);\n' % values_str)
- file.Write(" }\n });\n")
+ f.write(' GPU_CLIENT_LOG(" " << i << ": " << %s);\n' % values_str)
+ f.write(" }\n });\n")
for arg in func.GetOriginalArgs():
- arg.WriteClientSideValidationCode(file, func)
- file.Write(" helper_->%sImmediate(%s);\n" %
+ arg.WriteClientSideValidationCode(f, func)
+ f.write(" helper_->%sImmediate(%s);\n" %
(func.name, func.MakeInitString("")))
- file.Write(" CheckGLError();\n")
- file.Write("}\n")
- file.Write("\n")
+ f.write(" CheckGLError();\n")
+ f.write("}\n")
+ f.write("\n")
- def WriteGLES2ImplementationUnitTest(self, func, file):
+ def WriteGLES2ImplementationUnitTest(self, func, f):
"""Writes the GLES2 Implemention unit test."""
code = """
TEST_F(GLES2ImplementationTest, %(name)s) {
@@ -7134,7 +7253,7 @@ TEST_F(GLES2ImplementationTest, %(name)s) {
gl_arg_strings.append(valid_value)
if arg.name == "count":
count_param = int(valid_value)
- file.Write(code % {
+ f.write(code % {
'name': func.name,
'type': self.GetArrayType(func),
'count': self.GetArrayCount(func),
@@ -7178,7 +7297,7 @@ TEST_F(GLES2ImplementationTest, %(name)sInvalidConstantArg%(invalid_index)d) {
if arg.name == "count":
count_param = int(valid_value)
- file.Write(code % {
+ f.write(code % {
'name': func.name,
'invalid_index': func.GetOriginalArgs().index(invalid_arg),
'type': self.GetArrayType(func),
@@ -7189,56 +7308,56 @@ TEST_F(GLES2ImplementationTest, %(name)sInvalidConstantArg%(invalid_index)d) {
})
- def WriteImmediateCmdComputeSize(self, func, file):
+ def WriteImmediateCmdComputeSize(self, func, f):
"""Overrriden from TypeHandler."""
- file.Write(" static uint32_t ComputeDataSize(GLsizei count) {\n")
- file.Write(" return static_cast<uint32_t>(\n")
- file.Write(" sizeof(%s) * %d * count); // NOLINT\n" %
+ f.write(" static uint32_t ComputeDataSize(GLsizei count) {\n")
+ f.write(" return static_cast<uint32_t>(\n")
+ f.write(" sizeof(%s) * %d * count); // NOLINT\n" %
(self.GetArrayType(func), self.GetArrayCount(func)))
- file.Write(" }\n")
- file.Write("\n")
- file.Write(" static uint32_t ComputeSize(GLsizei count) {\n")
- file.Write(" return static_cast<uint32_t>(\n")
- file.Write(
+ f.write(" }\n")
+ f.write("\n")
+ f.write(" static uint32_t ComputeSize(GLsizei count) {\n")
+ f.write(" return static_cast<uint32_t>(\n")
+ f.write(
" sizeof(ValueType) + ComputeDataSize(count)); // NOLINT\n")
- file.Write(" }\n")
- file.Write("\n")
+ f.write(" }\n")
+ f.write("\n")
- def WriteImmediateCmdSetHeader(self, func, file):
+ def WriteImmediateCmdSetHeader(self, func, f):
"""Overrriden from TypeHandler."""
- file.Write(" void SetHeader(GLsizei count) {\n")
- file.Write(
+ f.write(" void SetHeader(GLsizei count) {\n")
+ f.write(
" header.SetCmdByTotalSize<ValueType>(ComputeSize(count));\n")
- file.Write(" }\n")
- file.Write("\n")
+ f.write(" }\n")
+ f.write("\n")
- def WriteImmediateCmdInit(self, func, file):
+ def WriteImmediateCmdInit(self, func, f):
"""Overrriden from TypeHandler."""
- file.Write(" void Init(%s) {\n" %
+ f.write(" void Init(%s) {\n" %
func.MakeTypedInitString("_"))
- file.Write(" SetHeader(_count);\n")
+ f.write(" SetHeader(_count);\n")
args = func.GetCmdArgs()
for arg in args:
- file.Write(" %s = _%s;\n" % (arg.name, arg.name))
- file.Write(" memcpy(ImmediateDataAddress(this),\n")
+ f.write(" %s = _%s;\n" % (arg.name, arg.name))
+ f.write(" memcpy(ImmediateDataAddress(this),\n")
pointer_arg = func.GetLastOriginalPointerArg()
- file.Write(" _%s, ComputeDataSize(_count));\n" % pointer_arg.name)
- file.Write(" }\n")
- file.Write("\n")
+ f.write(" _%s, ComputeDataSize(_count));\n" % pointer_arg.name)
+ f.write(" }\n")
+ f.write("\n")
- def WriteImmediateCmdSet(self, func, file):
+ def WriteImmediateCmdSet(self, func, f):
"""Overrriden from TypeHandler."""
- file.Write(" void* Set(void* cmd%s) {\n" %
+ f.write(" void* Set(void* cmd%s) {\n" %
func.MakeTypedInitString("_", True))
- file.Write(" static_cast<ValueType*>(cmd)->Init(%s);\n" %
+ f.write(" static_cast<ValueType*>(cmd)->Init(%s);\n" %
func.MakeInitString("_"))
- file.Write(" const uint32_t size = ComputeSize(_count);\n")
- file.Write(" return NextImmediateCmdAddressTotalSize<ValueType>("
+ f.write(" const uint32_t size = ComputeSize(_count);\n")
+ f.write(" return NextImmediateCmdAddressTotalSize<ValueType>("
"cmd, size);\n")
- file.Write(" }\n")
- file.Write("\n")
+ f.write(" }\n")
+ f.write("\n")
- def WriteImmediateCmdHelper(self, func, file):
+ def WriteImmediateCmdHelper(self, func, f):
"""Overrriden from TypeHandler."""
code = """ void %(name)s(%(typed_args)s) {
const uint32_t size = gles2::cmds::%(name)s::ComputeSize(count);
@@ -7250,64 +7369,61 @@ TEST_F(GLES2ImplementationTest, %(name)sInvalidConstantArg%(invalid_index)d) {
}
"""
- file.Write(code % {
+ f.write(code % {
"name": func.name,
"typed_args": func.MakeTypedInitString(""),
"args": func.MakeInitString("")
})
- def WriteImmediateFormatTest(self, func, file):
+ def WriteImmediateFormatTest(self, func, f):
"""Overrriden from TypeHandler."""
args = func.GetOriginalArgs()
count_param = 0
for arg in args:
if arg.name == "count":
count_param = int(arg.GetValidClientSideCmdArg(func))
- file.Write("TEST_F(GLES2FormatTest, %s) {\n" % func.name)
- file.Write(" const int kSomeBaseValueToTestWith = 51;\n")
- file.Write(" static %s data[] = {\n" % self.GetArrayType(func))
+ f.write("TEST_F(GLES2FormatTest, %s) {\n" % func.name)
+ f.write(" const int kSomeBaseValueToTestWith = 51;\n")
+ f.write(" static %s data[] = {\n" % self.GetArrayType(func))
for v in range(0, self.GetArrayCount(func) * count_param):
- file.Write(" static_cast<%s>(kSomeBaseValueToTestWith + %d),\n" %
+ f.write(" static_cast<%s>(kSomeBaseValueToTestWith + %d),\n" %
(self.GetArrayType(func), v))
- file.Write(" };\n")
- file.Write(" cmds::%s& cmd = *GetBufferAs<cmds::%s>();\n" %
+ f.write(" };\n")
+ f.write(" cmds::%s& cmd = *GetBufferAs<cmds::%s>();\n" %
(func.name, func.name))
- file.Write(" const GLsizei kNumElements = %d;\n" % count_param)
- file.Write(" const size_t kExpectedCmdSize =\n")
- file.Write(" sizeof(cmd) + kNumElements * sizeof(%s) * %d;\n" %
+ f.write(" const GLsizei kNumElements = %d;\n" % count_param)
+ f.write(" const size_t kExpectedCmdSize =\n")
+ f.write(" sizeof(cmd) + kNumElements * sizeof(%s) * %d;\n" %
(self.GetArrayType(func), self.GetArrayCount(func)))
- file.Write(" void* next_cmd = cmd.Set(\n")
- file.Write(" &cmd")
+ f.write(" void* next_cmd = cmd.Set(\n")
+ f.write(" &cmd")
for value, arg in enumerate(args):
if arg.IsPointer():
- file.Write(",\n data")
+ f.write(",\n data")
elif arg.IsConstant():
continue
else:
- file.Write(",\n static_cast<%s>(%d)" % (arg.type, value + 1))
- file.Write(");\n")
- file.Write(" EXPECT_EQ(static_cast<uint32_t>(cmds::%s::kCmdId),\n" %
+ f.write(",\n static_cast<%s>(%d)" % (arg.type, value + 1))
+ f.write(");\n")
+ f.write(" EXPECT_EQ(static_cast<uint32_t>(cmds::%s::kCmdId),\n" %
func.name)
- file.Write(" cmd.header.command);\n")
- file.Write(" EXPECT_EQ(kExpectedCmdSize, cmd.header.size * 4u);\n")
+ f.write(" cmd.header.command);\n")
+ f.write(" EXPECT_EQ(kExpectedCmdSize, cmd.header.size * 4u);\n")
for value, arg in enumerate(args):
if arg.IsPointer() or arg.IsConstant():
continue
- file.Write(" EXPECT_EQ(static_cast<%s>(%d), cmd.%s);\n" %
+ f.write(" EXPECT_EQ(static_cast<%s>(%d), cmd.%s);\n" %
(arg.type, value + 1, arg.name))
- file.Write(" CheckBytesWrittenMatchesExpectedSize(\n")
- file.Write(" next_cmd, sizeof(cmd) +\n")
- file.Write(" RoundSizeToMultipleOfEntries(sizeof(data)));\n")
- file.Write(" // TODO(gman): Check that data was inserted;\n")
- file.Write("}\n")
- file.Write("\n")
+ f.write(" CheckBytesWrittenMatchesExpectedSize(\n")
+ f.write(" next_cmd, sizeof(cmd) +\n")
+ f.write(" RoundSizeToMultipleOfEntries(sizeof(data)));\n")
+ f.write(" // TODO(gman): Check that data was inserted;\n")
+ f.write("}\n")
+ f.write("\n")
class PUTSTRHandler(ArrayArgTypeHandler):
"""Handler for functions that pass a string array."""
- def __init__(self):
- ArrayArgTypeHandler.__init__(self)
-
def __GetDataArg(self, func):
"""Return the argument that points to the 2D char arrays"""
for arg in func.GetOriginalArgs():
@@ -7322,14 +7438,14 @@ class PUTSTRHandler(ArrayArgTypeHandler):
return arg
return None
- def WriteGLES2Implementation(self, func, file):
+ def WriteGLES2Implementation(self, func, f):
"""Overrriden from TypeHandler."""
- file.Write("%s GLES2Implementation::%s(%s) {\n" %
+ f.write("%s GLES2Implementation::%s(%s) {\n" %
(func.return_type, func.original_name,
func.MakeTypedOriginalArgString("")))
- file.Write(" GPU_CLIENT_SINGLE_THREAD_CHECK();\n")
- func.WriteDestinationInitalizationValidation(file)
- self.WriteClientGLCallLog(func, file)
+ f.write(" GPU_CLIENT_SINGLE_THREAD_CHECK();\n")
+ func.WriteDestinationInitalizationValidation(f)
+ self.WriteClientGLCallLog(func, f)
data_arg = self.__GetDataArg(func)
length_arg = self.__GetLengthArg(func)
log_code_block = """ GPU_CLIENT_LOG_CODE_BLOCK({
@@ -7353,12 +7469,12 @@ class PUTSTRHandler(ArrayArgTypeHandler):
}
});
"""
- file.Write(log_code_block % {
+ f.write(log_code_block % {
'data': data_arg.name,
'length': length_arg.name if not length_arg == None else ''
})
for arg in func.GetOriginalArgs():
- arg.WriteClientSideValidationCode(file, func)
+ arg.WriteClientSideValidationCode(f, func)
bucket_args = []
for arg in func.GetOriginalArgs():
@@ -7378,14 +7494,14 @@ class PUTSTRHandler(ArrayArgTypeHandler):
}
"""
- file.Write(code_block % {
+ f.write(code_block % {
'data': data_arg.name,
'length': length_arg.name if not length_arg == None else 'NULL',
'func_name': func.name,
'bucket_args': ', '.join(bucket_args),
})
- def WriteGLES2ImplementationUnitTest(self, func, file):
+ def WriteGLES2ImplementationUnitTest(self, func, f):
"""Overrriden from TypeHandler."""
code = """
TEST_F(GLES2ImplementationTest, %(name)s) {
@@ -7450,7 +7566,7 @@ TEST_F(GLES2ImplementationTest, %(name)s) {
else:
gl_args.append(arg.GetValidClientSideArg(func))
bucket_args.append(arg.GetValidClientSideArg(func))
- file.Write(code % {
+ f.write(code % {
'name': func.name,
'gl_args': ", ".join(gl_args),
'bucket_args': ", ".join(bucket_args),
@@ -7508,13 +7624,13 @@ TEST_F(GLES2ImplementationTest, %(name)sWithLength) {
gl_args.append('1')
else:
gl_args.append(arg.GetValidClientSideArg(func))
- file.Write(code % {
+ f.write(code % {
'name': func.name,
'gl_args': ", ".join(gl_args),
'bucket_args': ", ".join(bucket_args),
})
- def WriteBucketServiceUnitTest(self, func, file, *extras):
+ def WriteBucketServiceUnitTest(self, func, f, *extras):
"""Overrriden from TypeHandler."""
cmd_args = []
cmd_args_with_invalid_id = []
@@ -7557,7 +7673,7 @@ TEST_P(%(test_name)s, %(name)sValidArgs) {
test += """
}
"""
- self.WriteValidUnitTest(func, file, test, {
+ self.WriteValidUnitTest(func, f, test, {
'cmd_args': ", ".join(cmd_args),
'gl_args': ", ".join(gl_args),
}, *extras)
@@ -7580,7 +7696,7 @@ TEST_P(%(test_name)s, %(name)sInvalidArgs) {
EXPECT_EQ(GL_INVALID_VALUE, GetGLError());
}
"""
- self.WriteValidUnitTest(func, file, test, {
+ self.WriteValidUnitTest(func, f, test, {
'cmd_args': ", ".join(cmd_args),
'cmd_args_with_invalid_id': ", ".join(cmd_args_with_invalid_id),
}, *extras)
@@ -7607,7 +7723,7 @@ TEST_P(%(test_name)s, %(name)sInvalidHeader) {
}
}
"""
- self.WriteValidUnitTest(func, file, test, {
+ self.WriteValidUnitTest(func, f, test, {
'cmd_args': ", ".join(cmd_args),
}, *extras)
@@ -7624,25 +7740,17 @@ TEST_P(%(test_name)s, %(name)sInvalidStringEnding) {
EXPECT_EQ(error::kInvalidArguments, ExecuteCmd(cmd));
}
"""
- self.WriteValidUnitTest(func, file, test, {
+ self.WriteValidUnitTest(func, f, test, {
'cmd_args': ", ".join(cmd_args),
}, *extras)
class PUTXnHandler(ArrayArgTypeHandler):
"""Handler for glUniform?f functions."""
- def __init__(self):
- ArrayArgTypeHandler.__init__(self)
- def WriteHandlerImplementation(self, func, file):
+ def WriteHandlerImplementation(self, func, f):
"""Overrriden from TypeHandler."""
- code = """ %(type)s temp[%(count)s] = { %(values)s};"""
- if func.IsUnsafe():
- code += """
- gl%(name)sv(%(location)s, 1, &temp[0]);
-"""
- else:
- code += """
+ code = """ %(type)s temp[%(count)s] = { %(values)s};
Do%(name)sv(%(location)s, 1, &temp[0]);
"""
values = ""
@@ -7652,7 +7760,7 @@ class PUTXnHandler(ArrayArgTypeHandler):
for ii in range(count):
values += "%s, " % args[len(args) - count + ii].name
- file.Write(code % {
+ f.write(code % {
'name': func.name,
'count': self.GetArrayCount(func),
'type': self.GetArrayType(func),
@@ -7661,7 +7769,7 @@ class PUTXnHandler(ArrayArgTypeHandler):
'values': values,
})
- def WriteServiceUnitTest(self, func, file, *extras):
+ def WriteServiceUnitTest(self, func, f, *extras):
"""Overrriden from TypeHandler."""
valid_test = """
TEST_P(%(test_name)s, %(name)sValidArgs) {
@@ -7684,7 +7792,7 @@ TEST_P(%(test_name)s, %(name)sValidArgs) {
"""
args = func.GetOriginalArgs()
local_args = "%s, 1, _" % args[0].GetValidGLArg(func)
- self.WriteValidUnitTest(func, file, valid_test, {
+ self.WriteValidUnitTest(func, f, valid_test, {
'name': func.name,
'count': self.GetArrayCount(func),
'local_args': local_args,
@@ -7699,7 +7807,7 @@ TEST_P(%(test_name)s, %(name)sInvalidArgs%(arg_index)d_%(value_index)d) {
EXPECT_EQ(error::%(parse_result)s, ExecuteCmd(cmd));%(gl_error_test)s
}
"""
- self.WriteInvalidUnitTest(func, file, invalid_test, {
+ self.WriteInvalidUnitTest(func, f, invalid_test, {
'name': func.GetInfo('name'),
'count': self.GetArrayCount(func),
})
@@ -7708,26 +7816,23 @@ TEST_P(%(test_name)s, %(name)sInvalidArgs%(arg_index)d_%(value_index)d) {
class GLcharHandler(CustomHandler):
"""Handler for functions that pass a single string ."""
- def __init__(self):
- CustomHandler.__init__(self)
-
- def WriteImmediateCmdComputeSize(self, func, file):
+ def WriteImmediateCmdComputeSize(self, func, f):
"""Overrriden from TypeHandler."""
- file.Write(" static uint32_t ComputeSize(uint32_t data_size) {\n")
- file.Write(" return static_cast<uint32_t>(\n")
- file.Write(" sizeof(ValueType) + data_size); // NOLINT\n")
- file.Write(" }\n")
+ f.write(" static uint32_t ComputeSize(uint32_t data_size) {\n")
+ f.write(" return static_cast<uint32_t>(\n")
+ f.write(" sizeof(ValueType) + data_size); // NOLINT\n")
+ f.write(" }\n")
- def WriteImmediateCmdSetHeader(self, func, file):
+ def WriteImmediateCmdSetHeader(self, func, f):
"""Overrriden from TypeHandler."""
code = """
void SetHeader(uint32_t data_size) {
header.SetCmdBySize<ValueType>(data_size);
}
"""
- file.Write(code)
+ f.write(code)
- def WriteImmediateCmdInit(self, func, file):
+ def WriteImmediateCmdInit(self, func, f):
"""Overrriden from TypeHandler."""
last_arg = func.GetLastOriginalArg()
args = func.GetCmdArgs()
@@ -7742,25 +7847,25 @@ class GLcharHandler(CustomHandler):
}
"""
- file.Write(code % {
+ f.write(code % {
"typed_args": func.MakeTypedArgString("_"),
"set_code": "\n".join(set_code),
"last_arg": last_arg.name
})
- def WriteImmediateCmdSet(self, func, file):
+ def WriteImmediateCmdSet(self, func, f):
"""Overrriden from TypeHandler."""
last_arg = func.GetLastOriginalArg()
- file.Write(" void* Set(void* cmd%s, uint32_t _data_size) {\n" %
+ f.write(" void* Set(void* cmd%s, uint32_t _data_size) {\n" %
func.MakeTypedCmdArgString("_", True))
- file.Write(" static_cast<ValueType*>(cmd)->Init(%s, _data_size);\n" %
+ f.write(" static_cast<ValueType*>(cmd)->Init(%s, _data_size);\n" %
func.MakeCmdArgString("_"))
- file.Write(" return NextImmediateCmdAddress<ValueType>("
+ f.write(" return NextImmediateCmdAddress<ValueType>("
"cmd, _data_size);\n")
- file.Write(" }\n")
- file.Write("\n")
+ f.write(" }\n")
+ f.write("\n")
- def WriteImmediateCmdHelper(self, func, file):
+ def WriteImmediateCmdHelper(self, func, f):
"""Overrriden from TypeHandler."""
code = """ void %(name)s(%(typed_args)s) {
const uint32_t data_size = strlen(name);
@@ -7772,14 +7877,14 @@ class GLcharHandler(CustomHandler):
}
"""
- file.Write(code % {
+ f.write(code % {
"name": func.name,
"typed_args": func.MakeTypedOriginalArgString(""),
"args": func.MakeOriginalArgString(""),
})
- def WriteImmediateFormatTest(self, func, file):
+ def WriteImmediateFormatTest(self, func, f):
"""Overrriden from TypeHandler."""
init_code = []
check_code = []
@@ -7816,7 +7921,7 @@ TEST_F(GLES2FormatTest, %(func_name)s) {
}
"""
- file.Write(code % {
+ f.write(code % {
'func_name': func.name,
'init_code': "\n".join(init_code),
'check_code': "\n".join(check_code),
@@ -7826,9 +7931,6 @@ TEST_F(GLES2FormatTest, %(func_name)s) {
class GLcharNHandler(CustomHandler):
"""Handler for functions that pass a single string with an optional len."""
- def __init__(self):
- CustomHandler.__init__(self)
-
def InitFunction(self, func):
"""Overrriden from TypeHandler."""
func.cmd_args = []
@@ -7838,14 +7940,10 @@ class GLcharNHandler(CustomHandler):
"""Overriden from TypeHandler."""
return False
- def AddBucketFunction(self, generator, func):
- """Overrriden from TypeHandler."""
- pass
-
- def WriteServiceImplementation(self, func, file):
+ def WriteServiceImplementation(self, func, f):
"""Overrriden from TypeHandler."""
- self.WriteServiceHandlerFunctionHeader(func, file)
- file.Write("""
+ self.WriteServiceHandlerFunctionHeader(func, f)
+ f.write("""
GLuint bucket_id = static_cast<GLuint>(c.%(bucket_id)s);
Bucket* bucket = GetBucket(bucket_id);
if (!bucket || bucket->size() == 0) {
@@ -7869,9 +7967,6 @@ class GLcharNHandler(CustomHandler):
class IsHandler(TypeHandler):
"""Handler for glIs____ type and glGetError functions."""
- def __init__(self):
- TypeHandler.__init__(self)
-
def InitFunction(self, func):
"""Overrriden from TypeHandler."""
func.AddCmdArg(Argument("result_shm_id", 'uint32_t'))
@@ -7879,7 +7974,7 @@ class IsHandler(TypeHandler):
if func.GetInfo('result') == None:
func.AddInfo('result', ['uint32_t'])
- def WriteServiceUnitTest(self, func, file, *extras):
+ def WriteServiceUnitTest(self, func, f, *extras):
"""Overrriden from TypeHandler."""
valid_test = """
TEST_P(%(test_name)s, %(name)sValidArgs) {
@@ -7903,7 +7998,7 @@ TEST_P(%(test_name)s, %(name)sValidArgs) {
comma = ""
if len(func.GetOriginalArgs()):
comma =", "
- self.WriteValidUnitTest(func, file, valid_test, {
+ self.WriteValidUnitTest(func, f, valid_test, {
'comma': comma,
}, *extras)
@@ -7916,7 +8011,7 @@ TEST_P(%(test_name)s, %(name)sInvalidArgs%(arg_index)d_%(value_index)d) {
EXPECT_EQ(error::%(parse_result)s, ExecuteCmd(cmd));%(gl_error_test)s
}
"""
- self.WriteInvalidUnitTest(func, file, invalid_test, {
+ self.WriteInvalidUnitTest(func, f, invalid_test, {
'comma': comma,
}, *extras)
@@ -7939,16 +8034,17 @@ TEST_P(%(test_name)s, %(name)sInvalidArgsBadSharedMemoryId) {
invalid_test += """
}
"""
- self.WriteValidUnitTest(func, file, invalid_test, {
+ self.WriteValidUnitTest(func, f, invalid_test, {
'comma': comma,
}, *extras)
- def WriteServiceImplementation(self, func, file):
+ def WriteServiceImplementation(self, func, f):
"""Overrriden from TypeHandler."""
- self.WriteServiceHandlerFunctionHeader(func, file)
+ self.WriteServiceHandlerFunctionHeader(func, f)
+ self.WriteHandlerExtensionCheck(func, f)
args = func.GetOriginalArgs()
for arg in args:
- arg.WriteGetCode(file)
+ arg.WriteGetCode(f)
code = """ typedef cmds::%(func_name)s::Result Result;
Result* result_dst = GetSharedMemoryAs<Result*>(
@@ -7957,61 +8053,61 @@ TEST_P(%(test_name)s, %(name)sInvalidArgsBadSharedMemoryId) {
return error::kOutOfBounds;
}
"""
- file.Write(code % {'func_name': func.name})
- func.WriteHandlerValidation(file)
+ f.write(code % {'func_name': func.name})
+ func.WriteHandlerValidation(f)
if func.IsUnsafe():
assert func.GetInfo('id_mapping')
assert len(func.GetInfo('id_mapping')) == 1
assert len(args) == 1
id_type = func.GetInfo('id_mapping')[0]
- file.Write(" %s service_%s = 0;\n" % (args[0].type, id_type.lower()))
- file.Write(" *result_dst = group_->Get%sServiceId(%s, &service_%s);\n" %
+ f.write(" %s service_%s = 0;\n" % (args[0].type, id_type.lower()))
+ f.write(" *result_dst = group_->Get%sServiceId(%s, &service_%s);\n" %
(id_type, id_type.lower(), id_type.lower()))
else:
- file.Write(" *result_dst = %s(%s);\n" %
+ f.write(" *result_dst = %s(%s);\n" %
(func.GetGLFunctionName(), func.MakeOriginalArgString("")))
- file.Write(" return error::kNoError;\n")
- file.Write("}\n")
- file.Write("\n")
+ f.write(" return error::kNoError;\n")
+ f.write("}\n")
+ f.write("\n")
- def WriteGLES2Implementation(self, func, file):
+ def WriteGLES2Implementation(self, func, f):
"""Overrriden from TypeHandler."""
impl_func = func.GetInfo('impl_func')
if impl_func == None or impl_func == True:
error_value = func.GetInfo("error_value") or "GL_FALSE"
- file.Write("%s GLES2Implementation::%s(%s) {\n" %
+ f.write("%s GLES2Implementation::%s(%s) {\n" %
(func.return_type, func.original_name,
func.MakeTypedOriginalArgString("")))
- file.Write(" GPU_CLIENT_SINGLE_THREAD_CHECK();\n")
- self.WriteTraceEvent(func, file)
- func.WriteDestinationInitalizationValidation(file)
- self.WriteClientGLCallLog(func, file)
- file.Write(" typedef cmds::%s::Result Result;\n" % func.name)
- file.Write(" Result* result = GetResultAs<Result*>();\n")
- file.Write(" if (!result) {\n")
- file.Write(" return %s;\n" % error_value)
- file.Write(" }\n")
- file.Write(" *result = 0;\n")
+ f.write(" GPU_CLIENT_SINGLE_THREAD_CHECK();\n")
+ self.WriteTraceEvent(func, f)
+ func.WriteDestinationInitalizationValidation(f)
+ self.WriteClientGLCallLog(func, f)
+ f.write(" typedef cmds::%s::Result Result;\n" % func.name)
+ f.write(" Result* result = GetResultAs<Result*>();\n")
+ f.write(" if (!result) {\n")
+ f.write(" return %s;\n" % error_value)
+ f.write(" }\n")
+ f.write(" *result = 0;\n")
assert len(func.GetOriginalArgs()) == 1
id_arg = func.GetOriginalArgs()[0]
if id_arg.type == 'GLsync':
arg_string = "ToGLuint(%s)" % func.MakeOriginalArgString("")
else:
arg_string = func.MakeOriginalArgString("")
- file.Write(
+ f.write(
" helper_->%s(%s, GetResultShmId(), GetResultShmOffset());\n" %
(func.name, arg_string))
- file.Write(" WaitForCmd();\n")
- file.Write(" %s result_value = *result" % func.return_type)
+ f.write(" WaitForCmd();\n")
+ f.write(" %s result_value = *result" % func.return_type)
if func.return_type == "GLboolean":
- file.Write(" != 0")
- file.Write(';\n GPU_CLIENT_LOG("returned " << result_value);\n')
- file.Write(" CheckGLError();\n")
- file.Write(" return result_value;\n")
- file.Write("}\n")
- file.Write("\n")
-
- def WriteGLES2ImplementationUnitTest(self, func, file):
+ f.write(" != 0")
+ f.write(';\n GPU_CLIENT_LOG("returned " << result_value);\n')
+ f.write(" CheckGLError();\n")
+ f.write(" return result_value;\n")
+ f.write("}\n")
+ f.write("\n")
+
+ def WriteGLES2ImplementationUnitTest(self, func, f):
"""Overrriden from TypeHandler."""
client_test = func.GetInfo('client_test')
if client_test == None or client_test == True:
@@ -8037,7 +8133,7 @@ TEST_F(GLES2ImplementationTest, %(name)s) {
"""
args = func.GetOriginalArgs()
assert len(args) == 1
- file.Write(code % {
+ f.write(code % {
'name': func.name,
'cmd_id_value': args[0].GetValidClientSideCmdArg(func),
'gl_id_value': args[0].GetValidClientSideArg(func) })
@@ -8047,9 +8143,6 @@ class STRnHandler(TypeHandler):
"""Handler for GetProgramInfoLog, GetShaderInfoLog, GetShaderSource, and
GetTranslatedShaderSourceANGLE."""
- def __init__(self):
- TypeHandler.__init__(self)
-
def InitFunction(self, func):
"""Overrriden from TypeHandler."""
# remove all but the first cmd args.
@@ -8059,7 +8152,7 @@ class STRnHandler(TypeHandler):
# add on a bucket id.
func.AddCmdArg(Argument('bucket_id', 'uint32_t'))
- def WriteGLES2Implementation(self, func, file):
+ def WriteGLES2Implementation(self, func, f):
"""Overrriden from TypeHandler."""
code_1 = """%(return_type)s GLES2Implementation::%(func_name)s(%(args)s) {
GPU_CLIENT_SINGLE_THREAD_CHECK();
@@ -8103,11 +8196,11 @@ class STRnHandler(TypeHandler):
'arg2': args[2].name,
'arg3': args[3].name,
}
- file.Write(code_1 % str_args)
- func.WriteDestinationInitalizationValidation(file)
- file.Write(code_2 % str_args)
+ f.write(code_1 % str_args)
+ func.WriteDestinationInitalizationValidation(f)
+ f.write(code_2 % str_args)
- def WriteServiceUnitTest(self, func, file, *extras):
+ def WriteServiceUnitTest(self, func, f, *extras):
"""Overrriden from TypeHandler."""
valid_test = """
TEST_P(%(test_name)s, %(name)sValidArgs) {
@@ -8147,7 +8240,7 @@ TEST_P(%(test_name)s, %(name)sValidArgs) {
" EXPECT_CALL(*gl_, %s(%s, %s, _))\n"
" .WillOnce(SetArgumentPointee<2>(strlen(kInfo) + 1));") % (
get_len_func[2:], id_name, get_len_enum)
- self.WriteValidUnitTest(func, file, valid_test, sub, *extras)
+ self.WriteValidUnitTest(func, f, valid_test, sub, *extras)
invalid_test = """
TEST_P(%(test_name)s, %(name)sInvalidArgs) {
@@ -8160,9 +8253,9 @@ TEST_P(%(test_name)s, %(name)sInvalidArgs) {
EXPECT_EQ(GL_INVALID_VALUE, GetGLError());
}
"""
- self.WriteValidUnitTest(func, file, invalid_test, *extras)
+ self.WriteValidUnitTest(func, f, invalid_test, *extras)
- def WriteServiceImplementation(self, func, file):
+ def WriteServiceImplementation(self, func, f):
"""Overrriden from TypeHandler."""
pass
@@ -8171,7 +8264,7 @@ class NamedType(object):
A type of an argument that is to be passed through in the command buffer
command. Currently used only for the arguments that are specificly named in
- the 'cmd_buffer_functions.txt' file, mostly enums.
+ the 'cmd_buffer_functions.txt' f, mostly enums.
"""
def __init__(self, info):
@@ -8337,42 +8430,37 @@ class Argument(object):
return 'GLES2Util::GetStringEnum(%s)' % self.name
return self.name
- def WriteGetCode(self, file):
+ def WriteGetCode(self, f):
"""Writes the code to get an argument from a command structure."""
if self.type == 'GLsync':
my_type = 'GLuint'
else:
my_type = self.type
- file.Write(" %s %s = static_cast<%s>(c.%s);\n" %
+ f.write(" %s %s = static_cast<%s>(c.%s);\n" %
(my_type, self.name, my_type, self.name))
- def WriteValidationCode(self, file, func):
+ def WriteValidationCode(self, f, func):
"""Writes the validation code for an argument."""
pass
- def WriteClientSideValidationCode(self, file, func):
+ def WriteClientSideValidationCode(self, f, func):
"""Writes the validation code for an argument."""
pass
- def WriteDestinationInitalizationValidation(self, file, func):
+ def WriteDestinationInitalizationValidation(self, f, func):
"""Writes the client side destintion initialization validation."""
pass
- def WriteDestinationInitalizationValidatationIfNeeded(self, file, func):
+ def WriteDestinationInitalizationValidatationIfNeeded(self, f, func):
"""Writes the client side destintion initialization validation if needed."""
parts = self.type.split(" ")
if len(parts) > 1:
return
if parts[0] in self.need_validation_:
- file.Write(
+ f.write(
" GPU_CLIENT_VALIDATE_DESTINATION_%sINITALIZATION(%s, %s);\n" %
("OPTIONAL_" if self.optional else "", self.type[:-1], self.name))
-
- def WriteGetAddress(self, file):
- """Writes the code to get the address this argument refers to."""
- pass
-
def GetImmediateVersion(self):
"""Gets the immediate version of this argument."""
return self
@@ -8411,11 +8499,11 @@ class UniformLocationArgument(Argument):
def __init__(self, name):
Argument.__init__(self, name, "GLint")
- def WriteGetCode(self, file):
+ def WriteGetCode(self, f):
"""Writes the code to get an argument from a command structure."""
code = """ %s %s = static_cast<%s>(c.%s);
"""
- file.Write(code % (self.type, self.name, self.type, self.name))
+ f.write(code % (self.type, self.name, self.type, self.name))
class DataSizeArgument(Argument):
"""class for data_size which Bucket commands do not need."""
@@ -8430,9 +8518,6 @@ class DataSizeArgument(Argument):
class SizeArgument(Argument):
"""class for GLsizei and GLsizeiptr."""
- def __init__(self, name, type):
- Argument.__init__(self, name, type)
-
def GetNumInvalidValues(self, func):
"""overridden from Argument."""
if func.IsImmediate():
@@ -8443,7 +8528,7 @@ class SizeArgument(Argument):
"""overridden from Argument."""
return ("-1", "kNoError", "GL_INVALID_VALUE")
- def WriteValidationCode(self, file, func):
+ def WriteValidationCode(self, f, func):
"""overridden from Argument."""
if func.IsUnsafe():
return
@@ -8452,19 +8537,19 @@ class SizeArgument(Argument):
return error::kNoError;
}
"""
- file.Write(code % {
+ f.write(code % {
"var_name": self.name,
"func_name": func.original_name,
})
- def WriteClientSideValidationCode(self, file, func):
+ def WriteClientSideValidationCode(self, f, func):
"""overridden from Argument."""
code = """ if (%(var_name)s < 0) {
SetGLError(GL_INVALID_VALUE, "gl%(func_name)s", "%(var_name)s < 0");
return;
}
"""
- file.Write(code % {
+ f.write(code % {
"var_name": self.name,
"func_name": func.original_name,
})
@@ -8480,7 +8565,7 @@ class SizeNotNegativeArgument(SizeArgument):
"""overridden from SizeArgument."""
return ("-1", "kOutOfBounds", "GL_NO_ERROR")
- def WriteValidationCode(self, file, func):
+ def WriteValidationCode(self, f, func):
"""overridden from SizeArgument."""
pass
@@ -8492,7 +8577,6 @@ class EnumBaseArgument(Argument):
def __init__(self, name, gl_type, type, gl_error):
Argument.__init__(self, name, gl_type)
- self.local_type = type
self.gl_error = gl_error
name = type[len(gl_type):]
self.type_name = name
@@ -8504,37 +8588,37 @@ class EnumBaseArgument(Argument):
def GetConstantValue(self):
return self.named_type.GetConstantValue()
- def WriteValidationCode(self, file, func):
+ def WriteValidationCode(self, f, func):
if func.IsUnsafe():
return
if self.named_type.IsConstant():
return
- file.Write(" if (!validators_->%s.IsValid(%s)) {\n" %
+ f.write(" if (!validators_->%s.IsValid(%s)) {\n" %
(ToUnderscore(self.type_name), self.name))
if self.gl_error == "GL_INVALID_ENUM":
- file.Write(
+ f.write(
" LOCAL_SET_GL_ERROR_INVALID_ENUM(\"gl%s\", %s, \"%s\");\n" %
(func.original_name, self.name, self.name))
else:
- file.Write(
+ f.write(
" LOCAL_SET_GL_ERROR(%s, \"gl%s\", \"%s %s\");\n" %
(self.gl_error, func.original_name, self.name, self.gl_error))
- file.Write(" return error::kNoError;\n")
- file.Write(" }\n")
+ f.write(" return error::kNoError;\n")
+ f.write(" }\n")
- def WriteClientSideValidationCode(self, file, func):
+ def WriteClientSideValidationCode(self, f, func):
if not self.named_type.IsConstant():
return
- file.Write(" if (%s != %s) {" % (self.name,
+ f.write(" if (%s != %s) {" % (self.name,
self.GetConstantValue()))
- file.Write(
+ f.write(
" SetGLError(%s, \"gl%s\", \"%s %s\");\n" %
(self.gl_error, func.original_name, self.name, self.gl_error))
if func.return_type == "void":
- file.Write(" return;\n")
+ f.write(" return;\n")
else:
- file.Write(" return %s;\n" % func.GetErrorReturnString())
- file.Write(" }\n")
+ f.write(" return %s;\n" % func.GetErrorReturnString())
+ f.write(" }\n")
def GetValidArg(self, func):
valid_arg = func.GetValidArg(self)
@@ -8542,7 +8626,6 @@ class EnumBaseArgument(Argument):
return valid_arg
valid = self.named_type.GetValidValues()
if valid:
- num_valid = len(valid)
return valid[0]
index = func.GetOriginalArgs().index(self)
@@ -8560,7 +8643,6 @@ class EnumBaseArgument(Argument):
valid = self.named_type.GetValidValues()
if valid:
- num_valid = len(valid)
return valid[0]
try:
@@ -8646,9 +8728,6 @@ class ImmediatePointerArgument(Argument):
An immediate argument is one where the data follows the command.
"""
- def __init__(self, name, type):
- Argument.__init__(self, name, type)
-
def IsPointer(self):
return True
@@ -8661,28 +8740,28 @@ class ImmediatePointerArgument(Argument):
"""Overridden from Argument."""
pass
- def WriteGetCode(self, file):
+ def WriteGetCode(self, f):
"""Overridden from Argument."""
- file.Write(
+ f.write(
" %s %s = GetImmediateDataAs<%s>(\n" %
(self.type, self.name, self.type))
- file.Write(" c, data_size, immediate_data_size);\n")
+ f.write(" c, data_size, immediate_data_size);\n")
- def WriteValidationCode(self, file, func):
+ def WriteValidationCode(self, f, func):
"""Overridden from Argument."""
if self.optional:
return
- file.Write(" if (%s == NULL) {\n" % self.name)
- file.Write(" return error::kOutOfBounds;\n")
- file.Write(" }\n")
+ f.write(" if (%s == NULL) {\n" % self.name)
+ f.write(" return error::kOutOfBounds;\n")
+ f.write(" }\n")
def GetImmediateVersion(self):
"""Overridden from Argument."""
return None
- def WriteDestinationInitalizationValidation(self, file, func):
+ def WriteDestinationInitalizationValidation(self, f, func):
"""Overridden from Argument."""
- self.WriteDestinationInitalizationValidatationIfNeeded(file, func)
+ self.WriteDestinationInitalizationValidatationIfNeeded(f, func)
def GetLogArg(self):
"""Overridden from Argument."""
@@ -8692,9 +8771,6 @@ class ImmediatePointerArgument(Argument):
class PointerArgument(Argument):
"""A class that represents a pointer argument to a function."""
- def __init__(self, name, type):
- Argument.__init__(self, name, type)
-
def IsPointer(self):
"""Overridden from Argument."""
return True
@@ -8737,31 +8813,22 @@ class PointerArgument(Argument):
args.append(Argument("%s_shm_id" % self.name, 'uint32_t'))
args.append(Argument("%s_shm_offset" % self.name, 'uint32_t'))
- def WriteGetCode(self, file):
+ def WriteGetCode(self, f):
"""Overridden from Argument."""
- file.Write(
+ f.write(
" %s %s = GetSharedMemoryAs<%s>(\n" %
(self.type, self.name, self.type))
- file.Write(
+ f.write(
" c.%s_shm_id, c.%s_shm_offset, data_size);\n" %
(self.name, self.name))
- def WriteGetAddress(self, file):
- """Overridden from Argument."""
- file.Write(
- " %s %s = GetSharedMemoryAs<%s>(\n" %
- (self.type, self.name, self.type))
- file.Write(
- " %s_shm_id, %s_shm_offset, %s_size);\n" %
- (self.name, self.name, self.name))
-
- def WriteValidationCode(self, file, func):
+ def WriteValidationCode(self, f, func):
"""Overridden from Argument."""
if self.optional:
return
- file.Write(" if (%s == NULL) {\n" % self.name)
- file.Write(" return error::kOutOfBounds;\n")
- file.Write(" }\n")
+ f.write(" if (%s == NULL) {\n" % self.name)
+ f.write(" return error::kOutOfBounds;\n")
+ f.write(" }\n")
def GetImmediateVersion(self):
"""Overridden from Argument."""
@@ -8775,28 +8842,25 @@ class PointerArgument(Argument):
return InputStringBucketArgument(self.name, self.type)
return BucketPointerArgument(self.name, self.type)
- def WriteDestinationInitalizationValidation(self, file, func):
+ def WriteDestinationInitalizationValidation(self, f, func):
"""Overridden from Argument."""
- self.WriteDestinationInitalizationValidatationIfNeeded(file, func)
+ self.WriteDestinationInitalizationValidatationIfNeeded(f, func)
class BucketPointerArgument(PointerArgument):
"""A class that represents an bucket argument to a function."""
- def __init__(self, name, type):
- Argument.__init__(self, name, type)
-
def AddCmdArgs(self, args):
"""Overridden from Argument."""
pass
- def WriteGetCode(self, file):
+ def WriteGetCode(self, f):
"""Overridden from Argument."""
- file.Write(
+ f.write(
" %s %s = bucket->GetData(0, data_size);\n" %
(self.type, self.name))
- def WriteValidationCode(self, file, func):
+ def WriteValidationCode(self, f, func):
"""Overridden from Argument."""
pass
@@ -8804,9 +8868,9 @@ class BucketPointerArgument(PointerArgument):
"""Overridden from Argument."""
return None
- def WriteDestinationInitalizationValidation(self, file, func):
+ def WriteDestinationInitalizationValidation(self, f, func):
"""Overridden from Argument."""
- self.WriteDestinationInitalizationValidatationIfNeeded(file, func)
+ self.WriteDestinationInitalizationValidatationIfNeeded(f, func)
def GetLogArg(self):
"""Overridden from Argument."""
@@ -8835,7 +8899,7 @@ class InputStringArrayBucketArgument(Argument):
Argument.__init__(self, name + "_bucket_id", "uint32_t")
self._original_name = name
- def WriteGetCode(self, file):
+ def WriteGetCode(self, f):
"""Overridden from Argument."""
code = """
Bucket* bucket = GetBucket(c.%(name)s);
@@ -8854,7 +8918,7 @@ class InputStringArrayBucketArgument(Argument):
len.size() > 0 ? const_cast<const GLint*>(&len[0]) : NULL;
(void)length;
"""
- file.Write(code % {
+ f.write(code % {
'name': self.name,
'original_name': self._original_name,
})
@@ -8886,13 +8950,13 @@ class ResourceIdArgument(Argument):
type = type.replace(match.group(1), "GLuint")
Argument.__init__(self, name, type)
- def WriteGetCode(self, file):
+ def WriteGetCode(self, f):
"""Overridden from Argument."""
if self.type == "GLsync":
my_type = "GLuint"
else:
my_type = self.type
- file.Write(" %s %s = c.%s;\n" % (my_type, self.name, self.name))
+ f.write(" %s %s = c.%s;\n" % (my_type, self.name, self.name))
def GetValidArg(self, func):
return "client_%s_id_" % self.resource_type.lower()
@@ -8912,11 +8976,11 @@ class ResourceIdBindArgument(Argument):
type = type.replace(match.group(1), "GLuint")
Argument.__init__(self, name, type)
- def WriteGetCode(self, file):
+ def WriteGetCode(self, f):
"""Overridden from Argument."""
code = """ %(type)s %(name)s = c.%(name)s;
"""
- file.Write(code % {'type': self.type, 'name': self.name})
+ f.write(code % {'type': self.type, 'name': self.name})
def GetValidArg(self, func):
return "client_%s_id_" % self.resource_type.lower()
@@ -8934,9 +8998,9 @@ class ResourceIdZeroArgument(Argument):
type = type.replace(match.group(1), "GLuint")
Argument.__init__(self, name, type)
- def WriteGetCode(self, file):
+ def WriteGetCode(self, f):
"""Overridden from Argument."""
- file.Write(" %s %s = c.%s;\n" % (self.type, self.name, self.name))
+ f.write(" %s %s = c.%s;\n" % (self.type, self.name, self.name))
def GetValidArg(self, func):
return "client_%s_id_" % self.resource_type.lower()
@@ -8981,7 +9045,6 @@ class Function(object):
'StateSetFrontBackSeparate': StateSetFrontBackSeparateHandler(),
'StateSetNamedParameter': StateSetNamedParameter(),
'STRn': STRnHandler(),
- 'Todo': TodoHandler(),
}
def __init__(self, name, info):
@@ -9186,17 +9249,6 @@ class Function(object):
["%s%s" % (prefix, arg.name) for arg in args])
return self._MaybePrependComma(arg_string, add_comma)
- def MakeTypedHelperArgString(self, prefix, add_comma = False):
- """Gets a list of typed GL arguments after removing unneeded arguments."""
- args = self.GetOriginalArgs()
- arg_string = ", ".join(
- ["%s %s%s" % (
- arg.type,
- prefix,
- arg.name,
- ) for arg in args if not arg.IsConstant()])
- return self._MaybePrependComma(arg_string, add_comma)
-
def MakeHelperArgString(self, prefix, add_comma = False, separator = ", "):
"""Gets a list of GL arguments after removing unneeded arguments."""
args = self.GetOriginalArgs()
@@ -9280,25 +9332,21 @@ class Function(object):
args = self.GetOriginalArgs()
return ' << ", " << '.join([arg.GetLogArg() for arg in args])
- def WriteCommandDescription(self, file):
- """Writes a description of the command."""
- file.Write("//! Command that corresponds to gl%s.\n" % self.original_name)
-
- def WriteHandlerValidation(self, file):
+ def WriteHandlerValidation(self, f):
"""Writes validation code for the function."""
for arg in self.GetOriginalArgs():
- arg.WriteValidationCode(file, self)
- self.WriteValidationCode(file)
+ arg.WriteValidationCode(f, self)
+ self.WriteValidationCode(f)
- def WriteHandlerImplementation(self, file):
+ def WriteHandlerImplementation(self, f):
"""Writes the handler implementation for this command."""
- self.type_handler.WriteHandlerImplementation(self, file)
+ self.type_handler.WriteHandlerImplementation(self, f)
- def WriteValidationCode(self, file):
+ def WriteValidationCode(self, f):
"""Writes the validation code for a command."""
pass
- def WriteCmdFlag(self, file):
+ def WriteCmdFlag(self, f):
"""Writes the cmd cmd_flags constant."""
flags = []
# By default trace only at the highest level 3.
@@ -9313,121 +9361,121 @@ class Function(object):
else:
cmd_flags = 0
- file.Write(" static const uint8 cmd_flags = %s;\n" % cmd_flags)
+ f.write(" static const uint8 cmd_flags = %s;\n" % cmd_flags)
- def WriteCmdArgFlag(self, file):
+ def WriteCmdArgFlag(self, f):
"""Writes the cmd kArgFlags constant."""
- file.Write(" static const cmd::ArgFlags kArgFlags = cmd::kFixed;\n")
+ f.write(" static const cmd::ArgFlags kArgFlags = cmd::kFixed;\n")
- def WriteCmdComputeSize(self, file):
+ def WriteCmdComputeSize(self, f):
"""Writes the ComputeSize function for the command."""
- file.Write(" static uint32_t ComputeSize() {\n")
- file.Write(
+ f.write(" static uint32_t ComputeSize() {\n")
+ f.write(
" return static_cast<uint32_t>(sizeof(ValueType)); // NOLINT\n")
- file.Write(" }\n")
- file.Write("\n")
+ f.write(" }\n")
+ f.write("\n")
- def WriteCmdSetHeader(self, file):
+ def WriteCmdSetHeader(self, f):
"""Writes the cmd's SetHeader function."""
- file.Write(" void SetHeader() {\n")
- file.Write(" header.SetCmd<ValueType>();\n")
- file.Write(" }\n")
- file.Write("\n")
+ f.write(" void SetHeader() {\n")
+ f.write(" header.SetCmd<ValueType>();\n")
+ f.write(" }\n")
+ f.write("\n")
- def WriteCmdInit(self, file):
+ def WriteCmdInit(self, f):
"""Writes the cmd's Init function."""
- file.Write(" void Init(%s) {\n" % self.MakeTypedCmdArgString("_"))
- file.Write(" SetHeader();\n")
+ f.write(" void Init(%s) {\n" % self.MakeTypedCmdArgString("_"))
+ f.write(" SetHeader();\n")
args = self.GetCmdArgs()
for arg in args:
- file.Write(" %s = _%s;\n" % (arg.name, arg.name))
- file.Write(" }\n")
- file.Write("\n")
+ f.write(" %s = _%s;\n" % (arg.name, arg.name))
+ f.write(" }\n")
+ f.write("\n")
- def WriteCmdSet(self, file):
+ def WriteCmdSet(self, f):
"""Writes the cmd's Set function."""
copy_args = self.MakeCmdArgString("_", False)
- file.Write(" void* Set(void* cmd%s) {\n" %
+ f.write(" void* Set(void* cmd%s) {\n" %
self.MakeTypedCmdArgString("_", True))
- file.Write(" static_cast<ValueType*>(cmd)->Init(%s);\n" % copy_args)
- file.Write(" return NextCmdAddress<ValueType>(cmd);\n")
- file.Write(" }\n")
- file.Write("\n")
+ f.write(" static_cast<ValueType*>(cmd)->Init(%s);\n" % copy_args)
+ f.write(" return NextCmdAddress<ValueType>(cmd);\n")
+ f.write(" }\n")
+ f.write("\n")
- def WriteStruct(self, file):
- self.type_handler.WriteStruct(self, file)
+ def WriteStruct(self, f):
+ self.type_handler.WriteStruct(self, f)
- def WriteDocs(self, file):
- self.type_handler.WriteDocs(self, file)
+ def WriteDocs(self, f):
+ self.type_handler.WriteDocs(self, f)
- def WriteCmdHelper(self, file):
+ def WriteCmdHelper(self, f):
"""Writes the cmd's helper."""
- self.type_handler.WriteCmdHelper(self, file)
+ self.type_handler.WriteCmdHelper(self, f)
- def WriteServiceImplementation(self, file):
+ def WriteServiceImplementation(self, f):
"""Writes the service implementation for a command."""
- self.type_handler.WriteServiceImplementation(self, file)
+ self.type_handler.WriteServiceImplementation(self, f)
- def WriteServiceUnitTest(self, file, *extras):
+ def WriteServiceUnitTest(self, f, *extras):
"""Writes the service implementation for a command."""
- self.type_handler.WriteServiceUnitTest(self, file, *extras)
+ self.type_handler.WriteServiceUnitTest(self, f, *extras)
- def WriteGLES2CLibImplementation(self, file):
+ def WriteGLES2CLibImplementation(self, f):
"""Writes the GLES2 C Lib Implemention."""
- self.type_handler.WriteGLES2CLibImplementation(self, file)
+ self.type_handler.WriteGLES2CLibImplementation(self, f)
- def WriteGLES2InterfaceHeader(self, file):
+ def WriteGLES2InterfaceHeader(self, f):
"""Writes the GLES2 Interface declaration."""
- self.type_handler.WriteGLES2InterfaceHeader(self, file)
+ self.type_handler.WriteGLES2InterfaceHeader(self, f)
- def WriteMojoGLES2ImplHeader(self, file):
+ def WriteMojoGLES2ImplHeader(self, f):
"""Writes the Mojo GLES2 implementation header declaration."""
- self.type_handler.WriteMojoGLES2ImplHeader(self, file)
+ self.type_handler.WriteMojoGLES2ImplHeader(self, f)
- def WriteMojoGLES2Impl(self, file):
+ def WriteMojoGLES2Impl(self, f):
"""Writes the Mojo GLES2 implementation declaration."""
- self.type_handler.WriteMojoGLES2Impl(self, file)
+ self.type_handler.WriteMojoGLES2Impl(self, f)
- def WriteGLES2InterfaceStub(self, file):
+ def WriteGLES2InterfaceStub(self, f):
"""Writes the GLES2 Interface Stub declaration."""
- self.type_handler.WriteGLES2InterfaceStub(self, file)
+ self.type_handler.WriteGLES2InterfaceStub(self, f)
- def WriteGLES2InterfaceStubImpl(self, file):
+ def WriteGLES2InterfaceStubImpl(self, f):
"""Writes the GLES2 Interface Stub declaration."""
- self.type_handler.WriteGLES2InterfaceStubImpl(self, file)
+ self.type_handler.WriteGLES2InterfaceStubImpl(self, f)
- def WriteGLES2ImplementationHeader(self, file):
+ def WriteGLES2ImplementationHeader(self, f):
"""Writes the GLES2 Implemention declaration."""
- self.type_handler.WriteGLES2ImplementationHeader(self, file)
+ self.type_handler.WriteGLES2ImplementationHeader(self, f)
- def WriteGLES2Implementation(self, file):
+ def WriteGLES2Implementation(self, f):
"""Writes the GLES2 Implemention definition."""
- self.type_handler.WriteGLES2Implementation(self, file)
+ self.type_handler.WriteGLES2Implementation(self, f)
- def WriteGLES2TraceImplementationHeader(self, file):
+ def WriteGLES2TraceImplementationHeader(self, f):
"""Writes the GLES2 Trace Implemention declaration."""
- self.type_handler.WriteGLES2TraceImplementationHeader(self, file)
+ self.type_handler.WriteGLES2TraceImplementationHeader(self, f)
- def WriteGLES2TraceImplementation(self, file):
+ def WriteGLES2TraceImplementation(self, f):
"""Writes the GLES2 Trace Implemention definition."""
- self.type_handler.WriteGLES2TraceImplementation(self, file)
+ self.type_handler.WriteGLES2TraceImplementation(self, f)
- def WriteGLES2Header(self, file):
+ def WriteGLES2Header(self, f):
"""Writes the GLES2 Implemention unit test."""
- self.type_handler.WriteGLES2Header(self, file)
+ self.type_handler.WriteGLES2Header(self, f)
- def WriteGLES2ImplementationUnitTest(self, file):
+ def WriteGLES2ImplementationUnitTest(self, f):
"""Writes the GLES2 Implemention unit test."""
- self.type_handler.WriteGLES2ImplementationUnitTest(self, file)
+ self.type_handler.WriteGLES2ImplementationUnitTest(self, f)
- def WriteDestinationInitalizationValidation(self, file):
+ def WriteDestinationInitalizationValidation(self, f):
"""Writes the client side destintion initialization validation."""
- self.type_handler.WriteDestinationInitalizationValidation(self, file)
+ self.type_handler.WriteDestinationInitalizationValidation(self, f)
- def WriteFormatTest(self, file):
+ def WriteFormatTest(self, f):
"""Writes the cmd's format test."""
- self.type_handler.WriteFormatTest(self, file)
+ self.type_handler.WriteFormatTest(self, f)
class PepperInterface(object):
@@ -9449,12 +9497,6 @@ class PepperInterface(object):
dev = "_DEV"
return "PPB_OPENGLES2%s%s_INTERFACE" % (upperint, dev)
- def GetInterfaceString(self):
- dev = ""
- if self.dev:
- dev = "(Dev)"
- return "PPB_OpenGLES2%s%s" % (self.name, dev)
-
def GetStructName(self):
dev = ""
if self.dev:
@@ -9495,54 +9537,49 @@ class ImmediateFunction(Function):
def IsImmediate(self):
return True
- def WriteCommandDescription(self, file):
+ def WriteServiceImplementation(self, f):
"""Overridden from Function"""
- file.Write("//! Immediate version of command that corresponds to gl%s.\n" %
- self.original_name)
+ self.type_handler.WriteImmediateServiceImplementation(self, f)
- def WriteServiceImplementation(self, file):
+ def WriteHandlerImplementation(self, f):
"""Overridden from Function"""
- self.type_handler.WriteImmediateServiceImplementation(self, file)
+ self.type_handler.WriteImmediateHandlerImplementation(self, f)
- def WriteHandlerImplementation(self, file):
- """Overridden from Function"""
- self.type_handler.WriteImmediateHandlerImplementation(self, file)
-
- def WriteServiceUnitTest(self, file, *extras):
+ def WriteServiceUnitTest(self, f, *extras):
"""Writes the service implementation for a command."""
- self.type_handler.WriteImmediateServiceUnitTest(self, file, *extras)
+ self.type_handler.WriteImmediateServiceUnitTest(self, f, *extras)
- def WriteValidationCode(self, file):
+ def WriteValidationCode(self, f):
"""Overridden from Function"""
- self.type_handler.WriteImmediateValidationCode(self, file)
+ self.type_handler.WriteImmediateValidationCode(self, f)
- def WriteCmdArgFlag(self, file):
+ def WriteCmdArgFlag(self, f):
"""Overridden from Function"""
- file.Write(" static const cmd::ArgFlags kArgFlags = cmd::kAtLeastN;\n")
+ f.write(" static const cmd::ArgFlags kArgFlags = cmd::kAtLeastN;\n")
- def WriteCmdComputeSize(self, file):
+ def WriteCmdComputeSize(self, f):
"""Overridden from Function"""
- self.type_handler.WriteImmediateCmdComputeSize(self, file)
+ self.type_handler.WriteImmediateCmdComputeSize(self, f)
- def WriteCmdSetHeader(self, file):
+ def WriteCmdSetHeader(self, f):
"""Overridden from Function"""
- self.type_handler.WriteImmediateCmdSetHeader(self, file)
+ self.type_handler.WriteImmediateCmdSetHeader(self, f)
- def WriteCmdInit(self, file):
+ def WriteCmdInit(self, f):
"""Overridden from Function"""
- self.type_handler.WriteImmediateCmdInit(self, file)
+ self.type_handler.WriteImmediateCmdInit(self, f)
- def WriteCmdSet(self, file):
+ def WriteCmdSet(self, f):
"""Overridden from Function"""
- self.type_handler.WriteImmediateCmdSet(self, file)
+ self.type_handler.WriteImmediateCmdSet(self, f)
- def WriteCmdHelper(self, file):
+ def WriteCmdHelper(self, f):
"""Overridden from Function"""
- self.type_handler.WriteImmediateCmdHelper(self, file)
+ self.type_handler.WriteImmediateCmdHelper(self, f)
- def WriteFormatTest(self, file):
+ def WriteFormatTest(self, f):
"""Overridden from Function"""
- self.type_handler.WriteImmediateFormatTest(self, file)
+ self.type_handler.WriteImmediateFormatTest(self, f)
class BucketFunction(Function):
@@ -9575,22 +9612,17 @@ class BucketFunction(Function):
Function.InitFunction(self)
- def WriteCommandDescription(self, file):
- """Overridden from Function"""
- file.Write("//! Bucket version of command that corresponds to gl%s.\n" %
- self.original_name)
-
- def WriteServiceImplementation(self, file):
+ def WriteServiceImplementation(self, f):
"""Overridden from Function"""
- self.type_handler.WriteBucketServiceImplementation(self, file)
+ self.type_handler.WriteBucketServiceImplementation(self, f)
- def WriteHandlerImplementation(self, file):
+ def WriteHandlerImplementation(self, f):
"""Overridden from Function"""
- self.type_handler.WriteBucketHandlerImplementation(self, file)
+ self.type_handler.WriteBucketHandlerImplementation(self, f)
- def WriteServiceUnitTest(self, file, *extras):
+ def WriteServiceUnitTest(self, f, *extras):
"""Overridden from Function"""
- self.type_handler.WriteBucketServiceUnitTest(self, file, *extras)
+ self.type_handler.WriteBucketServiceUnitTest(self, f, *extras)
def MakeOriginalArgString(self, prefix, add_comma = False, separator = ", "):
"""Overridden from Function"""
@@ -9687,27 +9719,10 @@ class GLGenerator(object):
print "Error: %s" % msg
self.errors += 1
- def WriteLicense(self, file):
- """Writes the license."""
- file.Write(_LICENSE)
-
- def WriteNamespaceOpen(self, file):
- """Writes the code for the namespace."""
- file.Write("namespace gpu {\n")
- file.Write("namespace gles2 {\n")
- file.Write("\n")
-
- def WriteNamespaceClose(self, file):
- """Writes the code to close the namespace."""
- file.Write("} // namespace gles2\n")
- file.Write("} // namespace gpu\n")
- file.Write("\n")
-
def ParseGLH(self, filename):
"""Parses the cmd_buffer_functions.txt file and extracts the functions"""
- f = open(filename, "r")
- functions = f.read()
- f.close()
+ with open(filename, "r") as f:
+ functions = f.read()
for line in functions.splitlines():
match = self._function_re.match(line)
if match:
@@ -9760,170 +9775,152 @@ class GLGenerator(object):
def WriteCommandIds(self, filename):
"""Writes the command buffer format"""
- file = CHeaderWriter(filename)
- file.Write("#define GLES2_COMMAND_LIST(OP) \\\n")
- id = 256
- for func in self.functions:
- file.Write(" %-60s /* %d */ \\\n" %
- ("OP(%s)" % func.name, id))
- id += 1
- file.Write("\n")
-
- file.Write("enum CommandId {\n")
- file.Write(" kStartPoint = cmd::kLastCommonId, "
- "// All GLES2 commands start after this.\n")
- file.Write("#define GLES2_CMD_OP(name) k ## name,\n")
- file.Write(" GLES2_COMMAND_LIST(GLES2_CMD_OP)\n")
- file.Write("#undef GLES2_CMD_OP\n")
- file.Write(" kNumCommands\n")
- file.Write("};\n")
- file.Write("\n")
- file.Close()
- self.generated_cpp_filenames.append(file.filename)
+ with CHeaderWriter(filename) as f:
+ f.write("#define GLES2_COMMAND_LIST(OP) \\\n")
+ id = 256
+ for func in self.functions:
+ f.write(" %-60s /* %d */ \\\n" %
+ ("OP(%s)" % func.name, id))
+ id += 1
+ f.write("\n")
+
+ f.write("enum CommandId {\n")
+ f.write(" kStartPoint = cmd::kLastCommonId, "
+ "// All GLES2 commands start after this.\n")
+ f.write("#define GLES2_CMD_OP(name) k ## name,\n")
+ f.write(" GLES2_COMMAND_LIST(GLES2_CMD_OP)\n")
+ f.write("#undef GLES2_CMD_OP\n")
+ f.write(" kNumCommands\n")
+ f.write("};\n")
+ f.write("\n")
+ self.generated_cpp_filenames.append(filename)
def WriteFormat(self, filename):
"""Writes the command buffer format"""
- file = CHeaderWriter(filename)
- # Forward declaration of a few enums used in constant argument
- # to avoid including GL header files.
- enum_defines = {
- 'GL_SYNC_GPU_COMMANDS_COMPLETE': '0x9117',
- 'GL_SYNC_FLUSH_COMMANDS_BIT': '0x00000001',
- }
- file.Write('\n')
- for enum in enum_defines:
- file.Write("#define %s %s\n" % (enum, enum_defines[enum]))
- file.Write('\n')
- for func in self.functions:
- if True:
- #gen_cmd = func.GetInfo('gen_cmd')
- #if gen_cmd == True or gen_cmd == None:
- func.WriteStruct(file)
- file.Write("\n")
- file.Close()
- self.generated_cpp_filenames.append(file.filename)
+ with CHeaderWriter(filename) as f:
+ # Forward declaration of a few enums used in constant argument
+ # to avoid including GL header files.
+ enum_defines = {
+ 'GL_SYNC_GPU_COMMANDS_COMPLETE': '0x9117',
+ 'GL_SYNC_FLUSH_COMMANDS_BIT': '0x00000001',
+ }
+ f.write('\n')
+ for enum in enum_defines:
+ f.write("#define %s %s\n" % (enum, enum_defines[enum]))
+ f.write('\n')
+ for func in self.functions:
+ if True:
+ #gen_cmd = func.GetInfo('gen_cmd')
+ #if gen_cmd == True or gen_cmd == None:
+ func.WriteStruct(f)
+ f.write("\n")
+ self.generated_cpp_filenames.append(filename)
def WriteDocs(self, filename):
"""Writes the command buffer doc version of the commands"""
- file = CWriter(filename)
- for func in self.functions:
- if True:
- #gen_cmd = func.GetInfo('gen_cmd')
- #if gen_cmd == True or gen_cmd == None:
- func.WriteDocs(file)
- file.Write("\n")
- file.Close()
- self.generated_cpp_filenames.append(file.filename)
+ with CHeaderWriter(filename) as f:
+ for func in self.functions:
+ if True:
+ #gen_cmd = func.GetInfo('gen_cmd')
+ #if gen_cmd == True or gen_cmd == None:
+ func.WriteDocs(f)
+ f.write("\n")
+ self.generated_cpp_filenames.append(filename)
def WriteFormatTest(self, filename):
"""Writes the command buffer format test."""
- file = CHeaderWriter(
- filename,
- "// This file contains unit tests for gles2 commmands\n"
- "// It is included by gles2_cmd_format_test.cc\n"
- "\n")
-
- for func in self.functions:
- if True:
- #gen_cmd = func.GetInfo('gen_cmd')
- #if gen_cmd == True or gen_cmd == None:
- func.WriteFormatTest(file)
-
- file.Close()
- self.generated_cpp_filenames.append(file.filename)
+ comment = ("// This file contains unit tests for gles2 commmands\n"
+ "// It is included by gles2_cmd_format_test.cc\n\n")
+ with CHeaderWriter(filename, comment) as f:
+ for func in self.functions:
+ if True:
+ #gen_cmd = func.GetInfo('gen_cmd')
+ #if gen_cmd == True or gen_cmd == None:
+ func.WriteFormatTest(f)
+ self.generated_cpp_filenames.append(filename)
def WriteCmdHelperHeader(self, filename):
"""Writes the gles2 command helper."""
- file = CHeaderWriter(filename)
-
- for func in self.functions:
- if True:
- #gen_cmd = func.GetInfo('gen_cmd')
- #if gen_cmd == True or gen_cmd == None:
- func.WriteCmdHelper(file)
-
- file.Close()
- self.generated_cpp_filenames.append(file.filename)
+ with CHeaderWriter(filename) as f:
+ for func in self.functions:
+ if True:
+ #gen_cmd = func.GetInfo('gen_cmd')
+ #if gen_cmd == True or gen_cmd == None:
+ func.WriteCmdHelper(f)
+ self.generated_cpp_filenames.append(filename)
def WriteServiceContextStateHeader(self, filename):
"""Writes the service context state header."""
- file = CHeaderWriter(
- filename,
- "// It is included by context_state.h\n")
- file.Write("struct EnableFlags {\n")
- file.Write(" EnableFlags();\n")
- for capability in _CAPABILITY_FLAGS:
- file.Write(" bool %s;\n" % capability['name'])
- file.Write(" bool cached_%s;\n" % capability['name'])
- file.Write("};\n\n")
-
- for state_name in sorted(_STATES.keys()):
- state = _STATES[state_name]
- for item in state['states']:
- if isinstance(item['default'], list):
- file.Write("%s %s[%d];\n" % (item['type'], item['name'],
- len(item['default'])))
- else:
- file.Write("%s %s;\n" % (item['type'], item['name']))
+ comment = "// It is included by context_state.h\n"
+ with CHeaderWriter(filename, comment) as f:
+ f.write("struct EnableFlags {\n")
+ f.write(" EnableFlags();\n")
+ for capability in _CAPABILITY_FLAGS:
+ f.write(" bool %s;\n" % capability['name'])
+ f.write(" bool cached_%s;\n" % capability['name'])
+ f.write("};\n\n")
- if item.get('cached', False):
+ for state_name in sorted(_STATES.keys()):
+ state = _STATES[state_name]
+ for item in state['states']:
if isinstance(item['default'], list):
- file.Write("%s cached_%s[%d];\n" % (item['type'], item['name'],
- len(item['default'])))
+ f.write("%s %s[%d];\n" % (item['type'], item['name'],
+ len(item['default'])))
else:
- file.Write("%s cached_%s;\n" % (item['type'], item['name']))
+ f.write("%s %s;\n" % (item['type'], item['name']))
- file.Write("\n")
+ if item.get('cached', False):
+ if isinstance(item['default'], list):
+ f.write("%s cached_%s[%d];\n" % (item['type'], item['name'],
+ len(item['default'])))
+ else:
+ f.write("%s cached_%s;\n" % (item['type'], item['name']))
- file.Write("""
- inline void SetDeviceCapabilityState(GLenum cap, bool enable) {
- switch (cap) {
- """)
- for capability in _CAPABILITY_FLAGS:
- file.Write("""\
- case GL_%s:
- """ % capability['name'].upper())
- file.Write("""\
- if (enable_flags.cached_%(name)s == enable &&
- !ignore_cached_state)
+ f.write("\n")
+ f.write("""
+ inline void SetDeviceCapabilityState(GLenum cap, bool enable) {
+ switch (cap) {
+ """)
+ for capability in _CAPABILITY_FLAGS:
+ f.write("""\
+ case GL_%s:
+ """ % capability['name'].upper())
+ f.write("""\
+ if (enable_flags.cached_%(name)s == enable &&
+ !ignore_cached_state)
+ return;
+ enable_flags.cached_%(name)s = enable;
+ break;
+ """ % capability)
+
+ f.write("""\
+ default:
+ NOTREACHED();
return;
- enable_flags.cached_%(name)s = enable;
- break;
- """ % capability)
-
- file.Write("""\
- default:
- NOTREACHED();
- return;
+ }
+ if (enable)
+ glEnable(cap);
+ else
+ glDisable(cap);
}
- if (enable)
- glEnable(cap);
- else
- glDisable(cap);
- }
- """)
-
- file.Close()
- self.generated_cpp_filenames.append(file.filename)
+ """)
+ self.generated_cpp_filenames.append(filename)
def WriteClientContextStateHeader(self, filename):
"""Writes the client context state header."""
- file = CHeaderWriter(
- filename,
- "// It is included by client_context_state.h\n")
- file.Write("struct EnableFlags {\n")
- file.Write(" EnableFlags();\n")
- for capability in _CAPABILITY_FLAGS:
- file.Write(" bool %s;\n" % capability['name'])
- file.Write("};\n\n")
-
- file.Close()
- self.generated_cpp_filenames.append(file.filename)
-
- def WriteContextStateGetters(self, file, class_name):
+ comment = "// It is included by client_context_state.h\n"
+ with CHeaderWriter(filename, comment) as f:
+ f.write("struct EnableFlags {\n")
+ f.write(" EnableFlags();\n")
+ for capability in _CAPABILITY_FLAGS:
+ f.write(" bool %s;\n" % capability['name'])
+ f.write("};\n\n")
+ self.generated_cpp_filenames.append(filename)
+
+ def WriteContextStateGetters(self, f, class_name):
"""Writes the state getters."""
for gl_type in ["GLint", "GLfloat"]:
- file.Write("""
+ f.write("""
bool %s::GetStateAs%s(
GLenum pname, %s* params, GLsizei* num_written) const {
switch (pname) {
@@ -9931,49 +9928,49 @@ bool %s::GetStateAs%s(
for state_name in sorted(_STATES.keys()):
state = _STATES[state_name]
if 'enum' in state:
- file.Write(" case %s:\n" % state['enum'])
- file.Write(" *num_written = %d;\n" % len(state['states']))
- file.Write(" if (params) {\n")
+ f.write(" case %s:\n" % state['enum'])
+ f.write(" *num_written = %d;\n" % len(state['states']))
+ f.write(" if (params) {\n")
for ndx,item in enumerate(state['states']):
- file.Write(" params[%d] = static_cast<%s>(%s);\n" %
+ f.write(" params[%d] = static_cast<%s>(%s);\n" %
(ndx, gl_type, item['name']))
- file.Write(" }\n")
- file.Write(" return true;\n")
+ f.write(" }\n")
+ f.write(" return true;\n")
else:
for item in state['states']:
- file.Write(" case %s:\n" % item['enum'])
+ f.write(" case %s:\n" % item['enum'])
if isinstance(item['default'], list):
item_len = len(item['default'])
- file.Write(" *num_written = %d;\n" % item_len)
- file.Write(" if (params) {\n")
+ f.write(" *num_written = %d;\n" % item_len)
+ f.write(" if (params) {\n")
if item['type'] == gl_type:
- file.Write(" memcpy(params, %s, sizeof(%s) * %d);\n" %
+ f.write(" memcpy(params, %s, sizeof(%s) * %d);\n" %
(item['name'], item['type'], item_len))
else:
- file.Write(" for (size_t i = 0; i < %s; ++i) {\n" %
+ f.write(" for (size_t i = 0; i < %s; ++i) {\n" %
item_len)
- file.Write(" params[i] = %s;\n" %
+ f.write(" params[i] = %s;\n" %
(GetGLGetTypeConversion(gl_type, item['type'],
"%s[i]" % item['name'])))
- file.Write(" }\n");
+ f.write(" }\n");
else:
- file.Write(" *num_written = 1;\n")
- file.Write(" if (params) {\n")
- file.Write(" params[0] = %s;\n" %
+ f.write(" *num_written = 1;\n")
+ f.write(" if (params) {\n")
+ f.write(" params[0] = %s;\n" %
(GetGLGetTypeConversion(gl_type, item['type'],
item['name'])))
- file.Write(" }\n")
- file.Write(" return true;\n")
+ f.write(" }\n")
+ f.write(" return true;\n")
for capability in _CAPABILITY_FLAGS:
- file.Write(" case GL_%s:\n" % capability['name'].upper())
- file.Write(" *num_written = 1;\n")
- file.Write(" if (params) {\n")
- file.Write(
+ f.write(" case GL_%s:\n" % capability['name'].upper())
+ f.write(" *num_written = 1;\n")
+ f.write(" if (params) {\n")
+ f.write(
" params[0] = static_cast<%s>(enable_flags.%s);\n" %
(gl_type, capability['name']))
- file.Write(" }\n")
- file.Write(" return true;\n")
- file.Write(""" default:
+ f.write(" }\n")
+ f.write(" return true;\n")
+ f.write(""" default:
return false;
}
}
@@ -9981,394 +9978,384 @@ bool %s::GetStateAs%s(
def WriteServiceContextStateImpl(self, filename):
"""Writes the context state service implementation."""
- file = CHeaderWriter(
- filename,
- "// It is included by context_state.cc\n")
- code = []
- for capability in _CAPABILITY_FLAGS:
- code.append("%s(%s)" %
- (capability['name'],
- ('false', 'true')['default' in capability]))
- code.append("cached_%s(%s)" %
- (capability['name'],
- ('false', 'true')['default' in capability]))
- file.Write("ContextState::EnableFlags::EnableFlags()\n : %s {\n}\n" %
- ",\n ".join(code))
- file.Write("\n")
-
- file.Write("void ContextState::Initialize() {\n")
- for state_name in sorted(_STATES.keys()):
- state = _STATES[state_name]
- for item in state['states']:
- if isinstance(item['default'], list):
- for ndx, value in enumerate(item['default']):
- file.Write(" %s[%d] = %s;\n" % (item['name'], ndx, value))
- else:
- file.Write(" %s = %s;\n" % (item['name'], item['default']))
- if item.get('cached', False):
+ comment = "// It is included by context_state.cc\n"
+ with CHeaderWriter(filename, comment) as f:
+ code = []
+ for capability in _CAPABILITY_FLAGS:
+ code.append("%s(%s)" %
+ (capability['name'],
+ ('false', 'true')['default' in capability]))
+ code.append("cached_%s(%s)" %
+ (capability['name'],
+ ('false', 'true')['default' in capability]))
+ f.write("ContextState::EnableFlags::EnableFlags()\n : %s {\n}\n" %
+ ",\n ".join(code))
+ f.write("\n")
+
+ f.write("void ContextState::Initialize() {\n")
+ for state_name in sorted(_STATES.keys()):
+ state = _STATES[state_name]
+ for item in state['states']:
if isinstance(item['default'], list):
for ndx, value in enumerate(item['default']):
- file.Write(" cached_%s[%d] = %s;\n" % (item['name'], ndx, value))
+ f.write(" %s[%d] = %s;\n" % (item['name'], ndx, value))
else:
- file.Write(" cached_%s = %s;\n" % (item['name'], item['default']))
- file.Write("}\n")
+ f.write(" %s = %s;\n" % (item['name'], item['default']))
+ if item.get('cached', False):
+ if isinstance(item['default'], list):
+ for ndx, value in enumerate(item['default']):
+ f.write(" cached_%s[%d] = %s;\n" % (item['name'], ndx, value))
+ else:
+ f.write(" cached_%s = %s;\n" % (item['name'], item['default']))
+ f.write("}\n")
- file.Write("""
+ f.write("""
void ContextState::InitCapabilities(const ContextState* prev_state) const {
""")
- def WriteCapabilities(test_prev, es3_caps):
- for capability in _CAPABILITY_FLAGS:
- capability_name = capability['name']
- capability_es3 = 'es3' in capability and capability['es3'] == True
- if capability_es3 and not es3_caps or not capability_es3 and es3_caps:
- continue
- if test_prev:
- file.Write(""" if (prev_state->enable_flags.cached_%s !=
- enable_flags.cached_%s) {\n""" %
- (capability_name, capability_name))
- file.Write(" EnableDisable(GL_%s, enable_flags.cached_%s);\n" %
- (capability_name.upper(), capability_name))
- if test_prev:
- file.Write(" }")
-
- file.Write(" if (prev_state) {")
- WriteCapabilities(True, False)
- file.Write(" if (feature_info_->IsES3Capable()) {\n")
- WriteCapabilities(True, True)
- file.Write(" }\n")
- file.Write(" } else {")
- WriteCapabilities(False, False)
- file.Write(" if (feature_info_->IsES3Capable()) {\n")
- WriteCapabilities(False, True)
- file.Write(" }\n")
- file.Write(" }")
-
- file.Write("""}
+ def WriteCapabilities(test_prev, es3_caps):
+ for capability in _CAPABILITY_FLAGS:
+ capability_name = capability['name']
+ capability_es3 = 'es3' in capability and capability['es3'] == True
+ if capability_es3 and not es3_caps or not capability_es3 and es3_caps:
+ continue
+ if test_prev:
+ f.write(""" if (prev_state->enable_flags.cached_%s !=
+ enable_flags.cached_%s) {\n""" %
+ (capability_name, capability_name))
+ f.write(" EnableDisable(GL_%s, enable_flags.cached_%s);\n" %
+ (capability_name.upper(), capability_name))
+ if test_prev:
+ f.write(" }")
+
+ f.write(" if (prev_state) {")
+ WriteCapabilities(True, False)
+ f.write(" if (feature_info_->IsES3Capable()) {\n")
+ WriteCapabilities(True, True)
+ f.write(" }\n")
+ f.write(" } else {")
+ WriteCapabilities(False, False)
+ f.write(" if (feature_info_->IsES3Capable()) {\n")
+ WriteCapabilities(False, True)
+ f.write(" }\n")
+ f.write(" }")
+ f.write("""}
void ContextState::InitState(const ContextState *prev_state) const {
""")
- def WriteStates(test_prev):
- # We need to sort the keys so the expectations match
- for state_name in sorted(_STATES.keys()):
- state = _STATES[state_name]
- if state['type'] == 'FrontBack':
- num_states = len(state['states'])
- for ndx, group in enumerate(Grouper(num_states / 2, state['states'])):
+ def WriteStates(test_prev):
+ # We need to sort the keys so the expectations match
+ for state_name in sorted(_STATES.keys()):
+ state = _STATES[state_name]
+ if state['type'] == 'FrontBack':
+ num_states = len(state['states'])
+ for ndx, group in enumerate(Grouper(num_states / 2,
+ state['states'])):
+ if test_prev:
+ f.write(" if (")
+ args = []
+ for place, item in enumerate(group):
+ item_name = CachedStateName(item)
+ args.append('%s' % item_name)
+ if test_prev:
+ if place > 0:
+ f.write(' ||\n')
+ f.write("(%s != prev_state->%s)" % (item_name, item_name))
+ if test_prev:
+ f.write(")\n")
+ f.write(
+ " gl%s(%s, %s);\n" %
+ (state['func'], ('GL_FRONT', 'GL_BACK')[ndx],
+ ", ".join(args)))
+ elif state['type'] == 'NamedParameter':
+ for item in state['states']:
+ item_name = CachedStateName(item)
+
+ if 'extension_flag' in item:
+ f.write(" if (feature_info_->feature_flags().%s) {\n " %
+ item['extension_flag'])
+ if test_prev:
+ if isinstance(item['default'], list):
+ f.write(" if (memcmp(prev_state->%s, %s, "
+ "sizeof(%s) * %d)) {\n" %
+ (item_name, item_name, item['type'],
+ len(item['default'])))
+ else:
+ f.write(" if (prev_state->%s != %s) {\n " %
+ (item_name, item_name))
+ if 'gl_version_flag' in item:
+ item_name = item['gl_version_flag']
+ inverted = ''
+ if item_name[0] == '!':
+ inverted = '!'
+ item_name = item_name[1:]
+ f.write(" if (%sfeature_info_->gl_version_info().%s) {\n" %
+ (inverted, item_name))
+ f.write(" gl%s(%s, %s);\n" %
+ (state['func'],
+ (item['enum_set']
+ if 'enum_set' in item else item['enum']),
+ item['name']))
+ if 'gl_version_flag' in item:
+ f.write(" }\n")
+ if test_prev:
+ if 'extension_flag' in item:
+ f.write(" ")
+ f.write(" }")
+ if 'extension_flag' in item:
+ f.write(" }")
+ else:
+ if 'extension_flag' in state:
+ f.write(" if (feature_info_->feature_flags().%s)\n " %
+ state['extension_flag'])
if test_prev:
- file.Write(" if (")
+ f.write(" if (")
args = []
- for place, item in enumerate(group):
+ for place, item in enumerate(state['states']):
item_name = CachedStateName(item)
args.append('%s' % item_name)
if test_prev:
if place > 0:
- file.Write(' ||\n')
- file.Write("(%s != prev_state->%s)" % (item_name, item_name))
- if test_prev:
- file.Write(")\n")
- file.Write(
- " gl%s(%s, %s);\n" %
- (state['func'], ('GL_FRONT', 'GL_BACK')[ndx], ", ".join(args)))
- elif state['type'] == 'NamedParameter':
- for item in state['states']:
- item_name = CachedStateName(item)
-
- if 'extension_flag' in item:
- file.Write(" if (feature_info_->feature_flags().%s) {\n " %
- item['extension_flag'])
- if test_prev:
- if isinstance(item['default'], list):
- file.Write(" if (memcmp(prev_state->%s, %s, "
- "sizeof(%s) * %d)) {\n" %
- (item_name, item_name, item['type'],
- len(item['default'])))
- else:
- file.Write(" if (prev_state->%s != %s) {\n " %
+ f.write(' ||\n')
+ f.write("(%s != prev_state->%s)" %
(item_name, item_name))
- if 'gl_version_flag' in item:
- item_name = item['gl_version_flag']
- inverted = ''
- if item_name[0] == '!':
- inverted = '!'
- item_name = item_name[1:]
- file.Write(" if (%sfeature_info_->gl_version_info().%s) {\n" %
- (inverted, item_name))
- file.Write(" gl%s(%s, %s);\n" %
- (state['func'],
- (item['enum_set']
- if 'enum_set' in item else item['enum']),
- item['name']))
- if 'gl_version_flag' in item:
- file.Write(" }\n")
if test_prev:
- if 'extension_flag' in item:
- file.Write(" ")
- file.Write(" }")
- if 'extension_flag' in item:
- file.Write(" }")
- else:
- if 'extension_flag' in state:
- file.Write(" if (feature_info_->feature_flags().%s)\n " %
- state['extension_flag'])
- if test_prev:
- file.Write(" if (")
- args = []
- for place, item in enumerate(state['states']):
- item_name = CachedStateName(item)
- args.append('%s' % item_name)
- if test_prev:
- if place > 0:
- file.Write(' ||\n')
- file.Write("(%s != prev_state->%s)" %
- (item_name, item_name))
- if test_prev:
- file.Write(" )\n")
- file.Write(" gl%s(%s);\n" % (state['func'], ", ".join(args)))
+ f.write(" )\n")
+ f.write(" gl%s(%s);\n" % (state['func'], ", ".join(args)))
- file.Write(" if (prev_state) {")
- WriteStates(True)
- file.Write(" } else {")
- WriteStates(False)
- file.Write(" }")
- file.Write("}\n")
+ f.write(" if (prev_state) {")
+ WriteStates(True)
+ f.write(" } else {")
+ WriteStates(False)
+ f.write(" }")
+ f.write("}\n")
- file.Write("""bool ContextState::GetEnabled(GLenum cap) const {
+ f.write("""bool ContextState::GetEnabled(GLenum cap) const {
switch (cap) {
""")
- for capability in _CAPABILITY_FLAGS:
- file.Write(" case GL_%s:\n" % capability['name'].upper())
- file.Write(" return enable_flags.%s;\n" % capability['name'])
- file.Write(""" default:
+ for capability in _CAPABILITY_FLAGS:
+ f.write(" case GL_%s:\n" % capability['name'].upper())
+ f.write(" return enable_flags.%s;\n" % capability['name'])
+ f.write(""" default:
NOTREACHED();
return false;
}
}
""")
-
- self.WriteContextStateGetters(file, "ContextState")
- file.Close()
- self.generated_cpp_filenames.append(file.filename)
+ self.WriteContextStateGetters(f, "ContextState")
+ self.generated_cpp_filenames.append(filename)
def WriteClientContextStateImpl(self, filename):
"""Writes the context state client side implementation."""
- file = CHeaderWriter(
- filename,
- "// It is included by client_context_state.cc\n")
- code = []
- for capability in _CAPABILITY_FLAGS:
- code.append("%s(%s)" %
- (capability['name'],
- ('false', 'true')['default' in capability]))
- file.Write(
- "ClientContextState::EnableFlags::EnableFlags()\n : %s {\n}\n" %
- ",\n ".join(code))
- file.Write("\n")
-
- file.Write("""
+ comment = "// It is included by client_context_state.cc\n"
+ with CHeaderWriter(filename, comment) as f:
+ code = []
+ for capability in _CAPABILITY_FLAGS:
+ code.append("%s(%s)" %
+ (capability['name'],
+ ('false', 'true')['default' in capability]))
+ f.write(
+ "ClientContextState::EnableFlags::EnableFlags()\n : %s {\n}\n" %
+ ",\n ".join(code))
+ f.write("\n")
+
+ f.write("""
bool ClientContextState::SetCapabilityState(
GLenum cap, bool enabled, bool* changed) {
*changed = false;
switch (cap) {
""")
- for capability in _CAPABILITY_FLAGS:
- file.Write(" case GL_%s:\n" % capability['name'].upper())
- file.Write(""" if (enable_flags.%(name)s != enabled) {
+ for capability in _CAPABILITY_FLAGS:
+ f.write(" case GL_%s:\n" % capability['name'].upper())
+ f.write(""" if (enable_flags.%(name)s != enabled) {
*changed = true;
enable_flags.%(name)s = enabled;
}
return true;
""" % capability)
- file.Write(""" default:
+ f.write(""" default:
return false;
}
}
""")
- file.Write("""bool ClientContextState::GetEnabled(
+ f.write("""bool ClientContextState::GetEnabled(
GLenum cap, bool* enabled) const {
switch (cap) {
""")
- for capability in _CAPABILITY_FLAGS:
- file.Write(" case GL_%s:\n" % capability['name'].upper())
- file.Write(" *enabled = enable_flags.%s;\n" % capability['name'])
- file.Write(" return true;\n")
- file.Write(""" default:
+ for capability in _CAPABILITY_FLAGS:
+ f.write(" case GL_%s:\n" % capability['name'].upper())
+ f.write(" *enabled = enable_flags.%s;\n" % capability['name'])
+ f.write(" return true;\n")
+ f.write(""" default:
return false;
}
}
""")
- file.Close()
- self.generated_cpp_filenames.append(file.filename)
+ self.generated_cpp_filenames.append(filename)
def WriteServiceImplementation(self, filename):
"""Writes the service decorder implementation."""
- file = CHeaderWriter(
- filename,
- "// It is included by gles2_cmd_decoder.cc\n")
-
- for func in self.functions:
- if True:
- #gen_cmd = func.GetInfo('gen_cmd')
- #if gen_cmd == True or gen_cmd == None:
- func.WriteServiceImplementation(file)
+ comment = "// It is included by gles2_cmd_decoder.cc\n"
+ with CHeaderWriter(filename, comment) as f:
+ for func in self.functions:
+ if True:
+ #gen_cmd = func.GetInfo('gen_cmd')
+ #if gen_cmd == True or gen_cmd == None:
+ func.WriteServiceImplementation(f)
- file.Write("""
+ f.write("""
bool GLES2DecoderImpl::SetCapabilityState(GLenum cap, bool enabled) {
switch (cap) {
""")
- for capability in _CAPABILITY_FLAGS:
- file.Write(" case GL_%s:\n" % capability['name'].upper())
- if 'state_flag' in capability:
-
- file.Write("""\
- state_.enable_flags.%(name)s = enabled;
- if (state_.enable_flags.cached_%(name)s != enabled
- || state_.ignore_cached_state) {
- %(state_flag)s = true;
- }
- return false;
- """ % capability)
- else:
- file.Write("""\
- state_.enable_flags.%(name)s = enabled;
- if (state_.enable_flags.cached_%(name)s != enabled
- || state_.ignore_cached_state) {
- state_.enable_flags.cached_%(name)s = enabled;
- return true;
- }
- return false;
- """ % capability)
- file.Write(""" default:
+ for capability in _CAPABILITY_FLAGS:
+ f.write(" case GL_%s:\n" % capability['name'].upper())
+ if 'state_flag' in capability:
+
+ f.write("""\
+ state_.enable_flags.%(name)s = enabled;
+ if (state_.enable_flags.cached_%(name)s != enabled
+ || state_.ignore_cached_state) {
+ %(state_flag)s = true;
+ }
+ return false;
+ """ % capability)
+ else:
+ f.write("""\
+ state_.enable_flags.%(name)s = enabled;
+ if (state_.enable_flags.cached_%(name)s != enabled
+ || state_.ignore_cached_state) {
+ state_.enable_flags.cached_%(name)s = enabled;
+ return true;
+ }
+ return false;
+ """ % capability)
+ f.write(""" default:
NOTREACHED();
return false;
}
}
""")
- file.Close()
- self.generated_cpp_filenames.append(file.filename)
+ self.generated_cpp_filenames.append(filename)
- def WriteServiceUnitTests(self, filename):
+ def WriteServiceUnitTests(self, filename_pattern):
"""Writes the service decorder unit tests."""
num_tests = len(self.functions)
FUNCTIONS_PER_FILE = 98 # hard code this so it doesn't change.
count = 0
for test_num in range(0, num_tests, FUNCTIONS_PER_FILE):
count += 1
- name = filename % count
- file = CHeaderWriter(
- name,
- "// It is included by gles2_cmd_decoder_unittest_%d.cc\n" % count)
- test_name = 'GLES2DecoderTest%d' % count
- end = test_num + FUNCTIONS_PER_FILE
- if end > num_tests:
- end = num_tests
- for idx in range(test_num, end):
- func = self.functions[idx]
-
- # Do any filtering of the functions here, so that the functions
- # will not move between the numbered files if filtering properties
- # are changed.
- if func.GetInfo('extension_flag'):
- continue
+ filename = filename_pattern % count
+ comment = "// It is included by gles2_cmd_decoder_unittest_%d.cc\n" \
+ % count
+ with CHeaderWriter(filename, comment) as f:
+ test_name = 'GLES2DecoderTest%d' % count
+ end = test_num + FUNCTIONS_PER_FILE
+ if end > num_tests:
+ end = num_tests
+ for idx in range(test_num, end):
+ func = self.functions[idx]
+
+ # Do any filtering of the functions here, so that the functions
+ # will not move between the numbered files if filtering properties
+ # are changed.
+ if func.GetInfo('extension_flag'):
+ continue
- if True:
- #gen_cmd = func.GetInfo('gen_cmd')
- #if gen_cmd == True or gen_cmd == None:
- if func.GetInfo('unit_test') == False:
- file.Write("// TODO(gman): %s\n" % func.name)
- else:
- func.WriteServiceUnitTest(file, {
- 'test_name': test_name
- })
- file.Close()
- self.generated_cpp_filenames.append(file.filename)
- file = CHeaderWriter(
- filename % 0,
- "// It is included by gles2_cmd_decoder_unittest_base.cc\n")
- file.Write(
+ if True:
+ #gen_cmd = func.GetInfo('gen_cmd')
+ #if gen_cmd == True or gen_cmd == None:
+ if func.GetInfo('unit_test') == False:
+ f.write("// TODO(gman): %s\n" % func.name)
+ else:
+ func.WriteServiceUnitTest(f, {
+ 'test_name': test_name
+ })
+ self.generated_cpp_filenames.append(filename)
+
+ comment = "// It is included by gles2_cmd_decoder_unittest_base.cc\n"
+ filename = filename_pattern % 0
+ with CHeaderWriter(filename, comment) as f:
+ f.write(
"""void GLES2DecoderTestBase::SetupInitCapabilitiesExpectations(
bool es3_capable) {""")
- for capability in _CAPABILITY_FLAGS:
- capability_es3 = 'es3' in capability and capability['es3'] == True
- if not capability_es3:
- file.Write(" ExpectEnableDisable(GL_%s, %s);\n" %
- (capability['name'].upper(),
- ('false', 'true')['default' in capability]))
-
- file.Write(" if (es3_capable) {")
- for capability in _CAPABILITY_FLAGS:
- capability_es3 = 'es3' in capability and capability['es3'] == True
- if capability_es3:
- file.Write(" ExpectEnableDisable(GL_%s, %s);\n" %
- (capability['name'].upper(),
- ('false', 'true')['default' in capability]))
- file.Write(""" }
+ for capability in _CAPABILITY_FLAGS:
+ capability_es3 = 'es3' in capability and capability['es3'] == True
+ if not capability_es3:
+ f.write(" ExpectEnableDisable(GL_%s, %s);\n" %
+ (capability['name'].upper(),
+ ('false', 'true')['default' in capability]))
+
+ f.write(" if (es3_capable) {")
+ for capability in _CAPABILITY_FLAGS:
+ capability_es3 = 'es3' in capability and capability['es3'] == True
+ if capability_es3:
+ f.write(" ExpectEnableDisable(GL_%s, %s);\n" %
+ (capability['name'].upper(),
+ ('false', 'true')['default' in capability]))
+ f.write(""" }
}
void GLES2DecoderTestBase::SetupInitStateExpectations() {
""")
-
- # We need to sort the keys so the expectations match
- for state_name in sorted(_STATES.keys()):
- state = _STATES[state_name]
- if state['type'] == 'FrontBack':
- num_states = len(state['states'])
- for ndx, group in enumerate(Grouper(num_states / 2, state['states'])):
+ # We need to sort the keys so the expectations match
+ for state_name in sorted(_STATES.keys()):
+ state = _STATES[state_name]
+ if state['type'] == 'FrontBack':
+ num_states = len(state['states'])
+ for ndx, group in enumerate(Grouper(num_states / 2, state['states'])):
+ args = []
+ for item in group:
+ if 'expected' in item:
+ args.append(item['expected'])
+ else:
+ args.append(item['default'])
+ f.write(
+ " EXPECT_CALL(*gl_, %s(%s, %s))\n" %
+ (state['func'], ('GL_FRONT', 'GL_BACK')[ndx], ", ".join(args)))
+ f.write(" .Times(1)\n")
+ f.write(" .RetiresOnSaturation();\n")
+ elif state['type'] == 'NamedParameter':
+ for item in state['states']:
+ if 'extension_flag' in item:
+ f.write(" if (group_->feature_info()->feature_flags().%s) {\n" %
+ item['extension_flag'])
+ f.write(" ")
+ expect_value = item['default']
+ if isinstance(expect_value, list):
+ # TODO: Currently we do not check array values.
+ expect_value = "_"
+
+ f.write(
+ " EXPECT_CALL(*gl_, %s(%s, %s))\n" %
+ (state['func'],
+ (item['enum_set']
+ if 'enum_set' in item else item['enum']),
+ expect_value))
+ f.write(" .Times(1)\n")
+ f.write(" .RetiresOnSaturation();\n")
+ if 'extension_flag' in item:
+ f.write(" }\n")
+ else:
+ if 'extension_flag' in state:
+ f.write(" if (group_->feature_info()->feature_flags().%s) {\n" %
+ state['extension_flag'])
+ f.write(" ")
args = []
- for item in group:
+ for item in state['states']:
if 'expected' in item:
args.append(item['expected'])
else:
args.append(item['default'])
- file.Write(
- " EXPECT_CALL(*gl_, %s(%s, %s))\n" %
- (state['func'], ('GL_FRONT', 'GL_BACK')[ndx], ", ".join(args)))
- file.Write(" .Times(1)\n")
- file.Write(" .RetiresOnSaturation();\n")
- elif state['type'] == 'NamedParameter':
- for item in state['states']:
- if 'extension_flag' in item:
- file.Write(" if (group_->feature_info()->feature_flags().%s) {\n" %
- item['extension_flag'])
- file.Write(" ")
- expect_value = item['default']
- if isinstance(expect_value, list):
- # TODO: Currently we do not check array values.
- expect_value = "_"
-
- file.Write(
- " EXPECT_CALL(*gl_, %s(%s, %s))\n" %
- (state['func'],
- (item['enum_set']
- if 'enum_set' in item else item['enum']),
- expect_value))
- file.Write(" .Times(1)\n")
- file.Write(" .RetiresOnSaturation();\n")
- if 'extension_flag' in item:
- file.Write(" }\n")
- else:
- if 'extension_flag' in state:
- file.Write(" if (group_->feature_info()->feature_flags().%s) {\n" %
- state['extension_flag'])
- file.Write(" ")
- args = []
- for item in state['states']:
- if 'expected' in item:
- args.append(item['expected'])
- else:
- args.append(item['default'])
- # TODO: Currently we do not check array values.
- args = ["_" if isinstance(arg, list) else arg for arg in args]
- file.Write(" EXPECT_CALL(*gl_, %s(%s))\n" %
- (state['func'], ", ".join(args)))
- file.Write(" .Times(1)\n")
- file.Write(" .RetiresOnSaturation();\n")
- if 'extension_flag' in state:
- file.Write(" }\n")
- file.Write("""}
-""")
- file.Close()
- self.generated_cpp_filenames.append(file.filename)
+ # TODO: Currently we do not check array values.
+ args = ["_" if isinstance(arg, list) else arg for arg in args]
+ f.write(" EXPECT_CALL(*gl_, %s(%s))\n" %
+ (state['func'], ", ".join(args)))
+ f.write(" .Times(1)\n")
+ f.write(" .RetiresOnSaturation();\n")
+ if 'extension_flag' in state:
+ f.write(" }\n")
+ f.write("}\n")
+ self.generated_cpp_filenames.append(filename)
def WriteServiceUnitTestsForExtensions(self, filename):
"""Writes the service decorder unit tests for functions with extension_flag.
@@ -10377,80 +10364,64 @@ void GLES2DecoderTestBase::SetupInitStateExpectations() {
baseclass to turn on the extension.
"""
functions = [f for f in self.functions if f.GetInfo('extension_flag')]
- file = CHeaderWriter(
- filename,
- "// It is included by gles2_cmd_decoder_unittest_extensions.cc\n")
- for func in functions:
- if True:
- if func.GetInfo('unit_test') == False:
- file.Write("// TODO(gman): %s\n" % func.name)
- else:
- extension = ToCamelCase(
- ToGLExtensionString(func.GetInfo('extension_flag')))
- func.WriteServiceUnitTest(file, {
- 'test_name': 'GLES2DecoderTestWith%s' % extension
- })
-
- file.Close()
- self.generated_cpp_filenames.append(file.filename)
+ comment = "// It is included by gles2_cmd_decoder_unittest_extensions.cc\n"
+ with CHeaderWriter(filename, comment) as f:
+ for func in functions:
+ if True:
+ if func.GetInfo('unit_test') == False:
+ f.write("// TODO(gman): %s\n" % func.name)
+ else:
+ extension = ToCamelCase(
+ ToGLExtensionString(func.GetInfo('extension_flag')))
+ func.WriteServiceUnitTest(f, {
+ 'test_name': 'GLES2DecoderTestWith%s' % extension
+ })
+ self.generated_cpp_filenames.append(filename)
def WriteGLES2Header(self, filename):
"""Writes the GLES2 header."""
- file = CHeaderWriter(
- filename,
- "// This file contains Chromium-specific GLES2 declarations.\n\n")
-
- for func in self.original_functions:
- func.WriteGLES2Header(file)
-
- file.Write("\n")
- file.Close()
- self.generated_cpp_filenames.append(file.filename)
+ comment = "// This file contains Chromium-specific GLES2 declarations.\n\n"
+ with CHeaderWriter(filename, comment) as f:
+ for func in self.original_functions:
+ func.WriteGLES2Header(f)
+ f.write("\n")
+ self.generated_cpp_filenames.append(filename)
def WriteGLES2CLibImplementation(self, filename):
"""Writes the GLES2 c lib implementation."""
- file = CHeaderWriter(
- filename,
- "// These functions emulate GLES2 over command buffers.\n")
-
- for func in self.original_functions:
- func.WriteGLES2CLibImplementation(file)
-
- file.Write("""
+ comment = "// These functions emulate GLES2 over command buffers.\n"
+ with CHeaderWriter(filename, comment) as f:
+ for func in self.original_functions:
+ func.WriteGLES2CLibImplementation(f)
+ f.write("""
namespace gles2 {
extern const NameToFunc g_gles2_function_table[] = {
""")
- for func in self.original_functions:
- file.Write(
- ' { "gl%s", reinterpret_cast<GLES2FunctionPointer>(gl%s), },\n' %
- (func.name, func.name))
- file.Write(""" { NULL, NULL, },
+ for func in self.original_functions:
+ f.write(
+ ' { "gl%s", reinterpret_cast<GLES2FunctionPointer>(gl%s), },\n' %
+ (func.name, func.name))
+ f.write(""" { NULL, NULL, },
};
} // namespace gles2
""")
- file.Close()
- self.generated_cpp_filenames.append(file.filename)
+ self.generated_cpp_filenames.append(filename)
def WriteGLES2InterfaceHeader(self, filename):
"""Writes the GLES2 interface header."""
- file = CHeaderWriter(
- filename,
- "// This file is included by gles2_interface.h to declare the\n"
- "// GL api functions.\n")
- for func in self.original_functions:
- func.WriteGLES2InterfaceHeader(file)
- file.Close()
- self.generated_cpp_filenames.append(file.filename)
+ comment = ("// This file is included by gles2_interface.h to declare the\n"
+ "// GL api functions.\n")
+ with CHeaderWriter(filename, comment) as f:
+ for func in self.original_functions:
+ func.WriteGLES2InterfaceHeader(f)
+ self.generated_cpp_filenames.append(filename)
def WriteMojoGLES2ImplHeader(self, filename):
"""Writes the Mojo GLES2 implementation header."""
- file = CHeaderWriter(
- filename,
- "// This file is included by gles2_interface.h to declare the\n"
- "// GL api functions.\n")
-
+ comment = ("// This file is included by gles2_interface.h to declare the\n"
+ "// GL api functions.\n")
code = """
#include "gpu/command_buffer/client/gles2_interface.h"
#include "third_party/mojo/src/mojo/public/c/gles2/gles2.h"
@@ -10464,220 +10435,195 @@ class MojoGLES2Impl : public gpu::gles2::GLES2Interface {
}
~MojoGLES2Impl() override {}
"""
- file.Write(code);
- for func in self.original_functions:
- func.WriteMojoGLES2ImplHeader(file)
- code = """
+ with CHeaderWriter(filename, comment) as f:
+ f.write(code);
+ for func in self.original_functions:
+ func.WriteMojoGLES2ImplHeader(f)
+ code = """
private:
MojoGLES2Context context_;
};
} // namespace mojo
- """
- file.Write(code);
- file.Close()
- self.generated_cpp_filenames.append(file.filename)
+ """
+ f.write(code);
+ self.generated_cpp_filenames.append(filename)
def WriteMojoGLES2Impl(self, filename):
"""Writes the Mojo GLES2 implementation."""
- file = CWriter(filename)
- file.Write(_LICENSE)
- file.Write(_DO_NOT_EDIT_WARNING)
-
code = """
#include "mojo/gpu/mojo_gles2_impl_autogen.h"
#include "base/logging.h"
-#include "third_party/mojo/src/mojo/public/c/gles2/chromium_copy_texture.h"
-#include "third_party/mojo/src/mojo/public/c/gles2/chromium_image.h"
-#include "third_party/mojo/src/mojo/public/c/gles2/chromium_miscellaneous.h"
-#include "third_party/mojo/src/mojo/public/c/gles2/chromium_pixel_transfer_buffer_object.h"
-#include "third_party/mojo/src/mojo/public/c/gles2/chromium_sub_image.h"
-#include "third_party/mojo/src/mojo/public/c/gles2/chromium_sync_point.h"
-#include "third_party/mojo/src/mojo/public/c/gles2/chromium_texture_mailbox.h"
+#include "third_party/mojo/src/mojo/public/c/gles2/chromium_extension.h"
#include "third_party/mojo/src/mojo/public/c/gles2/gles2.h"
-#include "third_party/mojo/src/mojo/public/c/gles2/occlusion_query_ext.h"
namespace mojo {
"""
- file.Write(code);
- for func in self.original_functions:
- func.WriteMojoGLES2Impl(file)
- code = """
+ with CWriter(filename) as f:
+ f.write(code);
+ for func in self.original_functions:
+ func.WriteMojoGLES2Impl(f)
+ code = """
} // namespace mojo
"""
- file.Write(code);
- file.Close()
- self.generated_cpp_filenames.append(file.filename)
+ f.write(code);
+ self.generated_cpp_filenames.append(filename)
def WriteGLES2InterfaceStub(self, filename):
"""Writes the GLES2 interface stub header."""
- file = CHeaderWriter(
- filename,
- "// This file is included by gles2_interface_stub.h.\n")
- for func in self.original_functions:
- func.WriteGLES2InterfaceStub(file)
- file.Close()
- self.generated_cpp_filenames.append(file.filename)
+ comment = "// This file is included by gles2_interface_stub.h.\n"
+ with CHeaderWriter(filename, comment) as f:
+ for func in self.original_functions:
+ func.WriteGLES2InterfaceStub(f)
+ self.generated_cpp_filenames.append(filename)
def WriteGLES2InterfaceStubImpl(self, filename):
"""Writes the GLES2 interface header."""
- file = CHeaderWriter(
- filename,
- "// This file is included by gles2_interface_stub.cc.\n")
- for func in self.original_functions:
- func.WriteGLES2InterfaceStubImpl(file)
- file.Close()
- self.generated_cpp_filenames.append(file.filename)
+ comment = "// This file is included by gles2_interface_stub.cc.\n"
+ with CHeaderWriter(filename, comment) as f:
+ for func in self.original_functions:
+ func.WriteGLES2InterfaceStubImpl(f)
+ self.generated_cpp_filenames.append(filename)
def WriteGLES2ImplementationHeader(self, filename):
"""Writes the GLES2 Implementation header."""
- file = CHeaderWriter(
- filename,
- "// This file is included by gles2_implementation.h to declare the\n"
- "// GL api functions.\n")
- for func in self.original_functions:
- func.WriteGLES2ImplementationHeader(file)
- file.Close()
- self.generated_cpp_filenames.append(file.filename)
+ comment = \
+ ("// This file is included by gles2_implementation.h to declare the\n"
+ "// GL api functions.\n")
+ with CHeaderWriter(filename, comment) as f:
+ for func in self.original_functions:
+ func.WriteGLES2ImplementationHeader(f)
+ self.generated_cpp_filenames.append(filename)
def WriteGLES2Implementation(self, filename):
"""Writes the GLES2 Implementation."""
- file = CHeaderWriter(
- filename,
- "// This file is included by gles2_implementation.cc to define the\n"
- "// GL api functions.\n")
- for func in self.original_functions:
- func.WriteGLES2Implementation(file)
- file.Close()
- self.generated_cpp_filenames.append(file.filename)
+ comment = \
+ ("// This file is included by gles2_implementation.cc to define the\n"
+ "// GL api functions.\n")
+ with CHeaderWriter(filename, comment) as f:
+ for func in self.original_functions:
+ func.WriteGLES2Implementation(f)
+ self.generated_cpp_filenames.append(filename)
def WriteGLES2TraceImplementationHeader(self, filename):
"""Writes the GLES2 Trace Implementation header."""
- file = CHeaderWriter(
- filename,
- "// This file is included by gles2_trace_implementation.h\n")
- for func in self.original_functions:
- func.WriteGLES2TraceImplementationHeader(file)
- file.Close()
- self.generated_cpp_filenames.append(file.filename)
+ comment = "// This file is included by gles2_trace_implementation.h\n"
+ with CHeaderWriter(filename, comment) as f:
+ for func in self.original_functions:
+ func.WriteGLES2TraceImplementationHeader(f)
+ self.generated_cpp_filenames.append(filename)
def WriteGLES2TraceImplementation(self, filename):
"""Writes the GLES2 Trace Implementation."""
- file = CHeaderWriter(
- filename,
- "// This file is included by gles2_trace_implementation.cc\n")
- for func in self.original_functions:
- func.WriteGLES2TraceImplementation(file)
- file.Close()
- self.generated_cpp_filenames.append(file.filename)
+ comment = "// This file is included by gles2_trace_implementation.cc\n"
+ with CHeaderWriter(filename, comment) as f:
+ for func in self.original_functions:
+ func.WriteGLES2TraceImplementation(f)
+ self.generated_cpp_filenames.append(filename)
def WriteGLES2ImplementationUnitTests(self, filename):
"""Writes the GLES2 helper header."""
- file = CHeaderWriter(
- filename,
- "// This file is included by gles2_implementation.h to declare the\n"
- "// GL api functions.\n")
- for func in self.original_functions:
- func.WriteGLES2ImplementationUnitTest(file)
- file.Close()
- self.generated_cpp_filenames.append(file.filename)
+ comment = \
+ ("// This file is included by gles2_implementation.h to declare the\n"
+ "// GL api functions.\n")
+ with CHeaderWriter(filename, comment) as f:
+ for func in self.original_functions:
+ func.WriteGLES2ImplementationUnitTest(f)
+ self.generated_cpp_filenames.append(filename)
def WriteServiceUtilsHeader(self, filename):
"""Writes the gles2 auto generated utility header."""
- file = CHeaderWriter(filename)
- for name in sorted(_NAMED_TYPE_INFO.keys()):
- named_type = NamedType(_NAMED_TYPE_INFO[name])
- if named_type.IsConstant():
- continue
- file.Write("ValueValidator<%s> %s;\n" %
- (named_type.GetType(), ToUnderscore(name)))
- file.Write("\n")
- file.Close()
- self.generated_cpp_filenames.append(file.filename)
+ with CHeaderWriter(filename) as f:
+ for name in sorted(_NAMED_TYPE_INFO.keys()):
+ named_type = NamedType(_NAMED_TYPE_INFO[name])
+ if named_type.IsConstant():
+ continue
+ f.write("ValueValidator<%s> %s;\n" %
+ (named_type.GetType(), ToUnderscore(name)))
+ f.write("\n")
+ self.generated_cpp_filenames.append(filename)
def WriteServiceUtilsImplementation(self, filename):
"""Writes the gles2 auto generated utility implementation."""
- file = CHeaderWriter(filename)
- names = sorted(_NAMED_TYPE_INFO.keys())
- for name in names:
- named_type = NamedType(_NAMED_TYPE_INFO[name])
- if named_type.IsConstant():
- continue
- if named_type.GetValidValues():
- file.Write("static const %s valid_%s_table[] = {\n" %
- (named_type.GetType(), ToUnderscore(name)))
- for value in named_type.GetValidValues():
- file.Write(" %s,\n" % value)
- file.Write("};\n")
- file.Write("\n")
- if named_type.GetValidValuesES3():
- file.Write("static const %s valid_%s_table_es3[] = {\n" %
- (named_type.GetType(), ToUnderscore(name)))
- for value in named_type.GetValidValuesES3():
- file.Write(" %s,\n" % value)
- file.Write("};\n")
- file.Write("\n")
- if named_type.GetDeprecatedValuesES3():
- file.Write("static const %s deprecated_%s_table_es3[] = {\n" %
- (named_type.GetType(), ToUnderscore(name)))
- for value in named_type.GetDeprecatedValuesES3():
- file.Write(" %s,\n" % value)
- file.Write("};\n")
- file.Write("\n")
- file.Write("Validators::Validators()")
- pre = ' : '
- for count, name in enumerate(names):
- named_type = NamedType(_NAMED_TYPE_INFO[name])
- if named_type.IsConstant():
- continue
- if named_type.GetValidValues():
- code = """%(pre)s%(name)s(
- valid_%(name)s_table, arraysize(valid_%(name)s_table))"""
- else:
- code = "%(pre)s%(name)s()"
- file.Write(code % {
- 'name': ToUnderscore(name),
- 'pre': pre,
- })
- pre = ',\n '
- file.Write(" {\n");
- file.Write("}\n\n");
-
- file.Write("void Validators::UpdateValuesES3() {\n")
- for name in names:
- named_type = NamedType(_NAMED_TYPE_INFO[name])
- if named_type.GetDeprecatedValuesES3():
- code = """ %(name)s.RemoveValues(
- deprecated_%(name)s_table_es3, arraysize(deprecated_%(name)s_table_es3));
-"""
- file.Write(code % {
+ with CHeaderWriter(filename) as f:
+ names = sorted(_NAMED_TYPE_INFO.keys())
+ for name in names:
+ named_type = NamedType(_NAMED_TYPE_INFO[name])
+ if named_type.IsConstant():
+ continue
+ if named_type.GetValidValues():
+ f.write("static const %s valid_%s_table[] = {\n" %
+ (named_type.GetType(), ToUnderscore(name)))
+ for value in named_type.GetValidValues():
+ f.write(" %s,\n" % value)
+ f.write("};\n")
+ f.write("\n")
+ if named_type.GetValidValuesES3():
+ f.write("static const %s valid_%s_table_es3[] = {\n" %
+ (named_type.GetType(), ToUnderscore(name)))
+ for value in named_type.GetValidValuesES3():
+ f.write(" %s,\n" % value)
+ f.write("};\n")
+ f.write("\n")
+ if named_type.GetDeprecatedValuesES3():
+ f.write("static const %s deprecated_%s_table_es3[] = {\n" %
+ (named_type.GetType(), ToUnderscore(name)))
+ for value in named_type.GetDeprecatedValuesES3():
+ f.write(" %s,\n" % value)
+ f.write("};\n")
+ f.write("\n")
+ f.write("Validators::Validators()")
+ pre = ' : '
+ for count, name in enumerate(names):
+ named_type = NamedType(_NAMED_TYPE_INFO[name])
+ if named_type.IsConstant():
+ continue
+ if named_type.GetValidValues():
+ code = """%(pre)s%(name)s(
+ valid_%(name)s_table, arraysize(valid_%(name)s_table))"""
+ else:
+ code = "%(pre)s%(name)s()"
+ f.write(code % {
'name': ToUnderscore(name),
+ 'pre': pre,
})
- if named_type.GetValidValuesES3():
- code = """ %(name)s.AddValues(
+ pre = ',\n '
+ f.write(" {\n");
+ f.write("}\n\n");
+
+ f.write("void Validators::UpdateValuesES3() {\n")
+ for name in names:
+ named_type = NamedType(_NAMED_TYPE_INFO[name])
+ if named_type.GetDeprecatedValuesES3():
+ code = """ %(name)s.RemoveValues(
+ deprecated_%(name)s_table_es3, arraysize(deprecated_%(name)s_table_es3));
+"""
+ f.write(code % {
+ 'name': ToUnderscore(name),
+ })
+ if named_type.GetValidValuesES3():
+ code = """ %(name)s.AddValues(
valid_%(name)s_table_es3, arraysize(valid_%(name)s_table_es3));
"""
- file.Write(code % {
- 'name': ToUnderscore(name),
- })
- file.Write("}\n\n");
- file.Close()
- self.generated_cpp_filenames.append(file.filename)
+ f.write(code % {
+ 'name': ToUnderscore(name),
+ })
+ f.write("}\n\n");
+ self.generated_cpp_filenames.append(filename)
def WriteCommonUtilsHeader(self, filename):
"""Writes the gles2 common utility header."""
- file = CHeaderWriter(filename)
- type_infos = sorted(_NAMED_TYPE_INFO.keys())
- for type_info in type_infos:
- if _NAMED_TYPE_INFO[type_info]['type'] == 'GLenum':
- file.Write("static std::string GetString%s(uint32_t value);\n" %
- type_info)
- file.Write("\n")
- file.Close()
- self.generated_cpp_filenames.append(file.filename)
+ with CHeaderWriter(filename) as f:
+ type_infos = sorted(_NAMED_TYPE_INFO.keys())
+ for type_info in type_infos:
+ if _NAMED_TYPE_INFO[type_info]['type'] == 'GLenum':
+ f.write("static std::string GetString%s(uint32_t value);\n" %
+ type_info)
+ f.write("\n")
+ self.generated_cpp_filenames.append(filename)
def WriteCommonUtilsImpl(self, filename):
"""Writes the gles2 common utility header."""
@@ -10703,12 +10649,12 @@ namespace mojo {
self.Error("code collision: %s and %s have the same code %s" %
(dict[value], name, value))
- file = CHeaderWriter(filename)
- file.Write("static const GLES2Util::EnumToString "
- "enum_to_string_table[] = {\n")
- for value in dict:
- file.Write(' { %s, "%s", },\n' % (value, dict[value]))
- file.Write("""};
+ with CHeaderWriter(filename) as f:
+ f.write("static const GLES2Util::EnumToString "
+ "enum_to_string_table[] = {\n")
+ for value in dict:
+ f.write(' { %s, "%s", },\n' % (value, dict[value]))
+ f.write("""};
const GLES2Util::EnumToString* const GLES2Util::enum_to_string_table_ =
enum_to_string_table;
@@ -10717,256 +10663,231 @@ const size_t GLES2Util::enum_to_string_table_len_ =
""")
- enums = sorted(_NAMED_TYPE_INFO.keys())
- for enum in enums:
- if _NAMED_TYPE_INFO[enum]['type'] == 'GLenum':
- file.Write("std::string GLES2Util::GetString%s(uint32_t value) {\n" %
- enum)
- valid_list = _NAMED_TYPE_INFO[enum]['valid']
- if 'valid_es3' in _NAMED_TYPE_INFO[enum]:
- valid_list = valid_list + _NAMED_TYPE_INFO[enum]['valid_es3']
- assert len(valid_list) == len(set(valid_list))
- if len(valid_list) > 0:
- file.Write(" static const EnumToString string_table[] = {\n")
- for value in valid_list:
- file.Write(' { %s, "%s" },\n' % (value, value))
- file.Write(""" };
+ enums = sorted(_NAMED_TYPE_INFO.keys())
+ for enum in enums:
+ if _NAMED_TYPE_INFO[enum]['type'] == 'GLenum':
+ f.write("std::string GLES2Util::GetString%s(uint32_t value) {\n" %
+ enum)
+ valid_list = _NAMED_TYPE_INFO[enum]['valid']
+ if 'valid_es3' in _NAMED_TYPE_INFO[enum]:
+ valid_list = valid_list + _NAMED_TYPE_INFO[enum]['valid_es3']
+ assert len(valid_list) == len(set(valid_list))
+ if len(valid_list) > 0:
+ f.write(" static const EnumToString string_table[] = {\n")
+ for value in valid_list:
+ f.write(' { %s, "%s" },\n' % (value, value))
+ f.write(""" };
return GLES2Util::GetQualifiedEnumString(
string_table, arraysize(string_table), value);
}
""")
- else:
- file.Write(""" return GLES2Util::GetQualifiedEnumString(
+ else:
+ f.write(""" return GLES2Util::GetQualifiedEnumString(
NULL, 0, value);
}
""")
- file.Close()
- self.generated_cpp_filenames.append(file.filename)
+ self.generated_cpp_filenames.append(filename)
def WritePepperGLES2Interface(self, filename, dev):
"""Writes the Pepper OpenGLES interface definition."""
- file = CWriter(filename)
- file.Write(_LICENSE)
- file.Write(_DO_NOT_EDIT_WARNING)
-
- file.Write("label Chrome {\n")
- file.Write(" M39 = 1.0\n")
- file.Write("};\n\n")
-
- if not dev:
- # Declare GL types.
- file.Write("[version=1.0]\n")
- file.Write("describe {\n")
- for gltype in ['GLbitfield', 'GLboolean', 'GLbyte', 'GLclampf',
- 'GLclampx', 'GLenum', 'GLfixed', 'GLfloat', 'GLint',
- 'GLintptr', 'GLshort', 'GLsizei', 'GLsizeiptr',
- 'GLubyte', 'GLuint', 'GLushort']:
- file.Write(" %s;\n" % gltype)
- file.Write(" %s_ptr_t;\n" % gltype)
- file.Write("};\n\n")
-
- # C level typedefs.
- file.Write("#inline c\n")
- file.Write("#include \"ppapi/c/pp_resource.h\"\n")
- if dev:
- file.Write("#include \"ppapi/c/ppb_opengles2.h\"\n\n")
- else:
- file.Write("\n#ifndef __gl2_h_\n")
- for (k, v) in _GL_TYPES.iteritems():
- file.Write("typedef %s %s;\n" % (v, k))
- file.Write("#ifdef _WIN64\n")
- for (k, v) in _GL_TYPES_64.iteritems():
- file.Write("typedef %s %s;\n" % (v, k))
- file.Write("#else\n")
- for (k, v) in _GL_TYPES_32.iteritems():
- file.Write("typedef %s %s;\n" % (v, k))
- file.Write("#endif // _WIN64\n")
- file.Write("#endif // __gl2_h_\n\n")
- file.Write("#endinl\n")
-
- for interface in self.pepper_interfaces:
- if interface.dev != dev:
- continue
- # Historically, we provide OpenGLES2 interfaces with struct
- # namespace. Not to break code which uses the interface as
- # "struct OpenGLES2", we put it in struct namespace.
- file.Write('\n[macro="%s", force_struct_namespace]\n' %
- interface.GetInterfaceName())
- file.Write("interface %s {\n" % interface.GetStructName())
- for func in self.original_functions:
- if not func.InPepperInterface(interface):
+ with CWriter(filename) as f:
+ f.write("label Chrome {\n")
+ f.write(" M39 = 1.0\n")
+ f.write("};\n\n")
+
+ if not dev:
+ # Declare GL types.
+ f.write("[version=1.0]\n")
+ f.write("describe {\n")
+ for gltype in ['GLbitfield', 'GLboolean', 'GLbyte', 'GLclampf',
+ 'GLclampx', 'GLenum', 'GLfixed', 'GLfloat', 'GLint',
+ 'GLintptr', 'GLshort', 'GLsizei', 'GLsizeiptr',
+ 'GLubyte', 'GLuint', 'GLushort']:
+ f.write(" %s;\n" % gltype)
+ f.write(" %s_ptr_t;\n" % gltype)
+ f.write("};\n\n")
+
+ # C level typedefs.
+ f.write("#inline c\n")
+ f.write("#include \"ppapi/c/pp_resource.h\"\n")
+ if dev:
+ 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():
+ f.write("typedef %s %s;\n" % (v, k))
+ f.write("#ifdef _WIN64\n")
+ for (k, v) in _GL_TYPES_64.iteritems():
+ f.write("typedef %s %s;\n" % (v, k))
+ f.write("#else\n")
+ for (k, v) in _GL_TYPES_32.iteritems():
+ f.write("typedef %s %s;\n" % (v, k))
+ f.write("#endif // _WIN64\n")
+ f.write("#endif // __gl2_h_\n\n")
+ f.write("#endinl\n")
+
+ for interface in self.pepper_interfaces:
+ if interface.dev != dev:
continue
+ # Historically, we provide OpenGLES2 interfaces with struct
+ # namespace. Not to break code which uses the interface as
+ # "struct OpenGLES2", we put it in struct namespace.
+ f.write('\n[macro="%s", force_struct_namespace]\n' %
+ interface.GetInterfaceName())
+ f.write("interface %s {\n" % interface.GetStructName())
+ for func in self.original_functions:
+ if not func.InPepperInterface(interface):
+ continue
- ret_type = func.MapCTypeToPepperIdlType(func.return_type,
- is_for_return_type=True)
- func_prefix = " %s %s(" % (ret_type, func.GetPepperName())
- file.Write(func_prefix)
- file.Write("[in] PP_Resource context")
- for arg in func.MakeTypedPepperIdlArgStrings():
- file.Write(",\n" + " " * len(func_prefix) + arg)
- file.Write(");\n")
- file.Write("};\n\n")
-
-
- file.Close()
+ ret_type = func.MapCTypeToPepperIdlType(func.return_type,
+ is_for_return_type=True)
+ func_prefix = " %s %s(" % (ret_type, func.GetPepperName())
+ f.write(func_prefix)
+ f.write("[in] PP_Resource context")
+ for arg in func.MakeTypedPepperIdlArgStrings():
+ f.write(",\n" + " " * len(func_prefix) + arg)
+ f.write(");\n")
+ f.write("};\n\n")
def WritePepperGLES2Implementation(self, filename):
"""Writes the Pepper OpenGLES interface implementation."""
+ with CWriter(filename) as f:
+ f.write("#include \"ppapi/shared_impl/ppb_opengles2_shared.h\"\n\n")
+ f.write("#include \"base/logging.h\"\n")
+ f.write("#include \"gpu/command_buffer/client/gles2_implementation.h\"\n")
+ f.write("#include \"ppapi/shared_impl/ppb_graphics_3d_shared.h\"\n")
+ f.write("#include \"ppapi/thunk/enter.h\"\n\n")
+
+ f.write("namespace ppapi {\n\n")
+ f.write("namespace {\n\n")
+
+ f.write("typedef thunk::EnterResource<thunk::PPB_Graphics3D_API>"
+ " Enter3D;\n\n")
+
+ f.write("gpu::gles2::GLES2Implementation* ToGles2Impl(Enter3D*"
+ " enter) {\n")
+ f.write(" DCHECK(enter);\n")
+ f.write(" DCHECK(enter->succeeded());\n")
+ f.write(" return static_cast<PPB_Graphics3D_Shared*>(enter->object())->"
+ "gles2_impl();\n");
+ f.write("}\n\n");
- file = CWriter(filename)
- file.Write(_LICENSE)
- file.Write(_DO_NOT_EDIT_WARNING)
-
- file.Write("#include \"ppapi/shared_impl/ppb_opengles2_shared.h\"\n\n")
- file.Write("#include \"base/logging.h\"\n")
- file.Write("#include \"gpu/command_buffer/client/gles2_implementation.h\"\n")
- file.Write("#include \"ppapi/shared_impl/ppb_graphics_3d_shared.h\"\n")
- file.Write("#include \"ppapi/thunk/enter.h\"\n\n")
-
- file.Write("namespace ppapi {\n\n")
- file.Write("namespace {\n\n")
-
- file.Write("typedef thunk::EnterResource<thunk::PPB_Graphics3D_API>"
- " Enter3D;\n\n")
-
- file.Write("gpu::gles2::GLES2Implementation* ToGles2Impl(Enter3D*"
- " enter) {\n")
- file.Write(" DCHECK(enter);\n")
- file.Write(" DCHECK(enter->succeeded());\n")
- file.Write(" return static_cast<PPB_Graphics3D_Shared*>(enter->object())->"
- "gles2_impl();\n");
- file.Write("}\n\n");
-
- for func in self.original_functions:
- if not func.InAnyPepperExtension():
- continue
+ for func in self.original_functions:
+ if not func.InAnyPepperExtension():
+ continue
- original_arg = func.MakeTypedPepperArgString("")
- context_arg = "PP_Resource context_id"
- if len(original_arg):
- arg = context_arg + ", " + original_arg
- else:
- arg = context_arg
- file.Write("%s %s(%s) {\n" %
- (func.return_type, func.GetPepperName(), arg))
- file.Write(" Enter3D enter(context_id, true);\n")
- file.Write(" if (enter.succeeded()) {\n")
-
- return_str = "" if func.return_type == "void" else "return "
- file.Write(" %sToGles2Impl(&enter)->%s(%s);\n" %
- (return_str, func.original_name,
- func.MakeOriginalArgString("")))
- file.Write(" }")
- if func.return_type == "void":
- file.Write("\n")
- else:
- file.Write(" else {\n")
- file.Write(" return %s;\n" % func.GetErrorReturnString())
- file.Write(" }\n")
- file.Write("}\n\n")
-
- file.Write("} // namespace\n")
-
- for interface in self.pepper_interfaces:
- file.Write("const %s* PPB_OpenGLES2_Shared::Get%sInterface() {\n" %
- (interface.GetStructName(), interface.GetName()))
- file.Write(" static const struct %s "
- "ppb_opengles2 = {\n" % interface.GetStructName())
- file.Write(" &")
- file.Write(",\n &".join(
- f.GetPepperName() for f in self.original_functions
- if f.InPepperInterface(interface)))
- file.Write("\n")
-
- file.Write(" };\n")
- file.Write(" return &ppb_opengles2;\n")
- file.Write("}\n")
-
- file.Write("} // namespace ppapi\n")
- file.Close()
- self.generated_cpp_filenames.append(file.filename)
+ original_arg = func.MakeTypedPepperArgString("")
+ context_arg = "PP_Resource context_id"
+ if len(original_arg):
+ arg = context_arg + ", " + original_arg
+ else:
+ arg = context_arg
+ f.write("%s %s(%s) {\n" %
+ (func.return_type, func.GetPepperName(), arg))
+ f.write(" Enter3D enter(context_id, true);\n")
+ f.write(" if (enter.succeeded()) {\n")
+
+ return_str = "" if func.return_type == "void" else "return "
+ f.write(" %sToGles2Impl(&enter)->%s(%s);\n" %
+ (return_str, func.original_name,
+ func.MakeOriginalArgString("")))
+ f.write(" }")
+ if func.return_type == "void":
+ f.write("\n")
+ else:
+ f.write(" else {\n")
+ f.write(" return %s;\n" % func.GetErrorReturnString())
+ f.write(" }\n")
+ f.write("}\n\n")
+
+ f.write("} // namespace\n")
+
+ for interface in self.pepper_interfaces:
+ f.write("const %s* PPB_OpenGLES2_Shared::Get%sInterface() {\n" %
+ (interface.GetStructName(), interface.GetName()))
+ f.write(" static const struct %s "
+ "ppb_opengles2 = {\n" % interface.GetStructName())
+ f.write(" &")
+ f.write(",\n &".join(
+ f.GetPepperName() for f in self.original_functions
+ if f.InPepperInterface(interface)))
+ f.write("\n")
+
+ f.write(" };\n")
+ f.write(" return &ppb_opengles2;\n")
+ f.write("}\n")
+
+ f.write("} // namespace ppapi\n")
+ self.generated_cpp_filenames.append(filename)
def WriteGLES2ToPPAPIBridge(self, filename):
"""Connects GLES2 helper library to PPB_OpenGLES2 interface"""
+ with CWriter(filename) as f:
+ f.write("#ifndef GL_GLEXT_PROTOTYPES\n")
+ f.write("#define GL_GLEXT_PROTOTYPES\n")
+ f.write("#endif\n")
+ f.write("#include <GLES2/gl2.h>\n")
+ f.write("#include <GLES2/gl2ext.h>\n")
+ f.write("#include \"ppapi/lib/gl/gles2/gl2ext_ppapi.h\"\n\n")
- file = CWriter(filename)
- file.Write(_LICENSE)
- file.Write(_DO_NOT_EDIT_WARNING)
-
- file.Write("#ifndef GL_GLEXT_PROTOTYPES\n")
- file.Write("#define GL_GLEXT_PROTOTYPES\n")
- file.Write("#endif\n")
- file.Write("#include <GLES2/gl2.h>\n")
- file.Write("#include <GLES2/gl2ext.h>\n")
- file.Write("#include \"ppapi/lib/gl/gles2/gl2ext_ppapi.h\"\n\n")
-
- for func in self.original_functions:
- if not func.InAnyPepperExtension():
- continue
+ for func in self.original_functions:
+ if not func.InAnyPepperExtension():
+ continue
- interface = self.interface_info[func.GetInfo('pepper_interface') or '']
-
- file.Write("%s GL_APIENTRY gl%s(%s) {\n" %
- (func.return_type, func.GetPepperName(),
- func.MakeTypedPepperArgString("")))
- return_str = "" if func.return_type == "void" else "return "
- interface_str = "glGet%sInterfacePPAPI()" % interface.GetName()
- original_arg = func.MakeOriginalArgString("")
- context_arg = "glGetCurrentContextPPAPI()"
- if len(original_arg):
- arg = context_arg + ", " + original_arg
- else:
- arg = context_arg
- if interface.GetName():
- file.Write(" const struct %s* ext = %s;\n" %
- (interface.GetStructName(), interface_str))
- file.Write(" if (ext)\n")
- file.Write(" %sext->%s(%s);\n" %
- (return_str, func.GetPepperName(), arg))
- if return_str:
- file.Write(" %s0;\n" % return_str)
- else:
- file.Write(" %s%s->%s(%s);\n" %
- (return_str, interface_str, func.GetPepperName(), arg))
- file.Write("}\n\n")
- file.Close()
- self.generated_cpp_filenames.append(file.filename)
+ interface = self.interface_info[func.GetInfo('pepper_interface') or '']
+
+ f.write("%s GL_APIENTRY gl%s(%s) {\n" %
+ (func.return_type, func.GetPepperName(),
+ func.MakeTypedPepperArgString("")))
+ return_str = "" if func.return_type == "void" else "return "
+ interface_str = "glGet%sInterfacePPAPI()" % interface.GetName()
+ original_arg = func.MakeOriginalArgString("")
+ context_arg = "glGetCurrentContextPPAPI()"
+ if len(original_arg):
+ arg = context_arg + ", " + original_arg
+ else:
+ arg = context_arg
+ if interface.GetName():
+ f.write(" const struct %s* ext = %s;\n" %
+ (interface.GetStructName(), interface_str))
+ f.write(" if (ext)\n")
+ f.write(" %sext->%s(%s);\n" %
+ (return_str, func.GetPepperName(), arg))
+ if return_str:
+ f.write(" %s0;\n" % return_str)
+ else:
+ f.write(" %s%s->%s(%s);\n" %
+ (return_str, interface_str, func.GetPepperName(), arg))
+ f.write("}\n\n")
+ self.generated_cpp_filenames.append(filename)
def WriteMojoGLCallVisitor(self, filename):
"""Provides the GL implementation for mojo"""
- file = CWriter(filename)
- file.Write(_LICENSE)
- file.Write(_DO_NOT_EDIT_WARNING)
-
- for func in self.original_functions:
- if not func.IsCoreGLFunction():
- continue
- file.Write("VISIT_GL_CALL(%s, %s, (%s), (%s))\n" %
- (func.name, func.return_type,
- func.MakeTypedOriginalArgString(""),
- func.MakeOriginalArgString("")))
-
- file.Close()
- self.generated_cpp_filenames.append(file.filename)
-
- def WriteMojoGLCallVisitorForExtension(self, filename, extension):
- """Provides the GL implementation for mojo for a particular extension"""
- file = CWriter(filename)
- file.Write(_LICENSE)
- file.Write(_DO_NOT_EDIT_WARNING)
-
- for func in self.original_functions:
- if func.GetInfo("extension") != extension:
- continue
- file.Write("VISIT_GL_CALL(%s, %s, (%s), (%s))\n" %
- (func.name, func.return_type,
- func.MakeTypedOriginalArgString(""),
- func.MakeOriginalArgString("")))
-
- file.Close()
- self.generated_cpp_filenames.append(file.filename)
+ with CWriter(filename) as f:
+ for func in self.original_functions:
+ if not func.IsCoreGLFunction():
+ continue
+ f.write("VISIT_GL_CALL(%s, %s, (%s), (%s))\n" %
+ (func.name, func.return_type,
+ func.MakeTypedOriginalArgString(""),
+ func.MakeOriginalArgString("")))
+ self.generated_cpp_filenames.append(filename)
+
+ def WriteMojoGLCallVisitorForExtension(self, filename):
+ """Provides the GL implementation for mojo for all extensions"""
+ with CWriter(filename) as f:
+ for func in self.original_functions:
+ if not func.GetInfo("extension"):
+ continue
+ if func.IsUnsafe():
+ continue
+ f.write("VISIT_GL_CALL(%s, %s, (%s), (%s))\n" %
+ (func.name, func.return_type,
+ func.MakeTypedOriginalArgString(""),
+ func.MakeOriginalArgString("")))
+ self.generated_cpp_filenames.append(filename)
def Format(generated_files):
formatter = "clang-format"
@@ -11081,29 +11002,7 @@ def main(argv):
"gles2_call_visitor")
gen.WriteMojoGLCallVisitor(mojo_gles2_prefix + "_autogen.h")
gen.WriteMojoGLCallVisitorForExtension(
- mojo_gles2_prefix + "_chromium_texture_mailbox_autogen.h",
- "CHROMIUM_texture_mailbox")
- gen.WriteMojoGLCallVisitorForExtension(
- mojo_gles2_prefix + "_chromium_sync_point_autogen.h",
- "CHROMIUM_sync_point")
- gen.WriteMojoGLCallVisitorForExtension(
- mojo_gles2_prefix + "_chromium_sub_image_autogen.h",
- "CHROMIUM_sub_image")
- gen.WriteMojoGLCallVisitorForExtension(
- mojo_gles2_prefix + "_chromium_miscellaneous_autogen.h",
- "CHROMIUM_miscellaneous")
- gen.WriteMojoGLCallVisitorForExtension(
- mojo_gles2_prefix + "_occlusion_query_ext_autogen.h",
- "occlusion_query_EXT")
- gen.WriteMojoGLCallVisitorForExtension(
- mojo_gles2_prefix + "_chromium_image_autogen.h",
- "CHROMIUM_image")
- gen.WriteMojoGLCallVisitorForExtension(
- mojo_gles2_prefix + "_chromium_copy_texture_autogen.h",
- "CHROMIUM_copy_texture")
- gen.WriteMojoGLCallVisitorForExtension(
- mojo_gles2_prefix + "_chromium_pixel_transfer_buffer_object_autogen.h",
- "CHROMIUM_pixel_transfer_buffer_object")
+ mojo_gles2_prefix + "_chromium_extension_autogen.h")
Format(gen.generated_cpp_filenames)
diff --git a/chromium/gpu/command_buffer/client/buffer_tracker_unittest.cc b/chromium/gpu/command_buffer/client/buffer_tracker_unittest.cc
index e8d4d818308..c1ed0b6dfa5 100644
--- a/chromium/gpu/command_buffer/client/buffer_tracker_unittest.cc
+++ b/chromium/gpu/command_buffer/client/buffer_tracker_unittest.cc
@@ -43,11 +43,6 @@ class MockClientCommandBufferImpl : public MockClientCommandBuffer {
bool context_lost_;
};
-namespace {
-void EmptyPoll() {
-}
-}
-
class BufferTrackerTest : public testing::Test {
protected:
static const int32 kNumCommandEntries = 400;
@@ -58,8 +53,8 @@ class BufferTrackerTest : public testing::Test {
command_buffer_.reset(new MockClientCommandBufferImpl());
helper_.reset(new GLES2CmdHelper(command_buffer_.get()));
helper_->Initialize(kCommandBufferSizeBytes);
- mapped_memory_.reset(new MappedMemoryManager(
- helper_.get(), base::Bind(&EmptyPoll), MappedMemoryManager::kNoLimit));
+ mapped_memory_.reset(
+ new MappedMemoryManager(helper_.get(), MappedMemoryManager::kNoLimit));
buffer_tracker_.reset(new BufferTracker(mapped_memory_.get()));
}
diff --git a/chromium/gpu/command_buffer/client/client_context_state_impl_autogen.h b/chromium/gpu/command_buffer/client/client_context_state_impl_autogen.h
index 036f92ccdc9..203c8d37750 100644
--- a/chromium/gpu/command_buffer/client/client_context_state_impl_autogen.h
+++ b/chromium/gpu/command_buffer/client/client_context_state_impl_autogen.h
@@ -23,8 +23,7 @@ ClientContextState::EnableFlags::EnableFlags()
scissor_test(false),
stencil_test(false),
rasterizer_discard(false),
- primitive_restart_fixed_index(false) {
-}
+ primitive_restart_fixed_index(false) {}
bool ClientContextState::SetCapabilityState(GLenum cap,
bool enabled,
diff --git a/chromium/gpu/command_buffer/client/client_test_helper.h b/chromium/gpu/command_buffer/client/client_test_helper.h
index 07234c70ccb..e16e0895d51 100644
--- a/chromium/gpu/command_buffer/client/client_test_helper.h
+++ b/chromium/gpu/command_buffer/client/client_test_helper.h
@@ -112,6 +112,8 @@ class MockClientGpuControl : public GpuControl {
MOCK_METHOD1(CreateStreamTexture, uint32(uint32));
MOCK_METHOD1(SetLock, void(base::Lock*));
MOCK_METHOD0(IsGpuChannelLost, bool());
+ MOCK_CONST_METHOD0(GetNamespaceID, CommandBufferNamespace());
+ MOCK_CONST_METHOD0(GetCommandBufferID, uint64_t());
private:
DISALLOW_COPY_AND_ASSIGN(MockClientGpuControl);
diff --git a/chromium/gpu/command_buffer/client/cmd_buffer_helper.cc b/chromium/gpu/command_buffer/client/cmd_buffer_helper.cc
index 2b88cc1e7b1..35805fe1957 100644
--- a/chromium/gpu/command_buffer/client/cmd_buffer_helper.cc
+++ b/chromium/gpu/command_buffer/client/cmd_buffer_helper.cc
@@ -8,7 +8,12 @@
#include <algorithm>
#include "base/logging.h"
+#include "base/strings/stringprintf.h"
+#include "base/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"
#include "gpu/command_buffer/common/buffer.h"
#include "gpu/command_buffer/common/command_buffer.h"
#include "gpu/command_buffer/common/constants.h"
@@ -33,6 +38,13 @@ CommandBufferHelper::CommandBufferHelper(CommandBuffer* command_buffer)
context_lost_(false),
flush_automatically_(true),
flush_generation_(0) {
+ // In certain cases, ThreadTaskRunnerHandle isn't set (Android Webview).
+ // Don't register a dump provider in these cases.
+ // TODO(ericrk): Get this working in Android Webview. crbug.com/517156
+ if (base::ThreadTaskRunnerHandle::IsSet()) {
+ base::trace_event::MemoryDumpManager::GetInstance()->RegisterDumpProvider(
+ this, base::ThreadTaskRunnerHandle::Get());
+ }
}
void CommandBufferHelper::SetAutomaticFlushes(bool enabled) {
@@ -102,6 +114,7 @@ bool CommandBufferHelper::AllocateRingBuffer() {
command_buffer_->CreateTransferBuffer(ring_buffer_size_, &id);
if (id < 0) {
ClearUsable();
+ DCHECK(error::IsError(command_buffer()->GetLastError()));
return false;
}
@@ -122,6 +135,8 @@ void CommandBufferHelper::FreeResources() {
command_buffer_->DestroyTransferBuffer(ring_buffer_id_);
ring_buffer_id_ = -1;
CalcImmediateEntries(0);
+ entries_ = nullptr;
+ ring_buffer_ = nullptr;
}
}
@@ -137,6 +152,8 @@ bool CommandBufferHelper::Initialize(int32 ring_buffer_size) {
}
CommandBufferHelper::~CommandBufferHelper() {
+ base::trace_event::MemoryDumpManager::GetInstance()->UnregisterDumpProvider(
+ this);
FreeResources();
}
@@ -195,7 +212,8 @@ bool CommandBufferHelper::Finish() {
if (put_ == get_offset()) {
return true;
}
- DCHECK(HaveRingBuffer());
+ DCHECK(HaveRingBuffer() ||
+ error::IsError(command_buffer_->GetLastState().error));
Flush();
if (!WaitForGetOffsetInRange(put_, put_))
return false;
@@ -304,5 +322,41 @@ void CommandBufferHelper::WaitForAvailableEntries(int32 count) {
}
}
+int32 CommandBufferHelper::GetTotalFreeEntriesNoWaiting() const {
+ int32 current_get_offset = get_offset();
+ if (current_get_offset > put_) {
+ return current_get_offset - put_ - 1;
+ } else {
+ return current_get_offset + total_entry_count_ - put_ -
+ (current_get_offset == 0 ? 1 : 0);
+ }
+}
+
+bool CommandBufferHelper::OnMemoryDump(
+ const base::trace_event::MemoryDumpArgs& args,
+ base::trace_event::ProcessMemoryDump* pmd) {
+ if (!HaveRingBuffer())
+ return true;
+
+ const uint64 tracing_process_id =
+ base::trace_event::MemoryDumpManager::GetInstance()
+ ->GetTracingProcessId();
+
+ base::trace_event::MemoryAllocatorDump* dump =
+ pmd->CreateAllocatorDump(base::StringPrintf(
+ "gpu/command_buffer_memory/buffer_%d", ring_buffer_id_));
+ dump->AddScalar(base::trace_event::MemoryAllocatorDump::kNameSize,
+ base::trace_event::MemoryAllocatorDump::kUnitsBytes,
+ ring_buffer_size_);
+ dump->AddScalar("free_size",
+ base::trace_event::MemoryAllocatorDump::kUnitsBytes,
+ GetTotalFreeEntriesNoWaiting() * sizeof(CommandBufferEntry));
+ auto guid = GetBufferGUIDForTracing(tracing_process_id, ring_buffer_id_);
+ const int kImportance = 2;
+ pmd->CreateSharedGlobalAllocatorDump(guid);
+ pmd->AddOwnershipEdge(dump->guid(), guid, kImportance);
+
+ return true;
+}
} // namespace gpu
diff --git a/chromium/gpu/command_buffer/client/cmd_buffer_helper.h b/chromium/gpu/command_buffer/client/cmd_buffer_helper.h
index b5febb3eb8b..8739316b536 100644
--- a/chromium/gpu/command_buffer/client/cmd_buffer_helper.h
+++ b/chromium/gpu/command_buffer/client/cmd_buffer_helper.h
@@ -14,6 +14,7 @@
#include "base/macros.h"
#include "base/memory/ref_counted.h"
#include "base/time/time.h"
+#include "base/trace_event/memory_dump_provider.h"
#include "build/build_config.h"
#include "gpu/command_buffer/common/cmd_buffer_common.h"
#include "gpu/command_buffer/common/command_buffer.h"
@@ -48,10 +49,11 @@ const int kAutoFlushBig = 2; // 1/2 of the buffer
//
// helper.WaitForToken(token); // this doesn't return until the first two
// // commands have been executed.
-class GPU_EXPORT CommandBufferHelper {
+class GPU_EXPORT CommandBufferHelper
+ : public base::trace_event::MemoryDumpProvider {
public:
explicit CommandBufferHelper(CommandBuffer* command_buffer);
- virtual ~CommandBufferHelper();
+ ~CommandBufferHelper() override;
// Initializes the CommandBufferHelper.
// Parameters:
@@ -304,6 +306,10 @@ class GPU_EXPORT CommandBufferHelper {
CalcImmediateEntries(0);
}
+ // Overridden from base::trace_event::MemoryDumpProvider:
+ bool OnMemoryDump(const base::trace_event::MemoryDumpArgs& args,
+ base::trace_event::ProcessMemoryDump* pmd) override;
+
private:
// Returns the number of available entries (they may not be contiguous).
int32 AvailableEntries() {
@@ -323,6 +329,8 @@ class GPU_EXPORT CommandBufferHelper {
void PeriodicFlushCheck();
#endif
+ int32 GetTotalFreeEntriesNoWaiting() const;
+
CommandBuffer* command_buffer_;
int32 ring_buffer_id_;
int32 ring_buffer_size_;
diff --git a/chromium/gpu/command_buffer/client/cmd_buffer_helper_test.cc b/chromium/gpu/command_buffer/client/cmd_buffer_helper_test.cc
index 859c99553b9..48c1895e0f0 100644
--- a/chromium/gpu/command_buffer/client/cmd_buffer_helper_test.cc
+++ b/chromium/gpu/command_buffer/client/cmd_buffer_helper_test.cc
@@ -88,7 +88,7 @@ class CommandBufferHelperTest : public testing::Test {
.WillRepeatedly(Return(error::kNoError));
{
- TransferBufferManager* manager = new TransferBufferManager();
+ TransferBufferManager* manager = new TransferBufferManager(nullptr);
transfer_buffer_manager_ = manager;
EXPECT_TRUE(manager->Initialize());
}
diff --git a/chromium/gpu/command_buffer/client/context_support.h b/chromium/gpu/command_buffer/client/context_support.h
index 4a6f5868d5c..64079d2d8a9 100644
--- a/chromium/gpu/command_buffer/client/context_support.h
+++ b/chromium/gpu/command_buffer/client/context_support.h
@@ -6,9 +6,13 @@
#define GPU_COMMAND_BUFFER_CLIENT_CONTEXT_SUPPORT_H_
#include "base/callback.h"
-#include "ui/gfx/geometry/rect.h"
#include "ui/gfx/overlay_transform.h"
+namespace gfx {
+class Rect;
+class RectF;
+}
+
namespace gpu {
class ContextSupport {
@@ -46,6 +50,10 @@ class ContextSupport {
virtual uint32 InsertFutureSyncPointCHROMIUM() = 0;
virtual void RetireSyncPointCHROMIUM(uint32 sync_point) = 0;
+ // Returns an ID that can be used to globally identify the share group that
+ // this context's resources belong to.
+ virtual uint64_t ShareGroupTracingGUID() const = 0;
+
protected:
ContextSupport() {}
virtual ~ContextSupport() {}
diff --git a/chromium/gpu/command_buffer/client/fenced_allocator.cc b/chromium/gpu/command_buffer/client/fenced_allocator.cc
index 6db6e501977..726fe7dafd3 100644
--- a/chromium/gpu/command_buffer/client/fenced_allocator.cc
+++ b/chromium/gpu/command_buffer/client/fenced_allocator.cc
@@ -32,12 +32,8 @@ const FencedAllocator::Offset FencedAllocator::kInvalidOffset;
const unsigned int FencedAllocator::kAllocAlignment;
#endif
-FencedAllocator::FencedAllocator(unsigned int size,
- CommandBufferHelper* helper,
- const base::Closure& poll_callback)
- : helper_(helper),
- poll_callback_(poll_callback),
- bytes_in_use_(0) {
+FencedAllocator::FencedAllocator(unsigned int size, CommandBufferHelper* helper)
+ : helper_(helper), bytes_in_use_(0) {
Block block = { FREE, 0, RoundDown(size), kUnusedToken };
blocks_.push_back(block);
}
@@ -144,6 +140,18 @@ unsigned int FencedAllocator::GetLargestFreeOrPendingSize() {
return std::max(max_size, current_size);
}
+// Gets the total size of all blocks marked as free.
+unsigned int FencedAllocator::GetFreeSize() {
+ FreeUnused();
+ unsigned int size = 0;
+ for (unsigned int i = 0; i < blocks_.size(); ++i) {
+ Block& block = blocks_[i];
+ if (block.state == FREE)
+ size += block.size;
+ }
+ return size;
+}
+
// Makes sure that:
// - there is at least one block.
// - there are no contiguous FREE blocks (they should have been collapsed).
@@ -204,9 +212,6 @@ FencedAllocator::BlockIndex FencedAllocator::WaitForTokenAndFreeBlock(
// Frees any blocks pending a token for which the token has been read.
void FencedAllocator::FreeUnused() {
- // Free any potential blocks that has its lifetime handled outside.
- poll_callback_.Run();
-
for (unsigned int i = 0; i < blocks_.size();) {
Block& block = blocks_[i];
if (block.state == FREE_PENDING_TOKEN &&
diff --git a/chromium/gpu/command_buffer/client/fenced_allocator.h b/chromium/gpu/command_buffer/client/fenced_allocator.h
index 578870d2b04..95dcccec81b 100644
--- a/chromium/gpu/command_buffer/client/fenced_allocator.h
+++ b/chromium/gpu/command_buffer/client/fenced_allocator.h
@@ -40,9 +40,7 @@ class GPU_EXPORT FencedAllocator {
// Creates a FencedAllocator. Note that the size of the buffer is passed, but
// not its base address: everything is handled as offsets into the buffer.
- FencedAllocator(unsigned int size,
- CommandBufferHelper *helper,
- const base::Closure& poll_callback);
+ FencedAllocator(unsigned int size, CommandBufferHelper* helper);
~FencedAllocator();
@@ -83,6 +81,9 @@ class GPU_EXPORT FencedAllocator {
// block.
unsigned int GetLargestFreeOrPendingSize();
+ // Gets the total size of all free blocks that are available without waiting.
+ unsigned int GetFreeSize();
+
// Checks for consistency inside the book-keeping structures. Used for
// testing.
bool CheckConsistency();
@@ -143,7 +144,6 @@ class GPU_EXPORT FencedAllocator {
Offset AllocInBlock(BlockIndex index, unsigned int size);
CommandBufferHelper *helper_;
- base::Closure poll_callback_;
Container blocks_;
size_t bytes_in_use_;
@@ -156,10 +156,8 @@ class FencedAllocatorWrapper {
public:
FencedAllocatorWrapper(unsigned int size,
CommandBufferHelper* helper,
- const base::Closure& poll_callback,
void* base)
- : allocator_(size, helper, poll_callback),
- base_(base) { }
+ : allocator_(size, helper), base_(base) {}
// Allocates a block of memory. If the buffer is out of directly available
// memory, this function may wait until memory that was freed "pending a
@@ -243,6 +241,9 @@ class FencedAllocatorWrapper {
return allocator_.GetLargestFreeOrPendingSize();
}
+ // Gets the total size of all free blocks.
+ unsigned int GetFreeSize() { return allocator_.GetFreeSize(); }
+
// Checks for consistency inside the book-keeping structures. Used for
// testing.
bool CheckConsistency() {
diff --git a/chromium/gpu/command_buffer/client/fenced_allocator_test.cc b/chromium/gpu/command_buffer/client/fenced_allocator_test.cc
index 0b40a42d949..94faf0ca917 100644
--- a/chromium/gpu/command_buffer/client/fenced_allocator_test.cc
+++ b/chromium/gpu/command_buffer/client/fenced_allocator_test.cc
@@ -44,7 +44,7 @@ class BaseFencedAllocatorTest : public testing::Test {
Return(error::kNoError)));
{
- TransferBufferManager* manager = new TransferBufferManager();
+ TransferBufferManager* manager = new TransferBufferManager(nullptr);
transfer_buffer_manager_ = manager;
EXPECT_TRUE(manager->Initialize());
}
@@ -80,11 +80,6 @@ class BaseFencedAllocatorTest : public testing::Test {
const unsigned int BaseFencedAllocatorTest::kBufferSize;
#endif
-namespace {
-void EmptyPoll() {
-}
-}
-
// Test fixture for FencedAllocator test - Creates a FencedAllocator, using a
// CommandBufferHelper with a mock AsyncAPIInterface for its interface (calling
// it directly, not through the RPC mechanism), making sure Noops are ignored
@@ -93,9 +88,7 @@ class FencedAllocatorTest : public BaseFencedAllocatorTest {
protected:
void SetUp() override {
BaseFencedAllocatorTest::SetUp();
- allocator_.reset(new FencedAllocator(kBufferSize,
- helper_.get(),
- base::Bind(&EmptyPoll)));
+ allocator_.reset(new FencedAllocator(kBufferSize, helper_.get()));
}
void TearDown() override {
@@ -390,63 +383,6 @@ TEST_F(FencedAllocatorTest, TestGetLargestFreeOrPendingSize) {
EXPECT_EQ(kBufferSize, allocator_->GetLargestFreeSize());
}
-class FencedAllocatorPollTest : public BaseFencedAllocatorTest {
- public:
- static const unsigned int kAllocSize = 128;
-
- MOCK_METHOD0(MockedPoll, void());
-
- protected:
- virtual void TearDown() {
- // If the GpuScheduler posts any tasks, this forces them to run.
- base::MessageLoop::current()->RunUntilIdle();
-
- BaseFencedAllocatorTest::TearDown();
- }
-};
-
-TEST_F(FencedAllocatorPollTest, TestPoll) {
- scoped_ptr<FencedAllocator> allocator(
- new FencedAllocator(kBufferSize,
- helper_.get(),
- base::Bind(&FencedAllocatorPollTest::MockedPoll,
- base::Unretained(this))));
-
- FencedAllocator::Offset mem1 = allocator->Alloc(kAllocSize);
- FencedAllocator::Offset mem2 = allocator->Alloc(kAllocSize);
- EXPECT_NE(mem1, FencedAllocator::kInvalidOffset);
- EXPECT_NE(mem2, FencedAllocator::kInvalidOffset);
- EXPECT_TRUE(allocator->CheckConsistency());
- EXPECT_EQ(allocator->bytes_in_use(), kAllocSize * 2);
-
- // Check that no-op Poll doesn't affect the state.
- EXPECT_CALL(*this, MockedPoll()).RetiresOnSaturation();
- allocator->FreeUnused();
- EXPECT_TRUE(allocator->CheckConsistency());
- EXPECT_EQ(allocator->bytes_in_use(), kAllocSize * 2);
-
- // Check that freeing in Poll works.
- base::Closure free_mem1_closure =
- base::Bind(&FencedAllocator::Free,
- base::Unretained(allocator.get()),
- mem1);
- EXPECT_CALL(*this, MockedPoll())
- .WillOnce(InvokeWithoutArgs(&free_mem1_closure, &base::Closure::Run))
- .RetiresOnSaturation();
- allocator->FreeUnused();
- EXPECT_TRUE(allocator->CheckConsistency());
- EXPECT_EQ(allocator->bytes_in_use(), kAllocSize * 1);
-
- // Check that freeing still works.
- EXPECT_CALL(*this, MockedPoll()).RetiresOnSaturation();
- allocator->Free(mem2);
- allocator->FreeUnused();
- EXPECT_TRUE(allocator->CheckConsistency());
- EXPECT_EQ(allocator->bytes_in_use(), 0u);
-
- allocator.reset();
-}
-
// Test fixture for FencedAllocatorWrapper test - Creates a
// FencedAllocatorWrapper, using a CommandBufferHelper with a mock
// AsyncAPIInterface for its interface (calling it directly, not through the
@@ -464,7 +400,6 @@ class FencedAllocatorWrapperTest : public BaseFencedAllocatorTest {
kBufferSize, kAllocAlignment)));
allocator_.reset(new FencedAllocatorWrapper(kBufferSize,
helper_.get(),
- base::Bind(&EmptyPoll),
buffer_.get()));
}
diff --git a/chromium/gpu/command_buffer/client/gles2_c_lib.cc b/chromium/gpu/command_buffer/client/gles2_c_lib.cc
index 2d07755ddde..4d8c544f7de 100644
--- a/chromium/gpu/command_buffer/client/gles2_c_lib.cc
+++ b/chromium/gpu/command_buffer/client/gles2_c_lib.cc
@@ -12,6 +12,7 @@
#include <GLES2/gl2ext.h>
#include <GLES2/gl2extchromium.h>
+#include <GLES3/gl3.h>
#include <stddef.h>
extern "C" {
diff --git a/chromium/gpu/command_buffer/client/gles2_c_lib_autogen.h b/chromium/gpu/command_buffer/client/gles2_c_lib_autogen.h
index 8e59df28865..e1ce501f3bf 100644
--- a/chromium/gpu/command_buffer/client/gles2_c_lib_autogen.h
+++ b/chromium/gpu/command_buffer/client/gles2_c_lib_autogen.h
@@ -12,2659 +12,2810 @@
#ifndef GPU_COMMAND_BUFFER_CLIENT_GLES2_C_LIB_AUTOGEN_H_
#define GPU_COMMAND_BUFFER_CLIENT_GLES2_C_LIB_AUTOGEN_H_
-void GLES2ActiveTexture(GLenum texture) {
+void GL_APIENTRY GLES2ActiveTexture(GLenum texture) {
gles2::GetGLContext()->ActiveTexture(texture);
}
-void GLES2AttachShader(GLuint program, GLuint shader) {
+void GL_APIENTRY GLES2AttachShader(GLuint program, GLuint shader) {
gles2::GetGLContext()->AttachShader(program, shader);
}
-void GLES2BindAttribLocation(GLuint program, GLuint index, const char* name) {
+void GL_APIENTRY GLES2BindAttribLocation(GLuint program,
+ GLuint index,
+ const char* name) {
gles2::GetGLContext()->BindAttribLocation(program, index, name);
}
-void GLES2BindBuffer(GLenum target, GLuint buffer) {
+void GL_APIENTRY GLES2BindBuffer(GLenum target, GLuint buffer) {
gles2::GetGLContext()->BindBuffer(target, buffer);
}
-void GLES2BindBufferBase(GLenum target, GLuint index, GLuint buffer) {
+void GL_APIENTRY GLES2BindBufferBase(GLenum target,
+ GLuint index,
+ GLuint buffer) {
gles2::GetGLContext()->BindBufferBase(target, index, buffer);
}
-void GLES2BindBufferRange(GLenum target,
- GLuint index,
- GLuint buffer,
- GLintptr offset,
- GLsizeiptr size) {
+void GL_APIENTRY GLES2BindBufferRange(GLenum target,
+ GLuint index,
+ GLuint buffer,
+ GLintptr offset,
+ GLsizeiptr size) {
gles2::GetGLContext()->BindBufferRange(target, index, buffer, offset, size);
}
-void GLES2BindFramebuffer(GLenum target, GLuint framebuffer) {
+void GL_APIENTRY GLES2BindFramebuffer(GLenum target, GLuint framebuffer) {
gles2::GetGLContext()->BindFramebuffer(target, framebuffer);
}
-void GLES2BindRenderbuffer(GLenum target, GLuint renderbuffer) {
+void GL_APIENTRY GLES2BindRenderbuffer(GLenum target, GLuint renderbuffer) {
gles2::GetGLContext()->BindRenderbuffer(target, renderbuffer);
}
-void GLES2BindSampler(GLuint unit, GLuint sampler) {
+void GL_APIENTRY GLES2BindSampler(GLuint unit, GLuint sampler) {
gles2::GetGLContext()->BindSampler(unit, sampler);
}
-void GLES2BindTexture(GLenum target, GLuint texture) {
+void GL_APIENTRY GLES2BindTexture(GLenum target, GLuint texture) {
gles2::GetGLContext()->BindTexture(target, texture);
}
-void GLES2BindTransformFeedback(GLenum target, GLuint transformfeedback) {
+void GL_APIENTRY GLES2BindTransformFeedback(GLenum target,
+ GLuint transformfeedback) {
gles2::GetGLContext()->BindTransformFeedback(target, transformfeedback);
}
-void GLES2BlendColor(GLclampf red,
- GLclampf green,
- GLclampf blue,
- GLclampf alpha) {
+void GL_APIENTRY GLES2BlendColor(GLclampf red,
+ GLclampf green,
+ GLclampf blue,
+ GLclampf alpha) {
gles2::GetGLContext()->BlendColor(red, green, blue, alpha);
}
-void GLES2BlendEquation(GLenum mode) {
+void GL_APIENTRY GLES2BlendEquation(GLenum mode) {
gles2::GetGLContext()->BlendEquation(mode);
}
-void GLES2BlendEquationSeparate(GLenum modeRGB, GLenum modeAlpha) {
+void GL_APIENTRY GLES2BlendEquationSeparate(GLenum modeRGB, GLenum modeAlpha) {
gles2::GetGLContext()->BlendEquationSeparate(modeRGB, modeAlpha);
}
-void GLES2BlendFunc(GLenum sfactor, GLenum dfactor) {
+void GL_APIENTRY GLES2BlendFunc(GLenum sfactor, GLenum dfactor) {
gles2::GetGLContext()->BlendFunc(sfactor, dfactor);
}
-void GLES2BlendFuncSeparate(GLenum srcRGB,
- GLenum dstRGB,
- GLenum srcAlpha,
- GLenum dstAlpha) {
+void GL_APIENTRY GLES2BlendFuncSeparate(GLenum srcRGB,
+ GLenum dstRGB,
+ GLenum srcAlpha,
+ GLenum dstAlpha) {
gles2::GetGLContext()->BlendFuncSeparate(srcRGB, dstRGB, srcAlpha, dstAlpha);
}
-void GLES2BufferData(GLenum target,
- GLsizeiptr size,
- const void* data,
- GLenum usage) {
+void GL_APIENTRY GLES2BufferData(GLenum target,
+ GLsizeiptr size,
+ const void* data,
+ GLenum usage) {
gles2::GetGLContext()->BufferData(target, size, data, usage);
}
-void GLES2BufferSubData(GLenum target,
- GLintptr offset,
- GLsizeiptr size,
- const void* data) {
+void GL_APIENTRY GLES2BufferSubData(GLenum target,
+ GLintptr offset,
+ GLsizeiptr size,
+ const void* data) {
gles2::GetGLContext()->BufferSubData(target, offset, size, data);
}
-GLenum GLES2CheckFramebufferStatus(GLenum target) {
+GLenum GL_APIENTRY GLES2CheckFramebufferStatus(GLenum target) {
return gles2::GetGLContext()->CheckFramebufferStatus(target);
}
-void GLES2Clear(GLbitfield mask) {
+void GL_APIENTRY GLES2Clear(GLbitfield mask) {
gles2::GetGLContext()->Clear(mask);
}
-void GLES2ClearBufferfi(GLenum buffer,
- GLint drawbuffers,
- GLfloat depth,
- GLint stencil) {
+void GL_APIENTRY GLES2ClearBufferfi(GLenum buffer,
+ GLint drawbuffers,
+ GLfloat depth,
+ GLint stencil) {
gles2::GetGLContext()->ClearBufferfi(buffer, drawbuffers, depth, stencil);
}
-void GLES2ClearBufferfv(GLenum buffer,
- GLint drawbuffers,
- const GLfloat* value) {
+void GL_APIENTRY GLES2ClearBufferfv(GLenum buffer,
+ GLint drawbuffers,
+ const GLfloat* value) {
gles2::GetGLContext()->ClearBufferfv(buffer, drawbuffers, value);
}
-void GLES2ClearBufferiv(GLenum buffer, GLint drawbuffers, const GLint* value) {
+void GL_APIENTRY GLES2ClearBufferiv(GLenum buffer,
+ GLint drawbuffers,
+ const GLint* value) {
gles2::GetGLContext()->ClearBufferiv(buffer, drawbuffers, value);
}
-void GLES2ClearBufferuiv(GLenum buffer,
- GLint drawbuffers,
- const GLuint* value) {
+void GL_APIENTRY GLES2ClearBufferuiv(GLenum buffer,
+ GLint drawbuffers,
+ const GLuint* value) {
gles2::GetGLContext()->ClearBufferuiv(buffer, drawbuffers, value);
}
-void GLES2ClearColor(GLclampf red,
- GLclampf green,
- GLclampf blue,
- GLclampf alpha) {
+void GL_APIENTRY GLES2ClearColor(GLclampf red,
+ GLclampf green,
+ GLclampf blue,
+ GLclampf alpha) {
gles2::GetGLContext()->ClearColor(red, green, blue, alpha);
}
-void GLES2ClearDepthf(GLclampf depth) {
+void GL_APIENTRY GLES2ClearDepthf(GLclampf depth) {
gles2::GetGLContext()->ClearDepthf(depth);
}
-void GLES2ClearStencil(GLint s) {
+void GL_APIENTRY GLES2ClearStencil(GLint s) {
gles2::GetGLContext()->ClearStencil(s);
}
-GLenum GLES2ClientWaitSync(GLsync sync, GLbitfield flags, GLuint64 timeout) {
+GLenum GL_APIENTRY GLES2ClientWaitSync(GLsync sync,
+ GLbitfield flags,
+ GLuint64 timeout) {
return gles2::GetGLContext()->ClientWaitSync(sync, flags, timeout);
}
-void GLES2ColorMask(GLboolean red,
- GLboolean green,
- GLboolean blue,
- GLboolean alpha) {
+void GL_APIENTRY GLES2ColorMask(GLboolean red,
+ GLboolean green,
+ GLboolean blue,
+ GLboolean alpha) {
gles2::GetGLContext()->ColorMask(red, green, blue, alpha);
}
-void GLES2CompileShader(GLuint shader) {
+void GL_APIENTRY GLES2CompileShader(GLuint shader) {
gles2::GetGLContext()->CompileShader(shader);
}
-void GLES2CompressedTexImage2D(GLenum target,
- GLint level,
- GLenum internalformat,
- GLsizei width,
- GLsizei height,
- GLint border,
- GLsizei imageSize,
- const void* data) {
+void GL_APIENTRY GLES2CompressedTexImage2D(GLenum target,
+ GLint level,
+ GLenum internalformat,
+ GLsizei width,
+ GLsizei height,
+ GLint border,
+ GLsizei imageSize,
+ const void* data) {
gles2::GetGLContext()->CompressedTexImage2D(
target, level, internalformat, width, height, border, imageSize, data);
}
-void GLES2CompressedTexSubImage2D(GLenum target,
- GLint level,
- GLint xoffset,
- GLint yoffset,
- GLsizei width,
- GLsizei height,
- GLenum format,
- GLsizei imageSize,
- const void* data) {
+void GL_APIENTRY GLES2CompressedTexSubImage2D(GLenum target,
+ GLint level,
+ GLint xoffset,
+ GLint yoffset,
+ GLsizei width,
+ GLsizei height,
+ GLenum format,
+ GLsizei imageSize,
+ const void* data) {
gles2::GetGLContext()->CompressedTexSubImage2D(
target, level, xoffset, yoffset, width, height, format, imageSize, data);
}
-void GLES2CompressedTexImage3D(GLenum target,
- GLint level,
- GLenum internalformat,
- GLsizei width,
- GLsizei height,
- GLsizei depth,
- GLint border,
- GLsizei imageSize,
- const void* data) {
+void GL_APIENTRY GLES2CompressedTexImage3D(GLenum target,
+ GLint level,
+ GLenum internalformat,
+ GLsizei width,
+ GLsizei height,
+ GLsizei depth,
+ GLint border,
+ GLsizei imageSize,
+ const void* data) {
gles2::GetGLContext()->CompressedTexImage3D(target, level, internalformat,
width, height, depth, border,
imageSize, data);
}
-void GLES2CompressedTexSubImage3D(GLenum target,
- GLint level,
- GLint xoffset,
- GLint yoffset,
- GLint zoffset,
- GLsizei width,
- GLsizei height,
- GLsizei depth,
- GLenum format,
- GLsizei imageSize,
- const void* data) {
+void GL_APIENTRY GLES2CompressedTexSubImage3D(GLenum target,
+ GLint level,
+ GLint xoffset,
+ GLint yoffset,
+ GLint zoffset,
+ GLsizei width,
+ GLsizei height,
+ GLsizei depth,
+ GLenum format,
+ GLsizei imageSize,
+ const void* data) {
gles2::GetGLContext()->CompressedTexSubImage3D(
target, level, xoffset, yoffset, zoffset, width, height, depth, format,
imageSize, data);
}
-void GLES2CopyBufferSubData(GLenum readtarget,
- GLenum writetarget,
- GLintptr readoffset,
- GLintptr writeoffset,
- GLsizeiptr size) {
+void GL_APIENTRY GLES2CopyBufferSubData(GLenum readtarget,
+ GLenum writetarget,
+ GLintptr readoffset,
+ GLintptr writeoffset,
+ GLsizeiptr size) {
gles2::GetGLContext()->CopyBufferSubData(readtarget, writetarget, readoffset,
writeoffset, size);
}
-void GLES2CopyTexImage2D(GLenum target,
- GLint level,
- GLenum internalformat,
- GLint x,
- GLint y,
- GLsizei width,
- GLsizei height,
- GLint border) {
+void GL_APIENTRY GLES2CopyTexImage2D(GLenum target,
+ GLint level,
+ GLenum internalformat,
+ GLint x,
+ GLint y,
+ GLsizei width,
+ GLsizei height,
+ GLint border) {
gles2::GetGLContext()->CopyTexImage2D(target, level, internalformat, x, y,
width, height, border);
}
-void GLES2CopyTexSubImage2D(GLenum target,
- GLint level,
- GLint xoffset,
- GLint yoffset,
- GLint x,
- GLint y,
- GLsizei width,
- GLsizei height) {
+void GL_APIENTRY GLES2CopyTexSubImage2D(GLenum target,
+ GLint level,
+ GLint xoffset,
+ GLint yoffset,
+ GLint x,
+ GLint y,
+ GLsizei width,
+ GLsizei height) {
gles2::GetGLContext()->CopyTexSubImage2D(target, level, xoffset, yoffset, x,
y, width, height);
}
-void GLES2CopyTexSubImage3D(GLenum target,
- GLint level,
- GLint xoffset,
- GLint yoffset,
- GLint zoffset,
- GLint x,
- GLint y,
- GLsizei width,
- GLsizei height) {
+void GL_APIENTRY GLES2CopyTexSubImage3D(GLenum target,
+ GLint level,
+ GLint xoffset,
+ GLint yoffset,
+ GLint zoffset,
+ GLint x,
+ GLint y,
+ GLsizei width,
+ GLsizei height) {
gles2::GetGLContext()->CopyTexSubImage3D(target, level, xoffset, yoffset,
zoffset, x, y, width, height);
}
-GLuint GLES2CreateProgram() {
+GLuint GL_APIENTRY GLES2CreateProgram() {
return gles2::GetGLContext()->CreateProgram();
}
-GLuint GLES2CreateShader(GLenum type) {
+GLuint GL_APIENTRY GLES2CreateShader(GLenum type) {
return gles2::GetGLContext()->CreateShader(type);
}
-void GLES2CullFace(GLenum mode) {
+void GL_APIENTRY GLES2CullFace(GLenum mode) {
gles2::GetGLContext()->CullFace(mode);
}
-void GLES2DeleteBuffers(GLsizei n, const GLuint* buffers) {
+void GL_APIENTRY GLES2DeleteBuffers(GLsizei n, const GLuint* buffers) {
gles2::GetGLContext()->DeleteBuffers(n, buffers);
}
-void GLES2DeleteFramebuffers(GLsizei n, const GLuint* framebuffers) {
+void GL_APIENTRY GLES2DeleteFramebuffers(GLsizei n,
+ const GLuint* framebuffers) {
gles2::GetGLContext()->DeleteFramebuffers(n, framebuffers);
}
-void GLES2DeleteProgram(GLuint program) {
+void GL_APIENTRY GLES2DeleteProgram(GLuint program) {
gles2::GetGLContext()->DeleteProgram(program);
}
-void GLES2DeleteRenderbuffers(GLsizei n, const GLuint* renderbuffers) {
+void GL_APIENTRY GLES2DeleteRenderbuffers(GLsizei n,
+ const GLuint* renderbuffers) {
gles2::GetGLContext()->DeleteRenderbuffers(n, renderbuffers);
}
-void GLES2DeleteSamplers(GLsizei n, const GLuint* samplers) {
+void GL_APIENTRY GLES2DeleteSamplers(GLsizei n, const GLuint* samplers) {
gles2::GetGLContext()->DeleteSamplers(n, samplers);
}
-void GLES2DeleteSync(GLsync sync) {
+void GL_APIENTRY GLES2DeleteSync(GLsync sync) {
gles2::GetGLContext()->DeleteSync(sync);
}
-void GLES2DeleteShader(GLuint shader) {
+void GL_APIENTRY GLES2DeleteShader(GLuint shader) {
gles2::GetGLContext()->DeleteShader(shader);
}
-void GLES2DeleteTextures(GLsizei n, const GLuint* textures) {
+void GL_APIENTRY GLES2DeleteTextures(GLsizei n, const GLuint* textures) {
gles2::GetGLContext()->DeleteTextures(n, textures);
}
-void GLES2DeleteTransformFeedbacks(GLsizei n, const GLuint* ids) {
+void GL_APIENTRY GLES2DeleteTransformFeedbacks(GLsizei n, const GLuint* ids) {
gles2::GetGLContext()->DeleteTransformFeedbacks(n, ids);
}
-void GLES2DepthFunc(GLenum func) {
+void GL_APIENTRY GLES2DepthFunc(GLenum func) {
gles2::GetGLContext()->DepthFunc(func);
}
-void GLES2DepthMask(GLboolean flag) {
+void GL_APIENTRY GLES2DepthMask(GLboolean flag) {
gles2::GetGLContext()->DepthMask(flag);
}
-void GLES2DepthRangef(GLclampf zNear, GLclampf zFar) {
+void GL_APIENTRY GLES2DepthRangef(GLclampf zNear, GLclampf zFar) {
gles2::GetGLContext()->DepthRangef(zNear, zFar);
}
-void GLES2DetachShader(GLuint program, GLuint shader) {
+void GL_APIENTRY GLES2DetachShader(GLuint program, GLuint shader) {
gles2::GetGLContext()->DetachShader(program, shader);
}
-void GLES2Disable(GLenum cap) {
+void GL_APIENTRY GLES2Disable(GLenum cap) {
gles2::GetGLContext()->Disable(cap);
}
-void GLES2DisableVertexAttribArray(GLuint index) {
+void GL_APIENTRY GLES2DisableVertexAttribArray(GLuint index) {
gles2::GetGLContext()->DisableVertexAttribArray(index);
}
-void GLES2DrawArrays(GLenum mode, GLint first, GLsizei count) {
+void GL_APIENTRY GLES2DrawArrays(GLenum mode, GLint first, GLsizei count) {
gles2::GetGLContext()->DrawArrays(mode, first, count);
}
-void GLES2DrawElements(GLenum mode,
- GLsizei count,
- GLenum type,
- const void* indices) {
+void GL_APIENTRY GLES2DrawElements(GLenum mode,
+ GLsizei count,
+ GLenum type,
+ const void* indices) {
gles2::GetGLContext()->DrawElements(mode, count, type, indices);
}
-void GLES2DrawRangeElements(GLenum mode,
- GLuint start,
- GLuint end,
- GLsizei count,
- GLenum type,
- const void* indices) {
+void GL_APIENTRY GLES2DrawRangeElements(GLenum mode,
+ GLuint start,
+ GLuint end,
+ GLsizei count,
+ GLenum type,
+ const void* indices) {
gles2::GetGLContext()->DrawRangeElements(mode, start, end, count, type,
indices);
}
-void GLES2Enable(GLenum cap) {
+void GL_APIENTRY GLES2Enable(GLenum cap) {
gles2::GetGLContext()->Enable(cap);
}
-void GLES2EnableVertexAttribArray(GLuint index) {
+void GL_APIENTRY GLES2EnableVertexAttribArray(GLuint index) {
gles2::GetGLContext()->EnableVertexAttribArray(index);
}
-GLsync GLES2FenceSync(GLenum condition, GLbitfield flags) {
+GLsync GL_APIENTRY GLES2FenceSync(GLenum condition, GLbitfield flags) {
return gles2::GetGLContext()->FenceSync(condition, flags);
}
-void GLES2Finish() {
+void GL_APIENTRY GLES2Finish() {
gles2::GetGLContext()->Finish();
}
-void GLES2Flush() {
+void GL_APIENTRY GLES2Flush() {
gles2::GetGLContext()->Flush();
}
-void GLES2FramebufferRenderbuffer(GLenum target,
- GLenum attachment,
- GLenum renderbuffertarget,
- GLuint renderbuffer) {
+void GL_APIENTRY GLES2FramebufferRenderbuffer(GLenum target,
+ GLenum attachment,
+ GLenum renderbuffertarget,
+ GLuint renderbuffer) {
gles2::GetGLContext()->FramebufferRenderbuffer(
target, attachment, renderbuffertarget, renderbuffer);
}
-void GLES2FramebufferTexture2D(GLenum target,
- GLenum attachment,
- GLenum textarget,
- GLuint texture,
- GLint level) {
+void GL_APIENTRY GLES2FramebufferTexture2D(GLenum target,
+ GLenum attachment,
+ GLenum textarget,
+ GLuint texture,
+ GLint level) {
gles2::GetGLContext()->FramebufferTexture2D(target, attachment, textarget,
texture, level);
}
-void GLES2FramebufferTextureLayer(GLenum target,
- GLenum attachment,
- GLuint texture,
- GLint level,
- GLint layer) {
+void GL_APIENTRY GLES2FramebufferTextureLayer(GLenum target,
+ GLenum attachment,
+ GLuint texture,
+ GLint level,
+ GLint layer) {
gles2::GetGLContext()->FramebufferTextureLayer(target, attachment, texture,
level, layer);
}
-void GLES2FrontFace(GLenum mode) {
+void GL_APIENTRY GLES2FrontFace(GLenum mode) {
gles2::GetGLContext()->FrontFace(mode);
}
-void GLES2GenBuffers(GLsizei n, GLuint* buffers) {
+void GL_APIENTRY GLES2GenBuffers(GLsizei n, GLuint* buffers) {
gles2::GetGLContext()->GenBuffers(n, buffers);
}
-void GLES2GenerateMipmap(GLenum target) {
+void GL_APIENTRY GLES2GenerateMipmap(GLenum target) {
gles2::GetGLContext()->GenerateMipmap(target);
}
-void GLES2GenFramebuffers(GLsizei n, GLuint* framebuffers) {
+void GL_APIENTRY GLES2GenFramebuffers(GLsizei n, GLuint* framebuffers) {
gles2::GetGLContext()->GenFramebuffers(n, framebuffers);
}
-void GLES2GenRenderbuffers(GLsizei n, GLuint* renderbuffers) {
+void GL_APIENTRY GLES2GenRenderbuffers(GLsizei n, GLuint* renderbuffers) {
gles2::GetGLContext()->GenRenderbuffers(n, renderbuffers);
}
-void GLES2GenSamplers(GLsizei n, GLuint* samplers) {
+void GL_APIENTRY GLES2GenSamplers(GLsizei n, GLuint* samplers) {
gles2::GetGLContext()->GenSamplers(n, samplers);
}
-void GLES2GenTextures(GLsizei n, GLuint* textures) {
+void GL_APIENTRY GLES2GenTextures(GLsizei n, GLuint* textures) {
gles2::GetGLContext()->GenTextures(n, textures);
}
-void GLES2GenTransformFeedbacks(GLsizei n, GLuint* ids) {
+void GL_APIENTRY GLES2GenTransformFeedbacks(GLsizei n, GLuint* ids) {
gles2::GetGLContext()->GenTransformFeedbacks(n, ids);
}
-void GLES2GetActiveAttrib(GLuint program,
- GLuint index,
- GLsizei bufsize,
- GLsizei* length,
- GLint* size,
- GLenum* type,
- char* name) {
+void GL_APIENTRY GLES2GetActiveAttrib(GLuint program,
+ GLuint index,
+ GLsizei bufsize,
+ GLsizei* length,
+ GLint* size,
+ GLenum* type,
+ char* name) {
gles2::GetGLContext()->GetActiveAttrib(program, index, bufsize, length, size,
type, name);
}
-void GLES2GetActiveUniform(GLuint program,
- GLuint index,
- GLsizei bufsize,
- GLsizei* length,
- GLint* size,
- GLenum* type,
- char* name) {
+void GL_APIENTRY GLES2GetActiveUniform(GLuint program,
+ GLuint index,
+ GLsizei bufsize,
+ GLsizei* length,
+ GLint* size,
+ GLenum* type,
+ char* name) {
gles2::GetGLContext()->GetActiveUniform(program, index, bufsize, length, size,
type, name);
}
-void GLES2GetActiveUniformBlockiv(GLuint program,
- GLuint index,
- GLenum pname,
- GLint* params) {
+void GL_APIENTRY GLES2GetActiveUniformBlockiv(GLuint program,
+ GLuint index,
+ GLenum pname,
+ GLint* params) {
gles2::GetGLContext()->GetActiveUniformBlockiv(program, index, pname, params);
}
-void GLES2GetActiveUniformBlockName(GLuint program,
- GLuint index,
- GLsizei bufsize,
- GLsizei* length,
- char* name) {
+void GL_APIENTRY GLES2GetActiveUniformBlockName(GLuint program,
+ GLuint index,
+ GLsizei bufsize,
+ GLsizei* length,
+ char* name) {
gles2::GetGLContext()->GetActiveUniformBlockName(program, index, bufsize,
length, name);
}
-void GLES2GetActiveUniformsiv(GLuint program,
- GLsizei count,
- const GLuint* indices,
- GLenum pname,
- GLint* params) {
+void GL_APIENTRY GLES2GetActiveUniformsiv(GLuint program,
+ GLsizei count,
+ const GLuint* indices,
+ GLenum pname,
+ GLint* params) {
gles2::GetGLContext()->GetActiveUniformsiv(program, count, indices, pname,
params);
}
-void GLES2GetAttachedShaders(GLuint program,
- GLsizei maxcount,
- GLsizei* count,
- GLuint* shaders) {
+void GL_APIENTRY GLES2GetAttachedShaders(GLuint program,
+ GLsizei maxcount,
+ GLsizei* count,
+ GLuint* shaders) {
gles2::GetGLContext()->GetAttachedShaders(program, maxcount, count, shaders);
}
-GLint GLES2GetAttribLocation(GLuint program, const char* name) {
+GLint GL_APIENTRY GLES2GetAttribLocation(GLuint program, const char* name) {
return gles2::GetGLContext()->GetAttribLocation(program, name);
}
-void GLES2GetBooleanv(GLenum pname, GLboolean* params) {
+void GL_APIENTRY GLES2GetBooleanv(GLenum pname, GLboolean* params) {
gles2::GetGLContext()->GetBooleanv(pname, params);
}
-void GLES2GetBufferParameteriv(GLenum target, GLenum pname, GLint* params) {
+void GL_APIENTRY GLES2GetBufferParameteri64v(GLenum target,
+ GLenum pname,
+ GLint64* params) {
+ gles2::GetGLContext()->GetBufferParameteri64v(target, pname, params);
+}
+void GL_APIENTRY GLES2GetBufferParameteriv(GLenum target,
+ GLenum pname,
+ GLint* params) {
gles2::GetGLContext()->GetBufferParameteriv(target, pname, params);
}
-GLenum GLES2GetError() {
+GLenum GL_APIENTRY GLES2GetError() {
return gles2::GetGLContext()->GetError();
}
-void GLES2GetFloatv(GLenum pname, GLfloat* params) {
+void GL_APIENTRY GLES2GetFloatv(GLenum pname, GLfloat* params) {
gles2::GetGLContext()->GetFloatv(pname, params);
}
-GLint GLES2GetFragDataLocation(GLuint program, const char* name) {
+GLint GL_APIENTRY GLES2GetFragDataLocation(GLuint program, const char* name) {
return gles2::GetGLContext()->GetFragDataLocation(program, name);
}
-void GLES2GetFramebufferAttachmentParameteriv(GLenum target,
- GLenum attachment,
- GLenum pname,
- GLint* params) {
+void GL_APIENTRY GLES2GetFramebufferAttachmentParameteriv(GLenum target,
+ GLenum attachment,
+ GLenum pname,
+ GLint* params) {
gles2::GetGLContext()->GetFramebufferAttachmentParameteriv(target, attachment,
pname, params);
}
-void GLES2GetInteger64v(GLenum pname, GLint64* params) {
+void GL_APIENTRY GLES2GetInteger64v(GLenum pname, GLint64* params) {
gles2::GetGLContext()->GetInteger64v(pname, params);
}
-void GLES2GetIntegeri_v(GLenum pname, GLuint index, GLint* data) {
+void GL_APIENTRY GLES2GetIntegeri_v(GLenum pname, GLuint index, GLint* data) {
gles2::GetGLContext()->GetIntegeri_v(pname, index, data);
}
-void GLES2GetInteger64i_v(GLenum pname, GLuint index, GLint64* data) {
+void GL_APIENTRY GLES2GetInteger64i_v(GLenum pname,
+ GLuint index,
+ GLint64* data) {
gles2::GetGLContext()->GetInteger64i_v(pname, index, data);
}
-void GLES2GetIntegerv(GLenum pname, GLint* params) {
+void GL_APIENTRY GLES2GetIntegerv(GLenum pname, GLint* params) {
gles2::GetGLContext()->GetIntegerv(pname, params);
}
-void GLES2GetInternalformativ(GLenum target,
- GLenum format,
- GLenum pname,
- GLsizei bufSize,
- GLint* params) {
+void GL_APIENTRY GLES2GetInternalformativ(GLenum target,
+ GLenum format,
+ GLenum pname,
+ GLsizei bufSize,
+ GLint* params) {
gles2::GetGLContext()->GetInternalformativ(target, format, pname, bufSize,
params);
}
-void GLES2GetProgramiv(GLuint program, GLenum pname, GLint* params) {
+void GL_APIENTRY GLES2GetProgramiv(GLuint program,
+ GLenum pname,
+ GLint* params) {
gles2::GetGLContext()->GetProgramiv(program, pname, params);
}
-void GLES2GetProgramInfoLog(GLuint program,
- GLsizei bufsize,
- GLsizei* length,
- char* infolog) {
+void GL_APIENTRY GLES2GetProgramInfoLog(GLuint program,
+ GLsizei bufsize,
+ GLsizei* length,
+ char* infolog) {
gles2::GetGLContext()->GetProgramInfoLog(program, bufsize, length, infolog);
}
-void GLES2GetRenderbufferParameteriv(GLenum target,
- GLenum pname,
- GLint* params) {
+void GL_APIENTRY GLES2GetRenderbufferParameteriv(GLenum target,
+ GLenum pname,
+ GLint* params) {
gles2::GetGLContext()->GetRenderbufferParameteriv(target, pname, params);
}
-void GLES2GetSamplerParameterfv(GLuint sampler, GLenum pname, GLfloat* params) {
+void GL_APIENTRY GLES2GetSamplerParameterfv(GLuint sampler,
+ GLenum pname,
+ GLfloat* params) {
gles2::GetGLContext()->GetSamplerParameterfv(sampler, pname, params);
}
-void GLES2GetSamplerParameteriv(GLuint sampler, GLenum pname, GLint* params) {
+void GL_APIENTRY GLES2GetSamplerParameteriv(GLuint sampler,
+ GLenum pname,
+ GLint* params) {
gles2::GetGLContext()->GetSamplerParameteriv(sampler, pname, params);
}
-void GLES2GetShaderiv(GLuint shader, GLenum pname, GLint* params) {
+void GL_APIENTRY GLES2GetShaderiv(GLuint shader, GLenum pname, GLint* params) {
gles2::GetGLContext()->GetShaderiv(shader, pname, params);
}
-void GLES2GetShaderInfoLog(GLuint shader,
- GLsizei bufsize,
- GLsizei* length,
- char* infolog) {
+void GL_APIENTRY GLES2GetShaderInfoLog(GLuint shader,
+ GLsizei bufsize,
+ GLsizei* length,
+ char* infolog) {
gles2::GetGLContext()->GetShaderInfoLog(shader, bufsize, length, infolog);
}
-void GLES2GetShaderPrecisionFormat(GLenum shadertype,
- GLenum precisiontype,
- GLint* range,
- GLint* precision) {
+void GL_APIENTRY GLES2GetShaderPrecisionFormat(GLenum shadertype,
+ GLenum precisiontype,
+ GLint* range,
+ GLint* precision) {
gles2::GetGLContext()->GetShaderPrecisionFormat(shadertype, precisiontype,
range, precision);
}
-void GLES2GetShaderSource(GLuint shader,
- GLsizei bufsize,
- GLsizei* length,
- char* source) {
+void GL_APIENTRY GLES2GetShaderSource(GLuint shader,
+ GLsizei bufsize,
+ GLsizei* length,
+ char* source) {
gles2::GetGLContext()->GetShaderSource(shader, bufsize, length, source);
}
-const GLubyte* GLES2GetString(GLenum name) {
+const GLubyte* GL_APIENTRY GLES2GetString(GLenum name) {
return gles2::GetGLContext()->GetString(name);
}
-void GLES2GetSynciv(GLsync sync,
- GLenum pname,
- GLsizei bufsize,
- GLsizei* length,
- GLint* values) {
+void GL_APIENTRY GLES2GetSynciv(GLsync sync,
+ GLenum pname,
+ GLsizei bufsize,
+ GLsizei* length,
+ GLint* values) {
gles2::GetGLContext()->GetSynciv(sync, pname, bufsize, length, values);
}
-void GLES2GetTexParameterfv(GLenum target, GLenum pname, GLfloat* params) {
+void GL_APIENTRY GLES2GetTexParameterfv(GLenum target,
+ GLenum pname,
+ GLfloat* params) {
gles2::GetGLContext()->GetTexParameterfv(target, pname, params);
}
-void GLES2GetTexParameteriv(GLenum target, GLenum pname, GLint* params) {
+void GL_APIENTRY GLES2GetTexParameteriv(GLenum target,
+ GLenum pname,
+ GLint* params) {
gles2::GetGLContext()->GetTexParameteriv(target, pname, params);
}
-void GLES2GetTransformFeedbackVarying(GLuint program,
- GLuint index,
- GLsizei bufsize,
- GLsizei* length,
- GLsizei* size,
- GLenum* type,
- char* name) {
+void GL_APIENTRY GLES2GetTransformFeedbackVarying(GLuint program,
+ GLuint index,
+ GLsizei bufsize,
+ GLsizei* length,
+ GLsizei* size,
+ GLenum* type,
+ char* name) {
gles2::GetGLContext()->GetTransformFeedbackVarying(program, index, bufsize,
length, size, type, name);
}
-GLuint GLES2GetUniformBlockIndex(GLuint program, const char* name) {
+GLuint GL_APIENTRY GLES2GetUniformBlockIndex(GLuint program, const char* name) {
return gles2::GetGLContext()->GetUniformBlockIndex(program, name);
}
-void GLES2GetUniformfv(GLuint program, GLint location, GLfloat* params) {
+void GL_APIENTRY GLES2GetUniformfv(GLuint program,
+ GLint location,
+ GLfloat* params) {
gles2::GetGLContext()->GetUniformfv(program, location, params);
}
-void GLES2GetUniformiv(GLuint program, GLint location, GLint* params) {
+void GL_APIENTRY GLES2GetUniformiv(GLuint program,
+ GLint location,
+ GLint* params) {
gles2::GetGLContext()->GetUniformiv(program, location, params);
}
-void GLES2GetUniformuiv(GLuint program, GLint location, GLuint* params) {
+void GL_APIENTRY GLES2GetUniformuiv(GLuint program,
+ GLint location,
+ GLuint* params) {
gles2::GetGLContext()->GetUniformuiv(program, location, params);
}
-void GLES2GetUniformIndices(GLuint program,
- GLsizei count,
- const char* const* names,
- GLuint* indices) {
+void GL_APIENTRY GLES2GetUniformIndices(GLuint program,
+ GLsizei count,
+ const char* const* names,
+ GLuint* indices) {
gles2::GetGLContext()->GetUniformIndices(program, count, names, indices);
}
-GLint GLES2GetUniformLocation(GLuint program, const char* name) {
+GLint GL_APIENTRY GLES2GetUniformLocation(GLuint program, const char* name) {
return gles2::GetGLContext()->GetUniformLocation(program, name);
}
-void GLES2GetVertexAttribfv(GLuint index, GLenum pname, GLfloat* params) {
+void GL_APIENTRY GLES2GetVertexAttribfv(GLuint index,
+ GLenum pname,
+ GLfloat* params) {
gles2::GetGLContext()->GetVertexAttribfv(index, pname, params);
}
-void GLES2GetVertexAttribiv(GLuint index, GLenum pname, GLint* params) {
+void GL_APIENTRY GLES2GetVertexAttribiv(GLuint index,
+ GLenum pname,
+ GLint* params) {
gles2::GetGLContext()->GetVertexAttribiv(index, pname, params);
}
-void GLES2GetVertexAttribIiv(GLuint index, GLenum pname, GLint* params) {
+void GL_APIENTRY GLES2GetVertexAttribIiv(GLuint index,
+ GLenum pname,
+ GLint* params) {
gles2::GetGLContext()->GetVertexAttribIiv(index, pname, params);
}
-void GLES2GetVertexAttribIuiv(GLuint index, GLenum pname, GLuint* params) {
+void GL_APIENTRY GLES2GetVertexAttribIuiv(GLuint index,
+ GLenum pname,
+ GLuint* params) {
gles2::GetGLContext()->GetVertexAttribIuiv(index, pname, params);
}
-void GLES2GetVertexAttribPointerv(GLuint index, GLenum pname, void** pointer) {
+void GL_APIENTRY GLES2GetVertexAttribPointerv(GLuint index,
+ GLenum pname,
+ void** pointer) {
gles2::GetGLContext()->GetVertexAttribPointerv(index, pname, pointer);
}
-void GLES2Hint(GLenum target, GLenum mode) {
+void GL_APIENTRY GLES2Hint(GLenum target, GLenum mode) {
gles2::GetGLContext()->Hint(target, mode);
}
-void GLES2InvalidateFramebuffer(GLenum target,
- GLsizei count,
- const GLenum* attachments) {
+void GL_APIENTRY GLES2InvalidateFramebuffer(GLenum target,
+ GLsizei count,
+ const GLenum* attachments) {
gles2::GetGLContext()->InvalidateFramebuffer(target, count, attachments);
}
-void GLES2InvalidateSubFramebuffer(GLenum target,
- GLsizei count,
- const GLenum* attachments,
- GLint x,
- GLint y,
- GLsizei width,
- GLsizei height) {
+void GL_APIENTRY GLES2InvalidateSubFramebuffer(GLenum target,
+ GLsizei count,
+ const GLenum* attachments,
+ GLint x,
+ GLint y,
+ GLsizei width,
+ GLsizei height) {
gles2::GetGLContext()->InvalidateSubFramebuffer(target, count, attachments, x,
y, width, height);
}
-GLboolean GLES2IsBuffer(GLuint buffer) {
+GLboolean GL_APIENTRY GLES2IsBuffer(GLuint buffer) {
return gles2::GetGLContext()->IsBuffer(buffer);
}
-GLboolean GLES2IsEnabled(GLenum cap) {
+GLboolean GL_APIENTRY GLES2IsEnabled(GLenum cap) {
return gles2::GetGLContext()->IsEnabled(cap);
}
-GLboolean GLES2IsFramebuffer(GLuint framebuffer) {
+GLboolean GL_APIENTRY GLES2IsFramebuffer(GLuint framebuffer) {
return gles2::GetGLContext()->IsFramebuffer(framebuffer);
}
-GLboolean GLES2IsProgram(GLuint program) {
+GLboolean GL_APIENTRY GLES2IsProgram(GLuint program) {
return gles2::GetGLContext()->IsProgram(program);
}
-GLboolean GLES2IsRenderbuffer(GLuint renderbuffer) {
+GLboolean GL_APIENTRY GLES2IsRenderbuffer(GLuint renderbuffer) {
return gles2::GetGLContext()->IsRenderbuffer(renderbuffer);
}
-GLboolean GLES2IsSampler(GLuint sampler) {
+GLboolean GL_APIENTRY GLES2IsSampler(GLuint sampler) {
return gles2::GetGLContext()->IsSampler(sampler);
}
-GLboolean GLES2IsShader(GLuint shader) {
+GLboolean GL_APIENTRY GLES2IsShader(GLuint shader) {
return gles2::GetGLContext()->IsShader(shader);
}
-GLboolean GLES2IsSync(GLsync sync) {
+GLboolean GL_APIENTRY GLES2IsSync(GLsync sync) {
return gles2::GetGLContext()->IsSync(sync);
}
-GLboolean GLES2IsTexture(GLuint texture) {
+GLboolean GL_APIENTRY GLES2IsTexture(GLuint texture) {
return gles2::GetGLContext()->IsTexture(texture);
}
-GLboolean GLES2IsTransformFeedback(GLuint transformfeedback) {
+GLboolean GL_APIENTRY GLES2IsTransformFeedback(GLuint transformfeedback) {
return gles2::GetGLContext()->IsTransformFeedback(transformfeedback);
}
-void GLES2LineWidth(GLfloat width) {
+void GL_APIENTRY GLES2LineWidth(GLfloat width) {
gles2::GetGLContext()->LineWidth(width);
}
-void GLES2LinkProgram(GLuint program) {
+void GL_APIENTRY GLES2LinkProgram(GLuint program) {
gles2::GetGLContext()->LinkProgram(program);
}
-void GLES2PauseTransformFeedback() {
+void GL_APIENTRY GLES2PauseTransformFeedback() {
gles2::GetGLContext()->PauseTransformFeedback();
}
-void GLES2PixelStorei(GLenum pname, GLint param) {
+void GL_APIENTRY GLES2PixelStorei(GLenum pname, GLint param) {
gles2::GetGLContext()->PixelStorei(pname, param);
}
-void GLES2PolygonOffset(GLfloat factor, GLfloat units) {
+void GL_APIENTRY GLES2PolygonOffset(GLfloat factor, GLfloat units) {
gles2::GetGLContext()->PolygonOffset(factor, units);
}
-void GLES2ReadBuffer(GLenum src) {
+void GL_APIENTRY GLES2ReadBuffer(GLenum src) {
gles2::GetGLContext()->ReadBuffer(src);
}
-void GLES2ReadPixels(GLint x,
- GLint y,
- GLsizei width,
- GLsizei height,
- GLenum format,
- GLenum type,
- void* pixels) {
+void GL_APIENTRY GLES2ReadPixels(GLint x,
+ GLint y,
+ GLsizei width,
+ GLsizei height,
+ GLenum format,
+ GLenum type,
+ void* pixels) {
gles2::GetGLContext()->ReadPixels(x, y, width, height, format, type, pixels);
}
-void GLES2ReleaseShaderCompiler() {
+void GL_APIENTRY GLES2ReleaseShaderCompiler() {
gles2::GetGLContext()->ReleaseShaderCompiler();
}
-void GLES2RenderbufferStorage(GLenum target,
- GLenum internalformat,
- GLsizei width,
- GLsizei height) {
+void GL_APIENTRY GLES2RenderbufferStorage(GLenum target,
+ GLenum internalformat,
+ GLsizei width,
+ GLsizei height) {
gles2::GetGLContext()->RenderbufferStorage(target, internalformat, width,
height);
}
-void GLES2ResumeTransformFeedback() {
+void GL_APIENTRY GLES2ResumeTransformFeedback() {
gles2::GetGLContext()->ResumeTransformFeedback();
}
-void GLES2SampleCoverage(GLclampf value, GLboolean invert) {
+void GL_APIENTRY GLES2SampleCoverage(GLclampf value, GLboolean invert) {
gles2::GetGLContext()->SampleCoverage(value, invert);
}
-void GLES2SamplerParameterf(GLuint sampler, GLenum pname, GLfloat param) {
+void GL_APIENTRY GLES2SamplerParameterf(GLuint sampler,
+ GLenum pname,
+ GLfloat param) {
gles2::GetGLContext()->SamplerParameterf(sampler, pname, param);
}
-void GLES2SamplerParameterfv(GLuint sampler,
- GLenum pname,
- const GLfloat* params) {
+void GL_APIENTRY GLES2SamplerParameterfv(GLuint sampler,
+ GLenum pname,
+ const GLfloat* params) {
gles2::GetGLContext()->SamplerParameterfv(sampler, pname, params);
}
-void GLES2SamplerParameteri(GLuint sampler, GLenum pname, GLint param) {
+void GL_APIENTRY GLES2SamplerParameteri(GLuint sampler,
+ GLenum pname,
+ GLint param) {
gles2::GetGLContext()->SamplerParameteri(sampler, pname, param);
}
-void GLES2SamplerParameteriv(GLuint sampler,
- GLenum pname,
- const GLint* params) {
+void GL_APIENTRY GLES2SamplerParameteriv(GLuint sampler,
+ GLenum pname,
+ const GLint* params) {
gles2::GetGLContext()->SamplerParameteriv(sampler, pname, params);
}
-void GLES2Scissor(GLint x, GLint y, GLsizei width, GLsizei height) {
+void GL_APIENTRY GLES2Scissor(GLint x, GLint y, GLsizei width, GLsizei height) {
gles2::GetGLContext()->Scissor(x, y, width, height);
}
-void GLES2ShaderBinary(GLsizei n,
- const GLuint* shaders,
- GLenum binaryformat,
- const void* binary,
- GLsizei length) {
+void GL_APIENTRY GLES2ShaderBinary(GLsizei n,
+ const GLuint* shaders,
+ GLenum binaryformat,
+ const void* binary,
+ GLsizei length) {
gles2::GetGLContext()->ShaderBinary(n, shaders, binaryformat, binary, length);
}
-void GLES2ShaderSource(GLuint shader,
- GLsizei count,
- const GLchar* const* str,
- const GLint* length) {
+void GL_APIENTRY GLES2ShaderSource(GLuint shader,
+ GLsizei count,
+ const GLchar* const* str,
+ const GLint* length) {
gles2::GetGLContext()->ShaderSource(shader, count, str, length);
}
-void GLES2ShallowFinishCHROMIUM() {
+void GL_APIENTRY GLES2ShallowFinishCHROMIUM() {
gles2::GetGLContext()->ShallowFinishCHROMIUM();
}
-void GLES2ShallowFlushCHROMIUM() {
+void GL_APIENTRY GLES2ShallowFlushCHROMIUM() {
gles2::GetGLContext()->ShallowFlushCHROMIUM();
}
-void GLES2OrderingBarrierCHROMIUM() {
+void GL_APIENTRY GLES2OrderingBarrierCHROMIUM() {
gles2::GetGLContext()->OrderingBarrierCHROMIUM();
}
-void GLES2StencilFunc(GLenum func, GLint ref, GLuint mask) {
+void GL_APIENTRY GLES2StencilFunc(GLenum func, GLint ref, GLuint mask) {
gles2::GetGLContext()->StencilFunc(func, ref, mask);
}
-void GLES2StencilFuncSeparate(GLenum face,
- GLenum func,
- GLint ref,
- GLuint mask) {
+void GL_APIENTRY GLES2StencilFuncSeparate(GLenum face,
+ GLenum func,
+ GLint ref,
+ GLuint mask) {
gles2::GetGLContext()->StencilFuncSeparate(face, func, ref, mask);
}
-void GLES2StencilMask(GLuint mask) {
+void GL_APIENTRY GLES2StencilMask(GLuint mask) {
gles2::GetGLContext()->StencilMask(mask);
}
-void GLES2StencilMaskSeparate(GLenum face, GLuint mask) {
+void GL_APIENTRY GLES2StencilMaskSeparate(GLenum face, GLuint mask) {
gles2::GetGLContext()->StencilMaskSeparate(face, mask);
}
-void GLES2StencilOp(GLenum fail, GLenum zfail, GLenum zpass) {
+void GL_APIENTRY GLES2StencilOp(GLenum fail, GLenum zfail, GLenum zpass) {
gles2::GetGLContext()->StencilOp(fail, zfail, zpass);
}
-void GLES2StencilOpSeparate(GLenum face,
- GLenum fail,
- GLenum zfail,
- GLenum zpass) {
+void GL_APIENTRY GLES2StencilOpSeparate(GLenum face,
+ GLenum fail,
+ GLenum zfail,
+ GLenum zpass) {
gles2::GetGLContext()->StencilOpSeparate(face, fail, zfail, zpass);
}
-void GLES2TexImage2D(GLenum target,
- GLint level,
- GLint internalformat,
- GLsizei width,
- GLsizei height,
- GLint border,
- GLenum format,
- GLenum type,
- const void* pixels) {
+void GL_APIENTRY GLES2TexImage2D(GLenum target,
+ GLint level,
+ GLint internalformat,
+ GLsizei width,
+ GLsizei height,
+ GLint border,
+ GLenum format,
+ GLenum type,
+ const void* pixels) {
gles2::GetGLContext()->TexImage2D(target, level, internalformat, width,
height, border, format, type, pixels);
}
-void GLES2TexImage3D(GLenum target,
- GLint level,
- GLint internalformat,
- GLsizei width,
- GLsizei height,
- GLsizei depth,
- GLint border,
- GLenum format,
- GLenum type,
- const void* pixels) {
+void GL_APIENTRY GLES2TexImage3D(GLenum target,
+ GLint level,
+ GLint internalformat,
+ GLsizei width,
+ GLsizei height,
+ GLsizei depth,
+ GLint border,
+ GLenum format,
+ GLenum type,
+ const void* pixels) {
gles2::GetGLContext()->TexImage3D(target, level, internalformat, width,
height, depth, border, format, type,
pixels);
}
-void GLES2TexParameterf(GLenum target, GLenum pname, GLfloat param) {
+void GL_APIENTRY GLES2TexParameterf(GLenum target,
+ GLenum pname,
+ GLfloat param) {
gles2::GetGLContext()->TexParameterf(target, pname, param);
}
-void GLES2TexParameterfv(GLenum target, GLenum pname, const GLfloat* params) {
+void GL_APIENTRY GLES2TexParameterfv(GLenum target,
+ GLenum pname,
+ const GLfloat* params) {
gles2::GetGLContext()->TexParameterfv(target, pname, params);
}
-void GLES2TexParameteri(GLenum target, GLenum pname, GLint param) {
+void GL_APIENTRY GLES2TexParameteri(GLenum target, GLenum pname, GLint param) {
gles2::GetGLContext()->TexParameteri(target, pname, param);
}
-void GLES2TexParameteriv(GLenum target, GLenum pname, const GLint* params) {
+void GL_APIENTRY GLES2TexParameteriv(GLenum target,
+ GLenum pname,
+ const GLint* params) {
gles2::GetGLContext()->TexParameteriv(target, pname, params);
}
-void GLES2TexStorage3D(GLenum target,
- GLsizei levels,
- GLenum internalFormat,
- GLsizei width,
- GLsizei height,
- GLsizei depth) {
+void GL_APIENTRY GLES2TexStorage3D(GLenum target,
+ GLsizei levels,
+ GLenum internalFormat,
+ GLsizei width,
+ GLsizei height,
+ GLsizei depth) {
gles2::GetGLContext()->TexStorage3D(target, levels, internalFormat, width,
height, depth);
}
-void GLES2TexSubImage2D(GLenum target,
- GLint level,
- GLint xoffset,
- GLint yoffset,
- GLsizei width,
- GLsizei height,
- GLenum format,
- GLenum type,
- const void* pixels) {
+void GL_APIENTRY GLES2TexSubImage2D(GLenum target,
+ GLint level,
+ GLint xoffset,
+ GLint yoffset,
+ GLsizei width,
+ GLsizei height,
+ GLenum format,
+ GLenum type,
+ const void* pixels) {
gles2::GetGLContext()->TexSubImage2D(target, level, xoffset, yoffset, width,
height, format, type, pixels);
}
-void GLES2TexSubImage3D(GLenum target,
- GLint level,
- GLint xoffset,
- GLint yoffset,
- GLint zoffset,
- GLsizei width,
- GLsizei height,
- GLsizei depth,
- GLenum format,
- GLenum type,
- const void* pixels) {
+void GL_APIENTRY GLES2TexSubImage3D(GLenum target,
+ GLint level,
+ GLint xoffset,
+ GLint yoffset,
+ GLint zoffset,
+ GLsizei width,
+ GLsizei height,
+ GLsizei depth,
+ GLenum format,
+ GLenum type,
+ const void* pixels) {
gles2::GetGLContext()->TexSubImage3D(target, level, xoffset, yoffset, zoffset,
width, height, depth, format, type,
pixels);
}
-void GLES2TransformFeedbackVaryings(GLuint program,
- GLsizei count,
- const char* const* varyings,
- GLenum buffermode) {
+void GL_APIENTRY GLES2TransformFeedbackVaryings(GLuint program,
+ GLsizei count,
+ const char* const* varyings,
+ GLenum buffermode) {
gles2::GetGLContext()->TransformFeedbackVaryings(program, count, varyings,
buffermode);
}
-void GLES2Uniform1f(GLint location, GLfloat x) {
+void GL_APIENTRY GLES2Uniform1f(GLint location, GLfloat x) {
gles2::GetGLContext()->Uniform1f(location, x);
}
-void GLES2Uniform1fv(GLint location, GLsizei count, const GLfloat* v) {
+void GL_APIENTRY GLES2Uniform1fv(GLint location,
+ GLsizei count,
+ const GLfloat* v) {
gles2::GetGLContext()->Uniform1fv(location, count, v);
}
-void GLES2Uniform1i(GLint location, GLint x) {
+void GL_APIENTRY GLES2Uniform1i(GLint location, GLint x) {
gles2::GetGLContext()->Uniform1i(location, x);
}
-void GLES2Uniform1iv(GLint location, GLsizei count, const GLint* v) {
+void GL_APIENTRY GLES2Uniform1iv(GLint location,
+ GLsizei count,
+ const GLint* v) {
gles2::GetGLContext()->Uniform1iv(location, count, v);
}
-void GLES2Uniform1ui(GLint location, GLuint x) {
+void GL_APIENTRY GLES2Uniform1ui(GLint location, GLuint x) {
gles2::GetGLContext()->Uniform1ui(location, x);
}
-void GLES2Uniform1uiv(GLint location, GLsizei count, const GLuint* v) {
+void GL_APIENTRY GLES2Uniform1uiv(GLint location,
+ GLsizei count,
+ const GLuint* v) {
gles2::GetGLContext()->Uniform1uiv(location, count, v);
}
-void GLES2Uniform2f(GLint location, GLfloat x, GLfloat y) {
+void GL_APIENTRY GLES2Uniform2f(GLint location, GLfloat x, GLfloat y) {
gles2::GetGLContext()->Uniform2f(location, x, y);
}
-void GLES2Uniform2fv(GLint location, GLsizei count, const GLfloat* v) {
+void GL_APIENTRY GLES2Uniform2fv(GLint location,
+ GLsizei count,
+ const GLfloat* v) {
gles2::GetGLContext()->Uniform2fv(location, count, v);
}
-void GLES2Uniform2i(GLint location, GLint x, GLint y) {
+void GL_APIENTRY GLES2Uniform2i(GLint location, GLint x, GLint y) {
gles2::GetGLContext()->Uniform2i(location, x, y);
}
-void GLES2Uniform2iv(GLint location, GLsizei count, const GLint* v) {
+void GL_APIENTRY GLES2Uniform2iv(GLint location,
+ GLsizei count,
+ const GLint* v) {
gles2::GetGLContext()->Uniform2iv(location, count, v);
}
-void GLES2Uniform2ui(GLint location, GLuint x, GLuint y) {
+void GL_APIENTRY GLES2Uniform2ui(GLint location, GLuint x, GLuint y) {
gles2::GetGLContext()->Uniform2ui(location, x, y);
}
-void GLES2Uniform2uiv(GLint location, GLsizei count, const GLuint* v) {
+void GL_APIENTRY GLES2Uniform2uiv(GLint location,
+ GLsizei count,
+ const GLuint* v) {
gles2::GetGLContext()->Uniform2uiv(location, count, v);
}
-void GLES2Uniform3f(GLint location, GLfloat x, GLfloat y, GLfloat z) {
+void GL_APIENTRY GLES2Uniform3f(GLint location,
+ GLfloat x,
+ GLfloat y,
+ GLfloat z) {
gles2::GetGLContext()->Uniform3f(location, x, y, z);
}
-void GLES2Uniform3fv(GLint location, GLsizei count, const GLfloat* v) {
+void GL_APIENTRY GLES2Uniform3fv(GLint location,
+ GLsizei count,
+ const GLfloat* v) {
gles2::GetGLContext()->Uniform3fv(location, count, v);
}
-void GLES2Uniform3i(GLint location, GLint x, GLint y, GLint z) {
+void GL_APIENTRY GLES2Uniform3i(GLint location, GLint x, GLint y, GLint z) {
gles2::GetGLContext()->Uniform3i(location, x, y, z);
}
-void GLES2Uniform3iv(GLint location, GLsizei count, const GLint* v) {
+void GL_APIENTRY GLES2Uniform3iv(GLint location,
+ GLsizei count,
+ const GLint* v) {
gles2::GetGLContext()->Uniform3iv(location, count, v);
}
-void GLES2Uniform3ui(GLint location, GLuint x, GLuint y, GLuint z) {
+void GL_APIENTRY GLES2Uniform3ui(GLint location, GLuint x, GLuint y, GLuint z) {
gles2::GetGLContext()->Uniform3ui(location, x, y, z);
}
-void GLES2Uniform3uiv(GLint location, GLsizei count, const GLuint* v) {
+void GL_APIENTRY GLES2Uniform3uiv(GLint location,
+ GLsizei count,
+ const GLuint* v) {
gles2::GetGLContext()->Uniform3uiv(location, count, v);
}
-void GLES2Uniform4f(GLint location,
- GLfloat x,
- GLfloat y,
- GLfloat z,
- GLfloat w) {
+void GL_APIENTRY
+GLES2Uniform4f(GLint location, GLfloat x, GLfloat y, GLfloat z, GLfloat w) {
gles2::GetGLContext()->Uniform4f(location, x, y, z, w);
}
-void GLES2Uniform4fv(GLint location, GLsizei count, const GLfloat* v) {
+void GL_APIENTRY GLES2Uniform4fv(GLint location,
+ GLsizei count,
+ const GLfloat* v) {
gles2::GetGLContext()->Uniform4fv(location, count, v);
}
-void GLES2Uniform4i(GLint location, GLint x, GLint y, GLint z, GLint w) {
+void GL_APIENTRY
+GLES2Uniform4i(GLint location, GLint x, GLint y, GLint z, GLint w) {
gles2::GetGLContext()->Uniform4i(location, x, y, z, w);
}
-void GLES2Uniform4iv(GLint location, GLsizei count, const GLint* v) {
+void GL_APIENTRY GLES2Uniform4iv(GLint location,
+ GLsizei count,
+ const GLint* v) {
gles2::GetGLContext()->Uniform4iv(location, count, v);
}
-void GLES2Uniform4ui(GLint location, GLuint x, GLuint y, GLuint z, GLuint w) {
+void GL_APIENTRY
+GLES2Uniform4ui(GLint location, GLuint x, GLuint y, GLuint z, GLuint w) {
gles2::GetGLContext()->Uniform4ui(location, x, y, z, w);
}
-void GLES2Uniform4uiv(GLint location, GLsizei count, const GLuint* v) {
+void GL_APIENTRY GLES2Uniform4uiv(GLint location,
+ GLsizei count,
+ const GLuint* v) {
gles2::GetGLContext()->Uniform4uiv(location, count, v);
}
-void GLES2UniformBlockBinding(GLuint program, GLuint index, GLuint binding) {
+void GL_APIENTRY GLES2UniformBlockBinding(GLuint program,
+ GLuint index,
+ GLuint binding) {
gles2::GetGLContext()->UniformBlockBinding(program, index, binding);
}
-void GLES2UniformMatrix2fv(GLint location,
- GLsizei count,
- GLboolean transpose,
- const GLfloat* value) {
+void GL_APIENTRY GLES2UniformMatrix2fv(GLint location,
+ GLsizei count,
+ GLboolean transpose,
+ const GLfloat* value) {
gles2::GetGLContext()->UniformMatrix2fv(location, count, transpose, value);
}
-void GLES2UniformMatrix2x3fv(GLint location,
- GLsizei count,
- GLboolean transpose,
- const GLfloat* value) {
+void GL_APIENTRY GLES2UniformMatrix2x3fv(GLint location,
+ GLsizei count,
+ GLboolean transpose,
+ const GLfloat* value) {
gles2::GetGLContext()->UniformMatrix2x3fv(location, count, transpose, value);
}
-void GLES2UniformMatrix2x4fv(GLint location,
- GLsizei count,
- GLboolean transpose,
- const GLfloat* value) {
+void GL_APIENTRY GLES2UniformMatrix2x4fv(GLint location,
+ GLsizei count,
+ GLboolean transpose,
+ const GLfloat* value) {
gles2::GetGLContext()->UniformMatrix2x4fv(location, count, transpose, value);
}
-void GLES2UniformMatrix3fv(GLint location,
- GLsizei count,
- GLboolean transpose,
- const GLfloat* value) {
+void GL_APIENTRY GLES2UniformMatrix3fv(GLint location,
+ GLsizei count,
+ GLboolean transpose,
+ const GLfloat* value) {
gles2::GetGLContext()->UniformMatrix3fv(location, count, transpose, value);
}
-void GLES2UniformMatrix3x2fv(GLint location,
- GLsizei count,
- GLboolean transpose,
- const GLfloat* value) {
+void GL_APIENTRY GLES2UniformMatrix3x2fv(GLint location,
+ GLsizei count,
+ GLboolean transpose,
+ const GLfloat* value) {
gles2::GetGLContext()->UniformMatrix3x2fv(location, count, transpose, value);
}
-void GLES2UniformMatrix3x4fv(GLint location,
- GLsizei count,
- GLboolean transpose,
- const GLfloat* value) {
+void GL_APIENTRY GLES2UniformMatrix3x4fv(GLint location,
+ GLsizei count,
+ GLboolean transpose,
+ const GLfloat* value) {
gles2::GetGLContext()->UniformMatrix3x4fv(location, count, transpose, value);
}
-void GLES2UniformMatrix4fv(GLint location,
- GLsizei count,
- GLboolean transpose,
- const GLfloat* value) {
+void GL_APIENTRY GLES2UniformMatrix4fv(GLint location,
+ GLsizei count,
+ GLboolean transpose,
+ const GLfloat* value) {
gles2::GetGLContext()->UniformMatrix4fv(location, count, transpose, value);
}
-void GLES2UniformMatrix4x2fv(GLint location,
- GLsizei count,
- GLboolean transpose,
- const GLfloat* value) {
+void GL_APIENTRY GLES2UniformMatrix4x2fv(GLint location,
+ GLsizei count,
+ GLboolean transpose,
+ const GLfloat* value) {
gles2::GetGLContext()->UniformMatrix4x2fv(location, count, transpose, value);
}
-void GLES2UniformMatrix4x3fv(GLint location,
- GLsizei count,
- GLboolean transpose,
- const GLfloat* value) {
+void GL_APIENTRY GLES2UniformMatrix4x3fv(GLint location,
+ GLsizei count,
+ GLboolean transpose,
+ const GLfloat* value) {
gles2::GetGLContext()->UniformMatrix4x3fv(location, count, transpose, value);
}
-void GLES2UseProgram(GLuint program) {
+void GL_APIENTRY GLES2UseProgram(GLuint program) {
gles2::GetGLContext()->UseProgram(program);
}
-void GLES2ValidateProgram(GLuint program) {
+void GL_APIENTRY GLES2ValidateProgram(GLuint program) {
gles2::GetGLContext()->ValidateProgram(program);
}
-void GLES2VertexAttrib1f(GLuint indx, GLfloat x) {
+void GL_APIENTRY GLES2VertexAttrib1f(GLuint indx, GLfloat x) {
gles2::GetGLContext()->VertexAttrib1f(indx, x);
}
-void GLES2VertexAttrib1fv(GLuint indx, const GLfloat* values) {
+void GL_APIENTRY GLES2VertexAttrib1fv(GLuint indx, const GLfloat* values) {
gles2::GetGLContext()->VertexAttrib1fv(indx, values);
}
-void GLES2VertexAttrib2f(GLuint indx, GLfloat x, GLfloat y) {
+void GL_APIENTRY GLES2VertexAttrib2f(GLuint indx, GLfloat x, GLfloat y) {
gles2::GetGLContext()->VertexAttrib2f(indx, x, y);
}
-void GLES2VertexAttrib2fv(GLuint indx, const GLfloat* values) {
+void GL_APIENTRY GLES2VertexAttrib2fv(GLuint indx, const GLfloat* values) {
gles2::GetGLContext()->VertexAttrib2fv(indx, values);
}
-void GLES2VertexAttrib3f(GLuint indx, GLfloat x, GLfloat y, GLfloat z) {
+void GL_APIENTRY GLES2VertexAttrib3f(GLuint indx,
+ GLfloat x,
+ GLfloat y,
+ GLfloat z) {
gles2::GetGLContext()->VertexAttrib3f(indx, x, y, z);
}
-void GLES2VertexAttrib3fv(GLuint indx, const GLfloat* values) {
+void GL_APIENTRY GLES2VertexAttrib3fv(GLuint indx, const GLfloat* values) {
gles2::GetGLContext()->VertexAttrib3fv(indx, values);
}
-void GLES2VertexAttrib4f(GLuint indx,
- GLfloat x,
- GLfloat y,
- GLfloat z,
- GLfloat w) {
+void GL_APIENTRY
+GLES2VertexAttrib4f(GLuint indx, GLfloat x, GLfloat y, GLfloat z, GLfloat w) {
gles2::GetGLContext()->VertexAttrib4f(indx, x, y, z, w);
}
-void GLES2VertexAttrib4fv(GLuint indx, const GLfloat* values) {
+void GL_APIENTRY GLES2VertexAttrib4fv(GLuint indx, const GLfloat* values) {
gles2::GetGLContext()->VertexAttrib4fv(indx, values);
}
-void GLES2VertexAttribI4i(GLuint indx, GLint x, GLint y, GLint z, GLint w) {
+void GL_APIENTRY
+GLES2VertexAttribI4i(GLuint indx, GLint x, GLint y, GLint z, GLint w) {
gles2::GetGLContext()->VertexAttribI4i(indx, x, y, z, w);
}
-void GLES2VertexAttribI4iv(GLuint indx, const GLint* values) {
+void GL_APIENTRY GLES2VertexAttribI4iv(GLuint indx, const GLint* values) {
gles2::GetGLContext()->VertexAttribI4iv(indx, values);
}
-void GLES2VertexAttribI4ui(GLuint indx,
- GLuint x,
- GLuint y,
- GLuint z,
- GLuint w) {
+void GL_APIENTRY
+GLES2VertexAttribI4ui(GLuint indx, GLuint x, GLuint y, GLuint z, GLuint w) {
gles2::GetGLContext()->VertexAttribI4ui(indx, x, y, z, w);
}
-void GLES2VertexAttribI4uiv(GLuint indx, const GLuint* values) {
+void GL_APIENTRY GLES2VertexAttribI4uiv(GLuint indx, const GLuint* values) {
gles2::GetGLContext()->VertexAttribI4uiv(indx, values);
}
-void GLES2VertexAttribIPointer(GLuint indx,
- GLint size,
- GLenum type,
- GLsizei stride,
- const void* ptr) {
+void GL_APIENTRY GLES2VertexAttribIPointer(GLuint indx,
+ GLint size,
+ GLenum type,
+ GLsizei stride,
+ const void* ptr) {
gles2::GetGLContext()->VertexAttribIPointer(indx, size, type, stride, ptr);
}
-void GLES2VertexAttribPointer(GLuint indx,
- GLint size,
- GLenum type,
- GLboolean normalized,
- GLsizei stride,
- const void* ptr) {
+void GL_APIENTRY GLES2VertexAttribPointer(GLuint indx,
+ GLint size,
+ GLenum type,
+ GLboolean normalized,
+ GLsizei stride,
+ const void* ptr) {
gles2::GetGLContext()->VertexAttribPointer(indx, size, type, normalized,
stride, ptr);
}
-void GLES2Viewport(GLint x, GLint y, GLsizei width, GLsizei height) {
+void GL_APIENTRY GLES2Viewport(GLint x,
+ GLint y,
+ GLsizei width,
+ GLsizei height) {
gles2::GetGLContext()->Viewport(x, y, width, height);
}
-void GLES2WaitSync(GLsync sync, GLbitfield flags, GLuint64 timeout) {
+void GL_APIENTRY GLES2WaitSync(GLsync sync,
+ GLbitfield flags,
+ GLuint64 timeout) {
gles2::GetGLContext()->WaitSync(sync, flags, timeout);
}
-void GLES2BlitFramebufferCHROMIUM(GLint srcX0,
- GLint srcY0,
- GLint srcX1,
- GLint srcY1,
- GLint dstX0,
- GLint dstY0,
- GLint dstX1,
- GLint dstY1,
- GLbitfield mask,
- GLenum filter) {
+void GL_APIENTRY GLES2BlitFramebufferCHROMIUM(GLint srcX0,
+ GLint srcY0,
+ GLint srcX1,
+ GLint srcY1,
+ GLint dstX0,
+ GLint dstY0,
+ GLint dstX1,
+ GLint dstY1,
+ GLbitfield mask,
+ GLenum filter) {
gles2::GetGLContext()->BlitFramebufferCHROMIUM(
srcX0, srcY0, srcX1, srcY1, dstX0, dstY0, dstX1, dstY1, mask, filter);
}
-void GLES2RenderbufferStorageMultisampleCHROMIUM(GLenum target,
- GLsizei samples,
- GLenum internalformat,
- GLsizei width,
- GLsizei height) {
- gles2::GetGLContext()->RenderbufferStorageMultisampleCHROMIUM(
- target, samples, internalformat, width, height);
-}
-void GLES2RenderbufferStorageMultisampleEXT(GLenum target,
+void GL_APIENTRY
+GLES2RenderbufferStorageMultisampleCHROMIUM(GLenum target,
GLsizei samples,
GLenum internalformat,
GLsizei width,
GLsizei height) {
+ gles2::GetGLContext()->RenderbufferStorageMultisampleCHROMIUM(
+ target, samples, internalformat, width, height);
+}
+void GL_APIENTRY GLES2RenderbufferStorageMultisampleEXT(GLenum target,
+ GLsizei samples,
+ GLenum internalformat,
+ GLsizei width,
+ GLsizei height) {
gles2::GetGLContext()->RenderbufferStorageMultisampleEXT(
target, samples, internalformat, width, height);
}
-void GLES2FramebufferTexture2DMultisampleEXT(GLenum target,
- GLenum attachment,
- GLenum textarget,
- GLuint texture,
- GLint level,
- GLsizei samples) {
+void GL_APIENTRY GLES2FramebufferTexture2DMultisampleEXT(GLenum target,
+ GLenum attachment,
+ GLenum textarget,
+ GLuint texture,
+ GLint level,
+ GLsizei samples) {
gles2::GetGLContext()->FramebufferTexture2DMultisampleEXT(
target, attachment, textarget, texture, level, samples);
}
-void GLES2TexStorage2DEXT(GLenum target,
- GLsizei levels,
- GLenum internalFormat,
- GLsizei width,
- GLsizei height) {
+void GL_APIENTRY GLES2TexStorage2DEXT(GLenum target,
+ GLsizei levels,
+ GLenum internalFormat,
+ GLsizei width,
+ GLsizei height) {
gles2::GetGLContext()->TexStorage2DEXT(target, levels, internalFormat, width,
height);
}
-void GLES2GenQueriesEXT(GLsizei n, GLuint* queries) {
+void GL_APIENTRY GLES2GenQueriesEXT(GLsizei n, GLuint* queries) {
gles2::GetGLContext()->GenQueriesEXT(n, queries);
}
-void GLES2DeleteQueriesEXT(GLsizei n, const GLuint* queries) {
+void GL_APIENTRY GLES2DeleteQueriesEXT(GLsizei n, const GLuint* queries) {
gles2::GetGLContext()->DeleteQueriesEXT(n, queries);
}
-GLboolean GLES2IsQueryEXT(GLuint id) {
+void GL_APIENTRY GLES2QueryCounterEXT(GLuint id, GLenum target) {
+ gles2::GetGLContext()->QueryCounterEXT(id, target);
+}
+GLboolean GL_APIENTRY GLES2IsQueryEXT(GLuint id) {
return gles2::GetGLContext()->IsQueryEXT(id);
}
-void GLES2BeginQueryEXT(GLenum target, GLuint id) {
+void GL_APIENTRY GLES2BeginQueryEXT(GLenum target, GLuint id) {
gles2::GetGLContext()->BeginQueryEXT(target, id);
}
-void GLES2BeginTransformFeedback(GLenum primitivemode) {
+void GL_APIENTRY GLES2BeginTransformFeedback(GLenum primitivemode) {
gles2::GetGLContext()->BeginTransformFeedback(primitivemode);
}
-void GLES2EndQueryEXT(GLenum target) {
+void GL_APIENTRY GLES2EndQueryEXT(GLenum target) {
gles2::GetGLContext()->EndQueryEXT(target);
}
-void GLES2EndTransformFeedback() {
+void GL_APIENTRY GLES2EndTransformFeedback() {
gles2::GetGLContext()->EndTransformFeedback();
}
-void GLES2GetQueryivEXT(GLenum target, GLenum pname, GLint* params) {
+void GL_APIENTRY GLES2GetQueryivEXT(GLenum target,
+ GLenum pname,
+ GLint* params) {
gles2::GetGLContext()->GetQueryivEXT(target, pname, params);
}
-void GLES2GetQueryObjectuivEXT(GLuint id, GLenum pname, GLuint* params) {
+void GL_APIENTRY GLES2GetQueryObjectivEXT(GLuint id,
+ GLenum pname,
+ GLint* params) {
+ gles2::GetGLContext()->GetQueryObjectivEXT(id, pname, params);
+}
+void GL_APIENTRY GLES2GetQueryObjectuivEXT(GLuint id,
+ GLenum pname,
+ GLuint* params) {
gles2::GetGLContext()->GetQueryObjectuivEXT(id, pname, params);
}
-void GLES2GetQueryObjectui64vEXT(GLuint id, GLenum pname, GLuint64* params) {
+void GL_APIENTRY GLES2GetQueryObjecti64vEXT(GLuint id,
+ GLenum pname,
+ GLint64* params) {
+ gles2::GetGLContext()->GetQueryObjecti64vEXT(id, pname, params);
+}
+void GL_APIENTRY GLES2GetQueryObjectui64vEXT(GLuint id,
+ GLenum pname,
+ GLuint64* params) {
gles2::GetGLContext()->GetQueryObjectui64vEXT(id, pname, params);
}
-void GLES2InsertEventMarkerEXT(GLsizei length, const GLchar* marker) {
+void GL_APIENTRY GLES2SetDisjointValueSyncCHROMIUM() {
+ gles2::GetGLContext()->SetDisjointValueSyncCHROMIUM();
+}
+void GL_APIENTRY GLES2InsertEventMarkerEXT(GLsizei length,
+ const GLchar* marker) {
gles2::GetGLContext()->InsertEventMarkerEXT(length, marker);
}
-void GLES2PushGroupMarkerEXT(GLsizei length, const GLchar* marker) {
+void GL_APIENTRY GLES2PushGroupMarkerEXT(GLsizei length, const GLchar* marker) {
gles2::GetGLContext()->PushGroupMarkerEXT(length, marker);
}
-void GLES2PopGroupMarkerEXT() {
+void GL_APIENTRY GLES2PopGroupMarkerEXT() {
gles2::GetGLContext()->PopGroupMarkerEXT();
}
-void GLES2GenVertexArraysOES(GLsizei n, GLuint* arrays) {
+void GL_APIENTRY GLES2GenVertexArraysOES(GLsizei n, GLuint* arrays) {
gles2::GetGLContext()->GenVertexArraysOES(n, arrays);
}
-void GLES2DeleteVertexArraysOES(GLsizei n, const GLuint* arrays) {
+void GL_APIENTRY GLES2DeleteVertexArraysOES(GLsizei n, const GLuint* arrays) {
gles2::GetGLContext()->DeleteVertexArraysOES(n, arrays);
}
-GLboolean GLES2IsVertexArrayOES(GLuint array) {
+GLboolean GL_APIENTRY GLES2IsVertexArrayOES(GLuint array) {
return gles2::GetGLContext()->IsVertexArrayOES(array);
}
-void GLES2BindVertexArrayOES(GLuint array) {
+void GL_APIENTRY GLES2BindVertexArrayOES(GLuint array) {
gles2::GetGLContext()->BindVertexArrayOES(array);
}
-void GLES2SwapBuffers() {
+void GL_APIENTRY GLES2SwapBuffers() {
gles2::GetGLContext()->SwapBuffers();
}
-GLuint GLES2GetMaxValueInBufferCHROMIUM(GLuint buffer_id,
- GLsizei count,
- GLenum type,
- GLuint offset) {
+GLuint GL_APIENTRY GLES2GetMaxValueInBufferCHROMIUM(GLuint buffer_id,
+ GLsizei count,
+ GLenum type,
+ GLuint offset) {
return gles2::GetGLContext()->GetMaxValueInBufferCHROMIUM(buffer_id, count,
type, offset);
}
-GLboolean GLES2EnableFeatureCHROMIUM(const char* feature) {
+GLboolean GL_APIENTRY GLES2EnableFeatureCHROMIUM(const char* feature) {
return gles2::GetGLContext()->EnableFeatureCHROMIUM(feature);
}
-void* GLES2MapBufferCHROMIUM(GLuint target, GLenum access) {
+void* GL_APIENTRY GLES2MapBufferCHROMIUM(GLuint target, GLenum access) {
return gles2::GetGLContext()->MapBufferCHROMIUM(target, access);
}
-GLboolean GLES2UnmapBufferCHROMIUM(GLuint target) {
+GLboolean GL_APIENTRY GLES2UnmapBufferCHROMIUM(GLuint target) {
return gles2::GetGLContext()->UnmapBufferCHROMIUM(target);
}
-void* GLES2MapBufferSubDataCHROMIUM(GLuint target,
- GLintptr offset,
- GLsizeiptr size,
- GLenum access) {
+void* GL_APIENTRY GLES2MapBufferSubDataCHROMIUM(GLuint target,
+ GLintptr offset,
+ GLsizeiptr size,
+ GLenum access) {
return gles2::GetGLContext()->MapBufferSubDataCHROMIUM(target, offset, size,
access);
}
-void GLES2UnmapBufferSubDataCHROMIUM(const void* mem) {
+void GL_APIENTRY GLES2UnmapBufferSubDataCHROMIUM(const void* mem) {
gles2::GetGLContext()->UnmapBufferSubDataCHROMIUM(mem);
}
-void* GLES2MapBufferRange(GLenum target,
- GLintptr offset,
- GLsizeiptr size,
- GLbitfield access) {
+void* GL_APIENTRY GLES2MapBufferRange(GLenum target,
+ GLintptr offset,
+ GLsizeiptr size,
+ GLbitfield access) {
return gles2::GetGLContext()->MapBufferRange(target, offset, size, access);
}
-GLboolean GLES2UnmapBuffer(GLenum target) {
+GLboolean GL_APIENTRY GLES2UnmapBuffer(GLenum target) {
return gles2::GetGLContext()->UnmapBuffer(target);
}
-void* GLES2MapTexSubImage2DCHROMIUM(GLenum target,
- GLint level,
- GLint xoffset,
- GLint yoffset,
- GLsizei width,
- GLsizei height,
- GLenum format,
- GLenum type,
- GLenum access) {
+void* GL_APIENTRY GLES2MapTexSubImage2DCHROMIUM(GLenum target,
+ GLint level,
+ GLint xoffset,
+ GLint yoffset,
+ GLsizei width,
+ GLsizei height,
+ GLenum format,
+ GLenum type,
+ GLenum access) {
return gles2::GetGLContext()->MapTexSubImage2DCHROMIUM(
target, level, xoffset, yoffset, width, height, format, type, access);
}
-void GLES2UnmapTexSubImage2DCHROMIUM(const void* mem) {
+void GL_APIENTRY GLES2UnmapTexSubImage2DCHROMIUM(const void* mem) {
gles2::GetGLContext()->UnmapTexSubImage2DCHROMIUM(mem);
}
-void GLES2ResizeCHROMIUM(GLuint width, GLuint height, GLfloat scale_factor) {
+void GL_APIENTRY GLES2ResizeCHROMIUM(GLuint width,
+ GLuint height,
+ GLfloat scale_factor) {
gles2::GetGLContext()->ResizeCHROMIUM(width, height, scale_factor);
}
-const GLchar* GLES2GetRequestableExtensionsCHROMIUM() {
+const GLchar* GL_APIENTRY GLES2GetRequestableExtensionsCHROMIUM() {
return gles2::GetGLContext()->GetRequestableExtensionsCHROMIUM();
}
-void GLES2RequestExtensionCHROMIUM(const char* extension) {
+void GL_APIENTRY GLES2RequestExtensionCHROMIUM(const char* extension) {
gles2::GetGLContext()->RequestExtensionCHROMIUM(extension);
}
-void GLES2RateLimitOffscreenContextCHROMIUM() {
- gles2::GetGLContext()->RateLimitOffscreenContextCHROMIUM();
-}
-void GLES2GetProgramInfoCHROMIUM(GLuint program,
- GLsizei bufsize,
- GLsizei* size,
- void* info) {
+void GL_APIENTRY GLES2GetProgramInfoCHROMIUM(GLuint program,
+ GLsizei bufsize,
+ GLsizei* size,
+ void* info) {
gles2::GetGLContext()->GetProgramInfoCHROMIUM(program, bufsize, size, info);
}
-void GLES2GetUniformBlocksCHROMIUM(GLuint program,
- GLsizei bufsize,
- GLsizei* size,
- void* info) {
- gles2::GetGLContext()->GetUniformBlocksCHROMIUM(program, bufsize, size, info);
-}
-void GLES2GetTransformFeedbackVaryingsCHROMIUM(GLuint program,
+void GL_APIENTRY GLES2GetUniformBlocksCHROMIUM(GLuint program,
GLsizei bufsize,
GLsizei* size,
void* info) {
+ gles2::GetGLContext()->GetUniformBlocksCHROMIUM(program, bufsize, size, info);
+}
+void GL_APIENTRY GLES2GetTransformFeedbackVaryingsCHROMIUM(GLuint program,
+ GLsizei bufsize,
+ GLsizei* size,
+ void* info) {
gles2::GetGLContext()->GetTransformFeedbackVaryingsCHROMIUM(program, bufsize,
size, info);
}
-void GLES2GetUniformsES3CHROMIUM(GLuint program,
- GLsizei bufsize,
- GLsizei* size,
- void* info) {
+void GL_APIENTRY GLES2GetUniformsES3CHROMIUM(GLuint program,
+ GLsizei bufsize,
+ GLsizei* size,
+ void* info) {
gles2::GetGLContext()->GetUniformsES3CHROMIUM(program, bufsize, size, info);
}
-GLuint GLES2CreateStreamTextureCHROMIUM(GLuint texture) {
+GLuint GL_APIENTRY GLES2CreateStreamTextureCHROMIUM(GLuint texture) {
return gles2::GetGLContext()->CreateStreamTextureCHROMIUM(texture);
}
-GLuint GLES2CreateImageCHROMIUM(ClientBuffer buffer,
- GLsizei width,
- GLsizei height,
- GLenum internalformat) {
+GLuint GL_APIENTRY GLES2CreateImageCHROMIUM(ClientBuffer buffer,
+ GLsizei width,
+ GLsizei height,
+ GLenum internalformat) {
return gles2::GetGLContext()->CreateImageCHROMIUM(buffer, width, height,
internalformat);
}
-void GLES2DestroyImageCHROMIUM(GLuint image_id) {
+void GL_APIENTRY GLES2DestroyImageCHROMIUM(GLuint image_id) {
gles2::GetGLContext()->DestroyImageCHROMIUM(image_id);
}
-GLuint GLES2CreateGpuMemoryBufferImageCHROMIUM(GLsizei width,
- GLsizei height,
- GLenum internalformat,
- GLenum usage) {
+GLuint GL_APIENTRY
+GLES2CreateGpuMemoryBufferImageCHROMIUM(GLsizei width,
+ GLsizei height,
+ GLenum internalformat,
+ GLenum usage) {
return gles2::GetGLContext()->CreateGpuMemoryBufferImageCHROMIUM(
width, height, internalformat, usage);
}
-void GLES2GetTranslatedShaderSourceANGLE(GLuint shader,
- GLsizei bufsize,
- GLsizei* length,
- char* source) {
+void GL_APIENTRY GLES2GetTranslatedShaderSourceANGLE(GLuint shader,
+ GLsizei bufsize,
+ GLsizei* length,
+ char* source) {
gles2::GetGLContext()->GetTranslatedShaderSourceANGLE(shader, bufsize, length,
source);
}
-void GLES2PostSubBufferCHROMIUM(GLint x, GLint y, GLint width, GLint height) {
+void GL_APIENTRY GLES2PostSubBufferCHROMIUM(GLint x,
+ GLint y,
+ GLint width,
+ GLint height) {
gles2::GetGLContext()->PostSubBufferCHROMIUM(x, y, width, height);
}
-void GLES2TexImageIOSurface2DCHROMIUM(GLenum target,
- GLsizei width,
- GLsizei height,
- GLuint ioSurfaceId,
- GLuint plane) {
+void GL_APIENTRY GLES2TexImageIOSurface2DCHROMIUM(GLenum target,
+ GLsizei width,
+ GLsizei height,
+ GLuint ioSurfaceId,
+ GLuint plane) {
gles2::GetGLContext()->TexImageIOSurface2DCHROMIUM(target, width, height,
ioSurfaceId, plane);
}
-void GLES2CopyTextureCHROMIUM(GLenum target,
- GLenum source_id,
- GLenum dest_id,
- GLint internalformat,
- GLenum dest_type,
- GLboolean unpack_flip_y,
- GLboolean unpack_premultiply_alpha,
- GLboolean unpack_unmultiply_alpha) {
+void GL_APIENTRY GLES2CopyTextureCHROMIUM(GLenum target,
+ GLenum source_id,
+ GLenum dest_id,
+ GLint internalformat,
+ GLenum dest_type,
+ GLboolean unpack_flip_y,
+ GLboolean unpack_premultiply_alpha,
+ GLboolean unpack_unmultiply_alpha) {
gles2::GetGLContext()->CopyTextureCHROMIUM(
target, source_id, dest_id, internalformat, dest_type, unpack_flip_y,
unpack_premultiply_alpha, unpack_unmultiply_alpha);
}
-void GLES2CopySubTextureCHROMIUM(GLenum target,
- GLenum source_id,
- GLenum dest_id,
- GLint xoffset,
- GLint yoffset,
- GLint x,
- GLint y,
- GLsizei width,
- GLsizei height,
- GLboolean unpack_flip_y,
- GLboolean unpack_premultiply_alpha,
- GLboolean unpack_unmultiply_alpha) {
+void GL_APIENTRY
+GLES2CopySubTextureCHROMIUM(GLenum target,
+ GLenum source_id,
+ GLenum dest_id,
+ GLint xoffset,
+ GLint yoffset,
+ GLint x,
+ GLint y,
+ GLsizei width,
+ GLsizei height,
+ GLboolean unpack_flip_y,
+ GLboolean unpack_premultiply_alpha,
+ GLboolean unpack_unmultiply_alpha) {
gles2::GetGLContext()->CopySubTextureCHROMIUM(
target, source_id, dest_id, xoffset, yoffset, x, y, width, height,
unpack_flip_y, unpack_premultiply_alpha, unpack_unmultiply_alpha);
}
-void GLES2CompressedCopyTextureCHROMIUM(GLenum target,
- GLenum source_id,
- GLenum dest_id) {
+void GL_APIENTRY GLES2CompressedCopyTextureCHROMIUM(GLenum target,
+ GLenum source_id,
+ GLenum dest_id) {
gles2::GetGLContext()->CompressedCopyTextureCHROMIUM(target, source_id,
dest_id);
}
-void GLES2DrawArraysInstancedANGLE(GLenum mode,
- GLint first,
- GLsizei count,
- GLsizei primcount) {
+void GL_APIENTRY GLES2CompressedCopySubTextureCHROMIUM(GLenum target,
+ GLenum source_id,
+ GLenum dest_id,
+ GLint xoffset,
+ GLint yoffset,
+ GLint x,
+ GLint y,
+ GLsizei width,
+ GLsizei height) {
+ gles2::GetGLContext()->CompressedCopySubTextureCHROMIUM(
+ target, source_id, dest_id, xoffset, yoffset, x, y, width, height);
+}
+void GL_APIENTRY GLES2DrawArraysInstancedANGLE(GLenum mode,
+ GLint first,
+ GLsizei count,
+ GLsizei primcount) {
gles2::GetGLContext()->DrawArraysInstancedANGLE(mode, first, count,
primcount);
}
-void GLES2DrawElementsInstancedANGLE(GLenum mode,
- GLsizei count,
- GLenum type,
- const void* indices,
- GLsizei primcount) {
+void GL_APIENTRY GLES2DrawElementsInstancedANGLE(GLenum mode,
+ GLsizei count,
+ GLenum type,
+ const void* indices,
+ GLsizei primcount) {
gles2::GetGLContext()->DrawElementsInstancedANGLE(mode, count, type, indices,
primcount);
}
-void GLES2VertexAttribDivisorANGLE(GLuint index, GLuint divisor) {
+void GL_APIENTRY GLES2VertexAttribDivisorANGLE(GLuint index, GLuint divisor) {
gles2::GetGLContext()->VertexAttribDivisorANGLE(index, divisor);
}
-void GLES2GenMailboxCHROMIUM(GLbyte* mailbox) {
+void GL_APIENTRY GLES2GenMailboxCHROMIUM(GLbyte* mailbox) {
gles2::GetGLContext()->GenMailboxCHROMIUM(mailbox);
}
-void GLES2ProduceTextureCHROMIUM(GLenum target, const GLbyte* mailbox) {
+void GL_APIENTRY GLES2ProduceTextureCHROMIUM(GLenum target,
+ const GLbyte* mailbox) {
gles2::GetGLContext()->ProduceTextureCHROMIUM(target, mailbox);
}
-void GLES2ProduceTextureDirectCHROMIUM(GLuint texture,
- GLenum target,
- const GLbyte* mailbox) {
+void GL_APIENTRY GLES2ProduceTextureDirectCHROMIUM(GLuint texture,
+ GLenum target,
+ const GLbyte* mailbox) {
gles2::GetGLContext()->ProduceTextureDirectCHROMIUM(texture, target, mailbox);
}
-void GLES2ConsumeTextureCHROMIUM(GLenum target, const GLbyte* mailbox) {
+void GL_APIENTRY GLES2ConsumeTextureCHROMIUM(GLenum target,
+ const GLbyte* mailbox) {
gles2::GetGLContext()->ConsumeTextureCHROMIUM(target, mailbox);
}
-GLuint GLES2CreateAndConsumeTextureCHROMIUM(GLenum target,
- const GLbyte* mailbox) {
+GLuint GL_APIENTRY GLES2CreateAndConsumeTextureCHROMIUM(GLenum target,
+ const GLbyte* mailbox) {
return gles2::GetGLContext()->CreateAndConsumeTextureCHROMIUM(target,
mailbox);
}
-void GLES2BindUniformLocationCHROMIUM(GLuint program,
- GLint location,
- const char* name) {
+void GL_APIENTRY GLES2BindUniformLocationCHROMIUM(GLuint program,
+ GLint location,
+ const char* name) {
gles2::GetGLContext()->BindUniformLocationCHROMIUM(program, location, name);
}
-void GLES2GenValuebuffersCHROMIUM(GLsizei n, GLuint* buffers) {
+void GL_APIENTRY GLES2GenValuebuffersCHROMIUM(GLsizei n, GLuint* buffers) {
gles2::GetGLContext()->GenValuebuffersCHROMIUM(n, buffers);
}
-void GLES2DeleteValuebuffersCHROMIUM(GLsizei n, const GLuint* valuebuffers) {
+void GL_APIENTRY GLES2DeleteValuebuffersCHROMIUM(GLsizei n,
+ const GLuint* valuebuffers) {
gles2::GetGLContext()->DeleteValuebuffersCHROMIUM(n, valuebuffers);
}
-GLboolean GLES2IsValuebufferCHROMIUM(GLuint valuebuffer) {
+GLboolean GL_APIENTRY GLES2IsValuebufferCHROMIUM(GLuint valuebuffer) {
return gles2::GetGLContext()->IsValuebufferCHROMIUM(valuebuffer);
}
-void GLES2BindValuebufferCHROMIUM(GLenum target, GLuint valuebuffer) {
+void GL_APIENTRY GLES2BindValuebufferCHROMIUM(GLenum target,
+ GLuint valuebuffer) {
gles2::GetGLContext()->BindValuebufferCHROMIUM(target, valuebuffer);
}
-void GLES2SubscribeValueCHROMIUM(GLenum target, GLenum subscription) {
+void GL_APIENTRY GLES2SubscribeValueCHROMIUM(GLenum target,
+ GLenum subscription) {
gles2::GetGLContext()->SubscribeValueCHROMIUM(target, subscription);
}
-void GLES2PopulateSubscribedValuesCHROMIUM(GLenum target) {
+void GL_APIENTRY GLES2PopulateSubscribedValuesCHROMIUM(GLenum target) {
gles2::GetGLContext()->PopulateSubscribedValuesCHROMIUM(target);
}
-void GLES2UniformValuebufferCHROMIUM(GLint location,
- GLenum target,
- GLenum subscription) {
+void GL_APIENTRY GLES2UniformValuebufferCHROMIUM(GLint location,
+ GLenum target,
+ GLenum subscription) {
gles2::GetGLContext()->UniformValuebufferCHROMIUM(location, target,
subscription);
}
-void GLES2BindTexImage2DCHROMIUM(GLenum target, GLint imageId) {
+void GL_APIENTRY GLES2BindTexImage2DCHROMIUM(GLenum target, GLint imageId) {
gles2::GetGLContext()->BindTexImage2DCHROMIUM(target, imageId);
}
-void GLES2ReleaseTexImage2DCHROMIUM(GLenum target, GLint imageId) {
+void GL_APIENTRY GLES2ReleaseTexImage2DCHROMIUM(GLenum target, GLint imageId) {
gles2::GetGLContext()->ReleaseTexImage2DCHROMIUM(target, imageId);
}
-void GLES2TraceBeginCHROMIUM(const char* category_name,
- const char* trace_name) {
+void GL_APIENTRY GLES2TraceBeginCHROMIUM(const char* category_name,
+ const char* trace_name) {
gles2::GetGLContext()->TraceBeginCHROMIUM(category_name, trace_name);
}
-void GLES2TraceEndCHROMIUM() {
+void GL_APIENTRY GLES2TraceEndCHROMIUM() {
gles2::GetGLContext()->TraceEndCHROMIUM();
}
-void GLES2AsyncTexSubImage2DCHROMIUM(GLenum target,
- GLint level,
- GLint xoffset,
- GLint yoffset,
- GLsizei width,
- GLsizei height,
- GLenum format,
- GLenum type,
- const void* data) {
- gles2::GetGLContext()->AsyncTexSubImage2DCHROMIUM(
- target, level, xoffset, yoffset, width, height, format, type, data);
-}
-void GLES2AsyncTexImage2DCHROMIUM(GLenum target,
- GLint level,
- GLenum internalformat,
- GLsizei width,
- GLsizei height,
- GLint border,
- GLenum format,
- GLenum type,
- const void* pixels) {
- gles2::GetGLContext()->AsyncTexImage2DCHROMIUM(target, level, internalformat,
- width, height, border, format,
- type, pixels);
-}
-void GLES2WaitAsyncTexImage2DCHROMIUM(GLenum target) {
- gles2::GetGLContext()->WaitAsyncTexImage2DCHROMIUM(target);
-}
-void GLES2WaitAllAsyncTexImage2DCHROMIUM() {
- gles2::GetGLContext()->WaitAllAsyncTexImage2DCHROMIUM();
-}
-void GLES2DiscardFramebufferEXT(GLenum target,
- GLsizei count,
- const GLenum* attachments) {
+void GL_APIENTRY GLES2DiscardFramebufferEXT(GLenum target,
+ GLsizei count,
+ const GLenum* attachments) {
gles2::GetGLContext()->DiscardFramebufferEXT(target, count, attachments);
}
-void GLES2LoseContextCHROMIUM(GLenum current, GLenum other) {
+void GL_APIENTRY GLES2LoseContextCHROMIUM(GLenum current, GLenum other) {
gles2::GetGLContext()->LoseContextCHROMIUM(current, other);
}
-GLuint GLES2InsertSyncPointCHROMIUM() {
+GLuint GL_APIENTRY GLES2InsertSyncPointCHROMIUM() {
return gles2::GetGLContext()->InsertSyncPointCHROMIUM();
}
-void GLES2WaitSyncPointCHROMIUM(GLuint sync_point) {
+void GL_APIENTRY GLES2WaitSyncPointCHROMIUM(GLuint sync_point) {
gles2::GetGLContext()->WaitSyncPointCHROMIUM(sync_point);
}
-void GLES2DrawBuffersEXT(GLsizei count, const GLenum* bufs) {
+void GL_APIENTRY GLES2DrawBuffersEXT(GLsizei count, const GLenum* bufs) {
gles2::GetGLContext()->DrawBuffersEXT(count, bufs);
}
-void GLES2DiscardBackbufferCHROMIUM() {
+void GL_APIENTRY GLES2DiscardBackbufferCHROMIUM() {
gles2::GetGLContext()->DiscardBackbufferCHROMIUM();
}
-void GLES2ScheduleOverlayPlaneCHROMIUM(GLint plane_z_order,
- GLenum plane_transform,
- GLuint overlay_texture_id,
- GLint bounds_x,
- GLint bounds_y,
- GLint bounds_width,
- GLint bounds_height,
- GLfloat uv_x,
- GLfloat uv_y,
- GLfloat uv_width,
- GLfloat uv_height) {
+void GL_APIENTRY GLES2ScheduleOverlayPlaneCHROMIUM(GLint plane_z_order,
+ GLenum plane_transform,
+ GLuint overlay_texture_id,
+ GLint bounds_x,
+ GLint bounds_y,
+ GLint bounds_width,
+ GLint bounds_height,
+ GLfloat uv_x,
+ GLfloat uv_y,
+ GLfloat uv_width,
+ GLfloat uv_height) {
gles2::GetGLContext()->ScheduleOverlayPlaneCHROMIUM(
plane_z_order, plane_transform, overlay_texture_id, bounds_x, bounds_y,
bounds_width, bounds_height, uv_x, uv_y, uv_width, uv_height);
}
-void GLES2SwapInterval(GLint interval) {
+void GL_APIENTRY GLES2SwapInterval(GLint interval) {
gles2::GetGLContext()->SwapInterval(interval);
}
-void GLES2FlushDriverCachesCHROMIUM() {
+void GL_APIENTRY GLES2FlushDriverCachesCHROMIUM() {
gles2::GetGLContext()->FlushDriverCachesCHROMIUM();
}
-void GLES2MatrixLoadfCHROMIUM(GLenum matrixMode, const GLfloat* m) {
+void GL_APIENTRY GLES2MatrixLoadfCHROMIUM(GLenum matrixMode, const GLfloat* m) {
gles2::GetGLContext()->MatrixLoadfCHROMIUM(matrixMode, m);
}
-void GLES2MatrixLoadIdentityCHROMIUM(GLenum matrixMode) {
+void GL_APIENTRY GLES2MatrixLoadIdentityCHROMIUM(GLenum matrixMode) {
gles2::GetGLContext()->MatrixLoadIdentityCHROMIUM(matrixMode);
}
-GLenum GLES2GetGraphicsResetStatusKHR() {
+GLuint GL_APIENTRY GLES2GenPathsCHROMIUM(GLsizei range) {
+ return gles2::GetGLContext()->GenPathsCHROMIUM(range);
+}
+void GL_APIENTRY GLES2DeletePathsCHROMIUM(GLuint path, GLsizei range) {
+ gles2::GetGLContext()->DeletePathsCHROMIUM(path, range);
+}
+GLboolean GL_APIENTRY GLES2IsPathCHROMIUM(GLuint path) {
+ return gles2::GetGLContext()->IsPathCHROMIUM(path);
+}
+void GL_APIENTRY GLES2PathCommandsCHROMIUM(GLuint path,
+ GLsizei numCommands,
+ const GLubyte* commands,
+ GLsizei numCoords,
+ GLenum coordType,
+ const GLvoid* coords) {
+ gles2::GetGLContext()->PathCommandsCHROMIUM(path, numCommands, commands,
+ numCoords, coordType, coords);
+}
+void GL_APIENTRY GLES2PathParameterfCHROMIUM(GLuint path,
+ GLenum pname,
+ GLfloat value) {
+ gles2::GetGLContext()->PathParameterfCHROMIUM(path, pname, value);
+}
+void GL_APIENTRY GLES2PathParameteriCHROMIUM(GLuint path,
+ GLenum pname,
+ GLint value) {
+ gles2::GetGLContext()->PathParameteriCHROMIUM(path, pname, value);
+}
+void GL_APIENTRY GLES2PathStencilFuncCHROMIUM(GLenum func,
+ GLint ref,
+ GLuint mask) {
+ gles2::GetGLContext()->PathStencilFuncCHROMIUM(func, ref, mask);
+}
+void GL_APIENTRY GLES2StencilFillPathCHROMIUM(GLuint path,
+ GLenum fillMode,
+ GLuint mask) {
+ gles2::GetGLContext()->StencilFillPathCHROMIUM(path, fillMode, mask);
+}
+void GL_APIENTRY GLES2StencilStrokePathCHROMIUM(GLuint path,
+ GLint reference,
+ GLuint mask) {
+ gles2::GetGLContext()->StencilStrokePathCHROMIUM(path, reference, mask);
+}
+void GL_APIENTRY GLES2CoverFillPathCHROMIUM(GLuint path, GLenum coverMode) {
+ gles2::GetGLContext()->CoverFillPathCHROMIUM(path, coverMode);
+}
+void GL_APIENTRY GLES2CoverStrokePathCHROMIUM(GLuint path, GLenum coverMode) {
+ gles2::GetGLContext()->CoverStrokePathCHROMIUM(path, coverMode);
+}
+void GL_APIENTRY GLES2StencilThenCoverFillPathCHROMIUM(GLuint path,
+ GLenum fillMode,
+ GLuint mask,
+ GLenum coverMode) {
+ gles2::GetGLContext()->StencilThenCoverFillPathCHROMIUM(path, fillMode, mask,
+ coverMode);
+}
+void GL_APIENTRY GLES2StencilThenCoverStrokePathCHROMIUM(GLuint path,
+ GLint reference,
+ GLuint mask,
+ GLenum coverMode) {
+ gles2::GetGLContext()->StencilThenCoverStrokePathCHROMIUM(path, reference,
+ mask, coverMode);
+}
+GLenum GL_APIENTRY GLES2GetGraphicsResetStatusKHR() {
return gles2::GetGLContext()->GetGraphicsResetStatusKHR();
}
-void GLES2BlendBarrierKHR() {
+void GL_APIENTRY GLES2BlendBarrierKHR() {
gles2::GetGLContext()->BlendBarrierKHR();
}
+void GL_APIENTRY GLES2ApplyScreenSpaceAntialiasingCHROMIUM() {
+ gles2::GetGLContext()->ApplyScreenSpaceAntialiasingCHROMIUM();
+}
namespace gles2 {
extern const NameToFunc g_gles2_function_table[] = {
{
- "glActiveTexture",
- reinterpret_cast<GLES2FunctionPointer>(glActiveTexture),
+ "glActiveTexture",
+ reinterpret_cast<GLES2FunctionPointer>(glActiveTexture),
+ },
+ {
+ "glAttachShader",
+ reinterpret_cast<GLES2FunctionPointer>(glAttachShader),
+ },
+ {
+ "glBindAttribLocation",
+ reinterpret_cast<GLES2FunctionPointer>(glBindAttribLocation),
+ },
+ {
+ "glBindBuffer", reinterpret_cast<GLES2FunctionPointer>(glBindBuffer),
+ },
+ {
+ "glBindBufferBase",
+ reinterpret_cast<GLES2FunctionPointer>(glBindBufferBase),
+ },
+ {
+ "glBindBufferRange",
+ reinterpret_cast<GLES2FunctionPointer>(glBindBufferRange),
+ },
+ {
+ "glBindFramebuffer",
+ reinterpret_cast<GLES2FunctionPointer>(glBindFramebuffer),
+ },
+ {
+ "glBindRenderbuffer",
+ reinterpret_cast<GLES2FunctionPointer>(glBindRenderbuffer),
+ },
+ {
+ "glBindSampler", reinterpret_cast<GLES2FunctionPointer>(glBindSampler),
+ },
+ {
+ "glBindTexture", reinterpret_cast<GLES2FunctionPointer>(glBindTexture),
+ },
+ {
+ "glBindTransformFeedback",
+ reinterpret_cast<GLES2FunctionPointer>(glBindTransformFeedback),
+ },
+ {
+ "glBlendColor", reinterpret_cast<GLES2FunctionPointer>(glBlendColor),
+ },
+ {
+ "glBlendEquation",
+ reinterpret_cast<GLES2FunctionPointer>(glBlendEquation),
+ },
+ {
+ "glBlendEquationSeparate",
+ reinterpret_cast<GLES2FunctionPointer>(glBlendEquationSeparate),
+ },
+ {
+ "glBlendFunc", reinterpret_cast<GLES2FunctionPointer>(glBlendFunc),
+ },
+ {
+ "glBlendFuncSeparate",
+ reinterpret_cast<GLES2FunctionPointer>(glBlendFuncSeparate),
},
{
- "glAttachShader",
- reinterpret_cast<GLES2FunctionPointer>(glAttachShader),
+ "glBufferData", reinterpret_cast<GLES2FunctionPointer>(glBufferData),
},
{
- "glBindAttribLocation",
- reinterpret_cast<GLES2FunctionPointer>(glBindAttribLocation),
+ "glBufferSubData",
+ reinterpret_cast<GLES2FunctionPointer>(glBufferSubData),
},
{
- "glBindBuffer",
- reinterpret_cast<GLES2FunctionPointer>(glBindBuffer),
+ "glCheckFramebufferStatus",
+ reinterpret_cast<GLES2FunctionPointer>(glCheckFramebufferStatus),
},
{
- "glBindBufferBase",
- reinterpret_cast<GLES2FunctionPointer>(glBindBufferBase),
+ "glClear", reinterpret_cast<GLES2FunctionPointer>(glClear),
},
{
- "glBindBufferRange",
- reinterpret_cast<GLES2FunctionPointer>(glBindBufferRange),
+ "glClearBufferfi",
+ reinterpret_cast<GLES2FunctionPointer>(glClearBufferfi),
},
{
- "glBindFramebuffer",
- reinterpret_cast<GLES2FunctionPointer>(glBindFramebuffer),
+ "glClearBufferfv",
+ reinterpret_cast<GLES2FunctionPointer>(glClearBufferfv),
},
{
- "glBindRenderbuffer",
- reinterpret_cast<GLES2FunctionPointer>(glBindRenderbuffer),
+ "glClearBufferiv",
+ reinterpret_cast<GLES2FunctionPointer>(glClearBufferiv),
},
{
- "glBindSampler",
- reinterpret_cast<GLES2FunctionPointer>(glBindSampler),
+ "glClearBufferuiv",
+ reinterpret_cast<GLES2FunctionPointer>(glClearBufferuiv),
},
{
- "glBindTexture",
- reinterpret_cast<GLES2FunctionPointer>(glBindTexture),
+ "glClearColor", reinterpret_cast<GLES2FunctionPointer>(glClearColor),
},
{
- "glBindTransformFeedback",
- reinterpret_cast<GLES2FunctionPointer>(glBindTransformFeedback),
+ "glClearDepthf", reinterpret_cast<GLES2FunctionPointer>(glClearDepthf),
},
{
- "glBlendColor",
- reinterpret_cast<GLES2FunctionPointer>(glBlendColor),
+ "glClearStencil",
+ reinterpret_cast<GLES2FunctionPointer>(glClearStencil),
},
{
- "glBlendEquation",
- reinterpret_cast<GLES2FunctionPointer>(glBlendEquation),
+ "glClientWaitSync",
+ reinterpret_cast<GLES2FunctionPointer>(glClientWaitSync),
},
{
- "glBlendEquationSeparate",
- reinterpret_cast<GLES2FunctionPointer>(glBlendEquationSeparate),
+ "glColorMask", reinterpret_cast<GLES2FunctionPointer>(glColorMask),
},
{
- "glBlendFunc",
- reinterpret_cast<GLES2FunctionPointer>(glBlendFunc),
+ "glCompileShader",
+ reinterpret_cast<GLES2FunctionPointer>(glCompileShader),
},
{
- "glBlendFuncSeparate",
- reinterpret_cast<GLES2FunctionPointer>(glBlendFuncSeparate),
+ "glCompressedTexImage2D",
+ reinterpret_cast<GLES2FunctionPointer>(glCompressedTexImage2D),
},
{
- "glBufferData",
- reinterpret_cast<GLES2FunctionPointer>(glBufferData),
+ "glCompressedTexSubImage2D",
+ reinterpret_cast<GLES2FunctionPointer>(glCompressedTexSubImage2D),
},
{
- "glBufferSubData",
- reinterpret_cast<GLES2FunctionPointer>(glBufferSubData),
+ "glCompressedTexImage3D",
+ reinterpret_cast<GLES2FunctionPointer>(glCompressedTexImage3D),
},
{
- "glCheckFramebufferStatus",
- reinterpret_cast<GLES2FunctionPointer>(glCheckFramebufferStatus),
+ "glCompressedTexSubImage3D",
+ reinterpret_cast<GLES2FunctionPointer>(glCompressedTexSubImage3D),
},
{
- "glClear",
- reinterpret_cast<GLES2FunctionPointer>(glClear),
+ "glCopyBufferSubData",
+ reinterpret_cast<GLES2FunctionPointer>(glCopyBufferSubData),
},
{
- "glClearBufferfi",
- reinterpret_cast<GLES2FunctionPointer>(glClearBufferfi),
+ "glCopyTexImage2D",
+ reinterpret_cast<GLES2FunctionPointer>(glCopyTexImage2D),
},
{
- "glClearBufferfv",
- reinterpret_cast<GLES2FunctionPointer>(glClearBufferfv),
+ "glCopyTexSubImage2D",
+ reinterpret_cast<GLES2FunctionPointer>(glCopyTexSubImage2D),
},
{
- "glClearBufferiv",
- reinterpret_cast<GLES2FunctionPointer>(glClearBufferiv),
+ "glCopyTexSubImage3D",
+ reinterpret_cast<GLES2FunctionPointer>(glCopyTexSubImage3D),
},
{
- "glClearBufferuiv",
- reinterpret_cast<GLES2FunctionPointer>(glClearBufferuiv),
+ "glCreateProgram",
+ reinterpret_cast<GLES2FunctionPointer>(glCreateProgram),
},
{
- "glClearColor",
- reinterpret_cast<GLES2FunctionPointer>(glClearColor),
+ "glCreateShader",
+ reinterpret_cast<GLES2FunctionPointer>(glCreateShader),
},
{
- "glClearDepthf",
- reinterpret_cast<GLES2FunctionPointer>(glClearDepthf),
+ "glCullFace", reinterpret_cast<GLES2FunctionPointer>(glCullFace),
},
{
- "glClearStencil",
- reinterpret_cast<GLES2FunctionPointer>(glClearStencil),
+ "glDeleteBuffers",
+ reinterpret_cast<GLES2FunctionPointer>(glDeleteBuffers),
},
{
- "glClientWaitSync",
- reinterpret_cast<GLES2FunctionPointer>(glClientWaitSync),
+ "glDeleteFramebuffers",
+ reinterpret_cast<GLES2FunctionPointer>(glDeleteFramebuffers),
},
{
- "glColorMask",
- reinterpret_cast<GLES2FunctionPointer>(glColorMask),
+ "glDeleteProgram",
+ reinterpret_cast<GLES2FunctionPointer>(glDeleteProgram),
},
{
- "glCompileShader",
- reinterpret_cast<GLES2FunctionPointer>(glCompileShader),
+ "glDeleteRenderbuffers",
+ reinterpret_cast<GLES2FunctionPointer>(glDeleteRenderbuffers),
},
{
- "glCompressedTexImage2D",
- reinterpret_cast<GLES2FunctionPointer>(glCompressedTexImage2D),
+ "glDeleteSamplers",
+ reinterpret_cast<GLES2FunctionPointer>(glDeleteSamplers),
},
{
- "glCompressedTexSubImage2D",
- reinterpret_cast<GLES2FunctionPointer>(glCompressedTexSubImage2D),
+ "glDeleteSync", reinterpret_cast<GLES2FunctionPointer>(glDeleteSync),
},
{
- "glCompressedTexImage3D",
- reinterpret_cast<GLES2FunctionPointer>(glCompressedTexImage3D),
+ "glDeleteShader",
+ reinterpret_cast<GLES2FunctionPointer>(glDeleteShader),
},
{
- "glCompressedTexSubImage3D",
- reinterpret_cast<GLES2FunctionPointer>(glCompressedTexSubImage3D),
+ "glDeleteTextures",
+ reinterpret_cast<GLES2FunctionPointer>(glDeleteTextures),
},
{
- "glCopyBufferSubData",
- reinterpret_cast<GLES2FunctionPointer>(glCopyBufferSubData),
+ "glDeleteTransformFeedbacks",
+ reinterpret_cast<GLES2FunctionPointer>(glDeleteTransformFeedbacks),
},
{
- "glCopyTexImage2D",
- reinterpret_cast<GLES2FunctionPointer>(glCopyTexImage2D),
+ "glDepthFunc", reinterpret_cast<GLES2FunctionPointer>(glDepthFunc),
},
{
- "glCopyTexSubImage2D",
- reinterpret_cast<GLES2FunctionPointer>(glCopyTexSubImage2D),
+ "glDepthMask", reinterpret_cast<GLES2FunctionPointer>(glDepthMask),
},
{
- "glCopyTexSubImage3D",
- reinterpret_cast<GLES2FunctionPointer>(glCopyTexSubImage3D),
+ "glDepthRangef", reinterpret_cast<GLES2FunctionPointer>(glDepthRangef),
},
{
- "glCreateProgram",
- reinterpret_cast<GLES2FunctionPointer>(glCreateProgram),
+ "glDetachShader",
+ reinterpret_cast<GLES2FunctionPointer>(glDetachShader),
},
{
- "glCreateShader",
- reinterpret_cast<GLES2FunctionPointer>(glCreateShader),
+ "glDisable", reinterpret_cast<GLES2FunctionPointer>(glDisable),
},
{
- "glCullFace",
- reinterpret_cast<GLES2FunctionPointer>(glCullFace),
+ "glDisableVertexAttribArray",
+ reinterpret_cast<GLES2FunctionPointer>(glDisableVertexAttribArray),
},
{
- "glDeleteBuffers",
- reinterpret_cast<GLES2FunctionPointer>(glDeleteBuffers),
+ "glDrawArrays", reinterpret_cast<GLES2FunctionPointer>(glDrawArrays),
},
{
- "glDeleteFramebuffers",
- reinterpret_cast<GLES2FunctionPointer>(glDeleteFramebuffers),
+ "glDrawElements",
+ reinterpret_cast<GLES2FunctionPointer>(glDrawElements),
},
{
- "glDeleteProgram",
- reinterpret_cast<GLES2FunctionPointer>(glDeleteProgram),
+ "glDrawRangeElements",
+ reinterpret_cast<GLES2FunctionPointer>(glDrawRangeElements),
},
{
- "glDeleteRenderbuffers",
- reinterpret_cast<GLES2FunctionPointer>(glDeleteRenderbuffers),
+ "glEnable", reinterpret_cast<GLES2FunctionPointer>(glEnable),
},
{
- "glDeleteSamplers",
- reinterpret_cast<GLES2FunctionPointer>(glDeleteSamplers),
+ "glEnableVertexAttribArray",
+ reinterpret_cast<GLES2FunctionPointer>(glEnableVertexAttribArray),
},
{
- "glDeleteSync",
- reinterpret_cast<GLES2FunctionPointer>(glDeleteSync),
+ "glFenceSync", reinterpret_cast<GLES2FunctionPointer>(glFenceSync),
},
{
- "glDeleteShader",
- reinterpret_cast<GLES2FunctionPointer>(glDeleteShader),
+ "glFinish", reinterpret_cast<GLES2FunctionPointer>(glFinish),
},
{
- "glDeleteTextures",
- reinterpret_cast<GLES2FunctionPointer>(glDeleteTextures),
+ "glFlush", reinterpret_cast<GLES2FunctionPointer>(glFlush),
},
{
- "glDeleteTransformFeedbacks",
- reinterpret_cast<GLES2FunctionPointer>(glDeleteTransformFeedbacks),
+ "glFramebufferRenderbuffer",
+ reinterpret_cast<GLES2FunctionPointer>(glFramebufferRenderbuffer),
},
{
- "glDepthFunc",
- reinterpret_cast<GLES2FunctionPointer>(glDepthFunc),
+ "glFramebufferTexture2D",
+ reinterpret_cast<GLES2FunctionPointer>(glFramebufferTexture2D),
},
{
- "glDepthMask",
- reinterpret_cast<GLES2FunctionPointer>(glDepthMask),
+ "glFramebufferTextureLayer",
+ reinterpret_cast<GLES2FunctionPointer>(glFramebufferTextureLayer),
},
{
- "glDepthRangef",
- reinterpret_cast<GLES2FunctionPointer>(glDepthRangef),
+ "glFrontFace", reinterpret_cast<GLES2FunctionPointer>(glFrontFace),
},
{
- "glDetachShader",
- reinterpret_cast<GLES2FunctionPointer>(glDetachShader),
+ "glGenBuffers", reinterpret_cast<GLES2FunctionPointer>(glGenBuffers),
},
{
- "glDisable",
- reinterpret_cast<GLES2FunctionPointer>(glDisable),
+ "glGenerateMipmap",
+ reinterpret_cast<GLES2FunctionPointer>(glGenerateMipmap),
},
{
- "glDisableVertexAttribArray",
- reinterpret_cast<GLES2FunctionPointer>(glDisableVertexAttribArray),
+ "glGenFramebuffers",
+ reinterpret_cast<GLES2FunctionPointer>(glGenFramebuffers),
},
{
- "glDrawArrays",
- reinterpret_cast<GLES2FunctionPointer>(glDrawArrays),
+ "glGenRenderbuffers",
+ reinterpret_cast<GLES2FunctionPointer>(glGenRenderbuffers),
},
{
- "glDrawElements",
- reinterpret_cast<GLES2FunctionPointer>(glDrawElements),
+ "glGenSamplers", reinterpret_cast<GLES2FunctionPointer>(glGenSamplers),
},
{
- "glDrawRangeElements",
- reinterpret_cast<GLES2FunctionPointer>(glDrawRangeElements),
+ "glGenTextures", reinterpret_cast<GLES2FunctionPointer>(glGenTextures),
},
{
- "glEnable",
- reinterpret_cast<GLES2FunctionPointer>(glEnable),
+ "glGenTransformFeedbacks",
+ reinterpret_cast<GLES2FunctionPointer>(glGenTransformFeedbacks),
},
{
- "glEnableVertexAttribArray",
- reinterpret_cast<GLES2FunctionPointer>(glEnableVertexAttribArray),
+ "glGetActiveAttrib",
+ reinterpret_cast<GLES2FunctionPointer>(glGetActiveAttrib),
},
{
- "glFenceSync",
- reinterpret_cast<GLES2FunctionPointer>(glFenceSync),
+ "glGetActiveUniform",
+ reinterpret_cast<GLES2FunctionPointer>(glGetActiveUniform),
},
{
- "glFinish",
- reinterpret_cast<GLES2FunctionPointer>(glFinish),
+ "glGetActiveUniformBlockiv",
+ reinterpret_cast<GLES2FunctionPointer>(glGetActiveUniformBlockiv),
},
{
- "glFlush",
- reinterpret_cast<GLES2FunctionPointer>(glFlush),
+ "glGetActiveUniformBlockName",
+ reinterpret_cast<GLES2FunctionPointer>(glGetActiveUniformBlockName),
},
{
- "glFramebufferRenderbuffer",
- reinterpret_cast<GLES2FunctionPointer>(glFramebufferRenderbuffer),
+ "glGetActiveUniformsiv",
+ reinterpret_cast<GLES2FunctionPointer>(glGetActiveUniformsiv),
},
{
- "glFramebufferTexture2D",
- reinterpret_cast<GLES2FunctionPointer>(glFramebufferTexture2D),
+ "glGetAttachedShaders",
+ reinterpret_cast<GLES2FunctionPointer>(glGetAttachedShaders),
},
{
- "glFramebufferTextureLayer",
- reinterpret_cast<GLES2FunctionPointer>(glFramebufferTextureLayer),
+ "glGetAttribLocation",
+ reinterpret_cast<GLES2FunctionPointer>(glGetAttribLocation),
},
{
- "glFrontFace",
- reinterpret_cast<GLES2FunctionPointer>(glFrontFace),
+ "glGetBooleanv", reinterpret_cast<GLES2FunctionPointer>(glGetBooleanv),
},
{
- "glGenBuffers",
- reinterpret_cast<GLES2FunctionPointer>(glGenBuffers),
+ "glGetBufferParameteri64v",
+ reinterpret_cast<GLES2FunctionPointer>(glGetBufferParameteri64v),
},
{
- "glGenerateMipmap",
- reinterpret_cast<GLES2FunctionPointer>(glGenerateMipmap),
+ "glGetBufferParameteriv",
+ reinterpret_cast<GLES2FunctionPointer>(glGetBufferParameteriv),
},
{
- "glGenFramebuffers",
- reinterpret_cast<GLES2FunctionPointer>(glGenFramebuffers),
+ "glGetError", reinterpret_cast<GLES2FunctionPointer>(glGetError),
},
{
- "glGenRenderbuffers",
- reinterpret_cast<GLES2FunctionPointer>(glGenRenderbuffers),
+ "glGetFloatv", reinterpret_cast<GLES2FunctionPointer>(glGetFloatv),
},
{
- "glGenSamplers",
- reinterpret_cast<GLES2FunctionPointer>(glGenSamplers),
+ "glGetFragDataLocation",
+ reinterpret_cast<GLES2FunctionPointer>(glGetFragDataLocation),
},
{
- "glGenTextures",
- reinterpret_cast<GLES2FunctionPointer>(glGenTextures),
+ "glGetFramebufferAttachmentParameteriv",
+ reinterpret_cast<GLES2FunctionPointer>(
+ glGetFramebufferAttachmentParameteriv),
},
{
- "glGenTransformFeedbacks",
- reinterpret_cast<GLES2FunctionPointer>(glGenTransformFeedbacks),
+ "glGetInteger64v",
+ reinterpret_cast<GLES2FunctionPointer>(glGetInteger64v),
},
{
- "glGetActiveAttrib",
- reinterpret_cast<GLES2FunctionPointer>(glGetActiveAttrib),
+ "glGetIntegeri_v",
+ reinterpret_cast<GLES2FunctionPointer>(glGetIntegeri_v),
},
{
- "glGetActiveUniform",
- reinterpret_cast<GLES2FunctionPointer>(glGetActiveUniform),
+ "glGetInteger64i_v",
+ reinterpret_cast<GLES2FunctionPointer>(glGetInteger64i_v),
},
{
- "glGetActiveUniformBlockiv",
- reinterpret_cast<GLES2FunctionPointer>(glGetActiveUniformBlockiv),
+ "glGetIntegerv", reinterpret_cast<GLES2FunctionPointer>(glGetIntegerv),
},
{
- "glGetActiveUniformBlockName",
- reinterpret_cast<GLES2FunctionPointer>(glGetActiveUniformBlockName),
+ "glGetInternalformativ",
+ reinterpret_cast<GLES2FunctionPointer>(glGetInternalformativ),
},
{
- "glGetActiveUniformsiv",
- reinterpret_cast<GLES2FunctionPointer>(glGetActiveUniformsiv),
+ "glGetProgramiv",
+ reinterpret_cast<GLES2FunctionPointer>(glGetProgramiv),
},
{
- "glGetAttachedShaders",
- reinterpret_cast<GLES2FunctionPointer>(glGetAttachedShaders),
+ "glGetProgramInfoLog",
+ reinterpret_cast<GLES2FunctionPointer>(glGetProgramInfoLog),
},
{
- "glGetAttribLocation",
- reinterpret_cast<GLES2FunctionPointer>(glGetAttribLocation),
+ "glGetRenderbufferParameteriv",
+ reinterpret_cast<GLES2FunctionPointer>(glGetRenderbufferParameteriv),
},
{
- "glGetBooleanv",
- reinterpret_cast<GLES2FunctionPointer>(glGetBooleanv),
+ "glGetSamplerParameterfv",
+ reinterpret_cast<GLES2FunctionPointer>(glGetSamplerParameterfv),
},
{
- "glGetBufferParameteriv",
- reinterpret_cast<GLES2FunctionPointer>(glGetBufferParameteriv),
+ "glGetSamplerParameteriv",
+ reinterpret_cast<GLES2FunctionPointer>(glGetSamplerParameteriv),
},
{
- "glGetError",
- reinterpret_cast<GLES2FunctionPointer>(glGetError),
+ "glGetShaderiv", reinterpret_cast<GLES2FunctionPointer>(glGetShaderiv),
},
{
- "glGetFloatv",
- reinterpret_cast<GLES2FunctionPointer>(glGetFloatv),
+ "glGetShaderInfoLog",
+ reinterpret_cast<GLES2FunctionPointer>(glGetShaderInfoLog),
},
{
- "glGetFragDataLocation",
- reinterpret_cast<GLES2FunctionPointer>(glGetFragDataLocation),
+ "glGetShaderPrecisionFormat",
+ reinterpret_cast<GLES2FunctionPointer>(glGetShaderPrecisionFormat),
},
{
- "glGetFramebufferAttachmentParameteriv",
- reinterpret_cast<GLES2FunctionPointer>(
- glGetFramebufferAttachmentParameteriv),
+ "glGetShaderSource",
+ reinterpret_cast<GLES2FunctionPointer>(glGetShaderSource),
},
{
- "glGetInteger64v",
- reinterpret_cast<GLES2FunctionPointer>(glGetInteger64v),
+ "glGetString", reinterpret_cast<GLES2FunctionPointer>(glGetString),
},
{
- "glGetIntegeri_v",
- reinterpret_cast<GLES2FunctionPointer>(glGetIntegeri_v),
+ "glGetSynciv", reinterpret_cast<GLES2FunctionPointer>(glGetSynciv),
},
{
- "glGetInteger64i_v",
- reinterpret_cast<GLES2FunctionPointer>(glGetInteger64i_v),
+ "glGetTexParameterfv",
+ reinterpret_cast<GLES2FunctionPointer>(glGetTexParameterfv),
},
{
- "glGetIntegerv",
- reinterpret_cast<GLES2FunctionPointer>(glGetIntegerv),
+ "glGetTexParameteriv",
+ reinterpret_cast<GLES2FunctionPointer>(glGetTexParameteriv),
},
{
- "glGetInternalformativ",
- reinterpret_cast<GLES2FunctionPointer>(glGetInternalformativ),
+ "glGetTransformFeedbackVarying",
+ reinterpret_cast<GLES2FunctionPointer>(glGetTransformFeedbackVarying),
},
{
- "glGetProgramiv",
- reinterpret_cast<GLES2FunctionPointer>(glGetProgramiv),
+ "glGetUniformBlockIndex",
+ reinterpret_cast<GLES2FunctionPointer>(glGetUniformBlockIndex),
},
{
- "glGetProgramInfoLog",
- reinterpret_cast<GLES2FunctionPointer>(glGetProgramInfoLog),
+ "glGetUniformfv",
+ reinterpret_cast<GLES2FunctionPointer>(glGetUniformfv),
},
{
- "glGetRenderbufferParameteriv",
- reinterpret_cast<GLES2FunctionPointer>(glGetRenderbufferParameteriv),
+ "glGetUniformiv",
+ reinterpret_cast<GLES2FunctionPointer>(glGetUniformiv),
},
{
- "glGetSamplerParameterfv",
- reinterpret_cast<GLES2FunctionPointer>(glGetSamplerParameterfv),
+ "glGetUniformuiv",
+ reinterpret_cast<GLES2FunctionPointer>(glGetUniformuiv),
},
{
- "glGetSamplerParameteriv",
- reinterpret_cast<GLES2FunctionPointer>(glGetSamplerParameteriv),
+ "glGetUniformIndices",
+ reinterpret_cast<GLES2FunctionPointer>(glGetUniformIndices),
},
{
- "glGetShaderiv",
- reinterpret_cast<GLES2FunctionPointer>(glGetShaderiv),
+ "glGetUniformLocation",
+ reinterpret_cast<GLES2FunctionPointer>(glGetUniformLocation),
},
{
- "glGetShaderInfoLog",
- reinterpret_cast<GLES2FunctionPointer>(glGetShaderInfoLog),
+ "glGetVertexAttribfv",
+ reinterpret_cast<GLES2FunctionPointer>(glGetVertexAttribfv),
},
{
- "glGetShaderPrecisionFormat",
- reinterpret_cast<GLES2FunctionPointer>(glGetShaderPrecisionFormat),
+ "glGetVertexAttribiv",
+ reinterpret_cast<GLES2FunctionPointer>(glGetVertexAttribiv),
},
{
- "glGetShaderSource",
- reinterpret_cast<GLES2FunctionPointer>(glGetShaderSource),
+ "glGetVertexAttribIiv",
+ reinterpret_cast<GLES2FunctionPointer>(glGetVertexAttribIiv),
},
{
- "glGetString",
- reinterpret_cast<GLES2FunctionPointer>(glGetString),
+ "glGetVertexAttribIuiv",
+ reinterpret_cast<GLES2FunctionPointer>(glGetVertexAttribIuiv),
},
{
- "glGetSynciv",
- reinterpret_cast<GLES2FunctionPointer>(glGetSynciv),
+ "glGetVertexAttribPointerv",
+ reinterpret_cast<GLES2FunctionPointer>(glGetVertexAttribPointerv),
},
{
- "glGetTexParameterfv",
- reinterpret_cast<GLES2FunctionPointer>(glGetTexParameterfv),
+ "glHint", reinterpret_cast<GLES2FunctionPointer>(glHint),
},
{
- "glGetTexParameteriv",
- reinterpret_cast<GLES2FunctionPointer>(glGetTexParameteriv),
+ "glInvalidateFramebuffer",
+ reinterpret_cast<GLES2FunctionPointer>(glInvalidateFramebuffer),
},
{
- "glGetTransformFeedbackVarying",
- reinterpret_cast<GLES2FunctionPointer>(glGetTransformFeedbackVarying),
+ "glInvalidateSubFramebuffer",
+ reinterpret_cast<GLES2FunctionPointer>(glInvalidateSubFramebuffer),
},
{
- "glGetUniformBlockIndex",
- reinterpret_cast<GLES2FunctionPointer>(glGetUniformBlockIndex),
+ "glIsBuffer", reinterpret_cast<GLES2FunctionPointer>(glIsBuffer),
},
{
- "glGetUniformfv",
- reinterpret_cast<GLES2FunctionPointer>(glGetUniformfv),
+ "glIsEnabled", reinterpret_cast<GLES2FunctionPointer>(glIsEnabled),
},
{
- "glGetUniformiv",
- reinterpret_cast<GLES2FunctionPointer>(glGetUniformiv),
+ "glIsFramebuffer",
+ reinterpret_cast<GLES2FunctionPointer>(glIsFramebuffer),
},
{
- "glGetUniformuiv",
- reinterpret_cast<GLES2FunctionPointer>(glGetUniformuiv),
+ "glIsProgram", reinterpret_cast<GLES2FunctionPointer>(glIsProgram),
},
{
- "glGetUniformIndices",
- reinterpret_cast<GLES2FunctionPointer>(glGetUniformIndices),
+ "glIsRenderbuffer",
+ reinterpret_cast<GLES2FunctionPointer>(glIsRenderbuffer),
},
{
- "glGetUniformLocation",
- reinterpret_cast<GLES2FunctionPointer>(glGetUniformLocation),
+ "glIsSampler", reinterpret_cast<GLES2FunctionPointer>(glIsSampler),
},
{
- "glGetVertexAttribfv",
- reinterpret_cast<GLES2FunctionPointer>(glGetVertexAttribfv),
+ "glIsShader", reinterpret_cast<GLES2FunctionPointer>(glIsShader),
},
{
- "glGetVertexAttribiv",
- reinterpret_cast<GLES2FunctionPointer>(glGetVertexAttribiv),
+ "glIsSync", reinterpret_cast<GLES2FunctionPointer>(glIsSync),
},
{
- "glGetVertexAttribIiv",
- reinterpret_cast<GLES2FunctionPointer>(glGetVertexAttribIiv),
+ "glIsTexture", reinterpret_cast<GLES2FunctionPointer>(glIsTexture),
},
{
- "glGetVertexAttribIuiv",
- reinterpret_cast<GLES2FunctionPointer>(glGetVertexAttribIuiv),
+ "glIsTransformFeedback",
+ reinterpret_cast<GLES2FunctionPointer>(glIsTransformFeedback),
},
{
- "glGetVertexAttribPointerv",
- reinterpret_cast<GLES2FunctionPointer>(glGetVertexAttribPointerv),
+ "glLineWidth", reinterpret_cast<GLES2FunctionPointer>(glLineWidth),
},
{
- "glHint",
- reinterpret_cast<GLES2FunctionPointer>(glHint),
+ "glLinkProgram", reinterpret_cast<GLES2FunctionPointer>(glLinkProgram),
},
{
- "glInvalidateFramebuffer",
- reinterpret_cast<GLES2FunctionPointer>(glInvalidateFramebuffer),
+ "glPauseTransformFeedback",
+ reinterpret_cast<GLES2FunctionPointer>(glPauseTransformFeedback),
},
{
- "glInvalidateSubFramebuffer",
- reinterpret_cast<GLES2FunctionPointer>(glInvalidateSubFramebuffer),
+ "glPixelStorei", reinterpret_cast<GLES2FunctionPointer>(glPixelStorei),
},
{
- "glIsBuffer",
- reinterpret_cast<GLES2FunctionPointer>(glIsBuffer),
+ "glPolygonOffset",
+ reinterpret_cast<GLES2FunctionPointer>(glPolygonOffset),
},
{
- "glIsEnabled",
- reinterpret_cast<GLES2FunctionPointer>(glIsEnabled),
+ "glReadBuffer", reinterpret_cast<GLES2FunctionPointer>(glReadBuffer),
},
{
- "glIsFramebuffer",
- reinterpret_cast<GLES2FunctionPointer>(glIsFramebuffer),
+ "glReadPixels", reinterpret_cast<GLES2FunctionPointer>(glReadPixels),
},
{
- "glIsProgram",
- reinterpret_cast<GLES2FunctionPointer>(glIsProgram),
+ "glReleaseShaderCompiler",
+ reinterpret_cast<GLES2FunctionPointer>(glReleaseShaderCompiler),
},
{
- "glIsRenderbuffer",
- reinterpret_cast<GLES2FunctionPointer>(glIsRenderbuffer),
+ "glRenderbufferStorage",
+ reinterpret_cast<GLES2FunctionPointer>(glRenderbufferStorage),
},
{
- "glIsSampler",
- reinterpret_cast<GLES2FunctionPointer>(glIsSampler),
+ "glResumeTransformFeedback",
+ reinterpret_cast<GLES2FunctionPointer>(glResumeTransformFeedback),
},
{
- "glIsShader",
- reinterpret_cast<GLES2FunctionPointer>(glIsShader),
+ "glSampleCoverage",
+ reinterpret_cast<GLES2FunctionPointer>(glSampleCoverage),
},
{
- "glIsSync",
- reinterpret_cast<GLES2FunctionPointer>(glIsSync),
+ "glSamplerParameterf",
+ reinterpret_cast<GLES2FunctionPointer>(glSamplerParameterf),
},
{
- "glIsTexture",
- reinterpret_cast<GLES2FunctionPointer>(glIsTexture),
+ "glSamplerParameterfv",
+ reinterpret_cast<GLES2FunctionPointer>(glSamplerParameterfv),
},
{
- "glIsTransformFeedback",
- reinterpret_cast<GLES2FunctionPointer>(glIsTransformFeedback),
+ "glSamplerParameteri",
+ reinterpret_cast<GLES2FunctionPointer>(glSamplerParameteri),
},
{
- "glLineWidth",
- reinterpret_cast<GLES2FunctionPointer>(glLineWidth),
+ "glSamplerParameteriv",
+ reinterpret_cast<GLES2FunctionPointer>(glSamplerParameteriv),
},
{
- "glLinkProgram",
- reinterpret_cast<GLES2FunctionPointer>(glLinkProgram),
+ "glScissor", reinterpret_cast<GLES2FunctionPointer>(glScissor),
},
{
- "glPauseTransformFeedback",
- reinterpret_cast<GLES2FunctionPointer>(glPauseTransformFeedback),
+ "glShaderBinary",
+ reinterpret_cast<GLES2FunctionPointer>(glShaderBinary),
},
{
- "glPixelStorei",
- reinterpret_cast<GLES2FunctionPointer>(glPixelStorei),
+ "glShaderSource",
+ reinterpret_cast<GLES2FunctionPointer>(glShaderSource),
},
{
- "glPolygonOffset",
- reinterpret_cast<GLES2FunctionPointer>(glPolygonOffset),
+ "glShallowFinishCHROMIUM",
+ reinterpret_cast<GLES2FunctionPointer>(glShallowFinishCHROMIUM),
},
{
- "glReadBuffer",
- reinterpret_cast<GLES2FunctionPointer>(glReadBuffer),
+ "glShallowFlushCHROMIUM",
+ reinterpret_cast<GLES2FunctionPointer>(glShallowFlushCHROMIUM),
},
{
- "glReadPixels",
- reinterpret_cast<GLES2FunctionPointer>(glReadPixels),
+ "glOrderingBarrierCHROMIUM",
+ reinterpret_cast<GLES2FunctionPointer>(glOrderingBarrierCHROMIUM),
},
{
- "glReleaseShaderCompiler",
- reinterpret_cast<GLES2FunctionPointer>(glReleaseShaderCompiler),
+ "glStencilFunc", reinterpret_cast<GLES2FunctionPointer>(glStencilFunc),
},
{
- "glRenderbufferStorage",
- reinterpret_cast<GLES2FunctionPointer>(glRenderbufferStorage),
+ "glStencilFuncSeparate",
+ reinterpret_cast<GLES2FunctionPointer>(glStencilFuncSeparate),
},
{
- "glResumeTransformFeedback",
- reinterpret_cast<GLES2FunctionPointer>(glResumeTransformFeedback),
+ "glStencilMask", reinterpret_cast<GLES2FunctionPointer>(glStencilMask),
},
{
- "glSampleCoverage",
- reinterpret_cast<GLES2FunctionPointer>(glSampleCoverage),
+ "glStencilMaskSeparate",
+ reinterpret_cast<GLES2FunctionPointer>(glStencilMaskSeparate),
},
{
- "glSamplerParameterf",
- reinterpret_cast<GLES2FunctionPointer>(glSamplerParameterf),
+ "glStencilOp", reinterpret_cast<GLES2FunctionPointer>(glStencilOp),
},
{
- "glSamplerParameterfv",
- reinterpret_cast<GLES2FunctionPointer>(glSamplerParameterfv),
+ "glStencilOpSeparate",
+ reinterpret_cast<GLES2FunctionPointer>(glStencilOpSeparate),
},
{
- "glSamplerParameteri",
- reinterpret_cast<GLES2FunctionPointer>(glSamplerParameteri),
+ "glTexImage2D", reinterpret_cast<GLES2FunctionPointer>(glTexImage2D),
},
{
- "glSamplerParameteriv",
- reinterpret_cast<GLES2FunctionPointer>(glSamplerParameteriv),
+ "glTexImage3D", reinterpret_cast<GLES2FunctionPointer>(glTexImage3D),
},
{
- "glScissor",
- reinterpret_cast<GLES2FunctionPointer>(glScissor),
+ "glTexParameterf",
+ reinterpret_cast<GLES2FunctionPointer>(glTexParameterf),
},
{
- "glShaderBinary",
- reinterpret_cast<GLES2FunctionPointer>(glShaderBinary),
+ "glTexParameterfv",
+ reinterpret_cast<GLES2FunctionPointer>(glTexParameterfv),
},
{
- "glShaderSource",
- reinterpret_cast<GLES2FunctionPointer>(glShaderSource),
+ "glTexParameteri",
+ reinterpret_cast<GLES2FunctionPointer>(glTexParameteri),
},
{
- "glShallowFinishCHROMIUM",
- reinterpret_cast<GLES2FunctionPointer>(glShallowFinishCHROMIUM),
+ "glTexParameteriv",
+ reinterpret_cast<GLES2FunctionPointer>(glTexParameteriv),
},
{
- "glShallowFlushCHROMIUM",
- reinterpret_cast<GLES2FunctionPointer>(glShallowFlushCHROMIUM),
+ "glTexStorage3D",
+ reinterpret_cast<GLES2FunctionPointer>(glTexStorage3D),
},
{
- "glOrderingBarrierCHROMIUM",
- reinterpret_cast<GLES2FunctionPointer>(glOrderingBarrierCHROMIUM),
+ "glTexSubImage2D",
+ reinterpret_cast<GLES2FunctionPointer>(glTexSubImage2D),
},
{
- "glStencilFunc",
- reinterpret_cast<GLES2FunctionPointer>(glStencilFunc),
+ "glTexSubImage3D",
+ reinterpret_cast<GLES2FunctionPointer>(glTexSubImage3D),
},
{
- "glStencilFuncSeparate",
- reinterpret_cast<GLES2FunctionPointer>(glStencilFuncSeparate),
+ "glTransformFeedbackVaryings",
+ reinterpret_cast<GLES2FunctionPointer>(glTransformFeedbackVaryings),
},
{
- "glStencilMask",
- reinterpret_cast<GLES2FunctionPointer>(glStencilMask),
+ "glUniform1f", reinterpret_cast<GLES2FunctionPointer>(glUniform1f),
},
{
- "glStencilMaskSeparate",
- reinterpret_cast<GLES2FunctionPointer>(glStencilMaskSeparate),
+ "glUniform1fv", reinterpret_cast<GLES2FunctionPointer>(glUniform1fv),
},
{
- "glStencilOp",
- reinterpret_cast<GLES2FunctionPointer>(glStencilOp),
+ "glUniform1i", reinterpret_cast<GLES2FunctionPointer>(glUniform1i),
},
{
- "glStencilOpSeparate",
- reinterpret_cast<GLES2FunctionPointer>(glStencilOpSeparate),
+ "glUniform1iv", reinterpret_cast<GLES2FunctionPointer>(glUniform1iv),
},
{
- "glTexImage2D",
- reinterpret_cast<GLES2FunctionPointer>(glTexImage2D),
+ "glUniform1ui", reinterpret_cast<GLES2FunctionPointer>(glUniform1ui),
},
{
- "glTexImage3D",
- reinterpret_cast<GLES2FunctionPointer>(glTexImage3D),
+ "glUniform1uiv", reinterpret_cast<GLES2FunctionPointer>(glUniform1uiv),
},
{
- "glTexParameterf",
- reinterpret_cast<GLES2FunctionPointer>(glTexParameterf),
+ "glUniform2f", reinterpret_cast<GLES2FunctionPointer>(glUniform2f),
},
{
- "glTexParameterfv",
- reinterpret_cast<GLES2FunctionPointer>(glTexParameterfv),
+ "glUniform2fv", reinterpret_cast<GLES2FunctionPointer>(glUniform2fv),
},
{
- "glTexParameteri",
- reinterpret_cast<GLES2FunctionPointer>(glTexParameteri),
+ "glUniform2i", reinterpret_cast<GLES2FunctionPointer>(glUniform2i),
},
{
- "glTexParameteriv",
- reinterpret_cast<GLES2FunctionPointer>(glTexParameteriv),
+ "glUniform2iv", reinterpret_cast<GLES2FunctionPointer>(glUniform2iv),
},
{
- "glTexStorage3D",
- reinterpret_cast<GLES2FunctionPointer>(glTexStorage3D),
+ "glUniform2ui", reinterpret_cast<GLES2FunctionPointer>(glUniform2ui),
},
{
- "glTexSubImage2D",
- reinterpret_cast<GLES2FunctionPointer>(glTexSubImage2D),
+ "glUniform2uiv", reinterpret_cast<GLES2FunctionPointer>(glUniform2uiv),
},
{
- "glTexSubImage3D",
- reinterpret_cast<GLES2FunctionPointer>(glTexSubImage3D),
+ "glUniform3f", reinterpret_cast<GLES2FunctionPointer>(glUniform3f),
},
{
- "glTransformFeedbackVaryings",
- reinterpret_cast<GLES2FunctionPointer>(glTransformFeedbackVaryings),
+ "glUniform3fv", reinterpret_cast<GLES2FunctionPointer>(glUniform3fv),
},
{
- "glUniform1f",
- reinterpret_cast<GLES2FunctionPointer>(glUniform1f),
+ "glUniform3i", reinterpret_cast<GLES2FunctionPointer>(glUniform3i),
},
{
- "glUniform1fv",
- reinterpret_cast<GLES2FunctionPointer>(glUniform1fv),
+ "glUniform3iv", reinterpret_cast<GLES2FunctionPointer>(glUniform3iv),
},
{
- "glUniform1i",
- reinterpret_cast<GLES2FunctionPointer>(glUniform1i),
+ "glUniform3ui", reinterpret_cast<GLES2FunctionPointer>(glUniform3ui),
},
{
- "glUniform1iv",
- reinterpret_cast<GLES2FunctionPointer>(glUniform1iv),
+ "glUniform3uiv", reinterpret_cast<GLES2FunctionPointer>(glUniform3uiv),
},
{
- "glUniform1ui",
- reinterpret_cast<GLES2FunctionPointer>(glUniform1ui),
+ "glUniform4f", reinterpret_cast<GLES2FunctionPointer>(glUniform4f),
},
{
- "glUniform1uiv",
- reinterpret_cast<GLES2FunctionPointer>(glUniform1uiv),
+ "glUniform4fv", reinterpret_cast<GLES2FunctionPointer>(glUniform4fv),
},
{
- "glUniform2f",
- reinterpret_cast<GLES2FunctionPointer>(glUniform2f),
+ "glUniform4i", reinterpret_cast<GLES2FunctionPointer>(glUniform4i),
},
{
- "glUniform2fv",
- reinterpret_cast<GLES2FunctionPointer>(glUniform2fv),
+ "glUniform4iv", reinterpret_cast<GLES2FunctionPointer>(glUniform4iv),
},
{
- "glUniform2i",
- reinterpret_cast<GLES2FunctionPointer>(glUniform2i),
+ "glUniform4ui", reinterpret_cast<GLES2FunctionPointer>(glUniform4ui),
},
{
- "glUniform2iv",
- reinterpret_cast<GLES2FunctionPointer>(glUniform2iv),
+ "glUniform4uiv", reinterpret_cast<GLES2FunctionPointer>(glUniform4uiv),
},
{
- "glUniform2ui",
- reinterpret_cast<GLES2FunctionPointer>(glUniform2ui),
+ "glUniformBlockBinding",
+ reinterpret_cast<GLES2FunctionPointer>(glUniformBlockBinding),
},
{
- "glUniform2uiv",
- reinterpret_cast<GLES2FunctionPointer>(glUniform2uiv),
+ "glUniformMatrix2fv",
+ reinterpret_cast<GLES2FunctionPointer>(glUniformMatrix2fv),
},
{
- "glUniform3f",
- reinterpret_cast<GLES2FunctionPointer>(glUniform3f),
+ "glUniformMatrix2x3fv",
+ reinterpret_cast<GLES2FunctionPointer>(glUniformMatrix2x3fv),
},
{
- "glUniform3fv",
- reinterpret_cast<GLES2FunctionPointer>(glUniform3fv),
+ "glUniformMatrix2x4fv",
+ reinterpret_cast<GLES2FunctionPointer>(glUniformMatrix2x4fv),
},
{
- "glUniform3i",
- reinterpret_cast<GLES2FunctionPointer>(glUniform3i),
+ "glUniformMatrix3fv",
+ reinterpret_cast<GLES2FunctionPointer>(glUniformMatrix3fv),
},
{
- "glUniform3iv",
- reinterpret_cast<GLES2FunctionPointer>(glUniform3iv),
+ "glUniformMatrix3x2fv",
+ reinterpret_cast<GLES2FunctionPointer>(glUniformMatrix3x2fv),
},
{
- "glUniform3ui",
- reinterpret_cast<GLES2FunctionPointer>(glUniform3ui),
+ "glUniformMatrix3x4fv",
+ reinterpret_cast<GLES2FunctionPointer>(glUniformMatrix3x4fv),
},
{
- "glUniform3uiv",
- reinterpret_cast<GLES2FunctionPointer>(glUniform3uiv),
+ "glUniformMatrix4fv",
+ reinterpret_cast<GLES2FunctionPointer>(glUniformMatrix4fv),
},
{
- "glUniform4f",
- reinterpret_cast<GLES2FunctionPointer>(glUniform4f),
+ "glUniformMatrix4x2fv",
+ reinterpret_cast<GLES2FunctionPointer>(glUniformMatrix4x2fv),
},
{
- "glUniform4fv",
- reinterpret_cast<GLES2FunctionPointer>(glUniform4fv),
+ "glUniformMatrix4x3fv",
+ reinterpret_cast<GLES2FunctionPointer>(glUniformMatrix4x3fv),
},
{
- "glUniform4i",
- reinterpret_cast<GLES2FunctionPointer>(glUniform4i),
+ "glUseProgram", reinterpret_cast<GLES2FunctionPointer>(glUseProgram),
},
{
- "glUniform4iv",
- reinterpret_cast<GLES2FunctionPointer>(glUniform4iv),
+ "glValidateProgram",
+ reinterpret_cast<GLES2FunctionPointer>(glValidateProgram),
},
{
- "glUniform4ui",
- reinterpret_cast<GLES2FunctionPointer>(glUniform4ui),
+ "glVertexAttrib1f",
+ reinterpret_cast<GLES2FunctionPointer>(glVertexAttrib1f),
},
{
- "glUniform4uiv",
- reinterpret_cast<GLES2FunctionPointer>(glUniform4uiv),
+ "glVertexAttrib1fv",
+ reinterpret_cast<GLES2FunctionPointer>(glVertexAttrib1fv),
},
{
- "glUniformBlockBinding",
- reinterpret_cast<GLES2FunctionPointer>(glUniformBlockBinding),
+ "glVertexAttrib2f",
+ reinterpret_cast<GLES2FunctionPointer>(glVertexAttrib2f),
},
{
- "glUniformMatrix2fv",
- reinterpret_cast<GLES2FunctionPointer>(glUniformMatrix2fv),
+ "glVertexAttrib2fv",
+ reinterpret_cast<GLES2FunctionPointer>(glVertexAttrib2fv),
},
{
- "glUniformMatrix2x3fv",
- reinterpret_cast<GLES2FunctionPointer>(glUniformMatrix2x3fv),
+ "glVertexAttrib3f",
+ reinterpret_cast<GLES2FunctionPointer>(glVertexAttrib3f),
},
{
- "glUniformMatrix2x4fv",
- reinterpret_cast<GLES2FunctionPointer>(glUniformMatrix2x4fv),
+ "glVertexAttrib3fv",
+ reinterpret_cast<GLES2FunctionPointer>(glVertexAttrib3fv),
},
{
- "glUniformMatrix3fv",
- reinterpret_cast<GLES2FunctionPointer>(glUniformMatrix3fv),
+ "glVertexAttrib4f",
+ reinterpret_cast<GLES2FunctionPointer>(glVertexAttrib4f),
},
{
- "glUniformMatrix3x2fv",
- reinterpret_cast<GLES2FunctionPointer>(glUniformMatrix3x2fv),
+ "glVertexAttrib4fv",
+ reinterpret_cast<GLES2FunctionPointer>(glVertexAttrib4fv),
},
{
- "glUniformMatrix3x4fv",
- reinterpret_cast<GLES2FunctionPointer>(glUniformMatrix3x4fv),
+ "glVertexAttribI4i",
+ reinterpret_cast<GLES2FunctionPointer>(glVertexAttribI4i),
},
{
- "glUniformMatrix4fv",
- reinterpret_cast<GLES2FunctionPointer>(glUniformMatrix4fv),
+ "glVertexAttribI4iv",
+ reinterpret_cast<GLES2FunctionPointer>(glVertexAttribI4iv),
},
{
- "glUniformMatrix4x2fv",
- reinterpret_cast<GLES2FunctionPointer>(glUniformMatrix4x2fv),
+ "glVertexAttribI4ui",
+ reinterpret_cast<GLES2FunctionPointer>(glVertexAttribI4ui),
},
{
- "glUniformMatrix4x3fv",
- reinterpret_cast<GLES2FunctionPointer>(glUniformMatrix4x3fv),
+ "glVertexAttribI4uiv",
+ reinterpret_cast<GLES2FunctionPointer>(glVertexAttribI4uiv),
},
{
- "glUseProgram",
- reinterpret_cast<GLES2FunctionPointer>(glUseProgram),
+ "glVertexAttribIPointer",
+ reinterpret_cast<GLES2FunctionPointer>(glVertexAttribIPointer),
},
{
- "glValidateProgram",
- reinterpret_cast<GLES2FunctionPointer>(glValidateProgram),
+ "glVertexAttribPointer",
+ reinterpret_cast<GLES2FunctionPointer>(glVertexAttribPointer),
},
{
- "glVertexAttrib1f",
- reinterpret_cast<GLES2FunctionPointer>(glVertexAttrib1f),
+ "glViewport", reinterpret_cast<GLES2FunctionPointer>(glViewport),
},
{
- "glVertexAttrib1fv",
- reinterpret_cast<GLES2FunctionPointer>(glVertexAttrib1fv),
+ "glWaitSync", reinterpret_cast<GLES2FunctionPointer>(glWaitSync),
},
{
- "glVertexAttrib2f",
- reinterpret_cast<GLES2FunctionPointer>(glVertexAttrib2f),
+ "glBlitFramebufferCHROMIUM",
+ reinterpret_cast<GLES2FunctionPointer>(glBlitFramebufferCHROMIUM),
},
{
- "glVertexAttrib2fv",
- reinterpret_cast<GLES2FunctionPointer>(glVertexAttrib2fv),
+ "glRenderbufferStorageMultisampleCHROMIUM",
+ reinterpret_cast<GLES2FunctionPointer>(
+ glRenderbufferStorageMultisampleCHROMIUM),
},
{
- "glVertexAttrib3f",
- reinterpret_cast<GLES2FunctionPointer>(glVertexAttrib3f),
+ "glRenderbufferStorageMultisampleEXT",
+ reinterpret_cast<GLES2FunctionPointer>(
+ glRenderbufferStorageMultisampleEXT),
},
{
- "glVertexAttrib3fv",
- reinterpret_cast<GLES2FunctionPointer>(glVertexAttrib3fv),
+ "glFramebufferTexture2DMultisampleEXT",
+ reinterpret_cast<GLES2FunctionPointer>(
+ glFramebufferTexture2DMultisampleEXT),
},
{
- "glVertexAttrib4f",
- reinterpret_cast<GLES2FunctionPointer>(glVertexAttrib4f),
+ "glTexStorage2DEXT",
+ reinterpret_cast<GLES2FunctionPointer>(glTexStorage2DEXT),
},
{
- "glVertexAttrib4fv",
- reinterpret_cast<GLES2FunctionPointer>(glVertexAttrib4fv),
+ "glGenQueriesEXT",
+ reinterpret_cast<GLES2FunctionPointer>(glGenQueriesEXT),
},
{
- "glVertexAttribI4i",
- reinterpret_cast<GLES2FunctionPointer>(glVertexAttribI4i),
+ "glDeleteQueriesEXT",
+ reinterpret_cast<GLES2FunctionPointer>(glDeleteQueriesEXT),
},
{
- "glVertexAttribI4iv",
- reinterpret_cast<GLES2FunctionPointer>(glVertexAttribI4iv),
+ "glQueryCounterEXT",
+ reinterpret_cast<GLES2FunctionPointer>(glQueryCounterEXT),
},
{
- "glVertexAttribI4ui",
- reinterpret_cast<GLES2FunctionPointer>(glVertexAttribI4ui),
+ "glIsQueryEXT", reinterpret_cast<GLES2FunctionPointer>(glIsQueryEXT),
},
{
- "glVertexAttribI4uiv",
- reinterpret_cast<GLES2FunctionPointer>(glVertexAttribI4uiv),
+ "glBeginQueryEXT",
+ reinterpret_cast<GLES2FunctionPointer>(glBeginQueryEXT),
},
{
- "glVertexAttribIPointer",
- reinterpret_cast<GLES2FunctionPointer>(glVertexAttribIPointer),
+ "glBeginTransformFeedback",
+ reinterpret_cast<GLES2FunctionPointer>(glBeginTransformFeedback),
},
{
- "glVertexAttribPointer",
- reinterpret_cast<GLES2FunctionPointer>(glVertexAttribPointer),
+ "glEndQueryEXT", reinterpret_cast<GLES2FunctionPointer>(glEndQueryEXT),
},
{
- "glViewport",
- reinterpret_cast<GLES2FunctionPointer>(glViewport),
+ "glEndTransformFeedback",
+ reinterpret_cast<GLES2FunctionPointer>(glEndTransformFeedback),
},
{
- "glWaitSync",
- reinterpret_cast<GLES2FunctionPointer>(glWaitSync),
+ "glGetQueryivEXT",
+ reinterpret_cast<GLES2FunctionPointer>(glGetQueryivEXT),
},
{
- "glBlitFramebufferCHROMIUM",
- reinterpret_cast<GLES2FunctionPointer>(glBlitFramebufferCHROMIUM),
+ "glGetQueryObjectivEXT",
+ reinterpret_cast<GLES2FunctionPointer>(glGetQueryObjectivEXT),
},
{
- "glRenderbufferStorageMultisampleCHROMIUM",
- reinterpret_cast<GLES2FunctionPointer>(
- glRenderbufferStorageMultisampleCHROMIUM),
+ "glGetQueryObjectuivEXT",
+ reinterpret_cast<GLES2FunctionPointer>(glGetQueryObjectuivEXT),
},
{
- "glRenderbufferStorageMultisampleEXT",
- reinterpret_cast<GLES2FunctionPointer>(
- glRenderbufferStorageMultisampleEXT),
+ "glGetQueryObjecti64vEXT",
+ reinterpret_cast<GLES2FunctionPointer>(glGetQueryObjecti64vEXT),
},
{
- "glFramebufferTexture2DMultisampleEXT",
- reinterpret_cast<GLES2FunctionPointer>(
- glFramebufferTexture2DMultisampleEXT),
+ "glGetQueryObjectui64vEXT",
+ reinterpret_cast<GLES2FunctionPointer>(glGetQueryObjectui64vEXT),
},
{
- "glTexStorage2DEXT",
- reinterpret_cast<GLES2FunctionPointer>(glTexStorage2DEXT),
+ "glSetDisjointValueSyncCHROMIUM",
+ reinterpret_cast<GLES2FunctionPointer>(glSetDisjointValueSyncCHROMIUM),
},
{
- "glGenQueriesEXT",
- reinterpret_cast<GLES2FunctionPointer>(glGenQueriesEXT),
+ "glInsertEventMarkerEXT",
+ reinterpret_cast<GLES2FunctionPointer>(glInsertEventMarkerEXT),
},
{
- "glDeleteQueriesEXT",
- reinterpret_cast<GLES2FunctionPointer>(glDeleteQueriesEXT),
+ "glPushGroupMarkerEXT",
+ reinterpret_cast<GLES2FunctionPointer>(glPushGroupMarkerEXT),
},
{
- "glIsQueryEXT",
- reinterpret_cast<GLES2FunctionPointer>(glIsQueryEXT),
+ "glPopGroupMarkerEXT",
+ reinterpret_cast<GLES2FunctionPointer>(glPopGroupMarkerEXT),
},
{
- "glBeginQueryEXT",
- reinterpret_cast<GLES2FunctionPointer>(glBeginQueryEXT),
+ "glGenVertexArraysOES",
+ reinterpret_cast<GLES2FunctionPointer>(glGenVertexArraysOES),
},
{
- "glBeginTransformFeedback",
- reinterpret_cast<GLES2FunctionPointer>(glBeginTransformFeedback),
+ "glDeleteVertexArraysOES",
+ reinterpret_cast<GLES2FunctionPointer>(glDeleteVertexArraysOES),
},
{
- "glEndQueryEXT",
- reinterpret_cast<GLES2FunctionPointer>(glEndQueryEXT),
+ "glIsVertexArrayOES",
+ reinterpret_cast<GLES2FunctionPointer>(glIsVertexArrayOES),
},
{
- "glEndTransformFeedback",
- reinterpret_cast<GLES2FunctionPointer>(glEndTransformFeedback),
+ "glBindVertexArrayOES",
+ reinterpret_cast<GLES2FunctionPointer>(glBindVertexArrayOES),
},
{
- "glGetQueryivEXT",
- reinterpret_cast<GLES2FunctionPointer>(glGetQueryivEXT),
+ "glSwapBuffers", reinterpret_cast<GLES2FunctionPointer>(glSwapBuffers),
},
{
- "glGetQueryObjectuivEXT",
- reinterpret_cast<GLES2FunctionPointer>(glGetQueryObjectuivEXT),
+ "glGetMaxValueInBufferCHROMIUM",
+ reinterpret_cast<GLES2FunctionPointer>(glGetMaxValueInBufferCHROMIUM),
},
{
- "glGetQueryObjectui64vEXT",
- reinterpret_cast<GLES2FunctionPointer>(glGetQueryObjectui64vEXT),
+ "glEnableFeatureCHROMIUM",
+ reinterpret_cast<GLES2FunctionPointer>(glEnableFeatureCHROMIUM),
},
{
- "glInsertEventMarkerEXT",
- reinterpret_cast<GLES2FunctionPointer>(glInsertEventMarkerEXT),
+ "glMapBufferCHROMIUM",
+ reinterpret_cast<GLES2FunctionPointer>(glMapBufferCHROMIUM),
},
{
- "glPushGroupMarkerEXT",
- reinterpret_cast<GLES2FunctionPointer>(glPushGroupMarkerEXT),
+ "glUnmapBufferCHROMIUM",
+ reinterpret_cast<GLES2FunctionPointer>(glUnmapBufferCHROMIUM),
},
{
- "glPopGroupMarkerEXT",
- reinterpret_cast<GLES2FunctionPointer>(glPopGroupMarkerEXT),
+ "glMapBufferSubDataCHROMIUM",
+ reinterpret_cast<GLES2FunctionPointer>(glMapBufferSubDataCHROMIUM),
},
{
- "glGenVertexArraysOES",
- reinterpret_cast<GLES2FunctionPointer>(glGenVertexArraysOES),
+ "glUnmapBufferSubDataCHROMIUM",
+ reinterpret_cast<GLES2FunctionPointer>(glUnmapBufferSubDataCHROMIUM),
},
{
- "glDeleteVertexArraysOES",
- reinterpret_cast<GLES2FunctionPointer>(glDeleteVertexArraysOES),
+ "glMapBufferRange",
+ reinterpret_cast<GLES2FunctionPointer>(glMapBufferRange),
},
{
- "glIsVertexArrayOES",
- reinterpret_cast<GLES2FunctionPointer>(glIsVertexArrayOES),
+ "glUnmapBuffer", reinterpret_cast<GLES2FunctionPointer>(glUnmapBuffer),
},
{
- "glBindVertexArrayOES",
- reinterpret_cast<GLES2FunctionPointer>(glBindVertexArrayOES),
+ "glMapTexSubImage2DCHROMIUM",
+ reinterpret_cast<GLES2FunctionPointer>(glMapTexSubImage2DCHROMIUM),
},
{
- "glSwapBuffers",
- reinterpret_cast<GLES2FunctionPointer>(glSwapBuffers),
+ "glUnmapTexSubImage2DCHROMIUM",
+ reinterpret_cast<GLES2FunctionPointer>(glUnmapTexSubImage2DCHROMIUM),
},
{
- "glGetMaxValueInBufferCHROMIUM",
- reinterpret_cast<GLES2FunctionPointer>(glGetMaxValueInBufferCHROMIUM),
+ "glResizeCHROMIUM",
+ reinterpret_cast<GLES2FunctionPointer>(glResizeCHROMIUM),
},
{
- "glEnableFeatureCHROMIUM",
- reinterpret_cast<GLES2FunctionPointer>(glEnableFeatureCHROMIUM),
+ "glGetRequestableExtensionsCHROMIUM",
+ reinterpret_cast<GLES2FunctionPointer>(
+ glGetRequestableExtensionsCHROMIUM),
},
{
- "glMapBufferCHROMIUM",
- reinterpret_cast<GLES2FunctionPointer>(glMapBufferCHROMIUM),
+ "glRequestExtensionCHROMIUM",
+ reinterpret_cast<GLES2FunctionPointer>(glRequestExtensionCHROMIUM),
},
{
- "glUnmapBufferCHROMIUM",
- reinterpret_cast<GLES2FunctionPointer>(glUnmapBufferCHROMIUM),
+ "glGetProgramInfoCHROMIUM",
+ reinterpret_cast<GLES2FunctionPointer>(glGetProgramInfoCHROMIUM),
},
{
- "glMapBufferSubDataCHROMIUM",
- reinterpret_cast<GLES2FunctionPointer>(glMapBufferSubDataCHROMIUM),
+ "glGetUniformBlocksCHROMIUM",
+ reinterpret_cast<GLES2FunctionPointer>(glGetUniformBlocksCHROMIUM),
},
{
- "glUnmapBufferSubDataCHROMIUM",
- reinterpret_cast<GLES2FunctionPointer>(glUnmapBufferSubDataCHROMIUM),
+ "glGetTransformFeedbackVaryingsCHROMIUM",
+ reinterpret_cast<GLES2FunctionPointer>(
+ glGetTransformFeedbackVaryingsCHROMIUM),
},
{
- "glMapBufferRange",
- reinterpret_cast<GLES2FunctionPointer>(glMapBufferRange),
+ "glGetUniformsES3CHROMIUM",
+ reinterpret_cast<GLES2FunctionPointer>(glGetUniformsES3CHROMIUM),
},
{
- "glUnmapBuffer",
- reinterpret_cast<GLES2FunctionPointer>(glUnmapBuffer),
+ "glCreateStreamTextureCHROMIUM",
+ reinterpret_cast<GLES2FunctionPointer>(glCreateStreamTextureCHROMIUM),
},
{
- "glMapTexSubImage2DCHROMIUM",
- reinterpret_cast<GLES2FunctionPointer>(glMapTexSubImage2DCHROMIUM),
+ "glCreateImageCHROMIUM",
+ reinterpret_cast<GLES2FunctionPointer>(glCreateImageCHROMIUM),
},
{
- "glUnmapTexSubImage2DCHROMIUM",
- reinterpret_cast<GLES2FunctionPointer>(glUnmapTexSubImage2DCHROMIUM),
+ "glDestroyImageCHROMIUM",
+ reinterpret_cast<GLES2FunctionPointer>(glDestroyImageCHROMIUM),
},
{
- "glResizeCHROMIUM",
- reinterpret_cast<GLES2FunctionPointer>(glResizeCHROMIUM),
+ "glCreateGpuMemoryBufferImageCHROMIUM",
+ reinterpret_cast<GLES2FunctionPointer>(
+ glCreateGpuMemoryBufferImageCHROMIUM),
},
{
- "glGetRequestableExtensionsCHROMIUM",
- reinterpret_cast<GLES2FunctionPointer>(glGetRequestableExtensionsCHROMIUM),
+ "glGetTranslatedShaderSourceANGLE",
+ reinterpret_cast<GLES2FunctionPointer>(
+ glGetTranslatedShaderSourceANGLE),
},
{
- "glRequestExtensionCHROMIUM",
- reinterpret_cast<GLES2FunctionPointer>(glRequestExtensionCHROMIUM),
+ "glPostSubBufferCHROMIUM",
+ reinterpret_cast<GLES2FunctionPointer>(glPostSubBufferCHROMIUM),
},
{
- "glRateLimitOffscreenContextCHROMIUM",
- reinterpret_cast<GLES2FunctionPointer>(
- glRateLimitOffscreenContextCHROMIUM),
+ "glTexImageIOSurface2DCHROMIUM",
+ reinterpret_cast<GLES2FunctionPointer>(glTexImageIOSurface2DCHROMIUM),
},
{
- "glGetProgramInfoCHROMIUM",
- reinterpret_cast<GLES2FunctionPointer>(glGetProgramInfoCHROMIUM),
+ "glCopyTextureCHROMIUM",
+ reinterpret_cast<GLES2FunctionPointer>(glCopyTextureCHROMIUM),
},
{
- "glGetUniformBlocksCHROMIUM",
- reinterpret_cast<GLES2FunctionPointer>(glGetUniformBlocksCHROMIUM),
+ "glCopySubTextureCHROMIUM",
+ reinterpret_cast<GLES2FunctionPointer>(glCopySubTextureCHROMIUM),
},
{
- "glGetTransformFeedbackVaryingsCHROMIUM",
- reinterpret_cast<GLES2FunctionPointer>(
- glGetTransformFeedbackVaryingsCHROMIUM),
+ "glCompressedCopyTextureCHROMIUM",
+ reinterpret_cast<GLES2FunctionPointer>(glCompressedCopyTextureCHROMIUM),
},
{
- "glGetUniformsES3CHROMIUM",
- reinterpret_cast<GLES2FunctionPointer>(glGetUniformsES3CHROMIUM),
+ "glCompressedCopySubTextureCHROMIUM",
+ reinterpret_cast<GLES2FunctionPointer>(
+ glCompressedCopySubTextureCHROMIUM),
},
{
- "glCreateStreamTextureCHROMIUM",
- reinterpret_cast<GLES2FunctionPointer>(glCreateStreamTextureCHROMIUM),
+ "glDrawArraysInstancedANGLE",
+ reinterpret_cast<GLES2FunctionPointer>(glDrawArraysInstancedANGLE),
},
{
- "glCreateImageCHROMIUM",
- reinterpret_cast<GLES2FunctionPointer>(glCreateImageCHROMIUM),
+ "glDrawElementsInstancedANGLE",
+ reinterpret_cast<GLES2FunctionPointer>(glDrawElementsInstancedANGLE),
},
{
- "glDestroyImageCHROMIUM",
- reinterpret_cast<GLES2FunctionPointer>(glDestroyImageCHROMIUM),
+ "glVertexAttribDivisorANGLE",
+ reinterpret_cast<GLES2FunctionPointer>(glVertexAttribDivisorANGLE),
},
{
- "glCreateGpuMemoryBufferImageCHROMIUM",
- reinterpret_cast<GLES2FunctionPointer>(
- glCreateGpuMemoryBufferImageCHROMIUM),
+ "glGenMailboxCHROMIUM",
+ reinterpret_cast<GLES2FunctionPointer>(glGenMailboxCHROMIUM),
},
{
- "glGetTranslatedShaderSourceANGLE",
- reinterpret_cast<GLES2FunctionPointer>(glGetTranslatedShaderSourceANGLE),
+ "glProduceTextureCHROMIUM",
+ reinterpret_cast<GLES2FunctionPointer>(glProduceTextureCHROMIUM),
},
{
- "glPostSubBufferCHROMIUM",
- reinterpret_cast<GLES2FunctionPointer>(glPostSubBufferCHROMIUM),
+ "glProduceTextureDirectCHROMIUM",
+ reinterpret_cast<GLES2FunctionPointer>(glProduceTextureDirectCHROMIUM),
},
{
- "glTexImageIOSurface2DCHROMIUM",
- reinterpret_cast<GLES2FunctionPointer>(glTexImageIOSurface2DCHROMIUM),
+ "glConsumeTextureCHROMIUM",
+ reinterpret_cast<GLES2FunctionPointer>(glConsumeTextureCHROMIUM),
},
{
- "glCopyTextureCHROMIUM",
- reinterpret_cast<GLES2FunctionPointer>(glCopyTextureCHROMIUM),
+ "glCreateAndConsumeTextureCHROMIUM",
+ reinterpret_cast<GLES2FunctionPointer>(
+ glCreateAndConsumeTextureCHROMIUM),
},
{
- "glCopySubTextureCHROMIUM",
- reinterpret_cast<GLES2FunctionPointer>(glCopySubTextureCHROMIUM),
+ "glBindUniformLocationCHROMIUM",
+ reinterpret_cast<GLES2FunctionPointer>(glBindUniformLocationCHROMIUM),
},
{
- "glCompressedCopyTextureCHROMIUM",
- reinterpret_cast<GLES2FunctionPointer>(glCompressedCopyTextureCHROMIUM),
+ "glGenValuebuffersCHROMIUM",
+ reinterpret_cast<GLES2FunctionPointer>(glGenValuebuffersCHROMIUM),
},
{
- "glDrawArraysInstancedANGLE",
- reinterpret_cast<GLES2FunctionPointer>(glDrawArraysInstancedANGLE),
+ "glDeleteValuebuffersCHROMIUM",
+ reinterpret_cast<GLES2FunctionPointer>(glDeleteValuebuffersCHROMIUM),
},
{
- "glDrawElementsInstancedANGLE",
- reinterpret_cast<GLES2FunctionPointer>(glDrawElementsInstancedANGLE),
+ "glIsValuebufferCHROMIUM",
+ reinterpret_cast<GLES2FunctionPointer>(glIsValuebufferCHROMIUM),
},
{
- "glVertexAttribDivisorANGLE",
- reinterpret_cast<GLES2FunctionPointer>(glVertexAttribDivisorANGLE),
+ "glBindValuebufferCHROMIUM",
+ reinterpret_cast<GLES2FunctionPointer>(glBindValuebufferCHROMIUM),
},
{
- "glGenMailboxCHROMIUM",
- reinterpret_cast<GLES2FunctionPointer>(glGenMailboxCHROMIUM),
+ "glSubscribeValueCHROMIUM",
+ reinterpret_cast<GLES2FunctionPointer>(glSubscribeValueCHROMIUM),
},
{
- "glProduceTextureCHROMIUM",
- reinterpret_cast<GLES2FunctionPointer>(glProduceTextureCHROMIUM),
+ "glPopulateSubscribedValuesCHROMIUM",
+ reinterpret_cast<GLES2FunctionPointer>(
+ glPopulateSubscribedValuesCHROMIUM),
},
{
- "glProduceTextureDirectCHROMIUM",
- reinterpret_cast<GLES2FunctionPointer>(glProduceTextureDirectCHROMIUM),
+ "glUniformValuebufferCHROMIUM",
+ reinterpret_cast<GLES2FunctionPointer>(glUniformValuebufferCHROMIUM),
},
{
- "glConsumeTextureCHROMIUM",
- reinterpret_cast<GLES2FunctionPointer>(glConsumeTextureCHROMIUM),
+ "glBindTexImage2DCHROMIUM",
+ reinterpret_cast<GLES2FunctionPointer>(glBindTexImage2DCHROMIUM),
},
{
- "glCreateAndConsumeTextureCHROMIUM",
- reinterpret_cast<GLES2FunctionPointer>(glCreateAndConsumeTextureCHROMIUM),
+ "glReleaseTexImage2DCHROMIUM",
+ reinterpret_cast<GLES2FunctionPointer>(glReleaseTexImage2DCHROMIUM),
},
{
- "glBindUniformLocationCHROMIUM",
- reinterpret_cast<GLES2FunctionPointer>(glBindUniformLocationCHROMIUM),
+ "glTraceBeginCHROMIUM",
+ reinterpret_cast<GLES2FunctionPointer>(glTraceBeginCHROMIUM),
},
{
- "glGenValuebuffersCHROMIUM",
- reinterpret_cast<GLES2FunctionPointer>(glGenValuebuffersCHROMIUM),
+ "glTraceEndCHROMIUM",
+ reinterpret_cast<GLES2FunctionPointer>(glTraceEndCHROMIUM),
},
{
- "glDeleteValuebuffersCHROMIUM",
- reinterpret_cast<GLES2FunctionPointer>(glDeleteValuebuffersCHROMIUM),
+ "glDiscardFramebufferEXT",
+ reinterpret_cast<GLES2FunctionPointer>(glDiscardFramebufferEXT),
},
{
- "glIsValuebufferCHROMIUM",
- reinterpret_cast<GLES2FunctionPointer>(glIsValuebufferCHROMIUM),
+ "glLoseContextCHROMIUM",
+ reinterpret_cast<GLES2FunctionPointer>(glLoseContextCHROMIUM),
},
{
- "glBindValuebufferCHROMIUM",
- reinterpret_cast<GLES2FunctionPointer>(glBindValuebufferCHROMIUM),
+ "glInsertSyncPointCHROMIUM",
+ reinterpret_cast<GLES2FunctionPointer>(glInsertSyncPointCHROMIUM),
},
{
- "glSubscribeValueCHROMIUM",
- reinterpret_cast<GLES2FunctionPointer>(glSubscribeValueCHROMIUM),
+ "glWaitSyncPointCHROMIUM",
+ reinterpret_cast<GLES2FunctionPointer>(glWaitSyncPointCHROMIUM),
},
{
- "glPopulateSubscribedValuesCHROMIUM",
- reinterpret_cast<GLES2FunctionPointer>(glPopulateSubscribedValuesCHROMIUM),
+ "glDrawBuffersEXT",
+ reinterpret_cast<GLES2FunctionPointer>(glDrawBuffersEXT),
},
{
- "glUniformValuebufferCHROMIUM",
- reinterpret_cast<GLES2FunctionPointer>(glUniformValuebufferCHROMIUM),
+ "glDiscardBackbufferCHROMIUM",
+ reinterpret_cast<GLES2FunctionPointer>(glDiscardBackbufferCHROMIUM),
},
{
- "glBindTexImage2DCHROMIUM",
- reinterpret_cast<GLES2FunctionPointer>(glBindTexImage2DCHROMIUM),
+ "glScheduleOverlayPlaneCHROMIUM",
+ reinterpret_cast<GLES2FunctionPointer>(glScheduleOverlayPlaneCHROMIUM),
},
{
- "glReleaseTexImage2DCHROMIUM",
- reinterpret_cast<GLES2FunctionPointer>(glReleaseTexImage2DCHROMIUM),
+ "glSwapInterval",
+ reinterpret_cast<GLES2FunctionPointer>(glSwapInterval),
},
{
- "glTraceBeginCHROMIUM",
- reinterpret_cast<GLES2FunctionPointer>(glTraceBeginCHROMIUM),
+ "glFlushDriverCachesCHROMIUM",
+ reinterpret_cast<GLES2FunctionPointer>(glFlushDriverCachesCHROMIUM),
},
{
- "glTraceEndCHROMIUM",
- reinterpret_cast<GLES2FunctionPointer>(glTraceEndCHROMIUM),
+ "glMatrixLoadfCHROMIUM",
+ reinterpret_cast<GLES2FunctionPointer>(glMatrixLoadfCHROMIUM),
},
{
- "glAsyncTexSubImage2DCHROMIUM",
- reinterpret_cast<GLES2FunctionPointer>(glAsyncTexSubImage2DCHROMIUM),
+ "glMatrixLoadIdentityCHROMIUM",
+ reinterpret_cast<GLES2FunctionPointer>(glMatrixLoadIdentityCHROMIUM),
},
{
- "glAsyncTexImage2DCHROMIUM",
- reinterpret_cast<GLES2FunctionPointer>(glAsyncTexImage2DCHROMIUM),
+ "glGenPathsCHROMIUM",
+ reinterpret_cast<GLES2FunctionPointer>(glGenPathsCHROMIUM),
},
{
- "glWaitAsyncTexImage2DCHROMIUM",
- reinterpret_cast<GLES2FunctionPointer>(glWaitAsyncTexImage2DCHROMIUM),
+ "glDeletePathsCHROMIUM",
+ reinterpret_cast<GLES2FunctionPointer>(glDeletePathsCHROMIUM),
},
{
- "glWaitAllAsyncTexImage2DCHROMIUM",
- reinterpret_cast<GLES2FunctionPointer>(glWaitAllAsyncTexImage2DCHROMIUM),
+ "glIsPathCHROMIUM",
+ reinterpret_cast<GLES2FunctionPointer>(glIsPathCHROMIUM),
},
{
- "glDiscardFramebufferEXT",
- reinterpret_cast<GLES2FunctionPointer>(glDiscardFramebufferEXT),
+ "glPathCommandsCHROMIUM",
+ reinterpret_cast<GLES2FunctionPointer>(glPathCommandsCHROMIUM),
},
{
- "glLoseContextCHROMIUM",
- reinterpret_cast<GLES2FunctionPointer>(glLoseContextCHROMIUM),
+ "glPathParameterfCHROMIUM",
+ reinterpret_cast<GLES2FunctionPointer>(glPathParameterfCHROMIUM),
},
{
- "glInsertSyncPointCHROMIUM",
- reinterpret_cast<GLES2FunctionPointer>(glInsertSyncPointCHROMIUM),
+ "glPathParameteriCHROMIUM",
+ reinterpret_cast<GLES2FunctionPointer>(glPathParameteriCHROMIUM),
},
{
- "glWaitSyncPointCHROMIUM",
- reinterpret_cast<GLES2FunctionPointer>(glWaitSyncPointCHROMIUM),
+ "glPathStencilFuncCHROMIUM",
+ reinterpret_cast<GLES2FunctionPointer>(glPathStencilFuncCHROMIUM),
},
{
- "glDrawBuffersEXT",
- reinterpret_cast<GLES2FunctionPointer>(glDrawBuffersEXT),
+ "glStencilFillPathCHROMIUM",
+ reinterpret_cast<GLES2FunctionPointer>(glStencilFillPathCHROMIUM),
},
{
- "glDiscardBackbufferCHROMIUM",
- reinterpret_cast<GLES2FunctionPointer>(glDiscardBackbufferCHROMIUM),
+ "glStencilStrokePathCHROMIUM",
+ reinterpret_cast<GLES2FunctionPointer>(glStencilStrokePathCHROMIUM),
},
{
- "glScheduleOverlayPlaneCHROMIUM",
- reinterpret_cast<GLES2FunctionPointer>(glScheduleOverlayPlaneCHROMIUM),
+ "glCoverFillPathCHROMIUM",
+ reinterpret_cast<GLES2FunctionPointer>(glCoverFillPathCHROMIUM),
},
{
- "glSwapInterval",
- reinterpret_cast<GLES2FunctionPointer>(glSwapInterval),
+ "glCoverStrokePathCHROMIUM",
+ reinterpret_cast<GLES2FunctionPointer>(glCoverStrokePathCHROMIUM),
},
{
- "glFlushDriverCachesCHROMIUM",
- reinterpret_cast<GLES2FunctionPointer>(glFlushDriverCachesCHROMIUM),
+ "glStencilThenCoverFillPathCHROMIUM",
+ reinterpret_cast<GLES2FunctionPointer>(
+ glStencilThenCoverFillPathCHROMIUM),
},
{
- "glMatrixLoadfCHROMIUM",
- reinterpret_cast<GLES2FunctionPointer>(glMatrixLoadfCHROMIUM),
+ "glStencilThenCoverStrokePathCHROMIUM",
+ reinterpret_cast<GLES2FunctionPointer>(
+ glStencilThenCoverStrokePathCHROMIUM),
},
{
- "glMatrixLoadIdentityCHROMIUM",
- reinterpret_cast<GLES2FunctionPointer>(glMatrixLoadIdentityCHROMIUM),
+ "glGetGraphicsResetStatusKHR",
+ reinterpret_cast<GLES2FunctionPointer>(glGetGraphicsResetStatusKHR),
},
{
- "glGetGraphicsResetStatusKHR",
- reinterpret_cast<GLES2FunctionPointer>(glGetGraphicsResetStatusKHR),
+ "glBlendBarrierKHR",
+ reinterpret_cast<GLES2FunctionPointer>(glBlendBarrierKHR),
},
{
- "glBlendBarrierKHR",
- reinterpret_cast<GLES2FunctionPointer>(glBlendBarrierKHR),
+ "glApplyScreenSpaceAntialiasingCHROMIUM",
+ reinterpret_cast<GLES2FunctionPointer>(
+ glApplyScreenSpaceAntialiasingCHROMIUM),
},
{
- NULL,
- NULL,
+ NULL, NULL,
},
};
diff --git a/chromium/gpu/command_buffer/client/gles2_cmd_helper_autogen.h b/chromium/gpu/command_buffer/client/gles2_cmd_helper_autogen.h
index 27b98d3d561..fb77fa29a5b 100644
--- a/chromium/gpu/command_buffer/client/gles2_cmd_helper_autogen.h
+++ b/chromium/gpu/command_buffer/client/gles2_cmd_helper_autogen.h
@@ -852,6 +852,17 @@ void GetBooleanv(GLenum pname,
}
}
+void GetBufferParameteri64v(GLenum target,
+ GLenum pname,
+ uint32_t params_shm_id,
+ uint32_t params_shm_offset) {
+ gles2::cmds::GetBufferParameteri64v* c =
+ GetCmdSpace<gles2::cmds::GetBufferParameteri64v>();
+ if (c) {
+ c->Init(target, pname, params_shm_id, params_shm_offset);
+ }
+}
+
void GetBufferParameteriv(GLenum target,
GLenum pname,
uint32_t params_shm_id,
@@ -2228,6 +2239,17 @@ void DeleteQueriesEXTImmediate(GLsizei n, const GLuint* queries) {
}
}
+void QueryCounterEXT(GLuint id,
+ GLenum target,
+ uint32_t sync_data_shm_id,
+ uint32_t sync_data_shm_offset,
+ GLuint submit_count) {
+ gles2::cmds::QueryCounterEXT* c = GetCmdSpace<gles2::cmds::QueryCounterEXT>();
+ if (c) {
+ c->Init(id, target, sync_data_shm_id, sync_data_shm_offset, submit_count);
+ }
+}
+
void BeginQueryEXT(GLenum target,
GLuint id,
uint32_t sync_data_shm_id,
@@ -2261,6 +2283,15 @@ void EndTransformFeedback() {
}
}
+void SetDisjointValueSyncCHROMIUM(uint32_t sync_data_shm_id,
+ uint32_t sync_data_shm_offset) {
+ gles2::cmds::SetDisjointValueSyncCHROMIUM* c =
+ GetCmdSpace<gles2::cmds::SetDisjointValueSyncCHROMIUM>();
+ if (c) {
+ c->Init(sync_data_shm_id, sync_data_shm_offset);
+ }
+}
+
void InsertEventMarkerEXT(GLuint bucket_id) {
gles2::cmds::InsertEventMarkerEXT* c =
GetCmdSpace<gles2::cmds::InsertEventMarkerEXT>();
@@ -2506,6 +2537,22 @@ void CompressedCopyTextureCHROMIUM(GLenum target,
}
}
+void CompressedCopySubTextureCHROMIUM(GLenum target,
+ GLenum source_id,
+ GLenum dest_id,
+ GLint xoffset,
+ GLint yoffset,
+ GLint x,
+ GLint y,
+ GLsizei width,
+ GLsizei height) {
+ gles2::cmds::CompressedCopySubTextureCHROMIUM* c =
+ GetCmdSpace<gles2::cmds::CompressedCopySubTextureCHROMIUM>();
+ if (c) {
+ c->Init(target, source_id, dest_id, xoffset, yoffset, x, y, width, height);
+ }
+}
+
void DrawArraysInstancedANGLE(GLenum mode,
GLint first,
GLsizei count,
@@ -2681,65 +2728,6 @@ void TraceEndCHROMIUM() {
}
}
-void AsyncTexSubImage2DCHROMIUM(GLenum target,
- GLint level,
- GLint xoffset,
- GLint yoffset,
- GLsizei width,
- GLsizei height,
- GLenum format,
- GLenum type,
- uint32_t data_shm_id,
- uint32_t data_shm_offset,
- uint32_t async_upload_token,
- uint32_t sync_data_shm_id,
- uint32_t sync_data_shm_offset) {
- gles2::cmds::AsyncTexSubImage2DCHROMIUM* c =
- GetCmdSpace<gles2::cmds::AsyncTexSubImage2DCHROMIUM>();
- if (c) {
- c->Init(target, level, xoffset, yoffset, width, height, format, type,
- data_shm_id, data_shm_offset, async_upload_token, sync_data_shm_id,
- sync_data_shm_offset);
- }
-}
-
-void AsyncTexImage2DCHROMIUM(GLenum target,
- GLint level,
- GLint internalformat,
- GLsizei width,
- GLsizei height,
- GLenum format,
- GLenum type,
- uint32_t pixels_shm_id,
- uint32_t pixels_shm_offset,
- uint32_t async_upload_token,
- uint32_t sync_data_shm_id,
- uint32_t sync_data_shm_offset) {
- gles2::cmds::AsyncTexImage2DCHROMIUM* c =
- GetCmdSpace<gles2::cmds::AsyncTexImage2DCHROMIUM>();
- if (c) {
- c->Init(target, level, internalformat, width, height, format, type,
- pixels_shm_id, pixels_shm_offset, async_upload_token,
- sync_data_shm_id, sync_data_shm_offset);
- }
-}
-
-void WaitAsyncTexImage2DCHROMIUM(GLenum target) {
- gles2::cmds::WaitAsyncTexImage2DCHROMIUM* c =
- GetCmdSpace<gles2::cmds::WaitAsyncTexImage2DCHROMIUM>();
- if (c) {
- c->Init(target);
- }
-}
-
-void WaitAllAsyncTexImage2DCHROMIUM() {
- gles2::cmds::WaitAllAsyncTexImage2DCHROMIUM* c =
- GetCmdSpace<gles2::cmds::WaitAllAsyncTexImage2DCHROMIUM>();
- if (c) {
- c->Init();
- }
-}
-
void DiscardFramebufferEXTImmediate(GLenum target,
GLsizei count,
const GLenum* attachments) {
@@ -2841,6 +2829,125 @@ void MatrixLoadIdentityCHROMIUM(GLenum matrixMode) {
}
}
+void GenPathsCHROMIUM(GLuint first_client_id, GLsizei range) {
+ gles2::cmds::GenPathsCHROMIUM* c =
+ GetCmdSpace<gles2::cmds::GenPathsCHROMIUM>();
+ if (c) {
+ c->Init(first_client_id, range);
+ }
+}
+
+void DeletePathsCHROMIUM(GLuint first_client_id, GLsizei range) {
+ gles2::cmds::DeletePathsCHROMIUM* c =
+ GetCmdSpace<gles2::cmds::DeletePathsCHROMIUM>();
+ if (c) {
+ c->Init(first_client_id, range);
+ }
+}
+
+void IsPathCHROMIUM(GLuint path,
+ uint32_t result_shm_id,
+ uint32_t result_shm_offset) {
+ gles2::cmds::IsPathCHROMIUM* c = GetCmdSpace<gles2::cmds::IsPathCHROMIUM>();
+ if (c) {
+ c->Init(path, result_shm_id, result_shm_offset);
+ }
+}
+
+void PathCommandsCHROMIUM(GLuint path,
+ GLsizei numCommands,
+ uint32_t commands_shm_id,
+ uint32_t commands_shm_offset,
+ GLsizei numCoords,
+ GLenum coordType,
+ uint32_t coords_shm_id,
+ uint32_t coords_shm_offset) {
+ gles2::cmds::PathCommandsCHROMIUM* c =
+ GetCmdSpace<gles2::cmds::PathCommandsCHROMIUM>();
+ if (c) {
+ c->Init(path, numCommands, commands_shm_id, commands_shm_offset, numCoords,
+ coordType, coords_shm_id, coords_shm_offset);
+ }
+}
+
+void PathParameterfCHROMIUM(GLuint path, GLenum pname, GLfloat value) {
+ gles2::cmds::PathParameterfCHROMIUM* c =
+ GetCmdSpace<gles2::cmds::PathParameterfCHROMIUM>();
+ if (c) {
+ c->Init(path, pname, value);
+ }
+}
+
+void PathParameteriCHROMIUM(GLuint path, GLenum pname, GLint value) {
+ gles2::cmds::PathParameteriCHROMIUM* c =
+ GetCmdSpace<gles2::cmds::PathParameteriCHROMIUM>();
+ if (c) {
+ c->Init(path, pname, value);
+ }
+}
+
+void PathStencilFuncCHROMIUM(GLenum func, GLint ref, GLuint mask) {
+ gles2::cmds::PathStencilFuncCHROMIUM* c =
+ GetCmdSpace<gles2::cmds::PathStencilFuncCHROMIUM>();
+ if (c) {
+ c->Init(func, ref, mask);
+ }
+}
+
+void StencilFillPathCHROMIUM(GLuint path, GLenum fillMode, GLuint mask) {
+ gles2::cmds::StencilFillPathCHROMIUM* c =
+ GetCmdSpace<gles2::cmds::StencilFillPathCHROMIUM>();
+ if (c) {
+ c->Init(path, fillMode, mask);
+ }
+}
+
+void StencilStrokePathCHROMIUM(GLuint path, GLint reference, GLuint mask) {
+ gles2::cmds::StencilStrokePathCHROMIUM* c =
+ GetCmdSpace<gles2::cmds::StencilStrokePathCHROMIUM>();
+ if (c) {
+ c->Init(path, reference, mask);
+ }
+}
+
+void CoverFillPathCHROMIUM(GLuint path, GLenum coverMode) {
+ gles2::cmds::CoverFillPathCHROMIUM* c =
+ GetCmdSpace<gles2::cmds::CoverFillPathCHROMIUM>();
+ if (c) {
+ c->Init(path, coverMode);
+ }
+}
+
+void CoverStrokePathCHROMIUM(GLuint path, GLenum coverMode) {
+ gles2::cmds::CoverStrokePathCHROMIUM* c =
+ GetCmdSpace<gles2::cmds::CoverStrokePathCHROMIUM>();
+ if (c) {
+ c->Init(path, coverMode);
+ }
+}
+
+void StencilThenCoverFillPathCHROMIUM(GLuint path,
+ GLenum fillMode,
+ GLuint mask,
+ GLenum coverMode) {
+ gles2::cmds::StencilThenCoverFillPathCHROMIUM* c =
+ GetCmdSpace<gles2::cmds::StencilThenCoverFillPathCHROMIUM>();
+ if (c) {
+ c->Init(path, fillMode, mask, coverMode);
+ }
+}
+
+void StencilThenCoverStrokePathCHROMIUM(GLuint path,
+ GLint reference,
+ GLuint mask,
+ GLenum coverMode) {
+ gles2::cmds::StencilThenCoverStrokePathCHROMIUM* c =
+ GetCmdSpace<gles2::cmds::StencilThenCoverStrokePathCHROMIUM>();
+ if (c) {
+ c->Init(path, reference, mask, coverMode);
+ }
+}
+
void BlendBarrierKHR() {
gles2::cmds::BlendBarrierKHR* c = GetCmdSpace<gles2::cmds::BlendBarrierKHR>();
if (c) {
@@ -2848,4 +2955,12 @@ void BlendBarrierKHR() {
}
}
+void ApplyScreenSpaceAntialiasingCHROMIUM() {
+ gles2::cmds::ApplyScreenSpaceAntialiasingCHROMIUM* c =
+ GetCmdSpace<gles2::cmds::ApplyScreenSpaceAntialiasingCHROMIUM>();
+ if (c) {
+ c->Init();
+ }
+}
+
#endif // GPU_COMMAND_BUFFER_CLIENT_GLES2_CMD_HELPER_AUTOGEN_H_
diff --git a/chromium/gpu/command_buffer/client/gles2_implementation.cc b/chromium/gpu/command_buffer/client/gles2_implementation.cc
index ae721bde5b8..2b186a4bcb0 100644
--- a/chromium/gpu/command_buffer/client/gles2_implementation.cc
+++ b/chromium/gpu/command_buffer/client/gles2_implementation.cc
@@ -16,6 +16,11 @@
#include <sstream>
#include <string>
#include "base/compiler_specific.h"
+#include "base/strings/stringprintf.h"
+#include "base/thread_task_runner_handle.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"
#include "gpu/command_buffer/client/buffer_tracker.h"
#include "gpu/command_buffer/client/gles2_cmd_helper.h"
#include "gpu/command_buffer/client/gpu_control.h"
@@ -26,6 +31,8 @@
#include "gpu/command_buffer/common/gles2_cmd_utils.h"
#include "gpu/command_buffer/common/id_allocator.h"
#include "gpu/command_buffer/common/trace_event.h"
+#include "ui/gfx/geometry/rect.h"
+#include "ui/gfx/geometry/rect_f.h"
#if defined(GPU_CLIENT_DEBUG)
#include "base/command_line.h"
@@ -98,10 +105,6 @@ GLES2Implementation::GLES2Implementation(
bound_uniform_buffer_(0),
bound_pixel_pack_transfer_buffer_id_(0),
bound_pixel_unpack_transfer_buffer_id_(0),
- async_upload_token_(0),
- async_upload_sync_(NULL),
- async_upload_sync_shm_id_(0),
- async_upload_sync_shm_offset_(0),
error_bits_(0),
debug_(false),
lose_context_when_out_of_memory_(lose_context_when_out_of_memory),
@@ -127,7 +130,9 @@ GLES2Implementation::GLES2Implementation(
});
share_group_ =
- (share_group ? share_group : new ShareGroup(bind_generates_resource));
+ (share_group ? share_group
+ : new ShareGroup(bind_generates_resource,
+ gpu_control_->GetCommandBufferID()));
DCHECK(share_group_->bind_generates_resource() == bind_generates_resource);
memset(&reserved_ids_, 0, sizeof(reserved_ids_));
@@ -153,15 +158,7 @@ bool GLES2Implementation::Initialize(
return false;
}
- mapped_memory_.reset(
- new MappedMemoryManager(
- helper_,
- base::Bind(&GLES2Implementation::PollAsyncUploads,
- // The mapped memory manager is owned by |this| here, and
- // since its destroyed before before we destroy ourselves
- // we don't need extra safety measures for this closure.
- base::Unretained(this)),
- mapped_memory_limit));
+ mapped_memory_.reset(new MappedMemoryManager(helper_, mapped_memory_limit));
unsigned chunk_size = 2 * 1024 * 1024;
if (mapped_memory_limit != kNoLimit) {
@@ -210,10 +207,21 @@ bool GLES2Implementation::Initialize(
return false;
}
+ // In certain cases, ThreadTaskRunnerHandle isn't set (Android Webview).
+ // Don't register a dump provider in these cases.
+ // TODO(ericrk): Get this working in Android Webview. crbug.com/517156
+ if (base::ThreadTaskRunnerHandle::IsSet()) {
+ base::trace_event::MemoryDumpManager::GetInstance()->RegisterDumpProvider(
+ this, base::ThreadTaskRunnerHandle::Get());
+ }
+
return true;
}
GLES2Implementation::~GLES2Implementation() {
+ base::trace_event::MemoryDumpManager::GetInstance()->UnregisterDumpProvider(
+ this);
+
// Make sure the queries are finished otherwise we'll delete the
// shared memory (mapped_memory_) which will free the memory used
// by the queries. The GPU process when validating that memory is still
@@ -236,13 +244,6 @@ GLES2Implementation::~GLES2Implementation() {
buffer_tracker_.reset();
- FreeAllAsyncUploadBuffers();
-
- if (async_upload_sync_) {
- mapped_memory_->Free(async_upload_sync_);
- async_upload_sync_ = NULL;
- }
-
// Make sure the commands make it the service.
WaitForCmd();
}
@@ -255,6 +256,11 @@ IdHandlerInterface* GLES2Implementation::GetIdHandler(int namespace_id) const {
return share_group_->GetIdHandler(namespace_id);
}
+RangeIdHandlerInterface* GLES2Implementation::GetRangeIdHandler(
+ int namespace_id) const {
+ return share_group_->GetRangeIdHandler(namespace_id);
+}
+
IdAllocator* GLES2Implementation::GetIdAllocator(int namespace_id) const {
if (namespace_id == id_namespaces::kQueries)
return query_id_allocator_.get();
@@ -279,7 +285,6 @@ void GLES2Implementation::FreeUnusedSharedMemory() {
}
void GLES2Implementation::FreeEverything() {
- FreeAllAsyncUploadBuffers();
WaitForCmd();
query_tracker_->Shrink();
FreeUnusedSharedMemory();
@@ -338,6 +343,34 @@ void GLES2Implementation::SetAggressivelyFreeResources(
}
}
+bool GLES2Implementation::OnMemoryDump(
+ const base::trace_event::MemoryDumpArgs& args,
+ base::trace_event::ProcessMemoryDump* pmd) {
+ if (!transfer_buffer_->HaveBuffer())
+ return true;
+
+ const uint64 tracing_process_id =
+ base::trace_event::MemoryDumpManager::GetInstance()
+ ->GetTracingProcessId();
+
+ base::trace_event::MemoryAllocatorDump* dump = pmd->CreateAllocatorDump(
+ base::StringPrintf("gpu/transfer_buffer_memory/buffer_%d",
+ transfer_buffer_->GetShmId()));
+ dump->AddScalar(base::trace_event::MemoryAllocatorDump::kNameSize,
+ base::trace_event::MemoryAllocatorDump::kUnitsBytes,
+ transfer_buffer_->GetSize());
+ dump->AddScalar("free_size",
+ base::trace_event::MemoryAllocatorDump::kUnitsBytes,
+ transfer_buffer_->GetFreeSize());
+ auto guid =
+ GetBufferGUIDForTracing(tracing_process_id, transfer_buffer_->GetShmId());
+ const int kImportance = 2;
+ pmd->CreateSharedGlobalAllocatorDump(guid);
+ pmd->AddOwnershipEdge(dump->guid(), guid, kImportance);
+
+ return true;
+}
+
void GLES2Implementation::WaitForCmd() {
TRACE_EVENT0("gpu", "GLES2::WaitForCmd");
helper_->CommandBufferHelper::Finish();
@@ -713,13 +746,15 @@ bool GLES2Implementation::GetHelper(GLenum pname, GLint* params) {
return true;
}
break;
- // TODO(dyen): Also support GL_GPU_DISJOINT_EXT.
case GL_TIMESTAMP_EXT:
// We convert all GPU timestamps to CPU time.
*params = base::saturated_cast<GLint>(
(base::TraceTicks::Now() - base::TraceTicks()).InMicroseconds()
* base::Time::kNanosecondsPerMicrosecond);
return true;
+ case GL_GPU_DISJOINT_EXT:
+ *params = static_cast<GLint>(query_tracker_->CheckAndResetDisjoint());
+ return true;
// Non-cached parameters.
case GL_ALIASED_LINE_WIDTH_RANGE:
@@ -1095,7 +1130,7 @@ bool GLES2Implementation::GetQueryObjectValueHelper(
SetGLError(
GL_INVALID_OPERATION,
function_name,
- "query active. Did you to call glEndQueryEXT?");
+ "query active. Did you call glEndQueryEXT?");
return false;
}
@@ -1914,17 +1949,8 @@ void GLES2Implementation::BufferSubData(
void GLES2Implementation::RemoveTransferBuffer(BufferTracker::Buffer* buffer) {
int32 token = buffer->last_usage_token();
- uint32 async_token = buffer->last_async_upload_token();
- if (async_token) {
- if (HasAsyncUploadTokenPassed(async_token)) {
- buffer_tracker_->Free(buffer);
- } else {
- detached_async_upload_memory_.push_back(
- std::make_pair(buffer->address(), async_token));
- buffer_tracker_->Unmanage(buffer);
- }
- } else if (token) {
+ if (token) {
if (helper_->HasTokenPassed(token))
buffer_tracker_->Free(buffer);
else
@@ -4629,17 +4655,6 @@ void GLES2Implementation::RequestExtensionCHROMIUM(const char* extension) {
}
}
-void GLES2Implementation::RateLimitOffscreenContextCHROMIUM() {
- GPU_CLIENT_SINGLE_THREAD_CHECK();
- GPU_CLIENT_LOG("[" << GetLogPrefix() << "] glRateLimitOffscreenCHROMIUM()");
- // Wait if this would add too many rate limit tokens.
- if (rate_limit_tokens_.size() == kMaxSwapBuffers) {
- helper_->WaitForToken(rate_limit_tokens_.front());
- rate_limit_tokens_.pop();
- }
- rate_limit_tokens_.push(helper_->InsertToken());
-}
-
void GLES2Implementation::GetProgramInfoCHROMIUMHelper(
GLuint program, std::vector<int8>* result) {
DCHECK(result);
@@ -4858,11 +4873,9 @@ void GLES2Implementation::BeginQueryEXT(GLenum target, GLuint id) {
<< GLES2Util::GetStringQueryTarget(target)
<< ", " << id << ")");
- // Check capabilities
switch (target) {
case GL_COMMANDS_ISSUED_CHROMIUM:
case GL_LATENCY_QUERY_CHROMIUM:
- case GL_ASYNC_PIXEL_UNPACK_COMPLETED_CHROMIUM:
case GL_ASYNC_PIXEL_PACK_COMPLETED_CHROMIUM:
case GL_GET_ERROR_QUERY_CHROMIUM:
break;
@@ -4883,7 +4896,6 @@ void GLES2Implementation::BeginQueryEXT(GLenum target, GLuint id) {
return;
}
break;
- // TODO(dyen): Also support GL_TIMESTAMP.
case GL_TIME_ELAPSED_EXT:
if (!capabilities_.timer_queries) {
SetGLError(
@@ -4892,9 +4904,13 @@ void GLES2Implementation::BeginQueryEXT(GLenum target, GLuint id) {
return;
}
break;
+ case GL_TRANSFORM_FEEDBACK_PRIMITIVES_WRITTEN:
+ if (capabilities_.major_version >= 3)
+ break;
+ // Fall through
default:
SetGLError(
- GL_INVALID_OPERATION, "glBeginQueryEXT", "unknown query target");
+ GL_INVALID_ENUM, "glBeginQueryEXT", "unknown query target");
return;
}
@@ -4905,18 +4921,30 @@ void GLES2Implementation::BeginQueryEXT(GLenum target, GLuint id) {
return;
}
- // id = 0 INV_OP
if (id == 0) {
SetGLError(GL_INVALID_OPERATION, "glBeginQueryEXT", "id is 0");
return;
}
- // if not GENned INV_OPERATION
if (!query_id_allocator_->InUse(id)) {
SetGLError(GL_INVALID_OPERATION, "glBeginQueryEXT", "invalid id");
return;
}
+ // Extra setups some targets might need.
+ switch (target) {
+ case GL_TIME_ELAPSED_EXT:
+ if (!query_tracker_->SetDisjointSync(this)) {
+ SetGLError(GL_OUT_OF_MEMORY,
+ "glBeginQueryEXT",
+ "buffer allocation failed");
+ return;
+ }
+ break;
+ default:
+ break;
+ }
+
if (query_tracker_->BeginQuery(id, target, this))
CheckGLError();
}
@@ -4934,6 +4962,55 @@ void GLES2Implementation::EndQueryEXT(GLenum target) {
CheckGLError();
}
+void GLES2Implementation::QueryCounterEXT(GLuint id, GLenum target) {
+ GPU_CLIENT_SINGLE_THREAD_CHECK();
+ GPU_CLIENT_LOG("[" << GetLogPrefix() << "] QueryCounterEXT("
+ << id
+ << ", " << GLES2Util::GetStringQueryTarget(target) << ")");
+
+ switch (target) {
+ case GL_TIMESTAMP_EXT:
+ if (!capabilities_.timer_queries) {
+ SetGLError(
+ GL_INVALID_OPERATION, "glQueryCounterEXT",
+ "not enabled for timing queries");
+ return;
+ }
+ break;
+ default:
+ SetGLError(
+ GL_INVALID_ENUM, "glQueryCounterEXT", "unknown query target");
+ return;
+ }
+
+ if (id == 0) {
+ SetGLError(GL_INVALID_OPERATION, "glQueryCounterEXT", "id is 0");
+ return;
+ }
+
+ if (!query_id_allocator_->InUse(id)) {
+ SetGLError(GL_INVALID_OPERATION, "glQueryCounterEXT", "invalid id");
+ return;
+ }
+
+ // Extra setups some targets might need.
+ switch (target) {
+ case GL_TIMESTAMP_EXT:
+ if (!query_tracker_->SetDisjointSync(this)) {
+ SetGLError(GL_OUT_OF_MEMORY,
+ "glQueryCounterEXT",
+ "buffer allocation failed");
+ return;
+ }
+ break;
+ default:
+ break;
+ }
+
+ if (query_tracker_->QueryCounter(id, target, this))
+ CheckGLError();
+}
+
void GLES2Implementation::GetQueryivEXT(
GLenum target, GLenum pname, GLint* params) {
GPU_CLIENT_SINGLE_THREAD_CHECK();
@@ -4955,20 +5032,38 @@ void GLES2Implementation::GetQueryivEXT(
CheckGLError();
}
+void GLES2Implementation::GetQueryObjectivEXT(
+ GLuint id, GLenum pname, GLint* params) {
+ GLuint64 result = 0;
+ if (GetQueryObjectValueHelper("glGetQueryObjectivEXT", id, pname, &result))
+ *params = base::saturated_cast<GLint>(result);
+}
+
void GLES2Implementation::GetQueryObjectuivEXT(
GLuint id, GLenum pname, GLuint* params) {
GLuint64 result = 0;
- if (GetQueryObjectValueHelper("glQueryObjectuivEXT", id, pname, &result))
+ if (GetQueryObjectValueHelper("glGetQueryObjectuivEXT", id, pname, &result))
*params = base::saturated_cast<GLuint>(result);
}
+void GLES2Implementation::GetQueryObjecti64vEXT(
+ GLuint id, GLenum pname, GLint64* params) {
+ GLuint64 result = 0;
+ if (GetQueryObjectValueHelper("glGetQueryObjectiv64vEXT", id, pname, &result))
+ *params = base::saturated_cast<GLint64>(result);
+}
+
void GLES2Implementation::GetQueryObjectui64vEXT(
GLuint id, GLenum pname, GLuint64* params) {
GLuint64 result = 0;
- if (GetQueryObjectValueHelper("glQueryObjectui64vEXT", id, pname, &result))
+ if (GetQueryObjectValueHelper("glGetQueryObjectui64vEXT", id, pname, &result))
*params = result;
}
+void GLES2Implementation::SetDisjointValueSyncCHROMIUM() {
+ query_tracker_->SetDisjointSync(this);
+}
+
void GLES2Implementation::DrawArraysInstancedANGLE(
GLenum mode, GLint first, GLsizei count, GLsizei primcount) {
GPU_CLIENT_SINGLE_THREAD_CHECK();
@@ -5186,12 +5281,6 @@ void* GLES2Implementation::MapBufferCHROMIUM(GLuint target, GLenum access) {
return NULL;
}
break;
- case GL_PIXEL_UNPACK_TRANSFER_BUFFER_CHROMIUM:
- if (access != GL_WRITE_ONLY) {
- SetGLError(GL_INVALID_ENUM, "glMapBufferCHROMIUM", "bad access mode");
- return NULL;
- }
- break;
default:
SetGLError(
GL_INVALID_ENUM, "glMapBufferCHROMIUM", "invalid target");
@@ -5212,10 +5301,6 @@ void* GLES2Implementation::MapBufferCHROMIUM(GLuint target, GLenum access) {
return NULL;
}
// Here we wait for previous transfer operations to be finished.
- // TODO(hubbe): AsyncTex(Sub)Image2dCHROMIUM does not currently work
- // with this method of synchronization. Until this is fixed,
- // MapBufferCHROMIUM will not block even if the transfer is not ready
- // for these calls.
if (buffer->last_usage_token()) {
helper_->WaitForToken(buffer->last_usage_token());
buffer->set_last_usage_token(0);
@@ -5252,207 +5337,6 @@ GLboolean GLES2Implementation::UnmapBufferCHROMIUM(GLuint target) {
return true;
}
-bool GLES2Implementation::EnsureAsyncUploadSync() {
- if (async_upload_sync_)
- return true;
-
- int32 shm_id;
- unsigned int shm_offset;
- void* mem = mapped_memory_->Alloc(sizeof(AsyncUploadSync),
- &shm_id,
- &shm_offset);
- if (!mem)
- return false;
-
- async_upload_sync_shm_id_ = shm_id;
- async_upload_sync_shm_offset_ = shm_offset;
- async_upload_sync_ = static_cast<AsyncUploadSync*>(mem);
- async_upload_sync_->Reset();
-
- return true;
-}
-
-uint32 GLES2Implementation::NextAsyncUploadToken() {
- async_upload_token_++;
- if (async_upload_token_ == 0)
- async_upload_token_++;
- return async_upload_token_;
-}
-
-void GLES2Implementation::PollAsyncUploads() {
- if (!async_upload_sync_)
- return;
-
- if (helper_->IsContextLost()) {
- DetachedAsyncUploadMemoryList::iterator it =
- detached_async_upload_memory_.begin();
- while (it != detached_async_upload_memory_.end()) {
- mapped_memory_->Free(it->first);
- it = detached_async_upload_memory_.erase(it);
- }
- return;
- }
-
- DetachedAsyncUploadMemoryList::iterator it =
- detached_async_upload_memory_.begin();
- while (it != detached_async_upload_memory_.end()) {
- if (HasAsyncUploadTokenPassed(it->second)) {
- mapped_memory_->Free(it->first);
- it = detached_async_upload_memory_.erase(it);
- } else {
- break;
- }
- }
-}
-
-void GLES2Implementation::FreeAllAsyncUploadBuffers() {
- // Free all completed unmanaged async uploads buffers.
- PollAsyncUploads();
-
- // Synchronously free rest of the unmanaged async upload buffers.
- if (!detached_async_upload_memory_.empty()) {
- WaitAllAsyncTexImage2DCHROMIUMHelper();
- WaitForCmd();
- PollAsyncUploads();
- }
-}
-
-void GLES2Implementation::AsyncTexImage2DCHROMIUM(
- GLenum target, GLint level, GLenum internalformat, GLsizei width,
- GLsizei height, GLint border, GLenum format, GLenum type,
- const void* pixels) {
- GPU_CLIENT_SINGLE_THREAD_CHECK();
- GPU_CLIENT_LOG("[" << GetLogPrefix() << "] glTexImage2D("
- << GLES2Util::GetStringTextureTarget(target) << ", "
- << level << ", "
- << GLES2Util::GetStringTextureInternalFormat(internalformat) << ", "
- << width << ", " << height << ", " << border << ", "
- << GLES2Util::GetStringTextureFormat(format) << ", "
- << GLES2Util::GetStringPixelType(type) << ", "
- << static_cast<const void*>(pixels) << ")");
- if (level < 0 || height < 0 || width < 0) {
- SetGLError(GL_INVALID_VALUE, "glTexImage2D", "dimension < 0");
- return;
- }
- if (border != 0) {
- SetGLError(GL_INVALID_VALUE, "glTexImage2D", "border != 0");
- return;
- }
- uint32 size;
- uint32 unpadded_row_size;
- uint32 padded_row_size;
- if (!GLES2Util::ComputeImageDataSizes(
- width, height, 1, format, type, unpack_alignment_, &size,
- &unpadded_row_size, &padded_row_size)) {
- SetGLError(GL_INVALID_VALUE, "glTexImage2D", "image size too large");
- return;
- }
-
- // If there's no data/buffer just issue the AsyncTexImage2D
- if (!pixels && !bound_pixel_unpack_transfer_buffer_id_) {
- helper_->AsyncTexImage2DCHROMIUM(
- target, level, internalformat, width, height, format, type,
- 0, 0, 0, 0, 0);
- return;
- }
-
- if (!EnsureAsyncUploadSync()) {
- SetGLError(GL_OUT_OF_MEMORY, "glTexImage2D", "out of memory");
- return;
- }
-
- // Otherwise, async uploads require a transfer buffer to be bound.
- // TODO(hubbe): Make MapBufferCHROMIUM block if someone tries to re-use
- // the buffer before the transfer is finished. (Currently such
- // synchronization has to be handled manually.)
- GLuint offset = ToGLuint(pixels);
- BufferTracker::Buffer* buffer = GetBoundPixelUnpackTransferBufferIfValid(
- bound_pixel_unpack_transfer_buffer_id_,
- "glAsyncTexImage2DCHROMIUM", offset, size);
- if (buffer && buffer->shm_id() != -1) {
- uint32 async_token = NextAsyncUploadToken();
- buffer->set_last_async_upload_token(async_token);
- helper_->AsyncTexImage2DCHROMIUM(
- target, level, internalformat, width, height, format, type,
- buffer->shm_id(), buffer->shm_offset() + offset,
- async_token,
- async_upload_sync_shm_id_, async_upload_sync_shm_offset_);
- }
-}
-
-void GLES2Implementation::AsyncTexSubImage2DCHROMIUM(
- GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width,
- GLsizei height, GLenum format, GLenum type, const void* pixels) {
- GPU_CLIENT_SINGLE_THREAD_CHECK();
- GPU_CLIENT_LOG("[" << GetLogPrefix() << "] glAsyncTexSubImage2DCHROMIUM("
- << GLES2Util::GetStringTextureTarget(target) << ", "
- << level << ", "
- << xoffset << ", " << yoffset << ", "
- << width << ", " << height << ", "
- << GLES2Util::GetStringTextureFormat(format) << ", "
- << GLES2Util::GetStringPixelType(type) << ", "
- << static_cast<const void*>(pixels) << ")");
- if (level < 0 || height < 0 || width < 0) {
- SetGLError(
- GL_INVALID_VALUE, "glAsyncTexSubImage2DCHROMIUM", "dimension < 0");
- return;
- }
-
- uint32 size;
- uint32 unpadded_row_size;
- uint32 padded_row_size;
- if (!GLES2Util::ComputeImageDataSizes(
- width, height, 1, format, type, unpack_alignment_, &size,
- &unpadded_row_size, &padded_row_size)) {
- SetGLError(
- GL_INVALID_VALUE, "glAsyncTexSubImage2DCHROMIUM", "size to large");
- return;
- }
-
- if (!EnsureAsyncUploadSync()) {
- SetGLError(GL_OUT_OF_MEMORY, "glTexImage2D", "out of memory");
- return;
- }
-
- // Async uploads require a transfer buffer to be bound.
- // TODO(hubbe): Make MapBufferCHROMIUM block if someone tries to re-use
- // the buffer before the transfer is finished. (Currently such
- // synchronization has to be handled manually.)
- GLuint offset = ToGLuint(pixels);
- BufferTracker::Buffer* buffer = GetBoundPixelUnpackTransferBufferIfValid(
- bound_pixel_unpack_transfer_buffer_id_,
- "glAsyncTexSubImage2DCHROMIUM", offset, size);
- if (buffer && buffer->shm_id() != -1) {
- uint32 async_token = NextAsyncUploadToken();
- buffer->set_last_async_upload_token(async_token);
- helper_->AsyncTexSubImage2DCHROMIUM(
- target, level, xoffset, yoffset, width, height, format, type,
- buffer->shm_id(), buffer->shm_offset() + offset,
- async_token,
- async_upload_sync_shm_id_, async_upload_sync_shm_offset_);
- }
-}
-
-void GLES2Implementation::WaitAsyncTexImage2DCHROMIUM(GLenum target) {
- GPU_CLIENT_SINGLE_THREAD_CHECK();
- GPU_CLIENT_LOG("[" << GetLogPrefix() << "] glWaitAsyncTexImage2DCHROMIUM("
- << GLES2Util::GetStringTextureTarget(target) << ")");
- helper_->WaitAsyncTexImage2DCHROMIUM(target);
- CheckGLError();
-}
-
-void GLES2Implementation::WaitAllAsyncTexImage2DCHROMIUMHelper() {
- helper_->WaitAllAsyncTexImage2DCHROMIUM();
-}
-
-void GLES2Implementation::WaitAllAsyncTexImage2DCHROMIUM() {
- GPU_CLIENT_SINGLE_THREAD_CHECK();
- GPU_CLIENT_LOG("[" << GetLogPrefix()
- << "] glWaitAllAsyncTexImage2DCHROMIUM()");
- WaitAllAsyncTexImage2DCHROMIUMHelper();
- CheckGLError();
-}
-
GLuint GLES2Implementation::InsertSyncPointCHROMIUM() {
GPU_CLIENT_SINGLE_THREAD_CHECK();
GPU_CLIENT_LOG("[" << GetLogPrefix() << "] glInsertSyncPointCHROMIUM");
@@ -5476,6 +5360,10 @@ void GLES2Implementation::RetireSyncPointCHROMIUM(GLuint sync_point) {
gpu_control_->RetireSyncPoint(sync_point);
}
+uint64_t GLES2Implementation::ShareGroupTracingGUID() const {
+ return share_group_->TracingGUID();
+}
+
namespace {
bool ValidImageFormat(GLenum internalformat,
@@ -5493,6 +5381,7 @@ bool ValidImageFormat(GLenum internalformat,
case GL_R8:
case GL_RGB:
case GL_RGBA:
+ case GL_RGB_YCBCR_422_CHROMIUM:
case GL_BGRA_EXT:
return true;
default:
@@ -5835,6 +5724,164 @@ void GLES2Implementation::GetInternalformativ(
CheckGLError();
}
+GLuint GLES2Implementation::GenPathsCHROMIUM(GLsizei range) {
+ GPU_CLIENT_LOG("[" << GetLogPrefix() << "] glGenPathsCHROMIUM(" << range
+ << ")");
+ GPU_CLIENT_SINGLE_THREAD_CHECK();
+ static const char kFunctionName[] = "glGenPathsCHROMIUM";
+ if (range < 0) {
+ SetGLError(GL_INVALID_VALUE, kFunctionName, "range < 0");
+ return 0;
+ }
+ if (!base::IsValueInRangeForNumericType<int32_t>(range)) {
+ SetGLError(GL_INVALID_OPERATION, kFunctionName, "range more than 32-bit");
+ return 0;
+ }
+ if (range == 0)
+ return 0;
+
+ GLuint first_client_id = 0;
+ GetRangeIdHandler(id_namespaces::kPaths)
+ ->MakeIdRange(this, range, &first_client_id);
+
+ if (first_client_id == 0) {
+ // Ran out of id space. Is not specified to raise any gl errors.
+ return 0;
+ }
+
+ helper_->GenPathsCHROMIUM(first_client_id, range);
+
+ GPU_CLIENT_LOG_CODE_BLOCK({
+ for (GLsizei i = 0; i < range; ++i) {
+ GPU_CLIENT_LOG(" " << i << ": " << (first_client_id + i));
+ }
+ });
+ CheckGLError();
+ return first_client_id;
+}
+
+void GLES2Implementation::DeletePathsCHROMIUM(GLuint first_client_id,
+ GLsizei range) {
+ GPU_CLIENT_SINGLE_THREAD_CHECK();
+ GPU_CLIENT_LOG("[" << GetLogPrefix() << "] glDeletePathsCHROMIUM("
+ << first_client_id << ", " << range << ")");
+ static const char kFunctionName[] = "glDeletePathsCHROMIUM";
+
+ if (range < 0) {
+ SetGLError(GL_INVALID_VALUE, kFunctionName, "range < 0");
+ return;
+ }
+ if (!base::IsValueInRangeForNumericType<int32_t>(range)) {
+ SetGLError(GL_INVALID_OPERATION, kFunctionName, "range more than 32-bit");
+ return;
+ }
+ if (range == 0)
+ return;
+
+ GLuint last_client_id;
+ if (!SafeAddUint32(first_client_id, range - 1, &last_client_id)) {
+ SetGLError(GL_INVALID_OPERATION, kFunctionName, "overflow");
+ return;
+ }
+
+ GetRangeIdHandler(id_namespaces::kPaths)
+ ->FreeIdRange(this, first_client_id, range,
+ &GLES2Implementation::DeletePathsCHROMIUMStub);
+ CheckGLError();
+}
+
+void GLES2Implementation::DeletePathsCHROMIUMStub(GLuint first_client_id,
+ GLsizei range) {
+ helper_->DeletePathsCHROMIUM(first_client_id, range);
+}
+
+void GLES2Implementation::PathCommandsCHROMIUM(GLuint path,
+ GLsizei num_commands,
+ const GLubyte* commands,
+ GLsizei num_coords,
+ GLenum coord_type,
+ const void* coords) {
+ GPU_CLIENT_SINGLE_THREAD_CHECK();
+ GPU_CLIENT_LOG("[" << GetLogPrefix() << "] glPathCommandsCHROMIUM(" << path
+ << ", " << num_commands << ", " << commands << ", "
+ << num_coords << ", " << coords << ")");
+ static const char kFunctionName[] = "glPathCommandsCHROMIUM";
+ if (path == 0) {
+ SetGLError(GL_INVALID_VALUE, kFunctionName, "invalid path object");
+ return;
+ }
+ if (num_commands < 0) {
+ SetGLError(GL_INVALID_VALUE, kFunctionName, "numCommands < 0");
+ return;
+ }
+ if (num_commands != 0 && !commands) {
+ SetGLError(GL_INVALID_VALUE, kFunctionName, "missing commands");
+ return;
+ }
+ if (num_coords < 0) {
+ SetGLError(GL_INVALID_VALUE, kFunctionName, "numCoords < 0");
+ return;
+ }
+ if (num_coords != 0 && !coords) {
+ SetGLError(GL_INVALID_VALUE, kFunctionName, "missing coords");
+ return;
+ }
+ uint32 coord_type_size = GLES2Util::GetGLTypeSizeForPathCoordType(coord_type);
+ if (coord_type_size == 0) {
+ SetGLError(GL_INVALID_ENUM, kFunctionName, "invalid coordType");
+ return;
+ }
+ if (num_commands == 0) {
+ // No commands must mean no coords, thus nothing to memcpy. Let
+ // the service validate the call. Validate coord_type above, so
+ // that the parameters will be checked the in the same order
+ // regardless of num_commands.
+ helper_->PathCommandsCHROMIUM(path, num_commands, 0, 0, num_coords,
+ coord_type, 0, 0);
+ CheckGLError();
+ return;
+ }
+
+ uint32 coords_size;
+ if (!SafeMultiplyUint32(num_coords, coord_type_size, &coords_size)) {
+ SetGLError(GL_INVALID_OPERATION, kFunctionName, "overflow");
+ return;
+ }
+
+ uint32 required_buffer_size;
+ if (!SafeAddUint32(coords_size, num_commands, &required_buffer_size)) {
+ SetGLError(GL_INVALID_OPERATION, kFunctionName, "overflow");
+ return;
+ }
+
+ ScopedTransferBufferPtr buffer(required_buffer_size, helper_,
+ transfer_buffer_);
+ if (!buffer.valid() || buffer.size() < required_buffer_size) {
+ SetGLError(GL_OUT_OF_MEMORY, kFunctionName, "too large");
+ return;
+ }
+
+ uint32 coords_shm_id = 0;
+ uint32 coords_shm_offset = 0;
+ // Copy coords first because they need more strict alignment.
+ if (coords_size > 0) {
+ unsigned char* coords_addr = static_cast<unsigned char*>(buffer.address());
+ memcpy(coords_addr, coords, coords_size);
+ coords_shm_id = buffer.shm_id();
+ coords_shm_offset = buffer.offset();
+ }
+
+ DCHECK(num_commands > 0);
+ unsigned char* commands_addr =
+ static_cast<unsigned char*>(buffer.address()) + coords_size;
+ memcpy(commands_addr, commands, num_commands);
+
+ helper_->PathCommandsCHROMIUM(path, num_commands, buffer.shm_id(),
+ buffer.offset() + coords_size, num_coords,
+ coord_type, coords_shm_id, coords_shm_offset);
+ CheckGLError();
+}
+
// Include the auto-generated part of this file. We split this because it means
// we can easily edit the non-auto generated parts right here in this file
// instead of having to edit some template or the code generator.
diff --git a/chromium/gpu/command_buffer/client/gles2_implementation.h b/chromium/gpu/command_buffer/client/gles2_implementation.h
index 5c5e93f9920..7f036db908c 100644
--- a/chromium/gpu/command_buffer/client/gles2_implementation.h
+++ b/chromium/gpu/command_buffer/client/gles2_implementation.h
@@ -18,6 +18,7 @@
#include "base/macros.h"
#include "base/memory/scoped_ptr.h"
#include "base/memory/weak_ptr.h"
+#include "base/trace_event/memory_dump_provider.h"
#include "gpu/command_buffer/client/buffer_tracker.h"
#include "gpu/command_buffer/client/client_context_state.h"
#include "gpu/command_buffer/client/context_support.h"
@@ -122,7 +123,8 @@ class GLES2ImplementationErrorMessageCallback {
// shared memory and synchronization issues.
class GLES2_IMPL_EXPORT GLES2Implementation
: NON_EXPORTED_BASE(public GLES2Interface),
- NON_EXPORTED_BASE(public ContextSupport) {
+ NON_EXPORTED_BASE(public ContextSupport),
+ NON_EXPORTED_BASE(public base::trace_event::MemoryDumpProvider) {
public:
enum MappedMemoryLimit {
kNoLimit = MappedMemoryManager::kNoLimit,
@@ -207,6 +209,7 @@ class GLES2_IMPL_EXPORT GLES2Implementation
const gfx::RectF& uv_rect) override;
GLuint InsertFutureSyncPointCHROMIUM() override;
void RetireSyncPointCHROMIUM(GLuint sync_point) override;
+ uint64_t ShareGroupTracingGUID() const override;
void GetProgramInfoCHROMIUMHelper(GLuint program, std::vector<int8>* result);
GLint GetAttribLocationHelper(GLuint program, const char* name);
@@ -254,6 +257,10 @@ class GLES2_IMPL_EXPORT GLES2Implementation
void SetSurfaceVisible(bool visible) override;
void SetAggressivelyFreeResources(bool aggressively_free_resources) override;
+ // base::trace_event::MemoryDumpProvider implementation.
+ bool OnMemoryDump(const base::trace_event::MemoryDumpArgs& args,
+ base::trace_event::ProcessMemoryDump* pmd) override;
+
void SetErrorMessageCallback(
GLES2ImplementationErrorMessageCallback* callback) {
error_message_callback_ = callback;
@@ -510,6 +517,7 @@ class GLES2_IMPL_EXPORT GLES2Implementation
void DeleteFramebuffersStub(GLsizei n, const GLuint* framebuffers);
void DeleteRenderbuffersStub(GLsizei n, const GLuint* renderbuffers);
void DeleteTexturesStub(GLsizei n, const GLuint* textures);
+ void DeletePathsCHROMIUMStub(GLuint first_client_id, GLsizei range);
void DeleteProgramStub(GLsizei n, const GLuint* programs);
void DeleteShaderStub(GLsizei n, const GLuint* shaders);
void DeleteVertexArraysOESStub(GLsizei n, const GLuint* arrays);
@@ -566,6 +574,8 @@ class GLES2_IMPL_EXPORT GLES2Implementation
bool GetHelper(GLenum pname, GLint* params);
GLuint GetBoundBufferHelper(GLenum target);
bool GetBooleanvHelper(GLenum pname, GLboolean* params);
+ bool GetBufferParameteri64vHelper(
+ GLenum target, GLenum pname, GLint64* params);
bool GetBufferParameterivHelper(GLenum target, GLenum pname, GLint* params);
bool GetFloatvHelper(GLenum pname, GLfloat* params);
bool GetFramebufferAttachmentParameterivHelper(
@@ -595,6 +605,7 @@ class GLES2_IMPL_EXPORT GLES2Implementation
bool SetCapabilityState(GLenum cap, bool enabled);
IdHandlerInterface* GetIdHandler(int id_namespace) const;
+ RangeIdHandlerInterface* GetRangeIdHandler(int id_namespace) const;
// IdAllocators for objects that can't be shared among contexts.
// For now, used only for Queries. TODO(hj.r.chung) Should be added for
// Framebuffer and Vertex array objects.
@@ -619,32 +630,6 @@ class GLES2_IMPL_EXPORT GLES2Implementation
// a token.
void RemoveTransferBuffer(BufferTracker::Buffer* buffer);
- // Returns true if the async upload token has passed.
- //
- // NOTE: This will detect wrapped async tokens by checking if the most
- // significant bit of async token to check is 1 but the last read is 0, i.e.
- // the uint32 wrapped.
- bool HasAsyncUploadTokenPassed(uint32 token) const {
- return async_upload_sync_->HasAsyncUploadTokenPassed(token);
- }
-
- // Get the next async upload token.
- uint32 NextAsyncUploadToken();
-
- // Ensure that the shared memory used for synchronizing async upload tokens
- // has been mapped.
- //
- // Returns false on error, true on success.
- bool EnsureAsyncUploadSync();
-
- // Checks the last read asynchronously upload token and frees any unmanaged
- // transfer buffer that has its async token passed.
- void PollAsyncUploads();
-
- // Free every async upload buffer. If some async upload buffer is still in use
- // wait for them to finish before freeing.
- void FreeAllAsyncUploadBuffers();
-
bool GetBoundPixelTransferBuffer(
GLenum target, const char* function_name, GLuint* buffer_id);
BufferTracker::Buffer* GetBoundPixelUnpackTransferBufferIfValid(
@@ -740,18 +725,6 @@ class GLES2_IMPL_EXPORT GLES2Implementation
GLuint bound_pixel_pack_transfer_buffer_id_;
GLuint bound_pixel_unpack_transfer_buffer_id_;
- // The current asynchronous pixel buffer upload token.
- uint32 async_upload_token_;
-
- // The shared memory used for synchronizing asynchronous upload tokens.
- AsyncUploadSync* async_upload_sync_;
- int32 async_upload_sync_shm_id_;
- unsigned int async_upload_sync_shm_offset_;
-
- // Unmanaged pixel transfer buffer memory pending asynchronous upload token.
- typedef std::list<std::pair<void*, uint32> > DetachedAsyncUploadMemoryList;
- DetachedAsyncUploadMemoryList detached_async_upload_memory_;
-
// Client side management for vertex array objects. Needed to correctly
// track client side arrays.
scoped_ptr<VertexArrayObjectManager> vertex_array_object_manager_;
@@ -819,6 +792,11 @@ class GLES2_IMPL_EXPORT GLES2Implementation
DISALLOW_COPY_AND_ASSIGN(GLES2Implementation);
};
+inline bool GLES2Implementation::GetBufferParameteri64vHelper(
+ GLenum /* target */, GLenum /* pname */, GLint64* /* params */) {
+ return false;
+}
+
inline bool GLES2Implementation::GetBufferParameterivHelper(
GLenum /* target */, GLenum /* pname */, GLint* /* params */) {
return false;
diff --git a/chromium/gpu/command_buffer/client/gles2_implementation_autogen.h b/chromium/gpu/command_buffer/client/gles2_implementation_autogen.h
index 7e49ceb990f..305f971fdf1 100644
--- a/chromium/gpu/command_buffer/client/gles2_implementation_autogen.h
+++ b/chromium/gpu/command_buffer/client/gles2_implementation_autogen.h
@@ -312,6 +312,10 @@ GLint GetAttribLocation(GLuint program, const char* name) override;
void GetBooleanv(GLenum pname, GLboolean* params) override;
+void GetBufferParameteri64v(GLenum target,
+ GLenum pname,
+ GLint64* params) override;
+
void GetBufferParameteriv(GLenum target, GLenum pname, GLint* params) override;
GLenum GetError() override;
@@ -789,6 +793,8 @@ void GenQueriesEXT(GLsizei n, GLuint* queries) override;
void DeleteQueriesEXT(GLsizei n, const GLuint* queries) override;
+void QueryCounterEXT(GLuint id, GLenum target) override;
+
GLboolean IsQueryEXT(GLuint id) override;
void BeginQueryEXT(GLenum target, GLuint id) override;
@@ -801,10 +807,16 @@ void EndTransformFeedback() override;
void GetQueryivEXT(GLenum target, GLenum pname, GLint* params) override;
+void GetQueryObjectivEXT(GLuint id, GLenum pname, GLint* params) override;
+
void GetQueryObjectuivEXT(GLuint id, GLenum pname, GLuint* params) override;
+void GetQueryObjecti64vEXT(GLuint id, GLenum pname, GLint64* params) override;
+
void GetQueryObjectui64vEXT(GLuint id, GLenum pname, GLuint64* params) override;
+void SetDisjointValueSyncCHROMIUM() override;
+
void InsertEventMarkerEXT(GLsizei length, const GLchar* marker) override;
void PushGroupMarkerEXT(GLsizei length, const GLchar* marker) override;
@@ -864,8 +876,6 @@ const GLchar* GetRequestableExtensionsCHROMIUM() override;
void RequestExtensionCHROMIUM(const char* extension) override;
-void RateLimitOffscreenContextCHROMIUM() override;
-
void GetProgramInfoCHROMIUM(GLuint program,
GLsizei bufsize,
GLsizei* size,
@@ -942,6 +952,16 @@ void CompressedCopyTextureCHROMIUM(GLenum target,
GLenum source_id,
GLenum dest_id) override;
+void CompressedCopySubTextureCHROMIUM(GLenum target,
+ GLenum source_id,
+ GLenum dest_id,
+ GLint xoffset,
+ GLint yoffset,
+ GLint x,
+ GLint y,
+ GLsizei width,
+ GLsizei height) override;
+
void DrawArraysInstancedANGLE(GLenum mode,
GLint first,
GLsizei count,
@@ -997,30 +1017,6 @@ void TraceBeginCHROMIUM(const char* category_name,
void TraceEndCHROMIUM() override;
-void AsyncTexSubImage2DCHROMIUM(GLenum target,
- GLint level,
- GLint xoffset,
- GLint yoffset,
- GLsizei width,
- GLsizei height,
- GLenum format,
- GLenum type,
- const void* data) override;
-
-void AsyncTexImage2DCHROMIUM(GLenum target,
- GLint level,
- GLenum internalformat,
- GLsizei width,
- GLsizei height,
- GLint border,
- GLenum format,
- GLenum type,
- const void* pixels) override;
-
-void WaitAsyncTexImage2DCHROMIUM(GLenum target) override;
-
-void WaitAllAsyncTexImage2DCHROMIUM() override;
-
void DiscardFramebufferEXT(GLenum target,
GLsizei count,
const GLenum* attachments) override;
@@ -1055,8 +1051,51 @@ void MatrixLoadfCHROMIUM(GLenum matrixMode, const GLfloat* m) override;
void MatrixLoadIdentityCHROMIUM(GLenum matrixMode) override;
+GLuint GenPathsCHROMIUM(GLsizei range) override;
+
+void DeletePathsCHROMIUM(GLuint path, GLsizei range) override;
+
+GLboolean IsPathCHROMIUM(GLuint path) override;
+
+void PathCommandsCHROMIUM(GLuint path,
+ GLsizei numCommands,
+ const GLubyte* commands,
+ GLsizei numCoords,
+ GLenum coordType,
+ const GLvoid* coords) override;
+
+void PathParameterfCHROMIUM(GLuint path, GLenum pname, GLfloat value) override;
+
+void PathParameteriCHROMIUM(GLuint path, GLenum pname, GLint value) override;
+
+void PathStencilFuncCHROMIUM(GLenum func, GLint ref, GLuint mask) override;
+
+void StencilFillPathCHROMIUM(GLuint path,
+ GLenum fillMode,
+ GLuint mask) override;
+
+void StencilStrokePathCHROMIUM(GLuint path,
+ GLint reference,
+ GLuint mask) override;
+
+void CoverFillPathCHROMIUM(GLuint path, GLenum coverMode) override;
+
+void CoverStrokePathCHROMIUM(GLuint path, GLenum coverMode) override;
+
+void StencilThenCoverFillPathCHROMIUM(GLuint path,
+ GLenum fillMode,
+ GLuint mask,
+ GLenum coverMode) override;
+
+void StencilThenCoverStrokePathCHROMIUM(GLuint path,
+ GLint reference,
+ GLuint mask,
+ GLenum coverMode) override;
+
GLenum GetGraphicsResetStatusKHR() override;
void BlendBarrierKHR() override;
+void ApplyScreenSpaceAntialiasingCHROMIUM() override;
+
#endif // GPU_COMMAND_BUFFER_CLIENT_GLES2_IMPLEMENTATION_AUTOGEN_H_
diff --git a/chromium/gpu/command_buffer/client/gles2_implementation_impl_autogen.h b/chromium/gpu/command_buffer/client/gles2_implementation_impl_autogen.h
index 6f776ffbc4d..9f8bfba251a 100644
--- a/chromium/gpu/command_buffer/client/gles2_implementation_impl_autogen.h
+++ b/chromium/gpu/command_buffer/client/gles2_implementation_impl_autogen.h
@@ -693,11 +693,12 @@ void GLES2Implementation::FramebufferRenderbuffer(GLenum target,
GLenum renderbuffertarget,
GLuint renderbuffer) {
GPU_CLIENT_SINGLE_THREAD_CHECK();
- GPU_CLIENT_LOG("[" << GetLogPrefix() << "] glFramebufferRenderbuffer("
- << GLES2Util::GetStringFrameBufferTarget(target) << ", "
- << GLES2Util::GetStringAttachment(attachment) << ", "
- << GLES2Util::GetStringRenderBufferTarget(
- renderbuffertarget) << ", " << renderbuffer << ")");
+ GPU_CLIENT_LOG(
+ "[" << GetLogPrefix() << "] glFramebufferRenderbuffer("
+ << GLES2Util::GetStringFrameBufferTarget(target) << ", "
+ << GLES2Util::GetStringAttachment(attachment) << ", "
+ << GLES2Util::GetStringRenderBufferTarget(renderbuffertarget) << ", "
+ << renderbuffer << ")");
helper_->FramebufferRenderbuffer(target, attachment, renderbuffertarget,
renderbuffer);
CheckGLError();
@@ -906,6 +907,35 @@ void GLES2Implementation::GetBooleanv(GLenum pname, GLboolean* params) {
});
CheckGLError();
}
+void GLES2Implementation::GetBufferParameteri64v(GLenum target,
+ GLenum pname,
+ GLint64* params) {
+ GPU_CLIENT_SINGLE_THREAD_CHECK();
+ GPU_CLIENT_LOG("[" << GetLogPrefix() << "] glGetBufferParameteri64v("
+ << GLES2Util::GetStringBufferTarget(target) << ", "
+ << GLES2Util::GetStringBufferParameter64(pname) << ", "
+ << static_cast<const void*>(params) << ")");
+ TRACE_EVENT0("gpu", "GLES2Implementation::GetBufferParameteri64v");
+ if (GetBufferParameteri64vHelper(target, pname, params)) {
+ return;
+ }
+ typedef cmds::GetBufferParameteri64v::Result Result;
+ Result* result = GetResultAs<Result*>();
+ if (!result) {
+ return;
+ }
+ result->SetNumResults(0);
+ helper_->GetBufferParameteri64v(target, pname, GetResultShmId(),
+ GetResultShmOffset());
+ WaitForCmd();
+ result->CopyResult(params);
+ GPU_CLIENT_LOG_CODE_BLOCK({
+ for (int32_t i = 0; i < result->GetNumResults(); ++i) {
+ GPU_CLIENT_LOG(" " << i << ": " << result->GetData()[i]);
+ }
+ });
+ CheckGLError();
+}
void GLES2Implementation::GetBufferParameteriv(GLenum target,
GLenum pname,
GLint* params) {
@@ -1685,7 +1715,7 @@ void GLES2Implementation::PolygonOffset(GLfloat factor, GLfloat units) {
void GLES2Implementation::ReadBuffer(GLenum src) {
GPU_CLIENT_SINGLE_THREAD_CHECK();
GPU_CLIENT_LOG("[" << GetLogPrefix() << "] glReadBuffer("
- << GLES2Util::GetStringEnum(src) << ")");
+ << GLES2Util::GetStringReadBuffer(src) << ")");
helper_->ReadBuffer(src);
CheckGLError();
}
@@ -3009,9 +3039,10 @@ void GLES2Implementation::DeleteQueriesEXT(GLsizei n, const GLuint* queries) {
void GLES2Implementation::BeginTransformFeedback(GLenum primitivemode) {
GPU_CLIENT_SINGLE_THREAD_CHECK();
- GPU_CLIENT_LOG("[" << GetLogPrefix() << "] glBeginTransformFeedback("
- << GLES2Util::GetStringTransformFeedbackPrimitiveMode(
- primitivemode) << ")");
+ GPU_CLIENT_LOG(
+ "[" << GetLogPrefix() << "] glBeginTransformFeedback("
+ << GLES2Util::GetStringTransformFeedbackPrimitiveMode(primitivemode)
+ << ")");
helper_->BeginTransformFeedback(primitivemode);
CheckGLError();
}
@@ -3223,6 +3254,38 @@ void GLES2Implementation::CompressedCopyTextureCHROMIUM(GLenum target,
CheckGLError();
}
+void GLES2Implementation::CompressedCopySubTextureCHROMIUM(GLenum target,
+ GLenum source_id,
+ GLenum dest_id,
+ GLint xoffset,
+ GLint yoffset,
+ GLint x,
+ GLint y,
+ GLsizei width,
+ GLsizei height) {
+ GPU_CLIENT_SINGLE_THREAD_CHECK();
+ GPU_CLIENT_LOG("[" << GetLogPrefix()
+ << "] glCompressedCopySubTextureCHROMIUM("
+ << GLES2Util::GetStringEnum(target) << ", "
+ << GLES2Util::GetStringEnum(source_id) << ", "
+ << GLES2Util::GetStringEnum(dest_id) << ", " << xoffset
+ << ", " << yoffset << ", " << x << ", " << y << ", "
+ << width << ", " << height << ")");
+ if (width < 0) {
+ SetGLError(GL_INVALID_VALUE, "glCompressedCopySubTextureCHROMIUM",
+ "width < 0");
+ return;
+ }
+ if (height < 0) {
+ SetGLError(GL_INVALID_VALUE, "glCompressedCopySubTextureCHROMIUM",
+ "height < 0");
+ return;
+ }
+ helper_->CompressedCopySubTextureCHROMIUM(target, source_id, dest_id, xoffset,
+ yoffset, x, y, width, height);
+ CheckGLError();
+}
+
void GLES2Implementation::GenValuebuffersCHROMIUM(GLsizei n, GLuint* buffers) {
GPU_CLIENT_LOG("[" << GetLogPrefix() << "] glGenValuebuffersCHROMIUM(" << n
<< ", " << static_cast<const void*>(buffers) << ")");
@@ -3470,6 +3533,123 @@ void GLES2Implementation::MatrixLoadIdentityCHROMIUM(GLenum matrixMode) {
CheckGLError();
}
+GLboolean GLES2Implementation::IsPathCHROMIUM(GLuint path) {
+ GPU_CLIENT_SINGLE_THREAD_CHECK();
+ TRACE_EVENT0("gpu", "GLES2Implementation::IsPathCHROMIUM");
+ GPU_CLIENT_LOG("[" << GetLogPrefix() << "] glIsPathCHROMIUM(" << path << ")");
+ typedef cmds::IsPathCHROMIUM::Result Result;
+ Result* result = GetResultAs<Result*>();
+ if (!result) {
+ return GL_FALSE;
+ }
+ *result = 0;
+ helper_->IsPathCHROMIUM(path, GetResultShmId(), GetResultShmOffset());
+ WaitForCmd();
+ GLboolean result_value = *result != 0;
+ GPU_CLIENT_LOG("returned " << result_value);
+ CheckGLError();
+ return result_value;
+}
+
+void GLES2Implementation::PathParameterfCHROMIUM(GLuint path,
+ GLenum pname,
+ GLfloat value) {
+ GPU_CLIENT_SINGLE_THREAD_CHECK();
+ GPU_CLIENT_LOG("[" << GetLogPrefix() << "] glPathParameterfCHROMIUM(" << path
+ << ", " << GLES2Util::GetStringPathParameter(pname) << ", "
+ << value << ")");
+ helper_->PathParameterfCHROMIUM(path, pname, value);
+ CheckGLError();
+}
+
+void GLES2Implementation::PathParameteriCHROMIUM(GLuint path,
+ GLenum pname,
+ GLint value) {
+ GPU_CLIENT_SINGLE_THREAD_CHECK();
+ GPU_CLIENT_LOG("[" << GetLogPrefix() << "] glPathParameteriCHROMIUM(" << path
+ << ", " << GLES2Util::GetStringPathParameter(pname) << ", "
+ << value << ")");
+ helper_->PathParameteriCHROMIUM(path, pname, value);
+ CheckGLError();
+}
+
+void GLES2Implementation::PathStencilFuncCHROMIUM(GLenum func,
+ GLint ref,
+ GLuint mask) {
+ GPU_CLIENT_SINGLE_THREAD_CHECK();
+ GPU_CLIENT_LOG("[" << GetLogPrefix() << "] glPathStencilFuncCHROMIUM("
+ << GLES2Util::GetStringCmpFunction(func) << ", " << ref
+ << ", " << mask << ")");
+ helper_->PathStencilFuncCHROMIUM(func, ref, mask);
+ CheckGLError();
+}
+
+void GLES2Implementation::StencilFillPathCHROMIUM(GLuint path,
+ GLenum fillMode,
+ GLuint mask) {
+ GPU_CLIENT_SINGLE_THREAD_CHECK();
+ GPU_CLIENT_LOG("[" << GetLogPrefix() << "] glStencilFillPathCHROMIUM(" << path
+ << ", " << GLES2Util::GetStringPathFillMode(fillMode)
+ << ", " << mask << ")");
+ helper_->StencilFillPathCHROMIUM(path, fillMode, mask);
+ CheckGLError();
+}
+
+void GLES2Implementation::StencilStrokePathCHROMIUM(GLuint path,
+ GLint reference,
+ GLuint mask) {
+ GPU_CLIENT_SINGLE_THREAD_CHECK();
+ GPU_CLIENT_LOG("[" << GetLogPrefix() << "] glStencilStrokePathCHROMIUM("
+ << path << ", " << reference << ", " << mask << ")");
+ helper_->StencilStrokePathCHROMIUM(path, reference, mask);
+ CheckGLError();
+}
+
+void GLES2Implementation::CoverFillPathCHROMIUM(GLuint path, GLenum coverMode) {
+ GPU_CLIENT_SINGLE_THREAD_CHECK();
+ GPU_CLIENT_LOG("[" << GetLogPrefix() << "] glCoverFillPathCHROMIUM(" << path
+ << ", " << GLES2Util::GetStringPathCoverMode(coverMode)
+ << ")");
+ helper_->CoverFillPathCHROMIUM(path, coverMode);
+ CheckGLError();
+}
+
+void GLES2Implementation::CoverStrokePathCHROMIUM(GLuint path,
+ GLenum coverMode) {
+ GPU_CLIENT_SINGLE_THREAD_CHECK();
+ GPU_CLIENT_LOG("[" << GetLogPrefix() << "] glCoverStrokePathCHROMIUM(" << path
+ << ", " << GLES2Util::GetStringPathCoverMode(coverMode)
+ << ")");
+ helper_->CoverStrokePathCHROMIUM(path, coverMode);
+ CheckGLError();
+}
+
+void GLES2Implementation::StencilThenCoverFillPathCHROMIUM(GLuint path,
+ GLenum fillMode,
+ GLuint mask,
+ GLenum coverMode) {
+ GPU_CLIENT_SINGLE_THREAD_CHECK();
+ GPU_CLIENT_LOG(
+ "[" << GetLogPrefix() << "] glStencilThenCoverFillPathCHROMIUM(" << path
+ << ", " << GLES2Util::GetStringPathFillMode(fillMode) << ", " << mask
+ << ", " << GLES2Util::GetStringPathCoverMode(coverMode) << ")");
+ helper_->StencilThenCoverFillPathCHROMIUM(path, fillMode, mask, coverMode);
+ CheckGLError();
+}
+
+void GLES2Implementation::StencilThenCoverStrokePathCHROMIUM(GLuint path,
+ GLint reference,
+ GLuint mask,
+ GLenum coverMode) {
+ GPU_CLIENT_SINGLE_THREAD_CHECK();
+ GPU_CLIENT_LOG("[" << GetLogPrefix()
+ << "] glStencilThenCoverStrokePathCHROMIUM(" << path
+ << ", " << reference << ", " << mask << ", "
+ << GLES2Util::GetStringPathCoverMode(coverMode) << ")");
+ helper_->StencilThenCoverStrokePathCHROMIUM(path, reference, mask, coverMode);
+ CheckGLError();
+}
+
void GLES2Implementation::BlendBarrierKHR() {
GPU_CLIENT_SINGLE_THREAD_CHECK();
GPU_CLIENT_LOG("[" << GetLogPrefix() << "] glBlendBarrierKHR("
@@ -3478,4 +3658,13 @@ void GLES2Implementation::BlendBarrierKHR() {
CheckGLError();
}
+void GLES2Implementation::ApplyScreenSpaceAntialiasingCHROMIUM() {
+ GPU_CLIENT_SINGLE_THREAD_CHECK();
+ GPU_CLIENT_LOG("[" << GetLogPrefix()
+ << "] glApplyScreenSpaceAntialiasingCHROMIUM("
+ << ")");
+ helper_->ApplyScreenSpaceAntialiasingCHROMIUM();
+ CheckGLError();
+}
+
#endif // GPU_COMMAND_BUFFER_CLIENT_GLES2_IMPLEMENTATION_IMPL_AUTOGEN_H_
diff --git a/chromium/gpu/command_buffer/client/gles2_implementation_unittest.cc b/chromium/gpu/command_buffer/client/gles2_implementation_unittest.cc
index c354fd9343c..35218c33087 100644
--- a/chromium/gpu/command_buffer/client/gles2_implementation_unittest.cc
+++ b/chromium/gpu/command_buffer/client/gles2_implementation_unittest.cc
@@ -137,6 +137,8 @@ class MockTransferBuffer : public TransferBufferInterface {
RingBuffer::Offset GetOffset(void* pointer) const override;
void DiscardBlock(void* p) override;
void FreePendingToken(void* p, unsigned int /* token */) override;
+ unsigned int GetSize() const override;
+ unsigned int GetFreeSize() const override;
size_t MaxTransferBufferSize() {
return size_ - result_size_;
@@ -309,6 +311,14 @@ void MockTransferBuffer::FreePendingToken(void* p, unsigned int /* token */) {
last_alloc_ = NULL;
}
+unsigned int MockTransferBuffer::GetSize() const {
+ return 0;
+}
+
+unsigned int MockTransferBuffer::GetFreeSize() const {
+ return 0;
+}
+
// API wrapper for Buffers.
class GenBuffersAPI {
public:
@@ -412,7 +422,8 @@ class GLES2ImplementationTest : public testing::Test {
bool lose_context_when_out_of_memory,
bool transfer_buffer_initialize_fail,
bool sync_query,
- bool occlusion_query_boolean) {
+ bool occlusion_query_boolean,
+ bool timer_queries) {
command_buffer_.reset(new StrictMock<MockClientCommandBuffer>());
if (!command_buffer_->Initialize())
return false;
@@ -457,6 +468,7 @@ class GLES2ImplementationTest : public testing::Test {
bind_generates_resource_service ? 1 : 0;
capabilities.sync_query = sync_query;
capabilities.occlusion_query_boolean = occlusion_query_boolean;
+ capabilities.timer_queries = timer_queries;
EXPECT_CALL(*gpu_control_, GetCapabilities())
.WillOnce(testing::Return(capabilities));
@@ -542,6 +554,10 @@ class GLES2ImplementationTest : public testing::Test {
return gl_->query_tracker_->GetQuery(id);
}
+ QueryTracker* GetQueryTracker() {
+ return gl_->query_tracker_.get();
+ }
+
struct ContextInitOptions {
ContextInitOptions()
: bind_generates_resource_client(true),
@@ -549,7 +565,8 @@ class GLES2ImplementationTest : public testing::Test {
lose_context_when_out_of_memory(false),
transfer_buffer_initialize_fail(false),
sync_query(true),
- occlusion_query_boolean(true) {}
+ occlusion_query_boolean(true),
+ timer_queries(true) {}
bool bind_generates_resource_client;
bool bind_generates_resource_service;
@@ -557,11 +574,13 @@ class GLES2ImplementationTest : public testing::Test {
bool transfer_buffer_initialize_fail;
bool sync_query;
bool occlusion_query_boolean;
+ bool timer_queries;
};
bool Initialize(const ContextInitOptions& init_options) {
bool success = true;
- share_group_ = new ShareGroup(init_options.bind_generates_resource_client);
+ share_group_ = new ShareGroup(init_options.bind_generates_resource_client,
+ 0 /* tracing_id */);
for (int i = 0; i < kNumTestContexts; i++) {
if (!test_contexts_[i].Initialize(
@@ -571,7 +590,8 @@ class GLES2ImplementationTest : public testing::Test {
init_options.lose_context_when_out_of_memory,
init_options.transfer_buffer_initialize_fail,
init_options.sync_query,
- init_options.occlusion_query_boolean))
+ init_options.occlusion_query_boolean,
+ init_options.timer_queries))
success = false;
}
@@ -2204,6 +2224,42 @@ TEST_F(GLES2ImplementationTest, GetIntegerCacheRead) {
EXPECT_EQ(static_cast<GLenum>(GL_NO_ERROR), gl_->GetError());
}
+TEST_F(GLES2ImplementationTest, GetIntegerDisjointValue) {
+ ExpectedMemoryInfo mem = GetExpectedMappedMemory(sizeof(DisjointValueSync));
+ gl_->SetDisjointValueSyncCHROMIUM();
+ ASSERT_EQ(mem.id, GetQueryTracker()->DisjointCountSyncShmID());
+ ASSERT_EQ(mem.offset, GetQueryTracker()->DisjointCountSyncShmOffset());
+ DisjointValueSync* disjoint_sync =
+ reinterpret_cast<DisjointValueSync*>(mem.ptr);
+
+ ClearCommands();
+ GLint disjoint_value = -1;
+ gl_->GetIntegerv(GL_GPU_DISJOINT_EXT, &disjoint_value);
+ EXPECT_TRUE(NoCommandsWritten());
+ EXPECT_EQ(0, disjoint_value);
+
+ // After setting disjoint, it should be true.
+ disjoint_value = -1;
+ disjoint_sync->SetDisjointCount(1);
+ gl_->GetIntegerv(GL_GPU_DISJOINT_EXT, &disjoint_value);
+ EXPECT_TRUE(NoCommandsWritten());
+ EXPECT_EQ(1, disjoint_value);
+
+ // After checking disjoint, it should be false again.
+ disjoint_value = -1;
+ gl_->GetIntegerv(GL_GPU_DISJOINT_EXT, &disjoint_value);
+ EXPECT_TRUE(NoCommandsWritten());
+ EXPECT_EQ(0, disjoint_value);
+
+ // Check for errors.
+ ExpectedMemoryInfo result1 =
+ GetExpectedResultMemory(sizeof(cmds::GetError::Result));
+ EXPECT_CALL(*command_buffer(), OnFlush())
+ .WillOnce(SetMemory(result1.ptr, GLuint(GL_NO_ERROR)))
+ .RetiresOnSaturation();
+ EXPECT_EQ(static_cast<GLenum>(GL_NO_ERROR), gl_->GetError());
+}
+
TEST_F(GLES2ImplementationTest, GetIntegerCacheWrite) {
struct PNameValue {
GLenum pname;
@@ -2591,15 +2647,6 @@ TEST_F(GLES2ImplementationTest, TextureInvalidArguments) {
ClearCommands();
- gl_->AsyncTexImage2DCHROMIUM(
- kTarget, kLevel, kFormat, kWidth, kHeight, kInvalidBorder, kFormat, kType,
- NULL);
-
- EXPECT_TRUE(NoCommandsWritten());
- EXPECT_EQ(GL_INVALID_VALUE, CheckError());
-
- ClearCommands();
-
// Checking for CompressedTexImage2D argument validation is a bit tricky due
// to (runtime-detected) compression formats. Try to infer the error with an
// aux check.
@@ -3217,6 +3264,7 @@ TEST_F(GLES2ImplementationManualInitTest, BadQueryTargets) {
ContextInitOptions init_options;
init_options.sync_query = false;
init_options.occlusion_query_boolean = false;
+ init_options.timer_queries = false;
ASSERT_TRUE(Initialize(init_options));
GLuint id = 0;
@@ -3235,9 +3283,123 @@ TEST_F(GLES2ImplementationManualInitTest, BadQueryTargets) {
EXPECT_EQ(GL_INVALID_OPERATION, CheckError());
EXPECT_EQ(nullptr, GetQuery(id));
+ gl_->BeginQueryEXT(GL_TIME_ELAPSED_EXT, id);
+ EXPECT_EQ(GL_INVALID_OPERATION, CheckError());
+ EXPECT_EQ(nullptr, GetQuery(id));
+
gl_->BeginQueryEXT(0x123, id);
+ EXPECT_EQ(GL_INVALID_ENUM, CheckError());
+ EXPECT_EQ(nullptr, GetQuery(id));
+
+ gl_->QueryCounterEXT(id, GL_TIMESTAMP_EXT);
EXPECT_EQ(GL_INVALID_OPERATION, CheckError());
EXPECT_EQ(nullptr, GetQuery(id));
+
+ gl_->QueryCounterEXT(id, 0x123);
+ EXPECT_EQ(GL_INVALID_ENUM, CheckError());
+ EXPECT_EQ(nullptr, GetQuery(id));
+}
+
+TEST_F(GLES2ImplementationTest, SetDisjointSync) {
+ struct SetDisjointSyncCmd {
+ cmds::SetDisjointValueSyncCHROMIUM disjoint_sync;
+ };
+ SetDisjointSyncCmd expected_disjoint_sync_cmd;
+ const void* commands = GetPut();
+ gl_->SetDisjointValueSyncCHROMIUM();
+ expected_disjoint_sync_cmd.disjoint_sync.Init(
+ GetQueryTracker()->DisjointCountSyncShmID(),
+ GetQueryTracker()->DisjointCountSyncShmOffset());
+
+ EXPECT_EQ(0, memcmp(&expected_disjoint_sync_cmd, commands,
+ sizeof(expected_disjoint_sync_cmd)));
+}
+
+TEST_F(GLES2ImplementationTest, QueryCounterEXT) {
+ GLuint expected_ids[2] = { 1, 2 }; // These must match what's actually genned.
+ struct GenCmds {
+ cmds::GenQueriesEXTImmediate gen;
+ GLuint data[2];
+ };
+ GenCmds expected_gen_cmds;
+ expected_gen_cmds.gen.Init(arraysize(expected_ids), &expected_ids[0]);
+ GLuint ids[arraysize(expected_ids)] = { 0, };
+ gl_->GenQueriesEXT(arraysize(expected_ids), &ids[0]);
+ EXPECT_EQ(0, memcmp(
+ &expected_gen_cmds, commands_, sizeof(expected_gen_cmds)));
+ GLuint id1 = ids[0];
+ GLuint id2 = ids[1];
+ ClearCommands();
+
+ // Make sure disjoint value is synchronized already.
+ gl_->SetDisjointValueSyncCHROMIUM();
+ ClearCommands();
+
+ // Test QueryCounterEXT fails if id = 0.
+ gl_->QueryCounterEXT(0, GL_TIMESTAMP_EXT);
+ EXPECT_TRUE(NoCommandsWritten());
+ EXPECT_EQ(GL_INVALID_OPERATION, CheckError());
+
+ // Test QueryCounterEXT fails if target is unknown.
+ ClearCommands();
+ gl_->QueryCounterEXT(id1, GL_TIME_ELAPSED_EXT);
+ EXPECT_TRUE(NoCommandsWritten());
+ EXPECT_EQ(GL_INVALID_ENUM, CheckError());
+
+ // Test QueryCounterEXT inserts command.
+ struct QueryCounterCmds {
+ cmds::QueryCounterEXT query_counter;
+ };
+ QueryCounterCmds expected_query_counter_cmds;
+ const void* commands = GetPut();
+ gl_->QueryCounterEXT(id1, GL_TIMESTAMP_EXT);
+ EXPECT_EQ(GL_NO_ERROR, CheckError());
+ QueryTracker::Query* query = GetQuery(id1);
+ ASSERT_TRUE(query != NULL);
+ expected_query_counter_cmds.query_counter.Init(
+ id1, GL_TIMESTAMP_EXT, query->shm_id(), query->shm_offset(),
+ query->submit_count());
+ EXPECT_EQ(0, memcmp(&expected_query_counter_cmds, commands,
+ sizeof(expected_query_counter_cmds)));
+ ClearCommands();
+
+ // Test 2nd QueryCounterEXT succeeds.
+ commands = GetPut();
+ gl_->QueryCounterEXT(id2, GL_TIMESTAMP_EXT);
+ EXPECT_EQ(GL_NO_ERROR, CheckError());
+ QueryTracker::Query* query2 = GetQuery(id2);
+ ASSERT_TRUE(query2 != NULL);
+ expected_query_counter_cmds.query_counter.Init(
+ id2, GL_TIMESTAMP_EXT, query2->shm_id(), query2->shm_offset(),
+ query2->submit_count());
+ EXPECT_EQ(0, memcmp(&expected_query_counter_cmds, commands,
+ sizeof(expected_query_counter_cmds)));
+ ClearCommands();
+
+ // Test QueryCounterEXT increments count.
+ base::subtle::Atomic32 old_submit_count = query->submit_count();
+ commands = GetPut();
+ gl_->QueryCounterEXT(id1, GL_TIMESTAMP_EXT);
+ EXPECT_EQ(GL_NO_ERROR, CheckError());
+ EXPECT_NE(old_submit_count, query->submit_count());
+ expected_query_counter_cmds.query_counter.Init(
+ id1, GL_TIMESTAMP_EXT, query->shm_id(), query->shm_offset(),
+ query->submit_count());
+ EXPECT_EQ(0, memcmp(&expected_query_counter_cmds, commands,
+ sizeof(expected_query_counter_cmds)));
+ ClearCommands();
+
+ // Test GetQueryObjectuivEXT CheckResultsAvailable
+ GLuint available = 0xBDu;
+ ClearCommands();
+ gl_->GetQueryObjectuivEXT(id1, GL_QUERY_RESULT_AVAILABLE_EXT, &available);
+ EXPECT_EQ(0u, available);
+
+ // Test GetQueryObjectui64vEXT CheckResultsAvailable
+ GLuint64 available2 = 0xBDu;
+ ClearCommands();
+ gl_->GetQueryObjectui64vEXT(id1, GL_QUERY_RESULT_AVAILABLE_EXT, &available2);
+ EXPECT_EQ(0u, available2);
}
TEST_F(GLES2ImplementationTest, ErrorQuery) {
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 cf9a177118a..949ec7e207e 100644
--- a/chromium/gpu/command_buffer/client/gles2_implementation_unittest_autogen.h
+++ b/chromium/gpu/command_buffer/client/gles2_implementation_unittest_autogen.h
@@ -779,6 +779,24 @@ TEST_F(GLES2ImplementationTest, GetBooleanv) {
EXPECT_EQ(static_cast<ResultType>(1), result);
}
+TEST_F(GLES2ImplementationTest, GetBufferParameteri64v) {
+ struct Cmds {
+ cmds::GetBufferParameteri64v cmd;
+ };
+ typedef cmds::GetBufferParameteri64v::Result::Type ResultType;
+ ResultType result = 0;
+ Cmds expected;
+ ExpectedMemoryInfo result1 =
+ GetExpectedResultMemory(sizeof(uint32_t) + sizeof(ResultType));
+ expected.cmd.Init(123, GL_BUFFER_SIZE, result1.id, result1.offset);
+ EXPECT_CALL(*command_buffer(), OnFlush())
+ .WillOnce(SetMemory(result1.ptr, SizedResultHelper<ResultType>(1)))
+ .RetiresOnSaturation();
+ gl_->GetBufferParameteri64v(123, GL_BUFFER_SIZE, &result);
+ EXPECT_EQ(0, memcmp(&expected, commands_, sizeof(expected)));
+ EXPECT_EQ(static_cast<ResultType>(1), result);
+}
+
TEST_F(GLES2ImplementationTest, GetBufferParameteriv) {
struct Cmds {
cmds::GetBufferParameteriv cmd;
@@ -1420,9 +1438,9 @@ TEST_F(GLES2ImplementationTest, ReadBuffer) {
cmds::ReadBuffer cmd;
};
Cmds expected;
- expected.cmd.Init(1);
+ expected.cmd.Init(GL_NONE);
- gl_->ReadBuffer(1);
+ gl_->ReadBuffer(GL_NONE);
EXPECT_EQ(0, memcmp(&expected, commands_, sizeof(expected)));
}
@@ -2724,6 +2742,7 @@ TEST_F(GLES2ImplementationTest, DeleteQueriesEXT) {
gl_->DeleteQueriesEXT(arraysize(ids), &ids[0]);
EXPECT_EQ(0, memcmp(&expected, commands_, sizeof(expected)));
}
+// TODO(zmo): Implement unit test for QueryCounterEXT
// TODO(zmo): Implement unit test for BeginQueryEXT
TEST_F(GLES2ImplementationTest, BeginTransformFeedback) {
@@ -2874,6 +2893,17 @@ TEST_F(GLES2ImplementationTest, CompressedCopyTextureCHROMIUM) {
EXPECT_EQ(0, memcmp(&expected, commands_, sizeof(expected)));
}
+TEST_F(GLES2ImplementationTest, CompressedCopySubTextureCHROMIUM) {
+ struct Cmds {
+ cmds::CompressedCopySubTextureCHROMIUM cmd;
+ };
+ Cmds expected;
+ expected.cmd.Init(1, 2, 3, 4, 5, 6, 7, 8, 9);
+
+ gl_->CompressedCopySubTextureCHROMIUM(1, 2, 3, 4, 5, 6, 7, 8, 9);
+ EXPECT_EQ(0, memcmp(&expected, commands_, sizeof(expected)));
+}
+
TEST_F(GLES2ImplementationTest, DrawArraysInstancedANGLE) {
struct Cmds {
cmds::DrawArraysInstancedANGLE cmd;
@@ -3130,4 +3160,136 @@ TEST_F(GLES2ImplementationTest, MatrixLoadIdentityCHROMIUM) {
gl_->MatrixLoadIdentityCHROMIUM(GL_PATH_PROJECTION_CHROMIUM);
EXPECT_EQ(0, memcmp(&expected, commands_, sizeof(expected)));
}
+// TODO(zmo): Implement unit test for GenPathsCHROMIUM
+
+TEST_F(GLES2ImplementationTest, DeletePathsCHROMIUM) {
+ struct Cmds {
+ cmds::DeletePathsCHROMIUM cmd;
+ };
+ Cmds expected;
+ expected.cmd.Init(1, 2);
+
+ gl_->DeletePathsCHROMIUM(1, 2);
+ EXPECT_EQ(0, memcmp(&expected, commands_, sizeof(expected)));
+}
+
+TEST_F(GLES2ImplementationTest, IsPathCHROMIUM) {
+ struct Cmds {
+ cmds::IsPathCHROMIUM cmd;
+ };
+
+ Cmds expected;
+ ExpectedMemoryInfo result1 =
+ GetExpectedResultMemory(sizeof(cmds::IsPathCHROMIUM::Result));
+ expected.cmd.Init(1, result1.id, result1.offset);
+
+ EXPECT_CALL(*command_buffer(), OnFlush())
+ .WillOnce(SetMemory(result1.ptr, uint32_t(GL_TRUE)))
+ .RetiresOnSaturation();
+
+ GLboolean result = gl_->IsPathCHROMIUM(1);
+ EXPECT_EQ(0, memcmp(&expected, commands_, sizeof(expected)));
+ EXPECT_TRUE(result);
+}
+// TODO(zmo): Implement unit test for PathCommandsCHROMIUM
+
+TEST_F(GLES2ImplementationTest, PathParameterfCHROMIUM) {
+ struct Cmds {
+ cmds::PathParameterfCHROMIUM cmd;
+ };
+ Cmds expected;
+ expected.cmd.Init(1, GL_PATH_STROKE_WIDTH_CHROMIUM, 3);
+
+ gl_->PathParameterfCHROMIUM(1, GL_PATH_STROKE_WIDTH_CHROMIUM, 3);
+ EXPECT_EQ(0, memcmp(&expected, commands_, sizeof(expected)));
+}
+
+TEST_F(GLES2ImplementationTest, PathParameteriCHROMIUM) {
+ struct Cmds {
+ cmds::PathParameteriCHROMIUM cmd;
+ };
+ Cmds expected;
+ expected.cmd.Init(1, GL_PATH_STROKE_WIDTH_CHROMIUM, 3);
+
+ gl_->PathParameteriCHROMIUM(1, GL_PATH_STROKE_WIDTH_CHROMIUM, 3);
+ EXPECT_EQ(0, memcmp(&expected, commands_, sizeof(expected)));
+}
+
+TEST_F(GLES2ImplementationTest, PathStencilFuncCHROMIUM) {
+ struct Cmds {
+ cmds::PathStencilFuncCHROMIUM cmd;
+ };
+ Cmds expected;
+ expected.cmd.Init(GL_NEVER, 2, 3);
+
+ gl_->PathStencilFuncCHROMIUM(GL_NEVER, 2, 3);
+ EXPECT_EQ(0, memcmp(&expected, commands_, sizeof(expected)));
+}
+
+TEST_F(GLES2ImplementationTest, StencilFillPathCHROMIUM) {
+ struct Cmds {
+ cmds::StencilFillPathCHROMIUM cmd;
+ };
+ Cmds expected;
+ expected.cmd.Init(1, GL_INVERT, 3);
+
+ gl_->StencilFillPathCHROMIUM(1, GL_INVERT, 3);
+ EXPECT_EQ(0, memcmp(&expected, commands_, sizeof(expected)));
+}
+
+TEST_F(GLES2ImplementationTest, StencilStrokePathCHROMIUM) {
+ struct Cmds {
+ cmds::StencilStrokePathCHROMIUM cmd;
+ };
+ Cmds expected;
+ expected.cmd.Init(1, 2, 3);
+
+ gl_->StencilStrokePathCHROMIUM(1, 2, 3);
+ EXPECT_EQ(0, memcmp(&expected, commands_, sizeof(expected)));
+}
+
+TEST_F(GLES2ImplementationTest, CoverFillPathCHROMIUM) {
+ struct Cmds {
+ cmds::CoverFillPathCHROMIUM cmd;
+ };
+ Cmds expected;
+ expected.cmd.Init(1, GL_CONVEX_HULL_CHROMIUM);
+
+ gl_->CoverFillPathCHROMIUM(1, GL_CONVEX_HULL_CHROMIUM);
+ EXPECT_EQ(0, memcmp(&expected, commands_, sizeof(expected)));
+}
+
+TEST_F(GLES2ImplementationTest, CoverStrokePathCHROMIUM) {
+ struct Cmds {
+ cmds::CoverStrokePathCHROMIUM cmd;
+ };
+ Cmds expected;
+ expected.cmd.Init(1, GL_CONVEX_HULL_CHROMIUM);
+
+ gl_->CoverStrokePathCHROMIUM(1, GL_CONVEX_HULL_CHROMIUM);
+ EXPECT_EQ(0, memcmp(&expected, commands_, sizeof(expected)));
+}
+
+TEST_F(GLES2ImplementationTest, StencilThenCoverFillPathCHROMIUM) {
+ struct Cmds {
+ cmds::StencilThenCoverFillPathCHROMIUM cmd;
+ };
+ Cmds expected;
+ expected.cmd.Init(1, GL_INVERT, 3, GL_CONVEX_HULL_CHROMIUM);
+
+ gl_->StencilThenCoverFillPathCHROMIUM(1, GL_INVERT, 3,
+ GL_CONVEX_HULL_CHROMIUM);
+ EXPECT_EQ(0, memcmp(&expected, commands_, sizeof(expected)));
+}
+
+TEST_F(GLES2ImplementationTest, StencilThenCoverStrokePathCHROMIUM) {
+ struct Cmds {
+ cmds::StencilThenCoverStrokePathCHROMIUM cmd;
+ };
+ Cmds expected;
+ expected.cmd.Init(1, 2, 3, GL_CONVEX_HULL_CHROMIUM);
+
+ gl_->StencilThenCoverStrokePathCHROMIUM(1, 2, 3, GL_CONVEX_HULL_CHROMIUM);
+ EXPECT_EQ(0, memcmp(&expected, commands_, sizeof(expected)));
+}
#endif // GPU_COMMAND_BUFFER_CLIENT_GLES2_IMPLEMENTATION_UNITTEST_AUTOGEN_H_
diff --git a/chromium/gpu/command_buffer/client/gles2_interface_autogen.h b/chromium/gpu/command_buffer/client/gles2_interface_autogen.h
index c3e197f9f2e..43e3b9058c9 100644
--- a/chromium/gpu/command_buffer/client/gles2_interface_autogen.h
+++ b/chromium/gpu/command_buffer/client/gles2_interface_autogen.h
@@ -235,6 +235,9 @@ virtual void GetAttachedShaders(GLuint program,
GLuint* shaders) = 0;
virtual GLint GetAttribLocation(GLuint program, const char* name) = 0;
virtual void GetBooleanv(GLenum pname, GLboolean* params) = 0;
+virtual void GetBufferParameteri64v(GLenum target,
+ GLenum pname,
+ GLint64* params) = 0;
virtual void GetBufferParameteriv(GLenum target,
GLenum pname,
GLint* params) = 0;
@@ -590,16 +593,22 @@ virtual void TexStorage2DEXT(GLenum target,
GLsizei height) = 0;
virtual void GenQueriesEXT(GLsizei n, GLuint* queries) = 0;
virtual void DeleteQueriesEXT(GLsizei n, const GLuint* queries) = 0;
+virtual void QueryCounterEXT(GLuint id, GLenum target) = 0;
virtual GLboolean IsQueryEXT(GLuint id) = 0;
virtual void BeginQueryEXT(GLenum target, GLuint id) = 0;
virtual void BeginTransformFeedback(GLenum primitivemode) = 0;
virtual void EndQueryEXT(GLenum target) = 0;
virtual void EndTransformFeedback() = 0;
virtual void GetQueryivEXT(GLenum target, GLenum pname, GLint* params) = 0;
+virtual void GetQueryObjectivEXT(GLuint id, GLenum pname, GLint* params) = 0;
virtual void GetQueryObjectuivEXT(GLuint id, GLenum pname, GLuint* params) = 0;
+virtual void GetQueryObjecti64vEXT(GLuint id,
+ GLenum pname,
+ GLint64* params) = 0;
virtual void GetQueryObjectui64vEXT(GLuint id,
GLenum pname,
GLuint64* params) = 0;
+virtual void SetDisjointValueSyncCHROMIUM() = 0;
virtual void InsertEventMarkerEXT(GLsizei length, const GLchar* marker) = 0;
virtual void PushGroupMarkerEXT(GLsizei length, const GLchar* marker) = 0;
virtual void PopGroupMarkerEXT() = 0;
@@ -640,7 +649,6 @@ virtual void ResizeCHROMIUM(GLuint width,
GLfloat scale_factor) = 0;
virtual const GLchar* GetRequestableExtensionsCHROMIUM() = 0;
virtual void RequestExtensionCHROMIUM(const char* extension) = 0;
-virtual void RateLimitOffscreenContextCHROMIUM() = 0;
virtual void GetProgramInfoCHROMIUM(GLuint program,
GLsizei bufsize,
GLsizei* size,
@@ -703,6 +711,15 @@ virtual void CopySubTextureCHROMIUM(GLenum target,
virtual void CompressedCopyTextureCHROMIUM(GLenum target,
GLenum source_id,
GLenum dest_id) = 0;
+virtual void CompressedCopySubTextureCHROMIUM(GLenum target,
+ GLenum source_id,
+ GLenum dest_id,
+ GLint xoffset,
+ GLint yoffset,
+ GLint x,
+ GLint y,
+ GLsizei width,
+ GLsizei height) = 0;
virtual void DrawArraysInstancedANGLE(GLenum mode,
GLint first,
GLsizei count,
@@ -739,26 +756,6 @@ virtual void ReleaseTexImage2DCHROMIUM(GLenum target, GLint imageId) = 0;
virtual void TraceBeginCHROMIUM(const char* category_name,
const char* trace_name) = 0;
virtual void TraceEndCHROMIUM() = 0;
-virtual void AsyncTexSubImage2DCHROMIUM(GLenum target,
- GLint level,
- GLint xoffset,
- GLint yoffset,
- GLsizei width,
- GLsizei height,
- GLenum format,
- GLenum type,
- const void* data) = 0;
-virtual void AsyncTexImage2DCHROMIUM(GLenum target,
- GLint level,
- GLenum internalformat,
- GLsizei width,
- GLsizei height,
- GLint border,
- GLenum format,
- GLenum type,
- const void* pixels) = 0;
-virtual void WaitAsyncTexImage2DCHROMIUM(GLenum target) = 0;
-virtual void WaitAllAsyncTexImage2DCHROMIUM() = 0;
virtual void DiscardFramebufferEXT(GLenum target,
GLsizei count,
const GLenum* attachments) = 0;
@@ -782,6 +779,37 @@ virtual void SwapInterval(GLint interval) = 0;
virtual void FlushDriverCachesCHROMIUM() = 0;
virtual void MatrixLoadfCHROMIUM(GLenum matrixMode, const GLfloat* m) = 0;
virtual void MatrixLoadIdentityCHROMIUM(GLenum matrixMode) = 0;
+virtual GLuint GenPathsCHROMIUM(GLsizei range) = 0;
+virtual void DeletePathsCHROMIUM(GLuint path, GLsizei range) = 0;
+virtual GLboolean IsPathCHROMIUM(GLuint path) = 0;
+virtual void PathCommandsCHROMIUM(GLuint path,
+ GLsizei numCommands,
+ const GLubyte* commands,
+ GLsizei numCoords,
+ GLenum coordType,
+ const GLvoid* coords) = 0;
+virtual void PathParameterfCHROMIUM(GLuint path,
+ GLenum pname,
+ GLfloat value) = 0;
+virtual void PathParameteriCHROMIUM(GLuint path, GLenum pname, GLint value) = 0;
+virtual void PathStencilFuncCHROMIUM(GLenum func, GLint ref, GLuint mask) = 0;
+virtual void StencilFillPathCHROMIUM(GLuint path,
+ GLenum fillMode,
+ GLuint mask) = 0;
+virtual void StencilStrokePathCHROMIUM(GLuint path,
+ GLint reference,
+ GLuint mask) = 0;
+virtual void CoverFillPathCHROMIUM(GLuint path, GLenum coverMode) = 0;
+virtual void CoverStrokePathCHROMIUM(GLuint path, GLenum coverMode) = 0;
+virtual void StencilThenCoverFillPathCHROMIUM(GLuint path,
+ GLenum fillMode,
+ GLuint mask,
+ GLenum coverMode) = 0;
+virtual void StencilThenCoverStrokePathCHROMIUM(GLuint path,
+ GLint reference,
+ GLuint mask,
+ GLenum coverMode) = 0;
virtual GLenum GetGraphicsResetStatusKHR() = 0;
virtual void BlendBarrierKHR() = 0;
+virtual void ApplyScreenSpaceAntialiasingCHROMIUM() = 0;
#endif // GPU_COMMAND_BUFFER_CLIENT_GLES2_INTERFACE_AUTOGEN_H_
diff --git a/chromium/gpu/command_buffer/client/gles2_interface_stub_autogen.h b/chromium/gpu/command_buffer/client/gles2_interface_stub_autogen.h
index be5cbb8fbeb..0d08d670bd4 100644
--- a/chromium/gpu/command_buffer/client/gles2_interface_stub_autogen.h
+++ b/chromium/gpu/command_buffer/client/gles2_interface_stub_autogen.h
@@ -232,6 +232,9 @@ void GetAttachedShaders(GLuint program,
GLuint* shaders) override;
GLint GetAttribLocation(GLuint program, const char* name) override;
void GetBooleanv(GLenum pname, GLboolean* params) override;
+void GetBufferParameteri64v(GLenum target,
+ GLenum pname,
+ GLint64* params) override;
void GetBufferParameteriv(GLenum target, GLenum pname, GLint* params) override;
GLenum GetError() override;
void GetFloatv(GLenum pname, GLfloat* params) override;
@@ -573,14 +576,18 @@ void TexStorage2DEXT(GLenum target,
GLsizei height) override;
void GenQueriesEXT(GLsizei n, GLuint* queries) override;
void DeleteQueriesEXT(GLsizei n, const GLuint* queries) override;
+void QueryCounterEXT(GLuint id, GLenum target) override;
GLboolean IsQueryEXT(GLuint id) override;
void BeginQueryEXT(GLenum target, GLuint id) override;
void BeginTransformFeedback(GLenum primitivemode) override;
void EndQueryEXT(GLenum target) override;
void EndTransformFeedback() override;
void GetQueryivEXT(GLenum target, GLenum pname, GLint* params) override;
+void GetQueryObjectivEXT(GLuint id, GLenum pname, GLint* params) override;
void GetQueryObjectuivEXT(GLuint id, GLenum pname, GLuint* params) override;
+void GetQueryObjecti64vEXT(GLuint id, GLenum pname, GLint64* params) override;
void GetQueryObjectui64vEXT(GLuint id, GLenum pname, GLuint64* params) override;
+void SetDisjointValueSyncCHROMIUM() override;
void InsertEventMarkerEXT(GLsizei length, const GLchar* marker) override;
void PushGroupMarkerEXT(GLsizei length, const GLchar* marker) override;
void PopGroupMarkerEXT() override;
@@ -619,7 +626,6 @@ void UnmapTexSubImage2DCHROMIUM(const void* mem) override;
void ResizeCHROMIUM(GLuint width, GLuint height, GLfloat scale_factor) override;
const GLchar* GetRequestableExtensionsCHROMIUM() override;
void RequestExtensionCHROMIUM(const char* extension) override;
-void RateLimitOffscreenContextCHROMIUM() override;
void GetProgramInfoCHROMIUM(GLuint program,
GLsizei bufsize,
GLsizei* size,
@@ -682,6 +688,15 @@ void CopySubTextureCHROMIUM(GLenum target,
void CompressedCopyTextureCHROMIUM(GLenum target,
GLenum source_id,
GLenum dest_id) override;
+void CompressedCopySubTextureCHROMIUM(GLenum target,
+ GLenum source_id,
+ GLenum dest_id,
+ GLint xoffset,
+ GLint yoffset,
+ GLint x,
+ GLint y,
+ GLsizei width,
+ GLsizei height) override;
void DrawArraysInstancedANGLE(GLenum mode,
GLint first,
GLsizei count,
@@ -717,26 +732,6 @@ void ReleaseTexImage2DCHROMIUM(GLenum target, GLint imageId) override;
void TraceBeginCHROMIUM(const char* category_name,
const char* trace_name) override;
void TraceEndCHROMIUM() override;
-void AsyncTexSubImage2DCHROMIUM(GLenum target,
- GLint level,
- GLint xoffset,
- GLint yoffset,
- GLsizei width,
- GLsizei height,
- GLenum format,
- GLenum type,
- const void* data) override;
-void AsyncTexImage2DCHROMIUM(GLenum target,
- GLint level,
- GLenum internalformat,
- GLsizei width,
- GLsizei height,
- GLint border,
- GLenum format,
- GLenum type,
- const void* pixels) override;
-void WaitAsyncTexImage2DCHROMIUM(GLenum target) override;
-void WaitAllAsyncTexImage2DCHROMIUM() override;
void DiscardFramebufferEXT(GLenum target,
GLsizei count,
const GLenum* attachments) override;
@@ -760,6 +755,35 @@ void SwapInterval(GLint interval) override;
void FlushDriverCachesCHROMIUM() override;
void MatrixLoadfCHROMIUM(GLenum matrixMode, const GLfloat* m) override;
void MatrixLoadIdentityCHROMIUM(GLenum matrixMode) override;
+GLuint GenPathsCHROMIUM(GLsizei range) override;
+void DeletePathsCHROMIUM(GLuint path, GLsizei range) override;
+GLboolean IsPathCHROMIUM(GLuint path) override;
+void PathCommandsCHROMIUM(GLuint path,
+ GLsizei numCommands,
+ const GLubyte* commands,
+ GLsizei numCoords,
+ GLenum coordType,
+ const GLvoid* coords) override;
+void PathParameterfCHROMIUM(GLuint path, GLenum pname, GLfloat value) override;
+void PathParameteriCHROMIUM(GLuint path, GLenum pname, GLint value) override;
+void PathStencilFuncCHROMIUM(GLenum func, GLint ref, GLuint mask) override;
+void StencilFillPathCHROMIUM(GLuint path,
+ GLenum fillMode,
+ GLuint mask) override;
+void StencilStrokePathCHROMIUM(GLuint path,
+ GLint reference,
+ GLuint mask) override;
+void CoverFillPathCHROMIUM(GLuint path, GLenum coverMode) override;
+void CoverStrokePathCHROMIUM(GLuint path, GLenum coverMode) override;
+void StencilThenCoverFillPathCHROMIUM(GLuint path,
+ GLenum fillMode,
+ GLuint mask,
+ GLenum coverMode) override;
+void StencilThenCoverStrokePathCHROMIUM(GLuint path,
+ GLint reference,
+ GLuint mask,
+ GLenum coverMode) override;
GLenum GetGraphicsResetStatusKHR() override;
void BlendBarrierKHR() override;
+void ApplyScreenSpaceAntialiasingCHROMIUM() override;
#endif // GPU_COMMAND_BUFFER_CLIENT_GLES2_INTERFACE_STUB_AUTOGEN_H_
diff --git a/chromium/gpu/command_buffer/client/gles2_interface_stub_impl_autogen.h b/chromium/gpu/command_buffer/client/gles2_interface_stub_impl_autogen.h
index f06af17d214..6e3025154ed 100644
--- a/chromium/gpu/command_buffer/client/gles2_interface_stub_impl_autogen.h
+++ b/chromium/gpu/command_buffer/client/gles2_interface_stub_impl_autogen.h
@@ -12,99 +12,75 @@
#ifndef GPU_COMMAND_BUFFER_CLIENT_GLES2_INTERFACE_STUB_IMPL_AUTOGEN_H_
#define GPU_COMMAND_BUFFER_CLIENT_GLES2_INTERFACE_STUB_IMPL_AUTOGEN_H_
-void GLES2InterfaceStub::ActiveTexture(GLenum /* texture */) {
-}
+void GLES2InterfaceStub::ActiveTexture(GLenum /* texture */) {}
void GLES2InterfaceStub::AttachShader(GLuint /* program */,
- GLuint /* shader */) {
-}
+ GLuint /* shader */) {}
void GLES2InterfaceStub::BindAttribLocation(GLuint /* program */,
GLuint /* index */,
- const char* /* name */) {
-}
-void GLES2InterfaceStub::BindBuffer(GLenum /* target */, GLuint /* buffer */) {
-}
+ const char* /* name */) {}
+void GLES2InterfaceStub::BindBuffer(GLenum /* target */, GLuint /* buffer */) {}
void GLES2InterfaceStub::BindBufferBase(GLenum /* target */,
GLuint /* index */,
- GLuint /* buffer */) {
-}
+ GLuint /* buffer */) {}
void GLES2InterfaceStub::BindBufferRange(GLenum /* target */,
GLuint /* index */,
GLuint /* buffer */,
GLintptr /* offset */,
- GLsizeiptr /* size */) {
-}
+ GLsizeiptr /* size */) {}
void GLES2InterfaceStub::BindFramebuffer(GLenum /* target */,
- GLuint /* framebuffer */) {
-}
+ GLuint /* framebuffer */) {}
void GLES2InterfaceStub::BindRenderbuffer(GLenum /* target */,
- GLuint /* renderbuffer */) {
-}
-void GLES2InterfaceStub::BindSampler(GLuint /* unit */, GLuint /* sampler */) {
-}
+ GLuint /* renderbuffer */) {}
+void GLES2InterfaceStub::BindSampler(GLuint /* unit */, GLuint /* sampler */) {}
void GLES2InterfaceStub::BindTexture(GLenum /* target */,
- GLuint /* texture */) {
-}
+ GLuint /* texture */) {}
void GLES2InterfaceStub::BindTransformFeedback(GLenum /* target */,
GLuint /* transformfeedback */) {
}
void GLES2InterfaceStub::BlendColor(GLclampf /* red */,
GLclampf /* green */,
GLclampf /* blue */,
- GLclampf /* alpha */) {
-}
-void GLES2InterfaceStub::BlendEquation(GLenum /* mode */) {
-}
+ GLclampf /* alpha */) {}
+void GLES2InterfaceStub::BlendEquation(GLenum /* mode */) {}
void GLES2InterfaceStub::BlendEquationSeparate(GLenum /* modeRGB */,
- GLenum /* modeAlpha */) {
-}
+ GLenum /* modeAlpha */) {}
void GLES2InterfaceStub::BlendFunc(GLenum /* sfactor */, GLenum /* dfactor */) {
}
void GLES2InterfaceStub::BlendFuncSeparate(GLenum /* srcRGB */,
GLenum /* dstRGB */,
GLenum /* srcAlpha */,
- GLenum /* dstAlpha */) {
-}
+ GLenum /* dstAlpha */) {}
void GLES2InterfaceStub::BufferData(GLenum /* target */,
GLsizeiptr /* size */,
const void* /* data */,
- GLenum /* usage */) {
-}
+ GLenum /* usage */) {}
void GLES2InterfaceStub::BufferSubData(GLenum /* target */,
GLintptr /* offset */,
GLsizeiptr /* size */,
- const void* /* data */) {
-}
+ const void* /* data */) {}
GLenum GLES2InterfaceStub::CheckFramebufferStatus(GLenum /* target */) {
return 0;
}
-void GLES2InterfaceStub::Clear(GLbitfield /* mask */) {
-}
+void GLES2InterfaceStub::Clear(GLbitfield /* mask */) {}
void GLES2InterfaceStub::ClearBufferfi(GLenum /* buffer */,
GLint /* drawbuffers */,
GLfloat /* depth */,
- GLint /* stencil */) {
-}
+ GLint /* stencil */) {}
void GLES2InterfaceStub::ClearBufferfv(GLenum /* buffer */,
GLint /* drawbuffers */,
- const GLfloat* /* value */) {
-}
+ const GLfloat* /* value */) {}
void GLES2InterfaceStub::ClearBufferiv(GLenum /* buffer */,
GLint /* drawbuffers */,
- const GLint* /* value */) {
-}
+ const GLint* /* value */) {}
void GLES2InterfaceStub::ClearBufferuiv(GLenum /* buffer */,
GLint /* drawbuffers */,
- const GLuint* /* value */) {
-}
+ const GLuint* /* value */) {}
void GLES2InterfaceStub::ClearColor(GLclampf /* red */,
GLclampf /* green */,
GLclampf /* blue */,
- GLclampf /* alpha */) {
-}
-void GLES2InterfaceStub::ClearDepthf(GLclampf /* depth */) {
-}
-void GLES2InterfaceStub::ClearStencil(GLint /* s */) {
-}
+ GLclampf /* alpha */) {}
+void GLES2InterfaceStub::ClearDepthf(GLclampf /* depth */) {}
+void GLES2InterfaceStub::ClearStencil(GLint /* s */) {}
GLenum GLES2InterfaceStub::ClientWaitSync(GLsync /* sync */,
GLbitfield /* flags */,
GLuint64 /* timeout */) {
@@ -113,10 +89,8 @@ GLenum GLES2InterfaceStub::ClientWaitSync(GLsync /* sync */,
void GLES2InterfaceStub::ColorMask(GLboolean /* red */,
GLboolean /* green */,
GLboolean /* blue */,
- GLboolean /* alpha */) {
-}
-void GLES2InterfaceStub::CompileShader(GLuint /* shader */) {
-}
+ GLboolean /* alpha */) {}
+void GLES2InterfaceStub::CompileShader(GLuint /* shader */) {}
void GLES2InterfaceStub::CompressedTexImage2D(GLenum /* target */,
GLint /* level */,
GLenum /* internalformat */,
@@ -124,8 +98,7 @@ void GLES2InterfaceStub::CompressedTexImage2D(GLenum /* target */,
GLsizei /* height */,
GLint /* border */,
GLsizei /* imageSize */,
- const void* /* data */) {
-}
+ const void* /* data */) {}
void GLES2InterfaceStub::CompressedTexSubImage2D(GLenum /* target */,
GLint /* level */,
GLint /* xoffset */,
@@ -134,8 +107,7 @@ void GLES2InterfaceStub::CompressedTexSubImage2D(GLenum /* target */,
GLsizei /* height */,
GLenum /* format */,
GLsizei /* imageSize */,
- const void* /* data */) {
-}
+ const void* /* data */) {}
void GLES2InterfaceStub::CompressedTexImage3D(GLenum /* target */,
GLint /* level */,
GLenum /* internalformat */,
@@ -144,8 +116,7 @@ void GLES2InterfaceStub::CompressedTexImage3D(GLenum /* target */,
GLsizei /* depth */,
GLint /* border */,
GLsizei /* imageSize */,
- const void* /* data */) {
-}
+ const void* /* data */) {}
void GLES2InterfaceStub::CompressedTexSubImage3D(GLenum /* target */,
GLint /* level */,
GLint /* xoffset */,
@@ -156,14 +127,12 @@ void GLES2InterfaceStub::CompressedTexSubImage3D(GLenum /* target */,
GLsizei /* depth */,
GLenum /* format */,
GLsizei /* imageSize */,
- const void* /* data */) {
-}
+ const void* /* data */) {}
void GLES2InterfaceStub::CopyBufferSubData(GLenum /* readtarget */,
GLenum /* writetarget */,
GLintptr /* readoffset */,
GLintptr /* writeoffset */,
- GLsizeiptr /* size */) {
-}
+ GLsizeiptr /* size */) {}
void GLES2InterfaceStub::CopyTexImage2D(GLenum /* target */,
GLint /* level */,
GLenum /* internalformat */,
@@ -171,8 +140,7 @@ void GLES2InterfaceStub::CopyTexImage2D(GLenum /* target */,
GLint /* y */,
GLsizei /* width */,
GLsizei /* height */,
- GLint /* border */) {
-}
+ GLint /* border */) {}
void GLES2InterfaceStub::CopyTexSubImage2D(GLenum /* target */,
GLint /* level */,
GLint /* xoffset */,
@@ -180,8 +148,7 @@ void GLES2InterfaceStub::CopyTexSubImage2D(GLenum /* target */,
GLint /* x */,
GLint /* y */,
GLsizei /* width */,
- GLsizei /* height */) {
-}
+ GLsizei /* height */) {}
void GLES2InterfaceStub::CopyTexSubImage3D(GLenum /* target */,
GLint /* level */,
GLint /* xoffset */,
@@ -190,174 +157,133 @@ void GLES2InterfaceStub::CopyTexSubImage3D(GLenum /* target */,
GLint /* x */,
GLint /* y */,
GLsizei /* width */,
- GLsizei /* height */) {
-}
+ GLsizei /* height */) {}
GLuint GLES2InterfaceStub::CreateProgram() {
return 0;
}
GLuint GLES2InterfaceStub::CreateShader(GLenum /* type */) {
return 0;
}
-void GLES2InterfaceStub::CullFace(GLenum /* mode */) {
-}
+void GLES2InterfaceStub::CullFace(GLenum /* mode */) {}
void GLES2InterfaceStub::DeleteBuffers(GLsizei /* n */,
- const GLuint* /* buffers */) {
-}
+ const GLuint* /* buffers */) {}
void GLES2InterfaceStub::DeleteFramebuffers(GLsizei /* n */,
- const GLuint* /* framebuffers */) {
-}
-void GLES2InterfaceStub::DeleteProgram(GLuint /* program */) {
-}
+ const GLuint* /* framebuffers */) {}
+void GLES2InterfaceStub::DeleteProgram(GLuint /* program */) {}
void GLES2InterfaceStub::DeleteRenderbuffers(
GLsizei /* n */,
- const GLuint* /* renderbuffers */) {
-}
+ const GLuint* /* renderbuffers */) {}
void GLES2InterfaceStub::DeleteSamplers(GLsizei /* n */,
- const GLuint* /* samplers */) {
-}
-void GLES2InterfaceStub::DeleteSync(GLsync /* sync */) {
-}
-void GLES2InterfaceStub::DeleteShader(GLuint /* shader */) {
-}
+ const GLuint* /* samplers */) {}
+void GLES2InterfaceStub::DeleteSync(GLsync /* sync */) {}
+void GLES2InterfaceStub::DeleteShader(GLuint /* shader */) {}
void GLES2InterfaceStub::DeleteTextures(GLsizei /* n */,
- const GLuint* /* textures */) {
-}
+ const GLuint* /* textures */) {}
void GLES2InterfaceStub::DeleteTransformFeedbacks(GLsizei /* n */,
- const GLuint* /* ids */) {
-}
-void GLES2InterfaceStub::DepthFunc(GLenum /* func */) {
-}
-void GLES2InterfaceStub::DepthMask(GLboolean /* flag */) {
-}
+ const GLuint* /* ids */) {}
+void GLES2InterfaceStub::DepthFunc(GLenum /* func */) {}
+void GLES2InterfaceStub::DepthMask(GLboolean /* flag */) {}
void GLES2InterfaceStub::DepthRangef(GLclampf /* zNear */,
- GLclampf /* zFar */) {
-}
+ GLclampf /* zFar */) {}
void GLES2InterfaceStub::DetachShader(GLuint /* program */,
- GLuint /* shader */) {
-}
-void GLES2InterfaceStub::Disable(GLenum /* cap */) {
-}
-void GLES2InterfaceStub::DisableVertexAttribArray(GLuint /* index */) {
-}
+ GLuint /* shader */) {}
+void GLES2InterfaceStub::Disable(GLenum /* cap */) {}
+void GLES2InterfaceStub::DisableVertexAttribArray(GLuint /* index */) {}
void GLES2InterfaceStub::DrawArrays(GLenum /* mode */,
GLint /* first */,
- GLsizei /* count */) {
-}
+ GLsizei /* count */) {}
void GLES2InterfaceStub::DrawElements(GLenum /* mode */,
GLsizei /* count */,
GLenum /* type */,
- const void* /* indices */) {
-}
+ const void* /* indices */) {}
void GLES2InterfaceStub::DrawRangeElements(GLenum /* mode */,
GLuint /* start */,
GLuint /* end */,
GLsizei /* count */,
GLenum /* type */,
- const void* /* indices */) {
-}
-void GLES2InterfaceStub::Enable(GLenum /* cap */) {
-}
-void GLES2InterfaceStub::EnableVertexAttribArray(GLuint /* index */) {
-}
+ const void* /* indices */) {}
+void GLES2InterfaceStub::Enable(GLenum /* cap */) {}
+void GLES2InterfaceStub::EnableVertexAttribArray(GLuint /* index */) {}
GLsync GLES2InterfaceStub::FenceSync(GLenum /* condition */,
GLbitfield /* flags */) {
return 0;
}
-void GLES2InterfaceStub::Finish() {
-}
-void GLES2InterfaceStub::Flush() {
-}
+void GLES2InterfaceStub::Finish() {}
+void GLES2InterfaceStub::Flush() {}
void GLES2InterfaceStub::FramebufferRenderbuffer(
GLenum /* target */,
GLenum /* attachment */,
GLenum /* renderbuffertarget */,
- GLuint /* renderbuffer */) {
-}
+ GLuint /* renderbuffer */) {}
void GLES2InterfaceStub::FramebufferTexture2D(GLenum /* target */,
GLenum /* attachment */,
GLenum /* textarget */,
GLuint /* texture */,
- GLint /* level */) {
-}
+ GLint /* level */) {}
void GLES2InterfaceStub::FramebufferTextureLayer(GLenum /* target */,
GLenum /* attachment */,
GLuint /* texture */,
GLint /* level */,
- GLint /* layer */) {
-}
-void GLES2InterfaceStub::FrontFace(GLenum /* mode */) {
-}
-void GLES2InterfaceStub::GenBuffers(GLsizei /* n */, GLuint* /* buffers */) {
-}
-void GLES2InterfaceStub::GenerateMipmap(GLenum /* target */) {
-}
+ GLint /* layer */) {}
+void GLES2InterfaceStub::FrontFace(GLenum /* mode */) {}
+void GLES2InterfaceStub::GenBuffers(GLsizei /* n */, GLuint* /* buffers */) {}
+void GLES2InterfaceStub::GenerateMipmap(GLenum /* target */) {}
void GLES2InterfaceStub::GenFramebuffers(GLsizei /* n */,
- GLuint* /* framebuffers */) {
-}
+ GLuint* /* framebuffers */) {}
void GLES2InterfaceStub::GenRenderbuffers(GLsizei /* n */,
- GLuint* /* renderbuffers */) {
-}
-void GLES2InterfaceStub::GenSamplers(GLsizei /* n */, GLuint* /* samplers */) {
-}
-void GLES2InterfaceStub::GenTextures(GLsizei /* n */, GLuint* /* textures */) {
-}
+ GLuint* /* renderbuffers */) {}
+void GLES2InterfaceStub::GenSamplers(GLsizei /* n */, GLuint* /* samplers */) {}
+void GLES2InterfaceStub::GenTextures(GLsizei /* n */, GLuint* /* textures */) {}
void GLES2InterfaceStub::GenTransformFeedbacks(GLsizei /* n */,
- GLuint* /* ids */) {
-}
+ GLuint* /* ids */) {}
void GLES2InterfaceStub::GetActiveAttrib(GLuint /* program */,
GLuint /* index */,
GLsizei /* bufsize */,
GLsizei* /* length */,
GLint* /* size */,
GLenum* /* type */,
- char* /* name */) {
-}
+ char* /* name */) {}
void GLES2InterfaceStub::GetActiveUniform(GLuint /* program */,
GLuint /* index */,
GLsizei /* bufsize */,
GLsizei* /* length */,
GLint* /* size */,
GLenum* /* type */,
- char* /* name */) {
-}
+ char* /* name */) {}
void GLES2InterfaceStub::GetActiveUniformBlockiv(GLuint /* program */,
GLuint /* index */,
GLenum /* pname */,
- GLint* /* params */) {
-}
+ GLint* /* params */) {}
void GLES2InterfaceStub::GetActiveUniformBlockName(GLuint /* program */,
GLuint /* index */,
GLsizei /* bufsize */,
GLsizei* /* length */,
- char* /* name */) {
-}
+ char* /* name */) {}
void GLES2InterfaceStub::GetActiveUniformsiv(GLuint /* program */,
GLsizei /* count */,
const GLuint* /* indices */,
GLenum /* pname */,
- GLint* /* params */) {
-}
+ GLint* /* params */) {}
void GLES2InterfaceStub::GetAttachedShaders(GLuint /* program */,
GLsizei /* maxcount */,
GLsizei* /* count */,
- GLuint* /* shaders */) {
-}
+ GLuint* /* shaders */) {}
GLint GLES2InterfaceStub::GetAttribLocation(GLuint /* program */,
const char* /* name */) {
return 0;
}
void GLES2InterfaceStub::GetBooleanv(GLenum /* pname */,
- GLboolean* /* params */) {
-}
+ GLboolean* /* params */) {}
+void GLES2InterfaceStub::GetBufferParameteri64v(GLenum /* target */,
+ GLenum /* pname */,
+ GLint64* /* params */) {}
void GLES2InterfaceStub::GetBufferParameteriv(GLenum /* target */,
GLenum /* pname */,
- GLint* /* params */) {
-}
+ GLint* /* params */) {}
GLenum GLES2InterfaceStub::GetError() {
return 0;
}
-void GLES2InterfaceStub::GetFloatv(GLenum /* pname */, GLfloat* /* params */) {
-}
+void GLES2InterfaceStub::GetFloatv(GLenum /* pname */, GLfloat* /* params */) {}
GLint GLES2InterfaceStub::GetFragDataLocation(GLuint /* program */,
const char* /* name */) {
return 0;
@@ -366,67 +292,52 @@ void GLES2InterfaceStub::GetFramebufferAttachmentParameteriv(
GLenum /* target */,
GLenum /* attachment */,
GLenum /* pname */,
- GLint* /* params */) {
-}
+ GLint* /* params */) {}
void GLES2InterfaceStub::GetInteger64v(GLenum /* pname */,
- GLint64* /* params */) {
-}
+ GLint64* /* params */) {}
void GLES2InterfaceStub::GetIntegeri_v(GLenum /* pname */,
GLuint /* index */,
- GLint* /* data */) {
-}
+ GLint* /* data */) {}
void GLES2InterfaceStub::GetInteger64i_v(GLenum /* pname */,
GLuint /* index */,
- GLint64* /* data */) {
-}
-void GLES2InterfaceStub::GetIntegerv(GLenum /* pname */, GLint* /* params */) {
-}
+ GLint64* /* data */) {}
+void GLES2InterfaceStub::GetIntegerv(GLenum /* pname */, GLint* /* params */) {}
void GLES2InterfaceStub::GetInternalformativ(GLenum /* target */,
GLenum /* format */,
GLenum /* pname */,
GLsizei /* bufSize */,
- GLint* /* params */) {
-}
+ GLint* /* params */) {}
void GLES2InterfaceStub::GetProgramiv(GLuint /* program */,
GLenum /* pname */,
- GLint* /* params */) {
-}
+ GLint* /* params */) {}
void GLES2InterfaceStub::GetProgramInfoLog(GLuint /* program */,
GLsizei /* bufsize */,
GLsizei* /* length */,
- char* /* infolog */) {
-}
+ char* /* infolog */) {}
void GLES2InterfaceStub::GetRenderbufferParameteriv(GLenum /* target */,
GLenum /* pname */,
- GLint* /* params */) {
-}
+ GLint* /* params */) {}
void GLES2InterfaceStub::GetSamplerParameterfv(GLuint /* sampler */,
GLenum /* pname */,
- GLfloat* /* params */) {
-}
+ GLfloat* /* params */) {}
void GLES2InterfaceStub::GetSamplerParameteriv(GLuint /* sampler */,
GLenum /* pname */,
- GLint* /* params */) {
-}
+ GLint* /* params */) {}
void GLES2InterfaceStub::GetShaderiv(GLuint /* shader */,
GLenum /* pname */,
- GLint* /* params */) {
-}
+ GLint* /* params */) {}
void GLES2InterfaceStub::GetShaderInfoLog(GLuint /* shader */,
GLsizei /* bufsize */,
GLsizei* /* length */,
- char* /* infolog */) {
-}
+ char* /* infolog */) {}
void GLES2InterfaceStub::GetShaderPrecisionFormat(GLenum /* shadertype */,
GLenum /* precisiontype */,
GLint* /* range */,
- GLint* /* precision */) {
-}
+ GLint* /* precision */) {}
void GLES2InterfaceStub::GetShaderSource(GLuint /* shader */,
GLsizei /* bufsize */,
GLsizei* /* length */,
- char* /* source */) {
-}
+ char* /* source */) {}
const GLubyte* GLES2InterfaceStub::GetString(GLenum /* name */) {
return 0;
}
@@ -434,76 +345,61 @@ void GLES2InterfaceStub::GetSynciv(GLsync /* sync */,
GLenum /* pname */,
GLsizei /* bufsize */,
GLsizei* /* length */,
- GLint* /* values */) {
-}
+ GLint* /* values */) {}
void GLES2InterfaceStub::GetTexParameterfv(GLenum /* target */,
GLenum /* pname */,
- GLfloat* /* params */) {
-}
+ GLfloat* /* params */) {}
void GLES2InterfaceStub::GetTexParameteriv(GLenum /* target */,
GLenum /* pname */,
- GLint* /* params */) {
-}
+ GLint* /* params */) {}
void GLES2InterfaceStub::GetTransformFeedbackVarying(GLuint /* program */,
GLuint /* index */,
GLsizei /* bufsize */,
GLsizei* /* length */,
GLsizei* /* size */,
GLenum* /* type */,
- char* /* name */) {
-}
+ char* /* name */) {}
GLuint GLES2InterfaceStub::GetUniformBlockIndex(GLuint /* program */,
const char* /* name */) {
return 0;
}
void GLES2InterfaceStub::GetUniformfv(GLuint /* program */,
GLint /* location */,
- GLfloat* /* params */) {
-}
+ GLfloat* /* params */) {}
void GLES2InterfaceStub::GetUniformiv(GLuint /* program */,
GLint /* location */,
- GLint* /* params */) {
-}
+ GLint* /* params */) {}
void GLES2InterfaceStub::GetUniformuiv(GLuint /* program */,
GLint /* location */,
- GLuint* /* params */) {
-}
+ GLuint* /* params */) {}
void GLES2InterfaceStub::GetUniformIndices(GLuint /* program */,
GLsizei /* count */,
const char* const* /* names */,
- GLuint* /* indices */) {
-}
+ GLuint* /* indices */) {}
GLint GLES2InterfaceStub::GetUniformLocation(GLuint /* program */,
const char* /* name */) {
return 0;
}
void GLES2InterfaceStub::GetVertexAttribfv(GLuint /* index */,
GLenum /* pname */,
- GLfloat* /* params */) {
-}
+ GLfloat* /* params */) {}
void GLES2InterfaceStub::GetVertexAttribiv(GLuint /* index */,
GLenum /* pname */,
- GLint* /* params */) {
-}
+ GLint* /* params */) {}
void GLES2InterfaceStub::GetVertexAttribIiv(GLuint /* index */,
GLenum /* pname */,
- GLint* /* params */) {
-}
+ GLint* /* params */) {}
void GLES2InterfaceStub::GetVertexAttribIuiv(GLuint /* index */,
GLenum /* pname */,
- GLuint* /* params */) {
-}
+ GLuint* /* params */) {}
void GLES2InterfaceStub::GetVertexAttribPointerv(GLuint /* index */,
GLenum /* pname */,
- void** /* pointer */) {
-}
-void GLES2InterfaceStub::Hint(GLenum /* target */, GLenum /* mode */) {
-}
+ void** /* pointer */) {}
+void GLES2InterfaceStub::Hint(GLenum /* target */, GLenum /* mode */) {}
void GLES2InterfaceStub::InvalidateFramebuffer(
GLenum /* target */,
GLsizei /* count */,
- const GLenum* /* attachments */) {
-}
+ const GLenum* /* attachments */) {}
void GLES2InterfaceStub::InvalidateSubFramebuffer(
GLenum /* target */,
GLsizei /* count */,
@@ -511,8 +407,7 @@ void GLES2InterfaceStub::InvalidateSubFramebuffer(
GLint /* x */,
GLint /* y */,
GLsizei /* width */,
- GLsizei /* height */) {
-}
+ GLsizei /* height */) {}
GLboolean GLES2InterfaceStub::IsBuffer(GLuint /* buffer */) {
return 0;
}
@@ -544,100 +439,73 @@ GLboolean GLES2InterfaceStub::IsTransformFeedback(
GLuint /* transformfeedback */) {
return 0;
}
-void GLES2InterfaceStub::LineWidth(GLfloat /* width */) {
-}
-void GLES2InterfaceStub::LinkProgram(GLuint /* program */) {
-}
-void GLES2InterfaceStub::PauseTransformFeedback() {
-}
-void GLES2InterfaceStub::PixelStorei(GLenum /* pname */, GLint /* param */) {
-}
+void GLES2InterfaceStub::LineWidth(GLfloat /* width */) {}
+void GLES2InterfaceStub::LinkProgram(GLuint /* program */) {}
+void GLES2InterfaceStub::PauseTransformFeedback() {}
+void GLES2InterfaceStub::PixelStorei(GLenum /* pname */, GLint /* param */) {}
void GLES2InterfaceStub::PolygonOffset(GLfloat /* factor */,
- GLfloat /* units */) {
-}
-void GLES2InterfaceStub::ReadBuffer(GLenum /* src */) {
-}
+ GLfloat /* units */) {}
+void GLES2InterfaceStub::ReadBuffer(GLenum /* src */) {}
void GLES2InterfaceStub::ReadPixels(GLint /* x */,
GLint /* y */,
GLsizei /* width */,
GLsizei /* height */,
GLenum /* format */,
GLenum /* type */,
- void* /* pixels */) {
-}
-void GLES2InterfaceStub::ReleaseShaderCompiler() {
-}
+ void* /* pixels */) {}
+void GLES2InterfaceStub::ReleaseShaderCompiler() {}
void GLES2InterfaceStub::RenderbufferStorage(GLenum /* target */,
GLenum /* internalformat */,
GLsizei /* width */,
- GLsizei /* height */) {
-}
-void GLES2InterfaceStub::ResumeTransformFeedback() {
-}
+ GLsizei /* height */) {}
+void GLES2InterfaceStub::ResumeTransformFeedback() {}
void GLES2InterfaceStub::SampleCoverage(GLclampf /* value */,
- GLboolean /* invert */) {
-}
+ GLboolean /* invert */) {}
void GLES2InterfaceStub::SamplerParameterf(GLuint /* sampler */,
GLenum /* pname */,
- GLfloat /* param */) {
-}
+ GLfloat /* param */) {}
void GLES2InterfaceStub::SamplerParameterfv(GLuint /* sampler */,
GLenum /* pname */,
- const GLfloat* /* params */) {
-}
+ const GLfloat* /* params */) {}
void GLES2InterfaceStub::SamplerParameteri(GLuint /* sampler */,
GLenum /* pname */,
- GLint /* param */) {
-}
+ GLint /* param */) {}
void GLES2InterfaceStub::SamplerParameteriv(GLuint /* sampler */,
GLenum /* pname */,
- const GLint* /* params */) {
-}
+ const GLint* /* params */) {}
void GLES2InterfaceStub::Scissor(GLint /* x */,
GLint /* y */,
GLsizei /* width */,
- GLsizei /* height */) {
-}
+ GLsizei /* height */) {}
void GLES2InterfaceStub::ShaderBinary(GLsizei /* n */,
const GLuint* /* shaders */,
GLenum /* binaryformat */,
const void* /* binary */,
- GLsizei /* length */) {
-}
+ GLsizei /* length */) {}
void GLES2InterfaceStub::ShaderSource(GLuint /* shader */,
GLsizei /* count */,
const GLchar* const* /* str */,
- const GLint* /* length */) {
-}
-void GLES2InterfaceStub::ShallowFinishCHROMIUM() {
-}
-void GLES2InterfaceStub::ShallowFlushCHROMIUM() {
-}
-void GLES2InterfaceStub::OrderingBarrierCHROMIUM() {
-}
+ const GLint* /* length */) {}
+void GLES2InterfaceStub::ShallowFinishCHROMIUM() {}
+void GLES2InterfaceStub::ShallowFlushCHROMIUM() {}
+void GLES2InterfaceStub::OrderingBarrierCHROMIUM() {}
void GLES2InterfaceStub::StencilFunc(GLenum /* func */,
GLint /* ref */,
- GLuint /* mask */) {
-}
+ GLuint /* mask */) {}
void GLES2InterfaceStub::StencilFuncSeparate(GLenum /* face */,
GLenum /* func */,
GLint /* ref */,
- GLuint /* mask */) {
-}
-void GLES2InterfaceStub::StencilMask(GLuint /* mask */) {
-}
+ GLuint /* mask */) {}
+void GLES2InterfaceStub::StencilMask(GLuint /* mask */) {}
void GLES2InterfaceStub::StencilMaskSeparate(GLenum /* face */,
- GLuint /* mask */) {
-}
+ GLuint /* mask */) {}
void GLES2InterfaceStub::StencilOp(GLenum /* fail */,
GLenum /* zfail */,
- GLenum /* zpass */) {
-}
+ GLenum /* zpass */) {}
void GLES2InterfaceStub::StencilOpSeparate(GLenum /* face */,
GLenum /* fail */,
GLenum /* zfail */,
- GLenum /* zpass */) {
-}
+ GLenum /* zpass */) {}
void GLES2InterfaceStub::TexImage2D(GLenum /* target */,
GLint /* level */,
GLint /* internalformat */,
@@ -646,8 +514,7 @@ void GLES2InterfaceStub::TexImage2D(GLenum /* target */,
GLint /* border */,
GLenum /* format */,
GLenum /* type */,
- const void* /* pixels */) {
-}
+ const void* /* pixels */) {}
void GLES2InterfaceStub::TexImage3D(GLenum /* target */,
GLint /* level */,
GLint /* internalformat */,
@@ -657,31 +524,25 @@ void GLES2InterfaceStub::TexImage3D(GLenum /* target */,
GLint /* border */,
GLenum /* format */,
GLenum /* type */,
- const void* /* pixels */) {
-}
+ const void* /* pixels */) {}
void GLES2InterfaceStub::TexParameterf(GLenum /* target */,
GLenum /* pname */,
- GLfloat /* param */) {
-}
+ GLfloat /* param */) {}
void GLES2InterfaceStub::TexParameterfv(GLenum /* target */,
GLenum /* pname */,
- const GLfloat* /* params */) {
-}
+ const GLfloat* /* params */) {}
void GLES2InterfaceStub::TexParameteri(GLenum /* target */,
GLenum /* pname */,
- GLint /* param */) {
-}
+ GLint /* param */) {}
void GLES2InterfaceStub::TexParameteriv(GLenum /* target */,
GLenum /* pname */,
- const GLint* /* params */) {
-}
+ const GLint* /* params */) {}
void GLES2InterfaceStub::TexStorage3D(GLenum /* target */,
GLsizei /* levels */,
GLenum /* internalFormat */,
GLsizei /* width */,
GLsizei /* height */,
- GLsizei /* depth */) {
-}
+ GLsizei /* depth */) {}
void GLES2InterfaceStub::TexSubImage2D(GLenum /* target */,
GLint /* level */,
GLint /* xoffset */,
@@ -690,8 +551,7 @@ void GLES2InterfaceStub::TexSubImage2D(GLenum /* target */,
GLsizei /* height */,
GLenum /* format */,
GLenum /* type */,
- const void* /* pixels */) {
-}
+ const void* /* pixels */) {}
void GLES2InterfaceStub::TexSubImage3D(GLenum /* target */,
GLint /* level */,
GLint /* xoffset */,
@@ -702,235 +562,181 @@ void GLES2InterfaceStub::TexSubImage3D(GLenum /* target */,
GLsizei /* depth */,
GLenum /* format */,
GLenum /* type */,
- const void* /* pixels */) {
-}
+ const void* /* pixels */) {}
void GLES2InterfaceStub::TransformFeedbackVaryings(
GLuint /* program */,
GLsizei /* count */,
const char* const* /* varyings */,
- GLenum /* buffermode */) {
-}
-void GLES2InterfaceStub::Uniform1f(GLint /* location */, GLfloat /* x */) {
-}
+ GLenum /* buffermode */) {}
+void GLES2InterfaceStub::Uniform1f(GLint /* location */, GLfloat /* x */) {}
void GLES2InterfaceStub::Uniform1fv(GLint /* location */,
GLsizei /* count */,
- const GLfloat* /* v */) {
-}
-void GLES2InterfaceStub::Uniform1i(GLint /* location */, GLint /* x */) {
-}
+ const GLfloat* /* v */) {}
+void GLES2InterfaceStub::Uniform1i(GLint /* location */, GLint /* x */) {}
void GLES2InterfaceStub::Uniform1iv(GLint /* location */,
GLsizei /* count */,
- const GLint* /* v */) {
-}
-void GLES2InterfaceStub::Uniform1ui(GLint /* location */, GLuint /* x */) {
-}
+ const GLint* /* v */) {}
+void GLES2InterfaceStub::Uniform1ui(GLint /* location */, GLuint /* x */) {}
void GLES2InterfaceStub::Uniform1uiv(GLint /* location */,
GLsizei /* count */,
- const GLuint* /* v */) {
-}
+ const GLuint* /* v */) {}
void GLES2InterfaceStub::Uniform2f(GLint /* location */,
GLfloat /* x */,
- GLfloat /* y */) {
-}
+ GLfloat /* y */) {}
void GLES2InterfaceStub::Uniform2fv(GLint /* location */,
GLsizei /* count */,
- const GLfloat* /* v */) {
-}
+ const GLfloat* /* v */) {}
void GLES2InterfaceStub::Uniform2i(GLint /* location */,
GLint /* x */,
- GLint /* y */) {
-}
+ GLint /* y */) {}
void GLES2InterfaceStub::Uniform2iv(GLint /* location */,
GLsizei /* count */,
- const GLint* /* v */) {
-}
+ const GLint* /* v */) {}
void GLES2InterfaceStub::Uniform2ui(GLint /* location */,
GLuint /* x */,
- GLuint /* y */) {
-}
+ GLuint /* y */) {}
void GLES2InterfaceStub::Uniform2uiv(GLint /* location */,
GLsizei /* count */,
- const GLuint* /* v */) {
-}
+ const GLuint* /* v */) {}
void GLES2InterfaceStub::Uniform3f(GLint /* location */,
GLfloat /* x */,
GLfloat /* y */,
- GLfloat /* z */) {
-}
+ GLfloat /* z */) {}
void GLES2InterfaceStub::Uniform3fv(GLint /* location */,
GLsizei /* count */,
- const GLfloat* /* v */) {
-}
+ const GLfloat* /* v */) {}
void GLES2InterfaceStub::Uniform3i(GLint /* location */,
GLint /* x */,
GLint /* y */,
- GLint /* z */) {
-}
+ GLint /* z */) {}
void GLES2InterfaceStub::Uniform3iv(GLint /* location */,
GLsizei /* count */,
- const GLint* /* v */) {
-}
+ const GLint* /* v */) {}
void GLES2InterfaceStub::Uniform3ui(GLint /* location */,
GLuint /* x */,
GLuint /* y */,
- GLuint /* z */) {
-}
+ GLuint /* z */) {}
void GLES2InterfaceStub::Uniform3uiv(GLint /* location */,
GLsizei /* count */,
- const GLuint* /* v */) {
-}
+ const GLuint* /* v */) {}
void GLES2InterfaceStub::Uniform4f(GLint /* location */,
GLfloat /* x */,
GLfloat /* y */,
GLfloat /* z */,
- GLfloat /* w */) {
-}
+ GLfloat /* w */) {}
void GLES2InterfaceStub::Uniform4fv(GLint /* location */,
GLsizei /* count */,
- const GLfloat* /* v */) {
-}
+ const GLfloat* /* v */) {}
void GLES2InterfaceStub::Uniform4i(GLint /* location */,
GLint /* x */,
GLint /* y */,
GLint /* z */,
- GLint /* w */) {
-}
+ GLint /* w */) {}
void GLES2InterfaceStub::Uniform4iv(GLint /* location */,
GLsizei /* count */,
- const GLint* /* v */) {
-}
+ const GLint* /* v */) {}
void GLES2InterfaceStub::Uniform4ui(GLint /* location */,
GLuint /* x */,
GLuint /* y */,
GLuint /* z */,
- GLuint /* w */) {
-}
+ GLuint /* w */) {}
void GLES2InterfaceStub::Uniform4uiv(GLint /* location */,
GLsizei /* count */,
- const GLuint* /* v */) {
-}
+ const GLuint* /* v */) {}
void GLES2InterfaceStub::UniformBlockBinding(GLuint /* program */,
GLuint /* index */,
- GLuint /* binding */) {
-}
+ GLuint /* binding */) {}
void GLES2InterfaceStub::UniformMatrix2fv(GLint /* location */,
GLsizei /* count */,
GLboolean /* transpose */,
- const GLfloat* /* value */) {
-}
+ const GLfloat* /* value */) {}
void GLES2InterfaceStub::UniformMatrix2x3fv(GLint /* location */,
GLsizei /* count */,
GLboolean /* transpose */,
- const GLfloat* /* value */) {
-}
+ const GLfloat* /* value */) {}
void GLES2InterfaceStub::UniformMatrix2x4fv(GLint /* location */,
GLsizei /* count */,
GLboolean /* transpose */,
- const GLfloat* /* value */) {
-}
+ const GLfloat* /* value */) {}
void GLES2InterfaceStub::UniformMatrix3fv(GLint /* location */,
GLsizei /* count */,
GLboolean /* transpose */,
- const GLfloat* /* value */) {
-}
+ const GLfloat* /* value */) {}
void GLES2InterfaceStub::UniformMatrix3x2fv(GLint /* location */,
GLsizei /* count */,
GLboolean /* transpose */,
- const GLfloat* /* value */) {
-}
+ const GLfloat* /* value */) {}
void GLES2InterfaceStub::UniformMatrix3x4fv(GLint /* location */,
GLsizei /* count */,
GLboolean /* transpose */,
- const GLfloat* /* value */) {
-}
+ const GLfloat* /* value */) {}
void GLES2InterfaceStub::UniformMatrix4fv(GLint /* location */,
GLsizei /* count */,
GLboolean /* transpose */,
- const GLfloat* /* value */) {
-}
+ const GLfloat* /* value */) {}
void GLES2InterfaceStub::UniformMatrix4x2fv(GLint /* location */,
GLsizei /* count */,
GLboolean /* transpose */,
- const GLfloat* /* value */) {
-}
+ const GLfloat* /* value */) {}
void GLES2InterfaceStub::UniformMatrix4x3fv(GLint /* location */,
GLsizei /* count */,
GLboolean /* transpose */,
- const GLfloat* /* value */) {
-}
-void GLES2InterfaceStub::UseProgram(GLuint /* program */) {
-}
-void GLES2InterfaceStub::ValidateProgram(GLuint /* program */) {
-}
-void GLES2InterfaceStub::VertexAttrib1f(GLuint /* indx */, GLfloat /* x */) {
-}
+ const GLfloat* /* value */) {}
+void GLES2InterfaceStub::UseProgram(GLuint /* program */) {}
+void GLES2InterfaceStub::ValidateProgram(GLuint /* program */) {}
+void GLES2InterfaceStub::VertexAttrib1f(GLuint /* indx */, GLfloat /* x */) {}
void GLES2InterfaceStub::VertexAttrib1fv(GLuint /* indx */,
- const GLfloat* /* values */) {
-}
+ const GLfloat* /* values */) {}
void GLES2InterfaceStub::VertexAttrib2f(GLuint /* indx */,
GLfloat /* x */,
- GLfloat /* y */) {
-}
+ GLfloat /* y */) {}
void GLES2InterfaceStub::VertexAttrib2fv(GLuint /* indx */,
- const GLfloat* /* values */) {
-}
+ const GLfloat* /* values */) {}
void GLES2InterfaceStub::VertexAttrib3f(GLuint /* indx */,
GLfloat /* x */,
GLfloat /* y */,
- GLfloat /* z */) {
-}
+ GLfloat /* z */) {}
void GLES2InterfaceStub::VertexAttrib3fv(GLuint /* indx */,
- const GLfloat* /* values */) {
-}
+ const GLfloat* /* values */) {}
void GLES2InterfaceStub::VertexAttrib4f(GLuint /* indx */,
GLfloat /* x */,
GLfloat /* y */,
GLfloat /* z */,
- GLfloat /* w */) {
-}
+ GLfloat /* w */) {}
void GLES2InterfaceStub::VertexAttrib4fv(GLuint /* indx */,
- const GLfloat* /* values */) {
-}
+ const GLfloat* /* values */) {}
void GLES2InterfaceStub::VertexAttribI4i(GLuint /* indx */,
GLint /* x */,
GLint /* y */,
GLint /* z */,
- GLint /* w */) {
-}
+ GLint /* w */) {}
void GLES2InterfaceStub::VertexAttribI4iv(GLuint /* indx */,
- const GLint* /* values */) {
-}
+ const GLint* /* values */) {}
void GLES2InterfaceStub::VertexAttribI4ui(GLuint /* indx */,
GLuint /* x */,
GLuint /* y */,
GLuint /* z */,
- GLuint /* w */) {
-}
+ GLuint /* w */) {}
void GLES2InterfaceStub::VertexAttribI4uiv(GLuint /* indx */,
- const GLuint* /* values */) {
-}
+ const GLuint* /* values */) {}
void GLES2InterfaceStub::VertexAttribIPointer(GLuint /* indx */,
GLint /* size */,
GLenum /* type */,
GLsizei /* stride */,
- const void* /* ptr */) {
-}
+ const void* /* ptr */) {}
void GLES2InterfaceStub::VertexAttribPointer(GLuint /* indx */,
GLint /* size */,
GLenum /* type */,
GLboolean /* normalized */,
GLsizei /* stride */,
- const void* /* ptr */) {
-}
+ const void* /* ptr */) {}
void GLES2InterfaceStub::Viewport(GLint /* x */,
GLint /* y */,
GLsizei /* width */,
- GLsizei /* height */) {
-}
+ GLsizei /* height */) {}
void GLES2InterfaceStub::WaitSync(GLsync /* sync */,
GLbitfield /* flags */,
- GLuint64 /* timeout */) {
-}
+ GLuint64 /* timeout */) {}
void GLES2InterfaceStub::BlitFramebufferCHROMIUM(GLint /* srcX0 */,
GLint /* srcY0 */,
GLint /* srcX1 */,
@@ -940,85 +746,74 @@ void GLES2InterfaceStub::BlitFramebufferCHROMIUM(GLint /* srcX0 */,
GLint /* dstX1 */,
GLint /* dstY1 */,
GLbitfield /* mask */,
- GLenum /* filter */) {
-}
+ GLenum /* filter */) {}
void GLES2InterfaceStub::RenderbufferStorageMultisampleCHROMIUM(
GLenum /* target */,
GLsizei /* samples */,
GLenum /* internalformat */,
GLsizei /* width */,
- GLsizei /* height */) {
-}
+ GLsizei /* height */) {}
void GLES2InterfaceStub::RenderbufferStorageMultisampleEXT(
GLenum /* target */,
GLsizei /* samples */,
GLenum /* internalformat */,
GLsizei /* width */,
- GLsizei /* height */) {
-}
+ GLsizei /* height */) {}
void GLES2InterfaceStub::FramebufferTexture2DMultisampleEXT(
GLenum /* target */,
GLenum /* attachment */,
GLenum /* textarget */,
GLuint /* texture */,
GLint /* level */,
- GLsizei /* samples */) {
-}
+ GLsizei /* samples */) {}
void GLES2InterfaceStub::TexStorage2DEXT(GLenum /* target */,
GLsizei /* levels */,
GLenum /* internalFormat */,
GLsizei /* width */,
- GLsizei /* height */) {
-}
+ GLsizei /* height */) {}
void GLES2InterfaceStub::GenQueriesEXT(GLsizei /* n */, GLuint* /* queries */) {
}
void GLES2InterfaceStub::DeleteQueriesEXT(GLsizei /* n */,
- const GLuint* /* queries */) {
+ const GLuint* /* queries */) {}
+void GLES2InterfaceStub::QueryCounterEXT(GLuint /* id */, GLenum /* target */) {
}
GLboolean GLES2InterfaceStub::IsQueryEXT(GLuint /* id */) {
return 0;
}
-void GLES2InterfaceStub::BeginQueryEXT(GLenum /* target */, GLuint /* id */) {
-}
-void GLES2InterfaceStub::BeginTransformFeedback(GLenum /* primitivemode */) {
-}
-void GLES2InterfaceStub::EndQueryEXT(GLenum /* target */) {
-}
-void GLES2InterfaceStub::EndTransformFeedback() {
-}
+void GLES2InterfaceStub::BeginQueryEXT(GLenum /* target */, GLuint /* id */) {}
+void GLES2InterfaceStub::BeginTransformFeedback(GLenum /* primitivemode */) {}
+void GLES2InterfaceStub::EndQueryEXT(GLenum /* target */) {}
+void GLES2InterfaceStub::EndTransformFeedback() {}
void GLES2InterfaceStub::GetQueryivEXT(GLenum /* target */,
GLenum /* pname */,
- GLint* /* params */) {
-}
+ GLint* /* params */) {}
+void GLES2InterfaceStub::GetQueryObjectivEXT(GLuint /* id */,
+ GLenum /* pname */,
+ GLint* /* params */) {}
void GLES2InterfaceStub::GetQueryObjectuivEXT(GLuint /* id */,
GLenum /* pname */,
- GLuint* /* params */) {
-}
+ GLuint* /* params */) {}
+void GLES2InterfaceStub::GetQueryObjecti64vEXT(GLuint /* id */,
+ GLenum /* pname */,
+ GLint64* /* params */) {}
void GLES2InterfaceStub::GetQueryObjectui64vEXT(GLuint /* id */,
GLenum /* pname */,
- GLuint64* /* params */) {
-}
+ GLuint64* /* params */) {}
+void GLES2InterfaceStub::SetDisjointValueSyncCHROMIUM() {}
void GLES2InterfaceStub::InsertEventMarkerEXT(GLsizei /* length */,
- const GLchar* /* marker */) {
-}
+ const GLchar* /* marker */) {}
void GLES2InterfaceStub::PushGroupMarkerEXT(GLsizei /* length */,
- const GLchar* /* marker */) {
-}
-void GLES2InterfaceStub::PopGroupMarkerEXT() {
-}
+ const GLchar* /* marker */) {}
+void GLES2InterfaceStub::PopGroupMarkerEXT() {}
void GLES2InterfaceStub::GenVertexArraysOES(GLsizei /* n */,
- GLuint* /* arrays */) {
-}
+ GLuint* /* arrays */) {}
void GLES2InterfaceStub::DeleteVertexArraysOES(GLsizei /* n */,
- const GLuint* /* arrays */) {
-}
+ const GLuint* /* arrays */) {}
GLboolean GLES2InterfaceStub::IsVertexArrayOES(GLuint /* array */) {
return 0;
}
-void GLES2InterfaceStub::BindVertexArrayOES(GLuint /* array */) {
-}
-void GLES2InterfaceStub::SwapBuffers() {
-}
+void GLES2InterfaceStub::BindVertexArrayOES(GLuint /* array */) {}
+void GLES2InterfaceStub::SwapBuffers() {}
GLuint GLES2InterfaceStub::GetMaxValueInBufferCHROMIUM(GLuint /* buffer_id */,
GLsizei /* count */,
GLenum /* type */,
@@ -1041,8 +836,7 @@ void* GLES2InterfaceStub::MapBufferSubDataCHROMIUM(GLuint /* target */,
GLenum /* access */) {
return 0;
}
-void GLES2InterfaceStub::UnmapBufferSubDataCHROMIUM(const void* /* mem */) {
-}
+void GLES2InterfaceStub::UnmapBufferSubDataCHROMIUM(const void* /* mem */) {}
void* GLES2InterfaceStub::MapBufferRange(GLenum /* target */,
GLintptr /* offset */,
GLsizeiptr /* size */,
@@ -1063,40 +857,32 @@ void* GLES2InterfaceStub::MapTexSubImage2DCHROMIUM(GLenum /* target */,
GLenum /* access */) {
return 0;
}
-void GLES2InterfaceStub::UnmapTexSubImage2DCHROMIUM(const void* /* mem */) {
-}
+void GLES2InterfaceStub::UnmapTexSubImage2DCHROMIUM(const void* /* mem */) {}
void GLES2InterfaceStub::ResizeCHROMIUM(GLuint /* width */,
GLuint /* height */,
- GLfloat /* scale_factor */) {
-}
+ GLfloat /* scale_factor */) {}
const GLchar* GLES2InterfaceStub::GetRequestableExtensionsCHROMIUM() {
return 0;
}
void GLES2InterfaceStub::RequestExtensionCHROMIUM(const char* /* extension */) {
}
-void GLES2InterfaceStub::RateLimitOffscreenContextCHROMIUM() {
-}
void GLES2InterfaceStub::GetProgramInfoCHROMIUM(GLuint /* program */,
GLsizei /* bufsize */,
GLsizei* /* size */,
- void* /* info */) {
-}
+ void* /* info */) {}
void GLES2InterfaceStub::GetUniformBlocksCHROMIUM(GLuint /* program */,
GLsizei /* bufsize */,
GLsizei* /* size */,
- void* /* info */) {
-}
+ void* /* info */) {}
void GLES2InterfaceStub::GetTransformFeedbackVaryingsCHROMIUM(
GLuint /* program */,
GLsizei /* bufsize */,
GLsizei* /* size */,
- void* /* info */) {
-}
+ void* /* info */) {}
void GLES2InterfaceStub::GetUniformsES3CHROMIUM(GLuint /* program */,
GLsizei /* bufsize */,
GLsizei* /* size */,
- void* /* info */) {
-}
+ void* /* info */) {}
GLuint GLES2InterfaceStub::CreateStreamTextureCHROMIUM(GLuint /* texture */) {
return 0;
}
@@ -1106,8 +892,7 @@ GLuint GLES2InterfaceStub::CreateImageCHROMIUM(ClientBuffer /* buffer */,
GLenum /* internalformat */) {
return 0;
}
-void GLES2InterfaceStub::DestroyImageCHROMIUM(GLuint /* image_id */) {
-}
+void GLES2InterfaceStub::DestroyImageCHROMIUM(GLuint /* image_id */) {}
GLuint GLES2InterfaceStub::CreateGpuMemoryBufferImageCHROMIUM(
GLsizei /* width */,
GLsizei /* height */,
@@ -1118,19 +903,16 @@ GLuint GLES2InterfaceStub::CreateGpuMemoryBufferImageCHROMIUM(
void GLES2InterfaceStub::GetTranslatedShaderSourceANGLE(GLuint /* shader */,
GLsizei /* bufsize */,
GLsizei* /* length */,
- char* /* source */) {
-}
+ char* /* source */) {}
void GLES2InterfaceStub::PostSubBufferCHROMIUM(GLint /* x */,
GLint /* y */,
GLint /* width */,
- GLint /* height */) {
-}
+ GLint /* height */) {}
void GLES2InterfaceStub::TexImageIOSurface2DCHROMIUM(GLenum /* target */,
GLsizei /* width */,
GLsizei /* height */,
GLuint /* ioSurfaceId */,
- GLuint /* plane */) {
-}
+ GLuint /* plane */) {}
void GLES2InterfaceStub::CopyTextureCHROMIUM(
GLenum /* target */,
GLenum /* source_id */,
@@ -1139,8 +921,7 @@ void GLES2InterfaceStub::CopyTextureCHROMIUM(
GLenum /* dest_type */,
GLboolean /* unpack_flip_y */,
GLboolean /* unpack_premultiply_alpha */,
- GLboolean /* unpack_unmultiply_alpha */) {
-}
+ GLboolean /* unpack_unmultiply_alpha */) {}
void GLES2InterfaceStub::CopySubTextureCHROMIUM(
GLenum /* target */,
GLenum /* source_id */,
@@ -1153,39 +934,40 @@ void GLES2InterfaceStub::CopySubTextureCHROMIUM(
GLsizei /* height */,
GLboolean /* unpack_flip_y */,
GLboolean /* unpack_premultiply_alpha */,
- GLboolean /* unpack_unmultiply_alpha */) {
-}
+ GLboolean /* unpack_unmultiply_alpha */) {}
void GLES2InterfaceStub::CompressedCopyTextureCHROMIUM(GLenum /* target */,
GLenum /* source_id */,
- GLenum /* dest_id */) {
-}
+ GLenum /* dest_id */) {}
+void GLES2InterfaceStub::CompressedCopySubTextureCHROMIUM(
+ GLenum /* target */,
+ GLenum /* source_id */,
+ GLenum /* dest_id */,
+ GLint /* xoffset */,
+ GLint /* yoffset */,
+ GLint /* x */,
+ GLint /* y */,
+ GLsizei /* width */,
+ GLsizei /* height */) {}
void GLES2InterfaceStub::DrawArraysInstancedANGLE(GLenum /* mode */,
GLint /* first */,
GLsizei /* count */,
- GLsizei /* primcount */) {
-}
+ GLsizei /* primcount */) {}
void GLES2InterfaceStub::DrawElementsInstancedANGLE(GLenum /* mode */,
GLsizei /* count */,
GLenum /* type */,
const void* /* indices */,
- GLsizei /* primcount */) {
-}
+ GLsizei /* primcount */) {}
void GLES2InterfaceStub::VertexAttribDivisorANGLE(GLuint /* index */,
- GLuint /* divisor */) {
-}
-void GLES2InterfaceStub::GenMailboxCHROMIUM(GLbyte* /* mailbox */) {
-}
+ GLuint /* divisor */) {}
+void GLES2InterfaceStub::GenMailboxCHROMIUM(GLbyte* /* mailbox */) {}
void GLES2InterfaceStub::ProduceTextureCHROMIUM(GLenum /* target */,
- const GLbyte* /* mailbox */) {
-}
+ const GLbyte* /* mailbox */) {}
void GLES2InterfaceStub::ProduceTextureDirectCHROMIUM(
GLuint /* texture */,
GLenum /* target */,
- const GLbyte* /* mailbox */) {
-}
+ const GLbyte* /* mailbox */) {}
void GLES2InterfaceStub::ConsumeTextureCHROMIUM(GLenum /* target */,
- const GLbyte* /* mailbox */) {
-}
+ const GLbyte* /* mailbox */) {}
GLuint GLES2InterfaceStub::CreateAndConsumeTextureCHROMIUM(
GLenum /* target */,
const GLbyte* /* mailbox */) {
@@ -1193,24 +975,19 @@ GLuint GLES2InterfaceStub::CreateAndConsumeTextureCHROMIUM(
}
void GLES2InterfaceStub::BindUniformLocationCHROMIUM(GLuint /* program */,
GLint /* location */,
- const char* /* name */) {
-}
+ const char* /* name */) {}
void GLES2InterfaceStub::GenValuebuffersCHROMIUM(GLsizei /* n */,
- GLuint* /* buffers */) {
-}
+ GLuint* /* buffers */) {}
void GLES2InterfaceStub::DeleteValuebuffersCHROMIUM(
GLsizei /* n */,
- const GLuint* /* valuebuffers */) {
-}
+ const GLuint* /* valuebuffers */) {}
GLboolean GLES2InterfaceStub::IsValuebufferCHROMIUM(GLuint /* valuebuffer */) {
return 0;
}
void GLES2InterfaceStub::BindValuebufferCHROMIUM(GLenum /* target */,
- GLuint /* valuebuffer */) {
-}
+ GLuint /* valuebuffer */) {}
void GLES2InterfaceStub::SubscribeValueCHROMIUM(GLenum /* target */,
- GLenum /* subscription */) {
-}
+ GLenum /* subscription */) {}
void GLES2InterfaceStub::PopulateSubscribedValuesCHROMIUM(GLenum /* target */) {
}
void GLES2InterfaceStub::UniformValuebufferCHROMIUM(GLint /* location */,
@@ -1218,58 +995,25 @@ void GLES2InterfaceStub::UniformValuebufferCHROMIUM(GLint /* location */,
GLenum /* subscription */) {
}
void GLES2InterfaceStub::BindTexImage2DCHROMIUM(GLenum /* target */,
- GLint /* imageId */) {
-}
+ GLint /* imageId */) {}
void GLES2InterfaceStub::ReleaseTexImage2DCHROMIUM(GLenum /* target */,
- GLint /* imageId */) {
-}
+ GLint /* imageId */) {}
void GLES2InterfaceStub::TraceBeginCHROMIUM(const char* /* category_name */,
- const char* /* trace_name */) {
-}
-void GLES2InterfaceStub::TraceEndCHROMIUM() {
-}
-void GLES2InterfaceStub::AsyncTexSubImage2DCHROMIUM(GLenum /* target */,
- GLint /* level */,
- GLint /* xoffset */,
- GLint /* yoffset */,
- GLsizei /* width */,
- GLsizei /* height */,
- GLenum /* format */,
- GLenum /* type */,
- const void* /* data */) {
-}
-void GLES2InterfaceStub::AsyncTexImage2DCHROMIUM(GLenum /* target */,
- GLint /* level */,
- GLenum /* internalformat */,
- GLsizei /* width */,
- GLsizei /* height */,
- GLint /* border */,
- GLenum /* format */,
- GLenum /* type */,
- const void* /* pixels */) {
-}
-void GLES2InterfaceStub::WaitAsyncTexImage2DCHROMIUM(GLenum /* target */) {
-}
-void GLES2InterfaceStub::WaitAllAsyncTexImage2DCHROMIUM() {
-}
+ const char* /* trace_name */) {}
+void GLES2InterfaceStub::TraceEndCHROMIUM() {}
void GLES2InterfaceStub::DiscardFramebufferEXT(
GLenum /* target */,
GLsizei /* count */,
- const GLenum* /* attachments */) {
-}
+ const GLenum* /* attachments */) {}
void GLES2InterfaceStub::LoseContextCHROMIUM(GLenum /* current */,
- GLenum /* other */) {
-}
+ GLenum /* other */) {}
GLuint GLES2InterfaceStub::InsertSyncPointCHROMIUM() {
return 0;
}
-void GLES2InterfaceStub::WaitSyncPointCHROMIUM(GLuint /* sync_point */) {
-}
+void GLES2InterfaceStub::WaitSyncPointCHROMIUM(GLuint /* sync_point */) {}
void GLES2InterfaceStub::DrawBuffersEXT(GLsizei /* count */,
- const GLenum* /* bufs */) {
-}
-void GLES2InterfaceStub::DiscardBackbufferCHROMIUM() {
-}
+ const GLenum* /* bufs */) {}
+void GLES2InterfaceStub::DiscardBackbufferCHROMIUM() {}
void GLES2InterfaceStub::ScheduleOverlayPlaneCHROMIUM(
GLint /* plane_z_order */,
GLenum /* plane_transform */,
@@ -1281,20 +1025,58 @@ void GLES2InterfaceStub::ScheduleOverlayPlaneCHROMIUM(
GLfloat /* uv_x */,
GLfloat /* uv_y */,
GLfloat /* uv_width */,
- GLfloat /* uv_height */) {
-}
-void GLES2InterfaceStub::SwapInterval(GLint /* interval */) {
-}
-void GLES2InterfaceStub::FlushDriverCachesCHROMIUM() {
-}
+ GLfloat /* uv_height */) {}
+void GLES2InterfaceStub::SwapInterval(GLint /* interval */) {}
+void GLES2InterfaceStub::FlushDriverCachesCHROMIUM() {}
void GLES2InterfaceStub::MatrixLoadfCHROMIUM(GLenum /* matrixMode */,
- const GLfloat* /* m */) {
+ const GLfloat* /* m */) {}
+void GLES2InterfaceStub::MatrixLoadIdentityCHROMIUM(GLenum /* matrixMode */) {}
+GLuint GLES2InterfaceStub::GenPathsCHROMIUM(GLsizei /* range */) {
+ return 0;
}
-void GLES2InterfaceStub::MatrixLoadIdentityCHROMIUM(GLenum /* matrixMode */) {
+void GLES2InterfaceStub::DeletePathsCHROMIUM(GLuint /* path */,
+ GLsizei /* range */) {}
+GLboolean GLES2InterfaceStub::IsPathCHROMIUM(GLuint /* path */) {
+ return 0;
}
+void GLES2InterfaceStub::PathCommandsCHROMIUM(GLuint /* path */,
+ GLsizei /* numCommands */,
+ const GLubyte* /* commands */,
+ GLsizei /* numCoords */,
+ GLenum /* coordType */,
+ const GLvoid* /* coords */) {}
+void GLES2InterfaceStub::PathParameterfCHROMIUM(GLuint /* path */,
+ GLenum /* pname */,
+ GLfloat /* value */) {}
+void GLES2InterfaceStub::PathParameteriCHROMIUM(GLuint /* path */,
+ GLenum /* pname */,
+ GLint /* value */) {}
+void GLES2InterfaceStub::PathStencilFuncCHROMIUM(GLenum /* func */,
+ GLint /* ref */,
+ GLuint /* mask */) {}
+void GLES2InterfaceStub::StencilFillPathCHROMIUM(GLuint /* path */,
+ GLenum /* fillMode */,
+ GLuint /* mask */) {}
+void GLES2InterfaceStub::StencilStrokePathCHROMIUM(GLuint /* path */,
+ GLint /* reference */,
+ GLuint /* mask */) {}
+void GLES2InterfaceStub::CoverFillPathCHROMIUM(GLuint /* path */,
+ GLenum /* coverMode */) {}
+void GLES2InterfaceStub::CoverStrokePathCHROMIUM(GLuint /* path */,
+ GLenum /* coverMode */) {}
+void GLES2InterfaceStub::StencilThenCoverFillPathCHROMIUM(
+ GLuint /* path */,
+ GLenum /* fillMode */,
+ GLuint /* mask */,
+ GLenum /* coverMode */) {}
+void GLES2InterfaceStub::StencilThenCoverStrokePathCHROMIUM(
+ GLuint /* path */,
+ GLint /* reference */,
+ GLuint /* mask */,
+ GLenum /* coverMode */) {}
GLenum GLES2InterfaceStub::GetGraphicsResetStatusKHR() {
return 0;
}
-void GLES2InterfaceStub::BlendBarrierKHR() {
-}
+void GLES2InterfaceStub::BlendBarrierKHR() {}
+void GLES2InterfaceStub::ApplyScreenSpaceAntialiasingCHROMIUM() {}
#endif // GPU_COMMAND_BUFFER_CLIENT_GLES2_INTERFACE_STUB_IMPL_AUTOGEN_H_
diff --git a/chromium/gpu/command_buffer/client/gles2_lib.h b/chromium/gpu/command_buffer/client/gles2_lib.h
index b90a2d8daf3..957ac69a9ff 100644
--- a/chromium/gpu/command_buffer/client/gles2_lib.h
+++ b/chromium/gpu/command_buffer/client/gles2_lib.h
@@ -12,7 +12,7 @@
namespace gles2 {
-typedef void (*GLES2FunctionPointer)(void);
+typedef void(GL_APIENTRY* GLES2FunctionPointer)(void);
struct NameToFunc {
const char* name;
diff --git a/chromium/gpu/command_buffer/client/gles2_trace_implementation_autogen.h b/chromium/gpu/command_buffer/client/gles2_trace_implementation_autogen.h
index c9fa2ec767a..41140beb411 100644
--- a/chromium/gpu/command_buffer/client/gles2_trace_implementation_autogen.h
+++ b/chromium/gpu/command_buffer/client/gles2_trace_implementation_autogen.h
@@ -232,6 +232,9 @@ void GetAttachedShaders(GLuint program,
GLuint* shaders) override;
GLint GetAttribLocation(GLuint program, const char* name) override;
void GetBooleanv(GLenum pname, GLboolean* params) override;
+void GetBufferParameteri64v(GLenum target,
+ GLenum pname,
+ GLint64* params) override;
void GetBufferParameteriv(GLenum target, GLenum pname, GLint* params) override;
GLenum GetError() override;
void GetFloatv(GLenum pname, GLfloat* params) override;
@@ -573,14 +576,18 @@ void TexStorage2DEXT(GLenum target,
GLsizei height) override;
void GenQueriesEXT(GLsizei n, GLuint* queries) override;
void DeleteQueriesEXT(GLsizei n, const GLuint* queries) override;
+void QueryCounterEXT(GLuint id, GLenum target) override;
GLboolean IsQueryEXT(GLuint id) override;
void BeginQueryEXT(GLenum target, GLuint id) override;
void BeginTransformFeedback(GLenum primitivemode) override;
void EndQueryEXT(GLenum target) override;
void EndTransformFeedback() override;
void GetQueryivEXT(GLenum target, GLenum pname, GLint* params) override;
+void GetQueryObjectivEXT(GLuint id, GLenum pname, GLint* params) override;
void GetQueryObjectuivEXT(GLuint id, GLenum pname, GLuint* params) override;
+void GetQueryObjecti64vEXT(GLuint id, GLenum pname, GLint64* params) override;
void GetQueryObjectui64vEXT(GLuint id, GLenum pname, GLuint64* params) override;
+void SetDisjointValueSyncCHROMIUM() override;
void InsertEventMarkerEXT(GLsizei length, const GLchar* marker) override;
void PushGroupMarkerEXT(GLsizei length, const GLchar* marker) override;
void PopGroupMarkerEXT() override;
@@ -619,7 +626,6 @@ void UnmapTexSubImage2DCHROMIUM(const void* mem) override;
void ResizeCHROMIUM(GLuint width, GLuint height, GLfloat scale_factor) override;
const GLchar* GetRequestableExtensionsCHROMIUM() override;
void RequestExtensionCHROMIUM(const char* extension) override;
-void RateLimitOffscreenContextCHROMIUM() override;
void GetProgramInfoCHROMIUM(GLuint program,
GLsizei bufsize,
GLsizei* size,
@@ -682,6 +688,15 @@ void CopySubTextureCHROMIUM(GLenum target,
void CompressedCopyTextureCHROMIUM(GLenum target,
GLenum source_id,
GLenum dest_id) override;
+void CompressedCopySubTextureCHROMIUM(GLenum target,
+ GLenum source_id,
+ GLenum dest_id,
+ GLint xoffset,
+ GLint yoffset,
+ GLint x,
+ GLint y,
+ GLsizei width,
+ GLsizei height) override;
void DrawArraysInstancedANGLE(GLenum mode,
GLint first,
GLsizei count,
@@ -717,26 +732,6 @@ void ReleaseTexImage2DCHROMIUM(GLenum target, GLint imageId) override;
void TraceBeginCHROMIUM(const char* category_name,
const char* trace_name) override;
void TraceEndCHROMIUM() override;
-void AsyncTexSubImage2DCHROMIUM(GLenum target,
- GLint level,
- GLint xoffset,
- GLint yoffset,
- GLsizei width,
- GLsizei height,
- GLenum format,
- GLenum type,
- const void* data) override;
-void AsyncTexImage2DCHROMIUM(GLenum target,
- GLint level,
- GLenum internalformat,
- GLsizei width,
- GLsizei height,
- GLint border,
- GLenum format,
- GLenum type,
- const void* pixels) override;
-void WaitAsyncTexImage2DCHROMIUM(GLenum target) override;
-void WaitAllAsyncTexImage2DCHROMIUM() override;
void DiscardFramebufferEXT(GLenum target,
GLsizei count,
const GLenum* attachments) override;
@@ -760,6 +755,35 @@ void SwapInterval(GLint interval) override;
void FlushDriverCachesCHROMIUM() override;
void MatrixLoadfCHROMIUM(GLenum matrixMode, const GLfloat* m) override;
void MatrixLoadIdentityCHROMIUM(GLenum matrixMode) override;
+GLuint GenPathsCHROMIUM(GLsizei range) override;
+void DeletePathsCHROMIUM(GLuint path, GLsizei range) override;
+GLboolean IsPathCHROMIUM(GLuint path) override;
+void PathCommandsCHROMIUM(GLuint path,
+ GLsizei numCommands,
+ const GLubyte* commands,
+ GLsizei numCoords,
+ GLenum coordType,
+ const GLvoid* coords) override;
+void PathParameterfCHROMIUM(GLuint path, GLenum pname, GLfloat value) override;
+void PathParameteriCHROMIUM(GLuint path, GLenum pname, GLint value) override;
+void PathStencilFuncCHROMIUM(GLenum func, GLint ref, GLuint mask) override;
+void StencilFillPathCHROMIUM(GLuint path,
+ GLenum fillMode,
+ GLuint mask) override;
+void StencilStrokePathCHROMIUM(GLuint path,
+ GLint reference,
+ GLuint mask) override;
+void CoverFillPathCHROMIUM(GLuint path, GLenum coverMode) override;
+void CoverStrokePathCHROMIUM(GLuint path, GLenum coverMode) override;
+void StencilThenCoverFillPathCHROMIUM(GLuint path,
+ GLenum fillMode,
+ GLuint mask,
+ GLenum coverMode) override;
+void StencilThenCoverStrokePathCHROMIUM(GLuint path,
+ GLint reference,
+ GLuint mask,
+ GLenum coverMode) override;
GLenum GetGraphicsResetStatusKHR() override;
void BlendBarrierKHR() override;
+void ApplyScreenSpaceAntialiasingCHROMIUM() override;
#endif // GPU_COMMAND_BUFFER_CLIENT_GLES2_TRACE_IMPLEMENTATION_AUTOGEN_H_
diff --git a/chromium/gpu/command_buffer/client/gles2_trace_implementation_impl_autogen.h b/chromium/gpu/command_buffer/client/gles2_trace_implementation_impl_autogen.h
index 893cc910fb9..11d76df9d1e 100644
--- a/chromium/gpu/command_buffer/client/gles2_trace_implementation_impl_autogen.h
+++ b/chromium/gpu/command_buffer/client/gles2_trace_implementation_impl_autogen.h
@@ -592,6 +592,13 @@ void GLES2TraceImplementation::GetBooleanv(GLenum pname, GLboolean* params) {
gl_->GetBooleanv(pname, params);
}
+void GLES2TraceImplementation::GetBufferParameteri64v(GLenum target,
+ GLenum pname,
+ GLint64* params) {
+ TRACE_EVENT_BINARY_EFFICIENT0("gpu", "GLES2Trace::GetBufferParameteri64v");
+ gl_->GetBufferParameteri64v(target, pname, params);
+}
+
void GLES2TraceImplementation::GetBufferParameteriv(GLenum target,
GLenum pname,
GLint* params) {
@@ -1642,6 +1649,11 @@ void GLES2TraceImplementation::DeleteQueriesEXT(GLsizei n,
gl_->DeleteQueriesEXT(n, queries);
}
+void GLES2TraceImplementation::QueryCounterEXT(GLuint id, GLenum target) {
+ TRACE_EVENT_BINARY_EFFICIENT0("gpu", "GLES2Trace::QueryCounterEXT");
+ gl_->QueryCounterEXT(id, target);
+}
+
GLboolean GLES2TraceImplementation::IsQueryEXT(GLuint id) {
TRACE_EVENT_BINARY_EFFICIENT0("gpu", "GLES2Trace::IsQueryEXT");
return gl_->IsQueryEXT(id);
@@ -1674,6 +1686,13 @@ void GLES2TraceImplementation::GetQueryivEXT(GLenum target,
gl_->GetQueryivEXT(target, pname, params);
}
+void GLES2TraceImplementation::GetQueryObjectivEXT(GLuint id,
+ GLenum pname,
+ GLint* params) {
+ TRACE_EVENT_BINARY_EFFICIENT0("gpu", "GLES2Trace::GetQueryObjectivEXT");
+ gl_->GetQueryObjectivEXT(id, pname, params);
+}
+
void GLES2TraceImplementation::GetQueryObjectuivEXT(GLuint id,
GLenum pname,
GLuint* params) {
@@ -1681,6 +1700,13 @@ void GLES2TraceImplementation::GetQueryObjectuivEXT(GLuint id,
gl_->GetQueryObjectuivEXT(id, pname, params);
}
+void GLES2TraceImplementation::GetQueryObjecti64vEXT(GLuint id,
+ GLenum pname,
+ GLint64* params) {
+ TRACE_EVENT_BINARY_EFFICIENT0("gpu", "GLES2Trace::GetQueryObjecti64vEXT");
+ gl_->GetQueryObjecti64vEXT(id, pname, params);
+}
+
void GLES2TraceImplementation::GetQueryObjectui64vEXT(GLuint id,
GLenum pname,
GLuint64* params) {
@@ -1688,6 +1714,12 @@ void GLES2TraceImplementation::GetQueryObjectui64vEXT(GLuint id,
gl_->GetQueryObjectui64vEXT(id, pname, params);
}
+void GLES2TraceImplementation::SetDisjointValueSyncCHROMIUM() {
+ TRACE_EVENT_BINARY_EFFICIENT0("gpu",
+ "GLES2Trace::SetDisjointValueSyncCHROMIUM");
+ gl_->SetDisjointValueSyncCHROMIUM();
+}
+
void GLES2TraceImplementation::InsertEventMarkerEXT(GLsizei length,
const GLchar* marker) {
TRACE_EVENT_BINARY_EFFICIENT0("gpu", "GLES2Trace::InsertEventMarkerEXT");
@@ -1821,12 +1853,6 @@ void GLES2TraceImplementation::RequestExtensionCHROMIUM(const char* extension) {
gl_->RequestExtensionCHROMIUM(extension);
}
-void GLES2TraceImplementation::RateLimitOffscreenContextCHROMIUM() {
- TRACE_EVENT_BINARY_EFFICIENT0(
- "gpu", "GLES2Trace::RateLimitOffscreenContextCHROMIUM");
- gl_->RateLimitOffscreenContextCHROMIUM();
-}
-
void GLES2TraceImplementation::GetProgramInfoCHROMIUM(GLuint program,
GLsizei bufsize,
GLsizei* size,
@@ -1960,6 +1986,22 @@ void GLES2TraceImplementation::CompressedCopyTextureCHROMIUM(GLenum target,
gl_->CompressedCopyTextureCHROMIUM(target, source_id, dest_id);
}
+void GLES2TraceImplementation::CompressedCopySubTextureCHROMIUM(
+ GLenum target,
+ GLenum source_id,
+ GLenum dest_id,
+ GLint xoffset,
+ GLint yoffset,
+ GLint x,
+ GLint y,
+ GLsizei width,
+ GLsizei height) {
+ TRACE_EVENT_BINARY_EFFICIENT0("gpu",
+ "GLES2Trace::CompressedCopySubTextureCHROMIUM");
+ gl_->CompressedCopySubTextureCHROMIUM(target, source_id, dest_id, xoffset,
+ yoffset, x, y, width, height);
+}
+
void GLES2TraceImplementation::DrawArraysInstancedANGLE(GLenum mode,
GLint first,
GLsizei count,
@@ -2094,47 +2136,6 @@ void GLES2TraceImplementation::TraceEndCHROMIUM() {
gl_->TraceEndCHROMIUM();
}
-void GLES2TraceImplementation::AsyncTexSubImage2DCHROMIUM(GLenum target,
- GLint level,
- GLint xoffset,
- GLint yoffset,
- GLsizei width,
- GLsizei height,
- GLenum format,
- GLenum type,
- const void* data) {
- TRACE_EVENT_BINARY_EFFICIENT0("gpu",
- "GLES2Trace::AsyncTexSubImage2DCHROMIUM");
- gl_->AsyncTexSubImage2DCHROMIUM(target, level, xoffset, yoffset, width,
- height, format, type, data);
-}
-
-void GLES2TraceImplementation::AsyncTexImage2DCHROMIUM(GLenum target,
- GLint level,
- GLenum internalformat,
- GLsizei width,
- GLsizei height,
- GLint border,
- GLenum format,
- GLenum type,
- const void* pixels) {
- TRACE_EVENT_BINARY_EFFICIENT0("gpu", "GLES2Trace::AsyncTexImage2DCHROMIUM");
- gl_->AsyncTexImage2DCHROMIUM(target, level, internalformat, width, height,
- border, format, type, pixels);
-}
-
-void GLES2TraceImplementation::WaitAsyncTexImage2DCHROMIUM(GLenum target) {
- TRACE_EVENT_BINARY_EFFICIENT0("gpu",
- "GLES2Trace::WaitAsyncTexImage2DCHROMIUM");
- gl_->WaitAsyncTexImage2DCHROMIUM(target);
-}
-
-void GLES2TraceImplementation::WaitAllAsyncTexImage2DCHROMIUM() {
- TRACE_EVENT_BINARY_EFFICIENT0("gpu",
- "GLES2Trace::WaitAllAsyncTexImage2DCHROMIUM");
- gl_->WaitAllAsyncTexImage2DCHROMIUM();
-}
-
void GLES2TraceImplementation::DiscardFramebufferEXT(
GLenum target,
GLsizei count,
@@ -2211,6 +2212,99 @@ void GLES2TraceImplementation::MatrixLoadIdentityCHROMIUM(GLenum matrixMode) {
gl_->MatrixLoadIdentityCHROMIUM(matrixMode);
}
+GLuint GLES2TraceImplementation::GenPathsCHROMIUM(GLsizei range) {
+ TRACE_EVENT_BINARY_EFFICIENT0("gpu", "GLES2Trace::GenPathsCHROMIUM");
+ return gl_->GenPathsCHROMIUM(range);
+}
+
+void GLES2TraceImplementation::DeletePathsCHROMIUM(GLuint path, GLsizei range) {
+ TRACE_EVENT_BINARY_EFFICIENT0("gpu", "GLES2Trace::DeletePathsCHROMIUM");
+ gl_->DeletePathsCHROMIUM(path, range);
+}
+
+GLboolean GLES2TraceImplementation::IsPathCHROMIUM(GLuint path) {
+ TRACE_EVENT_BINARY_EFFICIENT0("gpu", "GLES2Trace::IsPathCHROMIUM");
+ return gl_->IsPathCHROMIUM(path);
+}
+
+void GLES2TraceImplementation::PathCommandsCHROMIUM(GLuint path,
+ GLsizei numCommands,
+ const GLubyte* commands,
+ GLsizei numCoords,
+ GLenum coordType,
+ const GLvoid* coords) {
+ TRACE_EVENT_BINARY_EFFICIENT0("gpu", "GLES2Trace::PathCommandsCHROMIUM");
+ gl_->PathCommandsCHROMIUM(path, numCommands, commands, numCoords, coordType,
+ coords);
+}
+
+void GLES2TraceImplementation::PathParameterfCHROMIUM(GLuint path,
+ GLenum pname,
+ GLfloat value) {
+ TRACE_EVENT_BINARY_EFFICIENT0("gpu", "GLES2Trace::PathParameterfCHROMIUM");
+ gl_->PathParameterfCHROMIUM(path, pname, value);
+}
+
+void GLES2TraceImplementation::PathParameteriCHROMIUM(GLuint path,
+ GLenum pname,
+ GLint value) {
+ TRACE_EVENT_BINARY_EFFICIENT0("gpu", "GLES2Trace::PathParameteriCHROMIUM");
+ gl_->PathParameteriCHROMIUM(path, pname, value);
+}
+
+void GLES2TraceImplementation::PathStencilFuncCHROMIUM(GLenum func,
+ GLint ref,
+ GLuint mask) {
+ TRACE_EVENT_BINARY_EFFICIENT0("gpu", "GLES2Trace::PathStencilFuncCHROMIUM");
+ gl_->PathStencilFuncCHROMIUM(func, ref, mask);
+}
+
+void GLES2TraceImplementation::StencilFillPathCHROMIUM(GLuint path,
+ GLenum fillMode,
+ GLuint mask) {
+ TRACE_EVENT_BINARY_EFFICIENT0("gpu", "GLES2Trace::StencilFillPathCHROMIUM");
+ gl_->StencilFillPathCHROMIUM(path, fillMode, mask);
+}
+
+void GLES2TraceImplementation::StencilStrokePathCHROMIUM(GLuint path,
+ GLint reference,
+ GLuint mask) {
+ TRACE_EVENT_BINARY_EFFICIENT0("gpu", "GLES2Trace::StencilStrokePathCHROMIUM");
+ gl_->StencilStrokePathCHROMIUM(path, reference, mask);
+}
+
+void GLES2TraceImplementation::CoverFillPathCHROMIUM(GLuint path,
+ GLenum coverMode) {
+ TRACE_EVENT_BINARY_EFFICIENT0("gpu", "GLES2Trace::CoverFillPathCHROMIUM");
+ gl_->CoverFillPathCHROMIUM(path, coverMode);
+}
+
+void GLES2TraceImplementation::CoverStrokePathCHROMIUM(GLuint path,
+ GLenum coverMode) {
+ TRACE_EVENT_BINARY_EFFICIENT0("gpu", "GLES2Trace::CoverStrokePathCHROMIUM");
+ gl_->CoverStrokePathCHROMIUM(path, coverMode);
+}
+
+void GLES2TraceImplementation::StencilThenCoverFillPathCHROMIUM(
+ GLuint path,
+ GLenum fillMode,
+ GLuint mask,
+ GLenum coverMode) {
+ TRACE_EVENT_BINARY_EFFICIENT0("gpu",
+ "GLES2Trace::StencilThenCoverFillPathCHROMIUM");
+ gl_->StencilThenCoverFillPathCHROMIUM(path, fillMode, mask, coverMode);
+}
+
+void GLES2TraceImplementation::StencilThenCoverStrokePathCHROMIUM(
+ GLuint path,
+ GLint reference,
+ GLuint mask,
+ GLenum coverMode) {
+ TRACE_EVENT_BINARY_EFFICIENT0(
+ "gpu", "GLES2Trace::StencilThenCoverStrokePathCHROMIUM");
+ gl_->StencilThenCoverStrokePathCHROMIUM(path, reference, mask, coverMode);
+}
+
GLenum GLES2TraceImplementation::GetGraphicsResetStatusKHR() {
TRACE_EVENT_BINARY_EFFICIENT0("gpu", "GLES2Trace::GetGraphicsResetStatusKHR");
return gl_->GetGraphicsResetStatusKHR();
@@ -2221,4 +2315,10 @@ void GLES2TraceImplementation::BlendBarrierKHR() {
gl_->BlendBarrierKHR();
}
+void GLES2TraceImplementation::ApplyScreenSpaceAntialiasingCHROMIUM() {
+ TRACE_EVENT_BINARY_EFFICIENT0(
+ "gpu", "GLES2Trace::ApplyScreenSpaceAntialiasingCHROMIUM");
+ gl_->ApplyScreenSpaceAntialiasingCHROMIUM();
+}
+
#endif // GPU_COMMAND_BUFFER_CLIENT_GLES2_TRACE_IMPLEMENTATION_IMPL_AUTOGEN_H_
diff --git a/chromium/gpu/command_buffer/client/gpu_control.h b/chromium/gpu/command_buffer/client/gpu_control.h
index 75bd082a34d..7065d1edb44 100644
--- a/chromium/gpu/command_buffer/client/gpu_control.h
+++ b/chromium/gpu/command_buffer/client/gpu_control.h
@@ -12,6 +12,7 @@
#include "base/callback.h"
#include "base/macros.h"
#include "gpu/command_buffer/common/capabilities.h"
+#include "gpu/command_buffer/common/constants.h"
#include "gpu/command_buffer/common/mailbox.h"
#include "gpu/gpu_export.h"
@@ -89,6 +90,12 @@ class GPU_EXPORT GpuControl {
// should be considered as lost.
virtual bool IsGpuChannelLost() = 0;
+ // The namespace and command buffer ID forms a unique pair for all existing
+ // GpuControl (on client) and matches for the corresponding command buffer
+ // (on server) in a single server process.
+ virtual CommandBufferNamespace GetNamespaceID() const = 0;
+ virtual uint64_t GetCommandBufferID() const = 0;
+
private:
DISALLOW_COPY_AND_ASSIGN(GpuControl);
};
diff --git a/chromium/gpu/command_buffer/client/gpu_memory_buffer_manager.h b/chromium/gpu/command_buffer/client/gpu_memory_buffer_manager.h
index ea1759ea0e5..21ed6254d24 100644
--- a/chromium/gpu/command_buffer/client/gpu_memory_buffer_manager.h
+++ b/chromium/gpu/command_buffer/client/gpu_memory_buffer_manager.h
@@ -19,8 +19,8 @@ class GPU_EXPORT GpuMemoryBufferManager {
// Allocates a GpuMemoryBuffer that can be shared with another process.
virtual scoped_ptr<gfx::GpuMemoryBuffer> AllocateGpuMemoryBuffer(
const gfx::Size& size,
- gfx::GpuMemoryBuffer::Format format,
- gfx::GpuMemoryBuffer::Usage usage) = 0;
+ gfx::BufferFormat format,
+ gfx::BufferUsage usage) = 0;
// Returns a GpuMemoryBuffer instance given a ClientBuffer. Returns NULL on
// failure.
diff --git a/chromium/gpu/command_buffer/client/mapped_memory.cc b/chromium/gpu/command_buffer/client/mapped_memory.cc
index 7c5864a4710..d798ada7e8c 100644
--- a/chromium/gpu/command_buffer/client/mapped_memory.cc
+++ b/chromium/gpu/command_buffer/client/mapped_memory.cc
@@ -7,34 +7,54 @@
#include <algorithm>
#include <functional>
+#include "base/atomic_sequence_num.h"
#include "base/logging.h"
+#include "base/strings/stringprintf.h"
+#include "base/thread_task_runner_handle.h"
+#include "base/trace_event/memory_dump_manager.h"
#include "base/trace_event/trace_event.h"
#include "gpu/command_buffer/client/cmd_buffer_helper.h"
+#include "gpu/command_buffer/common/buffer.h"
namespace gpu {
+namespace {
+
+// Generates process-unique IDs to use for tracing a MappedMemoryManager's
+// chunks.
+base::StaticAtomicSequenceNumber g_next_mapped_memory_manager_tracing_id;
+
+} // namespace
MemoryChunk::MemoryChunk(int32 shm_id,
scoped_refptr<gpu::Buffer> shm,
- CommandBufferHelper* helper,
- const base::Closure& poll_callback)
+ CommandBufferHelper* helper)
: shm_id_(shm_id),
shm_(shm),
- allocator_(shm->size(), helper, poll_callback, shm->memory()) {}
+ allocator_(shm->size(), helper, shm->memory()) {}
MemoryChunk::~MemoryChunk() {}
MappedMemoryManager::MappedMemoryManager(CommandBufferHelper* helper,
- const base::Closure& poll_callback,
size_t unused_memory_reclaim_limit)
: chunk_size_multiple_(FencedAllocator::kAllocAlignment),
helper_(helper),
- poll_callback_(poll_callback),
allocated_memory_(0),
max_free_bytes_(unused_memory_reclaim_limit),
- max_allocated_bytes_(kNoLimit) {
+ max_allocated_bytes_(kNoLimit),
+ tracing_id_(g_next_mapped_memory_manager_tracing_id.GetNext()) {
+ // In certain cases, ThreadTaskRunnerHandle isn't set (Android Webview).
+ // Don't register a dump provider in these cases.
+ // TODO(ericrk): Get this working in Android Webview. crbug.com/517156
+ if (base::ThreadTaskRunnerHandle::IsSet()) {
+ base::trace_event::MemoryDumpManager::GetInstance()->RegisterDumpProvider(
+ this, base::ThreadTaskRunnerHandle::Get());
+ }
}
MappedMemoryManager::~MappedMemoryManager() {
+ base::trace_event::MemoryDumpManager::GetInstance()->UnregisterDumpProvider(
+ this);
+
CommandBuffer* cmd_buf = helper_->command_buffer();
for (MemoryChunkVector::iterator iter = chunks_.begin();
iter != chunks_.end(); ++iter) {
@@ -98,7 +118,7 @@ void* MappedMemoryManager::Alloc(
if (id < 0)
return NULL;
DCHECK(shm.get());
- MemoryChunk* mc = new MemoryChunk(id, shm, helper_, poll_callback_);
+ MemoryChunk* mc = new MemoryChunk(id, shm, helper_);
allocated_memory_ += mc->GetSize();
chunks_.push_back(mc);
void* mem = mc->Alloc(size);
@@ -146,6 +166,36 @@ void MappedMemoryManager::FreeUnused() {
}
}
+bool MappedMemoryManager::OnMemoryDump(
+ const base::trace_event::MemoryDumpArgs& args,
+ base::trace_event::ProcessMemoryDump* pmd) {
+ const uint64 tracing_process_id =
+ base::trace_event::MemoryDumpManager::GetInstance()
+ ->GetTracingProcessId();
+
+ for (const auto& chunk : chunks_) {
+ std::string dump_name = base::StringPrintf(
+ "gpu/mapped_memory/manager_%d/chunk_%d", tracing_id_, chunk->shm_id());
+ base::trace_event::MemoryAllocatorDump* dump =
+ pmd->CreateAllocatorDump(dump_name);
+
+ dump->AddScalar(base::trace_event::MemoryAllocatorDump::kNameSize,
+ base::trace_event::MemoryAllocatorDump::kUnitsBytes,
+ chunk->GetSize());
+ dump->AddScalar("free_size",
+ base::trace_event::MemoryAllocatorDump::kUnitsBytes,
+ chunk->GetFreeSize());
+
+ auto guid = GetBufferGUIDForTracing(tracing_process_id, chunk->shm_id());
+
+ const int kImportance = 2;
+ pmd->CreateSharedGlobalAllocatorDump(guid);
+ pmd->AddOwnershipEdge(dump->guid(), guid, kImportance);
+ }
+
+ return true;
+}
+
void ScopedMappedMemoryPtr::Release() {
if (buffer_) {
mapped_memory_manager_->FreePendingToken(buffer_, helper_->InsertToken());
diff --git a/chromium/gpu/command_buffer/client/mapped_memory.h b/chromium/gpu/command_buffer/client/mapped_memory.h
index 55d94e56068..aad8647c790 100644
--- a/chromium/gpu/command_buffer/client/mapped_memory.h
+++ b/chromium/gpu/command_buffer/client/mapped_memory.h
@@ -10,6 +10,7 @@
#include "base/bind.h"
#include "base/macros.h"
#include "base/memory/scoped_vector.h"
+#include "base/trace_event/memory_dump_provider.h"
#include "gpu/command_buffer/client/fenced_allocator.h"
#include "gpu/command_buffer/common/buffer.h"
#include "gpu/gpu_export.h"
@@ -23,8 +24,7 @@ class GPU_EXPORT MemoryChunk {
public:
MemoryChunk(int32_t shm_id,
scoped_refptr<gpu::Buffer> shm,
- CommandBufferHelper* helper,
- const base::Closure& poll_callback);
+ CommandBufferHelper* helper);
~MemoryChunk();
// Gets the size of the largest free block that is available without waiting.
@@ -91,6 +91,9 @@ class GPU_EXPORT MemoryChunk {
allocator_.FreeUnused();
}
+ // Gets the free size of the chunk.
+ unsigned int GetFreeSize() { return allocator_.GetFreeSize(); }
+
// Returns true if pointer is in the range of this block.
bool IsInChunk(void* pointer) const {
return pointer >= shm_->memory() &&
@@ -116,7 +119,8 @@ class GPU_EXPORT MemoryChunk {
};
// Manages MemoryChunks.
-class GPU_EXPORT MappedMemoryManager {
+class GPU_EXPORT MappedMemoryManager
+ : public base::trace_event::MemoryDumpProvider {
public:
enum MemoryLimit {
kNoLimit = 0,
@@ -125,10 +129,9 @@ class GPU_EXPORT MappedMemoryManager {
// |unused_memory_reclaim_limit|: When exceeded this causes pending memory
// to be reclaimed before allocating more memory.
MappedMemoryManager(CommandBufferHelper* helper,
- const base::Closure& poll_callback,
size_t unused_memory_reclaim_limit);
- ~MappedMemoryManager();
+ ~MappedMemoryManager() override;
unsigned int chunk_size_multiple() const {
return chunk_size_multiple_;
@@ -174,6 +177,10 @@ class GPU_EXPORT MappedMemoryManager {
// Free Any Shared memory that is not in use.
void FreeUnused();
+ // Overridden from base::trace_event::MemoryDumpProvider:
+ bool OnMemoryDump(const base::trace_event::MemoryDumpArgs& args,
+ base::trace_event::ProcessMemoryDump* pmd) override;
+
// Used for testing
size_t num_chunks() const {
return chunks_.size();
@@ -199,11 +206,13 @@ class GPU_EXPORT MappedMemoryManager {
// size a chunk is rounded up to.
unsigned int chunk_size_multiple_;
CommandBufferHelper* helper_;
- base::Closure poll_callback_;
MemoryChunkVector chunks_;
size_t allocated_memory_;
size_t max_free_bytes_;
size_t max_allocated_bytes_;
+ // A process-unique ID used for disambiguating memory dumps from different
+ // mapped memory manager.
+ int tracing_id_;
DISALLOW_COPY_AND_ASSIGN(MappedMemoryManager);
};
diff --git a/chromium/gpu/command_buffer/client/mapped_memory_unittest.cc b/chromium/gpu/command_buffer/client/mapped_memory_unittest.cc
index 981bbbad712..73da17690e4 100644
--- a/chromium/gpu/command_buffer/client/mapped_memory_unittest.cc
+++ b/chromium/gpu/command_buffer/client/mapped_memory_unittest.cc
@@ -41,7 +41,7 @@ class MappedMemoryTestBase : public testing::Test {
Return(error::kNoError)));
{
- TransferBufferManager* manager = new TransferBufferManager();
+ TransferBufferManager* manager = new TransferBufferManager(nullptr);
transfer_buffer_manager_ = manager;
EXPECT_TRUE(manager->Initialize());
}
@@ -78,11 +78,6 @@ class MappedMemoryTestBase : public testing::Test {
const unsigned int MappedMemoryTestBase::kBufferSize;
#endif
-namespace {
-void EmptyPoll() {
-}
-}
-
// Test fixture for MemoryChunk test - Creates a MemoryChunk, using a
// CommandBufferHelper with a mock AsyncAPIInterface for its interface (calling
// it directly, not through the RPC mechanism), making sure Noops are ignored
@@ -95,10 +90,7 @@ class MemoryChunkTest : public MappedMemoryTestBase {
scoped_ptr<base::SharedMemory> shared_memory(new base::SharedMemory());
shared_memory->CreateAndMapAnonymous(kBufferSize);
buffer_ = MakeBufferFromSharedMemory(shared_memory.Pass(), kBufferSize);
- chunk_.reset(new MemoryChunk(kShmId,
- buffer_,
- helper_.get(),
- base::Bind(&EmptyPoll)));
+ chunk_.reset(new MemoryChunk(kShmId, buffer_, helper_.get()));
}
void TearDown() override {
@@ -157,8 +149,8 @@ class MappedMemoryManagerTest : public MappedMemoryTestBase {
protected:
void SetUp() override {
MappedMemoryTestBase::SetUp();
- manager_.reset(new MappedMemoryManager(
- helper_.get(), base::Bind(&EmptyPoll), MappedMemoryManager::kNoLimit));
+ manager_.reset(
+ new MappedMemoryManager(helper_.get(), MappedMemoryManager::kNoLimit));
}
void TearDown() override {
@@ -312,8 +304,7 @@ TEST_F(MappedMemoryManagerTest, ChunkSizeMultiple) {
TEST_F(MappedMemoryManagerTest, UnusedMemoryLimit) {
const unsigned int kChunkSize = 2048;
// Reset the manager with a memory limit.
- manager_.reset(new MappedMemoryManager(
- helper_.get(), base::Bind(&EmptyPoll), kChunkSize));
+ manager_.reset(new MappedMemoryManager(helper_.get(), kChunkSize));
manager_->set_chunk_size_multiple(kChunkSize);
// Allocate one chunk worth of memory.
@@ -344,8 +335,7 @@ TEST_F(MappedMemoryManagerTest, UnusedMemoryLimit) {
TEST_F(MappedMemoryManagerTest, MemoryLimitWithReuse) {
const unsigned int kSize = 1024;
// Reset the manager with a memory limit.
- manager_.reset(new MappedMemoryManager(
- helper_.get(), base::Bind(&EmptyPoll), kSize));
+ manager_.reset(new MappedMemoryManager(helper_.get(), kSize));
const unsigned int kChunkSize = 2 * 1024;
manager_->set_chunk_size_multiple(kChunkSize);
@@ -397,8 +387,7 @@ TEST_F(MappedMemoryManagerTest, MemoryLimitWithReuse) {
TEST_F(MappedMemoryManagerTest, MaxAllocationTest) {
const unsigned int kSize = 1024;
// Reset the manager with a memory limit.
- manager_.reset(new MappedMemoryManager(
- helper_.get(), base::Bind(&EmptyPoll), kSize));
+ manager_.reset(new MappedMemoryManager(helper_.get(), kSize));
const size_t kLimit = 512;
manager_->set_chunk_size_multiple(kLimit);
@@ -442,55 +431,4 @@ TEST_F(MappedMemoryManagerTest, MaxAllocationTest) {
manager_->Free(mem4);
}
-namespace {
-void Poll(MappedMemoryManagerTest *test, std::list<void*>* list) {
- std::list<void*>::iterator it = list->begin();
- while (it != list->end()) {
- void* address = *it;
- test->manager()->Free(address);
- it = list->erase(it);
- }
-}
-}
-
-TEST_F(MappedMemoryManagerTest, Poll) {
- std::list<void*> unmanaged_memory_list;
-
- const unsigned int kSize = 1024;
- // Reset the manager with a memory limit.
- manager_.reset(new MappedMemoryManager(
- helper_.get(),
- base::Bind(&Poll, this, &unmanaged_memory_list),
- kSize));
-
- // Allocate kSize bytes. Don't add the address to
- // the unmanaged memory list, so that it won't be free:ed just yet.
- int32 id1;
- unsigned int offset1;
- void* mem1 = manager_->Alloc(kSize, &id1, &offset1);
- EXPECT_EQ(manager_->bytes_in_use(), kSize);
-
- // Allocate kSize more bytes, and make sure we grew.
- int32 id2;
- unsigned int offset2;
- void* mem2 = manager_->Alloc(kSize, &id2, &offset2);
- EXPECT_EQ(manager_->bytes_in_use(), kSize * 2);
-
- // Make the unmanaged buffer be released next time FreeUnused() is called
- // in MappedMemoryManager/FencedAllocator. This happens for example when
- // allocating new memory.
- unmanaged_memory_list.push_back(mem1);
-
- // Allocate kSize more bytes. This should poll unmanaged memory, which now
- // should free the previously allocated unmanaged memory.
- int32 id3;
- unsigned int offset3;
- void* mem3 = manager_->Alloc(kSize, &id3, &offset3);
- EXPECT_EQ(manager_->bytes_in_use(), kSize * 2);
-
- manager_->Free(mem2);
- manager_->Free(mem3);
- EXPECT_EQ(manager_->bytes_in_use(), static_cast<size_t>(0));
-}
-
} // namespace gpu
diff --git a/chromium/gpu/command_buffer/client/program_info_manager.cc b/chromium/gpu/command_buffer/client/program_info_manager.cc
index 89e8913a63a..6d33d858835 100644
--- a/chromium/gpu/command_buffer/client/program_info_manager.cc
+++ b/chromium/gpu/command_buffer/client/program_info_manager.cc
@@ -84,6 +84,7 @@ ProgramInfoManager::Program::Program()
active_uniform_block_max_name_length_(0),
cached_es3_transform_feedback_varyings_(false),
transform_feedback_varying_max_length_(0),
+ transform_feedback_buffer_mode_(0),
cached_es3_uniformsiv_(false) {
}
@@ -208,6 +209,9 @@ bool ProgramInfoManager::Program::GetProgramiv(
case GL_TRANSFORM_FEEDBACK_VARYING_MAX_LENGTH:
*params = static_cast<GLint>(transform_feedback_varying_max_length_);
return true;
+ case GL_TRANSFORM_FEEDBACK_BUFFER_MODE:
+ *params = static_cast<GLint>(transform_feedback_buffer_mode_);
+ return true;
default:
NOTREACHED();
break;
@@ -494,6 +498,7 @@ void ProgramInfoManager::Program::UpdateES3TransformFeedbackVaryings(
// This should only happen on a lost context.
return;
}
+ DCHECK_EQ(0u, transform_feedback_buffer_mode_);
DCHECK_EQ(0u, transform_feedback_varyings_.size());
DCHECK_EQ(0u, transform_feedback_varying_max_length_);
@@ -505,6 +510,7 @@ void ProgramInfoManager::Program::UpdateES3TransformFeedbackVaryings(
LocalGetAs<const TransformFeedbackVaryingsHeader*>(
result, 0, header_size);
DCHECK(header);
+ transform_feedback_buffer_mode_ = header->transform_feedback_buffer_mode;
if (header->num_transform_feedback_varyings == 0) {
DCHECK_EQ(result.size(), header_size);
// TODO(zmo): Here we can't tell if no TransformFeedback varyings are
@@ -610,6 +616,7 @@ ProgramInfoManager::Program* ProgramInfoManager::GetProgramInfo(
gl->GetTransformFeedbackVaryingsCHROMIUMHelper(program, &result);
}
info->UpdateES3TransformFeedbackVaryings(result);
+ break;
case kES3Uniformsiv:
{
base::AutoUnlock unlock(lock_);
@@ -618,6 +625,7 @@ ProgramInfoManager::Program* ProgramInfoManager::GetProgramInfo(
gl->GetUniformsES3CHROMIUMHelper(program, &result);
}
info->UpdateES3Uniformsiv(result);
+ break;
default:
NOTREACHED();
return NULL;
@@ -655,6 +663,7 @@ bool ProgramInfoManager::GetProgramiv(
case GL_ACTIVE_UNIFORM_BLOCK_MAX_NAME_LENGTH:
type = kES3UniformBlocks;
break;
+ case GL_TRANSFORM_FEEDBACK_BUFFER_MODE:
case GL_TRANSFORM_FEEDBACK_VARYINGS:
case GL_TRANSFORM_FEEDBACK_VARYING_MAX_LENGTH:
type = kES3TransformFeedbackVaryings;
diff --git a/chromium/gpu/command_buffer/client/program_info_manager.h b/chromium/gpu/command_buffer/client/program_info_manager.h
index 6f8a745c0b8..fa74ea58a0c 100644
--- a/chromium/gpu/command_buffer/client/program_info_manager.h
+++ b/chromium/gpu/command_buffer/client/program_info_manager.h
@@ -222,6 +222,7 @@ class GLES2_IMPL_EXPORT ProgramInfoManager {
bool cached_es3_transform_feedback_varyings_;
uint32_t transform_feedback_varying_max_length_;
+ GLenum transform_feedback_buffer_mode_;
// TransformFeedback varyings by index.
std::vector<TransformFeedbackVarying> transform_feedback_varyings_;
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 f9c6b00320a..c78fa089d86 100644
--- a/chromium/gpu/command_buffer/client/program_info_manager_unittest.cc
+++ b/chromium/gpu/command_buffer/client/program_info_manager_unittest.cc
@@ -148,6 +148,7 @@ class ProgramInfoManagerTest : public testing::Test {
// The names needs to be of size 4*k-1 to avoid padding in the struct Data.
// This is a testing only problem.
const char* kName[] = { "cow", "chicken" };
+ data->header.transform_feedback_buffer_mode = GL_SEPARATE_ATTRIBS;
data->header.num_transform_feedback_varyings = 2;
data->entry[0].size = 1;
data->entry[0].type = GL_FLOAT_VEC2;
@@ -265,6 +266,11 @@ TEST_F(ProgramInfoManagerTest, UpdateES3TransformFeedbackVaryings) {
EXPECT_TRUE(program_->IsCached(
ProgramInfoManager::kES3TransformFeedbackVaryings));
+ GLint transform_feedback_buffer_mode = 0;
+ EXPECT_TRUE(program_->GetProgramiv(
+ GL_TRANSFORM_FEEDBACK_BUFFER_MODE, &transform_feedback_buffer_mode));
+ EXPECT_EQ(data.header.transform_feedback_buffer_mode,
+ static_cast<uint32_t>(transform_feedback_buffer_mode));
GLint transform_feedback_varying_count = 0;
EXPECT_TRUE(program_->GetProgramiv(
GL_TRANSFORM_FEEDBACK_VARYINGS, &transform_feedback_varying_count));
diff --git a/chromium/gpu/command_buffer/client/query_tracker.cc b/chromium/gpu/command_buffer/client/query_tracker.cc
index 37a147878a7..ec678a261c7 100644
--- a/chromium/gpu/command_buffer/client/query_tracker.cc
+++ b/chromium/gpu/command_buffer/client/query_tracker.cc
@@ -133,7 +133,6 @@ void QueryTracker::Query::Begin(GLES2Implementation* gl) {
// tell service about id, shared memory and count
gl->helper()->BeginQueryEXT(target(), id(), shm_id(), shm_offset());
break;
- case GL_ASYNC_PIXEL_UNPACK_COMPLETED_CHROMIUM:
case GL_ASYNC_PIXEL_PACK_COMPLETED_CHROMIUM:
default:
// tell service about id, shared memory and count
@@ -166,6 +165,14 @@ void QueryTracker::Query::End(GLES2Implementation* gl) {
MarkAsPending(gl->helper()->InsertToken());
}
+void QueryTracker::Query::QueryCounter(GLES2Implementation* gl) {
+ MarkAsActive();
+ flush_count_ = gl->helper()->flush_generation();
+ gl->helper()->QueryCounterEXT(id(), target(), shm_id(), shm_offset(),
+ submit_count());
+ MarkAsPending(gl->helper()->InsertToken());
+}
+
bool QueryTracker::Query::CheckResultsAvailable(
CommandBufferHelper* helper) {
if (Pending()) {
@@ -181,7 +188,6 @@ bool QueryTracker::Query::CheckResultsAvailable(
//DCHECK(info_.sync->result >= client_begin_time_us_);
result_ = info_.sync->result - client_begin_time_us_;
break;
- case GL_ASYNC_PIXEL_UNPACK_COMPLETED_CHROMIUM:
case GL_ASYNC_PIXEL_PACK_COMPLETED_CHROMIUM:
default:
result_ = info_.sync->result;
@@ -206,7 +212,12 @@ uint64 QueryTracker::Query::GetResult() const {
}
QueryTracker::QueryTracker(MappedMemoryManager* manager)
- : query_sync_manager_(manager) {
+ : query_sync_manager_(manager),
+ mapped_memory_(manager),
+ disjoint_count_sync_shm_id_(-1),
+ disjoint_count_sync_shm_offset_(0),
+ disjoint_count_sync_(nullptr),
+ local_disjoint_count_(0) {
}
QueryTracker::~QueryTracker() {
@@ -218,6 +229,10 @@ QueryTracker::~QueryTracker() {
delete removed_queries_.front();
removed_queries_.pop_front();
}
+ if (disjoint_count_sync_) {
+ mapped_memory_->Free(disjoint_count_sync_);
+ disjoint_count_sync_ = nullptr;
+ }
}
QueryTracker::Query* QueryTracker::CreateQuery(GLuint id, GLenum target) {
@@ -324,5 +339,57 @@ bool QueryTracker::EndQuery(GLenum target, GLES2Implementation* gl) {
return true;
}
+bool QueryTracker::QueryCounter(GLuint id, GLenum target,
+ GLES2Implementation* gl) {
+ QueryTracker::Query* query = GetQuery(id);
+ if (!query) {
+ query = CreateQuery(id, target);
+ if (!query) {
+ gl->SetGLError(GL_OUT_OF_MEMORY,
+ "glQueryCounterEXT",
+ "transfer buffer allocation failed");
+ return false;
+ }
+ } else if (query->target() != target) {
+ gl->SetGLError(GL_INVALID_OPERATION,
+ "glQueryCounterEXT",
+ "target does not match");
+ return false;
+ }
+
+ query->QueryCounter(gl);
+ return true;
+}
+
+bool QueryTracker::SetDisjointSync(GLES2Implementation* gl) {
+ if (!disjoint_count_sync_) {
+ // Allocate memory for disjoint value sync.
+ int32_t shm_id = -1;
+ uint32_t shm_offset;
+ void* mem = mapped_memory_->Alloc(sizeof(*disjoint_count_sync_),
+ &shm_id,
+ &shm_offset);
+ if (mem) {
+ disjoint_count_sync_shm_id_ = shm_id;
+ disjoint_count_sync_shm_offset_ = shm_offset;
+ disjoint_count_sync_ = static_cast<DisjointValueSync*>(mem);
+ disjoint_count_sync_->Reset();
+ gl->helper()->SetDisjointValueSyncCHROMIUM(shm_id, shm_offset);
+ }
+ }
+ return disjoint_count_sync_ != nullptr;
+}
+
+bool QueryTracker::CheckAndResetDisjoint() {
+ if (disjoint_count_sync_) {
+ const uint32_t disjoint_count = disjoint_count_sync_->GetDisjointCount();
+ if (local_disjoint_count_ != disjoint_count) {
+ local_disjoint_count_ = disjoint_count;
+ return true;
+ }
+ }
+ return false;
+}
+
} // namespace gles2
} // namespace gpu
diff --git a/chromium/gpu/command_buffer/client/query_tracker.h b/chromium/gpu/command_buffer/client/query_tracker.h
index abd2f5d331e..986b9f290f3 100644
--- a/chromium/gpu/command_buffer/client/query_tracker.h
+++ b/chromium/gpu/command_buffer/client/query_tracker.h
@@ -143,6 +143,7 @@ class GLES2_IMPL_EXPORT QueryTracker {
void Begin(GLES2Implementation* gl);
void End(GLES2Implementation* gl);
+ void QueryCounter(GLES2Implementation* gl);
GLuint id_;
GLenum target_;
@@ -167,6 +168,17 @@ class GLES2_IMPL_EXPORT QueryTracker {
bool BeginQuery(GLuint id, GLenum target, GLES2Implementation* gl);
bool EndQuery(GLenum target, GLES2Implementation* gl);
+ bool QueryCounter(GLuint id, GLenum target, GLES2Implementation* gl);
+ bool SetDisjointSync(GLES2Implementation* gl);
+ bool CheckAndResetDisjoint();
+
+ int32_t DisjointCountSyncShmID() const {
+ return disjoint_count_sync_shm_id_;
+ }
+
+ uint32_t DisjointCountSyncShmOffset() const {
+ return disjoint_count_sync_shm_offset_;
+ }
private:
typedef base::hash_map<GLuint, Query*> QueryIdMap;
@@ -178,6 +190,13 @@ class GLES2_IMPL_EXPORT QueryTracker {
QueryList removed_queries_;
QuerySyncManager query_sync_manager_;
+ // The shared memory used for synchronizing timer disjoint values.
+ MappedMemoryManager* mapped_memory_;
+ int32_t disjoint_count_sync_shm_id_;
+ uint32_t disjoint_count_sync_shm_offset_;
+ DisjointValueSync* disjoint_count_sync_;
+ uint32_t local_disjoint_count_;
+
DISALLOW_COPY_AND_ASSIGN(QueryTracker);
};
diff --git a/chromium/gpu/command_buffer/client/query_tracker_unittest.cc b/chromium/gpu/command_buffer/client/query_tracker_unittest.cc
index 51c86994d60..93c2cbe8477 100644
--- a/chromium/gpu/command_buffer/client/query_tracker_unittest.cc
+++ b/chromium/gpu/command_buffer/client/query_tracker_unittest.cc
@@ -21,11 +21,6 @@
namespace gpu {
namespace gles2 {
-namespace {
-void EmptyPoll() {
-}
-}
-
class QuerySyncManagerTest : public testing::Test {
protected:
static const int32 kNumCommandEntries = 400;
@@ -36,8 +31,8 @@ class QuerySyncManagerTest : public testing::Test {
command_buffer_.reset(new MockClientCommandBuffer());
helper_.reset(new GLES2CmdHelper(command_buffer_.get()));
helper_->Initialize(kCommandBufferSizeBytes);
- mapped_memory_.reset(new MappedMemoryManager(
- helper_.get(), base::Bind(&EmptyPoll), MappedMemoryManager::kNoLimit));
+ mapped_memory_.reset(
+ new MappedMemoryManager(helper_.get(), MappedMemoryManager::kNoLimit));
sync_manager_.reset(new QuerySyncManager(mapped_memory_.get()));
}
@@ -90,8 +85,8 @@ class QueryTrackerTest : public testing::Test {
command_buffer_.reset(new MockClientCommandBuffer());
helper_.reset(new GLES2CmdHelper(command_buffer_.get()));
helper_->Initialize(kCommandBufferSizeBytes);
- mapped_memory_.reset(new MappedMemoryManager(
- helper_.get(), base::Bind(&EmptyPoll), MappedMemoryManager::kNoLimit));
+ mapped_memory_.reset(
+ new MappedMemoryManager(helper_.get(), MappedMemoryManager::kNoLimit));
query_tracker_.reset(new QueryTracker(mapped_memory_.get()));
}
@@ -290,6 +285,7 @@ TEST_F(QueryTrackerTest, ManyQueries) {
EXPECT_EQ(use_count_before_remove - 1, GetBucketUsedCount(bucket));
}
}
+
} // namespace gles2
} // namespace gpu
diff --git a/chromium/gpu/command_buffer/client/ring_buffer.cc b/chromium/gpu/command_buffer/client/ring_buffer.cc
index c66fc06c147..002d529c6d7 100644
--- a/chromium/gpu/command_buffer/client/ring_buffer.cc
+++ b/chromium/gpu/command_buffer/client/ring_buffer.cc
@@ -167,4 +167,14 @@ unsigned int RingBuffer::GetLargestFreeSizeNoWaiting() {
}
}
+unsigned int RingBuffer::GetTotalFreeSizeNoWaiting() {
+ unsigned int largest_free_size = GetLargestFreeSizeNoWaiting();
+ if (free_offset_ > in_use_offset_) {
+ // It's free from free_offset_ to size_ and from 0 to in_use_offset_.
+ return size_ - free_offset_ + in_use_offset_;
+ } else {
+ return largest_free_size;
+ }
+}
+
} // namespace gpu
diff --git a/chromium/gpu/command_buffer/client/ring_buffer.h b/chromium/gpu/command_buffer/client/ring_buffer.h
index 00de8a59bad..ff20a4c05fe 100644
--- a/chromium/gpu/command_buffer/client/ring_buffer.h
+++ b/chromium/gpu/command_buffer/client/ring_buffer.h
@@ -63,6 +63,9 @@ class GPU_EXPORT RingBuffer {
// Gets the size of the largest free block that is available without waiting.
unsigned int GetLargestFreeSizeNoWaiting();
+ // Gets the total size of all free blocks that are available without waiting.
+ unsigned int GetTotalFreeSizeNoWaiting();
+
// Gets the size of the largest free block that can be allocated if the
// caller can wait. Allocating a block of this size will succeed, but may
// block.
diff --git a/chromium/gpu/command_buffer/client/ring_buffer_test.cc b/chromium/gpu/command_buffer/client/ring_buffer_test.cc
index dad9cbc3686..86b420da6ef 100644
--- a/chromium/gpu/command_buffer/client/ring_buffer_test.cc
+++ b/chromium/gpu/command_buffer/client/ring_buffer_test.cc
@@ -66,7 +66,7 @@ class BaseRingBufferTest : public testing::Test {
Return(error::kNoError)));
{
- TransferBufferManager* manager = new TransferBufferManager();
+ TransferBufferManager* manager = new TransferBufferManager(nullptr);
transfer_buffer_manager_ = manager;
EXPECT_TRUE(manager->Initialize());
}
diff --git a/chromium/gpu/command_buffer/client/share_group.cc b/chromium/gpu/command_buffer/client/share_group.cc
index 32e853b7f2f..fb5b886b052 100644
--- a/chromium/gpu/command_buffer/client/share_group.cc
+++ b/chromium/gpu/command_buffer/client/share_group.cc
@@ -318,8 +318,38 @@ class NonReusedIdHandler : public IdHandlerInterface {
GLuint last_id_;
};
-ShareGroup::ShareGroup(bool bind_generates_resource)
- : bind_generates_resource_(bind_generates_resource) {
+class RangeIdHandler : public RangeIdHandlerInterface {
+ public:
+ RangeIdHandler() {}
+
+ void MakeIdRange(GLES2Implementation* /*gl_impl*/,
+ GLsizei n,
+ GLuint* first_id) override {
+ base::AutoLock auto_lock(lock_);
+ *first_id = id_allocator_.AllocateIDRange(n);
+ }
+
+ void FreeIdRange(GLES2Implementation* gl_impl,
+ const GLuint first_id,
+ GLsizei range,
+ DeleteRangeFn delete_fn) override {
+ base::AutoLock auto_lock(lock_);
+ DCHECK(range > 0);
+ id_allocator_.FreeIDRange(first_id, range);
+ (gl_impl->*delete_fn)(first_id, range);
+ gl_impl->helper()->CommandBufferHelper::OrderingBarrier();
+ }
+
+ void FreeContext(GLES2Implementation* gl_impl) override {}
+
+ private:
+ base::Lock lock_;
+ IdAllocator id_allocator_;
+};
+
+ShareGroup::ShareGroup(bool bind_generates_resource, uint64_t tracing_guid)
+ : bind_generates_resource_(bind_generates_resource),
+ tracing_guid_(tracing_guid) {
if (bind_generates_resource) {
for (int i = 0; i < id_namespaces::kNumIdNamespaces; ++i) {
if (i == id_namespaces::kProgramsAndShaders) {
@@ -338,6 +368,9 @@ ShareGroup::ShareGroup(bool bind_generates_resource)
}
}
program_info_manager_.reset(new ProgramInfoManager);
+ for (auto& range_id_handler : range_id_handlers_) {
+ range_id_handler.reset(new RangeIdHandler());
+ }
}
void ShareGroup::set_program_info_manager(ProgramInfoManager* manager) {
diff --git a/chromium/gpu/command_buffer/client/share_group.h b/chromium/gpu/command_buffer/client/share_group.h
index c1500043190..9fe0fb98de2 100644
--- a/chromium/gpu/command_buffer/client/share_group.h
+++ b/chromium/gpu/command_buffer/client/share_group.h
@@ -19,6 +19,8 @@ class GLES2ImplementationTest;
class ProgramInfoManager;
typedef void (GLES2Implementation::*DeleteFn)(GLsizei n, const GLuint* ids);
+typedef void (GLES2Implementation::*DeleteRangeFn)(const GLuint first_id,
+ GLsizei range);
typedef void (GLES2Implementation::*BindFn)(GLenum target, GLuint id);
typedef void (GLES2Implementation::*BindIndexedFn)( \
GLenum target, GLuint index, GLuint id);
@@ -86,11 +88,32 @@ class IdHandlerInterface {
virtual void FreeContext(GLES2Implementation* gl_impl) = 0;
};
+class RangeIdHandlerInterface {
+ public:
+ RangeIdHandlerInterface() {}
+ virtual ~RangeIdHandlerInterface() {}
+
+ // Makes a continuous range of ids. Stores the first allocated id to
+ // |first_id| or 0 if allocation failed.
+ virtual void MakeIdRange(GLES2Implementation* gl_impl,
+ GLsizei n,
+ GLuint* first_id) = 0;
+
+ // Frees a continuous |range| of ids beginning at |first_id|.
+ virtual void FreeIdRange(GLES2Implementation* gl_impl,
+ const GLuint first_id,
+ GLsizei range,
+ DeleteRangeFn delete_fn) = 0;
+
+ // Called when a context in the share group is destructed.
+ virtual void FreeContext(GLES2Implementation* gl_impl) = 0;
+};
+
// ShareGroup manages shared resources for contexts that are sharing resources.
class GLES2_IMPL_EXPORT ShareGroup
: public gpu::RefCountedThreadSafe<ShareGroup> {
public:
- ShareGroup(bool bind_generates_resource);
+ ShareGroup(bool bind_generates_resource, uint64_t tracing_guid);
bool bind_generates_resource() const {
return bind_generates_resource_;
@@ -100,6 +123,10 @@ class GLES2_IMPL_EXPORT ShareGroup
return id_handlers_[namespace_id].get();
}
+ RangeIdHandlerInterface* GetRangeIdHandler(int range_namespace_id) const {
+ return range_id_handlers_[range_namespace_id].get();
+ }
+
ProgramInfoManager* program_info_manager() {
return program_info_manager_.get();
}
@@ -108,8 +135,13 @@ class GLES2_IMPL_EXPORT ShareGroup
for (int i = 0; i < id_namespaces::kNumIdNamespaces; ++i) {
id_handlers_[i]->FreeContext(gl_impl);
}
+ for (auto& range_id_handler : range_id_handlers_) {
+ range_id_handler->FreeContext(gl_impl);
+ }
}
+ uint64_t TracingGUID() const { return tracing_guid_; }
+
private:
friend class gpu::RefCountedThreadSafe<ShareGroup>;
friend class gpu::gles2::GLES2ImplementationTest;
@@ -119,9 +151,12 @@ class GLES2_IMPL_EXPORT ShareGroup
void set_program_info_manager(ProgramInfoManager* manager);
scoped_ptr<IdHandlerInterface> id_handlers_[id_namespaces::kNumIdNamespaces];
+ scoped_ptr<RangeIdHandlerInterface>
+ range_id_handlers_[id_namespaces::kNumRangeIdNamespaces];
scoped_ptr<ProgramInfoManager> program_info_manager_;
bool bind_generates_resource_;
+ uint64_t tracing_guid_;
DISALLOW_COPY_AND_ASSIGN(ShareGroup);
};
diff --git a/chromium/gpu/command_buffer/client/transfer_buffer.cc b/chromium/gpu/command_buffer/client/transfer_buffer.cc
index 3ff257da5ad..dde802096b4 100644
--- a/chromium/gpu/command_buffer/client/transfer_buffer.cc
+++ b/chromium/gpu/command_buffer/client/transfer_buffer.cc
@@ -85,6 +85,14 @@ void TransferBuffer::FreePendingToken(void* p, unsigned int token) {
}
}
+unsigned int TransferBuffer::GetSize() const {
+ return HaveBuffer() ? ring_buffer_->GetLargestFreeOrPendingSize() : 0;
+}
+
+unsigned int TransferBuffer::GetFreeSize() const {
+ return HaveBuffer() ? ring_buffer_->GetTotalFreeSizeNoWaiting() : 0;
+}
+
void TransferBuffer::AllocateRingBuffer(unsigned int size) {
for (;size >= min_buffer_size_; size /= 2) {
int32 id = -1;
diff --git a/chromium/gpu/command_buffer/client/transfer_buffer.h b/chromium/gpu/command_buffer/client/transfer_buffer.h
index e1f8e91ba43..7dbe6021f50 100644
--- a/chromium/gpu/command_buffer/client/transfer_buffer.h
+++ b/chromium/gpu/command_buffer/client/transfer_buffer.h
@@ -50,6 +50,10 @@ class GPU_EXPORT TransferBufferInterface {
virtual void DiscardBlock(void* p) = 0;
virtual void FreePendingToken(void* p, unsigned int token) = 0;
+
+ virtual unsigned int GetSize() const = 0;
+
+ virtual unsigned int GetFreeSize() const = 0;
};
// Class that manages the transfer buffer.
@@ -75,6 +79,8 @@ class GPU_EXPORT TransferBuffer : public TransferBufferInterface {
RingBuffer::Offset GetOffset(void* pointer) const override;
void DiscardBlock(void* p) override;
void FreePendingToken(void* p, unsigned int token) override;
+ unsigned int GetSize() const override;
+ unsigned int GetFreeSize() const override;
// These are for testing.
unsigned int GetCurrentMaxAllocationWithoutRealloc() const;
diff --git a/chromium/gpu/command_buffer/cmd_buffer_functions.txt b/chromium/gpu/command_buffer/cmd_buffer_functions.txt
index 8b3176a9f4f..9eda893e9e4 100644
--- a/chromium/gpu/command_buffer/cmd_buffer_functions.txt
+++ b/chromium/gpu/command_buffer/cmd_buffer_functions.txt
@@ -87,6 +87,7 @@ GL_APICALL void GL_APIENTRY glGetActiveUniformsiv (GLidProgram program,
GL_APICALL void GL_APIENTRY glGetAttachedShaders (GLidProgram program, GLsizeiNotNegative maxcount, GLsizeiOptional* count, GLuint* shaders);
GL_APICALL GLint GL_APIENTRY glGetAttribLocation (GLidProgram program, const char* name);
GL_APICALL void GL_APIENTRY glGetBooleanv (GLenumGLState pname, GLboolean* params);
+GL_APICALL void GL_APIENTRY glGetBufferParameteri64v (GLenumBufferTarget target, GLenumBufferParameter64 pname, GLint64* params);
GL_APICALL void GL_APIENTRY glGetBufferParameteriv (GLenumBufferTarget target, GLenumBufferParameter pname, GLint* params);
GL_APICALL GLenum GL_APIENTRY glGetError (void);
GL_APICALL void GL_APIENTRY glGetFloatv (GLenumGLState pname, GLfloat* params);
@@ -140,7 +141,7 @@ GL_APICALL void GL_APIENTRY glLinkProgram (GLidProgram program);
GL_APICALL void GL_APIENTRY glPauseTransformFeedback (void);
GL_APICALL void GL_APIENTRY glPixelStorei (GLenumPixelStore pname, GLintPixelStoreAlignment param);
GL_APICALL void GL_APIENTRY glPolygonOffset (GLfloat factor, GLfloat units);
-GL_APICALL void GL_APIENTRY glReadBuffer (GLenum src);
+GL_APICALL void GL_APIENTRY glReadBuffer (GLenumReadBuffer src);
GL_APICALL void GL_APIENTRY glReadPixels (GLint x, GLint y, GLsizei width, GLsizei height, GLenumReadPixelFormat format, GLenumReadPixelType type, void* pixels);
GL_APICALL void GL_APIENTRY glReleaseShaderCompiler (void);
GL_APICALL void GL_APIENTRY glRenderbufferStorage (GLenumRenderBufferTarget target, GLenumRenderBufferFormat internalformat, GLsizei width, GLsizei height);
@@ -231,14 +232,18 @@ GL_APICALL void GL_APIENTRY glFramebufferTexture2DMultisampleEXT (GLenum
GL_APICALL void GL_APIENTRY glTexStorage2DEXT (GLenumTextureBindTarget target, GLsizei levels, GLenumTextureInternalFormatStorage internalFormat, GLsizei width, GLsizei height);
GL_APICALL void GL_APIENTRY glGenQueriesEXT (GLsizeiNotNegative n, GLuint* queries);
GL_APICALL void GL_APIENTRY glDeleteQueriesEXT (GLsizeiNotNegative n, const GLuint* queries);
+GL_APICALL void GL_APIENTRY glQueryCounterEXT (GLidQuery id, GLenumQueryTarget target);
GL_APICALL GLboolean GL_APIENTRY glIsQueryEXT (GLidQuery id);
GL_APICALL void GL_APIENTRY glBeginQueryEXT (GLenumQueryTarget target, GLidQuery id);
GL_APICALL void GL_APIENTRY glBeginTransformFeedback (GLenumTransformFeedbackPrimitiveMode primitivemode);
GL_APICALL void GL_APIENTRY glEndQueryEXT (GLenumQueryTarget target);
GL_APICALL void GL_APIENTRY glEndTransformFeedback (void);
GL_APICALL void GL_APIENTRY glGetQueryivEXT (GLenumQueryTarget target, GLenumQueryParameter pname, GLint* params);
+GL_APICALL void GL_APIENTRY glGetQueryObjectivEXT (GLidQuery id, GLenumQueryObjectParameter pname, GLint* params);
GL_APICALL void GL_APIENTRY glGetQueryObjectuivEXT (GLidQuery id, GLenumQueryObjectParameter pname, GLuint* params);
+GL_APICALL void GL_APIENTRY glGetQueryObjecti64vEXT (GLidQuery id, GLenumQueryObjectParameter pname, GLint64* params);
GL_APICALL void GL_APIENTRY glGetQueryObjectui64vEXT (GLidQuery id, GLenumQueryObjectParameter pname, GLuint64* params);
+GL_APICALL void GL_APIENTRY glSetDisjointValueSyncCHROMIUM (void);
GL_APICALL void GL_APIENTRY glInsertEventMarkerEXT (GLsizei length, const GLchar* marker);
GL_APICALL void GL_APIENTRY glPushGroupMarkerEXT (GLsizei length, const GLchar* marker);
GL_APICALL void GL_APIENTRY glPopGroupMarkerEXT (void);
@@ -263,7 +268,6 @@ GL_APICALL void GL_APIENTRY glUnmapTexSubImage2DCHROMIUM (const void* me
GL_APICALL void GL_APIENTRY glResizeCHROMIUM (GLuint width, GLuint height, GLfloat scale_factor);
GL_APICALL const GLchar* GL_APIENTRY glGetRequestableExtensionsCHROMIUM (void);
GL_APICALL void GL_APIENTRY glRequestExtensionCHROMIUM (const char* extension);
-GL_APICALL void GL_APIENTRY glRateLimitOffscreenContextCHROMIUM (void);
GL_APICALL void GL_APIENTRY glGetProgramInfoCHROMIUM (GLidProgram program, GLsizeiNotNegative bufsize, GLsizei* size, void* info);
GL_APICALL void GL_APIENTRY glGetUniformBlocksCHROMIUM (GLidProgram program, GLsizeiNotNegative bufsize, GLsizei* size, void* info);
GL_APICALL void GL_APIENTRY glGetTransformFeedbackVaryingsCHROMIUM (GLidProgram program, GLsizeiNotNegative bufsize, GLsizei* size, void* info);
@@ -278,6 +282,7 @@ GL_APICALL void GL_APIENTRY glTexImageIOSurface2DCHROMIUM (GLenumTexture
GL_APICALL void GL_APIENTRY glCopyTextureCHROMIUM (GLenum target, GLenum source_id, GLenum dest_id, GLintTextureInternalFormat internalformat, GLenumPixelType dest_type, GLboolean unpack_flip_y, GLboolean unpack_premultiply_alpha, GLboolean unpack_unmultiply_alpha);
GL_APICALL void GL_APIENTRY glCopySubTextureCHROMIUM (GLenum target, GLenum source_id, GLenum dest_id, GLint xoffset, GLint yoffset, GLint x, GLint y, GLsizei width, GLsizei height, GLboolean unpack_flip_y, GLboolean unpack_premultiply_alpha, GLboolean unpack_unmultiply_alpha);
GL_APICALL void GL_APIENTRY glCompressedCopyTextureCHROMIUM (GLenum target, GLenum source_id, GLenum dest_id);
+GL_APICALL void GL_APIENTRY glCompressedCopySubTextureCHROMIUM (GLenum target, GLenum source_id, GLenum dest_id, GLint xoffset, GLint yoffset, GLint x, GLint y, GLsizei width, GLsizei height);
GL_APICALL void GL_APIENTRY glDrawArraysInstancedANGLE (GLenumDrawMode mode, GLint first, GLsizei count, GLsizei primcount);
GL_APICALL void GL_APIENTRY glDrawElementsInstancedANGLE (GLenumDrawMode mode, GLsizei count, GLenumIndexType type, const void* indices, GLsizei primcount);
GL_APICALL void GL_APIENTRY glVertexAttribDivisorANGLE (GLuint index, GLuint divisor);
@@ -298,10 +303,6 @@ GL_APICALL void GL_APIENTRY glBindTexImage2DCHROMIUM (GLenumTextureBindT
GL_APICALL void GL_APIENTRY glReleaseTexImage2DCHROMIUM (GLenumTextureBindTarget target, GLint imageId);
GL_APICALL void GL_APIENTRY glTraceBeginCHROMIUM (const char* category_name, const char* trace_name);
GL_APICALL void GL_APIENTRY glTraceEndCHROMIUM (void);
-GL_APICALL void GL_APIENTRY glAsyncTexSubImage2DCHROMIUM (GLenumTextureTarget target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenumTextureFormat format, GLenumPixelType type, const void* data);
-GL_APICALL void GL_APIENTRY glAsyncTexImage2DCHROMIUM (GLenumTextureTarget target, GLint level, GLenumTextureInternalFormat internalformat, GLsizei width, GLsizei height, GLintTextureBorder border, GLenumTextureFormat format, GLenumPixelType type, const void* pixels);
-GL_APICALL void GL_APIENTRY glWaitAsyncTexImage2DCHROMIUM (GLenumTextureTarget target);
-GL_APICALL void GL_APIENTRY glWaitAllAsyncTexImage2DCHROMIUM (void);
GL_APICALL void GL_APIENTRY glDiscardFramebufferEXT (GLenum target, GLsizei count, const GLenum* attachments);
GL_APICALL void GL_APIENTRY glLoseContextCHROMIUM (GLenumResetStatus current, GLenumResetStatus other);
GL_APICALL GLuint GL_APIENTRY glInsertSyncPointCHROMIUM (void);
@@ -315,9 +316,25 @@ GL_APICALL void GL_APIENTRY glFlushDriverCachesCHROMIUM (void);
// Extension CHROMIUM_path_rendering.
GL_APICALL void GL_APIENTRY glMatrixLoadfCHROMIUM (GLenumMatrixMode matrixMode, const GLfloat* m);
GL_APICALL void GL_APIENTRY glMatrixLoadIdentityCHROMIUM (GLenumMatrixMode matrixMode);
+GL_APICALL GLuint GL_APIENTRY glGenPathsCHROMIUM (GLsizei range);
+GL_APICALL void GL_APIENTRY glDeletePathsCHROMIUM (GLidPath path, GLsizei range);
+GL_APICALL GLboolean GL_APIENTRY glIsPathCHROMIUM (GLidPath path);
+GL_APICALL void GL_APIENTRY glPathCommandsCHROMIUM (GLidPath path, GLsizei numCommands, const GLubyte* commands, GLsizei numCoords, GLenumPathCoordType coordType, const GLvoid* coords);
+GL_APICALL void GL_APIENTRY glPathParameterfCHROMIUM (GLidPath path, GLenumPathParameter pname, GLfloat value);
+GL_APICALL void GL_APIENTRY glPathParameteriCHROMIUM (GLidPath path, GLenumPathParameter pname, GLint value);
+GL_APICALL void GL_APIENTRY glPathStencilFuncCHROMIUM (GLenumCmpFunction func, GLint ref, GLuint mask);
+GL_APICALL void GL_APIENTRY glStencilFillPathCHROMIUM (GLidPath path, GLenumPathFillMode fillMode, GLuint mask);
+GL_APICALL void GL_APIENTRY glStencilStrokePathCHROMIUM (GLidPath path, GLint reference, GLuint mask);
+GL_APICALL void GL_APIENTRY glCoverFillPathCHROMIUM (GLidPath path, GLenumPathCoverMode coverMode);
+GL_APICALL void GL_APIENTRY glCoverStrokePathCHROMIUM (GLidPath path, GLenumPathCoverMode coverMode);
+GL_APICALL void GL_APIENTRY glStencilThenCoverFillPathCHROMIUM (GLidPath path, GLenumPathFillMode fillMode, GLuint mask, GLenumPathCoverMode coverMode);
+GL_APICALL void GL_APIENTRY glStencilThenCoverStrokePathCHROMIUM (GLidPath path, GLint reference, GLuint mask, GLenumPathCoverMode coverMode);
// Extension KHR_robustness
GL_APICALL GLenum GL_APIENTRY glGetGraphicsResetStatusKHR (void);
// Extension KHR_blend_equation_advanced
GL_APICALL void GL_APIENTRY glBlendBarrierKHR (void);
+
+// Extension GL_CHROMIUM_screen_space_antialiasing
+GL_APICALL void GL_APIENTRY glApplyScreenSpaceAntialiasingCHROMIUM (void);
diff --git a/chromium/gpu/command_buffer/common/buffer.cc b/chromium/gpu/command_buffer/common/buffer.cc
index 3b3da4345d7..e402886f9e3 100644
--- a/chromium/gpu/command_buffer/common/buffer.cc
+++ b/chromium/gpu/command_buffer/common/buffer.cc
@@ -4,9 +4,10 @@
#include "gpu/command_buffer/common/buffer.h"
+#include "base/format_macros.h"
#include "base/logging.h"
-
#include "base/numerics/safe_math.h"
+#include "base/strings/stringprintf.h"
namespace gpu {
SharedMemoryBufferBacking::SharedMemoryBufferBacking(
@@ -39,4 +40,11 @@ void* Buffer::GetDataAddress(uint32 data_offset, uint32 data_size) const {
return static_cast<uint8*>(memory_) + data_offset;
}
+base::trace_event::MemoryAllocatorDumpGuid GetBufferGUIDForTracing(
+ uint64_t tracing_process_id,
+ int32_t buffer_id) {
+ return base::trace_event::MemoryAllocatorDumpGuid(base::StringPrintf(
+ "gpu-buffer-x-process/%" PRIx64 "/%d", tracing_process_id, buffer_id));
+}
+
} // namespace gpu
diff --git a/chromium/gpu/command_buffer/common/buffer.h b/chromium/gpu/command_buffer/common/buffer.h
index 5942f7fb2da..e14dabe8e27 100644
--- a/chromium/gpu/command_buffer/common/buffer.h
+++ b/chromium/gpu/command_buffer/common/buffer.h
@@ -9,6 +9,7 @@
#include "base/memory/ref_counted.h"
#include "base/memory/scoped_ptr.h"
#include "base/memory/shared_memory.h"
+#include "base/trace_event/memory_allocator_dump.h"
#include "gpu/gpu_export.h"
namespace base {
@@ -75,6 +76,11 @@ static inline scoped_refptr<Buffer> MakeBufferFromSharedMemory(
return new Buffer(MakeBackingFromSharedMemory(shared_memory.Pass(), size));
}
+// Generates GUID which can be used to trace buffer using an Id.
+GPU_EXPORT base::trace_event::MemoryAllocatorDumpGuid GetBufferGUIDForTracing(
+ uint64_t tracing_process_id,
+ int32_t buffer_id);
+
} // namespace gpu
#endif // GPU_COMMAND_BUFFER_COMMON_BUFFER_H_
diff --git a/chromium/gpu/command_buffer/common/capabilities.cc b/chromium/gpu/command_buffer/common/capabilities.cc
index baec1541118..becf6fd7b10 100644
--- a/chromium/gpu/command_buffer/common/capabilities.cc
+++ b/chromium/gpu/command_buffer/common/capabilities.cc
@@ -56,6 +56,7 @@ Capabilities::Capabilities()
uniform_buffer_offset_alignment(1),
post_sub_buffer(false),
egl_image_external(false),
+ texture_format_astc(false),
texture_format_atc(false),
texture_format_bgra8888(false),
texture_format_dxt1(false),
@@ -73,10 +74,12 @@ Capabilities::Capabilities()
blend_equation_advanced(false),
blend_equation_advanced_coherent(false),
texture_rg(false),
+ image_ycbcr_422(false),
render_buffer_format_bgra8888(false),
occlusion_query_boolean(false),
+ timer_queries(false),
+ surfaceless(false),
major_version(2),
- minor_version(0) {
-}
+ minor_version(0) {}
} // namespace gpu
diff --git a/chromium/gpu/command_buffer/common/capabilities.h b/chromium/gpu/command_buffer/common/capabilities.h
index 19f1d26fa05..532c2dfff14 100644
--- a/chromium/gpu/command_buffer/common/capabilities.h
+++ b/chromium/gpu/command_buffer/common/capabilities.h
@@ -115,6 +115,7 @@ struct GPU_EXPORT Capabilities {
bool post_sub_buffer;
bool egl_image_external;
+ bool texture_format_astc;
bool texture_format_atc;
bool texture_format_bgra8888;
bool texture_format_dxt1;
@@ -132,9 +133,11 @@ struct GPU_EXPORT Capabilities {
bool blend_equation_advanced;
bool blend_equation_advanced_coherent;
bool texture_rg;
+ bool image_ycbcr_422;
bool render_buffer_format_bgra8888;
bool occlusion_query_boolean;
bool timer_queries;
+ bool surfaceless;
int major_version;
int minor_version;
diff --git a/chromium/gpu/command_buffer/common/constants.h b/chromium/gpu/command_buffer/common/constants.h
index d06836c0d71..e14c06db541 100644
--- a/chromium/gpu/command_buffer/common/constants.h
+++ b/chromium/gpu/command_buffer/common/constants.h
@@ -66,6 +66,18 @@ const int32_t kCommandBufferSharedMemoryId = 4;
// The size to set for the program cache.
const size_t kDefaultMaxProgramCacheMemoryBytes = 6 * 1024 * 1024;
+// Namespace used to separate various command buffer types.
+enum CommandBufferNamespace {
+ INVALID = -1,
+
+ GPU_IO,
+ IN_PROCESS,
+ MOJO,
+
+ NUM_COMMAND_BUFFER_NAMESPACES
+};
+
+
} // namespace gpu
#endif // GPU_COMMAND_BUFFER_COMMON_CONSTANTS_H_
diff --git a/chromium/gpu/command_buffer/common/gles2_cmd_format.h b/chromium/gpu/command_buffer/common/gles2_cmd_format.h
index db63594f250..e4d00dd41ea 100644
--- a/chromium/gpu/command_buffer/common/gles2_cmd_format.h
+++ b/chromium/gpu/command_buffer/common/gles2_cmd_format.h
@@ -70,12 +70,15 @@ enum IdNamespaces {
kNumIdNamespaces
};
+enum RangeIdNamespaces { kPaths, kNumRangeIdNamespaces };
+
// These numbers must not change
static_assert(kBuffers == 0, "kBuffers should equal 0");
static_assert(kFramebuffers == 1, "kFramebuffers should equal 1");
static_assert(kProgramsAndShaders == 2, "kProgramsAndShaders should equal 2");
static_assert(kRenderbuffers == 3, "kRenderbuffers should equal 3");
static_assert(kTextures == 4, "kTextures should equal 4");
+static_assert(kPaths == 0, "kPaths should equal 0");
} // namespace id_namespaces
@@ -178,6 +181,7 @@ struct TransformFeedbackVaryingInfo {
// The format of the bucket filled out by GetTransformFeedbackVaryingsCHROMIUM
struct TransformFeedbackVaryingsHeader {
+ uint32_t transform_feedback_buffer_mode;
uint32_t num_transform_feedback_varyings;
// TransformFeedbackVaryingInfo varyings[num_transform_feedback_varyings];
};
@@ -228,6 +232,23 @@ struct AsyncUploadSync {
base::subtle::Atomic32 async_upload_token;
};
+struct DisjointValueSync {
+ void Reset() {
+ base::subtle::Release_Store(&disjoint_count, 0);
+ }
+
+ void SetDisjointCount(uint32_t token) {
+ DCHECK_NE(token, 0u);
+ base::subtle::Release_Store(&disjoint_count, token);
+ }
+
+ uint32_t GetDisjointCount() {
+ return base::subtle::Acquire_Load(&disjoint_count);
+ }
+
+ base::subtle::Atomic32 disjoint_count;
+};
+
static_assert(sizeof(ProgramInput) == 20, "size of ProgramInput should be 20");
static_assert(offsetof(ProgramInput, type) == 0,
"offset of ProgramInput.type should be 0");
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 ae5d0e29891..3f288cb3ebd 100644
--- a/chromium/gpu/command_buffer/common/gles2_cmd_format_autogen.h
+++ b/chromium/gpu/command_buffer/common/gles2_cmd_format_autogen.h
@@ -4136,6 +4136,62 @@ static_assert(offsetof(GetBooleanv, params_shm_id) == 8,
static_assert(offsetof(GetBooleanv, params_shm_offset) == 12,
"offset of GetBooleanv params_shm_offset should be 12");
+struct GetBufferParameteri64v {
+ typedef GetBufferParameteri64v ValueType;
+ static const CommandId kCmdId = kGetBufferParameteri64v;
+ static const cmd::ArgFlags kArgFlags = cmd::kFixed;
+ static const uint8 cmd_flags = CMD_FLAG_SET_TRACE_LEVEL(3);
+
+ typedef SizedResult<GLint64> Result;
+
+ static uint32_t ComputeSize() {
+ return static_cast<uint32_t>(sizeof(ValueType)); // NOLINT
+ }
+
+ void SetHeader() { header.SetCmd<ValueType>(); }
+
+ void Init(GLenum _target,
+ GLenum _pname,
+ uint32_t _params_shm_id,
+ uint32_t _params_shm_offset) {
+ SetHeader();
+ target = _target;
+ pname = _pname;
+ params_shm_id = _params_shm_id;
+ params_shm_offset = _params_shm_offset;
+ }
+
+ void* Set(void* cmd,
+ GLenum _target,
+ GLenum _pname,
+ uint32_t _params_shm_id,
+ uint32_t _params_shm_offset) {
+ static_cast<ValueType*>(cmd)
+ ->Init(_target, _pname, _params_shm_id, _params_shm_offset);
+ return NextCmdAddress<ValueType>(cmd);
+ }
+
+ gpu::CommandHeader header;
+ uint32_t target;
+ uint32_t pname;
+ uint32_t params_shm_id;
+ uint32_t params_shm_offset;
+};
+
+static_assert(sizeof(GetBufferParameteri64v) == 20,
+ "size of GetBufferParameteri64v should be 20");
+static_assert(offsetof(GetBufferParameteri64v, header) == 0,
+ "offset of GetBufferParameteri64v header should be 0");
+static_assert(offsetof(GetBufferParameteri64v, target) == 4,
+ "offset of GetBufferParameteri64v target should be 4");
+static_assert(offsetof(GetBufferParameteri64v, pname) == 8,
+ "offset of GetBufferParameteri64v pname should be 8");
+static_assert(offsetof(GetBufferParameteri64v, params_shm_id) == 12,
+ "offset of GetBufferParameteri64v params_shm_id should be 12");
+static_assert(
+ offsetof(GetBufferParameteri64v, params_shm_offset) == 16,
+ "offset of GetBufferParameteri64v params_shm_offset should be 16");
+
struct GetBufferParameteriv {
typedef GetBufferParameteriv ValueType;
static const CommandId kCmdId = kGetBufferParameteriv;
@@ -11055,6 +11111,65 @@ static_assert(offsetof(DeleteQueriesEXTImmediate, header) == 0,
static_assert(offsetof(DeleteQueriesEXTImmediate, n) == 4,
"offset of DeleteQueriesEXTImmediate n should be 4");
+struct QueryCounterEXT {
+ typedef QueryCounterEXT ValueType;
+ static const CommandId kCmdId = kQueryCounterEXT;
+ static const cmd::ArgFlags kArgFlags = cmd::kFixed;
+ static const uint8 cmd_flags = CMD_FLAG_SET_TRACE_LEVEL(3);
+
+ static uint32_t ComputeSize() {
+ return static_cast<uint32_t>(sizeof(ValueType)); // NOLINT
+ }
+
+ void SetHeader() { header.SetCmd<ValueType>(); }
+
+ void Init(GLuint _id,
+ GLenum _target,
+ uint32_t _sync_data_shm_id,
+ uint32_t _sync_data_shm_offset,
+ GLuint _submit_count) {
+ SetHeader();
+ id = _id;
+ target = _target;
+ sync_data_shm_id = _sync_data_shm_id;
+ sync_data_shm_offset = _sync_data_shm_offset;
+ submit_count = _submit_count;
+ }
+
+ void* Set(void* cmd,
+ GLuint _id,
+ GLenum _target,
+ uint32_t _sync_data_shm_id,
+ uint32_t _sync_data_shm_offset,
+ GLuint _submit_count) {
+ static_cast<ValueType*>(cmd)->Init(_id, _target, _sync_data_shm_id,
+ _sync_data_shm_offset, _submit_count);
+ return NextCmdAddress<ValueType>(cmd);
+ }
+
+ gpu::CommandHeader header;
+ uint32_t id;
+ uint32_t target;
+ uint32_t sync_data_shm_id;
+ uint32_t sync_data_shm_offset;
+ uint32_t submit_count;
+};
+
+static_assert(sizeof(QueryCounterEXT) == 24,
+ "size of QueryCounterEXT should be 24");
+static_assert(offsetof(QueryCounterEXT, header) == 0,
+ "offset of QueryCounterEXT header should be 0");
+static_assert(offsetof(QueryCounterEXT, id) == 4,
+ "offset of QueryCounterEXT id should be 4");
+static_assert(offsetof(QueryCounterEXT, target) == 8,
+ "offset of QueryCounterEXT target should be 8");
+static_assert(offsetof(QueryCounterEXT, sync_data_shm_id) == 12,
+ "offset of QueryCounterEXT sync_data_shm_id should be 12");
+static_assert(offsetof(QueryCounterEXT, sync_data_shm_offset) == 16,
+ "offset of QueryCounterEXT sync_data_shm_offset should be 16");
+static_assert(offsetof(QueryCounterEXT, submit_count) == 20,
+ "offset of QueryCounterEXT submit_count should be 20");
+
struct BeginQueryEXT {
typedef BeginQueryEXT ValueType;
static const CommandId kCmdId = kBeginQueryEXT;
@@ -11204,6 +11319,48 @@ static_assert(sizeof(EndTransformFeedback) == 4,
static_assert(offsetof(EndTransformFeedback, header) == 0,
"offset of EndTransformFeedback header should be 0");
+struct SetDisjointValueSyncCHROMIUM {
+ typedef SetDisjointValueSyncCHROMIUM ValueType;
+ static const CommandId kCmdId = kSetDisjointValueSyncCHROMIUM;
+ static const cmd::ArgFlags kArgFlags = cmd::kFixed;
+ static const uint8 cmd_flags = CMD_FLAG_SET_TRACE_LEVEL(3);
+
+ static uint32_t ComputeSize() {
+ return static_cast<uint32_t>(sizeof(ValueType)); // NOLINT
+ }
+
+ void SetHeader() { header.SetCmd<ValueType>(); }
+
+ void Init(uint32_t _sync_data_shm_id, uint32_t _sync_data_shm_offset) {
+ SetHeader();
+ sync_data_shm_id = _sync_data_shm_id;
+ sync_data_shm_offset = _sync_data_shm_offset;
+ }
+
+ void* Set(void* cmd,
+ uint32_t _sync_data_shm_id,
+ uint32_t _sync_data_shm_offset) {
+ static_cast<ValueType*>(cmd)
+ ->Init(_sync_data_shm_id, _sync_data_shm_offset);
+ return NextCmdAddress<ValueType>(cmd);
+ }
+
+ gpu::CommandHeader header;
+ uint32_t sync_data_shm_id;
+ uint32_t sync_data_shm_offset;
+};
+
+static_assert(sizeof(SetDisjointValueSyncCHROMIUM) == 12,
+ "size of SetDisjointValueSyncCHROMIUM should be 12");
+static_assert(offsetof(SetDisjointValueSyncCHROMIUM, header) == 0,
+ "offset of SetDisjointValueSyncCHROMIUM header should be 0");
+static_assert(
+ offsetof(SetDisjointValueSyncCHROMIUM, sync_data_shm_id) == 4,
+ "offset of SetDisjointValueSyncCHROMIUM sync_data_shm_id should be 4");
+static_assert(
+ offsetof(SetDisjointValueSyncCHROMIUM, sync_data_shm_offset) == 8,
+ "offset of SetDisjointValueSyncCHROMIUM sync_data_shm_offset should be 8");
+
struct InsertEventMarkerEXT {
typedef InsertEventMarkerEXT ValueType;
static const CommandId kCmdId = kInsertEventMarkerEXT;
@@ -12366,6 +12523,93 @@ static_assert(offsetof(CompressedCopyTextureCHROMIUM, source_id) == 8,
static_assert(offsetof(CompressedCopyTextureCHROMIUM, dest_id) == 12,
"offset of CompressedCopyTextureCHROMIUM dest_id should be 12");
+struct CompressedCopySubTextureCHROMIUM {
+ typedef CompressedCopySubTextureCHROMIUM ValueType;
+ static const CommandId kCmdId = kCompressedCopySubTextureCHROMIUM;
+ static const cmd::ArgFlags kArgFlags = cmd::kFixed;
+ static const uint8 cmd_flags = CMD_FLAG_SET_TRACE_LEVEL(3);
+
+ static uint32_t ComputeSize() {
+ return static_cast<uint32_t>(sizeof(ValueType)); // NOLINT
+ }
+
+ void SetHeader() { header.SetCmd<ValueType>(); }
+
+ void Init(GLenum _target,
+ GLenum _source_id,
+ GLenum _dest_id,
+ GLint _xoffset,
+ GLint _yoffset,
+ GLint _x,
+ GLint _y,
+ GLsizei _width,
+ GLsizei _height) {
+ SetHeader();
+ target = _target;
+ source_id = _source_id;
+ dest_id = _dest_id;
+ xoffset = _xoffset;
+ yoffset = _yoffset;
+ x = _x;
+ y = _y;
+ width = _width;
+ height = _height;
+ }
+
+ void* Set(void* cmd,
+ GLenum _target,
+ GLenum _source_id,
+ GLenum _dest_id,
+ GLint _xoffset,
+ GLint _yoffset,
+ GLint _x,
+ GLint _y,
+ GLsizei _width,
+ GLsizei _height) {
+ static_cast<ValueType*>(cmd)->Init(_target, _source_id, _dest_id, _xoffset,
+ _yoffset, _x, _y, _width, _height);
+ return NextCmdAddress<ValueType>(cmd);
+ }
+
+ gpu::CommandHeader header;
+ uint32_t target;
+ uint32_t source_id;
+ uint32_t dest_id;
+ int32_t xoffset;
+ int32_t yoffset;
+ int32_t x;
+ int32_t y;
+ int32_t width;
+ int32_t height;
+};
+
+static_assert(sizeof(CompressedCopySubTextureCHROMIUM) == 40,
+ "size of CompressedCopySubTextureCHROMIUM should be 40");
+static_assert(offsetof(CompressedCopySubTextureCHROMIUM, header) == 0,
+ "offset of CompressedCopySubTextureCHROMIUM header should be 0");
+static_assert(offsetof(CompressedCopySubTextureCHROMIUM, target) == 4,
+ "offset of CompressedCopySubTextureCHROMIUM target should be 4");
+static_assert(
+ offsetof(CompressedCopySubTextureCHROMIUM, source_id) == 8,
+ "offset of CompressedCopySubTextureCHROMIUM source_id should be 8");
+static_assert(
+ offsetof(CompressedCopySubTextureCHROMIUM, dest_id) == 12,
+ "offset of CompressedCopySubTextureCHROMIUM dest_id should be 12");
+static_assert(
+ offsetof(CompressedCopySubTextureCHROMIUM, xoffset) == 16,
+ "offset of CompressedCopySubTextureCHROMIUM xoffset should be 16");
+static_assert(
+ offsetof(CompressedCopySubTextureCHROMIUM, yoffset) == 20,
+ "offset of CompressedCopySubTextureCHROMIUM yoffset should be 20");
+static_assert(offsetof(CompressedCopySubTextureCHROMIUM, x) == 24,
+ "offset of CompressedCopySubTextureCHROMIUM x should be 24");
+static_assert(offsetof(CompressedCopySubTextureCHROMIUM, y) == 28,
+ "offset of CompressedCopySubTextureCHROMIUM y should be 28");
+static_assert(offsetof(CompressedCopySubTextureCHROMIUM, width) == 32,
+ "offset of CompressedCopySubTextureCHROMIUM width should be 32");
+static_assert(offsetof(CompressedCopySubTextureCHROMIUM, height) == 36,
+ "offset of CompressedCopySubTextureCHROMIUM height should be 36");
+
struct DrawArraysInstancedANGLE {
typedef DrawArraysInstancedANGLE ValueType;
static const CommandId kCmdId = kDrawArraysInstancedANGLE;
@@ -13105,287 +13349,6 @@ static_assert(sizeof(TraceEndCHROMIUM) == 4,
static_assert(offsetof(TraceEndCHROMIUM, header) == 0,
"offset of TraceEndCHROMIUM header should be 0");
-struct AsyncTexSubImage2DCHROMIUM {
- typedef AsyncTexSubImage2DCHROMIUM ValueType;
- static const CommandId kCmdId = kAsyncTexSubImage2DCHROMIUM;
- static const cmd::ArgFlags kArgFlags = cmd::kFixed;
- static const uint8 cmd_flags = CMD_FLAG_SET_TRACE_LEVEL(2);
-
- static uint32_t ComputeSize() {
- return static_cast<uint32_t>(sizeof(ValueType)); // NOLINT
- }
-
- void SetHeader() { header.SetCmd<ValueType>(); }
-
- void Init(GLenum _target,
- GLint _level,
- GLint _xoffset,
- GLint _yoffset,
- GLsizei _width,
- GLsizei _height,
- GLenum _format,
- GLenum _type,
- uint32_t _data_shm_id,
- uint32_t _data_shm_offset,
- uint32_t _async_upload_token,
- uint32_t _sync_data_shm_id,
- uint32_t _sync_data_shm_offset) {
- SetHeader();
- target = _target;
- level = _level;
- xoffset = _xoffset;
- yoffset = _yoffset;
- width = _width;
- height = _height;
- format = _format;
- type = _type;
- data_shm_id = _data_shm_id;
- data_shm_offset = _data_shm_offset;
- async_upload_token = _async_upload_token;
- sync_data_shm_id = _sync_data_shm_id;
- sync_data_shm_offset = _sync_data_shm_offset;
- }
-
- void* Set(void* cmd,
- GLenum _target,
- GLint _level,
- GLint _xoffset,
- GLint _yoffset,
- GLsizei _width,
- GLsizei _height,
- GLenum _format,
- GLenum _type,
- uint32_t _data_shm_id,
- uint32_t _data_shm_offset,
- uint32_t _async_upload_token,
- uint32_t _sync_data_shm_id,
- uint32_t _sync_data_shm_offset) {
- static_cast<ValueType*>(cmd)
- ->Init(_target, _level, _xoffset, _yoffset, _width, _height, _format,
- _type, _data_shm_id, _data_shm_offset, _async_upload_token,
- _sync_data_shm_id, _sync_data_shm_offset);
- return NextCmdAddress<ValueType>(cmd);
- }
-
- gpu::CommandHeader header;
- uint32_t target;
- int32_t level;
- int32_t xoffset;
- int32_t yoffset;
- int32_t width;
- int32_t height;
- uint32_t format;
- uint32_t type;
- uint32_t data_shm_id;
- uint32_t data_shm_offset;
- uint32_t async_upload_token;
- uint32_t sync_data_shm_id;
- uint32_t sync_data_shm_offset;
-};
-
-static_assert(sizeof(AsyncTexSubImage2DCHROMIUM) == 56,
- "size of AsyncTexSubImage2DCHROMIUM should be 56");
-static_assert(offsetof(AsyncTexSubImage2DCHROMIUM, header) == 0,
- "offset of AsyncTexSubImage2DCHROMIUM header should be 0");
-static_assert(offsetof(AsyncTexSubImage2DCHROMIUM, target) == 4,
- "offset of AsyncTexSubImage2DCHROMIUM target should be 4");
-static_assert(offsetof(AsyncTexSubImage2DCHROMIUM, level) == 8,
- "offset of AsyncTexSubImage2DCHROMIUM level should be 8");
-static_assert(offsetof(AsyncTexSubImage2DCHROMIUM, xoffset) == 12,
- "offset of AsyncTexSubImage2DCHROMIUM xoffset should be 12");
-static_assert(offsetof(AsyncTexSubImage2DCHROMIUM, yoffset) == 16,
- "offset of AsyncTexSubImage2DCHROMIUM yoffset should be 16");
-static_assert(offsetof(AsyncTexSubImage2DCHROMIUM, width) == 20,
- "offset of AsyncTexSubImage2DCHROMIUM width should be 20");
-static_assert(offsetof(AsyncTexSubImage2DCHROMIUM, height) == 24,
- "offset of AsyncTexSubImage2DCHROMIUM height should be 24");
-static_assert(offsetof(AsyncTexSubImage2DCHROMIUM, format) == 28,
- "offset of AsyncTexSubImage2DCHROMIUM format should be 28");
-static_assert(offsetof(AsyncTexSubImage2DCHROMIUM, type) == 32,
- "offset of AsyncTexSubImage2DCHROMIUM type should be 32");
-static_assert(offsetof(AsyncTexSubImage2DCHROMIUM, data_shm_id) == 36,
- "offset of AsyncTexSubImage2DCHROMIUM data_shm_id should be 36");
-static_assert(
- offsetof(AsyncTexSubImage2DCHROMIUM, data_shm_offset) == 40,
- "offset of AsyncTexSubImage2DCHROMIUM data_shm_offset should be 40");
-static_assert(
- offsetof(AsyncTexSubImage2DCHROMIUM, async_upload_token) == 44,
- "offset of AsyncTexSubImage2DCHROMIUM async_upload_token should be 44");
-static_assert(
- offsetof(AsyncTexSubImage2DCHROMIUM, sync_data_shm_id) == 48,
- "offset of AsyncTexSubImage2DCHROMIUM sync_data_shm_id should be 48");
-static_assert(
- offsetof(AsyncTexSubImage2DCHROMIUM, sync_data_shm_offset) == 52,
- "offset of AsyncTexSubImage2DCHROMIUM sync_data_shm_offset should be 52");
-
-struct AsyncTexImage2DCHROMIUM {
- typedef AsyncTexImage2DCHROMIUM ValueType;
- static const CommandId kCmdId = kAsyncTexImage2DCHROMIUM;
- static const cmd::ArgFlags kArgFlags = cmd::kFixed;
- static const uint8 cmd_flags = CMD_FLAG_SET_TRACE_LEVEL(2);
-
- static uint32_t ComputeSize() {
- return static_cast<uint32_t>(sizeof(ValueType)); // NOLINT
- }
-
- void SetHeader() { header.SetCmd<ValueType>(); }
-
- void Init(GLenum _target,
- GLint _level,
- GLint _internalformat,
- GLsizei _width,
- GLsizei _height,
- GLenum _format,
- GLenum _type,
- uint32_t _pixels_shm_id,
- uint32_t _pixels_shm_offset,
- uint32_t _async_upload_token,
- uint32_t _sync_data_shm_id,
- uint32_t _sync_data_shm_offset) {
- SetHeader();
- target = _target;
- level = _level;
- internalformat = _internalformat;
- width = _width;
- height = _height;
- format = _format;
- type = _type;
- pixels_shm_id = _pixels_shm_id;
- pixels_shm_offset = _pixels_shm_offset;
- async_upload_token = _async_upload_token;
- sync_data_shm_id = _sync_data_shm_id;
- sync_data_shm_offset = _sync_data_shm_offset;
- }
-
- void* Set(void* cmd,
- GLenum _target,
- GLint _level,
- GLint _internalformat,
- GLsizei _width,
- GLsizei _height,
- GLenum _format,
- GLenum _type,
- uint32_t _pixels_shm_id,
- uint32_t _pixels_shm_offset,
- uint32_t _async_upload_token,
- uint32_t _sync_data_shm_id,
- uint32_t _sync_data_shm_offset) {
- static_cast<ValueType*>(cmd)
- ->Init(_target, _level, _internalformat, _width, _height, _format,
- _type, _pixels_shm_id, _pixels_shm_offset, _async_upload_token,
- _sync_data_shm_id, _sync_data_shm_offset);
- return NextCmdAddress<ValueType>(cmd);
- }
-
- gpu::CommandHeader header;
- uint32_t target;
- int32_t level;
- int32_t internalformat;
- int32_t width;
- int32_t height;
- uint32_t format;
- uint32_t type;
- uint32_t pixels_shm_id;
- uint32_t pixels_shm_offset;
- uint32_t async_upload_token;
- uint32_t sync_data_shm_id;
- uint32_t sync_data_shm_offset;
- static const int32_t border = 0;
-};
-
-static_assert(sizeof(AsyncTexImage2DCHROMIUM) == 52,
- "size of AsyncTexImage2DCHROMIUM should be 52");
-static_assert(offsetof(AsyncTexImage2DCHROMIUM, header) == 0,
- "offset of AsyncTexImage2DCHROMIUM header should be 0");
-static_assert(offsetof(AsyncTexImage2DCHROMIUM, target) == 4,
- "offset of AsyncTexImage2DCHROMIUM target should be 4");
-static_assert(offsetof(AsyncTexImage2DCHROMIUM, level) == 8,
- "offset of AsyncTexImage2DCHROMIUM level should be 8");
-static_assert(offsetof(AsyncTexImage2DCHROMIUM, internalformat) == 12,
- "offset of AsyncTexImage2DCHROMIUM internalformat should be 12");
-static_assert(offsetof(AsyncTexImage2DCHROMIUM, width) == 16,
- "offset of AsyncTexImage2DCHROMIUM width should be 16");
-static_assert(offsetof(AsyncTexImage2DCHROMIUM, height) == 20,
- "offset of AsyncTexImage2DCHROMIUM height should be 20");
-static_assert(offsetof(AsyncTexImage2DCHROMIUM, format) == 24,
- "offset of AsyncTexImage2DCHROMIUM format should be 24");
-static_assert(offsetof(AsyncTexImage2DCHROMIUM, type) == 28,
- "offset of AsyncTexImage2DCHROMIUM type should be 28");
-static_assert(offsetof(AsyncTexImage2DCHROMIUM, pixels_shm_id) == 32,
- "offset of AsyncTexImage2DCHROMIUM pixels_shm_id should be 32");
-static_assert(
- offsetof(AsyncTexImage2DCHROMIUM, pixels_shm_offset) == 36,
- "offset of AsyncTexImage2DCHROMIUM pixels_shm_offset should be 36");
-static_assert(
- offsetof(AsyncTexImage2DCHROMIUM, async_upload_token) == 40,
- "offset of AsyncTexImage2DCHROMIUM async_upload_token should be 40");
-static_assert(
- offsetof(AsyncTexImage2DCHROMIUM, sync_data_shm_id) == 44,
- "offset of AsyncTexImage2DCHROMIUM sync_data_shm_id should be 44");
-static_assert(
- offsetof(AsyncTexImage2DCHROMIUM, sync_data_shm_offset) == 48,
- "offset of AsyncTexImage2DCHROMIUM sync_data_shm_offset should be 48");
-
-struct WaitAsyncTexImage2DCHROMIUM {
- typedef WaitAsyncTexImage2DCHROMIUM ValueType;
- static const CommandId kCmdId = kWaitAsyncTexImage2DCHROMIUM;
- static const cmd::ArgFlags kArgFlags = cmd::kFixed;
- static const uint8 cmd_flags = CMD_FLAG_SET_TRACE_LEVEL(1);
-
- static uint32_t ComputeSize() {
- return static_cast<uint32_t>(sizeof(ValueType)); // NOLINT
- }
-
- void SetHeader() { header.SetCmd<ValueType>(); }
-
- void Init(GLenum _target) {
- SetHeader();
- target = _target;
- }
-
- void* Set(void* cmd, GLenum _target) {
- static_cast<ValueType*>(cmd)->Init(_target);
- return NextCmdAddress<ValueType>(cmd);
- }
-
- gpu::CommandHeader header;
- uint32_t target;
-};
-
-static_assert(sizeof(WaitAsyncTexImage2DCHROMIUM) == 8,
- "size of WaitAsyncTexImage2DCHROMIUM should be 8");
-static_assert(offsetof(WaitAsyncTexImage2DCHROMIUM, header) == 0,
- "offset of WaitAsyncTexImage2DCHROMIUM header should be 0");
-static_assert(offsetof(WaitAsyncTexImage2DCHROMIUM, target) == 4,
- "offset of WaitAsyncTexImage2DCHROMIUM target should be 4");
-
-struct WaitAllAsyncTexImage2DCHROMIUM {
- typedef WaitAllAsyncTexImage2DCHROMIUM ValueType;
- static const CommandId kCmdId = kWaitAllAsyncTexImage2DCHROMIUM;
- static const cmd::ArgFlags kArgFlags = cmd::kFixed;
- static const uint8 cmd_flags = CMD_FLAG_SET_TRACE_LEVEL(1);
-
- static uint32_t ComputeSize() {
- return static_cast<uint32_t>(sizeof(ValueType)); // NOLINT
- }
-
- void SetHeader() { header.SetCmd<ValueType>(); }
-
- void Init() { SetHeader(); }
-
- void* Set(void* cmd) {
- static_cast<ValueType*>(cmd)->Init();
- return NextCmdAddress<ValueType>(cmd);
- }
-
- gpu::CommandHeader header;
-};
-
-static_assert(sizeof(WaitAllAsyncTexImage2DCHROMIUM) == 4,
- "size of WaitAllAsyncTexImage2DCHROMIUM should be 4");
-static_assert(offsetof(WaitAllAsyncTexImage2DCHROMIUM, header) == 0,
- "offset of WaitAllAsyncTexImage2DCHROMIUM header should be 0");
-
struct DiscardFramebufferEXTImmediate {
typedef DiscardFramebufferEXTImmediate ValueType;
static const CommandId kCmdId = kDiscardFramebufferEXTImmediate;
@@ -13807,6 +13770,590 @@ static_assert(offsetof(MatrixLoadIdentityCHROMIUM, header) == 0,
static_assert(offsetof(MatrixLoadIdentityCHROMIUM, matrixMode) == 4,
"offset of MatrixLoadIdentityCHROMIUM matrixMode should be 4");
+struct GenPathsCHROMIUM {
+ typedef GenPathsCHROMIUM ValueType;
+ static const CommandId kCmdId = kGenPathsCHROMIUM;
+ static const cmd::ArgFlags kArgFlags = cmd::kFixed;
+ static const uint8 cmd_flags = CMD_FLAG_SET_TRACE_LEVEL(3);
+
+ static uint32_t ComputeSize() {
+ return static_cast<uint32_t>(sizeof(ValueType)); // NOLINT
+ }
+
+ void SetHeader() { header.SetCmd<ValueType>(); }
+
+ void Init(GLuint _first_client_id, GLsizei _range) {
+ SetHeader();
+ first_client_id = _first_client_id;
+ range = _range;
+ }
+
+ void* Set(void* cmd, GLuint _first_client_id, GLsizei _range) {
+ static_cast<ValueType*>(cmd)->Init(_first_client_id, _range);
+ return NextCmdAddress<ValueType>(cmd);
+ }
+
+ gpu::CommandHeader header;
+ uint32_t first_client_id;
+ int32_t range;
+};
+
+static_assert(sizeof(GenPathsCHROMIUM) == 12,
+ "size of GenPathsCHROMIUM should be 12");
+static_assert(offsetof(GenPathsCHROMIUM, header) == 0,
+ "offset of GenPathsCHROMIUM header should be 0");
+static_assert(offsetof(GenPathsCHROMIUM, first_client_id) == 4,
+ "offset of GenPathsCHROMIUM first_client_id should be 4");
+static_assert(offsetof(GenPathsCHROMIUM, range) == 8,
+ "offset of GenPathsCHROMIUM range should be 8");
+
+struct DeletePathsCHROMIUM {
+ typedef DeletePathsCHROMIUM ValueType;
+ static const CommandId kCmdId = kDeletePathsCHROMIUM;
+ static const cmd::ArgFlags kArgFlags = cmd::kFixed;
+ static const uint8 cmd_flags = CMD_FLAG_SET_TRACE_LEVEL(3);
+
+ static uint32_t ComputeSize() {
+ return static_cast<uint32_t>(sizeof(ValueType)); // NOLINT
+ }
+
+ void SetHeader() { header.SetCmd<ValueType>(); }
+
+ void Init(GLuint _first_client_id, GLsizei _range) {
+ SetHeader();
+ first_client_id = _first_client_id;
+ range = _range;
+ }
+
+ void* Set(void* cmd, GLuint _first_client_id, GLsizei _range) {
+ static_cast<ValueType*>(cmd)->Init(_first_client_id, _range);
+ return NextCmdAddress<ValueType>(cmd);
+ }
+
+ gpu::CommandHeader header;
+ uint32_t first_client_id;
+ int32_t range;
+};
+
+static_assert(sizeof(DeletePathsCHROMIUM) == 12,
+ "size of DeletePathsCHROMIUM should be 12");
+static_assert(offsetof(DeletePathsCHROMIUM, header) == 0,
+ "offset of DeletePathsCHROMIUM header should be 0");
+static_assert(offsetof(DeletePathsCHROMIUM, first_client_id) == 4,
+ "offset of DeletePathsCHROMIUM first_client_id should be 4");
+static_assert(offsetof(DeletePathsCHROMIUM, range) == 8,
+ "offset of DeletePathsCHROMIUM range should be 8");
+
+struct IsPathCHROMIUM {
+ typedef IsPathCHROMIUM ValueType;
+ static const CommandId kCmdId = kIsPathCHROMIUM;
+ static const cmd::ArgFlags kArgFlags = cmd::kFixed;
+ static const uint8 cmd_flags = CMD_FLAG_SET_TRACE_LEVEL(3);
+
+ typedef uint32_t Result;
+
+ static uint32_t ComputeSize() {
+ return static_cast<uint32_t>(sizeof(ValueType)); // NOLINT
+ }
+
+ void SetHeader() { header.SetCmd<ValueType>(); }
+
+ void Init(GLuint _path,
+ uint32_t _result_shm_id,
+ uint32_t _result_shm_offset) {
+ SetHeader();
+ path = _path;
+ result_shm_id = _result_shm_id;
+ result_shm_offset = _result_shm_offset;
+ }
+
+ void* Set(void* cmd,
+ GLuint _path,
+ uint32_t _result_shm_id,
+ uint32_t _result_shm_offset) {
+ static_cast<ValueType*>(cmd)
+ ->Init(_path, _result_shm_id, _result_shm_offset);
+ return NextCmdAddress<ValueType>(cmd);
+ }
+
+ gpu::CommandHeader header;
+ uint32_t path;
+ uint32_t result_shm_id;
+ uint32_t result_shm_offset;
+};
+
+static_assert(sizeof(IsPathCHROMIUM) == 16,
+ "size of IsPathCHROMIUM should be 16");
+static_assert(offsetof(IsPathCHROMIUM, header) == 0,
+ "offset of IsPathCHROMIUM header should be 0");
+static_assert(offsetof(IsPathCHROMIUM, path) == 4,
+ "offset of IsPathCHROMIUM path should be 4");
+static_assert(offsetof(IsPathCHROMIUM, result_shm_id) == 8,
+ "offset of IsPathCHROMIUM result_shm_id should be 8");
+static_assert(offsetof(IsPathCHROMIUM, result_shm_offset) == 12,
+ "offset of IsPathCHROMIUM result_shm_offset should be 12");
+
+struct PathCommandsCHROMIUM {
+ typedef PathCommandsCHROMIUM ValueType;
+ static const CommandId kCmdId = kPathCommandsCHROMIUM;
+ static const cmd::ArgFlags kArgFlags = cmd::kFixed;
+ static const uint8 cmd_flags = CMD_FLAG_SET_TRACE_LEVEL(3);
+
+ static uint32_t ComputeSize() {
+ return static_cast<uint32_t>(sizeof(ValueType)); // NOLINT
+ }
+
+ void SetHeader() { header.SetCmd<ValueType>(); }
+
+ void Init(GLuint _path,
+ GLsizei _numCommands,
+ uint32_t _commands_shm_id,
+ uint32_t _commands_shm_offset,
+ GLsizei _numCoords,
+ GLenum _coordType,
+ uint32_t _coords_shm_id,
+ uint32_t _coords_shm_offset) {
+ SetHeader();
+ path = _path;
+ numCommands = _numCommands;
+ commands_shm_id = _commands_shm_id;
+ commands_shm_offset = _commands_shm_offset;
+ numCoords = _numCoords;
+ coordType = _coordType;
+ coords_shm_id = _coords_shm_id;
+ coords_shm_offset = _coords_shm_offset;
+ }
+
+ void* Set(void* cmd,
+ GLuint _path,
+ GLsizei _numCommands,
+ uint32_t _commands_shm_id,
+ uint32_t _commands_shm_offset,
+ GLsizei _numCoords,
+ GLenum _coordType,
+ uint32_t _coords_shm_id,
+ uint32_t _coords_shm_offset) {
+ static_cast<ValueType*>(cmd)
+ ->Init(_path, _numCommands, _commands_shm_id, _commands_shm_offset,
+ _numCoords, _coordType, _coords_shm_id, _coords_shm_offset);
+ return NextCmdAddress<ValueType>(cmd);
+ }
+
+ gpu::CommandHeader header;
+ uint32_t path;
+ int32_t numCommands;
+ uint32_t commands_shm_id;
+ uint32_t commands_shm_offset;
+ int32_t numCoords;
+ uint32_t coordType;
+ uint32_t coords_shm_id;
+ uint32_t coords_shm_offset;
+};
+
+static_assert(sizeof(PathCommandsCHROMIUM) == 36,
+ "size of PathCommandsCHROMIUM should be 36");
+static_assert(offsetof(PathCommandsCHROMIUM, header) == 0,
+ "offset of PathCommandsCHROMIUM header should be 0");
+static_assert(offsetof(PathCommandsCHROMIUM, path) == 4,
+ "offset of PathCommandsCHROMIUM path should be 4");
+static_assert(offsetof(PathCommandsCHROMIUM, numCommands) == 8,
+ "offset of PathCommandsCHROMIUM numCommands should be 8");
+static_assert(offsetof(PathCommandsCHROMIUM, commands_shm_id) == 12,
+ "offset of PathCommandsCHROMIUM commands_shm_id should be 12");
+static_assert(
+ offsetof(PathCommandsCHROMIUM, commands_shm_offset) == 16,
+ "offset of PathCommandsCHROMIUM commands_shm_offset should be 16");
+static_assert(offsetof(PathCommandsCHROMIUM, numCoords) == 20,
+ "offset of PathCommandsCHROMIUM numCoords should be 20");
+static_assert(offsetof(PathCommandsCHROMIUM, coordType) == 24,
+ "offset of PathCommandsCHROMIUM coordType should be 24");
+static_assert(offsetof(PathCommandsCHROMIUM, coords_shm_id) == 28,
+ "offset of PathCommandsCHROMIUM coords_shm_id should be 28");
+static_assert(offsetof(PathCommandsCHROMIUM, coords_shm_offset) == 32,
+ "offset of PathCommandsCHROMIUM coords_shm_offset should be 32");
+
+struct PathParameterfCHROMIUM {
+ typedef PathParameterfCHROMIUM ValueType;
+ static const CommandId kCmdId = kPathParameterfCHROMIUM;
+ static const cmd::ArgFlags kArgFlags = cmd::kFixed;
+ static const uint8 cmd_flags = CMD_FLAG_SET_TRACE_LEVEL(3);
+
+ static uint32_t ComputeSize() {
+ return static_cast<uint32_t>(sizeof(ValueType)); // NOLINT
+ }
+
+ void SetHeader() { header.SetCmd<ValueType>(); }
+
+ void Init(GLuint _path, GLenum _pname, GLfloat _value) {
+ SetHeader();
+ path = _path;
+ pname = _pname;
+ value = _value;
+ }
+
+ void* Set(void* cmd, GLuint _path, GLenum _pname, GLfloat _value) {
+ static_cast<ValueType*>(cmd)->Init(_path, _pname, _value);
+ return NextCmdAddress<ValueType>(cmd);
+ }
+
+ gpu::CommandHeader header;
+ uint32_t path;
+ uint32_t pname;
+ float value;
+};
+
+static_assert(sizeof(PathParameterfCHROMIUM) == 16,
+ "size of PathParameterfCHROMIUM should be 16");
+static_assert(offsetof(PathParameterfCHROMIUM, header) == 0,
+ "offset of PathParameterfCHROMIUM header should be 0");
+static_assert(offsetof(PathParameterfCHROMIUM, path) == 4,
+ "offset of PathParameterfCHROMIUM path should be 4");
+static_assert(offsetof(PathParameterfCHROMIUM, pname) == 8,
+ "offset of PathParameterfCHROMIUM pname should be 8");
+static_assert(offsetof(PathParameterfCHROMIUM, value) == 12,
+ "offset of PathParameterfCHROMIUM value should be 12");
+
+struct PathParameteriCHROMIUM {
+ typedef PathParameteriCHROMIUM ValueType;
+ static const CommandId kCmdId = kPathParameteriCHROMIUM;
+ static const cmd::ArgFlags kArgFlags = cmd::kFixed;
+ static const uint8 cmd_flags = CMD_FLAG_SET_TRACE_LEVEL(3);
+
+ static uint32_t ComputeSize() {
+ return static_cast<uint32_t>(sizeof(ValueType)); // NOLINT
+ }
+
+ void SetHeader() { header.SetCmd<ValueType>(); }
+
+ void Init(GLuint _path, GLenum _pname, GLint _value) {
+ SetHeader();
+ path = _path;
+ pname = _pname;
+ value = _value;
+ }
+
+ void* Set(void* cmd, GLuint _path, GLenum _pname, GLint _value) {
+ static_cast<ValueType*>(cmd)->Init(_path, _pname, _value);
+ return NextCmdAddress<ValueType>(cmd);
+ }
+
+ gpu::CommandHeader header;
+ uint32_t path;
+ uint32_t pname;
+ int32_t value;
+};
+
+static_assert(sizeof(PathParameteriCHROMIUM) == 16,
+ "size of PathParameteriCHROMIUM should be 16");
+static_assert(offsetof(PathParameteriCHROMIUM, header) == 0,
+ "offset of PathParameteriCHROMIUM header should be 0");
+static_assert(offsetof(PathParameteriCHROMIUM, path) == 4,
+ "offset of PathParameteriCHROMIUM path should be 4");
+static_assert(offsetof(PathParameteriCHROMIUM, pname) == 8,
+ "offset of PathParameteriCHROMIUM pname should be 8");
+static_assert(offsetof(PathParameteriCHROMIUM, value) == 12,
+ "offset of PathParameteriCHROMIUM value should be 12");
+
+struct PathStencilFuncCHROMIUM {
+ typedef PathStencilFuncCHROMIUM ValueType;
+ static const CommandId kCmdId = kPathStencilFuncCHROMIUM;
+ static const cmd::ArgFlags kArgFlags = cmd::kFixed;
+ static const uint8 cmd_flags = CMD_FLAG_SET_TRACE_LEVEL(3);
+
+ static uint32_t ComputeSize() {
+ return static_cast<uint32_t>(sizeof(ValueType)); // NOLINT
+ }
+
+ void SetHeader() { header.SetCmd<ValueType>(); }
+
+ void Init(GLenum _func, GLint _ref, GLuint _mask) {
+ SetHeader();
+ func = _func;
+ ref = _ref;
+ mask = _mask;
+ }
+
+ void* Set(void* cmd, GLenum _func, GLint _ref, GLuint _mask) {
+ static_cast<ValueType*>(cmd)->Init(_func, _ref, _mask);
+ return NextCmdAddress<ValueType>(cmd);
+ }
+
+ gpu::CommandHeader header;
+ uint32_t func;
+ int32_t ref;
+ uint32_t mask;
+};
+
+static_assert(sizeof(PathStencilFuncCHROMIUM) == 16,
+ "size of PathStencilFuncCHROMIUM should be 16");
+static_assert(offsetof(PathStencilFuncCHROMIUM, header) == 0,
+ "offset of PathStencilFuncCHROMIUM header should be 0");
+static_assert(offsetof(PathStencilFuncCHROMIUM, func) == 4,
+ "offset of PathStencilFuncCHROMIUM func should be 4");
+static_assert(offsetof(PathStencilFuncCHROMIUM, ref) == 8,
+ "offset of PathStencilFuncCHROMIUM ref should be 8");
+static_assert(offsetof(PathStencilFuncCHROMIUM, mask) == 12,
+ "offset of PathStencilFuncCHROMIUM mask should be 12");
+
+struct StencilFillPathCHROMIUM {
+ typedef StencilFillPathCHROMIUM ValueType;
+ static const CommandId kCmdId = kStencilFillPathCHROMIUM;
+ static const cmd::ArgFlags kArgFlags = cmd::kFixed;
+ static const uint8 cmd_flags = CMD_FLAG_SET_TRACE_LEVEL(3);
+
+ static uint32_t ComputeSize() {
+ return static_cast<uint32_t>(sizeof(ValueType)); // NOLINT
+ }
+
+ void SetHeader() { header.SetCmd<ValueType>(); }
+
+ void Init(GLuint _path, GLenum _fillMode, GLuint _mask) {
+ SetHeader();
+ path = _path;
+ fillMode = _fillMode;
+ mask = _mask;
+ }
+
+ void* Set(void* cmd, GLuint _path, GLenum _fillMode, GLuint _mask) {
+ static_cast<ValueType*>(cmd)->Init(_path, _fillMode, _mask);
+ return NextCmdAddress<ValueType>(cmd);
+ }
+
+ gpu::CommandHeader header;
+ uint32_t path;
+ uint32_t fillMode;
+ uint32_t mask;
+};
+
+static_assert(sizeof(StencilFillPathCHROMIUM) == 16,
+ "size of StencilFillPathCHROMIUM should be 16");
+static_assert(offsetof(StencilFillPathCHROMIUM, header) == 0,
+ "offset of StencilFillPathCHROMIUM header should be 0");
+static_assert(offsetof(StencilFillPathCHROMIUM, path) == 4,
+ "offset of StencilFillPathCHROMIUM path should be 4");
+static_assert(offsetof(StencilFillPathCHROMIUM, fillMode) == 8,
+ "offset of StencilFillPathCHROMIUM fillMode should be 8");
+static_assert(offsetof(StencilFillPathCHROMIUM, mask) == 12,
+ "offset of StencilFillPathCHROMIUM mask should be 12");
+
+struct StencilStrokePathCHROMIUM {
+ typedef StencilStrokePathCHROMIUM ValueType;
+ static const CommandId kCmdId = kStencilStrokePathCHROMIUM;
+ static const cmd::ArgFlags kArgFlags = cmd::kFixed;
+ static const uint8 cmd_flags = CMD_FLAG_SET_TRACE_LEVEL(3);
+
+ static uint32_t ComputeSize() {
+ return static_cast<uint32_t>(sizeof(ValueType)); // NOLINT
+ }
+
+ void SetHeader() { header.SetCmd<ValueType>(); }
+
+ void Init(GLuint _path, GLint _reference, GLuint _mask) {
+ SetHeader();
+ path = _path;
+ reference = _reference;
+ mask = _mask;
+ }
+
+ void* Set(void* cmd, GLuint _path, GLint _reference, GLuint _mask) {
+ static_cast<ValueType*>(cmd)->Init(_path, _reference, _mask);
+ return NextCmdAddress<ValueType>(cmd);
+ }
+
+ gpu::CommandHeader header;
+ uint32_t path;
+ int32_t reference;
+ uint32_t mask;
+};
+
+static_assert(sizeof(StencilStrokePathCHROMIUM) == 16,
+ "size of StencilStrokePathCHROMIUM should be 16");
+static_assert(offsetof(StencilStrokePathCHROMIUM, header) == 0,
+ "offset of StencilStrokePathCHROMIUM header should be 0");
+static_assert(offsetof(StencilStrokePathCHROMIUM, path) == 4,
+ "offset of StencilStrokePathCHROMIUM path should be 4");
+static_assert(offsetof(StencilStrokePathCHROMIUM, reference) == 8,
+ "offset of StencilStrokePathCHROMIUM reference should be 8");
+static_assert(offsetof(StencilStrokePathCHROMIUM, mask) == 12,
+ "offset of StencilStrokePathCHROMIUM mask should be 12");
+
+struct CoverFillPathCHROMIUM {
+ typedef CoverFillPathCHROMIUM ValueType;
+ static const CommandId kCmdId = kCoverFillPathCHROMIUM;
+ static const cmd::ArgFlags kArgFlags = cmd::kFixed;
+ static const uint8 cmd_flags = CMD_FLAG_SET_TRACE_LEVEL(3);
+
+ static uint32_t ComputeSize() {
+ return static_cast<uint32_t>(sizeof(ValueType)); // NOLINT
+ }
+
+ void SetHeader() { header.SetCmd<ValueType>(); }
+
+ void Init(GLuint _path, GLenum _coverMode) {
+ SetHeader();
+ path = _path;
+ coverMode = _coverMode;
+ }
+
+ void* Set(void* cmd, GLuint _path, GLenum _coverMode) {
+ static_cast<ValueType*>(cmd)->Init(_path, _coverMode);
+ return NextCmdAddress<ValueType>(cmd);
+ }
+
+ gpu::CommandHeader header;
+ uint32_t path;
+ uint32_t coverMode;
+};
+
+static_assert(sizeof(CoverFillPathCHROMIUM) == 12,
+ "size of CoverFillPathCHROMIUM should be 12");
+static_assert(offsetof(CoverFillPathCHROMIUM, header) == 0,
+ "offset of CoverFillPathCHROMIUM header should be 0");
+static_assert(offsetof(CoverFillPathCHROMIUM, path) == 4,
+ "offset of CoverFillPathCHROMIUM path should be 4");
+static_assert(offsetof(CoverFillPathCHROMIUM, coverMode) == 8,
+ "offset of CoverFillPathCHROMIUM coverMode should be 8");
+
+struct CoverStrokePathCHROMIUM {
+ typedef CoverStrokePathCHROMIUM ValueType;
+ static const CommandId kCmdId = kCoverStrokePathCHROMIUM;
+ static const cmd::ArgFlags kArgFlags = cmd::kFixed;
+ static const uint8 cmd_flags = CMD_FLAG_SET_TRACE_LEVEL(3);
+
+ static uint32_t ComputeSize() {
+ return static_cast<uint32_t>(sizeof(ValueType)); // NOLINT
+ }
+
+ void SetHeader() { header.SetCmd<ValueType>(); }
+
+ void Init(GLuint _path, GLenum _coverMode) {
+ SetHeader();
+ path = _path;
+ coverMode = _coverMode;
+ }
+
+ void* Set(void* cmd, GLuint _path, GLenum _coverMode) {
+ static_cast<ValueType*>(cmd)->Init(_path, _coverMode);
+ return NextCmdAddress<ValueType>(cmd);
+ }
+
+ gpu::CommandHeader header;
+ uint32_t path;
+ uint32_t coverMode;
+};
+
+static_assert(sizeof(CoverStrokePathCHROMIUM) == 12,
+ "size of CoverStrokePathCHROMIUM should be 12");
+static_assert(offsetof(CoverStrokePathCHROMIUM, header) == 0,
+ "offset of CoverStrokePathCHROMIUM header should be 0");
+static_assert(offsetof(CoverStrokePathCHROMIUM, path) == 4,
+ "offset of CoverStrokePathCHROMIUM path should be 4");
+static_assert(offsetof(CoverStrokePathCHROMIUM, coverMode) == 8,
+ "offset of CoverStrokePathCHROMIUM coverMode should be 8");
+
+struct StencilThenCoverFillPathCHROMIUM {
+ typedef StencilThenCoverFillPathCHROMIUM ValueType;
+ static const CommandId kCmdId = kStencilThenCoverFillPathCHROMIUM;
+ static const cmd::ArgFlags kArgFlags = cmd::kFixed;
+ static const uint8 cmd_flags = CMD_FLAG_SET_TRACE_LEVEL(3);
+
+ static uint32_t ComputeSize() {
+ return static_cast<uint32_t>(sizeof(ValueType)); // NOLINT
+ }
+
+ void SetHeader() { header.SetCmd<ValueType>(); }
+
+ void Init(GLuint _path, GLenum _fillMode, GLuint _mask, GLenum _coverMode) {
+ SetHeader();
+ path = _path;
+ fillMode = _fillMode;
+ mask = _mask;
+ coverMode = _coverMode;
+ }
+
+ void* Set(void* cmd,
+ GLuint _path,
+ GLenum _fillMode,
+ GLuint _mask,
+ GLenum _coverMode) {
+ static_cast<ValueType*>(cmd)->Init(_path, _fillMode, _mask, _coverMode);
+ return NextCmdAddress<ValueType>(cmd);
+ }
+
+ gpu::CommandHeader header;
+ uint32_t path;
+ uint32_t fillMode;
+ uint32_t mask;
+ uint32_t coverMode;
+};
+
+static_assert(sizeof(StencilThenCoverFillPathCHROMIUM) == 20,
+ "size of StencilThenCoverFillPathCHROMIUM should be 20");
+static_assert(offsetof(StencilThenCoverFillPathCHROMIUM, header) == 0,
+ "offset of StencilThenCoverFillPathCHROMIUM header should be 0");
+static_assert(offsetof(StencilThenCoverFillPathCHROMIUM, path) == 4,
+ "offset of StencilThenCoverFillPathCHROMIUM path should be 4");
+static_assert(
+ offsetof(StencilThenCoverFillPathCHROMIUM, fillMode) == 8,
+ "offset of StencilThenCoverFillPathCHROMIUM fillMode should be 8");
+static_assert(offsetof(StencilThenCoverFillPathCHROMIUM, mask) == 12,
+ "offset of StencilThenCoverFillPathCHROMIUM mask should be 12");
+static_assert(
+ offsetof(StencilThenCoverFillPathCHROMIUM, coverMode) == 16,
+ "offset of StencilThenCoverFillPathCHROMIUM coverMode should be 16");
+
+struct StencilThenCoverStrokePathCHROMIUM {
+ typedef StencilThenCoverStrokePathCHROMIUM ValueType;
+ static const CommandId kCmdId = kStencilThenCoverStrokePathCHROMIUM;
+ static const cmd::ArgFlags kArgFlags = cmd::kFixed;
+ static const uint8 cmd_flags = CMD_FLAG_SET_TRACE_LEVEL(3);
+
+ static uint32_t ComputeSize() {
+ return static_cast<uint32_t>(sizeof(ValueType)); // NOLINT
+ }
+
+ void SetHeader() { header.SetCmd<ValueType>(); }
+
+ void Init(GLuint _path, GLint _reference, GLuint _mask, GLenum _coverMode) {
+ SetHeader();
+ path = _path;
+ reference = _reference;
+ mask = _mask;
+ coverMode = _coverMode;
+ }
+
+ void* Set(void* cmd,
+ GLuint _path,
+ GLint _reference,
+ GLuint _mask,
+ GLenum _coverMode) {
+ static_cast<ValueType*>(cmd)->Init(_path, _reference, _mask, _coverMode);
+ return NextCmdAddress<ValueType>(cmd);
+ }
+
+ gpu::CommandHeader header;
+ uint32_t path;
+ int32_t reference;
+ uint32_t mask;
+ uint32_t coverMode;
+};
+
+static_assert(sizeof(StencilThenCoverStrokePathCHROMIUM) == 20,
+ "size of StencilThenCoverStrokePathCHROMIUM should be 20");
+static_assert(
+ offsetof(StencilThenCoverStrokePathCHROMIUM, header) == 0,
+ "offset of StencilThenCoverStrokePathCHROMIUM header should be 0");
+static_assert(offsetof(StencilThenCoverStrokePathCHROMIUM, path) == 4,
+ "offset of StencilThenCoverStrokePathCHROMIUM path should be 4");
+static_assert(
+ offsetof(StencilThenCoverStrokePathCHROMIUM, reference) == 8,
+ "offset of StencilThenCoverStrokePathCHROMIUM reference should be 8");
+static_assert(offsetof(StencilThenCoverStrokePathCHROMIUM, mask) == 12,
+ "offset of StencilThenCoverStrokePathCHROMIUM mask should be 12");
+static_assert(
+ offsetof(StencilThenCoverStrokePathCHROMIUM, coverMode) == 16,
+ "offset of StencilThenCoverStrokePathCHROMIUM coverMode should be 16");
+
struct BlendBarrierKHR {
typedef BlendBarrierKHR ValueType;
static const CommandId kCmdId = kBlendBarrierKHR;
@@ -13834,4 +14381,32 @@ static_assert(sizeof(BlendBarrierKHR) == 4,
static_assert(offsetof(BlendBarrierKHR, header) == 0,
"offset of BlendBarrierKHR header should be 0");
+struct ApplyScreenSpaceAntialiasingCHROMIUM {
+ typedef ApplyScreenSpaceAntialiasingCHROMIUM ValueType;
+ static const CommandId kCmdId = kApplyScreenSpaceAntialiasingCHROMIUM;
+ static const cmd::ArgFlags kArgFlags = cmd::kFixed;
+ static const uint8 cmd_flags = CMD_FLAG_SET_TRACE_LEVEL(3);
+
+ static uint32_t ComputeSize() {
+ return static_cast<uint32_t>(sizeof(ValueType)); // NOLINT
+ }
+
+ void SetHeader() { header.SetCmd<ValueType>(); }
+
+ void Init() { SetHeader(); }
+
+ void* Set(void* cmd) {
+ static_cast<ValueType*>(cmd)->Init();
+ return NextCmdAddress<ValueType>(cmd);
+ }
+
+ gpu::CommandHeader header;
+};
+
+static_assert(sizeof(ApplyScreenSpaceAntialiasingCHROMIUM) == 4,
+ "size of ApplyScreenSpaceAntialiasingCHROMIUM should be 4");
+static_assert(
+ offsetof(ApplyScreenSpaceAntialiasingCHROMIUM, header) == 0,
+ "offset of ApplyScreenSpaceAntialiasingCHROMIUM header should be 0");
+
#endif // GPU_COMMAND_BUFFER_COMMON_GLES2_CMD_FORMAT_AUTOGEN_H_
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 bc74f593935..62bff78160d 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
@@ -744,7 +744,7 @@ TEST_F(GLES2FormatTest, DeleteBuffersImmediate) {
CheckBytesWrittenMatchesExpectedSize(
next_cmd,
sizeof(cmd) + RoundSizeToMultipleOfEntries(arraysize(ids) * 4u));
- // TODO(gman): Check that ids were inserted;
+ EXPECT_EQ(0, memcmp(ids, ImmediateDataAddress(&cmd), sizeof(ids)));
}
TEST_F(GLES2FormatTest, DeleteFramebuffersImmediate) {
@@ -762,7 +762,7 @@ TEST_F(GLES2FormatTest, DeleteFramebuffersImmediate) {
CheckBytesWrittenMatchesExpectedSize(
next_cmd,
sizeof(cmd) + RoundSizeToMultipleOfEntries(arraysize(ids) * 4u));
- // TODO(gman): Check that ids were inserted;
+ EXPECT_EQ(0, memcmp(ids, ImmediateDataAddress(&cmd), sizeof(ids)));
}
TEST_F(GLES2FormatTest, DeleteProgram) {
@@ -790,7 +790,7 @@ TEST_F(GLES2FormatTest, DeleteRenderbuffersImmediate) {
CheckBytesWrittenMatchesExpectedSize(
next_cmd,
sizeof(cmd) + RoundSizeToMultipleOfEntries(arraysize(ids) * 4u));
- // TODO(gman): Check that ids were inserted;
+ EXPECT_EQ(0, memcmp(ids, ImmediateDataAddress(&cmd), sizeof(ids)));
}
TEST_F(GLES2FormatTest, DeleteSamplersImmediate) {
@@ -808,7 +808,7 @@ TEST_F(GLES2FormatTest, DeleteSamplersImmediate) {
CheckBytesWrittenMatchesExpectedSize(
next_cmd,
sizeof(cmd) + RoundSizeToMultipleOfEntries(arraysize(ids) * 4u));
- // TODO(gman): Check that ids were inserted;
+ EXPECT_EQ(0, memcmp(ids, ImmediateDataAddress(&cmd), sizeof(ids)));
}
TEST_F(GLES2FormatTest, DeleteSync) {
@@ -846,7 +846,7 @@ TEST_F(GLES2FormatTest, DeleteTexturesImmediate) {
CheckBytesWrittenMatchesExpectedSize(
next_cmd,
sizeof(cmd) + RoundSizeToMultipleOfEntries(arraysize(ids) * 4u));
- // TODO(gman): Check that ids were inserted;
+ EXPECT_EQ(0, memcmp(ids, ImmediateDataAddress(&cmd), sizeof(ids)));
}
TEST_F(GLES2FormatTest, DeleteTransformFeedbacksImmediate) {
@@ -865,7 +865,7 @@ TEST_F(GLES2FormatTest, DeleteTransformFeedbacksImmediate) {
CheckBytesWrittenMatchesExpectedSize(
next_cmd,
sizeof(cmd) + RoundSizeToMultipleOfEntries(arraysize(ids) * 4u));
- // TODO(gman): Check that ids were inserted;
+ EXPECT_EQ(0, memcmp(ids, ImmediateDataAddress(&cmd), sizeof(ids)));
}
TEST_F(GLES2FormatTest, DepthFunc) {
@@ -1074,7 +1074,7 @@ TEST_F(GLES2FormatTest, GenBuffersImmediate) {
CheckBytesWrittenMatchesExpectedSize(
next_cmd,
sizeof(cmd) + RoundSizeToMultipleOfEntries(arraysize(ids) * 4u));
- // TODO(gman): Check that ids were inserted;
+ EXPECT_EQ(0, memcmp(ids, ImmediateDataAddress(&cmd), sizeof(ids)));
}
TEST_F(GLES2FormatTest, GenerateMipmap) {
@@ -1102,7 +1102,7 @@ TEST_F(GLES2FormatTest, GenFramebuffersImmediate) {
CheckBytesWrittenMatchesExpectedSize(
next_cmd,
sizeof(cmd) + RoundSizeToMultipleOfEntries(arraysize(ids) * 4u));
- // TODO(gman): Check that ids were inserted;
+ EXPECT_EQ(0, memcmp(ids, ImmediateDataAddress(&cmd), sizeof(ids)));
}
TEST_F(GLES2FormatTest, GenRenderbuffersImmediate) {
@@ -1120,7 +1120,7 @@ TEST_F(GLES2FormatTest, GenRenderbuffersImmediate) {
CheckBytesWrittenMatchesExpectedSize(
next_cmd,
sizeof(cmd) + RoundSizeToMultipleOfEntries(arraysize(ids) * 4u));
- // TODO(gman): Check that ids were inserted;
+ EXPECT_EQ(0, memcmp(ids, ImmediateDataAddress(&cmd), sizeof(ids)));
}
TEST_F(GLES2FormatTest, GenSamplersImmediate) {
@@ -1137,7 +1137,7 @@ TEST_F(GLES2FormatTest, GenSamplersImmediate) {
CheckBytesWrittenMatchesExpectedSize(
next_cmd,
sizeof(cmd) + RoundSizeToMultipleOfEntries(arraysize(ids) * 4u));
- // TODO(gman): Check that ids were inserted;
+ EXPECT_EQ(0, memcmp(ids, ImmediateDataAddress(&cmd), sizeof(ids)));
}
TEST_F(GLES2FormatTest, GenTexturesImmediate) {
@@ -1154,7 +1154,7 @@ TEST_F(GLES2FormatTest, GenTexturesImmediate) {
CheckBytesWrittenMatchesExpectedSize(
next_cmd,
sizeof(cmd) + RoundSizeToMultipleOfEntries(arraysize(ids) * 4u));
- // TODO(gman): Check that ids were inserted;
+ EXPECT_EQ(0, memcmp(ids, ImmediateDataAddress(&cmd), sizeof(ids)));
}
TEST_F(GLES2FormatTest, GenTransformFeedbacksImmediate) {
@@ -1172,7 +1172,7 @@ TEST_F(GLES2FormatTest, GenTransformFeedbacksImmediate) {
CheckBytesWrittenMatchesExpectedSize(
next_cmd,
sizeof(cmd) + RoundSizeToMultipleOfEntries(arraysize(ids) * 4u));
- // TODO(gman): Check that ids were inserted;
+ EXPECT_EQ(0, memcmp(ids, ImmediateDataAddress(&cmd), sizeof(ids)));
}
TEST_F(GLES2FormatTest, GetActiveAttrib) {
@@ -1306,6 +1306,22 @@ TEST_F(GLES2FormatTest, GetBooleanv) {
CheckBytesWrittenMatchesExpectedSize(next_cmd, sizeof(cmd));
}
+TEST_F(GLES2FormatTest, GetBufferParameteri64v) {
+ cmds::GetBufferParameteri64v& cmd =
+ *GetBufferAs<cmds::GetBufferParameteri64v>();
+ void* next_cmd =
+ cmd.Set(&cmd, static_cast<GLenum>(11), static_cast<GLenum>(12),
+ static_cast<uint32_t>(13), static_cast<uint32_t>(14));
+ EXPECT_EQ(static_cast<uint32_t>(cmds::GetBufferParameteri64v::kCmdId),
+ cmd.header.command);
+ EXPECT_EQ(sizeof(cmd), cmd.header.size * 4u);
+ EXPECT_EQ(static_cast<GLenum>(11), cmd.target);
+ EXPECT_EQ(static_cast<GLenum>(12), cmd.pname);
+ EXPECT_EQ(static_cast<uint32_t>(13), cmd.params_shm_id);
+ EXPECT_EQ(static_cast<uint32_t>(14), cmd.params_shm_offset);
+ CheckBytesWrittenMatchesExpectedSize(next_cmd, sizeof(cmd));
+}
+
TEST_F(GLES2FormatTest, GetBufferParameteriv) {
cmds::GetBufferParameteriv& cmd = *GetBufferAs<cmds::GetBufferParameteriv>();
void* next_cmd =
@@ -3762,7 +3778,7 @@ TEST_F(GLES2FormatTest, GenQueriesEXTImmediate) {
CheckBytesWrittenMatchesExpectedSize(
next_cmd,
sizeof(cmd) + RoundSizeToMultipleOfEntries(arraysize(ids) * 4u));
- // TODO(gman): Check that ids were inserted;
+ EXPECT_EQ(0, memcmp(ids, ImmediateDataAddress(&cmd), sizeof(ids)));
}
TEST_F(GLES2FormatTest, DeleteQueriesEXTImmediate) {
@@ -3780,7 +3796,23 @@ TEST_F(GLES2FormatTest, DeleteQueriesEXTImmediate) {
CheckBytesWrittenMatchesExpectedSize(
next_cmd,
sizeof(cmd) + RoundSizeToMultipleOfEntries(arraysize(ids) * 4u));
- // TODO(gman): Check that ids were inserted;
+ EXPECT_EQ(0, memcmp(ids, ImmediateDataAddress(&cmd), sizeof(ids)));
+}
+
+TEST_F(GLES2FormatTest, QueryCounterEXT) {
+ cmds::QueryCounterEXT& cmd = *GetBufferAs<cmds::QueryCounterEXT>();
+ void* next_cmd = cmd.Set(&cmd, static_cast<GLuint>(11),
+ static_cast<GLenum>(12), static_cast<uint32_t>(13),
+ static_cast<uint32_t>(14), static_cast<GLuint>(15));
+ EXPECT_EQ(static_cast<uint32_t>(cmds::QueryCounterEXT::kCmdId),
+ cmd.header.command);
+ EXPECT_EQ(sizeof(cmd), cmd.header.size * 4u);
+ EXPECT_EQ(static_cast<GLuint>(11), cmd.id);
+ EXPECT_EQ(static_cast<GLenum>(12), cmd.target);
+ EXPECT_EQ(static_cast<uint32_t>(13), cmd.sync_data_shm_id);
+ EXPECT_EQ(static_cast<uint32_t>(14), cmd.sync_data_shm_offset);
+ EXPECT_EQ(static_cast<GLuint>(15), cmd.submit_count);
+ CheckBytesWrittenMatchesExpectedSize(next_cmd, sizeof(cmd));
}
TEST_F(GLES2FormatTest, BeginQueryEXT) {
@@ -3830,6 +3862,19 @@ TEST_F(GLES2FormatTest, EndTransformFeedback) {
CheckBytesWrittenMatchesExpectedSize(next_cmd, sizeof(cmd));
}
+TEST_F(GLES2FormatTest, SetDisjointValueSyncCHROMIUM) {
+ cmds::SetDisjointValueSyncCHROMIUM& cmd =
+ *GetBufferAs<cmds::SetDisjointValueSyncCHROMIUM>();
+ void* next_cmd =
+ cmd.Set(&cmd, static_cast<uint32_t>(11), static_cast<uint32_t>(12));
+ EXPECT_EQ(static_cast<uint32_t>(cmds::SetDisjointValueSyncCHROMIUM::kCmdId),
+ cmd.header.command);
+ EXPECT_EQ(sizeof(cmd), cmd.header.size * 4u);
+ EXPECT_EQ(static_cast<uint32_t>(11), cmd.sync_data_shm_id);
+ EXPECT_EQ(static_cast<uint32_t>(12), cmd.sync_data_shm_offset);
+ CheckBytesWrittenMatchesExpectedSize(next_cmd, sizeof(cmd));
+}
+
TEST_F(GLES2FormatTest, InsertEventMarkerEXT) {
cmds::InsertEventMarkerEXT& cmd = *GetBufferAs<cmds::InsertEventMarkerEXT>();
void* next_cmd = cmd.Set(&cmd, static_cast<GLuint>(11));
@@ -3874,7 +3919,7 @@ TEST_F(GLES2FormatTest, GenVertexArraysOESImmediate) {
CheckBytesWrittenMatchesExpectedSize(
next_cmd,
sizeof(cmd) + RoundSizeToMultipleOfEntries(arraysize(ids) * 4u));
- // TODO(gman): Check that ids were inserted;
+ EXPECT_EQ(0, memcmp(ids, ImmediateDataAddress(&cmd), sizeof(ids)));
}
TEST_F(GLES2FormatTest, DeleteVertexArraysOESImmediate) {
@@ -3892,7 +3937,7 @@ TEST_F(GLES2FormatTest, DeleteVertexArraysOESImmediate) {
CheckBytesWrittenMatchesExpectedSize(
next_cmd,
sizeof(cmd) + RoundSizeToMultipleOfEntries(arraysize(ids) * 4u));
- // TODO(gman): Check that ids were inserted;
+ EXPECT_EQ(0, memcmp(ids, ImmediateDataAddress(&cmd), sizeof(ids)));
}
TEST_F(GLES2FormatTest, IsVertexArrayOES) {
@@ -4189,6 +4234,30 @@ TEST_F(GLES2FormatTest, CompressedCopyTextureCHROMIUM) {
CheckBytesWrittenMatchesExpectedSize(next_cmd, sizeof(cmd));
}
+TEST_F(GLES2FormatTest, CompressedCopySubTextureCHROMIUM) {
+ cmds::CompressedCopySubTextureCHROMIUM& cmd =
+ *GetBufferAs<cmds::CompressedCopySubTextureCHROMIUM>();
+ void* next_cmd = cmd.Set(&cmd, static_cast<GLenum>(11),
+ static_cast<GLenum>(12), static_cast<GLenum>(13),
+ static_cast<GLint>(14), static_cast<GLint>(15),
+ static_cast<GLint>(16), static_cast<GLint>(17),
+ static_cast<GLsizei>(18), static_cast<GLsizei>(19));
+ EXPECT_EQ(
+ static_cast<uint32_t>(cmds::CompressedCopySubTextureCHROMIUM::kCmdId),
+ cmd.header.command);
+ EXPECT_EQ(sizeof(cmd), cmd.header.size * 4u);
+ EXPECT_EQ(static_cast<GLenum>(11), cmd.target);
+ EXPECT_EQ(static_cast<GLenum>(12), cmd.source_id);
+ EXPECT_EQ(static_cast<GLenum>(13), cmd.dest_id);
+ EXPECT_EQ(static_cast<GLint>(14), cmd.xoffset);
+ EXPECT_EQ(static_cast<GLint>(15), cmd.yoffset);
+ EXPECT_EQ(static_cast<GLint>(16), cmd.x);
+ EXPECT_EQ(static_cast<GLint>(17), cmd.y);
+ EXPECT_EQ(static_cast<GLsizei>(18), cmd.width);
+ EXPECT_EQ(static_cast<GLsizei>(19), cmd.height);
+ CheckBytesWrittenMatchesExpectedSize(next_cmd, sizeof(cmd));
+}
+
TEST_F(GLES2FormatTest, DrawArraysInstancedANGLE) {
cmds::DrawArraysInstancedANGLE& cmd =
*GetBufferAs<cmds::DrawArraysInstancedANGLE>();
@@ -4516,7 +4585,7 @@ TEST_F(GLES2FormatTest, GenValuebuffersCHROMIUMImmediate) {
CheckBytesWrittenMatchesExpectedSize(
next_cmd,
sizeof(cmd) + RoundSizeToMultipleOfEntries(arraysize(ids) * 4u));
- // TODO(gman): Check that ids were inserted;
+ EXPECT_EQ(0, memcmp(ids, ImmediateDataAddress(&cmd), sizeof(ids)));
}
TEST_F(GLES2FormatTest, DeleteValuebuffersCHROMIUMImmediate) {
@@ -4535,7 +4604,7 @@ TEST_F(GLES2FormatTest, DeleteValuebuffersCHROMIUMImmediate) {
CheckBytesWrittenMatchesExpectedSize(
next_cmd,
sizeof(cmd) + RoundSizeToMultipleOfEntries(arraysize(ids) * 4u));
- // TODO(gman): Check that ids were inserted;
+ EXPECT_EQ(0, memcmp(ids, ImmediateDataAddress(&cmd), sizeof(ids)));
}
TEST_F(GLES2FormatTest, IsValuebufferCHROMIUM) {
@@ -4652,84 +4721,6 @@ TEST_F(GLES2FormatTest, TraceEndCHROMIUM) {
CheckBytesWrittenMatchesExpectedSize(next_cmd, sizeof(cmd));
}
-TEST_F(GLES2FormatTest, AsyncTexSubImage2DCHROMIUM) {
- cmds::AsyncTexSubImage2DCHROMIUM& cmd =
- *GetBufferAs<cmds::AsyncTexSubImage2DCHROMIUM>();
- void* next_cmd = cmd.Set(
- &cmd, static_cast<GLenum>(11), static_cast<GLint>(12),
- static_cast<GLint>(13), static_cast<GLint>(14), static_cast<GLsizei>(15),
- static_cast<GLsizei>(16), static_cast<GLenum>(17),
- static_cast<GLenum>(18), static_cast<uint32_t>(19),
- static_cast<uint32_t>(20), static_cast<uint32_t>(21),
- static_cast<uint32_t>(22), static_cast<uint32_t>(23));
- EXPECT_EQ(static_cast<uint32_t>(cmds::AsyncTexSubImage2DCHROMIUM::kCmdId),
- cmd.header.command);
- EXPECT_EQ(sizeof(cmd), cmd.header.size * 4u);
- EXPECT_EQ(static_cast<GLenum>(11), cmd.target);
- EXPECT_EQ(static_cast<GLint>(12), cmd.level);
- EXPECT_EQ(static_cast<GLint>(13), cmd.xoffset);
- EXPECT_EQ(static_cast<GLint>(14), cmd.yoffset);
- EXPECT_EQ(static_cast<GLsizei>(15), cmd.width);
- EXPECT_EQ(static_cast<GLsizei>(16), cmd.height);
- EXPECT_EQ(static_cast<GLenum>(17), cmd.format);
- EXPECT_EQ(static_cast<GLenum>(18), cmd.type);
- EXPECT_EQ(static_cast<uint32_t>(19), cmd.data_shm_id);
- EXPECT_EQ(static_cast<uint32_t>(20), cmd.data_shm_offset);
- EXPECT_EQ(static_cast<uint32_t>(21), cmd.async_upload_token);
- EXPECT_EQ(static_cast<uint32_t>(22), cmd.sync_data_shm_id);
- EXPECT_EQ(static_cast<uint32_t>(23), cmd.sync_data_shm_offset);
- CheckBytesWrittenMatchesExpectedSize(next_cmd, sizeof(cmd));
-}
-
-TEST_F(GLES2FormatTest, AsyncTexImage2DCHROMIUM) {
- cmds::AsyncTexImage2DCHROMIUM& cmd =
- *GetBufferAs<cmds::AsyncTexImage2DCHROMIUM>();
- void* next_cmd =
- cmd.Set(&cmd, static_cast<GLenum>(11), static_cast<GLint>(12),
- static_cast<GLint>(13), static_cast<GLsizei>(14),
- static_cast<GLsizei>(15), static_cast<GLenum>(16),
- static_cast<GLenum>(17), static_cast<uint32_t>(18),
- static_cast<uint32_t>(19), static_cast<uint32_t>(20),
- static_cast<uint32_t>(21), static_cast<uint32_t>(22));
- EXPECT_EQ(static_cast<uint32_t>(cmds::AsyncTexImage2DCHROMIUM::kCmdId),
- cmd.header.command);
- EXPECT_EQ(sizeof(cmd), cmd.header.size * 4u);
- EXPECT_EQ(static_cast<GLenum>(11), cmd.target);
- EXPECT_EQ(static_cast<GLint>(12), cmd.level);
- EXPECT_EQ(static_cast<GLint>(13), cmd.internalformat);
- EXPECT_EQ(static_cast<GLsizei>(14), cmd.width);
- EXPECT_EQ(static_cast<GLsizei>(15), cmd.height);
- EXPECT_EQ(static_cast<GLenum>(16), cmd.format);
- EXPECT_EQ(static_cast<GLenum>(17), cmd.type);
- EXPECT_EQ(static_cast<uint32_t>(18), cmd.pixels_shm_id);
- EXPECT_EQ(static_cast<uint32_t>(19), cmd.pixels_shm_offset);
- EXPECT_EQ(static_cast<uint32_t>(20), cmd.async_upload_token);
- EXPECT_EQ(static_cast<uint32_t>(21), cmd.sync_data_shm_id);
- EXPECT_EQ(static_cast<uint32_t>(22), cmd.sync_data_shm_offset);
- CheckBytesWrittenMatchesExpectedSize(next_cmd, sizeof(cmd));
-}
-
-TEST_F(GLES2FormatTest, WaitAsyncTexImage2DCHROMIUM) {
- cmds::WaitAsyncTexImage2DCHROMIUM& cmd =
- *GetBufferAs<cmds::WaitAsyncTexImage2DCHROMIUM>();
- void* next_cmd = cmd.Set(&cmd, static_cast<GLenum>(11));
- EXPECT_EQ(static_cast<uint32_t>(cmds::WaitAsyncTexImage2DCHROMIUM::kCmdId),
- cmd.header.command);
- EXPECT_EQ(sizeof(cmd), cmd.header.size * 4u);
- EXPECT_EQ(static_cast<GLenum>(11), cmd.target);
- CheckBytesWrittenMatchesExpectedSize(next_cmd, sizeof(cmd));
-}
-
-TEST_F(GLES2FormatTest, WaitAllAsyncTexImage2DCHROMIUM) {
- cmds::WaitAllAsyncTexImage2DCHROMIUM& cmd =
- *GetBufferAs<cmds::WaitAllAsyncTexImage2DCHROMIUM>();
- void* next_cmd = cmd.Set(&cmd);
- EXPECT_EQ(static_cast<uint32_t>(cmds::WaitAllAsyncTexImage2DCHROMIUM::kCmdId),
- cmd.header.command);
- EXPECT_EQ(sizeof(cmd), cmd.header.size * 4u);
- CheckBytesWrittenMatchesExpectedSize(next_cmd, sizeof(cmd));
-}
-
TEST_F(GLES2FormatTest, DiscardFramebufferEXTImmediate) {
const int kSomeBaseValueToTestWith = 51;
static GLenum data[] = {
@@ -4897,6 +4888,195 @@ TEST_F(GLES2FormatTest, MatrixLoadIdentityCHROMIUM) {
CheckBytesWrittenMatchesExpectedSize(next_cmd, sizeof(cmd));
}
+TEST_F(GLES2FormatTest, GenPathsCHROMIUM) {
+ cmds::GenPathsCHROMIUM& cmd = *GetBufferAs<cmds::GenPathsCHROMIUM>();
+ void* next_cmd =
+ cmd.Set(&cmd, static_cast<GLuint>(11), static_cast<GLsizei>(12));
+ EXPECT_EQ(static_cast<uint32_t>(cmds::GenPathsCHROMIUM::kCmdId),
+ cmd.header.command);
+ EXPECT_EQ(sizeof(cmd), cmd.header.size * 4u);
+ EXPECT_EQ(static_cast<GLuint>(11), cmd.first_client_id);
+ EXPECT_EQ(static_cast<GLsizei>(12), cmd.range);
+ CheckBytesWrittenMatchesExpectedSize(next_cmd, sizeof(cmd));
+}
+
+TEST_F(GLES2FormatTest, DeletePathsCHROMIUM) {
+ cmds::DeletePathsCHROMIUM& cmd = *GetBufferAs<cmds::DeletePathsCHROMIUM>();
+ void* next_cmd =
+ cmd.Set(&cmd, static_cast<GLuint>(11), static_cast<GLsizei>(12));
+ EXPECT_EQ(static_cast<uint32_t>(cmds::DeletePathsCHROMIUM::kCmdId),
+ cmd.header.command);
+ EXPECT_EQ(sizeof(cmd), cmd.header.size * 4u);
+ EXPECT_EQ(static_cast<GLuint>(11), cmd.first_client_id);
+ EXPECT_EQ(static_cast<GLsizei>(12), cmd.range);
+ CheckBytesWrittenMatchesExpectedSize(next_cmd, sizeof(cmd));
+}
+
+TEST_F(GLES2FormatTest, IsPathCHROMIUM) {
+ cmds::IsPathCHROMIUM& cmd = *GetBufferAs<cmds::IsPathCHROMIUM>();
+ void* next_cmd =
+ cmd.Set(&cmd, static_cast<GLuint>(11), static_cast<uint32_t>(12),
+ static_cast<uint32_t>(13));
+ EXPECT_EQ(static_cast<uint32_t>(cmds::IsPathCHROMIUM::kCmdId),
+ cmd.header.command);
+ EXPECT_EQ(sizeof(cmd), cmd.header.size * 4u);
+ EXPECT_EQ(static_cast<GLuint>(11), cmd.path);
+ EXPECT_EQ(static_cast<uint32_t>(12), cmd.result_shm_id);
+ EXPECT_EQ(static_cast<uint32_t>(13), cmd.result_shm_offset);
+ CheckBytesWrittenMatchesExpectedSize(next_cmd, sizeof(cmd));
+}
+
+TEST_F(GLES2FormatTest, PathCommandsCHROMIUM) {
+ cmds::PathCommandsCHROMIUM& cmd = *GetBufferAs<cmds::PathCommandsCHROMIUM>();
+ void* next_cmd =
+ cmd.Set(&cmd, static_cast<GLuint>(11), static_cast<GLsizei>(12),
+ static_cast<uint32_t>(13), static_cast<uint32_t>(14),
+ static_cast<GLsizei>(15), static_cast<GLenum>(16),
+ static_cast<uint32_t>(17), static_cast<uint32_t>(18));
+ EXPECT_EQ(static_cast<uint32_t>(cmds::PathCommandsCHROMIUM::kCmdId),
+ cmd.header.command);
+ EXPECT_EQ(sizeof(cmd), cmd.header.size * 4u);
+ EXPECT_EQ(static_cast<GLuint>(11), cmd.path);
+ EXPECT_EQ(static_cast<GLsizei>(12), cmd.numCommands);
+ EXPECT_EQ(static_cast<uint32_t>(13), cmd.commands_shm_id);
+ EXPECT_EQ(static_cast<uint32_t>(14), cmd.commands_shm_offset);
+ EXPECT_EQ(static_cast<GLsizei>(15), cmd.numCoords);
+ EXPECT_EQ(static_cast<GLenum>(16), cmd.coordType);
+ EXPECT_EQ(static_cast<uint32_t>(17), cmd.coords_shm_id);
+ EXPECT_EQ(static_cast<uint32_t>(18), cmd.coords_shm_offset);
+ CheckBytesWrittenMatchesExpectedSize(next_cmd, sizeof(cmd));
+}
+
+TEST_F(GLES2FormatTest, PathParameterfCHROMIUM) {
+ cmds::PathParameterfCHROMIUM& cmd =
+ *GetBufferAs<cmds::PathParameterfCHROMIUM>();
+ void* next_cmd = cmd.Set(&cmd, static_cast<GLuint>(11),
+ static_cast<GLenum>(12), static_cast<GLfloat>(13));
+ EXPECT_EQ(static_cast<uint32_t>(cmds::PathParameterfCHROMIUM::kCmdId),
+ cmd.header.command);
+ EXPECT_EQ(sizeof(cmd), cmd.header.size * 4u);
+ EXPECT_EQ(static_cast<GLuint>(11), cmd.path);
+ EXPECT_EQ(static_cast<GLenum>(12), cmd.pname);
+ EXPECT_EQ(static_cast<GLfloat>(13), cmd.value);
+ CheckBytesWrittenMatchesExpectedSize(next_cmd, sizeof(cmd));
+}
+
+TEST_F(GLES2FormatTest, PathParameteriCHROMIUM) {
+ cmds::PathParameteriCHROMIUM& cmd =
+ *GetBufferAs<cmds::PathParameteriCHROMIUM>();
+ void* next_cmd = cmd.Set(&cmd, static_cast<GLuint>(11),
+ static_cast<GLenum>(12), static_cast<GLint>(13));
+ EXPECT_EQ(static_cast<uint32_t>(cmds::PathParameteriCHROMIUM::kCmdId),
+ cmd.header.command);
+ EXPECT_EQ(sizeof(cmd), cmd.header.size * 4u);
+ EXPECT_EQ(static_cast<GLuint>(11), cmd.path);
+ EXPECT_EQ(static_cast<GLenum>(12), cmd.pname);
+ EXPECT_EQ(static_cast<GLint>(13), cmd.value);
+ CheckBytesWrittenMatchesExpectedSize(next_cmd, sizeof(cmd));
+}
+
+TEST_F(GLES2FormatTest, PathStencilFuncCHROMIUM) {
+ cmds::PathStencilFuncCHROMIUM& cmd =
+ *GetBufferAs<cmds::PathStencilFuncCHROMIUM>();
+ void* next_cmd = cmd.Set(&cmd, static_cast<GLenum>(11),
+ static_cast<GLint>(12), static_cast<GLuint>(13));
+ EXPECT_EQ(static_cast<uint32_t>(cmds::PathStencilFuncCHROMIUM::kCmdId),
+ cmd.header.command);
+ EXPECT_EQ(sizeof(cmd), cmd.header.size * 4u);
+ EXPECT_EQ(static_cast<GLenum>(11), cmd.func);
+ EXPECT_EQ(static_cast<GLint>(12), cmd.ref);
+ EXPECT_EQ(static_cast<GLuint>(13), cmd.mask);
+ CheckBytesWrittenMatchesExpectedSize(next_cmd, sizeof(cmd));
+}
+
+TEST_F(GLES2FormatTest, StencilFillPathCHROMIUM) {
+ cmds::StencilFillPathCHROMIUM& cmd =
+ *GetBufferAs<cmds::StencilFillPathCHROMIUM>();
+ void* next_cmd = cmd.Set(&cmd, static_cast<GLuint>(11),
+ static_cast<GLenum>(12), static_cast<GLuint>(13));
+ EXPECT_EQ(static_cast<uint32_t>(cmds::StencilFillPathCHROMIUM::kCmdId),
+ cmd.header.command);
+ EXPECT_EQ(sizeof(cmd), cmd.header.size * 4u);
+ EXPECT_EQ(static_cast<GLuint>(11), cmd.path);
+ EXPECT_EQ(static_cast<GLenum>(12), cmd.fillMode);
+ EXPECT_EQ(static_cast<GLuint>(13), cmd.mask);
+ CheckBytesWrittenMatchesExpectedSize(next_cmd, sizeof(cmd));
+}
+
+TEST_F(GLES2FormatTest, StencilStrokePathCHROMIUM) {
+ cmds::StencilStrokePathCHROMIUM& cmd =
+ *GetBufferAs<cmds::StencilStrokePathCHROMIUM>();
+ void* next_cmd = cmd.Set(&cmd, static_cast<GLuint>(11),
+ static_cast<GLint>(12), static_cast<GLuint>(13));
+ EXPECT_EQ(static_cast<uint32_t>(cmds::StencilStrokePathCHROMIUM::kCmdId),
+ cmd.header.command);
+ EXPECT_EQ(sizeof(cmd), cmd.header.size * 4u);
+ EXPECT_EQ(static_cast<GLuint>(11), cmd.path);
+ EXPECT_EQ(static_cast<GLint>(12), cmd.reference);
+ EXPECT_EQ(static_cast<GLuint>(13), cmd.mask);
+ CheckBytesWrittenMatchesExpectedSize(next_cmd, sizeof(cmd));
+}
+
+TEST_F(GLES2FormatTest, CoverFillPathCHROMIUM) {
+ cmds::CoverFillPathCHROMIUM& cmd =
+ *GetBufferAs<cmds::CoverFillPathCHROMIUM>();
+ void* next_cmd =
+ cmd.Set(&cmd, static_cast<GLuint>(11), static_cast<GLenum>(12));
+ EXPECT_EQ(static_cast<uint32_t>(cmds::CoverFillPathCHROMIUM::kCmdId),
+ cmd.header.command);
+ EXPECT_EQ(sizeof(cmd), cmd.header.size * 4u);
+ EXPECT_EQ(static_cast<GLuint>(11), cmd.path);
+ EXPECT_EQ(static_cast<GLenum>(12), cmd.coverMode);
+ CheckBytesWrittenMatchesExpectedSize(next_cmd, sizeof(cmd));
+}
+
+TEST_F(GLES2FormatTest, CoverStrokePathCHROMIUM) {
+ cmds::CoverStrokePathCHROMIUM& cmd =
+ *GetBufferAs<cmds::CoverStrokePathCHROMIUM>();
+ void* next_cmd =
+ cmd.Set(&cmd, static_cast<GLuint>(11), static_cast<GLenum>(12));
+ EXPECT_EQ(static_cast<uint32_t>(cmds::CoverStrokePathCHROMIUM::kCmdId),
+ cmd.header.command);
+ EXPECT_EQ(sizeof(cmd), cmd.header.size * 4u);
+ EXPECT_EQ(static_cast<GLuint>(11), cmd.path);
+ EXPECT_EQ(static_cast<GLenum>(12), cmd.coverMode);
+ CheckBytesWrittenMatchesExpectedSize(next_cmd, sizeof(cmd));
+}
+
+TEST_F(GLES2FormatTest, StencilThenCoverFillPathCHROMIUM) {
+ cmds::StencilThenCoverFillPathCHROMIUM& cmd =
+ *GetBufferAs<cmds::StencilThenCoverFillPathCHROMIUM>();
+ void* next_cmd =
+ cmd.Set(&cmd, static_cast<GLuint>(11), static_cast<GLenum>(12),
+ static_cast<GLuint>(13), static_cast<GLenum>(14));
+ EXPECT_EQ(
+ static_cast<uint32_t>(cmds::StencilThenCoverFillPathCHROMIUM::kCmdId),
+ cmd.header.command);
+ EXPECT_EQ(sizeof(cmd), cmd.header.size * 4u);
+ EXPECT_EQ(static_cast<GLuint>(11), cmd.path);
+ EXPECT_EQ(static_cast<GLenum>(12), cmd.fillMode);
+ EXPECT_EQ(static_cast<GLuint>(13), cmd.mask);
+ EXPECT_EQ(static_cast<GLenum>(14), cmd.coverMode);
+ CheckBytesWrittenMatchesExpectedSize(next_cmd, sizeof(cmd));
+}
+
+TEST_F(GLES2FormatTest, StencilThenCoverStrokePathCHROMIUM) {
+ cmds::StencilThenCoverStrokePathCHROMIUM& cmd =
+ *GetBufferAs<cmds::StencilThenCoverStrokePathCHROMIUM>();
+ void* next_cmd =
+ cmd.Set(&cmd, static_cast<GLuint>(11), static_cast<GLint>(12),
+ static_cast<GLuint>(13), static_cast<GLenum>(14));
+ EXPECT_EQ(
+ static_cast<uint32_t>(cmds::StencilThenCoverStrokePathCHROMIUM::kCmdId),
+ cmd.header.command);
+ EXPECT_EQ(sizeof(cmd), cmd.header.size * 4u);
+ EXPECT_EQ(static_cast<GLuint>(11), cmd.path);
+ EXPECT_EQ(static_cast<GLint>(12), cmd.reference);
+ EXPECT_EQ(static_cast<GLuint>(13), cmd.mask);
+ EXPECT_EQ(static_cast<GLenum>(14), cmd.coverMode);
+ CheckBytesWrittenMatchesExpectedSize(next_cmd, sizeof(cmd));
+}
+
TEST_F(GLES2FormatTest, BlendBarrierKHR) {
cmds::BlendBarrierKHR& cmd = *GetBufferAs<cmds::BlendBarrierKHR>();
void* next_cmd = cmd.Set(&cmd);
@@ -4906,4 +5086,15 @@ TEST_F(GLES2FormatTest, BlendBarrierKHR) {
CheckBytesWrittenMatchesExpectedSize(next_cmd, sizeof(cmd));
}
+TEST_F(GLES2FormatTest, ApplyScreenSpaceAntialiasingCHROMIUM) {
+ cmds::ApplyScreenSpaceAntialiasingCHROMIUM& cmd =
+ *GetBufferAs<cmds::ApplyScreenSpaceAntialiasingCHROMIUM>();
+ void* next_cmd = cmd.Set(&cmd);
+ EXPECT_EQ(
+ static_cast<uint32_t>(cmds::ApplyScreenSpaceAntialiasingCHROMIUM::kCmdId),
+ cmd.header.command);
+ EXPECT_EQ(sizeof(cmd), cmd.header.size * 4u);
+ CheckBytesWrittenMatchesExpectedSize(next_cmd, sizeof(cmd));
+}
+
#endif // GPU_COMMAND_BUFFER_COMMON_GLES2_CMD_FORMAT_TEST_AUTOGEN_H_
diff --git a/chromium/gpu/command_buffer/common/gles2_cmd_ids_autogen.h b/chromium/gpu/command_buffer/common/gles2_cmd_ids_autogen.h
index 35c09fa4f36..895144093cb 100644
--- a/chromium/gpu/command_buffer/common/gles2_cmd_ids_autogen.h
+++ b/chromium/gpu/command_buffer/common/gles2_cmd_ids_autogen.h
@@ -98,200 +98,200 @@
OP(GetAttachedShaders) /* 339 */ \
OP(GetAttribLocation) /* 340 */ \
OP(GetBooleanv) /* 341 */ \
- OP(GetBufferParameteriv) /* 342 */ \
- OP(GetError) /* 343 */ \
- OP(GetFloatv) /* 344 */ \
- OP(GetFragDataLocation) /* 345 */ \
- OP(GetFramebufferAttachmentParameteriv) /* 346 */ \
- OP(GetInteger64v) /* 347 */ \
- OP(GetIntegeri_v) /* 348 */ \
- OP(GetInteger64i_v) /* 349 */ \
- OP(GetIntegerv) /* 350 */ \
- OP(GetInternalformativ) /* 351 */ \
- OP(GetProgramiv) /* 352 */ \
- OP(GetProgramInfoLog) /* 353 */ \
- OP(GetRenderbufferParameteriv) /* 354 */ \
- OP(GetSamplerParameterfv) /* 355 */ \
- OP(GetSamplerParameteriv) /* 356 */ \
- OP(GetShaderiv) /* 357 */ \
- OP(GetShaderInfoLog) /* 358 */ \
- OP(GetShaderPrecisionFormat) /* 359 */ \
- OP(GetShaderSource) /* 360 */ \
- OP(GetString) /* 361 */ \
- OP(GetSynciv) /* 362 */ \
- OP(GetTexParameterfv) /* 363 */ \
- OP(GetTexParameteriv) /* 364 */ \
- OP(GetTransformFeedbackVarying) /* 365 */ \
- OP(GetUniformBlockIndex) /* 366 */ \
- OP(GetUniformfv) /* 367 */ \
- OP(GetUniformiv) /* 368 */ \
- OP(GetUniformuiv) /* 369 */ \
- OP(GetUniformIndices) /* 370 */ \
- OP(GetUniformLocation) /* 371 */ \
- OP(GetVertexAttribfv) /* 372 */ \
- OP(GetVertexAttribiv) /* 373 */ \
- OP(GetVertexAttribIiv) /* 374 */ \
- OP(GetVertexAttribIuiv) /* 375 */ \
- OP(GetVertexAttribPointerv) /* 376 */ \
- OP(Hint) /* 377 */ \
- OP(InvalidateFramebufferImmediate) /* 378 */ \
- OP(InvalidateSubFramebufferImmediate) /* 379 */ \
- OP(IsBuffer) /* 380 */ \
- OP(IsEnabled) /* 381 */ \
- OP(IsFramebuffer) /* 382 */ \
- OP(IsProgram) /* 383 */ \
- OP(IsRenderbuffer) /* 384 */ \
- OP(IsSampler) /* 385 */ \
- OP(IsShader) /* 386 */ \
- OP(IsSync) /* 387 */ \
- OP(IsTexture) /* 388 */ \
- OP(IsTransformFeedback) /* 389 */ \
- OP(LineWidth) /* 390 */ \
- OP(LinkProgram) /* 391 */ \
- OP(PauseTransformFeedback) /* 392 */ \
- OP(PixelStorei) /* 393 */ \
- OP(PolygonOffset) /* 394 */ \
- OP(ReadBuffer) /* 395 */ \
- OP(ReadPixels) /* 396 */ \
- OP(ReleaseShaderCompiler) /* 397 */ \
- OP(RenderbufferStorage) /* 398 */ \
- OP(ResumeTransformFeedback) /* 399 */ \
- OP(SampleCoverage) /* 400 */ \
- OP(SamplerParameterf) /* 401 */ \
- OP(SamplerParameterfvImmediate) /* 402 */ \
- OP(SamplerParameteri) /* 403 */ \
- OP(SamplerParameterivImmediate) /* 404 */ \
- OP(Scissor) /* 405 */ \
- OP(ShaderBinary) /* 406 */ \
- OP(ShaderSourceBucket) /* 407 */ \
- OP(StencilFunc) /* 408 */ \
- OP(StencilFuncSeparate) /* 409 */ \
- OP(StencilMask) /* 410 */ \
- OP(StencilMaskSeparate) /* 411 */ \
- OP(StencilOp) /* 412 */ \
- OP(StencilOpSeparate) /* 413 */ \
- OP(TexImage2D) /* 414 */ \
- OP(TexImage3D) /* 415 */ \
- OP(TexParameterf) /* 416 */ \
- OP(TexParameterfvImmediate) /* 417 */ \
- OP(TexParameteri) /* 418 */ \
- OP(TexParameterivImmediate) /* 419 */ \
- OP(TexStorage3D) /* 420 */ \
- OP(TexSubImage2D) /* 421 */ \
- OP(TexSubImage3D) /* 422 */ \
- OP(TransformFeedbackVaryingsBucket) /* 423 */ \
- OP(Uniform1f) /* 424 */ \
- OP(Uniform1fvImmediate) /* 425 */ \
- OP(Uniform1i) /* 426 */ \
- OP(Uniform1ivImmediate) /* 427 */ \
- OP(Uniform1ui) /* 428 */ \
- OP(Uniform1uivImmediate) /* 429 */ \
- OP(Uniform2f) /* 430 */ \
- OP(Uniform2fvImmediate) /* 431 */ \
- OP(Uniform2i) /* 432 */ \
- OP(Uniform2ivImmediate) /* 433 */ \
- OP(Uniform2ui) /* 434 */ \
- OP(Uniform2uivImmediate) /* 435 */ \
- OP(Uniform3f) /* 436 */ \
- OP(Uniform3fvImmediate) /* 437 */ \
- OP(Uniform3i) /* 438 */ \
- OP(Uniform3ivImmediate) /* 439 */ \
- OP(Uniform3ui) /* 440 */ \
- OP(Uniform3uivImmediate) /* 441 */ \
- OP(Uniform4f) /* 442 */ \
- OP(Uniform4fvImmediate) /* 443 */ \
- OP(Uniform4i) /* 444 */ \
- OP(Uniform4ivImmediate) /* 445 */ \
- OP(Uniform4ui) /* 446 */ \
- OP(Uniform4uivImmediate) /* 447 */ \
- OP(UniformBlockBinding) /* 448 */ \
- OP(UniformMatrix2fvImmediate) /* 449 */ \
- OP(UniformMatrix2x3fvImmediate) /* 450 */ \
- OP(UniformMatrix2x4fvImmediate) /* 451 */ \
- OP(UniformMatrix3fvImmediate) /* 452 */ \
- OP(UniformMatrix3x2fvImmediate) /* 453 */ \
- OP(UniformMatrix3x4fvImmediate) /* 454 */ \
- OP(UniformMatrix4fvImmediate) /* 455 */ \
- OP(UniformMatrix4x2fvImmediate) /* 456 */ \
- OP(UniformMatrix4x3fvImmediate) /* 457 */ \
- OP(UseProgram) /* 458 */ \
- OP(ValidateProgram) /* 459 */ \
- OP(VertexAttrib1f) /* 460 */ \
- OP(VertexAttrib1fvImmediate) /* 461 */ \
- OP(VertexAttrib2f) /* 462 */ \
- OP(VertexAttrib2fvImmediate) /* 463 */ \
- OP(VertexAttrib3f) /* 464 */ \
- OP(VertexAttrib3fvImmediate) /* 465 */ \
- OP(VertexAttrib4f) /* 466 */ \
- OP(VertexAttrib4fvImmediate) /* 467 */ \
- OP(VertexAttribI4i) /* 468 */ \
- OP(VertexAttribI4ivImmediate) /* 469 */ \
- OP(VertexAttribI4ui) /* 470 */ \
- OP(VertexAttribI4uivImmediate) /* 471 */ \
- OP(VertexAttribIPointer) /* 472 */ \
- OP(VertexAttribPointer) /* 473 */ \
- OP(Viewport) /* 474 */ \
- OP(WaitSync) /* 475 */ \
- OP(BlitFramebufferCHROMIUM) /* 476 */ \
- OP(RenderbufferStorageMultisampleCHROMIUM) /* 477 */ \
- OP(RenderbufferStorageMultisampleEXT) /* 478 */ \
- OP(FramebufferTexture2DMultisampleEXT) /* 479 */ \
- OP(TexStorage2DEXT) /* 480 */ \
- OP(GenQueriesEXTImmediate) /* 481 */ \
- OP(DeleteQueriesEXTImmediate) /* 482 */ \
- OP(BeginQueryEXT) /* 483 */ \
- OP(BeginTransformFeedback) /* 484 */ \
- OP(EndQueryEXT) /* 485 */ \
- OP(EndTransformFeedback) /* 486 */ \
- OP(InsertEventMarkerEXT) /* 487 */ \
- OP(PushGroupMarkerEXT) /* 488 */ \
- OP(PopGroupMarkerEXT) /* 489 */ \
- OP(GenVertexArraysOESImmediate) /* 490 */ \
- OP(DeleteVertexArraysOESImmediate) /* 491 */ \
- OP(IsVertexArrayOES) /* 492 */ \
- OP(BindVertexArrayOES) /* 493 */ \
- OP(SwapBuffers) /* 494 */ \
- OP(GetMaxValueInBufferCHROMIUM) /* 495 */ \
- OP(EnableFeatureCHROMIUM) /* 496 */ \
- OP(MapBufferRange) /* 497 */ \
- OP(UnmapBuffer) /* 498 */ \
- OP(ResizeCHROMIUM) /* 499 */ \
- OP(GetRequestableExtensionsCHROMIUM) /* 500 */ \
- OP(RequestExtensionCHROMIUM) /* 501 */ \
- OP(GetProgramInfoCHROMIUM) /* 502 */ \
- OP(GetUniformBlocksCHROMIUM) /* 503 */ \
- OP(GetTransformFeedbackVaryingsCHROMIUM) /* 504 */ \
- OP(GetUniformsES3CHROMIUM) /* 505 */ \
- OP(GetTranslatedShaderSourceANGLE) /* 506 */ \
- OP(PostSubBufferCHROMIUM) /* 507 */ \
- OP(TexImageIOSurface2DCHROMIUM) /* 508 */ \
- OP(CopyTextureCHROMIUM) /* 509 */ \
- OP(CopySubTextureCHROMIUM) /* 510 */ \
- OP(CompressedCopyTextureCHROMIUM) /* 511 */ \
- OP(DrawArraysInstancedANGLE) /* 512 */ \
- OP(DrawElementsInstancedANGLE) /* 513 */ \
- OP(VertexAttribDivisorANGLE) /* 514 */ \
- OP(GenMailboxCHROMIUM) /* 515 */ \
- OP(ProduceTextureCHROMIUMImmediate) /* 516 */ \
- OP(ProduceTextureDirectCHROMIUMImmediate) /* 517 */ \
- OP(ConsumeTextureCHROMIUMImmediate) /* 518 */ \
- OP(CreateAndConsumeTextureCHROMIUMImmediate) /* 519 */ \
- OP(BindUniformLocationCHROMIUMBucket) /* 520 */ \
- OP(GenValuebuffersCHROMIUMImmediate) /* 521 */ \
- OP(DeleteValuebuffersCHROMIUMImmediate) /* 522 */ \
- OP(IsValuebufferCHROMIUM) /* 523 */ \
- OP(BindValuebufferCHROMIUM) /* 524 */ \
- OP(SubscribeValueCHROMIUM) /* 525 */ \
- OP(PopulateSubscribedValuesCHROMIUM) /* 526 */ \
- OP(UniformValuebufferCHROMIUM) /* 527 */ \
- OP(BindTexImage2DCHROMIUM) /* 528 */ \
- OP(ReleaseTexImage2DCHROMIUM) /* 529 */ \
- OP(TraceBeginCHROMIUM) /* 530 */ \
- OP(TraceEndCHROMIUM) /* 531 */ \
- OP(AsyncTexSubImage2DCHROMIUM) /* 532 */ \
- OP(AsyncTexImage2DCHROMIUM) /* 533 */ \
- OP(WaitAsyncTexImage2DCHROMIUM) /* 534 */ \
- OP(WaitAllAsyncTexImage2DCHROMIUM) /* 535 */ \
+ OP(GetBufferParameteri64v) /* 342 */ \
+ OP(GetBufferParameteriv) /* 343 */ \
+ OP(GetError) /* 344 */ \
+ OP(GetFloatv) /* 345 */ \
+ OP(GetFragDataLocation) /* 346 */ \
+ OP(GetFramebufferAttachmentParameteriv) /* 347 */ \
+ OP(GetInteger64v) /* 348 */ \
+ OP(GetIntegeri_v) /* 349 */ \
+ OP(GetInteger64i_v) /* 350 */ \
+ OP(GetIntegerv) /* 351 */ \
+ OP(GetInternalformativ) /* 352 */ \
+ OP(GetProgramiv) /* 353 */ \
+ OP(GetProgramInfoLog) /* 354 */ \
+ OP(GetRenderbufferParameteriv) /* 355 */ \
+ OP(GetSamplerParameterfv) /* 356 */ \
+ OP(GetSamplerParameteriv) /* 357 */ \
+ OP(GetShaderiv) /* 358 */ \
+ OP(GetShaderInfoLog) /* 359 */ \
+ OP(GetShaderPrecisionFormat) /* 360 */ \
+ OP(GetShaderSource) /* 361 */ \
+ OP(GetString) /* 362 */ \
+ OP(GetSynciv) /* 363 */ \
+ OP(GetTexParameterfv) /* 364 */ \
+ OP(GetTexParameteriv) /* 365 */ \
+ OP(GetTransformFeedbackVarying) /* 366 */ \
+ OP(GetUniformBlockIndex) /* 367 */ \
+ OP(GetUniformfv) /* 368 */ \
+ OP(GetUniformiv) /* 369 */ \
+ OP(GetUniformuiv) /* 370 */ \
+ OP(GetUniformIndices) /* 371 */ \
+ OP(GetUniformLocation) /* 372 */ \
+ OP(GetVertexAttribfv) /* 373 */ \
+ OP(GetVertexAttribiv) /* 374 */ \
+ OP(GetVertexAttribIiv) /* 375 */ \
+ OP(GetVertexAttribIuiv) /* 376 */ \
+ OP(GetVertexAttribPointerv) /* 377 */ \
+ OP(Hint) /* 378 */ \
+ OP(InvalidateFramebufferImmediate) /* 379 */ \
+ OP(InvalidateSubFramebufferImmediate) /* 380 */ \
+ OP(IsBuffer) /* 381 */ \
+ OP(IsEnabled) /* 382 */ \
+ OP(IsFramebuffer) /* 383 */ \
+ OP(IsProgram) /* 384 */ \
+ OP(IsRenderbuffer) /* 385 */ \
+ OP(IsSampler) /* 386 */ \
+ OP(IsShader) /* 387 */ \
+ OP(IsSync) /* 388 */ \
+ OP(IsTexture) /* 389 */ \
+ OP(IsTransformFeedback) /* 390 */ \
+ OP(LineWidth) /* 391 */ \
+ OP(LinkProgram) /* 392 */ \
+ OP(PauseTransformFeedback) /* 393 */ \
+ OP(PixelStorei) /* 394 */ \
+ OP(PolygonOffset) /* 395 */ \
+ OP(ReadBuffer) /* 396 */ \
+ OP(ReadPixels) /* 397 */ \
+ OP(ReleaseShaderCompiler) /* 398 */ \
+ OP(RenderbufferStorage) /* 399 */ \
+ OP(ResumeTransformFeedback) /* 400 */ \
+ OP(SampleCoverage) /* 401 */ \
+ OP(SamplerParameterf) /* 402 */ \
+ OP(SamplerParameterfvImmediate) /* 403 */ \
+ OP(SamplerParameteri) /* 404 */ \
+ OP(SamplerParameterivImmediate) /* 405 */ \
+ OP(Scissor) /* 406 */ \
+ OP(ShaderBinary) /* 407 */ \
+ OP(ShaderSourceBucket) /* 408 */ \
+ OP(StencilFunc) /* 409 */ \
+ OP(StencilFuncSeparate) /* 410 */ \
+ OP(StencilMask) /* 411 */ \
+ OP(StencilMaskSeparate) /* 412 */ \
+ OP(StencilOp) /* 413 */ \
+ OP(StencilOpSeparate) /* 414 */ \
+ OP(TexImage2D) /* 415 */ \
+ OP(TexImage3D) /* 416 */ \
+ OP(TexParameterf) /* 417 */ \
+ OP(TexParameterfvImmediate) /* 418 */ \
+ OP(TexParameteri) /* 419 */ \
+ OP(TexParameterivImmediate) /* 420 */ \
+ OP(TexStorage3D) /* 421 */ \
+ OP(TexSubImage2D) /* 422 */ \
+ OP(TexSubImage3D) /* 423 */ \
+ OP(TransformFeedbackVaryingsBucket) /* 424 */ \
+ OP(Uniform1f) /* 425 */ \
+ OP(Uniform1fvImmediate) /* 426 */ \
+ OP(Uniform1i) /* 427 */ \
+ OP(Uniform1ivImmediate) /* 428 */ \
+ OP(Uniform1ui) /* 429 */ \
+ OP(Uniform1uivImmediate) /* 430 */ \
+ OP(Uniform2f) /* 431 */ \
+ OP(Uniform2fvImmediate) /* 432 */ \
+ OP(Uniform2i) /* 433 */ \
+ OP(Uniform2ivImmediate) /* 434 */ \
+ OP(Uniform2ui) /* 435 */ \
+ OP(Uniform2uivImmediate) /* 436 */ \
+ OP(Uniform3f) /* 437 */ \
+ OP(Uniform3fvImmediate) /* 438 */ \
+ OP(Uniform3i) /* 439 */ \
+ OP(Uniform3ivImmediate) /* 440 */ \
+ OP(Uniform3ui) /* 441 */ \
+ OP(Uniform3uivImmediate) /* 442 */ \
+ OP(Uniform4f) /* 443 */ \
+ OP(Uniform4fvImmediate) /* 444 */ \
+ OP(Uniform4i) /* 445 */ \
+ OP(Uniform4ivImmediate) /* 446 */ \
+ OP(Uniform4ui) /* 447 */ \
+ OP(Uniform4uivImmediate) /* 448 */ \
+ OP(UniformBlockBinding) /* 449 */ \
+ OP(UniformMatrix2fvImmediate) /* 450 */ \
+ OP(UniformMatrix2x3fvImmediate) /* 451 */ \
+ OP(UniformMatrix2x4fvImmediate) /* 452 */ \
+ OP(UniformMatrix3fvImmediate) /* 453 */ \
+ OP(UniformMatrix3x2fvImmediate) /* 454 */ \
+ OP(UniformMatrix3x4fvImmediate) /* 455 */ \
+ OP(UniformMatrix4fvImmediate) /* 456 */ \
+ OP(UniformMatrix4x2fvImmediate) /* 457 */ \
+ OP(UniformMatrix4x3fvImmediate) /* 458 */ \
+ OP(UseProgram) /* 459 */ \
+ OP(ValidateProgram) /* 460 */ \
+ OP(VertexAttrib1f) /* 461 */ \
+ OP(VertexAttrib1fvImmediate) /* 462 */ \
+ OP(VertexAttrib2f) /* 463 */ \
+ OP(VertexAttrib2fvImmediate) /* 464 */ \
+ OP(VertexAttrib3f) /* 465 */ \
+ OP(VertexAttrib3fvImmediate) /* 466 */ \
+ OP(VertexAttrib4f) /* 467 */ \
+ OP(VertexAttrib4fvImmediate) /* 468 */ \
+ OP(VertexAttribI4i) /* 469 */ \
+ OP(VertexAttribI4ivImmediate) /* 470 */ \
+ OP(VertexAttribI4ui) /* 471 */ \
+ OP(VertexAttribI4uivImmediate) /* 472 */ \
+ OP(VertexAttribIPointer) /* 473 */ \
+ OP(VertexAttribPointer) /* 474 */ \
+ OP(Viewport) /* 475 */ \
+ OP(WaitSync) /* 476 */ \
+ OP(BlitFramebufferCHROMIUM) /* 477 */ \
+ OP(RenderbufferStorageMultisampleCHROMIUM) /* 478 */ \
+ OP(RenderbufferStorageMultisampleEXT) /* 479 */ \
+ OP(FramebufferTexture2DMultisampleEXT) /* 480 */ \
+ OP(TexStorage2DEXT) /* 481 */ \
+ OP(GenQueriesEXTImmediate) /* 482 */ \
+ OP(DeleteQueriesEXTImmediate) /* 483 */ \
+ OP(QueryCounterEXT) /* 484 */ \
+ OP(BeginQueryEXT) /* 485 */ \
+ OP(BeginTransformFeedback) /* 486 */ \
+ OP(EndQueryEXT) /* 487 */ \
+ OP(EndTransformFeedback) /* 488 */ \
+ OP(SetDisjointValueSyncCHROMIUM) /* 489 */ \
+ OP(InsertEventMarkerEXT) /* 490 */ \
+ OP(PushGroupMarkerEXT) /* 491 */ \
+ OP(PopGroupMarkerEXT) /* 492 */ \
+ OP(GenVertexArraysOESImmediate) /* 493 */ \
+ OP(DeleteVertexArraysOESImmediate) /* 494 */ \
+ OP(IsVertexArrayOES) /* 495 */ \
+ OP(BindVertexArrayOES) /* 496 */ \
+ OP(SwapBuffers) /* 497 */ \
+ OP(GetMaxValueInBufferCHROMIUM) /* 498 */ \
+ OP(EnableFeatureCHROMIUM) /* 499 */ \
+ OP(MapBufferRange) /* 500 */ \
+ OP(UnmapBuffer) /* 501 */ \
+ OP(ResizeCHROMIUM) /* 502 */ \
+ OP(GetRequestableExtensionsCHROMIUM) /* 503 */ \
+ OP(RequestExtensionCHROMIUM) /* 504 */ \
+ OP(GetProgramInfoCHROMIUM) /* 505 */ \
+ OP(GetUniformBlocksCHROMIUM) /* 506 */ \
+ OP(GetTransformFeedbackVaryingsCHROMIUM) /* 507 */ \
+ OP(GetUniformsES3CHROMIUM) /* 508 */ \
+ OP(GetTranslatedShaderSourceANGLE) /* 509 */ \
+ OP(PostSubBufferCHROMIUM) /* 510 */ \
+ OP(TexImageIOSurface2DCHROMIUM) /* 511 */ \
+ OP(CopyTextureCHROMIUM) /* 512 */ \
+ OP(CopySubTextureCHROMIUM) /* 513 */ \
+ OP(CompressedCopyTextureCHROMIUM) /* 514 */ \
+ OP(CompressedCopySubTextureCHROMIUM) /* 515 */ \
+ OP(DrawArraysInstancedANGLE) /* 516 */ \
+ OP(DrawElementsInstancedANGLE) /* 517 */ \
+ OP(VertexAttribDivisorANGLE) /* 518 */ \
+ OP(GenMailboxCHROMIUM) /* 519 */ \
+ OP(ProduceTextureCHROMIUMImmediate) /* 520 */ \
+ OP(ProduceTextureDirectCHROMIUMImmediate) /* 521 */ \
+ OP(ConsumeTextureCHROMIUMImmediate) /* 522 */ \
+ OP(CreateAndConsumeTextureCHROMIUMImmediate) /* 523 */ \
+ OP(BindUniformLocationCHROMIUMBucket) /* 524 */ \
+ OP(GenValuebuffersCHROMIUMImmediate) /* 525 */ \
+ OP(DeleteValuebuffersCHROMIUMImmediate) /* 526 */ \
+ OP(IsValuebufferCHROMIUM) /* 527 */ \
+ OP(BindValuebufferCHROMIUM) /* 528 */ \
+ OP(SubscribeValueCHROMIUM) /* 529 */ \
+ OP(PopulateSubscribedValuesCHROMIUM) /* 530 */ \
+ OP(UniformValuebufferCHROMIUM) /* 531 */ \
+ OP(BindTexImage2DCHROMIUM) /* 532 */ \
+ OP(ReleaseTexImage2DCHROMIUM) /* 533 */ \
+ OP(TraceBeginCHROMIUM) /* 534 */ \
+ OP(TraceEndCHROMIUM) /* 535 */ \
OP(DiscardFramebufferEXTImmediate) /* 536 */ \
OP(LoseContextCHROMIUM) /* 537 */ \
OP(InsertSyncPointCHROMIUM) /* 538 */ \
@@ -303,7 +303,21 @@
OP(FlushDriverCachesCHROMIUM) /* 544 */ \
OP(MatrixLoadfCHROMIUMImmediate) /* 545 */ \
OP(MatrixLoadIdentityCHROMIUM) /* 546 */ \
- OP(BlendBarrierKHR) /* 547 */
+ OP(GenPathsCHROMIUM) /* 547 */ \
+ OP(DeletePathsCHROMIUM) /* 548 */ \
+ OP(IsPathCHROMIUM) /* 549 */ \
+ OP(PathCommandsCHROMIUM) /* 550 */ \
+ OP(PathParameterfCHROMIUM) /* 551 */ \
+ OP(PathParameteriCHROMIUM) /* 552 */ \
+ OP(PathStencilFuncCHROMIUM) /* 553 */ \
+ OP(StencilFillPathCHROMIUM) /* 554 */ \
+ OP(StencilStrokePathCHROMIUM) /* 555 */ \
+ OP(CoverFillPathCHROMIUM) /* 556 */ \
+ OP(CoverStrokePathCHROMIUM) /* 557 */ \
+ OP(StencilThenCoverFillPathCHROMIUM) /* 558 */ \
+ OP(StencilThenCoverStrokePathCHROMIUM) /* 559 */ \
+ OP(BlendBarrierKHR) /* 560 */ \
+ OP(ApplyScreenSpaceAntialiasingCHROMIUM) /* 561 */
enum CommandId {
kStartPoint = cmd::kLastCommonId, // All GLES2 commands start after this.
diff --git a/chromium/gpu/command_buffer/common/gles2_cmd_utils.cc b/chromium/gpu/command_buffer/common/gles2_cmd_utils.cc
index 7a33ab1e48f..b6533a29cdd 100644
--- a/chromium/gpu/command_buffer/common/gles2_cmd_utils.cc
+++ b/chromium/gpu/command_buffer/common/gles2_cmd_utils.cc
@@ -235,6 +235,16 @@ int GLES2Util::GLGetNumValuesReturned(int id) const {
case GL_BUFFER_USAGE:
return 1;
+ // ES3
+ case GL_BUFFER_MAPPED:
+ return 1;
+ case GL_BUFFER_ACCESS_FLAGS:
+ return 1;
+ case GL_BUFFER_MAP_LENGTH:
+ return 1;
+ case GL_BUFFER_MAP_OFFSET:
+ return 1;
+
// -- glGetFramebufferAttachmentParameteriv
case GL_FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE:
return 1;
@@ -252,6 +262,23 @@ int GLES2Util::GLGetNumValuesReturned(int id) const {
// GL_EXT_sRGB
case GL_FRAMEBUFFER_ATTACHMENT_COLOR_ENCODING_EXT:
return 1;
+ // ES3
+ case GL_FRAMEBUFFER_ATTACHMENT_RED_SIZE:
+ return 1;
+ case GL_FRAMEBUFFER_ATTACHMENT_GREEN_SIZE:
+ return 1;
+ case GL_FRAMEBUFFER_ATTACHMENT_BLUE_SIZE:
+ return 1;
+ case GL_FRAMEBUFFER_ATTACHMENT_ALPHA_SIZE:
+ return 1;
+ case GL_FRAMEBUFFER_ATTACHMENT_DEPTH_SIZE:
+ return 1;
+ case GL_FRAMEBUFFER_ATTACHMENT_STENCIL_SIZE:
+ return 1;
+ case GL_FRAMEBUFFER_ATTACHMENT_COMPONENT_TYPE:
+ return 1;
+ case GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_LAYER:
+ return 1;
// -- glGetProgramiv
case GL_DELETE_STATUS:
@@ -443,10 +470,12 @@ int BytesPerElement(int type) {
case GL_FLOAT:
case GL_UNSIGNED_INT_24_8_OES:
case GL_UNSIGNED_INT:
+ case GL_INT:
case GL_UNSIGNED_INT_2_10_10_10_REV:
case GL_UNSIGNED_INT_10F_11F_11F_REV:
case GL_UNSIGNED_INT_5_9_9_9_REV:
return 4;
+ case GL_HALF_FLOAT:
case GL_HALF_FLOAT_OES:
case GL_UNSIGNED_SHORT:
case GL_SHORT:
@@ -702,6 +731,23 @@ size_t GLES2Util::GetGLTypeSizeForTexturesAndBuffers(uint32 type) {
}
}
+size_t GLES2Util::GetGLTypeSizeForPathCoordType(uint32 type) {
+ switch (type) {
+ case GL_BYTE:
+ return sizeof(GLbyte); // NOLINT
+ case GL_UNSIGNED_BYTE:
+ return sizeof(GLubyte); // NOLINT
+ case GL_SHORT:
+ return sizeof(GLshort); // NOLINT
+ case GL_UNSIGNED_SHORT:
+ return sizeof(GLushort); // NOLINT
+ case GL_FLOAT:
+ return sizeof(GLfloat); // NOLINT
+ default:
+ return 0;
+ }
+}
+
uint32 GLES2Util::GLErrorToErrorBit(uint32 error) {
switch (error) {
case GL_INVALID_ENUM:
@@ -780,28 +826,89 @@ size_t GLES2Util::GLTargetToFaceIndex(uint32 target) {
}
}
-uint32 GLES2Util::GetPreferredGLReadPixelsFormat(uint32 internal_format) {
+uint32 GLES2Util::GetGLReadPixelsImplementationFormat(
+ uint32 internal_format) {
switch (internal_format) {
- case GL_RGB16F_EXT:
- case GL_RGB32F_EXT:
+ case GL_R8:
+ case GL_R16F:
+ case GL_R32F:
+ return GL_RED;
+ case GL_R8UI:
+ case GL_R8I:
+ case GL_R16UI:
+ case GL_R16I:
+ case GL_R32UI:
+ case GL_R32I:
+ return GL_RED_INTEGER;
+ case GL_RG8:
+ case GL_RG16F:
+ case GL_RG32F:
+ return GL_RG;
+ case GL_RG8UI:
+ case GL_RG8I:
+ case GL_RG16UI:
+ case GL_RG16I:
+ case GL_RG32UI:
+ case GL_RG32I:
+ return GL_RG_INTEGER;
+ case GL_RGB:
+ case GL_RGB8:
+ case GL_RGB565:
+ case GL_R11F_G11F_B10F:
+ case GL_RGB16F:
+ case GL_RGB32F:
return GL_RGB;
- case GL_RGBA16F_EXT:
- case GL_RGBA32F_EXT:
- return GL_RGBA;
+ case GL_RGBA8UI:
+ case GL_RGBA8I:
+ case GL_RGB10_A2UI:
+ case GL_RGBA16UI:
+ case GL_RGBA16I:
+ case GL_RGBA32UI:
+ case GL_RGBA32I:
+ return GL_RGBA_INTEGER;
default:
return GL_RGBA;
}
}
-uint32 GLES2Util::GetPreferredGLReadPixelsType(
+uint32 GLES2Util::GetGLReadPixelsImplementationType(
uint32 internal_format, uint32 texture_type) {
switch (internal_format) {
- case GL_RGBA32F_EXT:
- case GL_RGB32F_EXT:
+ case GL_R16UI:
+ case GL_RG16UI:
+ case GL_RGBA16UI:
+ case GL_RGB10_A2:
+ case GL_RGB10_A2UI:
+ return GL_UNSIGNED_SHORT;
+ case GL_R32UI:
+ case GL_RG32UI:
+ case GL_RGBA32UI:
+ return GL_UNSIGNED_INT;
+ case GL_R8I:
+ case GL_RG8I:
+ case GL_RGBA8I:
+ return GL_BYTE;
+ case GL_R16I:
+ case GL_RG16I:
+ case GL_RGBA16I:
+ return GL_SHORT;
+ case GL_R32I:
+ case GL_RG32I:
+ case GL_RGBA32I:
+ return GL_INT;
+ case GL_R32F:
+ case GL_RG32F:
+ case GL_RGB32F:
+ case GL_RGBA32F:
+ return GL_FLOAT;
+ case GL_R16F:
+ case GL_RG16F:
+ case GL_R11F_G11F_B10F:
+ case GL_RGB16F:
+ case GL_RGBA16F:
+ // TODO(zmo): Consider return GL_UNSIGNED_INT_10F_11F_11F_REV and
+ // GL_HALF_FLOAT.
return GL_FLOAT;
- case GL_RGBA16F_EXT:
- case GL_RGB16F_EXT:
- return GL_HALF_FLOAT_OES;
case GL_RGBA:
case GL_RGB:
// Unsized internal format, check the type
@@ -809,6 +916,9 @@ uint32 GLES2Util::GetPreferredGLReadPixelsType(
case GL_FLOAT:
case GL_HALF_FLOAT_OES:
return GL_FLOAT;
+ // TODO(zmo): Consider return GL_UNSIGNED_SHORT_5_6_5,
+ // GL_UNSIGNED_SHORT_4_4_4_4, GL_UNSIGNED_SHORT_5_5_5_1, and
+ // GL_UNSIGNED_INT_2_10_10_10_REV.
default:
return GL_UNSIGNED_BYTE;
}
@@ -1057,6 +1167,49 @@ uint32_t GLES2Util::MapBufferTargetToBindingEnum(uint32_t target) {
}
}
+// static
+bool GLES2Util::IsUnsignedIntegerFormat(uint32_t internal_format) {
+ switch (internal_format) {
+ case GL_R8UI:
+ case GL_R16UI:
+ case GL_R32UI:
+ case GL_RG8UI:
+ case GL_RG16UI:
+ case GL_RG32UI:
+ case GL_RGBA8UI:
+ case GL_RGB10_A2UI:
+ case GL_RGBA16UI:
+ case GL_RGBA32UI:
+ return true;
+ default:
+ return false;
+ }
+}
+
+// static
+bool GLES2Util::IsSignedIntegerFormat(uint32_t internal_format) {
+ switch (internal_format) {
+ case GL_R8I:
+ case GL_R16I:
+ case GL_R32I:
+ case GL_RG8I:
+ case GL_RG16I:
+ case GL_RG32I:
+ case GL_RGBA8I:
+ case GL_RGBA16I:
+ case GL_RGBA32I:
+ return true;
+ default:
+ return false;
+ }
+}
+
+// static
+bool GLES2Util::IsIntegerFormat(uint32_t internal_format) {
+ return (IsUnsignedIntegerFormat(internal_format) ||
+ IsSignedIntegerFormat(internal_format));
+}
+
namespace {
@@ -1082,7 +1235,7 @@ const int32 kBufferDestroyed = 0x3095; // EGL_BUFFER_DESTROYED
const int32 kBindGeneratesResource = 0x10000;
const int32 kFailIfMajorPerfCaveat = 0x10001;
const int32 kLoseContextWhenOutOfMemory = 0x10002;
-const int32 kWebGLVersion = 0x10003;
+const int32 kContextType = 0x10003;
} // namespace
@@ -1099,8 +1252,7 @@ ContextCreationAttribHelper::ContextCreationAttribHelper()
bind_generates_resource(true),
fail_if_major_perf_caveat(false),
lose_context_when_out_of_memory(false),
- webgl_version(0) {
-}
+ context_type(CONTEXT_TYPE_OPENGLES2) {}
void ContextCreationAttribHelper::Serialize(std::vector<int32>* attribs) const {
if (alpha_size != -1) {
@@ -1143,8 +1295,8 @@ void ContextCreationAttribHelper::Serialize(std::vector<int32>* attribs) const {
attribs->push_back(fail_if_major_perf_caveat ? 1 : 0);
attribs->push_back(kLoseContextWhenOutOfMemory);
attribs->push_back(lose_context_when_out_of_memory ? 1 : 0);
- attribs->push_back(kWebGLVersion);
- attribs->push_back(webgl_version);
+ attribs->push_back(kContextType);
+ attribs->push_back(context_type);
attribs->push_back(kNone);
}
@@ -1199,8 +1351,8 @@ bool ContextCreationAttribHelper::Parse(const std::vector<int32>& attribs) {
case kLoseContextWhenOutOfMemory:
lose_context_when_out_of_memory = value != 0;
break;
- case kWebGLVersion:
- webgl_version = value;
+ case kContextType:
+ context_type = static_cast<ContextType>(value);
break;
case kNone:
// Terminate list, even if more attributes.
diff --git a/chromium/gpu/command_buffer/common/gles2_cmd_utils.h b/chromium/gpu/command_buffer/common/gles2_cmd_utils.h
index 12b155145f6..b29f96b4fa5 100644
--- a/chromium/gpu/command_buffer/common/gles2_cmd_utils.h
+++ b/chromium/gpu/command_buffer/common/gles2_cmd_utils.h
@@ -127,6 +127,8 @@ class GLES2_UTILS_EXPORT GLES2Util {
static size_t GetGLTypeSizeForTexturesAndBuffers(uint32_t type);
+ static size_t GetGLTypeSizeForPathCoordType(uint32_t type);
+
static uint32_t GLErrorToErrorBit(uint32_t gl_error);
static uint32_t GLErrorBitToGLError(uint32_t error_bit);
@@ -135,9 +137,10 @@ class GLES2_UTILS_EXPORT GLES2Util {
static size_t GLTargetToFaceIndex(uint32_t target);
- static uint32_t GetPreferredGLReadPixelsFormat(uint32_t internal_format);
+ static uint32_t GetGLReadPixelsImplementationFormat(
+ uint32_t internal_format);
- static uint32_t GetPreferredGLReadPixelsType(
+ static uint32_t GetGLReadPixelsImplementationType(
uint32_t internal_format, uint32_t texture_type);
// Returns a bitmask for the channels the given format supports.
@@ -184,6 +187,10 @@ class GLES2_UTILS_EXPORT GLES2Util {
static uint32_t MapBufferTargetToBindingEnum(uint32_t target);
+ static bool IsUnsignedIntegerFormat(uint32_t internal_format);
+ static bool IsSignedIntegerFormat(uint32_t internal_format);
+ static bool IsIntegerFormat(uint32_t internal_format);
+
#include "../common/gles2_cmd_utils_autogen.h"
private:
@@ -197,6 +204,13 @@ class GLES2_UTILS_EXPORT GLES2Util {
int num_shader_binary_formats_;
};
+enum ContextType {
+ CONTEXT_TYPE_WEBGL1,
+ CONTEXT_TYPE_WEBGL2,
+ CONTEXT_TYPE_OPENGLES2,
+ CONTEXT_TYPE_OPENGLES3
+};
+
struct GLES2_UTILS_EXPORT ContextCreationAttribHelper {
ContextCreationAttribHelper();
@@ -216,8 +230,7 @@ struct GLES2_UTILS_EXPORT ContextCreationAttribHelper {
bool bind_generates_resource;
bool fail_if_major_perf_caveat;
bool lose_context_when_out_of_memory;
- // 0 if not a WebGL context.
- unsigned webgl_version;
+ ContextType context_type;
};
} // namespace gles2
diff --git a/chromium/gpu/command_buffer/common/gles2_cmd_utils_autogen.h b/chromium/gpu/command_buffer/common/gles2_cmd_utils_autogen.h
index 6e3d161ffe5..e23d2c40f5c 100644
--- a/chromium/gpu/command_buffer/common/gles2_cmd_utils_autogen.h
+++ b/chromium/gpu/command_buffer/common/gles2_cmd_utils_autogen.h
@@ -16,6 +16,7 @@ static std::string GetStringBackbufferAttachment(uint32_t value);
static std::string GetStringBlitFilter(uint32_t value);
static std::string GetStringBufferMode(uint32_t value);
static std::string GetStringBufferParameter(uint32_t value);
+static std::string GetStringBufferParameter64(uint32_t value);
static std::string GetStringBufferTarget(uint32_t value);
static std::string GetStringBufferUsage(uint32_t value);
static std::string GetStringBufferfi(uint32_t value);
@@ -46,12 +47,17 @@ static std::string GetStringInternalFormatParameter(uint32_t value);
static std::string GetStringInvalidateFrameBufferTarget(uint32_t value);
static std::string GetStringMapBufferAccess(uint32_t value);
static std::string GetStringMatrixMode(uint32_t value);
+static std::string GetStringPathCoordType(uint32_t value);
+static std::string GetStringPathCoverMode(uint32_t value);
+static std::string GetStringPathFillMode(uint32_t value);
+static std::string GetStringPathParameter(uint32_t value);
static std::string GetStringPixelStore(uint32_t value);
static std::string GetStringPixelType(uint32_t value);
static std::string GetStringProgramParameter(uint32_t value);
static std::string GetStringQueryObjectParameter(uint32_t value);
static std::string GetStringQueryParameter(uint32_t value);
static std::string GetStringQueryTarget(uint32_t value);
+static std::string GetStringReadBuffer(uint32_t value);
static std::string GetStringReadPixelFormat(uint32_t value);
static std::string GetStringReadPixelType(uint32_t value);
static std::string GetStringRenderBufferFormat(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 3dd31caeb66..99f7837063b 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
@@ -13,4424 +13,3391 @@
static const GLES2Util::EnumToString enum_to_string_table[] = {
{
- 0x8D77,
- "GL_RGB16UI",
+ 0x8D77, "GL_RGB16UI",
},
{
- 0x8D76,
- "GL_RGBA16UI",
+ 0x8D76, "GL_RGBA16UI",
},
{
- 0x9260,
- "GL_GCCSO_SHADER_BINARY_FJ",
+ 0x9260, "GL_GCCSO_SHADER_BINARY_FJ",
},
{
- 0x9009,
- "GL_TEXTURE_CUBE_MAP_ARRAY_EXT",
+ 0x9009, "GL_TEXTURE_CUBE_MAP_ARRAY_EXT",
},
{
- 0x8D71,
- "GL_RGB32UI",
+ 0x8D71, "GL_RGB32UI",
},
{
- 0x8D70,
- "GL_RGBA32UI",
+ 0x8D70, "GL_RGBA32UI",
},
{
- 0x8C76,
- "GL_TRANSFORM_FEEDBACK_VARYING_MAX_LENGTH",
+ 0x8C76, "GL_TRANSFORM_FEEDBACK_VARYING_MAX_LENGTH",
},
{
- 0x8825,
- "GL_DRAW_BUFFER0_EXT",
+ 0x8825, "GL_DRAW_BUFFER0_EXT",
},
{
- 0x8D94,
- "GL_RED_INTEGER",
+ 0x8D94, "GL_RED_INTEGER",
},
{
- 0x0BC1,
- "GL_ALPHA_TEST_FUNC_QCOM",
+ 0x0BC1, "GL_ALPHA_TEST_FUNC_QCOM",
},
{
- 0x884C,
- "GL_TEXTURE_COMPARE_MODE_EXT",
+ 0x884C, "GL_TEXTURE_COMPARE_MODE_EXT",
},
{
- 0x0BC2,
- "GL_ALPHA_TEST_REF_QCOM",
+ 0x0BC2, "GL_ALPHA_TEST_REF_QCOM",
},
{
- 0x78EF,
- "GL_PIXEL_UNPACK_TRANSFER_BUFFER_BINDING_CHROMIUM",
+ 0x78EF, "GL_PIXEL_UNPACK_TRANSFER_BUFFER_BINDING_CHROMIUM",
},
{
- 0x884D,
- "GL_TEXTURE_COMPARE_FUNC_EXT",
+ 0x884D, "GL_TEXTURE_COMPARE_FUNC_EXT",
},
{
- 0x884E,
- "GL_COMPARE_REF_TO_TEXTURE_EXT",
+ 0x884E, "GL_COMPARE_REF_TO_TEXTURE_EXT",
},
{
- 0x8E76,
- "GL_TESS_GEN_MODE_EXT",
+ 0x8E76, "GL_TESS_GEN_MODE_EXT",
},
{
- 0x8E77,
- "GL_TESS_GEN_SPACING_EXT",
+ 0x8E77, "GL_TESS_GEN_SPACING_EXT",
},
{
- 0x000D,
- "GL_TRIANGLE_STRIP_ADJACENCY_EXT",
+ 0x000D, "GL_TRIANGLE_STRIP_ADJACENCY_EXT",
},
{
- 0x000E,
- "GL_PATCHES_EXT",
+ 0x000E, "GL_PATCHES_EXT",
},
{
- 0x000B,
- "GL_LINE_STRIP_ADJACENCY_EXT",
+ 0x000B, "GL_LINE_STRIP_ADJACENCY_EXT",
},
{
- 0x000C,
- "GL_TRIANGLES_ADJACENCY_EXT",
+ 0x000C, "GL_TRIANGLES_ADJACENCY_EXT",
},
{
- 0x000A,
- "GL_LINES_ADJACENCY_EXT",
+ 0x000A, "GL_LINES_ADJACENCY_EXT",
},
{
- 0x92CF,
- "GL_MAX_GEOMETRY_ATOMIC_COUNTER_BUFFERS_EXT",
+ 0x92CF, "GL_MAX_GEOMETRY_ATOMIC_COUNTER_BUFFERS_EXT",
},
{
- 0x93A1,
- "GL_BGRA8_EXT",
+ 0x93A1, "GL_BGRA8_EXT",
},
{
- 0x813C,
- "GL_TEXTURE_BASE_LEVEL",
+ 0x813C, "GL_TEXTURE_BASE_LEVEL",
},
{
- 0,
- "GL_FALSE",
+ 0, "GL_FALSE",
},
{
- 0x00400000,
- "GL_STENCIL_BUFFER_BIT6_QCOM",
+ 0x00400000, "GL_STENCIL_BUFFER_BIT6_QCOM",
},
{
- 64,
- "GL_MAILBOX_SIZE_CHROMIUM",
+ 64, "GL_MAILBOX_SIZE_CHROMIUM",
},
{
- 0x9500,
- "GL_PERFQUERY_GPA_EXTENDED_COUNTERS_INTEL",
+ 0x9500, "GL_PERFQUERY_GPA_EXTENDED_COUNTERS_INTEL",
},
{
- 0x78F2,
- "GL_SCANOUT_CHROMIUM",
+ 0x78F2, "GL_SCANOUT_CHROMIUM",
},
{
- 0x9138,
- "GL_COMPRESSED_RGBA_PVRTC_4BPPV2_IMG",
+ 0x9138, "GL_COMPRESSED_RGBA_PVRTC_4BPPV2_IMG",
},
{
- 0x8FC4,
- "GL_SHADER_BINARY_VIV",
+ 0x8FC4, "GL_SHADER_BINARY_VIV",
},
{
- 0x9130,
- "GL_SGX_PROGRAM_BINARY_IMG",
+ 0x90A7, "GL_MITER_REVERT_CHROMIUM",
},
{
- 0x9133,
- "GL_RENDERBUFFER_SAMPLES_IMG",
+ 0x9130, "GL_SGX_PROGRAM_BINARY_IMG",
},
{
- 0x82E0,
- "GL_BUFFER_KHR",
+ 0x9133, "GL_RENDERBUFFER_SAMPLES_IMG",
},
{
- 0x9135,
- "GL_MAX_SAMPLES_IMG",
+ 0x82E0, "GL_BUFFER_KHR",
},
{
- 0x9134,
- "GL_FRAMEBUFFER_INCOMPLETE_MULTISAMPLE_IMG",
+ 0x9135, "GL_MAX_SAMPLES_IMG",
},
{
- 0x9137,
- "GL_COMPRESSED_RGBA_PVRTC_2BPPV2_IMG",
+ 0x9134, "GL_FRAMEBUFFER_INCOMPLETE_MULTISAMPLE_IMG",
},
{
- 0x9136,
- "GL_TEXTURE_SAMPLES_IMG",
+ 0x9137, "GL_COMPRESSED_RGBA_PVRTC_2BPPV2_IMG",
},
{
- 0x8D88,
- "GL_RGBA16I",
+ 0x9136, "GL_TEXTURE_SAMPLES_IMG",
},
{
- 0x8D89,
- "GL_RGB16I",
+ 0x8D88, "GL_RGBA16I",
},
{
- 0x00000020,
- "GL_COLOR_BUFFER_BIT5_QCOM",
+ 0x8D89, "GL_RGB16I",
},
{
- 0x0008,
- "GL_MAP_INVALIDATE_BUFFER_BIT_EXT",
+ 0x00000020, "GL_COLOR_BUFFER_BIT5_QCOM",
},
{
- 0x0BC0,
- "GL_ALPHA_TEST_QCOM",
+ 0x0008, "GL_MAP_INVALIDATE_BUFFER_BIT_EXT",
},
{
- 0x0006,
- "GL_TRIANGLE_FAN",
+ 0x0BC0, "GL_ALPHA_TEST_QCOM",
},
{
- 0x0007,
- "GL_QUADS_EXT",
+ 0x0006, "GL_TRIANGLE_FAN",
},
{
- 0x0004,
- "GL_TRIANGLES",
+ 0x0007, "GL_QUADS_EXT",
},
{
- 0x0005,
- "GL_TRIANGLE_STRIP",
+ 0x0004, "GL_TRIANGLES",
},
{
- 0x0002,
- "GL_LINE_LOOP",
+ 0x0005, "GL_TRIANGLE_STRIP",
},
{
- 0x0003,
- "GL_LINE_STRIP",
+ 0x0002, "GL_LINE_LOOP",
},
{
- 0x0000,
- "GL_POINTS",
+ 0x0003, "GL_LINE_STRIP",
},
{
- 0x0001,
- "GL_LINES",
+ 0x0000, "GL_POINTS",
},
{
- 0x8D7D,
- "GL_RGB8UI",
+ 0x0001, "GL_LINES",
},
{
- 0x93F0,
- "GL_COMPRESSED_SRGB_ALPHA_PVRTC_2BPPV2_IMG",
+ 0x8D7D, "GL_RGB8UI",
},
{
- 0x93F1,
- "GL_COMPRESSED_SRGB_ALPHA_PVRTC_4BPPV2_IMG",
+ 0x93F0, "GL_COMPRESSED_SRGB_ALPHA_PVRTC_2BPPV2_IMG",
},
{
- 0x0D04,
- "GL_PACK_SKIP_PIXELS",
+ 0x93F1, "GL_COMPRESSED_SRGB_ALPHA_PVRTC_4BPPV2_IMG",
},
{
- 0x900E,
- "GL_INT_SAMPLER_CUBE_MAP_ARRAY_EXT",
+ 0x0D04, "GL_PACK_SKIP_PIXELS",
},
{
- 0x900D,
- "GL_SAMPLER_CUBE_MAP_ARRAY_SHADOW_EXT",
+ 0x900E, "GL_INT_SAMPLER_CUBE_MAP_ARRAY_EXT",
},
{
- 0x8C7F,
- "GL_TRANSFORM_FEEDBACK_BUFFER_MODE",
+ 0x900D, "GL_SAMPLER_CUBE_MAP_ARRAY_SHADOW_EXT",
},
{
- 0x900F,
- "GL_UNSIGNED_INT_SAMPLER_CUBE_MAP_ARRAY_EXT",
+ 0x8C7F, "GL_TRANSFORM_FEEDBACK_BUFFER_MODE",
},
{
- 0x900A,
- "GL_TEXTURE_BINDING_CUBE_MAP_ARRAY_EXT",
+ 0x900F, "GL_UNSIGNED_INT_SAMPLER_CUBE_MAP_ARRAY_EXT",
},
{
- 0x900C,
- "GL_SAMPLER_CUBE_MAP_ARRAY_EXT",
+ 0x900A, "GL_TEXTURE_BINDING_CUBE_MAP_ARRAY_EXT",
},
{
- 0x8213,
- "GL_FRAMEBUFFER_ATTACHMENT_GREEN_SIZE",
+ 0x900C, "GL_SAMPLER_CUBE_MAP_ARRAY_EXT",
},
{
- 0x88B9,
- "GL_WRITE_ONLY_OES",
+ 0x8213, "GL_FRAMEBUFFER_ATTACHMENT_GREEN_SIZE",
},
{
- 0x8211,
- "GL_FRAMEBUFFER_ATTACHMENT_COMPONENT_TYPE_EXT",
+ 0x88B9, "GL_WRITE_ONLY_OES",
},
{
- 0x8210,
- "GL_FRAMEBUFFER_ATTACHMENT_COLOR_ENCODING_EXT",
+ 0x8211, "GL_FRAMEBUFFER_ATTACHMENT_COMPONENT_TYPE_EXT",
},
{
- 0x8741,
- "GL_PROGRAM_BINARY_LENGTH_OES",
+ 0x8210, "GL_FRAMEBUFFER_ATTACHMENT_COLOR_ENCODING_EXT",
},
{
- 0x8740,
- "GL_Z400_BINARY_AMD",
+ 0x8741, "GL_PROGRAM_BINARY_LENGTH_OES",
},
{
- 0x8215,
- "GL_FRAMEBUFFER_ATTACHMENT_ALPHA_SIZE",
+ 0x8740, "GL_Z400_BINARY_AMD",
},
{
- 0x8C4D,
- "GL_COMPRESSED_SRGB_ALPHA_S3TC_DXT1_NV",
+ 0x8215, "GL_FRAMEBUFFER_ATTACHMENT_ALPHA_SIZE",
},
{
- 0x8192,
- "GL_GENERATE_MIPMAP_HINT",
+ 0x8C4D, "GL_COMPRESSED_SRGB_ALPHA_S3TC_DXT1_NV",
},
{
- 0x8E79,
- "GL_TESS_GEN_POINT_MODE_EXT",
+ 0x8192, "GL_GENERATE_MIPMAP_HINT",
},
{
- 0x8A54,
- "GL_COMPRESSED_SRGB_PVRTC_2BPPV1_EXT",
+ 0x8E79, "GL_TESS_GEN_POINT_MODE_EXT",
},
{
- 0x8A55,
- "GL_COMPRESSED_SRGB_PVRTC_4BPPV1_EXT",
+ 0x8A54, "GL_COMPRESSED_SRGB_PVRTC_2BPPV1_EXT",
},
{
- 0x8A56,
- "GL_COMPRESSED_SRGB_ALPHA_PVRTC_2BPPV1_EXT",
+ 0x8A55, "GL_COMPRESSED_SRGB_PVRTC_4BPPV1_EXT",
},
{
- 0x8A57,
- "GL_COMPRESSED_SRGB_ALPHA_PVRTC_4BPPV1_EXT",
+ 0x8A56, "GL_COMPRESSED_SRGB_ALPHA_PVRTC_2BPPV1_EXT",
},
{
- 0x8A51,
- "GL_RGB_RAW_422_APPLE",
+ 0x8A57, "GL_COMPRESSED_SRGB_ALPHA_PVRTC_4BPPV1_EXT",
},
{
- 0x87F9,
- "GL_3DC_X_AMD",
+ 0x8A51, "GL_RGB_RAW_422_APPLE",
},
{
- 0x8A53,
- "GL_SYNC_OBJECT_APPLE",
+ 0x87F9, "GL_3DC_X_AMD",
},
{
- 0x8DF8,
- "GL_SHADER_BINARY_FORMATS",
+ 0x8A53, "GL_SYNC_OBJECT_APPLE",
},
{
- 0x8DF9,
- "GL_NUM_SHADER_BINARY_FORMATS",
+ 0x78FB, "GL_RGB_YCBCR_422_CHROMIUM",
},
{
- 0x826D,
- "GL_DEBUG_GROUP_STACK_DEPTH_KHR",
+ 0x8DF8, "GL_SHADER_BINARY_FORMATS",
},
{
- 0x8E75,
- "GL_TESS_CONTROL_OUTPUT_VERTICES_EXT",
+ 0x8DF9, "GL_NUM_SHADER_BINARY_FORMATS",
},
{
- 0x826B,
- "GL_DEBUG_SEVERITY_NOTIFICATION_KHR",
+ 0x826D, "GL_DEBUG_GROUP_STACK_DEPTH_KHR",
},
{
- 0x826C,
- "GL_MAX_DEBUG_GROUP_STACK_DEPTH_KHR",
+ 0x8E75, "GL_TESS_CONTROL_OUTPUT_VERTICES_EXT",
},
{
- 0x8B59,
- "GL_BOOL_VEC4",
+ 0x826B, "GL_DEBUG_SEVERITY_NOTIFICATION_KHR",
},
{
- 0x826A,
- "GL_DEBUG_TYPE_POP_GROUP_KHR",
+ 0x826C, "GL_MAX_DEBUG_GROUP_STACK_DEPTH_KHR",
},
{
- 0x8B57,
- "GL_BOOL_VEC2",
+ 0x8B59, "GL_BOOL_VEC4",
},
{
- 0x8DF1,
- "GL_MEDIUM_FLOAT",
+ 0x826A, "GL_DEBUG_TYPE_POP_GROUP_KHR",
},
{
- 0x8B55,
- "GL_INT_VEC4",
+ 0x8B57, "GL_BOOL_VEC2",
},
{
- 0x8B54,
- "GL_INT_VEC3",
+ 0x8DF1, "GL_MEDIUM_FLOAT",
},
{
- 0x8DF4,
- "GL_MEDIUM_INT",
+ 0x8B55, "GL_INT_VEC4",
},
{
- 0x8DF5,
- "GL_HIGH_INT",
+ 0x8B54, "GL_INT_VEC3",
},
{
- 0x8B51,
- "GL_FLOAT_VEC3",
+ 0x8DF4, "GL_MEDIUM_INT",
},
{
- 0x8B50,
- "GL_FLOAT_VEC2",
+ 0x8DF5, "GL_HIGH_INT",
},
{
- 0x806D,
- "GL_UNPACK_SKIP_IMAGES",
+ 0x8B51, "GL_FLOAT_VEC3",
},
{
- 0x806E,
- "GL_UNPACK_IMAGE_HEIGHT",
+ 0x8B50, "GL_FLOAT_VEC2",
},
{
- 0x806F,
- "GL_TEXTURE_3D_OES",
+ 0x806D, "GL_UNPACK_SKIP_IMAGES",
},
{
- 0x92E7,
- "GL_IS_PER_PATCH_EXT",
+ 0x806E, "GL_UNPACK_IMAGE_HEIGHT",
},
{
- 0x92E0,
- "GL_DEBUG_OUTPUT_KHR",
+ 0x806F, "GL_TEXTURE_3D_OES",
},
{
- 0x806A,
- "GL_TEXTURE_BINDING_3D_OES",
+ 0x92E7, "GL_IS_PER_PATCH_EXT",
},
{
- 0x8D8E,
- "GL_RGBA8I",
+ 0x92E0, "GL_DEBUG_OUTPUT_KHR",
},
{
- 0x8CE3,
- "GL_COLOR_ATTACHMENT3_EXT",
+ 0x806A, "GL_TEXTURE_BINDING_3D_OES",
},
{
- 0x9274,
- "GL_COMPRESSED_RGB8_ETC2",
+ 0x8D8E, "GL_RGBA8I",
},
{
- 0x1904,
- "GL_GREEN_NV",
+ 0x8CE3, "GL_COLOR_ATTACHMENT3_EXT",
},
{
- 0x928D,
- "GL_DST_OUT_NV",
+ 0x9274, "GL_COMPRESSED_RGB8_ETC2",
},
{
- 0x8069,
- "GL_TEXTURE_BINDING_2D",
+ 0x1904, "GL_GREEN_NV",
},
{
- 0x8A2E,
- "GL_MAX_COMBINED_UNIFORM_BLOCKS",
+ 0x928D, "GL_DST_OUT_NV",
},
{
- 0x8F96,
- "GL_RGB8_SNORM",
+ 0x8069, "GL_TEXTURE_BINDING_2D",
},
{
- 0x8260,
- "GL_UNDEFINED_VERTEX_EXT",
+ 0x8A2E, "GL_MAX_COMBINED_UNIFORM_BLOCKS",
},
{
- 0x8261,
- "GL_NO_RESET_NOTIFICATION_KHR",
+ 0x8F96, "GL_RGB8_SNORM",
},
{
- 0x0D02,
- "GL_PACK_ROW_LENGTH",
+ 0x8260, "GL_UNDEFINED_VERTEX_EXT",
},
{
- 0x8DFA,
- "GL_SHADER_COMPILER",
+ 0x8261, "GL_NO_RESET_NOTIFICATION_KHR",
},
{
- 0x8DFB,
- "GL_MAX_VERTEX_UNIFORM_VECTORS",
+ 0x0D02, "GL_PACK_ROW_LENGTH",
},
{
- 0x8DFC,
- "GL_MAX_VARYING_VECTORS",
+ 0x8DFA, "GL_SHADER_COMPILER",
},
{
- 0x8B5C,
- "GL_FLOAT_MAT4",
+ 0x8DFB, "GL_MAX_VERTEX_UNIFORM_VECTORS",
},
{
- 0x8B5B,
- "GL_FLOAT_MAT3",
+ 0x8DFC, "GL_MAX_VARYING_VECTORS",
},
{
- 0x8268,
- "GL_DEBUG_TYPE_MARKER_KHR",
+ 0x8B5C, "GL_FLOAT_MAT4",
},
{
- 0x8269,
- "GL_DEBUG_TYPE_PUSH_GROUP_KHR",
+ 0x8B5B, "GL_FLOAT_MAT3",
},
{
- 0x1905,
- "GL_BLUE_NV",
+ 0x8268, "GL_DEBUG_TYPE_MARKER_KHR",
},
{
- 0x87FF,
- "GL_PROGRAM_BINARY_FORMATS_OES",
+ 0x8269, "GL_DEBUG_TYPE_PUSH_GROUP_KHR",
},
{
- 0x87FE,
- "GL_NUM_PROGRAM_BINARY_FORMATS_OES",
+ 0x1905, "GL_BLUE_NV",
},
{
- 0x8A41,
- "GL_UNIFORM_BLOCK_NAME_LENGTH",
+ 0x87FF, "GL_PROGRAM_BINARY_FORMATS_OES",
},
{
- 0x2600,
- "GL_NEAREST",
+ 0x87FE, "GL_NUM_PROGRAM_BINARY_FORMATS_OES",
},
{
- 0x2601,
- "GL_LINEAR",
+ 0x8A41, "GL_UNIFORM_BLOCK_NAME_LENGTH",
},
{
- 0x8C03,
- "GL_COMPRESSED_RGBA_PVRTC_2BPPV1_IMG",
+ 0x2600, "GL_NEAREST",
},
{
- 0x821B,
- "GL_MAJOR_VERSION",
+ 0x2601, "GL_LINEAR",
},
{
- 0x821A,
- "GL_DEPTH_STENCIL_ATTACHMENT",
+ 0x8C03, "GL_COMPRESSED_RGBA_PVRTC_2BPPV1_IMG",
},
{
- 0x8A40,
- "GL_UNIFORM_BLOCK_DATA_SIZE",
+ 0x821B, "GL_MAJOR_VERSION",
},
{
- 0x821D,
- "GL_NUM_EXTENSIONS",
+ 0x821A, "GL_DEPTH_STENCIL_ATTACHMENT",
},
{
- 0x88BB,
- "GL_BUFFER_ACCESS_OES",
+ 0x8A40, "GL_UNIFORM_BLOCK_DATA_SIZE",
},
{
- 0x88BC,
- "GL_BUFFER_MAPPED_OES",
+ 0x821D, "GL_NUM_EXTENSIONS",
},
{
- 0x88BD,
- "GL_BUFFER_MAP_POINTER_OES",
+ 0x88BB, "GL_BUFFER_ACCESS_OES",
},
{
- 0x88BF,
- "GL_TIME_ELAPSED_EXT",
+ 0x88BC, "GL_BUFFER_MAPPED_OES",
},
{
- 0x8A46,
- "GL_UNIFORM_BLOCK_REFERENCED_BY_FRAGMENT_SHADER",
+ 0x88BD, "GL_BUFFER_MAP_POINTER_OES",
},
{
- 0x6003,
- "GL_GET_ERROR_QUERY_CHROMIUM",
+ 0x88BF, "GL_TIME_ELAPSED_EXT",
},
{
- 0x8F94,
- "GL_R8_SNORM",
+ 0x8A46, "GL_UNIFORM_BLOCK_REFERENCED_BY_FRAGMENT_SHADER",
},
{
- 0x0C10,
- "GL_SCISSOR_BOX",
+ 0x6003, "GL_GET_ERROR_QUERY_CHROMIUM",
},
{
- 0x0C11,
- "GL_SCISSOR_TEST",
+ 0x8F94, "GL_R8_SNORM",
},
{
- 0x1700,
- "GL_PATH_MODELVIEW_CHROMIUM",
+ 0x0C10, "GL_SCISSOR_BOX",
},
{
- 0x80000000,
- "GL_MULTISAMPLE_BUFFER_BIT7_QCOM",
+ 0x0C11, "GL_SCISSOR_TEST",
},
{
- 0x94F8,
- "GL_PERFQUERY_COUNTER_DATA_UINT32_INTEL",
+ 0x1700, "GL_PATH_MODELVIEW_CHROMIUM",
},
{
- 0x8A48,
- "GL_TEXTURE_SRGB_DECODE_EXT",
+ 0x80000000, "GL_MULTISAMPLE_BUFFER_BIT7_QCOM",
},
{
- 0x300E,
- "GL_CONTEXT_LOST",
+ 0x94F8, "GL_PERFQUERY_COUNTER_DATA_UINT32_INTEL",
},
{
- 0x02000000,
- "GL_MULTISAMPLE_BUFFER_BIT1_QCOM",
+ 0x90a4, "GL_ROUND_CHROMIUM",
},
{
- 0x8C2F,
- "GL_ANY_SAMPLES_PASSED_EXT",
+ 0x8A48, "GL_TEXTURE_SRGB_DECODE_EXT",
},
{
- 0x8BD2,
- "GL_TEXTURE_WIDTH_QCOM",
+ 0x300E, "GL_CONTEXT_LOST",
},
{
- 0x8C2D,
- "GL_TEXTURE_BUFFER_DATA_STORE_BINDING_EXT",
+ 0x90a3, "GL_SQUARE_CHROMIUM",
},
{
- 0x8C2C,
- "GL_TEXTURE_BINDING_BUFFER_EXT",
+ 0x02000000, "GL_MULTISAMPLE_BUFFER_BIT1_QCOM",
},
{
- 0x8C2B,
- "GL_MAX_TEXTURE_BUFFER_SIZE_EXT",
+ 0x8C2F, "GL_ANY_SAMPLES_PASSED_EXT",
},
{
- 0x8C2A,
- "GL_TEXTURE_BUFFER_EXT",
+ 0x8BD2, "GL_TEXTURE_WIDTH_QCOM",
},
{
- 0x8BD7,
- "GL_TEXTURE_TYPE_QCOM",
+ 0x8C2D, "GL_TEXTURE_BUFFER_DATA_STORE_BINDING_EXT",
},
{
- 0x8B8D,
- "GL_CURRENT_PROGRAM",
+ 0x8C2C, "GL_TEXTURE_BINDING_BUFFER_EXT",
},
{
- 0x8BD9,
- "GL_TEXTURE_NUM_LEVELS_QCOM",
+ 0x8C2B, "GL_MAX_TEXTURE_BUFFER_SIZE_EXT",
},
{
- 0x00200000,
- "GL_STENCIL_BUFFER_BIT5_QCOM",
+ 0x8C2A, "GL_TEXTURE_BUFFER_EXT",
},
{
- 0x8D9F,
- "GL_INT_2_10_10_10_REV",
+ 0x8BD7, "GL_TEXTURE_TYPE_QCOM",
},
{
- 0x8B8A,
- "GL_ACTIVE_ATTRIBUTE_MAX_LENGTH",
+ 0x8B8D, "GL_CURRENT_PROGRAM",
},
{
- 0x8B8B,
- "GL_FRAGMENT_SHADER_DERIVATIVE_HINT_OES",
+ 0x8BD9, "GL_TEXTURE_NUM_LEVELS_QCOM",
},
{
- 0x8B8C,
- "GL_SHADING_LANGUAGE_VERSION",
+ 0x00200000, "GL_STENCIL_BUFFER_BIT5_QCOM",
},
{
- 0x8BDA,
- "GL_TEXTURE_TARGET_QCOM",
+ 0x8D9F, "GL_INT_2_10_10_10_REV",
},
{
- 0x8BDB,
- "GL_TEXTURE_OBJECT_VALID_QCOM",
+ 0x8B8A, "GL_ACTIVE_ATTRIBUTE_MAX_LENGTH",
},
{
- 0x8BDC,
- "GL_STATE_RESTORE",
+ 0x8B8B, "GL_FRAGMENT_SHADER_DERIVATIVE_HINT_OES",
},
{
- 0x8B88,
- "GL_SHADER_SOURCE_LENGTH",
+ 0x8B8C, "GL_SHADING_LANGUAGE_VERSION",
},
{
- 0x8B89,
- "GL_ACTIVE_ATTRIBUTES",
+ 0x8BDA, "GL_TEXTURE_TARGET_QCOM",
},
{
- 0x93C9,
- "GL_COMPRESSED_RGBA_ASTC_6x6x6_OES",
+ 0x8BDB, "GL_TEXTURE_OBJECT_VALID_QCOM",
},
{
- 0x93C8,
- "GL_COMPRESSED_RGBA_ASTC_6x6x5_OES",
+ 0x8BDC, "GL_STATE_RESTORE",
},
{
- 0x8B84,
- "GL_INFO_LOG_LENGTH",
+ 0x8B88, "GL_SHADER_SOURCE_LENGTH",
},
{
- 0x8B85,
- "GL_ATTACHED_SHADERS",
+ 0x8B89, "GL_ACTIVE_ATTRIBUTES",
},
{
- 0x8B86,
- "GL_ACTIVE_UNIFORMS",
+ 0x93C9, "GL_COMPRESSED_RGBA_ASTC_6x6x6_OES",
},
{
- 0x8B87,
- "GL_ACTIVE_UNIFORM_MAX_LENGTH",
+ 0x93C8, "GL_COMPRESSED_RGBA_ASTC_6x6x5_OES",
},
{
- 0x8B80,
- "GL_DELETE_STATUS",
+ 0x8B84, "GL_INFO_LOG_LENGTH",
},
{
- 0x8B81,
- "GL_COMPILE_STATUS",
+ 0x8B85, "GL_ATTACHED_SHADERS",
},
{
- 0x8B82,
- "GL_LINK_STATUS",
+ 0x8B86, "GL_ACTIVE_UNIFORMS",
},
{
- 0x8B83,
- "GL_VALIDATE_STATUS",
+ 0x8B87, "GL_ACTIVE_UNIFORM_MAX_LENGTH",
},
{
- 0x9380,
- "GL_NUM_SAMPLE_COUNTS",
+ 0x8B80, "GL_DELETE_STATUS",
},
{
- 0x8D48,
- "GL_STENCIL_INDEX8",
+ 0x8B81, "GL_COMPILE_STATUS",
},
{
- 0x8D46,
- "GL_STENCIL_INDEX1_OES",
+ 0x8B82, "GL_LINK_STATUS",
},
{
- 0x8D47,
- "GL_STENCIL_INDEX4_OES",
+ 0x8B83, "GL_VALIDATE_STATUS",
},
{
- 0x8D44,
- "GL_RENDERBUFFER_INTERNAL_FORMAT",
+ 0x9380, "GL_NUM_SAMPLE_COUNTS",
},
{
- 0x00000100,
- "GL_DEPTH_BUFFER_BIT",
+ 0x8D48, "GL_STENCIL_INDEX8",
},
{
- 0x8D42,
- "GL_RENDERBUFFER_WIDTH",
+ 0x8D46, "GL_STENCIL_INDEX1_OES",
},
{
- 0x8D43,
- "GL_RENDERBUFFER_HEIGHT",
+ 0x8D47, "GL_STENCIL_INDEX4_OES",
},
{
- 0x8D40,
- "GL_FRAMEBUFFER",
+ 0x8D44, "GL_RENDERBUFFER_INTERNAL_FORMAT",
},
{
- 0x8D41,
- "GL_RENDERBUFFER",
+ 0x00000100, "GL_DEPTH_BUFFER_BIT",
},
{
- 0x8A3A,
- "GL_UNIFORM_BLOCK_INDEX",
+ 0x8D42, "GL_RENDERBUFFER_WIDTH",
},
{
- 0x88B8,
- "GL_READ_ONLY",
+ 0x8D43, "GL_RENDERBUFFER_HEIGHT",
},
{
- 0x0BD0,
- "GL_DITHER",
+ 0x8D40, "GL_FRAMEBUFFER",
},
{
- 0x93D3,
- "GL_COMPRESSED_SRGB8_ALPHA8_ASTC_6x5_KHR",
+ 0x8D41, "GL_RENDERBUFFER",
},
{
- 0x9144,
- "GL_MAX_DEBUG_LOGGED_MESSAGES_KHR",
+ 0x90B7, "GL_PATH_STENCIL_FUNC_CHROMIUM",
},
{
- 0x1801,
- "GL_DEPTH_EXT",
+ 0x8A3A, "GL_UNIFORM_BLOCK_INDEX",
},
{
- 0x1800,
- "GL_COLOR_EXT",
+ 0x88B8, "GL_READ_ONLY",
},
{
- 0x1802,
- "GL_STENCIL_EXT",
+ 0x0BD0, "GL_DITHER",
},
{
- 0x9288,
- "GL_SRC_OVER_NV",
+ 0x90B9, "GL_PATH_STENCIL_VALUE_MASK_CHROMIUM",
},
{
- 0x9120,
- "GL_BUFFER_MAP_LENGTH",
+ 0x90B8, "GL_PATH_STENCIL_REF_CHROMIUM",
},
{
- 0x0B21,
- "GL_LINE_WIDTH",
+ 0x93D3, "GL_COMPRESSED_SRGB8_ALPHA8_ASTC_6x5_KHR",
},
{
- 0x9308,
- "GL_REFERENCED_BY_TESS_EVALUATION_SHADER_EXT",
+ 0x1D00, "GL_FLAT_CHROMIUM",
},
{
- 0x81A5,
- "GL_DEPTH_COMPONENT16",
+ 0x9144, "GL_MAX_DEBUG_LOGGED_MESSAGES_KHR",
},
{
- 0x81A6,
- "GL_DEPTH_COMPONENT24_OES",
+ 0x1801, "GL_DEPTH_EXT",
},
{
- 0x81A7,
- "GL_DEPTH_COMPONENT32_OES",
+ 0x1800, "GL_COLOR_EXT",
},
{
- 0x88FD,
- "GL_VERTEX_ATTRIB_ARRAY_INTEGER",
+ 0x1802, "GL_STENCIL_EXT",
},
{
- 0x88FE,
- "GL_VERTEX_ATTRIB_ARRAY_DIVISOR_ANGLE",
+ 0x9288, "GL_SRC_OVER_NV",
},
{
- 0x88FF,
- "GL_MAX_ARRAY_TEXTURE_LAYERS",
+ 0x9120, "GL_BUFFER_MAP_LENGTH",
},
{
- 0x8B6A,
- "GL_FLOAT_MAT4x3_NV",
+ 0x0B21, "GL_LINE_WIDTH",
},
{
- 0x93D0,
- "GL_COMPRESSED_SRGB8_ALPHA8_ASTC_4x4_KHR",
+ 0x9308, "GL_REFERENCED_BY_TESS_EVALUATION_SHADER_EXT",
},
{
- 0x9143,
- "GL_MAX_DEBUG_MESSAGE_LENGTH_KHR",
+ 0x81A5, "GL_DEPTH_COMPONENT16",
},
{
- 0x8DFD,
- "GL_MAX_FRAGMENT_UNIFORM_VECTORS",
+ 0x81A6, "GL_DEPTH_COMPONENT24_OES",
},
{
- 0x9145,
- "GL_DEBUG_LOGGED_MESSAGES_KHR",
+ 0x81A7, "GL_DEPTH_COMPONENT32_OES",
},
{
- 0x9146,
- "GL_DEBUG_SEVERITY_HIGH_KHR",
+ 0x88FD, "GL_VERTEX_ATTRIB_ARRAY_INTEGER",
},
{
- 0x9147,
- "GL_DEBUG_SEVERITY_MEDIUM_KHR",
+ 0x88FE, "GL_VERTEX_ATTRIB_ARRAY_DIVISOR_ANGLE",
},
{
- 0x9148,
- "GL_DEBUG_SEVERITY_LOW_KHR",
+ 0x88FF, "GL_MAX_ARRAY_TEXTURE_LAYERS",
},
{
- 0x8F63,
- "GL_MAX_SHADER_PIXEL_LOCAL_STORAGE_FAST_SIZE_EXT",
+ 0x8B6A, "GL_FLOAT_MAT4x3_NV",
},
{
- 0x8F60,
- "GL_MALI_SHADER_BINARY_ARM",
+ 0x93D0, "GL_COMPRESSED_SRGB8_ALPHA8_ASTC_4x4_KHR",
},
{
- 0x8F61,
- "GL_MALI_PROGRAM_BINARY_ARM",
+ 0x9143, "GL_MAX_DEBUG_MESSAGE_LENGTH_KHR",
},
{
- 0x8F66,
- "GL_FRAGMENT_SHADER_FRAMEBUFFER_FETCH_MRT_ARM",
+ 0x8DFD, "GL_MAX_FRAGMENT_UNIFORM_VECTORS",
},
{
- 0x8F67,
- "GL_MAX_SHADER_PIXEL_LOCAL_STORAGE_SIZE_EXT",
+ 0x9145, "GL_DEBUG_LOGGED_MESSAGES_KHR",
},
{
- 0x8F64,
- "GL_SHADER_PIXEL_LOCAL_STORAGE_EXT",
+ 0x9146, "GL_DEBUG_SEVERITY_HIGH_KHR",
},
{
- 0x8F65,
- "GL_FETCH_PER_SAMPLE_ARM",
+ 0x9147, "GL_DEBUG_SEVERITY_MEDIUM_KHR",
},
{
- 0x92D3,
- "GL_MAX_TESS_CONTROL_ATOMIC_COUNTERS_EXT",
+ 0x9148, "GL_DEBUG_SEVERITY_LOW_KHR",
},
{
- 0x87EE,
- "GL_ATC_RGBA_INTERPOLATED_ALPHA_AMD",
+ 0x8F63, "GL_MAX_SHADER_PIXEL_LOCAL_STORAGE_FAST_SIZE_EXT",
},
{
- 0x822B,
- "GL_RG8_EXT",
+ 0x8F60, "GL_MALI_SHADER_BINARY_ARM",
},
{
- 0x822F,
- "GL_RG16F_EXT",
+ 0x8F61, "GL_MALI_PROGRAM_BINARY_ARM",
},
{
- 0x822D,
- "GL_R16F_EXT",
+ 0x8F66, "GL_FRAGMENT_SHADER_FRAMEBUFFER_FETCH_MRT_ARM",
},
{
- 0x822E,
- "GL_R32F_EXT",
+ 0x8F67, "GL_MAX_SHADER_PIXEL_LOCAL_STORAGE_SIZE_EXT",
},
{
- 1,
- "GL_ES_VERSION_2_0",
+ 0x8F64, "GL_SHADER_PIXEL_LOCAL_STORAGE_EXT",
},
{
- 0x84F9,
- "GL_DEPTH_STENCIL_OES",
+ 0x8F65, "GL_FETCH_PER_SAMPLE_ARM",
},
{
- 0x82DB,
- "GL_TEXTURE_VIEW_MIN_LEVEL_EXT",
+ 0x92D3, "GL_MAX_TESS_CONTROL_ATOMIC_COUNTERS_EXT",
},
{
- 0x8368,
- "GL_UNSIGNED_INT_2_10_10_10_REV_EXT",
+ 0x87EE, "GL_ATC_RGBA_INTERPOLATED_ALPHA_AMD",
},
{
- 0x8819,
- "GL_LUMINANCE_ALPHA32F_EXT",
+ 0x822B, "GL_RG8_EXT",
},
{
- 0x8818,
- "GL_LUMINANCE32F_EXT",
+ 0x822F, "GL_RG16F_EXT",
},
{
- 0x82DF,
- "GL_TEXTURE_IMMUTABLE_LEVELS",
+ 0x822D, "GL_R16F_EXT",
},
{
- 0x8363,
- "GL_UNSIGNED_SHORT_5_6_5",
+ 0x822E, "GL_R32F_EXT",
},
{
- 0x9051,
- "GL_IMAGE_BUFFER_EXT",
+ 1, "GL_ES_VERSION_2_0",
},
{
- 0x84F2,
- "GL_ALL_COMPLETED_NV",
+ 0x84F9, "GL_DEPTH_STENCIL_OES",
},
{
- 0x8E5A,
- "GL_MAX_GEOMETRY_SHADER_INVOCATIONS_EXT",
+ 0x82DB, "GL_TEXTURE_VIEW_MIN_LEVEL_EXT",
},
{
- 0x84F4,
- "GL_FENCE_CONDITION_NV",
+ 0x8368, "GL_UNSIGNED_INT_2_10_10_10_REV_EXT",
},
{
- 0x8366,
- "GL_UNSIGNED_SHORT_1_5_5_5_REV_EXT",
+ 0x8819, "GL_LUMINANCE_ALPHA32F_EXT",
},
{
- 0x8365,
- "GL_UNSIGNED_SHORT_4_4_4_4_REV_EXT",
+ 0x8818, "GL_LUMINANCE32F_EXT",
},
{
- 0x84F7,
- "GL_COMMANDS_COMPLETED_CHROMIUM",
+ 0x82DF, "GL_TEXTURE_IMMUTABLE_LEVELS",
},
{
- 0x8F9C,
- "GL_SIGNED_NORMALIZED",
+ 0x8363, "GL_UNSIGNED_SHORT_5_6_5",
},
{
- 0x92D5,
- "GL_MAX_GEOMETRY_ATOMIC_COUNTERS_EXT",
+ 0x9051, "GL_IMAGE_BUFFER_EXT",
},
{
- 0x881E,
- "GL_LUMINANCE16F_EXT",
+ 0x84F2, "GL_ALL_COMPLETED_NV",
},
{
- 0x84FA,
- "GL_UNSIGNED_INT_24_8_OES",
+ 0x8E5A, "GL_MAX_GEOMETRY_SHADER_INVOCATIONS_EXT",
},
{
- 0x92D4,
- "GL_MAX_TESS_EVALUATION_ATOMIC_COUNTERS_EXT",
+ 0x84F4, "GL_FENCE_CONDITION_NV",
},
{
- 0x881A,
- "GL_RGBA16F_EXT",
+ 0x8366, "GL_UNSIGNED_SHORT_1_5_5_5_REV_EXT",
},
{
- 0x84FE,
- "GL_TEXTURE_MAX_ANISOTROPY_EXT",
+ 0x8365, "GL_UNSIGNED_SHORT_4_4_4_4_REV_EXT",
},
{
- 0x0901,
- "GL_CCW",
+ 0x84F7, "GL_COMMANDS_COMPLETED_CHROMIUM",
},
{
- 0x0900,
- "GL_CW",
+ 0x8F9C, "GL_SIGNED_NORMALIZED",
},
{
- 0x9317,
- "GL_MAX_FRAMEBUFFER_LAYERS_EXT",
+ 0x92D5, "GL_MAX_GEOMETRY_ATOMIC_COUNTERS_EXT",
},
{
- 0x8229,
- "GL_R8_EXT",
+ 0x881E, "GL_LUMINANCE16F_EXT",
},
{
- 0x8230,
- "GL_RG32F_EXT",
+ 0x84FA, "GL_UNSIGNED_INT_24_8_OES",
},
{
- 0x9312,
- "GL_FRAMEBUFFER_DEFAULT_LAYERS_EXT",
+ 0x0A, "GL_QUADRATIC_CURVE_TO_CHROMIUM",
},
{
- 0x9283,
- "GL_DISJOINT_NV",
+ 0x92D4, "GL_MAX_TESS_EVALUATION_ATOMIC_COUNTERS_EXT",
},
{
- 0x8221,
- "GL_PRIMITIVE_RESTART_FOR_PATCHES_SUPPORTED",
+ 0x881A, "GL_RGBA16F_EXT",
},
{
- 0x8227,
- "GL_RG_EXT",
+ 0x84FE, "GL_TEXTURE_MAX_ANISOTROPY_EXT",
},
{
- 0x8B66,
- "GL_FLOAT_MAT2x4_NV",
+ 0x0901, "GL_CCW",
},
{
- 0x8B67,
- "GL_FLOAT_MAT3x2_NV",
+ 0x0900, "GL_CW",
},
{
- 0x8E1E,
- "GL_MAX_COMBINED_TESS_CONTROL_UNIFORM_COMPONENTS_EXT",
+ 0x9317, "GL_MAX_FRAMEBUFFER_LAYERS_EXT",
},
{
- 0x8B62,
- "GL_SAMPLER_2D_SHADOW_EXT",
+ 0x8229, "GL_R8_EXT",
},
{
- 0x8B63,
- "GL_SAMPLER_2D_RECT_ARB",
+ 0x8230, "GL_RG32F_EXT",
},
{
- 0x8B60,
- "GL_SAMPLER_CUBE",
+ 0x9312, "GL_FRAMEBUFFER_DEFAULT_LAYERS_EXT",
},
{
- 0x00001000,
- "GL_DEPTH_BUFFER_BIT4_QCOM",
+ 0x9283, "GL_DISJOINT_NV",
},
{
- 0x8B68,
- "GL_FLOAT_MAT3x4_NV",
+ 0x8221, "GL_PRIMITIVE_RESTART_FOR_PATCHES_SUPPORTED",
},
{
- 0x83F0,
- "GL_COMPRESSED_RGB_S3TC_DXT1_EXT",
+ 0x8227, "GL_RG_EXT",
},
{
- 0x8D6A,
- "GL_ANY_SAMPLES_PASSED_CONSERVATIVE_EXT",
+ 0x8B66, "GL_FLOAT_MAT2x4_NV",
},
{
- 0x00000080,
- "GL_COLOR_BUFFER_BIT7_QCOM",
+ 0x8B67, "GL_FLOAT_MAT3x2_NV",
},
{
- 0x88F0,
- "GL_DEPTH24_STENCIL8_OES",
+ 0x8E1E, "GL_MAX_COMBINED_TESS_CONTROL_UNIFORM_COMPONENTS_EXT",
},
{
- 0x8E1F,
- "GL_MAX_COMBINED_TESS_EVALUATION_UNIFORM_COMPONENTS_EXT",
+ 0x8B62, "GL_SAMPLER_2D_SHADOW_EXT",
},
{
- 0x80A0,
- "GL_SAMPLE_COVERAGE",
+ 0x8B63, "GL_SAMPLER_2D_RECT_ARB",
},
{
- 0x928F,
- "GL_DST_ATOP_NV",
+ 0x8B60, "GL_SAMPLER_CUBE",
},
{
- 0x80A9,
- "GL_SAMPLES",
+ 0x00001000, "GL_DEPTH_BUFFER_BIT4_QCOM",
},
{
- 0x80A8,
- "GL_SAMPLE_BUFFERS",
+ 0x8B68, "GL_FLOAT_MAT3x4_NV",
},
{
- 0x0D55,
- "GL_ALPHA_BITS",
+ 0x83F0, "GL_COMPRESSED_RGB_S3TC_DXT1_EXT",
},
{
- 0x0D54,
- "GL_BLUE_BITS",
+ 0x8D6A, "GL_ANY_SAMPLES_PASSED_CONSERVATIVE_EXT",
},
{
- 0x0D57,
- "GL_STENCIL_BITS",
+ 0x00000080, "GL_COLOR_BUFFER_BIT7_QCOM",
},
{
- 0x0D56,
- "GL_DEPTH_BITS",
+ 0x88F0, "GL_DEPTH24_STENCIL8_OES",
},
{
- 0x8CD5,
- "GL_FRAMEBUFFER_COMPLETE",
+ 0x8E1F, "GL_MAX_COMBINED_TESS_EVALUATION_UNIFORM_COMPONENTS_EXT",
},
{
- 0x0D50,
- "GL_SUBPIXEL_BITS",
+ 0x80A0, "GL_SAMPLE_COVERAGE",
},
{
- 0x0D53,
- "GL_GREEN_BITS",
+ 0x0C, "GL_CUBIC_CURVE_TO_CHROMIUM",
},
{
- 0x0D52,
- "GL_RED_BITS",
+ 0x928F, "GL_DST_ATOP_NV",
},
{
- 0x8037,
- "GL_POLYGON_OFFSET_FILL",
+ 0x80A9, "GL_SAMPLES",
},
{
- 0x928C,
- "GL_SRC_OUT_NV",
+ 0x80A8, "GL_SAMPLE_BUFFERS",
},
{
- 0x8034,
- "GL_UNSIGNED_SHORT_5_5_5_1",
+ 0x0D55, "GL_ALPHA_BITS",
},
{
- 0x8033,
- "GL_UNSIGNED_SHORT_4_4_4_4",
+ 0x0D54, "GL_BLUE_BITS",
},
{
- 0x928B,
- "GL_DST_IN_NV",
+ 0x0D57, "GL_STENCIL_BITS",
},
{
- 0x0305,
- "GL_ONE_MINUS_DST_ALPHA",
+ 0x0D56, "GL_DEPTH_BITS",
},
{
- 0x0304,
- "GL_DST_ALPHA",
+ 0x8CD5, "GL_FRAMEBUFFER_COMPLETE",
},
{
- 0x0307,
- "GL_ONE_MINUS_DST_COLOR",
+ 0x0D50, "GL_SUBPIXEL_BITS",
},
{
- 0x0306,
- "GL_DST_COLOR",
+ 0x0D53, "GL_GREEN_BITS",
},
{
- 0x0301,
- "GL_ONE_MINUS_SRC_COLOR",
+ 0x0D52, "GL_RED_BITS",
},
{
- 0x0300,
- "GL_SRC_COLOR",
+ 0x8037, "GL_POLYGON_OFFSET_FILL",
},
{
- 0x0303,
- "GL_ONE_MINUS_SRC_ALPHA",
+ 0x928C, "GL_SRC_OUT_NV",
},
{
- 0x0302,
- "GL_SRC_ALPHA",
+ 0x8034, "GL_UNSIGNED_SHORT_5_5_5_1",
},
{
- 0x8212,
- "GL_FRAMEBUFFER_ATTACHMENT_RED_SIZE",
+ 0x8033, "GL_UNSIGNED_SHORT_4_4_4_4",
},
{
- 0x0308,
- "GL_SRC_ALPHA_SATURATE",
+ 0x928B, "GL_DST_IN_NV",
},
{
- 0x2A00,
- "GL_POLYGON_OFFSET_UNITS",
+ 0x0305, "GL_ONE_MINUS_DST_ALPHA",
},
{
- 0xFFFFFFFF,
- "GL_ALL_SHADER_BITS_EXT",
+ 0x0304, "GL_DST_ALPHA",
},
{
- 0x82DC,
- "GL_TEXTURE_VIEW_NUM_LEVELS_EXT",
+ 0x0307, "GL_ONE_MINUS_DST_COLOR",
},
{
- 0x8C29,
- "GL_MAX_GEOMETRY_TEXTURE_IMAGE_UNITS_EXT",
+ 0x0306, "GL_DST_COLOR",
},
{
- 0x82DD,
- "GL_TEXTURE_VIEW_MIN_LAYER_EXT",
+ 0x0301, "GL_ONE_MINUS_SRC_COLOR",
},
{
- 0x00800000,
- "GL_STENCIL_BUFFER_BIT7_QCOM",
+ 0x0300, "GL_SRC_COLOR",
},
{
- 0x82DE,
- "GL_TEXTURE_VIEW_NUM_LAYERS_EXT",
+ 0x0303, "GL_ONE_MINUS_SRC_ALPHA",
},
{
- 0x00020000,
- "GL_STENCIL_BUFFER_BIT1_QCOM",
+ 0x0302, "GL_SRC_ALPHA",
},
{
- 0x8D00,
- "GL_DEPTH_ATTACHMENT",
+ 0x8212, "GL_FRAMEBUFFER_ATTACHMENT_RED_SIZE",
},
{
- 0x8FA0,
- "GL_PERFMON_GLOBAL_MODE_QCOM",
+ 0x0308, "GL_SRC_ALPHA_SATURATE",
},
{
- 0x8815,
- "GL_RGB32F_EXT",
+ 0x2A00, "GL_POLYGON_OFFSET_UNITS",
},
{
- 0x8A35,
- "GL_ACTIVE_UNIFORM_BLOCK_MAX_NAME_LENGTH",
+ 0xFFFFFFFF, "GL_ALL_SHADER_BITS_EXT",
},
{
- 0x8814,
- "GL_RGBA32F_EXT",
+ 0x82DC, "GL_TEXTURE_VIEW_NUM_LEVELS_EXT",
},
{
- 0x6006,
- "GL_ASYNC_PIXEL_PACK_COMPLETED_CHROMIUM",
+ 0x8C29, "GL_MAX_GEOMETRY_TEXTURE_IMAGE_UNITS_EXT",
},
{
- 0x9277,
- "GL_COMPRESSED_SRGB8_PUNCHTHROUGH_ALPHA1_ETC2",
+ 0x82DD, "GL_TEXTURE_VIEW_MIN_LAYER_EXT",
},
{
- 0x6004,
- "GL_COMMANDS_ISSUED_CHROMIUM",
+ 0x00800000, "GL_STENCIL_BUFFER_BIT7_QCOM",
},
{
- 0x813D,
- "GL_TEXTURE_MAX_LEVEL_APPLE",
+ 0x82DE, "GL_TEXTURE_VIEW_NUM_LAYERS_EXT",
},
{
- 0x8816,
- "GL_ALPHA32F_EXT",
+ 0x00020000, "GL_STENCIL_BUFFER_BIT1_QCOM",
},
{
- 0x813B,
- "GL_TEXTURE_MAX_LOD",
+ 0x8D00, "GL_DEPTH_ATTACHMENT",
},
{
- 0x8CDD,
- "GL_FRAMEBUFFER_UNSUPPORTED",
+ 0x8FA0, "GL_PERFMON_GLOBAL_MODE_QCOM",
},
{
- 0x8CDF,
- "GL_MAX_COLOR_ATTACHMENTS_EXT",
+ 0x8815, "GL_RGB32F_EXT",
},
{
- 0x90F3,
- "GL_CONTEXT_ROBUST_ACCESS_KHR",
+ 0x8A35, "GL_ACTIVE_UNIFORM_BLOCK_MAX_NAME_LENGTH",
},
{
- 0x90F2,
- "GL_MAX_MULTIVIEW_BUFFERS_EXT",
+ 0x8814, "GL_RGBA32F_EXT",
},
{
- 0x90F1,
- "GL_MULTIVIEW_EXT",
+ 0x6006, "GL_ASYNC_PIXEL_PACK_COMPLETED_CHROMIUM",
},
{
- 0x90F0,
- "GL_COLOR_ATTACHMENT_EXT",
+ 0x9277, "GL_COMPRESSED_SRGB8_PUNCHTHROUGH_ALPHA1_ETC2",
},
{
- 0x803C,
- "GL_ALPHA8_OES",
+ 0x6004, "GL_COMMANDS_ISSUED_CHROMIUM",
},
{
- 0x8904,
- "GL_MIN_PROGRAM_TEXEL_OFFSET",
+ 0x813D, "GL_TEXTURE_MAX_LEVEL_APPLE",
},
{
- 0x84F5,
- "GL_TEXTURE_RECTANGLE_ARB",
+ 0x8816, "GL_ALPHA32F_EXT",
},
{
- 0x882A,
- "GL_DRAW_BUFFER5_EXT",
+ 0x813B, "GL_TEXTURE_MAX_LOD",
},
{
- 0x8E7F,
- "GL_MAX_TESS_CONTROL_UNIFORM_COMPONENTS_EXT",
+ 0x8CDD, "GL_FRAMEBUFFER_UNSUPPORTED",
},
{
- 0x80AA,
- "GL_SAMPLE_COVERAGE_VALUE",
+ 0x8CDF, "GL_MAX_COLOR_ATTACHMENTS_EXT",
},
{
- 0x84F6,
- "GL_TEXTURE_BINDING_RECTANGLE_ARB",
+ 0x90F3, "GL_CONTEXT_ROBUST_ACCESS_KHR",
},
{
- 0x80AB,
- "GL_SAMPLE_COVERAGE_INVERT",
+ 0x90F2, "GL_MAX_MULTIVIEW_BUFFERS_EXT",
},
{
- 0x8E7D,
- "GL_MAX_PATCH_VERTICES_EXT",
+ 0x90F1, "GL_MULTIVIEW_EXT",
},
{
- 0x6005,
- "GL_ASYNC_PIXEL_UNPACK_COMPLETED_CHROMIUM",
+ 0x90F0, "GL_COLOR_ATTACHMENT_EXT",
},
{
- 0x9105,
- "GL_TEXTURE_BINDING_2D_MULTISAMPLE_ARRAY_OES",
+ 0x803C, "GL_ALPHA8_OES",
},
{
- 0x8E7E,
- "GL_MAX_TESS_GEN_LEVEL_EXT",
+ 0x8904, "GL_MIN_PROGRAM_TEXEL_OFFSET",
},
{
- 0x9102,
- "GL_TEXTURE_2D_MULTISAMPLE_ARRAY_OES",
+ 0x84F5, "GL_TEXTURE_RECTANGLE_ARB",
},
{
- 0x8C40,
- "GL_SRGB_EXT",
+ 0x882A, "GL_DRAW_BUFFER5_EXT",
},
{
- 0x8E7B,
- "GL_FRACTIONAL_ODD_EXT",
+ 0x8E7F, "GL_MAX_TESS_CONTROL_UNIFORM_COMPONENTS_EXT",
},
{
- 0x00000040,
- "GL_COLOR_BUFFER_BIT6_QCOM",
+ 0x80AA, "GL_SAMPLE_COVERAGE_VALUE",
},
{
- 0x882B,
- "GL_DRAW_BUFFER6_EXT",
+ 0x84F6, "GL_TEXTURE_BINDING_RECTANGLE_ARB",
},
{
- 0x8E7C,
- "GL_FRACTIONAL_EVEN_EXT",
+ 0x80AB, "GL_SAMPLE_COVERAGE_INVERT",
},
{
- 0x8C8E,
- "GL_TRANSFORM_FEEDBACK_BUFFER",
+ 0x8E7D, "GL_MAX_PATCH_VERTICES_EXT",
},
{
- 0x8C8D,
- "GL_SEPARATE_ATTRIBS",
+ 0x9105, "GL_TEXTURE_BINDING_2D_MULTISAMPLE_ARRAY_OES",
},
{
- 0x8C8F,
- "GL_TRANSFORM_FEEDBACK_BUFFER_BINDING",
+ 0x8E7E, "GL_MAX_TESS_GEN_LEVEL_EXT",
},
{
- 0x8C8A,
- "GL_MAX_TRANSFORM_FEEDBACK_INTERLEAVED_COMPONENTS",
+ 0x9102, "GL_TEXTURE_2D_MULTISAMPLE_ARRAY_OES",
},
{
- 0x8C8C,
- "GL_INTERLEAVED_ATTRIBS",
+ 0x8C40, "GL_SRGB_EXT",
},
{
- 0x8C8B,
- "GL_MAX_TRANSFORM_FEEDBACK_SEPARATE_ATTRIBS",
+ 0x8E7B, "GL_FRACTIONAL_ODD_EXT",
},
{
- 0x8C17,
- "GL_UNSIGNED_NORMALIZED_EXT",
+ 0x00000040, "GL_COLOR_BUFFER_BIT6_QCOM",
},
{
- 0x8A3E,
- "GL_UNIFORM_IS_ROW_MAJOR",
+ 0x882B, "GL_DRAW_BUFFER6_EXT",
},
{
- 0x8E7A,
- "GL_ISOLINES_EXT",
+ 0x8E7C, "GL_FRACTIONAL_EVEN_EXT",
},
{
- 0x8F95,
- "GL_RG8_SNORM",
+ 0x8C8E, "GL_TRANSFORM_FEEDBACK_BUFFER",
},
{
- 0x8D99,
- "GL_RGBA_INTEGER",
+ 0x8C8D, "GL_SEPARATE_ATTRIBS",
},
{
- 0x8D98,
- "GL_RGB_INTEGER",
+ 0x8C8F, "GL_TRANSFORM_FEEDBACK_BUFFER_BINDING",
},
{
- 0x8A4A,
- "GL_SKIP_DECODE_EXT",
+ 0x8C8A, "GL_MAX_TRANSFORM_FEEDBACK_INTERLEAVED_COMPONENTS",
},
{
- 0x8A4F,
- "GL_PROGRAM_PIPELINE_OBJECT_EXT",
+ 0x8C8C, "GL_INTERLEAVED_ATTRIBS",
},
{
- 0x882C,
- "GL_DRAW_BUFFER7_EXT",
+ 0x8C8B, "GL_MAX_TRANSFORM_FEEDBACK_SEPARATE_ATTRIBS",
},
{
- 0x0010,
- "GL_MAP_FLUSH_EXPLICIT_BIT_EXT",
+ 0x8C17, "GL_UNSIGNED_NORMALIZED_EXT",
},
{
- 0x8918,
- "GL_GEOMETRY_LINKED_OUTPUT_TYPE_EXT",
+ 0x8A3E, "GL_UNIFORM_IS_ROW_MAJOR",
},
{
- 0x8919,
- "GL_SAMPLER_BINDING",
+ 0x8E7A, "GL_ISOLINES_EXT",
},
{
- 0x92CD,
- "GL_MAX_TESS_CONTROL_ATOMIC_COUNTER_BUFFERS_EXT",
+ 0x8F95, "GL_RG8_SNORM",
},
{
- 0x92CE,
- "GL_MAX_TESS_EVALUATION_ATOMIC_COUNTER_BUFFERS_EXT",
+ 0x8D99, "GL_RGBA_INTEGER",
},
{
- 0x8C85,
- "GL_TRANSFORM_FEEDBACK_BUFFER_SIZE",
+ 0x8D98, "GL_RGB_INTEGER",
},
{
- 0x8D7C,
- "GL_RGBA8UI",
+ 0x8A4A, "GL_SKIP_DECODE_EXT",
},
{
- 0x6007,
- "GL_LATENCY_QUERY_CHROMIUM",
+ 0x8A4F, "GL_PROGRAM_PIPELINE_OBJECT_EXT",
},
{
- 0x8D83,
- "GL_RGB32I",
+ 0x882C, "GL_DRAW_BUFFER7_EXT",
},
{
- 0x8916,
- "GL_GEOMETRY_LINKED_VERTICES_OUT_EXT",
+ 0x0010, "GL_MAP_FLUSH_EXPLICIT_BIT_EXT",
},
{
- 0x8917,
- "GL_GEOMETRY_LINKED_INPUT_TYPE_EXT",
+ 0x8918, "GL_GEOMETRY_LINKED_OUTPUT_TYPE_EXT",
},
{
- 0x881F,
- "GL_LUMINANCE_ALPHA16F_EXT",
+ 0x8919, "GL_SAMPLER_BINDING",
},
{
- 0x84FD,
- "GL_MAX_TEXTURE_LOD_BIAS",
+ 0x92CD, "GL_MAX_TESS_CONTROL_ATOMIC_COUNTER_BUFFERS_EXT",
},
{
- 0x882D,
- "GL_DRAW_BUFFER8_EXT",
+ 0x92CE, "GL_MAX_TESS_EVALUATION_ATOMIC_COUNTER_BUFFERS_EXT",
},
{
- 0x8A43,
- "GL_UNIFORM_BLOCK_ACTIVE_UNIFORM_INDICES",
+ 0x8C85, "GL_TRANSFORM_FEEDBACK_BUFFER_SIZE",
},
{
- 0x8A42,
- "GL_UNIFORM_BLOCK_ACTIVE_UNIFORMS",
+ 0x8D7C, "GL_RGBA8UI",
},
{
- 0x8F37,
- "GL_COPY_WRITE_BUFFER_NV",
+ 0x6007, "GL_LATENCY_QUERY_CHROMIUM",
},
{
- 0x8F36,
- "GL_COPY_READ_BUFFER_NV",
+ 0x8D83, "GL_RGB32I",
},
{
- 0x84FF,
- "GL_MAX_TEXTURE_MAX_ANISOTROPY_EXT",
+ 0x8916, "GL_GEOMETRY_LINKED_VERTICES_OUT_EXT",
},
{
- 0x8A3C,
- "GL_UNIFORM_ARRAY_STRIDE",
+ 0x8917, "GL_GEOMETRY_LINKED_INPUT_TYPE_EXT",
},
{
- 0x8A44,
- "GL_UNIFORM_BLOCK_REFERENCED_BY_VERTEX_SHADER",
+ 0x881F, "GL_LUMINANCE_ALPHA16F_EXT",
},
{
- 0x6000,
- "GL_TEXTURE_POOL_CHROMIUM",
+ 0x84FD, "GL_MAX_TEXTURE_LOD_BIAS",
},
{
- 0x0B74,
- "GL_DEPTH_FUNC",
+ 0x882D, "GL_DRAW_BUFFER8_EXT",
},
{
- 0x8A49,
- "GL_DECODE_EXT",
+ 0x8A43, "GL_UNIFORM_BLOCK_ACTIVE_UNIFORM_INDICES",
},
{
- 0x881B,
- "GL_RGB16F_EXT",
+ 0x8A42, "GL_UNIFORM_BLOCK_ACTIVE_UNIFORMS",
},
{
- 0x0B71,
- "GL_DEPTH_TEST",
+ 0x8F37, "GL_COPY_WRITE_BUFFER_NV",
},
{
- 0x0B70,
- "GL_DEPTH_RANGE",
+ 0x8F36, "GL_COPY_READ_BUFFER_NV",
},
{
- 0x0B73,
- "GL_DEPTH_CLEAR_VALUE",
+ 0x84FF, "GL_MAX_TEXTURE_MAX_ANISOTROPY_EXT",
},
{
- 0x0B72,
- "GL_DEPTH_WRITEMASK",
+ 0x8A3C, "GL_UNIFORM_ARRAY_STRIDE",
},
{
- 0x8BD5,
- "GL_TEXTURE_INTERNAL_FORMAT_QCOM",
+ 0x8A44, "GL_UNIFORM_BLOCK_REFERENCED_BY_VERTEX_SHADER",
},
{
- 0x85BA,
- "GL_UNSIGNED_SHORT_8_8_APPLE",
+ 0x6000, "GL_TEXTURE_POOL_CHROMIUM",
},
{
- 0x8C87,
- "GL_PRIMITIVES_GENERATED_EXT",
+ 0x0B74, "GL_DEPTH_FUNC",
},
{
- 0x8C80,
- "GL_MAX_TRANSFORM_FEEDBACK_SEPARATE_COMPONENTS",
+ 0x8A49, "GL_DECODE_EXT",
},
{
- 0x8C83,
- "GL_TRANSFORM_FEEDBACK_VARYINGS",
+ 0x881B, "GL_RGB16F_EXT",
},
{
- 0x8D69,
- "GL_PRIMITIVE_RESTART_FIXED_INDEX",
+ 0x0B71, "GL_DEPTH_TEST",
},
{
- 0x882E,
- "GL_DRAW_BUFFER9_EXT",
+ 0x0B70, "GL_DEPTH_RANGE",
},
{
- 0x8A32,
- "GL_MAX_COMBINED_GEOMETRY_UNIFORM_COMPONENTS_EXT",
+ 0x0B73, "GL_DEPTH_CLEAR_VALUE",
},
{
- 0x8A31,
- "GL_MAX_COMBINED_VERTEX_UNIFORM_COMPONENTS",
+ 0x0B72, "GL_DEPTH_WRITEMASK",
},
{
- 0x8C89,
- "GL_RASTERIZER_DISCARD",
+ 0x8BD5, "GL_TEXTURE_INTERNAL_FORMAT_QCOM",
},
{
- 0x8C88,
- "GL_TRANSFORM_FEEDBACK_PRIMITIVES_WRITTEN",
+ 0x85BA, "GL_UNSIGNED_SHORT_8_8_APPLE",
},
{
- 0x8C1A,
- "GL_TEXTURE_2D_ARRAY",
+ 0x8C87, "GL_PRIMITIVES_GENERATED_EXT",
},
{
- 0x910D,
- "GL_UNSIGNED_INT_SAMPLER_2D_MULTISAMPLE_ARRAY_OES",
+ 0x8C80, "GL_MAX_TRANSFORM_FEEDBACK_SEPARATE_COMPONENTS",
},
{
- 0x8E80,
- "GL_MAX_TESS_EVALUATION_UNIFORM_COMPONENTS_EXT",
+ 0x8C83, "GL_TRANSFORM_FEEDBACK_VARYINGS",
},
{
- 0x910B,
- "GL_SAMPLER_2D_MULTISAMPLE_ARRAY_OES",
+ 0x8D69, "GL_PRIMITIVE_RESTART_FIXED_INDEX",
},
{
- 0x910C,
- "GL_INT_SAMPLER_2D_MULTISAMPLE_ARRAY_OES",
+ 0x882E, "GL_DRAW_BUFFER9_EXT",
},
{
- 0x94FA,
- "GL_PERFQUERY_COUNTER_DATA_FLOAT_INTEL",
+ 0x8A32, "GL_MAX_COMBINED_GEOMETRY_UNIFORM_COMPONENTS_EXT",
},
{
- 0x8073,
- "GL_MAX_3D_TEXTURE_SIZE_OES",
+ 0x8A31, "GL_MAX_COMBINED_VERTEX_UNIFORM_COMPONENTS",
},
{
- 0x8072,
- "GL_TEXTURE_WRAP_R_OES",
+ 0x8C89, "GL_RASTERIZER_DISCARD",
},
{
- 0x9289,
- "GL_DST_OVER_NV",
+ 0x8C88, "GL_TRANSFORM_FEEDBACK_PRIMITIVES_WRITTEN",
},
{
- 0x882F,
- "GL_DRAW_BUFFER10_EXT",
+ 0x8C1A, "GL_TEXTURE_2D_ARRAY",
},
{
- 0x8074,
- "GL_VERTEX_ARRAY_KHR",
+ 0x910D, "GL_UNSIGNED_INT_SAMPLER_2D_MULTISAMPLE_ARRAY_OES",
},
{
- 0x80E1,
- "GL_BGRA_EXT",
+ 0x8E80, "GL_MAX_TESS_EVALUATION_UNIFORM_COMPONENTS_EXT",
},
{
- 0x8ED7,
- "GL_COVERAGE_AUTOMATIC_NV",
+ 0x910B, "GL_SAMPLER_2D_MULTISAMPLE_ARRAY_OES",
},
{
- 0x8ED6,
- "GL_COVERAGE_EDGE_FRAGMENTS_NV",
+ 0x910C, "GL_INT_SAMPLER_2D_MULTISAMPLE_ARRAY_OES",
},
{
- 0x8ED5,
- "GL_COVERAGE_ALL_FRAGMENTS_NV",
+ 0x94FA, "GL_PERFQUERY_COUNTER_DATA_FLOAT_INTEL",
},
{
- 0x8ED4,
- "GL_COVERAGE_SAMPLES_NV",
+ 0x8073, "GL_MAX_3D_TEXTURE_SIZE_OES",
},
{
- 0x8ED3,
- "GL_COVERAGE_BUFFERS_NV",
+ 0x8072, "GL_TEXTURE_WRAP_R_OES",
},
{
- 0x8ED2,
- "GL_COVERAGE_ATTACHMENT_NV",
+ 0x9289, "GL_DST_OVER_NV",
},
{
- 0x8ED1,
- "GL_COVERAGE_COMPONENT4_NV",
+ 0x882F, "GL_DRAW_BUFFER10_EXT",
},
{
- 0x8ED0,
- "GL_COVERAGE_COMPONENT_NV",
+ 0x8074, "GL_VERTEX_ARRAY_KHR",
},
{
- 0x8217,
- "GL_FRAMEBUFFER_ATTACHMENT_STENCIL_SIZE",
+ 0x80E1, "GL_BGRA_EXT",
},
{
- 0x8E89,
- "GL_MAX_TESS_CONTROL_UNIFORM_BLOCKS_EXT",
+ 0x908B, "GL_CONVEX_HULL_CHROMIUM",
},
{
- 0x8216,
- "GL_FRAMEBUFFER_ATTACHMENT_DEPTH_SIZE",
+ 0x8ED7, "GL_COVERAGE_AUTOMATIC_NV",
},
{
- 0x8A36,
- "GL_ACTIVE_UNIFORM_BLOCKS",
+ 0x8ED6, "GL_COVERAGE_EDGE_FRAGMENTS_NV",
},
{
- 0x8A37,
- "GL_UNIFORM_TYPE",
+ 0x8ED5, "GL_COVERAGE_ALL_FRAGMENTS_NV",
},
{
- 0x8A34,
- "GL_UNIFORM_BUFFER_OFFSET_ALIGNMENT",
+ 0x8ED4, "GL_COVERAGE_SAMPLES_NV",
},
{
- 0x3006,
- "GL_CLIP_DISTANCE6_APPLE",
+ 0x8ED3, "GL_COVERAGE_BUFFERS_NV",
},
{
- 0x800B,
- "GL_FUNC_REVERSE_SUBTRACT",
+ 0x8ED2, "GL_COVERAGE_ATTACHMENT_NV",
},
{
- 0x8A33,
- "GL_MAX_COMBINED_FRAGMENT_UNIFORM_COMPONENTS",
+ 0x8ED1, "GL_COVERAGE_COMPONENT4_NV",
},
{
- 0x00000400,
- "GL_STENCIL_BUFFER_BIT",
+ 0x8ED0, "GL_COVERAGE_COMPONENT_NV",
},
{
- 0x800A,
- "GL_FUNC_SUBTRACT",
+ 0x8217, "GL_FRAMEBUFFER_ATTACHMENT_STENCIL_SIZE",
},
{
- 0x8214,
- "GL_FRAMEBUFFER_ATTACHMENT_BLUE_SIZE",
+ 0x8E89, "GL_MAX_TESS_CONTROL_UNIFORM_BLOCKS_EXT",
},
{
- 0x8A38,
- "GL_UNIFORM_SIZE",
+ 0x8216, "GL_FRAMEBUFFER_ATTACHMENT_DEPTH_SIZE",
},
{
- 0x8A39,
- "GL_UNIFORM_NAME_LENGTH",
+ 0x8A36, "GL_ACTIVE_UNIFORM_BLOCKS",
},
{
- 0x8E2C,
- "GL_DEPTH_COMPONENT16_NONLINEAR_NV",
+ 0x8A37, "GL_UNIFORM_TYPE",
},
{
- 0x889F,
- "GL_VERTEX_ATTRIB_ARRAY_BUFFER_BINDING",
+ 0x8A34, "GL_UNIFORM_BUFFER_OFFSET_ALIGNMENT",
},
{
- 0x8219,
- "GL_FRAMEBUFFER_UNDEFINED_OES",
+ 0x3006, "GL_CLIP_DISTANCE6_APPLE",
},
{
- 0x8E23,
- "GL_TRANSFORM_FEEDBACK_PAUSED",
+ 0x800B, "GL_FUNC_REVERSE_SUBTRACT",
},
{
- 0x8E22,
- "GL_TRANSFORM_FEEDBACK",
+ 0x8A33, "GL_MAX_COMBINED_FRAGMENT_UNIFORM_COMPONENTS",
},
{
- 0x8E25,
- "GL_TRANSFORM_FEEDBACK_BINDING",
+ 0x00000400, "GL_STENCIL_BUFFER_BIT",
},
{
- 0x9054,
- "GL_IMAGE_CUBE_MAP_ARRAY_EXT",
+ 0x800A, "GL_FUNC_SUBTRACT",
},
{
- 0x8E28,
- "GL_TIMESTAMP_EXT",
+ 0x8214, "GL_FRAMEBUFFER_ATTACHMENT_BLUE_SIZE",
},
{
- 0x8006,
- "GL_FUNC_ADD",
+ 0x8A38, "GL_UNIFORM_SIZE",
},
{
- 0x8007,
- "GL_MIN_EXT",
+ 0x8A39, "GL_UNIFORM_NAME_LENGTH",
},
{
- 0x8004,
- "GL_ONE_MINUS_CONSTANT_ALPHA",
+ 0x8E2C, "GL_DEPTH_COMPONENT16_NONLINEAR_NV",
},
{
- 0x8005,
- "GL_BLEND_COLOR",
+ 0x889F, "GL_VERTEX_ATTRIB_ARRAY_BUFFER_BINDING",
},
{
- 0x8002,
- "GL_ONE_MINUS_CONSTANT_COLOR",
+ 0x8219, "GL_FRAMEBUFFER_UNDEFINED_OES",
},
{
- 0x8003,
- "GL_CONSTANT_ALPHA",
+ 0x8E23, "GL_TRANSFORM_FEEDBACK_PAUSED",
},
{
- 0x8001,
- "GL_CONSTANT_COLOR",
+ 0x8E22, "GL_TRANSFORM_FEEDBACK",
},
{
- 0x0204,
- "GL_GREATER",
+ 0x8E25, "GL_TRANSFORM_FEEDBACK_BINDING",
},
{
- 0x0205,
- "GL_NOTEQUAL",
+ 0x9054, "GL_IMAGE_CUBE_MAP_ARRAY_EXT",
},
{
- 0x0206,
- "GL_GEQUAL",
+ 0x8E28, "GL_TIMESTAMP_EXT",
},
{
- 0x0207,
- "GL_ALWAYS",
+ 0x8006, "GL_FUNC_ADD",
},
{
- 0x0200,
- "GL_NEVER",
+ 0x8007, "GL_MIN_EXT",
},
{
- 0x0201,
- "GL_LESS",
+ 0x8004, "GL_ONE_MINUS_CONSTANT_ALPHA",
},
{
- 0x0202,
- "GL_EQUAL",
+ 0x8005, "GL_BLEND_COLOR",
},
{
- 0x0203,
- "GL_LEQUAL",
+ 0x8002, "GL_ONE_MINUS_CONSTANT_COLOR",
},
{
- 0x8BD6,
- "GL_TEXTURE_FORMAT_QCOM",
+ 0x8003, "GL_CONSTANT_ALPHA",
},
{
- 0x8228,
- "GL_RG_INTEGER",
+ 0x8001, "GL_CONSTANT_COLOR",
},
{
- 0x2901,
- "GL_REPEAT",
+ 0x0204, "GL_GREATER",
},
{
- 0x9067,
- "GL_UNSIGNED_INT_IMAGE_BUFFER_EXT",
+ 0x0205, "GL_NOTEQUAL",
},
{
- 0x92A0,
- "GL_EXCLUSION_KHR",
+ 0x0206, "GL_GEQUAL",
},
{
- 0x93D8,
- "GL_COMPRESSED_SRGB8_ALPHA8_ASTC_10x5_KHR",
+ 0x0207, "GL_ALWAYS",
},
{
- 0x93D9,
- "GL_COMPRESSED_SRGB8_ALPHA8_ASTC_10x6_KHR",
+ 0x0200, "GL_NEVER",
},
{
- 0x8FB2,
- "GL_GPU_OPTIMIZED_QCOM",
+ 0x0201, "GL_LESS",
},
{
- 0x190A,
- "GL_LUMINANCE_ALPHA",
+ 0x0202, "GL_EQUAL",
},
{
- 0x8FB0,
- "GL_BINNING_CONTROL_HINT_QCOM",
+ 0x0203, "GL_LEQUAL",
},
{
- 0x905C,
- "GL_INT_IMAGE_BUFFER_EXT",
+ 0x8BD6, "GL_TEXTURE_FORMAT_QCOM",
},
{
- 0x1E00,
- "GL_KEEP",
+ 0x8228, "GL_RG_INTEGER",
},
{
- 0x1E01,
- "GL_REPLACE",
+ 0x2901, "GL_REPEAT",
},
{
- 0x1E02,
- "GL_INCR",
+ 0x9067, "GL_UNSIGNED_INT_IMAGE_BUFFER_EXT",
},
{
- 0x1E03,
- "GL_DECR",
+ 0x92A0, "GL_EXCLUSION_KHR",
},
{
- 0x93D6,
- "GL_COMPRESSED_SRGB8_ALPHA8_ASTC_8x6_KHR",
+ 0x93D8, "GL_COMPRESSED_SRGB8_ALPHA8_ASTC_10x5_KHR",
},
{
- 0x93D7,
- "GL_COMPRESSED_SRGB8_ALPHA8_ASTC_8x8_KHR",
+ 0x93D9, "GL_COMPRESSED_SRGB8_ALPHA8_ASTC_10x6_KHR",
},
{
- 0x93D4,
- "GL_COMPRESSED_SRGB8_ALPHA8_ASTC_6x6_KHR",
+ 0x8FB2, "GL_GPU_OPTIMIZED_QCOM",
},
{
- 0x93D5,
- "GL_COMPRESSED_SRGB8_ALPHA8_ASTC_8x5_KHR",
+ 0x190A, "GL_LUMINANCE_ALPHA",
},
{
- 0x886D,
- "GL_MAX_TESS_EVALUATION_INPUT_COMPONENTS_EXT",
+ 0x8FB0, "GL_BINNING_CONTROL_HINT_QCOM",
},
{
- 0x0BE2,
- "GL_BLEND",
+ 0x905C, "GL_INT_IMAGE_BUFFER_EXT",
},
{
- 0x84CB,
- "GL_TEXTURE11",
+ 0x1E00, "GL_KEEP",
},
{
- 0x8D55,
- "GL_RENDERBUFFER_STENCIL_SIZE",
+ 0x1E01, "GL_REPLACE",
},
{
- 0x8D54,
- "GL_RENDERBUFFER_DEPTH_SIZE",
+ 0x1E02, "GL_INCR",
},
{
- 0x8D57,
- "GL_MAX_SAMPLES_ANGLE",
+ 0x1E03, "GL_DECR",
},
{
- 0x8D56,
- "GL_FRAMEBUFFER_INCOMPLETE_MULTISAMPLE_ANGLE",
+ 0x93D6, "GL_COMPRESSED_SRGB8_ALPHA8_ASTC_8x6_KHR",
},
{
- 0x8D51,
- "GL_RENDERBUFFER_GREEN_SIZE",
+ 0x93D7, "GL_COMPRESSED_SRGB8_ALPHA8_ASTC_8x8_KHR",
},
{
- 0x8D50,
- "GL_RENDERBUFFER_RED_SIZE",
+ 0x93D4, "GL_COMPRESSED_SRGB8_ALPHA8_ASTC_6x6_KHR",
},
{
- 0x8D53,
- "GL_RENDERBUFFER_ALPHA_SIZE",
+ 0x93D5, "GL_COMPRESSED_SRGB8_ALPHA8_ASTC_8x5_KHR",
},
{
- 0x8D52,
- "GL_RENDERBUFFER_BLUE_SIZE",
+ 0x886D, "GL_MAX_TESS_EVALUATION_INPUT_COMPONENTS_EXT",
},
{
- 0x92A6,
- "GL_VIVIDLIGHT_NV",
+ 0x04, "GL_LINE_TO_CHROMIUM",
},
{
- 0x8DCC,
- "GL_INT_SAMPLER_CUBE",
+ 0x0BE2, "GL_BLEND",
},
{
- 0x8905,
- "GL_MAX_PROGRAM_TEXEL_OFFSET",
+ 0x84CB, "GL_TEXTURE11",
},
{
- 0x00080000,
- "GL_STENCIL_BUFFER_BIT3_QCOM",
+ 0x8D55, "GL_RENDERBUFFER_STENCIL_SIZE",
},
{
- 0x92A7,
- "GL_LINEARLIGHT_NV",
+ 0x8D54, "GL_RENDERBUFFER_DEPTH_SIZE",
},
{
- 0x8DCF,
- "GL_INT_SAMPLER_2D_ARRAY",
+ 0x8D57, "GL_MAX_SAMPLES_ANGLE",
},
{
- 0x886A,
- "GL_VERTEX_ATTRIB_ARRAY_NORMALIZED",
+ 0x8D56, "GL_FRAMEBUFFER_INCOMPLETE_MULTISAMPLE_ANGLE",
},
{
- 0x8C41,
- "GL_SRGB8_NV",
+ 0x8D51, "GL_RENDERBUFFER_GREEN_SIZE",
},
{
- 0x0C01,
- "GL_DRAW_BUFFER_EXT",
+ 0x8D50, "GL_RENDERBUFFER_RED_SIZE",
},
{
- 0x886C,
- "GL_MAX_TESS_CONTROL_INPUT_COMPONENTS_EXT",
+ 0x8D53, "GL_RENDERBUFFER_ALPHA_SIZE",
},
{
- 0x90CB,
- "GL_MAX_TESS_CONTROL_IMAGE_UNIFORMS_EXT",
+ 0x8D52, "GL_RENDERBUFFER_BLUE_SIZE",
},
{
- 0x8DCA,
- "GL_INT_SAMPLER_2D",
+ 0x92A6, "GL_VIVIDLIGHT_NV",
},
{
- 0x93C7,
- "GL_COMPRESSED_RGBA_ASTC_6x5x5_OES",
+ 0x8DCC, "GL_INT_SAMPLER_CUBE",
},
{
- 0x8B5F,
- "GL_SAMPLER_3D_OES",
+ 0x8905, "GL_MAX_PROGRAM_TEXEL_OFFSET",
},
{
- 0x8B95,
- "GL_PALETTE8_RGB8_OES",
+ 0x00080000, "GL_STENCIL_BUFFER_BIT3_QCOM",
},
{
- 0x9250,
- "GL_SHADER_BINARY_DMP",
+ 0x92A7, "GL_LINEARLIGHT_NV",
},
{
- 0x9251,
- "GL_SMAPHS30_PROGRAM_BINARY_DMP",
+ 0x00, "GL_CLOSE_PATH_CHROMIUM",
},
{
- 0x9252,
- "GL_SMAPHS_PROGRAM_BINARY_DMP",
+ 0x8DCF, "GL_INT_SAMPLER_2D_ARRAY",
},
{
- 0x9253,
- "GL_DMP_PROGRAM_BINARY_DMP",
+ 0x02, "GL_MOVE_TO_CHROMIUM",
},
{
- 0x8DC8,
- "GL_UNSIGNED_INT_VEC4",
+ 0x886A, "GL_VERTEX_ATTRIB_ARRAY_NORMALIZED",
},
{
- 0x3000,
- "GL_CLIP_DISTANCE0_APPLE",
+ 0x8C41, "GL_SRGB8_NV",
},
{
- 0x8C92,
- "GL_ATC_RGB_AMD",
+ 0x9079, "GL_PATH_JOIN_STYLE_CHROMIUM",
},
{
- 0x8DC1,
- "GL_SAMPLER_2D_ARRAY",
+ 0x0C01, "GL_DRAW_BUFFER_EXT",
},
{
- 0x9154,
- "GL_VERTEX_ARRAY_OBJECT_EXT",
+ 0x9075, "GL_PATH_STROKE_WIDTH_CHROMIUM",
},
{
- 0x9153,
- "GL_QUERY_OBJECT_EXT",
+ 0x9076, "GL_PATH_END_CAPS_CHROMIUM",
},
{
- 0x8864,
- "GL_QUERY_COUNTER_BITS_EXT",
+ 0x886C, "GL_MAX_TESS_CONTROL_INPUT_COMPONENTS_EXT",
},
{
- 0x9151,
- "GL_BUFFER_OBJECT_EXT",
+ 0x90CB, "GL_MAX_TESS_CONTROL_IMAGE_UNIFORMS_EXT",
},
{
- 0x8C93,
- "GL_ATC_RGBA_EXPLICIT_ALPHA_AMD",
+ 0x8DCA, "GL_INT_SAMPLER_2D",
},
{
- 0x00000002,
- "GL_CONTEXT_FLAG_DEBUG_BIT_KHR",
+ 0x93C7, "GL_COMPRESSED_RGBA_ASTC_6x5x5_OES",
},
{
- 0x8A3F,
- "GL_UNIFORM_BLOCK_BINDING",
+ 0x8B5F, "GL_SAMPLER_3D_OES",
},
{
- 0x00000000,
- "GL_PERFQUERY_SINGLE_CONTEXT_INTEL",
+ 0x8B95, "GL_PALETTE8_RGB8_OES",
},
{
- 0x00000001,
- "GL_SYNC_FLUSH_COMMANDS_BIT_APPLE",
+ 0x9250, "GL_SHADER_BINARY_DMP",
},
{
- 0x9248,
- "GL_OVERLAY_TRANSFORM_ROTATE_90_CHROMIUM",
+ 0x9251, "GL_SMAPHS30_PROGRAM_BINARY_DMP",
},
{
- 0x00000004,
- "GL_GEOMETRY_SHADER_BIT_EXT",
+ 0x9252, "GL_SMAPHS_PROGRAM_BINARY_DMP",
},
{
- 0x1702,
- "GL_TEXTURE",
+ 0x9253, "GL_DMP_PROGRAM_BINARY_DMP",
},
{
- 0x3003,
- "GL_CLIP_DISTANCE3_APPLE",
+ 0x8DC8, "GL_UNSIGNED_INT_VEC4",
},
{
- 0x00000008,
- "GL_TESS_CONTROL_SHADER_BIT_EXT",
+ 0x3000, "GL_CLIP_DISTANCE0_APPLE",
},
{
- 0x8B58,
- "GL_BOOL_VEC3",
+ 0x8C92, "GL_ATC_RGB_AMD",
},
{
- 0x8A3D,
- "GL_UNIFORM_MATRIX_STRIDE",
+ 0x8DC1, "GL_SAMPLER_2D_ARRAY",
},
{
- 0x8828,
- "GL_DRAW_BUFFER3_EXT",
+ 0x9154, "GL_VERTEX_ARRAY_OBJECT_EXT",
},
{
- 0x8DF0,
- "GL_LOW_FLOAT",
+ 0x9153, "GL_QUERY_OBJECT_EXT",
},
{
- 0x1906,
- "GL_ALPHA",
+ 0x8864, "GL_QUERY_COUNTER_BITS_EXT",
},
{
- 0x1907,
- "GL_RGB",
+ 0x9151, "GL_BUFFER_OBJECT_EXT",
},
{
- 0x8FBB,
- "GL_GPU_DISJOINT_EXT",
+ 0x8C93, "GL_ATC_RGBA_EXPLICIT_ALPHA_AMD",
},
{
- 0x1901,
- "GL_STENCIL_INDEX_OES",
+ 0x00000002, "GL_CONTEXT_FLAG_DEBUG_BIT_KHR",
},
{
- 0x1902,
- "GL_DEPTH_COMPONENT",
+ 0x8A3F, "GL_UNIFORM_BLOCK_BINDING",
},
{
- 0x8B56,
- "GL_BOOL",
+ 0x00000000, "GL_PERFQUERY_SINGLE_CONTEXT_INTEL",
},
{
- 0x93DB,
- "GL_COMPRESSED_SRGB8_ALPHA8_ASTC_10x10_KHR",
+ 0x00000001, "GL_SYNC_FLUSH_COMMANDS_BIT_APPLE",
},
{
- 0x8B9B,
- "GL_IMPLEMENTATION_COLOR_READ_FORMAT",
+ 0x9248, "GL_OVERLAY_TRANSFORM_ROTATE_90_CHROMIUM",
},
{
- 0x8B9A,
- "GL_IMPLEMENTATION_COLOR_READ_TYPE",
+ 0x00000004, "GL_GEOMETRY_SHADER_BIT_EXT",
},
{
- 0x93DA,
- "GL_COMPRESSED_SRGB8_ALPHA8_ASTC_10x8_KHR",
+ 0x1702, "GL_TEXTURE",
},
{
- 0x1908,
- "GL_RGBA",
+ 0x3003, "GL_CLIP_DISTANCE3_APPLE",
},
{
- 0x8DF2,
- "GL_HIGH_FLOAT",
+ 0x00000008, "GL_TESS_CONTROL_SHADER_BIT_EXT",
},
{
- 0x93DD,
- "GL_COMPRESSED_SRGB8_ALPHA8_ASTC_12x12_KHR",
+ 0x8B58, "GL_BOOL_VEC3",
},
{
- 0x8827,
- "GL_DRAW_BUFFER2_EXT",
+ 0x8A3D, "GL_UNIFORM_MATRIX_STRIDE",
},
{
- 0x9243,
- "GL_UNPACK_COLORSPACE_CONVERSION_CHROMIUM",
+ 0x8828, "GL_DRAW_BUFFER3_EXT",
},
{
- 0x8DF3,
- "GL_LOW_INT",
+ 0x8DF0, "GL_LOW_FLOAT",
},
{
- 0x82E8,
- "GL_MAX_LABEL_LENGTH_KHR",
+ 0x1906, "GL_ALPHA",
},
{
- 0x82E6,
- "GL_SAMPLER_KHR",
+ 0x1907, "GL_RGB",
},
{
- 0x0C02,
- "GL_READ_BUFFER_EXT",
+ 0x8FBB, "GL_GPU_DISJOINT_EXT",
},
{
- 0x82E3,
- "GL_QUERY_KHR",
+ 0x1901, "GL_STENCIL_INDEX_OES",
},
{
- 0x82E2,
- "GL_PROGRAM_KHR",
+ 0x1902, "GL_DEPTH_COMPONENT",
},
{
- 0x82E1,
- "GL_SHADER_KHR",
+ 0x8B56, "GL_BOOL",
},
{
- 0x8B52,
- "GL_FLOAT_VEC4",
+ 0x93DB, "GL_COMPRESSED_SRGB8_ALPHA8_ASTC_10x10_KHR",
},
{
- 0x8239,
- "GL_RG16I",
+ 0x8B9B, "GL_IMPLEMENTATION_COLOR_READ_FORMAT",
},
{
- 0x8238,
- "GL_RG8UI",
+ 0x8B9A, "GL_IMPLEMENTATION_COLOR_READ_TYPE",
},
{
- 0x8DF6,
- "GL_UNSIGNED_INT_10_10_10_2_OES",
+ 0x93DA, "GL_COMPRESSED_SRGB8_ALPHA8_ASTC_10x8_KHR",
},
{
- 0x8A30,
- "GL_MAX_UNIFORM_BLOCK_SIZE",
+ 0x1908, "GL_RGBA",
},
{
- 0x9273,
- "GL_COMPRESSED_SIGNED_RG11_EAC",
+ 0x8DF2, "GL_HIGH_FLOAT",
},
{
- 0x8231,
- "GL_R8I",
+ 0x93DD, "GL_COMPRESSED_SRGB8_ALPHA8_ASTC_12x12_KHR",
},
{
- 0x8866,
- "GL_QUERY_RESULT_EXT",
+ 0x8827, "GL_DRAW_BUFFER2_EXT",
},
{
- 0x8233,
- "GL_R16I",
+ 0x9243, "GL_UNPACK_COLORSPACE_CONVERSION_CHROMIUM",
},
{
- 0x8DF7,
- "GL_INT_10_10_10_2_OES",
+ 0x8DF3, "GL_LOW_INT",
},
{
- 0x8235,
- "GL_R32I",
+ 0x82E8, "GL_MAX_LABEL_LENGTH_KHR",
},
{
- 0x8234,
- "GL_R16UI",
+ 0x82E6, "GL_SAMPLER_KHR",
},
{
- 0x8237,
- "GL_RG8I",
+ 0x0C02, "GL_READ_BUFFER_EXT",
},
{
- 0x8236,
- "GL_R32UI",
+ 0x82E3, "GL_QUERY_KHR",
},
{
- 0x8B69,
- "GL_FLOAT_MAT4x2_NV",
+ 0x82E2, "GL_PROGRAM_KHR",
},
{
- 0x812D,
- "GL_CLAMP_TO_BORDER_EXT",
+ 0x82E1, "GL_SHADER_KHR",
},
{
- 0x812F,
- "GL_CLAMP_TO_EDGE",
+ 0x8B52, "GL_FLOAT_VEC4",
},
{
- 0x92A4,
- "GL_LINEARDODGE_NV",
+ 0x8239, "GL_RG16I",
},
{
- 0x8DD8,
- "GL_UNSIGNED_INT_SAMPLER_BUFFER_EXT",
+ 0x8238, "GL_RG8UI",
},
{
- 0x8DD9,
- "GL_GEOMETRY_SHADER_EXT",
+ 0x8DF6, "GL_UNSIGNED_INT_10_10_10_2_OES",
},
{
- 0x86A3,
- "GL_COMPRESSED_TEXTURE_FORMATS",
+ 0x8A30, "GL_MAX_UNIFORM_BLOCK_SIZE",
},
{
- 0x8DD4,
- "GL_UNSIGNED_INT_SAMPLER_CUBE",
+ 0x9273, "GL_COMPRESSED_SIGNED_RG11_EAC",
},
{
- 0x9244,
- "GL_BIND_GENERATES_RESOURCE_CHROMIUM",
+ 0x8231, "GL_R8I",
},
{
- 0x8DD2,
- "GL_UNSIGNED_INT_SAMPLER_2D",
+ 0x8866, "GL_QUERY_RESULT_EXT",
},
{
- 0x8DD3,
- "GL_UNSIGNED_INT_SAMPLER_3D",
+ 0x8233, "GL_R16I",
},
{
- 0x8DD0,
- "GL_INT_SAMPLER_BUFFER_EXT",
+ 0x8DF7, "GL_INT_10_10_10_2_OES",
},
{
- 0x86A2,
- "GL_NUM_COMPRESSED_TEXTURE_FORMATS",
+ 0x8235, "GL_R32I",
},
{
- 0x0CF3,
- "GL_UNPACK_SKIP_ROWS_EXT",
+ 0x8234, "GL_R16UI",
},
{
- 0x0CF2,
- "GL_UNPACK_ROW_LENGTH_EXT",
+ 0x8237, "GL_RG8I",
},
{
- 0x140C,
- "GL_FIXED",
+ 0x8236, "GL_R32UI",
},
{
- 0x140B,
- "GL_HALF_FLOAT",
+ 0x8B69, "GL_FLOAT_MAT4x2_NV",
},
{
- 0x8008,
- "GL_MAX_EXT",
+ 0x812D, "GL_CLAMP_TO_BORDER_EXT",
},
{
- 0x0CF5,
- "GL_UNPACK_ALIGNMENT",
+ 0x812F, "GL_CLAMP_TO_EDGE",
},
{
- 0x8867,
- "GL_QUERY_RESULT_AVAILABLE_EXT",
+ 0x92A4, "GL_LINEARDODGE_NV",
},
{
- 0x8D82,
- "GL_RGBA32I",
+ 0x8DD8, "GL_UNSIGNED_INT_SAMPLER_BUFFER_EXT",
},
{
- 0x8009,
- "GL_BLEND_EQUATION",
+ 0x8DD9, "GL_GEOMETRY_SHADER_EXT",
},
{
- 0x911F,
- "GL_BUFFER_ACCESS_FLAGS",
+ 0x86A3, "GL_COMPRESSED_TEXTURE_FORMATS",
},
{
- 0x1401,
- "GL_UNSIGNED_BYTE",
+ 0x8DD4, "GL_UNSIGNED_INT_SAMPLER_CUBE",
},
{
- 0x1400,
- "GL_BYTE",
+ 0x9244, "GL_BIND_GENERATES_RESOURCE_CHROMIUM",
},
{
- 0x1403,
- "GL_UNSIGNED_SHORT",
+ 0x8DD2, "GL_UNSIGNED_INT_SAMPLER_2D",
},
{
- 0x1402,
- "GL_SHORT",
+ 0x8DD3, "GL_UNSIGNED_INT_SAMPLER_3D",
},
{
- 0x1405,
- "GL_UNSIGNED_INT",
+ 0x8DD0, "GL_INT_SAMPLER_BUFFER_EXT",
},
{
- 0x1404,
- "GL_INT",
+ 0x86A2, "GL_NUM_COMPRESSED_TEXTURE_FORMATS",
},
{
- 0x1406,
- "GL_FLOAT",
+ 0x0CF3, "GL_UNPACK_SKIP_ROWS_EXT",
},
{
- 0x8C1D,
- "GL_TEXTURE_BINDING_2D_ARRAY",
+ 0x0CF2, "GL_UNPACK_ROW_LENGTH_EXT",
},
{
- 0x8DDF,
- "GL_MAX_GEOMETRY_UNIFORM_COMPONENTS_EXT",
+ 0x140C, "GL_FIXED",
},
{
- 0x8043,
- "GL_LUMINANCE4_ALPHA4_OES",
+ 0x140B, "GL_HALF_FLOAT",
},
{
- 0x8040,
- "GL_LUMINANCE8_OES",
+ 0x8008, "GL_MAX_EXT",
},
{
- 0x8045,
- "GL_LUMINANCE8_ALPHA8_OES",
+ 0x0CF5, "GL_UNPACK_ALIGNMENT",
},
{
- 0x8CD1,
- "GL_FRAMEBUFFER_ATTACHMENT_OBJECT_NAME",
+ 0x8867, "GL_QUERY_RESULT_AVAILABLE_EXT",
},
{
- 0x00040000,
- "GL_STENCIL_BUFFER_BIT2_QCOM",
+ 0x8D82, "GL_RGBA32I",
},
{
- 0x8CD0,
- "GL_FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE",
+ 0x8009, "GL_BLEND_EQUATION",
},
{
- 0x823A,
- "GL_RG16UI",
+ 0x911F, "GL_BUFFER_ACCESS_FLAGS",
},
{
- 0x8CE4,
- "GL_COLOR_ATTACHMENT4_EXT",
+ 0x1401, "GL_UNSIGNED_BYTE",
},
{
- 0x823B,
- "GL_RG32I",
+ 0x1400, "GL_BYTE",
},
{
- 0x8CD3,
- "GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_CUBE_MAP_FACE",
+ 0x1403, "GL_UNSIGNED_SHORT",
},
{
- 0x846E,
- "GL_ALIASED_LINE_WIDTH_RANGE",
+ 0x1402, "GL_SHORT",
},
{
- 0x0B90,
- "GL_STENCIL_TEST",
+ 0x1405, "GL_UNSIGNED_INT",
},
{
- 0x8CD2,
- "GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_LEVEL",
+ 0x1404, "GL_INT",
},
{
- 0x881C,
- "GL_ALPHA16F_EXT",
+ 0x1406, "GL_FLOAT",
},
{
- 0x928E,
- "GL_SRC_ATOP_NV",
+ 0x8C1D, "GL_TEXTURE_BINDING_2D_ARRAY",
},
{
- 0x8CD4,
- "GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_3D_ZOFFSET_OES",
+ 0x8DDF, "GL_MAX_GEOMETRY_UNIFORM_COMPONENTS_EXT",
},
{
- 0x9113,
- "GL_SYNC_CONDITION_APPLE",
+ 0x8043, "GL_LUMINANCE4_ALPHA4_OES",
},
{
- 0x8CD7,
- "GL_FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT",
+ 0x8040, "GL_LUMINANCE8_OES",
},
{
- 0x08000000,
- "GL_MULTISAMPLE_BUFFER_BIT3_QCOM",
+ 0x8045, "GL_LUMINANCE8_ALPHA8_OES",
},
{
- 0x93A4,
- "GL_PACK_REVERSE_ROW_ORDER_ANGLE",
+ 0x8CD1, "GL_FRAMEBUFFER_ATTACHMENT_OBJECT_NAME",
},
{
- 0x8038,
- "GL_POLYGON_OFFSET_FACTOR",
+ 0x00040000, "GL_STENCIL_BUFFER_BIT2_QCOM",
},
{
- 0x94F9,
- "GL_PERFQUERY_COUNTER_DATA_UINT64_INTEL",
+ 0x8CD0, "GL_FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE",
},
{
- 0x851A,
- "GL_TEXTURE_CUBE_MAP_NEGATIVE_Z",
+ 0x823A, "GL_RG16UI",
},
{
- 0x851C,
- "GL_MAX_CUBE_MAP_TEXTURE_SIZE",
+ 0x8CE4, "GL_COLOR_ATTACHMENT4_EXT",
},
{
- 0x8CD9,
- "GL_FRAMEBUFFER_INCOMPLETE_DIMENSIONS",
+ 0x823B, "GL_RG32I",
},
{
- 0x84CC,
- "GL_TEXTURE12",
+ 0x8CD3, "GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_CUBE_MAP_FACE",
},
{
- 0x0BA2,
- "GL_VIEWPORT",
+ 0x846E, "GL_ALIASED_LINE_WIDTH_RANGE",
},
{
- 0x84CA,
- "GL_TEXTURE10",
+ 0x0B90, "GL_STENCIL_TEST",
},
{
- 0x0BA7,
- "GL_PATH_PROJECTION_MATRIX_CHROMIUM",
+ 0x8CD2, "GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_LEVEL",
},
{
- 0x84CF,
- "GL_TEXTURE15",
+ 0x881C, "GL_ALPHA16F_EXT",
},
{
- 0x84CE,
- "GL_TEXTURE14",
+ 0x928E, "GL_SRC_ATOP_NV",
},
{
- 0x84CD,
- "GL_TEXTURE13",
+ 0x8CD4, "GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_3D_ZOFFSET_OES",
},
{
- 0x83F9,
- "GL_PERFQUERY_DONOT_FLUSH_INTEL",
+ 0x9113, "GL_SYNC_CONDITION_APPLE",
},
{
- 0x9115,
- "GL_SYNC_FLAGS_APPLE",
+ 0x8CD7, "GL_FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT",
},
{
- 0x9286,
- "GL_SRC_NV",
+ 0x08000000, "GL_MULTISAMPLE_BUFFER_BIT3_QCOM",
},
{
- 0x83F3,
- "GL_COMPRESSED_RGBA_S3TC_DXT5_ANGLE",
+ 0x93A4, "GL_PACK_REVERSE_ROW_ORDER_ANGLE",
},
{
- 0x83F2,
- "GL_COMPRESSED_RGBA_S3TC_DXT3_ANGLE",
+ 0x8038, "GL_POLYGON_OFFSET_FACTOR",
},
{
- 0x83F1,
- "GL_COMPRESSED_RGBA_S3TC_DXT1_EXT",
+ 0x94F9, "GL_PERFQUERY_COUNTER_DATA_UINT64_INTEL",
},
{
- 0x9114,
- "GL_SYNC_STATUS_APPLE",
+ 0x851A, "GL_TEXTURE_CUBE_MAP_NEGATIVE_Z",
},
{
- 0x8C0A,
- "GL_SGX_BINARY_IMG",
+ 0x851C, "GL_MAX_CUBE_MAP_TEXTURE_SIZE",
},
{
- 0x93BB,
- "GL_COMPRESSED_RGBA_ASTC_10x10_KHR",
+ 0x8CD9, "GL_FRAMEBUFFER_INCOMPLETE_DIMENSIONS",
},
{
- 0x911C,
- "GL_CONDITION_SATISFIED_APPLE",
+ 0x84CC, "GL_TEXTURE12",
},
{
- 0x911B,
- "GL_TIMEOUT_EXPIRED_APPLE",
+ 0x0BA2, "GL_VIEWPORT",
},
{
- 0x911A,
- "GL_ALREADY_SIGNALED_APPLE",
+ 0x84CA, "GL_TEXTURE10",
},
{
- 0x9284,
- "GL_CONJOINT_NV",
+ 0x78F1, "GL_MAP_CHROMIUM",
},
{
- 0x9124,
- "GL_MAX_GEOMETRY_OUTPUT_COMPONENTS_EXT",
+ 0x84CF, "GL_TEXTURE15",
},
{
- 0x911D,
- "GL_WAIT_FAILED_APPLE",
+ 0x84CE, "GL_TEXTURE14",
},
{
- 0x929A,
- "GL_COLORBURN_KHR",
+ 0x84CD, "GL_TEXTURE13",
},
{
- 0x929B,
- "GL_HARDLIGHT_KHR",
+ 0x83F9, "GL_PERFQUERY_DONOT_FLUSH_INTEL",
},
{
- 0x929C,
- "GL_SOFTLIGHT_KHR",
+ 0x9115, "GL_SYNC_FLAGS_APPLE",
},
{
- 0x846D,
- "GL_ALIASED_POINT_SIZE_RANGE",
+ 0x9286, "GL_SRC_NV",
},
{
- 0x929E,
- "GL_DIFFERENCE_KHR",
+ 0x83F3, "GL_COMPRESSED_RGBA_S3TC_DXT5_ANGLE",
},
{
- 0x929F,
- "GL_MINUS_NV",
+ 0x83F2, "GL_COMPRESSED_RGBA_S3TC_DXT3_ANGLE",
},
{
- 0x9282,
- "GL_UNCORRELATED_NV",
+ 0x83F1, "GL_COMPRESSED_RGBA_S3TC_DXT1_EXT",
},
{
- 0x9298,
- "GL_LIGHTEN_KHR",
+ 0x9114, "GL_SYNC_STATUS_APPLE",
},
{
- 0x9299,
- "GL_COLORDODGE_KHR",
+ 0x8C0A, "GL_SGX_BINARY_IMG",
},
{
- 0x9111,
- "GL_MAX_SERVER_WAIT_TIMEOUT_APPLE",
+ 0x93BB, "GL_COMPRESSED_RGBA_ASTC_10x10_KHR",
},
{
- 0x93A6,
- "GL_PROGRAM_BINARY_ANGLE",
+ 0x911C, "GL_CONDITION_SATISFIED_APPLE",
},
{
- 0x9117,
- "GL_SYNC_GPU_COMMANDS_COMPLETE_APPLE",
+ 0x911B, "GL_TIMEOUT_EXPIRED_APPLE",
},
{
- 0x93A0,
- "GL_TRANSLATED_SHADER_SOURCE_LENGTH_ANGLE",
+ 0x911A, "GL_ALREADY_SIGNALED_APPLE",
},
{
- 0x93A3,
- "GL_FRAMEBUFFER_ATTACHMENT_ANGLE",
+ 0x9284, "GL_CONJOINT_NV",
},
{
- 0x93A2,
- "GL_TEXTURE_USAGE_ANGLE",
+ 0x9124, "GL_MAX_GEOMETRY_OUTPUT_COMPONENTS_EXT",
},
{
- 0x8802,
- "GL_STENCIL_BACK_PASS_DEPTH_FAIL",
+ 0x911D, "GL_WAIT_FAILED_APPLE",
},
{
- 0x9119,
- "GL_SIGNALED_APPLE",
+ 0x929A, "GL_COLORBURN_KHR",
},
{
- 0x9118,
- "GL_UNSIGNALED_APPLE",
+ 0x929B, "GL_HARDLIGHT_KHR",
},
{
- 0x9294,
- "GL_MULTIPLY_KHR",
+ 0x929C, "GL_SOFTLIGHT_KHR",
},
{
- 0x9295,
- "GL_SCREEN_KHR",
+ 0x846D, "GL_ALIASED_POINT_SIZE_RANGE",
},
{
- 0x9296,
- "GL_OVERLAY_KHR",
+ 0x929E, "GL_DIFFERENCE_KHR",
},
{
- 0x9297,
- "GL_DARKEN_KHR",
+ 0x929F, "GL_MINUS_NV",
},
{
- 0x0020,
- "GL_MAP_UNSYNCHRONIZED_BIT_EXT",
+ 0x9282, "GL_UNCORRELATED_NV",
},
{
- 0x8E78,
- "GL_TESS_GEN_VERTEX_ORDER_EXT",
+ 0x9298, "GL_LIGHTEN_KHR",
},
{
- 0x8C01,
- "GL_COMPRESSED_RGB_PVRTC_2BPPV1_IMG",
+ 0x9299, "GL_COLORDODGE_KHR",
},
{
- 0x8C00,
- "GL_COMPRESSED_RGB_PVRTC_4BPPV1_IMG",
+ 0x9111, "GL_MAX_SERVER_WAIT_TIMEOUT_APPLE",
},
{
- 0x8A52,
- "GL_FRAGMENT_SHADER_DISCARDS_SAMPLES_EXT",
+ 0x93A6, "GL_PROGRAM_BINARY_ANGLE",
},
{
- 0x8C02,
- "GL_COMPRESSED_RGBA_PVRTC_4BPPV1_IMG",
+ 0x9117, "GL_SYNC_GPU_COMMANDS_COMPLETE_APPLE",
},
{
- 0x84C9,
- "GL_TEXTURE9",
+ 0x93A0, "GL_TRANSLATED_SHADER_SOURCE_LENGTH_ANGLE",
},
{
- 0x84C8,
- "GL_TEXTURE8",
+ 0x93A3, "GL_FRAMEBUFFER_ATTACHMENT_ANGLE",
},
{
- 0x8869,
- "GL_MAX_VERTEX_ATTRIBS",
+ 0x93A2, "GL_TEXTURE_USAGE_ANGLE",
},
{
- 0x84C3,
- "GL_TEXTURE3",
+ 0x8802, "GL_STENCIL_BACK_PASS_DEPTH_FAIL",
},
{
- 0x84C2,
- "GL_TEXTURE2",
+ 0x9119, "GL_SIGNALED_APPLE",
},
{
- 0x84C1,
- "GL_TEXTURE1",
+ 0x9118, "GL_UNSIGNALED_APPLE",
},
{
- 0x84C0,
- "GL_TEXTURE0",
+ 0x9294, "GL_MULTIPLY_KHR",
},
{
- 0x84C7,
- "GL_TEXTURE7",
+ 0x9295, "GL_SCREEN_KHR",
},
{
- 0x84C6,
- "GL_TEXTURE6",
+ 0x9296, "GL_OVERLAY_KHR",
},
{
- 0x84C5,
- "GL_TEXTURE5",
+ 0x9297, "GL_DARKEN_KHR",
},
{
- 0x8803,
- "GL_STENCIL_BACK_PASS_DEPTH_PASS",
+ 0x0020, "GL_MAP_UNSYNCHRONIZED_BIT_EXT",
},
{
- 0x928A,
- "GL_SRC_IN_NV",
+ 0x8E78, "GL_TESS_GEN_VERTEX_ORDER_EXT",
},
{
- 0x8518,
- "GL_TEXTURE_CUBE_MAP_NEGATIVE_Y",
+ 0x8C01, "GL_COMPRESSED_RGB_PVRTC_2BPPV1_IMG",
},
{
- 0x8519,
- "GL_TEXTURE_CUBE_MAP_POSITIVE_Z",
+ 0x8C00, "GL_COMPRESSED_RGB_PVRTC_4BPPV1_IMG",
},
{
- 0x8514,
- "GL_TEXTURE_BINDING_CUBE_MAP",
+ 0x8A52, "GL_FRAGMENT_SHADER_DISCARDS_SAMPLES_EXT",
},
{
- 0x8515,
- "GL_TEXTURE_CUBE_MAP_POSITIVE_X",
+ 0x8C02, "GL_COMPRESSED_RGBA_PVRTC_4BPPV1_IMG",
},
{
- 0x8516,
- "GL_TEXTURE_CUBE_MAP_NEGATIVE_X",
+ 0x84C9, "GL_TEXTURE9",
},
{
- 0x8517,
- "GL_TEXTURE_CUBE_MAP_POSITIVE_Y",
+ 0x84C8, "GL_TEXTURE8",
},
{
- 0x8218,
- "GL_FRAMEBUFFER_DEFAULT",
+ 0x8869, "GL_MAX_VERTEX_ATTRIBS",
},
{
- 0x8513,
- "GL_TEXTURE_CUBE_MAP",
+ 0x84C3, "GL_TEXTURE3",
},
{
- 0x8626,
- "GL_CURRENT_VERTEX_ATTRIB",
+ 0x84C2, "GL_TEXTURE2",
},
{
- 0x92B1,
- "GL_PLUS_CLAMPED_NV",
+ 0x84C1, "GL_TEXTURE1",
},
{
- 0x92B0,
- "GL_HSL_LUMINOSITY_KHR",
+ 0x84C0, "GL_TEXTURE0",
},
{
- 0x92B3,
- "GL_MINUS_CLAMPED_NV",
+ 0x84C7, "GL_TEXTURE7",
},
{
- 0x92B2,
- "GL_PLUS_CLAMPED_ALPHA_NV",
+ 0x84C6, "GL_TEXTURE6",
},
{
- 0x8765,
- "GL_BUFFER_USAGE",
+ 0x84C5, "GL_TEXTURE5",
},
{
- 0x8764,
- "GL_BUFFER_SIZE",
+ 0x8803, "GL_STENCIL_BACK_PASS_DEPTH_PASS",
},
{
- 0x8B99,
- "GL_PALETTE8_RGB5_A1_OES",
+ 0x928A, "GL_SRC_IN_NV",
},
{
- 0x0503,
- "GL_STACK_OVERFLOW_KHR",
+ 0x8518, "GL_TEXTURE_CUBE_MAP_NEGATIVE_Y",
},
{
- 0x0502,
- "GL_INVALID_OPERATION",
+ 0x8519, "GL_TEXTURE_CUBE_MAP_POSITIVE_Z",
},
{
- 0x0501,
- "GL_INVALID_VALUE",
+ 0x8514, "GL_TEXTURE_BINDING_CUBE_MAP",
},
{
- 0x0500,
- "GL_INVALID_ENUM",
+ 0x8515, "GL_TEXTURE_CUBE_MAP_POSITIVE_X",
},
{
- 0x0507,
- "GL_CONTEXT_LOST_KHR",
+ 0x8516, "GL_TEXTURE_CUBE_MAP_NEGATIVE_X",
},
{
- 0x0506,
- "GL_INVALID_FRAMEBUFFER_OPERATION",
+ 0x8517, "GL_TEXTURE_CUBE_MAP_POSITIVE_Y",
},
{
- 0x0505,
- "GL_OUT_OF_MEMORY",
+ 0x8218, "GL_FRAMEBUFFER_DEFAULT",
},
{
- 0x0504,
- "GL_STACK_UNDERFLOW_KHR",
+ 0x8513, "GL_TEXTURE_CUBE_MAP",
},
{
- 0x0CF4,
- "GL_UNPACK_SKIP_PIXELS_EXT",
+ 0x8626, "GL_CURRENT_VERTEX_ATTRIB",
},
{
- 0x0B44,
- "GL_CULL_FACE",
+ 0x92B1, "GL_PLUS_CLAMPED_NV",
},
{
- 0x8B5E,
- "GL_SAMPLER_2D",
+ 0x92B0, "GL_HSL_LUMINOSITY_KHR",
},
{
- 0x0B46,
- "GL_FRONT_FACE",
+ 0x92B3, "GL_MINUS_CLAMPED_NV",
},
{
- 0x8FB3,
- "GL_RENDER_DIRECT_TO_FRAMEBUFFER_QCOM",
+ 0x92B2, "GL_PLUS_CLAMPED_ALPHA_NV",
},
{
- 0x824A,
- "GL_DEBUG_SOURCE_APPLICATION_KHR",
+ 0x8765, "GL_BUFFER_USAGE",
},
{
- 0x824B,
- "GL_DEBUG_SOURCE_OTHER_KHR",
+ 0x8764, "GL_BUFFER_SIZE",
},
{
- 0x824C,
- "GL_DEBUG_TYPE_ERROR_KHR",
+ 0x8B99, "GL_PALETTE8_RGB5_A1_OES",
},
{
- 0x824D,
- "GL_DEBUG_TYPE_DEPRECATED_BEHAVIOR_KHR",
+ 0x0503, "GL_STACK_OVERFLOW_KHR",
},
{
- 0x824E,
- "GL_DEBUG_TYPE_UNDEFINED_BEHAVIOR_KHR",
+ 0x0502, "GL_INVALID_OPERATION",
},
{
- 0x824F,
- "GL_DEBUG_TYPE_PORTABILITY_KHR",
+ 0x0501, "GL_INVALID_VALUE",
},
{
- 0x8DD7,
- "GL_UNSIGNED_INT_SAMPLER_2D_ARRAY",
+ 0x0500, "GL_INVALID_ENUM",
},
{
- 0x8B31,
- "GL_VERTEX_SHADER",
+ 0x0507, "GL_CONTEXT_LOST_KHR",
},
{
- 0x8B30,
- "GL_FRAGMENT_SHADER",
+ 0x0506, "GL_INVALID_FRAMEBUFFER_OPERATION",
},
{
- 0x8FB1,
- "GL_CPU_OPTIMIZED_QCOM",
+ 0x0505, "GL_OUT_OF_MEMORY",
},
{
- 0x93D2,
- "GL_COMPRESSED_SRGB8_ALPHA8_ASTC_5x5_KHR",
+ 0x0504, "GL_STACK_UNDERFLOW_KHR",
},
{
- 0x82FB,
- "GL_CONTEXT_RELEASE_BEHAVIOR_KHR",
+ 0x0CF4, "GL_UNPACK_SKIP_PIXELS_EXT",
},
{
- 0x8B5A,
- "GL_FLOAT_MAT2",
+ 0x0B44, "GL_CULL_FACE",
},
{
- 0x84D8,
- "GL_TEXTURE24",
+ 0x8B5E, "GL_SAMPLER_2D",
},
{
- 0x84D9,
- "GL_TEXTURE25",
+ 0x0B46, "GL_FRONT_FACE",
},
{
- 0x84D6,
- "GL_TEXTURE22",
+ 0x8FB3, "GL_RENDER_DIRECT_TO_FRAMEBUFFER_QCOM",
},
{
- 0x84D7,
- "GL_TEXTURE23",
+ 0x824A, "GL_DEBUG_SOURCE_APPLICATION_KHR",
},
{
- 0x84D4,
- "GL_TEXTURE20",
+ 0x824B, "GL_DEBUG_SOURCE_OTHER_KHR",
},
{
- 0x0D05,
- "GL_PACK_ALIGNMENT",
+ 0x824C, "GL_DEBUG_TYPE_ERROR_KHR",
},
{
- 0x84D2,
- "GL_TEXTURE18",
+ 0x824D, "GL_DEBUG_TYPE_DEPRECATED_BEHAVIOR_KHR",
},
{
- 0x84D3,
- "GL_TEXTURE19",
+ 0x824E, "GL_DEBUG_TYPE_UNDEFINED_BEHAVIOR_KHR",
},
{
- 0x84D0,
- "GL_TEXTURE16",
+ 0x824F, "GL_DEBUG_TYPE_PORTABILITY_KHR",
},
{
- 0x84D1,
- "GL_TEXTURE17",
+ 0x8DD7, "GL_UNSIGNED_INT_SAMPLER_2D_ARRAY",
},
{
- 0x93D1,
- "GL_COMPRESSED_SRGB8_ALPHA8_ASTC_5x4_KHR",
+ 0x8B31, "GL_VERTEX_SHADER",
},
{
- 0x84DF,
- "GL_TEXTURE31",
+ 0x8B30, "GL_FRAGMENT_SHADER",
},
{
- 0x8B97,
- "GL_PALETTE8_R5_G6_B5_OES",
+ 0x8FB1, "GL_CPU_OPTIMIZED_QCOM",
},
{
- 0x84DD,
- "GL_TEXTURE29",
+ 0x93D2, "GL_COMPRESSED_SRGB8_ALPHA8_ASTC_5x5_KHR",
},
{
- 0x84DE,
- "GL_TEXTURE30",
+ 0x82FB, "GL_CONTEXT_RELEASE_BEHAVIOR_KHR",
},
{
- 0x84DB,
- "GL_TEXTURE27",
+ 0x8B5A, "GL_FLOAT_MAT2",
},
{
- 0x84DC,
- "GL_TEXTURE28",
+ 0x84D8, "GL_TEXTURE24",
},
{
- 0x6002,
- "GL_TEXTURE_POOL_UNMANAGED_CHROMIUM",
+ 0x84D9, "GL_TEXTURE25",
},
{
- 0x84DA,
- "GL_TEXTURE26",
+ 0x84D6, "GL_TEXTURE22",
},
{
- 0x8242,
- "GL_DEBUG_OUTPUT_SYNCHRONOUS_KHR",
+ 0x84D7, "GL_TEXTURE23",
},
{
- 0x8243,
- "GL_DEBUG_NEXT_LOGGED_MESSAGE_LENGTH_KHR",
+ 0x84D4, "GL_TEXTURE20",
},
{
- 0x8244,
- "GL_DEBUG_CALLBACK_FUNCTION_KHR",
+ 0x0D05, "GL_PACK_ALIGNMENT",
},
{
- 0x8245,
- "GL_DEBUG_CALLBACK_USER_PARAM_KHR",
+ 0x84D2, "GL_TEXTURE18",
},
{
- 0x8246,
- "GL_DEBUG_SOURCE_API_KHR",
+ 0x84D3, "GL_TEXTURE19",
},
{
- 0x8247,
- "GL_DEBUG_SOURCE_WINDOW_SYSTEM_KHR",
+ 0x84D0, "GL_TEXTURE16",
},
{
- 0x8248,
- "GL_DEBUG_SOURCE_SHADER_COMPILER_KHR",
+ 0x84D1, "GL_TEXTURE17",
},
{
- 0x8249,
- "GL_DEBUG_SOURCE_THIRD_PARTY_KHR",
+ 0x93D1, "GL_COMPRESSED_SRGB8_ALPHA8_ASTC_5x4_KHR",
},
{
- 0x8B94,
- "GL_PALETTE4_RGB5_A1_OES",
+ 0x84DF, "GL_TEXTURE31",
},
{
- 0x94F4,
- "GL_PERFQUERY_COUNTER_RAW_INTEL",
+ 0x8B97, "GL_PALETTE8_R5_G6_B5_OES",
},
{
- 0x823C,
- "GL_RG32UI",
+ 0x84DD, "GL_TEXTURE29",
},
{
- 0x8A29,
- "GL_UNIFORM_BUFFER_START",
+ 0x84DE, "GL_TEXTURE30",
},
{
- 0x8A28,
- "GL_UNIFORM_BUFFER_BINDING",
+ 0x84DB, "GL_TEXTURE27",
},
{
- 0x92BE,
- "GL_PRIMITIVE_BOUNDING_BOX_EXT",
+ 0x84DC, "GL_TEXTURE28",
},
{
- 0x8645,
- "GL_VERTEX_ATTRIB_ARRAY_POINTER",
+ 0x6002, "GL_TEXTURE_POOL_UNMANAGED_CHROMIUM",
},
{
- 0x8865,
- "GL_CURRENT_QUERY_EXT",
+ 0x84DA, "GL_TEXTURE26",
},
{
- 0x8E5B,
- "GL_MIN_FRAGMENT_INTERPOLATION_OFFSET_OES",
+ 0x8242, "GL_DEBUG_OUTPUT_SYNCHRONOUS_KHR",
},
{
- 0x8E5C,
- "GL_MAX_FRAGMENT_INTERPOLATION_OFFSET_OES",
+ 0x8243, "GL_DEBUG_NEXT_LOGGED_MESSAGE_LENGTH_KHR",
},
{
- 0x8E5D,
- "GL_FRAGMENT_INTERPOLATION_OFFSET_BITS_OES",
+ 0x8244, "GL_DEBUG_CALLBACK_FUNCTION_KHR",
},
{
- 0x906A,
- "GL_UNSIGNED_INT_IMAGE_CUBE_MAP_ARRAY_EXT",
+ 0x8245, "GL_DEBUG_CALLBACK_USER_PARAM_KHR",
},
{
- 0x906F,
- "GL_RGB10_A2UI",
+ 0x8246, "GL_DEBUG_SOURCE_API_KHR",
},
{
- 0x8E72,
- "GL_PATCH_VERTICES_EXT",
+ 0x8247, "GL_DEBUG_SOURCE_WINDOW_SYSTEM_KHR",
},
{
- 0x8BD3,
- "GL_TEXTURE_HEIGHT_QCOM",
+ 0x8248, "GL_DEBUG_SOURCE_SHADER_COMPILER_KHR",
},
{
- 0x87FA,
- "GL_3DC_XY_AMD",
+ 0x8249, "GL_DEBUG_SOURCE_THIRD_PARTY_KHR",
},
{
- 0x84C4,
- "GL_TEXTURE4",
+ 0x8B94, "GL_PALETTE4_RGB5_A1_OES",
},
{
- 0x821C,
- "GL_MINOR_VERSION",
+ 0x94F4, "GL_PERFQUERY_COUNTER_RAW_INTEL",
},
{
- 0x8E8A,
- "GL_MAX_TESS_EVALUATION_UNIFORM_BLOCKS_EXT",
+ 0x823C, "GL_RG32UI",
},
{
- 0x85B5,
- "GL_VERTEX_ARRAY_BINDING_OES",
+ 0x8A29, "GL_UNIFORM_BUFFER_START",
},
{
- 0x8253,
- "GL_GUILTY_CONTEXT_RESET_KHR",
+ 0x8A28, "GL_UNIFORM_BUFFER_BINDING",
},
{
- 0x8D6B,
- "GL_MAX_ELEMENT_INDEX",
+ 0x92BE, "GL_PRIMITIVE_BOUNDING_BOX_EXT",
},
{
- 0x8D6C,
- "GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_SAMPLES_EXT",
+ 0x8645, "GL_VERTEX_ATTRIB_ARRAY_POINTER",
},
{
- 0x92A1,
- "GL_CONTRAST_NV",
+ 0x8865, "GL_CURRENT_QUERY_EXT",
},
{
- 0x8252,
- "GL_LOSE_CONTEXT_ON_RESET_KHR",
+ 0x8E5B, "GL_MIN_FRAGMENT_INTERPOLATION_OFFSET_OES",
},
{
- 0x8C4C,
- "GL_COMPRESSED_SRGB_S3TC_DXT1_NV",
+ 0x8E5C, "GL_MAX_FRAGMENT_INTERPOLATION_OFFSET_OES",
},
{
- 0x8C4E,
- "GL_COMPRESSED_SRGB_ALPHA_S3TC_DXT3_NV",
+ 0x8E5D, "GL_FRAGMENT_INTERPOLATION_OFFSET_BITS_OES",
},
{
- 0x8251,
- "GL_DEBUG_TYPE_OTHER_KHR",
+ 0x906A, "GL_UNSIGNED_INT_IMAGE_CUBE_MAP_ARRAY_EXT",
},
{
- 0x8C4F,
- "GL_COMPRESSED_SRGB_ALPHA_S3TC_DXT5_NV",
+ 0x906F, "GL_RGB10_A2UI",
},
{
- 0x9309,
- "GL_REFERENCED_BY_GEOMETRY_SHADER_EXT",
+ 0x8E72, "GL_PATCH_VERTICES_EXT",
},
{
- 0x93E9,
- "GL_COMPRESSED_SRGB8_ALPHA8_ASTC_6x6x6_OES",
+ 0x8BD3, "GL_TEXTURE_HEIGHT_QCOM",
},
{
- 0x93E8,
- "GL_COMPRESSED_SRGB8_ALPHA8_ASTC_6x6x5_OES",
+ 0x87FA, "GL_3DC_XY_AMD",
},
{
- 0x8C43,
- "GL_SRGB8_ALPHA8_EXT",
+ 0x84C4, "GL_TEXTURE4",
},
{
- 0x8C42,
- "GL_SRGB_ALPHA_EXT",
+ 0x1A, "GL_CONIC_CURVE_TO_CHROMIUM",
},
{
- 0x8C45,
- "GL_SLUMINANCE8_ALPHA8_NV",
+ 0x821C, "GL_MINOR_VERSION",
},
{
- 0x8C44,
- "GL_SLUMINANCE_ALPHA_NV",
+ 0x8E8A, "GL_MAX_TESS_EVALUATION_UNIFORM_BLOCKS_EXT",
},
{
- 0x8C47,
- "GL_SLUMINANCE8_NV",
+ 0x85B5, "GL_VERTEX_ARRAY_BINDING_OES",
},
{
- 0x8C46,
- "GL_SLUMINANCE_NV",
+ 0x8253, "GL_GUILTY_CONTEXT_RESET_KHR",
},
{
- 0x93E1,
- "GL_COMPRESSED_SRGB8_ALPHA8_ASTC_4x3x3_OES",
+ 0x8D6B, "GL_MAX_ELEMENT_INDEX",
},
{
- 0x93E0,
- "GL_COMPRESSED_SRGB8_ALPHA8_ASTC_3x3x3_OES",
+ 0x8D6C, "GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_SAMPLES_EXT",
},
{
- 0x93E3,
- "GL_COMPRESSED_SRGB8_ALPHA8_ASTC_4x4x4_OES",
+ 0x92A1, "GL_CONTRAST_NV",
},
{
- 0x93E2,
- "GL_COMPRESSED_SRGB8_ALPHA8_ASTC_4x4x3_OES",
+ 0x8252, "GL_LOSE_CONTEXT_ON_RESET_KHR",
},
{
- 0x93E5,
- "GL_COMPRESSED_SRGB8_ALPHA8_ASTC_5x5x4_OES",
+ 0x8C4C, "GL_COMPRESSED_SRGB_S3TC_DXT1_NV",
},
{
- 0x93E4,
- "GL_COMPRESSED_SRGB8_ALPHA8_ASTC_5x4x4_OES",
+ 0x8C4E, "GL_COMPRESSED_SRGB_ALPHA_S3TC_DXT3_NV",
},
{
- 0x93E7,
- "GL_COMPRESSED_SRGB8_ALPHA8_ASTC_6x5x5_OES",
+ 0x8251, "GL_DEBUG_TYPE_OTHER_KHR",
},
{
- 0x93E6,
- "GL_COMPRESSED_SRGB8_ALPHA8_ASTC_5x5x5_OES",
+ 0x8C4F, "GL_COMPRESSED_SRGB_ALPHA_S3TC_DXT5_NV",
},
{
- 0x8D68,
- "GL_REQUIRED_TEXTURE_IMAGE_UNITS_OES",
+ 0x9309, "GL_REFERENCED_BY_GEOMETRY_SHADER_EXT",
},
{
- 0x8E82,
- "GL_MAX_TESS_EVALUATION_TEXTURE_IMAGE_UNITS_EXT",
+ 0x93E9, "GL_COMPRESSED_SRGB8_ALPHA8_ASTC_6x6x6_OES",
},
{
- 0x8E81,
- "GL_MAX_TESS_CONTROL_TEXTURE_IMAGE_UNITS_EXT",
+ 0x93E8, "GL_COMPRESSED_SRGB8_ALPHA8_ASTC_6x6x5_OES",
},
{
- 0x85BB,
- "GL_UNSIGNED_SHORT_8_8_REV_APPLE",
+ 0x8C43, "GL_SRGB8_ALPHA8_EXT",
},
{
- 0x8E87,
- "GL_TESS_EVALUATION_SHADER_EXT",
+ 0x8C42, "GL_SRGB_ALPHA_EXT",
},
{
- 0x8E86,
- "GL_MAX_TESS_EVALUATION_OUTPUT_COMPONENTS_EXT",
+ 0x8C45, "GL_SLUMINANCE8_ALPHA8_NV",
},
{
- 0x8E85,
- "GL_MAX_TESS_CONTROL_TOTAL_OUTPUT_COMPONENTS_EXT",
+ 0x8C44, "GL_SLUMINANCE_ALPHA_NV",
},
{
- 0x8E84,
- "GL_MAX_TESS_PATCH_COMPONENTS_EXT",
+ 0x8C47, "GL_SLUMINANCE8_NV",
},
{
- 0x8D61,
- "GL_HALF_FLOAT_OES",
+ 0x8C46, "GL_SLUMINANCE_NV",
},
{
- 0x8D62,
- "GL_RGB565",
+ 0x93E1, "GL_COMPRESSED_SRGB8_ALPHA8_ASTC_4x3x3_OES",
},
{
- 0x8E88,
- "GL_TESS_CONTROL_SHADER_EXT",
+ 0x93E0, "GL_COMPRESSED_SRGB8_ALPHA8_ASTC_3x3x3_OES",
},
{
- 0x8D64,
- "GL_ETC1_RGB8_OES",
+ 0x93E3, "GL_COMPRESSED_SRGB8_ALPHA8_ASTC_4x4x4_OES",
},
{
- 0x8D65,
- "GL_TEXTURE_EXTERNAL_OES",
+ 0x93E2, "GL_COMPRESSED_SRGB8_ALPHA8_ASTC_4x4x3_OES",
},
{
- 0x8D66,
- "GL_SAMPLER_EXTERNAL_OES",
+ 0x93E5, "GL_COMPRESSED_SRGB8_ALPHA8_ASTC_5x5x4_OES",
},
{
- 0x8D67,
- "GL_TEXTURE_BINDING_EXTERNAL_OES",
+ 0x93E4, "GL_COMPRESSED_SRGB8_ALPHA8_ASTC_5x4x4_OES",
},
{
- 0x10000000,
- "GL_MULTISAMPLE_BUFFER_BIT4_QCOM",
+ 0x93E7, "GL_COMPRESSED_SRGB8_ALPHA8_ASTC_6x5x5_OES",
},
{
- 0x04000000,
- "GL_MULTISAMPLE_BUFFER_BIT2_QCOM",
+ 0x93E6, "GL_COMPRESSED_SRGB8_ALPHA8_ASTC_5x5x5_OES",
},
{
- 0x90D7,
- "GL_MAX_GEOMETRY_SHADER_STORAGE_BLOCKS_EXT",
+ 0x8D68, "GL_REQUIRED_TEXTURE_IMAGE_UNITS_OES",
},
{
- 0x90D9,
- "GL_MAX_TESS_EVALUATION_SHADER_STORAGE_BLOCKS_EXT",
+ 0x8E82, "GL_MAX_TESS_EVALUATION_TEXTURE_IMAGE_UNITS_EXT",
},
{
- 0x90D8,
- "GL_MAX_TESS_CONTROL_SHADER_STORAGE_BLOCKS_EXT",
+ 0x8E81, "GL_MAX_TESS_CONTROL_TEXTURE_IMAGE_UNITS_EXT",
},
{
- 0x8CEE,
- "GL_COLOR_ATTACHMENT14_EXT",
+ 0x85BB, "GL_UNSIGNED_SHORT_8_8_REV_APPLE",
},
{
- 0x8DC7,
- "GL_UNSIGNED_INT_VEC3",
+ 0x8E87, "GL_TESS_EVALUATION_SHADER_EXT",
},
{
- 0x1701,
- "GL_PATH_PROJECTION_CHROMIUM",
+ 0x8E86, "GL_MAX_TESS_EVALUATION_OUTPUT_COMPONENTS_EXT",
},
{
- 0x2800,
- "GL_TEXTURE_MAG_FILTER",
+ 0x8E85, "GL_MAX_TESS_CONTROL_TOTAL_OUTPUT_COMPONENTS_EXT",
},
{
- 0x2801,
- "GL_TEXTURE_MIN_FILTER",
+ 0x8E84, "GL_MAX_TESS_PATCH_COMPONENTS_EXT",
},
{
- 0x2802,
- "GL_TEXTURE_WRAP_S",
+ 0x8D61, "GL_HALF_FLOAT_OES",
},
{
- 0x2803,
- "GL_TEXTURE_WRAP_T",
+ 0x8D62, "GL_RGB565",
},
{
- 0x8DCB,
- "GL_INT_SAMPLER_3D",
+ 0x8E88, "GL_TESS_CONTROL_SHADER_EXT",
},
{
- 0x3007,
- "GL_CLIP_DISTANCE7_APPLE",
+ 0x8D64, "GL_ETC1_RGB8_OES",
},
{
- 0x2703,
- "GL_LINEAR_MIPMAP_LINEAR",
+ 0x8D65, "GL_TEXTURE_EXTERNAL_OES",
},
{
- 0x3005,
- "GL_CLIP_DISTANCE5_APPLE",
+ 0x8D66, "GL_SAMPLER_EXTERNAL_OES",
},
{
- 0x3004,
- "GL_CLIP_DISTANCE4_APPLE",
+ 0x8D67, "GL_TEXTURE_BINDING_EXTERNAL_OES",
},
{
- 0x8B98,
- "GL_PALETTE8_RGBA4_OES",
+ 0x10000000, "GL_MULTISAMPLE_BUFFER_BIT4_QCOM",
},
{
- 0x3002,
- "GL_CLIP_DISTANCE2_APPLE",
+ 0x04000000, "GL_MULTISAMPLE_BUFFER_BIT2_QCOM",
},
{
- 0x3001,
- "GL_CLIP_DISTANCE1_APPLE",
+ 0x90D7, "GL_MAX_GEOMETRY_SHADER_STORAGE_BLOCKS_EXT",
},
{
- 0x2702,
- "GL_NEAREST_MIPMAP_LINEAR",
+ 0x90D9, "GL_MAX_TESS_EVALUATION_SHADER_STORAGE_BLOCKS_EXT",
},
{
- 0x1F03,
- "GL_EXTENSIONS",
+ 0x90D8, "GL_MAX_TESS_CONTROL_SHADER_STORAGE_BLOCKS_EXT",
},
{
- 0x1F02,
- "GL_VERSION",
+ 0x8CEE, "GL_COLOR_ATTACHMENT14_EXT",
},
{
- 0x1F01,
- "GL_RENDERER",
+ 0x8DC7, "GL_UNSIGNED_INT_VEC3",
},
{
- 0x1F00,
- "GL_VENDOR",
+ 0x90A6, "GL_BEVEL_CHROMIUM",
},
{
- 0x9247,
- "GL_OVERLAY_TRANSFORM_FLIP_VERTICAL_CHROMIUM",
+ 0x1701, "GL_PATH_PROJECTION_CHROMIUM",
},
{
- 0x2701,
- "GL_LINEAR_MIPMAP_NEAREST",
+ 0x2800, "GL_TEXTURE_MAG_FILTER",
},
{
- 0x9245,
- "GL_OVERLAY_TRANSFORM_NONE_CHROMIUM",
+ 0x2801, "GL_TEXTURE_MIN_FILTER",
},
{
- 0x92B4,
- "GL_INVERT_OVG_NV",
+ 0x2802, "GL_TEXTURE_WRAP_S",
},
{
- 0x9249,
- "GL_OVERLAY_TRANSFORM_ROTATE_180_CHROMIUM",
+ 0x2803, "GL_TEXTURE_WRAP_T",
},
{
- 0x0B94,
- "GL_STENCIL_FAIL",
+ 0x8DCB, "GL_INT_SAMPLER_3D",
},
{
- 0x8B4A,
- "GL_MAX_VERTEX_UNIFORM_COMPONENTS",
+ 0x3007, "GL_CLIP_DISTANCE7_APPLE",
},
{
- 0x8B4B,
- "GL_MAX_VARYING_COMPONENTS",
+ 0x2703, "GL_LINEAR_MIPMAP_LINEAR",
},
{
- 0x8B4C,
- "GL_MAX_VERTEX_TEXTURE_IMAGE_UNITS",
+ 0x3005, "GL_CLIP_DISTANCE5_APPLE",
},
{
- 0x8B4D,
- "GL_MAX_COMBINED_TEXTURE_IMAGE_UNITS",
+ 0x3004, "GL_CLIP_DISTANCE4_APPLE",
},
{
- 0x8B4F,
- "GL_SHADER_TYPE",
+ 0x8B98, "GL_PALETTE8_RGBA4_OES",
},
{
- 0x9122,
- "GL_MAX_VERTEX_OUTPUT_COMPONENTS",
+ 0x3002, "GL_CLIP_DISTANCE2_APPLE",
},
{
- 0x9123,
- "GL_MAX_GEOMETRY_INPUT_COMPONENTS_EXT",
+ 0x3001, "GL_CLIP_DISTANCE1_APPLE",
},
{
- 0x83FB,
- "GL_PERFQUERY_WAIT_INTEL",
+ 0x2702, "GL_NEAREST_MIPMAP_LINEAR",
},
{
- 0x9121,
- "GL_BUFFER_MAP_OFFSET",
+ 0x1F03, "GL_EXTENSIONS",
},
{
- 0x00004000,
- "GL_COLOR_BUFFER_BIT",
+ 0x1F02, "GL_VERSION",
},
{
- 0x9125,
- "GL_MAX_FRAGMENT_INPUT_COMPONENTS",
+ 0x1F01, "GL_RENDERER",
},
{
- 0x00000010,
- "GL_TESS_EVALUATION_SHADER_BIT_EXT",
+ 0x1F00, "GL_VENDOR",
},
{
- 0x8834,
- "GL_DRAW_BUFFER15_EXT",
+ 0x9247, "GL_OVERLAY_TRANSFORM_FLIP_VERTICAL_CHROMIUM",
},
{
- 0x8833,
- "GL_DRAW_BUFFER14_EXT",
+ 0x2701, "GL_LINEAR_MIPMAP_NEAREST",
},
{
- 0x8832,
- "GL_DRAW_BUFFER13_EXT",
+ 0x9245, "GL_OVERLAY_TRANSFORM_NONE_CHROMIUM",
},
{
- 0x8831,
- "GL_DRAW_BUFFER12_EXT",
+ 0x92B4, "GL_INVERT_OVG_NV",
},
{
- 0x8830,
- "GL_DRAW_BUFFER11_EXT",
+ 0x9249, "GL_OVERLAY_TRANSFORM_ROTATE_180_CHROMIUM",
},
{
- 0x8DC5,
- "GL_SAMPLER_CUBE_SHADOW_NV",
+ 0x0B94, "GL_STENCIL_FAIL",
},
{
- 0x94FF,
- "GL_PERFQUERY_COUNTER_DESC_LENGTH_MAX_INTEL",
+ 0x8B4A, "GL_MAX_VERTEX_UNIFORM_COMPONENTS",
},
{
- 0x94FE,
- "GL_PERFQUERY_COUNTER_NAME_LENGTH_MAX_INTEL",
+ 0x8B4B, "GL_MAX_VARYING_COMPONENTS",
},
{
- 0x94FD,
- "GL_PERFQUERY_QUERY_NAME_LENGTH_MAX_INTEL",
+ 0x8B4C, "GL_MAX_VERTEX_TEXTURE_IMAGE_UNITS",
},
{
- 0x94FC,
- "GL_PERFQUERY_COUNTER_DATA_BOOL32_INTEL",
+ 0x8B4D, "GL_MAX_COMBINED_TEXTURE_IMAGE_UNITS",
},
{
- 0x94FB,
- "GL_PERFQUERY_COUNTER_DATA_DOUBLE_INTEL",
+ 0x8B4F, "GL_SHADER_TYPE",
},
{
- 0x93B8,
- "GL_COMPRESSED_RGBA_ASTC_10x5_KHR",
+ 0x9122, "GL_MAX_VERTEX_OUTPUT_COMPONENTS",
},
{
- 0x8B65,
- "GL_FLOAT_MAT2x3_NV",
+ 0x9123, "GL_MAX_GEOMETRY_INPUT_COMPONENTS_EXT",
},
{
- 0x00010000,
- "GL_STENCIL_BUFFER_BIT0_QCOM",
+ 0x83FB, "GL_PERFQUERY_WAIT_INTEL",
},
{
- 0x83FA,
- "GL_PERFQUERY_FLUSH_INTEL",
+ 0x9121, "GL_BUFFER_MAP_OFFSET",
},
{
- 0x0D03,
- "GL_PACK_SKIP_ROWS",
+ 0x9089, "GL_COUNT_DOWN_CHROMIUM",
},
{
- 0x84F3,
- "GL_FENCE_STATUS_NV",
+ 0x9088, "GL_COUNT_UP_CHROMIUM",
},
{
- 0x88E6,
- "GL_STATIC_COPY",
+ 0x00004000, "GL_COLOR_BUFFER_BIT",
},
{
- 0x0B93,
- "GL_STENCIL_VALUE_MASK",
+ 0x9125, "GL_MAX_FRAGMENT_INPUT_COMPONENTS",
},
{
- 0x0B92,
- "GL_STENCIL_FUNC",
+ 0x00000010, "GL_TESS_EVALUATION_SHADER_BIT_EXT",
},
{
- 0x0B91,
- "GL_STENCIL_CLEAR_VALUE",
+ 0x8834, "GL_DRAW_BUFFER15_EXT",
},
{
- 0x883D,
- "GL_BLEND_EQUATION_ALPHA",
+ 0x8833, "GL_DRAW_BUFFER14_EXT",
},
{
- 0x0B97,
- "GL_STENCIL_REF",
+ 0x8832, "GL_DRAW_BUFFER13_EXT",
},
{
- 0x0B96,
- "GL_STENCIL_PASS_DEPTH_PASS",
+ 0x8831, "GL_DRAW_BUFFER12_EXT",
},
{
- 0x0B95,
- "GL_STENCIL_PASS_DEPTH_FAIL",
+ 0x8830, "GL_DRAW_BUFFER11_EXT",
},
{
- 0x2700,
- "GL_NEAREST_MIPMAP_NEAREST",
+ 0x8DC5, "GL_SAMPLER_CUBE_SHADOW_NV",
},
{
- 0x94F5,
- "GL_PERFQUERY_COUNTER_TIMESTAMP_INTEL",
+ 0x94FF, "GL_PERFQUERY_COUNTER_DESC_LENGTH_MAX_INTEL",
},
{
- 0x0B98,
- "GL_STENCIL_WRITEMASK",
+ 0x94FE, "GL_PERFQUERY_COUNTER_NAME_LENGTH_MAX_INTEL",
},
{
- 0x94F3,
- "GL_PERFQUERY_COUNTER_THROUGHPUT_INTEL",
+ 0x94FD, "GL_PERFQUERY_QUERY_NAME_LENGTH_MAX_INTEL",
},
{
- 0x94F2,
- "GL_PERFQUERY_COUNTER_DURATION_RAW_INTEL",
+ 0x94FC, "GL_PERFQUERY_COUNTER_DATA_BOOL32_INTEL",
},
{
- 0x94F1,
- "GL_PERFQUERY_COUNTER_DURATION_NORM_INTEL",
+ 0x94FB, "GL_PERFQUERY_COUNTER_DATA_DOUBLE_INTEL",
},
{
- 0x94F0,
- "GL_PERFQUERY_COUNTER_EVENT_INTEL",
+ 0x93B8, "GL_COMPRESSED_RGBA_ASTC_10x5_KHR",
},
{
- 0x8B40,
- "GL_PROGRAM_OBJECT_EXT",
+ 0x8B65, "GL_FLOAT_MAT2x3_NV",
},
{
- 0x1004,
- "GL_TEXTURE_BORDER_COLOR_EXT",
+ 0x00010000, "GL_STENCIL_BUFFER_BIT0_QCOM",
},
{
- 0x8A2D,
- "GL_MAX_FRAGMENT_UNIFORM_BLOCKS",
+ 0x83FA, "GL_PERFQUERY_FLUSH_INTEL",
},
{
- 0x8B48,
- "GL_SHADER_OBJECT_EXT",
+ 0x0D03, "GL_PACK_SKIP_ROWS",
},
{
- 0x8B49,
- "GL_MAX_FRAGMENT_UNIFORM_COMPONENTS",
+ 0x84F3, "GL_FENCE_STATUS_NV",
},
{
- 0x813A,
- "GL_TEXTURE_MIN_LOD",
+ 0x908D, "GL_BOUNDING_BOX_CHROMIUM",
},
{
- 0x8DE1,
- "GL_MAX_GEOMETRY_TOTAL_OUTPUT_COMPONENTS_EXT",
+ 0x88E6, "GL_STATIC_COPY",
},
{
- 0x8DE0,
- "GL_MAX_GEOMETRY_OUTPUT_VERTICES_EXT",
+ 0x0B93, "GL_STENCIL_VALUE_MASK",
},
{
- 0x924C,
- "GL_MOUSE_POSITION_CHROMIUM",
+ 0x0B92, "GL_STENCIL_FUNC",
},
{
- 0x924B,
- "GL_SUBSCRIBED_VALUES_BUFFER_CHROMIUM",
+ 0x0B91, "GL_STENCIL_CLEAR_VALUE",
},
{
- 0x924A,
- "GL_OVERLAY_TRANSFORM_ROTATE_270_CHROMIUM",
+ 0x883D, "GL_BLEND_EQUATION_ALPHA",
},
{
- 0x8A2F,
- "GL_MAX_UNIFORM_BUFFER_BINDINGS",
+ 0x0B97, "GL_STENCIL_REF",
},
{
- 0x20000000,
- "GL_MULTISAMPLE_BUFFER_BIT5_QCOM",
+ 0x0B96, "GL_STENCIL_PASS_DEPTH_PASS",
},
{
- 0x8A2A,
- "GL_UNIFORM_BUFFER_SIZE",
+ 0x0B95, "GL_STENCIL_PASS_DEPTH_FAIL",
},
{
- 0x0DE1,
- "GL_TEXTURE_2D",
+ 0x2700, "GL_NEAREST_MIPMAP_NEAREST",
},
{
- 0x8A2C,
- "GL_MAX_GEOMETRY_UNIFORM_BLOCKS_EXT",
+ 0x94F5, "GL_PERFQUERY_COUNTER_TIMESTAMP_INTEL",
},
{
- 0x80C9,
- "GL_BLEND_SRC_RGB",
+ 0x0B98, "GL_STENCIL_WRITEMASK",
},
{
- 0x80C8,
- "GL_BLEND_DST_RGB",
+ 0x94F3, "GL_PERFQUERY_COUNTER_THROUGHPUT_INTEL",
},
{
- 0x912F,
- "GL_TEXTURE_IMMUTABLE_FORMAT_EXT",
+ 0x94F2, "GL_PERFQUERY_COUNTER_DURATION_RAW_INTEL",
},
{
- 0x8A2B,
- "GL_MAX_VERTEX_UNIFORM_BLOCKS",
+ 0x94F1, "GL_PERFQUERY_COUNTER_DURATION_NORM_INTEL",
},
{
- 0x9246,
- "GL_OVERLAY_TRANSFORM_FLIP_HORIZONTAL_CHROMIUM",
+ 0x94F0, "GL_PERFQUERY_COUNTER_EVENT_INTEL",
},
{
- 0x88EC,
- "GL_PIXEL_UNPACK_BUFFER",
+ 0x8B40, "GL_PROGRAM_OBJECT_EXT",
},
{
- 0x8D8F,
- "GL_RGB8I",
+ 0x1004, "GL_TEXTURE_BORDER_COLOR_EXT",
},
{
- 0x8059,
- "GL_RGB10_A2_EXT",
+ 0x8A2D, "GL_MAX_FRAGMENT_UNIFORM_BLOCKS",
},
{
- 0x8058,
- "GL_RGBA8_OES",
+ 0x8B48, "GL_SHADER_OBJECT_EXT",
},
{
- 0x8B93,
- "GL_PALETTE4_RGBA4_OES",
+ 0x8B49, "GL_MAX_FRAGMENT_UNIFORM_COMPONENTS",
},
{
- 0x88EB,
- "GL_PIXEL_PACK_BUFFER",
+ 0x813A, "GL_TEXTURE_MIN_LOD",
},
{
- 0x8E83,
- "GL_MAX_TESS_CONTROL_OUTPUT_COMPONENTS_EXT",
+ 0x8DE1, "GL_MAX_GEOMETRY_TOTAL_OUTPUT_COMPONENTS_EXT",
},
{
- 0x8051,
- "GL_RGB8_OES",
+ 0x8DE0, "GL_MAX_GEOMETRY_OUTPUT_VERTICES_EXT",
},
{
- 0x8CAD,
- "GL_DEPTH32F_STENCIL8",
+ 0x924C, "GL_MOUSE_POSITION_CHROMIUM",
},
{
- 0x8052,
- "GL_RGB10_EXT",
+ 0x924B, "GL_SUBSCRIBED_VALUES_BUFFER_CHROMIUM",
},
{
- 0x8CAB,
- "GL_RENDERBUFFER_SAMPLES_ANGLE",
+ 0x924A, "GL_OVERLAY_TRANSFORM_ROTATE_270_CHROMIUM",
},
{
- 0x8CAC,
- "GL_DEPTH_COMPONENT32F",
+ 0x8A2F, "GL_MAX_UNIFORM_BUFFER_BINDINGS",
},
{
- 0x8057,
- "GL_RGB5_A1",
+ 0x20000000, "GL_MULTISAMPLE_BUFFER_BIT5_QCOM",
},
{
- 0x8056,
- "GL_RGBA4",
+ 0x8A2A, "GL_UNIFORM_BUFFER_SIZE",
},
{
- 0x8232,
- "GL_R8UI",
+ 0x0BA7, "GL_PATH_PROJECTION_MATRIX_CHROMIUM",
},
{
- 0x150A,
- "GL_INVERT",
+ 0x0DE1, "GL_TEXTURE_2D",
},
{
- 0x01000000,
- "GL_MULTISAMPLE_BUFFER_BIT0_QCOM",
+ 0x8A2C, "GL_MAX_GEOMETRY_UNIFORM_BLOCKS_EXT",
},
{
- 0x78ED,
- "GL_PIXEL_PACK_TRANSFER_BUFFER_CHROMIUM",
+ 0x80C9, "GL_BLEND_SRC_RGB",
},
{
- 0x78EE,
- "GL_PIXEL_PACK_TRANSFER_BUFFER_BINDING_CHROMIUM",
+ 0x80C8, "GL_BLEND_DST_RGB",
},
{
- 0x6001,
- "GL_TEXTURE_POOL_MANAGED_CHROMIUM",
+ 0x912F, "GL_TEXTURE_IMMUTABLE_FORMAT_EXT",
},
{
- 0x0B45,
- "GL_CULL_FACE_MODE",
+ 0x8A2B, "GL_MAX_VERTEX_UNIFORM_BLOCKS",
},
{
- 0x8B92,
- "GL_PALETTE4_R5_G6_B5_OES",
+ 0x9246, "GL_OVERLAY_TRANSFORM_FLIP_HORIZONTAL_CHROMIUM",
},
{
- 0x00100000,
- "GL_STENCIL_BUFFER_BIT4_QCOM",
+ 0x88EC, "GL_PIXEL_UNPACK_BUFFER",
},
{
- 0x8E4E,
- "GL_LAST_VERTEX_CONVENTION_EXT",
+ 0x8D8F, "GL_RGB8I",
},
{
- 0x8E4D,
- "GL_FIRST_VERTEX_CONVENTION_EXT",
+ 0x8059, "GL_RGB10_A2_EXT",
},
{
- 0x8E24,
- "GL_TRANSFORM_FEEDBACK_ACTIVE",
+ 0x8058, "GL_RGBA8_OES",
},
{
- 0x8E45,
- "GL_TEXTURE_SWIZZLE_A",
+ 0x8B93, "GL_PALETTE4_RGBA4_OES",
},
{
- 0x8E44,
- "GL_TEXTURE_SWIZZLE_B",
+ 0x88EB, "GL_PIXEL_PACK_BUFFER",
},
{
- 0x8E43,
- "GL_TEXTURE_SWIZZLE_G",
+ 0x8E83, "GL_MAX_TESS_CONTROL_OUTPUT_COMPONENTS_EXT",
},
{
- 0x8E42,
- "GL_TEXTURE_SWIZZLE_R",
+ 0x8051, "GL_RGB8_OES",
},
{
- 0x8D20,
- "GL_STENCIL_ATTACHMENT",
+ 0x8CAD, "GL_DEPTH32F_STENCIL8",
},
{
- 0x8B91,
- "GL_PALETTE4_RGBA8_OES",
+ 0x8052, "GL_RGB10_EXT",
},
{
- 0x00000200,
- "GL_DEPTH_BUFFER_BIT1_QCOM",
+ 0x8CAB, "GL_RENDERBUFFER_SAMPLES_ANGLE",
},
{
- 0x78EC,
- "GL_PIXEL_UNPACK_TRANSFER_BUFFER_CHROMIUM",
+ 0x8CAC, "GL_DEPTH_COMPONENT32F",
},
{
- 0x78FA,
- "GL_RGB_YUV_420_CHROMIUM",
+ 0x8057, "GL_RGB5_A1",
},
{
- 0x00008000,
- "GL_COVERAGE_BUFFER_BIT_NV",
+ 0x8056, "GL_RGBA4",
},
{
- 0x1506,
- "GL_XOR_NV",
+ 0x8232, "GL_R8UI",
},
{
- 0x8CA8,
- "GL_READ_FRAMEBUFFER_ANGLE",
+ 0x90A4, "GL_ROUND_CHROMIUM",
},
{
- 0x8CA9,
- "GL_DRAW_FRAMEBUFFER_ANGLE",
+ 0x150A, "GL_INVERT",
},
{
- 0x8CA6,
- "GL_FRAMEBUFFER_BINDING",
+ 0x01000000, "GL_MULTISAMPLE_BUFFER_BIT0_QCOM",
},
{
- 0x8CA7,
- "GL_RENDERBUFFER_BINDING",
+ 0x78ED, "GL_PIXEL_PACK_TRANSFER_BUFFER_CHROMIUM",
},
{
- 0x8CA4,
- "GL_STENCIL_BACK_VALUE_MASK",
+ 0x78EE, "GL_PIXEL_PACK_TRANSFER_BUFFER_BINDING_CHROMIUM",
},
{
- 0x8CA5,
- "GL_STENCIL_BACK_WRITEMASK",
+ 0x6001, "GL_TEXTURE_POOL_MANAGED_CHROMIUM",
},
{
- 0x8B90,
- "GL_PALETTE4_RGB8_OES",
+ 0x0B45, "GL_CULL_FACE_MODE",
},
{
- 0x8CA3,
- "GL_STENCIL_BACK_REF",
+ 0x8B92, "GL_PALETTE4_R5_G6_B5_OES",
},
{
- 0x80E8,
- "GL_MAX_ELEMENTS_VERTICES",
+ 0x00100000, "GL_STENCIL_BUFFER_BIT4_QCOM",
},
{
- 0x80CB,
- "GL_BLEND_SRC_ALPHA",
+ 0x8E4E, "GL_LAST_VERTEX_CONVENTION_EXT",
},
{
- 0x80CA,
- "GL_BLEND_DST_ALPHA",
+ 0x8E4D, "GL_FIRST_VERTEX_CONVENTION_EXT",
},
{
- 0x8CE7,
- "GL_COLOR_ATTACHMENT7_EXT",
+ 0x8E24, "GL_TRANSFORM_FEEDBACK_ACTIVE",
},
{
- 0x93B0,
- "GL_COMPRESSED_RGBA_ASTC_4x4_KHR",
+ 0x8E45, "GL_TEXTURE_SWIZZLE_A",
},
{
- 0x93B1,
- "GL_COMPRESSED_RGBA_ASTC_5x4_KHR",
+ 0x8E44, "GL_TEXTURE_SWIZZLE_B",
},
{
- 0x93B2,
- "GL_COMPRESSED_RGBA_ASTC_5x5_KHR",
+ 0x8E43, "GL_TEXTURE_SWIZZLE_G",
},
{
- 0x93B3,
- "GL_COMPRESSED_RGBA_ASTC_6x5_KHR",
+ 0x8E42, "GL_TEXTURE_SWIZZLE_R",
},
{
- 0x93B4,
- "GL_COMPRESSED_RGBA_ASTC_6x6_KHR",
+ 0x8D20, "GL_STENCIL_ATTACHMENT",
},
{
- 0x93B5,
- "GL_COMPRESSED_RGBA_ASTC_8x5_KHR",
+ 0x8B91, "GL_PALETTE4_RGBA8_OES",
},
{
- 0x93B6,
- "GL_COMPRESSED_RGBA_ASTC_8x6_KHR",
+ 0x00000200, "GL_DEPTH_BUFFER_BIT1_QCOM",
},
{
- 0x93B7,
- "GL_COMPRESSED_RGBA_ASTC_8x8_KHR",
+ 0x78EC, "GL_PIXEL_UNPACK_TRANSFER_BUFFER_CHROMIUM",
},
{
- 0x8CD6,
- "GL_FRAMEBUFFER_INCOMPLETE_ATTACHMENT",
+ 0x78FA, "GL_RGB_YUV_420_CHROMIUM",
},
{
- 0x93B9,
- "GL_COMPRESSED_RGBA_ASTC_10x6_KHR",
+ 0x00008000, "GL_COVERAGE_BUFFER_BIT_NV",
},
{
- 0x80E9,
- "GL_MAX_ELEMENTS_INDICES",
+ 0x1506, "GL_XOR_NV",
},
{
- 0x8CE5,
- "GL_COLOR_ATTACHMENT5_EXT",
+ 0x8CA8, "GL_READ_FRAMEBUFFER_ANGLE",
},
{
- 0x8C84,
- "GL_TRANSFORM_FEEDBACK_BUFFER_START",
+ 0x8CA9, "GL_DRAW_FRAMEBUFFER_ANGLE",
},
{
- 0x0BA6,
- "GL_PATH_MODELVIEW_MATRIX_CHROMIUM",
+ 0x8CA6, "GL_FRAMEBUFFER_BINDING",
},
{
- 0x8DC2,
- "GL_SAMPLER_BUFFER_EXT",
+ 0x8CA7, "GL_RENDERBUFFER_BINDING",
},
{
- 0x8C36,
- "GL_SAMPLE_SHADING_OES",
+ 0x8CA4, "GL_STENCIL_BACK_VALUE_MASK",
},
{
- 0x8C37,
- "GL_MIN_SAMPLE_SHADING_VALUE_OES",
+ 0x8CA5, "GL_STENCIL_BACK_WRITEMASK",
},
{
- 0x8F97,
- "GL_RGBA8_SNORM",
+ 0x8B90, "GL_PALETTE4_RGB8_OES",
},
{
- 0x8CE9,
- "GL_COLOR_ATTACHMENT9_EXT",
+ 0x8CA3, "GL_STENCIL_BACK_REF",
},
{
- 0x8DAD,
- "GL_FLOAT_32_UNSIGNED_INT_24_8_REV",
+ 0x80E8, "GL_MAX_ELEMENTS_VERTICES",
},
{
- 0x8B96,
- "GL_PALETTE8_RGBA8_OES",
+ 0x80CB, "GL_BLEND_SRC_ALPHA",
},
{
- 0x8872,
- "GL_MAX_TEXTURE_IMAGE_UNITS",
+ 0x80CA, "GL_BLEND_DST_ALPHA",
},
{
- 0x8DC6,
- "GL_UNSIGNED_INT_VEC2",
+ 0x8CE7, "GL_COLOR_ATTACHMENT7_EXT",
},
{
- 0x8508,
- "GL_DECR_WRAP",
+ 0x93B0, "GL_COMPRESSED_RGBA_ASTC_4x4_KHR",
},
{
- 0x92AD,
- "GL_HSL_HUE_KHR",
+ 0x93B1, "GL_COMPRESSED_RGBA_ASTC_5x4_KHR",
},
{
- 0x92AE,
- "GL_HSL_SATURATION_KHR",
+ 0x93B2, "GL_COMPRESSED_RGBA_ASTC_5x5_KHR",
},
{
- 0x92AF,
- "GL_HSL_COLOR_KHR",
+ 0x93B3, "GL_COMPRESSED_RGBA_ASTC_6x5_KHR",
},
{
- 0x8BD4,
- "GL_TEXTURE_DEPTH_QCOM",
+ 0x93B4, "GL_COMPRESSED_RGBA_ASTC_6x6_KHR",
},
{
- 0x8DC4,
- "GL_SAMPLER_2D_ARRAY_SHADOW_NV",
+ 0x93B5, "GL_COMPRESSED_RGBA_ASTC_8x5_KHR",
},
{
- 0x8507,
- "GL_INCR_WRAP",
+ 0x93B6, "GL_COMPRESSED_RGBA_ASTC_8x6_KHR",
},
{
- 0x82FC,
- "GL_CONTEXT_RELEASE_BEHAVIOR_FLUSH_KHR",
+ 0x93B7, "GL_COMPRESSED_RGBA_ASTC_8x8_KHR",
},
{
- 0x8895,
- "GL_ELEMENT_ARRAY_BUFFER_BINDING",
+ 0x8CD6, "GL_FRAMEBUFFER_INCOMPLETE_ATTACHMENT",
},
{
- 0x8894,
- "GL_ARRAY_BUFFER_BINDING",
+ 0x93B9, "GL_COMPRESSED_RGBA_ASTC_10x6_KHR",
},
{
- 0x92A3,
- "GL_INVERT_RGB_NV",
+ 0x80E9, "GL_MAX_ELEMENTS_INDICES",
},
{
- 0x905F,
- "GL_INT_IMAGE_CUBE_MAP_ARRAY_EXT",
+ 0x8CE5, "GL_COLOR_ATTACHMENT5_EXT",
},
{
- 0x92A5,
- "GL_LINEARBURN_NV",
+ 0x8C84, "GL_TRANSFORM_FEEDBACK_BUFFER_START",
},
{
- 0x8893,
- "GL_ELEMENT_ARRAY_BUFFER",
+ 0x0BA6, "GL_PATH_MODELVIEW_MATRIX_CHROMIUM",
},
{
- 0x8892,
- "GL_ARRAY_BUFFER",
+ 0x8DC2, "GL_SAMPLER_BUFFER_EXT",
},
{
- 0x92A8,
- "GL_PINLIGHT_NV",
+ 0x8C36, "GL_SAMPLE_SHADING_OES",
},
{
- 0x92A9,
- "GL_HARDMIX_NV",
+ 0x8C37, "GL_MIN_SAMPLE_SHADING_VALUE_OES",
},
{
- 0x9112,
- "GL_OBJECT_TYPE_APPLE",
+ 0x8F97, "GL_RGBA8_SNORM",
},
{
- 0x90CC,
- "GL_MAX_TESS_EVALUATION_IMAGE_UNIFORMS_EXT",
+ 0x8CE9, "GL_COLOR_ATTACHMENT9_EXT",
},
{
- 0x90CD,
- "GL_MAX_GEOMETRY_IMAGE_UNIFORMS_EXT",
+ 0x8DAD, "GL_FLOAT_32_UNSIGNED_INT_24_8_REV",
},
{
- 0x919F,
- "GL_TEXTURE_BUFFER_OFFSET_ALIGNMENT_EXT",
+ 0x8B96, "GL_PALETTE8_RGBA8_OES",
},
{
- 0x919E,
- "GL_TEXTURE_BUFFER_SIZE_EXT",
+ 0x8872, "GL_MAX_TEXTURE_IMAGE_UNITS",
},
{
- 0x919D,
- "GL_TEXTURE_BUFFER_OFFSET_EXT",
+ 0x8DC6, "GL_UNSIGNED_INT_VEC2",
},
{
- 0x8BD8,
- "GL_TEXTURE_IMAGE_VALID_QCOM",
+ 0x8508, "GL_DECR_WRAP",
},
{
- 0x9278,
- "GL_COMPRESSED_RGBA8_ETC2_EAC",
+ 0x92AD, "GL_HSL_HUE_KHR",
},
{
- 0x9279,
- "GL_COMPRESSED_SRGB8_ALPHA8_ETC2_EAC",
+ 0x92AE, "GL_HSL_SATURATION_KHR",
},
{
- 0x8DA7,
- "GL_FRAMEBUFFER_ATTACHMENT_LAYERED_EXT",
+ 0x92AF, "GL_HSL_COLOR_KHR",
},
{
- 0x9272,
- "GL_COMPRESSED_RG11_EAC",
+ 0x8BD4, "GL_TEXTURE_DEPTH_QCOM",
},
{
- 0x8DA8,
- "GL_FRAMEBUFFER_INCOMPLETE_LAYER_TARGETS_EXT",
+ 0x8DC4, "GL_SAMPLER_2D_ARRAY_SHADOW_NV",
},
{
- 0x9270,
- "GL_COMPRESSED_R11_EAC",
+ 0x8507, "GL_INCR_WRAP",
},
{
- 0x9271,
- "GL_COMPRESSED_SIGNED_R11_EAC",
+ 0x82FC, "GL_CONTEXT_RELEASE_BEHAVIOR_FLUSH_KHR",
},
{
- 0x9276,
- "GL_COMPRESSED_RGB8_PUNCHTHROUGH_ALPHA1_ETC2",
+ 0x8895, "GL_ELEMENT_ARRAY_BUFFER_BINDING",
},
{
- 0x887F,
- "GL_GEOMETRY_SHADER_INVOCATIONS_EXT",
+ 0x8894, "GL_ARRAY_BUFFER_BINDING",
},
{
- 0x8A3B,
- "GL_UNIFORM_OFFSET",
+ 0x92A3, "GL_INVERT_RGB_NV",
},
{
- 0x9275,
- "GL_COMPRESSED_SRGB8_ETC2",
+ 0x905F, "GL_INT_IMAGE_CUBE_MAP_ARRAY_EXT",
},
{
- 0x84D5,
- "GL_TEXTURE21",
+ 0x92A5, "GL_LINEARBURN_NV",
},
{
- 0x8C3A,
- "GL_R11F_G11F_B10F_APPLE",
+ 0x8893, "GL_ELEMENT_ARRAY_BUFFER",
},
{
- 0x8C3B,
- "GL_UNSIGNED_INT_10F_11F_11F_REV_APPLE",
+ 0x8892, "GL_ARRAY_BUFFER",
},
{
- 0x8C3D,
- "GL_RGB9_E5_APPLE",
+ 0x92A8, "GL_PINLIGHT_NV",
},
{
- 0x8C3E,
- "GL_UNSIGNED_INT_5_9_9_9_REV_APPLE",
+ 0x92A9, "GL_HARDMIX_NV",
},
{
- 0x9287,
- "GL_DST_NV",
+ 0x9112, "GL_OBJECT_TYPE_APPLE",
},
{
- 0x93BA,
- "GL_COMPRESSED_RGBA_ASTC_10x8_KHR",
+ 0x90CC, "GL_MAX_TESS_EVALUATION_IMAGE_UNIFORMS_EXT",
},
{
- 0x9285,
- "GL_BLEND_ADVANCED_COHERENT_KHR",
+ 0x90CD, "GL_MAX_GEOMETRY_IMAGE_UNIFORMS_EXT",
},
{
- 0x93BC,
- "GL_COMPRESSED_RGBA_ASTC_12x10_KHR",
+ 0x919F, "GL_TEXTURE_BUFFER_OFFSET_ALIGNMENT_EXT",
},
{
- 0x93BD,
- "GL_COMPRESSED_RGBA_ASTC_12x12_KHR",
+ 0x919E, "GL_TEXTURE_BUFFER_SIZE_EXT",
},
{
- 0x84E8,
- "GL_MAX_RENDERBUFFER_SIZE",
+ 0x919D, "GL_TEXTURE_BUFFER_OFFSET_EXT",
},
{
- 0x9281,
- "GL_BLEND_OVERLAP_NV",
+ 0x8BD8, "GL_TEXTURE_IMAGE_VALID_QCOM",
},
{
- 0x9280,
- "GL_BLEND_PREMULTIPLIED_SRC_NV",
+ 0x9278, "GL_COMPRESSED_RGBA8_ETC2_EAC",
},
{
- 0x00002000,
- "GL_DEPTH_BUFFER_BIT5_QCOM",
+ 0x9279, "GL_COMPRESSED_SRGB8_ALPHA8_ETC2_EAC",
},
{
- 0x8370,
- "GL_MIRRORED_REPEAT",
+ 0x8DA7, "GL_FRAMEBUFFER_ATTACHMENT_LAYERED_EXT",
},
{
- 0x84E0,
- "GL_ACTIVE_TEXTURE",
+ 0x9272, "GL_COMPRESSED_RG11_EAC",
},
{
- 0x8800,
- "GL_STENCIL_BACK_FUNC",
+ 0x8DA8, "GL_FRAMEBUFFER_INCOMPLETE_LAYER_TARGETS_EXT",
},
{
- 0x8801,
- "GL_STENCIL_BACK_FAIL",
+ 0x9270, "GL_COMPRESSED_R11_EAC",
},
{
- 0x0D33,
- "GL_MAX_TEXTURE_SIZE",
+ 0x9271, "GL_COMPRESSED_SIGNED_R11_EAC",
},
{
- 0x0D32,
- "GL_MAX_CLIP_DISTANCES_APPLE",
+ 0x9276, "GL_COMPRESSED_RGB8_PUNCHTHROUGH_ALPHA1_ETC2",
},
{
- 0x8624,
- "GL_VERTEX_ATTRIB_ARRAY_STRIDE",
+ 0x887F, "GL_GEOMETRY_SHADER_INVOCATIONS_EXT",
},
{
- 0x8625,
- "GL_VERTEX_ATTRIB_ARRAY_TYPE",
+ 0x8A3B, "GL_UNIFORM_OFFSET",
},
{
- 0x8622,
- "GL_VERTEX_ATTRIB_ARRAY_ENABLED",
+ 0x9275, "GL_COMPRESSED_SRGB8_ETC2",
},
{
- 0x8623,
- "GL_VERTEX_ATTRIB_ARRAY_SIZE",
+ 0x84D5, "GL_TEXTURE21",
},
{
- 0x8DB9,
- "GL_FRAMEBUFFER_SRGB_EXT",
+ 0x8C3A, "GL_R11F_G11F_B10F_APPLE",
},
{
- 0x9307,
- "GL_REFERENCED_BY_TESS_CONTROL_SHADER_EXT",
+ 0x8C3B, "GL_UNSIGNED_INT_10F_11F_11F_REV_APPLE",
},
{
- 0x8259,
- "GL_ACTIVE_PROGRAM_EXT",
+ 0x8C3D, "GL_RGB9_E5_APPLE",
},
{
- 0x8258,
- "GL_PROGRAM_SEPARABLE_EXT",
+ 0x8C3E, "GL_UNSIGNED_INT_5_9_9_9_REV_APPLE",
},
{
- 0x8257,
- "GL_PROGRAM_BINARY_RETRIEVABLE_HINT",
+ 0x9287, "GL_DST_NV",
},
{
- 0x8256,
- "GL_RESET_NOTIFICATION_STRATEGY_KHR",
+ 0x93BA, "GL_COMPRESSED_RGBA_ASTC_10x8_KHR",
},
{
- 0x8255,
- "GL_UNKNOWN_CONTEXT_RESET_KHR",
+ 0x9285, "GL_BLEND_ADVANCED_COHERENT_KHR",
},
{
- 0x8254,
- "GL_INNOCENT_CONTEXT_RESET_KHR",
+ 0x93BC, "GL_COMPRESSED_RGBA_ASTC_12x10_KHR",
},
{
- 0x1100,
- "GL_DONT_CARE",
+ 0x93BD, "GL_COMPRESSED_RGBA_ASTC_12x12_KHR",
},
{
- 0x1101,
- "GL_FASTEST",
+ 0x84E8, "GL_MAX_RENDERBUFFER_SIZE",
},
{
- 0x1102,
- "GL_NICEST",
+ 0x9281, "GL_BLEND_OVERLAP_NV",
},
{
- 0x8250,
- "GL_DEBUG_TYPE_PERFORMANCE_KHR",
+ 0x9280, "GL_BLEND_PREMULTIPLIED_SRC_NV",
},
{
- 0x8CEB,
- "GL_COLOR_ATTACHMENT11_EXT",
+ 0x00002000, "GL_DEPTH_BUFFER_BIT5_QCOM",
},
{
- 0x8CEC,
- "GL_COLOR_ATTACHMENT12_EXT",
+ 0x8370, "GL_MIRRORED_REPEAT",
},
{
- 0x0408,
- "GL_FRONT_AND_BACK",
+ 0x84E0, "GL_ACTIVE_TEXTURE",
},
{
- 0x8CEA,
- "GL_COLOR_ATTACHMENT10_EXT",
+ 0x8800, "GL_STENCIL_BACK_FUNC",
},
{
- 0x8CEF,
- "GL_COLOR_ATTACHMENT15_EXT",
+ 0x8801, "GL_STENCIL_BACK_FAIL",
},
{
- 0x8CED,
- "GL_COLOR_ATTACHMENT13_EXT",
+ 0x0D33, "GL_MAX_TEXTURE_SIZE",
},
{
- 0x8829,
- "GL_DRAW_BUFFER4_EXT",
+ 0x0D32, "GL_MAX_CLIP_DISTANCES_APPLE",
},
{
- 0x0404,
- "GL_FRONT",
+ 0x8624, "GL_VERTEX_ATTRIB_ARRAY_STRIDE",
},
{
- 0x0405,
- "GL_BACK",
+ 0x8625, "GL_VERTEX_ATTRIB_ARRAY_TYPE",
},
{
- 0x88E1,
- "GL_STREAM_READ",
+ 0x8622, "GL_VERTEX_ATTRIB_ARRAY_ENABLED",
},
{
- 0x88E0,
- "GL_STREAM_DRAW",
+ 0x8623, "GL_VERTEX_ATTRIB_ARRAY_SIZE",
},
{
- 0x88E2,
- "GL_STREAM_COPY",
+ 0x9086, "GL_PATH_STROKE_BOUND_CHROMIUM",
},
{
- 0x88E5,
- "GL_STATIC_READ",
+ 0x8DB9, "GL_FRAMEBUFFER_SRGB_EXT",
},
{
- 0x88E4,
- "GL_STATIC_DRAW",
+ 0x907a, "GL_PATH_MITER_LIMIT_CHROMIUM",
},
{
- 0x93C6,
- "GL_COMPRESSED_RGBA_ASTC_5x5x5_OES",
+ 0x9307, "GL_REFERENCED_BY_TESS_CONTROL_SHADER_EXT",
},
{
- 0x88E9,
- "GL_DYNAMIC_READ",
+ 0x8259, "GL_ACTIVE_PROGRAM_EXT",
},
{
- 0x88E8,
- "GL_DYNAMIC_DRAW",
+ 0x8258, "GL_PROGRAM_SEPARABLE_EXT",
},
{
- 0x9291,
- "GL_PLUS_NV",
+ 0x8257, "GL_PROGRAM_BINARY_RETRIEVABLE_HINT",
},
{
- 0x8CAA,
- "GL_READ_FRAMEBUFFER_BINDING_ANGLE",
+ 0x8256, "GL_RESET_NOTIFICATION_STRATEGY_KHR",
},
{
- 0x93C5,
- "GL_COMPRESSED_RGBA_ASTC_5x5x4_OES",
+ 0x8255, "GL_UNKNOWN_CONTEXT_RESET_KHR",
},
{
- 0x40000000,
- "GL_MULTISAMPLE_BUFFER_BIT6_QCOM",
+ 0x8254, "GL_INNOCENT_CONTEXT_RESET_KHR",
},
{
- 0x88EA,
- "GL_DYNAMIC_COPY",
+ 0x1100, "GL_DONT_CARE",
},
{
- 0x9116,
- "GL_SYNC_FENCE_APPLE",
+ 0x1101, "GL_FASTEST",
},
{
- 0x93C4,
- "GL_COMPRESSED_RGBA_ASTC_5x4x4_OES",
+ 0x1102, "GL_NICEST",
},
{
- 0x88EE,
- "GL_ETC1_SRGB8_NV",
+ 0x8250, "GL_DEBUG_TYPE_PERFORMANCE_KHR",
},
{
- 0x88ED,
- "GL_PIXEL_PACK_BUFFER_BINDING",
+ 0x8CEB, "GL_COLOR_ATTACHMENT11_EXT",
},
{
- 0x88EF,
- "GL_PIXEL_UNPACK_BUFFER_BINDING",
+ 0x8CEC, "GL_COLOR_ATTACHMENT12_EXT",
},
{
- 0x93C3,
- "GL_COMPRESSED_RGBA_ASTC_4x4x4_OES",
+ 0x0408, "GL_FRONT_AND_BACK",
},
{
- 0x00000800,
- "GL_DEPTH_BUFFER_BIT3_QCOM",
+ 0x8CEA, "GL_COLOR_ATTACHMENT10_EXT",
},
{
- 0x1903,
- "GL_RED_EXT",
+ 0x8CEF, "GL_COLOR_ATTACHMENT15_EXT",
},
{
- 0x93C2,
- "GL_COMPRESSED_RGBA_ASTC_4x4x3_OES",
+ 0x8CED, "GL_COLOR_ATTACHMENT13_EXT",
},
{
- 0x8CE2,
- "GL_COLOR_ATTACHMENT2_EXT",
+ 0x8829, "GL_DRAW_BUFFER4_EXT",
},
{
- 0x8BC1,
- "GL_COUNTER_RANGE_AMD",
+ 0x0404, "GL_FRONT",
},
{
- 0x8CE0,
- "GL_COLOR_ATTACHMENT0",
+ 0x0405, "GL_BACK",
},
{
- 0x8CE1,
- "GL_COLOR_ATTACHMENT1_EXT",
+ 0x88E1, "GL_STREAM_READ",
},
{
- 0x8CE6,
- "GL_COLOR_ATTACHMENT6_EXT",
+ 0x88E0, "GL_STREAM_DRAW",
},
{
- 0x93C1,
- "GL_COMPRESSED_RGBA_ASTC_4x3x3_OES",
+ 0x88E2, "GL_STREAM_COPY",
},
{
- 0x8A1F,
- "GL_RGB_422_APPLE",
+ 0x88E5, "GL_STATIC_READ",
},
{
- 0x93DC,
- "GL_COMPRESSED_SRGB8_ALPHA8_ASTC_12x10_KHR",
+ 0x88E4, "GL_STATIC_DRAW",
},
{
- 0x9292,
- "GL_PLUS_DARKER_NV",
+ 0x93C6, "GL_COMPRESSED_RGBA_ASTC_5x5x5_OES",
},
{
- 0x8CE8,
- "GL_COLOR_ATTACHMENT8_EXT",
+ 0x88E9, "GL_DYNAMIC_READ",
},
{
- 0x93C0,
- "GL_COMPRESSED_RGBA_ASTC_3x3x3_OES",
+ 0x88E8, "GL_DYNAMIC_DRAW",
},
{
- 0x0C23,
- "GL_COLOR_WRITEMASK",
+ 0x9291, "GL_PLUS_NV",
},
{
- 0x0C22,
- "GL_COLOR_CLEAR_VALUE",
+ 0x8CAA, "GL_READ_FRAMEBUFFER_BINDING_ANGLE",
},
{
- 0x8A11,
- "GL_UNIFORM_BUFFER",
+ 0x93C5, "GL_COMPRESSED_RGBA_ASTC_5x5x4_OES",
},
{
- 0x8823,
- "GL_WRITEONLY_RENDERING_QCOM",
+ 0x40000000, "GL_MULTISAMPLE_BUFFER_BIT6_QCOM",
},
{
- 0x78F1,
- "GL_MAP_CHROMIUM",
+ 0x88EA, "GL_DYNAMIC_COPY",
},
{
- 0x8824,
- "GL_MAX_DRAW_BUFFERS_EXT",
+ 0x9116, "GL_SYNC_FENCE_APPLE",
},
{
- 0x825E,
- "GL_LAYER_PROVOKING_VERTEX_EXT",
+ 0x93C4, "GL_COMPRESSED_RGBA_ASTC_5x4x4_OES",
},
{
- 0x825A,
- "GL_PROGRAM_PIPELINE_BINDING_EXT",
+ 0x88EE, "GL_ETC1_SRGB8_NV",
},
{
- 0x1909,
- "GL_LUMINANCE",
+ 0x88ED, "GL_PIXEL_PACK_BUFFER_BINDING",
},
{
- 0x0D3A,
- "GL_MAX_VIEWPORT_DIMS",
+ 0x88EF, "GL_PIXEL_UNPACK_BUFFER_BINDING",
},
{
- 0x8B53,
- "GL_INT_VEC2",
+ 0x93C3, "GL_COMPRESSED_RGBA_ASTC_4x4x4_OES",
},
{
- 0x8826,
- "GL_DRAW_BUFFER1_EXT",
+ 0x00000800, "GL_DEPTH_BUFFER_BIT3_QCOM",
},
{
- 0x809E,
- "GL_SAMPLE_ALPHA_TO_COVERAGE",
+ 0x1903, "GL_RED_EXT",
},
{
- 0x8BC0,
- "GL_COUNTER_TYPE_AMD",
+ 0x93C2, "GL_COMPRESSED_RGBA_ASTC_4x4x3_OES",
},
{
- 0x8BC3,
- "GL_PERCENTAGE_AMD",
+ 0x8CE2, "GL_COLOR_ATTACHMENT2_EXT",
},
{
- 0x8BC2,
- "GL_UNSIGNED_INT64_AMD",
+ 0x8BC1, "GL_COUNTER_RANGE_AMD",
},
{
- 0x8BC5,
- "GL_PERFMON_RESULT_SIZE_AMD",
+ 0x8CE0, "GL_COLOR_ATTACHMENT0",
},
{
- 0x8BC4,
- "GL_PERFMON_RESULT_AVAILABLE_AMD",
+ 0x8CE1, "GL_COLOR_ATTACHMENT1_EXT",
},
{
- 0x8BC6,
- "GL_PERFMON_RESULT_AMD",
+ 0x8CE6, "GL_COLOR_ATTACHMENT6_EXT",
+ },
+ {
+ 0x93C1, "GL_COMPRESSED_RGBA_ASTC_4x3x3_OES",
+ },
+ {
+ 0x8A1F, "GL_RGB_422_APPLE",
+ },
+ {
+ 0x93DC, "GL_COMPRESSED_SRGB8_ALPHA8_ASTC_12x10_KHR",
+ },
+ {
+ 0x9292, "GL_PLUS_DARKER_NV",
+ },
+ {
+ 0x8CE8, "GL_COLOR_ATTACHMENT8_EXT",
+ },
+ {
+ 0x93C0, "GL_COMPRESSED_RGBA_ASTC_3x3x3_OES",
+ },
+ {
+ 0x0C23, "GL_COLOR_WRITEMASK",
+ },
+ {
+ 0x0C22, "GL_COLOR_CLEAR_VALUE",
+ },
+ {
+ 0x8A11, "GL_UNIFORM_BUFFER",
+ },
+ {
+ 0x8823, "GL_WRITEONLY_RENDERING_QCOM",
+ },
+ {
+ 0x8824, "GL_MAX_DRAW_BUFFERS_EXT",
+ },
+ {
+ 0x825E, "GL_LAYER_PROVOKING_VERTEX_EXT",
+ },
+ {
+ 0x825A, "GL_PROGRAM_PIPELINE_BINDING_EXT",
+ },
+ {
+ 0x1909, "GL_LUMINANCE",
+ },
+ {
+ 0x0D3A, "GL_MAX_VIEWPORT_DIMS",
+ },
+ {
+ 0x8B53, "GL_INT_VEC2",
+ },
+ {
+ 0x8826, "GL_DRAW_BUFFER1_EXT",
+ },
+ {
+ 0x809E, "GL_SAMPLE_ALPHA_TO_COVERAGE",
+ },
+ {
+ 0x8BC0, "GL_COUNTER_TYPE_AMD",
+ },
+ {
+ 0x8BC3, "GL_PERCENTAGE_AMD",
+ },
+ {
+ 0x8BC2, "GL_UNSIGNED_INT64_AMD",
+ },
+ {
+ 0x8BC5, "GL_PERFMON_RESULT_SIZE_AMD",
+ },
+ {
+ 0x8BC4, "GL_PERFMON_RESULT_AVAILABLE_AMD",
+ },
+ {
+ 0x8BC6, "GL_PERFMON_RESULT_AMD",
},
};
@@ -4445,6 +3412,9 @@ std::string GLES2Util::GetStringAttachment(uint32_t value) {
{GL_DEPTH_ATTACHMENT, "GL_DEPTH_ATTACHMENT"},
{GL_STENCIL_ATTACHMENT, "GL_STENCIL_ATTACHMENT"},
{GL_DEPTH_STENCIL_ATTACHMENT, "GL_DEPTH_STENCIL_ATTACHMENT"},
+ {GL_COLOR_EXT, "GL_COLOR_EXT"},
+ {GL_DEPTH_EXT, "GL_DEPTH_EXT"},
+ {GL_STENCIL_EXT, "GL_STENCIL_EXT"},
};
return GLES2Util::GetQualifiedEnumString(string_table,
arraysize(string_table), value);
@@ -4483,6 +3453,14 @@ std::string GLES2Util::GetStringBufferParameter(uint32_t value) {
{GL_BUFFER_USAGE, "GL_BUFFER_USAGE"},
{GL_BUFFER_ACCESS_FLAGS, "GL_BUFFER_ACCESS_FLAGS"},
{GL_BUFFER_MAPPED, "GL_BUFFER_MAPPED"},
+ };
+ return GLES2Util::GetQualifiedEnumString(string_table,
+ arraysize(string_table), value);
+}
+
+std::string GLES2Util::GetStringBufferParameter64(uint32_t value) {
+ static const EnumToString string_table[] = {
+ {GL_BUFFER_SIZE, "GL_BUFFER_SIZE"},
{GL_BUFFER_MAP_LENGTH, "GL_BUFFER_MAP_LENGTH"},
{GL_BUFFER_MAP_OFFSET, "GL_BUFFER_MAP_OFFSET"},
};
@@ -4573,14 +3551,10 @@ std::string GLES2Util::GetStringCapability(uint32_t value) {
std::string GLES2Util::GetStringCmpFunction(uint32_t value) {
static const EnumToString string_table[] = {
- {GL_NEVER, "GL_NEVER"},
- {GL_LESS, "GL_LESS"},
- {GL_EQUAL, "GL_EQUAL"},
- {GL_LEQUAL, "GL_LEQUAL"},
- {GL_GREATER, "GL_GREATER"},
- {GL_NOTEQUAL, "GL_NOTEQUAL"},
- {GL_GEQUAL, "GL_GEQUAL"},
- {GL_ALWAYS, "GL_ALWAYS"},
+ {GL_NEVER, "GL_NEVER"}, {GL_LESS, "GL_LESS"},
+ {GL_EQUAL, "GL_EQUAL"}, {GL_LEQUAL, "GL_LEQUAL"},
+ {GL_GREATER, "GL_GREATER"}, {GL_NOTEQUAL, "GL_NOTEQUAL"},
+ {GL_GEQUAL, "GL_GEQUAL"}, {GL_ALWAYS, "GL_ALWAYS"},
};
return GLES2Util::GetQualifiedEnumString(string_table,
arraysize(string_table), value);
@@ -4830,6 +3804,7 @@ std::string GLES2Util::GetStringGLState(uint32_t value) {
{GL_DRAW_FRAMEBUFFER_BINDING, "GL_DRAW_FRAMEBUFFER_BINDING"},
{GL_FRAGMENT_SHADER_DERIVATIVE_HINT,
"GL_FRAGMENT_SHADER_DERIVATIVE_HINT"},
+ {GL_GPU_DISJOINT_EXT, "GL_GPU_DISJOINT_EXT"},
{GL_MAJOR_VERSION, "GL_MAJOR_VERSION"},
{GL_MAX_3D_TEXTURE_SIZE, "GL_MAX_3D_TEXTURE_SIZE"},
{GL_MAX_ARRAY_TEXTURE_LAYERS, "GL_MAX_ARRAY_TEXTURE_LAYERS"},
@@ -4876,6 +3851,7 @@ std::string GLES2Util::GetStringGLState(uint32_t value) {
{GL_READ_BUFFER, "GL_READ_BUFFER"},
{GL_READ_FRAMEBUFFER_BINDING, "GL_READ_FRAMEBUFFER_BINDING"},
{GL_SAMPLER_BINDING, "GL_SAMPLER_BINDING"},
+ {GL_TIMESTAMP_EXT, "GL_TIMESTAMP_EXT"},
{GL_TEXTURE_BINDING_2D_ARRAY, "GL_TEXTURE_BINDING_2D_ARRAY"},
{GL_TEXTURE_BINDING_3D, "GL_TEXTURE_BINDING_3D"},
{GL_TRANSFORM_FEEDBACK_BINDING, "GL_TRANSFORM_FEEDBACK_BINDING"},
@@ -4946,6 +3922,7 @@ std::string GLES2Util::GetStringImageInternalFormat(uint32_t value) {
static const EnumToString string_table[] = {
{GL_RGB, "GL_RGB"},
{GL_RGB_YUV_420_CHROMIUM, "GL_RGB_YUV_420_CHROMIUM"},
+ {GL_RGB_YCBCR_422_CHROMIUM, "GL_RGB_YCBCR_422_CHROMIUM"},
{GL_RGBA, "GL_RGBA"},
};
return GLES2Util::GetQualifiedEnumString(string_table,
@@ -5034,6 +4011,47 @@ std::string GLES2Util::GetStringMatrixMode(uint32_t value) {
arraysize(string_table), value);
}
+std::string GLES2Util::GetStringPathCoordType(uint32_t value) {
+ static const EnumToString string_table[] = {
+ {GL_BYTE, "GL_BYTE"}, {GL_UNSIGNED_BYTE, "GL_UNSIGNED_BYTE"},
+ {GL_SHORT, "GL_SHORT"}, {GL_UNSIGNED_SHORT, "GL_UNSIGNED_SHORT"},
+ {GL_FLOAT, "GL_FLOAT"},
+ };
+ return GLES2Util::GetQualifiedEnumString(string_table,
+ arraysize(string_table), value);
+}
+
+std::string GLES2Util::GetStringPathCoverMode(uint32_t value) {
+ static const EnumToString string_table[] = {
+ {GL_CONVEX_HULL_CHROMIUM, "GL_CONVEX_HULL_CHROMIUM"},
+ {GL_BOUNDING_BOX_CHROMIUM, "GL_BOUNDING_BOX_CHROMIUM"},
+ };
+ return GLES2Util::GetQualifiedEnumString(string_table,
+ arraysize(string_table), value);
+}
+
+std::string GLES2Util::GetStringPathFillMode(uint32_t value) {
+ static const EnumToString string_table[] = {
+ {GL_INVERT, "GL_INVERT"},
+ {GL_COUNT_UP_CHROMIUM, "GL_COUNT_UP_CHROMIUM"},
+ {GL_COUNT_DOWN_CHROMIUM, "GL_COUNT_DOWN_CHROMIUM"},
+ };
+ return GLES2Util::GetQualifiedEnumString(string_table,
+ arraysize(string_table), value);
+}
+
+std::string GLES2Util::GetStringPathParameter(uint32_t value) {
+ static const EnumToString string_table[] = {
+ {GL_PATH_STROKE_WIDTH_CHROMIUM, "GL_PATH_STROKE_WIDTH_CHROMIUM"},
+ {GL_PATH_END_CAPS_CHROMIUM, "GL_PATH_END_CAPS_CHROMIUM"},
+ {GL_PATH_JOIN_STYLE_CHROMIUM, "GL_PATH_JOIN_STYLE_CHROMIUM"},
+ {GL_PATH_MITER_LIMIT_CHROMIUM, "GL_PATH_MITER_LIMIT_CHROMIUM"},
+ {GL_PATH_STROKE_BOUND_CHROMIUM, "GL_PATH_STROKE_BOUND_CHROMIUM"},
+ };
+ return GLES2Util::GetQualifiedEnumString(string_table,
+ arraysize(string_table), value);
+}
+
std::string GLES2Util::GetStringPixelStore(uint32_t value) {
static const EnumToString string_table[] = {
{GL_PACK_ALIGNMENT, "GL_PACK_ALIGNMENT"},
@@ -5121,8 +4139,6 @@ std::string GLES2Util::GetStringQueryTarget(uint32_t value) {
"GL_ANY_SAMPLES_PASSED_CONSERVATIVE_EXT"},
{GL_COMMANDS_ISSUED_CHROMIUM, "GL_COMMANDS_ISSUED_CHROMIUM"},
{GL_LATENCY_QUERY_CHROMIUM, "GL_LATENCY_QUERY_CHROMIUM"},
- {GL_ASYNC_PIXEL_UNPACK_COMPLETED_CHROMIUM,
- "GL_ASYNC_PIXEL_UNPACK_COMPLETED_CHROMIUM"},
{GL_ASYNC_PIXEL_PACK_COMPLETED_CHROMIUM,
"GL_ASYNC_PIXEL_PACK_COMPLETED_CHROMIUM"},
{GL_COMMANDS_COMPLETED_CHROMIUM, "GL_COMMANDS_COMPLETED_CHROMIUM"},
@@ -5131,11 +4147,41 @@ std::string GLES2Util::GetStringQueryTarget(uint32_t value) {
arraysize(string_table), value);
}
+std::string GLES2Util::GetStringReadBuffer(uint32_t value) {
+ static const EnumToString string_table[] = {
+ {GL_NONE, "GL_NONE"},
+ {GL_BACK, "GL_BACK"},
+ {GL_COLOR_ATTACHMENT0, "GL_COLOR_ATTACHMENT0"},
+ {GL_COLOR_ATTACHMENT1, "GL_COLOR_ATTACHMENT1"},
+ {GL_COLOR_ATTACHMENT2, "GL_COLOR_ATTACHMENT2"},
+ {GL_COLOR_ATTACHMENT3, "GL_COLOR_ATTACHMENT3"},
+ {GL_COLOR_ATTACHMENT4, "GL_COLOR_ATTACHMENT4"},
+ {GL_COLOR_ATTACHMENT5, "GL_COLOR_ATTACHMENT5"},
+ {GL_COLOR_ATTACHMENT6, "GL_COLOR_ATTACHMENT6"},
+ {GL_COLOR_ATTACHMENT7, "GL_COLOR_ATTACHMENT7"},
+ {GL_COLOR_ATTACHMENT8, "GL_COLOR_ATTACHMENT8"},
+ {GL_COLOR_ATTACHMENT9, "GL_COLOR_ATTACHMENT9"},
+ {GL_COLOR_ATTACHMENT10, "GL_COLOR_ATTACHMENT10"},
+ {GL_COLOR_ATTACHMENT11, "GL_COLOR_ATTACHMENT11"},
+ {GL_COLOR_ATTACHMENT12, "GL_COLOR_ATTACHMENT12"},
+ {GL_COLOR_ATTACHMENT13, "GL_COLOR_ATTACHMENT13"},
+ {GL_COLOR_ATTACHMENT14, "GL_COLOR_ATTACHMENT14"},
+ {GL_COLOR_ATTACHMENT15, "GL_COLOR_ATTACHMENT15"},
+ };
+ return GLES2Util::GetQualifiedEnumString(string_table,
+ arraysize(string_table), value);
+}
+
std::string GLES2Util::GetStringReadPixelFormat(uint32_t value) {
static const EnumToString string_table[] = {
{GL_ALPHA, "GL_ALPHA"},
{GL_RGB, "GL_RGB"},
{GL_RGBA, "GL_RGBA"},
+ {GL_RED, "GL_RED"},
+ {GL_RED_INTEGER, "GL_RED_INTEGER"},
+ {GL_RG, "GL_RG"},
+ {GL_RG_INTEGER, "GL_RG_INTEGER"},
+ {GL_RGB_INTEGER, "GL_RGB_INTEGER"},
{GL_RGBA_INTEGER, "GL_RGBA_INTEGER"},
};
return GLES2Util::GetQualifiedEnumString(string_table,
@@ -5148,9 +4194,14 @@ std::string GLES2Util::GetStringReadPixelType(uint32_t value) {
{GL_UNSIGNED_SHORT_5_6_5, "GL_UNSIGNED_SHORT_5_6_5"},
{GL_UNSIGNED_SHORT_4_4_4_4, "GL_UNSIGNED_SHORT_4_4_4_4"},
{GL_UNSIGNED_SHORT_5_5_5_1, "GL_UNSIGNED_SHORT_5_5_5_1"},
+ {GL_BYTE, "GL_BYTE"},
+ {GL_UNSIGNED_SHORT, "GL_UNSIGNED_SHORT"},
+ {GL_SHORT, "GL_SHORT"},
{GL_UNSIGNED_INT, "GL_UNSIGNED_INT"},
{GL_INT, "GL_INT"},
+ {GL_HALF_FLOAT, "GL_HALF_FLOAT"},
{GL_FLOAT, "GL_FLOAT"},
+ {GL_UNSIGNED_INT_2_10_10_10_REV, "GL_UNSIGNED_INT_2_10_10_10_REV"},
};
return GLES2Util::GetQualifiedEnumString(string_table,
arraysize(string_table), value);
@@ -5268,12 +4319,9 @@ std::string GLES2Util::GetStringShaderParameter(uint32_t value) {
std::string GLES2Util::GetStringShaderPrecision(uint32_t value) {
static const EnumToString string_table[] = {
- {GL_LOW_FLOAT, "GL_LOW_FLOAT"},
- {GL_MEDIUM_FLOAT, "GL_MEDIUM_FLOAT"},
- {GL_HIGH_FLOAT, "GL_HIGH_FLOAT"},
- {GL_LOW_INT, "GL_LOW_INT"},
- {GL_MEDIUM_INT, "GL_MEDIUM_INT"},
- {GL_HIGH_INT, "GL_HIGH_INT"},
+ {GL_LOW_FLOAT, "GL_LOW_FLOAT"}, {GL_MEDIUM_FLOAT, "GL_MEDIUM_FLOAT"},
+ {GL_HIGH_FLOAT, "GL_HIGH_FLOAT"}, {GL_LOW_INT, "GL_LOW_INT"},
+ {GL_MEDIUM_INT, "GL_MEDIUM_INT"}, {GL_HIGH_INT, "GL_HIGH_INT"},
};
return GLES2Util::GetQualifiedEnumString(string_table,
arraysize(string_table), value);
@@ -5312,14 +4360,10 @@ std::string GLES2Util::GetStringSrcBlendFactor(uint32_t value) {
std::string GLES2Util::GetStringStencilOp(uint32_t value) {
static const EnumToString string_table[] = {
- {GL_KEEP, "GL_KEEP"},
- {GL_ZERO, "GL_ZERO"},
- {GL_REPLACE, "GL_REPLACE"},
- {GL_INCR, "GL_INCR"},
- {GL_INCR_WRAP, "GL_INCR_WRAP"},
- {GL_DECR, "GL_DECR"},
- {GL_DECR_WRAP, "GL_DECR_WRAP"},
- {GL_INVERT, "GL_INVERT"},
+ {GL_KEEP, "GL_KEEP"}, {GL_ZERO, "GL_ZERO"},
+ {GL_REPLACE, "GL_REPLACE"}, {GL_INCR, "GL_INCR"},
+ {GL_INCR_WRAP, "GL_INCR_WRAP"}, {GL_DECR, "GL_DECR"},
+ {GL_DECR_WRAP, "GL_DECR_WRAP"}, {GL_INVERT, "GL_INVERT"},
};
return GLES2Util::GetQualifiedEnumString(string_table,
arraysize(string_table), value);
@@ -5386,14 +4430,10 @@ std::string GLES2Util::GetStringTextureBindTarget(uint32_t value) {
std::string GLES2Util::GetStringTextureCompareFunc(uint32_t value) {
static const EnumToString string_table[] = {
- {GL_LEQUAL, "GL_LEQUAL"},
- {GL_GEQUAL, "GL_GEQUAL"},
- {GL_LESS, "GL_LESS"},
- {GL_GREATER, "GL_GREATER"},
- {GL_EQUAL, "GL_EQUAL"},
- {GL_NOTEQUAL, "GL_NOTEQUAL"},
- {GL_ALWAYS, "GL_ALWAYS"},
- {GL_NEVER, "GL_NEVER"},
+ {GL_LEQUAL, "GL_LEQUAL"}, {GL_GEQUAL, "GL_GEQUAL"},
+ {GL_LESS, "GL_LESS"}, {GL_GREATER, "GL_GREATER"},
+ {GL_EQUAL, "GL_EQUAL"}, {GL_NOTEQUAL, "GL_NOTEQUAL"},
+ {GL_ALWAYS, "GL_ALWAYS"}, {GL_NEVER, "GL_NEVER"},
};
return GLES2Util::GetQualifiedEnumString(string_table,
arraysize(string_table), value);
@@ -5719,12 +4759,9 @@ std::string GLES2Util::GetStringValueBufferTarget(uint32_t value) {
std::string GLES2Util::GetStringVertexAttribIType(uint32_t value) {
static const EnumToString string_table[] = {
- {GL_BYTE, "GL_BYTE"},
- {GL_UNSIGNED_BYTE, "GL_UNSIGNED_BYTE"},
- {GL_SHORT, "GL_SHORT"},
- {GL_UNSIGNED_SHORT, "GL_UNSIGNED_SHORT"},
- {GL_INT, "GL_INT"},
- {GL_UNSIGNED_INT, "GL_UNSIGNED_INT"},
+ {GL_BYTE, "GL_BYTE"}, {GL_UNSIGNED_BYTE, "GL_UNSIGNED_BYTE"},
+ {GL_SHORT, "GL_SHORT"}, {GL_UNSIGNED_SHORT, "GL_UNSIGNED_SHORT"},
+ {GL_INT, "GL_INT"}, {GL_UNSIGNED_INT, "GL_UNSIGNED_INT"},
};
return GLES2Util::GetQualifiedEnumString(string_table,
arraysize(string_table), value);
diff --git a/chromium/gpu/command_buffer/common/gles2_cmd_utils_unittest.cc b/chromium/gpu/command_buffer/common/gles2_cmd_utils_unittest.cc
index 8f7f94f270d..54ad3b59152 100644
--- a/chromium/gpu/command_buffer/common/gles2_cmd_utils_unittest.cc
+++ b/chromium/gpu/command_buffer/common/gles2_cmd_utils_unittest.cc
@@ -235,6 +235,18 @@ TEST_F(GLES2UtilTest, ComputeImageDataSizeTypes) {
EXPECT_EQ(kWidth * kHeight * 8, size);
EXPECT_EQ(kWidth * 8, padded_row_size);
EXPECT_EQ(padded_row_size, unpadded_row_size);
+ EXPECT_TRUE(GLES2Util::ComputeImageDataSizes(
+ kWidth, kHeight, 1, GL_RGBA, GL_HALF_FLOAT,
+ 1, &size, &unpadded_row_size, &padded_row_size));
+ EXPECT_EQ(kWidth * kHeight * 8, size);
+ EXPECT_EQ(kWidth * 8, padded_row_size);
+ EXPECT_EQ(padded_row_size, unpadded_row_size);
+ EXPECT_TRUE(GLES2Util::ComputeImageDataSizes(
+ kWidth, kHeight, 1, GL_RGBA, GL_HALF_FLOAT_OES,
+ 1, &size, &unpadded_row_size, &padded_row_size));
+ EXPECT_EQ(kWidth * kHeight * 8, size);
+ EXPECT_EQ(kWidth * 8, padded_row_size);
+ EXPECT_EQ(padded_row_size, unpadded_row_size);
}
TEST_F(GLES2UtilTest, ComputeImageDataSizesUnpackAlignment) {
diff --git a/chromium/gpu/command_buffer/common/mailbox.h b/chromium/gpu/command_buffer/common/mailbox.h
index 67b023e9936..94d63c53bbe 100644
--- a/chromium/gpu/command_buffer/common/mailbox.h
+++ b/chromium/gpu/command_buffer/common/mailbox.h
@@ -17,6 +17,13 @@
namespace gpu {
+// A mailbox is an unguessable name that references texture image data.
+// This name can be passed across processes permitting one context to share
+// texture image data with another. The mailbox name consists of a random
+// set of bytes, optionally with a checksum (in debug mode) to verify the
+// name is valid.
+// See src/gpu/GLES2/extensions/CHROMIUM/CHROMIUM_texture_mailbox.txt for more
+// details.
struct GPU_EXPORT Mailbox {
using Name = int8_t[GL_MAILBOX_SIZE_CHROMIUM];
diff --git a/chromium/gpu/command_buffer/common/mailbox_holder.h b/chromium/gpu/command_buffer/common/mailbox_holder.h
index 7c7a0e23123..51c377dba4c 100644
--- a/chromium/gpu/command_buffer/common/mailbox_holder.h
+++ b/chromium/gpu/command_buffer/common/mailbox_holder.h
@@ -13,6 +13,13 @@
namespace gpu {
+// A MailboxHolder is a mechanism by which texture image data produced by one
+// context can be consumed by another. The |sync_point| is used to allow one
+// context to wait until another has finished using the texture before it begins
+// using the texture. When the mailbox is backed by a GPU texture, the
+// |texture_target| is that texture's type.
+// See here for OpenGL texture types:
+// https://www.opengl.org/wiki/Texture#Texture_Objects
struct GPU_EXPORT MailboxHolder {
MailboxHolder();
MailboxHolder(const gpu::Mailbox& mailbox,
diff --git a/chromium/gpu/command_buffer/service/BUILD.gn b/chromium/gpu/command_buffer/service/BUILD.gn
index 0bcafdc97a8..ec6d209dd64 100644
--- a/chromium/gpu/command_buffer/service/BUILD.gn
+++ b/chromium/gpu/command_buffer/service/BUILD.gn
@@ -18,25 +18,12 @@ group("service") {
}
source_set("service_sources") {
- visibility = [ "//gpu/*" ]
+ visibility = [
+ "//gpu/*",
+ "//mojo/gles2:gles2",
+ ]
sources = [
- "async_pixel_transfer_delegate.cc",
- "async_pixel_transfer_delegate.h",
- "async_pixel_transfer_manager.cc",
- "async_pixel_transfer_manager.h",
- "async_pixel_transfer_manager_android.cc",
- "async_pixel_transfer_manager_idle.cc",
- "async_pixel_transfer_manager_idle.h",
- "async_pixel_transfer_manager_linux.cc",
- "async_pixel_transfer_manager_mac.cc",
- "async_pixel_transfer_manager_share_group.cc",
- "async_pixel_transfer_manager_share_group.h",
- "async_pixel_transfer_manager_stub.cc",
- "async_pixel_transfer_manager_stub.h",
- "async_pixel_transfer_manager_sync.cc",
- "async_pixel_transfer_manager_sync.h",
- "async_pixel_transfer_manager_win.cc",
"buffer_manager.cc",
"buffer_manager.h",
"cmd_buffer_engine.h",
@@ -56,6 +43,8 @@ source_set("service_sources") {
"error_state.h",
"feature_info.cc",
"feature_info.h",
+ "framebuffer_completeness_cache.cc",
+ "framebuffer_completeness_cache.h",
"framebuffer_manager.cc",
"framebuffer_manager.h",
"gl_context_virtual.cc",
@@ -92,6 +81,7 @@ source_set("service_sources") {
"in_process_command_buffer.h",
"logger.cc",
"logger.h",
+ "mailbox_manager.cc",
"mailbox_manager.h",
"mailbox_manager_impl.cc",
"mailbox_manager_impl.h",
@@ -99,6 +89,8 @@ source_set("service_sources") {
"mailbox_manager_sync.h",
"memory_program_cache.cc",
"memory_program_cache.h",
+ "path_manager.cc",
+ "path_manager.h",
"program_cache.cc",
"program_cache.h",
"program_manager.cc",
@@ -132,6 +124,7 @@ source_set("service_sources") {
]
configs += [
+ "//build/config:precompiled_headers",
"//gpu:gpu_implementation",
"//third_party/khronos:khronos_headers",
]
@@ -148,6 +141,7 @@ source_set("service_sources") {
"//base/third_party/dynamic_annotations",
"//crypto",
"//gpu/config:config_sources",
+ "//third_party/angle:commit_id",
"//third_party/angle:translator",
"//third_party/protobuf:protobuf_lite",
"//third_party/re2",
@@ -157,13 +151,6 @@ source_set("service_sources") {
"//ui/gl",
]
- if (is_win || is_android || (is_linux && use_x11)) {
- sources += [
- "async_pixel_transfer_manager_egl.cc",
- "async_pixel_transfer_manager_egl.h",
- ]
- }
-
if (is_mac) {
# Required by gles2_cmd_decoder.cc on Mac.
libs = [
@@ -174,7 +161,7 @@ source_set("service_sources") {
if (is_android && !is_debug) {
# On Android optimize more since this component can be a bottleneck.
- configs -= [ "//build/config/compiler:optimize" ]
+ configs -= [ "//build/config/compiler:default_optimization" ]
configs += [ "//build/config/compiler:optimize_max" ]
}
}
diff --git a/chromium/gpu/command_buffer/service/async_pixel_transfer_delegate.cc b/chromium/gpu/command_buffer/service/async_pixel_transfer_delegate.cc
deleted file mode 100644
index 201026b2176..00000000000
--- a/chromium/gpu/command_buffer/service/async_pixel_transfer_delegate.cc
+++ /dev/null
@@ -1,43 +0,0 @@
-// Copyright (c) 2013 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/command_buffer/service/async_pixel_transfer_delegate.h"
-
-namespace gpu {
-
-AsyncMemoryParams::AsyncMemoryParams(scoped_refptr<Buffer> buffer,
- uint32 data_offset,
- uint32 data_size)
- : buffer_(buffer), data_offset_(data_offset), data_size_(data_size) {
- DCHECK(buffer_.get());
- DCHECK(buffer_->memory());
-}
-
-AsyncMemoryParams::~AsyncMemoryParams() {
-}
-
-AsyncPixelTransferUploadStats::AsyncPixelTransferUploadStats()
- : texture_upload_count_(0) {}
-
-AsyncPixelTransferUploadStats::~AsyncPixelTransferUploadStats() {}
-
-void AsyncPixelTransferUploadStats::AddUpload(base::TimeDelta transfer_time) {
- base::AutoLock scoped_lock(lock_);
- texture_upload_count_++;
- total_texture_upload_time_ += transfer_time;
-}
-
-int AsyncPixelTransferUploadStats::GetStats(
- base::TimeDelta* total_texture_upload_time) {
- base::AutoLock scoped_lock(lock_);
- if (total_texture_upload_time)
- *total_texture_upload_time = total_texture_upload_time_;
- return texture_upload_count_;
-}
-
-AsyncPixelTransferDelegate::AsyncPixelTransferDelegate() {}
-
-AsyncPixelTransferDelegate::~AsyncPixelTransferDelegate() {}
-
-} // namespace gpu
diff --git a/chromium/gpu/command_buffer/service/async_pixel_transfer_delegate.h b/chromium/gpu/command_buffer/service/async_pixel_transfer_delegate.h
deleted file mode 100644
index b41bcd52444..00000000000
--- a/chromium/gpu/command_buffer/service/async_pixel_transfer_delegate.h
+++ /dev/null
@@ -1,117 +0,0 @@
-// Copyright (c) 2013 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_COMMAND_BUFFER_SERVICE_ASYNC_PIXEL_TRANSFER_DELEGATE_H_
-#define GPU_COMMAND_BUFFER_SERVICE_ASYNC_PIXEL_TRANSFER_DELEGATE_H_
-
-#include "base/basictypes.h"
-#include "base/callback.h"
-#include "base/memory/ref_counted.h"
-#include "base/memory/scoped_ptr.h"
-#include "base/synchronization/lock.h"
-#include "base/time/time.h"
-#include "gpu/command_buffer/common/buffer.h"
-#include "gpu/gpu_export.h"
-#include "ui/gl/gl_bindings.h"
-
-namespace base {
-class SharedMemory;
-}
-
-namespace gpu {
-
-struct AsyncTexImage2DParams {
- GLenum target;
- GLint level;
- GLenum internal_format;
- GLsizei width;
- GLsizei height;
- GLint border;
- GLenum format;
- GLenum type;
-};
-
-struct AsyncTexSubImage2DParams {
- GLenum target;
- GLint level;
- GLint xoffset;
- GLint yoffset;
- GLsizei width;
- GLsizei height;
- GLenum format;
- GLenum type;
-};
-
-class AsyncMemoryParams {
- public:
- AsyncMemoryParams(scoped_refptr<Buffer> buffer,
- uint32 data_offset,
- uint32 data_size);
- ~AsyncMemoryParams();
-
- scoped_refptr<Buffer> buffer() const { return buffer_; }
- uint32 data_size() const { return data_size_; }
- uint32 data_offset() const { return data_offset_; }
- void* GetDataAddress() const {
- return buffer_->GetDataAddress(data_offset_, data_size_);
- }
-
- private:
- scoped_refptr<Buffer> buffer_;
- uint32 data_offset_;
- uint32 data_size_;
-};
-
-class AsyncPixelTransferUploadStats
- : public base::RefCountedThreadSafe<AsyncPixelTransferUploadStats> {
- public:
- AsyncPixelTransferUploadStats();
-
- void AddUpload(base::TimeDelta transfer_time);
- int GetStats(base::TimeDelta* total_texture_upload_time);
-
- private:
- friend class base::RefCountedThreadSafe<AsyncPixelTransferUploadStats>;
-
- ~AsyncPixelTransferUploadStats();
-
- int texture_upload_count_;
- base::TimeDelta total_texture_upload_time_;
- base::Lock lock_;
-
- DISALLOW_COPY_AND_ASSIGN(AsyncPixelTransferUploadStats);
-};
-
-class GPU_EXPORT AsyncPixelTransferDelegate {
- public:
- virtual ~AsyncPixelTransferDelegate();
-
- // The callback occurs on the caller thread, once the texture is
- // safe/ready to be used.
- virtual void AsyncTexImage2D(
- const AsyncTexImage2DParams& tex_params,
- const AsyncMemoryParams& mem_params,
- const base::Closure& bind_callback) = 0;
-
- virtual void AsyncTexSubImage2D(
- const AsyncTexSubImage2DParams& tex_params,
- const AsyncMemoryParams& mem_params) = 0;
-
- // Returns true if there is a transfer in progress.
- virtual bool TransferIsInProgress() = 0;
-
- // Block until the specified transfer completes.
- virtual void WaitForTransferCompletion() = 0;
-
- protected:
- AsyncPixelTransferDelegate();
-
- private:
- DISALLOW_COPY_AND_ASSIGN(AsyncPixelTransferDelegate);
-};
-
-} // namespace gpu
-
-#endif // GPU_COMMAND_BUFFER_SERVICE_ASYNC_PIXEL_TRANSFER_DELEGATE_H_
-
diff --git a/chromium/gpu/command_buffer/service/async_pixel_transfer_delegate_mock.cc b/chromium/gpu/command_buffer/service/async_pixel_transfer_delegate_mock.cc
deleted file mode 100644
index 8e2d75fd9e4..00000000000
--- a/chromium/gpu/command_buffer/service/async_pixel_transfer_delegate_mock.cc
+++ /dev/null
@@ -1,17 +0,0 @@
-// 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.
-
-#include "gpu/command_buffer/service/async_pixel_transfer_delegate_mock.h"
-
-namespace gpu {
-
-MockAsyncPixelTransferDelegate::MockAsyncPixelTransferDelegate() {
-}
-
-MockAsyncPixelTransferDelegate::~MockAsyncPixelTransferDelegate() {
- Destroy();
-}
-
-} // namespace gpu
-
diff --git a/chromium/gpu/command_buffer/service/async_pixel_transfer_delegate_mock.h b/chromium/gpu/command_buffer/service/async_pixel_transfer_delegate_mock.h
deleted file mode 100644
index 9d2873023ed..00000000000
--- a/chromium/gpu/command_buffer/service/async_pixel_transfer_delegate_mock.h
+++ /dev/null
@@ -1,39 +0,0 @@
-// 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.
-
-#ifndef GPU_COMMAND_BUFFER_SERVICE_ASYNC_PIXEL_TRANSFER_DELEGATE_MOCK
-#define GPU_COMMAND_BUFFER_SERVICE_ASYNC_PIXEL_TRANSFER_DELEGATE_MOCK
-
-#include "base/basictypes.h"
-#include "gpu/command_buffer/service/async_pixel_transfer_delegate.h"
-#include "testing/gmock/include/gmock/gmock.h"
-
-namespace gpu {
-
-class MockAsyncPixelTransferDelegate : public AsyncPixelTransferDelegate {
- public:
- MockAsyncPixelTransferDelegate();
- virtual ~MockAsyncPixelTransferDelegate();
-
- // Called in ~MockAsyncPixelTransferDelegate.
- MOCK_METHOD0(Destroy, void());
-
- // Implement AsyncPixelTransferDelegate.
- MOCK_METHOD3(AsyncTexImage2D,
- void(const AsyncTexImage2DParams& tex_params,
- const AsyncMemoryParams& mem_params,
- const base::Closure& bind_callback));
- MOCK_METHOD2(AsyncTexSubImage2D,
- void(const AsyncTexSubImage2DParams& tex_params,
- const AsyncMemoryParams& mem_params));
- MOCK_METHOD0(TransferIsInProgress, bool());
- MOCK_METHOD0(WaitForTransferCompletion, void());
-
- private:
- DISALLOW_COPY_AND_ASSIGN(MockAsyncPixelTransferDelegate);
-};
-
-} // namespace gpu
-
-#endif // GPU_COMMAND_BUFFER_SERVICE_ASYNC_PIXEL_TRANSFER_DELEGATE_MOCK
diff --git a/chromium/gpu/command_buffer/service/async_pixel_transfer_manager.cc b/chromium/gpu/command_buffer/service/async_pixel_transfer_manager.cc
deleted file mode 100644
index efc893a40ca..00000000000
--- a/chromium/gpu/command_buffer/service/async_pixel_transfer_manager.cc
+++ /dev/null
@@ -1,87 +0,0 @@
-// Copyright 2013 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/command_buffer/service/async_pixel_transfer_manager.h"
-
-#include "gpu/command_buffer/service/async_pixel_transfer_delegate.h"
-
-namespace gpu {
-
-AsyncPixelTransferCompletionObserver::AsyncPixelTransferCompletionObserver() {}
-
-AsyncPixelTransferCompletionObserver::~AsyncPixelTransferCompletionObserver() {}
-
-AsyncPixelTransferManager::AsyncPixelTransferManager() {}
-
-AsyncPixelTransferManager::~AsyncPixelTransferManager() {
- if (manager_)
- manager_->RemoveObserver(this);
-
- for (TextureToDelegateMap::iterator ref = delegate_map_.begin();
- ref != delegate_map_.end();
- ref++) {
- ref->first->RemoveObserver();
- }
-}
-
-void AsyncPixelTransferManager::Initialize(gles2::TextureManager* manager) {
- manager_ = manager;
- manager_->AddObserver(this);
-}
-
-AsyncPixelTransferDelegate*
-AsyncPixelTransferManager::CreatePixelTransferDelegate(
- gles2::TextureRef* ref,
- const AsyncTexImage2DParams& define_params) {
- DCHECK(!GetPixelTransferDelegate(ref));
- AsyncPixelTransferDelegate* delegate =
- CreatePixelTransferDelegateImpl(ref, define_params);
- delegate_map_[ref] = make_linked_ptr(delegate);
- ref->AddObserver();
- return delegate;
-}
-
-AsyncPixelTransferDelegate*
-AsyncPixelTransferManager::GetPixelTransferDelegate(
- gles2::TextureRef* ref) {
- TextureToDelegateMap::iterator it = delegate_map_.find(ref);
- if (it == delegate_map_.end()) {
- return NULL;
- } else {
- return it->second.get();
- }
-}
-
-void AsyncPixelTransferManager::ClearPixelTransferDelegateForTest(
- gles2::TextureRef* ref) {
- TextureToDelegateMap::iterator it = delegate_map_.find(ref);
- if (it != delegate_map_.end()) {
- delegate_map_.erase(it);
- ref->RemoveObserver();
- }
-}
-
-bool AsyncPixelTransferManager::AsyncTransferIsInProgress(
- gles2::TextureRef* ref) {
- AsyncPixelTransferDelegate* delegate = GetPixelTransferDelegate(ref);
- return delegate && delegate->TransferIsInProgress();
-}
-
-void AsyncPixelTransferManager::OnTextureManagerDestroying(
- gles2::TextureManager* manager) {
- // TextureManager should outlive AsyncPixelTransferManager.
- NOTREACHED();
- manager_ = NULL;
-}
-
-void AsyncPixelTransferManager::OnTextureRefDestroying(
- gles2::TextureRef* texture) {
- TextureToDelegateMap::iterator it = delegate_map_.find(texture);
- if (it != delegate_map_.end()) {
- delegate_map_.erase(it);
- texture->RemoveObserver();
- }
-}
-
-} // namespace gpu
diff --git a/chromium/gpu/command_buffer/service/async_pixel_transfer_manager.h b/chromium/gpu/command_buffer/service/async_pixel_transfer_manager.h
deleted file mode 100644
index 3f52e1ec3a2..00000000000
--- a/chromium/gpu/command_buffer/service/async_pixel_transfer_manager.h
+++ /dev/null
@@ -1,110 +0,0 @@
-// Copyright 2013 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_COMMAND_BUFFER_SERVICE_ASYNC_PIXEL_TRANSFER_MANAGER_H_
-#define GPU_COMMAND_BUFFER_SERVICE_ASYNC_PIXEL_TRANSFER_MANAGER_H_
-
-#include <set>
-
-#include "base/basictypes.h"
-#include "base/callback.h"
-#include "base/containers/hash_tables.h"
-#include "base/memory/linked_ptr.h"
-#include "base/memory/ref_counted.h"
-#include "gpu/command_buffer/service/texture_manager.h"
-#include "gpu/gpu_export.h"
-
-namespace gfx {
-class GLContext;
-}
-
-namespace gpu {
-class AsyncPixelTransferDelegate;
-class AsyncMemoryParams;
-struct AsyncTexImage2DParams;
-
-class AsyncPixelTransferCompletionObserver
- : public base::RefCountedThreadSafe<AsyncPixelTransferCompletionObserver> {
- public:
- AsyncPixelTransferCompletionObserver();
-
- virtual void DidComplete(const AsyncMemoryParams& mem_params) = 0;
-
- protected:
- virtual ~AsyncPixelTransferCompletionObserver();
-
- private:
- friend class base::RefCountedThreadSafe<AsyncPixelTransferCompletionObserver>;
-
- DISALLOW_COPY_AND_ASSIGN(AsyncPixelTransferCompletionObserver);
-};
-
-class GPU_EXPORT AsyncPixelTransferManager
- : public gles2::TextureManager::DestructionObserver {
- public:
- static AsyncPixelTransferManager* Create(gfx::GLContext* context);
-
- ~AsyncPixelTransferManager() override;
-
- void Initialize(gles2::TextureManager* texture_manager);
-
- virtual void BindCompletedAsyncTransfers() = 0;
-
- // There's no guarantee that callback will run on the caller thread.
- virtual void AsyncNotifyCompletion(
- const AsyncMemoryParams& mem_params,
- AsyncPixelTransferCompletionObserver* observer) = 0;
-
- virtual uint32 GetTextureUploadCount() = 0;
- virtual base::TimeDelta GetTotalTextureUploadTime() = 0;
-
- // ProcessMorePendingTransfers() will be called at a good time
- // to process a small amount of pending transfer work while
- // NeedsProcessMorePendingTransfers() returns true. Implementations
- // that can't dispatch work to separate threads should use
- // this to avoid blocking the caller thread inappropriately.
- virtual void ProcessMorePendingTransfers() = 0;
- virtual bool NeedsProcessMorePendingTransfers() = 0;
-
- // Wait for all AsyncTex(Sub)Image2D uploads to finish before returning.
- virtual void WaitAllAsyncTexImage2D() = 0;
-
- AsyncPixelTransferDelegate* CreatePixelTransferDelegate(
- gles2::TextureRef* ref,
- const AsyncTexImage2DParams& define_params);
-
- AsyncPixelTransferDelegate* GetPixelTransferDelegate(
- gles2::TextureRef* ref);
-
- void ClearPixelTransferDelegateForTest(gles2::TextureRef* ref);
-
- bool AsyncTransferIsInProgress(gles2::TextureRef* ref);
-
- // gles2::TextureRef::DestructionObserver implementation:
- void OnTextureManagerDestroying(gles2::TextureManager* manager) override;
- void OnTextureRefDestroying(gles2::TextureRef* texture) override;
-
- protected:
- AsyncPixelTransferManager();
-
- private:
- gles2::TextureManager* manager_;
-
- typedef base::hash_map<gles2::TextureRef*,
- linked_ptr<AsyncPixelTransferDelegate> >
- TextureToDelegateMap;
- TextureToDelegateMap delegate_map_;
-
- // A factory method called by CreatePixelTransferDelegate that is overriden
- // by each implementation.
- virtual AsyncPixelTransferDelegate* CreatePixelTransferDelegateImpl(
- gles2::TextureRef* ref,
- const AsyncTexImage2DParams& define_params) = 0;
-
- DISALLOW_COPY_AND_ASSIGN(AsyncPixelTransferManager);
-};
-
-} // namespace gpu
-
-#endif // GPU_COMMAND_BUFFER_SERVICE_ASYNC_PIXEL_TRANSFER_MANAGER_H_
diff --git a/chromium/gpu/command_buffer/service/async_pixel_transfer_manager_android.cc b/chromium/gpu/command_buffer/service/async_pixel_transfer_manager_android.cc
deleted file mode 100644
index 9b6b7e212c6..00000000000
--- a/chromium/gpu/command_buffer/service/async_pixel_transfer_manager_android.cc
+++ /dev/null
@@ -1,118 +0,0 @@
-// Copyright 2013 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/command_buffer/service/async_pixel_transfer_manager.h"
-
-#include "base/command_line.h"
-#include "base/sys_info.h"
-#include "base/trace_event/trace_event.h"
-#include "gpu/command_buffer/service/async_pixel_transfer_manager_egl.h"
-#include "gpu/command_buffer/service/async_pixel_transfer_manager_idle.h"
-#include "gpu/command_buffer/service/async_pixel_transfer_manager_stub.h"
-#include "gpu/command_buffer/service/async_pixel_transfer_manager_sync.h"
-#include "gpu/command_buffer/service/gpu_switches.h"
-#include "ui/gl/gl_context.h"
-#include "ui/gl/gl_implementation.h"
-
-namespace gpu {
-namespace {
-
-enum GpuType {
- GPU_BROADCOM,
- GPU_IMAGINATION,
- GPU_NVIDIA_ES31,
- GPU_ADRENO_420,
- GPU_OTHER,
-};
-
-std::string MakeString(const char* s) {
- return std::string(s ? s : "");
-}
-
-GpuType GetGpuType() {
- const std::string vendor = MakeString(
- reinterpret_cast<const char*>(glGetString(GL_VENDOR)));
- const std::string renderer = MakeString(
- reinterpret_cast<const char*>(glGetString(GL_RENDERER)));
- const std::string version = MakeString(
- reinterpret_cast<const char*>(glGetString(GL_VERSION)));
-
- if (vendor.find("Broadcom") != std::string::npos)
- return GPU_BROADCOM;
-
- if (vendor.find("Imagination") != std::string::npos)
- return GPU_IMAGINATION;
-
- if (vendor.find("NVIDIA") != std::string::npos &&
- version.find("OpenGL ES 3.1") != std::string::npos) {
- return GPU_NVIDIA_ES31;
- }
-
- if (vendor.find("Qualcomm") != std::string::npos &&
- renderer.find("Adreno (TM) 420") != std::string::npos) {
- return GPU_ADRENO_420;
- }
-
- return GPU_OTHER;
-}
-
-bool AllowTransferThreadForGpu() {
- GpuType gpu = GetGpuType();
- return gpu != GPU_BROADCOM && gpu != GPU_IMAGINATION &&
- gpu != GPU_NVIDIA_ES31 && gpu != GPU_ADRENO_420;
-}
-
-}
-
-// We only used threaded uploads when we can:
-// - Create EGLImages out of OpenGL textures (EGL_KHR_gl_texture_2D_image)
-// - Bind EGLImages to OpenGL textures (GL_OES_EGL_image)
-// - Use fences (to test for upload completion).
-// - The heap size is large enough.
-// TODO(kaanb|epenner): Remove the IsImagination() check pending the
-// resolution of crbug.com/249147
-// TODO(kaanb|epenner): Remove the IsLowEndDevice() check pending the
-// resolution of crbug.com/271929
-AsyncPixelTransferManager* AsyncPixelTransferManager::Create(
- gfx::GLContext* context) {
- DCHECK(context->IsCurrent(NULL));
- base::CommandLine* cl = base::CommandLine::ForCurrentProcess();
-
- // Threaded mailbox uses EGLImage which conflicts with EGL uploader.
- // The spec only allows one EGL image per sibling group, but currently the
- // image handle cannot be shared between the threaded mailbox code and
- // AsyncPixelTransferManagerEGL.
- bool uses_threaded_mailboxes =
- cl->HasSwitch(switches::kEnableThreadedTextureMailboxes);
- // TexImage2D orphans the EGLImage used for threaded mailbox sharing.
- bool use_teximage2d_over_texsubimage2d = !uses_threaded_mailboxes;
- switch (gfx::GetGLImplementation()) {
- case gfx::kGLImplementationEGLGLES2:
- DCHECK(context);
- if (!base::SysInfo::IsLowEndDevice() &&
- context->HasExtension("EGL_KHR_fence_sync") &&
- context->HasExtension("EGL_KHR_image") &&
- context->HasExtension("EGL_KHR_image_base") &&
- context->HasExtension("EGL_KHR_gl_texture_2D_image") &&
- context->HasExtension("GL_OES_EGL_image") &&
- !uses_threaded_mailboxes && AllowTransferThreadForGpu()) {
- TRACE_EVENT0("gpu", "AsyncPixelTransferManager_CreateWithThread");
- return new AsyncPixelTransferManagerEGL;
- }
- return new AsyncPixelTransferManagerIdle(
- use_teximage2d_over_texsubimage2d);
- case gfx::kGLImplementationOSMesaGL: {
- TRACE_EVENT0("gpu", "AsyncPixelTransferManager_CreateIdle");
- return new AsyncPixelTransferManagerIdle(
- use_teximage2d_over_texsubimage2d);
- }
- case gfx::kGLImplementationMockGL:
- return new AsyncPixelTransferManagerStub;
- default:
- NOTREACHED();
- return NULL;
- }
-}
-
-} // namespace gpu
diff --git a/chromium/gpu/command_buffer/service/async_pixel_transfer_manager_egl.cc b/chromium/gpu/command_buffer/service/async_pixel_transfer_manager_egl.cc
deleted file mode 100644
index 6e1c3e7c61e..00000000000
--- a/chromium/gpu/command_buffer/service/async_pixel_transfer_manager_egl.cc
+++ /dev/null
@@ -1,733 +0,0 @@
-// Copyright 2013 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/command_buffer/service/async_pixel_transfer_manager_egl.h"
-
-#include <list>
-#include <string>
-
-#include "base/bind.h"
-#include "base/lazy_instance.h"
-#include "base/location.h"
-#include "base/logging.h"
-#include "base/memory/ref_counted.h"
-#include "base/single_thread_task_runner.h"
-#include "base/synchronization/waitable_event.h"
-#include "base/threading/thread.h"
-#include "base/trace_event/trace_event.h"
-#include "base/trace_event/trace_event_synthetic_delay.h"
-#include "gpu/command_buffer/service/async_pixel_transfer_delegate.h"
-#include "ui/gl/gl_context.h"
-#include "ui/gl/gl_surface_egl.h"
-#include "ui/gl/scoped_binders.h"
-
-namespace gpu {
-
-namespace {
-
-bool CheckErrors(const char* file, int line) {
- EGLint eglerror;
- GLenum glerror;
- bool success = true;
- while ((eglerror = eglGetError()) != EGL_SUCCESS) {
- LOG(ERROR) << "Async transfer EGL error at "
- << file << ":" << line << " " << eglerror;
- success = false;
- }
- while ((glerror = glGetError()) != GL_NO_ERROR) {
- LOG(ERROR) << "Async transfer OpenGL error at "
- << file << ":" << line << " " << glerror;
- success = false;
- }
- return success;
-}
-#define CHECK_GL() CheckErrors(__FILE__, __LINE__)
-
-const char kAsyncTransferThreadName[] = "AsyncTransferThread";
-
-// Regular glTexImage2D call.
-void DoTexImage2D(const AsyncTexImage2DParams& tex_params, void* data) {
- glTexImage2D(
- GL_TEXTURE_2D, tex_params.level, tex_params.internal_format,
- tex_params.width, tex_params.height,
- tex_params.border, tex_params.format, tex_params.type, data);
-}
-
-// Regular glTexSubImage2D call.
-void DoTexSubImage2D(const AsyncTexSubImage2DParams& tex_params, void* data) {
- glTexSubImage2D(
- GL_TEXTURE_2D, tex_params.level,
- tex_params.xoffset, tex_params.yoffset,
- tex_params.width, tex_params.height,
- tex_params.format, tex_params.type, data);
-}
-
-// Full glTexSubImage2D call, from glTexImage2D params.
-void DoFullTexSubImage2D(const AsyncTexImage2DParams& tex_params, void* data) {
- glTexSubImage2D(
- GL_TEXTURE_2D, tex_params.level,
- 0, 0, tex_params.width, tex_params.height,
- tex_params.format, tex_params.type, data);
-}
-
-void SetGlParametersForEglImageTexture() {
- // These params are needed for EGLImage creation to succeed on several
- // Android devices. I couldn't find this requirement in the EGLImage
- // extension spec, but several devices fail without it.
- glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR);
- glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE);
- glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE);
-}
-
-void PerformNotifyCompletion(
- AsyncMemoryParams mem_params,
- scoped_refptr<AsyncPixelTransferCompletionObserver> observer) {
- TRACE_EVENT0("gpu", "PerformNotifyCompletion");
- observer->DidComplete(mem_params);
-}
-
-class TransferThread : public base::Thread {
- public:
- TransferThread() : base::Thread(kAsyncTransferThreadName) {
- base::Thread::Options options;
-#if defined(OS_ANDROID)
- options.priority = base::ThreadPriority::BACKGROUND;
-#endif
- StartWithOptions(options);
- }
- ~TransferThread() override { Stop(); }
-
- void Init() override {
- gfx::GLShareGroup* share_group = NULL;
- surface_ = new gfx::PbufferGLSurfaceEGL(gfx::Size(1, 1));
- surface_->Initialize();
- context_ = gfx::GLContext::CreateGLContext(
- share_group, surface_.get(), gfx::PreferDiscreteGpu);
- bool is_current = context_->MakeCurrent(surface_.get());
- DCHECK(is_current);
- }
-
- void CleanUp() override {
- surface_ = NULL;
- context_->ReleaseCurrent(surface_.get());
- context_ = NULL;
- }
-
- private:
- scoped_refptr<gfx::GLContext> context_;
- scoped_refptr<gfx::GLSurface> surface_;
-
- DISALLOW_COPY_AND_ASSIGN(TransferThread);
-};
-
-base::LazyInstance<TransferThread>
- g_transfer_thread = LAZY_INSTANCE_INITIALIZER;
-
-base::SingleThreadTaskRunner* transfer_task_runner() {
- return g_transfer_thread.Pointer()->task_runner().get();
-}
-
-// Class which holds async pixel transfers state (EGLImage).
-// The EGLImage is accessed by either thread, but everything
-// else accessed only on the main thread.
-class TransferStateInternal
- : public base::RefCountedThreadSafe<TransferStateInternal> {
- public:
- TransferStateInternal(GLuint texture_id,
- const AsyncTexImage2DParams& define_params,
- bool wait_for_uploads,
- bool wait_for_creation,
- bool use_image_preserved)
- : texture_id_(texture_id),
- thread_texture_id_(0),
- transfer_completion_(true, true),
- egl_image_(EGL_NO_IMAGE_KHR),
- wait_for_uploads_(wait_for_uploads),
- wait_for_creation_(wait_for_creation),
- use_image_preserved_(use_image_preserved) {
- define_params_ = define_params;
- }
-
- bool TransferIsInProgress() {
- return !transfer_completion_.IsSignaled();
- }
-
- void BindTransfer() {
- TRACE_EVENT2("gpu", "BindAsyncTransfer glEGLImageTargetTexture2DOES",
- "width", define_params_.width,
- "height", define_params_.height);
- DCHECK(texture_id_);
- if (EGL_NO_IMAGE_KHR == egl_image_)
- return;
-
- glBindTexture(GL_TEXTURE_2D, texture_id_);
- glEGLImageTargetTexture2DOES(GL_TEXTURE_2D, egl_image_);
- bind_callback_.Run();
-
- DCHECK(CHECK_GL());
- }
-
- void CreateEglImage(GLuint texture_id) {
- TRACE_EVENT0("gpu", "eglCreateImageKHR");
- DCHECK(texture_id);
- DCHECK_EQ(egl_image_, EGL_NO_IMAGE_KHR);
-
- EGLDisplay egl_display = eglGetCurrentDisplay();
- EGLContext egl_context = eglGetCurrentContext();
- EGLenum egl_target = EGL_GL_TEXTURE_2D_KHR;
- EGLClientBuffer egl_buffer =
- reinterpret_cast<EGLClientBuffer>(texture_id);
-
- EGLint image_preserved = use_image_preserved_ ? EGL_TRUE : EGL_FALSE;
- EGLint egl_attrib_list[] = {
- EGL_GL_TEXTURE_LEVEL_KHR, 0, // mip-level.
- EGL_IMAGE_PRESERVED_KHR, image_preserved,
- EGL_NONE
- };
- egl_image_ = eglCreateImageKHR(
- egl_display,
- egl_context,
- egl_target,
- egl_buffer,
- egl_attrib_list);
-
- DLOG_IF(ERROR, EGL_NO_IMAGE_KHR == egl_image_)
- << "eglCreateImageKHR failed";
- }
-
- void CreateEglImageOnUploadThread() {
- CreateEglImage(thread_texture_id_);
- }
-
- void CreateEglImageOnMainThreadIfNeeded() {
- if (egl_image_ == EGL_NO_IMAGE_KHR) {
- CreateEglImage(texture_id_);
- if (wait_for_creation_) {
- TRACE_EVENT0("gpu", "glFinish creation");
- glFinish();
- }
- }
- }
-
- void WaitForLastUpload() {
- // This glFinish is just a safe-guard for if uploads have some
- // GPU action that needs to occur. We could use fences and try
- // to do this less often. However, on older drivers fences are
- // not always reliable (eg. Mali-400 just blocks forever).
- if (wait_for_uploads_) {
- TRACE_EVENT0("gpu", "glFinish");
- glFinish();
- }
- }
-
- void MarkAsTransferIsInProgress() {
- TRACE_EVENT_SYNTHETIC_DELAY_BEGIN("gpu.AsyncTexImage");
- transfer_completion_.Reset();
- }
-
- void MarkAsCompleted() {
- TRACE_EVENT_SYNTHETIC_DELAY_END("gpu.AsyncTexImage");
- transfer_completion_.Signal();
- }
-
- void WaitForTransferCompletion() {
- TRACE_EVENT0("gpu", "WaitForTransferCompletion");
- // TODO(backer): Deschedule the channel rather than blocking the main GPU
- // thread (crbug.com/240265).
- transfer_completion_.Wait();
- }
-
- void PerformAsyncTexImage2D(
- AsyncTexImage2DParams tex_params,
- AsyncMemoryParams mem_params,
- scoped_refptr<AsyncPixelTransferUploadStats> texture_upload_stats) {
- TRACE_EVENT2("gpu",
- "PerformAsyncTexImage",
- "width",
- tex_params.width,
- "height",
- tex_params.height);
- DCHECK(!thread_texture_id_);
- DCHECK_EQ(0, tex_params.level);
- if (EGL_NO_IMAGE_KHR != egl_image_) {
- MarkAsCompleted();
- return;
- }
-
- void* data = mem_params.GetDataAddress();
-
- base::TimeTicks begin_time;
- if (texture_upload_stats.get())
- begin_time = base::TimeTicks::Now();
-
- {
- TRACE_EVENT0("gpu", "glTexImage2D no data");
- glGenTextures(1, &thread_texture_id_);
- glActiveTexture(GL_TEXTURE0);
- glBindTexture(GL_TEXTURE_2D, thread_texture_id_);
-
- SetGlParametersForEglImageTexture();
-
- // If we need to use image_preserved, we pass the data with
- // the allocation. Otherwise we use a NULL allocation to
- // try to avoid any costs associated with creating the EGLImage.
- if (use_image_preserved_)
- DoTexImage2D(tex_params, data);
- else
- DoTexImage2D(tex_params, NULL);
- }
-
- CreateEglImageOnUploadThread();
-
- {
- TRACE_EVENT0("gpu", "glTexSubImage2D with data");
-
- // If we didn't use image_preserved, we haven't uploaded
- // the data yet, so we do this with a full texSubImage.
- if (!use_image_preserved_)
- DoFullTexSubImage2D(tex_params, data);
- }
-
- WaitForLastUpload();
- MarkAsCompleted();
-
- DCHECK(CHECK_GL());
- if (texture_upload_stats.get()) {
- texture_upload_stats->AddUpload(base::TimeTicks::Now() - begin_time);
- }
- }
-
- void PerformAsyncTexSubImage2D(
- AsyncTexSubImage2DParams tex_params,
- AsyncMemoryParams mem_params,
- scoped_refptr<AsyncPixelTransferUploadStats> texture_upload_stats) {
- TRACE_EVENT2("gpu",
- "PerformAsyncTexSubImage2D",
- "width",
- tex_params.width,
- "height",
- tex_params.height);
-
- DCHECK_NE(EGL_NO_IMAGE_KHR, egl_image_);
- DCHECK_EQ(0, tex_params.level);
-
- void* data = mem_params.GetDataAddress();
-
- base::TimeTicks begin_time;
- if (texture_upload_stats.get())
- begin_time = base::TimeTicks::Now();
-
- if (!thread_texture_id_) {
- TRACE_EVENT0("gpu", "glEGLImageTargetTexture2DOES");
- glGenTextures(1, &thread_texture_id_);
- glActiveTexture(GL_TEXTURE0);
- glBindTexture(GL_TEXTURE_2D, thread_texture_id_);
- glEGLImageTargetTexture2DOES(GL_TEXTURE_2D, egl_image_);
- } else {
- glActiveTexture(GL_TEXTURE0);
- glBindTexture(GL_TEXTURE_2D, thread_texture_id_);
- }
- {
- TRACE_EVENT0("gpu", "glTexSubImage2D");
- DoTexSubImage2D(tex_params, data);
- }
- WaitForLastUpload();
- MarkAsCompleted();
-
- DCHECK(CHECK_GL());
- if (texture_upload_stats.get()) {
- texture_upload_stats->AddUpload(base::TimeTicks::Now() - begin_time);
- }
- }
-
- protected:
- friend class base::RefCountedThreadSafe<TransferStateInternal>;
- friend class gpu::AsyncPixelTransferDelegateEGL;
-
- static void DeleteTexture(GLuint id) {
- glDeleteTextures(1, &id);
- }
-
- virtual ~TransferStateInternal() {
- if (egl_image_ != EGL_NO_IMAGE_KHR) {
- EGLDisplay display = eglGetCurrentDisplay();
- eglDestroyImageKHR(display, egl_image_);
- }
- if (thread_texture_id_) {
- transfer_task_runner()->PostTask(
- FROM_HERE, base::Bind(&DeleteTexture, thread_texture_id_));
- }
- }
-
- // The 'real' texture.
- GLuint texture_id_;
-
- // The EGLImage sibling on the upload thread.
- GLuint thread_texture_id_;
-
- // Definition params for texture that needs binding.
- AsyncTexImage2DParams define_params_;
-
- // Indicates that an async transfer is in progress.
- base::WaitableEvent transfer_completion_;
-
- // It would be nice if we could just create a new EGLImage for
- // every upload, but I found that didn't work, so this stores
- // one for the lifetime of the texture.
- EGLImageKHR egl_image_;
-
- // Callback to invoke when AsyncTexImage2D is complete
- // and the client can safely use the texture. This occurs
- // during BindCompletedAsyncTransfers().
- base::Closure bind_callback_;
-
- // Customize when we block on fences (these are work-arounds).
- bool wait_for_uploads_;
- bool wait_for_creation_;
- bool use_image_preserved_;
-};
-
-} // namespace
-
-// Class which handles async pixel transfers using EGLImageKHR and another
-// upload thread
-class AsyncPixelTransferDelegateEGL
- : public AsyncPixelTransferDelegate,
- public base::SupportsWeakPtr<AsyncPixelTransferDelegateEGL> {
- public:
- AsyncPixelTransferDelegateEGL(
- AsyncPixelTransferManagerEGL::SharedState* shared_state,
- GLuint texture_id,
- const AsyncTexImage2DParams& define_params);
- ~AsyncPixelTransferDelegateEGL() override;
-
- void BindTransfer() { state_->BindTransfer(); }
-
- // Implement AsyncPixelTransferDelegate:
- void AsyncTexImage2D(const AsyncTexImage2DParams& tex_params,
- const AsyncMemoryParams& mem_params,
- const base::Closure& bind_callback) override;
- void AsyncTexSubImage2D(const AsyncTexSubImage2DParams& tex_params,
- const AsyncMemoryParams& mem_params) override;
- bool TransferIsInProgress() override;
- void WaitForTransferCompletion() override;
-
- private:
- // Returns true if a work-around was used.
- bool WorkAroundAsyncTexImage2D(
- const AsyncTexImage2DParams& tex_params,
- const AsyncMemoryParams& mem_params,
- const base::Closure& bind_callback);
- bool WorkAroundAsyncTexSubImage2D(
- const AsyncTexSubImage2DParams& tex_params,
- const AsyncMemoryParams& mem_params);
-
- // A raw pointer is safe because the SharedState is owned by the Manager,
- // which owns this Delegate.
- AsyncPixelTransferManagerEGL::SharedState* shared_state_;
- scoped_refptr<TransferStateInternal> state_;
-
- DISALLOW_COPY_AND_ASSIGN(AsyncPixelTransferDelegateEGL);
-};
-
-AsyncPixelTransferDelegateEGL::AsyncPixelTransferDelegateEGL(
- AsyncPixelTransferManagerEGL::SharedState* shared_state,
- GLuint texture_id,
- const AsyncTexImage2DParams& define_params)
- : shared_state_(shared_state) {
- // We can't wait on uploads on imagination (it can take 200ms+).
- // In practice, they are complete when the CPU glTexSubImage2D completes.
- bool wait_for_uploads = !shared_state_->is_imagination;
-
- // Qualcomm runs into texture corruption problems if the same texture is
- // uploaded to with both async and normal uploads. Synchronize after EGLImage
- // creation on the main thread as a work-around.
- bool wait_for_creation = shared_state_->is_qualcomm;
-
- // Qualcomm has a race when using image_preserved=FALSE,
- // which can result in black textures even after the first upload.
- // Since using FALSE is mainly for performance (to avoid layout changes),
- // but Qualcomm itself doesn't seem to get any performance benefit,
- // we just using image_preservedd=TRUE on Qualcomm as a work-around.
- bool use_image_preserved =
- shared_state_->is_qualcomm || shared_state_->is_imagination;
-
- state_ = new TransferStateInternal(texture_id,
- define_params,
- wait_for_uploads,
- wait_for_creation,
- use_image_preserved);
-}
-
-AsyncPixelTransferDelegateEGL::~AsyncPixelTransferDelegateEGL() {}
-
-bool AsyncPixelTransferDelegateEGL::TransferIsInProgress() {
- return state_->TransferIsInProgress();
-}
-
-void AsyncPixelTransferDelegateEGL::WaitForTransferCompletion() {
- if (state_->TransferIsInProgress()) {
- state_->WaitForTransferCompletion();
- DCHECK(!state_->TransferIsInProgress());
- }
-}
-
-void AsyncPixelTransferDelegateEGL::AsyncTexImage2D(
- const AsyncTexImage2DParams& tex_params,
- const AsyncMemoryParams& mem_params,
- const base::Closure& bind_callback) {
- if (WorkAroundAsyncTexImage2D(tex_params, mem_params, bind_callback))
- return;
-
- DCHECK(!state_->TransferIsInProgress());
- DCHECK_EQ(state_->egl_image_, EGL_NO_IMAGE_KHR);
- DCHECK_EQ(static_cast<GLenum>(GL_TEXTURE_2D), tex_params.target);
- DCHECK_EQ(tex_params.level, 0);
-
- // Mark the transfer in progress and save the late bind
- // callback, so we can notify the client when it is bound.
- shared_state_->pending_allocations.push_back(AsWeakPtr());
- state_->bind_callback_ = bind_callback;
-
- // Mark the transfer in progress.
- state_->MarkAsTransferIsInProgress();
-
- // Duplicate the shared memory so there is no way we can get
- // a use-after-free of the raw pixels.
- transfer_task_runner()->PostTask(
- FROM_HERE,
- base::Bind(&TransferStateInternal::PerformAsyncTexImage2D, state_,
- tex_params, mem_params, shared_state_->texture_upload_stats));
-
- DCHECK(CHECK_GL());
-}
-
-void AsyncPixelTransferDelegateEGL::AsyncTexSubImage2D(
- const AsyncTexSubImage2DParams& tex_params,
- const AsyncMemoryParams& mem_params) {
- TRACE_EVENT2("gpu", "AsyncTexSubImage2D",
- "width", tex_params.width,
- "height", tex_params.height);
- if (WorkAroundAsyncTexSubImage2D(tex_params, mem_params))
- return;
- DCHECK(!state_->TransferIsInProgress());
- DCHECK_EQ(static_cast<GLenum>(GL_TEXTURE_2D), tex_params.target);
- DCHECK_EQ(tex_params.level, 0);
-
- // Mark the transfer in progress.
- state_->MarkAsTransferIsInProgress();
-
- // If this wasn't async allocated, we don't have an EGLImage yet.
- // Create the EGLImage if it hasn't already been created.
- state_->CreateEglImageOnMainThreadIfNeeded();
-
- // Duplicate the shared memory so there are no way we can get
- // a use-after-free of the raw pixels.
- transfer_task_runner()->PostTask(
- FROM_HERE,
- base::Bind(&TransferStateInternal::PerformAsyncTexSubImage2D, state_,
- tex_params, mem_params, shared_state_->texture_upload_stats));
-
- DCHECK(CHECK_GL());
-}
-
-namespace {
-bool IsPowerOfTwo (unsigned int x) {
- return ((x != 0) && !(x & (x - 1)));
-}
-
-bool IsMultipleOfEight(unsigned int x) {
- return (x & 7) == 0;
-}
-
-bool DimensionsSupportImgFastPath(int width, int height) {
- // Multiple of eight, but not a power of two.
- return IsMultipleOfEight(width) &&
- IsMultipleOfEight(height) &&
- !(IsPowerOfTwo(width) &&
- IsPowerOfTwo(height));
-}
-} // namespace
-
-// It is very difficult to stream uploads on Imagination GPUs:
-// - glTexImage2D defers a swizzle/stall until draw-time
-// - glTexSubImage2D will sleep for 16ms on a good day, and 100ms
-// or longer if OpenGL is in heavy use by another thread.
-// The one combination that avoids these problems requires:
-// a.) Allocations/Uploads must occur on different threads/contexts.
-// b.) Texture size must be non-power-of-two.
-// When using a+b, uploads will be incorrect/corrupt unless:
-// c.) Texture size must be a multiple-of-eight.
-//
-// To achieve a.) we allocate synchronously on the main thread followed
-// by uploading on the upload thread. When b/c are not true we fall back
-// on purely synchronous allocation/upload on the main thread.
-
-bool AsyncPixelTransferDelegateEGL::WorkAroundAsyncTexImage2D(
- const AsyncTexImage2DParams& tex_params,
- const AsyncMemoryParams& mem_params,
- const base::Closure& bind_callback) {
- if (!shared_state_->is_imagination)
- return false;
-
- // On imagination we allocate synchronously all the time, even
- // if the dimensions support fast uploads. This is for part a.)
- // above, so allocations occur on a different thread/context as uploads.
- void* data = mem_params.GetDataAddress();
- SetGlParametersForEglImageTexture();
-
- {
- TRACE_EVENT0("gpu", "glTexImage2D with data");
- DoTexImage2D(tex_params, data);
- }
-
- // The allocation has already occured, so mark it as finished
- // and ready for binding.
- CHECK(!state_->TransferIsInProgress());
-
- // If the dimensions support fast async uploads, create the
- // EGLImage for future uploads. The late bind should not
- // be needed since the EGLImage was created from the main thread
- // texture, but this is required to prevent an imagination driver crash.
- if (DimensionsSupportImgFastPath(tex_params.width, tex_params.height)) {
- state_->CreateEglImageOnMainThreadIfNeeded();
- shared_state_->pending_allocations.push_back(AsWeakPtr());
- state_->bind_callback_ = bind_callback;
- }
-
- DCHECK(CHECK_GL());
- return true;
-}
-
-bool AsyncPixelTransferDelegateEGL::WorkAroundAsyncTexSubImage2D(
- const AsyncTexSubImage2DParams& tex_params,
- const AsyncMemoryParams& mem_params) {
- if (!shared_state_->is_imagination)
- return false;
-
- // If the dimensions support fast async uploads, we can use the
- // normal async upload path for uploads.
- if (DimensionsSupportImgFastPath(tex_params.width, tex_params.height))
- return false;
-
- // Fall back on a synchronous stub as we don't have a known fast path.
- // Also, older ICS drivers crash when we do any glTexSubImage2D on the
- // same thread. To work around this we do glTexImage2D instead. Since
- // we didn't create an EGLImage for this texture (see above), this is
- // okay, but it limits this API to full updates for now.
- DCHECK(!state_->egl_image_);
- DCHECK_EQ(tex_params.xoffset, 0);
- DCHECK_EQ(tex_params.yoffset, 0);
- DCHECK_EQ(state_->define_params_.width, tex_params.width);
- DCHECK_EQ(state_->define_params_.height, tex_params.height);
- DCHECK_EQ(state_->define_params_.level, tex_params.level);
- DCHECK_EQ(state_->define_params_.format, tex_params.format);
- DCHECK_EQ(state_->define_params_.type, tex_params.type);
-
- void* data = mem_params.GetDataAddress();
- base::TimeTicks begin_time;
- if (shared_state_->texture_upload_stats.get())
- begin_time = base::TimeTicks::Now();
- {
- TRACE_EVENT0("gpu", "glTexSubImage2D");
- // Note we use define_params_ instead of tex_params.
- // The DCHECKs above verify this is always the same.
- DoTexImage2D(state_->define_params_, data);
- }
- if (shared_state_->texture_upload_stats.get()) {
- shared_state_->texture_upload_stats
- ->AddUpload(base::TimeTicks::Now() - begin_time);
- }
-
- DCHECK(CHECK_GL());
- return true;
-}
-
-AsyncPixelTransferManagerEGL::SharedState::SharedState()
- // TODO(reveman): Skip this if --enable-gpu-benchmarking is not present.
- : texture_upload_stats(new AsyncPixelTransferUploadStats) {
- const char* vendor = reinterpret_cast<const char*>(glGetString(GL_VENDOR));
- if (vendor) {
- is_imagination =
- std::string(vendor).find("Imagination") != std::string::npos;
- is_qualcomm = std::string(vendor).find("Qualcomm") != std::string::npos;
- }
-}
-
-AsyncPixelTransferManagerEGL::SharedState::~SharedState() {}
-
-AsyncPixelTransferManagerEGL::AsyncPixelTransferManagerEGL() {}
-
-AsyncPixelTransferManagerEGL::~AsyncPixelTransferManagerEGL() {}
-
-void AsyncPixelTransferManagerEGL::BindCompletedAsyncTransfers() {
- scoped_ptr<gfx::ScopedTextureBinder> texture_binder;
-
- while(!shared_state_.pending_allocations.empty()) {
- if (!shared_state_.pending_allocations.front().get()) {
- shared_state_.pending_allocations.pop_front();
- continue;
- }
- AsyncPixelTransferDelegateEGL* delegate =
- shared_state_.pending_allocations.front().get();
- // Terminate early, as all transfers finish in order, currently.
- if (delegate->TransferIsInProgress())
- break;
-
- if (!texture_binder)
- texture_binder.reset(new gfx::ScopedTextureBinder(GL_TEXTURE_2D, 0));
-
- // If the transfer is finished, bind it to the texture
- // and remove it from pending list.
- delegate->BindTransfer();
- shared_state_.pending_allocations.pop_front();
- }
-}
-
-void AsyncPixelTransferManagerEGL::AsyncNotifyCompletion(
- const AsyncMemoryParams& mem_params,
- AsyncPixelTransferCompletionObserver* observer) {
- // Post a PerformNotifyCompletion task to the upload thread. This task
- // will run after all async transfers are complete.
- transfer_task_runner()->PostTask(
- FROM_HERE, base::Bind(&PerformNotifyCompletion, mem_params,
- make_scoped_refptr(observer)));
-}
-
-uint32 AsyncPixelTransferManagerEGL::GetTextureUploadCount() {
- return shared_state_.texture_upload_stats->GetStats(NULL);
-}
-
-base::TimeDelta AsyncPixelTransferManagerEGL::GetTotalTextureUploadTime() {
- base::TimeDelta total_texture_upload_time;
- shared_state_.texture_upload_stats->GetStats(&total_texture_upload_time);
- return total_texture_upload_time;
-}
-
-void AsyncPixelTransferManagerEGL::ProcessMorePendingTransfers() {
-}
-
-bool AsyncPixelTransferManagerEGL::NeedsProcessMorePendingTransfers() {
- return false;
-}
-
-void AsyncPixelTransferManagerEGL::WaitAllAsyncTexImage2D() {
- if (shared_state_.pending_allocations.empty())
- return;
-
- AsyncPixelTransferDelegateEGL* delegate =
- shared_state_.pending_allocations.back().get();
- if (delegate)
- delegate->WaitForTransferCompletion();
-}
-
-AsyncPixelTransferDelegate*
-AsyncPixelTransferManagerEGL::CreatePixelTransferDelegateImpl(
- gles2::TextureRef* ref,
- const AsyncTexImage2DParams& define_params) {
- return new AsyncPixelTransferDelegateEGL(
- &shared_state_, ref->service_id(), define_params);
-}
-
-} // namespace gpu
diff --git a/chromium/gpu/command_buffer/service/async_pixel_transfer_manager_egl.h b/chromium/gpu/command_buffer/service/async_pixel_transfer_manager_egl.h
deleted file mode 100644
index 0b7421666b5..00000000000
--- a/chromium/gpu/command_buffer/service/async_pixel_transfer_manager_egl.h
+++ /dev/null
@@ -1,58 +0,0 @@
-// Copyright 2013 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_COMMAND_BUFFER_SERVICE_ASYNC_PIXEL_TRANSFER_MANAGER_EGL_H_
-#define GPU_COMMAND_BUFFER_SERVICE_ASYNC_PIXEL_TRANSFER_MANAGER_EGL_H_
-
-#include "gpu/command_buffer/service/async_pixel_transfer_manager.h"
-
-#include "base/memory/ref_counted.h"
-
-namespace gpu {
-class AsyncPixelTransferDelegateEGL;
-class AsyncPixelTransferUploadStats;
-
-class AsyncPixelTransferManagerEGL : public AsyncPixelTransferManager {
- public:
- AsyncPixelTransferManagerEGL();
- ~AsyncPixelTransferManagerEGL() override;
-
- // AsyncPixelTransferManager implementation:
- void BindCompletedAsyncTransfers() override;
- void AsyncNotifyCompletion(
- const AsyncMemoryParams& mem_params,
- AsyncPixelTransferCompletionObserver* observer) override;
- uint32 GetTextureUploadCount() override;
- base::TimeDelta GetTotalTextureUploadTime() override;
- void ProcessMorePendingTransfers() override;
- bool NeedsProcessMorePendingTransfers() override;
- void WaitAllAsyncTexImage2D() override;
-
- // State shared between Managers and Delegates.
- struct SharedState {
- SharedState();
- ~SharedState();
-
- scoped_refptr<AsyncPixelTransferUploadStats> texture_upload_stats;
- bool is_imagination;
- bool is_qualcomm;
- typedef std::list<base::WeakPtr<AsyncPixelTransferDelegateEGL> >
- TransferQueue;
- TransferQueue pending_allocations;
- };
-
- private:
- // AsyncPixelTransferManager implementation:
- AsyncPixelTransferDelegate* CreatePixelTransferDelegateImpl(
- gles2::TextureRef* ref,
- const AsyncTexImage2DParams& define_params) override;
-
- SharedState shared_state_;
-
- DISALLOW_COPY_AND_ASSIGN(AsyncPixelTransferManagerEGL);
-};
-
-} // namespace gpu
-
-#endif // GPU_COMMAND_BUFFER_SERVICE_ASYNC_PIXEL_TRANSFER_MANAGER_EGL_H_
diff --git a/chromium/gpu/command_buffer/service/async_pixel_transfer_manager_idle.cc b/chromium/gpu/command_buffer/service/async_pixel_transfer_manager_idle.cc
deleted file mode 100644
index b555ebb60bc..00000000000
--- a/chromium/gpu/command_buffer/service/async_pixel_transfer_manager_idle.cc
+++ /dev/null
@@ -1,334 +0,0 @@
-// Copyright 2013 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/command_buffer/service/async_pixel_transfer_manager_idle.h"
-
-#include "base/bind.h"
-#include "base/lazy_instance.h"
-#include "base/memory/weak_ptr.h"
-#include "base/trace_event/trace_event.h"
-#include "base/trace_event/trace_event_synthetic_delay.h"
-#include "ui/gl/scoped_binders.h"
-
-namespace gpu {
-
-namespace {
-
-static uint64 g_next_pixel_transfer_state_id = 1;
-
-void PerformNotifyCompletion(
- AsyncMemoryParams mem_params,
- scoped_refptr<AsyncPixelTransferCompletionObserver> observer) {
- TRACE_EVENT0("gpu", "PerformNotifyCompletion");
- observer->DidComplete(mem_params);
-}
-
-} // namespace
-
-// Class which handles async pixel transfers in a platform
-// independent way.
-class AsyncPixelTransferDelegateIdle
- : public AsyncPixelTransferDelegate,
- public base::SupportsWeakPtr<AsyncPixelTransferDelegateIdle> {
- public:
- typedef base::Callback<GLuint()> TextureIdCallback;
- AsyncPixelTransferDelegateIdle(
- AsyncPixelTransferManagerIdle::SharedState* state,
- const TextureIdCallback& texture_id_callback,
- const AsyncTexImage2DParams& define_params);
- ~AsyncPixelTransferDelegateIdle() override;
-
- // Implement AsyncPixelTransferDelegate:
- void AsyncTexImage2D(const AsyncTexImage2DParams& tex_params,
- const AsyncMemoryParams& mem_params,
- const base::Closure& bind_callback) override;
- void AsyncTexSubImage2D(const AsyncTexSubImage2DParams& tex_params,
- const AsyncMemoryParams& mem_params) override;
- bool TransferIsInProgress() override;
- void WaitForTransferCompletion() override;
-
- private:
- void PerformAsyncTexImage2D(AsyncTexImage2DParams tex_params,
- AsyncMemoryParams mem_params,
- const base::Closure& bind_callback);
- void PerformAsyncTexSubImage2D(AsyncTexSubImage2DParams tex_params,
- AsyncMemoryParams mem_params);
-
- uint64 id_;
- TextureIdCallback texture_id_callback_;
- bool transfer_in_progress_;
- AsyncTexImage2DParams define_params_;
-
- // Safe to hold a raw pointer because SharedState is owned by the Manager
- // which owns the Delegate.
- AsyncPixelTransferManagerIdle::SharedState* shared_state_;
-
- DISALLOW_COPY_AND_ASSIGN(AsyncPixelTransferDelegateIdle);
-};
-
-AsyncPixelTransferDelegateIdle::AsyncPixelTransferDelegateIdle(
- AsyncPixelTransferManagerIdle::SharedState* shared_state,
- const TextureIdCallback& texture_id_callback,
- const AsyncTexImage2DParams& define_params)
- : id_(g_next_pixel_transfer_state_id++),
- texture_id_callback_(texture_id_callback),
- transfer_in_progress_(false),
- define_params_(define_params),
- shared_state_(shared_state) {}
-
-AsyncPixelTransferDelegateIdle::~AsyncPixelTransferDelegateIdle() {}
-
-void AsyncPixelTransferDelegateIdle::AsyncTexImage2D(
- const AsyncTexImage2DParams& tex_params,
- const AsyncMemoryParams& mem_params,
- const base::Closure& bind_callback) {
- TRACE_EVENT_SYNTHETIC_DELAY_BEGIN("gpu.AsyncTexImage");
- DCHECK_EQ(static_cast<GLenum>(GL_TEXTURE_2D), tex_params.target);
-
- shared_state_->tasks.push_back(AsyncPixelTransferManagerIdle::Task(
- id_,
- this,
- base::Bind(&AsyncPixelTransferDelegateIdle::PerformAsyncTexImage2D,
- AsWeakPtr(),
- tex_params,
- mem_params,
- bind_callback)));
-
- transfer_in_progress_ = true;
-}
-
-void AsyncPixelTransferDelegateIdle::AsyncTexSubImage2D(
- const AsyncTexSubImage2DParams& tex_params,
- const AsyncMemoryParams& mem_params) {
- TRACE_EVENT_SYNTHETIC_DELAY_BEGIN("gpu.AsyncTexImage");
- DCHECK_EQ(static_cast<GLenum>(GL_TEXTURE_2D), tex_params.target);
-
- shared_state_->tasks.push_back(AsyncPixelTransferManagerIdle::Task(
- id_,
- this,
- base::Bind(&AsyncPixelTransferDelegateIdle::PerformAsyncTexSubImage2D,
- AsWeakPtr(),
- tex_params,
- mem_params)));
-
- transfer_in_progress_ = true;
-}
-
-bool AsyncPixelTransferDelegateIdle::TransferIsInProgress() {
- return transfer_in_progress_;
-}
-
-void AsyncPixelTransferDelegateIdle::WaitForTransferCompletion() {
- for (std::list<AsyncPixelTransferManagerIdle::Task>::iterator iter =
- shared_state_->tasks.begin();
- iter != shared_state_->tasks.end();
- ++iter) {
- if (iter->transfer_id != id_)
- continue;
-
- (*iter).task.Run();
- shared_state_->tasks.erase(iter);
- break;
- }
-
- shared_state_->ProcessNotificationTasks();
-}
-
-void AsyncPixelTransferDelegateIdle::PerformAsyncTexImage2D(
- AsyncTexImage2DParams tex_params,
- AsyncMemoryParams mem_params,
- const base::Closure& bind_callback) {
- TRACE_EVENT2("gpu", "PerformAsyncTexImage2D",
- "width", tex_params.width,
- "height", tex_params.height);
-
- void* data = mem_params.GetDataAddress();
-
- base::TimeTicks begin_time(base::TimeTicks::Now());
- gfx::ScopedTextureBinder texture_binder(tex_params.target,
- texture_id_callback_.Run());
-
- {
- TRACE_EVENT0("gpu", "glTexImage2D");
- glTexImage2D(
- tex_params.target,
- tex_params.level,
- tex_params.internal_format,
- tex_params.width,
- tex_params.height,
- tex_params.border,
- tex_params.format,
- tex_params.type,
- data);
- }
-
- TRACE_EVENT_SYNTHETIC_DELAY_END("gpu.AsyncTexImage");
- transfer_in_progress_ = false;
- shared_state_->texture_upload_count++;
- shared_state_->total_texture_upload_time +=
- base::TimeTicks::Now() - begin_time;
-
- // The texture is already fully bound so just call it now.
- bind_callback.Run();
-}
-
-void AsyncPixelTransferDelegateIdle::PerformAsyncTexSubImage2D(
- AsyncTexSubImage2DParams tex_params,
- AsyncMemoryParams mem_params) {
- TRACE_EVENT2("gpu", "PerformAsyncTexSubImage2D",
- "width", tex_params.width,
- "height", tex_params.height);
-
- void* data = mem_params.GetDataAddress();
-
- base::TimeTicks begin_time(base::TimeTicks::Now());
- gfx::ScopedTextureBinder texture_binder(tex_params.target,
- texture_id_callback_.Run());
-
- if (shared_state_->use_teximage2d_over_texsubimage2d &&
- tex_params.xoffset == 0 &&
- tex_params.yoffset == 0 &&
- tex_params.target == define_params_.target &&
- tex_params.level == define_params_.level &&
- tex_params.width == define_params_.width &&
- tex_params.height == define_params_.height) {
- TRACE_EVENT0("gpu", "glTexImage2D");
- glTexImage2D(
- define_params_.target,
- define_params_.level,
- define_params_.internal_format,
- define_params_.width,
- define_params_.height,
- define_params_.border,
- tex_params.format,
- tex_params.type,
- data);
- } else {
- TRACE_EVENT0("gpu", "glTexSubImage2D");
- glTexSubImage2D(
- tex_params.target,
- tex_params.level,
- tex_params.xoffset,
- tex_params.yoffset,
- tex_params.width,
- tex_params.height,
- tex_params.format,
- tex_params.type,
- data);
- }
-
- TRACE_EVENT_SYNTHETIC_DELAY_END("gpu.AsyncTexImage");
- transfer_in_progress_ = false;
- shared_state_->texture_upload_count++;
- shared_state_->total_texture_upload_time +=
- base::TimeTicks::Now() - begin_time;
-}
-
-AsyncPixelTransferManagerIdle::Task::Task(
- uint64 transfer_id,
- AsyncPixelTransferDelegate* delegate,
- const base::Closure& task)
- : transfer_id(transfer_id),
- delegate(delegate),
- task(task) {
-}
-
-AsyncPixelTransferManagerIdle::Task::~Task() {}
-
-AsyncPixelTransferManagerIdle::SharedState::SharedState(
- bool use_teximage2d_over_texsubimage2d)
- : use_teximage2d_over_texsubimage2d(use_teximage2d_over_texsubimage2d),
- texture_upload_count(0) {
-}
-
-AsyncPixelTransferManagerIdle::SharedState::~SharedState() {}
-
-void AsyncPixelTransferManagerIdle::SharedState::ProcessNotificationTasks() {
- while (!tasks.empty()) {
- // Stop when we reach a pixel transfer task.
- if (tasks.front().transfer_id)
- return;
-
- tasks.front().task.Run();
- tasks.pop_front();
- }
-}
-
-AsyncPixelTransferManagerIdle::AsyncPixelTransferManagerIdle(
- bool use_teximage2d_over_texsubimage2d)
- : shared_state_(use_teximage2d_over_texsubimage2d) {
-}
-
-AsyncPixelTransferManagerIdle::~AsyncPixelTransferManagerIdle() {}
-
-void AsyncPixelTransferManagerIdle::BindCompletedAsyncTransfers() {
- // Everything is already bound.
-}
-
-void AsyncPixelTransferManagerIdle::AsyncNotifyCompletion(
- const AsyncMemoryParams& mem_params,
- AsyncPixelTransferCompletionObserver* observer) {
- if (shared_state_.tasks.empty()) {
- observer->DidComplete(mem_params);
- return;
- }
-
- shared_state_.tasks.push_back(
- Task(0, // 0 transfer_id for notification tasks.
- NULL,
- base::Bind(
- &PerformNotifyCompletion,
- mem_params,
- make_scoped_refptr(observer))));
-}
-
-uint32 AsyncPixelTransferManagerIdle::GetTextureUploadCount() {
- return shared_state_.texture_upload_count;
-}
-
-base::TimeDelta AsyncPixelTransferManagerIdle::GetTotalTextureUploadTime() {
- return shared_state_.total_texture_upload_time;
-}
-
-void AsyncPixelTransferManagerIdle::ProcessMorePendingTransfers() {
- if (shared_state_.tasks.empty())
- return;
-
- // First task should always be a pixel transfer task.
- DCHECK(shared_state_.tasks.front().transfer_id);
- shared_state_.tasks.front().task.Run();
- shared_state_.tasks.pop_front();
-
- shared_state_.ProcessNotificationTasks();
-}
-
-bool AsyncPixelTransferManagerIdle::NeedsProcessMorePendingTransfers() {
- return !shared_state_.tasks.empty();
-}
-
-void AsyncPixelTransferManagerIdle::WaitAllAsyncTexImage2D() {
- if (shared_state_.tasks.empty())
- return;
-
- const Task& task = shared_state_.tasks.back();
- if (task.delegate)
- task.delegate->WaitForTransferCompletion();
-}
-
-AsyncPixelTransferDelegate*
-AsyncPixelTransferManagerIdle::CreatePixelTransferDelegateImpl(
- gles2::TextureRef* ref,
- const AsyncTexImage2DParams& define_params) {
- return new AsyncPixelTransferDelegateIdle(
- &shared_state_,
- // Not directly passing texture_ref->service_id here because it can change
- // if avoid_egl_image_target_texture_reuse workaround is in effect.
- // Unretained is safe because AsyncPixelTransferManager observes
- // TextureRef destruction and destroys the delegate before TextureRef
- // is destroyed.
- base::Bind(&gles2::TextureRef::service_id, base::Unretained(ref)),
- define_params);
-}
-
-} // namespace gpu
diff --git a/chromium/gpu/command_buffer/service/async_pixel_transfer_manager_idle.h b/chromium/gpu/command_buffer/service/async_pixel_transfer_manager_idle.h
deleted file mode 100644
index 41a77b397dc..00000000000
--- a/chromium/gpu/command_buffer/service/async_pixel_transfer_manager_idle.h
+++ /dev/null
@@ -1,70 +0,0 @@
-// Copyright 2013 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_COMMAND_BUFFER_SERVICE_ASYNC_PIXEL_TRANSFER_MANAGER_IDLE_H_
-#define GPU_COMMAND_BUFFER_SERVICE_ASYNC_PIXEL_TRANSFER_MANAGER_IDLE_H_
-
-#include <list>
-
-#include "gpu/command_buffer/service/async_pixel_transfer_manager.h"
-
-namespace gpu {
-
-class AsyncPixelTransferManagerIdle : public AsyncPixelTransferManager {
- public:
- explicit AsyncPixelTransferManagerIdle(
- bool use_teximage2d_over_texsubimage2d);
- ~AsyncPixelTransferManagerIdle() override;
-
- // AsyncPixelTransferManager implementation:
- void BindCompletedAsyncTransfers() override;
- void AsyncNotifyCompletion(
- const AsyncMemoryParams& mem_params,
- AsyncPixelTransferCompletionObserver* observer) override;
- uint32 GetTextureUploadCount() override;
- base::TimeDelta GetTotalTextureUploadTime() override;
- void ProcessMorePendingTransfers() override;
- bool NeedsProcessMorePendingTransfers() override;
- void WaitAllAsyncTexImage2D() override;
-
- struct Task {
- Task(uint64 transfer_id,
- AsyncPixelTransferDelegate* delegate,
- const base::Closure& task);
- ~Task();
-
- // This is non-zero if pixel transfer task.
- uint64 transfer_id;
-
- AsyncPixelTransferDelegate* delegate;
-
- base::Closure task;
- };
-
- // State shared between Managers and Delegates.
- struct SharedState {
- explicit SharedState(bool use_teximage2d_over_texsubimage2d);
- ~SharedState();
- void ProcessNotificationTasks();
-
- const bool use_teximage2d_over_texsubimage2d;
- int texture_upload_count;
- base::TimeDelta total_texture_upload_time;
- std::list<Task> tasks;
- };
-
- private:
- // AsyncPixelTransferManager implementation:
- AsyncPixelTransferDelegate* CreatePixelTransferDelegateImpl(
- gles2::TextureRef* ref,
- const AsyncTexImage2DParams& define_params) override;
-
- SharedState shared_state_;
-
- DISALLOW_COPY_AND_ASSIGN(AsyncPixelTransferManagerIdle);
-};
-
-} // namespace gpu
-
-#endif // GPU_COMMAND_BUFFER_SERVICE_ASYNC_PIXEL_TRANSFER_MANAGER_IDLE_H_
diff --git a/chromium/gpu/command_buffer/service/async_pixel_transfer_manager_linux.cc b/chromium/gpu/command_buffer/service/async_pixel_transfer_manager_linux.cc
deleted file mode 100644
index b0cc463eb27..00000000000
--- a/chromium/gpu/command_buffer/service/async_pixel_transfer_manager_linux.cc
+++ /dev/null
@@ -1,40 +0,0 @@
-// Copyright 2013 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/command_buffer/service/async_pixel_transfer_manager.h"
-
-#include "base/command_line.h"
-#include "base/trace_event/trace_event.h"
-#include "gpu/command_buffer/service/async_pixel_transfer_manager_idle.h"
-#include "gpu/command_buffer/service/async_pixel_transfer_manager_share_group.h"
-#include "gpu/command_buffer/service/async_pixel_transfer_manager_stub.h"
-#include "gpu/command_buffer/service/gpu_switches.h"
-#include "ui/gl/gl_implementation.h"
-
-namespace gpu {
-
-AsyncPixelTransferManager* AsyncPixelTransferManager::Create(
- gfx::GLContext* context) {
- TRACE_EVENT0("gpu", "AsyncPixelTransferManager::Create");
- if (base::CommandLine::ForCurrentProcess()->HasSwitch(
- switches::kEnableShareGroupAsyncTextureUpload)) {
- DCHECK(context);
- return static_cast<AsyncPixelTransferManager*> (
- new AsyncPixelTransferManagerShareGroup(context));
- }
-
- switch (gfx::GetGLImplementation()) {
- case gfx::kGLImplementationOSMesaGL:
- case gfx::kGLImplementationDesktopGL:
- case gfx::kGLImplementationEGLGLES2:
- return new AsyncPixelTransferManagerIdle(true);
- case gfx::kGLImplementationMockGL:
- return new AsyncPixelTransferManagerStub;
- default:
- NOTREACHED();
- return NULL;
- }
-}
-
-} // namespace gpu
diff --git a/chromium/gpu/command_buffer/service/async_pixel_transfer_manager_mac.cc b/chromium/gpu/command_buffer/service/async_pixel_transfer_manager_mac.cc
deleted file mode 100644
index 6d8562f1155..00000000000
--- a/chromium/gpu/command_buffer/service/async_pixel_transfer_manager_mac.cc
+++ /dev/null
@@ -1,31 +0,0 @@
-// Copyright 2013 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/command_buffer/service/async_pixel_transfer_manager.h"
-
-#include "base/trace_event/trace_event.h"
-#include "gpu/command_buffer/service/async_pixel_transfer_manager_idle.h"
-#include "gpu/command_buffer/service/async_pixel_transfer_manager_stub.h"
-#include "ui/gl/gl_implementation.h"
-
-namespace gpu {
-
-AsyncPixelTransferManager* AsyncPixelTransferManager::Create(
- gfx::GLContext* context) {
- TRACE_EVENT0("gpu", "AsyncPixelTransferManager::Create");
- switch (gfx::GetGLImplementation()) {
- case gfx::kGLImplementationOSMesaGL:
- case gfx::kGLImplementationDesktopGL:
- case gfx::kGLImplementationDesktopGLCoreProfile:
- case gfx::kGLImplementationAppleGL:
- return new AsyncPixelTransferManagerIdle(true);
- case gfx::kGLImplementationMockGL:
- return new AsyncPixelTransferManagerStub;
- default:
- NOTREACHED();
- return NULL;
- }
-}
-
-} // namespace gpu
diff --git a/chromium/gpu/command_buffer/service/async_pixel_transfer_manager_mock.cc b/chromium/gpu/command_buffer/service/async_pixel_transfer_manager_mock.cc
deleted file mode 100644
index 84e95e3d883..00000000000
--- a/chromium/gpu/command_buffer/service/async_pixel_transfer_manager_mock.cc
+++ /dev/null
@@ -1,15 +0,0 @@
-// Copyright 2013 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/command_buffer/service/async_pixel_transfer_manager_mock.h"
-
-#include "testing/gtest/include/gtest/gtest.h"
-
-namespace gpu {
-
-MockAsyncPixelTransferManager::MockAsyncPixelTransferManager() {}
-
-MockAsyncPixelTransferManager::~MockAsyncPixelTransferManager() {}
-
-} // namespace gpu
diff --git a/chromium/gpu/command_buffer/service/async_pixel_transfer_manager_mock.h b/chromium/gpu/command_buffer/service/async_pixel_transfer_manager_mock.h
deleted file mode 100644
index 3bc8b6bd036..00000000000
--- a/chromium/gpu/command_buffer/service/async_pixel_transfer_manager_mock.h
+++ /dev/null
@@ -1,39 +0,0 @@
-// Copyright 2013 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_COMMAND_BUFFER_SERVICE_ASYNC_PIXEL_TRANSFER_MANAGER_TEST_H_
-#define GPU_COMMAND_BUFFER_SERVICE_ASYNC_PIXEL_TRANSFER_MANAGER_TEST_H_
-
-#include "gpu/command_buffer/service/async_pixel_transfer_manager.h"
-#include "testing/gmock/include/gmock/gmock.h"
-
-namespace gpu {
-
-class MockAsyncPixelTransferManager : public AsyncPixelTransferManager {
- public:
- MockAsyncPixelTransferManager();
- virtual ~MockAsyncPixelTransferManager();
-
- // AsyncPixelTransferManager implementation:
- MOCK_METHOD0(BindCompletedAsyncTransfers, void());
- MOCK_METHOD2(AsyncNotifyCompletion,
- void(const AsyncMemoryParams& mem_params,
- AsyncPixelTransferCompletionObserver* observer));
- MOCK_METHOD0(GetTextureUploadCount, uint32());
- MOCK_METHOD0(GetTotalTextureUploadTime, base::TimeDelta());
- MOCK_METHOD0(ProcessMorePendingTransfers, void());
- MOCK_METHOD0(NeedsProcessMorePendingTransfers, bool());
- MOCK_METHOD0(WaitAllAsyncTexImage2D, void());
- MOCK_METHOD2(
- CreatePixelTransferDelegateImpl,
- AsyncPixelTransferDelegate*(gles2::TextureRef* ref,
- const AsyncTexImage2DParams& define_params));
-
- private:
- DISALLOW_COPY_AND_ASSIGN(MockAsyncPixelTransferManager);
-};
-
-} // namespace gpu
-
-#endif // GPU_COMMAND_BUFFER_SERVICE_ASYNC_PIXEL_TRANSFER_MANAGER_TEST_H_
diff --git a/chromium/gpu/command_buffer/service/async_pixel_transfer_manager_share_group.cc b/chromium/gpu/command_buffer/service/async_pixel_transfer_manager_share_group.cc
deleted file mode 100644
index 86eb71803cf..00000000000
--- a/chromium/gpu/command_buffer/service/async_pixel_transfer_manager_share_group.cc
+++ /dev/null
@@ -1,549 +0,0 @@
-// Copyright 2013 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/command_buffer/service/async_pixel_transfer_manager_share_group.h"
-
-#include <list>
-
-#include "base/bind.h"
-#include "base/lazy_instance.h"
-#include "base/location.h"
-#include "base/logging.h"
-#include "base/memory/ref_counted.h"
-#include "base/memory/weak_ptr.h"
-#include "base/single_thread_task_runner.h"
-#include "base/synchronization/cancellation_flag.h"
-#include "base/synchronization/lock.h"
-#include "base/synchronization/waitable_event.h"
-#include "base/threading/thread.h"
-#include "base/threading/thread_checker.h"
-#include "base/trace_event/trace_event.h"
-#include "base/trace_event/trace_event_synthetic_delay.h"
-#include "gpu/command_buffer/service/async_pixel_transfer_delegate.h"
-#include "ui/gl/gl_bindings.h"
-#include "ui/gl/gl_context.h"
-#include "ui/gl/gl_surface.h"
-#include "ui/gl/gpu_preference.h"
-#include "ui/gl/scoped_binders.h"
-
-namespace gpu {
-
-namespace {
-
-const char kAsyncTransferThreadName[] = "AsyncTransferThread";
-
-void PerformNotifyCompletion(
- AsyncMemoryParams mem_params,
- scoped_refptr<AsyncPixelTransferCompletionObserver> observer) {
- TRACE_EVENT0("gpu", "PerformNotifyCompletion");
- observer->DidComplete(mem_params);
-}
-
-// TODO(backer): Factor out common thread scheduling logic from the EGL and
-// ShareGroup implementations. http://crbug.com/239889
-class TransferThread : public base::Thread {
- public:
- TransferThread()
- : base::Thread(kAsyncTransferThreadName),
- initialized_(false) {
- base::Thread::Options options;
-#if defined(OS_ANDROID) || defined(OS_LINUX)
- options.priority = base::ThreadPriority::BACKGROUND;
-#endif
- StartWithOptions(options);
- }
-
- ~TransferThread() override {
- // The only instance of this class was declared leaky.
- NOTREACHED();
- }
-
- void InitializeOnMainThread(gfx::GLContext* parent_context) {
- TRACE_EVENT0("gpu", "TransferThread::InitializeOnMainThread");
- if (initialized_)
- return;
-
- base::WaitableEvent wait_for_init(true, false);
- task_runner()->PostTask(
- FROM_HERE,
- base::Bind(&TransferThread::InitializeOnTransferThread,
- base::Unretained(this), base::Unretained(parent_context),
- &wait_for_init));
- wait_for_init.Wait();
- }
-
- void CleanUp() override {
- surface_ = NULL;
- context_ = NULL;
- }
-
- private:
- bool initialized_;
-
- scoped_refptr<gfx::GLSurface> surface_;
- scoped_refptr<gfx::GLContext> context_;
-
- void InitializeOnTransferThread(gfx::GLContext* parent_context,
- base::WaitableEvent* caller_wait) {
- TRACE_EVENT0("gpu", "InitializeOnTransferThread");
-
- if (!parent_context) {
- LOG(ERROR) << "No parent context provided.";
- caller_wait->Signal();
- return;
- }
-
- surface_ = gfx::GLSurface::CreateOffscreenGLSurface(gfx::Size(1, 1));
- if (!surface_.get()) {
- LOG(ERROR) << "Unable to create GLSurface";
- caller_wait->Signal();
- return;
- }
-
- // TODO(backer): This is coded for integrated GPUs. For discrete GPUs
- // we would probably want to use a PBO texture upload for a true async
- // upload (that would hopefully be optimized as a DMA transfer by the
- // driver).
- context_ = gfx::GLContext::CreateGLContext(parent_context->share_group(),
- surface_.get(),
- gfx::PreferIntegratedGpu);
- if (!context_.get()) {
- LOG(ERROR) << "Unable to create GLContext.";
- caller_wait->Signal();
- return;
- }
-
- context_->MakeCurrent(surface_.get());
- initialized_ = true;
- caller_wait->Signal();
- }
-
- DISALLOW_COPY_AND_ASSIGN(TransferThread);
-};
-
-base::LazyInstance<TransferThread>::Leaky
- g_transfer_thread = LAZY_INSTANCE_INITIALIZER;
-
-base::SingleThreadTaskRunner* transfer_task_runner() {
- return g_transfer_thread.Pointer()->task_runner().get();
-}
-
-class PendingTask : public base::RefCountedThreadSafe<PendingTask> {
- public:
- explicit PendingTask(const base::Closure& task)
- : task_(task), task_pending_(true, false) {}
-
- bool TryRun() {
- // This is meant to be called on the main thread where the texture
- // is already bound.
- DCHECK(checker_.CalledOnValidThread());
- if (task_lock_.Try()) {
- // Only run once.
- if (!task_.is_null())
- task_.Run();
- task_.Reset();
-
- task_lock_.Release();
- task_pending_.Signal();
- return true;
- }
- return false;
- }
-
- void BindAndRun(GLuint texture_id) {
- // This is meant to be called on the upload thread where we don't have to
- // restore the previous texture binding.
- DCHECK(!checker_.CalledOnValidThread());
- base::AutoLock locked(task_lock_);
- if (!task_.is_null()) {
- glBindTexture(GL_TEXTURE_2D, texture_id);
- task_.Run();
- task_.Reset();
- glBindTexture(GL_TEXTURE_2D, 0);
- // Flush for synchronization between threads.
- glFlush();
- task_pending_.Signal();
- }
- }
-
- void Cancel() {
- base::AutoLock locked(task_lock_);
- task_.Reset();
- task_pending_.Signal();
- }
-
- bool TaskIsInProgress() {
- return !task_pending_.IsSignaled();
- }
-
- void WaitForTask() {
- task_pending_.Wait();
- }
-
- private:
- friend class base::RefCountedThreadSafe<PendingTask>;
-
- virtual ~PendingTask() {}
-
- base::ThreadChecker checker_;
-
- base::Lock task_lock_;
- base::Closure task_;
- base::WaitableEvent task_pending_;
-
- DISALLOW_COPY_AND_ASSIGN(PendingTask);
-};
-
-// Class which holds async pixel transfers state.
-// The texture_id is accessed by either thread, but everything
-// else accessed only on the main thread.
-class TransferStateInternal
- : public base::RefCountedThreadSafe<TransferStateInternal> {
- public:
- TransferStateInternal(GLuint texture_id,
- const AsyncTexImage2DParams& define_params)
- : texture_id_(texture_id), define_params_(define_params) {}
-
- bool TransferIsInProgress() {
- return pending_upload_task_.get() &&
- pending_upload_task_->TaskIsInProgress();
- }
-
- void BindTransfer() {
- TRACE_EVENT2("gpu", "BindAsyncTransfer",
- "width", define_params_.width,
- "height", define_params_.height);
- DCHECK(texture_id_);
-
- glBindTexture(GL_TEXTURE_2D, texture_id_);
- bind_callback_.Run();
- }
-
- void WaitForTransferCompletion() {
- TRACE_EVENT0("gpu", "WaitForTransferCompletion");
- DCHECK(pending_upload_task_.get());
- if (!pending_upload_task_->TryRun()) {
- pending_upload_task_->WaitForTask();
- }
- pending_upload_task_ = NULL;
- }
-
- void CancelUpload() {
- TRACE_EVENT0("gpu", "CancelUpload");
- if (pending_upload_task_.get())
- pending_upload_task_->Cancel();
- pending_upload_task_ = NULL;
- }
-
- void ScheduleAsyncTexImage2D(
- const AsyncTexImage2DParams tex_params,
- const AsyncMemoryParams mem_params,
- scoped_refptr<AsyncPixelTransferUploadStats> texture_upload_stats,
- const base::Closure& bind_callback) {
- TRACE_EVENT_SYNTHETIC_DELAY_BEGIN("gpu.AsyncTexImage");
- pending_upload_task_ = new PendingTask(base::Bind(
- &TransferStateInternal::PerformAsyncTexImage2D,
- this,
- tex_params,
- mem_params,
- texture_upload_stats));
- transfer_task_runner()->PostTask(
- FROM_HERE, base::Bind(&PendingTask::BindAndRun, pending_upload_task_,
- texture_id_));
-
- // Save the late bind callback, so we can notify the client when it is
- // bound.
- bind_callback_ = bind_callback;
- }
-
- void ScheduleAsyncTexSubImage2D(
- AsyncTexSubImage2DParams tex_params,
- AsyncMemoryParams mem_params,
- scoped_refptr<AsyncPixelTransferUploadStats> texture_upload_stats) {
- TRACE_EVENT_SYNTHETIC_DELAY_BEGIN("gpu.AsyncTexImage");
- pending_upload_task_ = new PendingTask(base::Bind(
- &TransferStateInternal::PerformAsyncTexSubImage2D,
- this,
- tex_params,
- mem_params,
- texture_upload_stats));
- transfer_task_runner()->PostTask(
- FROM_HERE, base::Bind(&PendingTask::BindAndRun, pending_upload_task_,
- texture_id_));
- }
-
- private:
- friend class base::RefCountedThreadSafe<TransferStateInternal>;
-
- virtual ~TransferStateInternal() {
- }
-
- void PerformAsyncTexImage2D(
- AsyncTexImage2DParams tex_params,
- AsyncMemoryParams mem_params,
- scoped_refptr<AsyncPixelTransferUploadStats> texture_upload_stats) {
- TRACE_EVENT2("gpu",
- "PerformAsyncTexImage",
- "width",
- tex_params.width,
- "height",
- tex_params.height);
- DCHECK_EQ(0, tex_params.level);
-
- base::TimeTicks begin_time;
- if (texture_upload_stats.get())
- begin_time = base::TimeTicks::Now();
-
- void* data = mem_params.GetDataAddress();
-
- {
- TRACE_EVENT0("gpu", "glTexImage2D");
- glTexImage2D(GL_TEXTURE_2D,
- tex_params.level,
- tex_params.internal_format,
- tex_params.width,
- tex_params.height,
- tex_params.border,
- tex_params.format,
- tex_params.type,
- data);
- TRACE_EVENT_SYNTHETIC_DELAY_END("gpu.AsyncTexImage");
- }
-
- if (texture_upload_stats.get()) {
- texture_upload_stats->AddUpload(base::TimeTicks::Now() - begin_time);
- }
- }
-
- void PerformAsyncTexSubImage2D(
- AsyncTexSubImage2DParams tex_params,
- AsyncMemoryParams mem_params,
- scoped_refptr<AsyncPixelTransferUploadStats> texture_upload_stats) {
- TRACE_EVENT2("gpu",
- "PerformAsyncTexSubImage2D",
- "width",
- tex_params.width,
- "height",
- tex_params.height);
- DCHECK_EQ(0, tex_params.level);
-
- base::TimeTicks begin_time;
- if (texture_upload_stats.get())
- begin_time = base::TimeTicks::Now();
-
- void* data = mem_params.GetDataAddress();
- {
- TRACE_EVENT0("gpu", "glTexSubImage2D");
- glTexSubImage2D(GL_TEXTURE_2D,
- tex_params.level,
- tex_params.xoffset,
- tex_params.yoffset,
- tex_params.width,
- tex_params.height,
- tex_params.format,
- tex_params.type,
- data);
- TRACE_EVENT_SYNTHETIC_DELAY_END("gpu.AsyncTexImage");
- }
-
- if (texture_upload_stats.get()) {
- texture_upload_stats->AddUpload(base::TimeTicks::Now() - begin_time);
- }
- }
-
- scoped_refptr<PendingTask> pending_upload_task_;
-
- GLuint texture_id_;
-
- // Definition params for texture that needs binding.
- AsyncTexImage2DParams define_params_;
-
- // Callback to invoke when AsyncTexImage2D is complete
- // and the client can safely use the texture. This occurs
- // during BindCompletedAsyncTransfers().
- base::Closure bind_callback_;
-};
-
-} // namespace
-
-class AsyncPixelTransferDelegateShareGroup
- : public AsyncPixelTransferDelegate,
- public base::SupportsWeakPtr<AsyncPixelTransferDelegateShareGroup> {
- public:
- AsyncPixelTransferDelegateShareGroup(
- AsyncPixelTransferManagerShareGroup::SharedState* shared_state,
- GLuint texture_id,
- const AsyncTexImage2DParams& define_params);
- ~AsyncPixelTransferDelegateShareGroup() override;
-
- void BindTransfer() { state_->BindTransfer(); }
-
- // Implement AsyncPixelTransferDelegate:
- void AsyncTexImage2D(const AsyncTexImage2DParams& tex_params,
- const AsyncMemoryParams& mem_params,
- const base::Closure& bind_callback) override;
- void AsyncTexSubImage2D(const AsyncTexSubImage2DParams& tex_params,
- const AsyncMemoryParams& mem_params) override;
- bool TransferIsInProgress() override;
- void WaitForTransferCompletion() override;
-
- private:
- // A raw pointer is safe because the SharedState is owned by the Manager,
- // which owns this Delegate.
- AsyncPixelTransferManagerShareGroup::SharedState* shared_state_;
- scoped_refptr<TransferStateInternal> state_;
-
- DISALLOW_COPY_AND_ASSIGN(AsyncPixelTransferDelegateShareGroup);
-};
-
-AsyncPixelTransferDelegateShareGroup::AsyncPixelTransferDelegateShareGroup(
- AsyncPixelTransferManagerShareGroup::SharedState* shared_state,
- GLuint texture_id,
- const AsyncTexImage2DParams& define_params)
- : shared_state_(shared_state),
- state_(new TransferStateInternal(texture_id, define_params)) {}
-
-AsyncPixelTransferDelegateShareGroup::~AsyncPixelTransferDelegateShareGroup() {
- TRACE_EVENT0("gpu", " ~AsyncPixelTransferDelegateShareGroup");
- state_->CancelUpload();
-}
-
-bool AsyncPixelTransferDelegateShareGroup::TransferIsInProgress() {
- return state_->TransferIsInProgress();
-}
-
-void AsyncPixelTransferDelegateShareGroup::WaitForTransferCompletion() {
- if (state_->TransferIsInProgress()) {
- state_->WaitForTransferCompletion();
- DCHECK(!state_->TransferIsInProgress());
- }
-
- // Fast track the BindTransfer, if applicable.
- for (AsyncPixelTransferManagerShareGroup::SharedState::TransferQueue::iterator
- iter = shared_state_->pending_allocations.begin();
- iter != shared_state_->pending_allocations.end();
- ++iter) {
- if (iter->get() != this)
- continue;
-
- shared_state_->pending_allocations.erase(iter);
- BindTransfer();
- break;
- }
-}
-
-void AsyncPixelTransferDelegateShareGroup::AsyncTexImage2D(
- const AsyncTexImage2DParams& tex_params,
- const AsyncMemoryParams& mem_params,
- const base::Closure& bind_callback) {
- DCHECK(!state_->TransferIsInProgress());
- DCHECK_EQ(static_cast<GLenum>(GL_TEXTURE_2D), tex_params.target);
- DCHECK_EQ(tex_params.level, 0);
-
- shared_state_->pending_allocations.push_back(AsWeakPtr());
- state_->ScheduleAsyncTexImage2D(tex_params,
- mem_params,
- shared_state_->texture_upload_stats,
- bind_callback);
-}
-
-void AsyncPixelTransferDelegateShareGroup::AsyncTexSubImage2D(
- const AsyncTexSubImage2DParams& tex_params,
- const AsyncMemoryParams& mem_params) {
- TRACE_EVENT2("gpu", "AsyncTexSubImage2D",
- "width", tex_params.width,
- "height", tex_params.height);
- DCHECK(!state_->TransferIsInProgress());
- DCHECK_EQ(static_cast<GLenum>(GL_TEXTURE_2D), tex_params.target);
- DCHECK_EQ(tex_params.level, 0);
-
- state_->ScheduleAsyncTexSubImage2D(
- tex_params, mem_params, shared_state_->texture_upload_stats);
-}
-
-AsyncPixelTransferManagerShareGroup::SharedState::SharedState()
- // TODO(reveman): Skip this if --enable-gpu-benchmarking is not present.
- : texture_upload_stats(new AsyncPixelTransferUploadStats) {}
-
-AsyncPixelTransferManagerShareGroup::SharedState::~SharedState() {}
-
-AsyncPixelTransferManagerShareGroup::AsyncPixelTransferManagerShareGroup(
- gfx::GLContext* context) {
- g_transfer_thread.Pointer()->InitializeOnMainThread(context);
-}
-
-AsyncPixelTransferManagerShareGroup::~AsyncPixelTransferManagerShareGroup() {}
-
-void AsyncPixelTransferManagerShareGroup::BindCompletedAsyncTransfers() {
- scoped_ptr<gfx::ScopedTextureBinder> texture_binder;
-
- while (!shared_state_.pending_allocations.empty()) {
- if (!shared_state_.pending_allocations.front().get()) {
- shared_state_.pending_allocations.pop_front();
- continue;
- }
- AsyncPixelTransferDelegateShareGroup* delegate =
- shared_state_.pending_allocations.front().get();
- // Terminate early, as all transfers finish in order, currently.
- if (delegate->TransferIsInProgress())
- break;
-
- if (!texture_binder)
- texture_binder.reset(new gfx::ScopedTextureBinder(GL_TEXTURE_2D, 0));
-
- // Used to set tex info from the gles2 cmd decoder once upload has
- // finished (it'll bind the texture and call a callback).
- delegate->BindTransfer();
-
- shared_state_.pending_allocations.pop_front();
- }
-}
-
-void AsyncPixelTransferManagerShareGroup::AsyncNotifyCompletion(
- const AsyncMemoryParams& mem_params,
- AsyncPixelTransferCompletionObserver* observer) {
- // Post a PerformNotifyCompletion task to the upload thread. This task
- // will run after all async transfers are complete.
- transfer_task_runner()->PostTask(
- FROM_HERE, base::Bind(&PerformNotifyCompletion, mem_params,
- make_scoped_refptr(observer)));
-}
-
-uint32 AsyncPixelTransferManagerShareGroup::GetTextureUploadCount() {
- return shared_state_.texture_upload_stats->GetStats(NULL);
-}
-
-base::TimeDelta
-AsyncPixelTransferManagerShareGroup::GetTotalTextureUploadTime() {
- base::TimeDelta total_texture_upload_time;
- shared_state_.texture_upload_stats->GetStats(&total_texture_upload_time);
- return total_texture_upload_time;
-}
-
-void AsyncPixelTransferManagerShareGroup::ProcessMorePendingTransfers() {
-}
-
-bool AsyncPixelTransferManagerShareGroup::NeedsProcessMorePendingTransfers() {
- return false;
-}
-
-void AsyncPixelTransferManagerShareGroup::WaitAllAsyncTexImage2D() {
- if (shared_state_.pending_allocations.empty())
- return;
-
- AsyncPixelTransferDelegateShareGroup* delegate =
- shared_state_.pending_allocations.back().get();
- if (delegate)
- delegate->WaitForTransferCompletion();
-}
-
-AsyncPixelTransferDelegate*
-AsyncPixelTransferManagerShareGroup::CreatePixelTransferDelegateImpl(
- gles2::TextureRef* ref,
- const AsyncTexImage2DParams& define_params) {
- return new AsyncPixelTransferDelegateShareGroup(
- &shared_state_, ref->service_id(), define_params);
-}
-
-} // namespace gpu
diff --git a/chromium/gpu/command_buffer/service/async_pixel_transfer_manager_share_group.h b/chromium/gpu/command_buffer/service/async_pixel_transfer_manager_share_group.h
deleted file mode 100644
index 081fcc4dd07..00000000000
--- a/chromium/gpu/command_buffer/service/async_pixel_transfer_manager_share_group.h
+++ /dev/null
@@ -1,60 +0,0 @@
-// Copyright 2013 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_COMMAND_BUFFER_SERVICE_ASYNC_PIXEL_TRANSFER_MANAGER_SHARE_GROUP_H_
-#define GPU_COMMAND_BUFFER_SERVICE_ASYNC_PIXEL_TRANSFER_MANAGER_SHARE_GROUP_H_
-
-#include "gpu/command_buffer/service/async_pixel_transfer_manager.h"
-
-#include "base/memory/ref_counted.h"
-
-namespace gfx {
-class GLContext;
-}
-
-namespace gpu {
-class AsyncPixelTransferDelegateShareGroup;
-class AsyncPixelTransferUploadStats;
-
-class AsyncPixelTransferManagerShareGroup : public AsyncPixelTransferManager {
- public:
- explicit AsyncPixelTransferManagerShareGroup(gfx::GLContext* context);
- ~AsyncPixelTransferManagerShareGroup() override;
-
- // AsyncPixelTransferManager implementation:
- void BindCompletedAsyncTransfers() override;
- void AsyncNotifyCompletion(
- const AsyncMemoryParams& mem_params,
- AsyncPixelTransferCompletionObserver* observer) override;
- uint32 GetTextureUploadCount() override;
- base::TimeDelta GetTotalTextureUploadTime() override;
- void ProcessMorePendingTransfers() override;
- bool NeedsProcessMorePendingTransfers() override;
- void WaitAllAsyncTexImage2D() override;
-
- // State shared between Managers and Delegates.
- struct SharedState {
- SharedState();
- ~SharedState();
-
- scoped_refptr<AsyncPixelTransferUploadStats> texture_upload_stats;
- typedef std::list<base::WeakPtr<AsyncPixelTransferDelegateShareGroup> >
- TransferQueue;
- TransferQueue pending_allocations;
- };
-
- private:
- // AsyncPixelTransferManager implementation:
- AsyncPixelTransferDelegate* CreatePixelTransferDelegateImpl(
- gles2::TextureRef* ref,
- const AsyncTexImage2DParams& define_params) override;
-
- SharedState shared_state_;
-
- DISALLOW_COPY_AND_ASSIGN(AsyncPixelTransferManagerShareGroup);
-};
-
-} // namespace gpu
-
-#endif // GPU_COMMAND_BUFFER_SERVICE_ASYNC_PIXEL_TRANSFER_MANAGER_SHARE_GROUP_H_
diff --git a/chromium/gpu/command_buffer/service/async_pixel_transfer_manager_stub.cc b/chromium/gpu/command_buffer/service/async_pixel_transfer_manager_stub.cc
deleted file mode 100644
index a2fbc8e94ff..00000000000
--- a/chromium/gpu/command_buffer/service/async_pixel_transfer_manager_stub.cc
+++ /dev/null
@@ -1,89 +0,0 @@
-// Copyright 2013 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/command_buffer/service/async_pixel_transfer_manager_stub.h"
-
-#include "gpu/command_buffer/service/async_pixel_transfer_delegate.h"
-
-namespace gpu {
-
-class AsyncPixelTransferDelegateStub : public AsyncPixelTransferDelegate {
- public:
- AsyncPixelTransferDelegateStub();
- ~AsyncPixelTransferDelegateStub() override;
-
- // Implement AsyncPixelTransferDelegate:
- void AsyncTexImage2D(const AsyncTexImage2DParams& tex_params,
- const AsyncMemoryParams& mem_params,
- const base::Closure& bind_callback) override;
- void AsyncTexSubImage2D(const AsyncTexSubImage2DParams& tex_params,
- const AsyncMemoryParams& mem_params) override;
- bool TransferIsInProgress() override;
- void WaitForTransferCompletion() override;
-
- private:
- DISALLOW_COPY_AND_ASSIGN(AsyncPixelTransferDelegateStub);
-};
-
-AsyncPixelTransferDelegateStub::AsyncPixelTransferDelegateStub() {}
-
-AsyncPixelTransferDelegateStub::~AsyncPixelTransferDelegateStub() {}
-
-void AsyncPixelTransferDelegateStub::AsyncTexImage2D(
- const AsyncTexImage2DParams& tex_params,
- const AsyncMemoryParams& mem_params,
- const base::Closure& bind_callback) {
- bind_callback.Run();
-}
-
-void AsyncPixelTransferDelegateStub::AsyncTexSubImage2D(
- const AsyncTexSubImage2DParams& tex_params,
- const AsyncMemoryParams& mem_params) {
-}
-
-bool AsyncPixelTransferDelegateStub::TransferIsInProgress() {
- return false;
-}
-
-void AsyncPixelTransferDelegateStub::WaitForTransferCompletion() {}
-
-AsyncPixelTransferManagerStub::AsyncPixelTransferManagerStub() {}
-
-AsyncPixelTransferManagerStub::~AsyncPixelTransferManagerStub() {}
-
-void AsyncPixelTransferManagerStub::BindCompletedAsyncTransfers() {
-}
-
-void AsyncPixelTransferManagerStub::AsyncNotifyCompletion(
- const AsyncMemoryParams& mem_params,
- AsyncPixelTransferCompletionObserver* observer) {
- observer->DidComplete(mem_params);
-}
-
-uint32 AsyncPixelTransferManagerStub::GetTextureUploadCount() {
- return 0;
-}
-
-base::TimeDelta AsyncPixelTransferManagerStub::GetTotalTextureUploadTime() {
- return base::TimeDelta();
-}
-
-void AsyncPixelTransferManagerStub::ProcessMorePendingTransfers() {
-}
-
-bool AsyncPixelTransferManagerStub::NeedsProcessMorePendingTransfers() {
- return false;
-}
-
-void AsyncPixelTransferManagerStub::WaitAllAsyncTexImage2D() {
-}
-
-AsyncPixelTransferDelegate*
-AsyncPixelTransferManagerStub::CreatePixelTransferDelegateImpl(
- gles2::TextureRef* ref,
- const AsyncTexImage2DParams& define_params) {
- return new AsyncPixelTransferDelegateStub();
-}
-
-} // namespace gpu
diff --git a/chromium/gpu/command_buffer/service/async_pixel_transfer_manager_stub.h b/chromium/gpu/command_buffer/service/async_pixel_transfer_manager_stub.h
deleted file mode 100644
index f8ced577ed3..00000000000
--- a/chromium/gpu/command_buffer/service/async_pixel_transfer_manager_stub.h
+++ /dev/null
@@ -1,39 +0,0 @@
-// Copyright 2013 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_COMMAND_BUFFER_SERVICE_ASYNC_PIXEL_TRANSFER_MANAGER_STUB_H_
-#define GPU_COMMAND_BUFFER_SERVICE_ASYNC_PIXEL_TRANSFER_MANAGER_STUB_H_
-
-#include "gpu/command_buffer/service/async_pixel_transfer_manager.h"
-
-namespace gpu {
-
-class AsyncPixelTransferManagerStub : public AsyncPixelTransferManager {
- public:
- AsyncPixelTransferManagerStub();
- ~AsyncPixelTransferManagerStub() override;
-
- // AsyncPixelTransferManager implementation:
- void BindCompletedAsyncTransfers() override;
- void AsyncNotifyCompletion(
- const AsyncMemoryParams& mem_params,
- AsyncPixelTransferCompletionObserver* observer) override;
- uint32 GetTextureUploadCount() override;
- base::TimeDelta GetTotalTextureUploadTime() override;
- void ProcessMorePendingTransfers() override;
- bool NeedsProcessMorePendingTransfers() override;
- void WaitAllAsyncTexImage2D() override;
-
- private:
- // AsyncPixelTransferManager implementation:
- AsyncPixelTransferDelegate* CreatePixelTransferDelegateImpl(
- gles2::TextureRef* ref,
- const AsyncTexImage2DParams& define_params) override;
-
- DISALLOW_COPY_AND_ASSIGN(AsyncPixelTransferManagerStub);
-};
-
-} // namespace gpu
-
-#endif // GPU_COMMAND_BUFFER_SERVICE_ASYNC_PIXEL_TRANSFER_MANAGER_STUB_H_
diff --git a/chromium/gpu/command_buffer/service/async_pixel_transfer_manager_sync.cc b/chromium/gpu/command_buffer/service/async_pixel_transfer_manager_sync.cc
deleted file mode 100644
index 589598bca8f..00000000000
--- a/chromium/gpu/command_buffer/service/async_pixel_transfer_manager_sync.cc
+++ /dev/null
@@ -1,139 +0,0 @@
-// Copyright 2013 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/command_buffer/service/async_pixel_transfer_manager_sync.h"
-
-#include "gpu/command_buffer/service/async_pixel_transfer_delegate.h"
-
-namespace gpu {
-
-// Class which handles async pixel transfers synchronously.
-class AsyncPixelTransferDelegateSync : public AsyncPixelTransferDelegate {
- public:
- explicit AsyncPixelTransferDelegateSync(
- AsyncPixelTransferManagerSync::SharedState* shared_state);
- ~AsyncPixelTransferDelegateSync() override;
-
- // Implement AsyncPixelTransferDelegate:
- void AsyncTexImage2D(const AsyncTexImage2DParams& tex_params,
- const AsyncMemoryParams& mem_params,
- const base::Closure& bind_callback) override;
- void AsyncTexSubImage2D(const AsyncTexSubImage2DParams& tex_params,
- const AsyncMemoryParams& mem_params) override;
- bool TransferIsInProgress() override;
- void WaitForTransferCompletion() override;
-
- private:
- // Safe to hold a raw pointer because SharedState is owned by the Manager
- // which owns the Delegate.
- AsyncPixelTransferManagerSync::SharedState* shared_state_;
-
- DISALLOW_COPY_AND_ASSIGN(AsyncPixelTransferDelegateSync);
-};
-
-AsyncPixelTransferDelegateSync::AsyncPixelTransferDelegateSync(
- AsyncPixelTransferManagerSync::SharedState* shared_state)
- : shared_state_(shared_state) {}
-
-AsyncPixelTransferDelegateSync::~AsyncPixelTransferDelegateSync() {}
-
-void AsyncPixelTransferDelegateSync::AsyncTexImage2D(
- const AsyncTexImage2DParams& tex_params,
- const AsyncMemoryParams& mem_params,
- const base::Closure& bind_callback) {
- // Save the define params to return later during deferred
- // binding of the transfer texture.
- void* data = mem_params.GetDataAddress();
- base::TimeTicks begin_time(base::TimeTicks::Now());
- glTexImage2D(
- tex_params.target,
- tex_params.level,
- tex_params.internal_format,
- tex_params.width,
- tex_params.height,
- tex_params.border,
- tex_params.format,
- tex_params.type,
- data);
- shared_state_->texture_upload_count++;
- shared_state_->total_texture_upload_time +=
- base::TimeTicks::Now() - begin_time;
- // The texture is already fully bound so just call it now.
- bind_callback.Run();
-}
-
-void AsyncPixelTransferDelegateSync::AsyncTexSubImage2D(
- const AsyncTexSubImage2DParams& tex_params,
- const AsyncMemoryParams& mem_params) {
- void* data = mem_params.GetDataAddress();
- base::TimeTicks begin_time(base::TimeTicks::Now());
- glTexSubImage2D(
- tex_params.target,
- tex_params.level,
- tex_params.xoffset,
- tex_params.yoffset,
- tex_params.width,
- tex_params.height,
- tex_params.format,
- tex_params.type,
- data);
- shared_state_->texture_upload_count++;
- shared_state_->total_texture_upload_time +=
- base::TimeTicks::Now() - begin_time;
-}
-
-bool AsyncPixelTransferDelegateSync::TransferIsInProgress() {
- // Already done.
- return false;
-}
-
-void AsyncPixelTransferDelegateSync::WaitForTransferCompletion() {
- // Already done.
-}
-
-AsyncPixelTransferManagerSync::SharedState::SharedState()
- : texture_upload_count(0) {}
-
-AsyncPixelTransferManagerSync::SharedState::~SharedState() {}
-
-AsyncPixelTransferManagerSync::AsyncPixelTransferManagerSync() {}
-
-AsyncPixelTransferManagerSync::~AsyncPixelTransferManagerSync() {}
-
-void AsyncPixelTransferManagerSync::BindCompletedAsyncTransfers() {
- // Everything is already bound.
-}
-
-void AsyncPixelTransferManagerSync::AsyncNotifyCompletion(
- const AsyncMemoryParams& mem_params,
- AsyncPixelTransferCompletionObserver* observer) {
- observer->DidComplete(mem_params);
-}
-
-uint32 AsyncPixelTransferManagerSync::GetTextureUploadCount() {
- return shared_state_.texture_upload_count;
-}
-
-base::TimeDelta AsyncPixelTransferManagerSync::GetTotalTextureUploadTime() {
- return shared_state_.total_texture_upload_time;
-}
-
-void AsyncPixelTransferManagerSync::ProcessMorePendingTransfers() {
-}
-
-bool AsyncPixelTransferManagerSync::NeedsProcessMorePendingTransfers() {
- return false;
-}
-
-void AsyncPixelTransferManagerSync::WaitAllAsyncTexImage2D() {
-}
-
-AsyncPixelTransferDelegate*
-AsyncPixelTransferManagerSync::CreatePixelTransferDelegateImpl(
- gles2::TextureRef* ref,
- const AsyncTexImage2DParams& define_params) {
- return new AsyncPixelTransferDelegateSync(&shared_state_);
-}
-
-} // namespace gpu
diff --git a/chromium/gpu/command_buffer/service/async_pixel_transfer_manager_sync.h b/chromium/gpu/command_buffer/service/async_pixel_transfer_manager_sync.h
deleted file mode 100644
index b965d6f444a..00000000000
--- a/chromium/gpu/command_buffer/service/async_pixel_transfer_manager_sync.h
+++ /dev/null
@@ -1,50 +0,0 @@
-// Copyright 2013 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_COMMAND_BUFFER_SERVICE_ASYNC_PIXEL_TRANSFER_MANAGER_SYNC_H_
-#define GPU_COMMAND_BUFFER_SERVICE_ASYNC_PIXEL_TRANSFER_MANAGER_SYNC_H_
-
-#include "gpu/command_buffer/service/async_pixel_transfer_manager.h"
-
-namespace gpu {
-
-class AsyncPixelTransferManagerSync : public AsyncPixelTransferManager {
- public:
- AsyncPixelTransferManagerSync();
- ~AsyncPixelTransferManagerSync() override;
-
- // AsyncPixelTransferManager implementation:
- void BindCompletedAsyncTransfers() override;
- void AsyncNotifyCompletion(
- const AsyncMemoryParams& mem_params,
- AsyncPixelTransferCompletionObserver* observer) override;
- uint32 GetTextureUploadCount() override;
- base::TimeDelta GetTotalTextureUploadTime() override;
- void ProcessMorePendingTransfers() override;
- bool NeedsProcessMorePendingTransfers() override;
- void WaitAllAsyncTexImage2D() override;
-
- // State shared between Managers and Delegates.
- struct SharedState {
- SharedState();
- ~SharedState();
-
- int texture_upload_count;
- base::TimeDelta total_texture_upload_time;
- };
-
- private:
- // AsyncPixelTransferManager implementation:
- AsyncPixelTransferDelegate* CreatePixelTransferDelegateImpl(
- gles2::TextureRef* ref,
- const AsyncTexImage2DParams& define_params) override;
-
- SharedState shared_state_;
-
- DISALLOW_COPY_AND_ASSIGN(AsyncPixelTransferManagerSync);
-};
-
-} // namespace gpu
-
-#endif // GPU_COMMAND_BUFFER_SERVICE_ASYNC_PIXEL_TRANSFER_MANAGER_SYNC_H_
diff --git a/chromium/gpu/command_buffer/service/async_pixel_transfer_manager_win.cc b/chromium/gpu/command_buffer/service/async_pixel_transfer_manager_win.cc
deleted file mode 100644
index dc106e8316d..00000000000
--- a/chromium/gpu/command_buffer/service/async_pixel_transfer_manager_win.cc
+++ /dev/null
@@ -1,30 +0,0 @@
-// Copyright 2013 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/command_buffer/service/async_pixel_transfer_manager.h"
-
-#include "base/trace_event/trace_event.h"
-#include "gpu/command_buffer/service/async_pixel_transfer_manager_idle.h"
-#include "gpu/command_buffer/service/async_pixel_transfer_manager_stub.h"
-#include "ui/gl/gl_implementation.h"
-
-namespace gpu {
-
-AsyncPixelTransferManager* AsyncPixelTransferManager::Create(
- gfx::GLContext* context) {
- TRACE_EVENT0("gpu", "AsyncPixelTransferManager::Create");
- switch (gfx::GetGLImplementation()) {
- case gfx::kGLImplementationOSMesaGL:
- case gfx::kGLImplementationDesktopGL:
- case gfx::kGLImplementationEGLGLES2:
- return new AsyncPixelTransferManagerIdle(true);
- case gfx::kGLImplementationMockGL:
- return new AsyncPixelTransferManagerStub;
- default:
- NOTREACHED();
- return NULL;
- }
-}
-
-} // namespace gpu
diff --git a/chromium/gpu/command_buffer/service/buffer_manager.cc b/chromium/gpu/command_buffer/service/buffer_manager.cc
index 6b12f83d712..6e3c16733b2 100644
--- a/chromium/gpu/command_buffer/service/buffer_manager.cc
+++ b/chromium/gpu/command_buffer/service/buffer_manager.cc
@@ -5,6 +5,9 @@
#include "gpu/command_buffer/service/buffer_manager.h"
#include <limits>
#include "base/logging.h"
+#include "base/strings/stringprintf.h"
+#include "base/thread_task_runner_handle.h"
+#include "base/trace_event/memory_dump_manager.h"
#include "base/trace_event/trace_event.h"
#include "gpu/command_buffer/common/gles2_cmd_utils.h"
#include "gpu/command_buffer/service/context_state.h"
@@ -13,34 +16,46 @@
#include "gpu/command_buffer/service/memory_tracking.h"
#include "ui/gl/gl_bindings.h"
#include "ui/gl/gl_implementation.h"
+#include "ui/gl/trace_util.h"
namespace gpu {
namespace gles2 {
-BufferManager::BufferManager(
- MemoryTracker* memory_tracker,
- FeatureInfo* feature_info)
- : memory_tracker_(
+BufferManager::BufferManager(MemoryTracker* memory_tracker,
+ FeatureInfo* feature_info)
+ : memory_type_tracker_(
new MemoryTypeTracker(memory_tracker, MemoryTracker::kManaged)),
+ memory_tracker_(memory_tracker),
feature_info_(feature_info),
allow_buffers_on_multiple_targets_(false),
allow_fixed_attribs_(false),
buffer_count_(0),
have_context_(true),
use_client_side_arrays_for_stream_buffers_(
- feature_info ? feature_info->workarounds(
- ).use_client_side_arrays_for_stream_buffers : 0) {
+ feature_info
+ ? feature_info->workarounds()
+ .use_client_side_arrays_for_stream_buffers
+ : 0) {
+ // When created from InProcessCommandBuffer, we won't have a |memory_tracker_|
+ // so don't register a dump provider.
+ if (memory_tracker_) {
+ base::trace_event::MemoryDumpManager::GetInstance()->RegisterDumpProvider(
+ this, base::ThreadTaskRunnerHandle::Get());
+ }
}
BufferManager::~BufferManager() {
DCHECK(buffers_.empty());
CHECK_EQ(buffer_count_, 0u);
+
+ base::trace_event::MemoryDumpManager::GetInstance()->UnregisterDumpProvider(
+ this);
}
void BufferManager::Destroy(bool have_context) {
have_context_ = have_context;
buffers_.clear();
- DCHECK_EQ(0u, memory_tracker_->GetMemRepresented());
+ DCHECK_EQ(0u, memory_type_tracker_->GetMemRepresented());
}
void BufferManager::CreateBuffer(GLuint client_id, GLuint service_id) {
@@ -70,7 +85,7 @@ void BufferManager::StartTracking(Buffer* /* buffer */) {
}
void BufferManager::StopTracking(Buffer* buffer) {
- memory_tracker_->TrackMemFree(buffer->size());
+ memory_type_tracker_->TrackMemFree(buffer->size());
--buffer_count_;
}
@@ -274,7 +289,7 @@ bool BufferManager::UseNonZeroSizeForClientSideArrayBuffer() {
void BufferManager::SetInfo(Buffer* buffer, GLenum target, GLsizeiptr size,
GLenum usage, const GLvoid* data) {
DCHECK(buffer);
- memory_tracker_->TrackMemFree(buffer->size());
+ memory_type_tracker_->TrackMemFree(buffer->size());
const bool is_client_side_array = IsUsageClientSideArray(usage);
const bool support_fixed_attribs =
gfx::GetGLImplementation() == gfx::kGLImplementationEGLGLES2;
@@ -284,7 +299,7 @@ void BufferManager::SetInfo(Buffer* buffer, GLenum target, GLsizeiptr size,
(allow_fixed_attribs_ && !support_fixed_attribs) ||
is_client_side_array;
buffer->SetInfo(size, usage, shadow, data, is_client_side_array);
- memory_tracker_->TrackMemAlloc(buffer->size());
+ memory_type_tracker_->TrackMemAlloc(buffer->size());
}
void BufferManager::ValidateAndDoBufferData(
@@ -314,7 +329,7 @@ void BufferManager::ValidateAndDoBufferData(
return;
}
- if (!memory_tracker_->EnsureGPUMemoryAvailable(size)) {
+ if (!memory_type_tracker_->EnsureGPUMemoryAvailable(size)) {
ERRORSTATE_SET_GL_ERROR(
error_state, GL_OUT_OF_MEMORY, "glBufferData", "out of memory");
return;
@@ -386,6 +401,36 @@ void BufferManager::DoBufferSubData(
}
}
+void BufferManager::ValidateAndDoGetBufferParameteri64v(
+ ContextState* context_state, GLenum target, GLenum pname, GLint64* params) {
+ Buffer* buffer = GetBufferInfoForTarget(context_state, target);
+ if (!buffer) {
+ ERRORSTATE_SET_GL_ERROR(
+ context_state->GetErrorState(), GL_INVALID_OPERATION,
+ "glGetBufferParameteri64v", "no buffer bound for target");
+ return;
+ }
+ switch (pname) {
+ case GL_BUFFER_SIZE:
+ *params = buffer->size();
+ break;
+ case GL_BUFFER_MAP_LENGTH:
+ {
+ const Buffer::MappedRange* mapped_range = buffer->GetMappedRange();
+ *params = mapped_range ? mapped_range->size : 0;
+ break;
+ }
+ case GL_BUFFER_MAP_OFFSET:
+ {
+ const Buffer::MappedRange* mapped_range = buffer->GetMappedRange();
+ *params = mapped_range ? mapped_range->offset : 0;
+ break;
+ }
+ default:
+ NOTREACHED();
+ }
+}
+
void BufferManager::ValidateAndDoGetBufferParameteriv(
ContextState* context_state, GLenum target, GLenum pname, GLint* params) {
Buffer* buffer = GetBufferInfoForTarget(context_state, target);
@@ -402,6 +447,15 @@ void BufferManager::ValidateAndDoGetBufferParameteriv(
case GL_BUFFER_USAGE:
*params = buffer->usage();
break;
+ case GL_BUFFER_ACCESS_FLAGS:
+ {
+ const Buffer::MappedRange* mapped_range = buffer->GetMappedRange();
+ *params = mapped_range ? mapped_range->access : 0;
+ break;
+ }
+ case GL_BUFFER_MAPPED:
+ *params = buffer->GetMappedRange() == nullptr ? false : true;
+ break;
default:
NOTREACHED();
}
@@ -478,7 +532,28 @@ Buffer* BufferManager::GetBufferInfoForTarget(
}
}
+bool BufferManager::OnMemoryDump(const base::trace_event::MemoryDumpArgs& args,
+ base::trace_event::ProcessMemoryDump* pmd) {
+ const int client_id = memory_tracker_->ClientId();
+ for (const auto& buffer_entry : buffers_) {
+ const auto& client_buffer_id = buffer_entry.first;
+ const auto& buffer = buffer_entry.second;
+
+ std::string dump_name = base::StringPrintf(
+ "gpu/gl/buffers/client_%d/buffer_%d", client_id, client_buffer_id);
+ base::trace_event::MemoryAllocatorDump* dump =
+ pmd->CreateAllocatorDump(dump_name);
+ dump->AddScalar(base::trace_event::MemoryAllocatorDump::kNameSize,
+ base::trace_event::MemoryAllocatorDump::kUnitsBytes,
+ static_cast<uint64_t>(buffer->size()));
+
+ auto guid = gfx::GetGLBufferGUIDForTracing(
+ memory_tracker_->ShareGroupTracingGUID(), client_buffer_id);
+ pmd->CreateSharedGlobalAllocatorDump(guid);
+ pmd->AddOwnershipEdge(dump->guid(), guid);
+ }
+ return true;
+}
+
} // namespace gles2
} // namespace gpu
-
-
diff --git a/chromium/gpu/command_buffer/service/buffer_manager.h b/chromium/gpu/command_buffer/service/buffer_manager.h
index 9f69cf060b0..2f64e0d7e2f 100644
--- a/chromium/gpu/command_buffer/service/buffer_manager.h
+++ b/chromium/gpu/command_buffer/service/buffer_manager.h
@@ -202,10 +202,10 @@ class GPU_EXPORT Buffer : public base::RefCounted<Buffer> {
//
// NOTE: To support shared resources an instance of this class will need to be
// shared by multiple GLES2Decoders.
-class GPU_EXPORT BufferManager {
+class GPU_EXPORT BufferManager : public base::trace_event::MemoryDumpProvider {
public:
BufferManager(MemoryTracker* memory_tracker, FeatureInfo* feature_info);
- ~BufferManager();
+ ~BufferManager() override;
// Must call before destruction.
void Destroy(bool have_context);
@@ -234,6 +234,11 @@ class GPU_EXPORT BufferManager {
ContextState* context_state, GLenum target, GLsizeiptr size,
const GLvoid * data, GLenum usage);
+ // Validates a glGetBufferParameteri64v, and then calls GetBufferParameteri64v
+ // if validation was successful.
+ void ValidateAndDoGetBufferParameteri64v(
+ ContextState* context_state, GLenum target, GLenum pname, GLint64* params);
+
// Validates a glGetBufferParameteriv, and then calls GetBufferParameteriv if
// validation was successful.
void ValidateAndDoGetBufferParameteriv(
@@ -251,7 +256,7 @@ class GPU_EXPORT BufferManager {
}
size_t mem_represented() const {
- return memory_tracker_->GetMemRepresented();
+ return memory_type_tracker_->GetMemRepresented();
}
// Tells for a given usage if this would be a client side array.
@@ -263,6 +268,10 @@ class GPU_EXPORT BufferManager {
Buffer* GetBufferInfoForTarget(ContextState* state, GLenum target) const;
+ // base::trace_event::MemoryDumpProvider implementation.
+ bool OnMemoryDump(const base::trace_event::MemoryDumpArgs& args,
+ base::trace_event::ProcessMemoryDump* pmd) override;
+
private:
friend class Buffer;
friend class TestHelper; // Needs access to DoBufferData.
@@ -296,7 +305,8 @@ class GPU_EXPORT BufferManager {
void SetInfo(Buffer* buffer, GLenum target, GLsizeiptr size, GLenum usage,
const GLvoid* data);
- scoped_ptr<MemoryTypeTracker> memory_tracker_;
+ scoped_ptr<MemoryTypeTracker> memory_type_tracker_;
+ MemoryTracker* memory_tracker_;
scoped_refptr<FeatureInfo> feature_info_;
// Info for each buffer in the system.
diff --git a/chromium/gpu/command_buffer/service/buffer_manager_unittest.cc b/chromium/gpu/command_buffer/service/buffer_manager_unittest.cc
index c537c2f6cc4..91003a061a0 100644
--- a/chromium/gpu/command_buffer/service/buffer_manager_unittest.cc
+++ b/chromium/gpu/command_buffer/service/buffer_manager_unittest.cc
@@ -27,7 +27,7 @@ class BufferManagerTestBase : public GpuServiceTest {
GpuServiceTest::SetUp();
if (feature_info) {
TestHelper::SetupFeatureInfoInitExpectations(gl_.get(), extensions);
- feature_info->Initialize();
+ feature_info->InitializeForTesting();
}
error_state_.reset(new MockErrorState());
manager_.reset(new BufferManager(memory_tracker, feature_info));
diff --git a/chromium/gpu/command_buffer/service/command_buffer_service.cc b/chromium/gpu/command_buffer/service/command_buffer_service.cc
index f2444b31e9f..0ea4b54e2cf 100644
--- a/chromium/gpu/command_buffer/service/command_buffer_service.cc
+++ b/chromium/gpu/command_buffer/service/command_buffer_service.cc
@@ -122,14 +122,19 @@ scoped_refptr<Buffer> CommandBufferService::CreateTransferBuffer(size_t size,
*id = -1;
scoped_ptr<SharedMemory> shared_memory(new SharedMemory());
- if (!shared_memory->CreateAndMapAnonymous(size))
+ if (!shared_memory->CreateAndMapAnonymous(size)) {
+ if (error_ == error::kNoError)
+ error_ = gpu::error::kOutOfBounds;
return NULL;
+ }
static int32 next_id = 1;
*id = next_id++;
if (!RegisterTransferBuffer(
*id, MakeBackingFromSharedMemory(shared_memory.Pass(), size))) {
+ if (error_ == error::kNoError)
+ error_ = gpu::error::kOutOfBounds;
*id = -1;
return NULL;
}
diff --git a/chromium/gpu/command_buffer/service/command_buffer_service.h b/chromium/gpu/command_buffer/service/command_buffer_service.h
index 809891b6747..ddcfec3d36d 100644
--- a/chromium/gpu/command_buffer/service/command_buffer_service.h
+++ b/chromium/gpu/command_buffer/service/command_buffer_service.h
@@ -6,7 +6,6 @@
#define GPU_COMMAND_BUFFER_SERVICE_COMMAND_BUFFER_SERVICE_H_
#include "base/callback.h"
-#include "base/memory/shared_memory.h"
#include "gpu/command_buffer/common/command_buffer.h"
#include "gpu/command_buffer/common/command_buffer_shared.h"
diff --git a/chromium/gpu/command_buffer/service/command_buffer_service_unittest.cc b/chromium/gpu/command_buffer/service/command_buffer_service_unittest.cc
index 7b112c59596..1113fa5bdd3 100644
--- a/chromium/gpu/command_buffer/service/command_buffer_service_unittest.cc
+++ b/chromium/gpu/command_buffer/service/command_buffer_service_unittest.cc
@@ -24,7 +24,7 @@ class CommandBufferServiceTest : public testing::Test {
protected:
void SetUp() override {
{
- TransferBufferManager* manager = new TransferBufferManager();
+ TransferBufferManager* manager = new TransferBufferManager(nullptr);
transfer_buffer_manager_ = manager;
EXPECT_TRUE(manager->Initialize());
}
diff --git a/chromium/gpu/command_buffer/service/context_group.cc b/chromium/gpu/command_buffer/service/context_group.cc
index c975347ea68..e22459a7fcc 100644
--- a/chromium/gpu/command_buffer/service/context_group.cc
+++ b/chromium/gpu/command_buffer/service/context_group.cc
@@ -8,21 +8,20 @@
#include <string>
#include "base/command_line.h"
-#include "base/strings/string_util.h"
-#include "base/sys_info.h"
+#include "gpu/command_buffer/common/value_state.h"
#include "gpu/command_buffer/service/buffer_manager.h"
#include "gpu/command_buffer/service/framebuffer_manager.h"
-#include "gpu/command_buffer/service/gles2_cmd_decoder.h"
#include "gpu/command_buffer/service/gpu_switches.h"
#include "gpu/command_buffer/service/mailbox_manager_impl.h"
-#include "gpu/command_buffer/service/memory_tracking.h"
+#include "gpu/command_buffer/service/path_manager.h"
#include "gpu/command_buffer/service/program_manager.h"
#include "gpu/command_buffer/service/renderbuffer_manager.h"
#include "gpu/command_buffer/service/shader_manager.h"
#include "gpu/command_buffer/service/texture_manager.h"
#include "gpu/command_buffer/service/transfer_buffer_manager.h"
#include "gpu/command_buffer/service/valuebuffer_manager.h"
-#include "ui/gl/gl_implementation.h"
+#include "ui/gl/gl_bindings.h"
+#include "ui/gl/gl_version_info.h"
namespace gpu {
namespace gles2 {
@@ -31,18 +30,33 @@ ContextGroup::ContextGroup(
const scoped_refptr<MailboxManager>& mailbox_manager,
const scoped_refptr<MemoryTracker>& memory_tracker,
const scoped_refptr<ShaderTranslatorCache>& shader_translator_cache,
+ const scoped_refptr<FramebufferCompletenessCache>&
+ framebuffer_completeness_cache,
const scoped_refptr<FeatureInfo>& feature_info,
const scoped_refptr<SubscriptionRefSet>& subscription_ref_set,
const scoped_refptr<ValueStateMap>& pending_valuebuffer_state,
bool bind_generates_resource)
- : context_type_(CONTEXT_TYPE_UNDEFINED),
- mailbox_manager_(mailbox_manager),
+ : mailbox_manager_(mailbox_manager),
memory_tracker_(memory_tracker),
shader_translator_cache_(shader_translator_cache),
+#if defined(OS_MACOSX)
+ // Framebuffer completeness is not cacheable on OS X because of dynamic
+ // graphics switching.
+ // http://crbug.com/180876
+ // TODO(tobiasjs): determine whether GPU switching is possible
+ // programmatically, rather than just hardcoding this behaviour
+ // for OS X.
+ framebuffer_completeness_cache_(NULL),
+#else
+ framebuffer_completeness_cache_(framebuffer_completeness_cache),
+#endif
subscription_ref_set_(subscription_ref_set),
pending_valuebuffer_state_(pending_valuebuffer_state),
- enforce_gl_minimums_(base::CommandLine::ForCurrentProcess()->HasSwitch(
- switches::kEnforceGLMinimums)),
+ enforce_gl_minimums_(
+ base::CommandLine::InitializedForCurrentProcess()
+ ? base::CommandLine::ForCurrentProcess()->HasSwitch(
+ switches::kEnforceGLMinimums)
+ : false),
bind_generates_resource_(bind_generates_resource),
max_vertex_attribs_(0u),
max_texture_units_(0u),
@@ -54,8 +68,7 @@ ContextGroup::ContextGroup(
max_color_attachments_(1u),
max_draw_buffers_(1u),
program_cache_(NULL),
- feature_info_(feature_info),
- draw_buffer_(GL_BACK) {
+ feature_info_(feature_info) {
{
if (!mailbox_manager_.get())
mailbox_manager_ = new MailboxManagerImpl;
@@ -65,9 +78,7 @@ ContextGroup::ContextGroup(
pending_valuebuffer_state_ = new ValueStateMap();
if (!feature_info.get())
feature_info_ = new FeatureInfo;
- TransferBufferManager* manager = new TransferBufferManager();
- transfer_buffer_manager_ = manager;
- manager->Initialize();
+ transfer_buffer_manager_ = new TransferBufferManager(memory_tracker_.get());
}
}
@@ -77,50 +88,28 @@ static void GetIntegerv(GLenum pname, uint32* var) {
*var = value;
}
-// static
-ContextGroup::ContextType ContextGroup::GetContextType(
- unsigned webgl_version) {
- switch (webgl_version) {
- case 0:
- return CONTEXT_TYPE_OTHER;
- case 1:
- return CONTEXT_TYPE_WEBGL1;
- case 2:
- return CONTEXT_TYPE_WEBGL2;
- default:
- return CONTEXT_TYPE_UNDEFINED;
- }
-}
-
-bool ContextGroup::Initialize(
- GLES2Decoder* decoder,
- ContextGroup::ContextType context_type,
- const DisallowedFeatures& disallowed_features) {
- if (context_type == CONTEXT_TYPE_UNDEFINED) {
- LOG(ERROR) << "ContextGroup::Initialize failed because of unknown "
- << "context type.";
- return false;
- }
- if (context_type_ == CONTEXT_TYPE_UNDEFINED) {
- context_type_ = context_type;
- } else if (context_type_ != context_type) {
- LOG(ERROR) << "ContextGroup::Initialize failed because the type of "
- << "the context does not fit with the group.";
- return false;
- }
-
- // If we've already initialized the group just add the context.
+bool ContextGroup::Initialize(GLES2Decoder* decoder,
+ ContextType context_type,
+ const DisallowedFeatures& disallowed_features) {
if (HaveContexts()) {
+ if (context_type != feature_info_->context_type()) {
+ LOG(ERROR) << "ContextGroup::Initialize failed because the type of "
+ << "the context does not fit with the group.";
+ return false;
+ }
+ // If we've already initialized the group just add the context.
decoders_.push_back(base::AsWeakPtr<GLES2Decoder>(decoder));
return true;
}
- if (!feature_info_->Initialize(disallowed_features)) {
+ if (!feature_info_->Initialize(context_type, disallowed_features)) {
LOG(ERROR) << "ContextGroup::Initialize failed because FeatureInfo "
<< "initialization failed.";
return false;
}
+ transfer_buffer_manager_->Initialize();
+
const GLint kMinRenderbufferSize = 512; // GL says 1 pixel!
GLint max_renderbuffer_size = 0;
if (!QueryGLFeature(
@@ -149,13 +138,13 @@ bool ContextGroup::Initialize(
GetIntegerv(GL_MAX_DRAW_BUFFERS_ARB, &max_draw_buffers_);
if (max_draw_buffers_ < 1)
max_draw_buffers_ = 1;
- draw_buffer_ = GL_BACK;
}
buffer_manager_.reset(
new BufferManager(memory_tracker_.get(), feature_info_.get()));
- framebuffer_manager_.reset(
- new FramebufferManager(max_draw_buffers_, max_color_attachments_));
+ framebuffer_manager_.reset(new FramebufferManager(
+ max_draw_buffers_, max_color_attachments_, feature_info_->context_type(),
+ framebuffer_completeness_cache_));
renderbuffer_manager_.reset(new RenderbufferManager(
memory_tracker_.get(), max_renderbuffer_size, max_samples,
feature_info_.get()));
@@ -294,6 +283,8 @@ bool ContextGroup::Initialize(
feature_info_->workarounds().max_vertex_uniform_vectors));
}
+ path_manager_.reset(new PathManager());
+
program_manager_.reset(new ProgramManager(
program_cache_, max_varying_vectors_));
@@ -365,6 +356,11 @@ void ContextGroup::Destroy(GLES2Decoder* decoder, bool have_context) {
texture_manager_.reset();
}
+ if (path_manager_ != NULL) {
+ path_manager_->Destroy(have_context);
+ path_manager_.reset();
+ }
+
if (program_manager_ != NULL) {
program_manager_->Destroy(have_context);
program_manager_.reset();
diff --git a/chromium/gpu/command_buffer/service/context_group.h b/chromium/gpu/command_buffer/service/context_group.h
index 466f918a19c..ad2c5df0b19 100644
--- a/chromium/gpu/command_buffer/service/context_group.h
+++ b/chromium/gpu/command_buffer/service/context_group.h
@@ -5,23 +5,23 @@
#ifndef GPU_COMMAND_BUFFER_SERVICE_CONTEXT_GROUP_H_
#define GPU_COMMAND_BUFFER_SERVICE_CONTEXT_GROUP_H_
-#include <string>
#include <vector>
#include "base/basictypes.h"
#include "base/containers/hash_tables.h"
-#include "base/memory/linked_ptr.h"
#include "base/memory/ref_counted.h"
#include "base/memory/scoped_ptr.h"
#include "base/memory/weak_ptr.h"
+#include "gpu/command_buffer/common/constants.h"
#include "gpu/command_buffer/common/gles2_cmd_format.h"
+#include "gpu/command_buffer/common/gles2_cmd_utils.h"
#include "gpu/command_buffer/service/feature_info.h"
-#include "gpu/command_buffer/service/gles2_cmd_validation.h"
+#include "gpu/command_buffer/service/framebuffer_completeness_cache.h"
#include "gpu/command_buffer/service/shader_translator_cache.h"
#include "gpu/gpu_export.h"
namespace gpu {
-class TransferBufferManagerInterface;
+class TransferBufferManager;
class ValueStateMap;
namespace gles2 {
@@ -32,6 +32,7 @@ class GLES2Decoder;
class FramebufferManager;
class MailboxManager;
class RenderbufferManager;
+class PathManager;
class ProgramManager;
class ShaderManager;
class TextureManager;
@@ -44,19 +45,12 @@ struct DisallowedFeatures;
// resources.
class GPU_EXPORT ContextGroup : public base::RefCounted<ContextGroup> {
public:
- enum ContextType {
- CONTEXT_TYPE_WEBGL1,
- CONTEXT_TYPE_WEBGL2,
- CONTEXT_TYPE_OTHER,
- CONTEXT_TYPE_UNDEFINED
- };
-
- static ContextType GetContextType(unsigned webgl_version);
-
ContextGroup(
const scoped_refptr<MailboxManager>& mailbox_manager,
const scoped_refptr<MemoryTracker>& memory_tracker,
const scoped_refptr<ShaderTranslatorCache>& shader_translator_cache,
+ const scoped_refptr<FramebufferCompletenessCache>&
+ framebuffer_completeness_cache,
const scoped_refptr<FeatureInfo>& feature_info,
const scoped_refptr<SubscriptionRefSet>& subscription_ref_set,
const scoped_refptr<ValueStateMap>& pending_valuebuffer_state,
@@ -85,6 +79,10 @@ class GPU_EXPORT ContextGroup : public base::RefCounted<ContextGroup> {
return shader_translator_cache_.get();
}
+ FramebufferCompletenessCache* framebuffer_completeness_cache() const {
+ return framebuffer_completeness_cache_.get();
+ }
+
bool bind_generates_resource() {
return bind_generates_resource_;
}
@@ -153,6 +151,8 @@ class GPU_EXPORT ContextGroup : public base::RefCounted<ContextGroup> {
return texture_manager_.get();
}
+ PathManager* path_manager() const { return path_manager_.get(); }
+
ProgramManager* program_manager() const {
return program_manager_.get();
}
@@ -169,7 +169,7 @@ class GPU_EXPORT ContextGroup : public base::RefCounted<ContextGroup> {
return shader_manager_.get();
}
- TransferBufferManagerInterface* transfer_buffer_manager() const {
+ TransferBufferManager* transfer_buffer_manager() const {
return transfer_buffer_manager_.get();
}
@@ -178,14 +178,6 @@ class GPU_EXPORT ContextGroup : public base::RefCounted<ContextGroup> {
// Loses all the context associated with this group.
void LoseContexts(error::ContextLostReason reason);
- // EXT_draw_buffer related states for backbuffer.
- GLenum draw_buffer() const {
- return draw_buffer_;
- }
- void set_draw_buffer(GLenum buf) {
- draw_buffer_ = buf;
- }
-
bool GetBufferServiceId(GLuint client_id, GLuint* service_id) const;
void AddSamplerId(GLuint client_id, GLuint service_id) {
@@ -259,12 +251,11 @@ class GPU_EXPORT ContextGroup : public base::RefCounted<ContextGroup> {
bool QueryGLFeatureU(GLenum pname, GLint min_required, uint32* v);
bool HaveContexts();
- ContextType context_type_;
-
scoped_refptr<MailboxManager> mailbox_manager_;
scoped_refptr<MemoryTracker> memory_tracker_;
scoped_refptr<ShaderTranslatorCache> shader_translator_cache_;
- scoped_refptr<TransferBufferManagerInterface> transfer_buffer_manager_;
+ scoped_refptr<FramebufferCompletenessCache> framebuffer_completeness_cache_;
+ scoped_refptr<TransferBufferManager> transfer_buffer_manager_;
scoped_refptr<SubscriptionRefSet> subscription_ref_set_;
scoped_refptr<ValueStateMap> pending_valuebuffer_state_;
@@ -291,6 +282,8 @@ class GPU_EXPORT ContextGroup : public base::RefCounted<ContextGroup> {
scoped_ptr<TextureManager> texture_manager_;
+ scoped_ptr<PathManager> path_manager_;
+
scoped_ptr<ProgramManager> program_manager_;
scoped_ptr<ShaderManager> shader_manager_;
@@ -306,8 +299,6 @@ class GPU_EXPORT ContextGroup : public base::RefCounted<ContextGroup> {
base::hash_map<GLuint, GLuint> transformfeedbacks_id_map_;
base::hash_map<GLuint, GLsync> syncs_id_map_;
- GLenum draw_buffer_;
-
DISALLOW_COPY_AND_ASSIGN(ContextGroup);
};
@@ -315,5 +306,3 @@ class GPU_EXPORT ContextGroup : public base::RefCounted<ContextGroup> {
} // namespace gpu
#endif // GPU_COMMAND_BUFFER_SERVICE_CONTEXT_GROUP_H_
-
-
diff --git a/chromium/gpu/command_buffer/service/context_group_unittest.cc b/chromium/gpu/command_buffer/service/context_group_unittest.cc
index 7c6d5c1c8bd..af1c9b728cc 100644
--- a/chromium/gpu/command_buffer/service/context_group_unittest.cc
+++ b/chromium/gpu/command_buffer/service/context_group_unittest.cc
@@ -41,7 +41,7 @@ class ContextGroupTest : public GpuServiceTest {
GpuServiceTest::SetUp();
decoder_.reset(new MockGLES2Decoder());
group_ = scoped_refptr<ContextGroup>(new ContextGroup(
- NULL, NULL, NULL, NULL, NULL, NULL, kBindGeneratesResource));
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, kBindGeneratesResource));
}
scoped_ptr<MockGLES2Decoder> decoder_;
@@ -68,8 +68,8 @@ TEST_F(ContextGroupTest, Basic) {
TEST_F(ContextGroupTest, InitializeNoExtensions) {
TestHelper::SetupContextGroupInitExpectations(
gl_.get(), DisallowedFeatures(), "", "", kBindGeneratesResource);
- group_->Initialize(
- decoder_.get(), ContextGroup::CONTEXT_TYPE_OTHER, DisallowedFeatures());
+ group_->Initialize(decoder_.get(), CONTEXT_TYPE_OPENGLES2,
+ DisallowedFeatures());
EXPECT_EQ(static_cast<uint32>(TestHelper::kNumVertexAttribs),
group_->max_vertex_attribs());
EXPECT_EQ(static_cast<uint32>(TestHelper::kNumTextureUnits),
@@ -104,19 +104,16 @@ TEST_F(ContextGroupTest, MultipleContexts) {
scoped_ptr<MockGLES2Decoder> decoder2_(new MockGLES2Decoder());
TestHelper::SetupContextGroupInitExpectations(
gl_.get(), DisallowedFeatures(), "", "", kBindGeneratesResource);
- EXPECT_TRUE(group_->Initialize(
- decoder_.get(), ContextGroup::CONTEXT_TYPE_OTHER, DisallowedFeatures()));
- EXPECT_FALSE(group_->Initialize(
- decoder2_.get(), ContextGroup::CONTEXT_TYPE_WEBGL1,
- DisallowedFeatures()));
- EXPECT_FALSE(group_->Initialize(
- decoder2_.get(), ContextGroup::CONTEXT_TYPE_WEBGL2,
- DisallowedFeatures()));
- EXPECT_FALSE(group_->Initialize(
- decoder2_.get(), ContextGroup::CONTEXT_TYPE_UNDEFINED,
- DisallowedFeatures()));
- EXPECT_TRUE(group_->Initialize(
- decoder2_.get(), ContextGroup::CONTEXT_TYPE_OTHER, DisallowedFeatures()));
+ EXPECT_TRUE(group_->Initialize(decoder_.get(), CONTEXT_TYPE_OPENGLES2,
+ DisallowedFeatures()));
+ EXPECT_FALSE(group_->Initialize(decoder2_.get(), CONTEXT_TYPE_WEBGL1,
+ DisallowedFeatures()));
+ EXPECT_FALSE(group_->Initialize(decoder2_.get(), CONTEXT_TYPE_WEBGL2,
+ DisallowedFeatures()));
+ EXPECT_FALSE(group_->Initialize(decoder2_.get(), CONTEXT_TYPE_OPENGLES3,
+ DisallowedFeatures()));
+ EXPECT_TRUE(group_->Initialize(decoder2_.get(), CONTEXT_TYPE_OPENGLES2,
+ DisallowedFeatures()));
EXPECT_TRUE(group_->buffer_manager() != NULL);
EXPECT_TRUE(group_->framebuffer_manager() != NULL);
diff --git a/chromium/gpu/command_buffer/service/context_state.cc b/chromium/gpu/command_buffer/service/context_state.cc
index 38b70a1f2f5..e8c00727cf4 100644
--- a/chromium/gpu/command_buffer/service/context_state.cc
+++ b/chromium/gpu/command_buffer/service/context_state.cc
@@ -14,6 +14,7 @@
#include "gpu/command_buffer/service/renderbuffer_manager.h"
#include "ui/gl/gl_bindings.h"
#include "ui/gl/gl_implementation.h"
+#include "ui/gl/gl_version_info.h"
namespace gpu {
namespace gles2 {
@@ -262,7 +263,7 @@ void ContextState::RestoreBufferBindings() const {
glBindBuffer(GL_ELEMENT_ARRAY_BUFFER, GetBufferId(element_array_buffer));
}
glBindBuffer(GL_ARRAY_BUFFER, GetBufferId(bound_array_buffer.get()));
- if (feature_info_->IsES3Enabled()) {
+ if (feature_info_->IsES3Capable()) {
glBindBuffer(GL_COPY_READ_BUFFER,
GetBufferId(bound_copy_read_buffer.get()));
glBindBuffer(GL_COPY_WRITE_BUFFER,
@@ -499,6 +500,53 @@ void ContextState::RemoveBoundBuffer(Buffer* buffer) {
}
}
+void ContextState::UnbindTexture(TextureRef* texture) {
+ GLuint active_unit = active_texture_unit;
+ for (size_t jj = 0; jj < texture_units.size(); ++jj) {
+ TextureUnit& unit = texture_units[jj];
+ if (unit.bound_texture_2d.get() == texture) {
+ unit.bound_texture_2d = NULL;
+ if (active_unit != jj) {
+ glActiveTexture(GL_TEXTURE0 + jj);
+ active_unit = jj;
+ }
+ glBindTexture(GL_TEXTURE_2D, 0);
+ } else if (unit.bound_texture_cube_map.get() == texture) {
+ unit.bound_texture_cube_map = NULL;
+ if (active_unit != jj) {
+ glActiveTexture(GL_TEXTURE0 + jj);
+ active_unit = jj;
+ }
+ glBindTexture(GL_TEXTURE_CUBE_MAP, 0);
+ } else if (unit.bound_texture_external_oes.get() == texture) {
+ unit.bound_texture_external_oes = NULL;
+ if (active_unit != jj) {
+ glActiveTexture(GL_TEXTURE0 + jj);
+ active_unit = jj;
+ }
+ glBindTexture(GL_TEXTURE_EXTERNAL_OES, 0);
+ } else if (unit.bound_texture_3d.get() == texture) {
+ unit.bound_texture_3d = NULL;
+ if (active_unit != jj) {
+ glActiveTexture(GL_TEXTURE0 + jj);
+ active_unit = jj;
+ }
+ glBindTexture(GL_TEXTURE_3D, 0);
+ } else if (unit.bound_texture_2d_array.get() == texture) {
+ unit.bound_texture_2d_array = NULL;
+ if (active_unit != jj) {
+ glActiveTexture(GL_TEXTURE0 + jj);
+ active_unit = jj;
+ }
+ glBindTexture(GL_TEXTURE_2D_ARRAY, 0);
+ }
+ }
+
+ if (active_unit != active_texture_unit) {
+ glActiveTexture(GL_TEXTURE0 + active_texture_unit);
+ }
+}
+
// Include the auto-generated part of this file. We split this because it means
// we can easily edit the non-auto generated parts right here in this file
// instead of having to edit some template or the code generator.
@@ -506,5 +554,3 @@ void ContextState::RemoveBoundBuffer(Buffer* buffer) {
} // namespace gles2
} // namespace gpu
-
-
diff --git a/chromium/gpu/command_buffer/service/context_state.h b/chromium/gpu/command_buffer/service/context_state.h
index 88c9423d012..f9d4ff7b192 100644
--- a/chromium/gpu/command_buffer/service/context_state.h
+++ b/chromium/gpu/command_buffer/service/context_state.h
@@ -11,7 +11,6 @@
#include "base/logging.h"
#include "base/memory/scoped_ptr.h"
#include "gpu/command_buffer/service/gl_utils.h"
-#include "gpu/command_buffer/service/query_manager.h"
#include "gpu/command_buffer/service/texture_manager.h"
#include "gpu/command_buffer/service/valuebuffer_manager.h"
#include "gpu/command_buffer/service/vertex_attrib_manager.h"
@@ -26,6 +25,7 @@ class ErrorState;
class ErrorStateClient;
class FeatureInfo;
class Framebuffer;
+class Logger;
class Program;
class Renderbuffer;
@@ -81,24 +81,6 @@ struct GPU_EXPORT TextureUnit {
NOTREACHED();
return NULL;
}
-
- void Unbind(TextureRef* texture) {
- if (bound_texture_2d.get() == texture) {
- bound_texture_2d = NULL;
- }
- if (bound_texture_cube_map.get() == texture) {
- bound_texture_cube_map = NULL;
- }
- if (bound_texture_external_oes.get() == texture) {
- bound_texture_external_oes = NULL;
- }
- if (bound_texture_3d.get() == texture) {
- bound_texture_3d = NULL;
- }
- if (bound_texture_2d_array.get() == texture) {
- bound_texture_2d_array = NULL;
- }
- }
};
class GPU_EXPORT Vec4 {
@@ -234,6 +216,8 @@ struct GPU_EXPORT ContextState {
void SetBoundBuffer(GLenum target, Buffer* buffer);
void RemoveBoundBuffer(Buffer* buffer);
+ void UnbindTexture(TextureRef* texture);
+
#include "gpu/command_buffer/service/context_state_autogen.h"
EnableFlags enable_flags;
@@ -274,10 +258,6 @@ struct GPU_EXPORT ContextState {
// The currently bound valuebuffer
scoped_refptr<Valuebuffer> bound_valuebuffer;
- // A map of of target -> Query for current queries
- typedef std::map<GLuint, scoped_refptr<QueryManager::Query> > QueryMap;
- QueryMap current_queries;
-
bool pack_reverse_row_order;
bool ignore_cached_state;
diff --git a/chromium/gpu/command_buffer/service/context_state_autogen.h b/chromium/gpu/command_buffer/service/context_state_autogen.h
index e2b65bf5d50..7ca2faafcf7 100644
--- a/chromium/gpu/command_buffer/service/context_state_autogen.h
+++ b/chromium/gpu/command_buffer/service/context_state_autogen.h
@@ -74,6 +74,9 @@ GLenum hint_fragment_shader_derivative;
GLfloat line_width;
GLfloat modelview_matrix[16];
GLfloat projection_matrix[16];
+GLenum stencil_path_func;
+GLint stencil_path_ref;
+GLuint stencil_path_mask;
GLint pack_alignment;
GLint unpack_alignment;
GLfloat polygon_offset_factor;
diff --git a/chromium/gpu/command_buffer/service/context_state_impl_autogen.h b/chromium/gpu/command_buffer/service/context_state_impl_autogen.h
index fa5462f0460..450f0e295e0 100644
--- a/chromium/gpu/command_buffer/service/context_state_impl_autogen.h
+++ b/chromium/gpu/command_buffer/service/context_state_impl_autogen.h
@@ -34,8 +34,7 @@ ContextState::EnableFlags::EnableFlags()
rasterizer_discard(false),
cached_rasterizer_discard(false),
primitive_restart_fixed_index(false),
- cached_primitive_restart_fixed_index(false) {
-}
+ cached_primitive_restart_fixed_index(false) {}
void ContextState::Initialize() {
blend_color_red = 0.0f;
@@ -104,6 +103,9 @@ void ContextState::Initialize() {
projection_matrix[13] = 0.0f;
projection_matrix[14] = 0.0f;
projection_matrix[15] = 1.0f;
+ stencil_path_func = GL_ALWAYS;
+ stencil_path_ref = 0;
+ stencil_path_mask = 0xFFFFFFFFU;
pack_alignment = 4;
unpack_alignment = 4;
polygon_offset_factor = 0.0f;
@@ -276,6 +278,12 @@ void ContextState::InitState(const ContextState* prev_state) const {
glMatrixLoadfEXT(GL_PATH_PROJECTION_CHROMIUM, projection_matrix);
}
}
+ if (feature_info_->feature_flags().chromium_path_rendering)
+ if ((stencil_path_func != prev_state->stencil_path_func) ||
+ (stencil_path_ref != prev_state->stencil_path_ref) ||
+ (stencil_path_mask != prev_state->stencil_path_mask))
+ glPathStencilFuncNV(stencil_path_func, stencil_path_ref,
+ stencil_path_mask);
if (prev_state->pack_alignment != pack_alignment) {
glPixelStorei(GL_PACK_ALIGNMENT, pack_alignment);
}
@@ -355,6 +363,9 @@ void ContextState::InitState(const ContextState* prev_state) const {
if (feature_info_->feature_flags().chromium_path_rendering) {
glMatrixLoadfEXT(GL_PATH_PROJECTION_CHROMIUM, projection_matrix);
}
+ if (feature_info_->feature_flags().chromium_path_rendering)
+ glPathStencilFuncNV(stencil_path_func, stencil_path_ref,
+ stencil_path_mask);
glPixelStorei(GL_PACK_ALIGNMENT, pack_alignment);
glPixelStorei(GL_UNPACK_ALIGNMENT, unpack_alignment);
glPolygonOffset(polygon_offset_factor, polygon_offset_units);
@@ -547,6 +558,24 @@ bool ContextState::GetStateAsGLint(GLenum pname,
}
}
return true;
+ case GL_PATH_STENCIL_FUNC_CHROMIUM:
+ *num_written = 1;
+ if (params) {
+ params[0] = static_cast<GLint>(stencil_path_func);
+ }
+ return true;
+ case GL_PATH_STENCIL_REF_CHROMIUM:
+ *num_written = 1;
+ if (params) {
+ params[0] = static_cast<GLint>(stencil_path_ref);
+ }
+ return true;
+ case GL_PATH_STENCIL_VALUE_MASK_CHROMIUM:
+ *num_written = 1;
+ if (params) {
+ params[0] = static_cast<GLint>(stencil_path_mask);
+ }
+ return true;
case GL_PACK_ALIGNMENT:
*num_written = 1;
if (params) {
@@ -897,6 +926,24 @@ bool ContextState::GetStateAsGLfloat(GLenum pname,
memcpy(params, projection_matrix, sizeof(GLfloat) * 16);
}
return true;
+ case GL_PATH_STENCIL_FUNC_CHROMIUM:
+ *num_written = 1;
+ if (params) {
+ params[0] = static_cast<GLfloat>(stencil_path_func);
+ }
+ return true;
+ case GL_PATH_STENCIL_REF_CHROMIUM:
+ *num_written = 1;
+ if (params) {
+ params[0] = static_cast<GLfloat>(stencil_path_ref);
+ }
+ return true;
+ case GL_PATH_STENCIL_VALUE_MASK_CHROMIUM:
+ *num_written = 1;
+ if (params) {
+ params[0] = static_cast<GLfloat>(stencil_path_mask);
+ }
+ return true;
case GL_PACK_ALIGNMENT:
*num_written = 1;
if (params) {
diff --git a/chromium/gpu/command_buffer/service/disk_cache_proto.proto b/chromium/gpu/command_buffer/service/disk_cache_proto.proto
index ab3bb57a1b6..b1059a63386 100644
--- a/chromium/gpu/command_buffer/service/disk_cache_proto.proto
+++ b/chromium/gpu/command_buffer/service/disk_cache_proto.proto
@@ -1,3 +1,4 @@
+syntax = "proto2";
option optimize_for = LITE_RUNTIME;
message ShaderVariableProto {
diff --git a/chromium/gpu/command_buffer/service/feature_info.cc b/chromium/gpu/command_buffer/service/feature_info.cc
index 0ce99809114..b781b9651b9 100644
--- a/chromium/gpu/command_buffer/service/feature_info.cc
+++ b/chromium/gpu/command_buffer/service/feature_info.cc
@@ -5,19 +5,20 @@
#include "gpu/command_buffer/service/feature_info.h"
#include <set>
+#include <vector>
#include "base/command_line.h"
-#include "base/macros.h"
-#include "base/metrics/histogram.h"
+#include "base/metrics/histogram_macros.h"
#include "base/strings/string_number_conversions.h"
#include "base/strings/string_split.h"
-#include "base/strings/string_util.h"
-#include "gpu/command_buffer/service/gl_utils.h"
#include "gpu/command_buffer/service/gpu_switches.h"
#include "gpu/command_buffer/service/texture_definition.h"
#include "gpu/config/gpu_switches.h"
+#include "ui/gl/gl_bindings.h"
#include "ui/gl/gl_fence.h"
#include "ui/gl/gl_implementation.h"
+#include "ui/gl/gl_switches.h"
+#include "ui/gl/gl_version_info.h"
#if !defined(OS_MACOSX)
#include "ui/gl/gl_fence_egl.h"
@@ -82,11 +83,11 @@ class StringSet {
void StringToWorkarounds(
const std::string& types, FeatureInfo::Workarounds* workarounds) {
DCHECK(workarounds);
- std::vector<std::string> pieces;
- base::SplitString(types, ',', &pieces);
- for (size_t i = 0; i < pieces.size(); ++i) {
+ for (const base::StringPiece& piece :
+ base::SplitStringPiece(
+ types, ",", base::TRIM_WHITESPACE, base::SPLIT_WANT_ALL)) {
int number = 0;
- bool succeed = base::StringToInt(pieces[i], &number);
+ bool succeed = base::StringToInt(piece, &number);
DCHECK(succeed);
switch (number) {
#define GPU_OP(type, name) \
@@ -129,6 +130,7 @@ FeatureInfo::FeatureFlags::FeatureFlags()
use_core_framebuffer_multisample(false),
multisampled_render_to_texture(false),
use_img_for_multisampled_render_to_texture(false),
+ chromium_screen_space_antialiasing(false),
oes_standard_derivatives(false),
oes_egl_image_external(false),
oes_depth24(false),
@@ -145,6 +147,7 @@ FeatureInfo::FeatureFlags::FeatureFlags()
use_arb_occlusion_query2_for_occlusion_query_boolean(false),
use_arb_occlusion_query_for_occlusion_query_boolean(false),
native_vertex_array_object(false),
+ ext_texture_format_astc(false),
ext_texture_format_atc(false),
ext_texture_format_bgra8888(false),
ext_texture_format_dxt1(false),
@@ -166,10 +169,10 @@ FeatureInfo::FeatureFlags::FeatureFlags()
blend_equation_advanced(false),
blend_equation_advanced_coherent(false),
ext_texture_rg(false),
+ chromium_image_ycbcr_422(false),
enable_subscribe_uniform(false),
emulate_primitive_restart_fixed_index(false),
- ext_render_buffer_format_bgra8888(false) {
-}
+ ext_render_buffer_format_bgra8888(false) {}
FeatureInfo::Workarounds::Workarounds() :
#define GPU_OP(type, name) name(false),
@@ -184,46 +187,64 @@ FeatureInfo::Workarounds::Workarounds() :
}
FeatureInfo::FeatureInfo() {
- InitializeBasicState(*base::CommandLine::ForCurrentProcess());
+ InitializeBasicState(base::CommandLine::InitializedForCurrentProcess()
+ ? base::CommandLine::ForCurrentProcess()
+ : nullptr);
}
FeatureInfo::FeatureInfo(const base::CommandLine& command_line) {
- InitializeBasicState(command_line);
+ InitializeBasicState(&command_line);
}
-void FeatureInfo::InitializeBasicState(const base::CommandLine& command_line) {
- if (command_line.HasSwitch(switches::kGpuDriverBugWorkarounds)) {
- std::string types = command_line.GetSwitchValueASCII(
+void FeatureInfo::InitializeBasicState(const base::CommandLine* command_line) {
+ if (!command_line)
+ return;
+
+ if (command_line->HasSwitch(switches::kGpuDriverBugWorkarounds)) {
+ std::string types = command_line->GetSwitchValueASCII(
switches::kGpuDriverBugWorkarounds);
StringToWorkarounds(types, &workarounds_);
}
feature_flags_.enable_shader_name_hashing =
- !command_line.HasSwitch(switches::kDisableShaderNameHashing);
+ !command_line->HasSwitch(switches::kDisableShaderNameHashing);
feature_flags_.is_swiftshader =
- (command_line.GetSwitchValueASCII(switches::kUseGL) == "swiftshader");
+ (command_line->GetSwitchValueASCII(switches::kUseGL) == "swiftshader");
feature_flags_.enable_subscribe_uniform =
- command_line.HasSwitch(switches::kEnableSubscribeUniformExtension);
+ command_line->HasSwitch(switches::kEnableSubscribeUniformExtension);
enable_unsafe_es3_apis_switch_ =
- command_line.HasSwitch(switches::kEnableUnsafeES3APIs);
+ command_line->HasSwitch(switches::kEnableUnsafeES3APIs);
+
+ enable_gl_path_rendering_switch_ =
+ command_line->HasSwitch(switches::kEnableGLPathRendering);
+
+ // 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
+ // target context GLSL, etc.
+ // The flag here is for testing only.
+ disable_shader_translator_ =
+ command_line->HasSwitch(switches::kDisableGLSLTranslator);
unsafe_es3_apis_enabled_ = false;
-}
-bool FeatureInfo::Initialize() {
- disallowed_features_ = DisallowedFeatures();
- InitializeFeatures();
- return true;
+ // Default context_type_ to a GLES2 Context.
+ context_type_ = CONTEXT_TYPE_OPENGLES2;
}
-bool FeatureInfo::Initialize(const DisallowedFeatures& disallowed_features) {
+bool FeatureInfo::Initialize(ContextType context_type,
+ const DisallowedFeatures& disallowed_features) {
disallowed_features_ = disallowed_features;
+ context_type_ = context_type;
InitializeFeatures();
return true;
}
+bool FeatureInfo::InitializeForTesting() {
+ return Initialize(CONTEXT_TYPE_OPENGLES2, DisallowedFeatures());
+}
+
bool IsGL_REDSupportedOnFBOs() {
// Skia uses GL_RED with frame buffers, unfortunately, Mesa claims to support
// GL_EXT_texture_rg, but it doesn't support it on frame buffers. To fix
@@ -259,30 +280,10 @@ bool IsGL_REDSupportedOnFBOs() {
void FeatureInfo::InitializeFeatures() {
// Figure out what extensions to turn on.
- StringSet extensions;
- // We need to figure out how to query the extension string before we
- // have a GLVersionInfo available.
+ StringSet extensions(gfx::GetGLExtensionsFromCurrentContext());
+
const char* version_str =
reinterpret_cast<const char*>(glGetString(GL_VERSION));
- unsigned major_version, minor_version;
- bool is_es, is_es3;
- gfx::GLVersionInfo::ParseVersionString(
- version_str, &major_version, &minor_version, &is_es, &is_es3);
- if (!is_es && major_version >= 3) {
- std::vector<std::string> exts;
- GLint num_extensions = 0;
- glGetIntegerv(GL_NUM_EXTENSIONS, &num_extensions);
- for (GLint i = 0; i < num_extensions; ++i) {
- const char* extension = reinterpret_cast<const char*>(
- glGetStringi(GL_EXTENSIONS, i));
- DCHECK(extension != NULL);
- exts.push_back(extension);
- }
- extensions = exts;
- } else {
- extensions = reinterpret_cast<const char*>(glGetString(GL_EXTENSIONS));
- }
-
const char* renderer_str =
reinterpret_cast<const char*>(glGetString(GL_RENDERER));
@@ -350,6 +351,11 @@ void FeatureInfo::InitializeFeatures() {
GL_COMPRESSED_RGB_S3TC_DXT1_EXT);
validators_.compressed_texture_format.AddValue(
GL_COMPRESSED_RGBA_S3TC_DXT1_EXT);
+
+ validators_.texture_internal_format_storage.AddValue(
+ GL_COMPRESSED_RGB_S3TC_DXT1_EXT);
+ validators_.texture_internal_format_storage.AddValue(
+ GL_COMPRESSED_RGBA_S3TC_DXT1_EXT);
}
if (enable_dxt3) {
@@ -359,6 +365,8 @@ void FeatureInfo::InitializeFeatures() {
AddExtensionString("GL_CHROMIUM_texture_compression_dxt3");
validators_.compressed_texture_format.AddValue(
GL_COMPRESSED_RGBA_S3TC_DXT3_EXT);
+ validators_.texture_internal_format_storage.AddValue(
+ GL_COMPRESSED_RGBA_S3TC_DXT3_EXT);
}
if (enable_dxt5) {
@@ -370,6 +378,26 @@ void FeatureInfo::InitializeFeatures() {
AddExtensionString("GL_CHROMIUM_texture_compression_dxt5");
validators_.compressed_texture_format.AddValue(
GL_COMPRESSED_RGBA_S3TC_DXT5_EXT);
+ validators_.texture_internal_format_storage.AddValue(
+ GL_COMPRESSED_RGBA_S3TC_DXT5_EXT);
+ }
+
+ bool have_astc = extensions.Contains("GL_KHR_texture_compression_astc_ldr");
+ if (have_astc) {
+ feature_flags_.ext_texture_format_astc = true;
+ AddExtensionString("GL_KHR_texture_compression_astc_ldr");
+
+ // GL_COMPRESSED_RGBA_ASTC(0x93B0 ~ 0x93BD)
+ GLint astc_format_it = GL_COMPRESSED_RGBA_ASTC_4x4_KHR;
+ GLint astc_format_max = GL_COMPRESSED_RGBA_ASTC_12x12_KHR;
+ for (; astc_format_it <= astc_format_max; astc_format_it++)
+ validators_.compressed_texture_format.AddValue(astc_format_it);
+
+ // GL_COMPRESSED_SRGB8_ALPHA8_ASTC(0x93D0 ~ 0x93DD)
+ astc_format_it = GL_COMPRESSED_SRGB8_ALPHA8_ASTC_4x4_KHR;
+ astc_format_max = GL_COMPRESSED_SRGB8_ALPHA8_ASTC_12x12_KHR;
+ for (; astc_format_it <= astc_format_max; astc_format_it++)
+ validators_.compressed_texture_format.AddValue(astc_format_it);
}
bool have_atc = extensions.Contains("GL_AMD_compressed_ATC_texture") ||
@@ -381,6 +409,10 @@ void FeatureInfo::InitializeFeatures() {
validators_.compressed_texture_format.AddValue(GL_ATC_RGB_AMD);
validators_.compressed_texture_format.AddValue(
GL_ATC_RGBA_INTERPOLATED_ALPHA_AMD);
+
+ validators_.texture_internal_format_storage.AddValue(GL_ATC_RGB_AMD);
+ validators_.texture_internal_format_storage.AddValue(
+ GL_ATC_RGBA_INTERPOLATED_ALPHA_AMD);
}
// Check if we should enable GL_EXT_texture_filter_anisotropic.
@@ -489,7 +521,7 @@ void FeatureInfo::InitializeFeatures() {
// Check if we should allow GL_EXT_texture_format_BGRA8888
if (extensions.Contains("GL_EXT_texture_format_BGRA8888") ||
enable_immutable_texture_format_bgra_on_es3 ||
- extensions.Contains("GL_EXT_bgra")) {
+ !gl_version_info_->is_es) {
enable_texture_format_bgra8888 = true;
}
@@ -516,6 +548,15 @@ void FeatureInfo::InitializeFeatures() {
validators_.read_pixel_format.AddValue(GL_BGRA_EXT);
}
+ // We only support timer queries if we also support glGetInteger64v.
+ // For GL_EXT_disjoint_timer_query, glGetInteger64v is only support under ES3.
+ if ((gl_version_info_->is_es3 &&
+ extensions.Contains("GL_EXT_disjoint_timer_query")) ||
+ extensions.Contains("GL_ARB_timer_query") ||
+ extensions.Contains("GL_EXT_timer_query")) {
+ AddExtensionString("GL_EXT_disjoint_timer_query");
+ }
+
if (enable_render_buffer_bgra) {
feature_flags_.ext_render_buffer_format_bgra8888 = true;
AddExtensionString("GL_CHROMIUM_renderbuffer_format_BGRA8888");
@@ -657,7 +698,15 @@ void FeatureInfo::InitializeFeatures() {
}
// Check for multisample support
- if (!workarounds_.disable_chromium_framebuffer_multisample) {
+
+ // crbug.com/527565 - On some GPUs, MSAA does not perform acceptably for
+ // rasterization. We disable it on non-WebGL contexts. For WebGL contexts
+ // we leave it up to the site to decide whether to enable MSAA.
+ bool disable_all_multisample =
+ workarounds_.disable_msaa_on_non_webgl_contexts && !IsWebGLContext();
+
+ if (!disable_all_multisample &&
+ !workarounds_.disable_chromium_framebuffer_multisample) {
bool ext_has_multisample =
extensions.Contains("GL_EXT_framebuffer_multisample") ||
gl_version_info_->is_es3 ||
@@ -679,7 +728,8 @@ void FeatureInfo::InitializeFeatures() {
}
}
- if (!workarounds_.disable_multisampled_render_to_texture) {
+ if (!disable_all_multisample &&
+ !workarounds_.disable_multisampled_render_to_texture) {
if (extensions.Contains("GL_EXT_multisampled_render_to_texture")) {
feature_flags_.multisampled_render_to_texture = true;
} else if (extensions.Contains("GL_IMG_multisampled_render_to_texture")) {
@@ -696,6 +746,11 @@ void FeatureInfo::InitializeFeatures() {
}
}
+ if (extensions.Contains("GL_INTEL_framebuffer_CMAA")) {
+ feature_flags_.chromium_screen_space_antialiasing = true;
+ AddExtensionString("GL_CHROMIUM_screen_space_antialiasing");
+ }
+
if (extensions.Contains("GL_OES_depth24") || gfx::HasDesktopGLFeatures() ||
gl_version_info_->is_es3) {
AddExtensionString("GL_OES_depth24");
@@ -725,6 +780,7 @@ void FeatureInfo::InitializeFeatures() {
AddExtensionString("GL_OES_compressed_ETC1_RGB8_texture");
feature_flags_.oes_compressed_etc1_rgb8_texture = true;
validators_.compressed_texture_format.AddValue(GL_ETC1_RGB8_OES);
+ validators_.texture_internal_format_storage.AddValue(GL_ETC1_RGB8_OES);
}
if (extensions.Contains("GL_AMD_compressed_ATC_texture")) {
@@ -735,6 +791,13 @@ void FeatureInfo::InitializeFeatures() {
GL_ATC_RGBA_EXPLICIT_ALPHA_AMD);
validators_.compressed_texture_format.AddValue(
GL_ATC_RGBA_INTERPOLATED_ALPHA_AMD);
+
+ validators_.texture_internal_format_storage.AddValue(
+ GL_ATC_RGB_AMD);
+ validators_.texture_internal_format_storage.AddValue(
+ GL_ATC_RGBA_EXPLICIT_ALPHA_AMD);
+ validators_.texture_internal_format_storage.AddValue(
+ GL_ATC_RGBA_INTERPOLATED_ALPHA_AMD);
}
if (extensions.Contains("GL_IMG_texture_compression_pvrtc")) {
@@ -747,6 +810,15 @@ void FeatureInfo::InitializeFeatures() {
GL_COMPRESSED_RGBA_PVRTC_4BPPV1_IMG);
validators_.compressed_texture_format.AddValue(
GL_COMPRESSED_RGBA_PVRTC_2BPPV1_IMG);
+
+ validators_.texture_internal_format_storage.AddValue(
+ GL_COMPRESSED_RGB_PVRTC_4BPPV1_IMG);
+ validators_.texture_internal_format_storage.AddValue(
+ GL_COMPRESSED_RGB_PVRTC_2BPPV1_IMG);
+ validators_.texture_internal_format_storage.AddValue(
+ GL_COMPRESSED_RGBA_PVRTC_4BPPV1_IMG);
+ validators_.texture_internal_format_storage.AddValue(
+ GL_COMPRESSED_RGBA_PVRTC_2BPPV1_IMG);
}
// Ideally we would only expose this extension on Mac OS X, to
@@ -758,12 +830,11 @@ void FeatureInfo::InitializeFeatures() {
gl_version_info_->is_desktop_core_profile) {
AddExtensionString("GL_ARB_texture_rectangle");
feature_flags_.arb_texture_rectangle = true;
+ // Rectangle textures are used as samplers via glBindTexture, framebuffer
+ // textures via glFramebufferTexture2D, and copy destinations via
+ // glCopyPixels.
validators_.texture_bind_target.AddValue(GL_TEXTURE_RECTANGLE_ARB);
- // For the moment we don't add this enum to the texture_target
- // validator. This implies that the only way to get image data into a
- // rectangular texture is via glTexImageIOSurface2DCHROMIUM, which is
- // just fine since again we don't want applications depending on this
- // extension.
+ validators_.texture_target.AddValue(GL_TEXTURE_RECTANGLE_ARB);
validators_.get_tex_param_target.AddValue(GL_TEXTURE_RECTANGLE_ARB);
validators_.g_l_state.AddValue(GL_TEXTURE_BINDING_RECTANGLE_ARB);
}
@@ -772,6 +843,11 @@ void FeatureInfo::InitializeFeatures() {
AddExtensionString("GL_CHROMIUM_iosurface");
#endif
+ if (extensions.Contains("GL_APPLE_ycbcr_422")) {
+ AddExtensionString("GL_CHROMIUM_ycbcr_422_image");
+ feature_flags_.chromium_image_ycbcr_422 = true;
+ }
+
// TODO(gman): Add support for these extensions.
// GL_OES_depth32
@@ -803,10 +879,11 @@ void FeatureInfo::InitializeFeatures() {
enable_immutable_texture_format_bgra_on_es3) ||
(gl_version_info_->is_es3 &&
!enable_texture_format_bgra8888);
- if (extensions.Contains("GL_EXT_texture_storage") ||
- extensions.Contains("GL_ARB_texture_storage") ||
- support_texture_storage_on_es3 ||
- gl_version_info_->is_desktop_core_profile) {
+ if (!workarounds_.disable_texture_storage &&
+ (extensions.Contains("GL_EXT_texture_storage") ||
+ extensions.Contains("GL_ARB_texture_storage") ||
+ support_texture_storage_on_es3 ||
+ gl_version_info_->is_desktop_core_profile)) {
feature_flags_.ext_texture_storage = true;
AddExtensionString("GL_EXT_texture_storage");
validators_.texture_parameter.AddValue(GL_TEXTURE_IMMUTABLE_FORMAT_EXT);
@@ -1004,14 +1081,18 @@ void FeatureInfo::InitializeFeatures() {
}
}
- if (extensions.Contains("GL_NV_path_rendering")) {
- if (extensions.Contains("GL_EXT_direct_state_access") ||
- gl_version_info_->is_es3) {
- AddExtensionString("GL_CHROMIUM_path_rendering");
- feature_flags_.chromium_path_rendering = true;
- validators_.g_l_state.AddValue(GL_PATH_MODELVIEW_MATRIX_CHROMIUM);
- validators_.g_l_state.AddValue(GL_PATH_PROJECTION_MATRIX_CHROMIUM);
- }
+ if (enable_gl_path_rendering_switch_ &&
+ !workarounds_.disable_gl_path_rendering &&
+ extensions.Contains("GL_NV_path_rendering") &&
+ (extensions.Contains("GL_EXT_direct_state_access") ||
+ gl_version_info_->is_es3)) {
+ AddExtensionString("GL_CHROMIUM_path_rendering");
+ feature_flags_.chromium_path_rendering = true;
+ validators_.g_l_state.AddValue(GL_PATH_MODELVIEW_MATRIX_CHROMIUM);
+ validators_.g_l_state.AddValue(GL_PATH_PROJECTION_MATRIX_CHROMIUM);
+ validators_.g_l_state.AddValue(GL_PATH_STENCIL_FUNC_CHROMIUM);
+ validators_.g_l_state.AddValue(GL_PATH_STENCIL_REF_CHROMIUM);
+ validators_.g_l_state.AddValue(GL_PATH_STENCIL_VALUE_MASK_CHROMIUM);
}
if ((gl_version_info_->is_es3 || gl_version_info_->is_desktop_core_profile ||
@@ -1121,6 +1202,21 @@ void FeatureInfo::EnableES3Validators() {
unsafe_es3_apis_enabled_ = true;
}
+bool FeatureInfo::IsWebGLContext() const {
+ // Switch statement to cause a compile-time error if we miss a case.
+ switch (context_type_) {
+ case CONTEXT_TYPE_WEBGL1:
+ case CONTEXT_TYPE_WEBGL2:
+ return true;
+ case CONTEXT_TYPE_OPENGLES2:
+ case CONTEXT_TYPE_OPENGLES3:
+ return false;
+ }
+
+ NOTREACHED();
+ return false;
+}
+
void FeatureInfo::AddExtensionString(const char* s) {
std::string str(s);
size_t pos = extensions_.find(str);
diff --git a/chromium/gpu/command_buffer/service/feature_info.h b/chromium/gpu/command_buffer/service/feature_info.h
index 1ebff2a02a1..653afd9c498 100644
--- a/chromium/gpu/command_buffer/service/feature_info.h
+++ b/chromium/gpu/command_buffer/service/feature_info.h
@@ -5,21 +5,23 @@
#ifndef GPU_COMMAND_BUFFER_SERVICE_FEATURE_INFO_H_
#define GPU_COMMAND_BUFFER_SERVICE_FEATURE_INFO_H_
-#include <set>
#include <string>
-#include "base/containers/hash_tables.h"
+#include "base/macros.h"
#include "base/memory/ref_counted.h"
-#include "base/sys_info.h"
+#include "base/memory/scoped_ptr.h"
#include "gpu/command_buffer/service/gles2_cmd_decoder.h"
#include "gpu/command_buffer/service/gles2_cmd_validation.h"
#include "gpu/config/gpu_driver_bug_workaround_type.h"
#include "gpu/gpu_export.h"
-#include "ui/gl/gl_version_info.h"
namespace base {
class CommandLine;
}
+namespace gfx {
+struct GLVersionInfo;
+}
+
namespace gpu {
namespace gles2 {
@@ -40,6 +42,7 @@ class GPU_EXPORT FeatureInfo : public base::RefCounted<FeatureInfo> {
bool multisampled_render_to_texture;
// Use the IMG GLenum values and functions rather than EXT.
bool use_img_for_multisampled_render_to_texture;
+ bool chromium_screen_space_antialiasing;
bool oes_standard_derivatives;
bool oes_egl_image_external;
bool oes_depth24;
@@ -56,6 +59,7 @@ class GPU_EXPORT FeatureInfo : public base::RefCounted<FeatureInfo> {
bool use_arb_occlusion_query2_for_occlusion_query_boolean;
bool use_arb_occlusion_query_for_occlusion_query_boolean;
bool native_vertex_array_object;
+ bool ext_texture_format_astc;
bool ext_texture_format_atc;
bool ext_texture_format_bgra8888;
bool ext_texture_format_dxt1;
@@ -77,6 +81,7 @@ class GPU_EXPORT FeatureInfo : public base::RefCounted<FeatureInfo> {
bool blend_equation_advanced;
bool blend_equation_advanced_coherent;
bool ext_texture_rg;
+ bool chromium_image_ycbcr_422;
bool enable_subscribe_uniform;
bool emulate_primitive_restart_fixed_index;
bool ext_render_buffer_format_bgra8888;
@@ -105,13 +110,18 @@ class GPU_EXPORT FeatureInfo : public base::RefCounted<FeatureInfo> {
FeatureInfo(const base::CommandLine& command_line);
// Initializes the feature information. Needs a current GL context.
- bool Initialize();
- bool Initialize(const DisallowedFeatures& disallowed_features);
+ bool Initialize(ContextType context_type,
+ const DisallowedFeatures& disallowed_features);
+
+ // Helper that defaults to no disallowed features and a GLES2 context.
+ bool InitializeForTesting();
const Validators* validators() const {
return &validators_;
}
+ ContextType context_type() const { return context_type_; }
+
const std::string& extensions() const {
return extensions_;
}
@@ -136,6 +146,10 @@ class GPU_EXPORT FeatureInfo : public base::RefCounted<FeatureInfo> {
return unsafe_es3_apis_enabled_;
}
+ bool disable_shader_translator() const { return disable_shader_translator_; }
+
+ bool IsWebGLContext() const;
+
private:
friend class base::RefCounted<FeatureInfo>;
friend class BufferManagerClientSideArraysTest;
@@ -143,13 +157,15 @@ class GPU_EXPORT FeatureInfo : public base::RefCounted<FeatureInfo> {
~FeatureInfo();
void AddExtensionString(const char* s);
- void InitializeBasicState(const base::CommandLine& command_line);
+ void InitializeBasicState(const base::CommandLine* command_line);
void InitializeFeatures();
Validators validators_;
DisallowedFeatures disallowed_features_;
+ ContextType context_type_;
+
// The extensions string returned by glGetString(GL_EXTENSIONS);
std::string extensions_;
@@ -164,6 +180,10 @@ class GPU_EXPORT FeatureInfo : public base::RefCounted<FeatureInfo> {
bool unsafe_es3_apis_enabled_;
+ // Whether the command line switch kEnableGLPathRendering is passed in.
+ bool enable_gl_path_rendering_switch_;
+
+ bool disable_shader_translator_;
scoped_ptr<gfx::GLVersionInfo> gl_version_info_;
DISALLOW_COPY_AND_ASSIGN(FeatureInfo);
diff --git a/chromium/gpu/command_buffer/service/feature_info_unittest.cc b/chromium/gpu/command_buffer/service/feature_info_unittest.cc
index fdff1754715..bb616ac805b 100644
--- a/chromium/gpu/command_buffer/service/feature_info_unittest.cc
+++ b/chromium/gpu/command_buffer/service/feature_info_unittest.cc
@@ -8,6 +8,7 @@
#include "base/memory/scoped_ptr.h"
#include "base/strings/string_number_conversions.h"
#include "gpu/command_buffer/service/gpu_service_test.h"
+#include "gpu/command_buffer/service/gpu_switches.h"
#include "gpu/command_buffer/service/test_helper.h"
#include "gpu/command_buffer/service/texture_manager.h"
#include "gpu/config/gpu_driver_bug_workaround_type.h"
@@ -16,6 +17,7 @@
#include "ui/gl/gl_fence.h"
#include "ui/gl/gl_implementation.h"
#include "ui/gl/gl_mock.h"
+#include "ui/gl/gl_version_info.h"
using ::testing::_;
using ::testing::DoAll;
@@ -74,7 +76,32 @@ class FeatureInfoTest
TestHelper::SetupFeatureInfoInitExpectationsWithGLVersion(
gl_.get(), extensions, renderer, version);
info_ = new FeatureInfo();
- info_->Initialize();
+ info_->InitializeForTesting();
+ }
+
+ void SetupInitExpectationsWithGLVersionAndCommandLine(
+ const char* extensions,
+ const char* renderer,
+ const char* version,
+ const base::CommandLine& command_line) {
+ GpuServiceTest::SetUpWithGLVersion(version, extensions);
+ TestHelper::SetupFeatureInfoInitExpectationsWithGLVersion(
+ gl_.get(), extensions, renderer, version);
+ info_ = new FeatureInfo(command_line);
+ info_->InitializeForTesting();
+ }
+
+ void SetupInitExpectationsWithGLVersionAndContextTypeAndCommandLine(
+ const char* extensions,
+ const char* renderer,
+ const char* version,
+ ContextType context_type,
+ const base::CommandLine& command_line) {
+ GpuServiceTest::SetUpWithGLVersion(version, extensions);
+ TestHelper::SetupFeatureInfoInitExpectationsWithGLVersion(
+ gl_.get(), extensions, renderer, version);
+ info_ = new FeatureInfo(command_line);
+ info_->Initialize(context_type, DisallowedFeatures());
}
void SetupWithCommandLine(const base::CommandLine& command_line) {
@@ -89,7 +116,7 @@ class FeatureInfoTest
TestHelper::SetupFeatureInfoInitExpectationsWithGLVersion(
gl_.get(), extensions, "", "");
info_ = new FeatureInfo(command_line);
- info_->Initialize();
+ info_->InitializeForTesting();
}
void SetupWithoutInit() {
@@ -279,6 +306,7 @@ TEST_P(FeatureInfoTest, InitializeNoExtensions) {
GL_SRGB8_ALPHA8_EXT));
EXPECT_FALSE(info_->validators()->frame_buffer_parameter.IsValid(
GL_FRAMEBUFFER_ATTACHMENT_COLOR_ENCODING_EXT));
+ EXPECT_FALSE(info_->feature_flags().chromium_image_ycbcr_422);
}
TEST_P(FeatureInfoTest, InitializeWithANGLE) {
@@ -375,8 +403,9 @@ TEST_P(FeatureInfoTest, InitializeEXT_texture_format_BGRA8888Apple) {
EXPECT_FALSE(info_->feature_flags().ext_render_buffer_format_bgra8888);
}
-TEST_P(FeatureInfoTest, InitializeEXT_read_format_bgra) {
- SetupInitExpectations("GL_EXT_read_format_bgra");
+TEST_P(FeatureInfoTest, InitializeGLES2EXT_read_format_bgra) {
+ SetupInitExpectationsWithGLVersion(
+ "GL_EXT_read_format_bgra", "", "OpenGL ES 2.0");
EXPECT_THAT(info_->extensions(),
HasSubstr("GL_EXT_read_format_bgra"));
EXPECT_FALSE(info_->validators()->texture_format.IsValid(
@@ -390,6 +419,21 @@ TEST_P(FeatureInfoTest, InitializeEXT_read_format_bgra) {
EXPECT_FALSE(info_->feature_flags().ext_render_buffer_format_bgra8888);
}
+TEST_P(FeatureInfoTest, InitializeEXT_read_format_bgra) {
+ SetupInitExpectations("GL_EXT_read_format_bgra");
+ EXPECT_THAT(info_->extensions(),
+ HasSubstr("GL_EXT_read_format_bgra"));
+ EXPECT_TRUE(info_->validators()->texture_format.IsValid(
+ GL_BGRA_EXT));
+ EXPECT_TRUE(info_->validators()->texture_internal_format.IsValid(
+ GL_BGRA_EXT));
+ EXPECT_TRUE(info_->validators()->read_pixel_format.IsValid(
+ GL_BGRA_EXT));
+ EXPECT_FALSE(info_->validators()->render_buffer_format.IsValid(
+ GL_BGRA8_EXT));
+ EXPECT_FALSE(info_->feature_flags().ext_render_buffer_format_bgra8888);
+}
+
TEST_P(FeatureInfoTest, InitializeEXT_sRGB) {
SetupInitExpectations("GL_EXT_sRGB GL_OES_rgb8_rgba8");
EXPECT_THAT(info_->extensions(),
@@ -408,13 +452,44 @@ TEST_P(FeatureInfoTest, InitializeEXT_sRGB) {
GL_FRAMEBUFFER_ATTACHMENT_COLOR_ENCODING_EXT));
}
+TEST_P(FeatureInfoTest, InitializeGLES2EXT_texture_storage) {
+ SetupInitExpectationsWithGLVersion(
+ "GL_EXT_texture_storage", "", "OpenGL ES 2.0");
+ EXPECT_TRUE(info_->feature_flags().ext_texture_storage);
+ EXPECT_THAT(info_->extensions(), HasSubstr("GL_EXT_texture_storage"));
+ EXPECT_TRUE(info_->validators()->texture_parameter.IsValid(
+ GL_TEXTURE_IMMUTABLE_FORMAT_EXT));
+ EXPECT_FALSE(info_->validators()->texture_internal_format_storage.IsValid(
+ GL_BGRA8_EXT));
+ EXPECT_FALSE(info_->validators()->texture_internal_format_storage.IsValid(
+ GL_RGBA32F_EXT));
+ EXPECT_FALSE(info_->validators()->texture_internal_format_storage.IsValid(
+ GL_RGB32F_EXT));
+ EXPECT_FALSE(info_->validators()->texture_internal_format_storage.IsValid(
+ GL_ALPHA32F_EXT));
+ EXPECT_FALSE(info_->validators()->texture_internal_format_storage.IsValid(
+ GL_LUMINANCE32F_EXT));
+ EXPECT_FALSE(info_->validators()->texture_internal_format_storage.IsValid(
+ GL_LUMINANCE_ALPHA32F_EXT));
+ EXPECT_FALSE(info_->validators()->texture_internal_format_storage.IsValid(
+ GL_RGBA16F_EXT));
+ EXPECT_FALSE(info_->validators()->texture_internal_format_storage.IsValid(
+ GL_RGB16F_EXT));
+ EXPECT_FALSE(info_->validators()->texture_internal_format_storage.IsValid(
+ GL_ALPHA16F_EXT));
+ EXPECT_FALSE(info_->validators()->texture_internal_format_storage.IsValid(
+ GL_LUMINANCE16F_EXT));
+ EXPECT_FALSE(info_->validators()->texture_internal_format_storage.IsValid(
+ GL_LUMINANCE_ALPHA16F_EXT));
+}
+
TEST_P(FeatureInfoTest, InitializeEXT_texture_storage) {
SetupInitExpectations("GL_EXT_texture_storage");
EXPECT_TRUE(info_->feature_flags().ext_texture_storage);
EXPECT_THAT(info_->extensions(), HasSubstr("GL_EXT_texture_storage"));
EXPECT_TRUE(info_->validators()->texture_parameter.IsValid(
GL_TEXTURE_IMMUTABLE_FORMAT_EXT));
- EXPECT_FALSE(info_->validators()->texture_internal_format_storage.IsValid(
+ EXPECT_TRUE(info_->validators()->texture_internal_format_storage.IsValid(
GL_BGRA8_EXT));
EXPECT_FALSE(info_->validators()->texture_internal_format_storage.IsValid(
GL_RGBA32F_EXT));
@@ -1191,31 +1266,49 @@ TEST_P(FeatureInfoTest, BlendEquationAdvancedDisabled) {
EXPECT_FALSE(info_->feature_flags().blend_equation_advanced_coherent);
}
-TEST_P(FeatureInfoTest, InitializeCHROMIUM_path_rendering) {
+TEST_P(FeatureInfoTest, InitializeCHROMIUM_path_rendering_no_cmdline_switch) {
SetupInitExpectationsWithGLVersion(
"GL_ARB_compatibility GL_NV_path_rendering GL_EXT_direct_state_access",
"", "4.3");
+ EXPECT_FALSE(info_->feature_flags().chromium_path_rendering);
+ EXPECT_THAT(info_->extensions(),
+ Not(HasSubstr("GL_CHROMIUM_path_rendering")));
+}
+
+TEST_P(FeatureInfoTest, InitializeCHROMIUM_path_rendering) {
+ base::CommandLine command_line(0, NULL);
+ command_line.AppendSwitch(switches::kEnableGLPathRendering);
+ SetupInitExpectationsWithGLVersionAndCommandLine(
+ "GL_ARB_compatibility GL_NV_path_rendering GL_EXT_direct_state_access",
+ "", "4.3", command_line);
EXPECT_TRUE(info_->feature_flags().chromium_path_rendering);
EXPECT_THAT(info_->extensions(), HasSubstr("GL_CHROMIUM_path_rendering"));
}
TEST_P(FeatureInfoTest, InitializeCHROMIUM_path_rendering2) {
- SetupInitExpectationsWithGLVersion(
- "GL_NV_path_rendering", "", "OpenGL ES 3.1");
+ base::CommandLine command_line(0, NULL);
+ command_line.AppendSwitch(switches::kEnableGLPathRendering);
+ SetupInitExpectationsWithGLVersionAndCommandLine(
+ "GL_NV_path_rendering", "", "OpenGL ES 3.1", command_line);
EXPECT_TRUE(info_->feature_flags().chromium_path_rendering);
EXPECT_THAT(info_->extensions(), HasSubstr("GL_CHROMIUM_path_rendering"));
}
TEST_P(FeatureInfoTest, InitializeNoCHROMIUM_path_rendering) {
- SetupInitExpectationsWithGLVersion("GL_ARB_compatibility", "", "4.3");
+ base::CommandLine command_line(0, NULL);
+ command_line.AppendSwitch(switches::kEnableGLPathRendering);
+ SetupInitExpectationsWithGLVersionAndCommandLine("GL_ARB_compatibility", "",
+ "4.3", command_line);
EXPECT_FALSE(info_->feature_flags().chromium_path_rendering);
EXPECT_THAT(info_->extensions(),
Not(HasSubstr("GL_CHROMIUM_path_rendering")));
}
TEST_P(FeatureInfoTest, InitializeNoCHROMIUM_path_rendering2) {
- SetupInitExpectationsWithGLVersion(
- "GL_ARB_compatibility GL_NV_path_rendering", "", "4.3");
+ base::CommandLine command_line(0, NULL);
+ command_line.AppendSwitch(switches::kEnableGLPathRendering);
+ SetupInitExpectationsWithGLVersionAndCommandLine(
+ "GL_ARB_compatibility GL_NV_path_rendering", "", "4.3", command_line);
EXPECT_FALSE(info_->feature_flags().chromium_path_rendering);
EXPECT_THAT(info_->extensions(),
Not(HasSubstr("GL_CHROMIUM_path_rendering")));
@@ -1284,5 +1377,34 @@ TEST_P(FeatureInfoTest, InitializeARB_texture_rgNoFloat) {
EXPECT_TRUE(info_->validators()->render_buffer_format.IsValid(GL_RG8_EXT));
}
+TEST_P(FeatureInfoTest, InitializeCHROMIUM_ycbcr_422_imageTrue) {
+ SetupInitExpectations("GL_APPLE_ycbcr_422");
+ EXPECT_TRUE(info_->feature_flags().chromium_image_ycbcr_422);
+}
+
+TEST_P(FeatureInfoTest, DisableMsaaOnNonWebGLContexts) {
+ base::CommandLine command_line(0, NULL);
+ command_line.AppendSwitchASCII(
+ switches::kGpuDriverBugWorkarounds,
+ base::IntToString(gpu::DISABLE_MSAA_ON_NON_WEBGL_CONTEXTS));
+ SetupInitExpectationsWithGLVersionAndContextTypeAndCommandLine(
+ "GL_EXT_multisampled_render_to_texture GL_EXT_framebuffer_multisample",
+ "", "", CONTEXT_TYPE_OPENGLES2, command_line);
+ EXPECT_FALSE(info_->feature_flags().multisampled_render_to_texture);
+ EXPECT_FALSE(info_->feature_flags().chromium_framebuffer_multisample);
+}
+
+TEST_P(FeatureInfoTest, DontDisableMsaaOnWebGLContexts) {
+ base::CommandLine command_line(0, NULL);
+ command_line.AppendSwitchASCII(
+ switches::kGpuDriverBugWorkarounds,
+ base::IntToString(gpu::DISABLE_MSAA_ON_NON_WEBGL_CONTEXTS));
+ SetupInitExpectationsWithGLVersionAndContextTypeAndCommandLine(
+ "GL_EXT_multisampled_render_to_texture GL_EXT_framebuffer_multisample",
+ "", "", CONTEXT_TYPE_WEBGL1, command_line);
+ EXPECT_TRUE(info_->feature_flags().multisampled_render_to_texture);
+ EXPECT_TRUE(info_->feature_flags().chromium_framebuffer_multisample);
+}
+
} // namespace gles2
} // namespace gpu
diff --git a/chromium/gpu/command_buffer/service/framebuffer_completeness_cache.cc b/chromium/gpu/command_buffer/service/framebuffer_completeness_cache.cc
new file mode 100644
index 00000000000..183b023314f
--- /dev/null
+++ b/chromium/gpu/command_buffer/service/framebuffer_completeness_cache.cc
@@ -0,0 +1,24 @@
+// Copyright 2015 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/command_buffer/service/framebuffer_completeness_cache.h"
+
+namespace gpu {
+namespace gles2 {
+
+FramebufferCompletenessCache::FramebufferCompletenessCache() {}
+
+FramebufferCompletenessCache::~FramebufferCompletenessCache() {}
+
+bool FramebufferCompletenessCache::IsComplete(
+ const std::string& signature) const {
+ return cache_.find(signature) != cache_.end();
+}
+
+void FramebufferCompletenessCache::SetComplete(const std::string& signature) {
+ cache_.insert(signature);
+}
+
+} // namespace gles2
+} // namespace gpu
diff --git a/chromium/gpu/command_buffer/service/framebuffer_completeness_cache.h b/chromium/gpu/command_buffer/service/framebuffer_completeness_cache.h
new file mode 100644
index 00000000000..7200cbdea66
--- /dev/null
+++ b/chromium/gpu/command_buffer/service/framebuffer_completeness_cache.h
@@ -0,0 +1,42 @@
+// Copyright 2015 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_COMMAND_BUFFER_SERVICE_FRAMEBUFFER_COMPLETENESS_CACHE_H_
+#define GPU_COMMAND_BUFFER_SERVICE_FRAMEBUFFER_COMPLETENESS_CACHE_H_
+
+#include "base/containers/hash_tables.h"
+#include "base/memory/ref_counted.h"
+#include "gpu/gpu_export.h"
+
+namespace gpu {
+namespace gles2 {
+
+// Refcounted wrapper for a hash_set of framebuffer format signatures
+// representing framebuffer configurations that are reported by the GL
+// driver as complete according to glCheckFramebufferStatusEXT.
+class GPU_EXPORT FramebufferCompletenessCache
+ : public base::RefCounted<FramebufferCompletenessCache> {
+ public:
+ FramebufferCompletenessCache();
+
+ bool IsComplete(const std::string& signature) const;
+ void SetComplete(const std::string& signature);
+
+ protected:
+ virtual ~FramebufferCompletenessCache();
+
+ private:
+ friend class base::RefCounted<FramebufferCompletenessCache>;
+
+ typedef base::hash_set<std::string> Map;
+
+ Map cache_;
+
+ DISALLOW_COPY_AND_ASSIGN(FramebufferCompletenessCache);
+};
+
+} // namespace gles2
+} // namespace gpu
+
+#endif // GPU_COMMAND_BUFFER_SERVICE_FRAMEBUFFER_COMPLETENESS_CACHE_H_
diff --git a/chromium/gpu/command_buffer/service/framebuffer_manager.cc b/chromium/gpu/command_buffer/service/framebuffer_manager.cc
index 173c2868ed0..b78a5dcb6bc 100644
--- a/chromium/gpu/command_buffer/service/framebuffer_manager.cc
+++ b/chromium/gpu/command_buffer/service/framebuffer_manager.cc
@@ -6,6 +6,7 @@
#include "base/logging.h"
#include "base/strings/stringprintf.h"
#include "gpu/command_buffer/common/gles2_cmd_utils.h"
+#include "gpu/command_buffer/service/framebuffer_completeness_cache.h"
#include "gpu/command_buffer/service/renderbuffer_manager.h"
#include "gpu/command_buffer/service/texture_manager.h"
#include "ui/gl/gl_bindings.h"
@@ -22,24 +23,6 @@ DecoderFramebufferState::DecoderFramebufferState()
DecoderFramebufferState::~DecoderFramebufferState() {
}
-Framebuffer::FramebufferComboCompleteMap*
- Framebuffer::framebuffer_combo_complete_map_;
-
-// Framebuffer completeness is not cacheable on OS X because of dynamic
-// graphics switching.
-// http://crbug.com/180876
-#if defined(OS_MACOSX)
-bool Framebuffer::allow_framebuffer_combo_complete_map_ = false;
-#else
-bool Framebuffer::allow_framebuffer_combo_complete_map_ = true;
-#endif
-
-void Framebuffer::ClearFramebufferCompleteComboMap() {
- if (framebuffer_combo_complete_map_) {
- framebuffer_combo_complete_map_->clear();
- }
-}
-
class RenderbufferAttachment
: public Framebuffer::Attachment {
public:
@@ -260,12 +243,18 @@ FramebufferManager::TextureDetachObserver::TextureDetachObserver() {}
FramebufferManager::TextureDetachObserver::~TextureDetachObserver() {}
FramebufferManager::FramebufferManager(
- uint32 max_draw_buffers, uint32 max_color_attachments)
+ uint32 max_draw_buffers,
+ uint32 max_color_attachments,
+ ContextType context_type,
+ const scoped_refptr<FramebufferCompletenessCache>&
+ framebuffer_combo_complete_cache)
: framebuffer_state_change_count_(1),
framebuffer_count_(0),
have_context_(true),
max_draw_buffers_(max_draw_buffers),
- max_color_attachments_(max_color_attachments) {
+ max_color_attachments_(max_color_attachments),
+ context_type_(context_type),
+ framebuffer_combo_complete_cache_(framebuffer_combo_complete_cache) {
DCHECK_GT(max_draw_buffers_, 0u);
DCHECK_GT(max_color_attachments_, 0u);
}
@@ -318,7 +307,8 @@ Framebuffer::Framebuffer(
deleted_(false),
service_id_(service_id),
has_been_bound_(false),
- framebuffer_complete_state_count_id_(0) {
+ framebuffer_complete_state_count_id_(0),
+ read_buffer_(GL_COLOR_ATTACHMENT0) {
manager->StartTracking(this);
DCHECK_GT(manager->max_draw_buffers_, 0u);
draw_buffers_.reset(new GLenum[manager->max_draw_buffers_]);
@@ -369,7 +359,8 @@ void Framebuffer::ChangeDrawBuffersHelper(bool recover) const {
for (AttachmentMap::const_iterator it = attachments_.begin();
it != attachments_.end(); ++it) {
if (it->first >= GL_COLOR_ATTACHMENT0 &&
- it->first < GL_COLOR_ATTACHMENT0 + manager_->max_draw_buffers_) {
+ it->first < GL_COLOR_ATTACHMENT0 + manager_->max_draw_buffers_ &&
+ !GLES2Util::IsIntegerFormat(it->second->internal_format())) {
buffers[it->first - GL_COLOR_ATTACHMENT0] = it->first;
}
}
@@ -398,6 +389,26 @@ void Framebuffer::RestoreDrawBuffersAfterClear() const {
ChangeDrawBuffersHelper(recover);
}
+void Framebuffer::ClearIntegerBuffers() {
+ for (AttachmentMap::const_iterator it = attachments_.begin();
+ it != attachments_.end(); ++it) {
+ GLenum internal_format = it->second->internal_format();
+ if (it->first >= GL_COLOR_ATTACHMENT0 &&
+ it->first < GL_COLOR_ATTACHMENT0 + manager_->max_draw_buffers_ &&
+ !it->second->cleared() &&
+ GLES2Util::IsIntegerFormat(internal_format)) {
+ GLint drawbuffer = it->first - GL_COLOR_ATTACHMENT0;
+ if (GLES2Util::IsUnsignedIntegerFormat(internal_format)) {
+ const static GLuint kZero[] = { 0u, 0u, 0u, 0u };
+ glClearBufferuiv(GL_COLOR, drawbuffer, kZero);
+ } else { // IsUnsignedIntegerFormat(internal_format)
+ const static GLint kZero[] = { 0, 0, 0, 0 };
+ glClearBufferiv(GL_COLOR, drawbuffer, kZero);
+ }
+ }
+ }
+}
+
void Framebuffer::MarkAttachmentAsCleared(
RenderbufferManager* renderbuffer_manager,
TextureManager* texture_manager,
@@ -437,8 +448,10 @@ bool Framebuffer::HasStencilAttachment() const {
attachments_.find(GL_STENCIL_ATTACHMENT) != attachments_.end();
}
-GLenum Framebuffer::GetColorAttachmentFormat() const {
- AttachmentMap::const_iterator it = attachments_.find(GL_COLOR_ATTACHMENT0);
+GLenum Framebuffer::GetReadBufferInternalFormat() const {
+ if (read_buffer_ == GL_NONE)
+ return 0;
+ AttachmentMap::const_iterator it = attachments_.find(read_buffer_);
if (it == attachments_.end()) {
return 0;
}
@@ -446,8 +459,10 @@ GLenum Framebuffer::GetColorAttachmentFormat() const {
return attachment->internal_format();
}
-GLenum Framebuffer::GetColorAttachmentTextureType() const {
- AttachmentMap::const_iterator it = attachments_.find(GL_COLOR_ATTACHMENT0);
+GLenum Framebuffer::GetReadBufferTextureType() const {
+ if (read_buffer_ == GL_NONE)
+ return 0;
+ AttachmentMap::const_iterator it = attachments_.find(read_buffer_);
if (it == attachments_.end()) {
return 0;
}
@@ -476,7 +491,9 @@ GLenum Framebuffer::IsPossiblyComplete() const {
if (width == 0 || height == 0) {
return GL_FRAMEBUFFER_INCOMPLETE_ATTACHMENT;
}
- } else {
+ } else if (manager_->context_type() != CONTEXT_TYPE_WEBGL2) {
+ // TODO(zmo): revisit this if we create ES3 contexts for clients other
+ // than WebGL 2.
if (attachment->width() != width || attachment->height() != height) {
return GL_FRAMEBUFFER_INCOMPLETE_DIMENSIONS_EXT;
}
@@ -494,46 +511,40 @@ GLenum Framebuffer::IsPossiblyComplete() const {
GLenum Framebuffer::GetStatus(
TextureManager* texture_manager, GLenum target) const {
+ if (!manager_->GetFramebufferComboCompleteCache()) {
+ return glCheckFramebufferStatusEXT(target);
+ }
// Check if we have this combo already.
std::string signature;
- if (allow_framebuffer_combo_complete_map_) {
- size_t signature_size = sizeof(target);
- for (AttachmentMap::const_iterator it = attachments_.begin();
- it != attachments_.end(); ++it) {
- Attachment* attachment = it->second.get();
- signature_size += sizeof(it->first) +
- attachment->GetSignatureSize(texture_manager);
- }
- signature.reserve(signature_size);
- signature.append(reinterpret_cast<const char*>(&target), sizeof(target));
+ size_t signature_size = sizeof(target);
+ for (AttachmentMap::const_iterator it = attachments_.begin();
+ it != attachments_.end(); ++it) {
+ Attachment* attachment = it->second.get();
+ signature_size +=
+ sizeof(it->first) + attachment->GetSignatureSize(texture_manager);
+ }
- for (AttachmentMap::const_iterator it = attachments_.begin();
- it != attachments_.end(); ++it) {
- Attachment* attachment = it->second.get();
- signature.append(reinterpret_cast<const char*>(&it->first),
- sizeof(it->first));
- attachment->AddToSignature(texture_manager, &signature);
- }
- DCHECK(signature.size() == signature_size);
+ signature.reserve(signature_size);
+ signature.append(reinterpret_cast<const char*>(&target), sizeof(target));
- if (!framebuffer_combo_complete_map_) {
- framebuffer_combo_complete_map_ = new FramebufferComboCompleteMap();
- }
+ for (AttachmentMap::const_iterator it = attachments_.begin();
+ it != attachments_.end(); ++it) {
+ Attachment* attachment = it->second.get();
+ signature.append(reinterpret_cast<const char*>(&it->first),
+ sizeof(it->first));
+ attachment->AddToSignature(texture_manager, &signature);
+ }
+ DCHECK(signature.size() == signature_size);
- FramebufferComboCompleteMap::const_iterator it =
- framebuffer_combo_complete_map_->find(signature);
- if (it != framebuffer_combo_complete_map_->end()) {
- return GL_FRAMEBUFFER_COMPLETE;
- }
+ if (manager_->GetFramebufferComboCompleteCache()->IsComplete(signature)) {
+ return GL_FRAMEBUFFER_COMPLETE;
}
GLenum result = glCheckFramebufferStatusEXT(target);
- // Insert the new result into the combo map.
- if (allow_framebuffer_combo_complete_map_ &&
- result == GL_FRAMEBUFFER_COMPLETE) {
- framebuffer_combo_complete_map_->insert(std::make_pair(signature, true));
+ if (result == GL_FRAMEBUFFER_COMPLETE) {
+ manager_->GetFramebufferComboCompleteCache()->SetComplete(signature);
}
return result;
@@ -579,6 +590,23 @@ bool Framebuffer::HasAlphaMRT() const {
return false;
}
+bool Framebuffer::HasSameInternalFormatsMRT() const {
+ GLenum internal_format = 0;
+ for (uint32 i = 0; i < manager_->max_draw_buffers_; ++i) {
+ if (draw_buffers_[i] != GL_NONE) {
+ const Attachment* attachment = GetAttachment(draw_buffers_[i]);
+ if (!attachment)
+ continue;
+ if (!internal_format) {
+ internal_format = attachment->internal_format();
+ } else if (internal_format != attachment->internal_format()) {
+ return false;
+ }
+ }
+ }
+ return true;
+}
+
void Framebuffer::UnbindRenderbuffer(
GLenum target, Renderbuffer* renderbuffer) {
bool done;
@@ -679,21 +707,31 @@ const Framebuffer::Attachment*
return NULL;
}
+const Framebuffer::Attachment* Framebuffer::GetReadBufferAttachment() const {
+ if (read_buffer_ == GL_NONE)
+ return nullptr;
+ return GetAttachment(read_buffer_);
+}
+
void Framebuffer::OnTextureRefDetached(TextureRef* texture) {
manager_->OnTextureRefDetached(texture);
}
-void Framebuffer::OnWillRenderTo() const {
+void Framebuffer::OnWillRenderTo(GLenum attachment) const {
for (AttachmentMap::const_iterator it = attachments_.begin();
it != attachments_.end(); ++it) {
- it->second->OnWillRenderTo();
+ if (attachment == 0 || attachment == it->first) {
+ it->second->OnWillRenderTo();
+ }
}
}
-void Framebuffer::OnDidRenderTo() const {
+void Framebuffer::OnDidRenderTo(GLenum attachment) const {
for (AttachmentMap::const_iterator it = attachments_.begin();
it != attachments_.end(); ++it) {
- it->second->OnDidRenderTo();
+ if (attachment == 0 || attachment == it->first) {
+ it->second->OnDidRenderTo();
+ }
}
}
@@ -746,5 +784,3 @@ void FramebufferManager::OnTextureRefDetached(TextureRef* texture) {
} // namespace gles2
} // namespace gpu
-
-
diff --git a/chromium/gpu/command_buffer/service/framebuffer_manager.h b/chromium/gpu/command_buffer/service/framebuffer_manager.h
index 75f7e2a7ec6..7216654e86c 100644
--- a/chromium/gpu/command_buffer/service/framebuffer_manager.h
+++ b/chromium/gpu/command_buffer/service/framebuffer_manager.h
@@ -11,12 +11,14 @@
#include "base/containers/hash_tables.h"
#include "base/memory/ref_counted.h"
#include "base/memory/scoped_ptr.h"
+#include "gpu/command_buffer/service/context_group.h"
#include "gpu/command_buffer/service/gl_utils.h"
#include "gpu/gpu_export.h"
namespace gpu {
namespace gles2 {
+class FramebufferCompletenessCache;
class FramebufferManager;
class Renderbuffer;
class RenderbufferManager;
@@ -99,6 +101,8 @@ class GPU_EXPORT Framebuffer : public base::RefCounted<Framebuffer> {
const Attachment* GetAttachment(GLenum attachment) const;
+ const Attachment* GetReadBufferAttachment() const;
+
bool IsDeleted() const {
return deleted_;
}
@@ -113,10 +117,11 @@ class GPU_EXPORT Framebuffer : public base::RefCounted<Framebuffer> {
bool HasDepthAttachment() const;
bool HasStencilAttachment() const;
- GLenum GetColorAttachmentFormat() const;
+ GLenum GetDrawBufferInternalFormat() const;
+ GLenum GetReadBufferInternalFormat() const;
// If the color attachment is a texture, returns its type; otherwise,
// returns 0.
- GLenum GetColorAttachmentTextureType() const;
+ GLenum GetReadBufferTextureType() const;
// Verify all the rules in OpenGL ES 2.0.25 4.4.5 are followed.
// Returns GL_FRAMEBUFFER_COMPLETE if there are no reasons we know we can't
@@ -145,18 +150,30 @@ class GPU_EXPORT Framebuffer : public base::RefCounted<Framebuffer> {
// PrepareDrawBuffersForClear().
void RestoreDrawBuffersAfterClear() const;
+ // Clear all the active INT or UINT type color buffers to (0, 0, 0, 0).
+ void ClearIntegerBuffers();
+
// Return true if any draw buffers has an alpha channel.
bool HasAlphaMRT() const;
- static void ClearFramebufferCompleteComboMap();
+ // Return false if any two active color attachments have different internal
+ // formats.
+ bool HasSameInternalFormatsMRT() const;
+
+ void OnTextureRefDetached(TextureRef* texture);
- static bool AllowFramebufferComboCompleteMapForTesting() {
- return allow_framebuffer_combo_complete_map_;
+ // If attachment is 0, apply to all attachments; otherwise, apply only to
+ // the specified attachment.
+ void OnWillRenderTo(GLenum attachment) const;
+ void OnDidRenderTo(GLenum attachment) const;
+
+ void set_read_buffer(GLenum read_buffer) {
+ read_buffer_ = read_buffer;
}
- void OnTextureRefDetached(TextureRef* texture);
- void OnWillRenderTo() const;
- void OnDidRenderTo() const;
+ GLenum read_buffer() const {
+ return read_buffer_;
+ }
private:
friend class FramebufferManager;
@@ -201,14 +218,10 @@ class GPU_EXPORT Framebuffer : public base::RefCounted<Framebuffer> {
typedef base::hash_map<GLenum, scoped_refptr<Attachment> > AttachmentMap;
AttachmentMap attachments_;
- // A map of successful frame buffer combos. If it's in the map
- // it should be FRAMEBUFFER_COMPLETE.
- typedef base::hash_map<std::string, bool> FramebufferComboCompleteMap;
- static FramebufferComboCompleteMap* framebuffer_combo_complete_map_;
- static bool allow_framebuffer_combo_complete_map_;
-
scoped_ptr<GLenum[]> draw_buffers_;
+ GLenum read_buffer_;
+
DISALLOW_COPY_AND_ASSIGN(Framebuffer);
};
@@ -240,7 +253,11 @@ class GPU_EXPORT FramebufferManager {
DISALLOW_COPY_AND_ASSIGN(TextureDetachObserver);
};
- FramebufferManager(uint32 max_draw_buffers, uint32 max_color_attachments);
+ FramebufferManager(uint32 max_draw_buffers,
+ uint32 max_color_attachments,
+ ContextType context_type,
+ const scoped_refptr<FramebufferCompletenessCache>&
+ framebuffer_combo_complete_cache);
~FramebufferManager();
// Must call before destruction.
@@ -285,6 +302,8 @@ class GPU_EXPORT FramebufferManager {
texture_detach_observers_.end());
}
+ ContextType context_type() const { return context_type_; }
+
private:
friend class Framebuffer;
@@ -293,6 +312,10 @@ class GPU_EXPORT FramebufferManager {
void OnTextureRefDetached(TextureRef* texture);
+ FramebufferCompletenessCache* GetFramebufferComboCompleteCache() {
+ return framebuffer_combo_complete_cache_.get();
+ }
+
// Info for each framebuffer in the system.
typedef base::hash_map<GLuint, scoped_refptr<Framebuffer> >
FramebufferMap;
@@ -311,9 +334,13 @@ class GPU_EXPORT FramebufferManager {
uint32 max_draw_buffers_;
uint32 max_color_attachments_;
+ ContextType context_type_;
+
typedef std::vector<TextureDetachObserver*> TextureDetachObserverVector;
TextureDetachObserverVector texture_detach_observers_;
+ scoped_refptr<FramebufferCompletenessCache> framebuffer_combo_complete_cache_;
+
DISALLOW_COPY_AND_ASSIGN(FramebufferManager);
};
diff --git a/chromium/gpu/command_buffer/service/framebuffer_manager_unittest.cc b/chromium/gpu/command_buffer/service/framebuffer_manager_unittest.cc
index 5f42390f62d..e5f8f18a097 100644
--- a/chromium/gpu/command_buffer/service/framebuffer_manager_unittest.cc
+++ b/chromium/gpu/command_buffer/service/framebuffer_manager_unittest.cc
@@ -34,7 +34,7 @@ const bool kUseDefaultTextures = false;
class FramebufferManagerTest : public GpuServiceTest {
public:
FramebufferManagerTest()
- : manager_(1, 1),
+ : manager_(1, 1, CONTEXT_TYPE_OPENGLES2, NULL),
feature_info_(new FeatureInfo()) {
texture_manager_.reset(new TextureManager(NULL,
feature_info_.get(),
@@ -55,7 +55,6 @@ class FramebufferManagerTest : public GpuServiceTest {
}
protected:
-
FramebufferManager manager_;
scoped_refptr<FeatureInfo> feature_info_;
scoped_ptr<TextureManager> texture_manager_;
@@ -106,13 +105,16 @@ TEST_F(FramebufferManagerTest, Destroy) {
ASSERT_TRUE(framebuffer1 == NULL);
}
-class FramebufferInfoTest : public GpuServiceTest {
+class FramebufferInfoTestBase : public GpuServiceTest {
public:
static const GLuint kClient1Id = 1;
static const GLuint kService1Id = 11;
- FramebufferInfoTest()
- : manager_(kMaxDrawBuffers, kMaxColorAttachments),
+ explicit FramebufferInfoTestBase(ContextType context_type)
+ : manager_(kMaxDrawBuffers,
+ kMaxColorAttachments,
+ context_type,
+ new FramebufferCompletenessCache),
feature_info_(new FeatureInfo()) {
texture_manager_.reset(new TextureManager(NULL,
feature_info_.get(),
@@ -126,7 +128,7 @@ class FramebufferInfoTest : public GpuServiceTest {
kMaxSamples,
feature_info_.get()));
}
- ~FramebufferInfoTest() override {
+ ~FramebufferInfoTestBase() override {
manager_.Destroy(false);
texture_manager_->Destroy(false);
renderbuffer_manager_->Destroy(false);
@@ -141,7 +143,7 @@ class FramebufferInfoTest : public GpuServiceTest {
GpuServiceTest::SetUpWithGLVersion(gl_version, extensions);
TestHelper::SetupFeatureInfoInitExpectationsWithGLVersion(gl_.get(),
extensions, "", gl_version);
- feature_info_->Initialize();
+ feature_info_->InitializeForTesting();
manager_.CreateFramebuffer(kClient1Id, kService1Id);
error_state_.reset(new ::testing::StrictMock<gles2::MockErrorState>());
framebuffer_ = manager_.GetFramebuffer(kClient1Id);
@@ -156,10 +158,15 @@ class FramebufferInfoTest : public GpuServiceTest {
scoped_ptr<MockErrorState> error_state_;
};
+class FramebufferInfoTest : public FramebufferInfoTestBase {
+ public:
+ FramebufferInfoTest() : FramebufferInfoTestBase(CONTEXT_TYPE_OPENGLES2) {}
+};
+
// GCC requires these declarations, but MSVC requires they not be present
#ifndef COMPILER_MSVC
-const GLuint FramebufferInfoTest::kClient1Id;
-const GLuint FramebufferInfoTest::kService1Id;
+const GLuint FramebufferInfoTestBase::kClient1Id;
+const GLuint FramebufferInfoTestBase::kService1Id;
#endif
TEST_F(FramebufferInfoTest, Basic) {
@@ -175,7 +182,8 @@ TEST_F(FramebufferInfoTest, Basic) {
EXPECT_EQ(static_cast<GLenum>(GL_FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT),
framebuffer_->IsPossiblyComplete());
EXPECT_TRUE(framebuffer_->IsCleared());
- EXPECT_EQ(static_cast<GLenum>(0), framebuffer_->GetColorAttachmentFormat());
+ EXPECT_EQ(static_cast<GLenum>(0),
+ framebuffer_->GetReadBufferInternalFormat());
EXPECT_FALSE(manager_.IsComplete(framebuffer_));
}
@@ -223,7 +231,7 @@ TEST_F(FramebufferInfoTest, AttachRenderbuffer) {
EXPECT_FALSE(framebuffer_->HasUnclearedAttachment(GL_COLOR_ATTACHMENT0));
EXPECT_FALSE(framebuffer_->HasUnclearedAttachment(GL_DEPTH_ATTACHMENT));
EXPECT_EQ(static_cast<GLenum>(GL_RGBA4),
- framebuffer_->GetColorAttachmentFormat());
+ framebuffer_->GetReadBufferInternalFormat());
EXPECT_FALSE(framebuffer_->HasDepthAttachment());
EXPECT_FALSE(framebuffer_->HasStencilAttachment());
EXPECT_EQ(static_cast<GLenum>(GL_FRAMEBUFFER_INCOMPLETE_ATTACHMENT),
@@ -240,7 +248,7 @@ TEST_F(FramebufferInfoTest, AttachRenderbuffer) {
renderbuffer_manager_->SetInfo(
renderbuffer1, kSamples1, kFormat1, kWidth1, kHeight1);
EXPECT_EQ(static_cast<GLenum>(kFormat1),
- framebuffer_->GetColorAttachmentFormat());
+ framebuffer_->GetReadBufferInternalFormat());
EXPECT_FALSE(framebuffer_->HasDepthAttachment());
EXPECT_FALSE(framebuffer_->HasStencilAttachment());
EXPECT_EQ(static_cast<GLenum>(GL_FRAMEBUFFER_COMPLETE),
@@ -257,7 +265,7 @@ TEST_F(FramebufferInfoTest, AttachRenderbuffer) {
EXPECT_TRUE(framebuffer_->HasUnclearedAttachment(GL_COLOR_ATTACHMENT0));
EXPECT_FALSE(framebuffer_->HasUnclearedAttachment(GL_DEPTH_ATTACHMENT));
EXPECT_EQ(static_cast<GLenum>(kFormat1),
- framebuffer_->GetColorAttachmentFormat());
+ framebuffer_->GetReadBufferInternalFormat());
EXPECT_TRUE(framebuffer_->HasDepthAttachment());
EXPECT_FALSE(framebuffer_->HasStencilAttachment());
// The attachment has a size of 0,0 so depending on the order of the map
@@ -299,7 +307,7 @@ TEST_F(FramebufferInfoTest, AttachRenderbuffer) {
framebuffer_->AttachRenderbuffer(GL_STENCIL_ATTACHMENT, renderbuffer3);
EXPECT_FALSE(framebuffer_->HasUnclearedAttachment(GL_STENCIL_ATTACHMENT));
EXPECT_EQ(static_cast<GLenum>(kFormat1),
- framebuffer_->GetColorAttachmentFormat());
+ framebuffer_->GetReadBufferInternalFormat());
EXPECT_TRUE(framebuffer_->HasDepthAttachment());
EXPECT_TRUE(framebuffer_->HasStencilAttachment());
EXPECT_EQ(static_cast<GLenum>(GL_FRAMEBUFFER_COMPLETE),
@@ -310,7 +318,7 @@ TEST_F(FramebufferInfoTest, AttachRenderbuffer) {
renderbuffer_manager_->SetInfo(
renderbuffer1, kSamples1, kFormat1, kWidth1, kHeight1);
EXPECT_EQ(static_cast<GLenum>(kFormat1),
- framebuffer_->GetColorAttachmentFormat());
+ framebuffer_->GetReadBufferInternalFormat());
EXPECT_TRUE(framebuffer_->HasDepthAttachment());
EXPECT_TRUE(framebuffer_->HasStencilAttachment());
EXPECT_EQ(static_cast<GLenum>(GL_FRAMEBUFFER_COMPLETE),
@@ -376,7 +384,7 @@ TEST_F(FramebufferInfoTest, AttachRenderbuffer) {
framebuffer_->AttachRenderbuffer(GL_STENCIL_ATTACHMENT, NULL);
EXPECT_FALSE(framebuffer_->HasUnclearedAttachment(GL_STENCIL_ATTACHMENT));
EXPECT_EQ(static_cast<GLenum>(kFormat1),
- framebuffer_->GetColorAttachmentFormat());
+ framebuffer_->GetReadBufferInternalFormat());
EXPECT_TRUE(framebuffer_->HasDepthAttachment());
EXPECT_FALSE(framebuffer_->HasStencilAttachment());
@@ -442,7 +450,8 @@ TEST_F(FramebufferInfoTest, AttachTexture) {
EXPECT_EQ(static_cast<GLenum>(GL_FRAMEBUFFER_INCOMPLETE_ATTACHMENT),
framebuffer_->IsPossiblyComplete());
EXPECT_TRUE(framebuffer_->IsCleared());
- EXPECT_EQ(static_cast<GLenum>(0), framebuffer_->GetColorAttachmentFormat());
+ EXPECT_EQ(static_cast<GLenum>(0),
+ framebuffer_->GetReadBufferInternalFormat());
// Try format that doesn't work with COLOR_ATTACHMENT0
texture_manager_->SetTarget(texture1.get(), GL_TEXTURE_2D);
@@ -466,7 +475,7 @@ TEST_F(FramebufferInfoTest, AttachTexture) {
framebuffer_->IsPossiblyComplete());
EXPECT_TRUE(framebuffer_->IsCleared());
EXPECT_EQ(static_cast<GLenum>(kFormat1),
- framebuffer_->GetColorAttachmentFormat());
+ framebuffer_->GetReadBufferInternalFormat());
const Framebuffer::Attachment* attachment =
framebuffer_->GetAttachment(GL_COLOR_ATTACHMENT0);
@@ -490,7 +499,7 @@ TEST_F(FramebufferInfoTest, AttachTexture) {
framebuffer_->AttachTexture(
GL_COLOR_ATTACHMENT0, texture2.get(), kTarget2, kLevel2, kSamples2);
EXPECT_EQ(static_cast<GLenum>(kFormat2),
- framebuffer_->GetColorAttachmentFormat());
+ framebuffer_->GetReadBufferInternalFormat());
EXPECT_EQ(static_cast<GLenum>(GL_FRAMEBUFFER_COMPLETE),
framebuffer_->IsPossiblyComplete());
EXPECT_TRUE(framebuffer_->IsCleared());
@@ -515,7 +524,7 @@ TEST_F(FramebufferInfoTest, AttachTexture) {
EXPECT_EQ(kFormat3, attachment->internal_format());
EXPECT_FALSE(attachment->cleared());
EXPECT_EQ(static_cast<GLenum>(kFormat3),
- framebuffer_->GetColorAttachmentFormat());
+ framebuffer_->GetReadBufferInternalFormat());
EXPECT_EQ(static_cast<GLenum>(GL_FRAMEBUFFER_COMPLETE),
framebuffer_->IsPossiblyComplete());
EXPECT_FALSE(framebuffer_->IsCleared());
@@ -530,7 +539,8 @@ TEST_F(FramebufferInfoTest, AttachTexture) {
// Check removing it.
framebuffer_->AttachTexture(GL_COLOR_ATTACHMENT0, NULL, 0, 0, 0);
EXPECT_TRUE(framebuffer_->GetAttachment(GL_COLOR_ATTACHMENT0) == NULL);
- EXPECT_EQ(static_cast<GLenum>(0), framebuffer_->GetColorAttachmentFormat());
+ EXPECT_EQ(static_cast<GLenum>(0),
+ framebuffer_->GetReadBufferInternalFormat());
EXPECT_EQ(static_cast<GLenum>(GL_FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT),
framebuffer_->IsPossiblyComplete());
@@ -668,7 +678,8 @@ TEST_F(FramebufferInfoFloatTest, AttachFloatTexture) {
framebuffer_->AttachTexture(
GL_COLOR_ATTACHMENT0, texture.get(), kTarget, kLevel, kSamples);
- EXPECT_EQ(static_cast<GLenum>(0), framebuffer_->GetColorAttachmentFormat());
+ EXPECT_EQ(static_cast<GLenum>(0),
+ framebuffer_->GetReadBufferInternalFormat());
texture_manager_->SetTarget(texture.get(), GL_TEXTURE_2D);
texture_manager_->SetLevelInfo(texture.get(), GL_TEXTURE_2D, kLevel,
@@ -825,11 +836,6 @@ TEST_F(FramebufferInfoTest, GetStatus) {
framebuffer_->GetStatus(texture_manager_.get(), GL_FRAMEBUFFER);
// Check a second call for the same type does not call anything
- if (!framebuffer_->AllowFramebufferComboCompleteMapForTesting()) {
- EXPECT_CALL(*gl_, CheckFramebufferStatusEXT(GL_FRAMEBUFFER))
- .WillOnce(Return(GL_FRAMEBUFFER_COMPLETE))
- .RetiresOnSaturation();
- }
framebuffer_->GetStatus(texture_manager_.get(), GL_FRAMEBUFFER);
// Check changing the attachments calls CheckFramebufferStatus.
@@ -840,11 +846,6 @@ TEST_F(FramebufferInfoTest, GetStatus) {
framebuffer_->GetStatus(texture_manager_.get(), GL_FRAMEBUFFER);
// Check a second call for the same type does not call anything.
- if (!framebuffer_->AllowFramebufferComboCompleteMapForTesting()) {
- EXPECT_CALL(*gl_, CheckFramebufferStatusEXT(GL_FRAMEBUFFER))
- .WillOnce(Return(GL_FRAMEBUFFER_COMPLETE))
- .RetiresOnSaturation();
- }
framebuffer_->GetStatus(texture_manager_.get(), GL_FRAMEBUFFER);
// Check a second call with a different target calls CheckFramebufferStatus.
@@ -854,11 +855,6 @@ TEST_F(FramebufferInfoTest, GetStatus) {
framebuffer_->GetStatus(texture_manager_.get(), GL_READ_FRAMEBUFFER);
// Check a second call for the same type does not call anything.
- if (!framebuffer_->AllowFramebufferComboCompleteMapForTesting()) {
- EXPECT_CALL(*gl_, CheckFramebufferStatusEXT(GL_READ_FRAMEBUFFER))
- .WillOnce(Return(GL_FRAMEBUFFER_COMPLETE))
- .RetiresOnSaturation();
- }
framebuffer_->GetStatus(texture_manager_.get(), GL_READ_FRAMEBUFFER);
// Check adding another attachment calls CheckFramebufferStatus.
@@ -869,11 +865,6 @@ TEST_F(FramebufferInfoTest, GetStatus) {
framebuffer_->GetStatus(texture_manager_.get(), GL_READ_FRAMEBUFFER);
// Check a second call for the same type does not call anything.
- if (!framebuffer_->AllowFramebufferComboCompleteMapForTesting()) {
- EXPECT_CALL(*gl_, CheckFramebufferStatusEXT(GL_READ_FRAMEBUFFER))
- .WillOnce(Return(GL_FRAMEBUFFER_COMPLETE))
- .RetiresOnSaturation();
- }
framebuffer_->GetStatus(texture_manager_.get(), GL_READ_FRAMEBUFFER);
// Check changing the format calls CheckFramebuffferStatus.
@@ -896,11 +887,6 @@ TEST_F(FramebufferInfoTest, GetStatus) {
framebuffer_->GetStatus(texture_manager_.get(), GL_READ_FRAMEBUFFER);
// Check putting it back does not call CheckFramebufferStatus.
- if (!framebuffer_->AllowFramebufferComboCompleteMapForTesting()) {
- EXPECT_CALL(*gl_, CheckFramebufferStatusEXT(GL_READ_FRAMEBUFFER))
- .WillOnce(Return(GL_FRAMEBUFFER_COMPLETE))
- .RetiresOnSaturation();
- }
TestHelper::SetTexParameteriWithExpectations(gl_.get(),
error_state_.get(),
texture_manager_.get(),
@@ -912,14 +898,78 @@ TEST_F(FramebufferInfoTest, GetStatus) {
// Check Unbinding does not call CheckFramebufferStatus
framebuffer_->UnbindRenderbuffer(GL_RENDERBUFFER, renderbuffer1);
- if (!framebuffer_->AllowFramebufferComboCompleteMapForTesting()) {
- EXPECT_CALL(*gl_, CheckFramebufferStatusEXT(GL_READ_FRAMEBUFFER))
- .WillOnce(Return(GL_FRAMEBUFFER_COMPLETE))
- .RetiresOnSaturation();
- }
framebuffer_->GetStatus(texture_manager_.get(), GL_READ_FRAMEBUFFER);
}
+class FramebufferInfoES3Test : public FramebufferInfoTestBase {
+ public:
+ FramebufferInfoES3Test() : FramebufferInfoTestBase(CONTEXT_TYPE_WEBGL2) {}
+};
+
+TEST_F(FramebufferInfoES3Test, DifferentDimensions) {
+ const GLuint kRenderbufferClient1Id = 33;
+ const GLuint kRenderbufferService1Id = 333;
+ const GLuint kRenderbufferClient2Id = 34;
+ const GLuint kRenderbufferService2Id = 334;
+ const GLsizei kWidth1 = 16;
+ const GLsizei kHeight1 = 32;
+ const GLenum kFormat1 = GL_RGBA4;
+ const GLsizei kSamples1 = 0;
+ const GLsizei kWidth2 = 32; // Different from kWidth1
+ const GLsizei kHeight2 = 32;
+ const GLenum kFormat2 = GL_DEPTH_COMPONENT16;
+ const GLsizei kSamples2 = 0;
+
+ EXPECT_FALSE(framebuffer_->HasUnclearedAttachment(GL_COLOR_ATTACHMENT0));
+ EXPECT_FALSE(framebuffer_->HasUnclearedAttachment(GL_DEPTH_ATTACHMENT));
+ EXPECT_FALSE(framebuffer_->HasUnclearedAttachment(GL_STENCIL_ATTACHMENT));
+ EXPECT_FALSE(
+ framebuffer_->HasUnclearedAttachment(GL_DEPTH_STENCIL_ATTACHMENT));
+
+ renderbuffer_manager_->CreateRenderbuffer(
+ kRenderbufferClient1Id, kRenderbufferService1Id);
+ Renderbuffer* renderbuffer1 =
+ renderbuffer_manager_->GetRenderbuffer(kRenderbufferClient1Id);
+ ASSERT_TRUE(renderbuffer1 != NULL);
+ renderbuffer_manager_->SetInfo(
+ renderbuffer1, kSamples1, kFormat1, kWidth1, kHeight1);
+ framebuffer_->AttachRenderbuffer(GL_COLOR_ATTACHMENT0, renderbuffer1);
+
+ renderbuffer_manager_->CreateRenderbuffer(
+ kRenderbufferClient2Id, kRenderbufferService2Id);
+ Renderbuffer* renderbuffer2 =
+ renderbuffer_manager_->GetRenderbuffer(kRenderbufferClient2Id);
+ ASSERT_TRUE(renderbuffer2 != NULL);
+ renderbuffer_manager_->SetInfo(
+ renderbuffer2, kSamples2, kFormat2, kWidth2, kHeight2);
+ framebuffer_->AttachRenderbuffer(GL_DEPTH_ATTACHMENT, renderbuffer2);
+
+ EXPECT_EQ(static_cast<GLenum>(GL_FRAMEBUFFER_COMPLETE),
+ framebuffer_->IsPossiblyComplete());
+}
+
+TEST_F(FramebufferInfoES3Test, ReadBuffer) {
+ const GLuint kRenderbufferClientId = 33;
+ const GLuint kRenderbufferServiceId = 333;
+
+ EXPECT_EQ(static_cast<GLenum>(GL_COLOR_ATTACHMENT0),
+ framebuffer_->read_buffer());
+ framebuffer_->set_read_buffer(GL_NONE);
+ EXPECT_EQ(static_cast<GLenum>(GL_NONE), framebuffer_->read_buffer());
+ EXPECT_FALSE(framebuffer_->GetReadBufferAttachment());
+
+ framebuffer_->set_read_buffer(GL_COLOR_ATTACHMENT1);
+ EXPECT_FALSE(framebuffer_->GetReadBufferAttachment());
+
+ renderbuffer_manager_->CreateRenderbuffer(
+ kRenderbufferClientId, kRenderbufferServiceId);
+ Renderbuffer* renderbuffer =
+ renderbuffer_manager_->GetRenderbuffer(kRenderbufferClientId);
+ ASSERT_TRUE(renderbuffer != NULL);
+ framebuffer_->AttachRenderbuffer(GL_COLOR_ATTACHMENT1, renderbuffer);
+ EXPECT_TRUE(framebuffer_->GetReadBufferAttachment());
+}
+
} // namespace gles2
} // namespace gpu
diff --git a/chromium/gpu/command_buffer/service/gl_context_virtual.cc b/chromium/gpu/command_buffer/service/gl_context_virtual.cc
index 3abcb137308..563e6018757 100644
--- a/chromium/gpu/command_buffer/service/gl_context_virtual.cc
+++ b/chromium/gpu/command_buffer/service/gl_context_virtual.cc
@@ -4,11 +4,14 @@
#include "gpu/command_buffer/service/gl_context_virtual.h"
+#include "base/callback.h"
#include "gpu/command_buffer/service/gl_state_restorer_impl.h"
#include "gpu/command_buffer/service/gles2_cmd_decoder.h"
#include "ui/gl/gl_gl_api_implementation.h"
#include "ui/gl/gl_surface.h"
+#include "ui/gl/gpu_preference.h"
#include "ui/gl/gpu_timing.h"
+#include "ui/gl/scoped_api.h"
namespace gpu {
diff --git a/chromium/gpu/command_buffer/service/gl_context_virtual.h b/chromium/gpu/command_buffer/service/gl_context_virtual.h
index 1d82d5ac784..1403cf04ed0 100644
--- a/chromium/gpu/command_buffer/service/gl_context_virtual.h
+++ b/chromium/gpu/command_buffer/service/gl_context_virtual.h
@@ -5,17 +5,19 @@
#ifndef GPU_COMMAND_BUFFER_SERVICE_GL_CONTEXT_VIRTUAL_H_
#define GPU_COMMAND_BUFFER_SERVICE_GL_CONTEXT_VIRTUAL_H_
-#include "base/compiler_specific.h"
+#include <string>
+#include "base/callback_forward.h"
+#include "base/macros.h"
#include "base/memory/ref_counted.h"
-#include "base/memory/scoped_ptr.h"
#include "base/memory/weak_ptr.h"
#include "gpu/gpu_export.h"
#include "ui/gl/gl_context.h"
namespace gfx {
-class Display;
+class GPUPreference;
+class GPUTimingClient;
+class GLShareGroup;
class GLSurface;
-class GLStateRestorer;
}
namespace gpu {
@@ -34,7 +36,6 @@ class GPU_EXPORT GLContextVirtual : public gfx::GLContext {
// Implement GLContext.
bool Initialize(gfx::GLSurface* compatible_surface,
gfx::GpuPreference gpu_preference) override;
- void Destroy() override;
bool MakeCurrent(gfx::GLSurface* surface) override;
void ReleaseCurrent(gfx::GLSurface* surface) override;
bool IsCurrent(gfx::GLSurface* surface) override;
@@ -53,6 +54,8 @@ class GPU_EXPORT GLContextVirtual : public gfx::GLContext {
~GLContextVirtual() override;
private:
+ void Destroy();
+
scoped_refptr<gfx::GLContext> shared_context_;
base::WeakPtr<gles2::GLES2Decoder> decoder_;
diff --git a/chromium/gpu/command_buffer/service/gl_state_restorer_impl.cc b/chromium/gpu/command_buffer/service/gl_state_restorer_impl.cc
index 5fbd425f695..c132ef8ac7a 100644
--- a/chromium/gpu/command_buffer/service/gl_state_restorer_impl.cc
+++ b/chromium/gpu/command_buffer/service/gl_state_restorer_impl.cc
@@ -5,6 +5,7 @@
#include "gpu/command_buffer/service/gl_state_restorer_impl.h"
#include "gpu/command_buffer/service/gles2_cmd_decoder.h"
+#include "gpu/command_buffer/service/query_manager.h"
namespace gpu {
@@ -25,6 +26,7 @@ void GLStateRestorerImpl::RestoreState(const gfx::GLStateRestorer* prev_state) {
DCHECK(decoder_.get());
const GLStateRestorerImpl* restorer_impl =
static_cast<const GLStateRestorerImpl*>(prev_state);
+
decoder_->RestoreState(
restorer_impl ? restorer_impl->GetContextState() : NULL);
}
@@ -44,6 +46,16 @@ void GLStateRestorerImpl::RestoreFramebufferBindings() {
decoder_->RestoreFramebufferBindings();
}
+void GLStateRestorerImpl::PauseQueries() {
+ DCHECK(decoder_.get());
+ decoder_->GetQueryManager()->PauseQueries();
+}
+
+void GLStateRestorerImpl::ResumeQueries() {
+ DCHECK(decoder_.get());
+ decoder_->GetQueryManager()->ResumeQueries();
+}
+
const gles2::ContextState* GLStateRestorerImpl::GetContextState() const {
DCHECK(decoder_.get());
return decoder_->GetContextState();
diff --git a/chromium/gpu/command_buffer/service/gl_state_restorer_impl.h b/chromium/gpu/command_buffer/service/gl_state_restorer_impl.h
index 91d3408ce01..d9c41811447 100644
--- a/chromium/gpu/command_buffer/service/gl_state_restorer_impl.h
+++ b/chromium/gpu/command_buffer/service/gl_state_restorer_impl.h
@@ -29,6 +29,8 @@ class GPU_EXPORT GLStateRestorerImpl : public gfx::GLStateRestorer {
void RestoreAllTextureUnitBindings() override;
void RestoreActiveTextureUnitBinding(unsigned int target) override;
void RestoreFramebufferBindings() override;
+ void PauseQueries() override;
+ void ResumeQueries() override;
private:
const gles2::ContextState* GetContextState() const;
diff --git a/chromium/gpu/command_buffer/service/gles2_cmd_copy_texture_chromium.cc b/chromium/gpu/command_buffer/service/gles2_cmd_copy_texture_chromium.cc
index 846ac0d6a12..a987a39ce37 100644
--- a/chromium/gpu/command_buffer/service/gles2_cmd_copy_texture_chromium.cc
+++ b/chromium/gpu/command_buffer/service/gles2_cmd_copy_texture_chromium.cc
@@ -471,8 +471,10 @@ void CopyTextureCHROMIUMResourceManager::DoCopyTextureInternal(
DCHECK(source_target == GL_TEXTURE_2D ||
source_target == GL_TEXTURE_RECTANGLE_ARB ||
source_target == GL_TEXTURE_EXTERNAL_OES);
- DCHECK(xoffset >= 0 && xoffset + source_width <= dest_width);
- DCHECK(yoffset >= 0 && yoffset + source_height <= dest_height);
+ DCHECK_GE(xoffset, 0);
+ DCHECK_LE(xoffset + width, dest_width);
+ DCHECK_GE(yoffset, 0);
+ DCHECK_LE(yoffset + height, dest_height);
if (!initialized_) {
DLOG(ERROR) << "CopyTextureCHROMIUM: Uninitialized manager.";
return;
@@ -580,6 +582,8 @@ void CopyTextureCHROMIUMResourceManager::DoCopyTextureInternal(
if (need_scissor) {
glEnable(GL_SCISSOR_TEST);
glScissor(xoffset, yoffset, width, height);
+ } else {
+ glDisable(GL_SCISSOR_TEST);
}
glViewport(0, 0, dest_width, dest_height);
glDrawArrays(GL_TRIANGLE_FAN, 0, 4);
diff --git a/chromium/gpu/command_buffer/service/gles2_cmd_decoder.cc b/chromium/gpu/command_buffer/service/gles2_cmd_decoder.cc
index 2c3bc1291f3..fc12bfe2584 100644
--- a/chromium/gpu/command_buffer/service/gles2_cmd_decoder.cc
+++ b/chromium/gpu/command_buffer/service/gles2_cmd_decoder.cc
@@ -29,8 +29,6 @@
#include "gpu/command_buffer/common/gles2_cmd_format.h"
#include "gpu/command_buffer/common/gles2_cmd_utils.h"
#include "gpu/command_buffer/common/mailbox.h"
-#include "gpu/command_buffer/service/async_pixel_transfer_delegate.h"
-#include "gpu/command_buffer/service/async_pixel_transfer_manager.h"
#include "gpu/command_buffer/service/buffer_manager.h"
#include "gpu/command_buffer/service/context_group.h"
#include "gpu/command_buffer/service/context_state.h"
@@ -48,6 +46,7 @@
#include "gpu/command_buffer/service/logger.h"
#include "gpu/command_buffer/service/mailbox_manager.h"
#include "gpu/command_buffer/service/memory_tracking.h"
+#include "gpu/command_buffer/service/path_manager.h"
#include "gpu/command_buffer/service/program_manager.h"
#include "gpu/command_buffer/service/query_manager.h"
#include "gpu/command_buffer/service/renderbuffer_manager.h"
@@ -68,10 +67,11 @@
#include "ui/gl/gl_image.h"
#include "ui/gl/gl_implementation.h"
#include "ui/gl/gl_surface.h"
+#include "ui/gl/gl_version_info.h"
#include "ui/gl/gpu_timing.h"
#if defined(OS_MACOSX)
-#include <IOSurface/IOSurfaceAPI.h>
+#include <IOSurface/IOSurface.h>
// Note that this must be included after gl_bindings.h to avoid conflicts.
#include <OpenGL/CGLIOSurface.h>
#endif
@@ -413,22 +413,26 @@ ScopedModifyPixels::~ScopedModifyPixels() {
class ScopedRenderTo {
public:
- explicit ScopedRenderTo(Framebuffer* framebuffer);
+ explicit ScopedRenderTo(Framebuffer* framebuffer)
+ : ScopedRenderTo(framebuffer, 0) {}
+ ScopedRenderTo(Framebuffer* framebuffer, GLenum attachment);
~ScopedRenderTo();
private:
const Framebuffer* framebuffer_;
+ GLenum attachment_;
};
-ScopedRenderTo::ScopedRenderTo(Framebuffer* framebuffer)
- : framebuffer_(framebuffer) {
- if (framebuffer)
- framebuffer_->OnWillRenderTo();
+ScopedRenderTo::ScopedRenderTo(Framebuffer* framebuffer, GLenum attachment)
+ : framebuffer_(framebuffer),
+ attachment_(attachment) {
+ if (framebuffer_)
+ framebuffer_->OnWillRenderTo(attachment_);
}
ScopedRenderTo::~ScopedRenderTo() {
if (framebuffer_)
- framebuffer_->OnDidRenderTo();
+ framebuffer_->OnDidRenderTo(attachment_);
}
// Encapsulates an OpenGL texture.
@@ -556,28 +560,6 @@ struct FenceCallback {
scoped_ptr<gfx::GLFence> fence;
};
-class AsyncUploadTokenCompletionObserver
- : public AsyncPixelTransferCompletionObserver {
- public:
- explicit AsyncUploadTokenCompletionObserver(uint32 async_upload_token)
- : async_upload_token_(async_upload_token) {
- }
-
- void DidComplete(const AsyncMemoryParams& mem_params) override {
- DCHECK(mem_params.buffer().get());
- void* data = mem_params.GetDataAddress();
- AsyncUploadSync* sync = static_cast<AsyncUploadSync*>(data);
- sync->SetAsyncUploadToken(async_upload_token_);
- }
-
- private:
- ~AsyncUploadTokenCompletionObserver() override {}
-
- uint32 async_upload_token_;
-
- DISALLOW_COPY_AND_ASSIGN(AsyncUploadTokenCompletionObserver);
-};
-
// } // anonymous namespace.
// static
@@ -685,9 +667,10 @@ class GLES2DecoderImpl : public GLES2Decoder,
return valuebuffer_manager();
}
- bool ProcessPendingQueries(bool did_finish) override;
+ bool HasPendingQueries() const override;
+ void ProcessPendingQueries(bool did_finish) override;
- bool HasMoreIdleWork() override;
+ bool HasMoreIdleWork() const override;
void PerformIdleWork() override;
void WaitForReadPixels(base::Closure callback) override;
@@ -706,10 +689,6 @@ class GLES2DecoderImpl : public GLES2Decoder,
void SetShaderCacheCallback(const ShaderCacheCallback& callback) override;
void SetWaitSyncPointCallback(const WaitSyncPointCallback& callback) override;
- AsyncPixelTransferManager* GetAsyncPixelTransferManager() override;
- void ResetAsyncPixelTransferManagerForTest() override;
- void SetAsyncPixelTransferManagerForTest(
- AsyncPixelTransferManager* manager) override;
void SetIgnoreCachedStateForTest(bool ignore) override;
void ProcessFinishedAsyncTransfers();
@@ -729,9 +708,8 @@ class GLES2DecoderImpl : public GLES2Decoder,
// These check the state of the currently bound framebuffer or the
// backbuffer if no framebuffer is bound.
- // If all_draw_buffers is false, only check with COLOR_ATTACHMENT0, otherwise
- // check with all attached and enabled color attachments.
- bool BoundFramebufferHasColorAttachmentWithAlpha(bool all_draw_buffers);
+ // Check with all attached and enabled color attachments.
+ bool BoundFramebufferHasColorAttachmentWithAlpha();
bool BoundFramebufferHasDepthAttachment();
bool BoundFramebufferHasStencilAttachment();
@@ -792,13 +770,8 @@ class GLES2DecoderImpl : public GLES2Decoder,
void DeleteQueriesEXTHelper(GLsizei n, const GLuint* client_ids);
bool GenVertexArraysOESHelper(GLsizei n, const GLuint* client_ids);
void DeleteVertexArraysOESHelper(GLsizei n, const GLuint* client_ids);
-
- // Helper for async upload token completion notification callback.
- base::Closure AsyncUploadTokenCompletionClosure(uint32 async_upload_token,
- uint32 sync_data_shm_id,
- uint32 sync_data_shm_offset);
-
-
+ bool GenPathsCHROMIUMHelper(GLuint first_client_id, GLsizei range);
+ bool DeletePathsCHROMIUMHelper(GLuint first_client_id, GLsizei range);
// Workarounds
void OnFboChanged() const;
@@ -824,6 +797,8 @@ class GLES2DecoderImpl : public GLES2Decoder,
return group_->valuebuffer_manager();
}
+ PathManager* path_manager() { return group_->path_manager(); }
+
ProgramManager* program_manager() {
return group_->program_manager();
}
@@ -866,10 +841,6 @@ class GLES2DecoderImpl : public GLES2Decoder,
return true;
}
- bool IsWebGLContext() const {
- return webgl_version_ == 1 || webgl_version_ == 2;
- }
-
bool IsOffscreenBufferMultisampled() const {
return offscreen_target_samples_ > 1;
}
@@ -894,11 +865,18 @@ class GLES2DecoderImpl : public GLES2Decoder,
// or regular back buffer).
gfx::Size GetBoundReadFrameBufferSize();
- // Get the format of the currently bound frame buffer (either FBO or regular
- // back buffer)
+ // Get the format/type of the currently bound frame buffer (either FBO or
+ // regular back buffer).
+ // If the color image is a renderbuffer, returns 0 for type.
GLenum GetBoundReadFrameBufferTextureType();
GLenum GetBoundReadFrameBufferInternalFormat();
- GLenum GetBoundDrawFrameBufferInternalFormat();
+
+ // Get the i-th draw buffer's internal format from the bound framebuffer.
+ // If no framebuffer is bound, or no image is attached, or the DrawBuffers
+ // setting for that image is GL_NONE, return 0.
+ GLenum GetBoundColorDrawBufferInternalFormat(GLint drawbuffer_i);
+
+ void MarkDrawBufferAsCleared(GLenum buffer, GLint drawbuffer_i);
// Wrapper for CompressedTexImage2D commands.
error::Error DoCompressedTexImage2D(
@@ -1017,14 +995,6 @@ class GLES2DecoderImpl : public GLES2Decoder,
GLenum type,
const void * data);
- // Extra validation for async tex(Sub)Image2D.
- bool ValidateAsyncTransfer(
- const char* function_name,
- TextureRef* texture_ref,
- GLenum target,
- GLint level,
- const void * data);
-
// Wrapper for TexImageIOSurface2DCHROMIUM.
void DoTexImageIOSurface2DCHROMIUM(
GLenum target,
@@ -1059,6 +1029,16 @@ class GLES2DecoderImpl : public GLES2Decoder,
GLuint source_id,
GLuint dest_id);
+ void DoCompressedCopySubTextureCHROMIUM(GLenum target,
+ GLuint source_id,
+ GLuint dest_id,
+ GLint xoffset,
+ GLint yoffset,
+ GLint x,
+ GLint y,
+ GLsizei width,
+ GLsizei height);
+
// Wrapper for TexStorage2DEXT.
void DoTexStorage2DEXT(
GLenum target,
@@ -1070,13 +1050,16 @@ class GLES2DecoderImpl : public GLES2Decoder,
void DoProduceTextureCHROMIUM(GLenum target, const GLbyte* key);
void DoProduceTextureDirectCHROMIUM(GLuint texture, GLenum target,
const GLbyte* key);
- void ProduceTextureRef(std::string func_name, TextureRef* texture_ref,
- GLenum target, const GLbyte* data);
+ void ProduceTextureRef(const char* func_name,
+ TextureRef* texture_ref,
+ GLenum target,
+ const GLbyte* data);
void EnsureTextureForClientId(GLenum target, GLuint client_id);
void DoConsumeTextureCHROMIUM(GLenum target, const GLbyte* key);
void DoCreateAndConsumeTextureCHROMIUM(GLenum target, const GLbyte* key,
GLuint client_id);
+ void DoApplyScreenSpaceAntialiasingCHROMIUM();
bool DoIsValuebufferCHROMIUM(GLuint client_id);
void DoBindValueBufferCHROMIUM(GLenum target, GLuint valuebuffer);
@@ -1344,6 +1327,8 @@ class GLES2DecoderImpl : public GLES2Decoder,
GLenum target,
const char* func_name);
+ bool CheckBoundDrawFramebufferValid(const char* func_name);
+
// Check if the current valuebuffer exists and is valid. If not generates
// the appropriate GL error. Returns true if the current valuebuffer is in
// a usable state.
@@ -1413,6 +1398,13 @@ class GLES2DecoderImpl : public GLES2Decoder,
// Wrapper for glBindBuffer since we need to track the current targets.
void DoBindBuffer(GLenum target, GLuint buffer);
+ // Wrapper for glBindBufferBase since we need to track the current targets.
+ void DoBindBufferBase(GLenum target, GLuint index, GLuint buffer);
+
+ // Wrapper for glBindBufferRange since we need to track the current targets.
+ void DoBindBufferRange(GLenum target, GLuint index, GLuint buffer,
+ GLintptr offset, GLsizeiptr size);
+
// Wrapper for glBindFramebuffer since we need to track the current targets.
void DoBindFramebuffer(GLenum target, GLuint framebuffer);
@@ -1439,8 +1431,16 @@ class GLES2DecoderImpl : public GLES2Decoder,
// Wrapper for glCheckFramebufferStatus
GLenum DoCheckFramebufferStatus(GLenum target);
- // Wrapper for glClear
+ // Wrapper for glClear*()
error::Error DoClear(GLbitfield mask);
+ void DoClearBufferiv(
+ GLenum buffer, GLint drawbuffer, const GLint* value);
+ void DoClearBufferuiv(
+ GLenum buffer, GLint drawbuffer, const GLuint* value);
+ void DoClearBufferfv(
+ GLenum buffer, GLint drawbuffer, const GLfloat* value);
+ void DoClearBufferfi(
+ GLenum buffer, GLint drawbuffer, GLfloat depth, GLint stencil);
// Wrappers for various state.
void DoDepthRangef(GLclampf znear, GLclampf zfar);
@@ -1529,6 +1529,10 @@ class GLES2DecoderImpl : public GLES2Decoder,
GLuint DoGetMaxValueInBufferCHROMIUM(
GLuint buffer_id, GLsizei count, GLenum type, GLuint offset);
+ // Wrapper for glGetBufferParameteri64v.
+ void DoGetBufferParameteri64v(
+ GLenum target, GLenum pname, GLint64* params);
+
// Wrapper for glGetBufferParameteriv.
void DoGetBufferParameteriv(
GLenum target, GLenum pname, GLint* params);
@@ -1566,10 +1570,14 @@ class GLES2DecoderImpl : public GLES2Decoder,
bool DoIsShader(GLuint client_id);
bool DoIsTexture(GLuint client_id);
bool DoIsVertexArrayOES(GLuint client_id);
+ bool DoIsPathCHROMIUM(GLuint client_id);
// Wrapper for glLinkProgram
void DoLinkProgram(GLuint program);
+ // Wrapper for glReadBuffer
+ void DoReadBuffer(GLenum src);
+
// Wrapper for glRenderbufferStorage.
void DoRenderbufferStorage(
GLenum target, GLenum internalformat, GLsizei width, GLsizei height);
@@ -1619,6 +1627,12 @@ class GLES2DecoderImpl : public GLES2Decoder,
void DoUniform3iv(GLint fake_location, GLsizei count, const GLint* value);
void DoUniform4iv(GLint fake_location, GLsizei count, const GLint* value);
+ void DoUniform1ui(GLint fake_location, GLuint v0);
+ void DoUniform1uiv(GLint fake_location, GLsizei count, const GLuint* value);
+ void DoUniform2uiv(GLint fake_location, GLsizei count, const GLuint* value);
+ void DoUniform3uiv(GLint fake_location, GLsizei count, const GLuint* value);
+ void DoUniform4uiv(GLint fake_location, GLsizei count, const GLuint* value);
+
// Wrappers for glUniformfv because some drivers don't correctly accept
// bool uniforms.
void DoUniform1fv(GLint fake_location, GLsizei count, const GLfloat* value);
@@ -1635,6 +1649,24 @@ class GLES2DecoderImpl : public GLES2Decoder,
void DoUniformMatrix4fv(
GLint fake_location, GLsizei count, GLboolean transpose,
const GLfloat* value);
+ void DoUniformMatrix2x3fv(
+ GLint fake_location, GLsizei count, GLboolean transpose,
+ const GLfloat* value);
+ void DoUniformMatrix2x4fv(
+ GLint fake_location, GLsizei count, GLboolean transpose,
+ const GLfloat* value);
+ void DoUniformMatrix3x2fv(
+ GLint fake_location, GLsizei count, GLboolean transpose,
+ const GLfloat* value);
+ void DoUniformMatrix3x4fv(
+ GLint fake_location, GLsizei count, GLboolean transpose,
+ const GLfloat* value);
+ void DoUniformMatrix4x2fv(
+ GLint fake_location, GLsizei count, GLboolean transpose,
+ const GLfloat* value);
+ void DoUniformMatrix4x3fv(
+ GLint fake_location, GLsizei count, GLboolean transpose,
+ const GLfloat* value);
template <typename T>
bool SetVertexAttribValue(
@@ -1858,11 +1890,22 @@ class GLES2DecoderImpl : public GLES2Decoder,
return error::kNoError;
}
+ bool BackBufferHasAlpha() const {
+ if (back_buffer_draw_buffer_ == GL_NONE)
+ return false;
+ if (offscreen_target_frame_buffer_.get()) {
+ return (offscreen_target_color_format_ == GL_RGBA ||
+ offscreen_target_color_format_ == GL_RGBA8);
+ }
+ return (back_buffer_color_format_ == GL_RGBA ||
+ back_buffer_color_format_ == GL_RGBA8);
+ }
+
// Set remaining commands to process to 0 to force DoCommands to return
// and allow context preemption and GPU watchdog checks in GpuScheduler().
void ExitCommandProcessingEarly() { commands_to_process_ = 0; }
- void ProcessPendingReadPixels();
+ void ProcessPendingReadPixels(bool did_finish);
void FinishReadPixels(const cmds::ReadPixels& c, GLuint buffer);
// Generate a member function prototype for each command in an automated and
@@ -1949,13 +1992,18 @@ class GLES2DecoderImpl : public GLES2Decoder,
ShaderCacheCallback shader_cache_callback_;
- scoped_ptr<AsyncPixelTransferManager> async_pixel_transfer_manager_;
-
// The format of the back buffer_
GLenum back_buffer_color_format_;
bool back_buffer_has_depth_;
bool back_buffer_has_stencil_;
+ // Tracks read buffer and draw buffer for backbuffer, whether it's onscreen
+ // or offscreen.
+ // TODO(zmo): when ES3 APIs are exposed to Nacl, make sure read_buffer_
+ // setting is set correctly when SwapBuffers().
+ GLenum back_buffer_read_buffer_;
+ GLenum back_buffer_draw_buffer_;
+
bool surfaceless_;
// Backbuffer attachments that are currently undefined.
@@ -1966,7 +2014,6 @@ class GLES2DecoderImpl : public GLES2Decoder,
// if not returning an error.
error::Error current_decoder_error_;
- bool use_shader_translator_;
scoped_refptr<ShaderTranslatorInterface> vertex_translator_;
scoped_refptr<ShaderTranslatorInterface> fragment_translator_;
@@ -1987,11 +2034,7 @@ class GLES2DecoderImpl : public GLES2Decoder,
bool reset_by_robustness_extension_;
bool supports_post_sub_buffer_;
- // Indicates whether this is a context for WebGL1, WebGL2, or others.
- // 0: other types
- // 1: WebGL 1
- // 2: WebGL 2
- unsigned webgl_version_;
+ ContextType context_type_;
// These flags are used to override the state of the shared feature_info_
// member. Because the same FeatureInfo instance may be shared among many
@@ -2032,7 +2075,6 @@ class GLES2DecoderImpl : public GLES2Decoder,
scoped_ptr<GPUTracer> gpu_tracer_;
scoped_ptr<GPUStateTracer> gpu_state_tracer_;
- const unsigned char* cb_command_trace_category_;
const unsigned char* gpu_decoder_category_;
int gpu_trace_level_;
bool gpu_trace_commands_;
@@ -2519,10 +2561,11 @@ GLES2DecoderImpl::GLES2DecoderImpl(ContextGroup* group)
back_buffer_color_format_(0),
back_buffer_has_depth_(false),
back_buffer_has_stencil_(false),
+ back_buffer_read_buffer_(GL_BACK),
+ back_buffer_draw_buffer_(GL_BACK),
surfaceless_(false),
backbuffer_needs_clear_bits_(0),
current_decoder_error_(error::kNoError),
- use_shader_translator_(true),
validators_(group_->feature_info()->validators()),
feature_info_(group_->feature_info()),
frame_number_(0),
@@ -2531,22 +2574,20 @@ GLES2DecoderImpl::GLES2DecoderImpl(ContextGroup* group)
context_was_lost_(false),
reset_by_robustness_extension_(false),
supports_post_sub_buffer_(false),
- webgl_version_(0),
+ context_type_(CONTEXT_TYPE_OPENGLES2),
derivatives_explicitly_enabled_(false),
frag_depth_explicitly_enabled_(false),
draw_buffers_explicitly_enabled_(false),
shader_texture_lod_explicitly_enabled_(false),
compile_shader_always_succeeds_(false),
lose_context_when_out_of_memory_(false),
- service_logging_(base::CommandLine::ForCurrentProcess()->HasSwitch(
- switches::kEnableGPUServiceLoggingGPU)),
+ service_logging_(base::CommandLine::InitializedForCurrentProcess()
+ ? base::CommandLine::ForCurrentProcess()->HasSwitch(
+ switches::kEnableGPUServiceLoggingGPU)
+ : false),
viewport_max_width_(0),
viewport_max_height_(0),
- texture_state_(group_->feature_info()
- ->workarounds()
- .texsubimage_faster_than_teximage),
- cb_command_trace_category_(TRACE_EVENT_API_GET_CATEGORY_GROUP_ENABLED(
- TRACE_DISABLED_BY_DEFAULT("cb_command"))),
+ texture_state_(group_->feature_info()->workarounds()),
gpu_decoder_category_(TRACE_EVENT_API_GET_CATEGORY_GROUP_ENABLED(
TRACE_DISABLED_BY_DEFAULT("gpu_decoder"))),
gpu_trace_level_(2),
@@ -2556,17 +2597,6 @@ GLES2DecoderImpl::GLES2DecoderImpl(ContextGroup* group)
validation_fbo_multisample_(0),
validation_fbo_(0) {
DCHECK(group);
-
- // The shader translator is used for WebGL even when running on EGL
- // because additional restrictions are needed (like only enabling
- // GL_OES_standard_derivatives on demand). It is used for the unit
- // tests because GLES2DecoderWithShaderTest.GetShaderInfoLogValidArgs passes
- // the empty string to CompileShader and this is not a valid shader.
- if (gfx::GetGLImplementation() == gfx::kGLImplementationMockGL ||
- base::CommandLine::ForCurrentProcess()->HasSwitch(
- switches::kDisableGLSLTranslator)) {
- use_shader_translator_ = false;
- }
}
GLES2DecoderImpl::~GLES2DecoderImpl() {
@@ -2587,26 +2617,27 @@ bool GLES2DecoderImpl::Initialize(
ContextCreationAttribHelper attrib_parser;
if (!attrib_parser.Parse(attribs))
return false;
- webgl_version_ = attrib_parser.webgl_version;
surfaceless_ = surface->IsSurfaceless() && !offscreen;
set_initialized();
gpu_state_tracer_ = GPUStateTracer::Create(&state_);
- if (base::CommandLine::ForCurrentProcess()->HasSwitch(
- switches::kEnableGPUDebugging)) {
- set_debug(true);
- }
+ if (base::CommandLine::InitializedForCurrentProcess()) {
+ if (base::CommandLine::ForCurrentProcess()->HasSwitch(
+ switches::kEnableGPUDebugging)) {
+ set_debug(true);
+ }
- if (base::CommandLine::ForCurrentProcess()->HasSwitch(
- switches::kEnableGPUCommandLogging)) {
- set_log_commands(true);
- }
+ if (base::CommandLine::ForCurrentProcess()->HasSwitch(
+ switches::kEnableGPUCommandLogging)) {
+ set_log_commands(true);
+ }
- compile_shader_always_succeeds_ =
- base::CommandLine::ForCurrentProcess()->HasSwitch(
- switches::kCompileShaderAlwaysSucceeds);
+ compile_shader_always_succeeds_ =
+ base::CommandLine::ForCurrentProcess()->HasSwitch(
+ switches::kCompileShaderAlwaysSucceeds);
+ }
// Take ownership of the context and surface. The surface can be replaced with
// SetSurface.
@@ -2636,20 +2667,19 @@ bool GLES2DecoderImpl::Initialize(
}
disallowed_features_ = disallowed_features;
- if (webgl_version_ == 1) {
+ if (attrib_parser.context_type == CONTEXT_TYPE_WEBGL1) {
disallowed_features_.npot_support = true;
}
- if (!group_->Initialize(this,
- ContextGroup::GetContextType(webgl_version_),
+ if (!group_->Initialize(this, attrib_parser.context_type,
disallowed_features_)) {
group_ = NULL; // Must not destroy ContextGroup if it is not initialized.
Destroy(true);
return false;
}
CHECK_GL_ERROR();
-
- if (webgl_version_ == 2) {
+ if (feature_info_->context_type() == CONTEXT_TYPE_WEBGL2 ||
+ feature_info_->context_type() == CONTEXT_TYPE_OPENGLES3) {
if (!feature_info_->IsES3Capable()) {
LOG(ERROR) << "Underlying driver does not support ES3.";
Destroy(true);
@@ -2657,6 +2687,10 @@ bool GLES2DecoderImpl::Initialize(
}
feature_info_->EnableES3Validators();
set_unsafe_es3_apis_enabled(true);
+
+ frag_depth_explicitly_enabled_ = true;
+ draw_buffers_explicitly_enabled_ = true;
+ // TODO(zmo): Look into shader_texture_lod_explicitly_enabled_ situation.
}
state_.attrib_values.resize(group_->max_vertex_attribs());
@@ -2995,17 +3029,6 @@ bool GLES2DecoderImpl::Initialize(
context_->SetUnbindFboOnMakeCurrent();
}
- // Only compositor contexts are known to use only the subset of GL
- // that can be safely migrated between the iGPU and the dGPU. Mark
- // those contexts as safe to forcibly transition between the GPUs.
- // http://crbug.com/180876, http://crbug.com/227228
- if (!offscreen)
- context_->SetSafeToForceGpuSwitch();
-
- async_pixel_transfer_manager_.reset(
- AsyncPixelTransferManager::Create(context.get()));
- async_pixel_transfer_manager_->Initialize(texture_manager());
-
if (workarounds().gl_clear_broken) {
DCHECK(!clear_framebuffer_blit_.get());
LOCAL_COPY_REAL_GL_ERRORS_TO_WRAPPER("glClearWorkaroundInit");
@@ -3114,6 +3137,8 @@ Capabilities GLES2DecoderImpl::GetCapabilities() {
caps.egl_image_external =
feature_info_->feature_flags().oes_egl_image_external;
+ caps.texture_format_astc =
+ feature_info_->feature_flags().ext_texture_format_astc;
caps.texture_format_atc =
feature_info_->feature_flags().ext_texture_format_atc;
caps.texture_format_bgra8888 =
@@ -3140,12 +3165,15 @@ Capabilities GLES2DecoderImpl::GetCapabilities() {
caps.post_sub_buffer = supports_post_sub_buffer_;
caps.image = true;
+ caps.surfaceless = surfaceless_;
caps.blend_equation_advanced =
feature_info_->feature_flags().blend_equation_advanced;
caps.blend_equation_advanced_coherent =
feature_info_->feature_flags().blend_equation_advanced_coherent;
caps.texture_rg = feature_info_->feature_flags().ext_texture_rg;
+ caps.image_ycbcr_422 =
+ feature_info_->feature_flags().chromium_image_ycbcr_422;
caps.max_copy_texture_chromium_size =
feature_info_->workarounds().max_copy_texture_chromium_size;
caps.render_buffer_format_bgra8888 =
@@ -3166,8 +3194,7 @@ void GLES2DecoderImpl::UpdateCapabilities() {
bool GLES2DecoderImpl::InitializeShaderTranslator() {
TRACE_EVENT0("gpu", "GLES2DecoderImpl::InitializeShaderTranslator");
-
- if (!use_shader_translator_) {
+ if (feature_info_->disable_shader_translator()) {
return true;
}
ShBuiltInResources resources;
@@ -3193,7 +3220,7 @@ bool GLES2DecoderImpl::InitializeShaderTranslator() {
resources.FragmentPrecisionHigh =
PrecisionMeetsSpecForHighpFloat(range[0], range[1], precision);
- if (IsWebGLContext()) {
+ if (feature_info_->IsWebGLContext()) {
resources.OES_standard_derivatives = derivatives_explicitly_enabled_;
resources.EXT_frag_depth = frag_depth_explicitly_enabled_;
resources.EXT_draw_buffers = draw_buffers_explicitly_enabled_;
@@ -3220,10 +3247,23 @@ bool GLES2DecoderImpl::InitializeShaderTranslator() {
}
ShShaderSpec shader_spec;
- if (IsWebGLContext()) {
- shader_spec = webgl_version_ == 2 ? SH_WEBGL2_SPEC : SH_WEBGL_SPEC;
- } else {
- shader_spec = unsafe_es3_apis_enabled() ? SH_GLES3_SPEC : SH_GLES2_SPEC;
+ switch (feature_info_->context_type()) {
+ case CONTEXT_TYPE_WEBGL1:
+ shader_spec = SH_WEBGL_SPEC;
+ break;
+ case CONTEXT_TYPE_WEBGL2:
+ shader_spec = SH_WEBGL2_SPEC;
+ break;
+ case CONTEXT_TYPE_OPENGLES2:
+ shader_spec = SH_GLES2_SPEC;
+ break;
+ case CONTEXT_TYPE_OPENGLES3:
+ shader_spec = SH_GLES3_SPEC;
+ break;
+ default:
+ NOTREACHED();
+ shader_spec = SH_GLES2_SPEC;
+ break;
}
if ((shader_spec == SH_WEBGL_SPEC || shader_spec == SH_WEBGL2_SPEC) &&
@@ -3231,9 +3271,7 @@ bool GLES2DecoderImpl::InitializeShaderTranslator() {
resources.HashFunction = &CityHash64;
else
resources.HashFunction = NULL;
- ShaderTranslatorInterface::GlslImplementationType implementation_type =
- gfx::GetGLImplementation() == gfx::kGLImplementationEGLGLES2 ?
- ShaderTranslatorInterface::kGlslES : ShaderTranslatorInterface::kGlsl;
+
int driver_bug_workarounds = 0;
if (workarounds().needs_glsl_built_in_function_emulation)
driver_bug_workarounds |= SH_EMULATE_BUILT_IN_FUNCTIONS;
@@ -3252,15 +3290,17 @@ bool GLES2DecoderImpl::InitializeShaderTranslator() {
if (workarounds().remove_pow_with_constant_exponent)
driver_bug_workarounds |= SH_REMOVE_POW_WITH_CONSTANT_EXPONENT;
- if (base::CommandLine::ForCurrentProcess()->HasSwitch(
+ if (base::CommandLine::InitializedForCurrentProcess() &&
+ base::CommandLine::ForCurrentProcess()->HasSwitch(
switches::kEmulateShaderPrecision))
resources.WEBGL_debug_shader_precision = true;
+ ShShaderOutput shader_output_language =
+ ShaderTranslator::GetShaderOutputLanguageForContext(
+ feature_info_->gl_version_info());
+
vertex_translator_ = shader_translator_cache()->GetTranslator(
- GL_VERTEX_SHADER,
- shader_spec,
- &resources,
- implementation_type,
+ GL_VERTEX_SHADER, shader_spec, &resources, shader_output_language,
static_cast<ShCompileOptions>(driver_bug_workarounds));
if (!vertex_translator_.get()) {
LOG(ERROR) << "Could not initialize vertex shader translator.";
@@ -3269,10 +3309,7 @@ bool GLES2DecoderImpl::InitializeShaderTranslator() {
}
fragment_translator_ = shader_translator_cache()->GetTranslator(
- GL_FRAGMENT_SHADER,
- shader_spec,
- &resources,
- implementation_type,
+ GL_FRAGMENT_SHADER, shader_spec, &resources, shader_output_language,
static_cast<ShCompileOptions>(driver_bug_workarounds));
if (!fragment_translator_.get()) {
LOG(ERROR) << "Could not initialize fragment shader translator.";
@@ -3353,6 +3390,42 @@ bool GLES2DecoderImpl::GenTexturesHelper(GLsizei n, const GLuint* client_ids) {
return true;
}
+bool GLES2DecoderImpl::GenPathsCHROMIUMHelper(GLuint first_client_id,
+ GLsizei range) {
+ GLuint last_client_id;
+ if (!SafeAddUint32(first_client_id, range - 1, &last_client_id))
+ return false;
+
+ if (path_manager()->HasPathsInRange(first_client_id, last_client_id))
+ return false;
+
+ GLuint first_service_id = glGenPathsNV(range);
+ if (first_service_id == 0) {
+ // We have to fail the connection here, because client has already
+ // succeeded in allocating the ids. This happens if we allocate
+ // the whole path id space (two allocations of 0x7FFFFFFF paths, for
+ // example).
+ return false;
+ }
+ // GenPathsNV does not wrap.
+ DCHECK(first_service_id + range - 1 >= first_service_id);
+
+ path_manager()->CreatePathRange(first_client_id, last_client_id,
+ first_service_id);
+
+ return true;
+}
+
+bool GLES2DecoderImpl::DeletePathsCHROMIUMHelper(GLuint first_client_id,
+ GLsizei range) {
+ GLuint last_client_id;
+ if (!SafeAddUint32(first_client_id, range - 1, &last_client_id))
+ return false;
+
+ path_manager()->RemovePaths(first_client_id, last_client_id);
+ return true;
+}
+
void GLES2DecoderImpl::DeleteBuffersHelper(
GLsizei n, const GLuint* client_ids) {
for (GLsizei ii = 0; ii < n; ++ii) {
@@ -3457,9 +3530,8 @@ void GLES2DecoderImpl::DeleteTexturesHelper(
framebuffer_state_.clear_state_dirty = true;
}
// Unbind texture_ref from texture_ref units.
- for (size_t jj = 0; jj < state_.texture_units.size(); ++jj) {
- state_.texture_units[jj].Unbind(texture_ref);
- }
+ state_.UnbindTexture(texture_ref);
+
// Unbind from current framebuffers.
if (supports_separate_framebuffer_binds) {
if (framebuffer_state_.bound_read_framebuffer.get()) {
@@ -3524,16 +3596,9 @@ bool GLES2DecoderImpl::MakeCurrent() {
}
void GLES2DecoderImpl::ProcessFinishedAsyncTransfers() {
- ProcessPendingReadPixels();
+ ProcessPendingReadPixels(false);
if (engine() && query_manager_.get())
query_manager_->ProcessPendingTransferQueries();
-
- // TODO(epenner): Is there a better place to do this?
- // This needs to occur before we execute any batch of commands
- // from the client, as the client may have recieved an async
- // completion while issuing those commands.
- // "DidFlushStart" would be ideal if we had such a callback.
- async_pixel_transfer_manager_->BindCompletedAsyncTransfers();
}
static void RebindCurrentFramebuffer(
@@ -3588,7 +3653,7 @@ bool GLES2DecoderImpl::CheckFramebufferValid(
state_.SetDeviceCapabilityState(GL_SCISSOR_TEST, false);
bool reset_draw_buffer = false;
if ((backbuffer_needs_clear_bits_ & GL_COLOR_BUFFER_BIT) != 0 &&
- group_->draw_buffer() == GL_NONE) {
+ back_buffer_draw_buffer_ == GL_NONE) {
reset_draw_buffer = true;
GLenum buf = GL_BACK;
if (GetBackbufferServiceId() != 0) // emulated backbuffer
@@ -3668,6 +3733,25 @@ bool GLES2DecoderImpl::CheckBoundFramebuffersValid(const char* func_name) {
func_name);
}
+bool GLES2DecoderImpl::CheckBoundDrawFramebufferValid(const char* func_name) {
+ Framebuffer* framebuffer = framebuffer_state_.bound_draw_framebuffer.get();
+ if (!framebuffer) {
+ // Assume the default back buffer is always complete.
+ return true;
+ }
+ if (!framebuffer_manager()->IsComplete(framebuffer)) {
+ if (framebuffer->GetStatus(texture_manager(), GL_DRAW_FRAMEBUFFER) !=
+ GL_FRAMEBUFFER_COMPLETE) {
+ LOCAL_SET_GL_ERROR(
+ GL_INVALID_FRAMEBUFFER_OPERATION, func_name,
+ "framebuffer incomplete (check)");
+ return false;
+ }
+ framebuffer_manager()->MarkAsComplete(framebuffer);
+ }
+ return true;
+}
+
bool GLES2DecoderImpl::CheckBoundReadFramebufferColorAttachment(
const char* func_name) {
Framebuffer* framebuffer = features().chromium_framebuffer_multisample ?
@@ -3717,9 +3801,11 @@ gfx::Size GLES2DecoderImpl::GetBoundReadFrameBufferSize() {
GLenum GLES2DecoderImpl::GetBoundReadFrameBufferTextureType() {
Framebuffer* framebuffer =
GetFramebufferInfoForTarget(GL_READ_FRAMEBUFFER_EXT);
- if (framebuffer != NULL) {
- return framebuffer->GetColorAttachmentTextureType();
- } else {
+ if (framebuffer) {
+ return framebuffer->GetReadBufferTextureType();
+ } else { // Back buffer.
+ if (back_buffer_read_buffer_ == GL_NONE)
+ return 0;
return GL_UNSIGNED_BYTE;
}
}
@@ -3727,25 +3813,64 @@ GLenum GLES2DecoderImpl::GetBoundReadFrameBufferTextureType() {
GLenum GLES2DecoderImpl::GetBoundReadFrameBufferInternalFormat() {
Framebuffer* framebuffer =
GetFramebufferInfoForTarget(GL_READ_FRAMEBUFFER_EXT);
- if (framebuffer != NULL) {
- return framebuffer->GetColorAttachmentFormat();
- } else if (offscreen_target_frame_buffer_.get()) {
- return offscreen_target_color_format_;
- } else {
+ if (framebuffer) {
+ return framebuffer->GetReadBufferInternalFormat();
+ } else { // Back buffer.
+ if (back_buffer_read_buffer_ == GL_NONE)
+ return 0;
+ if (offscreen_target_frame_buffer_.get()) {
+ return offscreen_target_color_format_;
+ }
return back_buffer_color_format_;
}
}
-GLenum GLES2DecoderImpl::GetBoundDrawFrameBufferInternalFormat() {
- Framebuffer* framebuffer =
- GetFramebufferInfoForTarget(GL_DRAW_FRAMEBUFFER_EXT);
- if (framebuffer != NULL) {
- return framebuffer->GetColorAttachmentFormat();
- } else if (offscreen_target_frame_buffer_.get()) {
- return offscreen_target_color_format_;
- } else {
- return back_buffer_color_format_;
+GLenum GLES2DecoderImpl::GetBoundColorDrawBufferInternalFormat(
+ GLint drawbuffer_i) {
+ DCHECK(drawbuffer_i >= 0 &&
+ drawbuffer_i < static_cast<GLint>(group_->max_draw_buffers()));
+ Framebuffer* framebuffer = GetFramebufferInfoForTarget(GL_DRAW_FRAMEBUFFER);
+ if (!framebuffer) {
+ return 0;
+ }
+ GLenum drawbuffer = static_cast<GLenum>(GL_DRAW_BUFFER0 + drawbuffer_i);
+ if (framebuffer->GetDrawBuffer(drawbuffer) == GL_NONE) {
+ return 0;
+ }
+ GLenum attachment = static_cast<GLenum>(GL_COLOR_ATTACHMENT0 + drawbuffer_i);
+ const Framebuffer::Attachment* buffer =
+ framebuffer->GetAttachment(attachment);
+ if (!buffer) {
+ return 0;
+ }
+ return buffer->internal_format();
+}
+
+void GLES2DecoderImpl::MarkDrawBufferAsCleared(
+ GLenum buffer, GLint drawbuffer_i) {
+ Framebuffer* framebuffer = GetFramebufferInfoForTarget(GL_DRAW_FRAMEBUFFER);
+ if (!framebuffer)
+ return;
+ GLenum attachment = 0;
+ switch (buffer) {
+ case GL_COLOR:
+ DCHECK(drawbuffer_i >= 0 &&
+ drawbuffer_i < static_cast<GLint>(group_->max_draw_buffers()));
+ attachment = static_cast<GLenum>(GL_COLOR_ATTACHMENT0 + drawbuffer_i);
+ break;
+ case GL_DEPTH:
+ attachment = GL_DEPTH;
+ break;
+ case GL_STENCIL:
+ attachment = GL_STENCIL;
+ break;
+ default:
+ // Caller is responsible for breaking GL_DEPTH_STENCIL into GL_DEPTH and
+ // GL_STENCIL.
+ NOTREACHED();
}
+ framebuffer->MarkAttachmentAsCleared(
+ renderbuffer_manager(), texture_manager(), attachment, true);
}
void GLES2DecoderImpl::UpdateParentTextureInfo() {
@@ -3801,8 +3926,8 @@ Logger* GLES2DecoderImpl::GetLogger() {
void GLES2DecoderImpl::BeginDecoding() {
gpu_tracer_->BeginDecoding();
gpu_trace_commands_ = gpu_tracer_->IsTracing() && *gpu_decoder_category_;
- gpu_debug_commands_ = log_commands() || debug() || gpu_trace_commands_ ||
- (*cb_command_trace_category_ != 0);
+ gpu_debug_commands_ = log_commands() || debug() || gpu_trace_commands_;
+ query_manager_->ProcessFrameBeginUpdates();
}
void GLES2DecoderImpl::EndDecoding() {
@@ -3823,20 +3948,6 @@ void GLES2DecoderImpl::SetWaitSyncPointCallback(
wait_sync_point_callback_ = callback;
}
-AsyncPixelTransferManager*
- GLES2DecoderImpl::GetAsyncPixelTransferManager() {
- return async_pixel_transfer_manager_.get();
-}
-
-void GLES2DecoderImpl::ResetAsyncPixelTransferManagerForTest() {
- async_pixel_transfer_manager_.reset();
-}
-
-void GLES2DecoderImpl::SetAsyncPixelTransferManagerForTest(
- AsyncPixelTransferManager* manager) {
- async_pixel_transfer_manager_ = make_scoped_ptr(manager);
-}
-
bool GLES2DecoderImpl::GetServiceTextureId(uint32 client_texture_id,
uint32* service_texture_id) {
TextureRef* texture_ref = texture_manager()->GetTexture(client_texture_id);
@@ -3848,13 +3959,11 @@ bool GLES2DecoderImpl::GetServiceTextureId(uint32 client_texture_id,
}
uint32 GLES2DecoderImpl::GetTextureUploadCount() {
- return texture_state_.texture_upload_count +
- async_pixel_transfer_manager_->GetTextureUploadCount();
+ return texture_state_.texture_upload_count;
}
base::TimeDelta GLES2DecoderImpl::GetTotalTextureUploadTime() {
- return texture_state_.total_texture_upload_time +
- async_pixel_transfer_manager_->GetTotalTextureUploadTime();
+ return texture_state_.total_texture_upload_time;
}
base::TimeDelta GLES2DecoderImpl::GetTotalProcessingCommandsTime() {
@@ -3882,7 +3991,6 @@ void GLES2DecoderImpl::Destroy(bool have_context) {
state_.bound_pixel_unpack_buffer = NULL;
state_.bound_transform_feedback_buffer = NULL;
state_.bound_uniform_buffer = NULL;
- state_.current_queries.clear();
framebuffer_state_.bound_read_framebuffer = NULL;
framebuffer_state_.bound_draw_framebuffer = NULL;
state_.bound_renderbuffer = NULL;
@@ -4000,10 +4108,6 @@ void GLES2DecoderImpl::Destroy(bool have_context) {
fragment_translator_ = NULL;
vertex_translator_ = NULL;
- // Should destroy the transfer manager before the texture manager held
- // by the context group.
- async_pixel_transfer_manager_.reset();
-
// Destroy the GPU Tracer which may own some in process GPU Timings.
if (gpu_tracer_) {
gpu_tracer_->Destroy(have_context);
@@ -4152,8 +4256,7 @@ bool GLES2DecoderImpl::ResizeOffscreenFrameBuffer(const gfx::Size& size) {
// Clear the target frame buffer.
{
ScopedFrameBufferBinder binder(this, offscreen_target_frame_buffer_->id());
- glClearColor(0, 0, 0, (GLES2Util::GetChannelsForFormat(
- offscreen_target_color_format_) & 0x0008) != 0 ? 0 : 1.f);
+ glClearColor(0, 0, 0, BackBufferHasAlpha() ? 0 : 1.f);
state_.SetDeviceColorMask(GL_TRUE, GL_TRUE, GL_TRUE, GL_TRUE);
glClearStencil(0);
state_.SetDeviceStencilMaskSeparate(GL_FRONT, kDefaultStencilMask);
@@ -4268,14 +4371,9 @@ error::Error GLES2DecoderImpl::DoCommandsImpl(unsigned int num_commands,
break;
}
- if (DebugImpl) {
- TRACE_EVENT_BEGIN0(TRACE_DISABLED_BY_DEFAULT("cb_command"),
- GetCommandName(command));
-
- if (log_commands()) {
- LOG(ERROR) << "[" << logger_.GetLogPrefix() << "]"
- << "cmd: " << GetCommandName(command);
- }
+ if (DebugImpl && log_commands()) {
+ LOG(ERROR) << "[" << logger_.GetLogPrefix() << "]"
+ << "cmd: " << GetCommandName(command);
}
const unsigned int arg_count = size - 1;
@@ -4319,11 +4417,6 @@ error::Error GLES2DecoderImpl::DoCommandsImpl(unsigned int num_commands,
result = DoCommonCommand(command, arg_count, cmd_data);
}
- if (DebugImpl) {
- TRACE_EVENT_END0(TRACE_DISABLED_BY_DEFAULT("cb_command"),
- GetCommandName(command));
- }
-
if (result == error::kNoError &&
current_decoder_error_ != error::kNoError) {
result = current_decoder_error_;
@@ -4366,7 +4459,7 @@ void GLES2DecoderImpl::RemoveBuffer(GLuint client_id) {
void GLES2DecoderImpl::DoFinish() {
glFinish();
- ProcessPendingReadPixels();
+ ProcessPendingReadPixels(true);
ProcessPendingQueries(true);
}
@@ -4419,15 +4512,70 @@ void GLES2DecoderImpl::DoBindBuffer(GLenum target, GLuint client_id) {
glBindBuffer(target, service_id);
}
-bool GLES2DecoderImpl::BoundFramebufferHasColorAttachmentWithAlpha(
- bool all_draw_buffers) {
+void GLES2DecoderImpl::DoBindBufferBase(GLenum target, GLuint index,
+ GLuint client_id) {
+ Buffer* buffer = NULL;
+ GLuint service_id = 0;
+ if (client_id != 0) {
+ buffer = GetBuffer(client_id);
+ if (!buffer) {
+ if (!group_->bind_generates_resource()) {
+ LOCAL_SET_GL_ERROR(GL_INVALID_OPERATION,
+ "glBindBufferBase",
+ "id not generated by glGenBuffers");
+ return;
+ }
+
+ // It's a new id so make a buffer for it.
+ glGenBuffersARB(1, &service_id);
+ CreateBuffer(client_id, service_id);
+ buffer = GetBuffer(client_id);
+ }
+ }
+ LogClientServiceForInfo(buffer, client_id, "glBindBufferBase");
+ if (buffer) {
+ // TODO(kbr): track indexed bound buffers.
+ service_id = buffer->service_id();
+ }
+ glBindBufferBase(target, index, service_id);
+}
+
+void GLES2DecoderImpl::DoBindBufferRange(GLenum target, GLuint index,
+ GLuint client_id,
+ GLintptr offset,
+ GLsizeiptr size) {
+ Buffer* buffer = NULL;
+ GLuint service_id = 0;
+ if (client_id != 0) {
+ buffer = GetBuffer(client_id);
+ if (!buffer) {
+ if (!group_->bind_generates_resource()) {
+ LOCAL_SET_GL_ERROR(GL_INVALID_OPERATION,
+ "glBindBufferRange",
+ "id not generated by glGenBuffers");
+ return;
+ }
+
+ // It's a new id so make a buffer for it.
+ glGenBuffersARB(1, &service_id);
+ CreateBuffer(client_id, service_id);
+ buffer = GetBuffer(client_id);
+ }
+ }
+ LogClientServiceForInfo(buffer, client_id, "glBindBufferRange");
+ if (buffer) {
+ // TODO(kbr): track indexed bound buffers.
+ service_id = buffer->service_id();
+ }
+ glBindBufferRange(target, index, service_id, offset, size);
+}
+
+bool GLES2DecoderImpl::BoundFramebufferHasColorAttachmentWithAlpha() {
Framebuffer* framebuffer =
GetFramebufferInfoForTarget(GL_DRAW_FRAMEBUFFER_EXT);
- if (!all_draw_buffers || !framebuffer) {
- return (GLES2Util::GetChannelsForFormat(
- GetBoundDrawFrameBufferInternalFormat()) & 0x0008) != 0;
- }
- return framebuffer->HasAlphaMRT();
+ if (framebuffer)
+ return framebuffer->HasAlphaMRT();
+ return BackBufferHasAlpha();
}
bool GLES2DecoderImpl::BoundFramebufferHasDepthAttachment() {
@@ -4457,7 +4605,7 @@ bool GLES2DecoderImpl::BoundFramebufferHasStencilAttachment() {
void GLES2DecoderImpl::ApplyDirtyState() {
if (framebuffer_state_.clear_state_dirty) {
- bool have_alpha = BoundFramebufferHasColorAttachmentWithAlpha(true);
+ bool have_alpha = BoundFramebufferHasColorAttachmentWithAlpha();
state_.SetDeviceColorMask(state_.color_mask_red,
state_.color_mask_green,
state_.color_mask_blue,
@@ -4904,7 +5052,7 @@ bool GLES2DecoderImpl::GetHelper(
if (glGetError() == GL_NO_ERROR)
return true;
}
- *params = GLES2Util::GetPreferredGLReadPixelsFormat(
+ *params = GLES2Util::GetGLReadPixelsImplementationFormat(
GetBoundReadFrameBufferInternalFormat());
}
return true;
@@ -4918,7 +5066,7 @@ bool GLES2DecoderImpl::GetHelper(
if (glGetError() == GL_NO_ERROR)
return true;
}
- *params = GLES2Util::GetPreferredGLReadPixelsType(
+ *params = GLES2Util::GetGLReadPixelsImplementationType(
GetBoundReadFrameBufferInternalFormat(),
GetBoundReadFrameBufferTextureType());
}
@@ -4963,6 +5111,20 @@ bool GLES2DecoderImpl::GetHelper(
}
return true;
}
+ case GL_READ_BUFFER:
+ *num_written = 1;
+ if (params) {
+ Framebuffer* framebuffer =
+ GetFramebufferInfoForTarget(GL_READ_FRAMEBUFFER);
+ GLenum read_buffer;
+ if (framebuffer) {
+ read_buffer = framebuffer->read_buffer();
+ } else {
+ read_buffer = back_buffer_read_buffer_;
+ }
+ *params = static_cast<GLint>(read_buffer);
+ }
+ return true;
}
}
switch (pname) {
@@ -5016,21 +5178,23 @@ bool GLES2DecoderImpl::GetHelper(
*num_written = 1;
if (params) {
GLint v = 0;
- if (feature_info_->gl_version_info().is_desktop_core_profile) {
- Framebuffer* framebuffer =
- GetFramebufferInfoForTarget(GL_DRAW_FRAMEBUFFER_EXT);
- if (framebuffer) {
- glGetFramebufferAttachmentParameterivEXT(
- GL_FRAMEBUFFER, GL_COLOR_ATTACHMENT0,
- GL_FRAMEBUFFER_ATTACHMENT_ALPHA_SIZE, &v);
- } else {
- v = (back_buffer_color_format_ == GL_RGBA ? 8 : 0);
+ Framebuffer* framebuffer =
+ GetFramebufferInfoForTarget(GL_DRAW_FRAMEBUFFER_EXT);
+ if (framebuffer) {
+ if (framebuffer->HasAlphaMRT() &&
+ framebuffer->HasSameInternalFormatsMRT()) {
+ if (feature_info_->gl_version_info().is_desktop_core_profile) {
+ glGetFramebufferAttachmentParameterivEXT(
+ GL_FRAMEBUFFER, GL_COLOR_ATTACHMENT0,
+ GL_FRAMEBUFFER_ATTACHMENT_ALPHA_SIZE, &v);
+ } else {
+ glGetIntegerv(GL_ALPHA_BITS, &v);
+ }
}
} else {
- glGetIntegerv(GL_ALPHA_BITS, &v);
+ v = (BackBufferHasAlpha() ? 8 : 0);
}
- params[0] =
- BoundFramebufferHasColorAttachmentWithAlpha(false) ? v : 0;
+ params[0] = v;
}
return true;
case GL_DEPTH_BITS:
@@ -5307,7 +5471,7 @@ bool GLES2DecoderImpl::GetHelper(
params[0] = framebuffer->GetDrawBuffer(pname);
} else { // backbuffer
if (pname == GL_DRAW_BUFFER0_ARB)
- params[0] = group_->draw_buffer();
+ params[0] = back_buffer_draw_buffer_;
else
params[0] = GL_NONE;
}
@@ -5411,6 +5575,13 @@ void GLES2DecoderImpl::DoGetProgramiv(
program->GetProgramiv(pname, params);
}
+void GLES2DecoderImpl::DoGetBufferParameteri64v(
+ GLenum target, GLenum pname, GLint64* params) {
+ // Just delegate it. Some validation is actually done before this.
+ buffer_manager()->ValidateAndDoGetBufferParameteri64v(
+ &state_, target, pname, params);
+}
+
void GLES2DecoderImpl::DoGetBufferParameteriv(
GLenum target, GLenum pname, GLint* params) {
// Just delegate it. Some validation is actually done before this.
@@ -5564,6 +5735,8 @@ error::Error GLES2DecoderImpl::DoClear(GLbitfield mask) {
DCHECK(!ShouldDeferDraws());
if (CheckBoundFramebuffersValid("glClear")) {
ApplyDirtyState();
+ // TODO(zmo): Filter out INTEGER/SIGNED INTEGER images to avoid
+ // undefined results.
ScopedRenderTo do_render(framebuffer_state_.bound_draw_framebuffer.get());
if (workarounds().gl_clear_broken) {
ScopedGLErrorSuppressor suppressor("GLES2DecoderImpl::ClearWorkaround",
@@ -5583,6 +5756,177 @@ error::Error GLES2DecoderImpl::DoClear(GLbitfield mask) {
return error::kNoError;
}
+void GLES2DecoderImpl::DoClearBufferiv(
+ GLenum buffer, GLint drawbuffer, const GLint* value) {
+ if (!CheckBoundDrawFramebufferValid("glClearBufferiv"))
+ return;
+ ApplyDirtyState();
+
+ switch (buffer) {
+ case GL_COLOR:
+ case GL_STENCIL:
+ break;
+ default:
+ LOCAL_SET_GL_ERROR(
+ GL_INVALID_ENUM, "glClearBufferiv", "invalid buffer");
+ return;
+ }
+ GLenum attachment = 0;
+ if (buffer == GL_COLOR) {
+ if (drawbuffer < 0 ||
+ drawbuffer >= static_cast<GLint>(group_->max_draw_buffers())) {
+ LOCAL_SET_GL_ERROR(
+ GL_INVALID_VALUE, "glClearBufferiv", "invalid drawBuffer");
+ return;
+ }
+ GLenum internal_format =
+ GetBoundColorDrawBufferInternalFormat(drawbuffer);
+ if (!GLES2Util::IsSignedIntegerFormat(internal_format)) {
+ // To avoid undefined results, return without calling the gl function.
+ return;
+ }
+ attachment = static_cast<GLenum>(GL_COLOR_ATTACHMENT0 + drawbuffer);
+ } else {
+ DCHECK(buffer == GL_STENCIL);
+ if (drawbuffer != 0) {
+ LOCAL_SET_GL_ERROR(
+ GL_INVALID_VALUE, "glClearBufferiv", "invalid drawBuffer");
+ return;
+ }
+ if (!BoundFramebufferHasStencilAttachment()) {
+ return;
+ }
+ attachment = GL_STENCIL_ATTACHMENT;
+ }
+ MarkDrawBufferAsCleared(buffer, drawbuffer);
+ {
+ ScopedRenderTo do_render(framebuffer_state_.bound_draw_framebuffer.get(),
+ attachment);
+ glClearBufferiv(buffer, drawbuffer, value);
+ }
+}
+
+void GLES2DecoderImpl::DoClearBufferuiv(
+ GLenum buffer, GLint drawbuffer, const GLuint* value) {
+ if (!CheckBoundDrawFramebufferValid("glClearBufferuiv"))
+ return;
+ ApplyDirtyState();
+
+ switch (buffer) {
+ case GL_COLOR:
+ break;
+ default:
+ LOCAL_SET_GL_ERROR(
+ GL_INVALID_ENUM, "glClearBufferuiv", "invalid buffer");
+ return;
+ }
+ if (drawbuffer < 0 ||
+ drawbuffer >= static_cast<GLint>(group_->max_draw_buffers())) {
+ LOCAL_SET_GL_ERROR(
+ GL_INVALID_VALUE, "glClearBufferuiv", "invalid drawBuffer");
+ return;
+ }
+ GLenum internal_format =
+ GetBoundColorDrawBufferInternalFormat(drawbuffer);
+ if (!GLES2Util::IsUnsignedIntegerFormat(internal_format)) {
+ // To avoid undefined results, return without calling the gl function.
+ return;
+ }
+ MarkDrawBufferAsCleared(buffer, drawbuffer);
+ GLenum attachment = static_cast<GLenum>(GL_COLOR_ATTACHMENT0 + drawbuffer);
+ {
+ ScopedRenderTo do_render(framebuffer_state_.bound_draw_framebuffer.get(),
+ attachment);
+ glClearBufferuiv(buffer, drawbuffer, value);
+ }
+}
+
+void GLES2DecoderImpl::DoClearBufferfv(
+ GLenum buffer, GLint drawbuffer, const GLfloat* value) {
+ if (!CheckBoundDrawFramebufferValid("glClearBufferfv"))
+ return;
+ ApplyDirtyState();
+
+ switch (buffer) {
+ case GL_COLOR:
+ case GL_DEPTH:
+ break;
+ default:
+ LOCAL_SET_GL_ERROR(
+ GL_INVALID_ENUM, "glClearBufferfv", "invalid buffer");
+ return;
+ }
+ GLenum attachment = 0;
+ if (buffer == GL_COLOR) {
+ if (drawbuffer < 0 ||
+ drawbuffer >= static_cast<GLint>(group_->max_draw_buffers())) {
+ LOCAL_SET_GL_ERROR(
+ GL_INVALID_VALUE, "glClearBufferfv", "invalid drawBuffer");
+ return;
+ }
+ GLenum internal_format =
+ GetBoundColorDrawBufferInternalFormat(drawbuffer);
+ if (GLES2Util::IsIntegerFormat(internal_format)) {
+ // To avoid undefined results, return without calling the gl function.
+ return;
+ }
+ attachment = static_cast<GLenum>(GL_COLOR_ATTACHMENT0 + drawbuffer);
+ } else {
+ DCHECK(buffer == GL_DEPTH);
+ if (drawbuffer != 0) {
+ LOCAL_SET_GL_ERROR(
+ GL_INVALID_VALUE, "glClearBufferfv", "invalid drawBuffer");
+ return;
+ }
+ if (!BoundFramebufferHasDepthAttachment()) {
+ return;
+ }
+ attachment = GL_DEPTH_ATTACHMENT;
+ }
+ MarkDrawBufferAsCleared(buffer, drawbuffer);
+ {
+ ScopedRenderTo do_render(framebuffer_state_.bound_draw_framebuffer.get(),
+ attachment);
+ glClearBufferfv(buffer, drawbuffer, value);
+ }
+}
+
+void GLES2DecoderImpl::DoClearBufferfi(
+ GLenum buffer, GLint drawbuffer, GLfloat depth, GLint stencil) {
+ if (!CheckBoundDrawFramebufferValid("glClearBufferfi"))
+ return;
+ ApplyDirtyState();
+
+ switch (buffer) {
+ case GL_DEPTH_STENCIL:
+ break;
+ default:
+ LOCAL_SET_GL_ERROR(
+ GL_INVALID_ENUM, "glClearBufferfi", "invalid buffer");
+ return;
+ }
+ if (drawbuffer != 0) {
+ LOCAL_SET_GL_ERROR(
+ GL_INVALID_VALUE, "glClearBufferfi", "invalid drawBuffer");
+ return;
+ }
+ if (!BoundFramebufferHasDepthAttachment() &&
+ !BoundFramebufferHasStencilAttachment()) {
+ return;
+ }
+ MarkDrawBufferAsCleared(GL_DEPTH, drawbuffer);
+ MarkDrawBufferAsCleared(GL_STENCIL, drawbuffer);
+ {
+ ScopedRenderTo do_render_depth(
+ framebuffer_state_.bound_draw_framebuffer.get(),
+ GL_DEPTH_ATTACHMENT);
+ ScopedRenderTo do_render_stencil(
+ framebuffer_state_.bound_draw_framebuffer.get(),
+ GL_STENCIL_ATTACHMENT);
+ glClearBufferfi(buffer, drawbuffer, depth, stencil);
+ }
+}
+
void GLES2DecoderImpl::DoFramebufferRenderbuffer(
GLenum target, GLenum attachment, GLenum renderbuffertarget,
GLuint client_renderbuffer_id) {
@@ -5655,15 +5999,16 @@ void GLES2DecoderImpl::ClearUnclearedAttachments(
}
GLbitfield clear_bits = 0;
if (framebuffer->HasUnclearedColorAttachments()) {
- glClearColor(
- 0.0f, 0.0f, 0.0f,
- (GLES2Util::GetChannelsForFormat(
- framebuffer->GetColorAttachmentFormat()) & 0x0008) != 0 ? 0.0f :
- 1.0f);
+ // We should always use alpha == 0 here, because 1) some draw buffers may
+ // have alpha and some may not; 2) we won't have the same situation as the
+ // back buffer where alpha channel exists but is not requested.
+ glClearColor(0.0f, 0.0f, 0.0f, 0.0f);
state_.SetDeviceColorMask(GL_TRUE, GL_TRUE, GL_TRUE, GL_TRUE);
clear_bits |= GL_COLOR_BUFFER_BIT;
- if (feature_info_->feature_flags().ext_draw_buffers)
+ if (feature_info_->feature_flags().ext_draw_buffers ||
+ feature_info_->IsES3Enabled()) {
framebuffer->PrepareDrawBuffersForClear();
+ }
}
if (framebuffer->HasUnclearedAttachment(GL_STENCIL_ATTACHMENT) ||
@@ -5685,8 +6030,16 @@ void GLES2DecoderImpl::ClearUnclearedAttachments(
glClear(clear_bits);
if ((clear_bits & GL_COLOR_BUFFER_BIT) != 0 &&
- feature_info_->feature_flags().ext_draw_buffers)
+ (feature_info_->feature_flags().ext_draw_buffers ||
+ feature_info_->IsES3Enabled())) {
framebuffer->RestoreDrawBuffersAfterClear();
+ }
+
+ if (feature_info_->IsES3Enabled()) {
+ // TODO(zmo): track more state to know whether there are any integer
+ // buffers attached to the current framebuffer.
+ framebuffer->ClearIntegerBuffers();
+ }
framebuffer_manager()->MarkAttachmentsAsCleared(
framebuffer, renderbuffer_manager(), texture_manager());
@@ -5832,24 +6185,72 @@ void GLES2DecoderImpl::DoFramebufferTextureLayer(
void GLES2DecoderImpl::DoGetFramebufferAttachmentParameteriv(
GLenum target, GLenum attachment, GLenum pname, GLint* params) {
+ const char kFunctionName[] = "glGetFramebufferAttachmentParameteriv";
Framebuffer* framebuffer = GetFramebufferInfoForTarget(target);
if (!framebuffer) {
- LOCAL_SET_GL_ERROR(
- GL_INVALID_OPERATION,
- "glGetFramebufferAttachmentParameteriv", "no framebuffer bound");
- return;
+ if (!unsafe_es3_apis_enabled()) {
+ LOCAL_SET_GL_ERROR(GL_INVALID_OPERATION, kFunctionName,
+ "no framebuffer bound");
+ return;
+ }
+ if (!validators_->backbuffer_attachment.IsValid(attachment)) {
+ LOCAL_SET_GL_ERROR(GL_INVALID_OPERATION, kFunctionName,
+ "invalid attachment for backbuffer");
+ return;
+ }
+ switch (pname) {
+ case GL_FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE:
+ *params = static_cast<GLint>(GL_FRAMEBUFFER_DEFAULT);
+ return;
+ case GL_FRAMEBUFFER_ATTACHMENT_RED_SIZE:
+ case GL_FRAMEBUFFER_ATTACHMENT_GREEN_SIZE:
+ case GL_FRAMEBUFFER_ATTACHMENT_BLUE_SIZE:
+ case GL_FRAMEBUFFER_ATTACHMENT_ALPHA_SIZE:
+ case GL_FRAMEBUFFER_ATTACHMENT_DEPTH_SIZE:
+ case GL_FRAMEBUFFER_ATTACHMENT_STENCIL_SIZE:
+ case GL_FRAMEBUFFER_ATTACHMENT_COMPONENT_TYPE:
+ case GL_FRAMEBUFFER_ATTACHMENT_COLOR_ENCODING:
+ // Delegate to underlying driver.
+ break;
+ default:
+ LOCAL_SET_GL_ERROR(GL_INVALID_ENUM, kFunctionName,
+ "invalid pname for backbuffer");
+ return;
+ }
+ if (GetBackbufferServiceId() != 0) { // Emulated backbuffer.
+ switch (attachment) {
+ case GL_BACK:
+ attachment = GL_COLOR_ATTACHMENT0;
+ break;
+ case GL_DEPTH:
+ attachment = GL_DEPTH_ATTACHMENT;
+ break;
+ case GL_STENCIL:
+ attachment = GL_STENCIL_ATTACHMENT;
+ break;
+ default:
+ NOTREACHED();
+ break;
+ }
+ }
+ }
+ if (pname == GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_SAMPLES_EXT &&
+ features().use_img_for_multisampled_render_to_texture) {
+ pname = GL_TEXTURE_SAMPLES_IMG;
}
if (pname == GL_FRAMEBUFFER_ATTACHMENT_OBJECT_NAME) {
+ DCHECK(framebuffer);
+ // If we query from the driver, it will be service ID; however, we need to
+ // return the client ID here.
const Framebuffer::Attachment* attachment_object =
framebuffer->GetAttachment(attachment);
*params = attachment_object ? attachment_object->object_name() : 0;
- } else {
- if (pname == GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_SAMPLES_EXT &&
- features().use_img_for_multisampled_render_to_texture) {
- pname = GL_TEXTURE_SAMPLES_IMG;
- }
- glGetFramebufferAttachmentParameterivEXT(target, attachment, pname, params);
+ return;
}
+
+ glGetFramebufferAttachmentParameterivEXT(target, attachment, pname, params);
+ // We didn't perform a full error check before gl call.
+ LOCAL_PEEK_GL_ERROR(kFunctionName);
}
void GLES2DecoderImpl::DoGetRenderbufferParameteriv(
@@ -6267,6 +6668,47 @@ void GLES2DecoderImpl::DoLinkProgram(GLuint program_id) {
ExitCommandProcessingEarly();
}
+void GLES2DecoderImpl::DoReadBuffer(GLenum src) {
+ switch (src) {
+ case GL_NONE:
+ case GL_BACK:
+ break;
+ default:
+ {
+ GLenum upper_limit = static_cast<GLenum>(
+ group_->max_color_attachments() + GL_COLOR_ATTACHMENT0);
+ if (src < GL_COLOR_ATTACHMENT0 || src >= upper_limit) {
+ LOCAL_SET_GL_ERROR(
+ GL_INVALID_ENUM, "glReadBuffer", "invalid enum for src");
+ return;
+ }
+ }
+ break;
+ }
+
+ Framebuffer* framebuffer = GetFramebufferInfoForTarget(GL_READ_FRAMEBUFFER);
+ if (framebuffer) {
+ if (src == GL_BACK) {
+ LOCAL_SET_GL_ERROR(
+ GL_INVALID_ENUM, "glReadBuffer",
+ "invalid src for a named framebuffer");
+ return;
+ }
+ framebuffer->set_read_buffer(src);
+ } else {
+ if (src != GL_NONE && src != GL_BACK) {
+ LOCAL_SET_GL_ERROR(
+ GL_INVALID_ENUM, "glReadBuffer",
+ "invalid src for the default framebuffer");
+ return;
+ }
+ back_buffer_read_buffer_ = src;
+ if (GetBackbufferServiceId() && src == GL_BACK)
+ src = GL_COLOR_ATTACHMENT0;
+ }
+ glReadBuffer(src);
+}
+
void GLES2DecoderImpl::DoSamplerParameterfv(
GLuint sampler, GLenum pname, const GLfloat* params) {
DCHECK(params);
@@ -6533,6 +6975,21 @@ void GLES2DecoderImpl::DoUniform1iv(
glUniform1iv(real_location, count, value);
}
+void GLES2DecoderImpl::DoUniform1uiv(
+ GLint fake_location, GLsizei count, const GLuint *value) {
+ GLenum type = 0;
+ GLint real_location = -1;
+ if (!PrepForSetUniformByLocation(fake_location,
+ "glUniform1uiv",
+ Program::kUniform1ui,
+ &real_location,
+ &type,
+ &count)) {
+ return;
+ }
+ glUniform1uiv(real_location, count, value);
+}
+
void GLES2DecoderImpl::DoUniform1fv(
GLint fake_location, GLsizei count, const GLfloat* value) {
GLenum type = 0;
@@ -6643,6 +7100,21 @@ void GLES2DecoderImpl::DoUniform2iv(
glUniform2iv(real_location, count, value);
}
+void GLES2DecoderImpl::DoUniform2uiv(
+ GLint fake_location, GLsizei count, const GLuint* value) {
+ GLenum type = 0;
+ GLint real_location = -1;
+ if (!PrepForSetUniformByLocation(fake_location,
+ "glUniform2uiv",
+ Program::kUniform2ui,
+ &real_location,
+ &type,
+ &count)) {
+ return;
+ }
+ glUniform2uiv(real_location, count, value);
+}
+
void GLES2DecoderImpl::DoUniform3iv(
GLint fake_location, GLsizei count, const GLint* value) {
GLenum type = 0;
@@ -6658,6 +7130,21 @@ void GLES2DecoderImpl::DoUniform3iv(
glUniform3iv(real_location, count, value);
}
+void GLES2DecoderImpl::DoUniform3uiv(
+ GLint fake_location, GLsizei count, const GLuint* value) {
+ GLenum type = 0;
+ GLint real_location = -1;
+ if (!PrepForSetUniformByLocation(fake_location,
+ "glUniform3uiv",
+ Program::kUniform3ui,
+ &real_location,
+ &type,
+ &count)) {
+ return;
+ }
+ glUniform3uiv(real_location, count, value);
+}
+
void GLES2DecoderImpl::DoUniform4iv(
GLint fake_location, GLsizei count, const GLint* value) {
GLenum type = 0;
@@ -6673,6 +7160,21 @@ void GLES2DecoderImpl::DoUniform4iv(
glUniform4iv(real_location, count, value);
}
+void GLES2DecoderImpl::DoUniform4uiv(
+ GLint fake_location, GLsizei count, const GLuint* value) {
+ GLenum type = 0;
+ GLint real_location = -1;
+ if (!PrepForSetUniformByLocation(fake_location,
+ "glUniform4uiv",
+ Program::kUniform4ui,
+ &real_location,
+ &type,
+ &count)) {
+ return;
+ }
+ glUniform4uiv(real_location, count, value);
+}
+
void GLES2DecoderImpl::DoUniformMatrix2fv(
GLint fake_location, GLsizei count, GLboolean transpose,
const GLfloat* value) {
@@ -6721,6 +7223,102 @@ void GLES2DecoderImpl::DoUniformMatrix4fv(
glUniformMatrix4fv(real_location, count, transpose, value);
}
+void GLES2DecoderImpl::DoUniformMatrix2x3fv(
+ GLint fake_location, GLsizei count, GLboolean transpose,
+ const GLfloat* value) {
+ GLenum type = 0;
+ GLint real_location = -1;
+ if (!PrepForSetUniformByLocation(fake_location,
+ "glUniformMatrix2x3fv",
+ Program::kUniformMatrix2x3f,
+ &real_location,
+ &type,
+ &count)) {
+ return;
+ }
+ glUniformMatrix2x3fv(real_location, count, transpose, value);
+}
+
+void GLES2DecoderImpl::DoUniformMatrix2x4fv(
+ GLint fake_location, GLsizei count, GLboolean transpose,
+ const GLfloat* value) {
+ GLenum type = 0;
+ GLint real_location = -1;
+ if (!PrepForSetUniformByLocation(fake_location,
+ "glUniformMatrix2x4fv",
+ Program::kUniformMatrix2x4f,
+ &real_location,
+ &type,
+ &count)) {
+ return;
+ }
+ glUniformMatrix2x4fv(real_location, count, transpose, value);
+}
+
+void GLES2DecoderImpl::DoUniformMatrix3x2fv(
+ GLint fake_location, GLsizei count, GLboolean transpose,
+ const GLfloat* value) {
+ GLenum type = 0;
+ GLint real_location = -1;
+ if (!PrepForSetUniformByLocation(fake_location,
+ "glUniformMatrix3x2fv",
+ Program::kUniformMatrix3x2f,
+ &real_location,
+ &type,
+ &count)) {
+ return;
+ }
+ glUniformMatrix3x2fv(real_location, count, transpose, value);
+}
+
+void GLES2DecoderImpl::DoUniformMatrix3x4fv(
+ GLint fake_location, GLsizei count, GLboolean transpose,
+ const GLfloat* value) {
+ GLenum type = 0;
+ GLint real_location = -1;
+ if (!PrepForSetUniformByLocation(fake_location,
+ "glUniformMatrix3x4fv",
+ Program::kUniformMatrix3x4f,
+ &real_location,
+ &type,
+ &count)) {
+ return;
+ }
+ glUniformMatrix3x4fv(real_location, count, transpose, value);
+}
+
+void GLES2DecoderImpl::DoUniformMatrix4x2fv(
+ GLint fake_location, GLsizei count, GLboolean transpose,
+ const GLfloat* value) {
+ GLenum type = 0;
+ GLint real_location = -1;
+ if (!PrepForSetUniformByLocation(fake_location,
+ "glUniformMatrix4x2fv",
+ Program::kUniformMatrix4x2f,
+ &real_location,
+ &type,
+ &count)) {
+ return;
+ }
+ glUniformMatrix4x2fv(real_location, count, transpose, value);
+}
+
+void GLES2DecoderImpl::DoUniformMatrix4x3fv(
+ GLint fake_location, GLsizei count, GLboolean transpose,
+ const GLfloat* value) {
+ GLenum type = 0;
+ GLint real_location = -1;
+ if (!PrepForSetUniformByLocation(fake_location,
+ "glUniformMatrix4x3fv",
+ Program::kUniformMatrix4x3f,
+ &real_location,
+ &type,
+ &count)) {
+ return;
+ }
+ glUniformMatrix4x3fv(real_location, count, transpose, value);
+}
+
void GLES2DecoderImpl::DoUseProgram(GLuint program_id) {
GLuint service_id = 0;
Program* program = NULL;
@@ -6800,7 +7398,6 @@ bool GLES2DecoderImpl::PrepareTexturesForRender() {
!texture_manager()->HaveImages()) {
return true;
}
-
bool textures_set = false;
const Program::SamplerIndices& sampler_indices =
state_.current_program->sampler_indices();
@@ -6824,11 +7421,11 @@ bool GLES2DecoderImpl::PrepareTexturesForRender() {
if (!texture_ref) {
LOCAL_RENDER_WARNING(
std::string("there is no texture bound to the unit ") +
- base::IntToString(texture_unit_index));
+ base::UintToString(texture_unit_index));
} else {
LOCAL_RENDER_WARNING(
std::string("texture bound to texture unit ") +
- base::IntToString(texture_unit_index) +
+ base::UintToString(texture_unit_index) +
" is not renderable. It maybe non-power-of-2 and have"
" incompatible texture filtering.");
}
@@ -7027,7 +7624,7 @@ bool GLES2DecoderImpl::SimulateAttrib0(
glVertexAttribPointer(0, 4, GL_FLOAT, GL_FALSE, 0, NULL);
- if (attrib->divisor())
+ if (feature_info_->feature_flags().angle_instanced_arrays)
glVertexAttribDivisorANGLE(0, 0);
*simulated = true;
@@ -7046,7 +7643,13 @@ void GLES2DecoderImpl::RestoreStateForAttrib(
attrib_index, attrib->size(), attrib->type(), attrib->normalized(),
attrib->gl_stride(), ptr);
}
- if (attrib->divisor())
+
+ // Attrib divisors should only be non-zero when the ANGLE_instanced_arrays
+ // extension is available
+ DCHECK(attrib->divisor() == 0 ||
+ feature_info_->feature_flags().angle_instanced_arrays);
+
+ if (feature_info_->feature_flags().angle_instanced_arrays)
glVertexAttribDivisorANGLE(attrib_index, attrib->divisor());
glBindBuffer(
GL_ARRAY_BUFFER, state_.bound_array_buffer.get() ?
@@ -7493,8 +8096,6 @@ void GLES2DecoderImpl::DoTransformFeedbackVaryings(
return;
}
program->TransformFeedbackVaryings(count, varyings, buffer_mode);
- glTransformFeedbackVaryings(
- program->service_id(), count, varyings, buffer_mode);
}
void GLES2DecoderImpl::DoCompileShader(GLuint client_id) {
@@ -7505,7 +8106,7 @@ void GLES2DecoderImpl::DoCompileShader(GLuint client_id) {
}
scoped_refptr<ShaderTranslatorInterface> translator;
- if (use_shader_translator_) {
+ if (!feature_info_->disable_shader_translator()) {
translator = shader->shader_type() == GL_VERTEX_SHADER ?
vertex_translator_ : fragment_translator_;
}
@@ -8334,22 +8935,100 @@ error::Error GLES2DecoderImpl::HandleReadPixels(uint32 immediate_data_size,
LOCAL_SET_GL_ERROR_INVALID_ENUM("glReadPixels", type, "type");
return error::kNoError;
}
- if ((format != GL_RGBA && format != GL_BGRA_EXT && format != GL_RGB &&
- format != GL_ALPHA) || type != GL_UNSIGNED_BYTE) {
+
+ GLenum src_internal_format = GetBoundReadFrameBufferInternalFormat();
+ if (src_internal_format == 0) {
+ LOCAL_SET_GL_ERROR(GL_INVALID_VALUE, "glReadPixels",
+ "no valid read buffer source");
+ return error::kNoError;
+ }
+ std::vector<GLenum> accepted_formats;
+ std::vector<GLenum> accepted_types;
+ switch (src_internal_format) {
+ case GL_R8UI:
+ case GL_R16UI:
+ case GL_R32UI:
+ case GL_RG8UI:
+ case GL_RG16UI:
+ case GL_RG32UI:
+ // All the RGB_INTEGER formats are not renderable.
+ case GL_RGBA8UI:
+ case GL_RGB10_A2UI:
+ case GL_RGBA16UI:
+ case GL_RGBA32UI:
+ accepted_formats.push_back(GL_RGBA_INTEGER);
+ accepted_types.push_back(GL_UNSIGNED_INT);
+ break;
+ case GL_R8I:
+ case GL_R16I:
+ case GL_R32I:
+ case GL_RG8I:
+ case GL_RG16I:
+ case GL_RG32I:
+ case GL_RGBA8I:
+ case GL_RGBA16I:
+ case GL_RGBA32I:
+ accepted_formats.push_back(GL_RGBA_INTEGER);
+ accepted_types.push_back(GL_INT);
+ break;
+ case GL_RGB10_A2:
+ accepted_formats.push_back(GL_RGBA);
+ accepted_types.push_back(GL_UNSIGNED_BYTE);
+ // Special case with an extra supported format/type.
+ accepted_formats.push_back(GL_RGBA);
+ accepted_types.push_back(GL_UNSIGNED_INT_2_10_10_10_REV);
+ break;
+ default:
+ accepted_formats.push_back(GL_RGBA);
+ {
+ GLenum src_type = GetBoundReadFrameBufferTextureType();
+ switch (src_type) {
+ case GL_HALF_FLOAT:
+ case GL_HALF_FLOAT_OES:
+ case GL_FLOAT:
+ case GL_UNSIGNED_INT_10F_11F_11F_REV:
+ if (!feature_info_->IsES3Enabled()) {
+ accepted_types.push_back(GL_UNSIGNED_BYTE);
+ } else {
+ accepted_types.push_back(GL_FLOAT);
+ }
+ break;
+ default:
+ accepted_types.push_back(GL_UNSIGNED_BYTE);
+ break;
+ }
+ }
+ break;
+ }
+ if (!feature_info_->IsWebGLContext()) {
+ accepted_formats.push_back(GL_BGRA_EXT);
+ accepted_types.push_back(GL_UNSIGNED_BYTE);
+ }
+ DCHECK_EQ(accepted_formats.size(), accepted_types.size());
+ bool format_type_acceptable = false;
+ for (size_t ii = 0; ii < accepted_formats.size(); ++ii) {
+ if (format == accepted_formats[ii] && type == accepted_types[ii]) {
+ format_type_acceptable = true;
+ break;
+ }
+ }
+ if (!format_type_acceptable) {
// format and type are acceptable enums but not guaranteed to be supported
// for this framebuffer. Have to ask gl if they are valid.
GLint preferred_format = 0;
DoGetIntegerv(GL_IMPLEMENTATION_COLOR_READ_FORMAT, &preferred_format);
GLint preferred_type = 0;
DoGetIntegerv(GL_IMPLEMENTATION_COLOR_READ_TYPE, &preferred_type);
- if (format != static_cast<GLenum>(preferred_format) ||
- type != static_cast<GLenum>(preferred_type)) {
- LOCAL_SET_GL_ERROR(
- GL_INVALID_OPERATION, "glReadPixels", "format and type incompatible "
- "with the current read framebuffer");
- return error::kNoError;
+ if (format == static_cast<GLenum>(preferred_format) &&
+ type == static_cast<GLenum>(preferred_type)) {
+ format_type_acceptable = true;
}
}
+ if (!format_type_acceptable) {
+ LOCAL_SET_GL_ERROR(GL_INVALID_OPERATION, "glReadPixels",
+ "format and type incompatible with the current read framebuffer");
+ return error::kNoError;
+ }
if (width == 0 || height == 0) {
return error::kNoError;
}
@@ -8365,10 +9044,6 @@ error::Error GLES2DecoderImpl::HandleReadPixels(uint32 immediate_data_size,
return error::kNoError;
}
- if (!CheckBoundReadFramebufferColorAttachment("glReadPixels")) {
- return error::kNoError;
- }
-
if (!CheckBoundFramebuffersValid("glReadPixels")) {
return error::kNoError;
}
@@ -8826,7 +9501,7 @@ error::Error GLES2DecoderImpl::HandleGetString(uint32 immediate_data_size,
case GL_VENDOR:
// Return the unmasked VENDOR/RENDERER string for WebGL contexts.
// They are used by WEBGL_debug_renderer_info.
- if (!IsWebGLContext())
+ if (!feature_info_->IsWebGLContext())
str = "Chromium";
else
str = reinterpret_cast<const char*>(glGetString(name));
@@ -8835,7 +9510,7 @@ error::Error GLES2DecoderImpl::HandleGetString(uint32 immediate_data_size,
{
// For WebGL contexts, strip out the OES derivatives and
// EXT frag depth extensions if they have not been enabled.
- if (IsWebGLContext()) {
+ if (feature_info_->IsWebGLContext()) {
extensions = feature_info_->extensions();
if (!derivatives_explicitly_enabled_) {
size_t offset = extensions.find(kOESDerivativeExtension);
@@ -8920,8 +9595,9 @@ bool GLES2DecoderImpl::ClearLevel(Texture* texture,
int width,
int height) {
uint32 channels = GLES2Util::GetChannelsForFormat(format);
- if (feature_info_->feature_flags().angle_depth_texture &&
- (channels & GLES2Util::kDepth) != 0) {
+ if ((feature_info_->feature_flags().angle_depth_texture ||
+ feature_info_->IsES3Enabled())
+ && (channels & GLES2Util::kDepth) != 0) {
// It's a depth format and ANGLE doesn't allow texImage2D or texSubImage2D
// on depth formats.
GLuint fb = 0;
@@ -9011,12 +9687,34 @@ bool GLES2DecoderImpl::ClearLevel(Texture* texture,
namespace {
+const int kASTCBlockSize = 16;
const int kS3TCBlockWidth = 4;
const int kS3TCBlockHeight = 4;
const int kS3TCDXT1BlockSize = 8;
const int kS3TCDXT3AndDXT5BlockSize = 16;
const int kEACAndETC2BlockSize = 4;
+typedef struct {
+ int blockWidth;
+ int blockHeight;
+} ASTCBlockArray;
+
+const ASTCBlockArray kASTCBlockArray[] = {
+ {4, 4}, /* GL_COMPRESSED_RGBA_ASTC_4x4_KHR */
+ {5, 4}, /* and GL_COMPRESSED_SRGB8_ALPHA8_ASTC_4x4_KHR */
+ {5, 5},
+ {6, 5},
+ {6, 6},
+ {8, 5},
+ {8, 6},
+ {8, 8},
+ {10, 5},
+ {10, 6},
+ {10, 8},
+ {10, 10},
+ {12, 10},
+ {12, 12}};
+
bool IsValidDXTSize(GLint level, GLsizei size) {
return (size == 1) ||
(size == 2) || !(size % kS3TCBlockWidth);
@@ -9044,6 +9742,49 @@ bool GLES2DecoderImpl::GetCompressedTexSizeInBytes(
(height + kS3TCBlockHeight - 1) / kS3TCBlockHeight;
bytes_required *= kS3TCDXT1BlockSize;
break;
+ case GL_COMPRESSED_RGBA_ASTC_4x4_KHR:
+ case GL_COMPRESSED_RGBA_ASTC_5x4_KHR:
+ case GL_COMPRESSED_RGBA_ASTC_5x5_KHR:
+ case GL_COMPRESSED_RGBA_ASTC_6x5_KHR:
+ case GL_COMPRESSED_RGBA_ASTC_6x6_KHR:
+ case GL_COMPRESSED_RGBA_ASTC_8x5_KHR:
+ case GL_COMPRESSED_RGBA_ASTC_8x6_KHR:
+ case GL_COMPRESSED_RGBA_ASTC_8x8_KHR:
+ case GL_COMPRESSED_RGBA_ASTC_10x5_KHR:
+ case GL_COMPRESSED_RGBA_ASTC_10x6_KHR:
+ case GL_COMPRESSED_RGBA_ASTC_10x8_KHR:
+ case GL_COMPRESSED_RGBA_ASTC_10x10_KHR:
+ case GL_COMPRESSED_RGBA_ASTC_12x10_KHR:
+ case GL_COMPRESSED_RGBA_ASTC_12x12_KHR:
+ case GL_COMPRESSED_SRGB8_ALPHA8_ASTC_4x4_KHR:
+ case GL_COMPRESSED_SRGB8_ALPHA8_ASTC_5x4_KHR:
+ case GL_COMPRESSED_SRGB8_ALPHA8_ASTC_5x5_KHR:
+ case GL_COMPRESSED_SRGB8_ALPHA8_ASTC_6x5_KHR:
+ case GL_COMPRESSED_SRGB8_ALPHA8_ASTC_6x6_KHR:
+ case GL_COMPRESSED_SRGB8_ALPHA8_ASTC_8x5_KHR:
+ case GL_COMPRESSED_SRGB8_ALPHA8_ASTC_8x6_KHR:
+ case GL_COMPRESSED_SRGB8_ALPHA8_ASTC_8x8_KHR:
+ case GL_COMPRESSED_SRGB8_ALPHA8_ASTC_10x5_KHR:
+ case GL_COMPRESSED_SRGB8_ALPHA8_ASTC_10x6_KHR:
+ case GL_COMPRESSED_SRGB8_ALPHA8_ASTC_10x8_KHR:
+ case GL_COMPRESSED_SRGB8_ALPHA8_ASTC_10x10_KHR:
+ case GL_COMPRESSED_SRGB8_ALPHA8_ASTC_12x10_KHR:
+ case GL_COMPRESSED_SRGB8_ALPHA8_ASTC_12x12_KHR: {
+ const int index = (format < GL_COMPRESSED_SRGB8_ALPHA8_ASTC_4x4_KHR) ?
+ static_cast<int>(format - GL_COMPRESSED_RGBA_ASTC_4x4_KHR) :
+ static_cast<int>(format - GL_COMPRESSED_SRGB8_ALPHA8_ASTC_4x4_KHR);
+
+ const int kBlockWidth = kASTCBlockArray[index].blockWidth;
+ const int kBlockHeight = kASTCBlockArray[index].blockHeight;
+
+ bytes_required =
+ (width + kBlockWidth - 1) / kBlockWidth;
+ bytes_required *=
+ (height + kBlockHeight - 1) / kBlockHeight;
+
+ bytes_required *= kASTCBlockSize;
+ break;
+ }
case GL_ATC_RGBA_EXPLICIT_ALPHA_AMD:
case GL_ATC_RGBA_INTERPOLATED_ALPHA_AMD:
case GL_COMPRESSED_RGBA_S3TC_DXT3_EXT:
@@ -9144,6 +9885,34 @@ bool GLES2DecoderImpl::ValidateCompressedTexDimensions(
return false;
}
return true;
+ case GL_COMPRESSED_RGBA_ASTC_4x4_KHR:
+ case GL_COMPRESSED_RGBA_ASTC_5x4_KHR:
+ case GL_COMPRESSED_RGBA_ASTC_5x5_KHR:
+ case GL_COMPRESSED_RGBA_ASTC_6x5_KHR:
+ case GL_COMPRESSED_RGBA_ASTC_6x6_KHR:
+ case GL_COMPRESSED_RGBA_ASTC_8x5_KHR:
+ case GL_COMPRESSED_RGBA_ASTC_8x6_KHR:
+ case GL_COMPRESSED_RGBA_ASTC_8x8_KHR:
+ case GL_COMPRESSED_RGBA_ASTC_10x5_KHR:
+ case GL_COMPRESSED_RGBA_ASTC_10x6_KHR:
+ case GL_COMPRESSED_RGBA_ASTC_10x8_KHR:
+ case GL_COMPRESSED_RGBA_ASTC_10x10_KHR:
+ case GL_COMPRESSED_RGBA_ASTC_12x10_KHR:
+ case GL_COMPRESSED_RGBA_ASTC_12x12_KHR:
+ case GL_COMPRESSED_SRGB8_ALPHA8_ASTC_4x4_KHR:
+ case GL_COMPRESSED_SRGB8_ALPHA8_ASTC_5x4_KHR:
+ case GL_COMPRESSED_SRGB8_ALPHA8_ASTC_5x5_KHR:
+ case GL_COMPRESSED_SRGB8_ALPHA8_ASTC_6x5_KHR:
+ case GL_COMPRESSED_SRGB8_ALPHA8_ASTC_6x6_KHR:
+ case GL_COMPRESSED_SRGB8_ALPHA8_ASTC_8x5_KHR:
+ case GL_COMPRESSED_SRGB8_ALPHA8_ASTC_8x6_KHR:
+ case GL_COMPRESSED_SRGB8_ALPHA8_ASTC_8x8_KHR:
+ case GL_COMPRESSED_SRGB8_ALPHA8_ASTC_10x5_KHR:
+ case GL_COMPRESSED_SRGB8_ALPHA8_ASTC_10x6_KHR:
+ case GL_COMPRESSED_SRGB8_ALPHA8_ASTC_10x8_KHR:
+ case GL_COMPRESSED_SRGB8_ALPHA8_ASTC_10x10_KHR:
+ case GL_COMPRESSED_SRGB8_ALPHA8_ASTC_12x10_KHR:
+ case GL_COMPRESSED_SRGB8_ALPHA8_ASTC_12x12_KHR:
case GL_ATC_RGB_AMD:
case GL_ATC_RGBA_EXPLICIT_ALPHA_AMD:
case GL_ATC_RGBA_INTERPOLATED_ALPHA_AMD:
@@ -9321,6 +10090,14 @@ error::Error GLES2DecoderImpl::DoCompressedTexImage2D(
"glCompressedTexImage2D", target, "target");
return error::kNoError;
}
+ // TODO(ccameron): Add a separate texture from |texture_target| for
+ // [Compressed]Tex[Sub]Image2D and related functions.
+ // http://crbug.com/536854
+ if (target == GL_TEXTURE_RECTANGLE_ARB) {
+ LOCAL_SET_GL_ERROR_INVALID_ENUM(
+ "glCompressedTexImage2D", target, "target");
+ return error::kNoError;
+ }
if (!validators_->compressed_texture_format.IsValid(
internal_format)) {
LOCAL_SET_GL_ERROR_INVALID_ENUM(
@@ -9349,7 +10126,6 @@ error::Error GLES2DecoderImpl::DoCompressedTexImage2D(
"glCompressedTexImage2D", "texture is immutable");
return error::kNoError;
}
-
if (!ValidateCompressedTexDimensions("glCompressedTexImage2D", target, level,
width, height, 1, internal_format) ||
!ValidateCompressedTexFuncData("glCompressedTexImage2D", width, height,
@@ -9468,6 +10244,14 @@ error::Error GLES2DecoderImpl::HandleCompressedTexSubImage2DBucket(
GL_INVALID_ENUM, "glCompressedTexSubImage2D", "target");
return error::kNoError;
}
+ // TODO(ccameron): Add a separate texture from |texture_target| for
+ // [Compressed]Tex[Sub]Image2D and related functions.
+ // http://crbug.com/536854
+ if (target == GL_TEXTURE_RECTANGLE_ARB) {
+ LOCAL_SET_GL_ERROR(
+ GL_INVALID_ENUM, "glCompressedTexSubImage2D", "target");
+ return error::kNoError;
+ }
if (!validators_->compressed_texture_format.IsValid(format)) {
LOCAL_SET_GL_ERROR_INVALID_ENUM(
"glCompressedTexSubImage2D", format, "format");
@@ -9677,7 +10461,7 @@ void GLES2DecoderImpl::DoCompressedTexSubImage3D(
return;
}
if (!texture->ValidForTexture(target, level, xoffset, yoffset, zoffset,
- width, height, depth, type)) {
+ width, height, depth)) {
LOCAL_SET_GL_ERROR(GL_INVALID_VALUE, "glCompressedTexSubImage3D",
"bad dimensions");
return;
@@ -9884,7 +10668,7 @@ void GLES2DecoderImpl::DoCompressedTexSubImage2D(
return;
}
if (!texture->ValidForTexture(target, level, xoffset, yoffset, 0, width,
- height, 1, type)) {
+ height, 1)) {
LOCAL_SET_GL_ERROR(
GL_INVALID_VALUE, "glCompressedTexSubImage2D", "bad dimensions.");
return;
@@ -10094,17 +10878,11 @@ void GLES2DecoderImpl::DoCopyTexSubImage2D(
GLenum format = 0;
if (!texture->GetLevelType(target, level, &type, &format) ||
!texture->ValidForTexture(
- target, level, xoffset, yoffset, 0, width, height, 1, type)) {
+ target, level, xoffset, yoffset, 0, width, height, 1)) {
LOCAL_SET_GL_ERROR(
GL_INVALID_VALUE, "glCopyTexSubImage2D", "bad dimensions.");
return;
}
- if (async_pixel_transfer_manager_->AsyncTransferIsInProgress(texture_ref)) {
- LOCAL_SET_GL_ERROR(
- GL_INVALID_OPERATION,
- "glCopyTexSubImage2D", "async upload pending for texture");
- return;
- }
// Check we have compatible formats.
GLenum read_format = GetBoundReadFrameBufferInternalFormat();
@@ -10227,6 +11005,13 @@ bool GLES2DecoderImpl::ValidateTexSubImage2D(
LOCAL_SET_GL_ERROR_INVALID_ENUM(function_name, target, "target");
return false;
}
+ // TODO(ccameron): Add a separate texture from |texture_target| for
+ // [Compressed]Tex[Sub]Image2D and related functions.
+ // http://crbug.com/536854
+ if (target == GL_TEXTURE_RECTANGLE_ARB) {
+ LOCAL_SET_GL_ERROR_INVALID_ENUM(function_name, target, "target");
+ return false;
+ }
if (width < 0) {
LOCAL_SET_GL_ERROR(GL_INVALID_VALUE, function_name, "width < 0");
return false;
@@ -10255,25 +11040,20 @@ bool GLES2DecoderImpl::ValidateTexSubImage2D(
function_name, format, type, internal_format, level)) {
return false;
}
- if (type != current_type) {
+ if (type != current_type && !feature_info_->IsES3Enabled()) {
LOCAL_SET_GL_ERROR(
GL_INVALID_OPERATION,
function_name, "type does not match type of texture.");
return false;
}
- if (async_pixel_transfer_manager_->AsyncTransferIsInProgress(texture_ref)) {
- LOCAL_SET_GL_ERROR(
- GL_INVALID_OPERATION,
- function_name, "async upload pending for texture");
- return false;
- }
if (!texture->ValidForTexture(
- target, level, xoffset, yoffset, 0, width, height, 1, type)) {
+ target, level, xoffset, yoffset, 0, width, height, 1)) {
LOCAL_SET_GL_ERROR(GL_INVALID_VALUE, function_name, "bad dimensions.");
return false;
}
if ((GLES2Util::GetChannelsForFormat(format) &
- (GLES2Util::kDepth | GLES2Util::kStencil)) != 0) {
+ (GLES2Util::kDepth | GLES2Util::kStencil)) != 0
+ && !feature_info_->IsES3Enabled()) {
LOCAL_SET_GL_ERROR(
GL_INVALID_OPERATION,
function_name, "can not supply data for depth or stencil textures");
@@ -11011,7 +11791,7 @@ void GLES2DecoderImpl::DoSwapBuffers() {
}
ScopedGPUTrace scoped_gpu_trace(gpu_tracer_.get(), kTraceDecoder,
- "gpu_toplevel", "SwapBuffer");
+ "GLES2Decoder", "SwapBuffer");
bool is_tracing;
TRACE_EVENT_CATEGORY_GROUP_ENABLED(TRACE_DISABLED_BY_DEFAULT("gpu.debug"),
@@ -11177,7 +11957,7 @@ error::Error GLES2DecoderImpl::HandleGetRequestableExtensionsCHROMIUM(
cmd_data);
Bucket* bucket = CreateBucket(c.bucket_id);
scoped_refptr<FeatureInfo> info(new FeatureInfo());
- info->Initialize(disallowed_features_);
+ info->Initialize(feature_info_->context_type(), disallowed_features_);
bucket->SetFromString(info->extensions().c_str());
return error::kNoError;
}
@@ -11200,7 +11980,7 @@ error::Error GLES2DecoderImpl::HandleRequestExtensionCHROMIUM(
bool desire_frag_depth = false;
bool desire_draw_buffers = false;
bool desire_shader_texture_lod = false;
- if (IsWebGLContext()) {
+ if (feature_info_->IsWebGLContext()) {
desire_standard_derivatives =
feature_str.find("GL_OES_standard_derivatives") != std::string::npos;
desire_frag_depth =
@@ -11489,27 +12269,19 @@ bool GLES2DecoderImpl::GenQueriesEXTHelper(
void GLES2DecoderImpl::DeleteQueriesEXTHelper(
GLsizei n, const GLuint* client_ids) {
for (GLsizei ii = 0; ii < n; ++ii) {
- QueryManager::Query* query = query_manager_->GetQuery(client_ids[ii]);
- if (query && !query->IsDeleted()) {
- ContextState::QueryMap::iterator it =
- state_.current_queries.find(query->target());
- if (it != state_.current_queries.end())
- state_.current_queries.erase(it);
-
- query->Destroy(true);
- }
query_manager_->RemoveQuery(client_ids[ii]);
}
}
-bool GLES2DecoderImpl::ProcessPendingQueries(bool did_finish) {
- if (query_manager_.get() == NULL) {
- return false;
- }
- if (!query_manager_->ProcessPendingQueries(did_finish)) {
+bool GLES2DecoderImpl::HasPendingQueries() const {
+ return query_manager_.get() && query_manager_->HavePendingQueries();
+}
+
+void GLES2DecoderImpl::ProcessPendingQueries(bool did_finish) {
+ if (!query_manager_.get())
+ return;
+ if (!query_manager_->ProcessPendingQueries(did_finish))
current_decoder_error_ = error::kOutOfBounds;
- }
- return query_manager_->HavePendingQueries();
}
// Note that if there are no pending readpixels right now,
@@ -11522,9 +12294,13 @@ void GLES2DecoderImpl::WaitForReadPixels(base::Closure callback) {
}
}
-void GLES2DecoderImpl::ProcessPendingReadPixels() {
+void GLES2DecoderImpl::ProcessPendingReadPixels(bool did_finish) {
+ // Note: |did_finish| guarantees that the GPU has passed the fence but
+ // we cannot assume that GLFence::HasCompleted() will return true yet as
+ // that's not guaranteed by all GLFence implementations.
while (!pending_readpixel_fences_.empty() &&
- pending_readpixel_fences_.front()->fence->HasCompleted()) {
+ (did_finish ||
+ pending_readpixel_fences_.front()->fence->HasCompleted())) {
std::vector<base::Closure> callbacks =
pending_readpixel_fences_.front()->callbacks;
pending_readpixel_fences_.pop();
@@ -11534,17 +12310,14 @@ void GLES2DecoderImpl::ProcessPendingReadPixels() {
}
}
-bool GLES2DecoderImpl::HasMoreIdleWork() {
+bool GLES2DecoderImpl::HasMoreIdleWork() const {
return !pending_readpixel_fences_.empty() ||
- async_pixel_transfer_manager_->NeedsProcessMorePendingTransfers();
+ gpu_tracer_->HasTracesToProcess();
}
void GLES2DecoderImpl::PerformIdleWork() {
- ProcessPendingReadPixels();
- if (!async_pixel_transfer_manager_->NeedsProcessMorePendingTransfers())
- return;
- async_pixel_transfer_manager_->ProcessMorePendingTransfers();
- ProcessFinishedAsyncTransfers();
+ gpu_tracer_->ProcessTraces();
+ ProcessPendingReadPixels(false);
}
error::Error GLES2DecoderImpl::HandleBeginQueryEXT(uint32 immediate_data_size,
@@ -11559,7 +12332,6 @@ error::Error GLES2DecoderImpl::HandleBeginQueryEXT(uint32 immediate_data_size,
switch (target) {
case GL_COMMANDS_ISSUED_CHROMIUM:
case GL_LATENCY_QUERY_CHROMIUM:
- case GL_ASYNC_PIXEL_UNPACK_COMPLETED_CHROMIUM:
case GL_ASYNC_PIXEL_PACK_COMPLETED_CHROMIUM:
case GL_GET_ERROR_QUERY_CHROMIUM:
break;
@@ -11582,7 +12354,6 @@ error::Error GLES2DecoderImpl::HandleBeginQueryEXT(uint32 immediate_data_size,
}
break;
case GL_TIME_ELAPSED:
- // TODO(dyen): Also support GL_TIMESTAMP.
if (!query_manager_->GPUTimingAvailable()) {
LOCAL_SET_GL_ERROR(
GL_INVALID_OPERATION, "glBeginQueryEXT",
@@ -11590,14 +12361,19 @@ error::Error GLES2DecoderImpl::HandleBeginQueryEXT(uint32 immediate_data_size,
return error::kNoError;
}
break;
+ case GL_TRANSFORM_FEEDBACK_PRIMITIVES_WRITTEN:
+ if (feature_info_->IsES3Enabled()) {
+ break;
+ }
+ // Fall through.
default:
LOCAL_SET_GL_ERROR(
- GL_INVALID_OPERATION, "glBeginQueryEXT",
+ GL_INVALID_ENUM, "glBeginQueryEXT",
"unknown query target");
return error::kNoError;
}
- if (state_.current_queries.find(target) != state_.current_queries.end()) {
+ if (query_manager_->GetActiveQuery(target)) {
LOCAL_SET_GL_ERROR(
GL_INVALID_OPERATION, "glBeginQueryEXT", "query already in progress");
return error::kNoError;
@@ -11634,7 +12410,6 @@ error::Error GLES2DecoderImpl::HandleBeginQueryEXT(uint32 immediate_data_size,
return error::kOutOfBounds;
}
- state_.current_queries[target] = query;
return error::kNoError;
}
@@ -11644,22 +12419,75 @@ error::Error GLES2DecoderImpl::HandleEndQueryEXT(uint32 immediate_data_size,
*static_cast<const gles2::cmds::EndQueryEXT*>(cmd_data);
GLenum target = static_cast<GLenum>(c.target);
uint32 submit_count = static_cast<GLuint>(c.submit_count);
- ContextState::QueryMap::iterator it = state_.current_queries.find(target);
- if (it == state_.current_queries.end()) {
+ QueryManager::Query* query = query_manager_->GetActiveQuery(target);
+ if (!query) {
LOCAL_SET_GL_ERROR(
GL_INVALID_OPERATION, "glEndQueryEXT", "No active query");
return error::kNoError;
}
- QueryManager::Query* query = it->second.get();
if (!query_manager_->EndQuery(query, submit_count)) {
return error::kOutOfBounds;
}
query_manager_->ProcessPendingTransferQueries();
- state_.current_queries.erase(it);
+ return error::kNoError;
+}
+
+error::Error GLES2DecoderImpl::HandleQueryCounterEXT(uint32 immediate_data_size,
+ const void* cmd_data) {
+ const gles2::cmds::QueryCounterEXT& c =
+ *static_cast<const gles2::cmds::QueryCounterEXT*>(cmd_data);
+ GLuint client_id = static_cast<GLuint>(c.id);
+ GLenum target = static_cast<GLenum>(c.target);
+ int32 sync_shm_id = static_cast<int32>(c.sync_data_shm_id);
+ uint32 sync_shm_offset = static_cast<uint32>(c.sync_data_shm_offset);
+ uint32 submit_count = static_cast<GLuint>(c.submit_count);
+
+ switch (target) {
+ case GL_TIMESTAMP:
+ if (!query_manager_->GPUTimingAvailable()) {
+ LOCAL_SET_GL_ERROR(
+ GL_INVALID_OPERATION, "glQueryCounterEXT",
+ "not enabled for timing queries");
+ return error::kNoError;
+ }
+ break;
+ default:
+ LOCAL_SET_GL_ERROR(
+ GL_INVALID_ENUM, "glQueryCounterEXT",
+ "unknown query target");
+ return error::kNoError;
+ }
+
+ QueryManager::Query* query = query_manager_->GetQuery(client_id);
+ if (!query) {
+ if (!query_manager_->IsValidQuery(client_id)) {
+ LOCAL_SET_GL_ERROR(GL_INVALID_OPERATION,
+ "glQueryCounterEXT",
+ "id not made by glGenQueriesEXT");
+ return error::kNoError;
+ }
+ query = query_manager_->CreateQuery(
+ target, client_id, sync_shm_id, sync_shm_offset);
+ }
+ if (!query_manager_->QueryCounter(query, submit_count)) {
+ return error::kOutOfBounds;
+ }
+
+ return error::kNoError;
+}
+
+error::Error GLES2DecoderImpl::HandleSetDisjointValueSyncCHROMIUM(
+ uint32 immediate_data_size, const void* cmd_data) {
+ const gles2::cmds::SetDisjointValueSyncCHROMIUM& c =
+ *static_cast<const gles2::cmds::SetDisjointValueSyncCHROMIUM*>(cmd_data);
+ int32 sync_shm_id = static_cast<int32>(c.sync_data_shm_id);
+ uint32 sync_shm_offset = static_cast<uint32>(c.sync_data_shm_offset);
+
+ query_manager_->SetDisjointSync(sync_shm_id, sync_shm_offset);
return error::kNoError;
}
@@ -11752,6 +12580,12 @@ bool GLES2DecoderImpl::DoIsVertexArrayOES(GLuint client_id) {
return vao && vao->IsValid() && !vao->IsDeleted();
}
+bool GLES2DecoderImpl::DoIsPathCHROMIUM(GLuint client_id) {
+ GLuint service_id = 0;
+ return path_manager()->GetPath(client_id, &service_id) &&
+ glIsPathNV(service_id) == GL_TRUE;
+}
+
#if defined(OS_MACOSX)
void GLES2DecoderImpl::ReleaseIOSurfaceForTexture(GLuint texture_id) {
TextureToIOSurfaceMap::iterator it = texture_to_io_surface_map_.find(
@@ -11852,36 +12686,93 @@ void GLES2DecoderImpl::DoTexImageIOSurface2DCHROMIUM(
static GLenum ExtractFormatFromStorageFormat(GLenum internalformat) {
switch (internalformat) {
+ case GL_R8:
+ case GL_R8_SNORM:
+ case GL_R16F:
+ case GL_R32F:
+ return GL_RED;
+ case GL_R8UI:
+ case GL_R8I:
+ case GL_R16UI:
+ case GL_R16I:
+ case GL_R32UI:
+ case GL_R32I:
+ return GL_RED_INTEGER;
+ case GL_RG8:
+ case GL_RG8_SNORM:
+ case GL_RG16F:
+ case GL_RG32F:
+ return GL_RG;
+ case GL_RG8UI:
+ case GL_RG8I:
+ case GL_RG16UI:
+ case GL_RG16I:
+ case GL_RG32UI:
+ case GL_RG32I:
+ return GL_RG_INTEGER;
+ case GL_ATC_RGB_AMD:
+ case GL_COMPRESSED_RGB_PVRTC_2BPPV1_IMG:
+ case GL_COMPRESSED_RGB_PVRTC_4BPPV1_IMG:
+ case GL_COMPRESSED_RGB_S3TC_DXT1_EXT:
+ case GL_ETC1_RGB8_OES:
+ case GL_RGB8:
+ case GL_R11F_G11F_B10F:
case GL_RGB565:
+ case GL_RGB8_SNORM:
+ case GL_RGB9_E5:
+ case GL_RGB16F:
+ case GL_RGB32F:
return GL_RGB;
+ case GL_RGB8UI:
+ case GL_RGB8I:
+ case GL_RGB16UI:
+ case GL_RGB16I:
+ case GL_RGB32UI:
+ case GL_RGB32I:
+ return GL_RGB_INTEGER;
+ case GL_ATC_RGBA_EXPLICIT_ALPHA_AMD:
+ case GL_ATC_RGBA_INTERPOLATED_ALPHA_AMD:
+ case GL_COMPRESSED_RGBA_PVRTC_2BPPV1_IMG:
+ case GL_COMPRESSED_RGBA_PVRTC_4BPPV1_IMG:
+ case GL_COMPRESSED_RGBA_S3TC_DXT1_EXT:
+ case GL_COMPRESSED_RGBA_S3TC_DXT3_EXT:
+ case GL_COMPRESSED_RGBA_S3TC_DXT5_EXT:
+ case GL_RGBA8:
+ case GL_SRGB8_ALPHA8:
+ case GL_RGBA8_SNORM:
case GL_RGBA4:
- return GL_RGBA;
case GL_RGB5_A1:
+ case GL_RGB10_A2:
+ case GL_RGBA16F:
+ case GL_RGBA32F:
return GL_RGBA;
- case GL_RGB8_OES:
- return GL_RGB;
- case GL_RGBA8_OES:
- return GL_RGBA;
+ case GL_RGBA8UI:
+ case GL_RGBA8I:
+ case GL_RGB10_A2UI:
+ case GL_RGBA16UI:
+ case GL_RGBA16I:
+ case GL_RGBA32UI:
+ case GL_RGBA32I:
+ return GL_RGBA_INTEGER;
+ case GL_DEPTH_COMPONENT16:
+ case GL_DEPTH_COMPONENT24:
+ case GL_DEPTH_COMPONENT32F:
+ return GL_DEPTH_COMPONENT;
+ case GL_DEPTH24_STENCIL8:
+ case GL_DEPTH32F_STENCIL8:
+ return GL_DEPTH_STENCIL;
case GL_LUMINANCE8_ALPHA8_EXT:
return GL_LUMINANCE_ALPHA;
case GL_LUMINANCE8_EXT:
return GL_LUMINANCE;
case GL_ALPHA8_EXT:
return GL_ALPHA;
- case GL_RGBA32F_EXT:
- return GL_RGBA;
- case GL_RGB32F_EXT:
- return GL_RGB;
case GL_ALPHA32F_EXT:
return GL_ALPHA;
case GL_LUMINANCE32F_EXT:
return GL_LUMINANCE;
case GL_LUMINANCE_ALPHA32F_EXT:
return GL_LUMINANCE_ALPHA;
- case GL_RGBA16F_EXT:
- return GL_RGBA;
- case GL_RGB16F_EXT:
- return GL_RGB;
case GL_ALPHA16F_EXT:
return GL_ALPHA;
case GL_LUMINANCE16F_EXT:
@@ -11890,8 +12781,6 @@ static GLenum ExtractFormatFromStorageFormat(GLenum internalformat) {
return GL_LUMINANCE_ALPHA;
case GL_BGRA8_EXT:
return GL_BGRA_EXT;
- case GL_SRGB8_ALPHA8_EXT:
- return GL_SRGB_ALPHA_EXT;
default:
return GL_NONE;
}
@@ -11947,7 +12836,8 @@ bool GLES2DecoderImpl::ValidateCopyTextureCHROMIUM(
source_internal_format == GL_RGB || source_internal_format == GL_RGBA ||
source_internal_format == GL_LUMINANCE ||
source_internal_format == GL_LUMINANCE_ALPHA ||
- source_internal_format == GL_BGRA_EXT;
+ source_internal_format == GL_BGRA_EXT ||
+ source_internal_format == GL_RGB_YCBCR_422_CHROMIUM;
if (!valid_source_format || !valid_dest_format) {
LOCAL_SET_GL_ERROR(GL_INVALID_OPERATION, function_name,
"invalid internal format");
@@ -12224,7 +13114,7 @@ void GLES2DecoderImpl::DoCopySubTextureCHROMIUM(
source_texture->GetLevelType(source_texture->target(), 0, &source_type,
&source_internal_format);
if (!source_texture->ValidForTexture(source_texture->target(), 0, x, y, 0,
- width, height, 1, source_type)) {
+ width, height, 1)) {
LOCAL_SET_GL_ERROR(GL_INVALID_VALUE, "glCopySubTextureCHROMIUM",
"source texture bad dimensions.");
return;
@@ -12240,7 +13130,7 @@ void GLES2DecoderImpl::DoCopySubTextureCHROMIUM(
return;
}
if (!dest_texture->ValidForTexture(dest_texture->target(), 0, xoffset,
- yoffset, 0, width, height, 1, dest_type)) {
+ yoffset, 0, width, height, 1)) {
LOCAL_SET_GL_ERROR(GL_INVALID_VALUE, "glCopySubTextureCHROMIUM",
"destination texture bad dimensions.");
return;
@@ -12306,7 +13196,8 @@ void GLES2DecoderImpl::DoCopySubTextureCHROMIUM(
bool unpack_premultiply_alpha_change =
(unpack_premultiply_alpha ^ unpack_unmultiply_alpha) != 0;
if (image && !unpack_flip_y && !unpack_premultiply_alpha_change) {
- glBindTexture(GL_TEXTURE_2D, dest_texture->service_id());
+ ScopedTextureBinder binder(
+ &state_, dest_texture->service_id(), GL_TEXTURE_2D);
if (image->CopyTexSubImage(GL_TEXTURE_2D, gfx::Point(xoffset, yoffset),
gfx::Rect(x, y, width, height))) {
return;
@@ -12505,38 +13396,344 @@ void GLES2DecoderImpl::DoCompressedCopyTextureCHROMIUM(GLenum target,
DoDidUseTexImageIfNeeded(source_texture, source_texture->target());
}
+void GLES2DecoderImpl::DoCompressedCopySubTextureCHROMIUM(GLenum target,
+ GLuint source_id,
+ GLuint dest_id,
+ GLint xoffset,
+ GLint yoffset,
+ GLint x,
+ GLint y,
+ GLsizei width,
+ GLsizei height) {
+ TRACE_EVENT0("gpu", "GLES2DecoderImpl::DoCompressedCopySubTextureCHROMIUM");
+
+ TextureRef* source_texture_ref = GetTexture(source_id);
+ TextureRef* dest_texture_ref = GetTexture(dest_id);
+ Texture* source_texture = source_texture_ref->texture();
+ Texture* dest_texture = dest_texture_ref->texture();
+ int source_width = 0;
+ int source_height = 0;
+ gfx::GLImage* image =
+ source_texture->GetLevelImage(source_texture->target(), 0);
+ if (image) {
+ gfx::Size size = image->GetSize();
+ source_width = size.width();
+ source_height = size.height();
+ if (source_width <= 0 || source_height <= 0) {
+ LOCAL_SET_GL_ERROR(GL_INVALID_VALUE, "glCompressedCopySubTextureCHROMIUM",
+ "invalid image size");
+ return;
+ }
+ } else {
+ if (!source_texture->GetLevelSize(source_texture->target(), 0,
+ &source_width, &source_height, nullptr)) {
+ LOCAL_SET_GL_ERROR(GL_INVALID_VALUE, "glCompressedCopySubTextureCHROMIUM",
+ "source texture has no level 0");
+ return;
+ }
+
+ // Check that this type of texture is allowed.
+ if (!texture_manager()->ValidForTarget(source_texture->target(), 0,
+ source_width, source_height, 1)) {
+ LOCAL_SET_GL_ERROR(GL_INVALID_VALUE, "glCompressedCopySubTextureCHROMIUM",
+ "source texture bad dimensions");
+ return;
+ }
+ }
+
+ GLenum source_type = 0;
+ GLenum source_internal_format = 0;
+ source_texture->GetLevelType(source_texture->target(), 0, &source_type,
+ &source_internal_format);
+ if (!source_texture->ValidForTexture(source_texture->target(), 0, x, y, 0,
+ width, height, 1)) {
+ LOCAL_SET_GL_ERROR(GL_INVALID_VALUE, "glCompressedCopySubTextureCHROMIUM",
+ "source texture bad dimensions.");
+ return;
+ }
+
+ GLenum dest_type = 0;
+ GLenum dest_internal_format = 0;
+ bool dest_level_defined = dest_texture->GetLevelType(
+ dest_texture->target(), 0, &dest_type, &dest_internal_format);
+ if (!dest_level_defined) {
+ LOCAL_SET_GL_ERROR(GL_INVALID_OPERATION,
+ "glCompressedCopySubTextureCHROMIUM",
+ "destination texture is not defined");
+ return;
+ }
+ if (!dest_texture->ValidForTexture(dest_texture->target(), 0, xoffset,
+ yoffset, 0, width, height, 1)) {
+ LOCAL_SET_GL_ERROR(GL_INVALID_VALUE, "glCompressedCopySubTextureCHROMIUM",
+ "destination texture bad dimensions.");
+ return;
+ }
+
+ if (!ValidateCompressedCopyTextureCHROMIUM(
+ "glCompressedCopySubTextureCHROMIUM", target, source_texture_ref,
+ dest_texture_ref)) {
+ return;
+ }
+
+ if (!ValidateCompressedTexSubDimensions("glCompressedCopySubTextureCHROMIUM",
+ source_texture->target(), 0, x, y, 0,
+ width, height, 1,
+ source_internal_format,
+ source_texture) ||
+ !ValidateCompressedTexSubDimensions("glCompressedCopySubTextureCHROMIUM",
+ dest_texture->target(), 0,
+ xoffset, yoffset, 0, width, height, 1,
+ dest_internal_format,
+ dest_texture)) {
+ return;
+ }
+
+ // Defer initializing the CopyTextureCHROMIUMResourceManager until it is
+ // needed because it takes 10s of milliseconds to initialize.
+ if (!copy_texture_CHROMIUM_.get()) {
+ LOCAL_COPY_REAL_GL_ERRORS_TO_WRAPPER("glCompressedCopySubTextureCHROMIUM");
+ copy_texture_CHROMIUM_.reset(new CopyTextureCHROMIUMResourceManager());
+ copy_texture_CHROMIUM_->Initialize(this);
+ RestoreCurrentFramebufferBindings();
+ if (LOCAL_PEEK_GL_ERROR("glCompressedCopySubTextureCHROMIUM") !=
+ GL_NO_ERROR) {
+ return;
+ }
+ }
+
+ // Clear the source texture if necessary.
+ if (!texture_manager()->ClearTextureLevel(this, source_texture_ref,
+ source_texture->target(), 0)) {
+ LOCAL_SET_GL_ERROR(GL_OUT_OF_MEMORY, "glCompressedCopySubTextureCHROMIUM",
+ "source texture dimensions too big");
+ return;
+ }
+
+ int dest_width = 0;
+ int dest_height = 0;
+ bool ok = dest_texture->GetLevelSize(
+ GL_TEXTURE_2D, 0, &dest_width, &dest_height, nullptr);
+ DCHECK(ok);
+ if (xoffset != 0 || yoffset != 0 || width != dest_width ||
+ height != dest_height) {
+ gfx::Rect cleared_rect;
+ if (CombineAdjacentRects(dest_texture->GetLevelClearedRect(target, 0),
+ gfx::Rect(xoffset, yoffset, width, height),
+ &cleared_rect)) {
+ DCHECK_GE(cleared_rect.size().GetArea(),
+ dest_texture->GetLevelClearedRect(target, 0).size().GetArea());
+ texture_manager()->SetLevelClearedRect(dest_texture_ref, target, 0,
+ cleared_rect);
+ } else {
+ // Otherwise clear part of texture level that is not already cleared.
+ if (!texture_manager()->ClearTextureLevel(this, dest_texture_ref, target,
+ 0)) {
+ LOCAL_SET_GL_ERROR(GL_OUT_OF_MEMORY,
+ "glCompressedCopySubTextureCHROMIUM",
+ "destination texture dimensions too big");
+ return;
+ }
+ }
+ } else {
+ texture_manager()->SetLevelCleared(dest_texture_ref, GL_TEXTURE_2D, 0,
+ true);
+ }
+
+ ScopedTextureBinder binder(
+ &state_, dest_texture->service_id(), GL_TEXTURE_2D);
+
+ ScopedModifyPixels modify(dest_texture_ref);
+
+ // Try using GLImage::CopyTexSubImage when possible.
+ if (image) {
+ if (image->CopyTexSubImage(GL_TEXTURE_2D, gfx::Point(xoffset, yoffset),
+ gfx::Rect(x, y, width, height))) {
+ return;
+ }
+ }
+
+ TRACE_EVENT0(
+ "gpu",
+ "GLES2DecoderImpl::DoCompressedCopySubTextureCHROMIUM, fallback");
+
+ DoWillUseTexImageIfNeeded(source_texture, source_texture->target());
+
+ // As a fallback, copy into a non-compressed GL_RGBA texture.
+ if (dest_internal_format != GL_RGBA) {
+ // To preserve the contents of the original destination texture we must
+ // first copy the original destination texture to a temporary storage, then
+ // copy it back to the original destination texture.
+ GLuint tmp_service_id;
+ glGenTextures(1, &tmp_service_id);
+ DCHECK_NE(0u, tmp_service_id);
+
+ glBindTexture(GL_TEXTURE_2D, tmp_service_id);
+
+ LOCAL_COPY_REAL_GL_ERRORS_TO_WRAPPER("glCompressedCopyTextureCHROMIUM");
+ glTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA, dest_width, dest_height, 0, GL_RGBA,
+ GL_UNSIGNED_BYTE, NULL);
+ GLenum error = LOCAL_PEEK_GL_ERROR("glCompressedCopySubTextureCHROMIUM");
+ if (error != GL_NO_ERROR)
+ return;
+
+ copy_texture_CHROMIUM_->DoCopyTexture(
+ this, dest_texture->target(), dest_texture->service_id(),
+ dest_internal_format, tmp_service_id, GL_RGBA,
+ dest_width, dest_height, false, false, false);
+
+ // Redefine destination texture to use RGBA.
+ glBindTexture(GL_TEXTURE_2D, dest_texture->service_id());
+ LOCAL_COPY_REAL_GL_ERRORS_TO_WRAPPER("glCompressedCopyTextureCHROMIUM");
+ glTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA, dest_width, dest_height, 0, GL_RGBA,
+ GL_UNSIGNED_BYTE, NULL);
+ error = LOCAL_PEEK_GL_ERROR("glCompressedCopySubTextureCHROMIUM");
+ if (error != GL_NO_ERROR)
+ return;
+
+ texture_manager()->SetLevelInfo(
+ dest_texture_ref, GL_TEXTURE_2D, 0, GL_RGBA, dest_width, dest_height,
+ 1, 0, GL_RGBA, GL_UNSIGNED_BYTE, gfx::Rect(dest_width, dest_height));
+
+ copy_texture_CHROMIUM_->DoCopyTexture(
+ this, GL_TEXTURE_2D, tmp_service_id, GL_RGBA,
+ dest_texture->service_id(), GL_RGBA,
+ dest_width, dest_height, false, false, false);
+
+ glDeleteTextures(1, &tmp_service_id);
+ }
+
+ // TODO(hkuang): get the StreamTexture transform matrix in GPU process.
+ // crbug.com/226218.
+ copy_texture_CHROMIUM_->DoCopySubTexture(
+ this, source_texture->target(), source_texture->service_id(),
+ source_internal_format, dest_texture->service_id(), GL_RGBA,
+ xoffset, yoffset, x, y, width, height, dest_width, dest_height,
+ source_width, source_height, false, false, false);
+
+ DoDidUseTexImageIfNeeded(source_texture, source_texture->target());
+}
+
static GLenum ExtractTypeFromStorageFormat(GLenum internalformat) {
switch (internalformat) {
+ case GL_R8:
+ return GL_UNSIGNED_BYTE;
+ case GL_R8_SNORM:
+ return GL_BYTE;
+ case GL_R16F:
+ return GL_HALF_FLOAT;
+ case GL_R32F:
+ return GL_FLOAT;
+ case GL_R8UI:
+ return GL_UNSIGNED_BYTE;
+ case GL_R8I:
+ return GL_BYTE;
+ case GL_R16UI:
+ return GL_UNSIGNED_SHORT;
+ case GL_R16I:
+ return GL_SHORT;
+ case GL_R32UI:
+ return GL_UNSIGNED_INT;
+ case GL_R32I:
+ return GL_INT;
+ case GL_RG8:
+ return GL_UNSIGNED_BYTE;
+ case GL_RG8_SNORM:
+ return GL_BYTE;
+ case GL_RG16F:
+ return GL_HALF_FLOAT;
+ case GL_RG32F:
+ return GL_FLOAT;
+ case GL_RG8UI:
+ return GL_UNSIGNED_BYTE;
+ case GL_RG8I:
+ return GL_BYTE;
+ case GL_RG16UI:
+ return GL_UNSIGNED_SHORT;
+ case GL_RG16I:
+ return GL_SHORT;
+ case GL_RG32UI:
+ return GL_UNSIGNED_INT;
+ case GL_RG32I:
+ return GL_INT;
+ case GL_RGB8:
+ case GL_SRGB8:
+ return GL_UNSIGNED_BYTE;
+ case GL_R11F_G11F_B10F:
+ return GL_UNSIGNED_INT_10F_11F_11F_REV;
case GL_RGB565:
return GL_UNSIGNED_SHORT_5_6_5;
+ case GL_RGB8_SNORM:
+ return GL_BYTE;
+ case GL_RGB9_E5:
+ return GL_UNSIGNED_INT_5_9_9_9_REV;
+ case GL_RGB16F:
+ return GL_HALF_FLOAT;
+ case GL_RGB32F:
+ return GL_FLOAT;
+ case GL_RGB8UI:
+ return GL_UNSIGNED_BYTE;
+ case GL_RGB8I:
+ return GL_BYTE;
+ case GL_RGB16UI:
+ return GL_UNSIGNED_SHORT;
+ case GL_RGB16I:
+ return GL_SHORT;
+ case GL_RGB32UI:
+ return GL_UNSIGNED_INT;
+ case GL_RGB32I:
+ return GL_INT;
+ case GL_RGBA8:
+ return GL_UNSIGNED_BYTE;
+ case GL_SRGB8_ALPHA8:
+ return GL_UNSIGNED_BYTE;
+ case GL_RGBA8_SNORM:
+ return GL_BYTE;
case GL_RGBA4:
return GL_UNSIGNED_SHORT_4_4_4_4;
+ case GL_RGB10_A2:
+ return GL_UNSIGNED_INT_2_10_10_10_REV;
case GL_RGB5_A1:
return GL_UNSIGNED_SHORT_5_5_5_1;
- case GL_RGB8_OES:
- return GL_UNSIGNED_BYTE;
- case GL_RGBA8_OES:
+ case GL_RGBA16F:
+ return GL_HALF_FLOAT;
+ case GL_RGBA32F:
+ return GL_FLOAT;
+ case GL_RGBA8UI:
return GL_UNSIGNED_BYTE;
+ case GL_RGBA8I:
+ return GL_BYTE;
+ case GL_RGB10_A2UI:
+ return GL_UNSIGNED_INT_2_10_10_10_REV;
+ case GL_RGBA16UI:
+ return GL_UNSIGNED_SHORT;
+ case GL_RGBA16I:
+ return GL_SHORT;
+ case GL_RGBA32I:
+ return GL_INT;
+ case GL_RGBA32UI:
+ return GL_UNSIGNED_INT;
+ case GL_DEPTH_COMPONENT16:
+ return GL_UNSIGNED_SHORT;
+ case GL_DEPTH_COMPONENT24:
+ return GL_UNSIGNED_INT;
+ case GL_DEPTH_COMPONENT32F:
+ return GL_FLOAT;
+ case GL_DEPTH24_STENCIL8:
+ return GL_UNSIGNED_INT_24_8;
+ case GL_DEPTH32F_STENCIL8:
+ return GL_FLOAT_32_UNSIGNED_INT_24_8_REV;
case GL_LUMINANCE8_ALPHA8_EXT:
return GL_UNSIGNED_BYTE;
case GL_LUMINANCE8_EXT:
return GL_UNSIGNED_BYTE;
case GL_ALPHA8_EXT:
return GL_UNSIGNED_BYTE;
- case GL_RGBA32F_EXT:
- return GL_FLOAT;
- case GL_RGB32F_EXT:
- return GL_FLOAT;
case GL_ALPHA32F_EXT:
return GL_FLOAT;
case GL_LUMINANCE32F_EXT:
return GL_FLOAT;
case GL_LUMINANCE_ALPHA32F_EXT:
return GL_FLOAT;
- case GL_RGBA16F_EXT:
- return GL_HALF_FLOAT_OES;
- case GL_RGB16F_EXT:
- return GL_HALF_FLOAT_OES;
case GL_ALPHA16F_EXT:
return GL_HALF_FLOAT_OES;
case GL_LUMINANCE16F_EXT:
@@ -12616,10 +13813,22 @@ void GLES2DecoderImpl::DoTexStorage2DEXT(
if (error == GL_NO_ERROR) {
GLsizei level_width = width;
GLsizei level_height = height;
+
+ GLenum cur_format = feature_info_->IsES3Enabled() ?
+ internal_format : format;
for (int ii = 0; ii < levels; ++ii) {
- texture_manager()->SetLevelInfo(texture_ref, target, ii, format,
- level_width, level_height, 1, 0, format,
- type, gfx::Rect());
+ if (target == GL_TEXTURE_CUBE_MAP) {
+ for (int jj = 0; jj < 6; ++jj) {
+ GLenum face = GL_TEXTURE_CUBE_MAP_POSITIVE_X + jj;
+ texture_manager()->SetLevelInfo(texture_ref, face, ii, cur_format,
+ level_width, level_height, 1, 0,
+ format, type, gfx::Rect());
+ }
+ } else {
+ texture_manager()->SetLevelInfo(texture_ref, target, ii, cur_format,
+ level_width, level_height, 1, 0,
+ format, type, gfx::Rect());
+ }
level_width = std::max(1, level_width >> 1);
level_height = std::max(1, level_height >> 1);
}
@@ -12654,8 +13863,10 @@ void GLES2DecoderImpl::DoProduceTextureDirectCHROMIUM(GLuint client_id,
target, data);
}
-void GLES2DecoderImpl::ProduceTextureRef(std::string func_name,
- TextureRef* texture_ref, GLenum target, const GLbyte* data) {
+void GLES2DecoderImpl::ProduceTextureRef(const char* func_name,
+ TextureRef* texture_ref,
+ GLenum target,
+ const GLbyte* data) {
const Mailbox& mailbox = *reinterpret_cast<const Mailbox*>(data);
DLOG_IF(ERROR, !mailbox.Verify()) << func_name << " was passed a "
"mailbox that was not generated by "
@@ -12663,20 +13874,20 @@ void GLES2DecoderImpl::ProduceTextureRef(std::string func_name,
if (!texture_ref) {
LOCAL_SET_GL_ERROR(
- GL_INVALID_OPERATION, func_name.c_str(), "unknown texture for target");
+ GL_INVALID_OPERATION, func_name, "unknown texture for target");
return;
}
Texture* produced = texture_manager()->Produce(texture_ref);
if (!produced) {
LOCAL_SET_GL_ERROR(
- GL_INVALID_OPERATION, func_name.c_str(), "invalid texture");
+ GL_INVALID_OPERATION, func_name, "invalid texture");
return;
}
if (produced->target() != target) {
LOCAL_SET_GL_ERROR(
- GL_INVALID_OPERATION, func_name.c_str(), "invalid target");
+ GL_INVALID_OPERATION, func_name, "invalid target");
return;
}
@@ -12834,6 +14045,13 @@ void GLES2DecoderImpl::DoCreateAndConsumeTextureCHROMIUM(GLenum target,
texture_ref = texture_manager()->Consume(client_id, texture);
}
+void GLES2DecoderImpl::DoApplyScreenSpaceAntialiasingCHROMIUM() {
+ // Apply CMAA(Conservative Morphological Anti-Aliasing) algorithm to the
+ // color attachments of currently bound draw framebuffer.
+ // Reference GL_INTEL_framebuffer_CMAA for details.
+ glApplyFramebufferAttachmentCMAAINTEL();
+}
+
bool GLES2DecoderImpl::DoIsValuebufferCHROMIUM(GLuint client_id) {
const Valuebuffer* valuebuffer = GetValuebuffer(client_id);
return valuebuffer && valuebuffer->IsValid();
@@ -12911,19 +14129,10 @@ void GLES2DecoderImpl::DoInsertEventMarkerEXT(
}
void GLES2DecoderImpl::DoPushGroupMarkerEXT(
- GLsizei length, const GLchar* marker) {
- if (!marker) {
- marker = "";
- }
- std::string name = length ? std::string(marker, length) : std::string(marker);
- debug_marker_manager_.PushGroup(name);
- gpu_tracer_->Begin(TRACE_DISABLED_BY_DEFAULT("gpu_group_marker"), name,
- kTraceGroupMarker);
+ GLsizei /*length*/, const GLchar* /*marker*/) {
}
void GLES2DecoderImpl::DoPopGroupMarkerEXT(void) {
- debug_marker_manager_.PopGroup();
- gpu_tracer_->End(kTraceGroupMarker);
}
void GLES2DecoderImpl::DoBindTexImage2DCHROMIUM(
@@ -13032,6 +14241,7 @@ error::Error GLES2DecoderImpl::HandleTraceBeginCHROMIUM(
return error::kInvalidArguments;
}
+ debug_marker_manager_.PushGroup(trace_name);
if (!gpu_tracer_->Begin(category_name, trace_name, kTraceCHROMIUM)) {
LOCAL_SET_GL_ERROR(
GL_INVALID_OPERATION,
@@ -13042,6 +14252,7 @@ error::Error GLES2DecoderImpl::HandleTraceBeginCHROMIUM(
}
void GLES2DecoderImpl::DoTraceEndCHROMIUM() {
+ debug_marker_manager_.PopGroup();
if (!gpu_tracer_->End(kTraceCHROMIUM)) {
LOCAL_SET_GL_ERROR(GL_INVALID_OPERATION,
"glTraceEndCHROMIUM", "no trace begin found");
@@ -13087,7 +14298,7 @@ void GLES2DecoderImpl::DoDrawBuffersEXT(
mapped_buf = GL_COLOR_ATTACHMENT0;
}
glDrawBuffersARB(count, &mapped_buf);
- group_->set_draw_buffer(bufs[0]);
+ back_buffer_draw_buffer_ = bufs[0];
}
}
@@ -13110,12 +14321,6 @@ void GLES2DecoderImpl::DoMatrixLoadfCHROMIUM(GLenum matrix_mode,
const GLfloat* matrix) {
DCHECK(matrix_mode == GL_PATH_PROJECTION_CHROMIUM ||
matrix_mode == GL_PATH_MODELVIEW_CHROMIUM);
- if (!features().chromium_path_rendering) {
- LOCAL_SET_GL_ERROR(GL_INVALID_OPERATION,
- "glMatrixLoadfCHROMIUM",
- "function not available");
- return;
- }
GLfloat* target_matrix = matrix_mode == GL_PATH_PROJECTION_CHROMIUM
? state_.projection_matrix
@@ -13130,13 +14335,6 @@ void GLES2DecoderImpl::DoMatrixLoadIdentityCHROMIUM(GLenum matrix_mode) {
DCHECK(matrix_mode == GL_PATH_PROJECTION_CHROMIUM ||
matrix_mode == GL_PATH_MODELVIEW_CHROMIUM);
- if (!features().chromium_path_rendering) {
- LOCAL_SET_GL_ERROR(GL_INVALID_OPERATION,
- "glMatrixLoadIdentityCHROMIUM",
- "function not available");
- return;
- }
-
GLfloat* target_matrix = matrix_mode == GL_PATH_PROJECTION_CHROMIUM
? state_.projection_matrix
: state_.modelview_matrix;
@@ -13146,312 +14344,6 @@ void GLES2DecoderImpl::DoMatrixLoadIdentityCHROMIUM(GLenum matrix_mode) {
glMatrixLoadIdentityEXT(matrix_mode);
}
-bool GLES2DecoderImpl::ValidateAsyncTransfer(
- const char* function_name,
- TextureRef* texture_ref,
- GLenum target,
- GLint level,
- const void * data) {
- // We only support async uploads to 2D textures for now.
- if (GL_TEXTURE_2D != target) {
- LOCAL_SET_GL_ERROR_INVALID_ENUM(function_name, target, "target");
- return false;
- }
- // We only support uploads to level zero for now.
- if (level != 0) {
- LOCAL_SET_GL_ERROR(GL_INVALID_VALUE, function_name, "level != 0");
- return false;
- }
- // A transfer buffer must be bound, even for asyncTexImage2D.
- if (data == NULL) {
- LOCAL_SET_GL_ERROR(GL_INVALID_OPERATION, function_name, "buffer == 0");
- return false;
- }
- // We only support one async transfer in progress.
- if (!texture_ref ||
- async_pixel_transfer_manager_->AsyncTransferIsInProgress(texture_ref)) {
- LOCAL_SET_GL_ERROR(
- GL_INVALID_OPERATION,
- function_name, "transfer already in progress");
- return false;
- }
- return true;
-}
-
-base::Closure GLES2DecoderImpl::AsyncUploadTokenCompletionClosure(
- uint32 async_upload_token,
- uint32 sync_data_shm_id,
- uint32 sync_data_shm_offset) {
- scoped_refptr<gpu::Buffer> buffer = GetSharedMemoryBuffer(sync_data_shm_id);
- if (!buffer.get() ||
- !buffer->GetDataAddress(sync_data_shm_offset, sizeof(AsyncUploadSync)))
- return base::Closure();
-
- AsyncMemoryParams mem_params(buffer,
- sync_data_shm_offset,
- sizeof(AsyncUploadSync));
-
- scoped_refptr<AsyncUploadTokenCompletionObserver> observer(
- new AsyncUploadTokenCompletionObserver(async_upload_token));
-
- return base::Bind(
- &AsyncPixelTransferManager::AsyncNotifyCompletion,
- base::Unretained(GetAsyncPixelTransferManager()),
- mem_params,
- observer);
-}
-
-error::Error GLES2DecoderImpl::HandleAsyncTexImage2DCHROMIUM(
- uint32 immediate_data_size,
- const void* cmd_data) {
- const gles2::cmds::AsyncTexImage2DCHROMIUM& c =
- *static_cast<const gles2::cmds::AsyncTexImage2DCHROMIUM*>(cmd_data);
- TRACE_EVENT0("gpu", "GLES2DecoderImpl::HandleAsyncTexImage2DCHROMIUM");
- GLenum target = static_cast<GLenum>(c.target);
- GLint level = static_cast<GLint>(c.level);
- GLenum internal_format = static_cast<GLenum>(c.internalformat);
- GLsizei width = static_cast<GLsizei>(c.width);
- GLsizei height = static_cast<GLsizei>(c.height);
- GLint border = static_cast<GLint>(c.border);
- GLenum format = static_cast<GLenum>(c.format);
- GLenum type = static_cast<GLenum>(c.type);
- uint32 pixels_shm_id = static_cast<uint32>(c.pixels_shm_id);
- uint32 pixels_shm_offset = static_cast<uint32>(c.pixels_shm_offset);
- uint32 pixels_size;
- uint32 async_upload_token = static_cast<uint32>(c.async_upload_token);
- uint32 sync_data_shm_id = static_cast<uint32>(c.sync_data_shm_id);
- uint32 sync_data_shm_offset = static_cast<uint32>(c.sync_data_shm_offset);
-
- base::ScopedClosureRunner scoped_completion_callback;
- if (async_upload_token) {
- base::Closure completion_closure =
- AsyncUploadTokenCompletionClosure(async_upload_token,
- sync_data_shm_id,
- sync_data_shm_offset);
- if (completion_closure.is_null())
- return error::kInvalidArguments;
-
- scoped_completion_callback.Reset(completion_closure);
- }
-
- // TODO(epenner): Move this and copies of this memory validation
- // into ValidateTexImage2D step.
- if (!GLES2Util::ComputeImageDataSizes(
- width, height, 1, format, type, state_.unpack_alignment, &pixels_size,
- NULL, NULL)) {
- return error::kOutOfBounds;
- }
- const void* pixels = NULL;
- if (pixels_shm_id != 0 || pixels_shm_offset != 0) {
- pixels = GetSharedMemoryAs<const void*>(
- pixels_shm_id, pixels_shm_offset, pixels_size);
- if (!pixels) {
- return error::kOutOfBounds;
- }
- }
-
- TextureManager::DoTexImageArguments args = {
- target, level, internal_format, width, height, 1, border, format, type,
- pixels, pixels_size, TextureManager::DoTexImageArguments::kTexImage2D };
- TextureRef* texture_ref;
- // All the normal glTexSubImage2D validation.
- if (!texture_manager()->ValidateTexImage(
- &state_, "glAsyncTexImage2DCHROMIUM", args, &texture_ref)) {
- return error::kNoError;
- }
-
- // Extra async validation.
- Texture* texture = texture_ref->texture();
- if (!ValidateAsyncTransfer(
- "glAsyncTexImage2DCHROMIUM", texture_ref, target, level, pixels))
- return error::kNoError;
-
- // Don't allow async redefinition of a textures.
- if (texture->IsDefined()) {
- LOCAL_SET_GL_ERROR(
- GL_INVALID_OPERATION,
- "glAsyncTexImage2DCHROMIUM", "already defined");
- return error::kNoError;
- }
-
- if (!EnsureGPUMemoryAvailable(pixels_size)) {
- LOCAL_SET_GL_ERROR(
- GL_OUT_OF_MEMORY, "glAsyncTexImage2DCHROMIUM", "out of memory");
- return error::kNoError;
- }
-
- // Setup the parameters.
- AsyncTexImage2DParams tex_params = {
- target, level, static_cast<GLenum>(internal_format),
- width, height, border, format, type};
- AsyncMemoryParams mem_params(
- GetSharedMemoryBuffer(c.pixels_shm_id), c.pixels_shm_offset, pixels_size);
-
- // Set up the async state if needed, and make the texture
- // immutable so the async state stays valid. The level info
- // is set up lazily when the transfer completes.
- AsyncPixelTransferDelegate* delegate =
- async_pixel_transfer_manager_->CreatePixelTransferDelegate(texture_ref,
- tex_params);
- texture->SetImmutable(true);
-
- delegate->AsyncTexImage2D(
- tex_params,
- mem_params,
- base::Bind(&TextureManager::SetLevelInfoFromParams,
- // The callback is only invoked if the transfer delegate still
- // exists, which implies through manager->texture_ref->state
- // ownership that both of these pointers are valid.
- base::Unretained(texture_manager()),
- base::Unretained(texture_ref),
- tex_params));
- return error::kNoError;
-}
-
-error::Error GLES2DecoderImpl::HandleAsyncTexSubImage2DCHROMIUM(
- uint32 immediate_data_size,
- const void* cmd_data) {
- const gles2::cmds::AsyncTexSubImage2DCHROMIUM& c =
- *static_cast<const gles2::cmds::AsyncTexSubImage2DCHROMIUM*>(cmd_data);
- TRACE_EVENT0("gpu", "GLES2DecoderImpl::HandleAsyncTexSubImage2DCHROMIUM");
- GLenum target = static_cast<GLenum>(c.target);
- GLint level = static_cast<GLint>(c.level);
- GLint xoffset = static_cast<GLint>(c.xoffset);
- GLint yoffset = static_cast<GLint>(c.yoffset);
- GLsizei width = static_cast<GLsizei>(c.width);
- GLsizei height = static_cast<GLsizei>(c.height);
- GLenum format = static_cast<GLenum>(c.format);
- GLenum type = static_cast<GLenum>(c.type);
- uint32 async_upload_token = static_cast<uint32>(c.async_upload_token);
- uint32 sync_data_shm_id = static_cast<uint32>(c.sync_data_shm_id);
- uint32 sync_data_shm_offset = static_cast<uint32>(c.sync_data_shm_offset);
-
- base::ScopedClosureRunner scoped_completion_callback;
- if (async_upload_token) {
- base::Closure completion_closure =
- AsyncUploadTokenCompletionClosure(async_upload_token,
- sync_data_shm_id,
- sync_data_shm_offset);
- if (completion_closure.is_null())
- return error::kInvalidArguments;
-
- scoped_completion_callback.Reset(completion_closure);
- }
-
- // TODO(epenner): Move this and copies of this memory validation
- // into ValidateTexSubImage2D step.
- uint32 data_size;
- if (!GLES2Util::ComputeImageDataSizes(
- width, height, 1, format, type, state_.unpack_alignment, &data_size,
- NULL, NULL)) {
- return error::kOutOfBounds;
- }
- const void* pixels = GetSharedMemoryAs<const void*>(
- c.data_shm_id, c.data_shm_offset, data_size);
-
- // All the normal glTexSubImage2D validation.
- error::Error error = error::kNoError;
- if (!ValidateTexSubImage2D(&error, "glAsyncTexSubImage2DCHROMIUM",
- target, level, xoffset, yoffset, width, height, format, type, pixels)) {
- return error;
- }
-
- // Extra async validation.
- TextureRef* texture_ref = texture_manager()->GetTextureInfoForTarget(
- &state_, target);
- Texture* texture = texture_ref->texture();
- if (!ValidateAsyncTransfer(
- "glAsyncTexSubImage2DCHROMIUM", texture_ref, target, level, pixels))
- return error::kNoError;
-
- // Guarantee async textures are always 'cleared' as follows:
- // - AsyncTexImage2D can not redefine an existing texture
- // - AsyncTexImage2D must initialize the entire image via non-null buffer.
- // - AsyncTexSubImage2D clears synchronously if not already cleared.
- // - Textures become immutable after an async call.
- // This way we know in all cases that an async texture is always clear.
- if (!texture->SafeToRenderFrom()) {
- if (!texture_manager()->ClearTextureLevel(this, texture_ref,
- target, level)) {
- LOCAL_SET_GL_ERROR(
- GL_OUT_OF_MEMORY,
- "glAsyncTexSubImage2DCHROMIUM", "dimensions too big");
- return error::kNoError;
- }
- }
-
- // Setup the parameters.
- AsyncTexSubImage2DParams tex_params = {target, level, xoffset, yoffset,
- width, height, format, type};
- AsyncMemoryParams mem_params(
- GetSharedMemoryBuffer(c.data_shm_id), c.data_shm_offset, data_size);
- AsyncPixelTransferDelegate* delegate =
- async_pixel_transfer_manager_->GetPixelTransferDelegate(texture_ref);
- if (!delegate) {
- // TODO(epenner): We may want to enforce exclusive use
- // of async APIs in which case this should become an error,
- // (the texture should have been async defined).
- AsyncTexImage2DParams define_params = {target, level,
- 0, 0, 0, 0, 0, 0};
- texture->GetLevelSize(
- target, level, &define_params.width, &define_params.height, nullptr);
- texture->GetLevelType(
- target, level, &define_params.type, &define_params.internal_format);
- // Set up the async state if needed, and make the texture
- // immutable so the async state stays valid.
- delegate = async_pixel_transfer_manager_->CreatePixelTransferDelegate(
- texture_ref, define_params);
- texture->SetImmutable(true);
- }
-
- delegate->AsyncTexSubImage2D(tex_params, mem_params);
- return error::kNoError;
-}
-
-error::Error GLES2DecoderImpl::HandleWaitAsyncTexImage2DCHROMIUM(
- uint32 immediate_data_size,
- const void* cmd_data) {
- const gles2::cmds::WaitAsyncTexImage2DCHROMIUM& c =
- *static_cast<const gles2::cmds::WaitAsyncTexImage2DCHROMIUM*>(cmd_data);
- TRACE_EVENT0("gpu", "GLES2DecoderImpl::HandleWaitAsyncTexImage2DCHROMIUM");
- GLenum target = static_cast<GLenum>(c.target);
-
- if (GL_TEXTURE_2D != target) {
- LOCAL_SET_GL_ERROR(
- GL_INVALID_ENUM, "glWaitAsyncTexImage2DCHROMIUM", "target");
- return error::kNoError;
- }
- TextureRef* texture_ref = texture_manager()->GetTextureInfoForTarget(
- &state_, target);
- if (!texture_ref) {
- LOCAL_SET_GL_ERROR(
- GL_INVALID_OPERATION,
- "glWaitAsyncTexImage2DCHROMIUM", "unknown texture");
- return error::kNoError;
- }
- AsyncPixelTransferDelegate* delegate =
- async_pixel_transfer_manager_->GetPixelTransferDelegate(texture_ref);
- if (!delegate) {
- LOCAL_SET_GL_ERROR(
- GL_INVALID_OPERATION,
- "glWaitAsyncTexImage2DCHROMIUM", "No async transfer started");
- return error::kNoError;
- }
- delegate->WaitForTransferCompletion();
- ProcessFinishedAsyncTransfers();
- return error::kNoError;
-}
-
-error::Error GLES2DecoderImpl::HandleWaitAllAsyncTexImage2DCHROMIUM(
- uint32 immediate_data_size,
- const void* data) {
- TRACE_EVENT0("gpu", "GLES2DecoderImpl::HandleWaitAsyncTexImage2DCHROMIUM");
-
- GetAsyncPixelTransferManager()->WaitAllAsyncTexImage2D();
- ProcessFinishedAsyncTransfers();
- return error::kNoError;
-}
-
error::Error GLES2DecoderImpl::HandleUniformBlockBinding(
uint32_t immediate_data_size, const void* cmd_data) {
if (!unsafe_es3_apis_enabled())
@@ -13712,6 +14604,455 @@ void GLES2DecoderImpl::OnOutOfMemoryError() {
}
}
+error::Error GLES2DecoderImpl::HandleGenPathsCHROMIUM(
+ uint32 immediate_data_size,
+ const void* cmd_data) {
+ static const char kFunctionName[] = "glGenPathsCHROMIUM";
+ const gles2::cmds::GenPathsCHROMIUM& c =
+ *static_cast<const gles2::cmds::GenPathsCHROMIUM*>(cmd_data);
+ if (!features().chromium_path_rendering) {
+ LOCAL_SET_GL_ERROR(GL_INVALID_OPERATION, kFunctionName,
+ "function not available");
+ return error::kNoError;
+ }
+
+ GLsizei range = static_cast<GLsizei>(c.range);
+ if (range < 0) {
+ LOCAL_SET_GL_ERROR(GL_INVALID_VALUE, kFunctionName, "range < 0");
+ return error::kNoError;
+ }
+
+ GLuint first_client_id = static_cast<GLuint>(c.first_client_id);
+ if (first_client_id == 0)
+ return error::kInvalidArguments;
+
+ if (range == 0)
+ return error::kNoError;
+
+ if (!GenPathsCHROMIUMHelper(first_client_id, range))
+ return error::kInvalidArguments;
+
+ return error::kNoError;
+}
+error::Error GLES2DecoderImpl::HandleDeletePathsCHROMIUM(
+ uint32_t immediate_data_size,
+ const void* cmd_data) {
+ static const char kFunctionName[] = "glDeletePathsCHROMIUM";
+ const gles2::cmds::DeletePathsCHROMIUM& c =
+ *static_cast<const gles2::cmds::DeletePathsCHROMIUM*>(cmd_data);
+ if (!features().chromium_path_rendering) {
+ LOCAL_SET_GL_ERROR(GL_INVALID_OPERATION, kFunctionName,
+ "function not available");
+ return error::kNoError;
+ }
+
+ GLsizei range = static_cast<GLsizei>(c.range);
+ if (range < 0) {
+ LOCAL_SET_GL_ERROR(GL_INVALID_VALUE, kFunctionName, "range < 0");
+ return error::kNoError;
+ }
+
+ if (range == 0)
+ return error::kNoError;
+
+ GLuint first_client_id = c.first_client_id;
+ // first_client_id can be 0, because non-existing path ids are skipped.
+
+ if (!DeletePathsCHROMIUMHelper(first_client_id, range))
+ return error::kInvalidArguments;
+
+ return error::kNoError;
+}
+
+error::Error GLES2DecoderImpl::HandlePathCommandsCHROMIUM(
+ uint32 immediate_data_size,
+ const void* cmd_data) {
+ static const char kFunctionName[] = "glPathCommandsCHROMIUM";
+ const gles2::cmds::PathCommandsCHROMIUM& c =
+ *static_cast<const gles2::cmds::PathCommandsCHROMIUM*>(cmd_data);
+ if (!features().chromium_path_rendering) {
+ LOCAL_SET_GL_ERROR(GL_INVALID_OPERATION, kFunctionName,
+ "function not available");
+ return error::kNoError;
+ }
+
+ GLuint service_id = 0;
+ if (!path_manager()->GetPath(static_cast<GLuint>(c.path), &service_id)) {
+ LOCAL_SET_GL_ERROR(GL_INVALID_OPERATION, kFunctionName,
+ "invalid path name");
+ return error::kNoError;
+ }
+
+ GLsizei num_commands = static_cast<GLsizei>(c.numCommands);
+ if (num_commands < 0) {
+ LOCAL_SET_GL_ERROR(GL_INVALID_VALUE, kFunctionName, "numCommands < 0");
+ return error::kNoError;
+ }
+
+ GLsizei num_coords = static_cast<uint32>(c.numCoords);
+ if (num_coords < 0) {
+ LOCAL_SET_GL_ERROR(GL_INVALID_VALUE, kFunctionName, "numCoords < 0");
+ return error::kNoError;
+ }
+
+ GLenum coord_type = static_cast<uint32>(c.coordType);
+ if (!validators_->path_coord_type.IsValid(static_cast<GLint>(coord_type))) {
+ LOCAL_SET_GL_ERROR(GL_INVALID_ENUM, kFunctionName, "invalid coordType");
+ return error::kNoError;
+ }
+
+ const GLubyte* commands = NULL;
+ base::CheckedNumeric<GLsizei> num_coords_expected = 0;
+
+ if (num_commands > 0) {
+ uint32 commands_shm_id = static_cast<uint32>(c.commands_shm_id);
+ uint32 commands_shm_offset = static_cast<uint32>(c.commands_shm_offset);
+ if (commands_shm_id != 0 || commands_shm_offset != 0)
+ commands = GetSharedMemoryAs<const GLubyte*>(
+ commands_shm_id, commands_shm_offset, num_commands);
+
+ if (!commands)
+ return error::kOutOfBounds;
+
+ for (GLsizei i = 0; i < num_commands; ++i) {
+ switch (commands[i]) {
+ case GL_CLOSE_PATH_CHROMIUM:
+ // Close has no coords.
+ break;
+ case GL_MOVE_TO_CHROMIUM:
+ // Fallthrough.
+ case GL_LINE_TO_CHROMIUM:
+ num_coords_expected += 2;
+ break;
+ case GL_QUADRATIC_CURVE_TO_CHROMIUM:
+ num_coords_expected += 4;
+ break;
+ case GL_CUBIC_CURVE_TO_CHROMIUM:
+ num_coords_expected += 6;
+ break;
+ case GL_CONIC_CURVE_TO_CHROMIUM:
+ num_coords_expected += 5;
+ break;
+ default:
+ LOCAL_SET_GL_ERROR(GL_INVALID_ENUM, kFunctionName, "invalid command");
+ return error::kNoError;
+ }
+ }
+ }
+
+ if (!num_coords_expected.IsValid() ||
+ num_coords != num_coords_expected.ValueOrDie()) {
+ LOCAL_SET_GL_ERROR(GL_INVALID_OPERATION, kFunctionName,
+ "numCoords does not match commands");
+ return error::kNoError;
+ }
+
+ const void* coords = NULL;
+
+ if (num_coords > 0) {
+ uint32 coords_size = 0;
+ uint32 coord_type_size =
+ GLES2Util::GetGLTypeSizeForPathCoordType(coord_type);
+ if (!SafeMultiplyUint32(num_coords, coord_type_size, &coords_size))
+ return error::kOutOfBounds;
+
+ uint32 coords_shm_id = static_cast<uint32>(c.coords_shm_id);
+ uint32 coords_shm_offset = static_cast<uint32>(c.coords_shm_offset);
+ if (coords_shm_id != 0 || coords_shm_offset != 0)
+ coords = GetSharedMemoryAs<const void*>(coords_shm_id, coords_shm_offset,
+ coords_size);
+
+ if (!coords)
+ return error::kOutOfBounds;
+ }
+
+ glPathCommandsNV(service_id, num_commands, commands, num_coords, coord_type,
+ coords);
+
+ return error::kNoError;
+}
+
+error::Error GLES2DecoderImpl::HandlePathParameterfCHROMIUM(
+ uint32 immediate_data_size,
+ const void* cmd_data) {
+ static const char kFunctionName[] = "glPathParameterfCHROMIUM";
+ const gles2::cmds::PathParameterfCHROMIUM& c =
+ *static_cast<const gles2::cmds::PathParameterfCHROMIUM*>(cmd_data);
+ if (!features().chromium_path_rendering) {
+ LOCAL_SET_GL_ERROR(GL_INVALID_OPERATION, kFunctionName,
+ "function not available");
+ return error::kNoError;
+ }
+ GLuint service_id = 0;
+ if (!path_manager()->GetPath(static_cast<GLuint>(c.path), &service_id)) {
+ LOCAL_SET_GL_ERROR(GL_INVALID_OPERATION, kFunctionName,
+ "invalid path name");
+ return error::kNoError;
+ }
+
+ GLenum pname = static_cast<GLenum>(c.pname);
+ GLfloat value = static_cast<GLfloat>(c.value);
+ bool hasValueError = false;
+
+ switch (pname) {
+ case GL_PATH_STROKE_WIDTH_CHROMIUM:
+ case GL_PATH_MITER_LIMIT_CHROMIUM:
+ hasValueError = std::isnan(value) || !std::isfinite(value) || value < 0;
+ break;
+ case GL_PATH_STROKE_BOUND_CHROMIUM:
+ value = std::max(std::min(1.0f, value), 0.0f);
+ break;
+ case GL_PATH_END_CAPS_CHROMIUM:
+ hasValueError = !validators_->path_parameter_cap_values.IsValid(
+ static_cast<GLint>(value));
+ break;
+ case GL_PATH_JOIN_STYLE_CHROMIUM:
+ hasValueError = !validators_->path_parameter_join_values.IsValid(
+ static_cast<GLint>(value));
+ break;
+ default:
+ DCHECK(!validators_->path_parameter.IsValid(pname));
+ LOCAL_SET_GL_ERROR_INVALID_ENUM(kFunctionName, pname, "pname");
+ return error::kNoError;
+ }
+ DCHECK(validators_->path_parameter.IsValid(pname));
+
+ if (hasValueError) {
+ LOCAL_SET_GL_ERROR(GL_INVALID_VALUE, kFunctionName, "value not correct");
+ return error::kNoError;
+ }
+
+ glPathParameterfNV(service_id, pname, value);
+ return error::kNoError;
+}
+
+error::Error GLES2DecoderImpl::HandlePathParameteriCHROMIUM(
+ uint32 immediate_data_size,
+ const void* cmd_data) {
+ static const char kFunctionName[] = "glPathParameteriCHROMIUM";
+ const gles2::cmds::PathParameteriCHROMIUM& c =
+ *static_cast<const gles2::cmds::PathParameteriCHROMIUM*>(cmd_data);
+ if (!features().chromium_path_rendering) {
+ LOCAL_SET_GL_ERROR(GL_INVALID_OPERATION, kFunctionName,
+ "function not available");
+ return error::kNoError;
+ }
+ GLuint service_id = 0;
+ if (!path_manager()->GetPath(static_cast<GLuint>(c.path), &service_id)) {
+ LOCAL_SET_GL_ERROR(GL_INVALID_OPERATION, kFunctionName,
+ "invalid path name");
+ return error::kNoError;
+ }
+
+ GLenum pname = static_cast<GLenum>(c.pname);
+ GLint value = static_cast<GLint>(c.value);
+ bool hasValueError = false;
+
+ switch (pname) {
+ case GL_PATH_STROKE_WIDTH_CHROMIUM:
+ case GL_PATH_MITER_LIMIT_CHROMIUM:
+ hasValueError = value < 0;
+ break;
+ case GL_PATH_STROKE_BOUND_CHROMIUM:
+ value = std::max(std::min(1, value), 0);
+ break;
+ case GL_PATH_END_CAPS_CHROMIUM:
+ hasValueError = !validators_->path_parameter_cap_values.IsValid(value);
+ break;
+ case GL_PATH_JOIN_STYLE_CHROMIUM:
+ hasValueError = !validators_->path_parameter_join_values.IsValid(value);
+ break;
+ default:
+ DCHECK(!validators_->path_parameter.IsValid(pname));
+ LOCAL_SET_GL_ERROR_INVALID_ENUM(kFunctionName, pname, "pname");
+ return error::kNoError;
+ }
+ DCHECK(validators_->path_parameter.IsValid(pname));
+
+ if (hasValueError) {
+ LOCAL_SET_GL_ERROR(GL_INVALID_VALUE, kFunctionName, "value not correct");
+ return error::kNoError;
+ }
+
+ glPathParameteriNV(service_id, pname, value);
+ return error::kNoError;
+}
+
+error::Error GLES2DecoderImpl::HandleStencilFillPathCHROMIUM(
+ uint32 immediate_data_size,
+ const void* cmd_data) {
+ static const char kFunctionName[] = "glStencilFillPathCHROMIUM";
+ const gles2::cmds::StencilFillPathCHROMIUM& c =
+ *static_cast<const gles2::cmds::StencilFillPathCHROMIUM*>(cmd_data);
+ if (!features().chromium_path_rendering) {
+ LOCAL_SET_GL_ERROR(GL_INVALID_OPERATION, kFunctionName,
+ "function not available");
+ return error::kNoError;
+ }
+ GLenum fill_mode = static_cast<GLenum>(c.fillMode);
+ if (!validators_->path_fill_mode.IsValid(fill_mode)) {
+ LOCAL_SET_GL_ERROR_INVALID_ENUM(kFunctionName, fill_mode, "fillMode");
+ return error::kNoError;
+ }
+ GLuint mask = static_cast<GLuint>(c.mask);
+ if ((fill_mode == GL_COUNT_UP_CHROMIUM ||
+ fill_mode == GL_COUNT_DOWN_CHROMIUM) &&
+ GLES2Util::IsNPOT(mask + 1)) {
+ LOCAL_SET_GL_ERROR(GL_INVALID_VALUE, kFunctionName,
+ "mask + 1 is not power of two");
+ return error::kNoError;
+ }
+ GLuint service_id = 0;
+ if (!path_manager()->GetPath(static_cast<GLuint>(c.path), &service_id)) {
+ // "If /path/ does not name an existing path object, the command does
+ // nothing (and no error is generated)."
+ // This holds for other rendering functions, too.
+ return error::kNoError;
+ }
+ ApplyDirtyState();
+ glStencilFillPathNV(service_id, fill_mode, mask);
+ return error::kNoError;
+}
+
+error::Error GLES2DecoderImpl::HandleStencilStrokePathCHROMIUM(
+ uint32 immediate_data_size,
+ const void* cmd_data) {
+ static const char kFunctionName[] = "glStencilStrokePathCHROMIUM";
+ const gles2::cmds::StencilStrokePathCHROMIUM& c =
+ *static_cast<const gles2::cmds::StencilStrokePathCHROMIUM*>(cmd_data);
+ if (!features().chromium_path_rendering) {
+ LOCAL_SET_GL_ERROR(GL_INVALID_OPERATION, kFunctionName,
+ "function not available");
+ return error::kNoError;
+ }
+ GLuint service_id = 0;
+ if (!path_manager()->GetPath(static_cast<GLuint>(c.path), &service_id)) {
+ return error::kNoError;
+ }
+ GLint reference = static_cast<GLint>(c.reference);
+ GLuint mask = static_cast<GLuint>(c.mask);
+ ApplyDirtyState();
+ glStencilStrokePathNV(service_id, reference, mask);
+ return error::kNoError;
+}
+
+error::Error GLES2DecoderImpl::HandleCoverFillPathCHROMIUM(
+ uint32 immediate_data_size,
+ const void* cmd_data) {
+ static const char kFunctionName[] = "glCoverFillPathCHROMIUM";
+ const gles2::cmds::CoverFillPathCHROMIUM& c =
+ *static_cast<const gles2::cmds::CoverFillPathCHROMIUM*>(cmd_data);
+ if (!features().chromium_path_rendering) {
+ LOCAL_SET_GL_ERROR(GL_INVALID_OPERATION, kFunctionName,
+ "function not available");
+ return error::kNoError;
+ }
+ GLenum cover_mode = static_cast<GLenum>(c.coverMode);
+ if (!validators_->path_cover_mode.IsValid(cover_mode)) {
+ LOCAL_SET_GL_ERROR_INVALID_ENUM(kFunctionName, cover_mode, "coverMode");
+ return error::kNoError;
+ }
+ GLuint service_id = 0;
+ if (!path_manager()->GetPath(static_cast<GLuint>(c.path), &service_id))
+ return error::kNoError;
+
+ ApplyDirtyState();
+ glCoverFillPathNV(service_id, cover_mode);
+ return error::kNoError;
+}
+
+error::Error GLES2DecoderImpl::HandleCoverStrokePathCHROMIUM(
+ uint32 immediate_data_size,
+ const void* cmd_data) {
+ static const char kFunctionName[] = "glCoverStrokePathCHROMIUM";
+ const gles2::cmds::CoverStrokePathCHROMIUM& c =
+ *static_cast<const gles2::cmds::CoverStrokePathCHROMIUM*>(cmd_data);
+ if (!features().chromium_path_rendering) {
+ LOCAL_SET_GL_ERROR(GL_INVALID_OPERATION, kFunctionName,
+ "function not available");
+ return error::kNoError;
+ }
+ GLenum cover_mode = static_cast<GLenum>(c.coverMode);
+ if (!validators_->path_cover_mode.IsValid(cover_mode)) {
+ LOCAL_SET_GL_ERROR_INVALID_ENUM(kFunctionName, cover_mode, "coverMode");
+ return error::kNoError;
+ }
+ GLuint service_id = 0;
+ if (!path_manager()->GetPath(static_cast<GLuint>(c.path), &service_id))
+ return error::kNoError;
+
+ ApplyDirtyState();
+ glCoverStrokePathNV(service_id, cover_mode);
+ return error::kNoError;
+}
+
+error::Error GLES2DecoderImpl::HandleStencilThenCoverFillPathCHROMIUM(
+ uint32 immediate_data_size,
+ const void* cmd_data) {
+ static const char kFunctionName[] = "glStencilThenCoverFillPathCHROMIUM";
+ const gles2::cmds::StencilThenCoverFillPathCHROMIUM& c =
+ *static_cast<const gles2::cmds::StencilThenCoverFillPathCHROMIUM*>(
+ cmd_data);
+ if (!features().chromium_path_rendering) {
+ LOCAL_SET_GL_ERROR(GL_INVALID_OPERATION, kFunctionName,
+ "function not available");
+ return error::kNoError;
+ }
+ GLenum fill_mode = static_cast<GLenum>(c.fillMode);
+ if (!validators_->path_fill_mode.IsValid(fill_mode)) {
+ LOCAL_SET_GL_ERROR_INVALID_ENUM(kFunctionName, fill_mode, "fillMode");
+ return error::kNoError;
+ }
+ GLuint mask = static_cast<GLuint>(c.mask);
+ if ((fill_mode == GL_COUNT_UP_CHROMIUM ||
+ fill_mode == GL_COUNT_DOWN_CHROMIUM) &&
+ GLES2Util::IsNPOT(mask + 1)) {
+ LOCAL_SET_GL_ERROR(GL_INVALID_VALUE, kFunctionName,
+ "mask + 1 is not power of two");
+ return error::kNoError;
+ }
+ GLenum cover_mode = static_cast<GLenum>(c.coverMode);
+ if (!validators_->path_cover_mode.IsValid(cover_mode)) {
+ LOCAL_SET_GL_ERROR_INVALID_ENUM(kFunctionName, cover_mode, "coverMode");
+ return error::kNoError;
+ }
+ GLuint service_id = 0;
+ if (!path_manager()->GetPath(static_cast<GLuint>(c.path), &service_id))
+ return error::kNoError;
+
+ ApplyDirtyState();
+ glStencilThenCoverFillPathNV(service_id, fill_mode, mask, cover_mode);
+ return error::kNoError;
+}
+
+error::Error GLES2DecoderImpl::HandleStencilThenCoverStrokePathCHROMIUM(
+ uint32 immediate_data_size,
+ const void* cmd_data) {
+ static const char kFunctionName[] = "glStencilThenCoverStrokePathCHROMIUM";
+ const gles2::cmds::StencilThenCoverStrokePathCHROMIUM& c =
+ *static_cast<const gles2::cmds::StencilThenCoverStrokePathCHROMIUM*>(
+ cmd_data);
+ if (!features().chromium_path_rendering) {
+ LOCAL_SET_GL_ERROR(GL_INVALID_OPERATION, kFunctionName,
+ "function not available");
+ return error::kNoError;
+ }
+ GLenum cover_mode = static_cast<GLenum>(c.coverMode);
+ if (!validators_->path_cover_mode.IsValid(cover_mode)) {
+ LOCAL_SET_GL_ERROR_INVALID_ENUM(kFunctionName, cover_mode, "coverMode");
+ return error::kNoError;
+ }
+ GLuint service_id = 0;
+ if (!path_manager()->GetPath(static_cast<GLuint>(c.path), &service_id))
+ return error::kNoError;
+
+ GLint reference = static_cast<GLint>(c.reference);
+ GLuint mask = static_cast<GLuint>(c.mask);
+ ApplyDirtyState();
+ glStencilThenCoverStrokePathNV(service_id, reference, mask, cover_mode);
+ return error::kNoError;
+}
+
// Include the auto-generated part of this file. We split this because it means
// we can easily edit the non-auto generated parts right here in this file
// instead of having to edit some template or the code generator.
diff --git a/chromium/gpu/command_buffer/service/gles2_cmd_decoder.h b/chromium/gpu/command_buffer/service/gles2_cmd_decoder.h
index 79ecb2c21bc..0fb4882c76d 100644
--- a/chromium/gpu/command_buffer/service/gles2_cmd_decoder.h
+++ b/chromium/gpu/command_buffer/service/gles2_cmd_decoder.h
@@ -30,7 +30,6 @@ class Size;
namespace gpu {
-class AsyncPixelTransferManager;
struct Mailbox;
namespace gles2 {
@@ -188,12 +187,16 @@ class GPU_EXPORT GLES2Decoder : public base::SupportsWeakPtr<GLES2Decoder>,
// Gets the ValuebufferManager for this context.
virtual ValuebufferManager* GetValuebufferManager() = 0;
- // Process any pending queries. Returns false if there are no pending queries.
- virtual bool ProcessPendingQueries(bool did_finish) = 0;
+ // Returns false if there are no pending queries.
+ virtual bool HasPendingQueries() const = 0;
- // Returns false if there are no idle work to be made.
- virtual bool HasMoreIdleWork() = 0;
+ // Process any pending queries.
+ virtual void ProcessPendingQueries(bool did_finish) = 0;
+ // Returns false if there is no idle work to be made.
+ virtual bool HasMoreIdleWork() const = 0;
+
+ // Perform any idle work that needs to be made.
virtual void PerformIdleWork() = 0;
// Sets a callback which is called when a glResizeCHROMIUM command
@@ -201,12 +204,6 @@ class GPU_EXPORT GLES2Decoder : public base::SupportsWeakPtr<GLES2Decoder>,
virtual void SetResizeCallback(
const base::Callback<void(gfx::Size, float)>& callback) = 0;
- // Interface to performing async pixel transfers.
- virtual AsyncPixelTransferManager* GetAsyncPixelTransferManager() = 0;
- virtual void ResetAsyncPixelTransferManagerForTest() = 0;
- virtual void SetAsyncPixelTransferManagerForTest(
- AsyncPixelTransferManager* manager) = 0;
-
// Get the service texture ID corresponding to a client texture ID.
// If no such record is found then return false.
virtual bool GetServiceTextureId(uint32 client_texture_id,
diff --git a/chromium/gpu/command_buffer/service/gles2_cmd_decoder_autogen.h b/chromium/gpu/command_buffer/service/gles2_cmd_decoder_autogen.h
index 27e66c30388..303b7021c5c 100644
--- a/chromium/gpu/command_buffer/service/gles2_cmd_decoder_autogen.h
+++ b/chromium/gpu/command_buffer/service/gles2_cmd_decoder_autogen.h
@@ -59,17 +59,7 @@ error::Error GLES2DecoderImpl::HandleBindBufferBase(
GLenum target = static_cast<GLenum>(c.target);
GLuint index = static_cast<GLuint>(c.index);
GLuint buffer = c.buffer;
- if (!group_->GetBufferServiceId(buffer, &buffer)) {
- if (!group_->bind_generates_resource()) {
- LOCAL_SET_GL_ERROR(GL_INVALID_OPERATION, "glBindBufferBase",
- "invalid buffer id");
- return error::kNoError;
- }
- GLuint client_id = buffer;
- glGenBuffersARB(1, &buffer);
- CreateBuffer(client_id, buffer);
- }
- glBindBufferBase(target, index, buffer);
+ DoBindBufferBase(target, index, buffer);
return error::kNoError;
}
@@ -86,17 +76,7 @@ error::Error GLES2DecoderImpl::HandleBindBufferRange(
GLuint buffer = c.buffer;
GLintptr offset = static_cast<GLintptr>(c.offset);
GLsizeiptr size = static_cast<GLsizeiptr>(c.size);
- if (!group_->GetBufferServiceId(buffer, &buffer)) {
- if (!group_->bind_generates_resource()) {
- LOCAL_SET_GL_ERROR(GL_INVALID_OPERATION, "glBindBufferRange",
- "invalid buffer id");
- return error::kNoError;
- }
- GLuint client_id = buffer;
- glGenBuffersARB(1, &buffer);
- CreateBuffer(client_id, buffer);
- }
- glBindBufferRange(target, index, buffer, offset, size);
+ DoBindBufferRange(target, index, buffer, offset, size);
return error::kNoError;
}
@@ -141,6 +121,10 @@ error::Error GLES2DecoderImpl::HandleBindSampler(uint32_t immediate_data_size,
(void)c;
GLuint unit = static_cast<GLuint>(c.unit);
GLuint sampler = c.sampler;
+ if (sampler == 0) {
+ glBindSampler(unit, sampler);
+ return error::kNoError;
+ }
if (!group_->GetSamplerServiceId(sampler, &sampler)) {
LOCAL_SET_GL_ERROR(GL_INVALID_OPERATION, "glBindSampler",
"invalid sampler id");
@@ -391,7 +375,7 @@ error::Error GLES2DecoderImpl::HandleClearBufferfi(uint32_t immediate_data_size,
GLint drawbuffers = static_cast<GLint>(c.drawbuffers);
GLfloat depth = static_cast<GLfloat>(c.depth);
GLint stencil = static_cast<GLint>(c.stencil);
- glClearBufferfi(buffer, drawbuffers, depth, stencil);
+ DoClearBufferfi(buffer, drawbuffers, depth, stencil);
return error::kNoError;
}
@@ -417,7 +401,7 @@ error::Error GLES2DecoderImpl::HandleClearBufferfvImmediate(
if (value == NULL) {
return error::kOutOfBounds;
}
- glClearBufferfv(buffer, drawbuffers, value);
+ DoClearBufferfv(buffer, drawbuffers, value);
return error::kNoError;
}
@@ -443,7 +427,7 @@ error::Error GLES2DecoderImpl::HandleClearBufferivImmediate(
if (value == NULL) {
return error::kOutOfBounds;
}
- glClearBufferiv(buffer, drawbuffers, value);
+ DoClearBufferiv(buffer, drawbuffers, value);
return error::kNoError;
}
@@ -469,7 +453,7 @@ error::Error GLES2DecoderImpl::HandleClearBufferuivImmediate(
if (value == NULL) {
return error::kOutOfBounds;
}
- glClearBufferuiv(buffer, drawbuffers, value);
+ DoClearBufferuiv(buffer, drawbuffers, value);
return error::kNoError;
}
@@ -1388,6 +1372,33 @@ error::Error GLES2DecoderImpl::HandleGetBooleanv(uint32_t immediate_data_size,
return error::kNoError;
}
+error::Error GLES2DecoderImpl::HandleGetBufferParameteri64v(
+ uint32_t immediate_data_size,
+ const void* cmd_data) {
+ if (!unsafe_es3_apis_enabled())
+ return error::kUnknownCommand;
+ const gles2::cmds::GetBufferParameteri64v& c =
+ *static_cast<const gles2::cmds::GetBufferParameteri64v*>(cmd_data);
+ (void)c;
+ GLenum target = static_cast<GLenum>(c.target);
+ GLenum pname = static_cast<GLenum>(c.pname);
+ typedef cmds::GetBufferParameteri64v::Result Result;
+ GLsizei num_values = 0;
+ GetNumValuesReturnedForGLGet(pname, &num_values);
+ Result* result = GetSharedMemoryAs<Result*>(
+ c.params_shm_id, c.params_shm_offset, Result::ComputeSize(num_values));
+ GLint64* params = result ? result->GetData() : NULL;
+ if (params == NULL) {
+ return error::kOutOfBounds;
+ }
+ // Check that the client initialized the result.
+ if (result->size != 0) {
+ return error::kInvalidArguments;
+ }
+ DoGetBufferParameteri64v(target, pname, params);
+ result->SetNumResults(num_values);
+ return error::kNoError;
+}
error::Error GLES2DecoderImpl::HandleGetBufferParameteriv(
uint32_t immediate_data_size,
const void* cmd_data) {
@@ -2394,7 +2405,7 @@ error::Error GLES2DecoderImpl::HandleReadBuffer(uint32_t immediate_data_size,
*static_cast<const gles2::cmds::ReadBuffer*>(cmd_data);
(void)c;
GLenum src = static_cast<GLenum>(c.src);
- glReadBuffer(src);
+ DoReadBuffer(src);
return error::kNoError;
}
@@ -3055,7 +3066,7 @@ error::Error GLES2DecoderImpl::HandleUniform1ui(uint32_t immediate_data_size,
GLuint temp[1] = {
x,
};
- glUniform1uiv(location, 1, &temp[0]);
+ DoUniform1uiv(location, 1, &temp[0]);
return error::kNoError;
}
@@ -3081,7 +3092,7 @@ error::Error GLES2DecoderImpl::HandleUniform1uivImmediate(
if (v == NULL) {
return error::kOutOfBounds;
}
- glUniform1uiv(location, count, v);
+ DoUniform1uiv(location, count, v);
return error::kNoError;
}
@@ -3176,7 +3187,7 @@ error::Error GLES2DecoderImpl::HandleUniform2ui(uint32_t immediate_data_size,
GLuint temp[2] = {
x, y,
};
- glUniform2uiv(location, 1, &temp[0]);
+ DoUniform2uiv(location, 1, &temp[0]);
return error::kNoError;
}
@@ -3202,7 +3213,7 @@ error::Error GLES2DecoderImpl::HandleUniform2uivImmediate(
if (v == NULL) {
return error::kOutOfBounds;
}
- glUniform2uiv(location, count, v);
+ DoUniform2uiv(location, count, v);
return error::kNoError;
}
@@ -3300,7 +3311,7 @@ error::Error GLES2DecoderImpl::HandleUniform3ui(uint32_t immediate_data_size,
GLuint temp[3] = {
x, y, z,
};
- glUniform3uiv(location, 1, &temp[0]);
+ DoUniform3uiv(location, 1, &temp[0]);
return error::kNoError;
}
@@ -3326,7 +3337,7 @@ error::Error GLES2DecoderImpl::HandleUniform3uivImmediate(
if (v == NULL) {
return error::kOutOfBounds;
}
- glUniform3uiv(location, count, v);
+ DoUniform3uiv(location, count, v);
return error::kNoError;
}
@@ -3427,7 +3438,7 @@ error::Error GLES2DecoderImpl::HandleUniform4ui(uint32_t immediate_data_size,
GLuint temp[4] = {
x, y, z, w,
};
- glUniform4uiv(location, 1, &temp[0]);
+ DoUniform4uiv(location, 1, &temp[0]);
return error::kNoError;
}
@@ -3453,7 +3464,7 @@ error::Error GLES2DecoderImpl::HandleUniform4uivImmediate(
if (v == NULL) {
return error::kOutOfBounds;
}
- glUniform4uiv(location, count, v);
+ DoUniform4uiv(location, count, v);
return error::kNoError;
}
@@ -3505,7 +3516,7 @@ error::Error GLES2DecoderImpl::HandleUniformMatrix2x3fvImmediate(
if (value == NULL) {
return error::kOutOfBounds;
}
- glUniformMatrix2x3fv(location, count, transpose, value);
+ DoUniformMatrix2x3fv(location, count, transpose, value);
return error::kNoError;
}
@@ -3532,7 +3543,7 @@ error::Error GLES2DecoderImpl::HandleUniformMatrix2x4fvImmediate(
if (value == NULL) {
return error::kOutOfBounds;
}
- glUniformMatrix2x4fv(location, count, transpose, value);
+ DoUniformMatrix2x4fv(location, count, transpose, value);
return error::kNoError;
}
@@ -3584,7 +3595,7 @@ error::Error GLES2DecoderImpl::HandleUniformMatrix3x2fvImmediate(
if (value == NULL) {
return error::kOutOfBounds;
}
- glUniformMatrix3x2fv(location, count, transpose, value);
+ DoUniformMatrix3x2fv(location, count, transpose, value);
return error::kNoError;
}
@@ -3611,7 +3622,7 @@ error::Error GLES2DecoderImpl::HandleUniformMatrix3x4fvImmediate(
if (value == NULL) {
return error::kOutOfBounds;
}
- glUniformMatrix3x4fv(location, count, transpose, value);
+ DoUniformMatrix3x4fv(location, count, transpose, value);
return error::kNoError;
}
@@ -3663,7 +3674,7 @@ error::Error GLES2DecoderImpl::HandleUniformMatrix4x2fvImmediate(
if (value == NULL) {
return error::kOutOfBounds;
}
- glUniformMatrix4x2fv(location, count, transpose, value);
+ DoUniformMatrix4x2fv(location, count, transpose, value);
return error::kNoError;
}
@@ -3690,7 +3701,7 @@ error::Error GLES2DecoderImpl::HandleUniformMatrix4x3fvImmediate(
if (value == NULL) {
return error::kOutOfBounds;
}
- glUniformMatrix4x3fv(location, count, transpose, value);
+ DoUniformMatrix4x3fv(location, count, transpose, value);
return error::kNoError;
}
@@ -4524,6 +4535,37 @@ error::Error GLES2DecoderImpl::HandleCompressedCopyTextureCHROMIUM(
return error::kNoError;
}
+error::Error GLES2DecoderImpl::HandleCompressedCopySubTextureCHROMIUM(
+ uint32_t immediate_data_size,
+ const void* cmd_data) {
+ const gles2::cmds::CompressedCopySubTextureCHROMIUM& c =
+ *static_cast<const gles2::cmds::CompressedCopySubTextureCHROMIUM*>(
+ cmd_data);
+ (void)c;
+ GLenum target = static_cast<GLenum>(c.target);
+ GLenum source_id = static_cast<GLenum>(c.source_id);
+ GLenum dest_id = static_cast<GLenum>(c.dest_id);
+ GLint xoffset = static_cast<GLint>(c.xoffset);
+ GLint yoffset = static_cast<GLint>(c.yoffset);
+ GLint x = static_cast<GLint>(c.x);
+ GLint y = static_cast<GLint>(c.y);
+ GLsizei width = static_cast<GLsizei>(c.width);
+ GLsizei height = static_cast<GLsizei>(c.height);
+ if (width < 0) {
+ LOCAL_SET_GL_ERROR(GL_INVALID_VALUE, "glCompressedCopySubTextureCHROMIUM",
+ "width < 0");
+ return error::kNoError;
+ }
+ if (height < 0) {
+ LOCAL_SET_GL_ERROR(GL_INVALID_VALUE, "glCompressedCopySubTextureCHROMIUM",
+ "height < 0");
+ return error::kNoError;
+ }
+ DoCompressedCopySubTextureCHROMIUM(target, source_id, dest_id, xoffset,
+ yoffset, x, y, width, height);
+ return error::kNoError;
+}
+
error::Error GLES2DecoderImpl::HandleProduceTextureCHROMIUMImmediate(
uint32_t immediate_data_size,
const void* cmd_data) {
@@ -4956,6 +4998,58 @@ error::Error GLES2DecoderImpl::HandleMatrixLoadIdentityCHROMIUM(
return error::kNoError;
}
+error::Error GLES2DecoderImpl::HandleIsPathCHROMIUM(
+ uint32_t immediate_data_size,
+ const void* cmd_data) {
+ const gles2::cmds::IsPathCHROMIUM& c =
+ *static_cast<const gles2::cmds::IsPathCHROMIUM*>(cmd_data);
+ (void)c;
+ if (!features().chromium_path_rendering) {
+ LOCAL_SET_GL_ERROR(GL_INVALID_OPERATION, "glIsPathCHROMIUM",
+ "function not available");
+ return error::kNoError;
+ }
+
+ GLuint path = c.path;
+ typedef cmds::IsPathCHROMIUM::Result Result;
+ Result* result_dst = GetSharedMemoryAs<Result*>(
+ c.result_shm_id, c.result_shm_offset, sizeof(*result_dst));
+ if (!result_dst) {
+ return error::kOutOfBounds;
+ }
+ *result_dst = DoIsPathCHROMIUM(path);
+ return error::kNoError;
+}
+
+error::Error GLES2DecoderImpl::HandlePathStencilFuncCHROMIUM(
+ uint32_t immediate_data_size,
+ const void* cmd_data) {
+ const gles2::cmds::PathStencilFuncCHROMIUM& c =
+ *static_cast<const gles2::cmds::PathStencilFuncCHROMIUM*>(cmd_data);
+ (void)c;
+ if (!features().chromium_path_rendering) {
+ LOCAL_SET_GL_ERROR(GL_INVALID_OPERATION, "glPathStencilFuncCHROMIUM",
+ "function not available");
+ return error::kNoError;
+ }
+
+ GLenum func = static_cast<GLenum>(c.func);
+ GLint ref = static_cast<GLint>(c.ref);
+ GLuint mask = static_cast<GLuint>(c.mask);
+ if (!validators_->cmp_function.IsValid(func)) {
+ LOCAL_SET_GL_ERROR_INVALID_ENUM("glPathStencilFuncCHROMIUM", func, "func");
+ return error::kNoError;
+ }
+ if (state_.stencil_path_func != func || state_.stencil_path_ref != ref ||
+ state_.stencil_path_mask != mask) {
+ state_.stencil_path_func = func;
+ state_.stencil_path_ref = ref;
+ state_.stencil_path_mask = mask;
+ glPathStencilFuncNV(func, ref, mask);
+ }
+ return error::kNoError;
+}
+
error::Error GLES2DecoderImpl::HandleBlendBarrierKHR(
uint32_t immediate_data_size,
const void* cmd_data) {
@@ -4972,6 +5066,24 @@ error::Error GLES2DecoderImpl::HandleBlendBarrierKHR(
return error::kNoError;
}
+error::Error GLES2DecoderImpl::HandleApplyScreenSpaceAntialiasingCHROMIUM(
+ uint32_t immediate_data_size,
+ const void* cmd_data) {
+ const gles2::cmds::ApplyScreenSpaceAntialiasingCHROMIUM& c =
+ *static_cast<const gles2::cmds::ApplyScreenSpaceAntialiasingCHROMIUM*>(
+ cmd_data);
+ (void)c;
+ if (!features().chromium_screen_space_antialiasing) {
+ LOCAL_SET_GL_ERROR(GL_INVALID_OPERATION,
+ "glApplyScreenSpaceAntialiasingCHROMIUM",
+ "function not available");
+ return error::kNoError;
+ }
+
+ DoApplyScreenSpaceAntialiasingCHROMIUM();
+ return error::kNoError;
+}
+
bool GLES2DecoderImpl::SetCapabilityState(GLenum cap, bool enabled) {
switch (cap) {
case GL_BLEND:
diff --git a/chromium/gpu/command_buffer/service/gles2_cmd_decoder_mock.h b/chromium/gpu/command_buffer/service/gles2_cmd_decoder_mock.h
index 0c71d48b38f..62e1c9d492b 100644
--- a/chromium/gpu/command_buffer/service/gles2_cmd_decoder_mock.h
+++ b/chromium/gpu/command_buffer/service/gles2_cmd_decoder_mock.h
@@ -59,8 +59,9 @@ class MockGLES2Decoder : public GLES2Decoder {
MOCK_METHOD0(GetContextGroup, ContextGroup*());
MOCK_METHOD0(GetContextState, const ContextState*());
MOCK_METHOD0(GetCapabilities, Capabilities());
- MOCK_METHOD1(ProcessPendingQueries, bool(bool));
- MOCK_METHOD0(HasMoreIdleWork, bool());
+ MOCK_CONST_METHOD0(HasPendingQueries, bool());
+ MOCK_METHOD1(ProcessPendingQueries, void(bool));
+ MOCK_CONST_METHOD0(HasMoreIdleWork, bool());
MOCK_METHOD0(PerformIdleWork, void());
MOCK_METHOD1(RestoreState, void(const ContextState* prev_state));
MOCK_CONST_METHOD0(RestoreActiveTexture, void());
@@ -83,13 +84,6 @@ class MockGLES2Decoder : public GLES2Decoder {
MOCK_METHOD0(GetValuebufferManager, gpu::gles2::ValuebufferManager*());
MOCK_METHOD1(
SetResizeCallback, void(const base::Callback<void(gfx::Size, float)>&));
- MOCK_METHOD0(GetAsyncPixelTransferDelegate,
- AsyncPixelTransferDelegate*());
- MOCK_METHOD0(GetAsyncPixelTransferManager,
- AsyncPixelTransferManager*());
- MOCK_METHOD0(ResetAsyncPixelTransferManagerForTest, void());
- MOCK_METHOD1(SetAsyncPixelTransferManagerForTest,
- void(AsyncPixelTransferManager*));
MOCK_METHOD1(SetIgnoreCachedStateForTest, void(bool ignore));
MOCK_METHOD1(SetAllowExit, void(bool allow));
MOCK_METHOD3(DoCommand, error::Error(unsigned int command,
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 a76346f3088..a66af3aa75b 100644
--- a/chromium/gpu/command_buffer/service/gles2_cmd_decoder_unittest.cc
+++ b/chromium/gpu/command_buffer/service/gles2_cmd_decoder_unittest.cc
@@ -8,9 +8,6 @@
#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/async_pixel_transfer_delegate_mock.h"
-#include "gpu/command_buffer/service/async_pixel_transfer_manager.h"
-#include "gpu/command_buffer/service/async_pixel_transfer_manager_mock.h"
#include "gpu/command_buffer/service/cmd_buffer_engine.h"
#include "gpu/command_buffer/service/context_group.h"
#include "gpu/command_buffer/service/context_state.h"
@@ -26,6 +23,7 @@
#include "ui/gl/gl_implementation.h"
#include "ui/gl/gl_mock.h"
#include "ui/gl/gl_surface_stub.h"
+#include "ui/gl/gpu_timing_fake.h"
#if !defined(GL_DEPTH24_STENCIL8)
@@ -95,7 +93,7 @@ void GLES3DecoderTest::SetUp() {
InitState init;
init.gl_version = "OpenGL ES 3.0";
init.bind_generates_resource = true;
- init.webgl_version = 2;
+ init.context_type = CONTEXT_TYPE_OPENGLES3;
InitDecoderWithCommandLine(init, &command_line);
}
@@ -537,7 +535,7 @@ TEST_P(GLES2DecoderManualInitTest, BeginEndQueryEXT) {
// After BeginQueriesEXT id name should have query object associated with it.
query = query_manager->GetQuery(kNewClientId);
ASSERT_TRUE(query != NULL);
- EXPECT_FALSE(query->pending());
+ EXPECT_FALSE(query->IsPending());
// Test trying begin again fails
EXPECT_EQ(error::kNoError, ExecuteCmd(begin_cmd));
@@ -555,129 +553,185 @@ TEST_P(GLES2DecoderManualInitTest, BeginEndQueryEXT) {
end_cmd.Init(GL_ANY_SAMPLES_PASSED_EXT, 1);
EXPECT_EQ(error::kNoError, ExecuteCmd(end_cmd));
EXPECT_EQ(GL_NO_ERROR, GetGLError());
- EXPECT_TRUE(query->pending());
+ EXPECT_TRUE(query->IsPending());
EXPECT_CALL(*gl_, DeleteQueries(1, _)).Times(1).RetiresOnSaturation();
}
struct QueryType {
GLenum type;
- bool is_gl;
+ bool is_counter;
};
const QueryType kQueryTypes[] = {
{GL_COMMANDS_ISSUED_CHROMIUM, false},
{GL_LATENCY_QUERY_CHROMIUM, false},
- {GL_ASYNC_PIXEL_UNPACK_COMPLETED_CHROMIUM, false},
{GL_ASYNC_PIXEL_PACK_COMPLETED_CHROMIUM, false},
{GL_GET_ERROR_QUERY_CHROMIUM, false},
{GL_COMMANDS_COMPLETED_CHROMIUM, false},
- {GL_ANY_SAMPLES_PASSED_EXT, true},
- {GL_TIME_ELAPSED, true},
+ {GL_ANY_SAMPLES_PASSED_EXT, false},
+ {GL_TIME_ELAPSED, false},
+ {GL_TIMESTAMP, true},
};
+const GLsync kGlSync = reinterpret_cast<GLsync>(0xdeadbeef);
-static void CheckBeginEndQueryBadMemoryFails(GLES2DecoderTestBase* test,
- GLuint client_id,
- GLuint service_id,
- const QueryType& query_type,
- int32 shm_id,
- uint32 shm_offset) {
- // We need to reset the decoder on each iteration, because we lose the
- // context every time.
- GLES2DecoderTestBase::InitState init;
- init.extensions = "GL_EXT_occlusion_query_boolean"
- " GL_ARB_sync"
- " GL_ARB_timer_query";
- init.gl_version = "opengl es 2.0";
- init.has_alpha = true;
- init.request_alpha = true;
- init.bind_generates_resource = true;
- test->InitDecoder(init);
- ::testing::StrictMock< ::gfx::MockGLInterface>* gl = test->GetGLMock();
-
- BeginQueryEXT begin_cmd;
-
+static void ExecuteGenerateQueryCmd(GLES2DecoderTestBase* test,
+ ::gfx::MockGLInterface* gl,
+ GLenum target,
+ GLuint client_id,
+ GLuint service_id) {
test->GenHelper<GenQueriesEXTImmediate>(client_id);
-
- if (query_type.is_gl) {
+ if (GL_ANY_SAMPLES_PASSED_EXT == target) {
EXPECT_CALL(*gl, GenQueries(1, _))
.WillOnce(SetArgPointee<1>(service_id))
.RetiresOnSaturation();
- EXPECT_CALL(*gl, BeginQuery(query_type.type, service_id))
+ }
+}
+
+static error::Error ExecuteBeginQueryCmd(GLES2DecoderTestBase* test,
+ ::gfx::MockGLInterface* gl,
+ ::gfx::GPUTimingFake* timing_queries,
+ GLenum target,
+ GLuint client_id,
+ GLuint service_id,
+ int32 shm_id,
+ uint32 shm_offset) {
+ if (GL_ANY_SAMPLES_PASSED_EXT == target) {
+ EXPECT_CALL(*gl, BeginQuery(target, service_id))
.Times(1)
.RetiresOnSaturation();
+ } else if (GL_TIME_ELAPSED == target) {
+ timing_queries->ExpectGPUTimerQuery(*gl, true);
}
- // Test bad shared memory fails
- begin_cmd.Init(query_type.type, client_id, shm_id, shm_offset);
- error::Error error1 = test->ExecuteCmd(begin_cmd);
+ BeginQueryEXT begin_cmd;
+ begin_cmd.Init(target, client_id, shm_id, shm_offset);
+ return test->ExecuteCmd(begin_cmd);
+}
- if (query_type.is_gl) {
- EXPECT_CALL(*gl, EndQuery(query_type.type))
+static error::Error ExecuteEndQueryCmd(GLES2DecoderTestBase* test,
+ ::gfx::MockGLInterface* gl,
+ GLenum target,
+ uint32_t submit_count) {
+ if (GL_ANY_SAMPLES_PASSED_EXT == target) {
+ EXPECT_CALL(*gl, EndQuery(target))
.Times(1)
.RetiresOnSaturation();
- }
- if (query_type.type == GL_GET_ERROR_QUERY_CHROMIUM) {
+ } else if (GL_GET_ERROR_QUERY_CHROMIUM == target) {
EXPECT_CALL(*gl, GetError())
.WillOnce(Return(GL_NO_ERROR))
.RetiresOnSaturation();
- }
- GLsync kGlSync = reinterpret_cast<GLsync>(0xdeadbeef);
- if (query_type.type == GL_COMMANDS_COMPLETED_CHROMIUM) {
+ } else if (GL_COMMANDS_COMPLETED_CHROMIUM == target) {
EXPECT_CALL(*gl, Flush()).RetiresOnSaturation();
EXPECT_CALL(*gl, FenceSync(GL_SYNC_GPU_COMMANDS_COMPLETE, 0))
.WillOnce(Return(kGlSync))
.RetiresOnSaturation();
#if DCHECK_IS_ON()
EXPECT_CALL(*gl, IsSync(kGlSync))
- .WillOnce(Return(GL_TRUE))
- .RetiresOnSaturation();
+ .WillRepeatedly(Return(GL_TRUE));
#endif
}
EndQueryEXT end_cmd;
- end_cmd.Init(query_type.type, 1);
- error::Error error2 = test->ExecuteCmd(end_cmd);
+ end_cmd.Init(target, submit_count);
+ return test->ExecuteCmd(end_cmd);
+}
+
+static error::Error ExecuteQueryCounterCmd(GLES2DecoderTestBase* test,
+ ::gfx::MockGLInterface* gl,
+ ::gfx::GPUTimingFake* timing_queries,
+ GLenum target,
+ GLuint client_id,
+ GLuint service_id,
+ int32 shm_id,
+ uint32 shm_offset,
+ uint32_t submit_count) {
+ if (GL_TIMESTAMP == target) {
+ timing_queries->ExpectGPUTimeStampQuery(*gl, false);
+ }
+
+ QueryCounterEXT query_counter_cmd;
+ query_counter_cmd.Init(client_id,
+ target,
+ shm_id,
+ shm_offset,
+ submit_count);
+ return test->ExecuteCmd(query_counter_cmd);
+}
- if (query_type.is_gl) {
+static bool ProcessQuery(GLES2DecoderTestBase* test,
+ ::gfx::MockGLInterface* gl,
+ GLenum target,
+ GLuint service_id) {
+ if (GL_ANY_SAMPLES_PASSED_EXT == target) {
EXPECT_CALL(
*gl, GetQueryObjectuiv(service_id, GL_QUERY_RESULT_AVAILABLE_EXT, _))
.WillOnce(SetArgPointee<2>(1))
.RetiresOnSaturation();
- if (query_type.type == GL_TIME_ELAPSED) {
- EXPECT_CALL(*gl, GetQueryObjectui64v(service_id, GL_QUERY_RESULT_EXT, _))
- .WillOnce(SetArgPointee<2>(1))
- .RetiresOnSaturation();
- } else {
- EXPECT_CALL(*gl, GetQueryObjectuiv(service_id, GL_QUERY_RESULT_EXT, _))
- .WillOnce(SetArgPointee<2>(1))
- .RetiresOnSaturation();
- }
- EXPECT_CALL(*gl, DeleteQueries(1, _)).Times(1).RetiresOnSaturation();
- }
- if (query_type.type == GL_COMMANDS_COMPLETED_CHROMIUM) {
-#if DCHECK_IS_ON()
- EXPECT_CALL(*gl, IsSync(kGlSync))
- .WillOnce(Return(GL_TRUE))
+ EXPECT_CALL(*gl, GetQueryObjectuiv(service_id, GL_QUERY_RESULT_EXT, _))
+ .WillOnce(SetArgPointee<2>(1))
.RetiresOnSaturation();
-#endif
+ } else if (GL_COMMANDS_COMPLETED_CHROMIUM == target) {
EXPECT_CALL(*gl, ClientWaitSync(kGlSync, _, _))
.WillOnce(Return(GL_ALREADY_SIGNALED))
.RetiresOnSaturation();
-#if DCHECK_IS_ON()
- EXPECT_CALL(*gl, IsSync(kGlSync))
- .WillOnce(Return(GL_TRUE))
- .RetiresOnSaturation();
-#endif
EXPECT_CALL(*gl, DeleteSync(kGlSync)).Times(1).RetiresOnSaturation();
}
QueryManager* query_manager = test->GetDecoder()->GetQueryManager();
- ASSERT_TRUE(query_manager != NULL);
- bool process_success = query_manager->ProcessPendingQueries(false);
+ EXPECT_TRUE(nullptr != query_manager);
+ if (!query_manager)
+ return false;
+
+ return query_manager->ProcessPendingQueries(false);
+}
+
+static void CheckBeginEndQueryBadMemoryFails(GLES2DecoderTestBase* test,
+ GLuint client_id,
+ GLuint service_id,
+ const QueryType& query_type,
+ int32 shm_id,
+ uint32 shm_offset) {
+ // We need to reset the decoder on each iteration, because we lose the
+ // context every time.
+ GLES2DecoderTestBase::InitState init;
+ init.extensions = "GL_EXT_occlusion_query_boolean"
+ " GL_ARB_sync"
+ " GL_ARB_timer_query";
+ init.gl_version = "opengl es 3.0";
+ init.has_alpha = true;
+ init.request_alpha = true;
+ init.bind_generates_resource = true;
+ test->InitDecoder(init);
+ ::testing::StrictMock< ::gfx::MockGLInterface>* gl = test->GetGLMock();
+ ::gfx::GPUTimingFake gpu_timing_queries;
+
+ ExecuteGenerateQueryCmd(test, gl, query_type.type,
+ client_id, service_id);
+
+ // Test bad shared memory fails
+ error::Error error1 = error::kNoError;
+ error::Error error2 = error::kNoError;
+ if (query_type.is_counter) {
+ error1 = ExecuteQueryCounterCmd(test, gl, &gpu_timing_queries,
+ query_type.type,
+ client_id, service_id,
+ shm_id, shm_offset, 1);
+ } else {
+ error1 = ExecuteBeginQueryCmd(test, gl, &gpu_timing_queries,
+ query_type.type,
+ client_id, service_id,
+ shm_id, shm_offset);
+ error2 = ExecuteEndQueryCmd(test, gl, query_type.type, 1);
+ }
+
+ bool process_success = ProcessQuery(test, gl, query_type.type, service_id);
EXPECT_TRUE(error1 != error::kNoError || error2 != error::kNoError ||
!process_success);
+
+ if (GL_ANY_SAMPLES_PASSED_EXT == query_type.type)
+ EXPECT_CALL(*gl, DeleteQueries(1, _)).Times(1).RetiresOnSaturation();
test->ResetDecoder();
}
@@ -711,6 +765,79 @@ TEST_P(GLES2DecoderManualInitTest, BeginEndQueryEXTBadMemoryOffsetFails) {
}
}
+TEST_P(GLES2DecoderManualInitTest, QueryReuseTest) {
+ for (size_t i = 0; i < arraysize(kQueryTypes); ++i) {
+ const QueryType& query_type = kQueryTypes[i];
+
+ GLES2DecoderTestBase::InitState init;
+ init.extensions = "GL_EXT_occlusion_query_boolean"
+ " GL_ARB_sync"
+ " GL_ARB_timer_query";
+ init.gl_version = "opengl es 3.0";
+ init.has_alpha = true;
+ init.request_alpha = true;
+ init.bind_generates_resource = true;
+ InitDecoder(init);
+ ::testing::StrictMock< ::gfx::MockGLInterface>* gl = GetGLMock();
+ ::gfx::GPUTimingFake gpu_timing_queries;
+
+ ExecuteGenerateQueryCmd(this, gl, query_type.type,
+ kNewClientId, kNewServiceId);
+
+ // Query once.
+ if (query_type.is_counter) {
+ EXPECT_EQ(error::kNoError, ExecuteQueryCounterCmd(this, gl,
+ &gpu_timing_queries,
+ query_type.type,
+ kNewClientId,
+ kNewServiceId,
+ kSharedMemoryId,
+ kSharedMemoryOffset,
+ 1));
+ } else {
+ EXPECT_EQ(error::kNoError, ExecuteBeginQueryCmd(this, gl,
+ &gpu_timing_queries,
+ query_type.type,
+ kNewClientId,
+ kNewServiceId,
+ kSharedMemoryId,
+ kSharedMemoryOffset));
+ EXPECT_EQ(error::kNoError, ExecuteEndQueryCmd(this, gl,
+ query_type.type, 1));
+ }
+
+ EXPECT_TRUE(ProcessQuery(this, gl, query_type.type, kNewServiceId));
+
+ // Reuse query.
+ if (query_type.is_counter) {
+ EXPECT_EQ(error::kNoError, ExecuteQueryCounterCmd(this, gl,
+ &gpu_timing_queries,
+ query_type.type,
+ kNewClientId,
+ kNewServiceId,
+ kSharedMemoryId,
+ kSharedMemoryOffset,
+ 2));
+ } else {
+ EXPECT_EQ(error::kNoError, ExecuteBeginQueryCmd(this, gl,
+ &gpu_timing_queries,
+ query_type.type,
+ kNewClientId,
+ kNewServiceId,
+ kSharedMemoryId,
+ kSharedMemoryOffset));
+ EXPECT_EQ(error::kNoError, ExecuteEndQueryCmd(this, gl,
+ query_type.type, 2));
+ }
+
+ EXPECT_TRUE(ProcessQuery(this, gl, query_type.type, kNewServiceId));
+
+ if (GL_ANY_SAMPLES_PASSED_EXT == query_type.type)
+ EXPECT_CALL(*gl, DeleteQueries(1, _)).Times(1).RetiresOnSaturation();
+ ResetDecoder();
+ }
+}
+
TEST_P(GLES2DecoderTest, BeginEndQueryEXTCommandsIssuedCHROMIUM) {
BeginQueryEXT begin_cmd;
@@ -728,14 +855,14 @@ TEST_P(GLES2DecoderTest, BeginEndQueryEXTCommandsIssuedCHROMIUM) {
ASSERT_TRUE(query_manager != NULL);
QueryManager::Query* query = query_manager->GetQuery(kNewClientId);
ASSERT_TRUE(query != NULL);
- EXPECT_FALSE(query->pending());
+ EXPECT_FALSE(query->IsPending());
// Test end succeeds
EndQueryEXT end_cmd;
end_cmd.Init(GL_COMMANDS_ISSUED_CHROMIUM, 1);
EXPECT_EQ(error::kNoError, ExecuteCmd(end_cmd));
EXPECT_EQ(GL_NO_ERROR, GetGLError());
- EXPECT_FALSE(query->pending());
+ EXPECT_FALSE(query->IsPending());
}
TEST_P(GLES2DecoderTest, BeginEndQueryEXTGetErrorQueryCHROMIUM) {
@@ -755,7 +882,7 @@ TEST_P(GLES2DecoderTest, BeginEndQueryEXTGetErrorQueryCHROMIUM) {
ASSERT_TRUE(query_manager != NULL);
QueryManager::Query* query = query_manager->GetQuery(kNewClientId);
ASSERT_TRUE(query != NULL);
- EXPECT_FALSE(query->pending());
+ EXPECT_FALSE(query->IsPending());
// Test end succeeds
QuerySync* sync = static_cast<QuerySync*>(shared_memory_address_);
@@ -768,7 +895,7 @@ TEST_P(GLES2DecoderTest, BeginEndQueryEXTGetErrorQueryCHROMIUM) {
end_cmd.Init(GL_GET_ERROR_QUERY_CHROMIUM, 1);
EXPECT_EQ(error::kNoError, ExecuteCmd(end_cmd));
EXPECT_EQ(GL_NO_ERROR, GetGLError());
- EXPECT_FALSE(query->pending());
+ EXPECT_FALSE(query->IsPending());
EXPECT_EQ(static_cast<GLenum>(GL_INVALID_VALUE),
static_cast<GLenum>(sync->result));
}
@@ -796,9 +923,8 @@ TEST_P(GLES2DecoderManualInitTest, BeginEndQueryEXTCommandsCompletedCHROMIUM) {
ASSERT_TRUE(query_manager != NULL);
QueryManager::Query* query = query_manager->GetQuery(kNewClientId);
ASSERT_TRUE(query != NULL);
- EXPECT_FALSE(query->pending());
+ EXPECT_FALSE(query->IsPending());
- GLsync kGlSync = reinterpret_cast<GLsync>(0xdeadbeef);
EXPECT_CALL(*gl_, Flush()).RetiresOnSaturation();
EXPECT_CALL(*gl_, FenceSync(GL_SYNC_GPU_COMMANDS_COMPLETE, 0))
.WillOnce(Return(kGlSync))
@@ -813,7 +939,7 @@ TEST_P(GLES2DecoderManualInitTest, BeginEndQueryEXTCommandsCompletedCHROMIUM) {
end_cmd.Init(GL_COMMANDS_COMPLETED_CHROMIUM, 1);
EXPECT_EQ(error::kNoError, ExecuteCmd(end_cmd));
EXPECT_EQ(GL_NO_ERROR, GetGLError());
- EXPECT_TRUE(query->pending());
+ EXPECT_TRUE(query->IsPending());
#if DCHECK_IS_ON()
EXPECT_CALL(*gl_, IsSync(kGlSync))
@@ -826,7 +952,7 @@ TEST_P(GLES2DecoderManualInitTest, BeginEndQueryEXTCommandsCompletedCHROMIUM) {
bool process_success = query_manager->ProcessPendingQueries(false);
EXPECT_TRUE(process_success);
- EXPECT_TRUE(query->pending());
+ EXPECT_TRUE(query->IsPending());
#if DCHECK_IS_ON()
EXPECT_CALL(*gl_, IsSync(kGlSync))
@@ -839,7 +965,7 @@ TEST_P(GLES2DecoderManualInitTest, BeginEndQueryEXTCommandsCompletedCHROMIUM) {
process_success = query_manager->ProcessPendingQueries(false);
EXPECT_TRUE(process_success);
- EXPECT_FALSE(query->pending());
+ EXPECT_FALSE(query->IsPending());
#if DCHECK_IS_ON()
EXPECT_CALL(*gl_, IsSync(kGlSync))
@@ -883,12 +1009,81 @@ TEST_P(GLES2DecoderManualInitTest, BeginInvalidTargetQueryFails) {
EXPECT_EQ(error::kNoError, ExecuteCmd(begin_cmd));
EXPECT_EQ(GL_INVALID_OPERATION, GetGLError());
+ begin_cmd.Init(GL_TIME_ELAPSED,
+ kNewClientId,
+ kSharedMemoryId,
+ kSharedMemoryOffset);
+ EXPECT_EQ(error::kNoError, ExecuteCmd(begin_cmd));
+ EXPECT_EQ(GL_INVALID_OPERATION, GetGLError());
+
begin_cmd.Init(0xdeadbeef,
kNewClientId,
kSharedMemoryId,
kSharedMemoryOffset);
EXPECT_EQ(error::kNoError, ExecuteCmd(begin_cmd));
+ EXPECT_EQ(GL_INVALID_ENUM, GetGLError());
+}
+
+TEST_P(GLES2DecoderManualInitTest, QueryCounterEXTTimeStamp) {
+ InitState init;
+ init.extensions = "GL_ARB_timer_query";
+ init.gl_version = "opengl 2.0";
+ init.has_alpha = true;
+ init.request_alpha = true;
+ init.bind_generates_resource = true;
+ InitDecoder(init);
+
+ GenHelper<GenQueriesEXTImmediate>(kNewClientId);
+
+ EXPECT_CALL(*gl_, GenQueries(1, _))
+ .WillOnce(SetArgPointee<1>(kNewServiceId))
+ .RetiresOnSaturation();
+ EXPECT_CALL(*gl_, QueryCounter(kNewServiceId, GL_TIMESTAMP))
+ .Times(1)
+ .RetiresOnSaturation();
+ QueryCounterEXT query_counter_cmd;
+ query_counter_cmd.Init(kNewClientId,
+ GL_TIMESTAMP,
+ kSharedMemoryId,
+ kSharedMemoryOffset,
+ 1);
+ EXPECT_EQ(error::kNoError, ExecuteCmd(query_counter_cmd));
+ EXPECT_EQ(GL_NO_ERROR, GetGLError());
+
+ QueryManager* query_manager = decoder_->GetQueryManager();
+ ASSERT_TRUE(query_manager != NULL);
+ QueryManager::Query* query = query_manager->GetQuery(kNewClientId);
+ ASSERT_TRUE(query != NULL);
+ EXPECT_TRUE(query->IsPending());
+}
+
+TEST_P(GLES2DecoderManualInitTest, InvalidTargetQueryCounterFails) {
+ InitState init;
+ init.extensions = "";
+ init.gl_version = "opengl es 2.0";
+ init.has_alpha = true;
+ init.request_alpha = true;
+ init.bind_generates_resource = true;
+ InitDecoder(init);
+
+ GenHelper<GenQueriesEXTImmediate>(kNewClientId);
+
+ QueryCounterEXT query_counter_cmd;
+ query_counter_cmd.Init(kNewClientId,
+ GL_TIMESTAMP,
+ kSharedMemoryId,
+ kSharedMemoryOffset,
+ 1);
+ EXPECT_EQ(error::kNoError, ExecuteCmd(query_counter_cmd));
EXPECT_EQ(GL_INVALID_OPERATION, GetGLError());
+
+ query_counter_cmd.Init(kNewClientId,
+ 0xdeadbeef,
+ kSharedMemoryId,
+ kSharedMemoryOffset,
+ 1);
+ EXPECT_EQ(error::kNoError, ExecuteCmd(query_counter_cmd));
+ EXPECT_EQ(GL_INVALID_ENUM, GetGLError());
}
TEST_P(GLES2DecoderTest, IsEnabledReturnsCachedValue) {
@@ -977,6 +1172,10 @@ class SizeOnlyMemoryTracker : public MemoryTracker {
return info.size - info.initial_size;
}
+ uint64_t ClientTracingId() const override { return 0; }
+ int ClientId() const override { return 0; }
+ uint64_t ShareGroupTracingGUID() const override { return 0; }
+
private:
virtual ~SizeOnlyMemoryTracker() {}
struct PoolInfo {
diff --git a/chromium/gpu/command_buffer/service/gles2_cmd_decoder_unittest_0_autogen.h b/chromium/gpu/command_buffer/service/gles2_cmd_decoder_unittest_0_autogen.h
index 16204238d7b..dd117162b8a 100644
--- a/chromium/gpu/command_buffer/service/gles2_cmd_decoder_unittest_0_autogen.h
+++ b/chromium/gpu/command_buffer/service/gles2_cmd_decoder_unittest_0_autogen.h
@@ -71,6 +71,11 @@ void GLES2DecoderTestBase::SetupInitStateExpectations() {
.Times(1)
.RetiresOnSaturation();
}
+ if (group_->feature_info()->feature_flags().chromium_path_rendering) {
+ EXPECT_CALL(*gl_, PathStencilFuncNV(GL_ALWAYS, 0, 0xFFFFFFFFU))
+ .Times(1)
+ .RetiresOnSaturation();
+ }
EXPECT_CALL(*gl_, PixelStorei(GL_PACK_ALIGNMENT, 4))
.Times(1)
.RetiresOnSaturation();
diff --git a/chromium/gpu/command_buffer/service/gles2_cmd_decoder_unittest_1.cc b/chromium/gpu/command_buffer/service/gles2_cmd_decoder_unittest_1.cc
index 3fb52f9bc13..95ada5dcf5c 100644
--- a/chromium/gpu/command_buffer/service/gles2_cmd_decoder_unittest_1.cc
+++ b/chromium/gpu/command_buffer/service/gles2_cmd_decoder_unittest_1.cc
@@ -28,11 +28,6 @@ using ::testing::StrEq;
namespace gpu {
namespace gles2 {
-namespace {
-void ShaderCacheCb(const std::string& key, const std::string& shader) {
-}
-} // namespace
-
class GLES2DecoderTest1 : public GLES2DecoderTestBase {
public:
GLES2DecoderTest1() { }
@@ -149,6 +144,12 @@ void GLES2DecoderTestBase::SpecializedSetup<cmds::FramebufferTexture2D, 0>(
template <>
void GLES2DecoderTestBase::SpecializedSetup<
+ cmds::GetBufferParameteri64v, 0>(bool /* valid */) {
+ DoBindBuffer(GL_ARRAY_BUFFER, client_buffer_id_, kServiceBufferId);
+};
+
+template <>
+void GLES2DecoderTestBase::SpecializedSetup<
cmds::GetBufferParameteriv, 0>(bool /* valid */) {
DoBindBuffer(GL_ARRAY_BUFFER, client_buffer_id_, kServiceBufferId);
};
@@ -175,75 +176,6 @@ void GLES2DecoderTestBase::SpecializedSetup<cmds::GetProgramiv, 0>(
}
}
-template <>
-void GLES2DecoderTestBase::SpecializedSetup<cmds::GetProgramInfoLog, 0>(
- bool /* valid */) {
- const GLuint kClientVertexShaderId = 5001;
- const GLuint kServiceVertexShaderId = 6001;
- const GLuint kClientFragmentShaderId = 5002;
- const GLuint kServiceFragmentShaderId = 6002;
- const char* log = "hello"; // Matches auto-generated unit test.
- DoCreateShader(
- GL_VERTEX_SHADER, kClientVertexShaderId, kServiceVertexShaderId);
- DoCreateShader(
- GL_FRAGMENT_SHADER, kClientFragmentShaderId, kServiceFragmentShaderId);
-
- TestHelper::SetShaderStates(
- gl_.get(), GetShader(kClientVertexShaderId), true);
- TestHelper::SetShaderStates(
- gl_.get(), GetShader(kClientFragmentShaderId), true);
-
- InSequence dummy;
- EXPECT_CALL(*gl_,
- AttachShader(kServiceProgramId, kServiceVertexShaderId))
- .Times(1)
- .RetiresOnSaturation();
- EXPECT_CALL(*gl_,
- AttachShader(kServiceProgramId, kServiceFragmentShaderId))
- .Times(1)
- .RetiresOnSaturation();
- EXPECT_CALL(*gl_, LinkProgram(kServiceProgramId))
- .Times(1)
- .RetiresOnSaturation();
- EXPECT_CALL(*gl_, GetProgramiv(kServiceProgramId, GL_LINK_STATUS, _))
- .WillOnce(SetArgumentPointee<2>(1));
- EXPECT_CALL(*gl_,
- GetProgramiv(kServiceProgramId, GL_INFO_LOG_LENGTH, _))
- .WillOnce(SetArgumentPointee<2>(strlen(log) + 1))
- .RetiresOnSaturation();
- EXPECT_CALL(*gl_,
- GetProgramInfoLog(kServiceProgramId, strlen(log) + 1, _, _))
- .WillOnce(DoAll(
- SetArgumentPointee<2>(strlen(log)),
- SetArrayArgument<3>(log, log + strlen(log) + 1)))
- .RetiresOnSaturation();
- EXPECT_CALL(*gl_, GetProgramiv(kServiceProgramId, GL_ACTIVE_ATTRIBUTES, _))
- .WillOnce(SetArgumentPointee<2>(0));
- EXPECT_CALL(
- *gl_,
- GetProgramiv(kServiceProgramId, GL_ACTIVE_ATTRIBUTE_MAX_LENGTH, _))
- .WillOnce(SetArgumentPointee<2>(0));
- EXPECT_CALL(*gl_, GetProgramiv(kServiceProgramId, GL_ACTIVE_UNIFORMS, _))
- .WillOnce(SetArgumentPointee<2>(0));
- EXPECT_CALL(
- *gl_,
- GetProgramiv(kServiceProgramId, GL_ACTIVE_UNIFORM_MAX_LENGTH, _))
- .WillOnce(SetArgumentPointee<2>(0));
-
- Program* program = GetProgram(client_program_id_);
- ASSERT_TRUE(program != NULL);
-
- cmds::AttachShader attach_cmd;
- attach_cmd.Init(client_program_id_, kClientVertexShaderId);
- EXPECT_EQ(error::kNoError, ExecuteCmd(attach_cmd));
-
- attach_cmd.Init(client_program_id_, kClientFragmentShaderId);
- EXPECT_EQ(error::kNoError, ExecuteCmd(attach_cmd));
-
- program->Link(NULL, Program::kCountOnlyStaticallyUsed,
- base::Bind(&ShaderCacheCb));
-};
-
#include "gpu/command_buffer/service/gles2_cmd_decoder_unittest_1_autogen.h"
} // namespace gles2
diff --git a/chromium/gpu/command_buffer/service/gles2_cmd_decoder_unittest_1_autogen.h b/chromium/gpu/command_buffer/service/gles2_cmd_decoder_unittest_1_autogen.h
index 32e1dcc8ed2..4a700b7f94b 100644
--- a/chromium/gpu/command_buffer/service/gles2_cmd_decoder_unittest_1_autogen.h
+++ b/chromium/gpu/command_buffer/service/gles2_cmd_decoder_unittest_1_autogen.h
@@ -348,72 +348,10 @@ TEST_P(GLES2DecoderTest1, ClearValidArgs) {
EXPECT_EQ(error::kNoError, ExecuteCmd(cmd));
EXPECT_EQ(GL_NO_ERROR, GetGLError());
}
-
-TEST_P(GLES2DecoderTest1, ClearBufferfiValidArgs) {
- EXPECT_CALL(*gl_, ClearBufferfi(GL_COLOR, 2, 3, 4));
- SpecializedSetup<cmds::ClearBufferfi, 0>(true);
- cmds::ClearBufferfi cmd;
- cmd.Init(GL_COLOR, 2, 3, 4);
- decoder_->set_unsafe_es3_apis_enabled(true);
- EXPECT_EQ(error::kNoError, ExecuteCmd(cmd));
- EXPECT_EQ(GL_NO_ERROR, GetGLError());
- decoder_->set_unsafe_es3_apis_enabled(false);
- EXPECT_EQ(error::kUnknownCommand, ExecuteCmd(cmd));
-}
-
-TEST_P(GLES2DecoderTest1, ClearBufferfvImmediateValidArgs) {
- cmds::ClearBufferfvImmediate& cmd =
- *GetImmediateAs<cmds::ClearBufferfvImmediate>();
- SpecializedSetup<cmds::ClearBufferfvImmediate, 0>(true);
- GLfloat temp[4] = {
- 0,
- };
- cmd.Init(GL_COLOR, 2, &temp[0]);
- EXPECT_CALL(*gl_,
- ClearBufferfv(GL_COLOR, 2, reinterpret_cast<GLfloat*>(
- ImmediateDataAddress(&cmd))));
- decoder_->set_unsafe_es3_apis_enabled(true);
- EXPECT_EQ(error::kNoError, ExecuteImmediateCmd(cmd, sizeof(temp)));
- EXPECT_EQ(GL_NO_ERROR, GetGLError());
- decoder_->set_unsafe_es3_apis_enabled(false);
- EXPECT_EQ(error::kUnknownCommand, ExecuteImmediateCmd(cmd, sizeof(temp)));
-}
-
-TEST_P(GLES2DecoderTest1, ClearBufferivImmediateValidArgs) {
- cmds::ClearBufferivImmediate& cmd =
- *GetImmediateAs<cmds::ClearBufferivImmediate>();
- SpecializedSetup<cmds::ClearBufferivImmediate, 0>(true);
- GLint temp[4] = {
- 0,
- };
- cmd.Init(GL_COLOR, 2, &temp[0]);
- EXPECT_CALL(*gl_, ClearBufferiv(
- GL_COLOR, 2,
- reinterpret_cast<GLint*>(ImmediateDataAddress(&cmd))));
- decoder_->set_unsafe_es3_apis_enabled(true);
- EXPECT_EQ(error::kNoError, ExecuteImmediateCmd(cmd, sizeof(temp)));
- EXPECT_EQ(GL_NO_ERROR, GetGLError());
- decoder_->set_unsafe_es3_apis_enabled(false);
- EXPECT_EQ(error::kUnknownCommand, ExecuteImmediateCmd(cmd, sizeof(temp)));
-}
-
-TEST_P(GLES2DecoderTest1, ClearBufferuivImmediateValidArgs) {
- cmds::ClearBufferuivImmediate& cmd =
- *GetImmediateAs<cmds::ClearBufferuivImmediate>();
- SpecializedSetup<cmds::ClearBufferuivImmediate, 0>(true);
- GLuint temp[4] = {
- 0,
- };
- cmd.Init(GL_COLOR, 2, &temp[0]);
- EXPECT_CALL(*gl_, ClearBufferuiv(
- GL_COLOR, 2,
- reinterpret_cast<GLuint*>(ImmediateDataAddress(&cmd))));
- decoder_->set_unsafe_es3_apis_enabled(true);
- EXPECT_EQ(error::kNoError, ExecuteImmediateCmd(cmd, sizeof(temp)));
- EXPECT_EQ(GL_NO_ERROR, GetGLError());
- decoder_->set_unsafe_es3_apis_enabled(false);
- EXPECT_EQ(error::kUnknownCommand, ExecuteImmediateCmd(cmd, sizeof(temp)));
-}
+// TODO(gman): ClearBufferfi
+// TODO(gman): ClearBufferfvImmediate
+// TODO(gman): ClearBufferivImmediate
+// TODO(gman): ClearBufferuivImmediate
TEST_P(GLES2DecoderTest1, ClearColorValidArgs) {
EXPECT_CALL(*gl_, ClearColor(1, 2, 3, 4));
@@ -709,8 +647,9 @@ TEST_P(GLES2DecoderTest1, DeleteTexturesImmediateInvalidArgs) {
}
TEST_P(GLES2DecoderTest1, DeleteTransformFeedbacksImmediateValidArgs) {
- EXPECT_CALL(*gl_, DeleteTransformFeedbacks(
- 1, Pointee(kServiceTransformFeedbackId))).Times(1);
+ EXPECT_CALL(*gl_,
+ DeleteTransformFeedbacks(1, Pointee(kServiceTransformFeedbackId)))
+ .Times(1);
cmds::DeleteTransformFeedbacksImmediate& cmd =
*GetImmediateAs<cmds::DeleteTransformFeedbacksImmediate>();
SpecializedSetup<cmds::DeleteTransformFeedbacksImmediate, 0>(true);
@@ -1161,10 +1100,7 @@ TEST_P(GLES2DecoderTest1, GenTransformFeedbacksImmediateInvalidArgs) {
// TODO(gman): GetAttribLocation
TEST_P(GLES2DecoderTest1, GetBooleanvValidArgs) {
- EXPECT_CALL(*gl_, GetError())
- .WillOnce(Return(GL_NO_ERROR))
- .WillOnce(Return(GL_NO_ERROR))
- .RetiresOnSaturation();
+ EXPECT_CALL(*gl_, GetError()).WillRepeatedly(Return(GL_NO_ERROR));
SpecializedSetup<cmds::GetBooleanv, 0>(true);
typedef cmds::GetBooleanv::Result Result;
Result* result = static_cast<Result*>(shared_memory_address_);
@@ -1215,6 +1151,23 @@ TEST_P(GLES2DecoderTest1, GetBooleanvInvalidArgs1_1) {
EXPECT_EQ(0u, result->size);
}
+TEST_P(GLES2DecoderTest1, GetBufferParameteri64vValidArgs) {
+ SpecializedSetup<cmds::GetBufferParameteri64v, 0>(true);
+ typedef cmds::GetBufferParameteri64v::Result Result;
+ Result* result = static_cast<Result*>(shared_memory_address_);
+ result->size = 0;
+ cmds::GetBufferParameteri64v cmd;
+ cmd.Init(GL_ARRAY_BUFFER, GL_BUFFER_SIZE, shared_memory_id_,
+ shared_memory_offset_);
+ decoder_->set_unsafe_es3_apis_enabled(true);
+ EXPECT_EQ(error::kNoError, ExecuteCmd(cmd));
+ EXPECT_EQ(decoder_->GetGLES2Util()->GLGetNumValuesReturned(GL_BUFFER_SIZE),
+ result->GetNumResults());
+ EXPECT_EQ(GL_NO_ERROR, GetGLError());
+ decoder_->set_unsafe_es3_apis_enabled(false);
+ EXPECT_EQ(error::kUnknownCommand, ExecuteCmd(cmd));
+}
+
TEST_P(GLES2DecoderTest1, GetBufferParameterivValidArgs) {
SpecializedSetup<cmds::GetBufferParameteriv, 0>(true);
typedef cmds::GetBufferParameteriv::Result Result;
@@ -1302,10 +1255,7 @@ TEST_P(GLES2DecoderTest1, GetErrorInvalidArgsBadSharedMemoryId) {
}
TEST_P(GLES2DecoderTest1, GetFloatvValidArgs) {
- EXPECT_CALL(*gl_, GetError())
- .WillOnce(Return(GL_NO_ERROR))
- .WillOnce(Return(GL_NO_ERROR))
- .RetiresOnSaturation();
+ EXPECT_CALL(*gl_, GetError()).WillRepeatedly(Return(GL_NO_ERROR));
SpecializedSetup<cmds::GetFloatv, 0>(true);
typedef cmds::GetFloatv::Result Result;
Result* result = static_cast<Result*>(shared_memory_address_);
@@ -1358,10 +1308,7 @@ TEST_P(GLES2DecoderTest1, GetFloatvInvalidArgs1_1) {
// TODO(gman): GetFragDataLocation
TEST_P(GLES2DecoderTest1, GetFramebufferAttachmentParameterivValidArgs) {
- EXPECT_CALL(*gl_, GetError())
- .WillOnce(Return(GL_NO_ERROR))
- .WillOnce(Return(GL_NO_ERROR))
- .RetiresOnSaturation();
+ EXPECT_CALL(*gl_, GetError()).WillRepeatedly(Return(GL_NO_ERROR));
SpecializedSetup<cmds::GetFramebufferAttachmentParameteriv, 0>(true);
typedef cmds::GetFramebufferAttachmentParameteriv::Result Result;
Result* result = static_cast<Result*>(shared_memory_address_);
@@ -1430,10 +1377,7 @@ TEST_P(GLES2DecoderTest1, GetFramebufferAttachmentParameterivInvalidArgs3_1) {
}
TEST_P(GLES2DecoderTest1, GetInteger64vValidArgs) {
- EXPECT_CALL(*gl_, GetError())
- .WillOnce(Return(GL_NO_ERROR))
- .WillOnce(Return(GL_NO_ERROR))
- .RetiresOnSaturation();
+ EXPECT_CALL(*gl_, GetError()).WillRepeatedly(Return(GL_NO_ERROR));
SpecializedSetup<cmds::GetInteger64v, 0>(true);
typedef cmds::GetInteger64v::Result Result;
Result* result = static_cast<Result*>(shared_memory_address_);
@@ -1451,10 +1395,7 @@ TEST_P(GLES2DecoderTest1, GetInteger64vValidArgs) {
}
TEST_P(GLES2DecoderTest1, GetIntegeri_vValidArgs) {
- EXPECT_CALL(*gl_, GetError())
- .WillOnce(Return(GL_NO_ERROR))
- .WillOnce(Return(GL_NO_ERROR))
- .RetiresOnSaturation();
+ EXPECT_CALL(*gl_, GetError()).WillRepeatedly(Return(GL_NO_ERROR));
SpecializedSetup<cmds::GetIntegeri_v, 0>(true);
typedef cmds::GetIntegeri_v::Result Result;
Result* result = static_cast<Result*>(shared_memory_address_);
@@ -1475,10 +1416,7 @@ TEST_P(GLES2DecoderTest1, GetIntegeri_vValidArgs) {
}
TEST_P(GLES2DecoderTest1, GetInteger64i_vValidArgs) {
- EXPECT_CALL(*gl_, GetError())
- .WillOnce(Return(GL_NO_ERROR))
- .WillOnce(Return(GL_NO_ERROR))
- .RetiresOnSaturation();
+ EXPECT_CALL(*gl_, GetError()).WillRepeatedly(Return(GL_NO_ERROR));
SpecializedSetup<cmds::GetInteger64i_v, 0>(true);
typedef cmds::GetInteger64i_v::Result Result;
Result* result = static_cast<Result*>(shared_memory_address_);
@@ -1499,10 +1437,7 @@ TEST_P(GLES2DecoderTest1, GetInteger64i_vValidArgs) {
}
TEST_P(GLES2DecoderTest1, GetIntegervValidArgs) {
- EXPECT_CALL(*gl_, GetError())
- .WillOnce(Return(GL_NO_ERROR))
- .WillOnce(Return(GL_NO_ERROR))
- .RetiresOnSaturation();
+ EXPECT_CALL(*gl_, GetError()).WillRepeatedly(Return(GL_NO_ERROR));
SpecializedSetup<cmds::GetIntegerv, 0>(true);
typedef cmds::GetIntegerv::Result Result;
Result* result = static_cast<Result*>(shared_memory_address_);
@@ -1606,28 +1541,4 @@ TEST_P(GLES2DecoderTest1, GetProgramivInvalidArgs2_1) {
EXPECT_EQ(error::kOutOfBounds, ExecuteCmd(cmd));
EXPECT_EQ(0u, result->size);
}
-
-TEST_P(GLES2DecoderTest1, GetProgramInfoLogValidArgs) {
- const char* kInfo = "hello";
- const uint32_t kBucketId = 123;
- SpecializedSetup<cmds::GetProgramInfoLog, 0>(true);
-
- cmds::GetProgramInfoLog cmd;
- cmd.Init(client_program_id_, kBucketId);
- EXPECT_EQ(error::kNoError, ExecuteCmd(cmd));
- CommonDecoder::Bucket* bucket = decoder_->GetBucket(kBucketId);
- ASSERT_TRUE(bucket != NULL);
- EXPECT_EQ(strlen(kInfo) + 1, bucket->size());
- EXPECT_EQ(0,
- memcmp(bucket->GetData(0, bucket->size()), kInfo, bucket->size()));
- EXPECT_EQ(GL_NO_ERROR, GetGLError());
-}
-
-TEST_P(GLES2DecoderTest1, GetProgramInfoLogInvalidArgs) {
- const uint32_t kBucketId = 123;
- cmds::GetProgramInfoLog cmd;
- cmd.Init(kInvalidClientId, kBucketId);
- EXPECT_EQ(error::kNoError, ExecuteCmd(cmd));
- EXPECT_EQ(GL_INVALID_VALUE, GetGLError());
-}
#endif // GPU_COMMAND_BUFFER_SERVICE_GLES2_CMD_DECODER_UNITTEST_1_AUTOGEN_H_
diff --git a/chromium/gpu/command_buffer/service/gles2_cmd_decoder_unittest_2.cc b/chromium/gpu/command_buffer/service/gles2_cmd_decoder_unittest_2.cc
index 2b471b9722e..4901ba1577a 100644
--- a/chromium/gpu/command_buffer/service/gles2_cmd_decoder_unittest_2.cc
+++ b/chromium/gpu/command_buffer/service/gles2_cmd_decoder_unittest_2.cc
@@ -29,11 +29,19 @@ using ::testing::StrEq;
namespace gpu {
namespace gles2 {
+namespace {
+void ShaderCacheCb(const std::string& key, const std::string& shader) {
+}
+} // namespace
+
class GLES2DecoderTest2 : public GLES2DecoderTestBase {
public:
GLES2DecoderTest2() { }
- void TestAcceptedUniform(GLenum uniform_type, uint32 accepts_apis) {
+ void TestAcceptedUniform(
+ GLenum uniform_type, uint32 accepts_apis, bool es3_enabled) {
+ decoder_->set_unsafe_es3_apis_enabled(es3_enabled);
+
SetupShaderForUniform(uniform_type);
bool valid_uniform = false;
@@ -50,6 +58,18 @@ class GLES2DecoderTest2 : public GLES2DecoderTestBase {
EXPECT_CALL(*gl_, UniformMatrix2fv(1, _, _, _)).Times(AnyNumber());
EXPECT_CALL(*gl_, UniformMatrix3fv(1, _, _, _)).Times(AnyNumber());
EXPECT_CALL(*gl_, UniformMatrix4fv(1, _, _, _)).Times(AnyNumber());
+ if (es3_enabled) {
+ EXPECT_CALL(*gl_, Uniform1uiv(1, _, _)).Times(AnyNumber());
+ EXPECT_CALL(*gl_, Uniform2uiv(1, _, _)).Times(AnyNumber());
+ EXPECT_CALL(*gl_, Uniform3uiv(1, _, _)).Times(AnyNumber());
+ EXPECT_CALL(*gl_, Uniform4uiv(1, _, _)).Times(AnyNumber());
+ EXPECT_CALL(*gl_, UniformMatrix2x3fv(1, _, _, _)).Times(AnyNumber());
+ EXPECT_CALL(*gl_, UniformMatrix2x4fv(1, _, _, _)).Times(AnyNumber());
+ EXPECT_CALL(*gl_, UniformMatrix3x2fv(1, _, _, _)).Times(AnyNumber());
+ EXPECT_CALL(*gl_, UniformMatrix3x4fv(1, _, _, _)).Times(AnyNumber());
+ EXPECT_CALL(*gl_, UniformMatrix4x2fv(1, _, _, _)).Times(AnyNumber());
+ EXPECT_CALL(*gl_, UniformMatrix4x3fv(1, _, _, _)).Times(AnyNumber());
+ }
{
valid_uniform = accepts_apis & Program::kUniform1i;
@@ -246,12 +266,235 @@ class GLES2DecoderTest2 : public GLES2DecoderTestBase {
EXPECT_EQ(valid_uniform ? GL_NO_ERROR : GL_INVALID_OPERATION,
GetGLError());
}
+
+ if (es3_enabled) {
+ {
+ valid_uniform = accepts_apis & Program::kUniform1ui;
+ cmds::Uniform1ui cmd;
+ cmd.Init(1, 2);
+ EXPECT_EQ(error::kNoError, ExecuteCmd(cmd));
+ EXPECT_EQ(valid_uniform ? GL_NO_ERROR : GL_INVALID_OPERATION,
+ GetGLError());
+ }
+
+ {
+ valid_uniform = accepts_apis & Program::kUniform1ui;
+ cmds::Uniform1uivImmediate& cmd =
+ *GetImmediateAs<cmds::Uniform1uivImmediate>();
+ GLuint data[2][1] = {{0}};
+ cmd.Init(1, 2, &data[0][0]);
+ EXPECT_EQ(error::kNoError, ExecuteImmediateCmd(cmd, sizeof(data)));
+ EXPECT_EQ(valid_uniform ? GL_NO_ERROR : GL_INVALID_OPERATION,
+ GetGLError());
+ }
+
+ {
+ valid_uniform = accepts_apis & Program::kUniform2ui;
+ cmds::Uniform2ui cmd;
+ cmd.Init(1, 2, 3);
+ EXPECT_EQ(error::kNoError, ExecuteCmd(cmd));
+ EXPECT_EQ(valid_uniform ? GL_NO_ERROR : GL_INVALID_OPERATION,
+ GetGLError());
+ }
+
+ {
+ valid_uniform = accepts_apis & Program::kUniform2ui;
+ cmds::Uniform2uivImmediate& cmd =
+ *GetImmediateAs<cmds::Uniform2uivImmediate>();
+ GLuint data[2][2] = {{0}};
+ cmd.Init(1, 2, &data[0][0]);
+ EXPECT_EQ(error::kNoError, ExecuteImmediateCmd(cmd, sizeof(data)));
+ EXPECT_EQ(valid_uniform ? GL_NO_ERROR : GL_INVALID_OPERATION,
+ GetGLError());
+ }
+
+ {
+ valid_uniform = accepts_apis & Program::kUniform3ui;
+ cmds::Uniform3ui cmd;
+ cmd.Init(1, 2, 3, 4);
+ EXPECT_EQ(error::kNoError, ExecuteCmd(cmd));
+ EXPECT_EQ(valid_uniform ? GL_NO_ERROR : GL_INVALID_OPERATION,
+ GetGLError());
+ }
+
+ {
+ valid_uniform = accepts_apis & Program::kUniform3ui;
+ cmds::Uniform3uivImmediate& cmd =
+ *GetImmediateAs<cmds::Uniform3uivImmediate>();
+ GLuint data[2][3] = {{0}};
+ cmd.Init(1, 2, &data[0][0]);
+ EXPECT_EQ(error::kNoError, ExecuteImmediateCmd(cmd, sizeof(data)));
+ EXPECT_EQ(valid_uniform ? GL_NO_ERROR : GL_INVALID_OPERATION,
+ GetGLError());
+ }
+
+ {
+ valid_uniform = accepts_apis & Program::kUniform4ui;
+ cmds::Uniform4ui cmd;
+ cmd.Init(1, 2, 3, 4, 5);
+ EXPECT_EQ(error::kNoError, ExecuteCmd(cmd));
+ EXPECT_EQ(valid_uniform ? GL_NO_ERROR : GL_INVALID_OPERATION,
+ GetGLError());
+ }
+
+ {
+ valid_uniform = accepts_apis & Program::kUniform4ui;
+ cmds::Uniform4uivImmediate& cmd =
+ *GetImmediateAs<cmds::Uniform4uivImmediate>();
+ GLuint data[2][4] = {{0}};
+ cmd.Init(1, 2, &data[0][0]);
+ EXPECT_EQ(error::kNoError, ExecuteImmediateCmd(cmd, sizeof(data)));
+ EXPECT_EQ(valid_uniform ? GL_NO_ERROR : GL_INVALID_OPERATION,
+ GetGLError());
+ }
+
+ {
+ valid_uniform = accepts_apis & Program::kUniformMatrix2x3f;
+ cmds::UniformMatrix2x3fvImmediate& cmd =
+ *GetImmediateAs<cmds::UniformMatrix2x3fvImmediate>();
+ GLfloat data[2][2 * 3] = {{0.0f}};
+
+ cmd.Init(1, 2, &data[0][0]);
+ EXPECT_EQ(error::kNoError, ExecuteImmediateCmd(cmd, sizeof(data)));
+ EXPECT_EQ(valid_uniform ? GL_NO_ERROR : GL_INVALID_OPERATION,
+ GetGLError());
+ }
+
+ {
+ valid_uniform = accepts_apis & Program::kUniformMatrix2x4f;
+ cmds::UniformMatrix2x4fvImmediate& cmd =
+ *GetImmediateAs<cmds::UniformMatrix2x4fvImmediate>();
+ GLfloat data[2][2 * 4] = {{0.0f}};
+
+ cmd.Init(1, 2, &data[0][0]);
+ EXPECT_EQ(error::kNoError, ExecuteImmediateCmd(cmd, sizeof(data)));
+ EXPECT_EQ(valid_uniform ? GL_NO_ERROR : GL_INVALID_OPERATION,
+ GetGLError());
+ }
+
+ {
+ valid_uniform = accepts_apis & Program::kUniformMatrix3x2f;
+ cmds::UniformMatrix3x2fvImmediate& cmd =
+ *GetImmediateAs<cmds::UniformMatrix3x2fvImmediate>();
+ GLfloat data[2][3 * 2] = {{0.0f}};
+
+ cmd.Init(1, 2, &data[0][0]);
+ EXPECT_EQ(error::kNoError, ExecuteImmediateCmd(cmd, sizeof(data)));
+ EXPECT_EQ(valid_uniform ? GL_NO_ERROR : GL_INVALID_OPERATION,
+ GetGLError());
+ }
+
+ {
+ valid_uniform = accepts_apis & Program::kUniformMatrix3x4f;
+ cmds::UniformMatrix3x4fvImmediate& cmd =
+ *GetImmediateAs<cmds::UniformMatrix3x4fvImmediate>();
+ GLfloat data[2][3 * 4] = {{0.0f}};
+
+ cmd.Init(1, 2, &data[0][0]);
+ EXPECT_EQ(error::kNoError, ExecuteImmediateCmd(cmd, sizeof(data)));
+ EXPECT_EQ(valid_uniform ? GL_NO_ERROR : GL_INVALID_OPERATION,
+ GetGLError());
+ }
+
+ {
+ valid_uniform = accepts_apis & Program::kUniformMatrix4x2f;
+ cmds::UniformMatrix4x2fvImmediate& cmd =
+ *GetImmediateAs<cmds::UniformMatrix4x2fvImmediate>();
+ GLfloat data[2][4 * 2] = {{0.0f}};
+
+ cmd.Init(1, 2, &data[0][0]);
+ EXPECT_EQ(error::kNoError, ExecuteImmediateCmd(cmd, sizeof(data)));
+ EXPECT_EQ(valid_uniform ? GL_NO_ERROR : GL_INVALID_OPERATION,
+ GetGLError());
+ }
+
+ {
+ valid_uniform = accepts_apis & Program::kUniformMatrix4x3f;
+ cmds::UniformMatrix4x3fvImmediate& cmd =
+ *GetImmediateAs<cmds::UniformMatrix4x3fvImmediate>();
+ GLfloat data[2][4 * 3] = {{0.0f}};
+
+ cmd.Init(1, 2, &data[0][0]);
+ EXPECT_EQ(error::kNoError, ExecuteImmediateCmd(cmd, sizeof(data)));
+ EXPECT_EQ(valid_uniform ? GL_NO_ERROR : GL_INVALID_OPERATION,
+ GetGLError());
+ }
+ }
}
};
INSTANTIATE_TEST_CASE_P(Service, GLES2DecoderTest2, ::testing::Bool());
template <>
+void GLES2DecoderTestBase::SpecializedSetup<cmds::GetProgramInfoLog, 0>(
+ bool /* valid */) {
+ const GLuint kClientVertexShaderId = 5001;
+ const GLuint kServiceVertexShaderId = 6001;
+ const GLuint kClientFragmentShaderId = 5002;
+ const GLuint kServiceFragmentShaderId = 6002;
+ const char* log = "hello"; // Matches auto-generated unit test.
+ DoCreateShader(
+ GL_VERTEX_SHADER, kClientVertexShaderId, kServiceVertexShaderId);
+ DoCreateShader(
+ GL_FRAGMENT_SHADER, kClientFragmentShaderId, kServiceFragmentShaderId);
+
+ TestHelper::SetShaderStates(
+ gl_.get(), GetShader(kClientVertexShaderId), true);
+ TestHelper::SetShaderStates(
+ gl_.get(), GetShader(kClientFragmentShaderId), true);
+
+ InSequence dummy;
+ EXPECT_CALL(*gl_,
+ AttachShader(kServiceProgramId, kServiceVertexShaderId))
+ .Times(1)
+ .RetiresOnSaturation();
+ EXPECT_CALL(*gl_,
+ AttachShader(kServiceProgramId, kServiceFragmentShaderId))
+ .Times(1)
+ .RetiresOnSaturation();
+ EXPECT_CALL(*gl_, LinkProgram(kServiceProgramId))
+ .Times(1)
+ .RetiresOnSaturation();
+ EXPECT_CALL(*gl_, GetProgramiv(kServiceProgramId, GL_LINK_STATUS, _))
+ .WillOnce(SetArgumentPointee<2>(1));
+ EXPECT_CALL(*gl_,
+ GetProgramiv(kServiceProgramId, GL_INFO_LOG_LENGTH, _))
+ .WillOnce(SetArgumentPointee<2>(strlen(log) + 1))
+ .RetiresOnSaturation();
+ EXPECT_CALL(*gl_,
+ GetProgramInfoLog(kServiceProgramId, strlen(log) + 1, _, _))
+ .WillOnce(DoAll(
+ SetArgumentPointee<2>(strlen(log)),
+ SetArrayArgument<3>(log, log + strlen(log) + 1)))
+ .RetiresOnSaturation();
+ EXPECT_CALL(*gl_, GetProgramiv(kServiceProgramId, GL_ACTIVE_ATTRIBUTES, _))
+ .WillOnce(SetArgumentPointee<2>(0));
+ EXPECT_CALL(
+ *gl_,
+ GetProgramiv(kServiceProgramId, GL_ACTIVE_ATTRIBUTE_MAX_LENGTH, _))
+ .WillOnce(SetArgumentPointee<2>(0));
+ EXPECT_CALL(*gl_, GetProgramiv(kServiceProgramId, GL_ACTIVE_UNIFORMS, _))
+ .WillOnce(SetArgumentPointee<2>(0));
+ EXPECT_CALL(
+ *gl_,
+ GetProgramiv(kServiceProgramId, GL_ACTIVE_UNIFORM_MAX_LENGTH, _))
+ .WillOnce(SetArgumentPointee<2>(0));
+
+ Program* program = GetProgram(client_program_id_);
+ ASSERT_TRUE(program != NULL);
+
+ cmds::AttachShader attach_cmd;
+ attach_cmd.Init(client_program_id_, kClientVertexShaderId);
+ EXPECT_EQ(error::kNoError, ExecuteCmd(attach_cmd));
+
+ attach_cmd.Init(client_program_id_, kClientFragmentShaderId);
+ EXPECT_EQ(error::kNoError, ExecuteCmd(attach_cmd));
+
+ program->Link(NULL, Program::kCountOnlyStaticallyUsed,
+ base::Bind(&ShaderCacheCb));
+};
+
+template <>
void GLES2DecoderTestBase::SpecializedSetup<
cmds::GetRenderbufferParameteriv, 0>(
bool /* valid */) {
@@ -456,6 +699,12 @@ void GLES2DecoderTestBase::SpecializedSetup<cmds::UniformMatrix2fvImmediate, 0>(
};
template <>
+void GLES2DecoderTestBase::SpecializedSetup<
+ cmds::UniformMatrix2x3fvImmediate, 0>(bool /* valid */) {
+ SetupShaderForUniform(GL_FLOAT_MAT2x3);
+};
+
+template <>
void GLES2DecoderTestBase::SpecializedSetup<cmds::TexParameterf, 0>(
bool /* valid */) {
DoBindTexture(GL_TEXTURE_2D, client_texture_id_, kServiceTextureId);
@@ -535,63 +784,135 @@ void GLES2DecoderTestBase::SpecializedSetup<cmds::GetVertexAttribIuiv, 0>(
#include "gpu/command_buffer/service/gles2_cmd_decoder_unittest_2_autogen.h"
TEST_P(GLES2DecoderTest2, AcceptsUniform_GL_INT) {
- TestAcceptedUniform(GL_INT, Program::kUniform1i);
+ TestAcceptedUniform(GL_INT, Program::kUniform1i, false);
}
TEST_P(GLES2DecoderTest2, AcceptsUniform_GL_INT_VEC2) {
- TestAcceptedUniform(GL_INT_VEC2, Program::kUniform2i);
+ TestAcceptedUniform(GL_INT_VEC2, Program::kUniform2i, false);
}
TEST_P(GLES2DecoderTest2, AcceptsUniform_GL_INT_VEC3) {
- TestAcceptedUniform(GL_INT_VEC3, Program::kUniform3i);
+ TestAcceptedUniform(GL_INT_VEC3, Program::kUniform3i, false);
}
TEST_P(GLES2DecoderTest2, AcceptsUniform_GL_INT_VEC4) {
- TestAcceptedUniform(GL_INT_VEC4, Program::kUniform4i);
+ TestAcceptedUniform(GL_INT_VEC4, Program::kUniform4i, false);
}
TEST_P(GLES2DecoderTest2, AcceptsUniform_GL_BOOL) {
- TestAcceptedUniform(GL_BOOL, Program::kUniform1i | Program::kUniform1f);
+ TestAcceptedUniform(
+ GL_BOOL, Program::kUniform1i | Program::kUniform1f, false);
+}
+
+TEST_P(GLES2DecoderTest2, AcceptsUniformES3_GL_BOOL) {
+ TestAcceptedUniform(
+ GL_BOOL,
+ Program::kUniform1i | Program::kUniform1f | Program::kUniform1ui,
+ true);
}
TEST_P(GLES2DecoderTest2, AcceptsUniform_GL_BOOL_VEC2) {
- TestAcceptedUniform(GL_BOOL_VEC2, Program::kUniform2i | Program::kUniform2f);
+ TestAcceptedUniform(
+ GL_BOOL_VEC2, Program::kUniform2i | Program::kUniform2f, false);
+}
+
+TEST_P(GLES2DecoderTest2, AcceptsUniformES3_GL_BOOL_VEC2) {
+ TestAcceptedUniform(
+ GL_BOOL_VEC2,
+ Program::kUniform2i | Program::kUniform2f | Program::kUniform2ui,
+ true);
}
TEST_P(GLES2DecoderTest2, AcceptsUniform_GL_BOOL_VEC3) {
- TestAcceptedUniform(GL_BOOL_VEC3, Program::kUniform3i | Program::kUniform3f);
+ TestAcceptedUniform(
+ GL_BOOL_VEC3, Program::kUniform3i | Program::kUniform3f, false);
+}
+
+TEST_P(GLES2DecoderTest2, AcceptsUniformES3_GL_BOOL_VEC3) {
+ TestAcceptedUniform(
+ GL_BOOL_VEC3,
+ Program::kUniform3i | Program::kUniform3f | Program::kUniform3ui,
+ true);
}
TEST_P(GLES2DecoderTest2, AcceptsUniform_GL_BOOL_VEC4) {
- TestAcceptedUniform(GL_BOOL_VEC4, Program::kUniform4i | Program::kUniform4f);
+ TestAcceptedUniform(
+ GL_BOOL_VEC4, Program::kUniform4i | Program::kUniform4f, false);
+}
+
+TEST_P(GLES2DecoderTest2, AcceptsUniformES3_GL_BOOL_VEC4) {
+ TestAcceptedUniform(
+ GL_BOOL_VEC4,
+ Program::kUniform4i | Program::kUniform4f | Program::kUniform4ui,
+ true);
}
TEST_P(GLES2DecoderTest2, AcceptsUniformTypeFLOAT) {
- TestAcceptedUniform(GL_FLOAT, Program::kUniform1f);
+ TestAcceptedUniform(GL_FLOAT, Program::kUniform1f, false);
}
TEST_P(GLES2DecoderTest2, AcceptsUniform_GL_FLOAT_VEC2) {
- TestAcceptedUniform(GL_FLOAT_VEC2, Program::kUniform2f);
+ TestAcceptedUniform(GL_FLOAT_VEC2, Program::kUniform2f, false);
}
TEST_P(GLES2DecoderTest2, AcceptsUniform_GL_FLOAT_VEC3) {
- TestAcceptedUniform(GL_FLOAT_VEC3, Program::kUniform3f);
+ TestAcceptedUniform(GL_FLOAT_VEC3, Program::kUniform3f, false);
}
TEST_P(GLES2DecoderTest2, AcceptsUniform_GL_FLOAT_VEC4) {
- TestAcceptedUniform(GL_FLOAT_VEC4, Program::kUniform4f);
+ TestAcceptedUniform(GL_FLOAT_VEC4, Program::kUniform4f, false);
}
TEST_P(GLES2DecoderTest2, AcceptsUniform_GL_FLOAT_MAT2) {
- TestAcceptedUniform(GL_FLOAT_MAT2, Program::kUniformMatrix2f);
+ TestAcceptedUniform(GL_FLOAT_MAT2, Program::kUniformMatrix2f, false);
}
TEST_P(GLES2DecoderTest2, AcceptsUniform_GL_FLOAT_MAT3) {
- TestAcceptedUniform(GL_FLOAT_MAT3, Program::kUniformMatrix3f);
+ TestAcceptedUniform(GL_FLOAT_MAT3, Program::kUniformMatrix3f, false);
}
TEST_P(GLES2DecoderTest2, AcceptsUniform_GL_FLOAT_MAT4) {
- TestAcceptedUniform(GL_FLOAT_MAT4, Program::kUniformMatrix4f);
+ TestAcceptedUniform(GL_FLOAT_MAT4, Program::kUniformMatrix4f, false);
+}
+
+TEST_P(GLES2DecoderTest2, AcceptsUniform_GL_UNSIGNED_INT) {
+ TestAcceptedUniform(GL_UNSIGNED_INT, Program::kUniform1ui, true);
+}
+
+TEST_P(GLES2DecoderTest2, AcceptsUniform_GL_UNSIGNED_INT_VEC2) {
+ TestAcceptedUniform(GL_UNSIGNED_INT_VEC2, Program::kUniform2ui, true);
+}
+
+TEST_P(GLES2DecoderTest2, AcceptsUniform_GL_UNSIGNED_INT_VEC3) {
+ TestAcceptedUniform(GL_UNSIGNED_INT_VEC3, Program::kUniform3ui, true);
+}
+
+TEST_P(GLES2DecoderTest2, AcceptsUniform_GL_UNSIGNED_INT_VEC4) {
+ TestAcceptedUniform(GL_UNSIGNED_INT_VEC4, Program::kUniform4ui, true);
+}
+
+TEST_P(GLES2DecoderTest2, AcceptsUniform_GL_FLOAT_MAT2x3) {
+ TestAcceptedUniform(GL_FLOAT_MAT2x3, Program::kUniformMatrix2x3f, true);
+}
+
+TEST_P(GLES2DecoderTest2, AcceptsUniform_GL_FLOAT_MAT2x4) {
+ TestAcceptedUniform(GL_FLOAT_MAT2x4, Program::kUniformMatrix2x4f, true);
+}
+
+TEST_P(GLES2DecoderTest2, AcceptsUniform_GL_FLOAT_MAT3x2) {
+ TestAcceptedUniform(GL_FLOAT_MAT3x2, Program::kUniformMatrix3x2f, true);
+}
+
+TEST_P(GLES2DecoderTest2, AcceptsUniform_GL_FLOAT_MAT3x4) {
+ TestAcceptedUniform(GL_FLOAT_MAT3x4, Program::kUniformMatrix3x4f, true);
+}
+
+TEST_P(GLES2DecoderTest2, AcceptsUniform_GL_FLOAT_MAT4x2) {
+ TestAcceptedUniform(GL_FLOAT_MAT4x2, Program::kUniformMatrix4x2f, true);
+}
+
+TEST_P(GLES2DecoderTest2, AcceptsUniform_GL_FLOAT_MAT4x3) {
+ TestAcceptedUniform(GL_FLOAT_MAT4x3, Program::kUniformMatrix4x3f, true);
}
} // namespace gles2
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 d21613b46ba..6565164c3b2 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
@@ -12,11 +12,32 @@
#ifndef GPU_COMMAND_BUFFER_SERVICE_GLES2_CMD_DECODER_UNITTEST_2_AUTOGEN_H_
#define GPU_COMMAND_BUFFER_SERVICE_GLES2_CMD_DECODER_UNITTEST_2_AUTOGEN_H_
+TEST_P(GLES2DecoderTest2, GetProgramInfoLogValidArgs) {
+ const char* kInfo = "hello";
+ const uint32_t kBucketId = 123;
+ SpecializedSetup<cmds::GetProgramInfoLog, 0>(true);
+
+ cmds::GetProgramInfoLog cmd;
+ cmd.Init(client_program_id_, kBucketId);
+ EXPECT_EQ(error::kNoError, ExecuteCmd(cmd));
+ CommonDecoder::Bucket* bucket = decoder_->GetBucket(kBucketId);
+ ASSERT_TRUE(bucket != NULL);
+ EXPECT_EQ(strlen(kInfo) + 1, bucket->size());
+ EXPECT_EQ(0,
+ memcmp(bucket->GetData(0, bucket->size()), kInfo, bucket->size()));
+ EXPECT_EQ(GL_NO_ERROR, GetGLError());
+}
+
+TEST_P(GLES2DecoderTest2, GetProgramInfoLogInvalidArgs) {
+ const uint32_t kBucketId = 123;
+ cmds::GetProgramInfoLog cmd;
+ cmd.Init(kInvalidClientId, kBucketId);
+ EXPECT_EQ(error::kNoError, ExecuteCmd(cmd));
+ EXPECT_EQ(GL_INVALID_VALUE, GetGLError());
+}
+
TEST_P(GLES2DecoderTest2, GetRenderbufferParameterivValidArgs) {
- EXPECT_CALL(*gl_, GetError())
- .WillOnce(Return(GL_NO_ERROR))
- .WillOnce(Return(GL_NO_ERROR))
- .RetiresOnSaturation();
+ EXPECT_CALL(*gl_, GetError()).WillRepeatedly(Return(GL_NO_ERROR));
SpecializedSetup<cmds::GetRenderbufferParameteriv, 0>(true);
typedef cmds::GetRenderbufferParameteriv::Result Result;
Result* result = static_cast<Result*>(shared_memory_address_);
@@ -78,10 +99,7 @@ TEST_P(GLES2DecoderTest2, GetRenderbufferParameterivInvalidArgs2_1) {
}
TEST_P(GLES2DecoderTest2, GetSamplerParameterfvValidArgs) {
- EXPECT_CALL(*gl_, GetError())
- .WillOnce(Return(GL_NO_ERROR))
- .WillOnce(Return(GL_NO_ERROR))
- .RetiresOnSaturation();
+ EXPECT_CALL(*gl_, GetError()).WillRepeatedly(Return(GL_NO_ERROR));
SpecializedSetup<cmds::GetSamplerParameterfv, 0>(true);
typedef cmds::GetSamplerParameterfv::Result Result;
Result* result = static_cast<Result*>(shared_memory_address_);
@@ -103,10 +121,7 @@ TEST_P(GLES2DecoderTest2, GetSamplerParameterfvValidArgs) {
}
TEST_P(GLES2DecoderTest2, GetSamplerParameterivValidArgs) {
- EXPECT_CALL(*gl_, GetError())
- .WillOnce(Return(GL_NO_ERROR))
- .WillOnce(Return(GL_NO_ERROR))
- .RetiresOnSaturation();
+ EXPECT_CALL(*gl_, GetError()).WillRepeatedly(Return(GL_NO_ERROR));
SpecializedSetup<cmds::GetSamplerParameteriv, 0>(true);
typedef cmds::GetSamplerParameteriv::Result Result;
Result* result = static_cast<Result*>(shared_memory_address_);
@@ -128,10 +143,7 @@ TEST_P(GLES2DecoderTest2, GetSamplerParameterivValidArgs) {
}
TEST_P(GLES2DecoderTest2, GetShaderivValidArgs) {
- EXPECT_CALL(*gl_, GetError())
- .WillOnce(Return(GL_NO_ERROR))
- .WillOnce(Return(GL_NO_ERROR))
- .RetiresOnSaturation();
+ EXPECT_CALL(*gl_, GetError()).WillRepeatedly(Return(GL_NO_ERROR));
SpecializedSetup<cmds::GetShaderiv, 0>(true);
typedef cmds::GetShaderiv::Result Result;
Result* result = static_cast<Result*>(shared_memory_address_);
@@ -178,10 +190,7 @@ TEST_P(GLES2DecoderTest2, GetShaderivInvalidArgs2_1) {
// TODO(gman): GetString
TEST_P(GLES2DecoderTest2, GetSyncivValidArgs) {
- EXPECT_CALL(*gl_, GetError())
- .WillOnce(Return(GL_NO_ERROR))
- .WillOnce(Return(GL_NO_ERROR))
- .RetiresOnSaturation();
+ EXPECT_CALL(*gl_, GetError()).WillRepeatedly(Return(GL_NO_ERROR));
SpecializedSetup<cmds::GetSynciv, 0>(true);
typedef cmds::GetSynciv::Result Result;
Result* result = static_cast<Result*>(shared_memory_address_);
@@ -204,10 +213,7 @@ TEST_P(GLES2DecoderTest2, GetSyncivValidArgs) {
}
TEST_P(GLES2DecoderTest2, GetTexParameterfvValidArgs) {
- EXPECT_CALL(*gl_, GetError())
- .WillOnce(Return(GL_NO_ERROR))
- .WillOnce(Return(GL_NO_ERROR))
- .RetiresOnSaturation();
+ EXPECT_CALL(*gl_, GetError()).WillRepeatedly(Return(GL_NO_ERROR));
SpecializedSetup<cmds::GetTexParameterfv, 0>(true);
typedef cmds::GetTexParameterfv::Result Result;
Result* result = static_cast<Result*>(shared_memory_address_);
@@ -278,10 +284,7 @@ TEST_P(GLES2DecoderTest2, GetTexParameterfvInvalidArgs2_1) {
}
TEST_P(GLES2DecoderTest2, GetTexParameterivValidArgs) {
- EXPECT_CALL(*gl_, GetError())
- .WillOnce(Return(GL_NO_ERROR))
- .WillOnce(Return(GL_NO_ERROR))
- .RetiresOnSaturation();
+ EXPECT_CALL(*gl_, GetError()).WillRepeatedly(Return(GL_NO_ERROR));
SpecializedSetup<cmds::GetTexParameteriv, 0>(true);
typedef cmds::GetTexParameteriv::Result Result;
Result* result = static_cast<Result*>(shared_memory_address_);
@@ -768,10 +771,10 @@ TEST_P(GLES2DecoderTest2, PolygonOffsetValidArgs) {
}
TEST_P(GLES2DecoderTest2, ReadBufferValidArgs) {
- EXPECT_CALL(*gl_, ReadBuffer(1));
+ EXPECT_CALL(*gl_, ReadBuffer(GL_NONE));
SpecializedSetup<cmds::ReadBuffer, 0>(true);
cmds::ReadBuffer cmd;
- cmd.Init(1);
+ cmd.Init(GL_NONE);
decoder_->set_unsafe_es3_apis_enabled(true);
EXPECT_EQ(error::kNoError, ExecuteCmd(cmd));
EXPECT_EQ(GL_NO_ERROR, GetGLError());
@@ -1253,8 +1256,6 @@ TEST_P(GLES2DecoderTest2, TexStorage3DValidArgs) {
// TODO(gman): TexSubImage3D
TEST_P(GLES2DecoderTest2, TransformFeedbackVaryingsBucketValidArgs) {
- EXPECT_CALL(*gl_, TransformFeedbackVaryings(kServiceProgramId, 1, _,
- GL_INTERLEAVED_ATTRIBS));
const uint32 kBucketId = 123;
const char kSource0[] = "hello";
const char* kSource[] = {kSource0};
@@ -1339,36 +1340,8 @@ TEST_P(GLES2DecoderTest2, Uniform1fvImmediateValidArgs) {
}
// TODO(gman): Uniform1i
// TODO(gman): Uniform1ivImmediate
-
-TEST_P(GLES2DecoderTest2, Uniform1uiValidArgs) {
- EXPECT_CALL(*gl_, Uniform1uiv(1, 1, _));
- SpecializedSetup<cmds::Uniform1ui, 0>(true);
- cmds::Uniform1ui cmd;
- cmd.Init(1, 2);
- decoder_->set_unsafe_es3_apis_enabled(true);
- EXPECT_EQ(error::kNoError, ExecuteCmd(cmd));
- EXPECT_EQ(GL_NO_ERROR, GetGLError());
- decoder_->set_unsafe_es3_apis_enabled(false);
- EXPECT_EQ(error::kUnknownCommand, ExecuteCmd(cmd));
-}
-
-TEST_P(GLES2DecoderTest2, Uniform1uivImmediateValidArgs) {
- cmds::Uniform1uivImmediate& cmd =
- *GetImmediateAs<cmds::Uniform1uivImmediate>();
- EXPECT_CALL(
- *gl_,
- Uniform1uiv(1, 2, reinterpret_cast<GLuint*>(ImmediateDataAddress(&cmd))));
- SpecializedSetup<cmds::Uniform1uivImmediate, 0>(true);
- GLuint temp[1 * 2] = {
- 0,
- };
- cmd.Init(1, 2, &temp[0]);
- decoder_->set_unsafe_es3_apis_enabled(true);
- EXPECT_EQ(error::kNoError, ExecuteImmediateCmd(cmd, sizeof(temp)));
- EXPECT_EQ(GL_NO_ERROR, GetGLError());
- decoder_->set_unsafe_es3_apis_enabled(false);
- EXPECT_EQ(error::kUnknownCommand, ExecuteImmediateCmd(cmd, sizeof(temp)));
-}
+// TODO(gman): Uniform1ui
+// TODO(gman): Uniform1uivImmediate
TEST_P(GLES2DecoderTest2, Uniform2fValidArgs) {
EXPECT_CALL(*gl_, Uniform2fv(1, 1, _));
@@ -1415,36 +1388,8 @@ TEST_P(GLES2DecoderTest2, Uniform2ivImmediateValidArgs) {
EXPECT_EQ(error::kNoError, ExecuteImmediateCmd(cmd, sizeof(temp)));
EXPECT_EQ(GL_NO_ERROR, GetGLError());
}
-
-TEST_P(GLES2DecoderTest2, Uniform2uiValidArgs) {
- EXPECT_CALL(*gl_, Uniform2uiv(1, 1, _));
- SpecializedSetup<cmds::Uniform2ui, 0>(true);
- cmds::Uniform2ui cmd;
- cmd.Init(1, 2, 3);
- decoder_->set_unsafe_es3_apis_enabled(true);
- EXPECT_EQ(error::kNoError, ExecuteCmd(cmd));
- EXPECT_EQ(GL_NO_ERROR, GetGLError());
- decoder_->set_unsafe_es3_apis_enabled(false);
- EXPECT_EQ(error::kUnknownCommand, ExecuteCmd(cmd));
-}
-
-TEST_P(GLES2DecoderTest2, Uniform2uivImmediateValidArgs) {
- cmds::Uniform2uivImmediate& cmd =
- *GetImmediateAs<cmds::Uniform2uivImmediate>();
- EXPECT_CALL(
- *gl_,
- Uniform2uiv(1, 2, reinterpret_cast<GLuint*>(ImmediateDataAddress(&cmd))));
- SpecializedSetup<cmds::Uniform2uivImmediate, 0>(true);
- GLuint temp[2 * 2] = {
- 0,
- };
- cmd.Init(1, 2, &temp[0]);
- decoder_->set_unsafe_es3_apis_enabled(true);
- EXPECT_EQ(error::kNoError, ExecuteImmediateCmd(cmd, sizeof(temp)));
- EXPECT_EQ(GL_NO_ERROR, GetGLError());
- decoder_->set_unsafe_es3_apis_enabled(false);
- EXPECT_EQ(error::kUnknownCommand, ExecuteImmediateCmd(cmd, sizeof(temp)));
-}
+// TODO(gman): Uniform2ui
+// TODO(gman): Uniform2uivImmediate
TEST_P(GLES2DecoderTest2, Uniform3fValidArgs) {
EXPECT_CALL(*gl_, Uniform3fv(1, 1, _));
@@ -1491,36 +1436,8 @@ TEST_P(GLES2DecoderTest2, Uniform3ivImmediateValidArgs) {
EXPECT_EQ(error::kNoError, ExecuteImmediateCmd(cmd, sizeof(temp)));
EXPECT_EQ(GL_NO_ERROR, GetGLError());
}
-
-TEST_P(GLES2DecoderTest2, Uniform3uiValidArgs) {
- EXPECT_CALL(*gl_, Uniform3uiv(1, 1, _));
- SpecializedSetup<cmds::Uniform3ui, 0>(true);
- cmds::Uniform3ui cmd;
- cmd.Init(1, 2, 3, 4);
- decoder_->set_unsafe_es3_apis_enabled(true);
- EXPECT_EQ(error::kNoError, ExecuteCmd(cmd));
- EXPECT_EQ(GL_NO_ERROR, GetGLError());
- decoder_->set_unsafe_es3_apis_enabled(false);
- EXPECT_EQ(error::kUnknownCommand, ExecuteCmd(cmd));
-}
-
-TEST_P(GLES2DecoderTest2, Uniform3uivImmediateValidArgs) {
- cmds::Uniform3uivImmediate& cmd =
- *GetImmediateAs<cmds::Uniform3uivImmediate>();
- EXPECT_CALL(
- *gl_,
- Uniform3uiv(1, 2, reinterpret_cast<GLuint*>(ImmediateDataAddress(&cmd))));
- SpecializedSetup<cmds::Uniform3uivImmediate, 0>(true);
- GLuint temp[3 * 2] = {
- 0,
- };
- cmd.Init(1, 2, &temp[0]);
- decoder_->set_unsafe_es3_apis_enabled(true);
- EXPECT_EQ(error::kNoError, ExecuteImmediateCmd(cmd, sizeof(temp)));
- EXPECT_EQ(GL_NO_ERROR, GetGLError());
- decoder_->set_unsafe_es3_apis_enabled(false);
- EXPECT_EQ(error::kUnknownCommand, ExecuteImmediateCmd(cmd, sizeof(temp)));
-}
+// TODO(gman): Uniform3ui
+// TODO(gman): Uniform3uivImmediate
TEST_P(GLES2DecoderTest2, Uniform4fValidArgs) {
EXPECT_CALL(*gl_, Uniform4fv(1, 1, _));
@@ -1567,36 +1484,8 @@ TEST_P(GLES2DecoderTest2, Uniform4ivImmediateValidArgs) {
EXPECT_EQ(error::kNoError, ExecuteImmediateCmd(cmd, sizeof(temp)));
EXPECT_EQ(GL_NO_ERROR, GetGLError());
}
-
-TEST_P(GLES2DecoderTest2, Uniform4uiValidArgs) {
- EXPECT_CALL(*gl_, Uniform4uiv(1, 1, _));
- SpecializedSetup<cmds::Uniform4ui, 0>(true);
- cmds::Uniform4ui cmd;
- cmd.Init(1, 2, 3, 4, 5);
- decoder_->set_unsafe_es3_apis_enabled(true);
- EXPECT_EQ(error::kNoError, ExecuteCmd(cmd));
- EXPECT_EQ(GL_NO_ERROR, GetGLError());
- decoder_->set_unsafe_es3_apis_enabled(false);
- EXPECT_EQ(error::kUnknownCommand, ExecuteCmd(cmd));
-}
-
-TEST_P(GLES2DecoderTest2, Uniform4uivImmediateValidArgs) {
- cmds::Uniform4uivImmediate& cmd =
- *GetImmediateAs<cmds::Uniform4uivImmediate>();
- EXPECT_CALL(
- *gl_,
- Uniform4uiv(1, 2, reinterpret_cast<GLuint*>(ImmediateDataAddress(&cmd))));
- SpecializedSetup<cmds::Uniform4uivImmediate, 0>(true);
- GLuint temp[4 * 2] = {
- 0,
- };
- cmd.Init(1, 2, &temp[0]);
- decoder_->set_unsafe_es3_apis_enabled(true);
- EXPECT_EQ(error::kNoError, ExecuteImmediateCmd(cmd, sizeof(temp)));
- EXPECT_EQ(GL_NO_ERROR, GetGLError());
- decoder_->set_unsafe_es3_apis_enabled(false);
- EXPECT_EQ(error::kUnknownCommand, ExecuteImmediateCmd(cmd, sizeof(temp)));
-}
+// TODO(gman): Uniform4ui
+// TODO(gman): Uniform4uivImmediate
// TODO(gman): UniformBlockBinding
TEST_P(GLES2DecoderTest2, UniformMatrix2fvImmediateValidArgs) {
@@ -1631,22 +1520,4 @@ TEST_P(GLES2DecoderTest2, UniformMatrix2x3fvImmediateValidArgs) {
decoder_->set_unsafe_es3_apis_enabled(false);
EXPECT_EQ(error::kUnknownCommand, ExecuteImmediateCmd(cmd, sizeof(temp)));
}
-
-TEST_P(GLES2DecoderTest2, UniformMatrix2x4fvImmediateValidArgs) {
- cmds::UniformMatrix2x4fvImmediate& cmd =
- *GetImmediateAs<cmds::UniformMatrix2x4fvImmediate>();
- EXPECT_CALL(*gl_,
- UniformMatrix2x4fv(1, 2, false, reinterpret_cast<GLfloat*>(
- ImmediateDataAddress(&cmd))));
- SpecializedSetup<cmds::UniformMatrix2x4fvImmediate, 0>(true);
- GLfloat temp[8 * 2] = {
- 0,
- };
- cmd.Init(1, 2, &temp[0]);
- decoder_->set_unsafe_es3_apis_enabled(true);
- EXPECT_EQ(error::kNoError, ExecuteImmediateCmd(cmd, sizeof(temp)));
- EXPECT_EQ(GL_NO_ERROR, GetGLError());
- decoder_->set_unsafe_es3_apis_enabled(false);
- EXPECT_EQ(error::kUnknownCommand, ExecuteImmediateCmd(cmd, sizeof(temp)));
-}
#endif // GPU_COMMAND_BUFFER_SERVICE_GLES2_CMD_DECODER_UNITTEST_2_AUTOGEN_H_
diff --git a/chromium/gpu/command_buffer/service/gles2_cmd_decoder_unittest_3.cc b/chromium/gpu/command_buffer/service/gles2_cmd_decoder_unittest_3.cc
index b705f602108..93dea22f494 100644
--- a/chromium/gpu/command_buffer/service/gles2_cmd_decoder_unittest_3.cc
+++ b/chromium/gpu/command_buffer/service/gles2_cmd_decoder_unittest_3.cc
@@ -48,6 +48,35 @@ void GLES2DecoderTestBase::SpecializedSetup<cmds::UniformMatrix4fvImmediate, 0>(
SetupShaderForUniform(GL_FLOAT_MAT4);
};
+template <>
+void GLES2DecoderTestBase::SpecializedSetup<
+ cmds::UniformMatrix2x4fvImmediate, 0>(bool /* valid */) {
+ SetupShaderForUniform(GL_FLOAT_MAT2x4);
+};
+
+template <>
+void GLES2DecoderTestBase::SpecializedSetup<
+ cmds::UniformMatrix3x2fvImmediate, 0>(bool /* valid */) {
+ SetupShaderForUniform(GL_FLOAT_MAT3x2);
+};
+
+template <>
+void GLES2DecoderTestBase::SpecializedSetup<
+ cmds::UniformMatrix3x4fvImmediate, 0>(bool /* valid */) {
+ SetupShaderForUniform(GL_FLOAT_MAT3x4);
+};
+
+template <>
+void GLES2DecoderTestBase::SpecializedSetup<
+ cmds::UniformMatrix4x2fvImmediate, 0>(bool /* valid */) {
+ SetupShaderForUniform(GL_FLOAT_MAT4x2);
+};
+
+template <>
+void GLES2DecoderTestBase::SpecializedSetup<
+ cmds::UniformMatrix4x3fvImmediate, 0>(bool /* valid */) {
+ SetupShaderForUniform(GL_FLOAT_MAT4x3);
+};
template <>
void GLES2DecoderTestBase::SpecializedSetup<cmds::UseProgram, 0>(
diff --git a/chromium/gpu/command_buffer/service/gles2_cmd_decoder_unittest_3_autogen.h b/chromium/gpu/command_buffer/service/gles2_cmd_decoder_unittest_3_autogen.h
index 7c0638e0cca..4c7afccb7d2 100644
--- a/chromium/gpu/command_buffer/service/gles2_cmd_decoder_unittest_3_autogen.h
+++ b/chromium/gpu/command_buffer/service/gles2_cmd_decoder_unittest_3_autogen.h
@@ -12,6 +12,24 @@
#ifndef GPU_COMMAND_BUFFER_SERVICE_GLES2_CMD_DECODER_UNITTEST_3_AUTOGEN_H_
#define GPU_COMMAND_BUFFER_SERVICE_GLES2_CMD_DECODER_UNITTEST_3_AUTOGEN_H_
+TEST_P(GLES2DecoderTest3, UniformMatrix2x4fvImmediateValidArgs) {
+ cmds::UniformMatrix2x4fvImmediate& cmd =
+ *GetImmediateAs<cmds::UniformMatrix2x4fvImmediate>();
+ EXPECT_CALL(*gl_,
+ UniformMatrix2x4fv(1, 2, false, reinterpret_cast<GLfloat*>(
+ ImmediateDataAddress(&cmd))));
+ SpecializedSetup<cmds::UniformMatrix2x4fvImmediate, 0>(true);
+ GLfloat temp[8 * 2] = {
+ 0,
+ };
+ cmd.Init(1, 2, &temp[0]);
+ decoder_->set_unsafe_es3_apis_enabled(true);
+ EXPECT_EQ(error::kNoError, ExecuteImmediateCmd(cmd, sizeof(temp)));
+ EXPECT_EQ(GL_NO_ERROR, GetGLError());
+ decoder_->set_unsafe_es3_apis_enabled(false);
+ EXPECT_EQ(error::kUnknownCommand, ExecuteImmediateCmd(cmd, sizeof(temp)));
+}
+
TEST_P(GLES2DecoderTest3, UniformMatrix3fvImmediateValidArgs) {
cmds::UniformMatrix3fvImmediate& cmd =
*GetImmediateAs<cmds::UniformMatrix3fvImmediate>();
@@ -325,6 +343,8 @@ TEST_P(GLES2DecoderTest3, ViewportInvalidArgs3_0) {
// TODO(gman): TexStorage2DEXT
// TODO(gman): GenQueriesEXTImmediate
// TODO(gman): DeleteQueriesEXTImmediate
+// TODO(gman): QueryCounterEXT
+
// TODO(gman): BeginQueryEXT
TEST_P(GLES2DecoderTest3, BeginTransformFeedbackValidArgs) {
@@ -351,6 +371,8 @@ TEST_P(GLES2DecoderTest3, EndTransformFeedbackValidArgs) {
decoder_->set_unsafe_es3_apis_enabled(false);
EXPECT_EQ(error::kUnknownCommand, ExecuteCmd(cmd));
}
+// TODO(gman): SetDisjointValueSyncCHROMIUM
+
// TODO(gman): InsertEventMarkerEXT
// TODO(gman): PushGroupMarkerEXT
@@ -393,6 +415,7 @@ TEST_P(GLES2DecoderTest3, PopGroupMarkerEXTValidArgs) {
// TODO(gman): CopyTextureCHROMIUM
// TODO(gman): CopySubTextureCHROMIUM
// TODO(gman): CompressedCopyTextureCHROMIUM
+// TODO(gman): CompressedCopySubTextureCHROMIUM
// TODO(gman): DrawArraysInstancedANGLE
// TODO(gman): DrawElementsInstancedANGLE
// TODO(gman): VertexAttribDivisorANGLE
@@ -433,14 +456,6 @@ TEST_P(GLES2DecoderTest3, IsValuebufferCHROMIUMInvalidArgsBadSharedMemoryId) {
// TODO(gman): TraceBeginCHROMIUM
// TODO(gman): TraceEndCHROMIUM
-// TODO(gman): AsyncTexSubImage2DCHROMIUM
-
-// TODO(gman): AsyncTexImage2DCHROMIUM
-
-// TODO(gman): WaitAsyncTexImage2DCHROMIUM
-
-// TODO(gman): WaitAllAsyncTexImage2DCHROMIUM
-
// TODO(gman): LoseContextCHROMIUM
// TODO(gman): InsertSyncPointCHROMIUM
diff --git a/chromium/gpu/command_buffer/service/gles2_cmd_decoder_unittest_4_autogen.h b/chromium/gpu/command_buffer/service/gles2_cmd_decoder_unittest_4_autogen.h
new file mode 100644
index 00000000000..9abba521520
--- /dev/null
+++ b/chromium/gpu/command_buffer/service/gles2_cmd_decoder_unittest_4_autogen.h
@@ -0,0 +1,15 @@
+// Copyright 2014 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.
+
+// This file is auto-generated from
+// gpu/command_buffer/build_gles2_cmd_buffer.py
+// It's formatted by clang-format using chromium coding style:
+// clang-format -i -style=chromium filename
+// DO NOT EDIT!
+
+// It is included by gles2_cmd_decoder_unittest_4.cc
+#ifndef GPU_COMMAND_BUFFER_SERVICE_GLES2_CMD_DECODER_UNITTEST_4_AUTOGEN_H_
+#define GPU_COMMAND_BUFFER_SERVICE_GLES2_CMD_DECODER_UNITTEST_4_AUTOGEN_H_
+
+#endif // GPU_COMMAND_BUFFER_SERVICE_GLES2_CMD_DECODER_UNITTEST_4_AUTOGEN_H_
diff --git a/chromium/gpu/command_buffer/service/gles2_cmd_decoder_unittest_async_pixel.cc b/chromium/gpu/command_buffer/service/gles2_cmd_decoder_unittest_async_pixel.cc
deleted file mode 100644
index 168740e73b6..00000000000
--- a/chromium/gpu/command_buffer/service/gles2_cmd_decoder_unittest_async_pixel.cc
+++ /dev/null
@@ -1,388 +0,0 @@
-// Copyright 2014 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/command_buffer/service/gles2_cmd_decoder.h"
-
-#include "base/command_line.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/common/id_allocator.h"
-#include "gpu/command_buffer/service/async_pixel_transfer_delegate_mock.h"
-#include "gpu/command_buffer/service/async_pixel_transfer_manager.h"
-#include "gpu/command_buffer/service/async_pixel_transfer_manager_mock.h"
-#include "gpu/command_buffer/service/cmd_buffer_engine.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_unittest.h"
-
-#include "gpu/command_buffer/service/gpu_switches.h"
-#include "gpu/command_buffer/service/image_manager.h"
-#include "gpu/command_buffer/service/mailbox_manager.h"
-#include "gpu/command_buffer/service/mocks.h"
-#include "gpu/command_buffer/service/program_manager.h"
-#include "gpu/command_buffer/service/test_helper.h"
-#include "testing/gtest/include/gtest/gtest.h"
-#include "ui/gl/gl_implementation.h"
-#include "ui/gl/gl_mock.h"
-#include "ui/gl/gl_surface_stub.h"
-
-#if !defined(GL_DEPTH24_STENCIL8)
-#define GL_DEPTH24_STENCIL8 0x88F0
-#endif
-
-using ::gfx::MockGLInterface;
-using ::testing::_;
-using ::testing::DoAll;
-using ::testing::InSequence;
-using ::testing::Invoke;
-using ::testing::MatcherCast;
-using ::testing::Mock;
-using ::testing::Pointee;
-using ::testing::Return;
-using ::testing::SaveArg;
-using ::testing::SetArrayArgument;
-using ::testing::SetArgumentPointee;
-using ::testing::SetArgPointee;
-using ::testing::StrEq;
-using ::testing::StrictMock;
-
-namespace gpu {
-namespace gles2 {
-
-using namespace cmds;
-
-TEST_P(GLES2DecoderManualInitTest, AsyncPixelTransfers) {
- InitState init;
- init.extensions = "GL_CHROMIUM_async_pixel_transfers";
- init.bind_generates_resource = true;
- InitDecoder(init);
-
- // Set up the texture.
- DoBindTexture(GL_TEXTURE_2D, client_texture_id_, kServiceTextureId);
- TextureRef* texture_ref = GetTexture(client_texture_id_);
- Texture* texture = texture_ref->texture();
-
- // Set a mock Async delegate
- StrictMock<gpu::MockAsyncPixelTransferManager>* manager =
- new StrictMock<gpu::MockAsyncPixelTransferManager>;
- manager->Initialize(group().texture_manager());
- decoder_->SetAsyncPixelTransferManagerForTest(manager);
- StrictMock<gpu::MockAsyncPixelTransferDelegate>* delegate = NULL;
-
- // Tex(Sub)Image2D upload commands.
- AsyncTexImage2DCHROMIUM teximage_cmd;
- teximage_cmd.Init(GL_TEXTURE_2D,
- 0,
- GL_RGBA,
- 8,
- 8,
- GL_RGBA,
- GL_UNSIGNED_BYTE,
- kSharedMemoryId,
- kSharedMemoryOffset,
- 0,
- 0,
- 0);
- AsyncTexSubImage2DCHROMIUM texsubimage_cmd;
- texsubimage_cmd.Init(GL_TEXTURE_2D,
- 0,
- 0,
- 0,
- 8,
- 8,
- GL_RGBA,
- GL_UNSIGNED_BYTE,
- kSharedMemoryId,
- kSharedMemoryOffset,
- 0,
- 0,
- 0);
- WaitAsyncTexImage2DCHROMIUM wait_cmd;
- wait_cmd.Init(GL_TEXTURE_2D);
- WaitAllAsyncTexImage2DCHROMIUM wait_all_cmd;
- wait_all_cmd.Init();
-
- // No transfer state exists initially.
- EXPECT_FALSE(
- decoder_->GetAsyncPixelTransferManager()->GetPixelTransferDelegate(
- texture_ref));
-
- base::Closure bind_callback;
-
- // AsyncTexImage2D
- {
- // Create transfer state since it doesn't exist.
- EXPECT_EQ(texture_ref->num_observers(), 0);
- EXPECT_CALL(*manager, CreatePixelTransferDelegateImpl(texture_ref, _))
- .WillOnce(Return(
- delegate = new StrictMock<gpu::MockAsyncPixelTransferDelegate>))
- .RetiresOnSaturation();
- EXPECT_CALL(*delegate, AsyncTexImage2D(_, _, _))
- .WillOnce(SaveArg<2>(&bind_callback))
- .RetiresOnSaturation();
- // Command succeeds.
- EXPECT_EQ(error::kNoError, ExecuteCmd(teximage_cmd));
- EXPECT_EQ(GL_NO_ERROR, GetGLError());
- EXPECT_EQ(
- delegate,
- decoder_->GetAsyncPixelTransferManager()->GetPixelTransferDelegate(
- texture_ref));
- EXPECT_TRUE(texture->IsImmutable());
- // The texture is safe but the level has not been defined yet.
- EXPECT_TRUE(texture->SafeToRenderFrom());
- GLsizei width, height;
- EXPECT_FALSE(
- texture->GetLevelSize(GL_TEXTURE_2D, 0, &width, &height, nullptr));
- EXPECT_EQ(texture_ref->num_observers(), 1);
- }
- {
- // Async redefinitions are not allowed!
- // Command fails.
- EXPECT_EQ(error::kNoError, ExecuteCmd(teximage_cmd));
- EXPECT_EQ(GL_INVALID_OPERATION, GetGLError());
- EXPECT_EQ(
- delegate,
- decoder_->GetAsyncPixelTransferManager()->GetPixelTransferDelegate(
- texture_ref));
- EXPECT_TRUE(texture->IsImmutable());
- EXPECT_TRUE(texture->SafeToRenderFrom());
- }
-
- // Binding/defining of the async transfer
- {
- // TODO(epenner): We should check that the manager gets the
- // BindCompletedAsyncTransfers() call, which is required to
- // guarantee the delegate calls the bind callback.
-
- // Simulate the bind callback from the delegate.
- bind_callback.Run();
-
- // After the bind callback is run, the texture is safe,
- // and has the right size etc.
- EXPECT_TRUE(texture->SafeToRenderFrom());
- GLsizei width, height;
- EXPECT_TRUE(
- texture->GetLevelSize(GL_TEXTURE_2D, 0, &width, &height, nullptr));
- EXPECT_EQ(width, 8);
- EXPECT_EQ(height, 8);
- }
-
- // AsyncTexSubImage2D
- EXPECT_CALL(*delegate, Destroy()).RetiresOnSaturation();
- decoder_->GetAsyncPixelTransferManager()->ClearPixelTransferDelegateForTest(
- texture_ref);
- EXPECT_EQ(texture_ref->num_observers(), 0);
- texture->SetImmutable(false);
- {
- // Create transfer state since it doesn't exist.
- EXPECT_CALL(*manager, CreatePixelTransferDelegateImpl(texture_ref, _))
- .WillOnce(Return(
- delegate = new StrictMock<gpu::MockAsyncPixelTransferDelegate>))
- .RetiresOnSaturation();
- EXPECT_CALL(*delegate, AsyncTexSubImage2D(_, _)).RetiresOnSaturation();
- // Command succeeds.
- EXPECT_EQ(error::kNoError, ExecuteCmd(texsubimage_cmd));
- EXPECT_EQ(GL_NO_ERROR, GetGLError());
- EXPECT_EQ(
- delegate,
- decoder_->GetAsyncPixelTransferManager()->GetPixelTransferDelegate(
- texture_ref));
- EXPECT_TRUE(texture->IsImmutable());
- EXPECT_TRUE(texture->SafeToRenderFrom());
- }
- {
- // No transfer is in progress.
- EXPECT_CALL(*delegate, TransferIsInProgress())
- .WillOnce(Return(false)) // texSubImage validation
- .WillOnce(Return(false)) // async validation
- .RetiresOnSaturation();
- EXPECT_CALL(*delegate, AsyncTexSubImage2D(_, _)).RetiresOnSaturation();
- // Command succeeds.
- EXPECT_EQ(error::kNoError, ExecuteCmd(texsubimage_cmd));
- EXPECT_EQ(GL_NO_ERROR, GetGLError());
- EXPECT_EQ(
- delegate,
- decoder_->GetAsyncPixelTransferManager()->GetPixelTransferDelegate(
- texture_ref));
- EXPECT_TRUE(texture->IsImmutable());
- EXPECT_TRUE(texture->SafeToRenderFrom());
- }
- {
- // A transfer is still in progress!
- EXPECT_CALL(*delegate, TransferIsInProgress())
- .WillOnce(Return(true))
- .RetiresOnSaturation();
- // No async call, command fails.
- EXPECT_EQ(error::kNoError, ExecuteCmd(texsubimage_cmd));
- EXPECT_EQ(GL_INVALID_OPERATION, GetGLError());
- EXPECT_EQ(
- delegate,
- decoder_->GetAsyncPixelTransferManager()->GetPixelTransferDelegate(
- texture_ref));
- EXPECT_TRUE(texture->IsImmutable());
- EXPECT_TRUE(texture->SafeToRenderFrom());
- }
-
- // Delete delegate on DeleteTexture.
- {
- EXPECT_EQ(texture_ref->num_observers(), 1);
- EXPECT_CALL(*delegate, Destroy()).RetiresOnSaturation();
- DoDeleteTexture(client_texture_id_, kServiceTextureId);
- EXPECT_FALSE(
- decoder_->GetAsyncPixelTransferManager()->GetPixelTransferDelegate(
- texture_ref));
- texture = NULL;
- texture_ref = NULL;
- delegate = NULL;
- }
-
- // WaitAsyncTexImage2D
- {
- // Get a fresh texture since the existing texture cannot be respecified
- // asynchronously and AsyncTexSubImage2D does not involve binding.
- EXPECT_CALL(*gl_, GenTextures(1, _))
- .WillOnce(SetArgumentPointee<1>(kServiceTextureId));
- DoBindTexture(GL_TEXTURE_2D, client_texture_id_, kServiceTextureId);
- texture_ref = GetTexture(client_texture_id_);
- texture = texture_ref->texture();
- texture->SetImmutable(false);
- // Create transfer state since it doesn't exist.
- EXPECT_CALL(*manager, CreatePixelTransferDelegateImpl(texture_ref, _))
- .WillOnce(Return(
- delegate = new StrictMock<gpu::MockAsyncPixelTransferDelegate>))
- .RetiresOnSaturation();
- EXPECT_CALL(*delegate, AsyncTexImage2D(_, _, _)).RetiresOnSaturation();
- // Start async transfer.
- EXPECT_EQ(error::kNoError, ExecuteCmd(teximage_cmd));
- EXPECT_EQ(GL_NO_ERROR, GetGLError());
- EXPECT_EQ(
- delegate,
- decoder_->GetAsyncPixelTransferManager()->GetPixelTransferDelegate(
- texture_ref));
-
- EXPECT_TRUE(texture->IsImmutable());
- // Wait for completion.
- EXPECT_CALL(*delegate, WaitForTransferCompletion());
- EXPECT_CALL(*manager, BindCompletedAsyncTransfers());
- EXPECT_EQ(error::kNoError, ExecuteCmd(wait_cmd));
- EXPECT_EQ(GL_NO_ERROR, GetGLError());
- }
-
- // WaitAllAsyncTexImage2D
- EXPECT_CALL(*delegate, Destroy()).RetiresOnSaturation();
- DoDeleteTexture(client_texture_id_, kServiceTextureId);
- EXPECT_FALSE(
- decoder_->GetAsyncPixelTransferManager()->GetPixelTransferDelegate(
- texture_ref));
- texture = NULL;
- texture_ref = NULL;
- delegate = NULL;
- {
- // Get a fresh texture since the existing texture cannot be respecified
- // asynchronously and AsyncTexSubImage2D does not involve binding.
- EXPECT_CALL(*gl_, GenTextures(1, _))
- .WillOnce(SetArgumentPointee<1>(kServiceTextureId));
- DoBindTexture(GL_TEXTURE_2D, client_texture_id_, kServiceTextureId);
- texture_ref = GetTexture(client_texture_id_);
- texture = texture_ref->texture();
- texture->SetImmutable(false);
- // Create transfer state since it doesn't exist.
- EXPECT_CALL(*manager, CreatePixelTransferDelegateImpl(texture_ref, _))
- .WillOnce(Return(
- delegate = new StrictMock<gpu::MockAsyncPixelTransferDelegate>))
- .RetiresOnSaturation();
- EXPECT_CALL(*delegate, AsyncTexImage2D(_, _, _)).RetiresOnSaturation();
- // Start async transfer.
- EXPECT_EQ(error::kNoError, ExecuteCmd(teximage_cmd));
- EXPECT_EQ(GL_NO_ERROR, GetGLError());
- EXPECT_EQ(
- delegate,
- decoder_->GetAsyncPixelTransferManager()->GetPixelTransferDelegate(
- texture_ref));
-
- EXPECT_TRUE(texture->IsImmutable());
- // Wait for completion of all uploads.
- EXPECT_CALL(*manager, WaitAllAsyncTexImage2D()).RetiresOnSaturation();
- EXPECT_CALL(*manager, BindCompletedAsyncTransfers());
- EXPECT_EQ(error::kNoError, ExecuteCmd(wait_all_cmd));
- EXPECT_EQ(GL_NO_ERROR, GetGLError());
- }
-
- // Remove PixelTransferManager before the decoder destroys.
- EXPECT_CALL(*delegate, Destroy()).RetiresOnSaturation();
- decoder_->ResetAsyncPixelTransferManagerForTest();
- manager = NULL;
-}
-
-TEST_P(GLES2DecoderManualInitTest, AsyncPixelTransferManager) {
- InitState init;
- init.extensions = "GL_CHROMIUM_async_pixel_transfers";
- init.bind_generates_resource = true;
- InitDecoder(init);
-
- // Set up the texture.
- DoBindTexture(GL_TEXTURE_2D, client_texture_id_, kServiceTextureId);
- TextureRef* texture_ref = GetTexture(client_texture_id_);
-
- // Set a mock Async delegate.
- StrictMock<gpu::MockAsyncPixelTransferManager>* manager =
- new StrictMock<gpu::MockAsyncPixelTransferManager>;
- manager->Initialize(group().texture_manager());
- decoder_->SetAsyncPixelTransferManagerForTest(manager);
- StrictMock<gpu::MockAsyncPixelTransferDelegate>* delegate = NULL;
-
- AsyncTexImage2DCHROMIUM teximage_cmd;
- teximage_cmd.Init(GL_TEXTURE_2D,
- 0,
- GL_RGBA,
- 8,
- 8,
- GL_RGBA,
- GL_UNSIGNED_BYTE,
- kSharedMemoryId,
- kSharedMemoryOffset,
- 0,
- 0,
- 0);
-
- // No transfer delegate exists initially.
- EXPECT_FALSE(
- decoder_->GetAsyncPixelTransferManager()->GetPixelTransferDelegate(
- texture_ref));
-
- // Create delegate on AsyncTexImage2D.
- {
- EXPECT_CALL(*manager, CreatePixelTransferDelegateImpl(texture_ref, _))
- .WillOnce(Return(
- delegate = new StrictMock<gpu::MockAsyncPixelTransferDelegate>))
- .RetiresOnSaturation();
- EXPECT_CALL(*delegate, AsyncTexImage2D(_, _, _)).RetiresOnSaturation();
-
- // Command succeeds.
- EXPECT_EQ(error::kNoError, ExecuteCmd(teximage_cmd));
- EXPECT_EQ(GL_NO_ERROR, GetGLError());
- }
-
- // Delegate is cached.
- EXPECT_EQ(delegate,
- decoder_->GetAsyncPixelTransferManager()->GetPixelTransferDelegate(
- texture_ref));
-
- // Delete delegate on manager teardown.
- {
- EXPECT_EQ(texture_ref->num_observers(), 1);
- EXPECT_CALL(*delegate, Destroy()).RetiresOnSaturation();
- decoder_->ResetAsyncPixelTransferManagerForTest();
- manager = NULL;
-
- // Texture ref still valid.
- EXPECT_EQ(texture_ref, GetTexture(client_texture_id_));
- EXPECT_EQ(texture_ref->num_observers(), 0);
- }
-}
-
-} // namespace gles2
-} // namespace gpu
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 cd39253d079..e854f53d2f7 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
@@ -8,9 +8,6 @@
#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/async_pixel_transfer_delegate_mock.h"
-#include "gpu/command_buffer/service/async_pixel_transfer_manager.h"
-#include "gpu/command_buffer/service/async_pixel_transfer_manager_mock.h"
#include "gpu/command_buffer/service/cmd_buffer_engine.h"
#include "gpu/command_buffer/service/context_group.h"
#include "gpu/command_buffer/service/context_state.h"
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 276cb7ded57..d4ca3bcbaf1 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
@@ -23,10 +23,11 @@
#include "testing/gtest/include/gtest/gtest.h"
#include "ui/gl/gl_implementation.h"
#include "ui/gl/gl_mock.h"
-#include "ui/gl/gl_surface.h"
+#include "ui/gl/test/gl_surface_test_support.h"
using ::gfx::MockGLInterface;
using ::testing::_;
+using ::testing::AnyNumber;
using ::testing::DoAll;
using ::testing::InSequence;
using ::testing::Invoke;
@@ -63,7 +64,8 @@ void NormalizeInitState(gpu::gles2::GLES2DecoderTestBase::InitState* init) {
return;
if (!init->extensions.empty())
init->extensions += " ";
- if (base::StartsWithASCII(init->gl_version, "opengl es", false)) {
+ if (base::StartsWith(init->gl_version, "opengl es",
+ base::CompareCase::INSENSITIVE_ASCII)) {
init->extensions += kVAOExtensions[0];
} else {
#if !defined(OS_MACOSX)
@@ -158,8 +160,7 @@ GLES2DecoderTestBase::InitState::InitState()
bind_generates_resource(false),
lose_context_when_out_of_memory(false),
use_native_vao(true),
- webgl_version(0) {
-}
+ context_type(CONTEXT_TYPE_OPENGLES2) {}
void GLES2DecoderTestBase::InitDecoder(const InitState& init) {
InitDecoderWithCommandLine(init, NULL);
@@ -173,10 +174,8 @@ void GLES2DecoderTestBase::InitDecoderWithCommandLine(
// For easier substring/extension matching
DCHECK(normalized_init.extensions.empty() ||
*normalized_init.extensions.rbegin() == ' ');
- Framebuffer::ClearFramebufferCompleteComboMap();
-
gfx::SetGLGetProcAddressProc(gfx::MockGLInterface::GetGLProcAddress);
- gfx::GLSurface::InitializeOneOffWithMockBindingsForTests();
+ gfx::GLSurfaceTestSupport::InitializeOneOffWithMockBindings();
gl_.reset(new StrictMock<MockGLInterface>());
::gfx::MockGLInterface::SetGLInterface(gl_.get());
@@ -187,12 +186,9 @@ void GLES2DecoderTestBase::InitDecoderWithCommandLine(
if (command_line)
feature_info = new FeatureInfo(*command_line);
group_ = scoped_refptr<ContextGroup>(
- new ContextGroup(NULL,
- memory_tracker_,
- new ShaderTranslatorCache,
- feature_info.get(),
- new SubscriptionRefSet,
- new ValueStateMap,
+ new ContextGroup(NULL, memory_tracker_, new ShaderTranslatorCache,
+ new FramebufferCompletenessCache, feature_info.get(),
+ new SubscriptionRefSet, new ValueStateMap,
normalized_init.bind_generates_resource));
bool use_default_textures = normalized_init.bind_generates_resource;
@@ -209,7 +205,7 @@ void GLES2DecoderTestBase::InitDecoderWithCommandLine(
context_->SetGLVersionString(normalized_init.gl_version.c_str());
context_->GLContextStubWithExtensions::MakeCurrent(surface_.get());
- gfx::GLSurface::InitializeDynamicMockBindingsForTests(context_.get());
+ gfx::GLSurfaceTestSupport::InitializeDynamicMockBindings(context_.get());
TestHelper::SetupContextGroupInitExpectations(
gl_.get(),
@@ -228,13 +224,11 @@ void GLES2DecoderTestBase::InitDecoderWithCommandLine(
EXPECT_CALL(*mock_decoder_, DoCommands(_, _, _, _)).WillRepeatedly(
Invoke(mock_decoder_.get(), &MockGLES2Decoder::FakeDoCommands));
+ EXPECT_TRUE(group_->Initialize(mock_decoder_.get(), init.context_type,
+ DisallowedFeatures()));
- EXPECT_TRUE(group_->Initialize(
- mock_decoder_.get(),
- ContextGroup::GetContextType(init.webgl_version),
- DisallowedFeatures()));
-
- if (init.webgl_version == 2) {
+ if (init.context_type == CONTEXT_TYPE_WEBGL2 ||
+ init.context_type == CONTEXT_TYPE_OPENGLES3) {
EXPECT_CALL(*gl_, GetIntegerv(GL_MAX_COLOR_ATTACHMENTS, _))
.WillOnce(SetArgumentPointee<1>(kMaxColorAttachments))
.RetiresOnSaturation();
@@ -406,29 +400,25 @@ void GLES2DecoderTestBase::InitDecoderWithCommandLine(
static const int32 kLoseContextWhenOutOfMemory = 0x10002;
static const int32 kWebGLVersion = 0x10003;
- int32 attributes[] = {
- EGL_ALPHA_SIZE,
- normalized_init.request_alpha ? 8 : 0,
- EGL_DEPTH_SIZE,
- normalized_init.request_depth ? 24 : 0,
- EGL_STENCIL_SIZE,
- normalized_init.request_stencil ? 8 : 0,
- kLoseContextWhenOutOfMemory,
- normalized_init.lose_context_when_out_of_memory ? 1 : 0,
- kWebGLVersion,
- init.webgl_version
- };
+ int32 attributes[] = {EGL_ALPHA_SIZE,
+ normalized_init.request_alpha ? 8 : 0,
+ EGL_DEPTH_SIZE,
+ normalized_init.request_depth ? 24 : 0,
+ EGL_STENCIL_SIZE,
+ normalized_init.request_stencil ? 8 : 0,
+ kLoseContextWhenOutOfMemory,
+ normalized_init.lose_context_when_out_of_memory ? 1 : 0,
+ kWebGLVersion,
+ init.context_type};
std::vector<int32> attribs(attributes, attributes + arraysize(attributes));
decoder_.reset(GLES2Decoder::Create(group_.get()));
decoder_->SetIgnoreCachedStateForTest(ignore_cached_state_for_test_);
decoder_->GetLogger()->set_log_synthesized_gl_errors(false);
- decoder_->Initialize(surface_,
- context_,
- false,
- surface_->GetSize(),
- DisallowedFeatures(),
- attribs);
+ ASSERT_TRUE(decoder_->Initialize(surface_, context_, false,
+ surface_->GetSize(), DisallowedFeatures(),
+ attribs));
+
EXPECT_CALL(*context_, MakeCurrent(surface_.get())).WillOnce(Return(true));
if (context_->WasAllocatedUsingRobustnessExtension()) {
EXPECT_CALL(*gl_, GetGraphicsResetStatusARB())
@@ -1130,10 +1120,21 @@ bool GLES2DecoderTestBase::DoIsTexture(GLuint client_id) {
void GLES2DecoderTestBase::DoDeleteTexture(
GLuint client_id, GLuint service_id) {
- EXPECT_CALL(*gl_, DeleteTextures(1, Pointee(service_id)))
- .Times(1)
- .RetiresOnSaturation();
- GenHelper<cmds::DeleteTexturesImmediate>(client_id);
+
+ {
+ InSequence s;
+
+ // Calling DoDeleteTexture will unbind the texture from any texture units
+ // it's currently bound to.
+ EXPECT_CALL(*gl_, BindTexture(_, 0))
+ .Times(AnyNumber());
+
+ EXPECT_CALL(*gl_, DeleteTextures(1, Pointee(service_id)))
+ .Times(1)
+ .RetiresOnSaturation();
+
+ GenHelper<cmds::DeleteTexturesImmediate>(client_id);
+ }
}
void GLES2DecoderTestBase::DoBindTexImage2DCHROMIUM(GLenum target,
@@ -1454,20 +1455,40 @@ const GLint GLES2DecoderTestBase::kMaxUniformLength;
const GLint GLES2DecoderTestBase::kUniform1Size;
const GLint GLES2DecoderTestBase::kUniform2Size;
const GLint GLES2DecoderTestBase::kUniform3Size;
+const GLint GLES2DecoderTestBase::kUniform4Size;
+const GLint GLES2DecoderTestBase::kUniform5Size;
+const GLint GLES2DecoderTestBase::kUniform6Size;
+const GLint GLES2DecoderTestBase::kUniform7Size;
const GLint GLES2DecoderTestBase::kUniform1RealLocation;
const GLint GLES2DecoderTestBase::kUniform2RealLocation;
const GLint GLES2DecoderTestBase::kUniform2ElementRealLocation;
const GLint GLES2DecoderTestBase::kUniform3RealLocation;
+const GLint GLES2DecoderTestBase::kUniform4RealLocation;
+const GLint GLES2DecoderTestBase::kUniform5RealLocation;
+const GLint GLES2DecoderTestBase::kUniform6RealLocation;
+const GLint GLES2DecoderTestBase::kUniform7RealLocation;
const GLint GLES2DecoderTestBase::kUniform1FakeLocation;
const GLint GLES2DecoderTestBase::kUniform2FakeLocation;
const GLint GLES2DecoderTestBase::kUniform2ElementFakeLocation;
const GLint GLES2DecoderTestBase::kUniform3FakeLocation;
+const GLint GLES2DecoderTestBase::kUniform4FakeLocation;
+const GLint GLES2DecoderTestBase::kUniform5FakeLocation;
+const GLint GLES2DecoderTestBase::kUniform6FakeLocation;
+const GLint GLES2DecoderTestBase::kUniform7FakeLocation;
const GLint GLES2DecoderTestBase::kUniform1DesiredLocation;
const GLint GLES2DecoderTestBase::kUniform2DesiredLocation;
const GLint GLES2DecoderTestBase::kUniform3DesiredLocation;
+const GLint GLES2DecoderTestBase::kUniform4DesiredLocation;
+const GLint GLES2DecoderTestBase::kUniform5DesiredLocation;
+const GLint GLES2DecoderTestBase::kUniform6DesiredLocation;
+const GLint GLES2DecoderTestBase::kUniform7DesiredLocation;
const GLenum GLES2DecoderTestBase::kUniform1Type;
const GLenum GLES2DecoderTestBase::kUniform2Type;
const GLenum GLES2DecoderTestBase::kUniform3Type;
+const GLenum GLES2DecoderTestBase::kUniform4Type;
+const GLenum GLES2DecoderTestBase::kUniform5Type;
+const GLenum GLES2DecoderTestBase::kUniform6Type;
+const GLenum GLES2DecoderTestBase::kUniform7Type;
const GLenum GLES2DecoderTestBase::kUniformCubemapType;
const GLint GLES2DecoderTestBase::kInvalidUniformLocation;
const GLint GLES2DecoderTestBase::kBadUniformIndex;
@@ -1480,6 +1501,10 @@ const char* GLES2DecoderTestBase::kAttrib3Name = "attrib3";
const char* GLES2DecoderTestBase::kUniform1Name = "uniform1";
const char* GLES2DecoderTestBase::kUniform2Name = "uniform2[0]";
const char* GLES2DecoderTestBase::kUniform3Name = "uniform3[0]";
+const char* GLES2DecoderTestBase::kUniform4Name = "uniform4";
+const char* GLES2DecoderTestBase::kUniform5Name = "uniform5";
+const char* GLES2DecoderTestBase::kUniform6Name = "uniform6";
+const char* GLES2DecoderTestBase::kUniform7Name = "uniform7";
void GLES2DecoderTestBase::SetupDefaultProgram() {
{
@@ -1498,6 +1523,18 @@ void GLES2DecoderTestBase::SetupDefaultProgram() {
{ kUniform3Name, kUniform3Size, kUniform3Type,
kUniform3FakeLocation, kUniform3RealLocation,
kUniform3DesiredLocation },
+ { kUniform4Name, kUniform4Size, kUniform4Type,
+ kUniform4FakeLocation, kUniform4RealLocation,
+ kUniform4DesiredLocation },
+ { kUniform5Name, kUniform5Size, kUniform5Type,
+ kUniform5FakeLocation, kUniform5RealLocation,
+ kUniform5DesiredLocation },
+ { kUniform6Name, kUniform6Size, kUniform6Type,
+ kUniform6FakeLocation, kUniform6RealLocation,
+ kUniform6DesiredLocation },
+ { kUniform7Name, kUniform7Size, kUniform7Type,
+ kUniform7FakeLocation, kUniform7RealLocation,
+ kUniform7DesiredLocation },
};
SetupShader(attribs, arraysize(attribs), uniforms, arraysize(uniforms),
client_program_id_, kServiceProgramId,
@@ -1532,6 +1569,18 @@ void GLES2DecoderTestBase::SetupCubemapProgram() {
{ kUniform3Name, kUniform3Size, kUniform3Type,
kUniform3FakeLocation, kUniform3RealLocation,
kUniform3DesiredLocation, },
+ { kUniform4Name, kUniform4Size, kUniform4Type,
+ kUniform4FakeLocation, kUniform4RealLocation,
+ kUniform4DesiredLocation, },
+ { kUniform5Name, kUniform5Size, kUniform5Type,
+ kUniform5FakeLocation, kUniform5RealLocation,
+ kUniform5DesiredLocation },
+ { kUniform6Name, kUniform6Size, kUniform6Type,
+ kUniform6FakeLocation, kUniform6RealLocation,
+ kUniform6DesiredLocation },
+ { kUniform7Name, kUniform7Size, kUniform7Type,
+ kUniform7FakeLocation, kUniform7RealLocation,
+ kUniform7DesiredLocation },
};
SetupShader(attribs, arraysize(attribs), uniforms, arraysize(uniforms),
client_program_id_, kServiceProgramId,
@@ -1566,6 +1615,18 @@ void GLES2DecoderTestBase::SetupSamplerExternalProgram() {
{ kUniform3Name, kUniform3Size, kUniform3Type,
kUniform3FakeLocation, kUniform3RealLocation,
kUniform3DesiredLocation, },
+ { kUniform4Name, kUniform4Size, kUniform4Type,
+ kUniform4FakeLocation, kUniform4RealLocation,
+ kUniform4DesiredLocation, },
+ { kUniform5Name, kUniform5Size, kUniform5Type,
+ kUniform5FakeLocation, kUniform5RealLocation,
+ kUniform5DesiredLocation },
+ { kUniform6Name, kUniform6Size, kUniform6Type,
+ kUniform6FakeLocation, kUniform6RealLocation,
+ kUniform6DesiredLocation },
+ { kUniform7Name, kUniform7Size, kUniform7Type,
+ kUniform7FakeLocation, kUniform7RealLocation,
+ kUniform7DesiredLocation },
};
SetupShader(attribs, arraysize(attribs), uniforms, arraysize(uniforms),
client_program_id_, kServiceProgramId,
@@ -1763,6 +1824,9 @@ void GLES2DecoderTestBase::AddExpectationsForSimulatedAttrib0WithError(
EXPECT_CALL(*gl_, VertexAttribPointer(0, 4, GL_FLOAT, GL_FALSE, 0, NULL))
.Times(1)
.RetiresOnSaturation();
+ EXPECT_CALL(*gl_, VertexAttribDivisorANGLE(0, 0))
+ .Times(testing::AtMost(1))
+ .RetiresOnSaturation();
EXPECT_CALL(*gl_, BindBuffer(GL_ARRAY_BUFFER, buffer_id))
.Times(1)
.RetiresOnSaturation();
diff --git a/chromium/gpu/command_buffer/service/gles2_cmd_decoder_unittest_base.h b/chromium/gpu/command_buffer/service/gles2_cmd_decoder_unittest_base.h
index 42a44e29611..4b9ce5107e1 100644
--- a/chromium/gpu/command_buffer/service/gles2_cmd_decoder_unittest_base.h
+++ b/chromium/gpu/command_buffer/service/gles2_cmd_decoder_unittest_base.h
@@ -25,6 +25,7 @@
#include "testing/gtest/include/gtest/gtest.h"
#include "ui/gl/gl_surface_stub.h"
#include "ui/gl/gl_mock.h"
+#include "ui/gl/gl_version_info.h"
namespace base {
class CommandLine;
@@ -199,7 +200,7 @@ class GLES2DecoderTestBase : public ::testing::TestWithParam<bool> {
bool bind_generates_resource;
bool lose_context_when_out_of_memory;
bool use_native_vao; // default is true.
- unsigned webgl_version; // default to 0, i.e., not WebGL context.
+ ContextType context_type;
};
void InitDecoder(const InitState& init);
@@ -533,23 +534,47 @@ class GLES2DecoderTestBase : public ::testing::TestWithParam<bool> {
static const char* kUniform1Name;
static const char* kUniform2Name;
static const char* kUniform3Name;
+ static const char* kUniform4Name;
+ static const char* kUniform5Name;
+ static const char* kUniform6Name;
+ static const char* kUniform7Name;
static const GLint kUniform1Size = 1;
static const GLint kUniform2Size = 3;
static const GLint kUniform3Size = 2;
+ static const GLint kUniform4Size = 1;
+ static const GLint kUniform5Size = 1;
+ static const GLint kUniform6Size = 1;
+ static const GLint kUniform7Size = 1;
static const GLint kUniform1RealLocation = 3;
static const GLint kUniform2RealLocation = 10;
static const GLint kUniform2ElementRealLocation = 12;
static const GLint kUniform3RealLocation = 20;
+ static const GLint kUniform4RealLocation = 22;
+ static const GLint kUniform5RealLocation = 30;
+ static const GLint kUniform6RealLocation = 32;
+ static const GLint kUniform7RealLocation = 44;
static const GLint kUniform1FakeLocation = 0; // These are
static const GLint kUniform2FakeLocation = 1; // hardcoded
static const GLint kUniform2ElementFakeLocation = 0x10001; // to match
static const GLint kUniform3FakeLocation = 2; // ProgramManager.
+ static const GLint kUniform4FakeLocation = 3; //
+ static const GLint kUniform5FakeLocation = 4; //
+ static const GLint kUniform6FakeLocation = 5; //
+ static const GLint kUniform7FakeLocation = 6; //
static const GLint kUniform1DesiredLocation = -1;
static const GLint kUniform2DesiredLocation = -1;
static const GLint kUniform3DesiredLocation = -1;
+ static const GLint kUniform4DesiredLocation = -1;
+ static const GLint kUniform5DesiredLocation = -1;
+ static const GLint kUniform6DesiredLocation = -1;
+ static const GLint kUniform7DesiredLocation = -1;
static const GLenum kUniform1Type = GL_SAMPLER_2D;
static const GLenum kUniform2Type = GL_INT_VEC2;
static const GLenum kUniform3Type = GL_FLOAT_VEC3;
+ static const GLenum kUniform4Type = GL_UNSIGNED_INT;
+ static const GLenum kUniform5Type = GL_UNSIGNED_INT_VEC2;
+ static const GLenum kUniform6Type = GL_UNSIGNED_INT_VEC3;
+ static const GLenum kUniform7Type = GL_UNSIGNED_INT_VEC4;
static const GLenum kUniformSamplerExternalType = GL_SAMPLER_EXTERNAL_OES;
static const GLenum kUniformCubemapType = GL_SAMPLER_CUBE;
static const GLint kInvalidUniformLocation = 30;
diff --git a/chromium/gpu/command_buffer/service/gles2_cmd_decoder_unittest_context_state.cc b/chromium/gpu/command_buffer/service/gles2_cmd_decoder_unittest_context_state.cc
index 3578b5b0bc8..b1ddbbabedd 100644
--- a/chromium/gpu/command_buffer/service/gles2_cmd_decoder_unittest_context_state.cc
+++ b/chromium/gpu/command_buffer/service/gles2_cmd_decoder_unittest_context_state.cc
@@ -8,9 +8,6 @@
#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/async_pixel_transfer_delegate_mock.h"
-#include "gpu/command_buffer/service/async_pixel_transfer_manager.h"
-#include "gpu/command_buffer/service/async_pixel_transfer_manager_mock.h"
#include "gpu/command_buffer/service/cmd_buffer_engine.h"
#include "gpu/command_buffer/service/context_group.h"
#include "gpu/command_buffer/service/context_state.h"
diff --git a/chromium/gpu/command_buffer/service/gles2_cmd_decoder_unittest_drawing.cc b/chromium/gpu/command_buffer/service/gles2_cmd_decoder_unittest_drawing.cc
index 579e84b81e0..b2147ccdd91 100644
--- a/chromium/gpu/command_buffer/service/gles2_cmd_decoder_unittest_drawing.cc
+++ b/chromium/gpu/command_buffer/service/gles2_cmd_decoder_unittest_drawing.cc
@@ -8,9 +8,6 @@
#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/async_pixel_transfer_delegate_mock.h"
-#include "gpu/command_buffer/service/async_pixel_transfer_manager.h"
-#include "gpu/command_buffer/service/async_pixel_transfer_manager_mock.h"
#include "gpu/command_buffer/service/cmd_buffer_engine.h"
#include "gpu/command_buffer/service/context_group.h"
#include "gpu/command_buffer/service/context_state.h"
@@ -1030,6 +1027,10 @@ TEST_P(GLES2DecoderGeometryInstancingTest,
AddExpectationsForSimulatedAttrib0(kNumVertices, kServiceBufferId);
SetupExpectationsForApplyingDefaultDirtyState();
+ EXPECT_CALL(*gl_, VertexAttribDivisorANGLE(0, 0))
+ .Times(1)
+ .RetiresOnSaturation();
+
EXPECT_CALL(*gl_, DrawArraysInstancedANGLE(GL_TRIANGLES, 0, kNumVertices, 1))
.Times(1)
.RetiresOnSaturation();
@@ -1523,6 +1524,10 @@ TEST_P(GLES2DecoderGeometryInstancingTest,
AddExpectationsForSimulatedAttrib0(kMaxValidIndex + 1, kServiceBufferId);
SetupExpectationsForApplyingDefaultDirtyState();
+ EXPECT_CALL(*gl_, VertexAttribDivisorANGLE(0, 0))
+ .Times(1)
+ .RetiresOnSaturation();
+
EXPECT_CALL(
*gl_,
DrawElementsInstancedANGLE(GL_TRIANGLES,
@@ -1532,6 +1537,7 @@ TEST_P(GLES2DecoderGeometryInstancingTest,
1))
.Times(1)
.RetiresOnSaturation();
+
DrawElementsInstancedANGLE cmd;
cmd.Init(GL_TRIANGLES,
kValidIndexRangeCount,
diff --git a/chromium/gpu/command_buffer/service/gles2_cmd_decoder_unittest_extensions.cc b/chromium/gpu/command_buffer/service/gles2_cmd_decoder_unittest_extensions.cc
index f87a4bd24b5..916f2aa76b1 100644
--- a/chromium/gpu/command_buffer/service/gles2_cmd_decoder_unittest_extensions.cc
+++ b/chromium/gpu/command_buffer/service/gles2_cmd_decoder_unittest_extensions.cc
@@ -4,21 +4,134 @@
#include "gpu/command_buffer/service/gles2_cmd_decoder.h"
+#include "base/command_line.h"
#include "gpu/command_buffer/common/gles2_cmd_format.h"
#include "gpu/command_buffer/common/gles2_cmd_utils.h"
#include "gpu/command_buffer/service/gles2_cmd_decoder_unittest.h"
+#include "gpu/command_buffer/service/gpu_switches.h"
#include "testing/gtest/include/gtest/gtest.h"
#include "ui/gl/gl_mock.h"
using ::gfx::MockGLInterface;
using ::testing::_;
+using ::testing::Return;
namespace gpu {
namespace gles2 {
+// Class to use to test that functions which need feature flags or
+// extensions always return INVALID_OPERATION if the feature flags is not
+// enabled or extension is not present.
+class GLES2DecoderTestDisabledExtensions : public GLES2DecoderTest {
+ public:
+ GLES2DecoderTestDisabledExtensions() {}
+};
+INSTANTIATE_TEST_CASE_P(Service,
+ GLES2DecoderTestDisabledExtensions,
+ ::testing::Bool());
+
+TEST_P(GLES2DecoderTestDisabledExtensions, CHROMIUMPathRenderingDisabled) {
+ const GLuint kClientPathId = 0;
+ {
+ cmds::MatrixLoadfCHROMIUMImmediate& cmd =
+ *GetImmediateAs<cmds::MatrixLoadfCHROMIUMImmediate>();
+ GLfloat temp[16] = {
+ 0,
+ };
+ cmd.Init(GL_PATH_MODELVIEW_CHROMIUM, temp);
+ EXPECT_EQ(error::kNoError, ExecuteImmediateCmd(cmd, sizeof(temp)));
+ EXPECT_EQ(GL_INVALID_OPERATION, GetGLError());
+ }
+ {
+ cmds::MatrixLoadIdentityCHROMIUM cmd;
+ cmd.Init(GL_PATH_PROJECTION_CHROMIUM);
+ EXPECT_EQ(error::kNoError, ExecuteCmd(cmd));
+ EXPECT_EQ(GL_INVALID_OPERATION, GetGLError());
+ }
+ {
+ cmds::GenPathsCHROMIUM cmd;
+ cmd.Init(0, 0);
+ EXPECT_EQ(error::kNoError, ExecuteCmd(cmd));
+ EXPECT_EQ(GL_INVALID_OPERATION, GetGLError());
+ }
+ {
+ cmds::DeletePathsCHROMIUM cmd;
+ cmd.Init(0, 0);
+ EXPECT_EQ(error::kNoError, ExecuteCmd(cmd));
+ EXPECT_EQ(GL_INVALID_OPERATION, GetGLError());
+ }
+ {
+ cmds::IsPathCHROMIUM cmd;
+ cmd.Init(kClientPathId, shared_memory_id_, shared_memory_offset_);
+ EXPECT_EQ(error::kNoError, ExecuteCmd(cmd));
+ EXPECT_EQ(GL_INVALID_OPERATION, GetGLError());
+ }
+ {
+ cmds::PathCommandsCHROMIUM cmd;
+ cmd.Init(kClientPathId, 0, 0, 0, 0, GL_FLOAT, 0, 0);
+ EXPECT_EQ(error::kNoError, ExecuteCmd(cmd));
+ EXPECT_EQ(GL_INVALID_OPERATION, GetGLError());
+ }
+ {
+ cmds::PathParameterfCHROMIUM cmd;
+ cmd.Init(kClientPathId, GL_PATH_STROKE_WIDTH_CHROMIUM, 1.0f);
+ EXPECT_EQ(error::kNoError, ExecuteCmd(cmd));
+ EXPECT_EQ(GL_INVALID_OPERATION, GetGLError());
+ }
+ {
+ cmds::PathParameteriCHROMIUM cmd;
+ cmd.Init(kClientPathId, GL_PATH_STROKE_WIDTH_CHROMIUM, 1);
+ EXPECT_EQ(error::kNoError, ExecuteCmd(cmd));
+ EXPECT_EQ(GL_INVALID_OPERATION, GetGLError());
+ }
+ {
+ cmds::PathStencilFuncCHROMIUM cmd;
+ cmd.Init(GL_NEVER, 2, 3);
+ EXPECT_EQ(error::kNoError, ExecuteCmd(cmd));
+ EXPECT_EQ(GL_INVALID_OPERATION, GetGLError());
+ }
+ {
+ cmds::StencilFillPathCHROMIUM cmd;
+ cmd.Init(kClientPathId, GL_COUNT_UP_CHROMIUM, 1);
+ EXPECT_EQ(error::kNoError, ExecuteCmd(cmd));
+ EXPECT_EQ(GL_INVALID_OPERATION, GetGLError());
+ }
+ {
+ cmds::StencilStrokePathCHROMIUM cmd;
+ cmd.Init(kClientPathId, 1, 2);
+ EXPECT_EQ(error::kNoError, ExecuteCmd(cmd));
+ EXPECT_EQ(GL_INVALID_OPERATION, GetGLError());
+ }
+ {
+ cmds::CoverFillPathCHROMIUM cmd;
+ cmd.Init(kClientPathId, GL_BOUNDING_BOX_CHROMIUM);
+ EXPECT_EQ(error::kNoError, ExecuteCmd(cmd));
+ EXPECT_EQ(GL_INVALID_OPERATION, GetGLError());
+ }
+ {
+ cmds::CoverStrokePathCHROMIUM cmd;
+ cmd.Init(kClientPathId, GL_BOUNDING_BOX_CHROMIUM);
+ EXPECT_EQ(error::kNoError, ExecuteCmd(cmd));
+ EXPECT_EQ(GL_INVALID_OPERATION, GetGLError());
+ }
+ {
+ cmds::StencilThenCoverFillPathCHROMIUM cmd;
+ cmd.Init(kClientPathId, GL_COUNT_UP_CHROMIUM, 1, GL_BOUNDING_BOX_CHROMIUM);
+ EXPECT_EQ(error::kNoError, ExecuteCmd(cmd));
+ EXPECT_EQ(GL_INVALID_OPERATION, GetGLError());
+ }
+ {
+ cmds::StencilThenCoverStrokePathCHROMIUM cmd;
+ cmd.Init(kClientPathId, 1, 2, GL_BOUNDING_BOX_CHROMIUM);
+ EXPECT_EQ(error::kNoError, ExecuteCmd(cmd));
+ EXPECT_EQ(GL_INVALID_OPERATION, GetGLError());
+ }
+}
+
class GLES2DecoderTestWithCHROMIUMPathRendering : public GLES2DecoderTest {
public:
- GLES2DecoderTestWithCHROMIUMPathRendering() {}
+ GLES2DecoderTestWithCHROMIUMPathRendering() : client_path_id_(125) {}
+
void SetUp() override {
InitState init;
init.gl_version = "opengl es 3.1";
@@ -28,8 +141,24 @@ class GLES2DecoderTestWithCHROMIUMPathRendering : public GLES2DecoderTest {
init.request_depth = true;
init.bind_generates_resource = true;
init.extensions = "GL_NV_path_rendering";
- InitDecoder(init);
+ base::CommandLine command_line(0, NULL);
+ command_line.AppendSwitch(switches::kEnableGLPathRendering);
+ InitDecoderWithCommandLine(init, &command_line);
+
+ EXPECT_CALL(*gl_, GenPathsNV(1))
+ .WillOnce(Return(kServicePathId))
+ .RetiresOnSaturation();
+ cmds::GenPathsCHROMIUM cmd;
+ cmd.Init(client_path_id_, 1);
+ EXPECT_EQ(error::kNoError, ExecuteCmd(cmd));
}
+
+ protected:
+ template <typename TypeParam>
+ void TestPathCommandsCHROMIUMCoordTypes();
+
+ GLuint client_path_id_;
+ static const GLuint kServicePathId = 311;
};
INSTANTIATE_TEST_CASE_P(Service,
@@ -56,6 +185,814 @@ INSTANTIATE_TEST_CASE_P(Service,
GLES2DecoderTestWithBlendEquationAdvanced,
::testing::Bool());
+TEST_P(GLES2DecoderTestWithCHROMIUMPathRendering, GenDeletePaths) {
+ static GLuint kFirstClientID = client_path_id_ + 88;
+ static GLsizei kPathCount = 58;
+ static GLuint kFirstCreatedServiceID = 8000;
+
+ // GenPaths range 0 causes no calls.
+ cmds::GenPathsCHROMIUM gen_cmd;
+ gen_cmd.Init(kFirstClientID, 0);
+ EXPECT_EQ(error::kNoError, ExecuteCmd(gen_cmd));
+ EXPECT_EQ(GL_NO_ERROR, GetGLError());
+
+ // DeletePaths range 0 causes no calls.
+ cmds::DeletePathsCHROMIUM delete_cmd;
+ delete_cmd.Init(kFirstClientID, 0);
+ EXPECT_EQ(error::kNoError, ExecuteCmd(delete_cmd));
+ EXPECT_EQ(GL_NO_ERROR, GetGLError());
+
+ // DeletePaths client 0 causes no calls and no errors.
+ delete_cmd.Init(0, 1);
+ EXPECT_EQ(error::kNoError, ExecuteCmd(delete_cmd));
+ EXPECT_EQ(GL_NO_ERROR, GetGLError());
+
+ // DeletePaths with a big range should not cause any deletes.
+ delete_cmd.Init(client_path_id_ + 1,
+ std::numeric_limits<GLsizei>::max() - client_path_id_ - 1);
+ EXPECT_EQ(error::kNoError, ExecuteCmd(delete_cmd));
+ EXPECT_EQ(GL_NO_ERROR, GetGLError());
+
+ delete_cmd.Init(std::numeric_limits<GLsizei>::max() + 1,
+ std::numeric_limits<GLsizei>::max());
+ EXPECT_EQ(error::kNoError, ExecuteCmd(delete_cmd));
+ EXPECT_EQ(GL_NO_ERROR, GetGLError());
+
+ // Normal Gen and Delete should cause the normal calls.
+ EXPECT_CALL(*gl_, GenPathsNV(kPathCount))
+ .WillOnce(Return(kFirstCreatedServiceID))
+ .RetiresOnSaturation();
+
+ gen_cmd.Init(kFirstClientID, kPathCount);
+ EXPECT_EQ(error::kNoError, ExecuteCmd(gen_cmd));
+ EXPECT_EQ(GL_NO_ERROR, GetGLError());
+
+ EXPECT_CALL(*gl_, DeletePathsNV(kFirstCreatedServiceID, kPathCount))
+ .RetiresOnSaturation();
+
+ delete_cmd.Init(kFirstClientID, kPathCount);
+ EXPECT_EQ(error::kNoError, ExecuteCmd(delete_cmd));
+ EXPECT_EQ(GL_NO_ERROR, GetGLError());
+}
+
+TEST_P(GLES2DecoderTestWithCHROMIUMPathRendering, GenDeleteRanges) {
+ static GLuint kFirstClientID = client_path_id_ + 77;
+ static GLsizei kPathCount = 5800;
+ static GLuint kFirstCreatedServiceID = 8000;
+
+ // Create a range of path names, delete one in middle and then
+ // the rest. Expect 3 DeletePath calls.
+ EXPECT_CALL(*gl_, GenPathsNV(kPathCount))
+ .WillOnce(Return(kFirstCreatedServiceID))
+ .RetiresOnSaturation();
+ cmds::GenPathsCHROMIUM gen_cmd;
+ gen_cmd.Init(kFirstClientID, kPathCount);
+ EXPECT_EQ(error::kNoError, ExecuteCmd(gen_cmd));
+ EXPECT_EQ(GL_NO_ERROR, GetGLError());
+
+ EXPECT_CALL(*gl_, DeletePathsNV(kFirstCreatedServiceID + (kPathCount / 2), 1))
+ .RetiresOnSaturation();
+
+ cmds::DeletePathsCHROMIUM delete_cmd;
+ delete_cmd.Init(kFirstClientID + (kPathCount / 2), 1);
+ EXPECT_EQ(error::kNoError, ExecuteCmd(delete_cmd));
+ EXPECT_EQ(GL_NO_ERROR, GetGLError());
+
+ EXPECT_CALL(*gl_, DeletePathsNV(kFirstCreatedServiceID, (kPathCount / 2)))
+ .RetiresOnSaturation();
+ EXPECT_CALL(*gl_, DeletePathsNV(kFirstCreatedServiceID + (kPathCount / 2) + 1,
+ (kPathCount / 2) - 1)).RetiresOnSaturation();
+
+ delete_cmd.Init(kFirstClientID, kPathCount);
+ EXPECT_EQ(error::kNoError, ExecuteCmd(delete_cmd));
+ EXPECT_EQ(GL_NO_ERROR, GetGLError());
+}
+
+TEST_P(GLES2DecoderTestWithCHROMIUMPathRendering, GenDeleteManyPaths) {
+ static GLuint kFirstClientID = client_path_id_ + 1;
+ static GLsizei kPathCount = std::numeric_limits<GLsizei>::max();
+ static GLuint kFirstCreatedServiceID = 8000;
+
+ EXPECT_CALL(*gl_, GenPathsNV(kPathCount))
+ .WillOnce(Return(kFirstCreatedServiceID))
+ .RetiresOnSaturation();
+
+ // GenPaths with big range.
+ cmds::GenPathsCHROMIUM gen_cmd;
+ gen_cmd.Init(kFirstClientID, kPathCount);
+ EXPECT_EQ(error::kNoError, ExecuteCmd(gen_cmd));
+ EXPECT_EQ(GL_NO_ERROR, GetGLError());
+
+ // Path range wraps, so we get connection error.
+ gen_cmd.Init(kFirstClientID + kPathCount, kPathCount);
+ EXPECT_EQ(error::kInvalidArguments, ExecuteCmd(gen_cmd));
+ EXPECT_EQ(GL_NO_ERROR, GetGLError());
+
+ EXPECT_CALL(*gl_, DeletePathsNV(kFirstCreatedServiceID, kPathCount))
+ .RetiresOnSaturation();
+
+ cmds::DeletePathsCHROMIUM delete_cmd;
+ delete_cmd.Init(kFirstClientID, kPathCount);
+ EXPECT_EQ(error::kNoError, ExecuteCmd(delete_cmd));
+ EXPECT_EQ(GL_NO_ERROR, GetGLError());
+
+ // Delete every possible path.
+ // We run into the one created for client_path_id_.
+ EXPECT_CALL(*gl_, DeletePathsNV(kServicePathId, 1)).RetiresOnSaturation();
+
+ delete_cmd.Init(1u, kPathCount);
+ EXPECT_EQ(error::kNoError, ExecuteCmd(delete_cmd));
+ EXPECT_EQ(GL_NO_ERROR, GetGLError());
+
+ delete_cmd.Init(static_cast<GLuint>(kPathCount) + 1u, kPathCount);
+ EXPECT_EQ(error::kNoError, ExecuteCmd(delete_cmd));
+ EXPECT_EQ(GL_NO_ERROR, GetGLError());
+
+ // Allocate every possible path, delete few, allocate them back and
+ // expect minimum amount of calls.
+ EXPECT_CALL(*gl_, GenPathsNV(kPathCount))
+ .WillOnce(Return(static_cast<GLuint>(1u)))
+ .WillOnce(Return(static_cast<GLuint>(kPathCount) + 1u))
+ .RetiresOnSaturation();
+
+ gen_cmd.Init(1u, kPathCount);
+ EXPECT_EQ(error::kNoError, ExecuteCmd(gen_cmd));
+ EXPECT_EQ(GL_NO_ERROR, GetGLError());
+
+ gen_cmd.Init(static_cast<GLuint>(kPathCount) + 1u, kPathCount);
+ EXPECT_EQ(error::kNoError, ExecuteCmd(gen_cmd));
+ EXPECT_EQ(GL_NO_ERROR, GetGLError());
+
+ gen_cmd.Init(static_cast<GLuint>(kPathCount) * 2u + 2u, kPathCount);
+ EXPECT_EQ(error::kInvalidArguments, ExecuteCmd(gen_cmd));
+ EXPECT_EQ(GL_NO_ERROR, GetGLError());
+
+ EXPECT_CALL(*gl_, DeletePathsNV(kFirstClientID, 4)).RetiresOnSaturation();
+
+ delete_cmd.Init(kFirstClientID, 4);
+ EXPECT_EQ(error::kNoError, ExecuteCmd(delete_cmd));
+ EXPECT_EQ(GL_NO_ERROR, GetGLError());
+
+ EXPECT_CALL(*gl_, DeletePathsNV(kFirstClientID * 3, 1)).RetiresOnSaturation();
+
+ delete_cmd.Init(kFirstClientID * 3, 1);
+ EXPECT_EQ(error::kNoError, ExecuteCmd(delete_cmd));
+ EXPECT_EQ(GL_NO_ERROR, GetGLError());
+
+ EXPECT_CALL(*gl_, GenPathsNV(1))
+ .WillOnce(Return(kFirstClientID))
+ .WillOnce(Return(kFirstClientID + 1))
+ .WillOnce(Return(kFirstClientID + 2))
+ .WillOnce(Return(kFirstClientID + 3))
+ .RetiresOnSaturation();
+
+ for (int i = 0; i < 4; ++i) {
+ gen_cmd.Init(kFirstClientID + i, 1);
+ EXPECT_EQ(error::kNoError, ExecuteCmd(gen_cmd));
+ EXPECT_EQ(GL_NO_ERROR, GetGLError());
+ }
+
+ EXPECT_CALL(*gl_, GenPathsNV(1))
+ .WillOnce(Return(kFirstClientID * 3))
+ .RetiresOnSaturation();
+ gen_cmd.Init(kFirstClientID * 3, 1);
+ EXPECT_EQ(error::kNoError, ExecuteCmd(gen_cmd));
+ EXPECT_EQ(GL_NO_ERROR, GetGLError());
+
+ EXPECT_CALL(*gl_, DeletePathsNV(1u, kPathCount)).RetiresOnSaturation();
+ EXPECT_CALL(*gl_, DeletePathsNV(static_cast<GLuint>(kPathCount) + 1u,
+ kPathCount)).RetiresOnSaturation();
+
+ delete_cmd.Init(1u, kPathCount);
+ EXPECT_EQ(error::kNoError, ExecuteCmd(delete_cmd));
+ EXPECT_EQ(GL_NO_ERROR, GetGLError());
+
+ delete_cmd.Init(static_cast<GLuint>(kPathCount) + 1u, kPathCount);
+ EXPECT_EQ(error::kNoError, ExecuteCmd(delete_cmd));
+ EXPECT_EQ(GL_NO_ERROR, GetGLError());
+
+ // Cleanup: return the client_path_id_ as a path.
+ EXPECT_CALL(*gl_, GenPathsNV(1))
+ .WillOnce(Return(static_cast<GLuint>(kServicePathId)))
+ .RetiresOnSaturation();
+
+ gen_cmd.Init(client_path_id_, 1);
+ EXPECT_EQ(error::kNoError, ExecuteCmd(gen_cmd));
+ EXPECT_EQ(GL_NO_ERROR, GetGLError());
+}
+
+TEST_P(GLES2DecoderTestWithCHROMIUMPathRendering,
+ GenPathsCHROMIUMInvalidCalls) {
+ static GLuint kFirstClientID = client_path_id_ + 88;
+ static GLsizei kPathCount = 5800;
+ static GLuint kFirstCreatedServiceID = 8000;
+
+ // Range < 0 is causes gl error.
+ cmds::GenPathsCHROMIUM gen_cmd;
+ gen_cmd.Init(kFirstClientID, -1);
+ EXPECT_EQ(error::kNoError, ExecuteCmd(gen_cmd));
+ EXPECT_EQ(GL_INVALID_VALUE, GetGLError());
+
+ // Path 0 is invalid client id, connection error.
+ gen_cmd.Init(0, kPathCount);
+ EXPECT_EQ(error::kInvalidArguments, ExecuteCmd(gen_cmd));
+ EXPECT_EQ(GL_NO_ERROR, GetGLError());
+
+ // Too big range causes client id to wrap, connection error.
+ gen_cmd.Init(std::numeric_limits<GLsizei>::max() + 3,
+ std::numeric_limits<GLsizei>::max());
+ EXPECT_EQ(error::kInvalidArguments, ExecuteCmd(gen_cmd));
+ EXPECT_EQ(GL_NO_ERROR, GetGLError());
+
+ // Creating duplicate client_ids cause connection error.
+ EXPECT_CALL(*gl_, GenPathsNV(kPathCount))
+ .WillOnce(Return(kFirstCreatedServiceID))
+ .RetiresOnSaturation();
+
+ gen_cmd.Init(kFirstClientID, kPathCount);
+ EXPECT_EQ(error::kNoError, ExecuteCmd(gen_cmd));
+ EXPECT_EQ(GL_NO_ERROR, GetGLError());
+
+ // Create duplicate by executing the same cmd.
+ EXPECT_EQ(error::kInvalidArguments, ExecuteCmd(gen_cmd));
+ EXPECT_EQ(GL_NO_ERROR, GetGLError());
+
+ // Create duplicate by creating a range that contains
+ // an already existing client path id.
+ gen_cmd.Init(kFirstClientID - 1, 2);
+ EXPECT_EQ(error::kInvalidArguments, ExecuteCmd(gen_cmd));
+ EXPECT_EQ(GL_NO_ERROR, GetGLError());
+
+ // Cleanup.
+ EXPECT_CALL(*gl_, DeletePathsNV(kFirstCreatedServiceID, kPathCount))
+ .RetiresOnSaturation();
+ cmds::DeletePathsCHROMIUM delete_cmd;
+ delete_cmd.Init(kFirstClientID, kPathCount);
+ EXPECT_EQ(error::kNoError, ExecuteCmd(delete_cmd));
+ EXPECT_EQ(GL_NO_ERROR, GetGLError());
+}
+
+TEST_P(GLES2DecoderTestWithCHROMIUMPathRendering,
+ DeletePathsCHROMIUMInvalidCalls) {
+ static GLuint kFirstClientID = client_path_id_ + 88;
+
+ // Range < 0 is causes gl error.
+ cmds::DeletePathsCHROMIUM delete_cmd;
+ delete_cmd.Init(kFirstClientID, -1);
+ EXPECT_EQ(error::kNoError, ExecuteCmd(delete_cmd));
+ EXPECT_EQ(GL_INVALID_VALUE, GetGLError());
+
+ // Too big range causes client id to wrap, connection error.
+ delete_cmd.Init(std::numeric_limits<GLsizei>::max() + 3,
+ std::numeric_limits<GLsizei>::max());
+ EXPECT_EQ(error::kInvalidArguments, ExecuteCmd(delete_cmd));
+ EXPECT_EQ(GL_NO_ERROR, GetGLError());
+}
+
+TEST_P(GLES2DecoderTestWithCHROMIUMPathRendering,
+ PathCommandsCHROMIUMInvalidCalls) {
+ static const GLsizei kCorrectCoordCount = 19;
+ static const GLsizei kCorrectCommandCount = 6;
+ static const GLenum kInvalidCoordType = GL_NONE;
+
+ GLfloat* coords = GetSharedMemoryAs<GLfloat*>();
+ unsigned commands_offset = sizeof(GLfloat) * kCorrectCoordCount;
+ GLubyte* commands = GetSharedMemoryAsWithOffset<GLubyte*>(commands_offset);
+ for (int i = 0; i < kCorrectCoordCount; ++i) {
+ coords[i] = 5.0f * i;
+ }
+ commands[0] = GL_MOVE_TO_CHROMIUM;
+ commands[1] = GL_CLOSE_PATH_CHROMIUM;
+ commands[2] = GL_LINE_TO_CHROMIUM;
+ commands[3] = GL_QUADRATIC_CURVE_TO_CHROMIUM;
+ commands[4] = GL_CUBIC_CURVE_TO_CHROMIUM;
+ commands[5] = GL_CONIC_CURVE_TO_CHROMIUM;
+
+ EXPECT_CALL(*gl_, PathCommandsNV(kServicePathId, kCorrectCommandCount,
+ commands, kCorrectCoordCount, GL_FLOAT,
+ coords)).RetiresOnSaturation();
+
+ cmds::PathCommandsCHROMIUM cmd;
+
+ // Reference call -- this succeeds.
+ cmd.Init(client_path_id_, kCorrectCommandCount, shared_memory_id_,
+ shared_memory_offset_ + commands_offset, kCorrectCoordCount,
+ GL_FLOAT, shared_memory_id_, shared_memory_offset_);
+ EXPECT_EQ(error::kNoError, ExecuteCmd(cmd));
+ EXPECT_EQ(GL_NO_ERROR, GetGLError());
+
+ EXPECT_CALL(*gl_, PathCommandsNV(_, _, _, _, _, _)).Times(0);
+
+ // Invalid client id fails.
+ cmd.Init(client_path_id_ - 1, kCorrectCommandCount, shared_memory_id_,
+ shared_memory_offset_, kCorrectCoordCount, GL_FLOAT,
+ shared_memory_id_, shared_memory_offset_);
+ EXPECT_EQ(error::kNoError, ExecuteCmd(cmd));
+ EXPECT_EQ(GL_INVALID_OPERATION, GetGLError());
+
+ // The numCommands < 0.
+ cmd.Init(client_path_id_, -1, shared_memory_id_, shared_memory_offset_,
+ kCorrectCoordCount, GL_FLOAT, shared_memory_id_,
+ shared_memory_offset_);
+ EXPECT_EQ(error::kNoError, ExecuteCmd(cmd));
+ EXPECT_EQ(GL_INVALID_VALUE, GetGLError());
+
+ // The numCoords < 0.
+ cmd.Init(client_path_id_, kCorrectCommandCount, shared_memory_id_,
+ shared_memory_offset_, -1, GL_FLOAT, shared_memory_id_,
+ shared_memory_offset_);
+ EXPECT_EQ(error::kNoError, ExecuteCmd(cmd));
+ EXPECT_EQ(GL_INVALID_VALUE, GetGLError());
+
+ // Invalid coordType fails.
+ cmd.Init(client_path_id_, kCorrectCommandCount, shared_memory_id_,
+ shared_memory_offset_, kCorrectCoordCount, kInvalidCoordType,
+ shared_memory_id_, shared_memory_offset_);
+ EXPECT_EQ(error::kNoError, ExecuteCmd(cmd));
+ EXPECT_EQ(GL_INVALID_ENUM, GetGLError());
+
+ // Big command counts.
+ cmd.Init(client_path_id_, std::numeric_limits<GLsizei>::max(),
+ shared_memory_id_, shared_memory_offset_ + commands_offset,
+ kCorrectCoordCount, GL_FLOAT, shared_memory_id_,
+ shared_memory_offset_);
+ EXPECT_EQ(error::kOutOfBounds, ExecuteCmd(cmd));
+ EXPECT_EQ(GL_NO_ERROR, GetGLError());
+
+ // Invalid SHM cases.
+ cmd.Init(client_path_id_, kCorrectCommandCount, kInvalidSharedMemoryId,
+ shared_memory_offset_ + commands_offset, kCorrectCoordCount,
+ GL_FLOAT, shared_memory_id_, shared_memory_offset_);
+ EXPECT_EQ(error::kOutOfBounds, ExecuteCmd(cmd));
+ EXPECT_EQ(GL_NO_ERROR, GetGLError());
+
+ cmd.Init(client_path_id_, kCorrectCommandCount, shared_memory_id_,
+ kInvalidSharedMemoryOffset, kCorrectCoordCount, GL_FLOAT,
+ shared_memory_id_, shared_memory_offset_);
+ EXPECT_EQ(error::kOutOfBounds, ExecuteCmd(cmd));
+ EXPECT_EQ(GL_NO_ERROR, GetGLError());
+
+ cmd.Init(client_path_id_, kCorrectCommandCount, shared_memory_id_,
+ shared_memory_offset_ + commands_offset, kCorrectCoordCount,
+ GL_FLOAT, kInvalidSharedMemoryId, shared_memory_offset_);
+ EXPECT_EQ(error::kOutOfBounds, ExecuteCmd(cmd));
+ EXPECT_EQ(GL_NO_ERROR, GetGLError());
+
+ cmd.Init(client_path_id_, kCorrectCommandCount, shared_memory_id_,
+ shared_memory_offset_ + commands_offset, kCorrectCoordCount,
+ GL_FLOAT, shared_memory_id_, kInvalidSharedMemoryOffset);
+ EXPECT_EQ(error::kOutOfBounds, ExecuteCmd(cmd));
+ EXPECT_EQ(GL_NO_ERROR, GetGLError());
+
+ // NULL shm command id with non-zero command count.
+ cmd.Init(client_path_id_, kCorrectCommandCount, 0, 0, kCorrectCoordCount,
+ GL_FLOAT, shared_memory_id_, shared_memory_offset_);
+ EXPECT_EQ(error::kOutOfBounds, ExecuteCmd(cmd));
+ EXPECT_EQ(GL_NO_ERROR, GetGLError());
+
+ // NULL shm coord id with non-zero coord count.
+ cmd.Init(client_path_id_, kCorrectCommandCount, shared_memory_id_,
+ shared_memory_offset_ + commands_offset, kCorrectCoordCount,
+ GL_FLOAT, 0, 0);
+ EXPECT_EQ(error::kOutOfBounds, ExecuteCmd(cmd));
+ EXPECT_EQ(GL_NO_ERROR, GetGLError());
+
+ // The coordCount not matching what is in commands.
+ // Expects kCorrectCoordCount+2 coords.
+ commands[1] = GL_MOVE_TO_CHROMIUM;
+ cmd.Init(client_path_id_, kCorrectCommandCount, shared_memory_id_,
+ shared_memory_offset_ + commands_offset, kCorrectCoordCount,
+ GL_FLOAT, shared_memory_id_, shared_memory_offset_);
+ EXPECT_EQ(error::kNoError, ExecuteCmd(cmd));
+ EXPECT_EQ(GL_INVALID_OPERATION, GetGLError());
+
+ // The coordCount not matching what is in commands.
+ // Expects kCorrectCoordCount-2 coords.
+ commands[0] = GL_CLOSE_PATH_CHROMIUM;
+ commands[1] = GL_CLOSE_PATH_CHROMIUM;
+ EXPECT_EQ(error::kNoError, ExecuteCmd(cmd));
+ EXPECT_EQ(GL_INVALID_OPERATION, GetGLError());
+
+ // NULL shm coord ids. Currently causes gl error, though client should not let
+ // this through.
+ cmd.Init(client_path_id_, kCorrectCommandCount, shared_memory_id_,
+ shared_memory_offset_ + commands_offset, kCorrectCoordCount,
+ GL_FLOAT, 0, 0);
+ EXPECT_EQ(error::kNoError, ExecuteCmd(cmd));
+ EXPECT_EQ(GL_INVALID_OPERATION, GetGLError());
+}
+
+TEST_P(GLES2DecoderTestWithCHROMIUMPathRendering,
+ PathCommandsCHROMIUMEmptyCommands) {
+ EXPECT_CALL(*gl_, PathCommandsNV(kServicePathId, 0, NULL, 0, GL_FLOAT, NULL))
+ .RetiresOnSaturation();
+ cmds::PathCommandsCHROMIUM cmd;
+ cmd.Init(client_path_id_, 0, 0, 0, 0, GL_FLOAT, 0, 0);
+ EXPECT_EQ(error::kNoError, ExecuteCmd(cmd));
+ EXPECT_EQ(GL_NO_ERROR, GetGLError());
+}
+
+TEST_P(GLES2DecoderTestWithCHROMIUMPathRendering,
+ PathCommandsCHROMIUMInvalidCommands) {
+ EXPECT_CALL(*gl_, PathCommandsNV(_, _, _, _, _, _)).Times(0);
+
+ cmds::PathCommandsCHROMIUM cmd;
+
+ {
+ const GLsizei kCoordCount = 2;
+ const GLsizei kCommandCount = 2;
+ GLfloat* coords = GetSharedMemoryAs<GLfloat*>();
+ unsigned commands_offset = sizeof(GLfloat) * kCoordCount;
+ GLubyte* commands = GetSharedMemoryAsWithOffset<GLubyte*>(commands_offset);
+
+ coords[0] = 5.0f;
+ coords[1] = 5.0f;
+ commands[0] = 0x3; // Token MOVE_TO_RELATIVE in NV_path_rendering.
+ commands[1] = GL_CLOSE_PATH_CHROMIUM;
+
+ cmd.Init(client_path_id_ - 1, kCommandCount, shared_memory_id_,
+ shared_memory_offset_, kCoordCount, GL_FLOAT, shared_memory_id_,
+ shared_memory_offset_);
+ EXPECT_EQ(error::kNoError, ExecuteCmd(cmd));
+ EXPECT_EQ(GL_INVALID_OPERATION, GetGLError());
+ }
+ {
+ const GLsizei kCoordCount = 8;
+ const GLsizei kCommandCount = 4;
+ GLfloat* coords = GetSharedMemoryAs<GLfloat*>();
+ unsigned commands_offset = sizeof(GLfloat) * kCoordCount;
+ GLubyte* commands = GetSharedMemoryAsWithOffset<GLubyte*>(commands_offset);
+
+ for (int i = 0; i < kCoordCount; ++i) {
+ coords[i] = 5.0f * i;
+ }
+ commands[0] = GL_MOVE_TO_CHROMIUM;
+ commands[1] = GL_MOVE_TO_CHROMIUM;
+ commands[2] = 'M'; // Synonym to MOVE_TO in NV_path_rendering.
+ commands[3] = GL_MOVE_TO_CHROMIUM;
+
+ cmd.Init(client_path_id_ - 1, kCommandCount, shared_memory_id_,
+ shared_memory_offset_, kCoordCount, GL_FLOAT, shared_memory_id_,
+ shared_memory_offset_);
+ EXPECT_EQ(error::kNoError, ExecuteCmd(cmd));
+ EXPECT_EQ(GL_INVALID_OPERATION, GetGLError());
+ }
+}
+
+TEST_P(GLES2DecoderTestWithCHROMIUMPathRendering, PathParameterXCHROMIUM) {
+ static GLuint kFirstClientID = client_path_id_ + 88;
+ static GLsizei kPathCount = 2;
+ static GLuint kFirstCreatedServiceID = 8000;
+
+ // Create a paths so that we do not modify client_path_id_
+ EXPECT_CALL(*gl_, GenPathsNV(kPathCount))
+ .WillOnce(Return(kFirstCreatedServiceID))
+ .RetiresOnSaturation();
+ cmds::GenPathsCHROMIUM gen_cmd;
+ gen_cmd.Init(kFirstClientID, kPathCount);
+ EXPECT_EQ(error::kNoError, ExecuteCmd(gen_cmd));
+ EXPECT_EQ(GL_NO_ERROR, GetGLError());
+
+ cmds::PathParameterfCHROMIUM fcmd;
+ cmds::PathParameteriCHROMIUM icmd;
+ const struct {
+ GLenum pname;
+ GLfloat value;
+ GLfloat expected_value;
+ } kTestcases[] = {
+ {GL_PATH_STROKE_WIDTH_CHROMIUM, 1.0f, 1.0f},
+ {GL_PATH_STROKE_WIDTH_CHROMIUM, 0.0f, 0.0f},
+ {GL_PATH_MITER_LIMIT_CHROMIUM, 500.0f, 500.0f},
+ {GL_PATH_STROKE_BOUND_CHROMIUM, .80f, .80f},
+ {GL_PATH_STROKE_BOUND_CHROMIUM, 1.80f, 1.0f},
+ {GL_PATH_STROKE_BOUND_CHROMIUM, -1.0f, 0.0f},
+ {GL_PATH_END_CAPS_CHROMIUM, GL_FLAT_CHROMIUM, GL_FLAT_CHROMIUM},
+ {GL_PATH_END_CAPS_CHROMIUM, GL_SQUARE_CHROMIUM, GL_SQUARE_CHROMIUM},
+ {GL_PATH_JOIN_STYLE_CHROMIUM,
+ GL_MITER_REVERT_CHROMIUM,
+ GL_MITER_REVERT_CHROMIUM},
+ };
+
+ for (auto& testcase : kTestcases) {
+ EXPECT_CALL(*gl_, PathParameterfNV(kFirstCreatedServiceID, testcase.pname,
+ testcase.expected_value))
+ .Times(1)
+ .RetiresOnSaturation();
+ fcmd.Init(kFirstClientID, testcase.pname, testcase.value);
+ EXPECT_EQ(error::kNoError, ExecuteCmd(fcmd));
+ EXPECT_EQ(GL_NO_ERROR, GetGLError());
+
+ EXPECT_CALL(*gl_,
+ PathParameteriNV(kFirstCreatedServiceID + 1, testcase.pname,
+ static_cast<GLint>(testcase.expected_value)))
+ .Times(1)
+ .RetiresOnSaturation();
+ icmd.Init(kFirstClientID + 1, testcase.pname,
+ static_cast<GLint>(testcase.value));
+ EXPECT_EQ(error::kNoError, ExecuteCmd(icmd));
+ EXPECT_EQ(GL_NO_ERROR, GetGLError());
+ }
+
+ // Cleanup.
+ EXPECT_CALL(*gl_, DeletePathsNV(kFirstCreatedServiceID, kPathCount))
+ .RetiresOnSaturation();
+
+ cmds::DeletePathsCHROMIUM delete_cmd;
+ delete_cmd.Init(kFirstClientID, kPathCount);
+ EXPECT_EQ(error::kNoError, ExecuteCmd(delete_cmd));
+ EXPECT_EQ(GL_NO_ERROR, GetGLError());
+}
+
+TEST_P(GLES2DecoderTestWithCHROMIUMPathRendering,
+ PathParameterXCHROMIUMInvalidArgs) {
+ static GLuint kFirstClientID = client_path_id_ + 88;
+ static GLsizei kPathCount = 2;
+ static GLuint kFirstCreatedServiceID = 8000;
+
+ // Create a paths so that we do not modify client_path_id_
+ EXPECT_CALL(*gl_, GenPathsNV(kPathCount))
+ .WillOnce(Return(kFirstCreatedServiceID))
+ .RetiresOnSaturation();
+ cmds::GenPathsCHROMIUM gen_cmd;
+ gen_cmd.Init(kFirstClientID, kPathCount);
+ EXPECT_EQ(error::kNoError, ExecuteCmd(gen_cmd));
+ EXPECT_EQ(GL_NO_ERROR, GetGLError());
+
+ cmds::PathParameterfCHROMIUM fcmd;
+ cmds::PathParameteriCHROMIUM icmd;
+ const struct {
+ GLenum pname;
+ GLfloat value;
+ bool try_int_version;
+ GLint error;
+ } kTestcases[] = {
+ {GL_PATH_STROKE_WIDTH_CHROMIUM, -1.0f, true, GL_INVALID_VALUE},
+ {GL_PATH_MITER_LIMIT_CHROMIUM,
+ std::numeric_limits<float>::infinity(),
+ false,
+ GL_INVALID_VALUE},
+ {GL_PATH_MITER_LIMIT_CHROMIUM,
+ std::numeric_limits<float>::quiet_NaN(),
+ false,
+ GL_INVALID_VALUE},
+ {GL_PATH_END_CAPS_CHROMIUM, 0x4, true, GL_INVALID_VALUE},
+ {GL_PATH_END_CAPS_CHROMIUM,
+ GL_MITER_REVERT_CHROMIUM,
+ true,
+ GL_INVALID_VALUE},
+ {GL_PATH_JOIN_STYLE_CHROMIUM, GL_FLAT_CHROMIUM, true, GL_INVALID_VALUE},
+ {GL_PATH_MODELVIEW_CHROMIUM, GL_FLAT_CHROMIUM, true, GL_INVALID_ENUM},
+ };
+
+ EXPECT_CALL(*gl_, PathParameterfNV(_, _, _)).Times(0);
+ EXPECT_CALL(*gl_, PathParameteriNV(_, _, _)).Times(0);
+
+ for (auto& testcase : kTestcases) {
+ fcmd.Init(kFirstClientID, testcase.pname, testcase.value);
+ EXPECT_EQ(error::kNoError, ExecuteCmd(fcmd));
+ EXPECT_EQ(testcase.error, GetGLError());
+ if (!testcase.try_int_version)
+ continue;
+
+ icmd.Init(kFirstClientID + 1, testcase.pname,
+ static_cast<GLint>(testcase.value));
+ EXPECT_EQ(error::kNoError, ExecuteCmd(icmd));
+ EXPECT_EQ(testcase.error, GetGLError());
+ }
+
+ // Cleanup.
+ EXPECT_CALL(*gl_, DeletePathsNV(kFirstCreatedServiceID, kPathCount))
+ .RetiresOnSaturation();
+
+ cmds::DeletePathsCHROMIUM delete_cmd;
+ delete_cmd.Init(kFirstClientID, kPathCount);
+ EXPECT_EQ(error::kNoError, ExecuteCmd(delete_cmd));
+ EXPECT_EQ(GL_NO_ERROR, GetGLError());
+}
+
+TEST_P(GLES2DecoderTestWithCHROMIUMPathRendering, StencilFillPathCHROMIUM) {
+ SetupExpectationsForApplyingDefaultDirtyState();
+
+ cmds::StencilFillPathCHROMIUM cmd;
+ cmds::StencilThenCoverFillPathCHROMIUM tcmd;
+
+ static const GLenum kFillModes[] = {
+ GL_INVERT, GL_COUNT_UP_CHROMIUM, GL_COUNT_DOWN_CHROMIUM};
+ static const GLuint kMask = 0x7F;
+
+ for (auto& fill_mode : kFillModes) {
+ EXPECT_CALL(*gl_, StencilFillPathNV(kServicePathId, fill_mode, kMask))
+ .RetiresOnSaturation();
+ cmd.Init(client_path_id_, fill_mode, kMask);
+ EXPECT_EQ(error::kNoError, ExecuteCmd(cmd));
+ EXPECT_EQ(GL_NO_ERROR, GetGLError());
+
+ EXPECT_CALL(*gl_, StencilThenCoverFillPathNV(kServicePathId, fill_mode,
+ kMask, GL_BOUNDING_BOX_NV))
+ .RetiresOnSaturation();
+ tcmd.Init(client_path_id_, fill_mode, kMask, GL_BOUNDING_BOX_CHROMIUM);
+ EXPECT_EQ(error::kNoError, ExecuteCmd(tcmd));
+ EXPECT_EQ(GL_NO_ERROR, GetGLError());
+ }
+
+ // Non-existent path: no error, no call.
+ cmd.Init(client_path_id_ - 1, GL_INVERT, 0x80);
+ EXPECT_EQ(error::kNoError, ExecuteCmd(cmd));
+ EXPECT_EQ(GL_NO_ERROR, GetGLError());
+
+ tcmd.Init(client_path_id_ - 1, GL_INVERT, 0x80, GL_BOUNDING_BOX_CHROMIUM);
+ EXPECT_EQ(error::kNoError, ExecuteCmd(tcmd));
+ EXPECT_EQ(GL_NO_ERROR, GetGLError());
+}
+
+TEST_P(GLES2DecoderTestWithCHROMIUMPathRendering,
+ StencilFillPathCHROMIUMInvalidArgs) {
+ EXPECT_CALL(*gl_, StencilFillPathNV(_, _, _)).Times(0);
+ EXPECT_CALL(*gl_, StencilThenCoverFillPathNV(_, _, _, GL_BOUNDING_BOX_NV))
+ .Times(0);
+
+ cmds::StencilFillPathCHROMIUM cmd;
+ cmds::StencilThenCoverFillPathCHROMIUM tcmd;
+
+ cmd.Init(client_path_id_, GL_INVERT - 1, 0x80);
+ EXPECT_EQ(error::kNoError, ExecuteCmd(cmd));
+ EXPECT_EQ(GL_INVALID_ENUM, GetGLError());
+
+ tcmd.Init(client_path_id_, GL_INVERT - 1, 0x80, GL_BOUNDING_BOX_CHROMIUM);
+ EXPECT_EQ(error::kNoError, ExecuteCmd(tcmd));
+ EXPECT_EQ(GL_INVALID_ENUM, GetGLError());
+
+ // The /mask/+1 is not power of two -> invalid value.
+ cmd.Init(client_path_id_, GL_COUNT_UP_CHROMIUM, 0x80);
+ EXPECT_EQ(error::kNoError, ExecuteCmd(cmd));
+ EXPECT_EQ(GL_INVALID_VALUE, GetGLError());
+
+ tcmd.Init(client_path_id_, GL_COUNT_UP_CHROMIUM, 0x80,
+ GL_BOUNDING_BOX_CHROMIUM);
+ EXPECT_EQ(error::kNoError, ExecuteCmd(tcmd));
+ EXPECT_EQ(GL_INVALID_VALUE, GetGLError());
+
+ cmd.Init(client_path_id_, GL_COUNT_DOWN_CHROMIUM, 5);
+ EXPECT_EQ(error::kNoError, ExecuteCmd(cmd));
+ EXPECT_EQ(GL_INVALID_VALUE, GetGLError());
+
+ tcmd.Init(client_path_id_, GL_COUNT_DOWN_CHROMIUM, 5,
+ GL_BOUNDING_BOX_CHROMIUM);
+ EXPECT_EQ(error::kNoError, ExecuteCmd(tcmd));
+ EXPECT_EQ(GL_INVALID_VALUE, GetGLError());
+}
+
+TEST_P(GLES2DecoderTestWithCHROMIUMPathRendering, StencilStrokePathCHROMIUM) {
+ SetupExpectationsForApplyingDefaultDirtyState();
+
+ EXPECT_CALL(*gl_, StencilStrokePathNV(kServicePathId, 1, 0x80))
+ .RetiresOnSaturation();
+ EXPECT_CALL(*gl_, StencilThenCoverStrokePathNV(kServicePathId, 1, 0x80,
+ GL_BOUNDING_BOX_NV))
+ .RetiresOnSaturation();
+
+ cmds::StencilStrokePathCHROMIUM cmd;
+ cmds::StencilThenCoverStrokePathCHROMIUM tcmd;
+
+ cmd.Init(client_path_id_, 1, 0x80);
+ EXPECT_EQ(error::kNoError, ExecuteCmd(cmd));
+ EXPECT_EQ(GL_NO_ERROR, GetGLError());
+
+ tcmd.Init(client_path_id_, 1, 0x80, GL_BOUNDING_BOX_CHROMIUM);
+ EXPECT_EQ(error::kNoError, ExecuteCmd(tcmd));
+ EXPECT_EQ(GL_NO_ERROR, GetGLError());
+
+ EXPECT_CALL(*gl_, StencilThenCoverStrokePathNV(kServicePathId, 1, 0x80,
+ GL_CONVEX_HULL_NV))
+ .RetiresOnSaturation();
+
+ tcmd.Init(client_path_id_, 1, 0x80, GL_CONVEX_HULL_CHROMIUM);
+ EXPECT_EQ(error::kNoError, ExecuteCmd(tcmd));
+ EXPECT_EQ(GL_NO_ERROR, GetGLError());
+
+ // Non-existent path: no error, no call.
+ cmd.Init(client_path_id_ - 1, 1, 0x80);
+ EXPECT_EQ(error::kNoError, ExecuteCmd(cmd));
+ EXPECT_EQ(GL_NO_ERROR, GetGLError());
+
+ tcmd.Init(client_path_id_ - 1, 1, 0x80, GL_BOUNDING_BOX_CHROMIUM);
+ EXPECT_EQ(error::kNoError, ExecuteCmd(tcmd));
+ EXPECT_EQ(GL_NO_ERROR, GetGLError());
+}
+
+TEST_P(GLES2DecoderTestWithCHROMIUMPathRendering, CoverFillPathCHROMIUM) {
+ SetupExpectationsForApplyingDefaultDirtyState();
+
+ EXPECT_CALL(*gl_, CoverFillPathNV(kServicePathId, GL_BOUNDING_BOX_NV))
+ .RetiresOnSaturation();
+ cmds::CoverFillPathCHROMIUM cmd;
+ cmd.Init(client_path_id_, GL_BOUNDING_BOX_CHROMIUM);
+ EXPECT_EQ(error::kNoError, ExecuteCmd(cmd));
+ EXPECT_EQ(GL_NO_ERROR, GetGLError());
+
+ EXPECT_CALL(*gl_, CoverFillPathNV(kServicePathId, GL_CONVEX_HULL_NV))
+ .RetiresOnSaturation();
+ cmd.Init(client_path_id_, GL_CONVEX_HULL_CHROMIUM);
+ EXPECT_EQ(error::kNoError, ExecuteCmd(cmd));
+ EXPECT_EQ(GL_NO_ERROR, GetGLError());
+
+ // Non-existent path: no error, no call.
+ cmd.Init(client_path_id_ - 1, GL_BOUNDING_BOX_CHROMIUM);
+ EXPECT_EQ(error::kNoError, ExecuteCmd(cmd));
+ EXPECT_EQ(GL_NO_ERROR, GetGLError());
+}
+
+TEST_P(GLES2DecoderTestWithCHROMIUMPathRendering, CoverStrokePathCHROMIUM) {
+ SetupExpectationsForApplyingDefaultDirtyState();
+ EXPECT_CALL(*gl_, CoverStrokePathNV(kServicePathId, GL_BOUNDING_BOX_NV))
+ .RetiresOnSaturation();
+ cmds::CoverStrokePathCHROMIUM cmd;
+ cmd.Init(client_path_id_, GL_BOUNDING_BOX_CHROMIUM);
+ EXPECT_EQ(error::kNoError, ExecuteCmd(cmd));
+ EXPECT_EQ(GL_NO_ERROR, GetGLError());
+
+ EXPECT_CALL(*gl_, CoverStrokePathNV(kServicePathId, GL_CONVEX_HULL_NV))
+ .RetiresOnSaturation();
+ cmd.Init(client_path_id_, GL_CONVEX_HULL_CHROMIUM);
+ EXPECT_EQ(error::kNoError, ExecuteCmd(cmd));
+ EXPECT_EQ(GL_NO_ERROR, GetGLError());
+
+ // Non-existent path: no error, no call.
+ cmd.Init(client_path_id_ - 1, GL_BOUNDING_BOX_CHROMIUM);
+ EXPECT_EQ(error::kNoError, ExecuteCmd(cmd));
+ EXPECT_EQ(GL_NO_ERROR, GetGLError());
+}
+
+namespace {
+template <typename T>
+struct gl_type_enum {};
+template <>
+struct gl_type_enum<GLbyte> {
+ enum { kGLType = GL_BYTE };
+};
+template <>
+struct gl_type_enum<GLubyte> {
+ enum { kGLType = GL_UNSIGNED_BYTE };
+};
+template <>
+struct gl_type_enum<GLshort> {
+ enum { kGLType = GL_SHORT };
+};
+template <>
+struct gl_type_enum<GLushort> {
+ enum { kGLType = GL_UNSIGNED_SHORT };
+};
+template <>
+struct gl_type_enum<GLfloat> {
+ enum { kGLType = GL_FLOAT };
+};
+}
+
+template <typename TypeParam>
+void GLES2DecoderTestWithCHROMIUMPathRendering::
+ TestPathCommandsCHROMIUMCoordTypes() {
+ static const GLsizei kCorrectCoordCount = 19;
+ static const GLsizei kCorrectCommandCount = 6;
+
+ TypeParam* coords = GetSharedMemoryAs<TypeParam*>();
+ unsigned commands_offset = sizeof(TypeParam) * kCorrectCoordCount;
+ GLubyte* commands = GetSharedMemoryAsWithOffset<GLubyte*>(commands_offset);
+ for (int i = 0; i < kCorrectCoordCount; ++i) {
+ coords[i] = static_cast<TypeParam>(5 * i);
+ }
+ commands[0] = GL_MOVE_TO_CHROMIUM;
+ commands[1] = GL_CLOSE_PATH_CHROMIUM;
+ commands[2] = GL_LINE_TO_CHROMIUM;
+ commands[3] = GL_QUADRATIC_CURVE_TO_CHROMIUM;
+ commands[4] = GL_CUBIC_CURVE_TO_CHROMIUM;
+ commands[5] = GL_CONIC_CURVE_TO_CHROMIUM;
+
+ EXPECT_CALL(*gl_, PathCommandsNV(kServicePathId, kCorrectCommandCount,
+ commands, kCorrectCoordCount,
+ gl_type_enum<TypeParam>::kGLType, coords))
+ .RetiresOnSaturation();
+
+ cmds::PathCommandsCHROMIUM cmd;
+
+ cmd.Init(client_path_id_, kCorrectCommandCount, shared_memory_id_,
+ shared_memory_offset_ + commands_offset, kCorrectCoordCount,
+ gl_type_enum<TypeParam>::kGLType, shared_memory_id_,
+ shared_memory_offset_);
+ EXPECT_EQ(error::kNoError, ExecuteCmd(cmd));
+ EXPECT_EQ(GL_NO_ERROR, GetGLError());
+}
+
+TEST_P(GLES2DecoderTestWithCHROMIUMPathRendering,
+ PathCommandsCHROMIUMCoordTypes) {
+ // Not using a typed test case, because the base class is already parametrized
+ // test case and uses GetParam.
+ TestPathCommandsCHROMIUMCoordTypes<GLbyte>();
+ TestPathCommandsCHROMIUMCoordTypes<GLubyte>();
+ TestPathCommandsCHROMIUMCoordTypes<GLshort>();
+ TestPathCommandsCHROMIUMCoordTypes<GLushort>();
+ TestPathCommandsCHROMIUMCoordTypes<GLfloat>();
+}
+
#include "gpu/command_buffer/service/gles2_cmd_decoder_unittest_extensions_autogen.h"
} // namespace gles2
diff --git a/chromium/gpu/command_buffer/service/gles2_cmd_decoder_unittest_extensions_autogen.h b/chromium/gpu/command_buffer/service/gles2_cmd_decoder_unittest_extensions_autogen.h
index 57db6720ca8..b990467b210 100644
--- a/chromium/gpu/command_buffer/service/gles2_cmd_decoder_unittest_extensions_autogen.h
+++ b/chromium/gpu/command_buffer/service/gles2_cmd_decoder_unittest_extensions_autogen.h
@@ -44,6 +44,55 @@ TEST_P(GLES2DecoderTestWithCHROMIUMPathRendering,
EXPECT_EQ(error::kNoError, ExecuteCmd(cmd));
EXPECT_EQ(GL_NO_ERROR, GetGLError());
}
+// TODO(gman): GenPathsCHROMIUM
+
+// TODO(gman): DeletePathsCHROMIUM
+
+TEST_P(GLES2DecoderTestWithCHROMIUMPathRendering, IsPathCHROMIUMValidArgs) {
+ EXPECT_CALL(*gl_, IsPathNV(kServicePathId));
+ SpecializedSetup<cmds::IsPathCHROMIUM, 0>(true);
+ cmds::IsPathCHROMIUM cmd;
+ cmd.Init(client_path_id_, shared_memory_id_, shared_memory_offset_);
+ EXPECT_EQ(error::kNoError, ExecuteCmd(cmd));
+ EXPECT_EQ(GL_NO_ERROR, GetGLError());
+}
+
+TEST_P(GLES2DecoderTestWithCHROMIUMPathRendering,
+ IsPathCHROMIUMInvalidArgsBadSharedMemoryId) {
+ EXPECT_CALL(*gl_, IsPathNV(kServicePathId)).Times(0);
+ SpecializedSetup<cmds::IsPathCHROMIUM, 0>(false);
+ cmds::IsPathCHROMIUM cmd;
+ cmd.Init(client_path_id_, kInvalidSharedMemoryId, shared_memory_offset_);
+ EXPECT_EQ(error::kOutOfBounds, ExecuteCmd(cmd));
+ cmd.Init(client_path_id_, shared_memory_id_, kInvalidSharedMemoryOffset);
+ EXPECT_EQ(error::kOutOfBounds, ExecuteCmd(cmd));
+}
+// TODO(gman): PathCommandsCHROMIUM
+
+// TODO(gman): PathParameterfCHROMIUM
+
+// TODO(gman): PathParameteriCHROMIUM
+
+TEST_P(GLES2DecoderTestWithCHROMIUMPathRendering,
+ PathStencilFuncCHROMIUMValidArgs) {
+ EXPECT_CALL(*gl_, PathStencilFuncNV(GL_NEVER, 2, 3));
+ SpecializedSetup<cmds::PathStencilFuncCHROMIUM, 0>(true);
+ cmds::PathStencilFuncCHROMIUM cmd;
+ cmd.Init(GL_NEVER, 2, 3);
+ EXPECT_EQ(error::kNoError, ExecuteCmd(cmd));
+ EXPECT_EQ(GL_NO_ERROR, GetGLError());
+}
+// TODO(gman): StencilFillPathCHROMIUM
+
+// TODO(gman): StencilStrokePathCHROMIUM
+
+// TODO(gman): CoverFillPathCHROMIUM
+
+// TODO(gman): CoverStrokePathCHROMIUM
+
+// TODO(gman): StencilThenCoverFillPathCHROMIUM
+
+// TODO(gman): StencilThenCoverStrokePathCHROMIUM
TEST_P(GLES2DecoderTestWithBlendEquationAdvanced, BlendBarrierKHRValidArgs) {
EXPECT_CALL(*gl_, BlendBarrierKHR());
@@ -53,4 +102,5 @@ TEST_P(GLES2DecoderTestWithBlendEquationAdvanced, BlendBarrierKHRValidArgs) {
EXPECT_EQ(error::kNoError, ExecuteCmd(cmd));
EXPECT_EQ(GL_NO_ERROR, GetGLError());
}
+// TODO(gman): ApplyScreenSpaceAntialiasingCHROMIUM
#endif // GPU_COMMAND_BUFFER_SERVICE_GLES2_CMD_DECODER_UNITTEST_EXTENSIONS_AUTOGEN_H_
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 6e47194f472..7e086fdfbd2 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
@@ -8,9 +8,6 @@
#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/async_pixel_transfer_delegate_mock.h"
-#include "gpu/command_buffer/service/async_pixel_transfer_manager.h"
-#include "gpu/command_buffer/service/async_pixel_transfer_manager_mock.h"
#include "gpu/command_buffer/service/cmd_buffer_engine.h"
#include "gpu/command_buffer/service/context_group.h"
#include "gpu/command_buffer/service/context_state.h"
@@ -43,7 +40,6 @@ using ::testing::Pointee;
using ::testing::Return;
using ::testing::SaveArg;
using ::testing::SetArrayArgument;
-using ::testing::SetArgumentPointee;
using ::testing::SetArgPointee;
using ::testing::StrEq;
using ::testing::StrictMock;
@@ -147,8 +143,7 @@ TEST_P(GLES2DecoderTest, GetFramebufferAttachmentParameterivWithRenderbuffer) {
DoBindFramebuffer(
GL_FRAMEBUFFER, client_framebuffer_id_, kServiceFramebufferId);
EXPECT_CALL(*gl_, GetError())
- .WillOnce(Return(GL_NO_ERROR))
- .RetiresOnSaturation();
+ .WillRepeatedly(Return(GL_NO_ERROR));
EXPECT_CALL(*gl_,
FramebufferRenderbufferEXT(GL_FRAMEBUFFER,
GL_COLOR_ATTACHMENT0,
@@ -156,13 +151,6 @@ TEST_P(GLES2DecoderTest, GetFramebufferAttachmentParameterivWithRenderbuffer) {
kServiceRenderbufferId))
.Times(1)
.RetiresOnSaturation();
- EXPECT_CALL(*gl_, GetError())
- .WillOnce(Return(GL_NO_ERROR))
- .RetiresOnSaturation();
- EXPECT_CALL(*gl_, GetError())
- .WillOnce(Return(GL_NO_ERROR))
- .WillOnce(Return(GL_NO_ERROR))
- .RetiresOnSaturation();
GetFramebufferAttachmentParameteriv::Result* result =
static_cast<GetFramebufferAttachmentParameteriv::Result*>(
shared_memory_address_);
@@ -182,15 +170,14 @@ TEST_P(GLES2DecoderTest, GetFramebufferAttachmentParameterivWithRenderbuffer) {
EXPECT_EQ(error::kNoError, ExecuteCmd(fbrb_cmd));
EXPECT_EQ(error::kNoError, ExecuteCmd(cmd));
EXPECT_EQ(GL_NO_ERROR, GetGLError());
- EXPECT_EQ(static_cast<GLuint>(*result_value), client_renderbuffer_id_);
+ EXPECT_EQ(client_renderbuffer_id_, static_cast<GLuint>(*result_value));
}
TEST_P(GLES2DecoderTest, GetFramebufferAttachmentParameterivWithTexture) {
DoBindFramebuffer(
GL_FRAMEBUFFER, client_framebuffer_id_, kServiceFramebufferId);
EXPECT_CALL(*gl_, GetError())
- .WillOnce(Return(GL_NO_ERROR))
- .RetiresOnSaturation();
+ .WillRepeatedly(Return(GL_NO_ERROR));
EXPECT_CALL(*gl_,
FramebufferTexture2DEXT(GL_FRAMEBUFFER,
GL_COLOR_ATTACHMENT0,
@@ -199,13 +186,6 @@ TEST_P(GLES2DecoderTest, GetFramebufferAttachmentParameterivWithTexture) {
0))
.Times(1)
.RetiresOnSaturation();
- EXPECT_CALL(*gl_, GetError())
- .WillOnce(Return(GL_NO_ERROR))
- .RetiresOnSaturation();
- EXPECT_CALL(*gl_, GetError())
- .WillOnce(Return(GL_NO_ERROR))
- .WillOnce(Return(GL_NO_ERROR))
- .RetiresOnSaturation();
GetFramebufferAttachmentParameteriv::Result* result =
static_cast<GetFramebufferAttachmentParameteriv::Result*>(
shared_memory_address_);
@@ -225,7 +205,7 @@ TEST_P(GLES2DecoderTest, GetFramebufferAttachmentParameterivWithTexture) {
EXPECT_EQ(error::kNoError, ExecuteCmd(fbtex_cmd));
EXPECT_EQ(error::kNoError, ExecuteCmd(cmd));
EXPECT_EQ(GL_NO_ERROR, GetGLError());
- EXPECT_EQ(static_cast<GLuint>(*result_value), client_texture_id_);
+ EXPECT_EQ(client_texture_id_, static_cast<GLuint>(*result_value));
}
TEST_P(GLES2DecoderWithShaderTest,
@@ -381,13 +361,14 @@ void GLES2DecoderTest::CheckReadPixelsOutOfRange(GLint in_read_x,
bool init) {
const GLsizei kWidth = 5;
const GLsizei kHeight = 3;
- const GLint kBytesPerPixel = 3;
+ const GLint kBytesPerPixel = 4;
const GLint kPackAlignment = 4;
- const GLenum kFormat = GL_RGB;
- static const int8 kSrcPixels[kWidth * kHeight * kBytesPerPixel] = {
- 12, 13, 14, 18, 19, 18, 19, 12, 13, 14, 18, 19, 18, 19, 13,
- 29, 28, 23, 22, 21, 22, 21, 29, 28, 23, 22, 21, 22, 21, 28,
- 31, 34, 39, 37, 32, 37, 32, 31, 34, 39, 37, 32, 37, 32, 34,
+ const GLenum kFormat = GL_RGBA;
+ static const uint8 kSrcPixels[kWidth * kHeight * kBytesPerPixel] = {
+ 12, 13, 14, 255, 18, 19, 18, 255, 19, 12, 13, 255, 14, 18, 19, 255,
+ 18, 19, 13, 255, 29, 28, 23, 255, 22, 21, 22, 255, 21, 29, 28, 255,
+ 23, 22, 21, 255, 22, 21, 28, 255, 31, 34, 39, 255, 37, 32, 37, 255,
+ 32, 31, 34, 255, 39, 37, 32, 255, 37, 32, 34, 255
};
ClearSharedMemory();
@@ -499,10 +480,13 @@ void GLES2DecoderTest::CheckReadPixelsOutOfRange(GLint in_read_x,
// check padding
if (yy != in_read_height - 1) {
- GLint num_padding_bytes =
- (kPackAlignment - 1) - (unpadded_row_size % kPackAlignment);
- EXPECT_EQ(0,
- memcmp(pack.get(), row + unpadded_row_size, num_padding_bytes));
+ GLint temp = unpadded_row_size + kPackAlignment - 1;
+ GLint padded_row_size = (temp / kPackAlignment ) * kPackAlignment;
+ GLint num_padding_bytes = padded_row_size - unpadded_row_size;
+ if (num_padding_bytes) {
+ EXPECT_EQ(0, memcmp(pack.get(),
+ row + unpadded_row_size, num_padding_bytes));
+ }
}
}
}
@@ -510,12 +494,13 @@ void GLES2DecoderTest::CheckReadPixelsOutOfRange(GLint in_read_x,
TEST_P(GLES2DecoderTest, ReadPixels) {
const GLsizei kWidth = 5;
const GLsizei kHeight = 3;
- const GLint kBytesPerPixel = 3;
+ const GLint kBytesPerPixel = 4;
const GLint kPackAlignment = 4;
- static const int8 kSrcPixels[kWidth * kHeight * kBytesPerPixel] = {
- 12, 13, 14, 18, 19, 18, 19, 12, 13, 14, 18, 19, 18, 19, 13,
- 29, 28, 23, 22, 21, 22, 21, 29, 28, 23, 22, 21, 22, 21, 28,
- 31, 34, 39, 37, 32, 37, 32, 31, 34, 39, 37, 32, 37, 32, 34,
+ static const uint8 kSrcPixels[kWidth * kHeight * kBytesPerPixel] = {
+ 12, 13, 14, 255, 18, 19, 18, 255, 19, 12, 13, 255, 14, 18, 19, 255,
+ 18, 19, 13, 255, 29, 28, 23, 255, 22, 21, 22, 255, 21, 29, 28, 255,
+ 23, 22, 21, 255, 22, 21, 28, 255, 31, 34, 39, 255, 37, 32, 37, 255,
+ 32, 31, 34, 255, 39, 37, 32, 255, 37, 32, 34, 255
};
surface_->SetSize(gfx::Size(INT_MAX, INT_MAX));
@@ -534,14 +519,14 @@ TEST_P(GLES2DecoderTest, ReadPixels) {
.WillOnce(Return(GL_NO_ERROR))
.RetiresOnSaturation();
EXPECT_CALL(*gl_,
- ReadPixels(0, 0, kWidth, kHeight, GL_RGB, GL_UNSIGNED_BYTE, _))
+ ReadPixels(0, 0, kWidth, kHeight, GL_RGBA, GL_UNSIGNED_BYTE, _))
.WillOnce(Invoke(&emu, &ReadPixelsEmulator::ReadPixels));
ReadPixels cmd;
cmd.Init(0,
0,
kWidth,
kHeight,
- GL_RGB,
+ GL_RGBA,
GL_UNSIGNED_BYTE,
pixels_shm_id,
pixels_shm_offset,
@@ -767,7 +752,7 @@ TEST_P(GLES2DecoderManualInitTest, ReadPixelsAsyncError) {
.RetiresOnSaturation();
EXPECT_CALL(*gl_,
- ReadPixels(0, 0, kWidth, kHeight, GL_RGB, GL_UNSIGNED_BYTE, _))
+ ReadPixels(0, 0, kWidth, kHeight, GL_RGBA, GL_UNSIGNED_BYTE, _))
.Times(1);
EXPECT_CALL(*gl_, GenBuffersARB(1, _)).Times(1);
EXPECT_CALL(*gl_, DeleteBuffersARB(1, _)).Times(1);
@@ -781,7 +766,7 @@ TEST_P(GLES2DecoderManualInitTest, ReadPixelsAsyncError) {
0,
kWidth,
kHeight,
- GL_RGB,
+ GL_RGBA,
GL_UNSIGNED_BYTE,
pixels_shm_id,
pixels_shm_offset,
@@ -938,9 +923,6 @@ TEST_P(GLES2DecoderManualInitTest, ActualAlphaMatchesRequestedAlpha) {
.RetiresOnSaturation();
typedef GetIntegerv::Result Result;
Result* result = static_cast<Result*>(shared_memory_address_);
- EXPECT_CALL(*gl_, GetIntegerv(GL_ALPHA_BITS, _))
- .WillOnce(SetArgumentPointee<1>(8))
- .RetiresOnSaturation();
result->size = 0;
GetIntegerv cmd2;
cmd2.Init(GL_ALPHA_BITS, shared_memory_id_, shared_memory_offset_);
@@ -963,9 +945,6 @@ TEST_P(GLES2DecoderManualInitTest, ActualAlphaDoesNotMatchRequestedAlpha) {
.RetiresOnSaturation();
typedef GetIntegerv::Result Result;
Result* result = static_cast<Result*>(shared_memory_address_);
- EXPECT_CALL(*gl_, GetIntegerv(GL_ALPHA_BITS, _))
- .WillOnce(SetArgumentPointee<1>(8))
- .RetiresOnSaturation();
result->size = 0;
GetIntegerv cmd2;
cmd2.Init(GL_ALPHA_BITS, shared_memory_id_, shared_memory_offset_);
@@ -990,7 +969,7 @@ TEST_P(GLES2DecoderManualInitTest, ActualDepthMatchesRequestedDepth) {
typedef GetIntegerv::Result Result;
Result* result = static_cast<Result*>(shared_memory_address_);
EXPECT_CALL(*gl_, GetIntegerv(GL_DEPTH_BITS, _))
- .WillOnce(SetArgumentPointee<1>(24))
+ .WillOnce(SetArgPointee<1>(24))
.RetiresOnSaturation();
result->size = 0;
GetIntegerv cmd2;
@@ -1015,7 +994,7 @@ TEST_P(GLES2DecoderManualInitTest, ActualDepthDoesNotMatchRequestedDepth) {
typedef GetIntegerv::Result Result;
Result* result = static_cast<Result*>(shared_memory_address_);
EXPECT_CALL(*gl_, GetIntegerv(GL_DEPTH_BITS, _))
- .WillOnce(SetArgumentPointee<1>(24))
+ .WillOnce(SetArgPointee<1>(24))
.RetiresOnSaturation();
result->size = 0;
GetIntegerv cmd2;
@@ -1041,7 +1020,7 @@ TEST_P(GLES2DecoderManualInitTest, ActualStencilMatchesRequestedStencil) {
typedef GetIntegerv::Result Result;
Result* result = static_cast<Result*>(shared_memory_address_);
EXPECT_CALL(*gl_, GetIntegerv(GL_STENCIL_BITS, _))
- .WillOnce(SetArgumentPointee<1>(8))
+ .WillOnce(SetArgPointee<1>(8))
.RetiresOnSaturation();
result->size = 0;
GetIntegerv cmd2;
@@ -1066,7 +1045,7 @@ TEST_P(GLES2DecoderManualInitTest, ActualStencilDoesNotMatchRequestedStencil) {
typedef GetIntegerv::Result Result;
Result* result = static_cast<Result*>(shared_memory_address_);
EXPECT_CALL(*gl_, GetIntegerv(GL_STENCIL_BITS, _))
- .WillOnce(SetArgumentPointee<1>(8))
+ .WillOnce(SetArgPointee<1>(8))
.RetiresOnSaturation();
result->size = 0;
GetIntegerv cmd2;
@@ -1101,7 +1080,7 @@ TEST_P(GLES2DecoderManualInitTest, PackedDepthStencilReportsCorrectValues) {
GetIntegerv cmd2;
cmd2.Init(GL_STENCIL_BITS, shared_memory_id_, shared_memory_offset_);
EXPECT_CALL(*gl_, GetIntegerv(GL_STENCIL_BITS, _))
- .WillOnce(SetArgumentPointee<1>(8))
+ .WillOnce(SetArgPointee<1>(8))
.RetiresOnSaturation();
EXPECT_EQ(error::kNoError, ExecuteCmd(cmd2));
EXPECT_EQ(decoder_->GetGLES2Util()->GLGetNumValuesReturned(GL_STENCIL_BITS),
@@ -1111,7 +1090,7 @@ TEST_P(GLES2DecoderManualInitTest, PackedDepthStencilReportsCorrectValues) {
result->size = 0;
cmd2.Init(GL_DEPTH_BITS, shared_memory_id_, shared_memory_offset_);
EXPECT_CALL(*gl_, GetIntegerv(GL_DEPTH_BITS, _))
- .WillOnce(SetArgumentPointee<1>(24))
+ .WillOnce(SetArgPointee<1>(24))
.RetiresOnSaturation();
EXPECT_EQ(error::kNoError, ExecuteCmd(cmd2));
EXPECT_EQ(decoder_->GetGLES2Util()->GLGetNumValuesReturned(GL_DEPTH_BITS),
@@ -1142,7 +1121,7 @@ TEST_P(GLES2DecoderManualInitTest, PackedDepthStencilNoRequestedStencil) {
GetIntegerv cmd2;
cmd2.Init(GL_STENCIL_BITS, shared_memory_id_, shared_memory_offset_);
EXPECT_CALL(*gl_, GetIntegerv(GL_STENCIL_BITS, _))
- .WillOnce(SetArgumentPointee<1>(8))
+ .WillOnce(SetArgPointee<1>(8))
.RetiresOnSaturation();
EXPECT_EQ(error::kNoError, ExecuteCmd(cmd2));
EXPECT_EQ(decoder_->GetGLES2Util()->GLGetNumValuesReturned(GL_STENCIL_BITS),
@@ -1152,7 +1131,7 @@ TEST_P(GLES2DecoderManualInitTest, PackedDepthStencilNoRequestedStencil) {
result->size = 0;
cmd2.Init(GL_DEPTH_BITS, shared_memory_id_, shared_memory_offset_);
EXPECT_CALL(*gl_, GetIntegerv(GL_DEPTH_BITS, _))
- .WillOnce(SetArgumentPointee<1>(24))
+ .WillOnce(SetArgPointee<1>(24))
.RetiresOnSaturation();
EXPECT_EQ(error::kNoError, ExecuteCmd(cmd2));
EXPECT_EQ(decoder_->GetGLES2Util()->GLGetNumValuesReturned(GL_DEPTH_BITS),
@@ -1212,7 +1191,7 @@ TEST_P(GLES2DecoderManualInitTest, PackedDepthStencilRenderbufferDepth) {
GetIntegerv cmd2;
cmd2.Init(GL_STENCIL_BITS, shared_memory_id_, shared_memory_offset_);
EXPECT_CALL(*gl_, GetIntegerv(GL_STENCIL_BITS, _))
- .WillOnce(SetArgumentPointee<1>(8))
+ .WillOnce(SetArgPointee<1>(8))
.RetiresOnSaturation();
EXPECT_EQ(error::kNoError, ExecuteCmd(cmd2));
EXPECT_EQ(decoder_->GetGLES2Util()->GLGetNumValuesReturned(GL_STENCIL_BITS),
@@ -1222,7 +1201,7 @@ TEST_P(GLES2DecoderManualInitTest, PackedDepthStencilRenderbufferDepth) {
result->size = 0;
cmd2.Init(GL_DEPTH_BITS, shared_memory_id_, shared_memory_offset_);
EXPECT_CALL(*gl_, GetIntegerv(GL_DEPTH_BITS, _))
- .WillOnce(SetArgumentPointee<1>(24))
+ .WillOnce(SetArgPointee<1>(24))
.RetiresOnSaturation();
EXPECT_EQ(error::kNoError, ExecuteCmd(cmd2));
EXPECT_EQ(decoder_->GetGLES2Util()->GLGetNumValuesReturned(GL_DEPTH_BITS),
@@ -1282,7 +1261,7 @@ TEST_P(GLES2DecoderManualInitTest, PackedDepthStencilRenderbufferStencil) {
GetIntegerv cmd2;
cmd2.Init(GL_STENCIL_BITS, shared_memory_id_, shared_memory_offset_);
EXPECT_CALL(*gl_, GetIntegerv(GL_STENCIL_BITS, _))
- .WillOnce(SetArgumentPointee<1>(8))
+ .WillOnce(SetArgPointee<1>(8))
.RetiresOnSaturation();
EXPECT_EQ(error::kNoError, ExecuteCmd(cmd2));
EXPECT_EQ(decoder_->GetGLES2Util()->GLGetNumValuesReturned(GL_STENCIL_BITS),
@@ -1292,7 +1271,7 @@ TEST_P(GLES2DecoderManualInitTest, PackedDepthStencilRenderbufferStencil) {
result->size = 0;
cmd2.Init(GL_DEPTH_BITS, shared_memory_id_, shared_memory_offset_);
EXPECT_CALL(*gl_, GetIntegerv(GL_DEPTH_BITS, _))
- .WillOnce(SetArgumentPointee<1>(24))
+ .WillOnce(SetArgPointee<1>(24))
.RetiresOnSaturation();
EXPECT_EQ(error::kNoError, ExecuteCmd(cmd2));
EXPECT_EQ(decoder_->GetGLES2Util()->GLGetNumValuesReturned(GL_DEPTH_BITS),
@@ -1394,6 +1373,128 @@ TEST_P(GLES2DecoderTest, RenderbufferStorageBadArgs) {
EXPECT_EQ(GL_INVALID_VALUE, GetGLError());
}
+TEST_P(GLES3DecoderTest, ClearBufferivImmediateValidArgs) {
+ DoBindFramebuffer(
+ GL_FRAMEBUFFER, client_framebuffer_id_, kServiceFramebufferId);
+ DoBindRenderbuffer(
+ GL_RENDERBUFFER, client_renderbuffer_id_, kServiceRenderbufferId);
+ DoRenderbufferStorage(
+ GL_RENDERBUFFER, GL_RGBA8I, GL_RGBA8I, 1, 1, GL_NO_ERROR);
+ DoFramebufferRenderbuffer(
+ GL_FRAMEBUFFER, GL_COLOR_ATTACHMENT0, GL_RENDERBUFFER,
+ client_renderbuffer_id_, kServiceRenderbufferId, GL_NO_ERROR);
+
+ cmds::ClearBufferivImmediate& cmd =
+ *GetImmediateAs<cmds::ClearBufferivImmediate>();
+ GLint temp[4] = { 0 };
+ cmd.Init(GL_COLOR, 0, &temp[0]);
+ EXPECT_CALL(*gl_, CheckFramebufferStatusEXT(GL_DRAW_FRAMEBUFFER))
+ .WillOnce(Return(GL_FRAMEBUFFER_COMPLETE))
+ .RetiresOnSaturation();
+ SetupExpectationsForApplyingDirtyState(
+ false, false, false, 0x1111, false, false, 0, 0, false);
+ EXPECT_CALL(*gl_, ClearBufferiv(
+ GL_COLOR, 0,
+ reinterpret_cast<GLint*>(ImmediateDataAddress(&cmd))));
+ EXPECT_EQ(error::kNoError, ExecuteImmediateCmd(cmd, sizeof(temp)));
+ EXPECT_EQ(GL_NO_ERROR, GetGLError());
+}
+
+TEST_P(GLES3DecoderTest, ClearBufferuivImmediateValidArgs) {
+ DoBindFramebuffer(
+ GL_FRAMEBUFFER, client_framebuffer_id_, kServiceFramebufferId);
+ DoBindRenderbuffer(
+ GL_RENDERBUFFER, client_renderbuffer_id_, kServiceRenderbufferId);
+ DoRenderbufferStorage(
+ GL_RENDERBUFFER, GL_RGBA8UI, GL_RGBA8UI, 1, 1, GL_NO_ERROR);
+ DoFramebufferRenderbuffer(
+ GL_FRAMEBUFFER, GL_COLOR_ATTACHMENT0, GL_RENDERBUFFER,
+ client_renderbuffer_id_, kServiceRenderbufferId, GL_NO_ERROR);
+
+ cmds::ClearBufferuivImmediate& cmd =
+ *GetImmediateAs<cmds::ClearBufferuivImmediate>();
+ GLuint temp[4] = { 0u };
+ cmd.Init(GL_COLOR, 0, &temp[0]);
+ EXPECT_CALL(*gl_, CheckFramebufferStatusEXT(GL_DRAW_FRAMEBUFFER))
+ .WillOnce(Return(GL_FRAMEBUFFER_COMPLETE))
+ .RetiresOnSaturation();
+ SetupExpectationsForApplyingDirtyState(
+ false, false, false, 0x1111, false, false, 0, 0, false);
+ EXPECT_CALL(*gl_, ClearBufferuiv(
+ GL_COLOR, 0,
+ reinterpret_cast<GLuint*>(
+ ImmediateDataAddress(&cmd))));
+ EXPECT_EQ(error::kNoError, ExecuteImmediateCmd(cmd, sizeof(temp)));
+ EXPECT_EQ(GL_NO_ERROR, GetGLError());
+}
+
+TEST_P(GLES3DecoderTest, ClearBufferfvImmediateValidArgs) {
+ DoBindFramebuffer(
+ GL_FRAMEBUFFER, client_framebuffer_id_, kServiceFramebufferId);
+ DoBindRenderbuffer(
+ GL_RENDERBUFFER, client_renderbuffer_id_, kServiceRenderbufferId);
+ DoRenderbufferStorage(
+ GL_RENDERBUFFER, GL_DEPTH_COMPONENT32F, GL_DEPTH_COMPONENT32F,
+ 1, 1, GL_NO_ERROR);
+ DoFramebufferRenderbuffer(
+ GL_FRAMEBUFFER, GL_DEPTH_ATTACHMENT, GL_RENDERBUFFER,
+ client_renderbuffer_id_, kServiceRenderbufferId, GL_NO_ERROR);
+
+ Enable cmd_enable;
+ cmd_enable.Init(GL_DEPTH_TEST);
+ EXPECT_EQ(error::kNoError, ExecuteCmd(cmd_enable));
+ EXPECT_EQ(GL_NO_ERROR, GetGLError());
+
+ cmds::ClearBufferfvImmediate& cmd =
+ *GetImmediateAs<cmds::ClearBufferfvImmediate>();
+ GLfloat temp[4] = { 1.0f };
+ cmd.Init(GL_DEPTH, 0, &temp[0]);
+ EXPECT_CALL(*gl_, CheckFramebufferStatusEXT(GL_DRAW_FRAMEBUFFER))
+ .WillOnce(Return(GL_FRAMEBUFFER_COMPLETE))
+ .RetiresOnSaturation();
+ SetupExpectationsForApplyingDirtyState(
+ true, true, false, 0x1110, true, true, 0, 0, false);
+ EXPECT_CALL(*gl_, ClearBufferfv(
+ GL_DEPTH, 0,
+ reinterpret_cast<GLfloat*>(
+ ImmediateDataAddress(&cmd))));
+ EXPECT_EQ(error::kNoError, ExecuteImmediateCmd(cmd, sizeof(temp)));
+ EXPECT_EQ(GL_NO_ERROR, GetGLError());
+}
+
+TEST_P(GLES3DecoderTest, ClearBufferfiValidArgs) {
+ DoBindFramebuffer(
+ GL_FRAMEBUFFER, client_framebuffer_id_, kServiceFramebufferId);
+ DoBindRenderbuffer(
+ GL_RENDERBUFFER, client_renderbuffer_id_, kServiceRenderbufferId);
+ DoRenderbufferStorage(
+ GL_RENDERBUFFER, GL_DEPTH24_STENCIL8, GL_DEPTH24_STENCIL8,
+ 1, 1, GL_NO_ERROR);
+ DoFramebufferRenderbuffer(
+ GL_FRAMEBUFFER, GL_DEPTH_STENCIL_ATTACHMENT, GL_RENDERBUFFER,
+ client_renderbuffer_id_, kServiceRenderbufferId, GL_NO_ERROR);
+
+ Enable cmd_enable;
+ cmd_enable.Init(GL_STENCIL_TEST);
+ EXPECT_EQ(error::kNoError, ExecuteCmd(cmd_enable));
+ cmd_enable.Init(GL_DEPTH_TEST);
+ EXPECT_EQ(error::kNoError, ExecuteCmd(cmd_enable));
+ EXPECT_EQ(GL_NO_ERROR, GetGLError());
+
+ cmds::ClearBufferfi cmd;
+ cmd.Init(GL_DEPTH_STENCIL, 0, 1.0f, 0);
+ EXPECT_CALL(*gl_, CheckFramebufferStatusEXT(GL_DRAW_FRAMEBUFFER))
+ .WillOnce(Return(GL_FRAMEBUFFER_COMPLETE))
+ .RetiresOnSaturation();
+ SetupExpectationsForApplyingDirtyState(
+ true, true, true, 0x1110, true, true,
+ GLES2Decoder::kDefaultStencilMask, GLES2Decoder::kDefaultStencilMask,
+ true);
+ EXPECT_CALL(*gl_, ClearBufferfi(GL_DEPTH_STENCIL, 0, 1.0f, 0));
+ EXPECT_EQ(error::kNoError, ExecuteCmd(cmd));
+ EXPECT_EQ(GL_NO_ERROR, GetGLError());
+}
+
TEST_P(GLES2DecoderManualInitTest,
RenderbufferStorageMultisampleCHROMIUMGLError) {
InitState init;
@@ -1658,7 +1759,7 @@ TEST_P(GLES2DecoderWithShaderTest, UnClearedAttachmentsGetClearedOnClear) {
// Register a texture id.
EXPECT_CALL(*gl_, GenTextures(_, _))
- .WillOnce(SetArgumentPointee<1>(kFBOServiceTextureId))
+ .WillOnce(SetArgPointee<1>(kFBOServiceTextureId))
.RetiresOnSaturation();
GenHelper<GenTexturesImmediate>(kFBOClientTextureId);
@@ -1715,7 +1816,7 @@ TEST_P(GLES2DecoderWithShaderTest, UnClearedAttachmentsGetClearedOnReadPixels) {
// Register a texture id.
EXPECT_CALL(*gl_, GenTextures(_, _))
- .WillOnce(SetArgumentPointee<1>(kFBOServiceTextureId))
+ .WillOnce(SetArgPointee<1>(kFBOServiceTextureId))
.RetiresOnSaturation();
GenHelper<GenTexturesImmediate>(kFBOClientTextureId);
@@ -1786,7 +1887,7 @@ TEST_P(GLES2DecoderManualInitTest,
// Register a texture id.
EXPECT_CALL(*gl_, GenTextures(_, _))
- .WillOnce(SetArgumentPointee<1>(kFBOServiceTextureId))
+ .WillOnce(SetArgPointee<1>(kFBOServiceTextureId))
.RetiresOnSaturation();
GenHelper<GenTexturesImmediate>(kFBOClientTextureId);
@@ -1945,7 +2046,7 @@ void GLES2DecoderWithShaderTest::CheckTextureChangesMarkFBOAsNotComplete(
// Register a texture id.
EXPECT_CALL(*gl_, GenTextures(_, _))
- .WillOnce(SetArgumentPointee<1>(kFBOServiceTextureId))
+ .WillOnce(SetArgPointee<1>(kFBOServiceTextureId))
.RetiresOnSaturation();
GenHelper<GenTexturesImmediate>(kFBOClientTextureId);
@@ -2188,7 +2289,7 @@ TEST_P(GLES2DecoderManualInitTest,
// Register a texture id.
EXPECT_CALL(*gl_, GenTextures(_, _))
- .WillOnce(SetArgumentPointee<1>(kFBOServiceTextureId))
+ .WillOnce(SetArgPointee<1>(kFBOServiceTextureId))
.RetiresOnSaturation();
GenHelper<GenTexturesImmediate>(kFBOClientTextureId);
@@ -2289,7 +2390,7 @@ TEST_P(GLES2DecoderManualInitTest, ReadFormatExtension) {
// Register a texture id.
EXPECT_CALL(*gl_, GenTextures(_, _))
- .WillOnce(SetArgumentPointee<1>(kFBOServiceTextureId))
+ .WillOnce(SetArgPointee<1>(kFBOServiceTextureId))
.RetiresOnSaturation();
GenHelper<GenTexturesImmediate>(kFBOClientTextureId);
@@ -2346,7 +2447,7 @@ TEST_P(GLES2DecoderManualInitTest, NoReadFormatExtension) {
// Register a texture id.
EXPECT_CALL(*gl_, GenTextures(_, _))
- .WillOnce(SetArgumentPointee<1>(kFBOServiceTextureId))
+ .WillOnce(SetArgPointee<1>(kFBOServiceTextureId))
.RetiresOnSaturation();
GenHelper<GenTexturesImmediate>(kFBOClientTextureId);
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 9c3d775f360..8d6753753dd 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
@@ -8,9 +8,6 @@
#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/async_pixel_transfer_delegate_mock.h"
-#include "gpu/command_buffer/service/async_pixel_transfer_manager.h"
-#include "gpu/command_buffer/service/async_pixel_transfer_manager_mock.h"
#include "gpu/command_buffer/service/cmd_buffer_engine.h"
#include "gpu/command_buffer/service/context_group.h"
#include "gpu/command_buffer/service/context_state.h"
@@ -166,6 +163,12 @@ TEST_P(GLES2DecoderWithShaderTest,
const uint32 kBucketId = 123;
GetTransformFeedbackVaryingsCHROMIUM cmd;
cmd.Init(client_program_id_, kBucketId);
+ EXPECT_CALL(*(gl_.get()),
+ GetProgramiv(kServiceProgramId,
+ GL_TRANSFORM_FEEDBACK_BUFFER_MODE,
+ _))
+ .WillOnce(SetArgPointee<2>(GL_INTERLEAVED_ATTRIBS))
+ .RetiresOnSaturation();
EXPECT_CALL(*gl_, GetProgramiv(kServiceProgramId, GL_LINK_STATUS, _))
.WillOnce(SetArgPointee<2>(GL_TRUE))
.RetiresOnSaturation();
@@ -182,6 +185,8 @@ TEST_P(GLES2DecoderWithShaderTest,
bucket->GetDataAs<TransformFeedbackVaryingsHeader*>(
0, sizeof(TransformFeedbackVaryingsHeader));
EXPECT_TRUE(header != NULL);
+ EXPECT_EQ(static_cast<uint32_t>(GL_INTERLEAVED_ATTRIBS),
+ header->transform_feedback_buffer_mode);
EXPECT_EQ(0u, header->num_transform_feedback_varyings);
decoder_->set_unsafe_es3_apis_enabled(false);
EXPECT_EQ(error::kUnknownCommand, ExecuteCmd(cmd));
@@ -1452,8 +1457,17 @@ TEST_P(GLES2DecoderWithShaderTest, GetActiveUniformsivBadSharedMemoryFails) {
}
TEST_P(GLES2DecoderWithShaderTest, GetShaderInfoLogValidArgs) {
- const char* kInfo = "hello";
const uint32 kBucketId = 123;
+ const char kSource0[] = "void main() { gl_Position = vec4(1.0); }";
+ const char* kSource[] = {kSource0};
+ const char kValidStrEnd = 0;
+ SetBucketAsCStrings(kBucketId, 1, kSource, 1, kValidStrEnd);
+ ShaderSourceBucket bucket_cmd;
+ bucket_cmd.Init(client_shader_id_, kBucketId);
+ EXPECT_EQ(error::kNoError, ExecuteCmd(bucket_cmd));
+ ClearSharedMemory();
+
+ const char* kInfo = "hello";
CompileShader compile_cmd;
GetShaderInfoLog cmd;
EXPECT_CALL(*gl_, ShaderSource(kServiceShaderId, 1, _, _));
@@ -1629,6 +1643,17 @@ TEST_P(GLES2DecoderWithShaderTest,
}
TEST_P(GLES2DecoderTest, CompileShaderValidArgs) {
+ // ShaderSource should not actually call any GL calls yet.
+ const uint32 kInBucketId = 123;
+ const char kSource0[] = "void main() { gl_Position = vec4(1.0); }";
+ const char* kSource[] = {kSource0};
+ const char kValidStrEnd = 0;
+ SetBucketAsCStrings(kInBucketId, 1, kSource, 1, kValidStrEnd);
+ ShaderSourceBucket bucket_cmd;
+ bucket_cmd.Init(client_shader_id_, kInBucketId);
+ EXPECT_EQ(error::kNoError, ExecuteCmd(bucket_cmd));
+ ClearSharedMemory();
+
// Compile shader should not actually call any GL calls yet.
CompileShader cmd;
cmd.Init(client_shader_id_);
@@ -1645,10 +1670,14 @@ TEST_P(GLES2DecoderTest, CompileShaderValidArgs) {
.WillOnce(Return(GL_NO_ERROR))
.RetiresOnSaturation();
+ GetShaderiv::Result* result =
+ static_cast<GetShaderiv::Result*>(shared_memory_address_);
+ result->size = 0;
GetShaderiv status_cmd;
status_cmd.Init(client_shader_id_, GL_COMPILE_STATUS,
kSharedMemoryId, kSharedMemoryOffset);
EXPECT_EQ(error::kNoError, ExecuteCmd(status_cmd));
+ EXPECT_EQ(GL_TRUE, *result->GetData());
}
TEST_P(GLES2DecoderTest, CompileShaderInvalidArgs) {
@@ -1717,6 +1746,17 @@ TEST_P(GLES2DecoderWithShaderTest, Uniform1iValidArgs) {
EXPECT_EQ(error::kNoError, ExecuteCmd(cmd));
}
+TEST_P(GLES2DecoderWithShaderTest, Uniform1uiValidArgs) {
+ EXPECT_CALL(*gl_, Uniform1uiv(kUniform4RealLocation, 1, _));
+ cmds::Uniform1ui cmd;
+ cmd.Init(kUniform4FakeLocation, 2);
+ decoder_->set_unsafe_es3_apis_enabled(true);
+ EXPECT_EQ(error::kNoError, ExecuteCmd(cmd));
+ EXPECT_EQ(GL_NO_ERROR, GetGLError());
+ decoder_->set_unsafe_es3_apis_enabled(false);
+ EXPECT_EQ(error::kUnknownCommand, ExecuteCmd(cmd));
+}
+
TEST_P(GLES2DecoderWithShaderTest, Uniform1ivImmediateValidArgs) {
Uniform1ivImmediate& cmd = *GetImmediateAs<Uniform1ivImmediate>();
EXPECT_CALL(*gl_,
@@ -1767,6 +1807,134 @@ TEST_P(GLES2DecoderWithShaderTest, Uniform1ivSamplerIsLimited) {
EXPECT_EQ(GL_INVALID_VALUE, GetGLError());
}
+TEST_P(GLES2DecoderWithShaderTest, Uniform1uivImmediateValidArgs) {
+ cmds::Uniform1uivImmediate& cmd =
+ *GetImmediateAs<cmds::Uniform1uivImmediate>();
+ EXPECT_CALL(
+ *gl_,
+ Uniform1uiv(kUniform4RealLocation, 1,
+ reinterpret_cast<GLuint*>(ImmediateDataAddress(&cmd))));
+ GLuint temp[1 * 2] = {
+ 0,
+ };
+ cmd.Init(kUniform4FakeLocation, 1, &temp[0]);
+ decoder_->set_unsafe_es3_apis_enabled(true);
+ EXPECT_EQ(error::kNoError, ExecuteImmediateCmd(cmd, sizeof(temp)));
+ EXPECT_EQ(GL_NO_ERROR, GetGLError());
+ decoder_->set_unsafe_es3_apis_enabled(false);
+ EXPECT_EQ(error::kUnknownCommand, ExecuteImmediateCmd(cmd, sizeof(temp)));
+}
+
+TEST_P(GLES2DecoderWithShaderTest, Uniform1uivImmediateInvalidType) {
+ EXPECT_CALL(*gl_, Uniform1uiv(_, _, _)).Times(0);
+ Uniform1uivImmediate& cmd = *GetImmediateAs<Uniform1uivImmediate>();
+ GLuint temp[1 * 2] = {
+ 0,
+ };
+ // uniform1 is SAMPLER type.
+ cmd.Init(kUniform1FakeLocation, 1, &temp[0]);
+ decoder_->set_unsafe_es3_apis_enabled(true);
+ EXPECT_EQ(error::kNoError, ExecuteImmediateCmd(cmd, sizeof(temp)));
+ EXPECT_EQ(GL_INVALID_OPERATION, GetGLError());
+}
+
+TEST_P(GLES2DecoderWithShaderTest, Uniform1uivZeroCount) {
+ EXPECT_CALL(*gl_, Uniform1uiv(_, _, _)).Times(0);
+ Uniform1uivImmediate& cmd = *GetImmediateAs<Uniform1uivImmediate>();
+ GLuint temp = 0;
+ cmd.Init(kUniform4FakeLocation, 0, &temp);
+ decoder_->set_unsafe_es3_apis_enabled(true);
+ EXPECT_EQ(error::kNoError, ExecuteImmediateCmd(cmd, sizeof(temp)));
+ EXPECT_EQ(GL_NO_ERROR, GetGLError());
+}
+
+TEST_P(GLES2DecoderWithShaderTest, Uniform2uiValidArgs) {
+ EXPECT_CALL(*gl_, Uniform2uiv(kUniform5RealLocation, 1, _));
+ cmds::Uniform2ui cmd;
+ cmd.Init(kUniform5FakeLocation, 2, 3);
+ decoder_->set_unsafe_es3_apis_enabled(true);
+ EXPECT_EQ(error::kNoError, ExecuteCmd(cmd));
+ EXPECT_EQ(GL_NO_ERROR, GetGLError());
+ decoder_->set_unsafe_es3_apis_enabled(false);
+ EXPECT_EQ(error::kUnknownCommand, ExecuteCmd(cmd));
+}
+
+TEST_P(GLES2DecoderWithShaderTest, Uniform2uivImmediateValidArgs) {
+ cmds::Uniform2uivImmediate& cmd =
+ *GetImmediateAs<cmds::Uniform2uivImmediate>();
+ EXPECT_CALL(
+ *gl_,
+ Uniform2uiv(kUniform5RealLocation, 1,
+ reinterpret_cast<GLuint*>(ImmediateDataAddress(&cmd))));
+ GLuint temp[2 * 1] = {
+ 0,
+ };
+ cmd.Init(kUniform5FakeLocation, 1, &temp[0]);
+ decoder_->set_unsafe_es3_apis_enabled(true);
+ EXPECT_EQ(error::kNoError, ExecuteImmediateCmd(cmd, sizeof(temp)));
+ EXPECT_EQ(GL_NO_ERROR, GetGLError());
+ decoder_->set_unsafe_es3_apis_enabled(false);
+ EXPECT_EQ(error::kUnknownCommand, ExecuteImmediateCmd(cmd, sizeof(temp)));
+}
+
+TEST_P(GLES2DecoderWithShaderTest, Uniform3uiValidArgs) {
+ EXPECT_CALL(*gl_, Uniform3uiv(kUniform6RealLocation, 1, _));
+ cmds::Uniform3ui cmd;
+ cmd.Init(kUniform6FakeLocation, 2, 3, 4);
+ decoder_->set_unsafe_es3_apis_enabled(true);
+ EXPECT_EQ(error::kNoError, ExecuteCmd(cmd));
+ EXPECT_EQ(GL_NO_ERROR, GetGLError());
+ decoder_->set_unsafe_es3_apis_enabled(false);
+ EXPECT_EQ(error::kUnknownCommand, ExecuteCmd(cmd));
+}
+
+TEST_P(GLES2DecoderWithShaderTest, Uniform3uivImmediateValidArgs) {
+ cmds::Uniform3uivImmediate& cmd =
+ *GetImmediateAs<cmds::Uniform3uivImmediate>();
+ EXPECT_CALL(
+ *gl_,
+ Uniform3uiv(kUniform6RealLocation, 1,
+ reinterpret_cast<GLuint*>(ImmediateDataAddress(&cmd))));
+ GLuint temp[3 * 1] = {
+ 0,
+ };
+ cmd.Init(kUniform6FakeLocation, 1, &temp[0]);
+ decoder_->set_unsafe_es3_apis_enabled(true);
+ EXPECT_EQ(error::kNoError, ExecuteImmediateCmd(cmd, sizeof(temp)));
+ EXPECT_EQ(GL_NO_ERROR, GetGLError());
+ decoder_->set_unsafe_es3_apis_enabled(false);
+ EXPECT_EQ(error::kUnknownCommand, ExecuteImmediateCmd(cmd, sizeof(temp)));
+}
+
+TEST_P(GLES2DecoderWithShaderTest, Uniform4uiValidArgs) {
+ EXPECT_CALL(*gl_, Uniform4uiv(kUniform7RealLocation, 1, _));
+ cmds::Uniform4ui cmd;
+ cmd.Init(kUniform7FakeLocation, 2, 3, 4, 5);
+ decoder_->set_unsafe_es3_apis_enabled(true);
+ EXPECT_EQ(error::kNoError, ExecuteCmd(cmd));
+ EXPECT_EQ(GL_NO_ERROR, GetGLError());
+ decoder_->set_unsafe_es3_apis_enabled(false);
+ EXPECT_EQ(error::kUnknownCommand, ExecuteCmd(cmd));
+}
+
+TEST_P(GLES2DecoderWithShaderTest, Uniform4uivImmediateValidArgs) {
+ cmds::Uniform4uivImmediate& cmd =
+ *GetImmediateAs<cmds::Uniform4uivImmediate>();
+ EXPECT_CALL(
+ *gl_,
+ Uniform4uiv(kUniform7RealLocation, 1,
+ reinterpret_cast<GLuint*>(ImmediateDataAddress(&cmd))));
+ GLuint temp[4 * 1] = {
+ 0,
+ };
+ cmd.Init(kUniform7FakeLocation, 1, &temp[0]);
+ decoder_->set_unsafe_es3_apis_enabled(true);
+ EXPECT_EQ(error::kNoError, ExecuteImmediateCmd(cmd, sizeof(temp)));
+ EXPECT_EQ(GL_NO_ERROR, GetGLError());
+ decoder_->set_unsafe_es3_apis_enabled(false);
+ EXPECT_EQ(error::kUnknownCommand, ExecuteImmediateCmd(cmd, sizeof(temp)));
+}
+
TEST_P(GLES2DecoderTest, BindAttribLocationBucket) {
const uint32 kBucketId = 123;
const GLint kLocation = 2;
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 159813d4605..89dec15acd0 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
@@ -9,9 +9,6 @@
#include "gpu/command_buffer/common/gles2_cmd_format.h"
#include "gpu/command_buffer/common/gles2_cmd_utils.h"
#include "gpu/command_buffer/common/id_allocator.h"
-#include "gpu/command_buffer/service/async_pixel_transfer_delegate_mock.h"
-#include "gpu/command_buffer/service/async_pixel_transfer_manager.h"
-#include "gpu/command_buffer/service/async_pixel_transfer_manager_mock.h"
#include "gpu/command_buffer/service/cmd_buffer_engine.h"
#include "gpu/command_buffer/service/context_group.h"
#include "gpu/command_buffer/service/context_state.h"
@@ -405,6 +402,90 @@ TEST_P(GLES2DecoderTest, TexSubImage2DBadArgs) {
EXPECT_NE(error::kNoError, ExecuteCmd(cmd));
}
+TEST_P(GLES3DecoderTest, TexSubImage2DTypesDoNotMatchUnsizedFormat) {
+ const int kWidth = 16;
+ const int kHeight = 8;
+ DoBindTexture(GL_TEXTURE_2D, client_texture_id_, kServiceTextureId);
+ DoTexImage2D(GL_TEXTURE_2D,
+ 1,
+ GL_RGBA,
+ kWidth,
+ kHeight,
+ 0,
+ GL_RGBA,
+ GL_UNSIGNED_SHORT_4_4_4_4,
+ kSharedMemoryId,
+ kSharedMemoryOffset);
+ EXPECT_CALL(*gl_,
+ TexSubImage2D(GL_TEXTURE_2D,
+ 1,
+ 1,
+ 0,
+ kWidth - 1,
+ kHeight,
+ GL_RGBA,
+ GL_UNSIGNED_BYTE,
+ shared_memory_address_))
+ .Times(1)
+ .RetiresOnSaturation();
+ TexSubImage2D cmd;
+ cmd.Init(GL_TEXTURE_2D,
+ 1,
+ 1,
+ 0,
+ kWidth - 1,
+ kHeight,
+ GL_RGBA,
+ GL_UNSIGNED_BYTE,
+ kSharedMemoryId,
+ kSharedMemoryOffset,
+ GL_FALSE);
+ EXPECT_EQ(error::kNoError, ExecuteCmd(cmd));
+ EXPECT_EQ(GL_NO_ERROR, GetGLError());
+}
+
+TEST_P(GLES3DecoderTest, TexSubImage2DTypesDoNotMatchSizedFormat) {
+ const int kWidth = 16;
+ const int kHeight = 8;
+ DoBindTexture(GL_TEXTURE_2D, client_texture_id_, kServiceTextureId);
+ DoTexImage2D(GL_TEXTURE_2D,
+ 1,
+ GL_RGBA4,
+ kWidth,
+ kHeight,
+ 0,
+ GL_RGBA,
+ GL_UNSIGNED_BYTE,
+ kSharedMemoryId,
+ kSharedMemoryOffset);
+ EXPECT_CALL(*gl_,
+ TexSubImage2D(GL_TEXTURE_2D,
+ 1,
+ 1,
+ 0,
+ kWidth - 1,
+ kHeight,
+ GL_RGBA,
+ GL_UNSIGNED_SHORT_4_4_4_4,
+ shared_memory_address_))
+ .Times(1)
+ .RetiresOnSaturation();
+ TexSubImage2D cmd;
+ cmd.Init(GL_TEXTURE_2D,
+ 1,
+ 1,
+ 0,
+ kWidth - 1,
+ kHeight,
+ GL_RGBA,
+ GL_UNSIGNED_SHORT_4_4_4_4,
+ kSharedMemoryId,
+ kSharedMemoryOffset,
+ GL_FALSE);
+ EXPECT_EQ(error::kNoError, ExecuteCmd(cmd));
+ EXPECT_EQ(GL_NO_ERROR, GetGLError());
+}
+
TEST_P(GLES2DecoderTest, CopyTexSubImage2DValidArgs) {
const int kWidth = 16;
const int kHeight = 8;
@@ -1708,7 +1789,7 @@ TEST_P(GLES2DecoderManualInitTest, ARBTextureRectangleTextureParamInvalid) {
EXPECT_TRUE(texture->wrap_t() == GL_CLAMP_TO_EDGE);
}
-TEST_P(GLES2DecoderManualInitTest, ARBTextureRectangleTexImage2DError) {
+TEST_P(GLES2DecoderManualInitTest, ARBTextureRectangleTexImage2D) {
InitState init;
init.extensions = "GL_ARB_texture_rectangle";
init.bind_generates_resource = true;
@@ -1721,9 +1802,44 @@ TEST_P(GLES2DecoderManualInitTest, ARBTextureRectangleTexImage2DError) {
GLsizei height = 4;
GLenum format = GL_RGBA;
GLenum type = GL_UNSIGNED_BYTE;
+
+ DoBindTexture(
+ GL_TEXTURE_RECTANGLE_ARB, client_texture_id_, kServiceTextureId);
+ ASSERT_TRUE(GetTexture(client_texture_id_) != NULL);
+
+ TexImage2D cmd;
+ cmd.Init(target,
+ level,
+ internal_format,
+ width,
+ height,
+ format,
+ type,
+ kSharedMemoryId,
+ kSharedMemoryOffset);
+ EXPECT_EQ(error::kNoError, ExecuteCmd(cmd));
+
+ EXPECT_EQ(GL_INVALID_ENUM, GetGLError());
+}
+
+TEST_P(GLES2DecoderManualInitTest, ARBTextureRectangleTexImage2DInvalid) {
+ InitState init;
+ init.extensions = "GL_ARB_texture_rectangle";
+ init.bind_generates_resource = true;
+ InitDecoder(init);
+
+ GLenum target = GL_TEXTURE_RECTANGLE_ARB;
+ GLint level = 1;
+ GLenum internal_format = GL_RGBA;
+ GLsizei width = 2;
+ GLsizei height = 4;
+ GLenum format = GL_RGBA;
+ GLenum type = GL_UNSIGNED_BYTE;
+
DoBindTexture(
GL_TEXTURE_RECTANGLE_ARB, client_texture_id_, kServiceTextureId);
ASSERT_TRUE(GetTexture(client_texture_id_) != NULL);
+
TexImage2D cmd;
cmd.Init(target,
level,
@@ -1736,7 +1852,6 @@ TEST_P(GLES2DecoderManualInitTest, ARBTextureRectangleTexImage2DError) {
kSharedMemoryOffset);
EXPECT_EQ(error::kNoError, ExecuteCmd(cmd));
- // TexImage2D is not allowed with GL_TEXTURE_RECTANGLE_ARB targets.
EXPECT_EQ(GL_INVALID_ENUM, GetGLError());
}
@@ -2151,6 +2266,9 @@ TEST_P(GLES2DecoderTest, ProduceAndConsumeTextureCHROMIUM) {
DoBindTexture(GL_TEXTURE_2D, kNewClientId, kNewServiceId);
// Assigns and binds original service size texture ID.
+ EXPECT_CALL(*gl_, BindTexture(GL_TEXTURE_2D, 0))
+ .Times(1)
+ .RetiresOnSaturation();
EXPECT_CALL(*gl_, DeleteTextures(1, _)).Times(1).RetiresOnSaturation();
EXPECT_CALL(*gl_, BindTexture(GL_TEXTURE_2D, kServiceTextureId))
.Times(1)
@@ -2723,6 +2841,10 @@ class MockGLImage : public gfx::GLImage {
gfx::OverlayTransform,
const gfx::Rect&,
const gfx::RectF&));
+ MOCK_METHOD3(OnMemoryDump,
+ void(base::trace_event::ProcessMemoryDump*,
+ uint64_t,
+ const std::string&));
protected:
virtual ~MockGLImage() {}
@@ -3183,6 +3305,39 @@ TEST_P(GLES2DecoderCompressedFormatsTest, GetCompressedTextureFormatsETC1) {
CheckFormats("GL_OES_compressed_ETC1_RGB8_texture", formats, 1);
}
+TEST_P(GLES2DecoderCompressedFormatsTest, GetCompressedTextureFormatsASTC) {
+ const GLenum formats[] = {
+ GL_COMPRESSED_RGBA_ASTC_4x4_KHR,
+ GL_COMPRESSED_RGBA_ASTC_5x4_KHR,
+ GL_COMPRESSED_RGBA_ASTC_5x5_KHR,
+ GL_COMPRESSED_RGBA_ASTC_6x5_KHR,
+ GL_COMPRESSED_RGBA_ASTC_6x6_KHR,
+ GL_COMPRESSED_RGBA_ASTC_8x5_KHR,
+ GL_COMPRESSED_RGBA_ASTC_8x6_KHR,
+ GL_COMPRESSED_RGBA_ASTC_8x8_KHR,
+ GL_COMPRESSED_RGBA_ASTC_10x5_KHR,
+ GL_COMPRESSED_RGBA_ASTC_10x6_KHR,
+ GL_COMPRESSED_RGBA_ASTC_10x8_KHR,
+ GL_COMPRESSED_RGBA_ASTC_10x10_KHR,
+ GL_COMPRESSED_RGBA_ASTC_12x10_KHR,
+ GL_COMPRESSED_RGBA_ASTC_12x12_KHR,
+ GL_COMPRESSED_SRGB8_ALPHA8_ASTC_4x4_KHR,
+ GL_COMPRESSED_SRGB8_ALPHA8_ASTC_5x4_KHR,
+ GL_COMPRESSED_SRGB8_ALPHA8_ASTC_5x5_KHR,
+ GL_COMPRESSED_SRGB8_ALPHA8_ASTC_6x5_KHR,
+ GL_COMPRESSED_SRGB8_ALPHA8_ASTC_6x6_KHR,
+ GL_COMPRESSED_SRGB8_ALPHA8_ASTC_8x5_KHR,
+ GL_COMPRESSED_SRGB8_ALPHA8_ASTC_8x6_KHR,
+ GL_COMPRESSED_SRGB8_ALPHA8_ASTC_8x8_KHR,
+ GL_COMPRESSED_SRGB8_ALPHA8_ASTC_10x5_KHR,
+ GL_COMPRESSED_SRGB8_ALPHA8_ASTC_10x6_KHR,
+ GL_COMPRESSED_SRGB8_ALPHA8_ASTC_10x8_KHR,
+ GL_COMPRESSED_SRGB8_ALPHA8_ASTC_10x10_KHR,
+ GL_COMPRESSED_SRGB8_ALPHA8_ASTC_12x10_KHR,
+ GL_COMPRESSED_SRGB8_ALPHA8_ASTC_12x12_KHR};
+ CheckFormats("GL_KHR_texture_compression_astc_ldr", formats, 28);
+}
+
TEST_P(GLES2DecoderManualInitTest, GetNoCompressedTextureFormats) {
InitState init;
init.bind_generates_resource = true;
diff --git a/chromium/gpu/command_buffer/service/gles2_cmd_validation_autogen.h b/chromium/gpu/command_buffer/service/gles2_cmd_validation_autogen.h
index ec96c6b70a7..229987d5be5 100644
--- a/chromium/gpu/command_buffer/service/gles2_cmd_validation_autogen.h
+++ b/chromium/gpu/command_buffer/service/gles2_cmd_validation_autogen.h
@@ -16,6 +16,7 @@ ValueValidator<GLenum> backbuffer_attachment;
ValueValidator<GLenum> blit_filter;
ValueValidator<GLenum> buffer_mode;
ValueValidator<GLenum> buffer_parameter;
+ValueValidator<GLenum> buffer_parameter_64;
ValueValidator<GLenum> buffer_target;
ValueValidator<GLenum> buffer_usage;
ValueValidator<GLenum> bufferfi;
@@ -46,6 +47,12 @@ ValueValidator<GLenum> internal_format_parameter;
ValueValidator<GLenum> invalidate_frame_buffer_target;
ValueValidator<GLenum> map_buffer_access;
ValueValidator<GLenum> matrix_mode;
+ValueValidator<GLenum> path_coord_type;
+ValueValidator<GLenum> path_cover_mode;
+ValueValidator<GLenum> path_fill_mode;
+ValueValidator<GLenum> path_parameter;
+ValueValidator<GLint> path_parameter_cap_values;
+ValueValidator<GLint> path_parameter_join_values;
ValueValidator<GLenum> pixel_store;
ValueValidator<GLint> pixel_store_alignment;
ValueValidator<GLenum> pixel_type;
@@ -53,6 +60,7 @@ ValueValidator<GLenum> program_parameter;
ValueValidator<GLenum> query_object_parameter;
ValueValidator<GLenum> query_parameter;
ValueValidator<GLenum> query_target;
+ValueValidator<GLenum> read_buffer;
ValueValidator<GLenum> read_pixel_format;
ValueValidator<GLenum> read_pixel_type;
ValueValidator<GLenum> render_buffer_format;
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 1c4cf97c349..ea6a90e092e 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
@@ -12,70 +12,53 @@
#define GPU_COMMAND_BUFFER_SERVICE_GLES2_CMD_VALIDATION_IMPLEMENTATION_AUTOGEN_H_
static const GLenum valid_attachment_table[] = {
- GL_COLOR_ATTACHMENT0,
- GL_DEPTH_ATTACHMENT,
- GL_STENCIL_ATTACHMENT,
+ GL_COLOR_ATTACHMENT0, GL_DEPTH_ATTACHMENT, GL_STENCIL_ATTACHMENT,
};
static const GLenum valid_attachment_table_es3[] = {
- GL_DEPTH_STENCIL_ATTACHMENT,
+ GL_DEPTH_STENCIL_ATTACHMENT, GL_COLOR_EXT, GL_DEPTH_EXT, GL_STENCIL_EXT,
};
static const GLenum valid_backbuffer_attachment_table[] = {
- GL_COLOR_EXT,
- GL_DEPTH_EXT,
- GL_STENCIL_EXT,
+ GL_COLOR_EXT, GL_DEPTH_EXT, GL_STENCIL_EXT,
};
static const GLenum valid_blit_filter_table[] = {
- GL_NEAREST,
- GL_LINEAR,
+ GL_NEAREST, GL_LINEAR,
};
static const GLenum valid_buffer_mode_table[] = {
- GL_INTERLEAVED_ATTRIBS,
- GL_SEPARATE_ATTRIBS,
+ GL_INTERLEAVED_ATTRIBS, GL_SEPARATE_ATTRIBS,
};
static const GLenum valid_buffer_parameter_table[] = {
- GL_BUFFER_SIZE,
- GL_BUFFER_USAGE,
+ GL_BUFFER_SIZE, GL_BUFFER_USAGE,
};
static const GLenum valid_buffer_parameter_table_es3[] = {
- GL_BUFFER_ACCESS_FLAGS,
- GL_BUFFER_MAPPED,
- GL_BUFFER_MAP_LENGTH,
- GL_BUFFER_MAP_OFFSET,
+ GL_BUFFER_ACCESS_FLAGS, GL_BUFFER_MAPPED,
+};
+
+static const GLenum valid_buffer_parameter_64_table[] = {
+ GL_BUFFER_SIZE, GL_BUFFER_MAP_LENGTH, GL_BUFFER_MAP_OFFSET,
};
static const GLenum valid_buffer_target_table[] = {
- GL_ARRAY_BUFFER,
- GL_ELEMENT_ARRAY_BUFFER,
+ GL_ARRAY_BUFFER, GL_ELEMENT_ARRAY_BUFFER,
};
static const GLenum valid_buffer_target_table_es3[] = {
- GL_COPY_READ_BUFFER,
- GL_COPY_WRITE_BUFFER,
- GL_PIXEL_PACK_BUFFER,
- GL_PIXEL_UNPACK_BUFFER,
- GL_TRANSFORM_FEEDBACK_BUFFER,
- GL_UNIFORM_BUFFER,
+ GL_COPY_READ_BUFFER, GL_COPY_WRITE_BUFFER, GL_PIXEL_PACK_BUFFER,
+ GL_PIXEL_UNPACK_BUFFER, GL_TRANSFORM_FEEDBACK_BUFFER, GL_UNIFORM_BUFFER,
};
static const GLenum valid_buffer_usage_table[] = {
- GL_STREAM_DRAW,
- GL_STATIC_DRAW,
- GL_DYNAMIC_DRAW,
+ GL_STREAM_DRAW, GL_STATIC_DRAW, GL_DYNAMIC_DRAW,
};
static const GLenum valid_buffer_usage_table_es3[] = {
- GL_STREAM_READ,
- GL_STREAM_COPY,
- GL_STATIC_READ,
- GL_STATIC_COPY,
- GL_DYNAMIC_READ,
- GL_DYNAMIC_COPY,
+ GL_STREAM_READ, GL_STREAM_COPY, GL_STATIC_READ,
+ GL_STATIC_COPY, GL_DYNAMIC_READ, GL_DYNAMIC_COPY,
};
static const GLenum valid_bufferfi_table[] = {
@@ -83,13 +66,11 @@ static const GLenum valid_bufferfi_table[] = {
};
static const GLenum valid_bufferfv_table[] = {
- GL_COLOR,
- GL_DEPTH,
+ GL_COLOR, GL_DEPTH,
};
static const GLenum valid_bufferiv_table[] = {
- GL_COLOR,
- GL_STENCIL,
+ GL_COLOR, GL_STENCIL,
};
static const GLenum valid_bufferuiv_table[] = {
@@ -97,31 +78,18 @@ static const GLenum valid_bufferuiv_table[] = {
};
static const GLenum valid_capability_table[] = {
- GL_BLEND,
- GL_CULL_FACE,
- GL_DEPTH_TEST,
- GL_DITHER,
- GL_POLYGON_OFFSET_FILL,
- GL_SAMPLE_ALPHA_TO_COVERAGE,
- GL_SAMPLE_COVERAGE,
- GL_SCISSOR_TEST,
- GL_STENCIL_TEST,
+ GL_BLEND, GL_CULL_FACE, GL_DEPTH_TEST,
+ GL_DITHER, GL_POLYGON_OFFSET_FILL, GL_SAMPLE_ALPHA_TO_COVERAGE,
+ GL_SAMPLE_COVERAGE, GL_SCISSOR_TEST, GL_STENCIL_TEST,
};
static const GLenum valid_capability_table_es3[] = {
- GL_RASTERIZER_DISCARD,
- GL_PRIMITIVE_RESTART_FIXED_INDEX,
+ GL_RASTERIZER_DISCARD, GL_PRIMITIVE_RESTART_FIXED_INDEX,
};
static const GLenum valid_cmp_function_table[] = {
- GL_NEVER,
- GL_LESS,
- GL_EQUAL,
- GL_LEQUAL,
- GL_GREATER,
- GL_NOTEQUAL,
- GL_GEQUAL,
- GL_ALWAYS,
+ GL_NEVER, GL_LESS, GL_EQUAL, GL_LEQUAL,
+ GL_GREATER, GL_NOTEQUAL, GL_GEQUAL, GL_ALWAYS,
};
static const GLenum valid_compressed_texture_format_table_es3[] = {
@@ -138,52 +106,34 @@ static const GLenum valid_compressed_texture_format_table_es3[] = {
};
static const GLenum valid_draw_mode_table[] = {
- GL_POINTS,
- GL_LINE_STRIP,
- GL_LINE_LOOP,
- GL_LINES,
- GL_TRIANGLE_STRIP,
- GL_TRIANGLE_FAN,
- GL_TRIANGLES,
+ GL_POINTS, GL_LINE_STRIP, GL_LINE_LOOP, GL_LINES,
+ GL_TRIANGLE_STRIP, GL_TRIANGLE_FAN, GL_TRIANGLES,
};
static const GLenum valid_dst_blend_factor_table[] = {
- GL_ZERO,
- GL_ONE,
- GL_SRC_COLOR,
- GL_ONE_MINUS_SRC_COLOR,
- GL_DST_COLOR,
- GL_ONE_MINUS_DST_COLOR,
- GL_SRC_ALPHA,
- GL_ONE_MINUS_SRC_ALPHA,
- GL_DST_ALPHA,
- GL_ONE_MINUS_DST_ALPHA,
- GL_CONSTANT_COLOR,
- GL_ONE_MINUS_CONSTANT_COLOR,
- GL_CONSTANT_ALPHA,
- GL_ONE_MINUS_CONSTANT_ALPHA,
+ GL_ZERO, GL_ONE,
+ GL_SRC_COLOR, GL_ONE_MINUS_SRC_COLOR,
+ GL_DST_COLOR, GL_ONE_MINUS_DST_COLOR,
+ GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA,
+ GL_DST_ALPHA, GL_ONE_MINUS_DST_ALPHA,
+ GL_CONSTANT_COLOR, GL_ONE_MINUS_CONSTANT_COLOR,
+ GL_CONSTANT_ALPHA, GL_ONE_MINUS_CONSTANT_ALPHA,
};
static const GLenum valid_equation_table[] = {
- GL_FUNC_ADD,
- GL_FUNC_SUBTRACT,
- GL_FUNC_REVERSE_SUBTRACT,
+ GL_FUNC_ADD, GL_FUNC_SUBTRACT, GL_FUNC_REVERSE_SUBTRACT,
};
static const GLenum valid_equation_table_es3[] = {
- GL_MIN,
- GL_MAX,
+ GL_MIN, GL_MAX,
};
static const GLenum valid_face_mode_table[] = {
- GL_CW,
- GL_CCW,
+ GL_CW, GL_CCW,
};
static const GLenum valid_face_type_table[] = {
- GL_FRONT,
- GL_BACK,
- GL_FRONT_AND_BACK,
+ GL_FRONT, GL_BACK, GL_FRONT_AND_BACK,
};
static const GLenum valid_frame_buffer_parameter_table[] = {
@@ -210,8 +160,7 @@ static const GLenum valid_frame_buffer_target_table[] = {
};
static const GLenum valid_frame_buffer_target_table_es3[] = {
- GL_DRAW_FRAMEBUFFER,
- GL_READ_FRAMEBUFFER,
+ GL_DRAW_FRAMEBUFFER, GL_READ_FRAMEBUFFER,
};
static const GLenum valid_g_l_state_table[] = {
@@ -328,6 +277,7 @@ static const GLenum valid_g_l_state_table_es3[] = {
GL_DRAW_BUFFER15,
GL_DRAW_FRAMEBUFFER_BINDING,
GL_FRAGMENT_SHADER_DERIVATIVE_HINT,
+ GL_GPU_DISJOINT_EXT,
GL_MAJOR_VERSION,
GL_MAX_3D_TEXTURE_SIZE,
GL_MAX_ARRAY_TEXTURE_LAYERS,
@@ -368,6 +318,7 @@ static const GLenum valid_g_l_state_table_es3[] = {
GL_READ_BUFFER,
GL_READ_FRAMEBUFFER_BINDING,
GL_SAMPLER_BINDING,
+ GL_TIMESTAMP_EXT,
GL_TEXTURE_BINDING_2D_ARRAY,
GL_TEXTURE_BINDING_3D,
GL_TRANSFORM_FEEDBACK_BINDING,
@@ -388,25 +339,19 @@ static const GLenum valid_g_l_state_table_es3[] = {
};
static const GLenum valid_get_max_index_type_table[] = {
- GL_UNSIGNED_BYTE,
- GL_UNSIGNED_SHORT,
- GL_UNSIGNED_INT,
+ GL_UNSIGNED_BYTE, GL_UNSIGNED_SHORT, GL_UNSIGNED_INT,
};
static const GLenum valid_get_tex_param_target_table[] = {
- GL_TEXTURE_2D,
- GL_TEXTURE_CUBE_MAP,
+ GL_TEXTURE_2D, GL_TEXTURE_CUBE_MAP,
};
static const GLenum valid_get_tex_param_target_table_es3[] = {
- GL_TEXTURE_2D_ARRAY,
- GL_TEXTURE_3D,
+ GL_TEXTURE_2D_ARRAY, GL_TEXTURE_3D,
};
static const GLenum valid_hint_mode_table[] = {
- GL_FASTEST,
- GL_NICEST,
- GL_DONT_CARE,
+ GL_FASTEST, GL_NICEST, GL_DONT_CARE,
};
static const GLenum valid_hint_target_table[] = {
@@ -418,19 +363,15 @@ static const GLenum valid_hint_target_table_es3[] = {
};
static const GLenum valid_image_internal_format_table[] = {
- GL_RGB,
- GL_RGB_YUV_420_CHROMIUM,
- GL_RGBA,
+ GL_RGB, GL_RGB_YUV_420_CHROMIUM, GL_RGB_YCBCR_422_CHROMIUM, GL_RGBA,
};
static const GLenum valid_image_usage_table[] = {
- GL_MAP_CHROMIUM,
- GL_SCANOUT_CHROMIUM,
+ GL_MAP_CHROMIUM, GL_SCANOUT_CHROMIUM,
};
static const GLenum valid_index_type_table[] = {
- GL_UNSIGNED_BYTE,
- GL_UNSIGNED_SHORT,
+ GL_UNSIGNED_BYTE, GL_UNSIGNED_SHORT,
};
static const GLenum valid_index_type_table_es3[] = {
@@ -438,8 +379,7 @@ static const GLenum valid_index_type_table_es3[] = {
};
static const GLenum valid_indexed_buffer_target_table[] = {
- GL_TRANSFORM_FEEDBACK_BUFFER,
- GL_UNIFORM_BUFFER,
+ GL_TRANSFORM_FEEDBACK_BUFFER, GL_UNIFORM_BUFFER,
};
static const GLenum valid_indexed_g_l_state_table[] = {
@@ -452,8 +392,7 @@ static const GLenum valid_indexed_g_l_state_table[] = {
};
static const GLenum valid_internal_format_parameter_table[] = {
- GL_NUM_SAMPLE_COUNTS,
- GL_SAMPLES,
+ GL_NUM_SAMPLE_COUNTS, GL_SAMPLES,
};
static const GLenum valid_invalidate_frame_buffer_target_table[] = {
@@ -470,37 +409,51 @@ static const GLenum valid_map_buffer_access_table[] = {
};
static const GLenum valid_matrix_mode_table[] = {
- GL_PATH_PROJECTION_CHROMIUM,
- GL_PATH_MODELVIEW_CHROMIUM,
+ GL_PATH_PROJECTION_CHROMIUM, GL_PATH_MODELVIEW_CHROMIUM,
+};
+
+static const GLenum valid_path_coord_type_table[] = {
+ GL_BYTE, GL_UNSIGNED_BYTE, GL_SHORT, GL_UNSIGNED_SHORT, GL_FLOAT,
+};
+
+static const GLenum valid_path_cover_mode_table[] = {
+ GL_CONVEX_HULL_CHROMIUM, GL_BOUNDING_BOX_CHROMIUM,
+};
+
+static const GLenum valid_path_fill_mode_table[] = {
+ GL_INVERT, GL_COUNT_UP_CHROMIUM, GL_COUNT_DOWN_CHROMIUM,
+};
+
+static const GLenum valid_path_parameter_table[] = {
+ GL_PATH_STROKE_WIDTH_CHROMIUM, GL_PATH_END_CAPS_CHROMIUM,
+ GL_PATH_JOIN_STYLE_CHROMIUM, GL_PATH_MITER_LIMIT_CHROMIUM,
+ GL_PATH_STROKE_BOUND_CHROMIUM,
+};
+
+static const GLint valid_path_parameter_cap_values_table[] = {
+ GL_FLAT, GL_SQUARE_CHROMIUM, GL_ROUND_CHROMIUM,
+};
+
+static const GLint valid_path_parameter_join_values_table[] = {
+ GL_MITER_REVERT_CHROMIUM, GL_BEVEL_CHROMIUM, GL_ROUND_CHROMIUM,
};
static const GLenum valid_pixel_store_table[] = {
- GL_PACK_ALIGNMENT,
- GL_UNPACK_ALIGNMENT,
+ GL_PACK_ALIGNMENT, GL_UNPACK_ALIGNMENT,
};
static const GLenum valid_pixel_store_table_es3[] = {
- GL_PACK_ROW_LENGTH,
- GL_PACK_SKIP_PIXELS,
- GL_PACK_SKIP_ROWS,
- GL_UNPACK_ROW_LENGTH,
- GL_UNPACK_IMAGE_HEIGHT,
- GL_UNPACK_SKIP_PIXELS,
- GL_UNPACK_SKIP_ROWS,
- GL_UNPACK_SKIP_IMAGES,
+ GL_PACK_ROW_LENGTH, GL_PACK_SKIP_PIXELS, GL_PACK_SKIP_ROWS,
+ GL_UNPACK_ROW_LENGTH, GL_UNPACK_IMAGE_HEIGHT, GL_UNPACK_SKIP_PIXELS,
+ GL_UNPACK_SKIP_ROWS, GL_UNPACK_SKIP_IMAGES,
};
static const GLint valid_pixel_store_alignment_table[] = {
- 1,
- 2,
- 4,
- 8,
+ 1, 2, 4, 8,
};
static const GLenum valid_pixel_type_table[] = {
- GL_UNSIGNED_BYTE,
- GL_UNSIGNED_SHORT_5_6_5,
- GL_UNSIGNED_SHORT_4_4_4_4,
+ GL_UNSIGNED_BYTE, GL_UNSIGNED_SHORT_5_6_5, GL_UNSIGNED_SHORT_4_4_4_4,
GL_UNSIGNED_SHORT_5_5_5_1,
};
@@ -540,8 +493,7 @@ static const GLenum valid_program_parameter_table_es3[] = {
};
static const GLenum valid_query_object_parameter_table[] = {
- GL_QUERY_RESULT_EXT,
- GL_QUERY_RESULT_AVAILABLE_EXT,
+ GL_QUERY_RESULT_EXT, GL_QUERY_RESULT_AVAILABLE_EXT,
};
static const GLenum valid_query_parameter_table[] = {
@@ -553,51 +505,52 @@ static const GLenum valid_query_target_table[] = {
GL_ANY_SAMPLES_PASSED_CONSERVATIVE_EXT,
GL_COMMANDS_ISSUED_CHROMIUM,
GL_LATENCY_QUERY_CHROMIUM,
- GL_ASYNC_PIXEL_UNPACK_COMPLETED_CHROMIUM,
GL_ASYNC_PIXEL_PACK_COMPLETED_CHROMIUM,
GL_COMMANDS_COMPLETED_CHROMIUM,
};
-static const GLenum valid_read_pixel_format_table[] = {
- GL_ALPHA,
- GL_RGB,
- GL_RGBA,
+static const GLenum valid_read_buffer_table[] = {
+ GL_NONE,
+ GL_BACK,
+ GL_COLOR_ATTACHMENT0,
+ GL_COLOR_ATTACHMENT1,
+ GL_COLOR_ATTACHMENT2,
+ GL_COLOR_ATTACHMENT3,
+ GL_COLOR_ATTACHMENT4,
+ GL_COLOR_ATTACHMENT5,
+ GL_COLOR_ATTACHMENT6,
+ GL_COLOR_ATTACHMENT7,
+ GL_COLOR_ATTACHMENT8,
+ GL_COLOR_ATTACHMENT9,
+ GL_COLOR_ATTACHMENT10,
+ GL_COLOR_ATTACHMENT11,
+ GL_COLOR_ATTACHMENT12,
+ GL_COLOR_ATTACHMENT13,
+ GL_COLOR_ATTACHMENT14,
+ GL_COLOR_ATTACHMENT15,
};
-static const GLenum valid_read_pixel_format_table_es3[] = {
- GL_RGBA_INTEGER,
+static const GLenum valid_read_pixel_format_table[] = {
+ GL_ALPHA, GL_RGB, GL_RGBA,
};
-static const GLenum deprecated_read_pixel_format_table_es3[] = {
- GL_ALPHA,
- GL_RGB,
+static const GLenum valid_read_pixel_format_table_es3[] = {
+ GL_RED, GL_RED_INTEGER, GL_RG,
+ GL_RG_INTEGER, GL_RGB_INTEGER, GL_RGBA_INTEGER,
};
static const GLenum valid_read_pixel_type_table[] = {
- GL_UNSIGNED_BYTE,
- GL_UNSIGNED_SHORT_5_6_5,
- GL_UNSIGNED_SHORT_4_4_4_4,
+ GL_UNSIGNED_BYTE, GL_UNSIGNED_SHORT_5_6_5, GL_UNSIGNED_SHORT_4_4_4_4,
GL_UNSIGNED_SHORT_5_5_5_1,
};
static const GLenum valid_read_pixel_type_table_es3[] = {
- GL_UNSIGNED_INT,
- GL_INT,
- GL_FLOAT,
-};
-
-static const GLenum deprecated_read_pixel_type_table_es3[] = {
- GL_UNSIGNED_SHORT_5_6_5,
- GL_UNSIGNED_SHORT_4_4_4_4,
- GL_UNSIGNED_SHORT_5_5_5_1,
+ GL_BYTE, GL_UNSIGNED_SHORT, GL_SHORT, GL_UNSIGNED_INT,
+ GL_INT, GL_HALF_FLOAT, GL_FLOAT, GL_UNSIGNED_INT_2_10_10_10_REV,
};
static const GLenum valid_render_buffer_format_table[] = {
- GL_RGBA4,
- GL_RGB565,
- GL_RGB5_A1,
- GL_DEPTH_COMPONENT16,
- GL_STENCIL_INDEX8,
+ GL_RGBA4, GL_RGB565, GL_RGB5_A1, GL_DEPTH_COMPONENT16, GL_STENCIL_INDEX8,
};
static const GLenum valid_render_buffer_format_table_es3[] = {
@@ -633,14 +586,10 @@ static const GLenum valid_render_buffer_format_table_es3[] = {
};
static const GLenum valid_render_buffer_parameter_table[] = {
- GL_RENDERBUFFER_RED_SIZE,
- GL_RENDERBUFFER_GREEN_SIZE,
- GL_RENDERBUFFER_BLUE_SIZE,
- GL_RENDERBUFFER_ALPHA_SIZE,
- GL_RENDERBUFFER_DEPTH_SIZE,
- GL_RENDERBUFFER_STENCIL_SIZE,
- GL_RENDERBUFFER_WIDTH,
- GL_RENDERBUFFER_HEIGHT,
+ GL_RENDERBUFFER_RED_SIZE, GL_RENDERBUFFER_GREEN_SIZE,
+ GL_RENDERBUFFER_BLUE_SIZE, GL_RENDERBUFFER_ALPHA_SIZE,
+ GL_RENDERBUFFER_DEPTH_SIZE, GL_RENDERBUFFER_STENCIL_SIZE,
+ GL_RENDERBUFFER_WIDTH, GL_RENDERBUFFER_HEIGHT,
GL_RENDERBUFFER_INTERNAL_FORMAT,
};
@@ -653,44 +602,29 @@ static const GLenum valid_render_buffer_target_table[] = {
};
static const GLenum valid_reset_status_table[] = {
- GL_GUILTY_CONTEXT_RESET_ARB,
- GL_INNOCENT_CONTEXT_RESET_ARB,
+ GL_GUILTY_CONTEXT_RESET_ARB, GL_INNOCENT_CONTEXT_RESET_ARB,
GL_UNKNOWN_CONTEXT_RESET_ARB,
};
static const GLenum valid_sampler_parameter_table[] = {
- GL_TEXTURE_MAG_FILTER,
- GL_TEXTURE_MIN_FILTER,
- GL_TEXTURE_MIN_LOD,
- GL_TEXTURE_MAX_LOD,
- GL_TEXTURE_WRAP_S,
- GL_TEXTURE_WRAP_T,
- GL_TEXTURE_WRAP_R,
- GL_TEXTURE_COMPARE_MODE,
- GL_TEXTURE_COMPARE_FUNC,
+ GL_TEXTURE_MAG_FILTER, GL_TEXTURE_MIN_FILTER, GL_TEXTURE_MIN_LOD,
+ GL_TEXTURE_MAX_LOD, GL_TEXTURE_WRAP_S, GL_TEXTURE_WRAP_T,
+ GL_TEXTURE_WRAP_R, GL_TEXTURE_COMPARE_MODE, GL_TEXTURE_COMPARE_FUNC,
};
static const GLenum valid_shader_parameter_table[] = {
- GL_SHADER_TYPE,
- GL_DELETE_STATUS,
- GL_COMPILE_STATUS,
- GL_INFO_LOG_LENGTH,
- GL_SHADER_SOURCE_LENGTH,
- GL_TRANSLATED_SHADER_SOURCE_LENGTH_ANGLE,
+ GL_SHADER_TYPE, GL_DELETE_STATUS,
+ GL_COMPILE_STATUS, GL_INFO_LOG_LENGTH,
+ GL_SHADER_SOURCE_LENGTH, GL_TRANSLATED_SHADER_SOURCE_LENGTH_ANGLE,
};
static const GLenum valid_shader_precision_table[] = {
- GL_LOW_FLOAT,
- GL_MEDIUM_FLOAT,
- GL_HIGH_FLOAT,
- GL_LOW_INT,
- GL_MEDIUM_INT,
- GL_HIGH_INT,
+ GL_LOW_FLOAT, GL_MEDIUM_FLOAT, GL_HIGH_FLOAT,
+ GL_LOW_INT, GL_MEDIUM_INT, GL_HIGH_INT,
};
static const GLenum valid_shader_type_table[] = {
- GL_VERTEX_SHADER,
- GL_FRAGMENT_SHADER,
+ GL_VERTEX_SHADER, GL_FRAGMENT_SHADER,
};
static const GLenum valid_src_blend_factor_table[] = {
@@ -712,21 +646,12 @@ static const GLenum valid_src_blend_factor_table[] = {
};
static const GLenum valid_stencil_op_table[] = {
- GL_KEEP,
- GL_ZERO,
- GL_REPLACE,
- GL_INCR,
- GL_INCR_WRAP,
- GL_DECR,
- GL_DECR_WRAP,
- GL_INVERT,
+ GL_KEEP, GL_ZERO, GL_REPLACE, GL_INCR,
+ GL_INCR_WRAP, GL_DECR, GL_DECR_WRAP, GL_INVERT,
};
static const GLenum valid_string_type_table[] = {
- GL_VENDOR,
- GL_RENDERER,
- GL_VERSION,
- GL_SHADING_LANGUAGE_VERSION,
+ GL_VENDOR, GL_RENDERER, GL_VERSION, GL_SHADING_LANGUAGE_VERSION,
GL_EXTENSIONS,
};
@@ -735,54 +660,36 @@ static const GLenum valid_subscription_target_table[] = {
};
static const GLbitfield valid_sync_flush_flags_table[] = {
- GL_SYNC_FLUSH_COMMANDS_BIT,
- 0,
+ GL_SYNC_FLUSH_COMMANDS_BIT, 0,
};
static const GLenum valid_sync_parameter_table[] = {
- GL_SYNC_STATUS,
- GL_OBJECT_TYPE,
- GL_SYNC_CONDITION,
- GL_SYNC_FLAGS,
+ GL_SYNC_STATUS, GL_OBJECT_TYPE, GL_SYNC_CONDITION, GL_SYNC_FLAGS,
};
static const GLenum valid_texture_3_d_target_table[] = {
- GL_TEXTURE_3D,
- GL_TEXTURE_2D_ARRAY,
+ GL_TEXTURE_3D, GL_TEXTURE_2D_ARRAY,
};
static const GLenum valid_texture_bind_target_table[] = {
- GL_TEXTURE_2D,
- GL_TEXTURE_CUBE_MAP,
+ GL_TEXTURE_2D, GL_TEXTURE_CUBE_MAP,
};
static const GLenum valid_texture_bind_target_table_es3[] = {
- GL_TEXTURE_3D,
- GL_TEXTURE_2D_ARRAY,
+ GL_TEXTURE_3D, GL_TEXTURE_2D_ARRAY,
};
static const GLenum valid_texture_compare_func_table[] = {
- GL_LEQUAL,
- GL_GEQUAL,
- GL_LESS,
- GL_GREATER,
- GL_EQUAL,
- GL_NOTEQUAL,
- GL_ALWAYS,
- GL_NEVER,
+ GL_LEQUAL, GL_GEQUAL, GL_LESS, GL_GREATER,
+ GL_EQUAL, GL_NOTEQUAL, GL_ALWAYS, GL_NEVER,
};
static const GLenum valid_texture_compare_mode_table[] = {
- GL_NONE,
- GL_COMPARE_REF_TO_TEXTURE,
+ GL_NONE, GL_COMPARE_REF_TO_TEXTURE,
};
static const GLenum valid_texture_format_table[] = {
- GL_ALPHA,
- GL_LUMINANCE,
- GL_LUMINANCE_ALPHA,
- GL_RGB,
- GL_RGBA,
+ GL_ALPHA, GL_LUMINANCE, GL_LUMINANCE_ALPHA, GL_RGB, GL_RGBA,
};
static const GLenum valid_texture_format_table_es3[] = {
@@ -797,11 +704,7 @@ static const GLenum valid_texture_format_table_es3[] = {
};
static const GLenum valid_texture_internal_format_table[] = {
- GL_ALPHA,
- GL_LUMINANCE,
- GL_LUMINANCE_ALPHA,
- GL_RGB,
- GL_RGBA,
+ GL_ALPHA, GL_LUMINANCE, GL_LUMINANCE_ALPHA, GL_RGB, GL_RGBA,
};
static const GLenum valid_texture_internal_format_table_es3[] = {
@@ -862,14 +765,9 @@ static const GLenum valid_texture_internal_format_table_es3[] = {
};
static const GLenum valid_texture_internal_format_storage_table[] = {
- GL_RGB565,
- GL_RGBA4,
- GL_RGB5_A1,
- GL_ALPHA8_EXT,
- GL_LUMINANCE8_EXT,
- GL_LUMINANCE8_ALPHA8_EXT,
- GL_RGB8_OES,
- GL_RGBA8_OES,
+ GL_RGB565, GL_RGBA4, GL_RGB5_A1,
+ GL_ALPHA8_EXT, GL_LUMINANCE8_EXT, GL_LUMINANCE8_ALPHA8_EXT,
+ GL_RGB8_OES, GL_RGBA8_OES,
};
static const GLenum valid_texture_internal_format_storage_table_es3[] = {
@@ -937,20 +835,13 @@ static const GLenum valid_texture_internal_format_storage_table_es3[] = {
};
static const GLenum deprecated_texture_internal_format_storage_table_es3[] = {
- GL_ALPHA8_EXT,
- GL_LUMINANCE8_EXT,
- GL_LUMINANCE8_ALPHA8_EXT,
- GL_ALPHA16F_EXT,
- GL_LUMINANCE16F_EXT,
- GL_LUMINANCE_ALPHA16F_EXT,
- GL_ALPHA32F_EXT,
- GL_LUMINANCE32F_EXT,
- GL_LUMINANCE_ALPHA32F_EXT,
+ GL_ALPHA8_EXT, GL_LUMINANCE8_EXT, GL_LUMINANCE8_ALPHA8_EXT,
+ GL_ALPHA16F_EXT, GL_LUMINANCE16F_EXT, GL_LUMINANCE_ALPHA16F_EXT,
+ GL_ALPHA32F_EXT, GL_LUMINANCE32F_EXT, GL_LUMINANCE_ALPHA32F_EXT,
};
static const GLenum valid_texture_mag_filter_mode_table[] = {
- GL_NEAREST,
- GL_LINEAR,
+ GL_NEAREST, GL_LINEAR,
};
static const GLenum valid_texture_min_filter_mode_table[] = {
@@ -963,28 +854,20 @@ static const GLenum valid_texture_min_filter_mode_table[] = {
};
static const GLenum valid_texture_parameter_table[] = {
- GL_TEXTURE_MAG_FILTER,
- GL_TEXTURE_MIN_FILTER,
- GL_TEXTURE_POOL_CHROMIUM,
- GL_TEXTURE_WRAP_S,
- GL_TEXTURE_WRAP_T,
+ GL_TEXTURE_MAG_FILTER, GL_TEXTURE_MIN_FILTER, GL_TEXTURE_POOL_CHROMIUM,
+ GL_TEXTURE_WRAP_S, GL_TEXTURE_WRAP_T,
};
static const GLenum valid_texture_parameter_table_es3[] = {
- GL_TEXTURE_BASE_LEVEL,
- GL_TEXTURE_COMPARE_FUNC,
- GL_TEXTURE_COMPARE_MODE,
- GL_TEXTURE_IMMUTABLE_FORMAT,
- GL_TEXTURE_IMMUTABLE_LEVELS,
- GL_TEXTURE_MAX_LEVEL,
- GL_TEXTURE_MAX_LOD,
- GL_TEXTURE_MIN_LOD,
+ GL_TEXTURE_BASE_LEVEL, GL_TEXTURE_COMPARE_FUNC,
+ GL_TEXTURE_COMPARE_MODE, GL_TEXTURE_IMMUTABLE_FORMAT,
+ GL_TEXTURE_IMMUTABLE_LEVELS, GL_TEXTURE_MAX_LEVEL,
+ GL_TEXTURE_MAX_LOD, GL_TEXTURE_MIN_LOD,
GL_TEXTURE_WRAP_R,
};
static const GLenum valid_texture_pool_table[] = {
- GL_TEXTURE_POOL_MANAGED_CHROMIUM,
- GL_TEXTURE_POOL_UNMANAGED_CHROMIUM,
+ GL_TEXTURE_POOL_MANAGED_CHROMIUM, GL_TEXTURE_POOL_UNMANAGED_CHROMIUM,
};
static const GLenum valid_texture_target_table[] = {
@@ -998,14 +881,11 @@ static const GLenum valid_texture_target_table[] = {
};
static const GLenum valid_texture_usage_table[] = {
- GL_NONE,
- GL_FRAMEBUFFER_ATTACHMENT_ANGLE,
+ GL_NONE, GL_FRAMEBUFFER_ATTACHMENT_ANGLE,
};
static const GLenum valid_texture_wrap_mode_table[] = {
- GL_CLAMP_TO_EDGE,
- GL_MIRRORED_REPEAT,
- GL_REPEAT,
+ GL_CLAMP_TO_EDGE, GL_MIRRORED_REPEAT, GL_REPEAT,
};
static const GLenum valid_transform_feedback_bind_target_table[] = {
@@ -1013,9 +893,7 @@ static const GLenum valid_transform_feedback_bind_target_table[] = {
};
static const GLenum valid_transform_feedback_primitive_mode_table[] = {
- GL_POINTS,
- GL_LINES,
- GL_TRIANGLES,
+ GL_POINTS, GL_LINES, GL_TRIANGLES,
};
static const GLenum valid_uniform_block_parameter_table[] = {
@@ -1029,14 +907,9 @@ static const GLenum valid_uniform_block_parameter_table[] = {
};
static const GLenum valid_uniform_parameter_table[] = {
- GL_UNIFORM_SIZE,
- GL_UNIFORM_TYPE,
- GL_UNIFORM_NAME_LENGTH,
- GL_UNIFORM_BLOCK_INDEX,
- GL_UNIFORM_OFFSET,
- GL_UNIFORM_ARRAY_STRIDE,
- GL_UNIFORM_MATRIX_STRIDE,
- GL_UNIFORM_IS_ROW_MAJOR,
+ GL_UNIFORM_SIZE, GL_UNIFORM_TYPE, GL_UNIFORM_NAME_LENGTH,
+ GL_UNIFORM_BLOCK_INDEX, GL_UNIFORM_OFFSET, GL_UNIFORM_ARRAY_STRIDE,
+ GL_UNIFORM_MATRIX_STRIDE, GL_UNIFORM_IS_ROW_MAJOR,
};
static const GLenum valid_value_buffer_target_table[] = {
@@ -1044,27 +917,16 @@ static const GLenum valid_value_buffer_target_table[] = {
};
static const GLenum valid_vertex_attrib_i_type_table[] = {
- GL_BYTE,
- GL_UNSIGNED_BYTE,
- GL_SHORT,
- GL_UNSIGNED_SHORT,
- GL_INT,
- GL_UNSIGNED_INT,
+ GL_BYTE, GL_UNSIGNED_BYTE, GL_SHORT,
+ GL_UNSIGNED_SHORT, GL_INT, GL_UNSIGNED_INT,
};
static const GLint valid_vertex_attrib_size_table[] = {
- 1,
- 2,
- 3,
- 4,
+ 1, 2, 3, 4,
};
static const GLenum valid_vertex_attrib_type_table[] = {
- GL_BYTE,
- GL_UNSIGNED_BYTE,
- GL_SHORT,
- GL_UNSIGNED_SHORT,
- GL_FLOAT,
+ GL_BYTE, GL_UNSIGNED_BYTE, GL_SHORT, GL_UNSIGNED_SHORT, GL_FLOAT,
};
static const GLenum valid_vertex_attrib_type_table_es3[] = {
@@ -1076,18 +938,14 @@ static const GLenum valid_vertex_attrib_type_table_es3[] = {
};
static const GLenum valid_vertex_attribute_table[] = {
- GL_VERTEX_ATTRIB_ARRAY_NORMALIZED,
- GL_VERTEX_ATTRIB_ARRAY_BUFFER_BINDING,
- GL_VERTEX_ATTRIB_ARRAY_ENABLED,
- GL_VERTEX_ATTRIB_ARRAY_SIZE,
- GL_VERTEX_ATTRIB_ARRAY_STRIDE,
- GL_VERTEX_ATTRIB_ARRAY_TYPE,
+ GL_VERTEX_ATTRIB_ARRAY_NORMALIZED, GL_VERTEX_ATTRIB_ARRAY_BUFFER_BINDING,
+ GL_VERTEX_ATTRIB_ARRAY_ENABLED, GL_VERTEX_ATTRIB_ARRAY_SIZE,
+ GL_VERTEX_ATTRIB_ARRAY_STRIDE, GL_VERTEX_ATTRIB_ARRAY_TYPE,
GL_CURRENT_VERTEX_ATTRIB,
};
static const GLenum valid_vertex_attribute_table_es3[] = {
- GL_VERTEX_ATTRIB_ARRAY_INTEGER,
- GL_VERTEX_ATTRIB_ARRAY_DIVISOR,
+ GL_VERTEX_ATTRIB_ARRAY_INTEGER, GL_VERTEX_ATTRIB_ARRAY_DIVISOR,
};
static const GLenum valid_vertex_pointer_table[] = {
@@ -1102,6 +960,8 @@ Validators::Validators()
buffer_mode(valid_buffer_mode_table, arraysize(valid_buffer_mode_table)),
buffer_parameter(valid_buffer_parameter_table,
arraysize(valid_buffer_parameter_table)),
+ buffer_parameter_64(valid_buffer_parameter_64_table,
+ arraysize(valid_buffer_parameter_64_table)),
buffer_target(valid_buffer_target_table,
arraysize(valid_buffer_target_table)),
buffer_usage(valid_buffer_usage_table,
@@ -1148,6 +1008,20 @@ Validators::Validators()
map_buffer_access(valid_map_buffer_access_table,
arraysize(valid_map_buffer_access_table)),
matrix_mode(valid_matrix_mode_table, arraysize(valid_matrix_mode_table)),
+ path_coord_type(valid_path_coord_type_table,
+ arraysize(valid_path_coord_type_table)),
+ path_cover_mode(valid_path_cover_mode_table,
+ arraysize(valid_path_cover_mode_table)),
+ path_fill_mode(valid_path_fill_mode_table,
+ arraysize(valid_path_fill_mode_table)),
+ path_parameter(valid_path_parameter_table,
+ arraysize(valid_path_parameter_table)),
+ path_parameter_cap_values(
+ valid_path_parameter_cap_values_table,
+ arraysize(valid_path_parameter_cap_values_table)),
+ path_parameter_join_values(
+ valid_path_parameter_join_values_table,
+ arraysize(valid_path_parameter_join_values_table)),
pixel_store(valid_pixel_store_table, arraysize(valid_pixel_store_table)),
pixel_store_alignment(valid_pixel_store_alignment_table,
arraysize(valid_pixel_store_alignment_table)),
@@ -1160,6 +1034,7 @@ Validators::Validators()
arraysize(valid_query_parameter_table)),
query_target(valid_query_target_table,
arraysize(valid_query_target_table)),
+ read_buffer(valid_read_buffer_table, arraysize(valid_read_buffer_table)),
read_pixel_format(valid_read_pixel_format_table,
arraysize(valid_read_pixel_format_table)),
read_pixel_type(valid_read_pixel_type_table,
@@ -1240,8 +1115,7 @@ Validators::Validators()
vertex_attribute(valid_vertex_attribute_table,
arraysize(valid_vertex_attribute_table)),
vertex_pointer(valid_vertex_pointer_table,
- arraysize(valid_vertex_pointer_table)) {
-}
+ arraysize(valid_vertex_pointer_table)) {}
void Validators::UpdateValuesES3() {
attachment.AddValues(valid_attachment_table_es3,
@@ -1279,13 +1153,8 @@ void Validators::UpdateValuesES3() {
arraysize(valid_pixel_type_table_es3));
program_parameter.AddValues(valid_program_parameter_table_es3,
arraysize(valid_program_parameter_table_es3));
- read_pixel_format.RemoveValues(
- deprecated_read_pixel_format_table_es3,
- arraysize(deprecated_read_pixel_format_table_es3));
read_pixel_format.AddValues(valid_read_pixel_format_table_es3,
arraysize(valid_read_pixel_format_table_es3));
- read_pixel_type.RemoveValues(deprecated_read_pixel_type_table_es3,
- arraysize(deprecated_read_pixel_type_table_es3));
read_pixel_type.AddValues(valid_read_pixel_type_table_es3,
arraysize(valid_read_pixel_type_table_es3));
render_buffer_format.AddValues(
diff --git a/chromium/gpu/command_buffer/service/gpu_scheduler.cc b/chromium/gpu/command_buffer/service/gpu_scheduler.cc
index 2a15dc76f9c..aa311b6b823 100644
--- a/chromium/gpu/command_buffer/service/gpu_scheduler.cc
+++ b/chromium/gpu/command_buffer/service/gpu_scheduler.cc
@@ -15,31 +15,20 @@
#include "ui/gl/gl_fence.h"
#include "ui/gl/gl_switches.h"
-#if defined(OS_WIN)
-#include "base/win/windows_version.h"
-#endif
-
using ::base::SharedMemory;
namespace gpu {
-#if defined(OS_WIN)
-const int64 kRescheduleTimeOutDelay = 1000;
-#endif
-
GpuScheduler::GpuScheduler(CommandBufferServiceBase* command_buffer,
AsyncAPIInterface* handler,
gles2::GLES2Decoder* decoder)
: command_buffer_(command_buffer),
handler_(handler),
decoder_(decoder),
- unscheduled_count_(0),
- rescheduled_count_(0),
- was_preempted_(false),
- reschedule_task_factory_(this) {}
+ scheduled_(true),
+ was_preempted_(false) {}
-GpuScheduler::~GpuScheduler() {
-}
+GpuScheduler::~GpuScheduler() {}
void GpuScheduler::PutChanged() {
TRACE_EVENT1(
@@ -58,10 +47,6 @@ void GpuScheduler::PutChanged() {
if (state.error != error::kNoError)
return;
- // One of the unschedule fence tasks might have unscheduled us.
- if (!IsScheduled())
- return;
-
base::TimeTicks begin_time(base::TimeTicks::Now());
error::Error error = error::kNoError;
if (decoder_)
@@ -70,12 +55,12 @@ void GpuScheduler::PutChanged() {
if (IsPreempted())
break;
- DCHECK(IsScheduled());
+ DCHECK(scheduled());
error = parser_->ProcessCommands(CommandParser::kParseCommandsSlice);
if (error == error::kDeferCommandUntilLater) {
- DCHECK_GT(unscheduled_count_, 0);
+ DCHECK(!scheduled());
break;
}
@@ -93,7 +78,7 @@ void GpuScheduler::PutChanged() {
if (!command_processed_callback_.is_null())
command_processed_callback_.Run();
- if (unscheduled_count_ > 0)
+ if (!scheduled())
break;
}
@@ -108,62 +93,23 @@ void GpuScheduler::PutChanged() {
}
void GpuScheduler::SetScheduled(bool scheduled) {
- TRACE_EVENT2("gpu", "GpuScheduler:SetScheduled", "this", this,
- "new unscheduled_count_",
- unscheduled_count_ + (scheduled? -1 : 1));
- if (scheduled) {
- // If the scheduler was rescheduled after a timeout, ignore the subsequent
- // calls to SetScheduled when they eventually arrive until they are all
- // accounted for.
- if (rescheduled_count_ > 0) {
- --rescheduled_count_;
- return;
- } else {
- --unscheduled_count_;
- }
-
- DCHECK_GE(unscheduled_count_, 0);
-
- if (unscheduled_count_ == 0) {
- TRACE_EVENT_ASYNC_END1("gpu", "ProcessingSwap", this,
- "GpuScheduler", this);
- // When the scheduler transitions from the unscheduled to the scheduled
- // state, cancel the task that would reschedule it after a timeout.
- reschedule_task_factory_.InvalidateWeakPtrs();
-
- if (!scheduling_changed_callback_.is_null())
- scheduling_changed_callback_.Run(true);
- }
- } else {
- ++unscheduled_count_;
- if (unscheduled_count_ == 1) {
- TRACE_EVENT_ASYNC_BEGIN1("gpu", "ProcessingSwap", this,
- "GpuScheduler", this);
-#if defined(OS_WIN)
- if (base::win::GetVersion() < base::win::VERSION_VISTA) {
- // When the scheduler transitions from scheduled to unscheduled, post a
- // delayed task that it will force it back into a scheduled state after
- // a timeout. This should only be necessary on pre-Vista.
- base::MessageLoop::current()->PostDelayedTask(
- FROM_HERE,
- base::Bind(&GpuScheduler::RescheduleTimeOut,
- reschedule_task_factory_.GetWeakPtr()),
- base::TimeDelta::FromMilliseconds(kRescheduleTimeOutDelay));
- }
-#endif
- if (!scheduling_changed_callback_.is_null())
- scheduling_changed_callback_.Run(false);
- }
- }
+ TRACE_EVENT2("gpu", "GpuScheduler:SetScheduled", "this", this, "scheduled",
+ scheduled);
+ if (scheduled_ == scheduled)
+ return;
+ scheduled_ = scheduled;
+ if (!scheduling_changed_callback_.is_null())
+ scheduling_changed_callback_.Run(scheduled);
}
-bool GpuScheduler::IsScheduled() {
- return unscheduled_count_ == 0;
+bool GpuScheduler::HasPendingQueries() const {
+ return (decoder_ && decoder_->HasPendingQueries());
}
-bool GpuScheduler::HasMoreWork() {
- return (decoder_ && decoder_->ProcessPendingQueries(false)) ||
- HasMoreIdleWork();
+void GpuScheduler::ProcessPendingQueries() {
+ if (!decoder_)
+ return;
+ decoder_->ProcessPendingQueries(false);
}
void GpuScheduler::SetSchedulingChangedCallback(
@@ -229,7 +175,7 @@ bool GpuScheduler::IsPreempted() {
return preemption_flag_->IsSet();
}
-bool GpuScheduler::HasMoreIdleWork() {
+bool GpuScheduler::HasMoreIdleWork() const {
return (decoder_ && decoder_->HasMoreIdleWork());
}
@@ -239,15 +185,4 @@ void GpuScheduler::PerformIdleWork() {
decoder_->PerformIdleWork();
}
-void GpuScheduler::RescheduleTimeOut() {
- int new_count = unscheduled_count_ + rescheduled_count_;
-
- rescheduled_count_ = 0;
-
- while (unscheduled_count_)
- SetScheduled(true);
-
- rescheduled_count_ = new_count;
-}
-
} // namespace gpu
diff --git a/chromium/gpu/command_buffer/service/gpu_scheduler.h b/chromium/gpu/command_buffer/service/gpu_scheduler.h
index b0b26303f71..11a6d31f941 100644
--- a/chromium/gpu/command_buffer/service/gpu_scheduler.h
+++ b/chromium/gpu/command_buffer/service/gpu_scheduler.h
@@ -65,16 +65,18 @@ class GPU_EXPORT GpuScheduler
}
// Sets whether commands should be processed by this scheduler. Setting to
- // false unschedules. Setting to true reschedules. Whether or not the
- // scheduler is currently scheduled is "reference counted". Every call with
- // false must eventually be paired by a call with true.
- void SetScheduled(bool is_scheduled);
+ // false unschedules. Setting to true reschedules.
+ void SetScheduled(bool scheduled);
- // Returns whether the scheduler is currently able to process more commands.
- bool IsScheduled();
+ bool scheduled() const { return scheduled_; }
- // Returns whether the scheduler needs to be polled again in the future.
- bool HasMoreWork();
+ // Returns whether the scheduler needs to be polled again in the future to
+ // process pending queries.
+ bool HasPendingQueries() const;
+
+ // Process pending queries and return. HasPendingQueries() can be used to
+ // determine if there's more pending queries after this has been called.
+ void ProcessPendingQueries();
typedef base::Callback<void(bool /* scheduled */)> SchedulingChangedCallback;
@@ -91,19 +93,20 @@ class GPU_EXPORT GpuScheduler
void SetCommandProcessedCallback(const base::Closure& callback);
- bool HasMoreIdleWork();
+ // Returns whether the scheduler needs to be polled again in the future to
+ // process idle work.
+ bool HasMoreIdleWork() const;
+
+ // Perform some idle work and return. HasMoreIdleWork() can be used to
+ // determine if there's more idle work do be done after this has been called.
void PerformIdleWork();
CommandParser* parser() const {
return parser_.get();
}
- bool IsPreempted();
-
private:
- // Artificially reschedule if the scheduler is still unscheduled after a
- // timeout.
- void RescheduleTimeOut();
+ bool IsPreempted();
// The GpuScheduler holds a weak reference to the CommandBuffer. The
// CommandBuffer owns the GpuScheduler and holds a strong reference to it
@@ -123,12 +126,8 @@ class GPU_EXPORT GpuScheduler
// This should be an argument to the constructor.
scoped_ptr<CommandParser> parser_;
- // Greater than zero if this is waiting to be rescheduled before continuing.
- int unscheduled_count_;
-
- // The number of times this scheduler has been artificially rescheduled on
- // account of a timeout.
- int rescheduled_count_;
+ // Whether the scheduler is currently able to process more commands.
+ bool scheduled_;
SchedulingChangedCallback scheduling_changed_callback_;
base::Closure descheduled_callback_;
@@ -138,10 +137,6 @@ class GPU_EXPORT GpuScheduler
scoped_refptr<PreemptionFlag> preemption_flag_;
bool was_preempted_;
- // A factory for outstanding rescheduling tasks that is invalidated whenever
- // the scheduler is rescheduled.
- base::WeakPtrFactory<GpuScheduler> reschedule_task_factory_;
-
DISALLOW_COPY_AND_ASSIGN(GpuScheduler);
};
diff --git a/chromium/gpu/command_buffer/service/gpu_service_test.cc b/chromium/gpu/command_buffer/service/gpu_service_test.cc
index d0b91175247..5be0b9bf8cf 100644
--- a/chromium/gpu/command_buffer/service/gpu_service_test.cc
+++ b/chromium/gpu/command_buffer/service/gpu_service_test.cc
@@ -9,7 +9,7 @@
#include "ui/gl/gl_context_stub_with_extensions.h"
#include "ui/gl/gl_implementation.h"
#include "ui/gl/gl_mock.h"
-#include "ui/gl/gl_surface.h"
+#include "ui/gl/test/gl_surface_test_support.h"
namespace gpu {
namespace gles2 {
@@ -26,14 +26,14 @@ void GpuServiceTest::SetUpWithGLVersion(const char* gl_version,
testing::Test::SetUp();
gfx::SetGLGetProcAddressProc(gfx::MockGLInterface::GetGLProcAddress);
- gfx::GLSurface::InitializeOneOffWithMockBindingsForTests();
+ gfx::GLSurfaceTestSupport::InitializeOneOffWithMockBindings();
gl_.reset(new ::testing::StrictMock< ::gfx::MockGLInterface>());
::gfx::MockGLInterface::SetGLInterface(gl_.get());
context_ = new gfx::GLContextStubWithExtensions;
context_->AddExtensionsString(gl_extensions);
context_->SetGLVersionString(gl_version);
- gfx::GLSurface::InitializeDynamicMockBindingsForTests(context_.get());
+ gfx::GLSurfaceTestSupport::InitializeDynamicMockBindings(context_.get());
ran_setup_ = true;
}
diff --git a/chromium/gpu/command_buffer/service/gpu_switches.cc b/chromium/gpu/command_buffer/service/gpu_switches.cc
index d2ca49018b7..171f543b7d4 100644
--- a/chromium/gpu/command_buffer/service/gpu_switches.cc
+++ b/chromium/gpu/command_buffer/service/gpu_switches.cc
@@ -71,25 +71,31 @@ const char kGLShaderIntermOutput[] = "gl-shader-interm-output";
// round intermediate values in ANGLE.
const char kEmulateShaderPrecision[] = "emulate-shader-precision";
+// Enables using path rendering implementation implemented currently
+// in NV_path_rendering OpenGL extension. Requires compatible hardware
+// and driver. This is used in GPU rasterization.
+const char kEnableGLPathRendering[] = "enable-gl-path-rendering";
+
const char* kGpuSwitches[] = {
- kCompileShaderAlwaysSucceeds,
- kDisableGLErrorLimit,
- kDisableGLSLTranslator,
- kDisableGpuDriverBugWorkarounds,
- kDisableShaderNameHashing,
- kEnableGPUCommandLogging,
- kEnableGPUDebugging,
- kEnableGPUServiceLoggingGPU,
- kDisableGpuProgramCache,
- kEnforceGLMinimums,
- kForceGpuMemAvailableMb,
- kGpuDriverBugWorkarounds,
- kGpuProgramCacheSizeKb,
- kDisableGpuShaderDiskCache,
- kEnableShareGroupAsyncTextureUpload,
- kEnableSubscribeUniformExtension,
- kGLShaderIntermOutput,
- kEmulateShaderPrecision,
+ kCompileShaderAlwaysSucceeds,
+ kDisableGLErrorLimit,
+ kDisableGLSLTranslator,
+ kDisableGpuDriverBugWorkarounds,
+ kDisableShaderNameHashing,
+ kEnableGPUCommandLogging,
+ kEnableGPUDebugging,
+ kEnableGPUServiceLoggingGPU,
+ kDisableGpuProgramCache,
+ kEnforceGLMinimums,
+ kForceGpuMemAvailableMb,
+ kGpuDriverBugWorkarounds,
+ kGpuProgramCacheSizeKb,
+ kDisableGpuShaderDiskCache,
+ kEnableShareGroupAsyncTextureUpload,
+ kEnableSubscribeUniformExtension,
+ kGLShaderIntermOutput,
+ kEmulateShaderPrecision,
+ kEnableGLPathRendering,
};
const int kNumGpuSwitches = arraysize(kGpuSwitches);
diff --git a/chromium/gpu/command_buffer/service/gpu_switches.h b/chromium/gpu/command_buffer/service/gpu_switches.h
index ac6883a4816..ac347e4eff6 100644
--- a/chromium/gpu/command_buffer/service/gpu_switches.h
+++ b/chromium/gpu/command_buffer/service/gpu_switches.h
@@ -30,6 +30,7 @@ GPU_EXPORT extern const char kEnableSubscribeUniformExtension[];
GPU_EXPORT extern const char kEnableThreadedTextureMailboxes[];
GPU_EXPORT extern const char kGLShaderIntermOutput[];
GPU_EXPORT extern const char kEmulateShaderPrecision[];
+GPU_EXPORT extern const char kEnableGLPathRendering[];
GPU_EXPORT extern const char* kGpuSwitches[];
GPU_EXPORT extern const int kNumGpuSwitches;
diff --git a/chromium/gpu/command_buffer/service/gpu_tracer.cc b/chromium/gpu/command_buffer/service/gpu_tracer.cc
index 868c5ec7299..3ea2adee14d 100644
--- a/chromium/gpu/command_buffer/service/gpu_tracer.cc
+++ b/chromium/gpu/command_buffer/service/gpu_tracer.cc
@@ -24,12 +24,10 @@
namespace gpu {
namespace gles2 {
-static const unsigned int kProcessInterval = 16;
static const char* kGpuTraceSourceNames[] = {
- "GroupMarker", // kTraceGroupMarker = 0,
- "TraceCHROMIUM", // kTraceCHROMIUM = 1,
- "TraceCmd", // kTraceDecoder = 2,
- "Disjoint", // kTraceDisjoint = 3, // Used internally.
+ "TraceCHROMIUM", // kTraceCHROMIUM,
+ "TraceCmd", // kTraceDecoder,
+ "Disjoint", // kTraceDisjoint, // Used internally.
};
static_assert(NUM_TRACER_SOURCES == arraysize(kGpuTraceSourceNames),
"Trace source names must match enumeration.");
@@ -70,7 +68,7 @@ void TraceOutputter::TraceDevice(GpuTracerSource source,
TRACE_DISABLED_BY_DEFAULT("gpu.device"),
name.c_str(),
local_trace_device_id_,
- named_thread_.thread_id(),
+ named_thread_.GetThreadId(),
start_time,
"gl_category",
category.c_str(),
@@ -83,7 +81,7 @@ void TraceOutputter::TraceDevice(GpuTracerSource source,
TRACE_DISABLED_BY_DEFAULT("gpu.device"),
name.c_str(),
local_trace_device_id_,
- named_thread_.thread_id(),
+ named_thread_.GetThreadId(),
end_time - 1,
"gl_category",
category.c_str(),
@@ -252,7 +250,6 @@ bool GPUTracer::EndDecoding() {
}
}
}
- IssueProcessTask();
}
gpu_executing_ = false;
@@ -298,7 +295,6 @@ bool GPUTracer::End(GpuTracerSource source) {
}
finished_traces_.push_back(trace);
- IssueProcessTask();
}
markers_[source].pop_back();
@@ -307,42 +303,8 @@ bool GPUTracer::End(GpuTracerSource source) {
return false;
}
-bool GPUTracer::IsTracing() {
- return (*gpu_trace_srv_category != 0) || (*gpu_trace_dev_category != 0);
-}
-
-const std::string& GPUTracer::CurrentCategory(GpuTracerSource source) const {
- if (source >= 0 &&
- source < NUM_TRACER_SOURCES &&
- !markers_[source].empty()) {
- return markers_[source].back().category_;
- }
- return base::EmptyString();
-}
-
-const std::string& GPUTracer::CurrentName(GpuTracerSource source) const {
- if (source >= 0 &&
- source < NUM_TRACER_SOURCES &&
- !markers_[source].empty()) {
- return markers_[source].back().name_;
- }
- return base::EmptyString();
-}
-
-scoped_refptr<Outputter> GPUTracer::CreateOutputter(const std::string& name) {
- return TraceOutputter::Create(name);
-}
-
-void GPUTracer::PostTask() {
- base::ThreadTaskRunnerHandle::Get()->PostDelayedTask(
- FROM_HERE, base::Bind(&GPUTracer::Process, base::AsWeakPtr(this)),
- base::TimeDelta::FromMilliseconds(kProcessInterval));
-}
-
-void GPUTracer::Process() {
- process_posted_ = false;
- ProcessTraces();
- IssueProcessTask();
+bool GPUTracer::HasTracesToProcess() {
+ return !finished_traces_.empty();
}
void GPUTracer::ProcessTraces() {
@@ -387,6 +349,32 @@ void GPUTracer::ProcessTraces() {
DCHECK(GL_NO_ERROR == glGetError());
}
+bool GPUTracer::IsTracing() {
+ return (*gpu_trace_srv_category != 0) || (*gpu_trace_dev_category != 0);
+}
+
+const std::string& GPUTracer::CurrentCategory(GpuTracerSource source) const {
+ if (source >= 0 &&
+ source < NUM_TRACER_SOURCES &&
+ !markers_[source].empty()) {
+ return markers_[source].back().category_;
+ }
+ return base::EmptyString();
+}
+
+const std::string& GPUTracer::CurrentName(GpuTracerSource source) const {
+ if (source >= 0 &&
+ source < NUM_TRACER_SOURCES &&
+ !markers_[source].empty()) {
+ return markers_[source].back().name_;
+ }
+ return base::EmptyString();
+}
+
+scoped_refptr<Outputter> GPUTracer::CreateOutputter(const std::string& name) {
+ return TraceOutputter::Create(name);
+}
+
bool GPUTracer::CheckDisjointStatus() {
const int64 current_time = gpu_timing_client_->GetCurrentCPUTime();
if (*gpu_trace_dev_category == 0)
@@ -424,13 +412,5 @@ void GPUTracer::ClearOngoingTraces(bool have_context) {
}
}
-void GPUTracer::IssueProcessTask() {
- if (finished_traces_.empty() || process_posted_)
- return;
-
- process_posted_ = true;
- PostTask();
-}
-
} // namespace gles2
} // namespace gpu
diff --git a/chromium/gpu/command_buffer/service/gpu_tracer.h b/chromium/gpu/command_buffer/service/gpu_tracer.h
index 610af9deacf..cb3f8902cac 100644
--- a/chromium/gpu/command_buffer/service/gpu_tracer.h
+++ b/chromium/gpu/command_buffer/service/gpu_tracer.h
@@ -33,7 +33,6 @@ class GPUTrace;
enum GpuTracerSource {
kTraceGroupInvalid = -1,
- kTraceGroupMarker,
kTraceCHROMIUM,
kTraceDecoder,
kTraceDisjoint, // Used internally.
@@ -73,6 +72,9 @@ class GPU_EXPORT GPUTracer
// End the last started trace marker.
bool End(GpuTracerSource source);
+ bool HasTracesToProcess();
+ void ProcessTraces();
+
virtual bool IsTracing();
// Retrieve the name of the current open trace.
@@ -83,15 +85,10 @@ class GPU_EXPORT GPUTracer
protected:
// Trace Processing.
virtual scoped_refptr<Outputter> CreateOutputter(const std::string& name);
- virtual void PostTask();
- void Process();
- void ProcessTraces();
bool CheckDisjointStatus();
void ClearOngoingTraces(bool have_context);
- void IssueProcessTask();
-
scoped_refptr<gfx::GPUTimingClient> gpu_timing_client_;
scoped_refptr<Outputter> outputter_;
std::vector<TraceMarker> markers_[NUM_TRACER_SOURCES];
@@ -103,7 +100,6 @@ class GPU_EXPORT GPUTracer
int64 disjoint_time_ = 0;
bool gpu_executing_ = false;
- bool process_posted_ = false;
bool began_device_traces_ = false;
private:
diff --git a/chromium/gpu/command_buffer/service/gpu_tracer_unittest.cc b/chromium/gpu/command_buffer/service/gpu_tracer_unittest.cc
index 9bb59980087..59ed6625bb1 100644
--- a/chromium/gpu/command_buffer/service/gpu_tracer_unittest.cc
+++ b/chromium/gpu/command_buffer/service/gpu_tracer_unittest.cc
@@ -76,13 +76,7 @@ class GPUTracerTester : public GPUTracer {
return new MockOutputter();
}
- void PostTask() override {
- // Process synchronously.
- Process();
- }
-
unsigned char tracing_enabled_;
-
scoped_refptr<Outputter> set_outputter_;
};
@@ -227,7 +221,7 @@ class BaseGpuTraceTest : public BaseGpuTest {
void DoTraceTest(bool tracing_service, bool tracing_device) {
// Expected results
- const GpuTracerSource tracer_source = kTraceGroupMarker;
+ const GpuTracerSource tracer_source = kTraceCHROMIUM;
const std::string category_name("trace_category");
const std::string trace_name("trace_test");
const int64 offset_time = 3231;
@@ -426,7 +420,6 @@ class BaseGpuTracerTest : public BaseGpuTest {
std::string source_trace_name = trace_name + num_char;
const bool valid_timer = gpu_timing_client_->IsAvailable();
-
const GpuTracerSource source = static_cast<GpuTracerSource>(i);
ExpectOutputterEndMocks(outputter_ref_.get(), source, source_category,
source_trace_name, expect_start_time + i,
@@ -438,6 +431,7 @@ class BaseGpuTracerTest : public BaseGpuTest {
ASSERT_TRUE(tracer.End(source));
}
ASSERT_TRUE(tracer.EndDecoding());
+ tracer.ProcessTraces();
outputter_ref_ = NULL;
}
@@ -513,6 +507,7 @@ class BaseGpuTracerTest : public BaseGpuTest {
(5 * base::Time::kNanosecondsPerMicrosecond));
g_fakeCPUTime = expect_start_time + 5;
ASSERT_TRUE(tracer.EndDecoding());
+ tracer.ProcessTraces();
}
void DoDisjointTest() {
@@ -573,6 +568,7 @@ class BaseGpuTracerTest : public BaseGpuTest {
ASSERT_TRUE(tracer.End(source));
ASSERT_TRUE(tracer.EndDecoding());
+ tracer.ProcessTraces();
outputter_ref_ = NULL;
}
@@ -629,6 +625,7 @@ class BaseGpuTracerTest : public BaseGpuTest {
ASSERT_TRUE(tracer.End(source));
ASSERT_TRUE(tracer.EndDecoding());
+ tracer.ProcessTraces();
}
};
@@ -766,11 +763,11 @@ TEST_F(GPUTracerTest, TraceDuringDecodeTest) {
const std::string trace_name("trace_test");
EXPECT_FALSE(
- tracer_tester_->Begin(category_name, trace_name, kTraceGroupMarker));
+ tracer_tester_->Begin(category_name, trace_name, kTraceCHROMIUM));
ASSERT_TRUE(tracer_tester_->BeginDecoding());
EXPECT_TRUE(
- tracer_tester_->Begin(category_name, trace_name, kTraceGroupMarker));
+ tracer_tester_->Begin(category_name, trace_name, kTraceCHROMIUM));
ASSERT_TRUE(tracer_tester_->EndDecoding());
}
diff --git a/chromium/gpu/command_buffer/service/image_factory.cc b/chromium/gpu/command_buffer/service/image_factory.cc
index f940498abf7..cfc543bb9c1 100644
--- a/chromium/gpu/command_buffer/service/image_factory.cc
+++ b/chromium/gpu/command_buffer/service/image_factory.cc
@@ -16,79 +16,104 @@ ImageFactory::~ImageFactory() {
}
// static
-gfx::GpuMemoryBuffer::Format ImageFactory::ImageFormatToGpuMemoryBufferFormat(
+gfx::BufferFormat ImageFactory::DefaultBufferFormatForImageFormat(
unsigned internalformat) {
switch (internalformat) {
case GL_R8:
- return gfx::GpuMemoryBuffer::R_8;
+ return gfx::BufferFormat::R_8;
case GL_RGB:
- return gfx::GpuMemoryBuffer::RGBX_8888;
+ return gfx::BufferFormat::BGRX_8888;
case GL_RGBA:
- return gfx::GpuMemoryBuffer::RGBA_8888;
+ return gfx::BufferFormat::RGBA_8888;
case GL_BGRA_EXT:
- return gfx::GpuMemoryBuffer::BGRA_8888;
+ return gfx::BufferFormat::BGRA_8888;
case GL_ATC_RGB_AMD:
- return gfx::GpuMemoryBuffer::ATC;
+ return gfx::BufferFormat::ATC;
case GL_ATC_RGBA_INTERPOLATED_ALPHA_AMD:
- return gfx::GpuMemoryBuffer::ATCIA;
+ return gfx::BufferFormat::ATCIA;
case GL_COMPRESSED_RGB_S3TC_DXT1_EXT:
- return gfx::GpuMemoryBuffer::DXT1;
+ return gfx::BufferFormat::DXT1;
case GL_COMPRESSED_RGBA_S3TC_DXT5_EXT:
- return gfx::GpuMemoryBuffer::DXT5;
+ return gfx::BufferFormat::DXT5;
case GL_ETC1_RGB8_OES:
- return gfx::GpuMemoryBuffer::ETC1;
+ return gfx::BufferFormat::ETC1;
case GL_RGB_YUV_420_CHROMIUM:
- return gfx::GpuMemoryBuffer::YUV_420;
+ return gfx::BufferFormat::YUV_420;
+ case GL_RGB_YCBCR_422_CHROMIUM:
+ return gfx::BufferFormat::UYVY_422;
default:
NOTREACHED();
- return gfx::GpuMemoryBuffer::RGBA_8888;
+ return gfx::BufferFormat::RGBA_8888;
}
}
// static
-gfx::GpuMemoryBuffer::Usage ImageFactory::ImageUsageToGpuMemoryBufferUsage(
+gfx::BufferUsage ImageFactory::ImageUsageToGpuMemoryBufferUsage(
unsigned usage) {
switch (usage) {
case GL_MAP_CHROMIUM:
- return gfx::GpuMemoryBuffer::MAP;
+ return gfx::BufferUsage::MAP;
case GL_SCANOUT_CHROMIUM:
- return gfx::GpuMemoryBuffer::SCANOUT;
+ return gfx::BufferUsage::SCANOUT;
default:
NOTREACHED();
- return gfx::GpuMemoryBuffer::MAP;
+ return gfx::BufferUsage::MAP;
}
}
// static
bool ImageFactory::IsImageFormatCompatibleWithGpuMemoryBufferFormat(
unsigned internalformat,
- gfx::GpuMemoryBuffer::Format format) {
- return ImageFormatToGpuMemoryBufferFormat(internalformat) == format;
+ gfx::BufferFormat format) {
+ switch (format) {
+ case gfx::BufferFormat::ATC:
+ case gfx::BufferFormat::ATCIA:
+ case gfx::BufferFormat::BGRA_8888:
+ case gfx::BufferFormat::BGRX_8888:
+ case gfx::BufferFormat::DXT1:
+ case gfx::BufferFormat::DXT5:
+ case gfx::BufferFormat::ETC1:
+ case gfx::BufferFormat::R_8:
+ case gfx::BufferFormat::RGBA_8888:
+ case gfx::BufferFormat::YUV_420:
+ case gfx::BufferFormat::YUV_420_BIPLANAR:
+ case gfx::BufferFormat::UYVY_422:
+ return format == DefaultBufferFormatForImageFormat(internalformat);
+ case gfx::BufferFormat::RGBA_4444:
+ return internalformat == GL_RGBA;
+ }
+
+ NOTREACHED();
+ return false;
}
// static
bool ImageFactory::IsGpuMemoryBufferFormatSupported(
- gfx::GpuMemoryBuffer::Format format,
+ gfx::BufferFormat format,
const gpu::Capabilities& capabilities) {
switch (format) {
- case gfx::GpuMemoryBuffer::ATC:
- case gfx::GpuMemoryBuffer::ATCIA:
+ case gfx::BufferFormat::ATC:
+ case gfx::BufferFormat::ATCIA:
return capabilities.texture_format_atc;
- case gfx::GpuMemoryBuffer::BGRA_8888:
+ case gfx::BufferFormat::BGRA_8888:
return capabilities.texture_format_bgra8888;
- case gfx::GpuMemoryBuffer::DXT1:
+ case gfx::BufferFormat::DXT1:
return capabilities.texture_format_dxt1;
- case gfx::GpuMemoryBuffer::DXT5:
+ case gfx::BufferFormat::DXT5:
return capabilities.texture_format_dxt5;
- case gfx::GpuMemoryBuffer::ETC1:
+ case gfx::BufferFormat::ETC1:
return capabilities.texture_format_etc1;
- case gfx::GpuMemoryBuffer::R_8:
+ case gfx::BufferFormat::R_8:
return capabilities.texture_rg;
- case gfx::GpuMemoryBuffer::RGBA_4444:
- case gfx::GpuMemoryBuffer::RGBA_8888:
- case gfx::GpuMemoryBuffer::RGBX_8888:
- case gfx::GpuMemoryBuffer::YUV_420:
+ case gfx::BufferFormat::UYVY_422:
+ return capabilities.image_ycbcr_422;
+ case gfx::BufferFormat::RGBA_4444:
+ case gfx::BufferFormat::RGBA_8888:
+ case gfx::BufferFormat::BGRX_8888:
+ case gfx::BufferFormat::YUV_420:
return true;
+ case gfx::BufferFormat::YUV_420_BIPLANAR:
+ return false;
}
NOTREACHED();
@@ -98,25 +123,28 @@ bool ImageFactory::IsGpuMemoryBufferFormatSupported(
// static
bool ImageFactory::IsImageSizeValidForGpuMemoryBufferFormat(
const gfx::Size& size,
- gfx::GpuMemoryBuffer::Format format) {
+ gfx::BufferFormat format) {
switch (format) {
- case gfx::GpuMemoryBuffer::ATC:
- case gfx::GpuMemoryBuffer::ATCIA:
- case gfx::GpuMemoryBuffer::DXT1:
- case gfx::GpuMemoryBuffer::DXT5:
- case gfx::GpuMemoryBuffer::ETC1:
+ case gfx::BufferFormat::ATC:
+ case gfx::BufferFormat::ATCIA:
+ case gfx::BufferFormat::DXT1:
+ case gfx::BufferFormat::DXT5:
+ case gfx::BufferFormat::ETC1:
// Compressed images must have a width and height that's evenly divisible
// by the block size.
return size.width() % 4 == 0 && size.height() % 4 == 0;
- case gfx::GpuMemoryBuffer::R_8:
- case gfx::GpuMemoryBuffer::RGBA_4444:
- case gfx::GpuMemoryBuffer::RGBA_8888:
- case gfx::GpuMemoryBuffer::BGRA_8888:
- case gfx::GpuMemoryBuffer::RGBX_8888:
+ case gfx::BufferFormat::R_8:
+ case gfx::BufferFormat::RGBA_4444:
+ case gfx::BufferFormat::RGBA_8888:
+ case gfx::BufferFormat::BGRA_8888:
+ case gfx::BufferFormat::BGRX_8888:
return true;
- case gfx::GpuMemoryBuffer::YUV_420:
+ case gfx::BufferFormat::YUV_420:
+ case gfx::BufferFormat::YUV_420_BIPLANAR:
// U and V planes are subsampled by a factor of 2.
return size.width() % 2 == 0 && size.height() % 2 == 0;
+ case gfx::BufferFormat::UYVY_422:
+ return size.width() % 2 == 0;
}
NOTREACHED();
diff --git a/chromium/gpu/command_buffer/service/image_factory.h b/chromium/gpu/command_buffer/service/image_factory.h
index b5813421945..c805db08fe8 100644
--- a/chromium/gpu/command_buffer/service/image_factory.h
+++ b/chromium/gpu/command_buffer/service/image_factory.h
@@ -23,28 +23,27 @@ class GPU_EXPORT ImageFactory {
// Returns a valid GpuMemoryBuffer format given a valid internalformat as
// defined by CHROMIUM_gpu_memory_buffer_image.
- static gfx::GpuMemoryBuffer::Format ImageFormatToGpuMemoryBufferFormat(
+ static gfx::BufferFormat DefaultBufferFormatForImageFormat(
unsigned internalformat);
// Returns a valid GpuMemoryBuffer usage given a valid usage as defined by
// CHROMIUM_gpu_memory_buffer_image.
- static gfx::GpuMemoryBuffer::Usage ImageUsageToGpuMemoryBufferUsage(
- unsigned usage);
+ static gfx::BufferUsage ImageUsageToGpuMemoryBufferUsage(unsigned usage);
// Returns true if |internalformat| is compatible with |format|.
static bool IsImageFormatCompatibleWithGpuMemoryBufferFormat(
unsigned internalformat,
- gfx::GpuMemoryBuffer::Format format);
+ gfx::BufferFormat format);
// Returns true if |format| is supported by |capabilities|.
static bool IsGpuMemoryBufferFormatSupported(
- gfx::GpuMemoryBuffer::Format format,
+ gfx::BufferFormat format,
const Capabilities& capabilities);
// Returns true if |size| is valid for |format|.
static bool IsImageSizeValidForGpuMemoryBufferFormat(
const gfx::Size& size,
- gfx::GpuMemoryBuffer::Format format);
+ gfx::BufferFormat format);
// Creates a GLImage instance for GPU memory buffer identified by |handle|.
// |client_id| should be set to the client requesting the creation of instance
@@ -52,7 +51,7 @@ class GPU_EXPORT ImageFactory {
virtual scoped_refptr<gfx::GLImage> CreateImageForGpuMemoryBuffer(
const gfx::GpuMemoryBufferHandle& handle,
const gfx::Size& size,
- gfx::GpuMemoryBuffer::Format format,
+ gfx::BufferFormat format,
unsigned internalformat,
int client_id) = 0;
diff --git a/chromium/gpu/command_buffer/service/in_process_command_buffer.cc b/chromium/gpu/command_buffer/service/in_process_command_buffer.cc
index 12c01c7e285..19e361619cd 100644
--- a/chromium/gpu/command_buffer/service/in_process_command_buffer.cc
+++ b/chromium/gpu/command_buffer/service/in_process_command_buffer.cc
@@ -17,9 +17,7 @@
#include "base/memory/weak_ptr.h"
#include "base/sequence_checker.h"
#include "base/single_thread_task_runner.h"
-#include "base/synchronization/condition_variable.h"
#include "base/thread_task_runner_handle.h"
-#include "base/threading/thread.h"
#include "gpu/command_buffer/client/gpu_memory_buffer_manager.h"
#include "gpu/command_buffer/common/value_state.h"
#include "gpu/command_buffer/service/command_buffer_service.h"
@@ -29,8 +27,8 @@
#include "gpu/command_buffer/service/gpu_switches.h"
#include "gpu/command_buffer/service/image_factory.h"
#include "gpu/command_buffer/service/image_manager.h"
-#include "gpu/command_buffer/service/mailbox_manager_impl.h"
-#include "gpu/command_buffer/service/mailbox_manager_sync.h"
+#include "gpu/command_buffer/service/mailbox_manager.h"
+#include "gpu/command_buffer/service/memory_program_cache.h"
#include "gpu/command_buffer/service/memory_tracking.h"
#include "gpu/command_buffer/service/query_manager.h"
#include "gpu/command_buffer/service/sync_point_manager.h"
@@ -56,6 +54,8 @@ namespace gpu {
namespace {
+base::StaticAtomicSequenceNumber g_next_command_buffer_id;
+
template <typename T>
static void RunTaskWithResult(base::Callback<T(void)> task,
T* result,
@@ -64,61 +64,11 @@ static void RunTaskWithResult(base::Callback<T(void)> task,
completion->Signal();
}
-class GpuInProcessThread
- : public base::Thread,
- public InProcessCommandBuffer::Service,
- public base::RefCountedThreadSafe<GpuInProcessThread> {
- public:
- GpuInProcessThread();
-
- void AddRef() const override {
- base::RefCountedThreadSafe<GpuInProcessThread>::AddRef();
- }
- void Release() const override {
- base::RefCountedThreadSafe<GpuInProcessThread>::Release();
- }
-
- void ScheduleTask(const base::Closure& task) override;
- void ScheduleIdleWork(const base::Closure& callback) override;
- bool UseVirtualizedGLContexts() override { return false; }
- scoped_refptr<gles2::ShaderTranslatorCache> shader_translator_cache()
- override;
-
- private:
- ~GpuInProcessThread() override;
- friend class base::RefCountedThreadSafe<GpuInProcessThread>;
-
- scoped_refptr<gpu::gles2::ShaderTranslatorCache> shader_translator_cache_;
- DISALLOW_COPY_AND_ASSIGN(GpuInProcessThread);
-};
-
-GpuInProcessThread::GpuInProcessThread() : base::Thread("GpuThread") {
- Start();
-}
-
-GpuInProcessThread::~GpuInProcessThread() {
- Stop();
-}
-
-void GpuInProcessThread::ScheduleTask(const base::Closure& task) {
- task_runner()->PostTask(FROM_HERE, task);
-}
-
-void GpuInProcessThread::ScheduleIdleWork(const base::Closure& callback) {
- // Match delay with GpuCommandBufferStub.
- task_runner()->PostDelayedTask(FROM_HERE, callback,
- base::TimeDelta::FromMilliseconds(2));
-}
-
-scoped_refptr<gles2::ShaderTranslatorCache>
-GpuInProcessThread::shader_translator_cache() {
- if (!shader_translator_cache_.get())
- shader_translator_cache_ = new gpu::gles2::ShaderTranslatorCache;
- return shader_translator_cache_;
-}
-
struct GpuInProcessThreadHolder {
- GpuInProcessThreadHolder() : gpu_thread(new GpuInProcessThread) {}
+ GpuInProcessThreadHolder()
+ : sync_point_manager(new SyncPointManager(false)),
+ gpu_thread(new GpuInProcessThread(sync_point_manager.get())) {}
+ scoped_ptr<SyncPointManager> sync_point_manager;
scoped_refptr<InProcessCommandBuffer::Service> gpu_thread;
};
@@ -134,66 +84,6 @@ class ScopedEvent {
base::WaitableEvent* event_;
};
-// This wrapper adds the WaitSyncPoint which allows waiting on a sync point
-// on the service thread, implemented using a condition variable.
-class SyncPointManagerWrapper {
- public:
- SyncPointManagerWrapper();
-
- uint32 GenerateSyncPoint();
- void RetireSyncPoint(uint32 sync_point);
- void AddSyncPointCallback(uint32 sync_point, const base::Closure& callback);
-
- void WaitSyncPoint(uint32 sync_point);
-
- private:
- void OnSyncPointRetired();
-
- const scoped_refptr<SyncPointManager> manager_;
- base::Lock retire_lock_;
- base::ConditionVariable retire_cond_var_;
-
- DISALLOW_COPY_AND_ASSIGN(SyncPointManagerWrapper);
-};
-
-SyncPointManagerWrapper::SyncPointManagerWrapper()
- : manager_(SyncPointManager::Create(true)),
- retire_cond_var_(&retire_lock_) {
-}
-
-uint32 SyncPointManagerWrapper::GenerateSyncPoint() {
- uint32 sync_point = manager_->GenerateSyncPoint();
- manager_->AddSyncPointCallback(
- sync_point, base::Bind(&SyncPointManagerWrapper::OnSyncPointRetired,
- base::Unretained(this)));
- return sync_point;
-}
-
-void SyncPointManagerWrapper::RetireSyncPoint(uint32 sync_point) {
- manager_->RetireSyncPoint(sync_point);
-}
-
-void SyncPointManagerWrapper::AddSyncPointCallback(
- uint32 sync_point,
- const base::Closure& callback) {
- manager_->AddSyncPointCallback(sync_point, callback);
-}
-
-void SyncPointManagerWrapper::WaitSyncPoint(uint32 sync_point) {
- base::AutoLock lock(retire_lock_);
- while (!manager_->IsSyncPointRetired(sync_point)) {
- retire_cond_var_.Wait();
- }
-}
-
-void SyncPointManagerWrapper::OnSyncPointRetired() {
- base::AutoLock lock(retire_lock_);
- retire_cond_var_.Broadcast();
-}
-
-base::LazyInstance<SyncPointManagerWrapper> g_sync_point_manager =
- LAZY_INSTANCE_INITIALIZER;
-
base::SharedMemoryHandle ShareToGpuThread(
base::SharedMemoryHandle source_handle) {
return base::SharedMemory::DuplicateHandle(source_handle);
@@ -212,7 +102,7 @@ gfx::GpuMemoryBufferHandle ShareGpuMemoryBufferToGpuThread(
}
case gfx::IO_SURFACE_BUFFER:
case gfx::SURFACE_TEXTURE_BUFFER:
- case gfx::OZONE_NATIVE_BUFFER:
+ case gfx::OZONE_NATIVE_PIXMAP:
*requires_sync_point = true;
return source_handle;
default:
@@ -252,12 +142,7 @@ InProcessCommandBuffer::Service::share_group() {
scoped_refptr<gles2::MailboxManager>
InProcessCommandBuffer::Service::mailbox_manager() {
if (!mailbox_manager_.get()) {
- if (base::CommandLine::ForCurrentProcess()->HasSwitch(
- switches::kEnableThreadedTextureMailboxes)) {
- mailbox_manager_ = new gles2::MailboxManagerSync();
- } else {
- mailbox_manager_ = new gles2::MailboxManagerImpl();
- }
+ mailbox_manager_ = gles2::MailboxManager::Create();
}
return mailbox_manager_;
}
@@ -278,10 +163,22 @@ InProcessCommandBuffer::Service::pending_valuebuffer_state() {
return pending_valuebuffer_state_;
}
+gpu::gles2::ProgramCache* InProcessCommandBuffer::Service::program_cache() {
+ if (!program_cache_.get() &&
+ (gfx::g_driver_gl.ext.b_GL_ARB_get_program_binary ||
+ gfx::g_driver_gl.ext.b_GL_OES_get_program_binary) &&
+ !base::CommandLine::ForCurrentProcess()->HasSwitch(
+ switches::kDisableGpuProgramCache)) {
+ program_cache_.reset(new gpu::gles2::MemoryProgramCache());
+ }
+ return program_cache_.get();
+}
+
InProcessCommandBuffer::InProcessCommandBuffer(
const scoped_refptr<Service>& service)
- : context_lost_(false),
- idle_work_pending_(false),
+ : command_buffer_id_(g_next_command_buffer_id.GetNext()),
+ context_lost_(false),
+ delayed_work_pending_(false),
image_factory_(nullptr),
last_put_offset_(-1),
gpu_memory_buffer_manager_(nullptr),
@@ -390,7 +287,7 @@ bool InProcessCommandBuffer::InitializeOnGpuThread(
DCHECK(params.size.width() >= 0 && params.size.height() >= 0);
- TransferBufferManager* manager = new TransferBufferManager();
+ TransferBufferManager* manager = new TransferBufferManager(nullptr);
transfer_buffer_manager_ = manager;
manager->Initialize();
@@ -419,11 +316,10 @@ bool InProcessCommandBuffer::InitializeOnGpuThread(
decoder_.reset(gles2::GLES2Decoder::Create(
params.context_group
? params.context_group->decoder_->GetContextGroup()
- : new gles2::ContextGroup(service_->mailbox_manager(),
- NULL,
+ : new gles2::ContextGroup(service_->mailbox_manager(), NULL,
service_->shader_translator_cache(),
- NULL,
- service_->subscription_ref_set(),
+ service_->framebuffer_completeness_cache(),
+ NULL, service_->subscription_ref_set(),
service_->pending_valuebuffer_state(),
bind_generates_resource)));
@@ -448,6 +344,11 @@ bool InProcessCommandBuffer::InitializeOnGpuThread(
return false;
}
+ sync_point_client_state_ = SyncPointClientState::Create();
+ sync_point_client_ = service_->sync_point_manager()->CreateSyncPointClient(
+ sync_point_client_state_,
+ GetNamespaceID(), GetCommandBufferID());
+
if (service_->UseVirtualizedGLContexts() ||
decoder_->GetContextGroup()
->feature_info()
@@ -484,6 +385,14 @@ bool InProcessCommandBuffer::InitializeOnGpuThread(
return false;
}
+ if (!decoder_->GetContextGroup()->has_program_cache() &&
+ !decoder_->GetContextGroup()
+ ->feature_info()
+ ->workarounds()
+ .disable_program_cache) {
+ decoder_->GetContextGroup()->set_program_cache(service_->program_cache());
+ }
+
gles2::DisallowedFeatures disallowed_features;
disallowed_features.gpu_memory_manager = true;
if (!decoder_->Initialize(surface_,
@@ -535,6 +444,8 @@ bool InProcessCommandBuffer::DestroyOnGpuThread() {
}
context_ = NULL;
surface_ = NULL;
+ sync_point_client_ = NULL;
+ sync_point_client_state_ = NULL;
gl_share_group_ = NULL;
#if defined(OS_ANDROID)
stream_texture_manager_.reset();
@@ -577,10 +488,13 @@ int32 InProcessCommandBuffer::GetLastToken() {
return last_state_.token;
}
-void InProcessCommandBuffer::FlushOnGpuThread(int32 put_offset) {
+void InProcessCommandBuffer::FlushOnGpuThread(int32 put_offset,
+ uint32_t order_num) {
CheckSequencedThread();
ScopedEvent handle_flush(&flush_event_);
base::AutoLock lock(command_buffer_lock_);
+
+ sync_point_client_state_->BeginProcessingOrderNumber(order_num);
command_buffer_->Flush(put_offset);
{
// Update state before signaling the flush event.
@@ -590,32 +504,43 @@ void InProcessCommandBuffer::FlushOnGpuThread(int32 put_offset) {
DCHECK((!error::IsError(state_after_last_flush_.error) && !context_lost_) ||
(error::IsError(state_after_last_flush_.error) && context_lost_));
+ // Currently the in process command buffer does not support being descheduled,
+ // if it does we would need to back off on calling the finish processing
+ // order number function until the message is rescheduled and finished
+ // processing. This DCHECK is to enforce this.
+ DCHECK(context_lost_ || put_offset == state_after_last_flush_.get_offset);
+ sync_point_client_state_->FinishProcessingOrderNumber(order_num);
+
// If we've processed all pending commands but still have pending queries,
// pump idle work until the query is passed.
if (put_offset == state_after_last_flush_.get_offset &&
- gpu_scheduler_->HasMoreWork()) {
- ScheduleIdleWorkOnGpuThread();
+ (gpu_scheduler_->HasMoreIdleWork() ||
+ gpu_scheduler_->HasPendingQueries())) {
+ ScheduleDelayedWorkOnGpuThread();
}
}
-void InProcessCommandBuffer::PerformIdleWork() {
+void InProcessCommandBuffer::PerformDelayedWork() {
CheckSequencedThread();
- idle_work_pending_ = false;
+ delayed_work_pending_ = false;
base::AutoLock lock(command_buffer_lock_);
- if (MakeCurrent() && gpu_scheduler_->HasMoreWork()) {
+ if (MakeCurrent()) {
gpu_scheduler_->PerformIdleWork();
- ScheduleIdleWorkOnGpuThread();
+ gpu_scheduler_->ProcessPendingQueries();
+ if (gpu_scheduler_->HasMoreIdleWork() ||
+ gpu_scheduler_->HasPendingQueries()) {
+ ScheduleDelayedWorkOnGpuThread();
+ }
}
}
-void InProcessCommandBuffer::ScheduleIdleWorkOnGpuThread() {
+void InProcessCommandBuffer::ScheduleDelayedWorkOnGpuThread() {
CheckSequencedThread();
- if (idle_work_pending_)
+ if (delayed_work_pending_)
return;
- idle_work_pending_ = true;
- service_->ScheduleIdleWork(
- base::Bind(&InProcessCommandBuffer::PerformIdleWork,
- gpu_thread_weak_ptr_));
+ delayed_work_pending_ = true;
+ service_->ScheduleDelayedWork(base::Bind(
+ &InProcessCommandBuffer::PerformDelayedWork, gpu_thread_weak_ptr_));
}
void InProcessCommandBuffer::Flush(int32 put_offset) {
@@ -626,10 +551,14 @@ void InProcessCommandBuffer::Flush(int32 put_offset) {
if (last_put_offset_ == put_offset)
return;
+ SyncPointManager* sync_manager = service_->sync_point_manager();
+ const uint32_t order_num =
+ sync_point_client_state_->GenerateUnprocessedOrderNumber(sync_manager);
last_put_offset_ = put_offset;
base::Closure task = base::Bind(&InProcessCommandBuffer::FlushOnGpuThread,
gpu_thread_weak_ptr_,
- put_offset);
+ put_offset,
+ order_num);
QueueTask(task);
}
@@ -754,7 +683,7 @@ void InProcessCommandBuffer::CreateImageOnGpuThread(
int32 id,
const gfx::GpuMemoryBufferHandle& handle,
const gfx::Size& size,
- gfx::GpuMemoryBuffer::Format format,
+ gfx::BufferFormat format,
uint32 internalformat) {
if (!decoder_)
return;
@@ -834,7 +763,7 @@ int32 InProcessCommandBuffer::CreateGpuMemoryBufferImage(
scoped_ptr<gfx::GpuMemoryBuffer> buffer(
gpu_memory_buffer_manager_->AllocateGpuMemoryBuffer(
gfx::Size(width, height),
- gpu::ImageFactory::ImageFormatToGpuMemoryBufferFormat(internalformat),
+ gpu::ImageFactory::DefaultBufferFormatForImageFormat(internalformat),
gpu::ImageFactory::ImageUsageToGpuMemoryBufferUsage(usage)));
if (!buffer)
return -1;
@@ -843,7 +772,7 @@ int32 InProcessCommandBuffer::CreateGpuMemoryBufferImage(
}
uint32 InProcessCommandBuffer::InsertSyncPoint() {
- uint32 sync_point = g_sync_point_manager.Get().GenerateSyncPoint();
+ uint32 sync_point = service_->sync_point_manager()->GenerateSyncPoint();
QueueTask(base::Bind(&InProcessCommandBuffer::RetireSyncPointOnGpuThread,
base::Unretained(this),
sync_point));
@@ -851,7 +780,7 @@ uint32 InProcessCommandBuffer::InsertSyncPoint() {
}
uint32 InProcessCommandBuffer::InsertFutureSyncPoint() {
- return g_sync_point_manager.Get().GenerateSyncPoint();
+ return service_->sync_point_manager()->GenerateSyncPoint();
}
void InProcessCommandBuffer::RetireSyncPoint(uint32 sync_point) {
@@ -872,7 +801,7 @@ void InProcessCommandBuffer::RetireSyncPointOnGpuThread(uint32 sync_point) {
if (make_current_success)
mailbox_manager->PushTextureUpdates(sync_point);
}
- g_sync_point_manager.Get().RetireSyncPoint(sync_point);
+ service_->sync_point_manager()->RetireSyncPoint(sync_point);
}
void InProcessCommandBuffer::SignalSyncPoint(unsigned sync_point,
@@ -885,7 +814,7 @@ void InProcessCommandBuffer::SignalSyncPoint(unsigned sync_point,
}
bool InProcessCommandBuffer::WaitSyncPointOnGpuThread(unsigned sync_point) {
- g_sync_point_manager.Get().WaitSyncPoint(sync_point);
+ service_->sync_point_manager()->WaitSyncPoint(sync_point);
gles2::MailboxManager* mailbox_manager =
decoder_->GetContextGroup()->mailbox_manager();
mailbox_manager->PullTextureUpdates(sync_point);
@@ -895,7 +824,7 @@ bool InProcessCommandBuffer::WaitSyncPointOnGpuThread(unsigned sync_point) {
void InProcessCommandBuffer::SignalSyncPointOnGpuThread(
unsigned sync_point,
const base::Closure& callback) {
- g_sync_point_manager.Get().AddSyncPointCallback(sync_point, callback);
+ service_->sync_point_manager()->AddSyncPointCallback(sync_point, callback);
}
void InProcessCommandBuffer::SignalQuery(unsigned query_id,
@@ -944,6 +873,14 @@ bool InProcessCommandBuffer::IsGpuChannelLost() {
return false;
}
+CommandBufferNamespace InProcessCommandBuffer::GetNamespaceID() const {
+ return CommandBufferNamespace::IN_PROCESS;
+}
+
+uint64_t InProcessCommandBuffer::GetCommandBufferID() const {
+ return command_buffer_id_;
+}
+
uint32 InProcessCommandBuffer::CreateStreamTextureOnGpuThread(
uint32 client_texture_id) {
#if defined(OS_ANDROID)
@@ -1008,4 +945,53 @@ InProcessCommandBuffer::GetSurfaceTexture(uint32 stream_id) {
}
#endif
+GpuInProcessThread::GpuInProcessThread(SyncPointManager* sync_point_manager)
+ : base::Thread("GpuThread"), sync_point_manager_(sync_point_manager) {
+ Start();
+}
+
+GpuInProcessThread::~GpuInProcessThread() {
+ Stop();
+}
+
+void GpuInProcessThread::AddRef() const {
+ base::RefCountedThreadSafe<GpuInProcessThread>::AddRef();
+}
+void GpuInProcessThread::Release() const {
+ base::RefCountedThreadSafe<GpuInProcessThread>::Release();
+}
+
+void GpuInProcessThread::ScheduleTask(const base::Closure& task) {
+ task_runner()->PostTask(FROM_HERE, task);
+}
+
+void GpuInProcessThread::ScheduleDelayedWork(const base::Closure& callback) {
+ // Match delay with GpuCommandBufferStub.
+ task_runner()->PostDelayedTask(FROM_HERE, callback,
+ base::TimeDelta::FromMilliseconds(2));
+}
+
+bool GpuInProcessThread::UseVirtualizedGLContexts() {
+ return false;
+}
+
+scoped_refptr<gles2::ShaderTranslatorCache>
+GpuInProcessThread::shader_translator_cache() {
+ if (!shader_translator_cache_.get())
+ shader_translator_cache_ = new gpu::gles2::ShaderTranslatorCache;
+ return shader_translator_cache_;
+}
+
+scoped_refptr<gles2::FramebufferCompletenessCache>
+GpuInProcessThread::framebuffer_completeness_cache() {
+ if (!framebuffer_completeness_cache_.get())
+ framebuffer_completeness_cache_ =
+ new gpu::gles2::FramebufferCompletenessCache;
+ return framebuffer_completeness_cache_;
+}
+
+SyncPointManager* GpuInProcessThread::sync_point_manager() {
+ return sync_point_manager_;
+}
+
} // namespace gpu
diff --git a/chromium/gpu/command_buffer/service/in_process_command_buffer.h b/chromium/gpu/command_buffer/service/in_process_command_buffer.h
index bfc0867cea1..f4f91f81009 100644
--- a/chromium/gpu/command_buffer/service/in_process_command_buffer.h
+++ b/chromium/gpu/command_buffer/service/in_process_command_buffer.h
@@ -17,6 +17,7 @@
#include "base/memory/weak_ptr.h"
#include "base/synchronization/lock.h"
#include "base/synchronization/waitable_event.h"
+#include "base/threading/thread.h"
#include "gpu/command_buffer/client/gpu_control.h"
#include "gpu/command_buffer/common/command_buffer.h"
#include "gpu/gpu_export.h"
@@ -46,11 +47,16 @@ class StreamTextureManagerInProcess;
#endif
namespace gpu {
+class SyncPointClient;
+class SyncPointClientState;
+class SyncPointManager;
class ValueStateMap;
namespace gles2 {
+class FramebufferCompletenessCache;
class GLES2Decoder;
class MailboxManager;
+class ProgramCache;
class ShaderTranslatorCache;
class SubscriptionRefSet;
}
@@ -122,6 +128,8 @@ class GPU_EXPORT InProcessCommandBuffer : public CommandBuffer,
uint32 CreateStreamTexture(uint32 texture_id) override;
void SetLock(base::Lock*) override;
bool IsGpuChannelLost() override;
+ CommandBufferNamespace GetNamespaceID() const override;
+ uint64_t GetCommandBufferID() const override;
// The serializer interface to the GPU service (i.e. thread).
class Service {
@@ -135,23 +143,28 @@ class GPU_EXPORT InProcessCommandBuffer : public CommandBuffer,
// Queues a task to run as soon as possible.
virtual void ScheduleTask(const base::Closure& task) = 0;
- // Schedules |callback| to run at an appropriate time for performing idle
+ // Schedules |callback| to run at an appropriate time for performing delayed
// work.
- virtual void ScheduleIdleWork(const base::Closure& task) = 0;
+ virtual void ScheduleDelayedWork(const base::Closure& task) = 0;
virtual bool UseVirtualizedGLContexts() = 0;
virtual scoped_refptr<gles2::ShaderTranslatorCache>
shader_translator_cache() = 0;
+ virtual scoped_refptr<gles2::FramebufferCompletenessCache>
+ framebuffer_completeness_cache() = 0;
+ virtual SyncPointManager* sync_point_manager() = 0;
scoped_refptr<gfx::GLShareGroup> share_group();
scoped_refptr<gles2::MailboxManager> mailbox_manager();
scoped_refptr<gles2::SubscriptionRefSet> subscription_ref_set();
scoped_refptr<gpu::ValueStateMap> pending_valuebuffer_state();
+ gpu::gles2::ProgramCache* program_cache();
private:
scoped_refptr<gfx::GLShareGroup> share_group_;
scoped_refptr<gles2::MailboxManager> mailbox_manager_;
scoped_refptr<gles2::SubscriptionRefSet> subscription_ref_set_;
scoped_refptr<gpu::ValueStateMap> pending_valuebuffer_state_;
+ scoped_ptr<gpu::gles2::ProgramCache> program_cache_;
};
#if defined(OS_ANDROID)
@@ -190,8 +203,8 @@ class GPU_EXPORT InProcessCommandBuffer : public CommandBuffer,
bool InitializeOnGpuThread(const InitializeOnGpuThreadParams& params);
bool DestroyOnGpuThread();
- void FlushOnGpuThread(int32 put_offset);
- void ScheduleIdleWorkOnGpuThread();
+ void FlushOnGpuThread(int32 put_offset, uint32_t order_num);
+ void ScheduleDelayedWorkOnGpuThread();
uint32 CreateStreamTextureOnGpuThread(uint32 client_texture_id);
bool MakeCurrent();
base::Closure WrapCallback(const base::Closure& callback);
@@ -207,7 +220,7 @@ class GPU_EXPORT InProcessCommandBuffer : public CommandBuffer,
void CreateImageOnGpuThread(int32 id,
const gfx::GpuMemoryBufferHandle& handle,
const gfx::Size& size,
- gfx::GpuMemoryBuffer::Format format,
+ gfx::BufferFormat format,
uint32 internalformat);
void DestroyImageOnGpuThread(int32 id);
void SetGetBufferOnGpuThread(int32 shm_id, base::WaitableEvent* completion);
@@ -217,7 +230,9 @@ class GPU_EXPORT InProcessCommandBuffer : public CommandBuffer,
void OnResizeView(gfx::Size size, float scale_factor);
bool GetBufferChanged(int32 transfer_buffer_id);
void PumpCommands();
- void PerformIdleWork();
+ void PerformDelayedWork();
+
+ const uint64_t command_buffer_id_;
// Members accessed on the gpu thread (possibly with the exception of
// creation):
@@ -227,8 +242,10 @@ class GPU_EXPORT InProcessCommandBuffer : public CommandBuffer,
scoped_ptr<gles2::GLES2Decoder> decoder_;
scoped_refptr<gfx::GLContext> context_;
scoped_refptr<gfx::GLSurface> surface_;
+ scoped_refptr<SyncPointClientState> sync_point_client_state_;
+ scoped_ptr<SyncPointClient> sync_point_client_;
base::Closure context_lost_callback_;
- bool idle_work_pending_; // Used to throttle PerformIdleWork.
+ bool delayed_work_pending_; // Used to throttle PerformDelayedWork.
ImageFactory* image_factory_;
// Members accessed on the client thread:
@@ -261,6 +278,36 @@ class GPU_EXPORT InProcessCommandBuffer : public CommandBuffer,
DISALLOW_COPY_AND_ASSIGN(InProcessCommandBuffer);
};
+// Default Service class when a null service is used.
+class GPU_EXPORT GpuInProcessThread
+ : public base::Thread,
+ public NON_EXPORTED_BASE(InProcessCommandBuffer::Service),
+ public base::RefCountedThreadSafe<GpuInProcessThread> {
+ public:
+ explicit GpuInProcessThread(SyncPointManager* sync_point_manager);
+
+ void AddRef() const override;
+ void Release() const override;
+ void ScheduleTask(const base::Closure& task) override;
+ void ScheduleDelayedWork(const base::Closure& callback) override;
+ bool UseVirtualizedGLContexts() override;
+ scoped_refptr<gles2::ShaderTranslatorCache> shader_translator_cache()
+ override;
+ scoped_refptr<gles2::FramebufferCompletenessCache>
+ framebuffer_completeness_cache() override;
+ SyncPointManager* sync_point_manager() override;
+
+ private:
+ ~GpuInProcessThread() override;
+ friend class base::RefCountedThreadSafe<GpuInProcessThread>;
+
+ SyncPointManager* sync_point_manager_; // Non-owning.
+ scoped_refptr<gpu::gles2::ShaderTranslatorCache> shader_translator_cache_;
+ scoped_refptr<gpu::gles2::FramebufferCompletenessCache>
+ framebuffer_completeness_cache_;
+ DISALLOW_COPY_AND_ASSIGN(GpuInProcessThread);
+};
+
} // namespace gpu
#endif // GPU_COMMAND_BUFFER_SERVICE_IN_PROCESS_COMMAND_BUFFER_H_
diff --git a/chromium/gpu/command_buffer/service/mailbox_manager.cc b/chromium/gpu/command_buffer/service/mailbox_manager.cc
new file mode 100644
index 00000000000..e8432ed17c5
--- /dev/null
+++ b/chromium/gpu/command_buffer/service/mailbox_manager.cc
@@ -0,0 +1,25 @@
+// Copyright 2015 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/command_buffer/service/mailbox_manager.h"
+
+#include "base/command_line.h"
+#include "gpu/command_buffer/service/gpu_switches.h"
+#include "gpu/command_buffer/service/mailbox_manager_impl.h"
+#include "gpu/command_buffer/service/mailbox_manager_sync.h"
+
+namespace gpu {
+namespace gles2 {
+
+// static
+scoped_refptr<MailboxManager> MailboxManager::Create() {
+ if (base::CommandLine::ForCurrentProcess()->HasSwitch(
+ switches::kEnableThreadedTextureMailboxes)) {
+ return scoped_refptr<MailboxManager>(new MailboxManagerSync);
+ }
+ return scoped_refptr<MailboxManager>(new MailboxManagerImpl);
+}
+
+} // namespage gles2
+} // namespace gpu
diff --git a/chromium/gpu/command_buffer/service/mailbox_manager.h b/chromium/gpu/command_buffer/service/mailbox_manager.h
index 8b53ce4c14d..2bfdb8957f5 100644
--- a/chromium/gpu/command_buffer/service/mailbox_manager.h
+++ b/chromium/gpu/command_buffer/service/mailbox_manager.h
@@ -17,6 +17,8 @@ class Texture;
// Manages resources scoped beyond the context or context group level.
class GPU_EXPORT MailboxManager : public base::RefCounted<MailboxManager> {
public:
+ static scoped_refptr<MailboxManager> Create();
+
// Look up the texture definition from the named mailbox.
virtual Texture* ConsumeTexture(const Mailbox& mailbox) = 0;
diff --git a/chromium/gpu/command_buffer/service/mailbox_manager_sync.cc b/chromium/gpu/command_buffer/service/mailbox_manager_sync.cc
index be12b3a8fe8..09d0d52251f 100644
--- a/chromium/gpu/command_buffer/service/mailbox_manager_sync.cc
+++ b/chromium/gpu/command_buffer/service/mailbox_manager_sync.cc
@@ -325,7 +325,6 @@ void MailboxManagerSync::PullTextureUpdates(uint32 sync_point) {
}
if (!needs_update.empty()) {
- ScopedUpdateTexture scoped_update_texture;
for (const TextureUpdatePair& pair : needs_update) {
pair.second.UpdateTexture(pair.first);
}
diff --git a/chromium/gpu/command_buffer/service/mailbox_manager_unittest.cc b/chromium/gpu/command_buffer/service/mailbox_manager_unittest.cc
index 3e14b76dc71..d715a398160 100644
--- a/chromium/gpu/command_buffer/service/mailbox_manager_unittest.cc
+++ b/chromium/gpu/command_buffer/service/mailbox_manager_unittest.cc
@@ -238,9 +238,6 @@ class MailboxManagerSyncTest : public MailboxManagerTest {
EXPECT_CALL(*gl_, BindTexture(GL_TEXTURE_2D, kCurrentTexture))
.Times(1)
.RetiresOnSaturation();
- EXPECT_CALL(*gl_, Flush())
- .Times(1)
- .RetiresOnSaturation();
}
void TearDown() override {
diff --git a/chromium/gpu/command_buffer/service/memory_tracking.h b/chromium/gpu/command_buffer/service/memory_tracking.h
index a7447e4e5d5..14bf29cd088 100644
--- a/chromium/gpu/command_buffer/service/memory_tracking.h
+++ b/chromium/gpu/command_buffer/service/memory_tracking.h
@@ -30,6 +30,16 @@ class MemoryTracker : public base::RefCounted<MemoryTracker> {
// Ensure a certain amount of GPU memory is free. Returns true on success.
virtual bool EnsureGPUMemoryAvailable(size_t size_needed) = 0;
+ // Tracing id which identifies the GPU client for whom memory is being
+ // allocated.
+ virtual uint64_t ClientTracingId() const = 0;
+
+ // Identifies the share group within which memory is being allocated.
+ virtual uint64_t ShareGroupTracingGUID() const = 0;
+
+ // Raw ID identifying the GPU client for whom memory is being allocated.
+ virtual int ClientId() const = 0;
+
protected:
friend class base::RefCounted<MemoryTracker>;
MemoryTracker() {}
diff --git a/chromium/gpu/command_buffer/service/mocks.h b/chromium/gpu/command_buffer/service/mocks.h
index 02a08dbad53..b503ce0eef6 100644
--- a/chromium/gpu/command_buffer/service/mocks.h
+++ b/chromium/gpu/command_buffer/service/mocks.h
@@ -89,12 +89,12 @@ class MockShaderTranslator : public ShaderTranslatorInterface {
public:
MockShaderTranslator();
- MOCK_METHOD5(Init, bool(
- sh::GLenum shader_type,
- ShShaderSpec shader_spec,
- const ShBuiltInResources* resources,
- GlslImplementationType glsl_implementation_type,
- ShCompileOptions driver_bug_workarounds));
+ MOCK_METHOD5(Init,
+ bool(sh::GLenum shader_type,
+ ShShaderSpec shader_spec,
+ const ShBuiltInResources* resources,
+ ShShaderOutput shader_output_language,
+ ShCompileOptions driver_bug_workarounds));
MOCK_CONST_METHOD8(Translate, bool(
const std::string& shader_source,
std::string* info_log,
@@ -145,6 +145,9 @@ class MockMemoryTracker : public MemoryTracker {
MOCK_METHOD3(TrackMemoryAllocatedChange, void(
size_t old_size, size_t new_size, Pool pool));
MOCK_METHOD1(EnsureGPUMemoryAvailable, bool(size_t size_needed));
+ MOCK_CONST_METHOD0(ClientTracingId, uint64_t());
+ MOCK_CONST_METHOD0(ClientId, int());
+ MOCK_CONST_METHOD0(ShareGroupTracingGUID, uint64_t());
private:
friend class ::testing::StrictMock<MockMemoryTracker>;
diff --git a/chromium/gpu/command_buffer/service/path_manager.cc b/chromium/gpu/command_buffer/service/path_manager.cc
new file mode 100644
index 00000000000..3e0d257e1a0
--- /dev/null
+++ b/chromium/gpu/command_buffer/service/path_manager.cc
@@ -0,0 +1,252 @@
+// Copyright (c) 2015 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/command_buffer/service/path_manager.h"
+
+#include <algorithm>
+
+#include "base/logging.h"
+#include "gpu/command_buffer/common/gles2_cmd_utils.h"
+#include "ui/gl/gl_bindings.h"
+
+namespace gpu {
+namespace gles2 {
+
+namespace {
+void CallDeletePaths(GLuint first_id, GLuint range) {
+ while (range > 0) {
+ GLsizei irange;
+ if (range > static_cast<GLuint>(std::numeric_limits<GLsizei>::max()))
+ irange = std::numeric_limits<GLsizei>::max();
+ else
+ irange = static_cast<GLsizei>(range);
+
+ glDeletePathsNV(first_id, irange);
+ range -= irange;
+ first_id += irange;
+ }
+}
+
+template <typename RangeIterator>
+static GLuint RangeSize(const RangeIterator& it) {
+ return it->second.last_client_id - it->first + 1;
+}
+template <typename RangeIterator>
+static GLuint FirstClientId(const RangeIterator& it) {
+ return it->first;
+}
+template <typename RangeIterator>
+static GLuint FirstServiceId(const RangeIterator& it) {
+ return it->second.first_service_id;
+}
+template <typename RangeIterator>
+static GLuint LastServiceId(const RangeIterator& it) {
+ return FirstServiceId(it) + RangeSize(it) - 1;
+}
+static GLuint LastClientId(PathManager::PathRangeMap::const_iterator& it) {
+ return it->second.last_client_id;
+}
+// Note: this one can be assigned to.
+static GLuint& LastClientId(PathManager::PathRangeMap::iterator& it) {
+ return it->second.last_client_id;
+}
+
+template <typename T>
+struct IteratorSelector {
+ typedef typename T::iterator iterator;
+};
+template <typename T>
+struct IteratorSelector<const T> {
+ typedef typename T::const_iterator iterator;
+};
+
+// Returns the range position that contains |client_id| or
+// |PathRangeMap::iterator::end()| if |client_id| is not found.
+template <typename MapType>
+static typename IteratorSelector<MapType>::iterator GetContainingRange(
+ MapType& path_map,
+ GLuint client_id) {
+ auto it = path_map.lower_bound(client_id);
+ if (it != path_map.end() && FirstClientId(it) == client_id)
+ return it;
+ if (it != path_map.begin()) {
+ --it;
+ if (LastClientId(it) >= client_id)
+ return it;
+ }
+ return path_map.end();
+}
+
+// Returns the range position that contains |client_id|. If that is
+// not available, returns the range that has smallest
+// |first_client_id| that is bigger than |client_id|. Returns
+// |PathRangeMap::iterator::end()| if there is no such range.
+template <typename MapType>
+static typename IteratorSelector<MapType>::iterator GetContainingOrNextRange(
+ MapType& path_map,
+ GLuint client_id) {
+ auto it = path_map.lower_bound(client_id);
+ if (it != path_map.end() && FirstClientId(it) == client_id) {
+ return it;
+ }
+ if (it != path_map.begin()) {
+ --it;
+ if (LastClientId(it) >= client_id)
+ return it;
+ ++it;
+ }
+ return it;
+}
+
+} // anonymous namespace
+
+PathManager::PathManager() {
+}
+
+PathManager::~PathManager() {
+ DCHECK(path_map_.empty());
+}
+
+void PathManager::Destroy(bool have_context) {
+ if (have_context) {
+ for (PathRangeMap::const_iterator it = path_map_.begin();
+ it != path_map_.end(); ++it)
+ CallDeletePaths(FirstServiceId(it), RangeSize(it));
+ }
+ path_map_.clear();
+}
+
+void PathManager::CreatePathRange(GLuint first_client_id,
+ GLuint last_client_id,
+ GLuint first_service_id) {
+ DCHECK(first_service_id > 0u);
+ DCHECK(first_client_id > 0u);
+ DCHECK(!HasPathsInRange(first_client_id, last_client_id));
+ DCHECK(CheckConsistency());
+
+ PathRangeMap::iterator range =
+ GetContainingRange(path_map_, first_client_id - 1u);
+
+ if (range != path_map_.end() &&
+ LastServiceId(range) == first_service_id - 1u) {
+ DCHECK_EQ(LastClientId(range), first_client_id - 1u);
+ LastClientId(range) = last_client_id;
+ } else {
+ auto result = path_map_.insert(
+ std::make_pair(first_client_id,
+ PathRangeDescription(last_client_id, first_service_id)));
+ DCHECK(result.second);
+ range = result.first;
+ }
+
+ PathRangeMap::iterator next_range = range;
+ ++next_range;
+ if (next_range != path_map_.end()) {
+ if (LastClientId(range) == FirstClientId(next_range) - 1u &&
+ LastServiceId(range) == FirstServiceId(next_range) - 1u) {
+ LastClientId(range) = LastClientId(next_range);
+ path_map_.erase(next_range);
+ }
+ }
+ DCHECK(CheckConsistency());
+}
+
+bool PathManager::HasPathsInRange(GLuint first_client_id,
+ GLuint last_client_id) const {
+ PathRangeMap::const_iterator it =
+ GetContainingOrNextRange(path_map_, first_client_id);
+ if (it == path_map_.end())
+ return false;
+
+ return FirstClientId(it) <= last_client_id;
+}
+
+bool PathManager::GetPath(GLuint client_id, GLuint* service_id) const {
+ PathRangeMap::const_iterator range = GetContainingRange(path_map_, client_id);
+ if (range == path_map_.end())
+ return false;
+
+ *service_id = FirstServiceId(range) + client_id - FirstClientId(range);
+ return true;
+}
+
+void PathManager::RemovePaths(GLuint first_client_id, GLuint last_client_id) {
+ DCHECK(CheckConsistency());
+ PathRangeMap::iterator it =
+ GetContainingOrNextRange(path_map_, first_client_id);
+
+ while (it != path_map_.end() && FirstClientId(it) <= last_client_id) {
+ GLuint delete_first_client_id =
+ std::max(first_client_id, FirstClientId(it));
+ GLuint delete_last_client_id = std::min(last_client_id, LastClientId(it));
+ GLuint delete_first_service_id =
+ FirstServiceId(it) + delete_first_client_id - FirstClientId(it);
+ GLuint delete_range = delete_last_client_id - delete_first_client_id + 1u;
+
+ CallDeletePaths(delete_first_service_id, delete_range);
+
+ PathRangeMap::iterator current = it;
+ ++it;
+
+ GLuint current_last_client_id = LastClientId(current);
+
+ if (FirstClientId(current) < delete_first_client_id)
+ LastClientId(current) = delete_first_client_id - 1u;
+ else
+ path_map_.erase(current);
+
+ if (current_last_client_id > delete_last_client_id) {
+ path_map_.insert(std::make_pair(
+ delete_last_client_id + 1u,
+ PathRangeDescription(current_last_client_id,
+ delete_first_service_id + delete_range)));
+ DCHECK(delete_last_client_id == last_client_id);
+ // This is necessarily the last range to check. Return early due to
+ // consistency. Iterator increment would skip the inserted range. The
+ // algorithm would work ok, but it looks weird.
+ DCHECK(CheckConsistency());
+ return;
+ }
+ }
+ DCHECK(CheckConsistency());
+}
+
+bool PathManager::CheckConsistency() {
+ GLuint prev_first_client_id = 0u;
+ GLuint prev_last_client_id = 0u;
+ GLuint prev_first_service_id = 0u;
+ for (PathRangeMap::iterator range = path_map_.begin();
+ range != path_map_.end(); ++range) {
+ // Code relies on ranges not starting at 0. Also, the above initialization
+ // is only
+ // correct then.
+ if (FirstClientId(range) == 0u || FirstServiceId(range) == 0u)
+ return false;
+
+ // Each range is consistent.
+ if (FirstClientId(range) > LastClientId(range))
+ return false;
+
+ if (prev_first_client_id != 0u) {
+ // No overlapping ranges. (The iteration is sorted).
+ if (FirstClientId(range) <= prev_last_client_id)
+ return false;
+
+ // No mergeable ranges.
+ bool is_mergeable_client =
+ FirstClientId(range) - 1u == prev_last_client_id;
+ bool is_mergeable_service =
+ FirstServiceId(range) - 1u == prev_first_service_id;
+ if (is_mergeable_client && is_mergeable_service)
+ return false;
+ }
+ prev_first_client_id = FirstClientId(range);
+ prev_last_client_id = LastClientId(range);
+ prev_first_service_id = FirstServiceId(range);
+ }
+ return true;
+}
+
+} // namespace gles2
+} // namespace gpu
diff --git a/chromium/gpu/command_buffer/service/path_manager.h b/chromium/gpu/command_buffer/service/path_manager.h
new file mode 100644
index 00000000000..78a53b7e203
--- /dev/null
+++ b/chromium/gpu/command_buffer/service/path_manager.h
@@ -0,0 +1,68 @@
+// Copyright (c) 2015 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_COMMAND_BUFFER_SERVICE_PATH_MANAGER_H_
+#define GPU_COMMAND_BUFFER_SERVICE_PATH_MANAGER_H_
+
+#include <map>
+
+#include "base/basictypes.h"
+#include "gpu/command_buffer/service/gl_utils.h"
+#include "gpu/gpu_export.h"
+
+namespace gpu {
+namespace gles2 {
+
+// This class keeps track of paths and their client and service ids
+// so we can correctly clear them.
+class GPU_EXPORT PathManager {
+ public:
+ PathManager();
+ ~PathManager();
+
+ // Must call before destruction.
+ void Destroy(bool have_context);
+
+ // Creates a path mapping between closed intervals
+ // [first_client_id, last_client_id] -> [first_service_id, ...].
+ void CreatePathRange(GLuint first_client_id,
+ GLuint last_client_id,
+ GLuint first_service_id);
+
+ // Returns true if any path exists in the closed interval
+ // [first_client_id, last_client_id].
+ bool HasPathsInRange(GLuint first_client_id, GLuint last_client_id) const;
+
+ // Gets the path id corresponding the client path id.
+ // Returns false if no such service path id was not found.
+ bool GetPath(GLuint client_id, GLuint* service_id) const;
+
+ // Removes a closed interval of paths [first_client_id, last_client_id].
+ void RemovePaths(GLuint first_client_id, GLuint last_client_id);
+
+ // Mapping between client id and service id.
+ // Should be used only by the implementation.
+ struct PathRangeDescription {
+ PathRangeDescription(GLuint last_client, GLuint first_service)
+ : last_client_id(last_client), first_service_id(first_service) {}
+ GLuint last_client_id;
+ GLuint first_service_id;
+ typedef GLuint ServiceIdType;
+ };
+ typedef std::map<GLuint, PathRangeDescription> PathRangeMap;
+
+ private:
+ // Checks for consistency inside the book-keeping structures. Used as
+ // DCHECK pre/post condition in mutating functions.
+ bool CheckConsistency();
+
+ PathRangeMap path_map_;
+
+ DISALLOW_COPY_AND_ASSIGN(PathManager);
+};
+
+} // namespace gles2
+} // namespace gpu
+
+#endif // GPU_COMMAND_BUFFER_SERVICE_PATH_MANAGER_H_
diff --git a/chromium/gpu/command_buffer/service/path_manager_unittest.cc b/chromium/gpu/command_buffer/service/path_manager_unittest.cc
new file mode 100644
index 00000000000..8a20db5b856
--- /dev/null
+++ b/chromium/gpu/command_buffer/service/path_manager_unittest.cc
@@ -0,0 +1,164 @@
+// Copyright (c) 2015 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/command_buffer/service/path_manager.h"
+
+#include "base/memory/scoped_ptr.h"
+#include "gpu/command_buffer/service/gpu_service_test.h"
+#include "gpu/command_buffer/service/mocks.h"
+#include "testing/gtest/include/gtest/gtest.h"
+#include "ui/gl/gl_mock.h"
+
+namespace gpu {
+namespace gles2 {
+
+class PathManagerTest : public GpuServiceTest {
+ public:
+ PathManagerTest() {}
+
+ protected:
+ void SetUp() override {
+ SetUpWithGLVersion("3.0", "GL_NV_path_rendering");
+ manager_.reset(new PathManager());
+ }
+
+ void TearDown() override {
+ manager_->Destroy(true);
+ manager_.reset();
+ GpuServiceTest::TearDown();
+ }
+
+ scoped_ptr<PathManager> manager_;
+};
+
+TEST_F(PathManagerTest, Basic) {
+ const GLuint kClient1Id = 1;
+ const GLuint kService1Id = 11;
+ const GLuint kClient2Id = 2;
+ GLuint service_id = 0;
+ manager_->CreatePathRange(kClient1Id, kClient1Id, kService1Id);
+ ASSERT_TRUE(manager_->HasPathsInRange(kClient1Id, kClient1Id));
+ EXPECT_TRUE(manager_->GetPath(kClient1Id, &service_id));
+ EXPECT_EQ(kService1Id, service_id);
+
+ // Check we get nothing for a non-existent path.
+ service_id = 123u;
+ ASSERT_FALSE(manager_->HasPathsInRange(kClient2Id, kClient2Id));
+ EXPECT_FALSE(manager_->GetPath(kClient2Id, &service_id));
+ EXPECT_EQ(123u, service_id);
+
+ // Check trying to remove non-existent paths does not crash.
+ manager_->RemovePaths(kClient2Id, kClient2Id);
+
+ // Check that it gets deleted when the last reference is released.
+ EXPECT_CALL(*gl_, DeletePathsNV(kService1Id, 1))
+ .Times(1)
+ .RetiresOnSaturation();
+
+ // Check we can't get the path after we remove it.
+ manager_->RemovePaths(kClient1Id, kClient1Id);
+ ASSERT_FALSE(manager_->HasPathsInRange(kClient1Id, kClient1Id));
+ EXPECT_FALSE(manager_->GetPath(kClient1Id, &service_id));
+}
+
+// Tests that path manager does not merge ranges that contain service ids that
+// prevent the merging. Path ranges A and B can be merged if
+// * client ids of B start immediately after the last client id of A
+// * service ids of B start immediately after the last service id of A
+// and similarly for the 'before' case.
+TEST_F(PathManagerTest, NonContiguousServiceIds) {
+ const GLuint kMergeCheckRange = 54;
+
+ const struct {
+ GLuint first_client_id;
+ GLuint last_client_id;
+ GLuint first_service_id;
+ } kIdRanges[] = {{500, 1000, 900}, {1001, 1155, 1}, {200, 499, 4888}};
+ for (auto& range : kIdRanges) {
+ manager_->CreatePathRange(range.first_client_id, range.last_client_id,
+ range.first_service_id);
+ ASSERT_TRUE(manager_->HasPathsInRange(range.first_client_id,
+ range.first_client_id));
+ ASSERT_TRUE(
+ manager_->HasPathsInRange(range.last_client_id, range.last_client_id));
+ ASSERT_TRUE(
+ manager_->HasPathsInRange(range.first_client_id, range.last_client_id));
+ GLuint service_id = 0u;
+ EXPECT_TRUE(manager_->GetPath(range.first_client_id + 5u, &service_id));
+ EXPECT_EQ(range.first_service_id + 5u, service_id);
+ }
+
+ // Insert a mergeable range last, to check that merges
+ // work. Otherwise the test could succeed because merges were not
+ // working.
+ auto& merge_candidate = kIdRanges[1];
+ GLuint merge_candidate_range =
+ merge_candidate.last_client_id - merge_candidate.first_client_id + 1;
+ manager_->CreatePathRange(
+ merge_candidate.last_client_id + 1,
+ merge_candidate.last_client_id + kMergeCheckRange,
+ merge_candidate.first_service_id + merge_candidate_range);
+
+ // We detect that ranges were not merged accidentally by detecting individual
+ // deletes.
+ for (auto& range : kIdRanges) {
+ if (&range == &merge_candidate)
+ continue;
+ GLsizei range_amount = range.last_client_id - range.first_client_id + 1;
+ EXPECT_CALL(*gl_, DeletePathsNV(range.first_service_id, range_amount))
+ .Times(1)
+ .RetiresOnSaturation();
+ }
+
+ // Just a check that merges work.
+ EXPECT_CALL(*gl_, DeletePathsNV(merge_candidate.first_service_id,
+ merge_candidate_range + kMergeCheckRange))
+ .Times(1)
+ .RetiresOnSaturation();
+
+ // Remove all ids. This should cause the expected amount of DeletePathsNV
+ // calls.
+ manager_->RemovePaths(1, std::numeric_limits<GLsizei>::max());
+
+ for (auto& range : kIdRanges) {
+ ASSERT_FALSE(
+ manager_->HasPathsInRange(range.first_client_id, range.last_client_id));
+ }
+}
+
+TEST_F(PathManagerTest, DeleteBigRange) {
+ // Allocates two ranges which in path manager end up merging as one
+ // big range. The range will be too big to fit in one DeletePaths
+ // call. Test that the range is deleted correctly with two calls.
+ const GLuint kFirstClientId1 = 1;
+ const GLsizei kRange1 = std::numeric_limits<GLsizei>::max() - 3;
+ const GLuint kLastClientId1 = kFirstClientId1 + kRange1 - 1;
+ const GLuint kFirstServiceId1 = 77;
+ const GLuint kLastServiceId1 = kFirstServiceId1 + kRange1 - 1;
+
+ const GLuint kFirstClientId2 = kLastClientId1 + 1;
+ const GLsizei kRange2 = 15;
+ const GLuint kLastClientId2 = kFirstClientId2 + kRange2 - 1;
+ const GLuint kFirstServiceId2 = kLastServiceId1 + 1;
+
+ const GLsizei kFirstDeleteRange = std::numeric_limits<GLsizei>::max();
+ const GLsizei kSecondDeleteRange = kRange2 - (kFirstDeleteRange - kRange1);
+ const GLuint kSecondDeleteFirstServiceId =
+ kFirstServiceId1 + kFirstDeleteRange;
+
+ EXPECT_CALL(*gl_, DeletePathsNV(kFirstServiceId1,
+ std::numeric_limits<GLsizei>::max()))
+ .RetiresOnSaturation();
+
+ EXPECT_CALL(*gl_, DeletePathsNV(kSecondDeleteFirstServiceId,
+ kSecondDeleteRange)).RetiresOnSaturation();
+
+ manager_->CreatePathRange(kFirstClientId1, kLastClientId1, kFirstServiceId1);
+ manager_->CreatePathRange(kFirstClientId2, kLastClientId2, kFirstServiceId2);
+ manager_->RemovePaths(0, std::numeric_limits<GLuint>::max());
+}
+
+} // namespace gles2
+
+} // namespace gpu
diff --git a/chromium/gpu/command_buffer/service/program_cache.cc b/chromium/gpu/command_buffer/service/program_cache.cc
index 31802de2e0b..ee1a736b9e0 100644
--- a/chromium/gpu/command_buffer/service/program_cache.cc
+++ b/chromium/gpu/command_buffer/service/program_cache.cc
@@ -7,6 +7,7 @@
#include <string>
#include "base/memory/scoped_ptr.h"
#include "gpu/command_buffer/service/shader_manager.h"
+#include "third_party/angle/src/common/version.h"
namespace gpu {
namespace gles2 {
@@ -114,15 +115,18 @@ void ProgramCache::ComputeProgramHash(
char* result) const {
const size_t shader0_size = kHashLength;
const size_t shader1_size = kHashLength;
+ const size_t angle_commit_size = ANGLE_COMMIT_HASH_SIZE;
const size_t map_size = CalculateMapSize(bind_attrib_location_map);
const size_t var_size = CalculateVaryingsSize(transform_feedback_varyings);
- const size_t total_size = shader0_size + shader1_size + map_size + var_size
- + sizeof(transform_feedback_buffer_mode);
+ const size_t total_size = shader0_size + shader1_size + angle_commit_size
+ + map_size + var_size + sizeof(transform_feedback_buffer_mode);
scoped_ptr<unsigned char[]> buffer(new unsigned char[total_size]);
memcpy(buffer.get(), hashed_shader_0, shader0_size);
memcpy(&buffer[shader0_size], hashed_shader_1, shader1_size);
size_t current_pos = shader0_size + shader1_size;
+ memcpy(&buffer[current_pos], ANGLE_COMMIT_HASH, angle_commit_size);
+ current_pos += angle_commit_size;
if (map_size != 0) {
// copy our map
for (auto it = bind_attrib_location_map->begin();
diff --git a/chromium/gpu/command_buffer/service/program_manager.cc b/chromium/gpu/command_buffer/service/program_manager.cc
index b1167b69696..b9a38351721 100644
--- a/chromium/gpu/command_buffer/service/program_manager.cc
+++ b/chromium/gpu/command_buffer/service/program_manager.cc
@@ -144,17 +144,30 @@ Program::UniformInfo::UniformInfo(GLsizei _size,
accepts_api_type = kUniform4i;
break;
+ case GL_UNSIGNED_INT:
+ accepts_api_type = kUniform1ui;
+ break;
+ case GL_UNSIGNED_INT_VEC2:
+ accepts_api_type = kUniform2ui;
+ break;
+ case GL_UNSIGNED_INT_VEC3:
+ accepts_api_type = kUniform3ui;
+ break;
+ case GL_UNSIGNED_INT_VEC4:
+ accepts_api_type = kUniform4ui;
+ break;
+
case GL_BOOL:
- accepts_api_type = kUniform1i | kUniform1f;
+ accepts_api_type = kUniform1i | kUniform1ui | kUniform1f;
break;
case GL_BOOL_VEC2:
- accepts_api_type = kUniform2i | kUniform2f;
+ accepts_api_type = kUniform2i | kUniform2ui | kUniform2f;
break;
case GL_BOOL_VEC3:
- accepts_api_type = kUniform3i | kUniform3f;
+ accepts_api_type = kUniform3i | kUniform3ui | kUniform3f;
break;
case GL_BOOL_VEC4:
- accepts_api_type = kUniform4i | kUniform4f;
+ accepts_api_type = kUniform4i | kUniform4ui | kUniform4f;
break;
case GL_FLOAT:
@@ -180,13 +193,44 @@ Program::UniformInfo::UniformInfo(GLsizei _size,
accepts_api_type = kUniformMatrix4f;
break;
+ case GL_FLOAT_MAT2x3:
+ accepts_api_type = kUniformMatrix2x3f;
+ break;
+ case GL_FLOAT_MAT2x4:
+ accepts_api_type = kUniformMatrix2x4f;
+ break;
+ case GL_FLOAT_MAT3x2:
+ accepts_api_type = kUniformMatrix3x2f;
+ break;
+ case GL_FLOAT_MAT3x4:
+ accepts_api_type = kUniformMatrix3x4f;
+ break;
+ case GL_FLOAT_MAT4x2:
+ accepts_api_type = kUniformMatrix4x2f;
+ break;
+ case GL_FLOAT_MAT4x3:
+ accepts_api_type = kUniformMatrix4x3f;
+ break;
+
case GL_SAMPLER_2D:
case GL_SAMPLER_2D_RECT_ARB:
case GL_SAMPLER_CUBE:
case GL_SAMPLER_3D_OES:
case GL_SAMPLER_EXTERNAL_OES:
+ case GL_SAMPLER_2D_ARRAY:
+ case GL_SAMPLER_2D_SHADOW:
+ case GL_SAMPLER_2D_ARRAY_SHADOW:
+ case GL_INT_SAMPLER_2D:
+ case GL_INT_SAMPLER_3D:
+ case GL_INT_SAMPLER_CUBE:
+ case GL_INT_SAMPLER_2D_ARRAY:
+ case GL_UNSIGNED_INT_SAMPLER_2D:
+ case GL_UNSIGNED_INT_SAMPLER_3D:
+ case GL_UNSIGNED_INT_SAMPLER_CUBE:
+ case GL_UNSIGNED_INT_SAMPLER_2D_ARRAY:
accepts_api_type = kUniform1i;
break;
+
default:
NOTREACHED() << "Unhandled UniformInfo type " << type;
break;
@@ -525,9 +569,10 @@ void Program::Update() {
LocationMap::const_iterator it = bind_uniform_location_map_.find(
short_name);
if (it != bind_uniform_location_map_.end()) {
- data.added = AddUniformInfo(
+ AddUniformInfo(
data.size, data.type, data.location, it->second, data.corrected_name,
data.original_name, &next_available_index);
+ data.added = true;
}
}
@@ -561,14 +606,44 @@ void Program::Update() {
}
void Program::ExecuteBindAttribLocationCalls() {
- for (LocationMap::const_iterator it = bind_attrib_location_map_.begin();
- it != bind_attrib_location_map_.end(); ++it) {
- const std::string* mapped_name = GetAttribMappedName(it->first);
+ for (const auto& key_value : bind_attrib_location_map_) {
+ const std::string* mapped_name = GetAttribMappedName(key_value.first);
if (mapped_name)
- glBindAttribLocation(service_id_, it->second, mapped_name->c_str());
+ glBindAttribLocation(service_id_, key_value.second, mapped_name->c_str());
}
}
+bool Program::ExecuteTransformFeedbackVaryingsCall() {
+ if (!transform_feedback_varyings_.empty()) {
+ Shader* vertex_shader = attached_shaders_[0].get();
+ if (!vertex_shader) {
+ set_log_info("TransformFeedbackVaryings: missing vertex shader");
+ return false;
+ }
+
+ std::vector<const char*> mapped_names;
+ mapped_names.reserve(transform_feedback_varyings_.size());
+ for (StringVector::const_iterator it =
+ transform_feedback_varyings_.begin();
+ it != transform_feedback_varyings_.end(); ++it) {
+ const std::string& orig = *it;
+ const std::string* mapped = vertex_shader->GetVaryingMappedName(orig);
+ if (!mapped) {
+ std::string log = "TransformFeedbackVaryings: no varying named " + orig;
+ set_log_info(log.c_str());
+ return false;
+ }
+ mapped_names.push_back(mapped->c_str());
+ }
+ glTransformFeedbackVaryings(service_id_,
+ mapped_names.size(),
+ &mapped_names.front(),
+ transform_feedback_buffer_mode_);
+ }
+
+ return true;
+}
+
bool Program::Link(ShaderManager* manager,
Program::VaryingsPackingOption varyings_packing_option,
const ShaderCacheCallback& shader_callback) {
@@ -592,7 +667,10 @@ bool Program::Link(ShaderManager* manager,
transform_feedback_varyings_,
transform_feedback_buffer_mode_);
- if (status == ProgramCache::LINK_SUCCEEDED) {
+ bool cache_hit = status == ProgramCache::LINK_SUCCEEDED;
+ UMA_HISTOGRAM_BOOLEAN("GPU.ProgramCache.CacheHit", cache_hit);
+
+ if (cache_hit) {
ProgramCache::ProgramLoadResult success =
cache->LoadLinkedProgram(service_id(),
attached_shaders_[0].get(),
@@ -628,6 +706,10 @@ bool Program::Link(ShaderManager* manager,
set_log_info(ProcessLogInfo(info_log).c_str());
return false;
}
+ if (DetectUniformLocationBindingConflicts()) {
+ set_log_info("glBindUniformLocationCHROMIUM() conflicts");
+ return false;
+ }
if (DetectVaryingsMismatch(&conflicting_name)) {
std::string info_log = "Varyings with the same name but different type, "
"or statically used varyings in fragment shader "
@@ -653,6 +735,9 @@ bool Program::Link(ShaderManager* manager,
}
ExecuteBindAttribLocationCalls();
+ if (!ExecuteTransformFeedbackVaryingsCall()) {
+ return false;
+ }
before_time = TimeTicks::Now();
if (cache && gfx::g_driver_gl.ext.b_GL_ARB_get_program_binary) {
glProgramParameteri(service_id(),
@@ -784,8 +869,7 @@ const Program::UniformInfo*
const std::string* Program::GetAttribMappedName(
const std::string& original_name) const {
- for (int ii = 0; ii < kMaxAttachedShaders; ++ii) {
- Shader* shader = attached_shaders_[ii].get();
+ for (auto shader : attached_shaders_) {
if (shader) {
const std::string* mapped_name =
shader->GetAttribMappedName(original_name);
@@ -793,13 +877,25 @@ const std::string* Program::GetAttribMappedName(
return mapped_name;
}
}
- return NULL;
+ return nullptr;
+}
+
+const std::string* Program::GetUniformMappedName(
+ const std::string& original_name) const {
+ for (auto shader : attached_shaders_) {
+ if (shader) {
+ const std::string* mapped_name =
+ shader->GetUniformMappedName(original_name);
+ if (mapped_name)
+ return mapped_name;
+ }
+ }
+ return nullptr;
}
const std::string* Program::GetOriginalNameFromHashedName(
const std::string& hashed_name) const {
- for (int ii = 0; ii < kMaxAttachedShaders; ++ii) {
- Shader* shader = attached_shaders_[ii].get();
+ for (auto shader : attached_shaders_) {
if (shader) {
const std::string* original_name =
shader->GetOriginalNameFromHashedName(hashed_name);
@@ -807,7 +903,7 @@ const std::string* Program::GetOriginalNameFromHashedName(
return original_name;
}
}
- return NULL;
+ return nullptr;
}
bool Program::SetUniformLocationBinding(
@@ -818,7 +914,6 @@ bool Program::SetUniformLocationBinding(
element_index != 0) {
return false;
}
-
bind_uniform_location_map_[short_name] = location;
return true;
}
@@ -830,8 +925,7 @@ void Program::GetCorrectedUniformData(
std::string* corrected_name, std::string* original_name,
GLsizei* size, GLenum* type) const {
DCHECK(corrected_name && original_name && size && type);
- for (int ii = 0; ii < kMaxAttachedShaders; ++ii) {
- Shader* shader = attached_shaders_[ii].get();
+ for (auto shader : attached_shaders_) {
if (!shader)
continue;
const sh::ShaderVariable* info = NULL;
@@ -841,7 +935,8 @@ void Program::GetCorrectedUniformData(
found = uniform->findInfoByMappedName(name, &info, original_name);
if (found) {
const std::string kArraySpec("[0]");
- if (info->arraySize > 0 && !base::EndsWith(name, kArraySpec, true)) {
+ if (info->arraySize > 0 &&
+ !base::EndsWith(name, kArraySpec, base::CompareCase::SENSITIVE)) {
*corrected_name = name + kArraySpec;
*original_name += kArraySpec;
} else {
@@ -879,10 +974,10 @@ void Program::GetVertexAttribData(
*original_name = name;
}
-bool Program::AddUniformInfo(
- GLsizei size, GLenum type, GLint location, GLint fake_base_location,
- const std::string& name, const std::string& original_name,
- size_t* next_available_index) {
+void Program::AddUniformInfo(
+ GLsizei size, GLenum type, GLint location, GLint fake_base_location,
+ const std::string& name, const std::string& original_name,
+ size_t* next_available_index) {
DCHECK(next_available_index);
const char* kArraySpec = "[0]";
size_t uniform_index =
@@ -891,11 +986,9 @@ bool Program::AddUniformInfo(
uniform_infos_.resize(uniform_index + 1);
}
- // return if this location is already in use.
- if (uniform_infos_[uniform_index].IsValid()) {
- DCHECK_GE(fake_base_location, 0);
- return false;
- }
+ // Before linking, we already validated that no two statically used uniforms
+ // are bound to the same location.
+ DCHECK(!uniform_infos_[uniform_index].IsValid());
uniform_infos_[uniform_index] = UniformInfo(
size, type, uniform_index, original_name);
@@ -945,8 +1038,6 @@ bool Program::AddUniformInfo(
uniform_infos_[*next_available_index].IsValid()) {
*next_available_index = *next_available_index + 1;
}
-
- return true;
}
const Program::UniformInfo*
@@ -1060,16 +1151,15 @@ bool Program::DetachShader(
void Program::DetachShaders(ShaderManager* shader_manager) {
DCHECK(shader_manager);
- for (int ii = 0; ii < kMaxAttachedShaders; ++ii) {
- if (attached_shaders_[ii].get()) {
- DetachShader(shader_manager, attached_shaders_[ii].get());
+ for (auto shader : attached_shaders_) {
+ if (shader) {
+ DetachShader(shader_manager, shader.get());
}
}
}
void Program::CompileAttachedShaders() {
- for (int ii = 0; ii < kMaxAttachedShaders; ++ii) {
- Shader* shader = attached_shaders_[ii].get();
+ for (auto shader : attached_shaders_) {
if (shader) {
shader->DoCompile();
}
@@ -1077,16 +1167,16 @@ void Program::CompileAttachedShaders() {
}
bool Program::AttachedShadersExist() const {
- for (int ii = 0; ii < kMaxAttachedShaders; ++ii) {
- if (!attached_shaders_[ii].get())
+ for (auto shader : attached_shaders_) {
+ if (!shader)
return false;
}
return true;
}
bool Program::CanLink() const {
- for (int ii = 0; ii < kMaxAttachedShaders; ++ii) {
- if (!attached_shaders_[ii].get() || !attached_shaders_[ii]->valid()) {
+ for (auto shader : attached_shaders_) {
+ if (!shader || !shader->valid()) {
return false;
}
}
@@ -1095,8 +1185,7 @@ bool Program::CanLink() const {
bool Program::DetectShaderVersionMismatch() const {
int version = Shader::kUndefinedShaderVersion;
- for (int ii = 0; ii < kMaxAttachedShaders; ++ii) {
- Shader* shader = attached_shaders_[ii].get();
+ for (auto shader : attached_shaders_) {
if (shader) {
if (version != Shader::kUndefinedShaderVersion &&
shader->shader_version() != version) {
@@ -1111,17 +1200,16 @@ bool Program::DetectShaderVersionMismatch() const {
bool Program::DetectAttribLocationBindingConflicts() const {
std::set<GLint> location_binding_used;
- for (LocationMap::const_iterator it = bind_attrib_location_map_.begin();
- it != bind_attrib_location_map_.end(); ++it) {
+ for (const auto& key_value : bind_attrib_location_map_) {
// Find out if an attribute is statically used in this program's shaders.
const sh::Attribute* attrib = NULL;
- const std::string* mapped_name = GetAttribMappedName(it->first);
+ const std::string* mapped_name = GetAttribMappedName(key_value.first);
if (!mapped_name)
continue;
- for (int ii = 0; ii < kMaxAttachedShaders; ++ii) {
- if (!attached_shaders_[ii].get() || !attached_shaders_[ii]->valid())
+ for (auto shader : attached_shaders_) {
+ if (!shader || !shader->valid())
continue;
- attrib = attached_shaders_[ii]->GetAttribInfo(*mapped_name);
+ attrib = shader->GetAttribInfo(*mapped_name);
if (attrib) {
if (attrib->staticUse)
break;
@@ -1145,9 +1233,8 @@ bool Program::DetectAttribLocationBindingConflicts() const {
break;
}
for (size_t ii = 0; ii < num_of_locations; ++ii) {
- GLint loc = it->second + ii;
- std::pair<std::set<GLint>::iterator, bool> result =
- location_binding_used.insert(loc);
+ GLint loc = key_value.second + ii;
+ auto result = location_binding_used.insert(loc);
if (!result.second)
return true;
}
@@ -1156,21 +1243,48 @@ bool Program::DetectAttribLocationBindingConflicts() const {
return false;
}
+bool Program::DetectUniformLocationBindingConflicts() const {
+ std::set<GLint> location_binding_used;
+ for (auto it : bind_uniform_location_map_) {
+ // Find out if an attribute is statically used in this program's shaders.
+ const sh::Uniform* uniform = nullptr;
+ const std::string* mapped_name = GetUniformMappedName(it.first);
+ if (!mapped_name)
+ continue;
+ for (auto shader : attached_shaders_) {
+ if (!shader || !shader->valid())
+ continue;
+ uniform = shader->GetUniformInfo(*mapped_name);
+ if (uniform) {
+ if (uniform->staticUse)
+ break;
+ else
+ uniform = nullptr;
+ }
+ }
+ if (uniform) {
+ auto result = location_binding_used.insert(it.second);
+ if (!result.second)
+ return true;
+ }
+ }
+ return false;
+}
+
bool Program::DetectUniformsMismatch(std::string* conflicting_name) const {
typedef std::map<std::string, const sh::Uniform*> UniformPointerMap;
UniformPointerMap uniform_pointer_map;
- for (int ii = 0; ii < kMaxAttachedShaders; ++ii) {
- const UniformMap& shader_uniforms = attached_shaders_[ii]->uniform_map();
- for (UniformMap::const_iterator iter = shader_uniforms.begin();
- iter != shader_uniforms.end(); ++iter) {
- const std::string& name = iter->first;
+ for (auto shader : attached_shaders_) {
+ const UniformMap& shader_uniforms = shader->uniform_map();
+ for (const auto& key_value : shader_uniforms) {
+ const std::string& name = key_value.first;
UniformPointerMap::iterator hit = uniform_pointer_map.find(name);
if (hit == uniform_pointer_map.end()) {
- uniform_pointer_map[name] = &(iter->second);
+ uniform_pointer_map[name] = &(key_value.second);
} else {
// If a uniform is in the map, i.e., it has already been declared by
// another shader, then the type, precision, etc. must match.
- if (hit->second->isSameUniformAtLinkTime(iter->second))
+ if (hit->second->isSameUniformAtLinkTime(key_value.second))
continue;
*conflicting_name = name;
return true;
@@ -1190,22 +1304,22 @@ bool Program::DetectVaryingsMismatch(std::string* conflicting_name) const {
int shader_version = attached_shaders_[0]->shader_version();
- for (VaryingMap::const_iterator iter = fragment_varyings->begin();
- iter != fragment_varyings->end(); ++iter) {
- const std::string& name = iter->first;
+ for (const auto& key_value : *fragment_varyings) {
+ const std::string& name = key_value.first;
if (IsBuiltInFragmentVarying(name))
continue;
VaryingMap::const_iterator hit = vertex_varyings->find(name);
if (hit == vertex_varyings->end()) {
- if (iter->second.staticUse) {
+ if (key_value.second.staticUse) {
*conflicting_name = name;
return true;
}
continue;
}
- if (!hit->second.isSameVaryingAtLinkTime(iter->second, shader_version)) {
+ if (!hit->second.isSameVaryingAtLinkTime(key_value.second,
+ shader_version)) {
*conflicting_name = name;
return true;
}
@@ -1247,11 +1361,10 @@ bool Program::DetectGlobalNameConflicts(std::string* conflicting_name) const {
const AttributeMap* attribs =
&(attached_shaders_[0]->attrib_map());
- for (AttributeMap::const_iterator iter = attribs->begin();
- iter != attribs->end(); ++iter) {
+ for (const auto& key_value : *attribs) {
for (int ii = 0; ii < 2; ++ii) {
- if (uniforms[ii]->find(iter->first) != uniforms[ii]->end()) {
- *conflicting_name = iter->first;
+ if (uniforms[ii]->find(key_value.first) != uniforms[ii]->end()) {
+ *conflicting_name = key_value.first;
return true;
}
}
@@ -1270,13 +1383,12 @@ bool Program::CheckVaryingsPacking(
std::map<std::string, ShVariableInfo> combined_map;
- for (VaryingMap::const_iterator iter = fragment_varyings->begin();
- iter != fragment_varyings->end(); ++iter) {
- if (!iter->second.staticUse && option == kCountOnlyStaticallyUsed)
+ for (const auto& key_value : *fragment_varyings) {
+ if (!key_value.second.staticUse && option == kCountOnlyStaticallyUsed)
continue;
- if (!IsBuiltInFragmentVarying(iter->first)) {
+ if (!IsBuiltInFragmentVarying(key_value.first)) {
VaryingMap::const_iterator vertex_iter =
- vertex_varyings->find(iter->first);
+ vertex_varyings->find(key_value.first);
if (vertex_iter == vertex_varyings->end() ||
(!vertex_iter->second.staticUse &&
option == kCountOnlyStaticallyUsed))
@@ -1284,9 +1396,9 @@ bool Program::CheckVaryingsPacking(
}
ShVariableInfo var;
- var.type = static_cast<sh::GLenum>(iter->second.type);
- var.size = std::max(1u, iter->second.arraySize);
- combined_map[iter->first] = var;
+ var.type = static_cast<sh::GLenum>(key_value.second.type);
+ var.size = std::max(1u, key_value.second.arraySize);
+ combined_map[key_value.first] = var;
}
if (combined_map.size() == 0)
@@ -1294,11 +1406,9 @@ bool Program::CheckVaryingsPacking(
scoped_ptr<ShVariableInfo[]> variables(
new ShVariableInfo[combined_map.size()]);
size_t index = 0;
- for (std::map<std::string, ShVariableInfo>::const_iterator iter =
- combined_map.begin();
- iter != combined_map.end(); ++iter) {
- variables[index].type = iter->second.type;
- variables[index].size = iter->second.size;
+ for (const auto& key_value : combined_map) {
+ variables[index].type = key_value.second.type;
+ variables[index].size = key_value.second.size;
++index;
}
return ShCheckVariablesWithinPackingLimits(
@@ -1539,8 +1649,13 @@ bool Program::GetTransformFeedbackVaryings(
uint32_t header_size = sizeof(TransformFeedbackVaryingsHeader);
bucket->SetSize(header_size); // In case we fail.
+ GLenum transform_feedback_buffer_mode = 0;
+ GLint param = 0;
+ glGetProgramiv(program, GL_TRANSFORM_FEEDBACK_BUFFER_MODE, &param);
+ transform_feedback_buffer_mode = static_cast<GLenum>(param);
+
uint32_t num_transform_feedback_varyings = 0;
- GLint param = GL_FALSE;
+ param = GL_FALSE;
// We assume program is a valid program service id.
glGetProgramiv(program, GL_LINK_STATUS, &param);
if (param == GL_TRUE) {
@@ -1549,6 +1664,9 @@ bool Program::GetTransformFeedbackVaryings(
num_transform_feedback_varyings = static_cast<uint32_t>(param);
}
if (num_transform_feedback_varyings == 0) {
+ TransformFeedbackVaryingsHeader* header =
+ bucket->GetDataAs<TransformFeedbackVaryingsHeader*>(0, header_size);
+ header->transform_feedback_buffer_mode = transform_feedback_buffer_mode;
return true;
}
@@ -1602,6 +1720,7 @@ bool Program::GetTransformFeedbackVaryings(
DCHECK(data);
// Copy over data for the header and entries.
+ header->transform_feedback_buffer_mode = transform_feedback_buffer_mode;
header->num_transform_feedback_varyings = num_transform_feedback_varyings;
memcpy(entries, &varyings[0], entry_size);
@@ -1750,10 +1869,9 @@ Program* ProgramManager::GetProgram(GLuint client_id) {
bool ProgramManager::GetClientId(GLuint service_id, GLuint* client_id) const {
// This doesn't need to be fast. It's only used during slow queries.
- for (ProgramMap::const_iterator it = programs_.begin();
- it != programs_.end(); ++it) {
- if (it->second->service_id() == service_id) {
- *client_id = it->first;
+ for (const auto& key_value : programs_) {
+ if (key_value.second->service_id() == service_id) {
+ *client_id = key_value.first;
return true;
}
}
@@ -1764,10 +1882,9 @@ ProgramCache* ProgramManager::program_cache() const {
return program_cache_;
}
-bool ProgramManager::IsOwned(Program* program) {
- for (ProgramMap::iterator it = programs_.begin();
- it != programs_.end(); ++it) {
- if (it->second.get() == program) {
+bool ProgramManager::IsOwned(Program* program) const {
+ for (const auto& key_value : programs_) {
+ if (key_value.second.get() == program) {
return true;
}
}
diff --git a/chromium/gpu/command_buffer/service/program_manager.h b/chromium/gpu/command_buffer/service/program_manager.h
index a620ee2ae15..1df65195587 100644
--- a/chromium/gpu/command_buffer/service/program_manager.h
+++ b/chromium/gpu/command_buffer/service/program_manager.h
@@ -50,6 +50,16 @@ class GPU_EXPORT Program : public base::RefCounted<Program> {
kUniformMatrix2f = 1 << 8,
kUniformMatrix3f = 1 << 9,
kUniformMatrix4f = 1 << 10,
+ kUniform1ui = 1 << 11,
+ kUniform2ui = 1 << 12,
+ kUniform3ui = 1 << 13,
+ kUniform4ui = 1 << 14,
+ kUniformMatrix2x3f = 1 << 15,
+ kUniformMatrix2x4f = 1 << 16,
+ kUniformMatrix3x2f = 1 << 17,
+ kUniformMatrix3x4f = 1 << 18,
+ kUniformMatrix4x2f = 1 << 19,
+ kUniformMatrix4x3f = 1 << 20,
};
struct UniformInfo {
@@ -95,6 +105,7 @@ class GPU_EXPORT Program : public base::RefCounted<Program> {
typedef std::vector<VertexAttrib> AttribInfoVector;
typedef std::vector<int> SamplerIndices;
typedef std::map<std::string, GLint> LocationMap;
+ typedef std::vector<std::string> StringVector;
Program(ProgramManager* manager, GLuint service_id);
@@ -133,6 +144,10 @@ class GPU_EXPORT Program : public base::RefCounted<Program> {
const std::string* GetAttribMappedName(
const std::string& original_name) const;
+ // If the original name is not found, return NULL.
+ const std::string* GetUniformMappedName(
+ const std::string& original_name) const;
+
// If the hashed name is not found, return NULL.
const std::string* GetOriginalNameFromHashedName(
const std::string& hashed_name) const;
@@ -221,6 +236,11 @@ class GPU_EXPORT Program : public base::RefCounted<Program> {
// We only consider the declared attributes in the program.
bool DetectAttribLocationBindingConflicts() const;
+ // Detects if there are uniform location conflicts from
+ // glBindUniformLocationCHROMIUM() calls.
+ // We only consider the statically used uniforms in the program.
+ bool DetectUniformLocationBindingConflicts() const;
+
// Detects if there are uniforms of the same name but different type
// or precision in vertex/fragment shaders.
// Return true and set the first found conflicting hashed name to
@@ -307,7 +327,12 @@ class GPU_EXPORT Program : public base::RefCounted<Program> {
// translated.
void ExecuteBindAttribLocationCalls();
- bool AddUniformInfo(
+ // The names of transform feedback varyings need to be hashed just
+ // like bound attributes' locations, just before the link call.
+ // Returns false upon failure.
+ bool ExecuteTransformFeedbackVaryingsCall();
+
+ void AddUniformInfo(
GLsizei size, GLenum type, GLint location, GLint fake_base_location,
const std::string& name, const std::string& original_name,
size_t* next_available_index);
@@ -434,7 +459,7 @@ class GPU_EXPORT ProgramManager {
static bool IsInvalidPrefix(const char* name, size_t length);
// Check if a Program is owned by this ProgramManager.
- bool IsOwned(Program* program);
+ bool IsOwned(Program* program) const;
static int32 MakeFakeLocation(int32 index, int32 element);
diff --git a/chromium/gpu/command_buffer/service/program_manager_unittest.cc b/chromium/gpu/command_buffer/service/program_manager_unittest.cc
index 6c296e6ad09..edbdbf181fe 100644
--- a/chromium/gpu/command_buffer/service/program_manager_unittest.cc
+++ b/chromium/gpu/command_buffer/service/program_manager_unittest.cc
@@ -1238,6 +1238,12 @@ TEST_F(ProgramManagerWithShaderTest,
ASSERT_TRUE(program != NULL);
// The program's previous link failed.
EXPECT_CALL(*(gl_.get()),
+ GetProgramiv(kServiceProgramId,
+ GL_TRANSFORM_FEEDBACK_BUFFER_MODE,
+ _))
+ .WillOnce(SetArgPointee<2>(GL_INTERLEAVED_ATTRIBS))
+ .RetiresOnSaturation();
+ EXPECT_CALL(*(gl_.get()),
GetProgramiv(kServiceProgramId, GL_LINK_STATUS, _))
.WillOnce(SetArgPointee<2>(GL_FALSE))
.RetiresOnSaturation();
@@ -1248,7 +1254,15 @@ TEST_F(ProgramManagerWithShaderTest,
0, sizeof(TransformFeedbackVaryingsHeader));
EXPECT_TRUE(header != NULL);
EXPECT_EQ(0u, header->num_transform_feedback_varyings);
- // Zero uniform blocks.
+ EXPECT_EQ(static_cast<uint32_t>(GL_INTERLEAVED_ATTRIBS),
+ header->transform_feedback_buffer_mode);
+ // Zero transform feedback blocks.
+ EXPECT_CALL(*(gl_.get()),
+ GetProgramiv(kServiceProgramId,
+ GL_TRANSFORM_FEEDBACK_BUFFER_MODE,
+ _))
+ .WillOnce(SetArgPointee<2>(GL_SEPARATE_ATTRIBS))
+ .RetiresOnSaturation();
EXPECT_CALL(*(gl_.get()),
GetProgramiv(kServiceProgramId, GL_LINK_STATUS, _))
.WillOnce(SetArgPointee<2>(GL_TRUE))
@@ -1263,6 +1277,8 @@ TEST_F(ProgramManagerWithShaderTest,
header = bucket.GetDataAs<TransformFeedbackVaryingsHeader*>(
0, sizeof(TransformFeedbackVaryingsHeader));
EXPECT_TRUE(header != NULL);
+ EXPECT_EQ(static_cast<uint32_t>(GL_SEPARATE_ATTRIBS),
+ header->transform_feedback_buffer_mode);
EXPECT_EQ(0u, header->num_transform_feedback_varyings);
}
@@ -1281,6 +1297,7 @@ TEST_F(ProgramManagerWithShaderTest,
// The names needs to be of size 4*k-1 to avoid padding in the struct Data.
// This is a testing only problem.
const char* kName[] = { "cow", "chicken" };
+ data.header.transform_feedback_buffer_mode = GL_INTERLEAVED_ATTRIBS;
data.header.num_transform_feedback_varyings = 2;
data.entry[0].size = 1;
data.entry[0].type = GL_FLOAT_VEC2;
@@ -1293,6 +1310,13 @@ TEST_F(ProgramManagerWithShaderTest,
memcpy(data.name0, kName[0], arraysize(data.name0));
memcpy(data.name1, kName[1], arraysize(data.name1));
+
+ EXPECT_CALL(*(gl_.get()),
+ GetProgramiv(kServiceProgramId,
+ GL_TRANSFORM_FEEDBACK_BUFFER_MODE,
+ _))
+ .WillOnce(SetArgPointee<2>(GL_INTERLEAVED_ATTRIBS))
+ .RetiresOnSaturation();
EXPECT_CALL(*(gl_.get()),
GetProgramiv(kServiceProgramId, GL_LINK_STATUS, _))
.WillOnce(SetArgPointee<2>(GL_TRUE))
diff --git a/chromium/gpu/command_buffer/service/query_manager.cc b/chromium/gpu/command_buffer/service/query_manager.cc
index 3de501a4499..6c1e2628a71 100644
--- a/chromium/gpu/command_buffer/service/query_manager.cc
+++ b/chromium/gpu/command_buffer/service/query_manager.cc
@@ -12,10 +12,10 @@
#include "base/synchronization/lock.h"
#include "base/time/time.h"
#include "gpu/command_buffer/common/gles2_cmd_format.h"
-#include "gpu/command_buffer/service/async_pixel_transfer_manager.h"
#include "gpu/command_buffer/service/error_state.h"
#include "gpu/command_buffer/service/feature_info.h"
#include "gpu/command_buffer/service/gles2_cmd_decoder.h"
+#include "ui/gl/gl_bindings.h"
#include "ui/gl/gl_context.h"
#include "ui/gl/gl_fence.h"
#include "ui/gl/gpu_timing.h"
@@ -23,176 +23,152 @@
namespace gpu {
namespace gles2 {
-namespace {
-
-class AsyncPixelTransferCompletionObserverImpl
- : public AsyncPixelTransferCompletionObserver {
- public:
- AsyncPixelTransferCompletionObserverImpl(base::subtle::Atomic32 submit_count)
- : submit_count_(submit_count), cancelled_(false) {}
-
- void Cancel() {
- base::AutoLock locked(lock_);
- cancelled_ = true;
- }
-
- void DidComplete(const AsyncMemoryParams& mem_params) override {
- base::AutoLock locked(lock_);
- if (!cancelled_) {
- DCHECK(mem_params.buffer().get());
- void* data = mem_params.GetDataAddress();
- QuerySync* sync = static_cast<QuerySync*>(data);
- base::subtle::Release_Store(&sync->process_count, submit_count_);
- }
- }
-
- private:
- ~AsyncPixelTransferCompletionObserverImpl() override {}
-
- base::subtle::Atomic32 submit_count_;
-
- base::Lock lock_;
- bool cancelled_;
-
- DISALLOW_COPY_AND_ASSIGN(AsyncPixelTransferCompletionObserverImpl);
-};
-
-class AsyncPixelTransfersCompletedQuery
- : public QueryManager::Query,
- public base::SupportsWeakPtr<AsyncPixelTransfersCompletedQuery> {
+class AbstractIntegerQuery : public QueryManager::Query {
public:
- AsyncPixelTransfersCompletedQuery(
+ AbstractIntegerQuery(
QueryManager* manager, GLenum target, int32 shm_id, uint32 shm_offset);
-
bool Begin() override;
bool End(base::subtle::Atomic32 submit_count) override;
- bool Process(bool did_finish) override;
+ bool QueryCounter(base::subtle::Atomic32 submit_count) override;
+ void Pause() override;
+ void Resume() override;
void Destroy(bool have_context) override;
protected:
- ~AsyncPixelTransfersCompletedQuery() override;
+ ~AbstractIntegerQuery() override;
+ bool AreAllResultsAvailable();
- scoped_refptr<AsyncPixelTransferCompletionObserverImpl> observer_;
+ // Service side query ids.
+ std::vector<GLuint> service_ids_;
};
-AsyncPixelTransfersCompletedQuery::AsyncPixelTransfersCompletedQuery(
+AbstractIntegerQuery::AbstractIntegerQuery(
QueryManager* manager, GLenum target, int32 shm_id, uint32 shm_offset)
: Query(manager, target, shm_id, shm_offset) {
-}
-
-bool AsyncPixelTransfersCompletedQuery::Begin() {
+ GLuint service_id = 0;
+ glGenQueries(1, &service_id);
+ DCHECK_NE(0u, service_id);
+ service_ids_.push_back(service_id);
+}
+
+bool AbstractIntegerQuery::Begin() {
+ MarkAsActive();
+ // Delete all but the first one when beginning a new query.
+ if (service_ids_.size() > 1) {
+ glDeleteQueries(service_ids_.size() - 1, &service_ids_[1]);
+ service_ids_.resize(1);
+ }
+ BeginQueryHelper(target(), service_ids_.back());
return true;
}
-bool AsyncPixelTransfersCompletedQuery::End(
- base::subtle::Atomic32 submit_count) {
- // Get the real shared memory since it might need to be duped to prevent
- // use-after-free of the memory.
- scoped_refptr<Buffer> buffer =
- manager()->decoder()->GetSharedMemoryBuffer(shm_id());
- if (!buffer.get())
- return false;
- AsyncMemoryParams mem_params(buffer, shm_offset(), sizeof(QuerySync));
- if (!mem_params.GetDataAddress())
- return false;
-
- observer_ = new AsyncPixelTransferCompletionObserverImpl(submit_count);
-
- // Ask AsyncPixelTransferDelegate to run completion callback after all
- // previous async transfers are done. No guarantee that callback is run
- // on the current thread.
- manager()->decoder()->GetAsyncPixelTransferManager()->AsyncNotifyCompletion(
- mem_params, observer_.get());
+bool AbstractIntegerQuery::End(base::subtle::Atomic32 submit_count) {
+ EndQueryHelper(target());
+ return AddToPendingQueue(submit_count);
+}
- return AddToPendingTransferQueue(submit_count);
+bool AbstractIntegerQuery::QueryCounter(base::subtle::Atomic32 submit_count) {
+ NOTREACHED();
+ return false;
}
-bool AsyncPixelTransfersCompletedQuery::Process(bool did_finish) {
- QuerySync* sync = manager()->decoder()->GetSharedMemoryAs<QuerySync*>(
- shm_id(), shm_offset(), sizeof(*sync));
- if (!sync)
- return false;
+void AbstractIntegerQuery::Pause() {
+ MarkAsPaused();
+ EndQueryHelper(target());
+}
- // Check if completion callback has been run. sync->process_count atomicity
- // is guaranteed as this is already used to notify client of a completed
- // query.
- if (base::subtle::Acquire_Load(&sync->process_count) != submit_count())
- return true;
+void AbstractIntegerQuery::Resume() {
+ MarkAsActive();
- UnmarkAsPending();
- return true;
+ GLuint service_id = 0;
+ glGenQueries(1, &service_id);
+ DCHECK_NE(0u, service_id);
+ service_ids_.push_back(service_id);
+ BeginQueryHelper(target(), service_ids_.back());
}
-void AsyncPixelTransfersCompletedQuery::Destroy(bool /* have_context */) {
- if (!IsDeleted()) {
+void AbstractIntegerQuery::Destroy(bool have_context) {
+ if (have_context && !IsDeleted()) {
+ glDeleteQueries(service_ids_.size(), &service_ids_[0]);
+ service_ids_.clear();
MarkAsDeleted();
}
}
-AsyncPixelTransfersCompletedQuery::~AsyncPixelTransfersCompletedQuery() {
- if (observer_.get())
- observer_->Cancel();
+AbstractIntegerQuery::~AbstractIntegerQuery() {
}
-} // namespace
+bool AbstractIntegerQuery::AreAllResultsAvailable() {
+ GLuint available = 0;
+ glGetQueryObjectuiv(
+ service_ids_.back(), GL_QUERY_RESULT_AVAILABLE_EXT, &available);
+ return !!available;
+}
-class AllSamplesPassedQuery : public QueryManager::Query {
+class BooleanQuery : public AbstractIntegerQuery {
public:
- AllSamplesPassedQuery(
- QueryManager* manager, GLenum target, int32 shm_id, uint32 shm_offset,
- GLuint service_id);
- bool Begin() override;
- bool End(base::subtle::Atomic32 submit_count) override;
+ BooleanQuery(
+ QueryManager* manager, GLenum target, int32 shm_id, uint32 shm_offset);
bool Process(bool did_finish) override;
- void Destroy(bool have_context) override;
protected:
- ~AllSamplesPassedQuery() override;
-
- private:
- // Service side query id.
- GLuint service_id_;
+ ~BooleanQuery() override;
};
-AllSamplesPassedQuery::AllSamplesPassedQuery(
- QueryManager* manager, GLenum target, int32 shm_id, uint32 shm_offset,
- GLuint service_id)
- : Query(manager, target, shm_id, shm_offset),
- service_id_(service_id) {
-}
-
-bool AllSamplesPassedQuery::Begin() {
- BeginQueryHelper(target(), service_id_);
- return true;
+BooleanQuery::BooleanQuery(
+ QueryManager* manager, GLenum target, int32 shm_id, uint32 shm_offset)
+ : AbstractIntegerQuery(manager, target, shm_id, shm_offset) {
}
-bool AllSamplesPassedQuery::End(base::subtle::Atomic32 submit_count) {
- EndQueryHelper(target());
- return AddToPendingQueue(submit_count);
+BooleanQuery::~BooleanQuery() {
}
-bool AllSamplesPassedQuery::Process(bool did_finish) {
- GLuint available = 0;
- glGetQueryObjectuiv(
- service_id_, GL_QUERY_RESULT_AVAILABLE_EXT, &available);
- if (!available) {
+bool BooleanQuery::Process(bool did_finish) {
+ if (!AreAllResultsAvailable()) {
+ // Must return true to avoid generating an error at the command
+ // buffer level.
return true;
}
- GLuint result = 0;
- glGetQueryObjectuiv(
- service_id_, GL_QUERY_RESULT_EXT, &result);
+ for (const GLuint& service_id : service_ids_) {
+ GLuint result = 0;
+ glGetQueryObjectuiv(service_id, GL_QUERY_RESULT_EXT, &result);
+ if (result != 0)
+ return MarkAsCompleted(1);
+ }
+ return MarkAsCompleted(0);
+}
+
+class SummedIntegerQuery : public AbstractIntegerQuery {
+ public:
+ SummedIntegerQuery(
+ QueryManager* manager, GLenum target, int32 shm_id, uint32 shm_offset);
+ bool Process(bool did_finish) override;
+
+ protected:
+ ~SummedIntegerQuery() override;
+};
- return MarkAsCompleted(result != 0);
+SummedIntegerQuery::SummedIntegerQuery(
+ QueryManager* manager, GLenum target, int32 shm_id, uint32 shm_offset)
+ : AbstractIntegerQuery(manager, target, shm_id, shm_offset) {
}
-void AllSamplesPassedQuery::Destroy(bool have_context) {
- if (have_context && !IsDeleted()) {
- glDeleteQueries(1, &service_id_);
- MarkAsDeleted();
- }
+SummedIntegerQuery::~SummedIntegerQuery() {
}
-AllSamplesPassedQuery::~AllSamplesPassedQuery() {
+bool SummedIntegerQuery::Process(bool did_finish) {
+ if (!AreAllResultsAvailable()) {
+ // Must return true to avoid generating an error at the command
+ // buffer level.
+ return true;
+ }
+ GLuint summed_result = 0;
+ for (const GLuint& service_id : service_ids_) {
+ GLuint result = 0;
+ glGetQueryObjectuiv(service_id, GL_QUERY_RESULT_EXT, &result);
+ summed_result += result;
+ }
+ return MarkAsCompleted(summed_result);
}
class CommandsIssuedQuery : public QueryManager::Query {
@@ -202,6 +178,9 @@ class CommandsIssuedQuery : public QueryManager::Query {
bool Begin() override;
bool End(base::subtle::Atomic32 submit_count) override;
+ bool QueryCounter(base::subtle::Atomic32 submit_count) override;
+ void Pause() override;
+ void Resume() override;
bool Process(bool did_finish) override;
void Destroy(bool have_context) override;
@@ -218,16 +197,30 @@ CommandsIssuedQuery::CommandsIssuedQuery(
}
bool CommandsIssuedQuery::Begin() {
+ MarkAsActive();
begin_time_ = base::TimeTicks::Now();
return true;
}
+void CommandsIssuedQuery::Pause() {
+ MarkAsPaused();
+}
+
+void CommandsIssuedQuery::Resume() {
+ MarkAsActive();
+}
+
bool CommandsIssuedQuery::End(base::subtle::Atomic32 submit_count) {
- base::TimeDelta elapsed = base::TimeTicks::Now() - begin_time_;
+ const base::TimeDelta elapsed = base::TimeTicks::Now() - begin_time_;
MarkAsPending(submit_count);
return MarkAsCompleted(elapsed.InMicroseconds());
}
+bool CommandsIssuedQuery::QueryCounter(base::subtle::Atomic32 submit_count) {
+ NOTREACHED();
+ return false;
+}
+
bool CommandsIssuedQuery::Process(bool did_finish) {
NOTREACHED();
return true;
@@ -249,6 +242,9 @@ class CommandLatencyQuery : public QueryManager::Query {
bool Begin() override;
bool End(base::subtle::Atomic32 submit_count) override;
+ bool QueryCounter(base::subtle::Atomic32 submit_count) override;
+ void Pause() override;
+ void Resume() override;
bool Process(bool did_finish) override;
void Destroy(bool have_context) override;
@@ -262,7 +258,16 @@ CommandLatencyQuery::CommandLatencyQuery(
}
bool CommandLatencyQuery::Begin() {
- return true;
+ MarkAsActive();
+ return true;
+}
+
+void CommandLatencyQuery::Pause() {
+ MarkAsPaused();
+}
+
+void CommandLatencyQuery::Resume() {
+ MarkAsActive();
}
bool CommandLatencyQuery::End(base::subtle::Atomic32 submit_count) {
@@ -271,6 +276,11 @@ bool CommandLatencyQuery::End(base::subtle::Atomic32 submit_count) {
return MarkAsCompleted(now.InMicroseconds());
}
+bool CommandLatencyQuery::QueryCounter(base::subtle::Atomic32 submit_count) {
+ NOTREACHED();
+ return false;
+}
+
bool CommandLatencyQuery::Process(bool did_finish) {
NOTREACHED();
return true;
@@ -295,6 +305,9 @@ class AsyncReadPixelsCompletedQuery
bool Begin() override;
bool End(base::subtle::Atomic32 submit_count) override;
+ bool QueryCounter(base::subtle::Atomic32 submit_count) override;
+ void Pause() override;
+ void Resume() override;
bool Process(bool did_finish) override;
void Destroy(bool have_context) override;
@@ -303,21 +316,28 @@ class AsyncReadPixelsCompletedQuery
~AsyncReadPixelsCompletedQuery() override;
private:
- bool completed_;
bool complete_result_;
};
AsyncReadPixelsCompletedQuery::AsyncReadPixelsCompletedQuery(
QueryManager* manager, GLenum target, int32 shm_id, uint32 shm_offset)
: Query(manager, target, shm_id, shm_offset),
- completed_(false),
complete_result_(false) {
}
bool AsyncReadPixelsCompletedQuery::Begin() {
+ MarkAsActive();
return true;
}
+void AsyncReadPixelsCompletedQuery::Pause() {
+ MarkAsPaused();
+}
+
+void AsyncReadPixelsCompletedQuery::Resume() {
+ MarkAsActive();
+}
+
bool AsyncReadPixelsCompletedQuery::End(base::subtle::Atomic32 submit_count) {
if (!AddToPendingQueue(submit_count)) {
return false;
@@ -329,13 +349,18 @@ bool AsyncReadPixelsCompletedQuery::End(base::subtle::Atomic32 submit_count) {
return Process(false);
}
+bool AsyncReadPixelsCompletedQuery::QueryCounter(
+ base::subtle::Atomic32 submit_count) {
+ NOTREACHED();
+ return false;
+}
+
void AsyncReadPixelsCompletedQuery::Complete() {
- completed_ = true;
complete_result_ = MarkAsCompleted(1);
}
bool AsyncReadPixelsCompletedQuery::Process(bool did_finish) {
- return !completed_ || complete_result_;
+ return !IsFinished() || complete_result_;
}
void AsyncReadPixelsCompletedQuery::Destroy(bool /* have_context */) {
@@ -355,6 +380,9 @@ class GetErrorQuery : public QueryManager::Query {
bool Begin() override;
bool End(base::subtle::Atomic32 submit_count) override;
+ bool QueryCounter(base::subtle::Atomic32 submit_count) override;
+ void Pause() override;
+ void Resume() override;
bool Process(bool did_finish) override;
void Destroy(bool have_context) override;
@@ -370,14 +398,28 @@ GetErrorQuery::GetErrorQuery(
}
bool GetErrorQuery::Begin() {
+ MarkAsActive();
return true;
}
+void GetErrorQuery::Pause() {
+ MarkAsPaused();
+}
+
+void GetErrorQuery::Resume() {
+ MarkAsActive();
+}
+
bool GetErrorQuery::End(base::subtle::Atomic32 submit_count) {
MarkAsPending(submit_count);
return MarkAsCompleted(manager()->decoder()->GetErrorState()->GetGLError());
}
+bool GetErrorQuery::QueryCounter(base::subtle::Atomic32 submit_count) {
+ NOTREACHED();
+ return false;
+}
+
bool GetErrorQuery::Process(bool did_finish) {
NOTREACHED();
return true;
@@ -402,6 +444,9 @@ class CommandsCompletedQuery : public QueryManager::Query {
// Overridden from QueryManager::Query:
bool Begin() override;
bool End(base::subtle::Atomic32 submit_count) override;
+ bool QueryCounter(base::subtle::Atomic32 submit_count) override;
+ void Pause() override;
+ void Resume() override;
bool Process(bool did_finish) override;
void Destroy(bool have_context) override;
@@ -420,16 +465,30 @@ CommandsCompletedQuery::CommandsCompletedQuery(QueryManager* manager,
: Query(manager, target, shm_id, shm_offset) {}
bool CommandsCompletedQuery::Begin() {
+ MarkAsActive();
begin_time_ = base::TimeTicks::Now();
return true;
}
+void CommandsCompletedQuery::Pause() {
+ MarkAsPaused();
+}
+
+void CommandsCompletedQuery::Resume() {
+ MarkAsActive();
+}
+
bool CommandsCompletedQuery::End(base::subtle::Atomic32 submit_count) {
fence_.reset(gfx::GLFence::Create());
DCHECK(fence_);
return AddToPendingQueue(submit_count);
}
+bool CommandsCompletedQuery::QueryCounter(base::subtle::Atomic32 submit_count) {
+ NOTREACHED();
+ return false;
+}
+
bool CommandsCompletedQuery::Process(bool did_finish) {
// Note: |did_finish| guarantees that the GPU has passed the fence but
// we cannot assume that GLFence::HasCompleted() will return true yet as
@@ -437,7 +496,7 @@ bool CommandsCompletedQuery::Process(bool did_finish) {
if (!did_finish && fence_ && !fence_->HasCompleted())
return true;
- base::TimeDelta elapsed = base::TimeTicks::Now() - begin_time_;
+ const base::TimeDelta elapsed = base::TimeTicks::Now() - begin_time_;
return MarkAsCompleted(elapsed.InMicroseconds());
}
@@ -460,6 +519,9 @@ class TimeElapsedQuery : public QueryManager::Query {
// Overridden from QueryManager::Query:
bool Begin() override;
bool End(base::subtle::Atomic32 submit_count) override;
+ bool QueryCounter(base::subtle::Atomic32 submit_count) override;
+ void Pause() override;
+ void Resume() override;
bool Process(bool did_finish) override;
void Destroy(bool have_context) override;
@@ -475,9 +537,13 @@ TimeElapsedQuery::TimeElapsedQuery(QueryManager* manager,
int32 shm_id,
uint32 shm_offset)
: Query(manager, target, shm_id, shm_offset),
- gpu_timer_(manager->CreateGPUTimer(true)) {}
+ gpu_timer_(manager->CreateGPUTimer(true)) {
+}
bool TimeElapsedQuery::Begin() {
+ // Reset the disjoint value before the query begins if it is safe.
+ SafelyResetDisjointValue();
+ MarkAsActive();
gpu_timer_->Start();
return true;
}
@@ -487,23 +553,127 @@ bool TimeElapsedQuery::End(base::subtle::Atomic32 submit_count) {
return AddToPendingQueue(submit_count);
}
+bool TimeElapsedQuery::QueryCounter(base::subtle::Atomic32 submit_count) {
+ NOTREACHED();
+ return false;
+}
+
+void TimeElapsedQuery::Pause() {
+ MarkAsPaused();
+}
+
+void TimeElapsedQuery::Resume() {
+ MarkAsActive();
+}
+
bool TimeElapsedQuery::Process(bool did_finish) {
if (!gpu_timer_->IsAvailable())
return true;
- const uint64_t nano_seconds =
- gpu_timer_->GetDeltaElapsed() * base::Time::kNanosecondsPerMicrosecond;
+ // Make sure disjoint value is up to date. This disjoint check is the only one
+ // that needs to be done to validate that this query is valid. If a disjoint
+ // occurs before the client checks the query value we will just hide the
+ // disjoint state since it did not affect this query.
+ UpdateDisjointValue();
+
+ const uint64_t nano_seconds = gpu_timer_->GetDeltaElapsed() *
+ base::Time::kNanosecondsPerMicrosecond;
return MarkAsCompleted(nano_seconds);
}
void TimeElapsedQuery::Destroy(bool have_context) {
+ gpu_timer_->Destroy(have_context);
+}
+
+TimeElapsedQuery::~TimeElapsedQuery() {}
+
+class TimeStampQuery : public QueryManager::Query {
+ public:
+ TimeStampQuery(QueryManager* manager,
+ GLenum target,
+ int32 shm_id,
+ uint32 shm_offset);
+
+ // Overridden from QueryManager::Query:
+ bool Begin() override;
+ bool End(base::subtle::Atomic32 submit_count) override;
+ bool QueryCounter(base::subtle::Atomic32 submit_count) override;
+ void Pause() override;
+ void Resume() override;
+ bool Process(bool did_finish) override;
+ void Destroy(bool have_context) override;
+
+ protected:
+ ~TimeStampQuery() override;
+
+ private:
+ scoped_ptr<gfx::GPUTimer> gpu_timer_;
+};
+
+TimeStampQuery::TimeStampQuery(QueryManager* manager,
+ GLenum target,
+ int32 shm_id,
+ uint32 shm_offset)
+ : Query(manager, target, shm_id, shm_offset),
+ gpu_timer_(manager->CreateGPUTimer(false)) {}
+
+bool TimeStampQuery::Begin() {
+ NOTREACHED();
+ return false;
+}
+
+bool TimeStampQuery::End(base::subtle::Atomic32 submit_count) {
+ NOTREACHED();
+ return false;
+}
+
+void TimeStampQuery::Pause() {
+ MarkAsPaused();
+}
+
+void TimeStampQuery::Resume() {
+ MarkAsActive();
+}
+
+bool TimeStampQuery::QueryCounter(base::subtle::Atomic32 submit_count) {
+ // Reset the disjoint value before the query begins if it is safe.
+ SafelyResetDisjointValue();
+ MarkAsActive();
+ // After a timestamp has begun, we will want to continually detect
+ // the disjoint value every frame until the context is destroyed.
+ BeginContinualDisjointUpdate();
+
+ gpu_timer_->QueryTimeStamp();
+ return AddToPendingQueue(submit_count);
+}
+
+bool TimeStampQuery::Process(bool did_finish) {
+ if (!gpu_timer_->IsAvailable())
+ return true;
+
+ // Make sure disjoint value is up to date. This disjoint check is the only one
+ // that needs to be done to validate that this query is valid. If a disjoint
+ // occurs before the client checks the query value we will just hide the
+ // disjoint state since it did not affect this query.
+ UpdateDisjointValue();
+
+ int64_t start = 0;
+ int64_t end = 0;
+ gpu_timer_->GetStartEndTimestamps(&start, &end);
+ DCHECK(start == end);
+
+ const uint64_t nano_seconds = start * base::Time::kNanosecondsPerMicrosecond;
+ return MarkAsCompleted(nano_seconds);
+}
+
+void TimeStampQuery::Destroy(bool have_context) {
if (gpu_timer_.get()) {
gpu_timer_->Destroy(have_context);
gpu_timer_.reset();
}
}
-TimeElapsedQuery::~TimeElapsedQuery() {}
+TimeStampQuery::~TimeStampQuery() {}
QueryManager::QueryManager(
GLES2Decoder* decoder,
@@ -515,6 +685,10 @@ QueryManager::QueryManager(
use_arb_occlusion_query_for_occlusion_query_boolean_(
feature_info->feature_flags(
).use_arb_occlusion_query_for_occlusion_query_boolean),
+ update_disjoints_continually_(false),
+ disjoint_notify_shm_id_(-1),
+ disjoint_notify_shm_offset_(0),
+ disjoints_notified_(0),
query_count_(0) {
DCHECK(!(use_arb_occlusion_query_for_occlusion_query_boolean_ &&
use_arb_occlusion_query2_for_occlusion_query_boolean_));
@@ -536,8 +710,10 @@ QueryManager::~QueryManager() {
}
void QueryManager::Destroy(bool have_context) {
+ active_queries_.clear();
pending_queries_.clear();
pending_transfer_queries_.clear();
+ active_queries_.clear();
while (!queries_.empty()) {
Query* query = queries_.begin()->second.get();
query->Destroy(have_context);
@@ -545,6 +721,20 @@ void QueryManager::Destroy(bool have_context) {
}
}
+void QueryManager::SetDisjointSync(int32 shm_id, uint32 shm_offset) {
+ DCHECK(disjoint_notify_shm_id_ == -1);
+ DCHECK(shm_id != -1);
+
+ DisjointValueSync* sync = decoder_->GetSharedMemoryAs<DisjointValueSync*>(
+ shm_id, shm_offset, sizeof(*sync));
+ DCHECK(sync);
+ sync->Reset();
+ disjoints_notified_ = 0;
+
+ disjoint_notify_shm_id_ = shm_id;
+ disjoint_notify_shm_offset_ = shm_offset;
+}
+
QueryManager::Query* QueryManager::CreateQuery(
GLenum target, GLuint client_id, int32 shm_id, uint32 shm_offset) {
scoped_refptr<Query> query;
@@ -555,11 +745,6 @@ QueryManager::Query* QueryManager::CreateQuery(
case GL_LATENCY_QUERY_CHROMIUM:
query = new CommandLatencyQuery(this, target, shm_id, shm_offset);
break;
- case GL_ASYNC_PIXEL_UNPACK_COMPLETED_CHROMIUM:
- // Currently async pixel transfer delegates only support uploads.
- query = new AsyncPixelTransfersCompletedQuery(
- this, target, shm_id, shm_offset);
- break;
case GL_ASYNC_PIXEL_PACK_COMPLETED_CHROMIUM:
query = new AsyncReadPixelsCompletedQuery(
this, target, shm_id, shm_offset);
@@ -573,13 +758,18 @@ QueryManager::Query* QueryManager::CreateQuery(
case GL_TIME_ELAPSED:
query = new TimeElapsedQuery(this, target, shm_id, shm_offset);
break;
- default: {
- GLuint service_id = 0;
- glGenQueries(1, &service_id);
- DCHECK_NE(0u, service_id);
- query = new AllSamplesPassedQuery(
- this, target, shm_id, shm_offset, service_id);
+ case GL_TIMESTAMP:
+ query = new TimeStampQuery(this, target, shm_id, shm_offset);
+ break;
+ case GL_ANY_SAMPLES_PASSED:
+ case GL_ANY_SAMPLES_PASSED_CONSERVATIVE:
+ query = new BooleanQuery(this, target, shm_id, shm_offset);
break;
+ case GL_TRANSFORM_FEEDBACK_PRIMITIVES_WRITTEN:
+ query = new SummedIntegerQuery(this, target, shm_id, shm_offset);
+ break;
+ default: {
+ NOTREACHED();
}
}
std::pair<QueryMap::iterator, bool> result =
@@ -608,16 +798,30 @@ bool QueryManager::IsValidQuery(GLuint id) {
return it != generated_query_ids_.end();
}
-QueryManager::Query* QueryManager::GetQuery(
- GLuint client_id) {
+QueryManager::Query* QueryManager::GetQuery(GLuint client_id) {
QueryMap::iterator it = queries_.find(client_id);
- return it != queries_.end() ? it->second.get() : NULL;
+ return it != queries_.end() ? it->second.get() : nullptr;
+}
+
+QueryManager::Query* QueryManager::GetActiveQuery(GLenum target) {
+ ActiveQueryMap::iterator it = active_queries_.find(target);
+ return it != active_queries_.end() ? it->second.get() : nullptr;
}
void QueryManager::RemoveQuery(GLuint client_id) {
QueryMap::iterator it = queries_.find(client_id);
if (it != queries_.end()) {
Query* query = it->second.get();
+
+ // Remove from active query map if it is active.
+ ActiveQueryMap::iterator active_it = active_queries_.find(query->target());
+ bool is_active = (active_it != active_queries_.end() &&
+ query == active_it->second.get());
+ DCHECK(is_active == query->IsActive());
+ if (is_active)
+ active_queries_.erase(active_it);
+
+ query->Destroy(true);
RemovePendingQuery(query);
query->MarkAsDeleted();
queries_.erase(it);
@@ -665,6 +869,33 @@ void QueryManager::EndQueryHelper(GLenum target) {
glEndQuery(target);
}
+void QueryManager::UpdateDisjointValue() {
+ if (disjoint_notify_shm_id_ != -1) {
+ if (gpu_timing_client_->CheckAndResetTimerErrors()) {
+ disjoints_notified_++;
+
+ DisjointValueSync* sync = decoder_->GetSharedMemoryAs<DisjointValueSync*>(
+ disjoint_notify_shm_id_, disjoint_notify_shm_offset_, sizeof(*sync));
+ if (!sync) {
+ // Shared memory does not seem to be valid, ignore the shm id/offset.
+ disjoint_notify_shm_id_ = -1;
+ disjoint_notify_shm_offset_ = 0;
+ } else {
+ sync->SetDisjointCount(disjoints_notified_);
+ }
+ }
+ }
+}
+
+void QueryManager::SafelyResetDisjointValue() {
+ // It is only safe to reset the disjoint value is there is no active
+ // elapsed timer and we are not continually updating the disjoint value.
+ if (!update_disjoints_continually_ && !GetActiveQuery(GL_TIME_ELAPSED)) {
+ // Reset the error state without storing the result.
+ gpu_timing_client_->CheckAndResetTimerErrors();
+ }
+}
+
QueryManager::Query::Query(
QueryManager* manager, GLenum target, int32 shm_id, uint32 shm_offset)
: manager_(manager),
@@ -672,7 +903,7 @@ QueryManager::Query::Query(
shm_id_(shm_id),
shm_offset_(shm_offset),
submit_count_(0),
- pending_(false),
+ query_state_(kQueryState_Initialize),
deleted_(false) {
DCHECK(manager);
manager_->StartTracking(this);
@@ -686,7 +917,7 @@ void QueryManager::Query::RunCallbacks() {
}
void QueryManager::Query::AddCallback(base::Closure callback) {
- if (pending_) {
+ if (query_state_ == kQueryState_Pending) {
callbacks_.push_back(callback);
} else {
callback.Run();
@@ -705,14 +936,13 @@ QueryManager::Query::~Query() {
}
bool QueryManager::Query::MarkAsCompleted(uint64 result) {
- DCHECK(pending_);
+ UnmarkAsPending();
QuerySync* sync = manager_->decoder_->GetSharedMemoryAs<QuerySync*>(
shm_id_, shm_offset_, sizeof(*sync));
if (!sync) {
return false;
}
- pending_ = false;
sync->result = result;
base::subtle::Release_Store(&sync->process_count, submit_count_);
@@ -725,12 +955,14 @@ bool QueryManager::ProcessPendingQueries(bool did_finish) {
if (!query->Process(did_finish)) {
return false;
}
- if (query->pending()) {
+ if (query->IsPending()) {
break;
}
query->RunCallbacks();
pending_queries_.pop_front();
}
+ // If glFinish() has been called, all of our queries should be completed.
+ DCHECK(!did_finish || pending_queries_.empty());
return true;
}
@@ -745,7 +977,7 @@ bool QueryManager::ProcessPendingTransferQueries() {
if (!query->Process(false)) {
return false;
}
- if (query->pending()) {
+ if (query->IsPending()) {
break;
}
query->RunCallbacks();
@@ -759,6 +991,11 @@ bool QueryManager::HavePendingTransferQueries() {
return !pending_transfer_queries_.empty();
}
+void QueryManager::ProcessFrameBeginUpdates() {
+ if (update_disjoints_continually_)
+ UpdateDisjointValue();
+}
+
bool QueryManager::AddPendingQuery(Query* query,
base::subtle::Atomic32 submit_count) {
DCHECK(query);
@@ -786,7 +1023,7 @@ bool QueryManager::AddPendingTransferQuery(
bool QueryManager::RemovePendingQuery(Query* query) {
DCHECK(query);
- if (query->pending()) {
+ if (query->IsPending()) {
// TODO(gman): Speed this up if this is a common operation. This would only
// happen if you do being/end begin/end on the same query without waiting
// for the first one to finish.
@@ -816,7 +1053,12 @@ bool QueryManager::BeginQuery(Query* query) {
if (!RemovePendingQuery(query)) {
return false;
}
- return query->Begin();
+ if (query->Begin()) {
+ active_queries_[query->target()] = query;
+ return true;
+ }
+
+ return false;
}
bool QueryManager::EndQuery(Query* query, base::subtle::Atomic32 submit_count) {
@@ -824,8 +1066,39 @@ bool QueryManager::EndQuery(Query* query, base::subtle::Atomic32 submit_count) {
if (!RemovePendingQuery(query)) {
return false;
}
+
+ // Remove from active query map if it is active.
+ ActiveQueryMap::iterator active_it = active_queries_.find(query->target());
+ DCHECK(active_it != active_queries_.end());
+ DCHECK(query == active_it->second.get());
+ active_queries_.erase(active_it);
+
return query->End(submit_count);
}
+bool QueryManager::QueryCounter(
+ Query* query, base::subtle::Atomic32 submit_count) {
+ DCHECK(query);
+ return query->QueryCounter(submit_count);
+}
+
+void QueryManager::PauseQueries() {
+ for (std::pair<const GLenum, scoped_refptr<Query> >& it : active_queries_) {
+ if (it.second->IsActive()) {
+ it.second->Pause();
+ DCHECK(it.second->IsPaused());
+ }
+ }
+}
+
+void QueryManager::ResumeQueries() {
+ for (std::pair<const GLenum, scoped_refptr<Query> >& it : active_queries_) {
+ if (it.second->IsPaused()) {
+ it.second->Resume();
+ DCHECK(it.second->IsActive());
+ }
+ }
+}
+
} // namespace gles2
} // namespace gpu
diff --git a/chromium/gpu/command_buffer/service/query_manager.h b/chromium/gpu/command_buffer/service/query_manager.h
index e453d03f818..204c100b3f1 100644
--- a/chromium/gpu/command_buffer/service/query_manager.h
+++ b/chromium/gpu/command_buffer/service/query_manager.h
@@ -50,8 +50,20 @@ class GPU_EXPORT QueryManager {
return target() && !IsDeleted();
}
- bool pending() const {
- return pending_;
+ bool IsActive() const {
+ return query_state_ == kQueryState_Active;
+ }
+
+ bool IsPaused() const {
+ return query_state_ == kQueryState_Paused;
+ }
+
+ bool IsPending() const {
+ return query_state_ == kQueryState_Pending;
+ }
+
+ bool IsFinished() const {
+ return query_state_ == kQueryState_Finished;
}
int32 shm_id() const {
@@ -69,8 +81,17 @@ class GPU_EXPORT QueryManager {
virtual bool End(base::subtle::Atomic32 submit_count) = 0;
// Returns false if shared memory for sync is invalid.
+ virtual bool QueryCounter(base::subtle::Atomic32 submit_count) = 0;
+
+ // Returns false if shared memory for sync is invalid.
virtual bool Process(bool did_finish) = 0;
+ // Pauses active query to be resumed later.
+ virtual void Pause() = 0;
+
+ // Resume from a paused active query.
+ virtual void Resume() = 0;
+
virtual void Destroy(bool have_context) = 0;
void AddCallback(base::Closure callback);
@@ -86,18 +107,30 @@ class GPU_EXPORT QueryManager {
deleted_ = true;
}
- // Returns false if shared memory for sync is invalid.
- bool MarkAsCompleted(uint64 result);
+ void MarkAsActive() {
+ DCHECK(query_state_ == kQueryState_Initialize ||
+ query_state_ == kQueryState_Paused ||
+ query_state_ == kQueryState_Finished);
+ query_state_ = kQueryState_Active;
+ }
+
+ void MarkAsPaused() {
+ DCHECK(query_state_ == kQueryState_Active);
+ query_state_ = kQueryState_Paused;
+ }
void MarkAsPending(base::subtle::Atomic32 submit_count) {
- DCHECK(!pending_);
- pending_ = true;
+ DCHECK(query_state_ == kQueryState_Active);
+ query_state_ = kQueryState_Pending;
submit_count_ = submit_count;
}
+ // Returns false if shared memory for sync is invalid.
+ bool MarkAsCompleted(uint64 result);
+
void UnmarkAsPending() {
- DCHECK(pending_);
- pending_ = false;
+ DCHECK(query_state_ == kQueryState_Pending);
+ query_state_ = kQueryState_Finished;
}
// Returns false if shared memory for sync is invalid.
@@ -118,6 +151,18 @@ class GPU_EXPORT QueryManager {
manager_->EndQueryHelper(target);
}
+ void SafelyResetDisjointValue() {
+ manager_->SafelyResetDisjointValue();
+ }
+
+ void UpdateDisjointValue() {
+ manager_->UpdateDisjointValue();
+ }
+
+ void BeginContinualDisjointUpdate() {
+ manager_->update_disjoints_continually_ = true;
+ }
+
base::subtle::Atomic32 submit_count() const { return submit_count_; }
private:
@@ -140,8 +185,14 @@ class GPU_EXPORT QueryManager {
// Count to set process count do when completed.
base::subtle::Atomic32 submit_count_;
- // True if in the queue.
- bool pending_;
+ // Current state of the query.
+ enum QueryState {
+ kQueryState_Initialize, // Has not been queried yet.
+ kQueryState_Active, // Query began but has not ended.
+ kQueryState_Paused, // Query was active but is now paused.
+ kQueryState_Pending, // Query ended, waiting for result.
+ kQueryState_Finished, // Query received result.
+ } query_state_;
// True if deleted.
bool deleted_;
@@ -158,6 +209,9 @@ class GPU_EXPORT QueryManager {
// Must call before destruction.
void Destroy(bool have_context);
+ // Sets up a location to be incremented whenever a disjoint is detected.
+ void SetDisjointSync(int32 shm_id, uint32 shm_offset);
+
// Creates a Query for the given query.
Query* CreateQuery(
GLenum target, GLuint client_id, int32 shm_id, uint32 shm_offset);
@@ -165,6 +219,9 @@ class GPU_EXPORT QueryManager {
// Gets the query info for the given query.
Query* GetQuery(GLuint client_id);
+ // Gets the currently active query for a target.
+ Query* GetActiveQuery(GLenum target);
+
// Removes a query info for the given query.
void RemoveQuery(GLuint client_id);
@@ -174,6 +231,12 @@ class GPU_EXPORT QueryManager {
// Returns false if any query is pointing to invalid shared memory.
bool EndQuery(Query* query, base::subtle::Atomic32 submit_count);
+ // Returns false if any query is pointing to invalid shared memory.
+ bool QueryCounter(Query* query, base::subtle::Atomic32 submit_count);
+
+ void PauseQueries();
+ void ResumeQueries();
+
// Processes pending queries. Returns false if any queries are pointing
// to invalid shared memory. |did_finish| is true if this is called as
// a result of calling glFinish().
@@ -189,6 +252,9 @@ class GPU_EXPORT QueryManager {
// True if there are pending transfer queries.
bool HavePendingTransferQueries();
+ // Do any updates we need to do when the frame has begun.
+ void ProcessFrameBeginUpdates();
+
GLES2Decoder* decoder() const {
return decoder_;
}
@@ -225,12 +291,28 @@ class GPU_EXPORT QueryManager {
// used to emulate a query.
GLenum AdjustTargetForEmulation(GLenum target);
+ // Checks and notifies if a disjoint occurred.
+ void UpdateDisjointValue();
+
+ // Safely resets the disjoint value if no queries are active.
+ void SafelyResetDisjointValue();
+
// Used to validate shared memory and get GL errors.
GLES2Decoder* decoder_;
bool use_arb_occlusion_query2_for_occlusion_query_boolean_;
bool use_arb_occlusion_query_for_occlusion_query_boolean_;
+ // Whether we are tracking disjoint values every frame.
+ bool update_disjoints_continually_;
+
+ // The shared memory used for disjoint notifications.
+ int32_t disjoint_notify_shm_id_;
+ uint32_t disjoint_notify_shm_offset_;
+
+ // Current number of disjoints notified.
+ uint32_t disjoints_notified_;
+
// Counts the number of Queries allocated with 'this' as their manager.
// Allows checking no Query will outlive this.
unsigned query_count_;
@@ -242,6 +324,10 @@ class GPU_EXPORT QueryManager {
typedef base::hash_set<GLuint> GeneratedQueryIds;
GeneratedQueryIds generated_query_ids_;
+ // A map of targets -> Query for current active queries.
+ typedef std::map<GLenum, scoped_refptr<Query> > ActiveQueryMap;
+ ActiveQueryMap active_queries_;
+
// Queries waiting for completion.
typedef std::deque<scoped_refptr<Query> > QueryQueue;
QueryQueue pending_queries_;
@@ -249,7 +335,6 @@ class GPU_EXPORT QueryManager {
// Async pixel transfer queries waiting for completion.
QueryQueue pending_transfer_queries_;
- // Used for timer queries.
scoped_refptr<gfx::GPUTimingClient> gpu_timing_client_;
DISALLOW_COPY_AND_ASSIGN(QueryManager);
diff --git a/chromium/gpu/command_buffer/service/query_manager_unittest.cc b/chromium/gpu/command_buffer/service/query_manager_unittest.cc
index f6e36822195..621cd6f107f 100644
--- a/chromium/gpu/command_buffer/service/query_manager_unittest.cc
+++ b/chromium/gpu/command_buffer/service/query_manager_unittest.cc
@@ -12,7 +12,10 @@
#include "gpu/command_buffer/service/gpu_service_test.h"
#include "gpu/command_buffer/service/test_helper.h"
#include "testing/gtest/include/gtest/gtest.h"
+#include "ui/gl/gl_context.h"
#include "ui/gl/gl_mock.h"
+#include "ui/gl/gpu_timing.h"
+#include "ui/gl/gpu_timing_fake.h"
using ::testing::_;
using ::testing::InSequence;
@@ -25,9 +28,11 @@ namespace gles2 {
class QueryManagerTest : public GpuServiceTest {
public:
static const int32 kSharedMemoryId = 401;
- static const size_t kSharedBufferSize = 2048;
static const uint32 kSharedMemoryOffset = 132;
- static const int32 kInvalidSharedMemoryId = 402;
+ static const int32 kSharedMemory2Id = 402;
+ static const uint32 kSharedMemory2Offset = 232;
+ static const size_t kSharedBufferSize = 2048;
+ static const int32 kInvalidSharedMemoryId = 403;
static const uint32 kInvalidSharedMemoryOffset = kSharedBufferSize + 1;
static const uint32 kInitialResult = 0xBDBDBDBDu;
static const uint8 kInitialMemoryValue = 0xBDu;
@@ -38,16 +43,10 @@ class QueryManagerTest : public GpuServiceTest {
protected:
void SetUp() override {
- GpuServiceTest::SetUpWithGLVersion("2.1", "GL_ARB_occlusion_query");
- engine_.reset(new MockCommandBufferEngine());
- decoder_.reset(new MockGLES2Decoder());
- decoder_->set_engine(engine_.get());
- TestHelper::SetupFeatureInfoInitExpectations(
- gl_.get(),
- "GL_EXT_occlusion_query_boolean");
- scoped_refptr<FeatureInfo> feature_info(new FeatureInfo());
- feature_info->Initialize();
- manager_.reset(new QueryManager(decoder_.get(), feature_info.get()));
+ GpuServiceTest::SetUpWithGLVersion("3.2",
+ "GL_ARB_occlusion_query, "
+ "GL_ARB_timer_query");
+ SetUpMockGL("GL_EXT_occlusion_query_boolean, GL_ARB_timer_query");
}
void TearDown() override {
@@ -58,6 +57,19 @@ class QueryManagerTest : public GpuServiceTest {
GpuServiceTest::TearDown();
}
+ void SetUpMockGL(const char* extension_expectations) {
+ engine_.reset(new MockCommandBufferEngine());
+ decoder_.reset(new MockGLES2Decoder());
+ decoder_->set_engine(engine_.get());
+ TestHelper::SetupFeatureInfoInitExpectations(
+ gl_.get(), extension_expectations);
+ EXPECT_CALL(*decoder_.get(), GetGLContext())
+ .WillRepeatedly(Return(GetGLContext()));
+ scoped_refptr<FeatureInfo> feature_info(new FeatureInfo());
+ feature_info->InitializeForTesting();
+ manager_.reset(new QueryManager(decoder_.get(), feature_info.get()));
+ }
+
QueryManager::Query* CreateQuery(
GLenum target, GLuint client_id, int32 shm_id, uint32 shm_offset,
GLuint service_id) {
@@ -91,18 +103,28 @@ class QueryManagerTest : public GpuServiceTest {
shared_memory->CreateAndMapAnonymous(kSharedBufferSize);
valid_buffer_ =
MakeBufferFromSharedMemory(shared_memory.Pass(), kSharedBufferSize);
- data_ = static_cast<uint8*>(valid_buffer_->memory());
+
+ scoped_ptr<base::SharedMemory> shared_memory2(new base::SharedMemory());
+ shared_memory2->CreateAndMapAnonymous(kSharedBufferSize);
+ valid_buffer2_ =
+ MakeBufferFromSharedMemory(shared_memory2.Pass(), kSharedBufferSize);
+
ClearSharedMemory();
}
~MockCommandBufferEngine() override {}
scoped_refptr<gpu::Buffer> GetSharedMemoryBuffer(int32 shm_id) override {
- return shm_id == kSharedMemoryId ? valid_buffer_ : invalid_buffer_;
+ switch (shm_id) {
+ case kSharedMemoryId: return valid_buffer_;
+ case kSharedMemory2Id: return valid_buffer2_;
+ default: return invalid_buffer_;
+ }
}
void ClearSharedMemory() {
- memset(data_, kInitialMemoryValue, kSharedBufferSize);
+ memset(valid_buffer_->memory(), kInitialMemoryValue, kSharedBufferSize);
+ memset(valid_buffer2_->memory(), kInitialMemoryValue, kSharedBufferSize);
}
void set_token(int32 token) override { DCHECK(false); }
@@ -125,19 +147,28 @@ class QueryManagerTest : public GpuServiceTest {
}
private:
- uint8* data_;
scoped_refptr<gpu::Buffer> valid_buffer_;
+ scoped_refptr<gpu::Buffer> valid_buffer2_;
scoped_refptr<gpu::Buffer> invalid_buffer_;
};
scoped_ptr<MockCommandBufferEngine> engine_;
};
+class QueryManagerManualSetupTest : public QueryManagerTest {
+ protected:
+ void SetUp() override {
+ // Let test setup manually.
+ }
+};
+
// GCC requires these declarations, but MSVC requires they not be present
#ifndef COMPILER_MSVC
const int32 QueryManagerTest::kSharedMemoryId;
-const size_t QueryManagerTest::kSharedBufferSize;
const uint32 QueryManagerTest::kSharedMemoryOffset;
+const int32 QueryManagerTest::kSharedMemory2Id;
+const uint32 QueryManagerTest::kSharedMemory2Offset;
+const size_t QueryManagerTest::kSharedBufferSize;
const int32 QueryManagerTest::kInvalidSharedMemoryId;
const uint32 QueryManagerTest::kInvalidSharedMemoryOffset;
const uint32 QueryManagerTest::kInitialResult;
@@ -160,6 +191,9 @@ TEST_F(QueryManagerTest, Basic) {
// Check we get nothing for a non-existent query.
EXPECT_TRUE(manager_->GetQuery(kClient2Id) == NULL);
// Check we can delete the query.
+ EXPECT_CALL(*gl_, DeleteQueries(1, ::testing::Pointee(kService1Id)))
+ .Times(1)
+ .RetiresOnSaturation();
manager_->RemoveQuery(kClient1Id);
// Check we get nothing for a non-existent query.
EXPECT_TRUE(manager_->GetQuery(kClient1Id) == NULL);
@@ -200,7 +234,7 @@ TEST_F(QueryManagerTest, QueryBasic) {
EXPECT_TRUE(query->IsValid());
EXPECT_FALSE(query->IsDeleted());
- EXPECT_FALSE(query->pending());
+ EXPECT_FALSE(query->IsPending());
EXPECT_EQ(kTarget, query->target());
EXPECT_EQ(kSharedMemoryId, query->shm_id());
EXPECT_EQ(kSharedMemoryOffset, query->shm_offset());
@@ -230,7 +264,7 @@ TEST_F(QueryManagerTest, ProcessPendingQuery) {
// Queue it
QueueQuery(query.get(), kService1Id, kSubmitCount);
- EXPECT_TRUE(query->pending());
+ EXPECT_TRUE(query->IsPending());
EXPECT_TRUE(manager_->HavePendingQueries());
// Process with return not available.
@@ -240,7 +274,7 @@ TEST_F(QueryManagerTest, ProcessPendingQuery) {
.WillOnce(SetArgumentPointee<2>(0))
.RetiresOnSaturation();
EXPECT_TRUE(manager_->ProcessPendingQueries(false));
- EXPECT_TRUE(query->pending());
+ EXPECT_TRUE(query->IsPending());
EXPECT_EQ(0, sync->process_count);
EXPECT_EQ(0u, sync->result);
@@ -255,7 +289,7 @@ TEST_F(QueryManagerTest, ProcessPendingQuery) {
.WillOnce(SetArgumentPointee<2>(kResult))
.RetiresOnSaturation();
EXPECT_TRUE(manager_->ProcessPendingQueries(false));
- EXPECT_FALSE(query->pending());
+ EXPECT_FALSE(query->IsPending());
EXPECT_EQ(kSubmitCount, sync->process_count);
EXPECT_EQ(kResult, sync->result);
EXPECT_FALSE(manager_->HavePendingQueries());
@@ -313,9 +347,9 @@ TEST_F(QueryManagerTest, ProcessPendingQueries) {
QueueQuery(query1.get(), kService1Id, kSubmitCount1);
QueueQuery(query2.get(), kService2Id, kSubmitCount2);
QueueQuery(query3.get(), kService3Id, kSubmitCount3);
- EXPECT_TRUE(query1->pending());
- EXPECT_TRUE(query2->pending());
- EXPECT_TRUE(query3->pending());
+ EXPECT_TRUE(query1->IsPending());
+ EXPECT_TRUE(query2->IsPending());
+ EXPECT_TRUE(query3->IsPending());
EXPECT_TRUE(manager_->HavePendingQueries());
// Process with return available for first 2 queries.
@@ -344,9 +378,9 @@ TEST_F(QueryManagerTest, ProcessPendingQueries) {
.RetiresOnSaturation();
EXPECT_TRUE(manager_->ProcessPendingQueries(false));
}
- EXPECT_FALSE(query1->pending());
- EXPECT_FALSE(query2->pending());
- EXPECT_TRUE(query3->pending());
+ EXPECT_FALSE(query1->IsPending());
+ EXPECT_FALSE(query2->IsPending());
+ EXPECT_TRUE(query3->IsPending());
EXPECT_EQ(kSubmitCount1, sync1->process_count);
EXPECT_EQ(kSubmitCount2, sync2->process_count);
EXPECT_EQ(kResult1, sync1->result);
@@ -362,7 +396,7 @@ TEST_F(QueryManagerTest, ProcessPendingQueries) {
.WillOnce(SetArgumentPointee<2>(0))
.RetiresOnSaturation();
EXPECT_TRUE(manager_->ProcessPendingQueries(false));
- EXPECT_TRUE(query3->pending());
+ EXPECT_TRUE(query3->IsPending());
EXPECT_EQ(0, sync3->process_count);
EXPECT_EQ(0u, sync3->result);
EXPECT_TRUE(manager_->HavePendingQueries());
@@ -378,7 +412,7 @@ TEST_F(QueryManagerTest, ProcessPendingQueries) {
.WillOnce(SetArgumentPointee<2>(kResult3))
.RetiresOnSaturation();
EXPECT_TRUE(manager_->ProcessPendingQueries(false));
- EXPECT_FALSE(query3->pending());
+ EXPECT_FALSE(query3->IsPending());
EXPECT_EQ(kSubmitCount3, sync3->process_count);
EXPECT_EQ(kResult3, sync3->result);
EXPECT_FALSE(manager_->HavePendingQueries());
@@ -470,13 +504,13 @@ TEST_F(QueryManagerTest, ARBOcclusionQuery2) {
gl_.get(),
"GL_ARB_occlusion_query2");
scoped_refptr<FeatureInfo> feature_info(new FeatureInfo());
- feature_info->Initialize();
+ feature_info->InitializeForTesting();
scoped_ptr<QueryManager> manager(
new QueryManager(decoder_.get(), feature_info.get()));
EXPECT_CALL(*gl_, GenQueries(1, _))
- .WillOnce(SetArgumentPointee<1>(kService1Id))
- .RetiresOnSaturation();
+ .WillOnce(SetArgumentPointee<1>(kService1Id))
+ .RetiresOnSaturation();
QueryManager::Query* query = manager->CreateQuery(
kTarget, kClient1Id, kSharedMemoryId, kSharedMemoryOffset);
ASSERT_TRUE(query != NULL);
@@ -504,13 +538,13 @@ TEST_F(QueryManagerTest, ARBOcclusionQuery) {
gl_.get(),
"GL_ARB_occlusion_query");
scoped_refptr<FeatureInfo> feature_info(new FeatureInfo());
- feature_info->Initialize();
+ feature_info->InitializeForTesting();
scoped_ptr<QueryManager> manager(
new QueryManager(decoder_.get(), feature_info.get()));
EXPECT_CALL(*gl_, GenQueries(1, _))
- .WillOnce(SetArgumentPointee<1>(kService1Id))
- .RetiresOnSaturation();
+ .WillOnce(SetArgumentPointee<1>(kService1Id))
+ .RetiresOnSaturation();
QueryManager::Query* query = manager->CreateQuery(
kTarget, kClient1Id, kSharedMemoryId, kSharedMemoryOffset);
ASSERT_TRUE(query != NULL);
@@ -526,6 +560,353 @@ TEST_F(QueryManagerTest, ARBOcclusionQuery) {
manager->Destroy(false);
}
+TEST_F(QueryManagerTest, ARBOcclusionPauseResume) {
+ const GLuint kClient1Id = 1;
+ const GLuint kService1Id = 11;
+ const GLuint kService2Id = 12;
+ const GLenum kTarget = GL_ANY_SAMPLES_PASSED_EXT;
+ const base::subtle::Atomic32 kSubmitCount = 123;
+
+ TestHelper::SetupFeatureInfoInitExpectations(
+ gl_.get(),
+ "GL_ARB_occlusion_query");
+ scoped_refptr<FeatureInfo> feature_info(new FeatureInfo());
+ feature_info->InitializeForTesting();
+ scoped_ptr<QueryManager> manager(
+ new QueryManager(decoder_.get(), feature_info.get()));
+
+ EXPECT_CALL(*gl_, GenQueries(1, _))
+ .WillOnce(SetArgumentPointee<1>(kService1Id))
+ .RetiresOnSaturation();
+ QueryManager::Query* query = manager->CreateQuery(
+ kTarget, kClient1Id, kSharedMemoryId, kSharedMemoryOffset);
+ ASSERT_TRUE(query != NULL);
+
+ EXPECT_CALL(*gl_, BeginQuery(GL_SAMPLES_PASSED_ARB, kService1Id))
+ .Times(1)
+ .RetiresOnSaturation();
+ EXPECT_TRUE(manager->BeginQuery(query));
+
+ // Pause and Resume the manager.
+ EXPECT_CALL(*gl_, EndQuery(GL_SAMPLES_PASSED_ARB))
+ .Times(1)
+ .RetiresOnSaturation();
+ manager->PauseQueries();
+
+ EXPECT_CALL(*gl_, GenQueries(1, _))
+ .WillOnce(SetArgumentPointee<1>(kService2Id))
+ .RetiresOnSaturation();
+ EXPECT_CALL(*gl_, BeginQuery(GL_SAMPLES_PASSED_ARB, kService2Id))
+ .Times(1)
+ .RetiresOnSaturation();
+ manager->ResumeQueries();
+
+ EXPECT_CALL(*gl_, EndQuery(GL_SAMPLES_PASSED_ARB))
+ .Times(1)
+ .RetiresOnSaturation();
+ EXPECT_TRUE(manager->EndQuery(query, kSubmitCount));
+
+ EXPECT_CALL(*gl_, GetQueryObjectuiv(kService2Id,
+ GL_QUERY_RESULT_AVAILABLE_EXT, _))
+ .WillOnce(SetArgumentPointee<2>(1u))
+ .RetiresOnSaturation();
+ EXPECT_CALL(*gl_, GetQueryObjectuiv(kService1Id,
+ GL_QUERY_RESULT_EXT, _))
+ .WillOnce(SetArgumentPointee<2>(0u))
+ .RetiresOnSaturation();
+ EXPECT_CALL(*gl_, GetQueryObjectuiv(kService2Id,
+ GL_QUERY_RESULT_EXT, _))
+ .WillOnce(SetArgumentPointee<2>(1u))
+ .RetiresOnSaturation();
+ EXPECT_TRUE(manager->ProcessPendingQueries(false));
+ EXPECT_TRUE(query->IsFinished());
+
+ QuerySync* sync = decoder_->GetSharedMemoryAs<QuerySync*>(
+ kSharedMemoryId, kSharedMemoryOffset, sizeof(*sync));
+ EXPECT_EQ(1u, sync->result);
+
+ // Make sure new query still works.
+ EXPECT_CALL(*gl_, DeleteQueries(1, ::testing::Pointee(kService2Id)))
+ .Times(1)
+ .RetiresOnSaturation();
+ EXPECT_CALL(*gl_, BeginQuery(GL_SAMPLES_PASSED_ARB, kService1Id))
+ .Times(1)
+ .RetiresOnSaturation();
+ EXPECT_CALL(*gl_, EndQuery(GL_SAMPLES_PASSED_ARB))
+ .Times(1)
+ .RetiresOnSaturation();
+ EXPECT_TRUE(manager->BeginQuery(query));
+ EXPECT_TRUE(manager->EndQuery(query, kSubmitCount + 1));
+
+ EXPECT_CALL(*gl_, GetQueryObjectuiv(kService1Id,
+ GL_QUERY_RESULT_AVAILABLE_EXT, _))
+ .WillOnce(SetArgumentPointee<2>(1u))
+ .RetiresOnSaturation();
+ EXPECT_CALL(*gl_, GetQueryObjectuiv(kService1Id,
+ GL_QUERY_RESULT_EXT, _))
+ .WillOnce(SetArgumentPointee<2>(0u))
+ .RetiresOnSaturation();
+ EXPECT_TRUE(manager->ProcessPendingQueries(false));
+ EXPECT_TRUE(query->IsFinished());
+
+ EXPECT_EQ(0u, sync->result);
+ EXPECT_CALL(*gl_, DeleteQueries(1, ::testing::Pointee(kService1Id)))
+ .Times(1)
+ .RetiresOnSaturation();
+ manager->Destroy(true);
+}
+
+TEST_F(QueryManagerTest, TimeElapsedQuery) {
+ const GLuint kClient1Id = 1;
+ const GLenum kTarget = GL_TIME_ELAPSED_EXT;
+ const base::subtle::Atomic32 kSubmitCount = 123;
+ gfx::GPUTimingFake fake_timing_queries;
+ decoder_->GetGLContext()->CreateGPUTimingClient()->SetCpuTimeForTesting(
+ base::Bind(&gfx::GPUTimingFake::GetFakeCPUTime));
+
+ QueryManager::Query* query = manager_->CreateQuery(
+ kTarget, kClient1Id, kSharedMemoryId, kSharedMemoryOffset);
+ ASSERT_TRUE(query != NULL);
+
+ fake_timing_queries.ExpectGPUTimerQuery(*gl_, true);
+ fake_timing_queries.SetCurrentGLTime(
+ 200 * base::Time::kNanosecondsPerMicrosecond);
+ EXPECT_TRUE(manager_->BeginQuery(query));
+ fake_timing_queries.SetCurrentGLTime(
+ 300 * base::Time::kNanosecondsPerMicrosecond);
+ EXPECT_TRUE(manager_->EndQuery(query, kSubmitCount));
+ EXPECT_TRUE(manager_->ProcessPendingQueries(false));
+
+ EXPECT_TRUE(query->IsFinished());
+
+ QuerySync* sync = decoder_->GetSharedMemoryAs<QuerySync*>(
+ kSharedMemoryId, kSharedMemoryOffset, sizeof(*sync));
+ const uint64_t expected_result =
+ 100u * base::Time::kNanosecondsPerMicrosecond;
+ EXPECT_EQ(expected_result, sync->result);
+
+ manager_->Destroy(false);
+}
+
+TEST_F(QueryManagerTest, TimeElapsedPauseResume) {
+ const GLuint kClient1Id = 1;
+ const GLenum kTarget = GL_TIME_ELAPSED_EXT;
+ const base::subtle::Atomic32 kSubmitCount = 123;
+ gfx::GPUTimingFake fake_timing_queries;
+ decoder_->GetGLContext()->CreateGPUTimingClient()->SetCpuTimeForTesting(
+ base::Bind(&gfx::GPUTimingFake::GetFakeCPUTime));
+
+ QueryManager::Query* query = manager_->CreateQuery(
+ kTarget, kClient1Id, kSharedMemoryId, kSharedMemoryOffset);
+ ASSERT_TRUE(query != NULL);
+
+ fake_timing_queries.ExpectGPUTimerQuery(*gl_, true);
+ fake_timing_queries.SetCurrentGLTime(
+ 200 * base::Time::kNanosecondsPerMicrosecond);
+ EXPECT_TRUE(manager_->BeginQuery(query));
+
+ // Pause and Resume here.
+ fake_timing_queries.SetCurrentGLTime(
+ 300 * base::Time::kNanosecondsPerMicrosecond);
+ manager_->PauseQueries();
+
+ fake_timing_queries.SetCurrentGLTime(
+ 400 * base::Time::kNanosecondsPerMicrosecond);
+ manager_->ResumeQueries();
+
+ fake_timing_queries.SetCurrentGLTime(
+ 500 * base::Time::kNanosecondsPerMicrosecond);
+ EXPECT_TRUE(manager_->EndQuery(query, kSubmitCount));
+
+ EXPECT_TRUE(manager_->ProcessPendingQueries(false));
+ EXPECT_TRUE(query->IsFinished());
+
+ QuerySync* sync = decoder_->GetSharedMemoryAs<QuerySync*>(
+ kSharedMemoryId, kSharedMemoryOffset, sizeof(*sync));
+ const uint64_t expected_result =
+ 300u * base::Time::kNanosecondsPerMicrosecond;
+ EXPECT_EQ(expected_result, sync->result);
+
+ // Make sure next query works properly.
+ fake_timing_queries.SetCurrentGLTime(
+ 600 * base::Time::kNanosecondsPerMicrosecond);
+ EXPECT_TRUE(manager_->BeginQuery(query));
+ fake_timing_queries.SetCurrentGLTime(
+ 700 * base::Time::kNanosecondsPerMicrosecond);
+ EXPECT_TRUE(manager_->EndQuery(query, kSubmitCount + 1));
+ EXPECT_TRUE(manager_->ProcessPendingQueries(false));
+
+ EXPECT_TRUE(query->IsFinished());
+
+ const uint64_t expected_result2 =
+ 100u * base::Time::kNanosecondsPerMicrosecond;
+ EXPECT_EQ(expected_result2, sync->result);
+
+ manager_->Destroy(false);
+}
+
+TEST_F(QueryManagerManualSetupTest, TimeElapsedDisjoint) {
+ GpuServiceTest::SetUpWithGLVersion("OpenGL ES 3.0",
+ "GL_EXT_disjoint_timer_query");
+ gfx::GPUTimingFake fake_timing_queries;
+ fake_timing_queries.ExpectDisjointCalls(*gl_);
+ SetUpMockGL("GL_EXT_disjoint_timer_query");
+
+ DisjointValueSync* disjoint_sync =
+ decoder_->GetSharedMemoryAs<DisjointValueSync*>(kSharedMemory2Id,
+ kSharedMemory2Offset,
+ sizeof(*disjoint_sync));
+ manager_->SetDisjointSync(kSharedMemory2Id, kSharedMemory2Offset);
+
+ const uint32_t current_disjoint_value = disjoint_sync->GetDisjointCount();
+ ASSERT_EQ(0u, current_disjoint_value);
+
+ const GLuint kClient1Id = 1;
+ const GLenum kTarget = GL_TIME_ELAPSED_EXT;
+ const base::subtle::Atomic32 kSubmitCount = 123;
+
+ QueryManager::Query* query = manager_->CreateQuery(
+ kTarget, kClient1Id, kSharedMemoryId, kSharedMemoryOffset);
+ ASSERT_TRUE(query != NULL);
+
+ // Disjoint happening before the query should not trigger a disjoint event.
+ fake_timing_queries.SetDisjoint();
+
+ fake_timing_queries.ExpectGPUTimerQuery(*gl_, true);
+ EXPECT_TRUE(manager_->BeginQuery(query));
+ EXPECT_TRUE(manager_->EndQuery(query, kSubmitCount));
+ EXPECT_TRUE(manager_->ProcessPendingQueries(false));
+
+ EXPECT_TRUE(query->IsFinished());
+ EXPECT_EQ(current_disjoint_value, disjoint_sync->GetDisjointCount());
+
+ // Disjoint happening during query should trigger disjoint event.
+ fake_timing_queries.ExpectGPUTimerQuery(*gl_, true);
+ EXPECT_TRUE(manager_->BeginQuery(query));
+ fake_timing_queries.SetDisjoint();
+ EXPECT_TRUE(manager_->EndQuery(query, kSubmitCount));
+ EXPECT_TRUE(manager_->ProcessPendingQueries(false));
+
+ EXPECT_TRUE(query->IsFinished());
+ EXPECT_NE(current_disjoint_value, disjoint_sync->GetDisjointCount());
+
+ manager_->Destroy(false);
+}
+
+TEST_F(QueryManagerTest, TimeStampQuery) {
+ const GLuint kClient1Id = 1;
+ const GLenum kTarget = GL_TIMESTAMP_EXT;
+ const base::subtle::Atomic32 kSubmitCount = 123;
+ gfx::GPUTimingFake fake_timing_queries;
+
+ decoder_->GetGLContext()->CreateGPUTimingClient()->SetCpuTimeForTesting(
+ base::Bind(&gfx::GPUTimingFake::GetFakeCPUTime));
+
+ QueryManager::Query* query = manager_->CreateQuery(
+ kTarget, kClient1Id, kSharedMemoryId, kSharedMemoryOffset);
+ ASSERT_TRUE(query != NULL);
+
+ const uint64_t expected_result =
+ 100u * base::Time::kNanosecondsPerMicrosecond;
+ fake_timing_queries.SetCurrentGLTime(expected_result);
+ fake_timing_queries.ExpectGPUTimeStampQuery(*gl_, false);
+ EXPECT_TRUE(manager_->QueryCounter(query, kSubmitCount));
+ EXPECT_TRUE(manager_->ProcessPendingQueries(false));
+
+ QuerySync* sync = decoder_->GetSharedMemoryAs<QuerySync*>(
+ kSharedMemoryId, kSharedMemoryOffset, sizeof(*sync));
+ EXPECT_EQ(expected_result, sync->result);
+
+ manager_->Destroy(false);
+}
+
+TEST_F(QueryManagerManualSetupTest, TimeStampDisjoint) {
+ GpuServiceTest::SetUpWithGLVersion("OpenGL ES 3.0",
+ "GL_EXT_disjoint_timer_query");
+ gfx::GPUTimingFake fake_timing_queries;
+ fake_timing_queries.ExpectDisjointCalls(*gl_);
+ SetUpMockGL("GL_EXT_disjoint_timer_query");
+
+ DisjointValueSync* disjoint_sync =
+ decoder_->GetSharedMemoryAs<DisjointValueSync*>(kSharedMemory2Id,
+ kSharedMemory2Offset,
+ sizeof(*disjoint_sync));
+ manager_->SetDisjointSync(kSharedMemory2Id, kSharedMemory2Offset);
+
+ const uint32_t current_disjoint_value = disjoint_sync->GetDisjointCount();
+ ASSERT_EQ(0u, current_disjoint_value);
+
+ const GLuint kClient1Id = 1;
+ const GLenum kTarget = GL_TIMESTAMP_EXT;
+ const base::subtle::Atomic32 kSubmitCount = 123;
+
+ QueryManager::Query* query = manager_->CreateQuery(
+ kTarget, kClient1Id, kSharedMemoryId, kSharedMemoryOffset);
+ ASSERT_TRUE(query != NULL);
+
+ // Disjoint happening before the query should not trigger a disjoint event.
+ fake_timing_queries.SetDisjoint();
+
+ fake_timing_queries.ExpectGPUTimeStampQuery(*gl_, false);
+ EXPECT_TRUE(manager_->QueryCounter(query, kSubmitCount));
+ EXPECT_TRUE(manager_->ProcessPendingQueries(false));
+
+ EXPECT_TRUE(query->IsFinished());
+ EXPECT_EQ(current_disjoint_value, disjoint_sync->GetDisjointCount());
+
+ // Disjoint happening during query should trigger disjoint event.
+ fake_timing_queries.ExpectGPUTimeStampQuery(*gl_, false);
+ EXPECT_TRUE(manager_->QueryCounter(query, kSubmitCount));
+ fake_timing_queries.SetDisjoint();
+ EXPECT_TRUE(manager_->ProcessPendingQueries(false));
+
+ EXPECT_TRUE(query->IsFinished());
+ EXPECT_NE(current_disjoint_value, disjoint_sync->GetDisjointCount());
+
+ manager_->Destroy(false);
+}
+
+TEST_F(QueryManagerManualSetupTest, DisjointContinualTest) {
+ GpuServiceTest::SetUpWithGLVersion("OpenGL ES 3.0",
+ "GL_EXT_disjoint_timer_query");
+ gfx::GPUTimingFake fake_timing_queries;
+ fake_timing_queries.ExpectDisjointCalls(*gl_);
+ SetUpMockGL("GL_EXT_disjoint_timer_query");
+
+ DisjointValueSync* disjoint_sync =
+ decoder_->GetSharedMemoryAs<DisjointValueSync*>(kSharedMemory2Id,
+ kSharedMemory2Offset,
+ sizeof(*disjoint_sync));
+ manager_->SetDisjointSync(kSharedMemory2Id, kSharedMemory2Offset);
+
+ const uint32_t current_disjoint_value = disjoint_sync->GetDisjointCount();
+ ASSERT_EQ(0u, current_disjoint_value);
+
+ // Disjoint value should not be updated until we have a timestamp query.
+ fake_timing_queries.SetDisjoint();
+ manager_->ProcessFrameBeginUpdates();
+ EXPECT_EQ(current_disjoint_value, disjoint_sync->GetDisjointCount());
+
+ const GLuint kClient1Id = 1;
+ const GLenum kTarget = GL_TIMESTAMP_EXT;
+ const base::subtle::Atomic32 kSubmitCount = 123;
+
+ QueryManager::Query* query = manager_->CreateQuery(
+ kTarget, kClient1Id, kSharedMemoryId, kSharedMemoryOffset);
+ ASSERT_TRUE(query != NULL);
+
+ fake_timing_queries.ExpectGPUTimeStampQuery(*gl_, false);
+ EXPECT_TRUE(manager_->QueryCounter(query, kSubmitCount));
+ EXPECT_TRUE(manager_->ProcessPendingQueries(false));
+
+ EXPECT_EQ(current_disjoint_value, disjoint_sync->GetDisjointCount());
+ fake_timing_queries.SetDisjoint();
+ manager_->ProcessFrameBeginUpdates();
+ EXPECT_NE(current_disjoint_value, disjoint_sync->GetDisjointCount());
+
+ manager_->Destroy(false);
+}
+
TEST_F(QueryManagerTest, GetErrorQuery) {
const GLuint kClient1Id = 1;
const GLenum kTarget = GL_GET_ERROR_QUERY_CHROMIUM;
@@ -533,7 +914,7 @@ TEST_F(QueryManagerTest, GetErrorQuery) {
TestHelper::SetupFeatureInfoInitExpectations(gl_.get(), "");
scoped_refptr<FeatureInfo> feature_info(new FeatureInfo());
- feature_info->Initialize();
+ feature_info->InitializeForTesting();
scoped_ptr<QueryManager> manager(
new QueryManager(decoder_.get(), feature_info.get()));
@@ -557,7 +938,7 @@ TEST_F(QueryManagerTest, GetErrorQuery) {
.RetiresOnSaturation();
EXPECT_TRUE(manager->EndQuery(query, kSubmitCount));
- EXPECT_FALSE(query->pending());
+ EXPECT_FALSE(query->IsPending());
EXPECT_EQ(static_cast<GLuint>(GL_INVALID_ENUM), sync->result);
diff --git a/chromium/gpu/command_buffer/service/renderbuffer_manager.cc b/chromium/gpu/command_buffer/service/renderbuffer_manager.cc
index 2af22de12c0..54c18bebbf3 100644
--- a/chromium/gpu/command_buffer/service/renderbuffer_manager.cc
+++ b/chromium/gpu/command_buffer/service/renderbuffer_manager.cc
@@ -6,12 +6,16 @@
#include "base/logging.h"
#include "base/strings/stringprintf.h"
+#include "base/thread_task_runner_handle.h"
+#include "base/trace_event/memory_dump_manager.h"
#include "base/trace_event/trace_event.h"
#include "gpu/command_buffer/common/gles2_cmd_utils.h"
#include "gpu/command_buffer/service/feature_info.h"
#include "gpu/command_buffer/service/gles2_cmd_decoder.h"
#include "gpu/command_buffer/service/memory_tracking.h"
#include "ui/gl/gl_implementation.h"
+#include "ui/gl/gl_version_info.h"
+#include "ui/gl/trace_util.h"
namespace gpu {
namespace gles2 {
@@ -40,19 +44,25 @@ struct RenderbufferSignature {
}
};
-RenderbufferManager::RenderbufferManager(
- MemoryTracker* memory_tracker,
- GLint max_renderbuffer_size,
- GLint max_samples,
- FeatureInfo* feature_info)
- : memory_tracker_(
+RenderbufferManager::RenderbufferManager(MemoryTracker* memory_tracker,
+ GLint max_renderbuffer_size,
+ GLint max_samples,
+ FeatureInfo* feature_info)
+ : memory_type_tracker_(
new MemoryTypeTracker(memory_tracker, MemoryTracker::kUnmanaged)),
+ memory_tracker_(memory_tracker),
max_renderbuffer_size_(max_renderbuffer_size),
max_samples_(max_samples),
feature_info_(feature_info),
num_uncleared_renderbuffers_(0),
renderbuffer_count_(0),
have_context_(true) {
+ // When created from InProcessCommandBuffer, we won't have a |memory_tracker_|
+ // so don't register a dump provider.
+ if (memory_tracker_) {
+ base::trace_event::MemoryDumpManager::GetInstance()->RegisterDumpProvider(
+ this, base::ThreadTaskRunnerHandle::Get());
+ }
}
RenderbufferManager::~RenderbufferManager() {
@@ -62,6 +72,9 @@ RenderbufferManager::~RenderbufferManager() {
CHECK_EQ(renderbuffer_count_, 0u);
DCHECK_EQ(0, num_uncleared_renderbuffers_);
+
+ base::trace_event::MemoryDumpManager::GetInstance()->UnregisterDumpProvider(
+ this);
}
size_t Renderbuffer::EstimatedSize() {
@@ -117,7 +130,7 @@ Renderbuffer::~Renderbuffer() {
void RenderbufferManager::Destroy(bool have_context) {
have_context_ = have_context;
renderbuffers_.clear();
- DCHECK_EQ(0u, memory_tracker_->GetMemRepresented());
+ DCHECK_EQ(0u, memory_type_tracker_->GetMemRepresented());
}
void RenderbufferManager::StartTracking(Renderbuffer* /* renderbuffer */) {
@@ -129,7 +142,7 @@ void RenderbufferManager::StopTracking(Renderbuffer* renderbuffer) {
if (!renderbuffer->cleared()) {
--num_uncleared_renderbuffers_;
}
- memory_tracker_->TrackMemFree(renderbuffer->EstimatedSize());
+ memory_type_tracker_->TrackMemFree(renderbuffer->EstimatedSize());
}
void RenderbufferManager::SetInfo(
@@ -139,9 +152,9 @@ void RenderbufferManager::SetInfo(
if (!renderbuffer->cleared()) {
--num_uncleared_renderbuffers_;
}
- memory_tracker_->TrackMemFree(renderbuffer->EstimatedSize());
+ memory_type_tracker_->TrackMemFree(renderbuffer->EstimatedSize());
renderbuffer->SetInfo(samples, internalformat, width, height);
- memory_tracker_->TrackMemAlloc(renderbuffer->EstimatedSize());
+ memory_type_tracker_->TrackMemAlloc(renderbuffer->EstimatedSize());
if (!renderbuffer->cleared()) {
++num_uncleared_renderbuffers_;
}
@@ -230,7 +243,30 @@ GLenum RenderbufferManager::InternalRenderbufferFormatToImplFormat(
return impl_format;
}
-} // namespace gles2
-} // namespace gpu
+bool RenderbufferManager::OnMemoryDump(
+ const base::trace_event::MemoryDumpArgs& args,
+ base::trace_event::ProcessMemoryDump* pmd) {
+ int client_id = memory_tracker_->ClientId();
+ for (const auto& renderbuffer_entry : renderbuffers_) {
+ const auto& client_renderbuffer_id = renderbuffer_entry.first;
+ const auto& renderbuffer = renderbuffer_entry.second;
+
+ std::string dump_name =
+ base::StringPrintf("gpu/gl/renderbuffers/client_%d/renderbuffer_%d",
+ client_id, client_renderbuffer_id);
+ base::trace_event::MemoryAllocatorDump* dump =
+ pmd->CreateAllocatorDump(dump_name);
+ dump->AddScalar(base::trace_event::MemoryAllocatorDump::kNameSize,
+ base::trace_event::MemoryAllocatorDump::kUnitsBytes,
+ static_cast<uint64_t>(renderbuffer->EstimatedSize()));
+ auto guid = gfx::GetGLRenderbufferGUIDForTracing(
+ memory_tracker_->ShareGroupTracingGUID(), client_renderbuffer_id);
+ pmd->CreateSharedGlobalAllocatorDump(guid);
+ pmd->AddOwnershipEdge(dump->guid(), guid);
+ }
+ return true;
+}
+} // namespace gles2
+} // namespace gpu
diff --git a/chromium/gpu/command_buffer/service/renderbuffer_manager.h b/chromium/gpu/command_buffer/service/renderbuffer_manager.h
index be4cc0974e4..72b0aaeddf5 100644
--- a/chromium/gpu/command_buffer/service/renderbuffer_manager.h
+++ b/chromium/gpu/command_buffer/service/renderbuffer_manager.h
@@ -124,13 +124,14 @@ class GPU_EXPORT Renderbuffer
// This class keeps track of the renderbuffers and whether or not they have
// been cleared.
-class GPU_EXPORT RenderbufferManager {
+class GPU_EXPORT RenderbufferManager
+ : public base::trace_event::MemoryDumpProvider {
public:
RenderbufferManager(MemoryTracker* memory_tracker,
GLint max_renderbuffer_size,
GLint max_samples,
FeatureInfo* feature_info);
- ~RenderbufferManager();
+ ~RenderbufferManager() override;
GLint max_renderbuffer_size() const {
return max_renderbuffer_size_;
@@ -163,7 +164,7 @@ class GPU_EXPORT RenderbufferManager {
void RemoveRenderbuffer(GLuint client_id);
size_t mem_represented() const {
- return memory_tracker_->GetMemRepresented();
+ return memory_type_tracker_->GetMemRepresented();
}
bool ComputeEstimatedRenderbufferSize(int width,
@@ -173,13 +174,18 @@ class GPU_EXPORT RenderbufferManager {
uint32* size) const;
GLenum InternalRenderbufferFormatToImplFormat(GLenum impl_format) const;
+ // base::trace_event::MemoryDumpProvider implementation.
+ bool OnMemoryDump(const base::trace_event::MemoryDumpArgs& args,
+ base::trace_event::ProcessMemoryDump* pmd) override;
+
private:
friend class Renderbuffer;
void StartTracking(Renderbuffer* renderbuffer);
void StopTracking(Renderbuffer* renderbuffer);
- scoped_ptr<MemoryTypeTracker> memory_tracker_;
+ scoped_ptr<MemoryTypeTracker> memory_type_tracker_;
+ MemoryTracker* memory_tracker_;
GLint max_renderbuffer_size_;
GLint max_samples_;
diff --git a/chromium/gpu/command_buffer/service/renderbuffer_manager_unittest.cc b/chromium/gpu/command_buffer/service/renderbuffer_manager_unittest.cc
index 7633f681571..9957203fb5a 100644
--- a/chromium/gpu/command_buffer/service/renderbuffer_manager_unittest.cc
+++ b/chromium/gpu/command_buffer/service/renderbuffer_manager_unittest.cc
@@ -35,7 +35,7 @@ class RenderbufferManagerTestBase : public GpuServiceTest {
depth24_supported ? "GL_OES_depth24" : "",
"",
use_gles ? "OpenGL ES 2.0" : "OpenGL 2.1");
- feature_info_->Initialize();
+ feature_info_->InitializeForTesting();
manager_.reset(new RenderbufferManager(
memory_tracker, kMaxSize, kMaxSamples, feature_info_.get()));
}
diff --git a/chromium/gpu/command_buffer/service/shader_manager.cc b/chromium/gpu/command_buffer/service/shader_manager.cc
index 23018ee2688..0ad8bf09bb7 100644
--- a/chromium/gpu/command_buffer/service/shader_manager.cc
+++ b/chromium/gpu/command_buffer/service/shader_manager.cc
@@ -175,8 +175,26 @@ const sh::Attribute* Shader::GetAttribInfo(const std::string& name) const {
const std::string* Shader::GetAttribMappedName(
const std::string& original_name) const {
- for (AttributeMap::const_iterator it = attrib_map_.begin();
- it != attrib_map_.end(); ++it) {
+ for (const auto& key_value : attrib_map_) {
+ if (key_value.second.name == original_name)
+ return &(key_value.first);
+ }
+ return nullptr;
+}
+
+const std::string* Shader::GetUniformMappedName(
+ const std::string& original_name) const {
+ for (const auto& key_value : uniform_map_) {
+ if (key_value.second.name == original_name)
+ return &(key_value.first);
+ }
+ return nullptr;
+}
+
+const std::string* Shader::GetVaryingMappedName(
+ const std::string& original_name) const {
+ for (VaryingMap::const_iterator it = varying_map_.begin();
+ it != varying_map_.end(); ++it) {
if (it->second.name == original_name)
return &(it->first);
}
diff --git a/chromium/gpu/command_buffer/service/shader_manager.h b/chromium/gpu/command_buffer/service/shader_manager.h
index c7355a815cc..1f97f42b412 100644
--- a/chromium/gpu/command_buffer/service/shader_manager.h
+++ b/chromium/gpu/command_buffer/service/shader_manager.h
@@ -90,6 +90,14 @@ class GPU_EXPORT Shader : public base::RefCounted<Shader> {
const std::string* GetAttribMappedName(
const std::string& original_name) const;
+ // If the original_name is not found, return NULL.
+ const std::string* GetUniformMappedName(
+ const std::string& original_name) const;
+
+ // If the original_name is not found, return NULL.
+ const std::string* GetVaryingMappedName(
+ const std::string& original_name) const;
+
// If the hashed_name is not found, return NULL.
const std::string* GetOriginalNameFromHashedName(
const std::string& hashed_name) const;
diff --git a/chromium/gpu/command_buffer/service/shader_translator.cc b/chromium/gpu/command_buffer/service/shader_translator.cc
index 04e12276afb..b852d2aa929 100644
--- a/chromium/gpu/command_buffer/service/shader_translator.cc
+++ b/chromium/gpu/command_buffer/service/shader_translator.cc
@@ -16,6 +16,7 @@
#include "base/trace_event/trace_event.h"
#include "gpu/command_buffer/service/gpu_switches.h"
#include "ui/gl/gl_implementation.h"
+#include "ui/gl/gl_version_info.h"
namespace gpu {
namespace gles2 {
@@ -90,6 +91,50 @@ void GetNameHashingInfo(ShHandle compiler, NameMap* name_map) {
} // namespace
+ShShaderOutput ShaderTranslator::GetShaderOutputLanguageForContext(
+ const gfx::GLVersionInfo& version_info) {
+ if (version_info.is_es) {
+ return SH_ESSL_OUTPUT;
+ }
+
+ // Determine the GLSL version based on OpenGL specification.
+
+ unsigned context_version =
+ version_info.major_version * 100 + version_info.minor_version * 10;
+ if (context_version >= 450) {
+ // OpenGL specs from 4.2 on specify that the core profile is "also
+ // guaranteed to support all previous versions of the OpenGL Shading
+ // Language back to version 1.40". For simplicity, we assume future
+ // specs do not unspecify this. If they did, they could unspecify
+ // glGetStringi(GL_SHADING_LANGUAGE_VERSION, k), too.
+ // Since current context >= 4.5, use GLSL 4.50 core.
+ return SH_GLSL_450_CORE_OUTPUT;
+ } else if (context_version == 440) {
+ return SH_GLSL_440_CORE_OUTPUT;
+ } else if (context_version == 430) {
+ return SH_GLSL_430_CORE_OUTPUT;
+ } else if (context_version == 420) {
+ return SH_GLSL_420_CORE_OUTPUT;
+ } else if (context_version == 410) {
+ return SH_GLSL_410_CORE_OUTPUT;
+ } else if (context_version == 400) {
+ return SH_GLSL_400_CORE_OUTPUT;
+ } else if (context_version == 330) {
+ return SH_GLSL_330_CORE_OUTPUT;
+ } else if (context_version == 320) {
+ return SH_GLSL_150_CORE_OUTPUT;
+ } else if (context_version == 310) {
+ return SH_GLSL_140_OUTPUT;
+ } else if (context_version == 300) {
+ return SH_GLSL_130_OUTPUT;
+ }
+
+ // Before OpenGL 3.0 we use compatibility profile. Also for future
+ // specs between OpenGL 3.3 and OpenGL 4.0, at the time of writing,
+ // we use compatibility profile.
+ return SH_GLSL_COMPATIBILITY_OUTPUT;
+}
+
ShaderTranslator::DestructionObserver::DestructionObserver() {
}
@@ -98,16 +143,14 @@ ShaderTranslator::DestructionObserver::~DestructionObserver() {
ShaderTranslator::ShaderTranslator()
: compiler_(NULL),
- implementation_is_glsl_es_(false),
driver_bug_workarounds_(static_cast<ShCompileOptions>(0)) {
}
-bool ShaderTranslator::Init(
- GLenum shader_type,
- ShShaderSpec shader_spec,
- const ShBuiltInResources* resources,
- ShaderTranslatorInterface::GlslImplementationType glsl_implementation_type,
- ShCompileOptions driver_bug_workarounds) {
+bool ShaderTranslator::Init(GLenum shader_type,
+ ShShaderSpec shader_spec,
+ const ShBuiltInResources* resources,
+ ShShaderOutput shader_output_language,
+ ShCompileOptions driver_bug_workarounds) {
// Make sure Init is called only once.
DCHECK(compiler_ == NULL);
DCHECK(shader_type == GL_FRAGMENT_SHADER || shader_type == GL_VERTEX_SHADER);
@@ -117,27 +160,12 @@ bool ShaderTranslator::Init(
g_translator_initializer.Get();
- ShShaderOutput shader_output;
- if (glsl_implementation_type == kGlslES) {
- shader_output = SH_ESSL_OUTPUT;
- } else {
- // TODO(kbr): clean up the tests of shader_spec and
- // gfx::GetGLImplementation(). crbug.com/471960
- if (shader_spec == SH_WEBGL2_SPEC ||
- gfx::GetGLImplementation() ==
- gfx::kGLImplementationDesktopGLCoreProfile) {
- shader_output = SH_GLSL_410_CORE_OUTPUT;
- } else {
- shader_output = SH_GLSL_COMPATIBILITY_OUTPUT;
- }
- }
{
TRACE_EVENT0("gpu", "ShConstructCompiler");
- compiler_ = ShConstructCompiler(
- shader_type, shader_spec, shader_output, resources);
+ compiler_ = ShConstructCompiler(shader_type, shader_spec,
+ shader_output_language, resources);
}
- implementation_is_glsl_es_ = (glsl_implementation_type == kGlslES);
driver_bug_workarounds_ = driver_bug_workarounds;
return compiler_ != NULL;
}
diff --git a/chromium/gpu/command_buffer/service/shader_translator.h b/chromium/gpu/command_buffer/service/shader_translator.h
index 858014dc049..6e7628ffa05 100644
--- a/chromium/gpu/command_buffer/service/shader_translator.h
+++ b/chromium/gpu/command_buffer/service/shader_translator.h
@@ -15,6 +15,10 @@
#include "gpu/gpu_export.h"
#include "third_party/angle/include/GLSLANG/ShaderLang.h"
+namespace gfx {
+struct GLVersionInfo;
+}
+
namespace gpu {
namespace gles2 {
@@ -31,19 +35,14 @@ class ShaderTranslatorInterface
: public base::RefCounted<ShaderTranslatorInterface> {
public:
ShaderTranslatorInterface() {}
- enum GlslImplementationType {
- kGlsl,
- kGlslES
- };
// Initializes the translator.
// Must be called once before using the translator object.
- virtual bool Init(
- sh::GLenum shader_type,
- ShShaderSpec shader_spec,
- const ShBuiltInResources* resources,
- GlslImplementationType glsl_implementation_type,
- ShCompileOptions driver_bug_workarounds) = 0;
+ virtual bool Init(sh::GLenum shader_type,
+ ShShaderSpec shader_spec,
+ const ShBuiltInResources* resources,
+ ShShaderOutput shader_output_language,
+ ShCompileOptions driver_bug_workarounds) = 0;
// Translates the given shader source.
// Returns true if translation is successful, false otherwise.
@@ -88,11 +87,15 @@ class GPU_EXPORT ShaderTranslator
ShaderTranslator();
+ // Return shader output lanaguage type based on the context version.
+ static ShShaderOutput GetShaderOutputLanguageForContext(
+ const gfx::GLVersionInfo& context_version);
+
// Overridden from ShaderTranslatorInterface.
bool Init(sh::GLenum shader_type,
ShShaderSpec shader_spec,
const ShBuiltInResources* resources,
- GlslImplementationType glsl_implementation_type,
+ ShShaderOutput shader_output_language,
ShCompileOptions driver_bug_workarounds) override;
// Overridden from ShaderTranslatorInterface.
@@ -116,7 +119,6 @@ class GPU_EXPORT ShaderTranslator
int GetCompileOptions() const;
ShHandle compiler_;
- bool implementation_is_glsl_es_;
ShCompileOptions driver_bug_workarounds_;
base::ObserverList<DestructionObserver> destruction_observers_;
};
diff --git a/chromium/gpu/command_buffer/service/shader_translator_cache.cc b/chromium/gpu/command_buffer/service/shader_translator_cache.cc
index 631a88e4142..f78039fcac2 100644
--- a/chromium/gpu/command_buffer/service/shader_translator_cache.cc
+++ b/chromium/gpu/command_buffer/service/shader_translator_cache.cc
@@ -31,13 +31,10 @@ scoped_refptr<ShaderTranslator> ShaderTranslatorCache::GetTranslator(
sh::GLenum shader_type,
ShShaderSpec shader_spec,
const ShBuiltInResources* resources,
- ShaderTranslatorInterface::GlslImplementationType
- glsl_implementation_type,
+ ShShaderOutput shader_output_language,
ShCompileOptions driver_bug_workarounds) {
- ShaderTranslatorInitParams params(shader_type,
- shader_spec,
- *resources,
- glsl_implementation_type,
+ ShaderTranslatorInitParams params(shader_type, shader_spec, *resources,
+ shader_output_language,
driver_bug_workarounds);
Cache::iterator it = cache_.find(params);
@@ -46,8 +43,7 @@ scoped_refptr<ShaderTranslator> ShaderTranslatorCache::GetTranslator(
ShaderTranslator* translator = new ShaderTranslator();
if (translator->Init(shader_type, shader_spec, resources,
- glsl_implementation_type,
- driver_bug_workarounds)) {
+ shader_output_language, driver_bug_workarounds)) {
cache_[params] = translator;
translator->AddDestructionObserver(this);
return translator;
diff --git a/chromium/gpu/command_buffer/service/shader_translator_cache.h b/chromium/gpu/command_buffer/service/shader_translator_cache.h
index 6b0b1a57ef3..471b081ac72 100644
--- a/chromium/gpu/command_buffer/service/shader_translator_cache.h
+++ b/chromium/gpu/command_buffer/service/shader_translator_cache.h
@@ -35,8 +35,7 @@ class GPU_EXPORT ShaderTranslatorCache
sh::GLenum shader_type,
ShShaderSpec shader_spec,
const ShBuiltInResources* resources,
- ShaderTranslatorInterface::GlslImplementationType
- glsl_implementation_type,
+ ShShaderOutput shader_output_language,
ShCompileOptions driver_bug_workarounds);
private:
@@ -49,21 +48,19 @@ class GPU_EXPORT ShaderTranslatorCache
sh::GLenum shader_type;
ShShaderSpec shader_spec;
ShBuiltInResources resources;
- ShaderTranslatorInterface::GlslImplementationType
- glsl_implementation_type;
+ ShShaderOutput shader_output_language;
ShCompileOptions driver_bug_workarounds;
ShaderTranslatorInitParams(sh::GLenum shader_type,
ShShaderSpec shader_spec,
const ShBuiltInResources& resources,
- ShaderTranslatorInterface::GlslImplementationType
- glsl_implementation_type,
+ ShShaderOutput shader_output_language,
ShCompileOptions driver_bug_workarounds) {
memset(this, 0, sizeof(*this));
this->shader_type = shader_type;
this->shader_spec = shader_spec;
this->resources = resources;
- this->glsl_implementation_type = glsl_implementation_type;
+ this->shader_output_language = shader_output_language;
this->driver_bug_workarounds = driver_bug_workarounds;
}
diff --git a/chromium/gpu/command_buffer/service/shader_translator_cache_unittest.cc b/chromium/gpu/command_buffer/service/shader_translator_cache_unittest.cc
index c5233e510e8..eefd2e69a7a 100644
--- a/chromium/gpu/command_buffer/service/shader_translator_cache_unittest.cc
+++ b/chromium/gpu/command_buffer/service/shader_translator_cache_unittest.cc
@@ -30,17 +30,11 @@ TEST(ShaderTranslatorCacheTest, InitParamComparable) {
memset(a_storage, 55, sizeof(a_storage));
ShaderTranslatorCache::ShaderTranslatorInitParams* a =
new (&a_storage) ShaderTranslatorCache::ShaderTranslatorInitParams(
- GL_VERTEX_SHADER,
- SH_GLES2_SPEC,
- a_resources,
- ShaderTranslatorInterface::kGlslES,
+ GL_VERTEX_SHADER, SH_GLES2_SPEC, a_resources, SH_ESSL_OUTPUT,
driver_bug_workarounds);
ShaderTranslatorCache::ShaderTranslatorInitParams b(
- GL_VERTEX_SHADER,
- SH_GLES2_SPEC,
- b_resources,
- ShaderTranslatorInterface::kGlslES,
+ GL_VERTEX_SHADER, SH_GLES2_SPEC, b_resources, SH_ESSL_OUTPUT,
driver_bug_workarounds);
EXPECT_TRUE(*a == b);
diff --git a/chromium/gpu/command_buffer/service/shader_translator_unittest.cc b/chromium/gpu/command_buffer/service/shader_translator_unittest.cc
index 5f6173818f9..0c60b44c5a6 100644
--- a/chromium/gpu/command_buffer/service/shader_translator_unittest.cc
+++ b/chromium/gpu/command_buffer/service/shader_translator_unittest.cc
@@ -6,6 +6,7 @@
#include "gpu/command_buffer/service/shader_translator.h"
#include "testing/gtest/include/gtest/gtest.h"
+#include "ui/gl/gl_version_info.h"
namespace gpu {
namespace gles2 {
@@ -13,6 +14,9 @@ namespace gles2 {
class ShaderTranslatorTest : public testing::Test {
public:
ShaderTranslatorTest() {
+ shader_output_language_ =
+ ShaderTranslator::GetShaderOutputLanguageForContext(
+ gfx::GLVersionInfo("2.0", "", ""));
}
~ShaderTranslatorTest() override {}
@@ -27,14 +31,12 @@ class ShaderTranslatorTest : public testing::Test {
vertex_translator_ = new ShaderTranslator();
fragment_translator_ = new ShaderTranslator();
- ASSERT_TRUE(vertex_translator_->Init(
- GL_VERTEX_SHADER, SH_GLES2_SPEC, &resources,
- ShaderTranslatorInterface::kGlsl,
- SH_EMULATE_BUILT_IN_FUNCTIONS));
- ASSERT_TRUE(fragment_translator_->Init(
- GL_FRAGMENT_SHADER, SH_GLES2_SPEC, &resources,
- ShaderTranslatorInterface::kGlsl,
- static_cast<ShCompileOptions>(0)));
+ ASSERT_TRUE(vertex_translator_->Init(GL_VERTEX_SHADER, SH_GLES2_SPEC,
+ &resources, shader_output_language_,
+ SH_EMULATE_BUILT_IN_FUNCTIONS));
+ ASSERT_TRUE(fragment_translator_->Init(GL_FRAGMENT_SHADER, SH_GLES2_SPEC,
+ &resources, shader_output_language_,
+ static_cast<ShCompileOptions>(0)));
}
void TearDown() override {
vertex_translator_ = NULL;
@@ -43,6 +45,7 @@ class ShaderTranslatorTest : public testing::Test {
scoped_refptr<ShaderTranslator> vertex_translator_;
scoped_refptr<ShaderTranslator> fragment_translator_;
+ ShShaderOutput shader_output_language_;
};
TEST_F(ShaderTranslatorTest, ValidVertexShader) {
@@ -290,19 +293,16 @@ TEST_F(ShaderTranslatorTest, OptionsString) {
ShBuiltInResources resources;
ShInitBuiltInResources(&resources);
- ASSERT_TRUE(translator_1->Init(
- GL_VERTEX_SHADER, SH_GLES2_SPEC, &resources,
- ShaderTranslatorInterface::kGlsl,
- SH_EMULATE_BUILT_IN_FUNCTIONS));
- ASSERT_TRUE(translator_2->Init(
- GL_FRAGMENT_SHADER, SH_GLES2_SPEC, &resources,
- ShaderTranslatorInterface::kGlsl,
- static_cast<ShCompileOptions>(0)));
+ ASSERT_TRUE(translator_1->Init(GL_VERTEX_SHADER, SH_GLES2_SPEC, &resources,
+ SH_GLSL_150_CORE_OUTPUT,
+ SH_EMULATE_BUILT_IN_FUNCTIONS));
+ ASSERT_TRUE(translator_2->Init(GL_FRAGMENT_SHADER, SH_GLES2_SPEC, &resources,
+ SH_GLSL_150_CORE_OUTPUT,
+ static_cast<ShCompileOptions>(0)));
resources.EXT_draw_buffers = 1;
- ASSERT_TRUE(translator_3->Init(
- GL_VERTEX_SHADER, SH_GLES2_SPEC, &resources,
- ShaderTranslatorInterface::kGlsl,
- SH_EMULATE_BUILT_IN_FUNCTIONS));
+ ASSERT_TRUE(translator_3->Init(GL_VERTEX_SHADER, SH_GLES2_SPEC, &resources,
+ SH_GLSL_150_CORE_OUTPUT,
+ SH_EMULATE_BUILT_IN_FUNCTIONS));
std::string options_1(
translator_1->GetStringForOptionsThatWouldAffectCompilation());
@@ -319,6 +319,113 @@ TEST_F(ShaderTranslatorTest, OptionsString) {
EXPECT_NE(options_3, options_4);
}
+class ShaderTranslatorOutputVersionTest
+ : public testing::TestWithParam<testing::tuple<const char*, const char*>> {
+};
+
+TEST_P(ShaderTranslatorOutputVersionTest, HasCorrectOutputGLSLVersion) {
+ // Test that translating to a shader targeting certain OpenGL context version
+ // (version string in test param tuple index 0) produces a GLSL shader that
+ // contains correct version string for that context (version directive
+ // in test param tuple index 1).
+
+ const char* kShader =
+ "attribute vec4 vPosition;\n"
+ "void main() {\n"
+ " gl_Position = vPosition;\n"
+ "}";
+
+ gfx::GLVersionInfo output_context_version(testing::get<0>(GetParam()), "",
+ "");
+
+ scoped_refptr<ShaderTranslator> translator = new ShaderTranslator();
+ ShBuiltInResources resources;
+ ShInitBuiltInResources(&resources);
+ ShCompileOptions compile_options = SH_OBJECT_CODE;
+ ShShaderOutput shader_output_language =
+ ShaderTranslator::GetShaderOutputLanguageForContext(
+ output_context_version);
+ ASSERT_TRUE(translator->Init(GL_VERTEX_SHADER, SH_GLES2_SPEC, &resources,
+ shader_output_language, compile_options));
+
+ std::string translated_source;
+ int shader_version;
+ EXPECT_TRUE(translator->Translate(kShader, nullptr, &translated_source,
+ &shader_version, nullptr, nullptr, nullptr,
+ nullptr));
+
+ std::string expected_version_directive = testing::get<1>(GetParam());
+ if (expected_version_directive.empty()) {
+ EXPECT_TRUE(translated_source.find("#version") == std::string::npos)
+ << "Translation was:\n" << translated_source;
+ } else {
+ EXPECT_TRUE(translated_source.find(expected_version_directive) !=
+ std::string::npos)
+ << "Translation was:\n" << translated_source;
+ }
+}
+
+// For some compilers, using make_tuple("a", "bb") would end up
+// instantiating make_tuple<char[1], char[2]>. This does not work.
+namespace {
+testing::tuple<const char*, const char*> make_gl_glsl_tuple(
+ const char* gl_version,
+ const char* glsl_version_directive) {
+ return testing::make_tuple(gl_version, glsl_version_directive);
+}
+}
+
+// Test data for the above test. OpenGL specifications specify a
+// certain version of GLSL to be guaranteed to be supported. Test
+// that ShaderTranslator produces a GLSL shader with the exact
+// specified GLSL version for each known OpenGL version.
+INSTANTIATE_TEST_CASE_P(
+ KnownOpenGLContexts,
+ ShaderTranslatorOutputVersionTest,
+ testing::Values(make_gl_glsl_tuple("4.5", "#version 450\n"),
+ make_gl_glsl_tuple("4.4", "#version 440\n"),
+ make_gl_glsl_tuple("4.3", "#version 430\n"),
+ make_gl_glsl_tuple("4.2", "#version 420\n"),
+ make_gl_glsl_tuple("4.1", "#version 410\n"),
+ make_gl_glsl_tuple("4.0", "#version 400\n"),
+ make_gl_glsl_tuple("3.3", "#version 330\n"),
+ make_gl_glsl_tuple("3.2", "#version 150\n"),
+ make_gl_glsl_tuple("3.1", "#version 140\n"),
+ make_gl_glsl_tuple("3.0", "#version 130\n")));
+
+// Test data for the above test. Check that early OpenGL contexts get
+// GLSL compatibility profile shader, e.g. shader has no #version
+// directive. Also check that future version 3.3+ OpenGL contexts get
+// similar shader. We do not expect that future 3.3+ specs contain
+// the "all eariler GLSL versions" clause, since 3.3 did not contain
+// it either.
+INSTANTIATE_TEST_CASE_P(OldOrUnknownOpenGLContexts,
+ ShaderTranslatorOutputVersionTest,
+ testing::Values(make_gl_glsl_tuple("3.4", ""),
+ make_gl_glsl_tuple("2.0", "")));
+
+// Test data for the above test. Cases for the future OpenGL versions. The
+// code assumes that the future OpenGL specs specify the clause that all
+// earlier GLSL versions are supported. We select the highest GLSL
+// version known at the time of writing.
+INSTANTIATE_TEST_CASE_P(
+ BackwardsCompatibleFutureOpenGLContexts,
+ ShaderTranslatorOutputVersionTest,
+ testing::Values(make_gl_glsl_tuple("5.0", "#version 450\n"),
+ make_gl_glsl_tuple("4.6", "#version 450\n")));
+
+// Test data for the above test. Check that for the OpenGL ES output
+// contexts, the shader is such that GLSL 1.0 is used. The translator
+// selects GLSL 1.0 by not output any version at the moment, though we
+// do not know if that would be correct for the future OpenGL ES specs.
+INSTANTIATE_TEST_CASE_P(OpenGLESContexts,
+ ShaderTranslatorOutputVersionTest,
+ testing::Values(make_gl_glsl_tuple("opengl es 2.0", ""),
+ make_gl_glsl_tuple("opengl es 3.0", ""),
+ make_gl_glsl_tuple("opengl es 3.1", ""),
+ make_gl_glsl_tuple("opengl es 3.2",
+ "")));
+
} // namespace gles2
} // namespace gpu
diff --git a/chromium/gpu/command_buffer/service/stream_texture_manager_in_process_android.cc b/chromium/gpu/command_buffer/service/stream_texture_manager_in_process_android.cc
index caf3fb671d3..e7e3a1f55a5 100644
--- a/chromium/gpu/command_buffer/service/stream_texture_manager_in_process_android.cc
+++ b/chromium/gpu/command_buffer/service/stream_texture_manager_in_process_android.cc
@@ -40,6 +40,9 @@ class GLImageImpl : public gfx::GLImage {
gfx::OverlayTransform transform,
const gfx::Rect& bounds_rect,
const gfx::RectF& crop_rect) override;
+ void OnMemoryDump(base::trace_event::ProcessMemoryDump* pmd,
+ uint64_t process_tracing_id,
+ const std::string& dump_name) override;
private:
~GLImageImpl() override;
@@ -99,6 +102,12 @@ bool GLImageImpl::ScheduleOverlayPlane(gfx::AcceleratedWidget widget,
return false;
}
+void GLImageImpl::OnMemoryDump(base::trace_event::ProcessMemoryDump* pmd,
+ uint64_t process_tracing_id,
+ const std::string& dump_name) {
+ // TODO(ericrk): Implement GLImage OnMemoryDump. crbug.com/514914
+}
+
} // anonymous namespace
StreamTextureManagerInProcess::StreamTextureManagerInProcess()
diff --git a/chromium/gpu/command_buffer/service/sync_point_manager.cc b/chromium/gpu/command_buffer/service/sync_point_manager.cc
index aa91bf1d3b3..039e494de8b 100644
--- a/chromium/gpu/command_buffer/service/sync_point_manager.cc
+++ b/chromium/gpu/command_buffer/service/sync_point_manager.cc
@@ -14,23 +14,86 @@ namespace gpu {
static const int kMaxSyncBase = INT_MAX;
-// static
-SyncPointManager* SyncPointManager::Create(bool allow_threaded_calls) {
- return new SyncPointManager(allow_threaded_calls);
+scoped_refptr<SyncPointClientState> SyncPointClientState::Create() {
+ return new SyncPointClientState;
}
-SyncPointManager::SyncPointManager(bool allow_threaded_calls)
- : next_sync_point_(base::RandInt(1, kMaxSyncBase)) {
- // To reduce the risk that a sync point created in a previous GPU process
- // will be in flight in the next GPU process, randomize the starting sync
- // point number. http://crbug.com/373452
+uint32_t SyncPointClientState::GenerateUnprocessedOrderNumber(
+ SyncPointManager* sync_point_manager) {
+ const uint32_t order_num = sync_point_manager->GenerateOrderNumber();
+ base::subtle::Release_Store(&unprocessed_order_num_, order_num);
+ return order_num;
+}
- if (!allow_threaded_calls) {
- sequence_checker_.reset(new base::SequenceChecker);
- }
+SyncPointClientState::SyncPointClientState()
+ : processed_order_num_(0),
+ unprocessed_order_num_(0),
+ current_order_num_(0) {
+}
+
+SyncPointClientState::~SyncPointClientState() {
+}
+
+SyncPointClient::~SyncPointClient() {
+ sync_point_manager_->DestroySyncPointClient(namespace_id_, client_id_);
+}
+
+SyncPointClient::SyncPointClient(SyncPointManager* sync_point_manager,
+ scoped_refptr<SyncPointClientState> state,
+ CommandBufferNamespace namespace_id,
+ uint64_t client_id)
+ : sync_point_manager_(sync_point_manager),
+ client_state_(state),
+ namespace_id_(namespace_id),
+ client_id_(client_id) {
+}
+
+SyncPointManager::SyncPointManager(bool allow_threaded_wait)
+ : allow_threaded_wait_(allow_threaded_wait),
+ // To reduce the risk that a sync point created in a previous GPU process
+ // will be in flight in the next GPU process, randomize the starting sync
+ // point number. http://crbug.com/373452
+ next_sync_point_(base::RandInt(1, kMaxSyncBase)),
+ retire_cond_var_(&lock_) {
+ global_order_num_.GetNext();
}
SyncPointManager::~SyncPointManager() {
+ for (const ClientMap& client_map : client_maps_) {
+ DCHECK(client_map.empty());
+ }
+}
+
+scoped_ptr<SyncPointClient> SyncPointManager::CreateSyncPointClient(
+ scoped_refptr<SyncPointClientState> client_state,
+ CommandBufferNamespace namespace_id, uint64_t client_id) {
+ DCHECK_GE(namespace_id, 0);
+ DCHECK_LT(static_cast<size_t>(namespace_id), arraysize(client_maps_));
+ base::AutoLock auto_lock(client_maps_lock_);
+
+ ClientMap& client_map = client_maps_[namespace_id];
+ std::pair<ClientMap::iterator, bool> result = client_map.insert(
+ std::make_pair(client_id, new SyncPointClient(this,
+ client_state,
+ namespace_id,
+ client_id)));
+ DCHECK(result.second);
+
+ return make_scoped_ptr(result.first->second);
+}
+
+scoped_refptr<SyncPointClientState> SyncPointManager::GetSyncPointClientState(
+ CommandBufferNamespace namespace_id, uint64_t client_id) {
+ DCHECK_GE(namespace_id, 0);
+ DCHECK_LT(static_cast<size_t>(namespace_id), arraysize(client_maps_));
+ base::AutoLock auto_lock(client_maps_lock_);
+
+ ClientMap& client_map = client_maps_[namespace_id];
+ ClientMap::iterator it = client_map.find(client_id);
+ if (it != client_map.end()) {
+ return it->second->client_state();
+ }
+ return nullptr;
}
uint32 SyncPointManager::GenerateSyncPoint() {
@@ -51,7 +114,6 @@ uint32 SyncPointManager::GenerateSyncPoint() {
}
void SyncPointManager::RetireSyncPoint(uint32 sync_point) {
- CheckSequencedThread();
ClosureList list;
{
base::AutoLock lock(lock_);
@@ -63,6 +125,8 @@ void SyncPointManager::RetireSyncPoint(uint32 sync_point) {
}
list.swap(it->second);
sync_point_map_.erase(it);
+ if (allow_threaded_wait_)
+ retire_cond_var_.Broadcast();
}
for (ClosureList::iterator i = list.begin(); i != list.end(); ++i)
i->Run();
@@ -70,7 +134,6 @@ void SyncPointManager::RetireSyncPoint(uint32 sync_point) {
void SyncPointManager::AddSyncPointCallback(uint32 sync_point,
const base::Closure& callback) {
- CheckSequencedThread();
{
base::AutoLock lock(lock_);
SyncPointMap::iterator it = sync_point_map_.find(sync_point);
@@ -83,17 +146,41 @@ void SyncPointManager::AddSyncPointCallback(uint32 sync_point,
}
bool SyncPointManager::IsSyncPointRetired(uint32 sync_point) {
- CheckSequencedThread();
- {
- base::AutoLock lock(lock_);
- SyncPointMap::iterator it = sync_point_map_.find(sync_point);
- return it == sync_point_map_.end();
+ base::AutoLock lock(lock_);
+ return IsSyncPointRetiredLocked(sync_point);
+}
+
+void SyncPointManager::WaitSyncPoint(uint32 sync_point) {
+ if (!allow_threaded_wait_) {
+ DCHECK(IsSyncPointRetired(sync_point));
+ return;
}
+
+ base::AutoLock lock(lock_);
+ while (!IsSyncPointRetiredLocked(sync_point)) {
+ retire_cond_var_.Wait();
+ }
+}
+
+bool SyncPointManager::IsSyncPointRetiredLocked(uint32 sync_point) {
+ lock_.AssertAcquired();
+ return sync_point_map_.find(sync_point) == sync_point_map_.end();
}
-void SyncPointManager::CheckSequencedThread() {
- DCHECK(!sequence_checker_ ||
- sequence_checker_->CalledOnValidSequencedThread());
+uint32_t SyncPointManager::GenerateOrderNumber() {
+ return global_order_num_.GetNext();
+}
+
+void SyncPointManager::DestroySyncPointClient(
+ CommandBufferNamespace namespace_id, uint64_t client_id) {
+ DCHECK_GE(namespace_id, 0);
+ DCHECK_LT(static_cast<size_t>(namespace_id), arraysize(client_maps_));
+
+ base::AutoLock auto_lock(client_maps_lock_);
+ ClientMap& client_map = client_maps_[namespace_id];
+ ClientMap::iterator it = client_map.find(client_id);
+ DCHECK(it != client_map.end());
+ client_map.erase(it);
}
} // namespace gpu
diff --git a/chromium/gpu/command_buffer/service/sync_point_manager.h b/chromium/gpu/command_buffer/service/sync_point_manager.h
index 001ab176087..3f11e05dabb 100644
--- a/chromium/gpu/command_buffer/service/sync_point_manager.h
+++ b/chromium/gpu/command_buffer/service/sync_point_manager.h
@@ -7,28 +7,118 @@
#include <vector>
+#include "base/atomic_sequence_num.h"
#include "base/callback.h"
#include "base/containers/hash_tables.h"
+#include "base/logging.h"
#include "base/memory/ref_counted.h"
#include "base/memory/scoped_ptr.h"
+#include "base/synchronization/condition_variable.h"
#include "base/synchronization/lock.h"
+#include "base/threading/thread_checker.h"
+#include "gpu/command_buffer/common/constants.h"
#include "gpu/gpu_export.h"
-namespace base {
-class SequenceChecker;
-}
-
namespace gpu {
+class SyncPointClient;
+class SyncPointManager;
+
+class GPU_EXPORT SyncPointClientState
+ : public base::RefCountedThreadSafe<SyncPointClientState> {
+ public:
+ static scoped_refptr<SyncPointClientState> Create();
+ uint32_t GenerateUnprocessedOrderNumber(SyncPointManager* sync_point_manager);
+
+ void BeginProcessingOrderNumber(uint32_t order_num) {
+ DCHECK(processing_thread_checker_.CalledOnValidThread());
+ DCHECK_GE(order_num, current_order_num_);
+ current_order_num_ = order_num;
+ }
+
+ void FinishProcessingOrderNumber(uint32_t order_num) {
+ DCHECK(processing_thread_checker_.CalledOnValidThread());
+ DCHECK_EQ(current_order_num_, order_num);
+ DCHECK_GT(order_num, processed_order_num());
+ base::subtle::Release_Store(&processed_order_num_, order_num);
+ }
+
+ uint32_t processed_order_num() const {
+ return base::subtle::Acquire_Load(&processed_order_num_);
+ }
+
+ uint32_t unprocessed_order_num() const {
+ return base::subtle::Acquire_Load(&unprocessed_order_num_);
+ }
+
+ uint32_t current_order_num() const {
+ DCHECK(processing_thread_checker_.CalledOnValidThread());
+ return current_order_num_;
+ }
+
+ protected:
+ friend class base::RefCountedThreadSafe<SyncPointClientState>;
+ friend class SyncPointClient;
+
+ SyncPointClientState();
+ virtual ~SyncPointClientState();
+
+ // Last finished IPC order number.
+ base::subtle::Atomic32 processed_order_num_;
+
+ // Unprocessed order number expected to be processed under normal execution.
+ base::subtle::Atomic32 unprocessed_order_num_;
+
+ // Non thread-safe functions need to be called from a single thread.
+ base::ThreadChecker processing_thread_checker_;
+
+ // Current IPC order number being processed (only used on processing thread).
+ uint32_t current_order_num_;
+
+ DISALLOW_COPY_AND_ASSIGN(SyncPointClientState);
+};
+
+class GPU_EXPORT SyncPointClient {
+ public:
+ ~SyncPointClient();
+
+ scoped_refptr<SyncPointClientState> client_state() { return client_state_; }
+
+ private:
+ friend class SyncPointManager;
+
+ SyncPointClient(SyncPointManager* sync_point_manager,
+ scoped_refptr<SyncPointClientState> state,
+ CommandBufferNamespace namespace_id, uint64_t client_id);
+
+ // Sync point manager is guaranteed to exist in the lifetime of the client.
+ SyncPointManager* sync_point_manager_;
+
+ // Keep the state that is sharable across multiple threads.
+ scoped_refptr<SyncPointClientState> client_state_;
+
+ // Unique namespace/client id pair for this sync point client.
+ CommandBufferNamespace namespace_id_;
+ uint64_t client_id_;
+
+ DISALLOW_COPY_AND_ASSIGN(SyncPointClient);
+};
+
// This class manages the sync points, which allow cross-channel
// synchronization.
-class GPU_EXPORT SyncPointManager
- : public base::RefCountedThreadSafe<SyncPointManager> {
+class GPU_EXPORT SyncPointManager {
public:
- // InProcessCommandBuffer allows threaded calls since it can call into
- // SyncPointManager from client threads, or from multiple service threads
- // used in Android WebView.
- static SyncPointManager* Create(bool allow_threaded_calls);
+ explicit SyncPointManager(bool allow_threaded_wait);
+ ~SyncPointManager();
+
+ // Creates/Destroy a sync point client which message processors should hold.
+ scoped_ptr<SyncPointClient> CreateSyncPointClient(
+ scoped_refptr<SyncPointClientState> client_state,
+ CommandBufferNamespace namespace_id, uint64_t client_id);
+
+ // Finds the state of an already created sync point client.
+ scoped_refptr<SyncPointClientState> GetSyncPointClientState(
+ CommandBufferNamespace namespace_id, uint64_t client_id);
// Generates a sync point, returning its ID. This can me called on any thread.
// IDs start at a random number. Never return 0.
@@ -46,22 +136,38 @@ class GPU_EXPORT SyncPointManager
bool IsSyncPointRetired(uint32 sync_point);
+ // Block and wait until a sync point is signaled. This is only useful when
+ // the sync point is signaled on another thread.
+ void WaitSyncPoint(uint32 sync_point);
+
private:
- friend class base::RefCountedThreadSafe<SyncPointManager>;
+ friend class SyncPointClient;
+ friend class SyncPointClientState;
+
typedef std::vector<base::Closure> ClosureList;
typedef base::hash_map<uint32, ClosureList> SyncPointMap;
+ typedef base::hash_map<uint64_t, SyncPointClient*> ClientMap;
- explicit SyncPointManager(bool allow_threaded_calls);
- ~SyncPointManager();
- void CheckSequencedThread();
+ bool IsSyncPointRetiredLocked(uint32 sync_point);
+ uint32_t GenerateOrderNumber();
+ void DestroySyncPointClient(CommandBufferNamespace namespace_id,
+ uint64_t client_id);
+
+ const bool allow_threaded_wait_;
+
+ // Order number is global for all clients.
+ base::AtomicSequenceNumber global_order_num_;
- scoped_ptr<base::SequenceChecker> sequence_checker_;
+ // Client map holds a map of clients id to client for each namespace.
+ base::Lock client_maps_lock_;
+ ClientMap client_maps_[NUM_COMMAND_BUFFER_NAMESPACES];
// Protects the 2 fields below. Note: callbacks shouldn't be called with this
// held.
base::Lock lock_;
SyncPointMap sync_point_map_;
uint32 next_sync_point_;
+ base::ConditionVariable retire_cond_var_;
DISALLOW_COPY_AND_ASSIGN(SyncPointManager);
};
diff --git a/chromium/gpu/command_buffer/service/test_helper.cc b/chromium/gpu/command_buffer/service/test_helper.cc
index 308ab8e8ffd..4b8d8fc9e6e 100644
--- a/chromium/gpu/command_buffer/service/test_helper.cc
+++ b/chromium/gpu/command_buffer/service/test_helper.cc
@@ -58,6 +58,10 @@ T ConstructShaderVariable(
#ifndef COMPILER_MSVC
const GLuint TestHelper::kServiceBlackTexture2dId;
const GLuint TestHelper::kServiceDefaultTexture2dId;
+const GLuint TestHelper::kServiceBlackTexture3dId;
+const GLuint TestHelper::kServiceDefaultTexture3dId;
+const GLuint TestHelper::kServiceBlackTexture2dArrayId;
+const GLuint TestHelper::kServiceDefaultTexture2dArrayId;
const GLuint TestHelper::kServiceBlackTextureCubemapId;
const GLuint TestHelper::kServiceDefaultTextureCubemapId;
const GLuint TestHelper::kServiceBlackExternalTextureId;
@@ -93,10 +97,18 @@ void TestHelper::SetupTextureInitializationExpectations(
bool needs_initialization = (target != GL_TEXTURE_EXTERNAL_OES);
bool needs_faces = (target == GL_TEXTURE_CUBE_MAP);
+ bool is_3d_or_2d_array_target = (target == GL_TEXTURE_3D ||
+ target == GL_TEXTURE_2D_ARRAY);
static GLuint texture_2d_ids[] = {
kServiceBlackTexture2dId,
kServiceDefaultTexture2dId };
+ static GLuint texture_3d_ids[] = {
+ kServiceBlackTexture3dId,
+ kServiceDefaultTexture3dId };
+ static GLuint texture_2d_array_ids[] = {
+ kServiceBlackTexture2dArrayId,
+ kServiceDefaultTexture2dArrayId };
static GLuint texture_cube_map_ids[] = {
kServiceBlackTextureCubemapId,
kServiceDefaultTextureCubemapId };
@@ -112,6 +124,12 @@ void TestHelper::SetupTextureInitializationExpectations(
case GL_TEXTURE_2D:
texture_ids = &texture_2d_ids[0];
break;
+ case GL_TEXTURE_3D:
+ texture_ids = &texture_3d_ids[0];
+ break;
+ case GL_TEXTURE_2D_ARRAY:
+ texture_ids = &texture_2d_array_ids[0];
+ break;
case GL_TEXTURE_CUBE_MAP:
texture_ids = &texture_cube_map_ids[0];
break;
@@ -152,10 +170,17 @@ void TestHelper::SetupTextureInitializationExpectations(
.RetiresOnSaturation();
}
} else {
- EXPECT_CALL(*gl, TexImage2D(target, 0, GL_RGBA, 1, 1, 0, GL_RGBA,
- GL_UNSIGNED_BYTE, _))
- .Times(1)
- .RetiresOnSaturation();
+ if (is_3d_or_2d_array_target) {
+ EXPECT_CALL(*gl, TexImage3D(target, 0, GL_RGBA, 1, 1, 1, 0, GL_RGBA,
+ GL_UNSIGNED_BYTE, _))
+ .Times(1)
+ .RetiresOnSaturation();
+ } else {
+ EXPECT_CALL(*gl, TexImage2D(target, 0, GL_RGBA, 1, 1, 0, GL_RGBA,
+ GL_UNSIGNED_BYTE, _))
+ .Times(1)
+ .RetiresOnSaturation();
+ }
}
}
}
@@ -166,6 +191,7 @@ void TestHelper::SetupTextureInitializationExpectations(
void TestHelper::SetupTextureManagerInitExpectations(
::gfx::MockGLInterface* gl,
+ bool is_es3_enabled,
const char* extensions,
bool use_default_textures) {
InSequence sequence;
@@ -175,6 +201,13 @@ void TestHelper::SetupTextureManagerInitExpectations(
SetupTextureInitializationExpectations(
gl, GL_TEXTURE_CUBE_MAP, use_default_textures);
+ if (is_es3_enabled) {
+ SetupTextureInitializationExpectations(
+ gl, GL_TEXTURE_3D, use_default_textures);
+ SetupTextureInitializationExpectations(
+ gl, GL_TEXTURE_2D_ARRAY, use_default_textures);
+ }
+
bool ext_image_external = false;
bool arb_texture_rectangle = false;
base::CStringTokenizer t(extensions, extensions + strlen(extensions), " ");
@@ -211,6 +244,12 @@ void TestHelper::SetupTextureDestructionExpectations(
case GL_TEXTURE_2D:
texture_id = kServiceDefaultTexture2dId;
break;
+ case GL_TEXTURE_3D:
+ texture_id = kServiceDefaultTexture3dId;
+ break;
+ case GL_TEXTURE_2D_ARRAY:
+ texture_id = kServiceDefaultTexture2dArrayId;
+ break;
case GL_TEXTURE_CUBE_MAP:
texture_id = kServiceDefaultTextureCubemapId;
break;
@@ -231,12 +270,20 @@ void TestHelper::SetupTextureDestructionExpectations(
void TestHelper::SetupTextureManagerDestructionExpectations(
::gfx::MockGLInterface* gl,
+ bool is_es3_enabled,
const char* extensions,
bool use_default_textures) {
SetupTextureDestructionExpectations(gl, GL_TEXTURE_2D, use_default_textures);
SetupTextureDestructionExpectations(
gl, GL_TEXTURE_CUBE_MAP, use_default_textures);
+ if (is_es3_enabled) {
+ SetupTextureDestructionExpectations(
+ gl, GL_TEXTURE_3D, use_default_textures);
+ SetupTextureDestructionExpectations(
+ gl, GL_TEXTURE_2D_ARRAY,use_default_textures);
+ }
+
bool ext_image_external = false;
bool arb_texture_rectangle = false;
base::CStringTokenizer t(extensions, extensions + strlen(extensions), " ");
@@ -260,7 +307,7 @@ void TestHelper::SetupTextureManagerDestructionExpectations(
gl, GL_TEXTURE_RECTANGLE_ARB, use_default_textures);
}
- EXPECT_CALL(*gl, DeleteTextures(4, _))
+ EXPECT_CALL(*gl, DeleteTextures(TextureManager::kNumDefaultTextures, _))
.Times(1)
.RetiresOnSaturation();
}
@@ -343,7 +390,8 @@ void TestHelper::SetupContextGroupInitExpectations(
}
bool use_default_textures = bind_generates_resource;
- SetupTextureManagerInitExpectations(gl, extensions, use_default_textures);
+ SetupTextureManagerInitExpectations(
+ gl, false, extensions, use_default_textures);
}
void TestHelper::SetupFeatureInfoInitExpectations(
@@ -386,6 +434,9 @@ void TestHelper::SetupFeatureInfoInitExpectationsWithGLVersion(
.RetiresOnSaturation();
}
+ EXPECT_CALL(*gl, GetString(GL_VERSION))
+ .WillOnce(Return(reinterpret_cast<const uint8*>(gl_version)))
+ .RetiresOnSaturation();
EXPECT_CALL(*gl, GetString(GL_RENDERER))
.WillOnce(Return(reinterpret_cast<const uint8*>(gl_renderer)))
.RetiresOnSaturation();
@@ -557,28 +608,49 @@ void TestHelper::SetupExpectationsForClearingUniforms(
case GL_SAMPLER_EXTERNAL_OES:
case GL_SAMPLER_3D_OES:
case GL_SAMPLER_2D_RECT_ARB:
+ case GL_SAMPLER_2D_ARRAY:
EXPECT_CALL(*gl, Uniform1iv(info.real_location, info.size, _))
.Times(1)
.RetiresOnSaturation();
break;
+ case GL_UNSIGNED_INT:
+ EXPECT_CALL(*gl, Uniform1uiv(info.real_location, info.size, _))
+ .Times(1)
+ .RetiresOnSaturation();
+ break;
case GL_INT_VEC2:
case GL_BOOL_VEC2:
EXPECT_CALL(*gl, Uniform2iv(info.real_location, info.size, _))
.Times(1)
.RetiresOnSaturation();
break;
+ case GL_UNSIGNED_INT_VEC2:
+ EXPECT_CALL(*gl, Uniform2uiv(info.real_location, info.size, _))
+ .Times(1)
+ .RetiresOnSaturation();
+ break;
case GL_INT_VEC3:
case GL_BOOL_VEC3:
EXPECT_CALL(*gl, Uniform3iv(info.real_location, info.size, _))
.Times(1)
.RetiresOnSaturation();
break;
+ case GL_UNSIGNED_INT_VEC3:
+ EXPECT_CALL(*gl, Uniform3uiv(info.real_location, info.size, _))
+ .Times(1)
+ .RetiresOnSaturation();
+ break;
case GL_INT_VEC4:
case GL_BOOL_VEC4:
EXPECT_CALL(*gl, Uniform4iv(info.real_location, info.size, _))
.Times(1)
.RetiresOnSaturation();
break;
+ case GL_UNSIGNED_INT_VEC4:
+ EXPECT_CALL(*gl, Uniform4uiv(info.real_location, info.size, _))
+ .Times(1)
+ .RetiresOnSaturation();
+ break;
case GL_FLOAT_MAT2:
EXPECT_CALL(*gl, UniformMatrix2fv(
info.real_location, info.size, false, _))
diff --git a/chromium/gpu/command_buffer/service/test_helper.h b/chromium/gpu/command_buffer/service/test_helper.h
index a7eaec2afe3..5998915b382 100644
--- a/chromium/gpu/command_buffer/service/test_helper.h
+++ b/chromium/gpu/command_buffer/service/test_helper.h
@@ -27,12 +27,16 @@ class TestHelper {
public:
static const GLuint kServiceBlackTexture2dId = 701;
static const GLuint kServiceDefaultTexture2dId = 702;
- static const GLuint kServiceBlackTextureCubemapId = 703;
- static const GLuint kServiceDefaultTextureCubemapId = 704;
- static const GLuint kServiceBlackExternalTextureId = 705;
- static const GLuint kServiceDefaultExternalTextureId = 706;
- static const GLuint kServiceBlackRectangleTextureId = 707;
- static const GLuint kServiceDefaultRectangleTextureId = 708;
+ static const GLuint kServiceBlackTexture3dId = 703;
+ static const GLuint kServiceDefaultTexture3dId = 704;
+ static const GLuint kServiceBlackTexture2dArrayId = 705;
+ static const GLuint kServiceDefaultTexture2dArrayId = 706;
+ static const GLuint kServiceBlackTextureCubemapId = 707;
+ static const GLuint kServiceDefaultTextureCubemapId = 708;
+ static const GLuint kServiceBlackExternalTextureId = 709;
+ static const GLuint kServiceDefaultExternalTextureId = 710;
+ static const GLuint kServiceBlackRectangleTextureId = 711;
+ static const GLuint kServiceDefaultRectangleTextureId = 712;
static const GLint kMaxSamples = 4;
static const GLint kMaxRenderbufferSize = 1024;
@@ -83,10 +87,12 @@ class TestHelper {
const char* gl_renderer,
const char* gl_version);
static void SetupTextureManagerInitExpectations(::gfx::MockGLInterface* gl,
+ bool is_es3_enabled,
const char* extensions,
bool use_default_textures);
static void SetupTextureManagerDestructionExpectations(
::gfx::MockGLInterface* gl,
+ bool is_es3_enabled,
const char* extensions,
bool use_default_textures);
diff --git a/chromium/gpu/command_buffer/service/texture_definition.cc b/chromium/gpu/command_buffer/service/texture_definition.cc
index c19b5d3d47c..1f1372a711b 100644
--- a/chromium/gpu/command_buffer/service/texture_definition.cc
+++ b/chromium/gpu/command_buffer/service/texture_definition.cc
@@ -48,6 +48,9 @@ class GLImageSync : public gfx::GLImage {
gfx::OverlayTransform transform,
const gfx::Rect& bounds_rect,
const gfx::RectF& crop_rect) override;
+ void OnMemoryDump(base::trace_event::ProcessMemoryDump* pmd,
+ uint64_t process_tracing_id,
+ const std::string& dump_name) override;
protected:
~GLImageSync() override;
@@ -118,6 +121,12 @@ bool GLImageSync::ScheduleOverlayPlane(gfx::AcceleratedWidget widget,
return false;
}
+void GLImageSync::OnMemoryDump(base::trace_event::ProcessMemoryDump* pmd,
+ uint64_t process_tracing_id,
+ const std::string& dump_name) {
+ // TODO(ericrk): Implement GLImage OnMemoryDump. crbug.com/514914
+}
+
#if !defined(OS_MACOSX)
class NativeImageBufferEGL : public NativeImageBuffer {
public:
@@ -256,10 +265,6 @@ class NativeImageBufferStub : public NativeImageBuffer {
bool g_avoid_egl_target_texture_reuse = false;
-#if DCHECK_IS_ON()
-base::LazyInstance<base::ThreadLocalBoolean> g_inside_scoped_update_texture;
-#endif
-
} // anonymous namespace
// static
@@ -282,27 +287,6 @@ void TextureDefinition::AvoidEGLTargetTextureReuse() {
g_avoid_egl_target_texture_reuse = true;
}
-ScopedUpdateTexture::ScopedUpdateTexture() {
-#if DCHECK_IS_ON()
- DCHECK(!g_inside_scoped_update_texture.Get().Get());
- g_inside_scoped_update_texture.Get().Set(true);
-#endif
-}
-
-ScopedUpdateTexture::~ScopedUpdateTexture() {
-#if DCHECK_IS_ON()
- DCHECK(g_inside_scoped_update_texture.Get().Get());
- g_inside_scoped_update_texture.Get().Set(false);
-#endif
- // We have to make sure the changes are visible to other clients in this share
- // group. As far as the clients are concerned, the mailbox semantics only
- // demand a single flush from the client after changes are first made,
- // and it is not visible to them when another share group boundary is crossed.
- // We could probably track this and be a bit smarter about when to flush
- // though.
- glFlush();
-}
-
TextureDefinition::LevelInfo::LevelInfo()
: target(0),
internal_format(0),
@@ -390,16 +374,12 @@ Texture* TextureDefinition::CreateTexture() const {
glGenTextures(1, &texture_id);
Texture* texture(new Texture(texture_id));
- ScopedUpdateTexture scoped_update_texture;
UpdateTextureInternal(texture);
return texture;
}
void TextureDefinition::UpdateTextureInternal(Texture* texture) const {
-#if DCHECK_IS_ON()
- DCHECK(g_inside_scoped_update_texture.Get().Get());
-#endif
gfx::ScopedTextureBinder texture_binder(target_, texture->service_id());
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, min_filter_);
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, mag_filter_);
diff --git a/chromium/gpu/command_buffer/service/texture_definition.h b/chromium/gpu/command_buffer/service/texture_definition.h
index 19c953cb1c4..9426fc4498b 100644
--- a/chromium/gpu/command_buffer/service/texture_definition.h
+++ b/chromium/gpu/command_buffer/service/texture_definition.h
@@ -37,15 +37,6 @@ class NativeImageBuffer : public base::RefCountedThreadSafe<NativeImageBuffer> {
DISALLOW_COPY_AND_ASSIGN(NativeImageBuffer);
};
-class ScopedUpdateTexture {
- public:
- ScopedUpdateTexture();
- ~ScopedUpdateTexture();
-
- private:
- DISALLOW_COPY_AND_ASSIGN(ScopedUpdateTexture);
-};
-
// An immutable description that can be used to create a texture that shares
// the underlying image buffer(s).
class TextureDefinition {
@@ -60,7 +51,6 @@ class TextureDefinition {
Texture* CreateTexture() const;
- // Must be wrapped with ScopedUpdateTexture.
void UpdateTexture(Texture* texture) const;
unsigned int version() const { return version_; }
diff --git a/chromium/gpu/command_buffer/service/texture_manager.cc b/chromium/gpu/command_buffer/service/texture_manager.cc
index c7150ee98ee..5ff4d2de1de 100644
--- a/chromium/gpu/command_buffer/service/texture_manager.cc
+++ b/chromium/gpu/command_buffer/service/texture_manager.cc
@@ -11,6 +11,8 @@
#include "base/bits.h"
#include "base/lazy_instance.h"
#include "base/strings/stringprintf.h"
+#include "base/thread_task_runner_handle.h"
+#include "base/trace_event/memory_dump_manager.h"
#include "gpu/command_buffer/common/gles2_cmd_utils.h"
#include "gpu/command_buffer/service/context_state.h"
#include "gpu/command_buffer/service/error_state.h"
@@ -20,6 +22,7 @@
#include "gpu/command_buffer/service/mailbox_manager.h"
#include "gpu/command_buffer/service/memory_tracking.h"
#include "ui/gl/gl_implementation.h"
+#include "ui/gl/trace_util.h"
namespace gpu {
namespace gles2 {
@@ -283,6 +286,9 @@ TextureManager::~TextureManager() {
DCHECK_EQ(0, num_unsafe_textures_);
DCHECK_EQ(0, num_uncleared_mips_);
DCHECK_EQ(0, num_images_);
+
+ base::trace_event::MemoryDumpManager::GetInstance()->UnregisterDumpProvider(
+ this);
}
void TextureManager::Destroy(bool have_context) {
@@ -437,10 +443,11 @@ Texture::CanRenderCondition Texture::GetCanRenderCondition() const {
if (needs_mips) {
if (!texture_complete())
return CAN_RENDER_NEVER;
- if (target_ == GL_TEXTURE_CUBE_MAP && !cube_complete())
- return CAN_RENDER_NEVER;
}
+ if (target_ == GL_TEXTURE_CUBE_MAP && !cube_complete())
+ return CAN_RENDER_NEVER;
+
bool is_npot_compatible = !needs_mips &&
wrap_s_ == GL_CLAMP_TO_EDGE &&
wrap_t_ == GL_CLAMP_TO_EDGE;
@@ -579,21 +586,25 @@ bool Texture::CanGenerateMipmaps(
return false;
}
+ if (static_cast<size_t>(base_level_) >= face_infos_[0].level_infos.size()) {
+ return false;
+ }
+
// Can't generate mips for depth or stencil textures.
- const Texture::LevelInfo& first = face_infos_[0].level_infos[0];
- uint32 channels = GLES2Util::GetChannelsForFormat(first.format);
+ const Texture::LevelInfo& base = face_infos_[0].level_infos[base_level_];
+ uint32 channels = GLES2Util::GetChannelsForFormat(base.format);
if (channels & (GLES2Util::kDepth | GLES2Util::kStencil)) {
return false;
}
// TODO(gman): Check internal_format, format and type.
for (size_t ii = 0; ii < face_infos_.size(); ++ii) {
- const LevelInfo& info = face_infos_[ii].level_infos[0];
- if ((info.target == 0) || (info.width != first.width) ||
- (info.height != first.height) || (info.depth != 1) ||
- (info.format != first.format) ||
- (info.internal_format != first.internal_format) ||
- (info.type != first.type) ||
+ const LevelInfo& info = face_infos_[ii].level_infos[base_level_];
+ if ((info.target == 0) || (info.width != base.width) ||
+ (info.height != base.height) || (info.depth != base.depth) ||
+ (info.format != base.format) ||
+ (info.internal_format != base.internal_format) ||
+ (info.type != base.type) ||
feature_info->validators()->compressed_texture_format.IsValid(
info.internal_format) ||
info.image.get()) {
@@ -851,8 +862,7 @@ bool Texture::ValidForTexture(
GLint zoffset,
GLsizei width,
GLsizei height,
- GLsizei depth,
- GLenum type) const {
+ GLsizei depth) const {
size_t face_index = GLES2Util::GLTargetToFaceIndex(target);
if (level >= 0 && face_index < face_infos_.size() &&
static_cast<size_t>(level) < face_infos_[face_index].level_infos.size()) {
@@ -868,8 +878,7 @@ bool Texture::ValidForTexture(
zoffset >= 0 &&
max_x <= info.width &&
max_y <= info.height &&
- max_z <= info.depth &&
- type == info.type;
+ max_z <= info.depth;
}
return false;
}
@@ -1257,6 +1266,10 @@ void Texture::SetLevelImage(
info.image = image;
UpdateCanRenderCondition();
UpdateHasImages();
+
+ // TODO(ericrk): Images may have complex sizing not accounted for by
+ // |estimated_size_|, we should add logic here to update |estimated_size_|
+ // based on the new GLImage. crbug.com/526298
}
gfx::GLImage* Texture::GetLevelImage(GLint target, GLint level) const {
@@ -1288,6 +1301,38 @@ void Texture::OnDidModifyPixels() {
image->DidModifyTexImage();
}
+void Texture::DumpLevelMemory(base::trace_event::ProcessMemoryDump* pmd,
+ uint64_t client_tracing_id,
+ const std::string& dump_name) const {
+ for (uint32_t face_index = 0; face_index < face_infos_.size(); ++face_index) {
+ const auto& level_infos = face_infos_[face_index].level_infos;
+ for (uint32_t level_index = 0; level_index < level_infos.size();
+ ++level_index) {
+ // Skip levels with no size. Textures will have empty levels for all
+ // potential mip levels which are not in use.
+ if (!level_infos[level_index].estimated_size)
+ continue;
+
+ if (level_infos[level_index].image) {
+ // If a level is backed by a GLImage, ask the GLImage to dump itself.
+ level_infos[level_index].image->OnMemoryDump(
+ pmd, client_tracing_id,
+ base::StringPrintf("%s/face_%d/level_%d", dump_name.c_str(),
+ face_index, level_index));
+ } else {
+ // If a level is not backed by a GLImage, create a simple dump.
+ base::trace_event::MemoryAllocatorDump* dump = pmd->CreateAllocatorDump(
+ base::StringPrintf("%s/face_%d/level_%d", dump_name.c_str(),
+ face_index, level_index));
+ dump->AddScalar(
+ base::trace_event::MemoryAllocatorDump::kNameSize,
+ base::trace_event::MemoryAllocatorDump::kUnitsBytes,
+ static_cast<uint64_t>(level_infos[level_index].estimated_size));
+ }
+ }
+ }
+}
+
TextureRef::TextureRef(TextureManager* manager,
GLuint client_id,
Texture* texture)
@@ -1324,6 +1369,7 @@ TextureManager::TextureManager(MemoryTracker* memory_tracker,
new MemoryTypeTracker(memory_tracker, MemoryTracker::kManaged)),
memory_tracker_unmanaged_(
new MemoryTypeTracker(memory_tracker, MemoryTracker::kUnmanaged)),
+ memory_tracker_(memory_tracker),
feature_info_(feature_info),
framebuffer_manager_(NULL),
max_texture_size_(max_texture_size),
@@ -1365,6 +1411,13 @@ bool TextureManager::Initialize() {
default_textures_[kCubeMap] = CreateDefaultAndBlackTextures(
GL_TEXTURE_CUBE_MAP, &black_texture_ids_[kCubeMap]);
+ if (feature_info_->IsES3Enabled()) {
+ default_textures_[kTexture3D] = CreateDefaultAndBlackTextures(
+ GL_TEXTURE_3D, &black_texture_ids_[kTexture3D]);
+ default_textures_[kTexture2DArray] = CreateDefaultAndBlackTextures(
+ GL_TEXTURE_2D_ARRAY, &black_texture_ids_[kTexture2DArray]);
+ }
+
if (feature_info_->feature_flags().oes_egl_image_external) {
default_textures_[kExternalOES] = CreateDefaultAndBlackTextures(
GL_TEXTURE_EXTERNAL_OES, &black_texture_ids_[kExternalOES]);
@@ -1375,6 +1428,13 @@ bool TextureManager::Initialize() {
GL_TEXTURE_RECTANGLE_ARB, &black_texture_ids_[kRectangleARB]);
}
+ // When created from InProcessCommandBuffer, we won't have a |memory_tracker_|
+ // so don't register a dump provider.
+ if (memory_tracker_) {
+ base::trace_event::MemoryDumpManager::GetInstance()->RegisterDumpProvider(
+ this, base::ThreadTaskRunnerHandle::Get());
+ }
+
return true;
}
@@ -1388,6 +1448,8 @@ scoped_refptr<TextureRef>
// black values according to the spec.
bool needs_initialization = (target != GL_TEXTURE_EXTERNAL_OES);
bool needs_faces = (target == GL_TEXTURE_CUBE_MAP);
+ bool is_3d_or_2d_array_target = (target == GL_TEXTURE_3D ||
+ target == GL_TEXTURE_2D_ARRAY);
// Make default textures and texture for replacing non-renderable textures.
GLuint ids[2];
@@ -1402,8 +1464,13 @@ scoped_refptr<TextureRef>
GL_RGBA, GL_UNSIGNED_BYTE, black);
}
} else {
- glTexImage2D(target, 0, GL_RGBA, 1, 1, 0, GL_RGBA,
- GL_UNSIGNED_BYTE, black);
+ if (is_3d_or_2d_array_target) {
+ glTexImage3D(target, 0, GL_RGBA, 1, 1, 1, 0, GL_RGBA,
+ GL_UNSIGNED_BYTE, black);
+ } else {
+ glTexImage2D(target, 0, GL_RGBA, 1, 1, 0, GL_RGBA,
+ GL_UNSIGNED_BYTE, black);
+ }
}
}
}
@@ -1867,6 +1934,14 @@ bool TextureManager::ValidateTexImage(
error_state, function_name, args.target, "target");
return false;
}
+ // TODO(ccameron): Add a separate texture from |texture_target| for
+ // [Compressed]Tex[Sub]Image2D and related functions.
+ // http://crbug.com/536854
+ if (args.target == GL_TEXTURE_RECTANGLE_ARB) {
+ ERRORSTATE_SET_GL_ERROR_INVALID_ENUM(
+ error_state, function_name, args.target, "target");
+ return false;
+ }
if (!ValidateTextureParameters(
error_state, function_name, args.format, args.type,
args.internal_format, args.level)) {
@@ -1881,7 +1956,8 @@ bool TextureManager::ValidateTexImage(
return false;
}
if ((GLES2Util::GetChannelsForFormat(args.format) &
- (GLES2Util::kDepth | GLES2Util::kStencil)) != 0 && args.pixels) {
+ (GLES2Util::kDepth | GLES2Util::kStencil)) != 0 && args.pixels
+ && !feature_info_->IsES3Enabled()) {
ERRORSTATE_SET_GL_ERROR(
error_state, GL_INVALID_OPERATION,
function_name, "can not supply data for depth or stencil textures");
@@ -1924,6 +2000,59 @@ void TextureManager::ValidateAndDoTexImage(
return;
}
+ // ValidateTexImage is passed already.
+ Texture* texture = texture_ref->texture();
+ bool need_cube_map_workaround =
+ texture->target() == GL_TEXTURE_CUBE_MAP &&
+ (texture_state->force_cube_complete ||
+ (texture_state->force_cube_map_positive_x_allocation &&
+ args.target != GL_TEXTURE_CUBE_MAP_POSITIVE_X));
+ if (need_cube_map_workaround) {
+ std::vector<GLenum> undefined_faces;
+ if (texture_state->force_cube_complete) {
+ int width = 0;
+ int height = 0;
+ for (unsigned i = 0; i < 6; i++) {
+ bool defined =
+ texture->GetLevelSize(GL_TEXTURE_CUBE_MAP_POSITIVE_X + i,
+ args.level, &width, &height, nullptr);
+ if (!defined || GL_TEXTURE_CUBE_MAP_POSITIVE_X + i == args.target)
+ undefined_faces.push_back(GL_TEXTURE_CUBE_MAP_POSITIVE_X + i);
+ }
+ } else if (texture_state->force_cube_map_positive_x_allocation &&
+ args.target != GL_TEXTURE_CUBE_MAP_POSITIVE_X) {
+ int width = 0;
+ int height = 0;
+ if (!texture->GetLevelSize(GL_TEXTURE_CUBE_MAP_POSITIVE_X, args.level,
+ &width, &height, nullptr)) {
+ undefined_faces.push_back(GL_TEXTURE_CUBE_MAP_POSITIVE_X);
+ }
+ undefined_faces.push_back(args.target);
+ }
+
+ DCHECK(undefined_faces.size());
+ if (!memory_tracker_managed_->EnsureGPUMemoryAvailable(
+ undefined_faces.size() * args.pixels_size)) {
+ ERRORSTATE_SET_GL_ERROR(state->GetErrorState(), GL_OUT_OF_MEMORY,
+ function_name, "out of memory");
+ return;
+ }
+ DoTexImageArguments new_args = args;
+ scoped_ptr<char[]> zero(new char[args.pixels_size]);
+ memset(zero.get(), 0, args.pixels_size);
+ for (GLenum face : undefined_faces) {
+ new_args.target = face;
+ if (face == args.target) {
+ new_args.pixels = args.pixels;
+ } else {
+ new_args.pixels = zero.get();
+ }
+ DoTexImage(texture_state, state->GetErrorState(), framebuffer_state,
+ function_name, texture_ref, new_args);
+ }
+ return;
+ }
+
DoTexImage(texture_state, state->GetErrorState(), framebuffer_state,
function_name, texture_ref, args);
}
@@ -2027,5 +2156,69 @@ ScopedTextureUploadTimer::~ScopedTextureUploadTimer() {
base::TimeTicks::Now() - begin_time_;
}
+bool TextureManager::OnMemoryDump(const base::trace_event::MemoryDumpArgs& args,
+ base::trace_event::ProcessMemoryDump* pmd) {
+ for (const auto& resource : textures_) {
+ // Only dump memory info for textures actually owned by this TextureManager.
+ DumpTextureRef(pmd, resource.second.get());
+ }
+
+ // Also dump TextureManager internal textures, if allocated.
+ for (int i = 0; i < kNumDefaultTextures; i++) {
+ if (default_textures_[i]) {
+ DumpTextureRef(pmd, default_textures_[i].get());
+ }
+ }
+
+ return true;
+}
+
+void TextureManager::DumpTextureRef(base::trace_event::ProcessMemoryDump* pmd,
+ TextureRef* ref) {
+ uint32_t size = ref->texture()->estimated_size();
+
+ // Ignore unallocated texture IDs.
+ if (size == 0)
+ return;
+
+ std::string dump_name =
+ base::StringPrintf("gpu/gl/textures/client_%d/texture_%d",
+ memory_tracker_->ClientId(), ref->client_id());
+
+ base::trace_event::MemoryAllocatorDump* dump =
+ pmd->CreateAllocatorDump(dump_name);
+ dump->AddScalar(base::trace_event::MemoryAllocatorDump::kNameSize,
+ base::trace_event::MemoryAllocatorDump::kUnitsBytes,
+ static_cast<uint64_t>(size));
+
+ // Add the |client_guid| which expresses shared ownership with the client
+ // process.
+ auto client_guid = gfx::GetGLTextureClientGUIDForTracing(
+ memory_tracker_->ShareGroupTracingGUID(), ref->client_id());
+ pmd->CreateSharedGlobalAllocatorDump(client_guid);
+ pmd->AddOwnershipEdge(dump->guid(), client_guid);
+
+ // Add a |service_guid| which expresses shared ownership between the various
+ // |client_guid|s.
+ // TODO(ericrk): May need to ensure uniqueness using GLShareGroup and
+ // potentially cross-share-group sharing via EGLImages. crbug.com/512534
+ auto service_guid = gfx::GetGLTextureServiceGUIDForTracing(
+ memory_tracker_->ShareGroupTracingGUID(), ref->texture()->service_id());
+ pmd->CreateSharedGlobalAllocatorDump(service_guid);
+
+ int importance = 0; // Default importance.
+ // The link to the memory tracking |client_id| is given a higher importance
+ // than other refs.
+ if (ref == ref->texture()->memory_tracking_ref_)
+ importance = 2;
+
+ pmd->AddOwnershipEdge(client_guid, service_guid, importance);
+
+ // Dump all sub-levels held by the texture. They will appear below the main
+ // gl/textures/client_X/texture_Y dump.
+ ref->texture()->DumpLevelMemory(pmd, memory_tracker_->ClientTracingId(),
+ dump_name);
+}
+
} // namespace gles2
} // namespace gpu
diff --git a/chromium/gpu/command_buffer/service/texture_manager.h b/chromium/gpu/command_buffer/service/texture_manager.h
index 4de5421b1bc..56d96ba5622 100644
--- a/chromium/gpu/command_buffer/service/texture_manager.h
+++ b/chromium/gpu/command_buffer/service/texture_manager.h
@@ -13,7 +13,7 @@
#include "base/basictypes.h"
#include "base/containers/hash_tables.h"
#include "base/memory/ref_counted.h"
-#include "gpu/command_buffer/service/async_pixel_transfer_delegate.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"
#include "gpu/gpu_export.h"
@@ -146,7 +146,7 @@ class GPU_EXPORT Texture {
}
// Returns true of the given dimensions are inside the dimensions of the
- // level and if the type matches the level.
+ // level.
bool ValidForTexture(
GLint target,
GLint level,
@@ -155,8 +155,7 @@ class GPU_EXPORT Texture {
GLint zoffset,
GLsizei width,
GLsizei height,
- GLsizei depth,
- GLenum type) const;
+ GLsizei depth) const;
bool IsValid() const {
return !!target();
@@ -201,6 +200,10 @@ class GPU_EXPORT Texture {
void OnWillModifyPixels();
void OnDidModifyPixels();
+ void DumpLevelMemory(base::trace_event::ProcessMemoryDump* pmd,
+ uint64_t client_tracing_id,
+ const std::string& dump_name) const;
+
private:
friend class MailboxManagerImpl;
friend class MailboxManagerSync;
@@ -532,10 +535,14 @@ class GPU_EXPORT TextureRef : public base::RefCounted<TextureRef> {
struct DecoderTextureState {
// total_texture_upload_time automatically initialized to 0 in default
// constructor.
- explicit DecoderTextureState(bool texsubimage_faster_than_teximage)
+ explicit DecoderTextureState(const FeatureInfo::Workarounds& workarounds)
: tex_image_failed(false),
texture_upload_count(0),
- texsubimage_faster_than_teximage(texsubimage_faster_than_teximage) {}
+ texsubimage_faster_than_teximage(
+ workarounds.texsubimage_faster_than_teximage),
+ force_cube_map_positive_x_allocation(
+ workarounds.force_cube_map_positive_x_allocation),
+ force_cube_complete(workarounds.force_cube_complete) {}
// This indicates all the following texSubImage*D calls that are part of the
// failed texImage*D call should be ignored. The client calls have a lock
@@ -548,6 +555,8 @@ struct DecoderTextureState {
base::TimeDelta total_texture_upload_time;
bool texsubimage_faster_than_teximage;
+ bool force_cube_map_positive_x_allocation;
+ bool force_cube_complete;
};
// This class keeps track of the textures and their sizes so we can do NPOT and
@@ -555,7 +564,7 @@ struct DecoderTextureState {
//
// NOTE: To support shared resources an instance of this class will need to be
// shared by multiple GLES2Decoders.
-class GPU_EXPORT TextureManager {
+class GPU_EXPORT TextureManager : public base::trace_event::MemoryDumpProvider {
public:
class GPU_EXPORT DestructionObserver {
public:
@@ -574,6 +583,8 @@ class GPU_EXPORT TextureManager {
enum DefaultAndBlackTextures {
kTexture2D,
+ kTexture3D,
+ kTexture2DArray,
kCubeMap,
kExternalOES,
kRectangleARB,
@@ -587,7 +598,7 @@ class GPU_EXPORT TextureManager {
GLsizei max_rectangle_texture_size,
GLsizei max_3d_texture_size,
bool use_default_textures);
- ~TextureManager();
+ ~TextureManager() override;
void set_framebuffer_manager(FramebufferManager* manager) {
framebuffer_manager_ = manager;
@@ -603,7 +614,8 @@ class GPU_EXPORT TextureManager {
GLint MaxLevelsForTarget(GLenum target) const {
switch (target) {
case GL_TEXTURE_2D:
- return max_levels_;
+ return max_levels_;
+ case GL_TEXTURE_RECTANGLE_ARB:
case GL_TEXTURE_EXTERNAL_OES:
return 1;
case GL_TEXTURE_3D:
@@ -674,15 +686,6 @@ class GPU_EXPORT TextureManager {
GLenum type,
const gfx::Rect& cleared_rect);
- // Adapter to call above function.
- void SetLevelInfoFromParams(TextureRef* ref,
- const gpu::AsyncTexImage2DParams& params) {
- SetLevelInfo(ref, params.target, params.level, params.internal_format,
- params.width, params.height, 1 /* depth */, params.border,
- params.format, params.type,
- gfx::Rect(params.width, params.height) /* cleared_rect */);
- }
-
Texture* Produce(TextureRef* ref);
// Maps an existing texture into the texture manager, at a given client ID.
@@ -736,6 +739,10 @@ class GPU_EXPORT TextureManager {
switch (target) {
case GL_TEXTURE_2D:
return default_textures_[kTexture2D].get();
+ case GL_TEXTURE_3D:
+ return default_textures_[kTexture3D].get();
+ case GL_TEXTURE_2D_ARRAY:
+ return default_textures_[kTexture2DArray].get();
case GL_TEXTURE_CUBE_MAP:
return default_textures_[kCubeMap].get();
case GL_TEXTURE_EXTERNAL_OES:
@@ -768,6 +775,10 @@ class GPU_EXPORT TextureManager {
switch (target) {
case GL_SAMPLER_2D:
return black_texture_ids_[kTexture2D];
+ case GL_SAMPLER_3D:
+ return black_texture_ids_[kTexture3D];
+ case GL_SAMPLER_2D_ARRAY:
+ return black_texture_ids_[kTexture2DArray];
case GL_SAMPLER_CUBE:
return black_texture_ids_[kCubeMap];
case GL_SAMPLER_EXTERNAL_OES:
@@ -866,6 +877,10 @@ class GPU_EXPORT TextureManager {
ErrorState* error_state, const char* function_name,
GLenum format, GLenum type, GLenum internal_format, GLint level);
+ // base::trace_event::MemoryDumpProvider implementation.
+ bool OnMemoryDump(const base::trace_event::MemoryDumpArgs& args,
+ base::trace_event::ProcessMemoryDump* pmd) override;
+
private:
friend class Texture;
friend class TextureRef;
@@ -895,9 +910,14 @@ class GPU_EXPORT TextureManager {
GLenum AdjustTexFormat(GLenum format) const;
+ // Helper function called by OnMemoryDump.
+ void DumpTextureRef(base::trace_event::ProcessMemoryDump* pmd,
+ TextureRef* ref);
+
MemoryTypeTracker* GetMemTracker(GLenum texture_pool);
scoped_ptr<MemoryTypeTracker> memory_tracker_managed_;
scoped_ptr<MemoryTypeTracker> memory_tracker_unmanaged_;
+ MemoryTracker* memory_tracker_;
scoped_refptr<FeatureInfo> feature_info_;
diff --git a/chromium/gpu/command_buffer/service/texture_manager_unittest.cc b/chromium/gpu/command_buffer/service/texture_manager_unittest.cc
index ed25a7d4520..262faab4f8e 100644
--- a/chromium/gpu/command_buffer/service/texture_manager_unittest.cc
+++ b/chromium/gpu/command_buffer/service/texture_manager_unittest.cc
@@ -78,7 +78,7 @@ class TextureManagerTest : public GpuServiceTest {
kMax3DTextureSize,
kUseDefaultTextures));
TestHelper::SetupTextureManagerInitExpectations(
- gl_.get(), "", kUseDefaultTextures);
+ gl_.get(), false, "", kUseDefaultTextures);
manager_->Initialize();
error_state_.reset(new ::testing::StrictMock<gles2::MockErrorState>());
}
@@ -96,6 +96,23 @@ class TextureManagerTest : public GpuServiceTest {
texture_ref, pname, value, error);
}
+ void SetupFeatureInfo(const char* gl_extensions,
+ const char* gl_version,
+ bool enable_es3) {
+ TestHelper::SetupFeatureInfoInitExpectationsWithGLVersion(
+ gl_.get(), gl_extensions, "", gl_version);
+ feature_info_->InitializeForTesting();
+ if (enable_es3) {
+ EXPECT_CALL(*gl_, GetIntegerv(GL_MAX_COLOR_ATTACHMENTS, _))
+ .WillOnce(SetArgPointee<1>(8))
+ .RetiresOnSaturation();
+ EXPECT_CALL(*gl_, GetIntegerv(GL_MAX_DRAW_BUFFERS, _))
+ .WillOnce(SetArgPointee<1>(8))
+ .RetiresOnSaturation();
+ feature_info_->EnableES3Validators();
+ }
+ }
+
scoped_refptr<FeatureInfo> feature_info_;
scoped_ptr<TextureManager> manager_;
scoped_ptr<MockErrorState> error_state_;
@@ -177,10 +194,8 @@ TEST_F(TextureManagerTest, SetParameter) {
TEST_F(TextureManagerTest, UseDefaultTexturesTrue) {
bool use_default_textures = true;
- scoped_refptr<FeatureInfo> feature_info(new FeatureInfo());
-
- TestHelper::SetupTextureManagerInitExpectations(
- gl_.get(), "GL_ANGLE_texture_usage", use_default_textures);
+ TestHelper::SetupTextureManagerInitExpectations(gl_.get(),
+ false, "GL_ANGLE_texture_usage", use_default_textures);
TextureManager manager(NULL,
feature_info_.get(),
kMaxTextureSize,
@@ -200,8 +215,8 @@ TEST_F(TextureManagerTest, UseDefaultTexturesTrue) {
TEST_F(TextureManagerTest, UseDefaultTexturesFalse) {
bool use_default_textures = false;
- TestHelper::SetupTextureManagerInitExpectations(
- gl_.get(), "GL_ANGLE_texture_usage", use_default_textures);
+ TestHelper::SetupTextureManagerInitExpectations(gl_.get(),
+ false, "GL_ANGLE_texture_usage", use_default_textures);
TextureManager manager(NULL,
feature_info_.get(),
kMaxTextureSize,
@@ -219,9 +234,49 @@ TEST_F(TextureManagerTest, UseDefaultTexturesFalse) {
manager.Destroy(false);
}
+TEST_F(TextureManagerTest, UseDefaultTexturesTrueES3) {
+ bool use_default_textures = true;
+ SetupFeatureInfo("", "OpenGL ES 3.0", true);
+ TestHelper::SetupTextureManagerInitExpectations(gl_.get(),
+ true, "", use_default_textures);
+ TextureManager manager(NULL,
+ feature_info_.get(),
+ kMaxTextureSize,
+ kMaxCubeMapTextureSize,
+ kMaxRectangleTextureSize,
+ kMax3DTextureSize,
+ use_default_textures);
+ manager.Initialize();
+
+ EXPECT_TRUE(manager.GetDefaultTextureInfo(GL_TEXTURE_3D) != NULL);
+ EXPECT_TRUE(manager.GetDefaultTextureInfo(GL_TEXTURE_2D_ARRAY) != NULL);
+
+ manager.Destroy(false);
+}
+
+TEST_F(TextureManagerTest, UseDefaultTexturesFalseES3) {
+ bool use_default_textures = false;
+ SetupFeatureInfo("", "OpenGL ES 3.0", true);
+ TestHelper::SetupTextureManagerInitExpectations(gl_.get(),
+ true, "", use_default_textures);
+ TextureManager manager(NULL,
+ feature_info_.get(),
+ kMaxTextureSize,
+ kMaxCubeMapTextureSize,
+ kMaxRectangleTextureSize,
+ kMax3DTextureSize,
+ use_default_textures);
+ manager.Initialize();
+
+ EXPECT_TRUE(manager.GetDefaultTextureInfo(GL_TEXTURE_3D) == NULL);
+ EXPECT_TRUE(manager.GetDefaultTextureInfo(GL_TEXTURE_2D_ARRAY) == NULL);
+
+ manager.Destroy(false);
+}
+
TEST_F(TextureManagerTest, TextureUsageExt) {
TestHelper::SetupTextureManagerInitExpectations(
- gl_.get(), "GL_ANGLE_texture_usage", kUseDefaultTextures);
+ gl_.get(), false, "GL_ANGLE_texture_usage", kUseDefaultTextures);
TextureManager manager(NULL,
feature_info_.get(),
kMaxTextureSize,
@@ -249,7 +304,7 @@ TEST_F(TextureManagerTest, Destroy) {
const GLuint kClient1Id = 1;
const GLuint kService1Id = 11;
TestHelper::SetupTextureManagerInitExpectations(
- gl_.get(), "", kUseDefaultTextures);
+ gl_.get(), false, "", kUseDefaultTextures);
TextureManager manager(NULL,
feature_info_.get(),
kMaxTextureSize,
@@ -267,7 +322,7 @@ TEST_F(TextureManagerTest, Destroy) {
.Times(1)
.RetiresOnSaturation();
TestHelper::SetupTextureManagerDestructionExpectations(
- gl_.get(), "", kUseDefaultTextures);
+ gl_.get(), false, "", kUseDefaultTextures);
manager.Destroy(true);
// Check that resources got freed.
texture = manager.GetTexture(kClient1Id);
@@ -389,7 +444,7 @@ TEST_F(TextureManagerTest, ValidForTargetNPOT) {
TestHelper::SetupFeatureInfoInitExpectations(
gl_.get(), "GL_OES_texture_npot");
scoped_refptr<FeatureInfo> feature_info(new FeatureInfo());
- feature_info->Initialize();
+ feature_info->InitializeForTesting();
TextureManager manager(NULL,
feature_info.get(),
kMaxTextureSize,
@@ -426,12 +481,12 @@ class TextureTestBase : public GpuServiceTest {
~TextureTestBase() override { texture_ref_ = NULL; }
protected:
- void SetUpBase(MemoryTracker* memory_tracker, std::string extensions) {
+ void SetUpBase(MemoryTracker* memory_tracker, const std::string& extensions) {
GpuServiceTest::SetUp();
if (!extensions.empty()) {
TestHelper::SetupFeatureInfoInitExpectations(gl_.get(),
extensions.c_str());
- feature_info_->Initialize();
+ feature_info_->InitializeForTesting();
}
manager_.reset(new TextureManager(memory_tracker,
@@ -724,7 +779,7 @@ TEST_F(TextureTest, NPOT2DNPOTOK) {
TestHelper::SetupFeatureInfoInitExpectations(
gl_.get(), "GL_OES_texture_npot");
scoped_refptr<FeatureInfo> feature_info(new FeatureInfo());
- feature_info->Initialize();
+ feature_info->InitializeForTesting();
TextureManager manager(NULL,
feature_info.get(),
kMaxTextureSize,
@@ -840,6 +895,76 @@ TEST_F(TextureTest, POTCubeMap) {
EXPECT_TRUE(TextureTestHelper::IsCubeComplete(texture));
}
+TEST_F(TextureTest, POTCubeMapWithoutMipmap) {
+ manager_->SetTarget(texture_ref_.get(), GL_TEXTURE_CUBE_MAP);
+ SetParameter(
+ texture_ref_.get(), GL_TEXTURE_MIN_FILTER, GL_NEAREST, GL_NO_ERROR);
+ SetParameter(
+ texture_ref_.get(), GL_TEXTURE_MAG_FILTER, GL_NEAREST, GL_NO_ERROR);
+ SetParameter(
+ texture_ref_.get(), GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE, GL_NO_ERROR);
+ SetParameter(
+ texture_ref_.get(), GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE, GL_NO_ERROR);
+
+ Texture* texture = texture_ref_->texture();
+ EXPECT_EQ(static_cast<GLenum>(GL_TEXTURE_CUBE_MAP), texture->target());
+ // Check Setting level 0 each face to POT
+ manager_->SetLevelInfo(texture_ref_.get(), GL_TEXTURE_CUBE_MAP_POSITIVE_X, 0,
+ GL_RGBA, 4, 4, 1, 0, GL_RGBA, GL_UNSIGNED_BYTE,
+ gfx::Rect(4, 4));
+ EXPECT_FALSE(TextureTestHelper::IsNPOT(texture));
+ EXPECT_FALSE(TextureTestHelper::IsTextureComplete(texture));
+ EXPECT_FALSE(TextureTestHelper::IsCubeComplete(texture));
+ EXPECT_FALSE(manager_->CanGenerateMipmaps(texture_ref_.get()));
+ EXPECT_FALSE(manager_->CanRender(texture_ref_.get()));
+ EXPECT_TRUE(manager_->HaveUnrenderableTextures());
+ manager_->SetLevelInfo(texture_ref_.get(), GL_TEXTURE_CUBE_MAP_NEGATIVE_X, 0,
+ GL_RGBA, 4, 4, 1, 0, GL_RGBA, GL_UNSIGNED_BYTE,
+ gfx::Rect(4, 4));
+ EXPECT_FALSE(TextureTestHelper::IsNPOT(texture));
+ EXPECT_FALSE(TextureTestHelper::IsTextureComplete(texture));
+ EXPECT_FALSE(TextureTestHelper::IsCubeComplete(texture));
+ EXPECT_FALSE(manager_->CanGenerateMipmaps(texture_ref_.get()));
+ EXPECT_FALSE(manager_->CanRender(texture_ref_.get()));
+ EXPECT_TRUE(manager_->HaveUnrenderableTextures());
+ manager_->SetLevelInfo(texture_ref_.get(), GL_TEXTURE_CUBE_MAP_POSITIVE_Y, 0,
+ GL_RGBA, 4, 4, 1, 0, GL_RGBA, GL_UNSIGNED_BYTE,
+ gfx::Rect(4, 4));
+ EXPECT_FALSE(TextureTestHelper::IsNPOT(texture));
+ EXPECT_FALSE(TextureTestHelper::IsTextureComplete(texture));
+ EXPECT_FALSE(TextureTestHelper::IsCubeComplete(texture));
+ EXPECT_FALSE(manager_->CanGenerateMipmaps(texture_ref_.get()));
+ EXPECT_FALSE(manager_->CanRender(texture_ref_.get()));
+ EXPECT_TRUE(manager_->HaveUnrenderableTextures());
+ manager_->SetLevelInfo(texture_ref_.get(), GL_TEXTURE_CUBE_MAP_NEGATIVE_Y, 0,
+ GL_RGBA, 4, 4, 1, 0, GL_RGBA, GL_UNSIGNED_BYTE,
+ gfx::Rect(4, 4));
+ EXPECT_FALSE(TextureTestHelper::IsNPOT(texture));
+ EXPECT_FALSE(TextureTestHelper::IsTextureComplete(texture));
+ EXPECT_FALSE(TextureTestHelper::IsCubeComplete(texture));
+ EXPECT_FALSE(manager_->CanRender(texture_ref_.get()));
+ EXPECT_FALSE(manager_->CanGenerateMipmaps(texture_ref_.get()));
+ EXPECT_TRUE(manager_->HaveUnrenderableTextures());
+ manager_->SetLevelInfo(texture_ref_.get(), GL_TEXTURE_CUBE_MAP_POSITIVE_Z, 0,
+ GL_RGBA, 4, 4, 1, 0, GL_RGBA, GL_UNSIGNED_BYTE,
+ gfx::Rect(4, 4));
+ EXPECT_FALSE(TextureTestHelper::IsNPOT(texture));
+ EXPECT_FALSE(TextureTestHelper::IsTextureComplete(texture));
+ EXPECT_FALSE(TextureTestHelper::IsCubeComplete(texture));
+ EXPECT_FALSE(manager_->CanGenerateMipmaps(texture_ref_.get()));
+ EXPECT_FALSE(manager_->CanRender(texture_ref_.get()));
+ EXPECT_TRUE(manager_->HaveUnrenderableTextures());
+ manager_->SetLevelInfo(texture_ref_.get(), GL_TEXTURE_CUBE_MAP_NEGATIVE_Z, 0,
+ GL_RGBA, 4, 4, 1, 0, GL_RGBA, GL_UNSIGNED_BYTE,
+ gfx::Rect(4, 4));
+ EXPECT_FALSE(TextureTestHelper::IsNPOT(texture));
+ EXPECT_FALSE(TextureTestHelper::IsTextureComplete(texture));
+ EXPECT_TRUE(TextureTestHelper::IsCubeComplete(texture));
+ EXPECT_TRUE(manager_->CanGenerateMipmaps(texture_ref_.get()));
+ EXPECT_TRUE(manager_->CanRender(texture_ref_.get()));
+ EXPECT_FALSE(manager_->HaveUnrenderableTextures());
+}
+
TEST_F(TextureTest, GetLevelSize) {
manager_->SetTarget(texture_ref_.get(), GL_TEXTURE_3D);
manager_->SetLevelInfo(texture_ref_.get(), GL_TEXTURE_3D, 1, GL_RGBA, 4, 5, 6,
@@ -891,57 +1016,40 @@ TEST_F(TextureTest, ValidForTexture) {
// Check bad face.
Texture* texture = texture_ref_->texture();
EXPECT_FALSE(texture->ValidForTexture(
- GL_TEXTURE_CUBE_MAP_NEGATIVE_Z,
- 1, 0, 0, 0, 4, 5, 6, GL_UNSIGNED_BYTE));
+ GL_TEXTURE_CUBE_MAP_NEGATIVE_Z, 1, 0, 0, 0, 4, 5, 6));
// Check bad level.
- EXPECT_FALSE(texture->ValidForTexture(
- GL_TEXTURE_2D, 0, 0, 0, 0, 4, 5, 6, GL_UNSIGNED_BYTE));
+ EXPECT_FALSE(texture->ValidForTexture(GL_TEXTURE_2D, 0, 0, 0, 0, 4, 5, 6));
// Check bad xoffset.
- EXPECT_FALSE(texture->ValidForTexture(
- GL_TEXTURE_2D, 1, -1, 0, 0, 4, 5, 6, GL_UNSIGNED_BYTE));
+ EXPECT_FALSE(texture->ValidForTexture(GL_TEXTURE_2D, 1, -1, 0, 0, 4, 5, 6));
// Check bad xoffset + width > width.
- EXPECT_FALSE(texture->ValidForTexture(
- GL_TEXTURE_2D, 1, 1, 0, 0, 4, 5, 6, GL_UNSIGNED_BYTE));
+ EXPECT_FALSE(texture->ValidForTexture(GL_TEXTURE_2D, 1, 1, 0, 0, 4, 5, 6));
// Check bad yoffset.
- EXPECT_FALSE(texture->ValidForTexture(
- GL_TEXTURE_2D, 1, 0, -1, 0, 4, 5, 6, GL_UNSIGNED_BYTE));
+ EXPECT_FALSE(texture->ValidForTexture(GL_TEXTURE_2D, 1, 0, -1, 0, 4, 5, 6));
// Check bad yoffset + height > height.
- EXPECT_FALSE(texture->ValidForTexture(
- GL_TEXTURE_2D, 1, 0, 1, 0, 4, 5, 6, GL_UNSIGNED_BYTE));
+ EXPECT_FALSE(texture->ValidForTexture(GL_TEXTURE_2D, 1, 0, 1, 0, 4, 5, 6));
// Check bad zoffset.
- EXPECT_FALSE(texture->ValidForTexture(
- GL_TEXTURE_2D, 1, 0, 0, -1, 4, 5, 6, GL_UNSIGNED_BYTE));
+ EXPECT_FALSE(texture->ValidForTexture(GL_TEXTURE_2D, 1, 0, 0, -1, 4, 5, 6));
// Check bad zoffset + depth > depth.
- EXPECT_FALSE(texture->ValidForTexture(
- GL_TEXTURE_2D, 1, 0, 0, 1, 4, 5, 6, GL_UNSIGNED_BYTE));
+ EXPECT_FALSE(texture->ValidForTexture(GL_TEXTURE_2D, 1, 0, 0, 1, 4, 5, 6));
// Check bad width.
- EXPECT_FALSE(texture->ValidForTexture(
- GL_TEXTURE_2D, 1, 0, 0, 0, 5, 5, 6, GL_UNSIGNED_BYTE));
+ EXPECT_FALSE(texture->ValidForTexture(GL_TEXTURE_2D, 1, 0, 0, 0, 5, 5, 6));
// Check bad height.
- EXPECT_FALSE(texture->ValidForTexture(
- GL_TEXTURE_2D, 1, 0, 0, 0, 4, 6, 6, GL_UNSIGNED_BYTE));
+ EXPECT_FALSE(texture->ValidForTexture(GL_TEXTURE_2D, 1, 0, 0, 0, 4, 6, 6));
// Check bad depth.
- EXPECT_FALSE(texture->ValidForTexture(
- GL_TEXTURE_2D, 1, 0, 0, 0, 4, 5, 7, GL_UNSIGNED_BYTE));
- // Check bad type.
- EXPECT_FALSE(texture->ValidForTexture(
- GL_TEXTURE_2D, 1, 0, 0, 0, 4, 5, 6, GL_UNSIGNED_SHORT_4_4_4_4));
+ EXPECT_FALSE(texture->ValidForTexture(GL_TEXTURE_2D, 1, 0, 0, 0, 4, 5, 7));
// Check valid full size
- EXPECT_TRUE(texture->ValidForTexture(
- GL_TEXTURE_2D, 1, 0, 0, 0, 4, 5, 6, GL_UNSIGNED_BYTE));
+ EXPECT_TRUE(texture->ValidForTexture(GL_TEXTURE_2D, 1, 0, 0, 0, 4, 5, 6));
// Check valid particial size.
- EXPECT_TRUE(texture->ValidForTexture(
- GL_TEXTURE_2D, 1, 1, 1, 1, 2, 3, 4, GL_UNSIGNED_BYTE));
+ EXPECT_TRUE(texture->ValidForTexture(GL_TEXTURE_2D, 1, 1, 1, 1, 2, 3, 4));
manager_->RemoveTexture(kClient1Id);
- EXPECT_TRUE(texture->ValidForTexture(
- GL_TEXTURE_2D, 1, 0, 0, 0, 4, 5, 6, GL_UNSIGNED_BYTE));
+ EXPECT_TRUE(texture->ValidForTexture(GL_TEXTURE_2D, 1, 0, 0, 0, 4, 5, 6));
}
TEST_F(TextureTest, FloatNotLinear) {
TestHelper::SetupFeatureInfoInitExpectations(
gl_.get(), "GL_OES_texture_float");
scoped_refptr<FeatureInfo> feature_info(new FeatureInfo());
- feature_info->Initialize();
+ feature_info->InitializeForTesting();
TextureManager manager(NULL,
feature_info.get(),
kMaxTextureSize,
@@ -973,7 +1081,7 @@ TEST_F(TextureTest, FloatLinear) {
TestHelper::SetupFeatureInfoInitExpectations(
gl_.get(), "GL_OES_texture_float GL_OES_texture_float_linear");
scoped_refptr<FeatureInfo> feature_info(new FeatureInfo());
- feature_info->Initialize();
+ feature_info->InitializeForTesting();
TextureManager manager(NULL,
feature_info.get(),
kMaxTextureSize,
@@ -997,7 +1105,7 @@ TEST_F(TextureTest, HalfFloatNotLinear) {
TestHelper::SetupFeatureInfoInitExpectations(
gl_.get(), "GL_OES_texture_half_float");
scoped_refptr<FeatureInfo> feature_info(new FeatureInfo());
- feature_info->Initialize();
+ feature_info->InitializeForTesting();
TextureManager manager(NULL,
feature_info.get(),
kMaxTextureSize,
@@ -1029,7 +1137,7 @@ TEST_F(TextureTest, HalfFloatLinear) {
TestHelper::SetupFeatureInfoInitExpectations(
gl_.get(), "GL_OES_texture_half_float GL_OES_texture_half_float_linear");
scoped_refptr<FeatureInfo> feature_info(new FeatureInfo());
- feature_info->Initialize();
+ feature_info->InitializeForTesting();
TextureManager manager(NULL,
feature_info.get(),
kMaxTextureSize,
@@ -1053,7 +1161,7 @@ TEST_F(TextureTest, EGLImageExternal) {
TestHelper::SetupFeatureInfoInitExpectations(
gl_.get(), "GL_OES_EGL_image_external");
scoped_refptr<FeatureInfo> feature_info(new FeatureInfo());
- feature_info->Initialize();
+ feature_info->InitializeForTesting();
TextureManager manager(NULL,
feature_info.get(),
kMaxTextureSize,
@@ -1075,7 +1183,7 @@ TEST_F(TextureTest, DepthTexture) {
TestHelper::SetupFeatureInfoInitExpectations(
gl_.get(), "GL_ANGLE_depth_texture");
scoped_refptr<FeatureInfo> feature_info(new FeatureInfo());
- feature_info->Initialize();
+ feature_info->InitializeForTesting();
TextureManager manager(NULL,
feature_info.get(),
kMaxTextureSize,
@@ -1714,6 +1822,12 @@ class CountingMemoryTracker : public MemoryTracker {
return current_size_[pool];
}
+ uint64_t ClientTracingId() const override { return 0; }
+
+ int ClientId() const override { return 0; }
+
+ uint64_t ShareGroupTracingGUID() const override { return 0; }
+
private:
~CountingMemoryTracker() override {}
@@ -1750,10 +1864,10 @@ class SharedTextureTest : public GpuServiceTest {
TextureManagerTest::kMax3DTextureSize,
kUseDefaultTextures));
TestHelper::SetupTextureManagerInitExpectations(
- gl_.get(), "", kUseDefaultTextures);
+ gl_.get(), false, "", kUseDefaultTextures);
texture_manager1_->Initialize();
TestHelper::SetupTextureManagerInitExpectations(
- gl_.get(), "", kUseDefaultTextures);
+ gl_.get(), false, "", kUseDefaultTextures);
texture_manager2_->Initialize();
}
@@ -1848,9 +1962,11 @@ TEST_F(SharedTextureTest, TextureSafetyAccounting) {
TEST_F(SharedTextureTest, FBOCompletenessCheck) {
const GLenum kCompleteValue = GL_FRAMEBUFFER_COMPLETE;
- FramebufferManager framebuffer_manager1(1, 1);
+ FramebufferManager framebuffer_manager1(1, 1, CONTEXT_TYPE_OPENGLES2,
+ nullptr);
texture_manager1_->set_framebuffer_manager(&framebuffer_manager1);
- FramebufferManager framebuffer_manager2(1, 1);
+ FramebufferManager framebuffer_manager2(1, 1, CONTEXT_TYPE_OPENGLES2,
+ nullptr);
texture_manager2_->set_framebuffer_manager(&framebuffer_manager2);
scoped_refptr<TextureRef> ref1 = texture_manager1_->CreateTexture(10, 10);
@@ -1996,12 +2112,6 @@ class TextureFormatTypeValidationTest : public TextureManagerTest {
~TextureFormatTypeValidationTest() override {}
protected:
- void SetupFeatureInfo(const char* gl_extensions, const char* gl_version) {
- TestHelper::SetupFeatureInfoInitExpectationsWithGLVersion(
- gl_.get(), gl_extensions, "", gl_version);
- feature_info_->Initialize();
- }
-
void ExpectValid(GLenum format, GLenum type, GLenum internal_format) {
EXPECT_TRUE(manager_->ValidateTextureParameters(
error_state_.get(), "", format, type, internal_format, 0));
@@ -2027,7 +2137,7 @@ class TextureFormatTypeValidationTest : public TextureManagerTest {
};
TEST_F(TextureFormatTypeValidationTest, ES2Basic) {
- SetupFeatureInfo("", "OpenGL ES 2.0");
+ SetupFeatureInfo("", "OpenGL ES 2.0", false);
ExpectValid(GL_ALPHA, GL_UNSIGNED_BYTE, GL_ALPHA);
ExpectValid(GL_RGB, GL_UNSIGNED_SHORT_5_6_5, GL_RGB);
@@ -2056,26 +2166,20 @@ TEST_F(TextureFormatTypeValidationTest, ES2Basic) {
ExpectInvalidEnum(GL_RGB, GL_UNSIGNED_BYTE, GL_RGB8);
}
-TEST_F(TextureFormatTypeValidationTest, ES2WithExtBGRA) {
- SetupFeatureInfo("GL_EXT_bgra", "OpenGL ES 2.0");
-
- ExpectValid(GL_BGRA_EXT, GL_UNSIGNED_BYTE, GL_BGRA_EXT);
-}
-
TEST_F(TextureFormatTypeValidationTest, ES2WithExtTextureFormatBGRA8888) {
- SetupFeatureInfo("GL_EXT_texture_format_BGRA8888", "OpenGL ES 2.0");
+ SetupFeatureInfo("GL_EXT_texture_format_BGRA8888", "OpenGL ES 2.0", false);
ExpectValid(GL_BGRA_EXT, GL_UNSIGNED_BYTE, GL_BGRA_EXT);
}
TEST_F(TextureFormatTypeValidationTest, ES2WithAppleTextureFormatBGRA8888) {
- SetupFeatureInfo("GL_APPLE_texture_format_BGRA8888", "OpenGL ES 2.0");
+ SetupFeatureInfo("GL_APPLE_texture_format_BGRA8888", "OpenGL ES 2.0", false);
ExpectValid(GL_BGRA_EXT, GL_UNSIGNED_BYTE, GL_BGRA_EXT);
}
TEST_F(TextureFormatTypeValidationTest, ES2WithArbDepth) {
- SetupFeatureInfo("GL_ARB_depth_texture", "OpenGL ES 2.0");
+ SetupFeatureInfo("GL_ARB_depth_texture", "OpenGL ES 2.0", false);
ExpectValid(GL_DEPTH_COMPONENT, GL_UNSIGNED_SHORT, GL_DEPTH_COMPONENT);
ExpectValid(GL_DEPTH_COMPONENT, GL_UNSIGNED_INT, GL_DEPTH_COMPONENT);
@@ -2083,7 +2187,7 @@ TEST_F(TextureFormatTypeValidationTest, ES2WithArbDepth) {
}
TEST_F(TextureFormatTypeValidationTest, ES2WithOesDepth) {
- SetupFeatureInfo("GL_OES_depth_texture", "OpenGL ES 2.0");
+ SetupFeatureInfo("GL_OES_depth_texture", "OpenGL ES 2.0", false);
ExpectValid(GL_DEPTH_COMPONENT, GL_UNSIGNED_SHORT, GL_DEPTH_COMPONENT);
ExpectValid(GL_DEPTH_COMPONENT, GL_UNSIGNED_INT, GL_DEPTH_COMPONENT);
@@ -2091,7 +2195,7 @@ TEST_F(TextureFormatTypeValidationTest, ES2WithOesDepth) {
}
TEST_F(TextureFormatTypeValidationTest, ES2WithAngleDepth) {
- SetupFeatureInfo("GL_ANGLE_depth_texture", "OpenGL ES 2.0");
+ SetupFeatureInfo("GL_ANGLE_depth_texture", "OpenGL ES 2.0", false);
ExpectValid(GL_DEPTH_COMPONENT, GL_UNSIGNED_SHORT, GL_DEPTH_COMPONENT);
ExpectValid(GL_DEPTH_COMPONENT, GL_UNSIGNED_INT, GL_DEPTH_COMPONENT);
@@ -2100,7 +2204,9 @@ TEST_F(TextureFormatTypeValidationTest, ES2WithAngleDepth) {
TEST_F(TextureFormatTypeValidationTest, ES2WithExtPackedDepthStencil) {
SetupFeatureInfo(
- "GL_EXT_packed_depth_stencil GL_ARB_depth_texture", "OpenGL ES 2.0");
+ "GL_EXT_packed_depth_stencil GL_ARB_depth_texture",
+ "OpenGL ES 2.0",
+ false);
ExpectValid(GL_DEPTH_COMPONENT, GL_UNSIGNED_SHORT, GL_DEPTH_COMPONENT);
ExpectValid(GL_DEPTH_COMPONENT, GL_UNSIGNED_INT, GL_DEPTH_COMPONENT);
@@ -2110,7 +2216,8 @@ TEST_F(TextureFormatTypeValidationTest, ES2WithExtPackedDepthStencil) {
TEST_F(TextureFormatTypeValidationTest, ES2WithRGWithFloat) {
SetupFeatureInfo(
"GL_EXT_texture_rg GL_OES_texture_float GL_OES_texture_half_float",
- "OpenGL ES 2.0");
+ "OpenGL ES 2.0",
+ false);
ExpectValid(GL_RED_EXT, GL_HALF_FLOAT_OES, GL_RED_EXT);
ExpectValid(GL_RG_EXT, GL_HALF_FLOAT_OES, GL_RG_EXT);
@@ -2124,7 +2231,7 @@ TEST_F(TextureFormatTypeValidationTest, ES2WithRGWithFloat) {
}
TEST_F(TextureFormatTypeValidationTest, ES2WithRGNoFloat) {
- SetupFeatureInfo("GL_ARB_texture_rg", "OpenGL ES 2.0");
+ SetupFeatureInfo("GL_ARB_texture_rg", "OpenGL ES 2.0", false);
ExpectValid(GL_RED_EXT, GL_UNSIGNED_BYTE, GL_RED_EXT);
ExpectValid(GL_RG_EXT, GL_UNSIGNED_BYTE, GL_RG_EXT);
@@ -2134,7 +2241,7 @@ TEST_F(TextureFormatTypeValidationTest, ES2WithRGNoFloat) {
}
TEST_F(TextureFormatTypeValidationTest, ES2OnTopOfES3) {
- SetupFeatureInfo("", "OpenGL ES 3.0");
+ SetupFeatureInfo("", "OpenGL ES 3.0", false);
ExpectInvalidEnum(GL_RGB, GL_FLOAT, GL_RGB);
ExpectInvalidEnum(GL_RGBA, GL_FLOAT, GL_RGBA);
@@ -2147,7 +2254,7 @@ TEST_F(TextureFormatTypeValidationTest, ES2OnTopOfES3) {
}
TEST_F(TextureFormatTypeValidationTest, ES2WithOesTextureFloat) {
- SetupFeatureInfo("GL_OES_texture_float", "OpenGL ES 2.0");
+ SetupFeatureInfo("GL_OES_texture_float", "OpenGL ES 2.0", false);
ExpectValid(GL_RGB, GL_FLOAT, GL_RGB);
ExpectValid(GL_RGBA, GL_FLOAT, GL_RGBA);
@@ -2164,7 +2271,9 @@ TEST_F(TextureFormatTypeValidationTest, ES2WithOesTextureFloat) {
TEST_F(TextureFormatTypeValidationTest, ES2WithOesTextureFloatLinear) {
SetupFeatureInfo(
- "GL_OES_texture_float GL_OES_texture_float_linear", "OpenGL ES 2.0");
+ "GL_OES_texture_float GL_OES_texture_float_linear",
+ "OpenGL ES 2.0",
+ false);
ExpectValid(GL_RGB, GL_FLOAT, GL_RGB);
ExpectValid(GL_RGBA, GL_FLOAT, GL_RGBA);
@@ -2180,7 +2289,7 @@ TEST_F(TextureFormatTypeValidationTest, ES2WithOesTextureFloatLinear) {
}
TEST_F(TextureFormatTypeValidationTest, ES2WithOesTextureHalfFloat) {
- SetupFeatureInfo("GL_OES_texture_half_float", "OpenGL ES 2.0");
+ SetupFeatureInfo("GL_OES_texture_half_float", "OpenGL ES 2.0", false);
ExpectValid(GL_RGB, GL_HALF_FLOAT_OES, GL_RGB);
ExpectValid(GL_RGBA, GL_HALF_FLOAT_OES, GL_RGBA);
@@ -2198,7 +2307,8 @@ TEST_F(TextureFormatTypeValidationTest, ES2WithOesTextureHalfFloat) {
TEST_F(TextureFormatTypeValidationTest, ES2WithOesTextureHalfFloatLinear) {
SetupFeatureInfo(
"GL_OES_texture_half_float GL_OES_texture_half_float_linear",
- "OpenGL ES 2.0");
+ "OpenGL ES 2.0",
+ false);
ExpectValid(GL_RGB, GL_HALF_FLOAT_OES, GL_RGB);
ExpectValid(GL_RGBA, GL_HALF_FLOAT_OES, GL_RGBA);
@@ -2214,14 +2324,7 @@ TEST_F(TextureFormatTypeValidationTest, ES2WithOesTextureHalfFloatLinear) {
}
TEST_F(TextureFormatTypeValidationTest, ES3Basic) {
- SetupFeatureInfo("", "OpenGL ES 3.0");
- EXPECT_CALL(*gl_, GetIntegerv(GL_MAX_COLOR_ATTACHMENTS, _))
- .WillOnce(SetArgPointee<1>(8))
- .RetiresOnSaturation();
- EXPECT_CALL(*gl_, GetIntegerv(GL_MAX_DRAW_BUFFERS, _))
- .WillOnce(SetArgPointee<1>(8))
- .RetiresOnSaturation();
- feature_info_->EnableES3Validators();
+ SetupFeatureInfo("", "OpenGL ES 3.0", true);
ExpectValid(GL_ALPHA, GL_UNSIGNED_BYTE, GL_ALPHA);
ExpectValid(GL_RGB, GL_UNSIGNED_SHORT_5_6_5, GL_RGB);
diff --git a/chromium/gpu/command_buffer/service/transfer_buffer_manager.cc b/chromium/gpu/command_buffer/service/transfer_buffer_manager.cc
index e9c83e01d00..fa7c83c759c 100644
--- a/chromium/gpu/command_buffer/service/transfer_buffer_manager.cc
+++ b/chromium/gpu/command_buffer/service/transfer_buffer_manager.cc
@@ -9,9 +9,15 @@
#include "base/logging.h"
#include "base/memory/scoped_ptr.h"
#include "base/process/process_handle.h"
+#include "base/strings/stringprintf.h"
+#include "base/thread_task_runner_handle.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"
#include "base/trace_event/trace_event.h"
#include "gpu/command_buffer/common/cmd_buffer_common.h"
#include "gpu/command_buffer/common/gles2_cmd_utils.h"
+#include "gpu/command_buffer/service/memory_tracking.h"
using ::base::SharedMemory;
@@ -20,9 +26,9 @@ namespace gpu {
TransferBufferManagerInterface::~TransferBufferManagerInterface() {
}
-TransferBufferManager::TransferBufferManager()
- : shared_memory_bytes_allocated_(0) {
-}
+TransferBufferManager::TransferBufferManager(
+ gles2::MemoryTracker* memory_tracker)
+ : shared_memory_bytes_allocated_(0), memory_tracker_(memory_tracker) {}
TransferBufferManager::~TransferBufferManager() {
while (!registered_buffers_.empty()) {
@@ -32,9 +38,18 @@ TransferBufferManager::~TransferBufferManager() {
registered_buffers_.erase(it);
}
DCHECK(!shared_memory_bytes_allocated_);
+
+ base::trace_event::MemoryDumpManager::GetInstance()->UnregisterDumpProvider(
+ this);
}
bool TransferBufferManager::Initialize() {
+ // When created from InProcessCommandBuffer, we won't have a |memory_tracker_|
+ // so don't register a dump provider.
+ if (memory_tracker_) {
+ base::trace_event::MemoryDumpManager::GetInstance()->RegisterDumpProvider(
+ this, base::ThreadTaskRunnerHandle::Get());
+ }
return true;
}
@@ -60,8 +75,6 @@ bool TransferBufferManager::RegisterTransferBuffer(
(kCommandBufferEntrySize - 1)));
shared_memory_bytes_allocated_ += buffer->size();
- TRACE_COUNTER_ID1(
- "gpu", "GpuTransferBufferMemory", this, shared_memory_bytes_allocated_);
registered_buffers_[id] = buffer;
@@ -77,8 +90,6 @@ void TransferBufferManager::DestroyTransferBuffer(int32 id) {
DCHECK(shared_memory_bytes_allocated_ >= it->second->size());
shared_memory_bytes_allocated_ -= it->second->size();
- TRACE_COUNTER_ID1(
- "gpu", "GpuTransferBufferMemory", this, shared_memory_bytes_allocated_);
registered_buffers_.erase(it);
}
@@ -94,5 +105,28 @@ scoped_refptr<Buffer> TransferBufferManager::GetTransferBuffer(int32 id) {
return it->second;
}
+bool TransferBufferManager::OnMemoryDump(
+ const base::trace_event::MemoryDumpArgs& args,
+ base::trace_event::ProcessMemoryDump* pmd) {
+ for (const auto& buffer_entry : registered_buffers_) {
+ int32 buffer_id = buffer_entry.first;
+ const Buffer* buffer = buffer_entry.second.get();
+ std::string dump_name =
+ base::StringPrintf("gpu/transfer_memory/client_%d/buffer_%d",
+ memory_tracker_->ClientId(), buffer_id);
+ base::trace_event::MemoryAllocatorDump* dump =
+ pmd->CreateAllocatorDump(dump_name);
+ dump->AddScalar(base::trace_event::MemoryAllocatorDump::kNameSize,
+ base::trace_event::MemoryAllocatorDump::kUnitsBytes,
+ buffer->size());
+ auto guid =
+ GetBufferGUIDForTracing(memory_tracker_->ClientTracingId(), buffer_id);
+ pmd->CreateSharedGlobalAllocatorDump(guid);
+ pmd->AddOwnershipEdge(dump->guid(), guid);
+ }
+
+ return true;
+}
+
} // namespace gpu
diff --git a/chromium/gpu/command_buffer/service/transfer_buffer_manager.h b/chromium/gpu/command_buffer/service/transfer_buffer_manager.h
index 8fae98c911f..a23f7c72554 100644
--- a/chromium/gpu/command_buffer/service/transfer_buffer_manager.h
+++ b/chromium/gpu/command_buffer/service/transfer_buffer_manager.h
@@ -12,10 +12,13 @@
#include "base/compiler_specific.h"
#include "base/containers/hash_tables.h"
#include "base/memory/ref_counted.h"
-#include "base/memory/shared_memory.h"
+#include "base/trace_event/memory_dump_provider.h"
#include "gpu/command_buffer/common/command_buffer_shared.h"
namespace gpu {
+namespace gles2 {
+class MemoryTracker;
+}
class GPU_EXPORT TransferBufferManagerInterface :
public base::RefCounted<TransferBufferManagerInterface> {
@@ -32,9 +35,14 @@ class GPU_EXPORT TransferBufferManagerInterface :
};
class GPU_EXPORT TransferBufferManager
- : public TransferBufferManagerInterface {
+ : public TransferBufferManagerInterface,
+ public base::trace_event::MemoryDumpProvider {
public:
- TransferBufferManager();
+ explicit TransferBufferManager(gles2::MemoryTracker* memory_tracker);
+
+ // Overridden from base::trace_event::MemoryDumpProvider:
+ bool OnMemoryDump(const base::trace_event::MemoryDumpArgs& args,
+ base::trace_event::ProcessMemoryDump* pmd) override;
bool Initialize();
bool RegisterTransferBuffer(
@@ -49,6 +57,7 @@ class GPU_EXPORT TransferBufferManager
typedef base::hash_map<int32, scoped_refptr<Buffer> > BufferMap;
BufferMap registered_buffers_;
size_t shared_memory_bytes_allocated_;
+ gles2::MemoryTracker* memory_tracker_;
DISALLOW_COPY_AND_ASSIGN(TransferBufferManager);
};
diff --git a/chromium/gpu/command_buffer/service/transfer_buffer_manager_unittest.cc b/chromium/gpu/command_buffer/service/transfer_buffer_manager_unittest.cc
index 5dbcfa140d3..cf88bed42fa 100644
--- a/chromium/gpu/command_buffer/service/transfer_buffer_manager_unittest.cc
+++ b/chromium/gpu/command_buffer/service/transfer_buffer_manager_unittest.cc
@@ -17,7 +17,7 @@ const static size_t kBufferSize = 1024;
class TransferBufferManagerTest : public testing::Test {
protected:
void SetUp() override {
- TransferBufferManager* manager = new TransferBufferManager();
+ TransferBufferManager* manager = new TransferBufferManager(nullptr);
transfer_buffer_manager_ = manager;
ASSERT_TRUE(manager->Initialize());
}
diff --git a/chromium/gpu/command_buffer/service/vertex_attrib_manager.cc b/chromium/gpu/command_buffer/service/vertex_attrib_manager.cc
index f0714f10d81..7d2752fe00d 100644
--- a/chromium/gpu/command_buffer/service/vertex_attrib_manager.cc
+++ b/chromium/gpu/command_buffer/service/vertex_attrib_manager.cc
@@ -195,8 +195,8 @@ bool VertexAttribManager::ValidateBindings(
ERRORSTATE_SET_GL_ERROR(
error_state, GL_INVALID_OPERATION, function_name,
(std::string(
- "attempt to access out of range vertices in attribute ") +
- base::IntToString(attrib->index())).c_str());
+ "attempt to access out of range vertices in attribute ") +
+ base::UintToString(attrib->index())).c_str());
return false;
}
if (use_client_side_arrays_for_stream_buffers) {
@@ -242,7 +242,7 @@ bool VertexAttribManager::ValidateBindings(
(std::string(
"attempt to render with no buffer attached to "
"enabled attribute ") +
- base::IntToString(attrib->index())).c_str());
+ base::UintToString(attrib->index())).c_str());
return false;
} else if (use_client_side_arrays_for_stream_buffers) {
Buffer* buffer = attrib->buffer();
diff --git a/chromium/gpu/command_buffer_service.gypi b/chromium/gpu/command_buffer_service.gypi
index af077f156ff..4735332f0da 100644
--- a/chromium/gpu/command_buffer_service.gypi
+++ b/chromium/gpu/command_buffer_service.gypi
@@ -22,25 +22,10 @@
'../ui/gfx/gfx.gyp:gfx',
'../ui/gfx/gfx.gyp:gfx_geometry',
'../ui/gl/gl.gyp:gl',
+ '<(angle_path)/src/angle.gyp:commit_id',
'<(angle_path)/src/angle.gyp:translator',
],
'sources': [
- 'command_buffer/service/async_pixel_transfer_delegate.cc',
- 'command_buffer/service/async_pixel_transfer_delegate.h',
- 'command_buffer/service/async_pixel_transfer_manager.cc',
- 'command_buffer/service/async_pixel_transfer_manager.h',
- 'command_buffer/service/async_pixel_transfer_manager_android.cc',
- 'command_buffer/service/async_pixel_transfer_manager_idle.cc',
- 'command_buffer/service/async_pixel_transfer_manager_idle.h',
- 'command_buffer/service/async_pixel_transfer_manager_linux.cc',
- 'command_buffer/service/async_pixel_transfer_manager_mac.cc',
- 'command_buffer/service/async_pixel_transfer_manager_share_group.cc',
- 'command_buffer/service/async_pixel_transfer_manager_share_group.h',
- 'command_buffer/service/async_pixel_transfer_manager_stub.cc',
- 'command_buffer/service/async_pixel_transfer_manager_stub.h',
- 'command_buffer/service/async_pixel_transfer_manager_sync.cc',
- 'command_buffer/service/async_pixel_transfer_manager_sync.h',
- 'command_buffer/service/async_pixel_transfer_manager_win.cc',
'command_buffer/service/buffer_manager.cc',
'command_buffer/service/buffer_manager.h',
'command_buffer/service/cmd_buffer_engine.h',
@@ -60,6 +45,8 @@
'command_buffer/service/error_state.h',
'command_buffer/service/feature_info.cc',
'command_buffer/service/feature_info.h',
+ "command_buffer/service/framebuffer_completeness_cache.cc",
+ "command_buffer/service/framebuffer_completeness_cache.h",
'command_buffer/service/framebuffer_manager.cc',
'command_buffer/service/framebuffer_manager.h',
'command_buffer/service/gl_context_virtual.cc',
@@ -96,6 +83,7 @@
'command_buffer/service/in_process_command_buffer.h',
'command_buffer/service/logger.cc',
'command_buffer/service/logger.h',
+ 'command_buffer/service/mailbox_manager.cc',
'command_buffer/service/mailbox_manager.h',
'command_buffer/service/mailbox_manager_impl.cc',
'command_buffer/service/mailbox_manager_impl.h',
@@ -106,6 +94,8 @@
'command_buffer/service/mocks.h',
'command_buffer/service/program_cache.cc',
'command_buffer/service/program_cache.h',
+ 'command_buffer/service/path_manager.cc',
+ 'command_buffer/service/path_manager.h',
'command_buffer/service/program_manager.cc',
'command_buffer/service/program_manager.h',
'command_buffer/service/query_manager.cc',
@@ -150,11 +140,5 @@
],
},
}],
- ['OS in ("win", "android") or (OS == "linux" and use_x11 == 1)', {
- 'sources': [
- 'command_buffer/service/async_pixel_transfer_manager_egl.cc',
- 'command_buffer/service/async_pixel_transfer_manager_egl.h',
- ],
- }],
],
}
diff --git a/chromium/gpu/config/BUILD.gn b/chromium/gpu/config/BUILD.gn
index 1300ccacf73..951731984ed 100644
--- a/chromium/gpu/config/BUILD.gn
+++ b/chromium/gpu/config/BUILD.gn
@@ -7,7 +7,7 @@ import("//build/config/ui.gni")
declare_args() {
# Use the PCI lib to collect GPU information on Linux.
- use_libpci = true
+ use_libpci = !is_chromecast
}
group("config") {
@@ -23,7 +23,10 @@ group("config") {
}
source_set("config_sources") {
- visibility = [ "//gpu/*" ]
+ visibility = [
+ "//components/mus/gles2:*",
+ "//gpu/*",
+ ]
sources = [
"dx_diag_node.cc",
@@ -94,7 +97,7 @@ source_set("config_sources") {
defines = [ "USE_LIBPCI=1" ]
}
if (is_linux && use_libpci && (use_x11 || use_ozone)) {
- deps += [ "//build/config/linux:libpci" ]
+ deps += [ "//build/linux:libpci" ]
}
if (is_linux && use_x11) {
configs += [
diff --git a/chromium/gpu/config/gpu_blacklist_unittest.cc b/chromium/gpu/config/gpu_blacklist_unittest.cc
index 1a3deb6dc22..1c7211e6d01 100644
--- a/chromium/gpu/config/gpu_blacklist_unittest.cc
+++ b/chromium/gpu/config/gpu_blacklist_unittest.cc
@@ -23,8 +23,8 @@ class GpuBlacklistTest : public testing::Test {
return gpu_info_;
}
- void RunFeatureTest(
- const std::string feature_name, GpuFeatureType feature_type) {
+ void RunFeatureTest(const std::string& feature_name,
+ GpuFeatureType feature_type) {
const std::string json =
"{\n"
" \"name\": \"gpu blacklist\",\n"
diff --git a/chromium/gpu/config/gpu_control_list.cc b/chromium/gpu/config/gpu_control_list.cc
index e187b5fc4c8..2e44e3db50c 100644
--- a/chromium/gpu/config/gpu_control_list.cc
+++ b/chromium/gpu/config/gpu_control_list.cc
@@ -25,7 +25,9 @@ bool ProcessVersionString(const std::string& version_string,
char splitter,
std::vector<std::string>* version) {
DCHECK(version);
- base::SplitString(version_string, splitter, version);
+ *version = base::SplitString(
+ version_string, std::string(1, splitter),
+ base::TRIM_WHITESPACE, base::SPLIT_WANT_ALL);
if (version->size() == 0)
return false;
// If the splitter is '-', we assume it's a date with format "mm-dd-yyyy";
@@ -723,6 +725,12 @@ GpuControlList::GpuControlListEntry::GetEntryFromValue(
dictionary_entry_count++;
}
+ bool in_process_gpu;
+ if (value->GetBoolean("in_process_gpu", &in_process_gpu)) {
+ entry->SetInProcessGPUInfo(in_process_gpu);
+ dictionary_entry_count++;
+ }
+
if (top_level) {
const base::ListValue* feature_value = NULL;
if (value->GetList("features", &feature_value)) {
@@ -980,6 +988,10 @@ void GpuControlList::GpuControlListEntry::SetDirectRenderingInfo(bool value) {
direct_rendering_info_.reset(new BoolInfo(value));
}
+void GpuControlList::GpuControlListEntry::SetInProcessGPUInfo(bool value) {
+ in_process_gpu_info_.reset(new BoolInfo(value));
+}
+
bool GpuControlList::GpuControlListEntry::SetFeatures(
const std::vector<std::string>& feature_strings,
const FeatureMap& feature_map,
@@ -1018,8 +1030,8 @@ bool GpuControlList::GpuControlListEntry::GLVersionInfoMismatch(
if (gl_version_info_.get() == NULL && gl_type_ == kGLTypeNone)
return false;
- std::vector<std::string> segments;
- base::SplitString(gl_version, ' ', &segments);
+ std::vector<std::string> segments = base::SplitString(
+ gl_version, " ", base::TRIM_WHITESPACE, base::SPLIT_WANT_ALL);
std::string number;
GLType gl_type = kGLTypeNone;
if (segments.size() > 2 &&
@@ -1029,7 +1041,8 @@ bool GpuControlList::GpuControlListEntry::GLVersionInfoMismatch(
gl_type = kGLTypeGLES;
if (segments.size() > 3 &&
- base::StartsWithASCII(segments[3], "(ANGLE", false)) {
+ base::StartsWith(segments[3], "(ANGLE",
+ base::CompareCase::INSENSITIVE_ASCII)) {
gl_type = kGLTypeANGLE;
}
} else {
@@ -1242,6 +1255,9 @@ bool GpuControlList::GpuControlListEntry::Contains(
if (direct_rendering_info_.get() != NULL &&
!direct_rendering_info_->Contains(gpu_info.direct_rendering))
return false;
+ if (in_process_gpu_info_.get() != NULL &&
+ !in_process_gpu_info_->Contains(gpu_info.in_process_gpu))
+ return false;
if (!cpu_brand_.empty()) {
base::CPU cpu_info;
if (StringMismatch(cpu_info.cpu_brand(), cpu_brand_))
diff --git a/chromium/gpu/config/gpu_control_list.h b/chromium/gpu/config/gpu_control_list.h
index 32494154bf4..ea9252aee98 100644
--- a/chromium/gpu/config/gpu_control_list.h
+++ b/chromium/gpu/config/gpu_control_list.h
@@ -11,7 +11,6 @@
#include "base/basictypes.h"
#include "base/containers/hash_tables.h"
-#include "base/gtest_prod_util.h"
#include "base/memory/ref_counted.h"
#include "base/memory/scoped_ptr.h"
#include "base/values.h"
@@ -400,6 +399,7 @@ class GPU_EXPORT GpuControlList {
const std::string& int_string2);
void SetDirectRenderingInfo(bool value);
+ void SetInProcessGPUInfo(bool value);
bool SetFeatures(const std::vector<std::string>& features,
const FeatureMap& feature_map,
@@ -456,6 +456,7 @@ class GPU_EXPORT GpuControlList {
scoped_ptr<VersionInfo> machine_model_version_info_;
scoped_ptr<IntInfo> gpu_count_info_;
scoped_ptr<BoolInfo> direct_rendering_info_;
+ scoped_ptr<BoolInfo> in_process_gpu_info_;
std::set<int> features_;
std::vector<ScopedGpuControlListEntry> exceptions_;
};
diff --git a/chromium/gpu/config/gpu_control_list_unittest.cc b/chromium/gpu/config/gpu_control_list_unittest.cc
index 88452fccdce..402998bfce1 100644
--- a/chromium/gpu/config/gpu_control_list_unittest.cc
+++ b/chromium/gpu/config/gpu_control_list_unittest.cc
@@ -627,4 +627,39 @@ TEST_F(GpuControlListTest, DisabledExtensionTest) {
ASSERT_STREQ("test_extension3", disabled_extensions[2].c_str());
}
+TEST_F(GpuControlListTest, DisabledInProcessGPUTest) {
+ const std::string exact_list_json = LONG_STRING_CONST(
+ {
+ "name": "gpu control list",
+ "version": "0.1",
+ "entries": [
+ {
+ "id": 1,
+ "os": {
+ "type": "win"
+ },
+ "in_process_gpu": true,
+ "features": [
+ "test_feature_0"
+ ]
+ }
+ ]
+ }
+ );
+ scoped_ptr<GpuControlList> control_list(Create());
+
+ EXPECT_TRUE(control_list->LoadList(exact_list_json, GpuControlList::kAllOs));
+ GPUInfo gpu_info;
+
+ gpu_info.in_process_gpu = true;
+ std::set<int> features = control_list->MakeDecision(
+ GpuControlList::kOsWin, kOsVersion, gpu_info);
+ EXPECT_SINGLE_FEATURE(features, TEST_FEATURE_0);
+
+ gpu_info.in_process_gpu = false;
+ features = control_list->MakeDecision(
+ GpuControlList::kOsWin, kOsVersion, gpu_info);
+ EXPECT_EMPTY_SET(features);
+}
+
} // namespace gpu
diff --git a/chromium/gpu/config/gpu_driver_bug_list.cc b/chromium/gpu/config/gpu_driver_bug_list.cc
index b0d82eb7fcd..1942523802b 100644
--- a/chromium/gpu/config/gpu_driver_bug_list.cc
+++ b/chromium/gpu/config/gpu_driver_bug_list.cc
@@ -59,29 +59,35 @@ void GpuDriverBugList::AppendWorkaroundsFromCommandLine(
const base::CommandLine& command_line) {
DCHECK(workarounds);
for (int i = 0; i < NUMBER_OF_GPU_DRIVER_BUG_WORKAROUND_TYPES; i++) {
- if (!command_line.HasSwitch(kFeatureList[i].name))
- continue;
- // Removing conflicting workarounds.
- switch (kFeatureList[i].type) {
- case FORCE_DISCRETE_GPU:
- workarounds->erase(FORCE_INTEGRATED_GPU);
- workarounds->insert(FORCE_DISCRETE_GPU);
- break;
- case FORCE_INTEGRATED_GPU:
- workarounds->erase(FORCE_DISCRETE_GPU);
- workarounds->insert(FORCE_INTEGRATED_GPU);
- break;
- case MAX_CUBE_MAP_TEXTURE_SIZE_LIMIT_512:
- case MAX_CUBE_MAP_TEXTURE_SIZE_LIMIT_1024:
- case MAX_CUBE_MAP_TEXTURE_SIZE_LIMIT_4096:
- workarounds->erase(MAX_CUBE_MAP_TEXTURE_SIZE_LIMIT_512);
- workarounds->erase(MAX_CUBE_MAP_TEXTURE_SIZE_LIMIT_1024);
- workarounds->erase(MAX_CUBE_MAP_TEXTURE_SIZE_LIMIT_4096);
- workarounds->insert(kFeatureList[i].type);
- break;
- default:
- workarounds->insert(kFeatureList[i].type);
- break;
+ if (command_line.HasSwitch(kFeatureList[i].name)) {
+ // Check for disabling workaround flag.
+ if (command_line.GetSwitchValueASCII(kFeatureList[i].name) == "0") {
+ workarounds->erase(kFeatureList[i].type);
+ continue;
+ }
+
+ // Removing conflicting workarounds.
+ switch (kFeatureList[i].type) {
+ case FORCE_DISCRETE_GPU:
+ workarounds->erase(FORCE_INTEGRATED_GPU);
+ workarounds->insert(FORCE_DISCRETE_GPU);
+ break;
+ case FORCE_INTEGRATED_GPU:
+ workarounds->erase(FORCE_DISCRETE_GPU);
+ workarounds->insert(FORCE_INTEGRATED_GPU);
+ break;
+ case MAX_CUBE_MAP_TEXTURE_SIZE_LIMIT_512:
+ case MAX_CUBE_MAP_TEXTURE_SIZE_LIMIT_1024:
+ case MAX_CUBE_MAP_TEXTURE_SIZE_LIMIT_4096:
+ workarounds->erase(MAX_CUBE_MAP_TEXTURE_SIZE_LIMIT_512);
+ workarounds->erase(MAX_CUBE_MAP_TEXTURE_SIZE_LIMIT_1024);
+ workarounds->erase(MAX_CUBE_MAP_TEXTURE_SIZE_LIMIT_4096);
+ workarounds->insert(kFeatureList[i].type);
+ break;
+ default:
+ workarounds->insert(kFeatureList[i].type);
+ break;
+ }
}
}
}
diff --git a/chromium/gpu/config/gpu_driver_bug_list_json.cc b/chromium/gpu/config/gpu_driver_bug_list_json.cc
index b5e9e6da5f7..6519e395a2c 100644
--- a/chromium/gpu/config/gpu_driver_bug_list_json.cc
+++ b/chromium/gpu/config/gpu_driver_bug_list_json.cc
@@ -19,7 +19,7 @@ const char kGpuDriverBugListJson[] = LONG_STRING_CONST(
{
"name": "gpu driver bug list",
// Please update the version number whenever you change this file.
- "version": "8.19",
+ "version": "8.26",
"entries": [
{
"id": 1,
@@ -317,12 +317,12 @@ const char kGpuDriverBugListJson[] = LONG_STRING_CONST(
{
"id": 24,
"cr_bugs": [231082],
- "description": "Mali-400 drivers throw an error when a buffer object's size is set to 0",
+ "description": "Mali-4xx drivers throw an error when a buffer object's size is set to 0",
"os": {
"type": "android"
},
"gl_vendor": "ARM.*",
- "gl_renderer": ".*Mali-400.*",
+ "gl_renderer": ".*Mali-4.*",
"features": [
"use_non_zero_size_for_client_side_stream_buffers"
]
@@ -857,7 +857,7 @@ LONG_STRING_CONST(
},
{
"id": 75,
- "description": "Mali-400 support of EXT_multisampled_render_to_texture is buggy on Android < 4.3",
+ "description": "Mali-4xx support of EXT_multisampled_render_to_texture is buggy on Android < 4.3",
"cr_bugs": [362435],
"os": {
"type": "android",
@@ -867,7 +867,7 @@ LONG_STRING_CONST(
}
},
"gl_vendor": "ARM.*",
- "gl_renderer": ".*Mali-400.*",
+ "gl_renderer": ".*Mali-4.*",
"features": [
"disable_multisampled_render_to_texture"
]
@@ -1261,9 +1261,9 @@ LONG_STRING_CONST(
{
"id": 108,
"cr_bugs": [449150],
- "description": "Mali-400 does not support GL_RGB format",
+ "description": "Mali-4xx does not support GL_RGB format",
"gl_vendor": "ARM.*",
- "gl_renderer": ".*Mali-400.*",
+ "gl_renderer": ".*Mali-4.*",
"features": [
"disable_gl_rgb_format"
]
@@ -1297,13 +1297,13 @@ LONG_STRING_CONST(
},
{
"id": 111,
- "description": "Discard Framebuffer breaks WebGL on Mali-400 Linux",
+ "description": "Discard Framebuffer breaks WebGL on Mali-4xx Linux",
"cr_bugs": [485814],
"os": {
"type": "linux"
},
"gl_vendor": "ARM.*",
- "gl_renderer": ".*Mali-400.*",
+ "gl_renderer": ".*Mali-4.*",
"features": [
"disable_discard_framebuffer"
]
@@ -1430,34 +1430,36 @@ LONG_STRING_CONST(
]
},
{
- "id": 121,
- "description": "NSCGLSurface API is buggy on multi-GPU systems",
- "cr_bugs": [496484],
- "os": {
- "type": "macosx"
- },
- "gpu_count": {
- "op": ">",
- "value": "1"
+ "id": 123,
+ "cr_bugs": [344330],
+ "description": "NVIDIA drivers before 337 lack features in NV_path_rendering and related extensions to implement driver level path rendering.",
+ "driver_version": {
+ "op": "<",
+ "value": "337"
},
+ "vendor_id": "0x10de",
"features": [
- "disable_ns_cgl_surface_api"
+ "disable_gl_path_rendering"
]
},
{
- "id": 122,
- "description": "NSCGLSurface API unsupported on VMWare drivers",
- "cr_bugs": [496484],
+ "id": 124,
+ "description": "Certain Adreno 4xx drivers often crash in glProgramBinary.",
+ "cr_bugs": [486117],
"os": {
- "type": "macosx"
+ "type": "android"
},
- "vendor_id": "0x15ad",
+ "driver_version": {
+ "op": "=",
+ "value": "103.0"
+ },
+ "gl_renderer": "Adreno \\(TM\\) 4.*",
"features": [
- "disable_ns_cgl_surface_api"
+ "disable_program_cache"
]
},
{
- "id": 123,
+ "id": 125,
"description": "glFinish doesn't clear caches on Android",
"cr_bugs": [509727],
"os": {
@@ -1469,19 +1471,87 @@ LONG_STRING_CONST(
]
},
{
- "id": 124,
- "description": "Certain Adreno 4xx drivers often crash in glProgramBinary.",
- "cr_bugs": [486117],
+ "id": 126,
+ "description": "Program binaries contain incorrect bound attribute locations on Adreno 3xx GPUs",
+ "cr_bugs": [510637],
"os": {
"type": "android"
},
+ "gl_renderer": "Adreno \\(TM\\) 3.*",
+ "features": [
+ "disable_program_cache"
+ ]
+ },
+ {
+ "id": 127,
+ "description": "Android Adreno crashes on binding incomplete cube map texture to FBO",
+ "cr_bugs": [518889],
+ "os": {
+ "type": "android"
+ },
+ "gl_renderer": "Adreno.*",
+ "features": [
+ "force_cube_map_positive_x_allocation"
+ ]
+ },
+ {
+ "id": 128,
+ "description": "Linux ATI drivers crash on binding incomplete cube map texture to FBO",
+ "cr_bugs": [518889],
+ "os": {
+ "type": "linux"
+ },
+ "vendor_id": "0x1002",
+ "features": [
+ "force_cube_map_positive_x_allocation"
+ ]
+ },
+ {
+ "id": 129,
+ // TODO(dshwang): Fix ANGLE crash. crbug.com/518889
+ "description": "ANGLE crash on glReadPixels from incomplete cube map texture",
+ "cr_bugs": [518889],
+ "os": {
+ "type": "win"
+ },
+ "gl_renderer": "ANGLE.*",
+ "features": [
+ "force_cube_complete"
+ ]
+ },
+ {
+ "id": 130,
+ "description": "NVIDIA fails glReadPixels from incomplete cube map texture",
+ "cr_bugs": [518889],
+ "gl_vendor": "NVIDIA.*",
+ "features": [
+ "force_cube_complete"
+ ]
+ },
+ {
+ "id": 131,
+ "description": "Linux Mesa drivers crash on glTexSubImage2D() to texture storage bound to FBO",
+ "cr_bugs": [521904],
+ "os": {
+ "type": "linux"
+ },
+ "driver_vendor": "Mesa",
"driver_version": {
- "op": "=",
- "value": "103.0"
+ "op": "<",
+ "value": "10.6"
},
- "gl_renderer": "Adreno \\(TM\\) 4.*",
"features": [
- "disable_program_cache"
+ "disable_texture_storage"
+ ]
+ },
+ {
+ "id": 132,
+ "description": "On Intel GPUs MSAA performance is not acceptable for GPU rasterization",
+ "cr_bugs": [527565],
+ "vendor_id": "0x8086",
+ "multi_gpu_category": "active",
+ "features": [
+ "disable_msaa_on_non_webgl_contexts"
]
}
]
diff --git a/chromium/gpu/config/gpu_driver_bug_workaround_type.h b/chromium/gpu/config/gpu_driver_bug_workaround_type.h
index 41f2918fb27..eb2877f2736 100644
--- a/chromium/gpu/config/gpu_driver_bug_workaround_type.h
+++ b/chromium/gpu/config/gpu_driver_bug_workaround_type.h
@@ -34,24 +34,32 @@
disable_discard_framebuffer) \
GPU_OP(DISABLE_EXT_DRAW_BUFFERS, \
disable_ext_draw_buffers) \
+ GPU_OP(DISABLE_GL_PATH_RENDERING, \
+ disable_gl_path_rendering) \
GPU_OP(DISABLE_GL_RGB_FORMAT, \
disable_gl_rgb_format) \
+ GPU_OP(DISABLE_MSAA_ON_NON_WEBGL_CONTEXTS, \
+ disable_msaa_on_non_webgl_contexts) \
GPU_OP(DISABLE_MULTIMONITOR_MULTISAMPLING, \
disable_multimonitor_multisampling) \
GPU_OP(DISABLE_MULTISAMPLED_RENDER_TO_TEXTURE, \
disable_multisampled_render_to_texture) \
- GPU_OP(DISABLE_NS_CGL_SURFACE_API, \
- disable_ns_cgl_surface_api) \
GPU_OP(DISABLE_POST_SUB_BUFFERS_FOR_ONSCREEN_SURFACES, \
disable_post_sub_buffers_for_onscreen_surfaces) \
GPU_OP(DISABLE_PROGRAM_CACHE, \
disable_program_cache) \
+ GPU_OP(DISABLE_TEXTURE_STORAGE, \
+ disable_texture_storage) \
GPU_OP(DISABLE_TIMESTAMP_QUERIES, \
disable_timestamp_queries) \
GPU_OP(ETC1_POWER_OF_TWO_ONLY, \
etc1_power_of_two_only) \
GPU_OP(EXIT_ON_CONTEXT_LOST, \
exit_on_context_lost) \
+ GPU_OP(FORCE_CUBE_COMPLETE, \
+ force_cube_complete) \
+ GPU_OP(FORCE_CUBE_MAP_POSITIVE_X_ALLOCATION, \
+ force_cube_map_positive_x_allocation) \
GPU_OP(FORCE_DISCRETE_GPU, \
force_discrete_gpu) \
GPU_OP(FORCE_GL_FINISH_AFTER_COMPOSITING, \
diff --git a/chromium/gpu/config/gpu_info.cc b/chromium/gpu/config/gpu_info.cc
index 85d26fb584a..23d52169f12 100644
--- a/chromium/gpu/config/gpu_info.cc
+++ b/chromium/gpu/config/gpu_info.cc
@@ -65,13 +65,13 @@ GPUInfo::GPUInfo()
direct_rendering(true),
sandboxed(false),
process_crash_count(0),
+ in_process_gpu(true),
basic_info_state(kCollectInfoNone),
-#if defined(OS_WIN)
context_info_state(kCollectInfoNone),
- dx_diagnostics_info_state(kCollectInfoNone) {
-#else
- context_info_state(kCollectInfoNone) {
+#if defined(OS_WIN)
+ dx_diagnostics_info_state(kCollectInfoNone),
#endif
+ jpeg_decode_accelerator_supported(false) {
}
GPUInfo::~GPUInfo() { }
@@ -107,6 +107,7 @@ void GPUInfo::EnumerateFields(Enumerator* enumerator) const {
bool direct_rendering;
bool sandboxed;
int process_crash_count;
+ bool in_process_gpu;
CollectInfoResult basic_info_state;
CollectInfoResult context_info_state;
#if defined(OS_WIN)
@@ -117,6 +118,7 @@ void GPUInfo::EnumerateFields(Enumerator* enumerator) const {
video_decode_accelerator_supported_profiles;
VideoEncodeAcceleratorSupportedProfiles
video_encode_accelerator_supported_profiles;
+ bool jpeg_decode_accelerator_supported;
};
// If this assert fails then most likely something below needs to be updated.
@@ -166,6 +168,7 @@ void GPUInfo::EnumerateFields(Enumerator* enumerator) const {
enumerator->AddBool("directRendering", direct_rendering);
enumerator->AddBool("sandboxed", sandboxed);
enumerator->AddInt("processCrashCount", process_crash_count);
+ enumerator->AddBool("inProcessGpu", in_process_gpu);
enumerator->AddInt("basicInfoState", basic_info_state);
enumerator->AddInt("contextInfoState", context_info_state);
#if defined(OS_WIN)
@@ -176,6 +179,8 @@ void GPUInfo::EnumerateFields(Enumerator* enumerator) const {
EnumerateVideoDecodeAcceleratorSupportedProfile(profile, enumerator);
for (const auto& profile : video_encode_accelerator_supported_profiles)
EnumerateVideoEncodeAcceleratorSupportedProfile(profile, enumerator);
+ enumerator->AddBool("jpegDecodeAcceleratorSupported",
+ jpeg_decode_accelerator_supported);
enumerator->EndAuxAttributes();
}
diff --git a/chromium/gpu/config/gpu_info.h b/chromium/gpu/config/gpu_info.h
index f377698dbb0..d6f61fd60f7 100644
--- a/chromium/gpu/config/gpu_info.h
+++ b/chromium/gpu/config/gpu_info.h
@@ -206,6 +206,9 @@ struct GPU_EXPORT GPUInfo {
// Number of GPU process crashes recorded.
int process_crash_count;
+ // True if the GPU is running in the browser process instead of its own.
+ bool in_process_gpu;
+
// The state of whether the basic/context/DxDiagnostics info is collected and
// if the collection fails or not.
CollectInfoResult basic_info_state;
@@ -221,6 +224,8 @@ struct GPU_EXPORT GPUInfo {
video_decode_accelerator_supported_profiles;
VideoEncodeAcceleratorSupportedProfiles
video_encode_accelerator_supported_profiles;
+ bool jpeg_decode_accelerator_supported;
+
// Note: when adding new members, please remember to update EnumerateFields
// in gpu_info.cc.
diff --git a/chromium/gpu/config/gpu_info_collector.cc b/chromium/gpu/config/gpu_info_collector.cc
index 8ef3d3cada5..2b7eaef5b4e 100644
--- a/chromium/gpu/config/gpu_info_collector.cc
+++ b/chromium/gpu/config/gpu_info_collector.cc
@@ -9,6 +9,7 @@
#include "base/logging.h"
#include "base/memory/scoped_ptr.h"
+#include "base/metrics/sparse_histogram.h"
#include "base/strings/string_number_conversions.h"
#include "base/strings/string_piece.h"
#include "base/strings/string_split.h"
@@ -68,8 +69,8 @@ std::string GetVersionFromString(const std::string& version_string) {
sub_string = version_string.substr(begin, end - begin);
else
sub_string = version_string.substr(begin);
- std::vector<std::string> pieces;
- base::SplitString(sub_string, '.', &pieces);
+ std::vector<std::string> pieces = base::SplitString(
+ sub_string, ".", base::TRIM_WHITESPACE, base::SPLIT_WANT_ALL);
if (pieces.size() >= 2)
return pieces[0] + "." + pieces[1];
}
@@ -98,12 +99,13 @@ CollectInfoResult CollectGraphicsInfoGL(GPUInfo* gpu_info) {
gpu_info->gl_renderer = GetGLString(GL_RENDERER);
gpu_info->gl_vendor = GetGLString(GL_VENDOR);
- gpu_info->gl_extensions = GetGLString(GL_EXTENSIONS);
+ gpu_info->gl_extensions = gfx::GetGLExtensionsFromCurrentContext();
gpu_info->gl_version = GetGLString(GL_VERSION);
std::string glsl_version_string = GetGLString(GL_SHADING_LANGUAGE_VERSION);
GLint max_samples = 0;
glGetIntegerv(GL_MAX_SAMPLES, &max_samples);
gpu_info->max_msaa_samples = base::IntToString(max_samples);
+ UMA_HISTOGRAM_SPARSE_SLOWLY("GPU.MaxMSAASampleCount", max_samples);
gfx::GLWindowSystemBindingInfo window_system_binding_info;
if (GetGLWindowSystemBindingInfo(&window_system_binding_info)) {
@@ -160,12 +162,15 @@ void MergeGPUInfoGL(GPUInfo* basic_gpu_info,
basic_gpu_info->can_lose_context = context_gpu_info.can_lose_context;
basic_gpu_info->sandboxed = context_gpu_info.sandboxed;
basic_gpu_info->direct_rendering = context_gpu_info.direct_rendering;
+ basic_gpu_info->in_process_gpu = context_gpu_info.in_process_gpu;
basic_gpu_info->context_info_state = context_gpu_info.context_info_state;
basic_gpu_info->initialization_time = context_gpu_info.initialization_time;
basic_gpu_info->video_decode_accelerator_supported_profiles =
context_gpu_info.video_decode_accelerator_supported_profiles;
basic_gpu_info->video_encode_accelerator_supported_profiles =
context_gpu_info.video_encode_accelerator_supported_profiles;
+ basic_gpu_info->jpeg_decode_accelerator_supported =
+ context_gpu_info.jpeg_decode_accelerator_supported;
}
} // namespace gpu
diff --git a/chromium/gpu/config/gpu_info_collector_android.cc b/chromium/gpu/config/gpu_info_collector_android.cc
index 93da6a93723..c6d9b19456a 100644
--- a/chromium/gpu/config/gpu_info_collector_android.cc
+++ b/chromium/gpu/config/gpu_info_collector_android.cc
@@ -34,8 +34,8 @@ std::pair<std::string, size_t> GetVersionFromString(
sub_string = version_string.substr(begin, end - begin);
else
sub_string = version_string.substr(begin);
- std::vector<std::string> pieces;
- base::SplitString(sub_string, '.', &pieces);
+ std::vector<std::string> pieces = base::SplitString(
+ sub_string, ".", base::TRIM_WHITESPACE, base::SPLIT_WANT_ALL);
if (pieces.size() >= 2)
return std::make_pair(pieces[0] + "." + pieces[1], end);
else
diff --git a/chromium/gpu/config/gpu_info_collector_linux.cc b/chromium/gpu/config/gpu_info_collector_linux.cc
index 413e949eda8..e93a79c42eb 100644
--- a/chromium/gpu/config/gpu_info_collector_linux.cc
+++ b/chromium/gpu/config/gpu_info_collector_linux.cc
@@ -56,7 +56,8 @@ std::string CollectDriverVersionATI() {
base::StringTokenizer t(contents, "\r\n");
while (t.GetNext()) {
std::string line = t.token();
- if (base::StartsWithASCII(line, "ReleaseVersion=", true)) {
+ if (base::StartsWith(line, "ReleaseVersion=",
+ base::CompareCase::SENSITIVE)) {
size_t begin = line.find_first_of("0123456789");
if (begin != std::string::npos) {
size_t end = line.find_first_not_of("0123456789.", begin);
@@ -244,10 +245,11 @@ CollectInfoResult CollectDriverInfoGL(GPUInfo* gpu_info) {
DCHECK(gpu_info);
std::string gl_version = gpu_info->gl_version;
- if (base::StartsWithASCII(gl_version, "OpenGL ES", true))
+ if (base::StartsWith(gl_version, "OpenGL ES", base::CompareCase::SENSITIVE))
gl_version = gl_version.substr(10);
- std::vector<std::string> pieces;
- base::SplitStringAlongWhitespace(gl_version, &pieces);
+ std::vector<std::string> pieces = base::SplitString(
+ gl_version, base::kWhitespaceASCII, base::KEEP_WHITESPACE,
+ base::SPLIT_WANT_NONEMPTY);
// In linux, the gl version string might be in the format of
// GLVersion DriverVendor DriverVersion
if (pieces.size() < 3)
diff --git a/chromium/gpu/config/gpu_info_collector_mac.mm b/chromium/gpu/config/gpu_info_collector_mac.mm
index bbe3780e5f3..61050649c1c 100644
--- a/chromium/gpu/config/gpu_info_collector_mac.mm
+++ b/chromium/gpu/config/gpu_info_collector_mac.mm
@@ -9,6 +9,7 @@
#include "base/logging.h"
#include "base/mac/mac_util.h"
#include "base/mac/scoped_cftyperef.h"
+#include "base/mac/scoped_ioobject.h"
#include "base/memory/scoped_ptr.h"
#include "base/strings/string_number_conversions.h"
#include "base/strings/string_piece.h"
@@ -75,8 +76,9 @@ CollectInfoResult CollectPCIVideoCardInfo(GPUInfo* gpu_info) {
if (IOServiceGetMatchingServices(kIOMasterPortDefault,
match_dictionary,
&entry_iterator) == kIOReturnSuccess) {
- io_registry_entry_t entry;
- while ((entry = IOIteratorNext(entry_iterator))) {
+
+ base::mac::ScopedIOObject<io_registry_entry_t> entry;
+ while (entry.reset(IOIteratorNext(entry_iterator)), entry) {
GPUInfo::GPUDevice gpu;
if (GetEntryProperty(entry, CFSTR("class-code")) != 0x30000) {
// 0x30000 : DISPLAY_VGA
diff --git a/chromium/gpu/config/gpu_info_collector_unittest.cc b/chromium/gpu/config/gpu_info_collector_unittest.cc
index f89eb4da4a6..0f9b306f3e1 100644
--- a/chromium/gpu/config/gpu_info_collector_unittest.cc
+++ b/chromium/gpu/config/gpu_info_collector_unittest.cc
@@ -3,22 +3,44 @@
// found in the LICENSE file.
#include "base/memory/scoped_ptr.h"
+#include "base/strings/string_split.h"
#include "gpu/config/gpu_info.h"
#include "gpu/config/gpu_info_collector.h"
#include "testing/gmock/include/gmock/gmock.h"
#include "testing/gtest/include/gtest/gtest.h"
#include "ui/gl/gl_implementation.h"
#include "ui/gl/gl_mock.h"
-#include "ui/gl/gl_surface.h"
+#include "ui/gl/test/gl_surface_test_support.h"
using ::gfx::MockGLInterface;
using ::testing::Return;
using ::testing::SetArgPointee;
using ::testing::_;
+namespace {
+
+// Allows testing of all configurations on all operating systems.
+enum MockedOperatingSystemKind {
+ kMockedAndroid,
+ kMockedLinux,
+ kMockedMacOSX,
+ kMockedWindows
+};
+
+} // anonymous namespace
+
namespace gpu {
-class GPUInfoCollectorTest : public testing::Test {
+static const MockedOperatingSystemKind kMockedOperatingSystemKinds[] = {
+ kMockedAndroid,
+ kMockedLinux,
+ kMockedMacOSX,
+ kMockedWindows
+};
+
+class GPUInfoCollectorTest
+ : public testing::Test,
+ public ::testing::WithParamInterface<MockedOperatingSystemKind> {
public:
GPUInfoCollectorTest() {}
~GPUInfoCollectorTest() override {}
@@ -26,89 +48,113 @@ class GPUInfoCollectorTest : public testing::Test {
void SetUp() override {
testing::Test::SetUp();
gfx::SetGLGetProcAddressProc(gfx::MockGLInterface::GetGLProcAddress);
- gfx::GLSurface::InitializeOneOffWithMockBindingsForTests();
+ gfx::GLSurfaceTestSupport::InitializeOneOffWithMockBindings();
gl_.reset(new ::testing::StrictMock< ::gfx::MockGLInterface>());
::gfx::MockGLInterface::SetGLInterface(gl_.get());
-#if defined(OS_WIN)
- const uint32 vendor_id = 0x10de;
- const uint32 device_id = 0x0658;
- const char* driver_vendor = ""; // not implemented
- const char* driver_version = "";
- const char* shader_version = "1.40";
- const char* gl_renderer = "Quadro FX 380/PCI/SSE2";
- const char* gl_vendor = "NVIDIA Corporation";
- const char* gl_version = "3.1.0";
- const char* gl_shading_language_version = "1.40 NVIDIA via Cg compiler";
- const char* gl_extensions =
- "GL_OES_packed_depth_stencil GL_EXT_texture_format_BGRA8888 "
- "GL_EXT_read_format_bgra";
-#elif defined(OS_MACOSX)
- const uint32 vendor_id = 0x10de;
- const uint32 device_id = 0x0640;
- const char* driver_vendor = ""; // not implemented
- const char* driver_version = "1.6.18";
- const char* shader_version = "1.20";
- const char* gl_renderer = "NVIDIA GeForce GT 120 OpenGL Engine";
- const char* gl_vendor = "NVIDIA Corporation";
- const char* gl_version = "2.1 NVIDIA-1.6.18";
- const char* gl_shading_language_version = "1.20 ";
- const char* gl_extensions =
- "GL_OES_packed_depth_stencil GL_EXT_texture_format_BGRA8888 "
- "GL_EXT_read_format_bgra";
-#elif defined(OS_ANDROID)
- const uint32 vendor_id = 0; // not implemented
- const uint32 device_id = 0; // not implemented
- const char* driver_vendor = ""; // not implemented
- const char* driver_version = "14.0";
- const char* shader_version = "1.00";
- const char* gl_renderer = "Adreno (TM) 320";
- const char* gl_vendor = "Qualcomm";
- const char* gl_version = "OpenGL ES 2.0 V@14.0 AU@04.02 (CL@3206)";
- const char* gl_shading_language_version = "1.00";
- const char* gl_extensions =
- "GL_OES_packed_depth_stencil GL_EXT_texture_format_BGRA8888 "
- "GL_EXT_read_format_bgra";
-#else // defined (OS_LINUX)
- const uint32 vendor_id = 0x10de;
- const uint32 device_id = 0x0658;
- const char* driver_vendor = "NVIDIA";
- const char* driver_version = "195.36.24";
- const char* shader_version = "1.50";
- const char* gl_renderer = "Quadro FX 380/PCI/SSE2";
- const char* gl_vendor = "NVIDIA Corporation";
- const char* gl_version = "3.2.0 NVIDIA 195.36.24";
- const char* gl_shading_language_version = "1.50 NVIDIA via Cg compiler";
- const char* gl_extensions =
- "GL_OES_packed_depth_stencil GL_EXT_texture_format_BGRA8888 "
- "GL_EXT_read_format_bgra";
-#endif
- test_values_.gpu.vendor_id = vendor_id;
- test_values_.gpu.device_id = device_id;
- test_values_.driver_vendor = driver_vendor;
- test_values_.driver_version =driver_version;
- test_values_.pixel_shader_version = shader_version;
- test_values_.vertex_shader_version = shader_version;
- test_values_.gl_renderer = gl_renderer;
- test_values_.gl_vendor = gl_vendor;
- test_values_.gl_version = gl_version;
- test_values_.gl_extensions = gl_extensions;
+ switch (GetParam()) {
+ case kMockedAndroid: {
+ test_values_.gpu.vendor_id = 0; // not implemented
+ test_values_.gpu.device_id = 0; // not implemented
+ test_values_.driver_vendor = ""; // not implemented
+ test_values_.driver_version = "14.0";
+ test_values_.pixel_shader_version = "1.00";
+ test_values_.vertex_shader_version = "1.00";
+ test_values_.gl_renderer = "Adreno (TM) 320";
+ test_values_.gl_vendor = "Qualcomm";
+ test_values_.gl_version = "OpenGL ES 2.0 V@14.0 AU@04.02 (CL@3206)";
+ test_values_.gl_extensions =
+ "GL_OES_packed_depth_stencil GL_EXT_texture_format_BGRA8888 "
+ "GL_EXT_read_format_bgra";
+ gl_shading_language_version_ = "1.00";
+ break;
+ }
+ case kMockedLinux: {
+ test_values_.gpu.vendor_id = 0x10de;
+ test_values_.gpu.device_id = 0x0658;
+ test_values_.driver_vendor = "NVIDIA";
+ test_values_.driver_version = "195.36.24";
+ test_values_.pixel_shader_version = "1.50";
+ test_values_.vertex_shader_version = "1.50";
+ test_values_.gl_renderer = "Quadro FX 380/PCI/SSE2";
+ test_values_.gl_vendor = "NVIDIA Corporation";
+ test_values_.gl_version = "3.2.0 NVIDIA 195.36.24";
+ test_values_.gl_extensions =
+ "GL_OES_packed_depth_stencil GL_EXT_texture_format_BGRA8888 "
+ "GL_EXT_read_format_bgra";
+ gl_shading_language_version_ = "1.50 NVIDIA via Cg compiler";
+ break;
+ }
+ case kMockedMacOSX: {
+ test_values_.gpu.vendor_id = 0x10de;
+ test_values_.gpu.device_id = 0x0640;
+ test_values_.driver_vendor = ""; // not implemented
+ test_values_.driver_version = "1.6.18";
+ test_values_.pixel_shader_version = "1.20";
+ test_values_.vertex_shader_version = "1.20";
+ test_values_.gl_renderer = "NVIDIA GeForce GT 120 OpenGL Engine";
+ test_values_.gl_vendor = "NVIDIA Corporation";
+ test_values_.gl_version = "2.1 NVIDIA-1.6.18";
+ test_values_.gl_extensions =
+ "GL_OES_packed_depth_stencil GL_EXT_texture_format_BGRA8888 "
+ "GL_EXT_read_format_bgra";
+ gl_shading_language_version_ = "1.20 ";
+ break;
+ }
+ case kMockedWindows: {
+ test_values_.gpu.vendor_id = 0x10de;
+ test_values_.gpu.device_id = 0x0658;
+ test_values_.driver_vendor = ""; // not implemented
+ test_values_.driver_version = "";
+ test_values_.pixel_shader_version = "1.40";
+ test_values_.vertex_shader_version = "1.40";
+ test_values_.gl_renderer = "Quadro FX 380/PCI/SSE2";
+ test_values_.gl_vendor = "NVIDIA Corporation";
+ test_values_.gl_version = "3.1.0";
+ test_values_.gl_extensions =
+ "GL_OES_packed_depth_stencil GL_EXT_texture_format_BGRA8888 "
+ "GL_EXT_read_format_bgra";
+ gl_shading_language_version_ = "1.40 NVIDIA via Cg compiler";
+ break;
+ }
+ default: {
+ NOTREACHED();
+ break;
+ }
+ }
+
test_values_.can_lose_context = false;
- EXPECT_CALL(*gl_, GetString(GL_EXTENSIONS))
+ EXPECT_CALL(*gl_, GetString(GL_VERSION))
.WillRepeatedly(Return(reinterpret_cast<const GLubyte*>(
- gl_extensions)));
+ test_values_.gl_version.c_str())));
+
+ // Now that that expectation is set up, we can call this helper function.
+ if (gfx::WillUseGLGetStringForExtensions()) {
+ EXPECT_CALL(*gl_, GetString(GL_EXTENSIONS))
+ .WillRepeatedly(Return(reinterpret_cast<const GLubyte*>(
+ test_values_.gl_extensions.c_str())));
+ } else {
+ split_extensions_.clear();
+ split_extensions_ = base::SplitString(
+ test_values_.gl_extensions, " ",
+ base::KEEP_WHITESPACE, base::SPLIT_WANT_NONEMPTY);
+ EXPECT_CALL(*gl_, GetIntegerv(GL_NUM_EXTENSIONS, _))
+ .WillRepeatedly(SetArgPointee<1>(split_extensions_.size()));
+ for (size_t ii = 0; ii < split_extensions_.size(); ++ii) {
+ EXPECT_CALL(*gl_, GetStringi(GL_EXTENSIONS, ii))
+ .WillRepeatedly(Return(reinterpret_cast<const uint8*>(
+ split_extensions_[ii].c_str())));
+ }
+ }
EXPECT_CALL(*gl_, GetString(GL_SHADING_LANGUAGE_VERSION))
.WillRepeatedly(Return(reinterpret_cast<const GLubyte*>(
- gl_shading_language_version)));
- EXPECT_CALL(*gl_, GetString(GL_VERSION))
- .WillRepeatedly(Return(reinterpret_cast<const GLubyte*>(
- gl_version)));
+ gl_shading_language_version_)));
EXPECT_CALL(*gl_, GetString(GL_VENDOR))
.WillRepeatedly(Return(reinterpret_cast<const GLubyte*>(
- gl_vendor)));
+ test_values_.gl_vendor.c_str())));
EXPECT_CALL(*gl_, GetString(GL_RENDERER))
.WillRepeatedly(Return(reinterpret_cast<const GLubyte*>(
- gl_renderer)));
+ test_values_.gl_renderer.c_str())));
EXPECT_CALL(*gl_, GetIntegerv(GL_MAX_SAMPLES, _))
.WillOnce(SetArgPointee<1>(8))
.RetiresOnSaturation();
@@ -126,21 +172,55 @@ class GPUInfoCollectorTest : public testing::Test {
// Use StrictMock to make 100% sure we know how GL will be called.
scoped_ptr< ::testing::StrictMock< ::gfx::MockGLInterface> > gl_;
GPUInfo test_values_;
+ const char* gl_shading_language_version_ = nullptr;
+
+ // Persistent storage is needed for the split extension string.
+ std::vector<std::string> split_extensions_;
};
+INSTANTIATE_TEST_CASE_P(GPUConfig,
+ GPUInfoCollectorTest,
+ ::testing::ValuesIn(kMockedOperatingSystemKinds));
+
// TODO(rlp): Test the vendor and device id collection if deemed necessary as
// it involves several complicated mocks for each platform.
-TEST_F(GPUInfoCollectorTest, CollectGraphicsInfoGL) {
+// TODO(kbr): This test still has platform-dependent behavior because
+// CollectDriverInfoGL behaves differently per platform. This should
+// be fixed.
+TEST_P(GPUInfoCollectorTest, CollectGraphicsInfoGL) {
GPUInfo gpu_info;
CollectGraphicsInfoGL(&gpu_info);
- EXPECT_EQ(test_values_.driver_vendor,
- gpu_info.driver_vendor);
-#if !defined(OS_WIN)
- // Skip Windows because the driver version is obtained from bot registry.
- EXPECT_EQ(test_values_.driver_version,
- gpu_info.driver_version);
+#if defined(OS_WIN)
+ if (GetParam() == kMockedWindows) {
+ EXPECT_EQ(test_values_.driver_vendor,
+ gpu_info.driver_vendor);
+ // Skip testing the driver version on Windows because it's
+ // obtained from the bot's registry.
+ }
+#elif defined(OS_MACOSX)
+ if (GetParam() == kMockedMacOSX) {
+ EXPECT_EQ(test_values_.driver_vendor,
+ gpu_info.driver_vendor);
+ EXPECT_EQ(test_values_.driver_version,
+ gpu_info.driver_version);
+ }
+#elif defined(OS_ANDROID)
+ if (GetParam() == kMockedAndroid) {
+ EXPECT_EQ(test_values_.driver_vendor,
+ gpu_info.driver_vendor);
+ EXPECT_EQ(test_values_.driver_version,
+ gpu_info.driver_version);
+ }
+#else // defined (OS_LINUX)
+ if (GetParam() == kMockedLinux) {
+ EXPECT_EQ(test_values_.driver_vendor,
+ gpu_info.driver_vendor);
+ EXPECT_EQ(test_values_.driver_version,
+ gpu_info.driver_version);
+ }
#endif
+
EXPECT_EQ(test_values_.pixel_shader_version,
gpu_info.pixel_shader_version);
EXPECT_EQ(test_values_.vertex_shader_version,
diff --git a/chromium/gpu/config/gpu_info_collector_win.cc b/chromium/gpu/config/gpu_info_collector_win.cc
index cc935ea9b87..f51764da823 100644
--- a/chromium/gpu/config/gpu_info_collector_win.cc
+++ b/chromium/gpu/config/gpu_info_collector_win.cc
@@ -51,18 +51,6 @@ enum DisplayLinkInstallationStatus {
DISPLAY_LINK_INSTALLATION_STATUS_MAX
};
-float ReadXMLFloatValue(XmlReader* reader) {
- std::string score_string;
- if (!reader->ReadElementContent(&score_string))
- return 0.0;
-
- double score;
- if (!base::StringToDouble(score_string, &score))
- return 0.0;
-
- return static_cast<float>(score);
-}
-
// Returns the display link driver version or an invalid version if it is
// not installed.
Version DisplayLinkVersion() {
diff --git a/chromium/gpu/config/gpu_test_config.cc b/chromium/gpu/config/gpu_test_config.cc
index c062c4da73c..4605f8987f5 100644
--- a/chromium/gpu/config/gpu_test_config.cc
+++ b/chromium/gpu/config/gpu_test_config.cc
@@ -39,6 +39,8 @@ GPUTestConfig::OS GetCurrentOS() {
return GPUTestConfig::kOsWin7;
if (major_version == 6 && (minor_version == 2 || minor_version == 3))
return GPUTestConfig::kOsWin8;
+ if (major_version == 10)
+ return GPUTestConfig::kOsWin10;
#elif defined(OS_MACOSX)
int32 major_version = 0;
int32 minor_version = 0;
@@ -73,8 +75,8 @@ GPUTestConfig::GPUTestConfig()
: validate_gpu_info_(true),
os_(kOsUnknown),
gpu_device_id_(0),
- build_type_(kBuildTypeUnknown) {
-}
+ build_type_(kBuildTypeUnknown),
+ api_(kAPIUnknown) {}
GPUTestConfig::~GPUTestConfig() {
}
@@ -100,6 +102,11 @@ void GPUTestConfig::set_build_type(int32 build_type) {
build_type_ = build_type;
}
+void GPUTestConfig::set_api(int32 api) {
+ DCHECK_EQ(0, api & ~(kAPID3D9 | kAPID3D11 | kAPIGLDesktop | kAPIGLES));
+ api_ = api;
+}
+
bool GPUTestConfig::IsValid() const {
if (!validate_gpu_info_)
return true;
@@ -169,6 +176,7 @@ bool GPUTestBotConfig::IsValid() const {
case kOsWinVista:
case kOsWin7:
case kOsWin8:
+ case kOsWin10:
case kOsMacLeopard:
case kOsMacSnowLeopard:
case kOsMacLion:
@@ -220,6 +228,8 @@ bool GPUTestBotConfig::Matches(const GPUTestConfig& config) const {
if (config.build_type() != kBuildTypeUnknown &&
(build_type() & config.build_type()) == 0)
return false;
+ if (config.api() != 0 && (api() & config.api()) == 0)
+ return false;
return true;
}
diff --git a/chromium/gpu/config/gpu_test_config.h b/chromium/gpu/config/gpu_test_config.h
index 8b184d3fe2e..10ab9de26c1 100644
--- a/chromium/gpu/config/gpu_test_config.h
+++ b/chromium/gpu/config/gpu_test_config.h
@@ -24,7 +24,6 @@ class GPU_EXPORT GPUTestConfig {
kOsWinVista = 1 << 1,
kOsWin7 = 1 << 2,
kOsWin8 = 1 << 3,
- kOsWin = kOsWinXP | kOsWinVista | kOsWin7 | kOsWin8,
kOsMacLeopard = 1 << 4,
kOsMacSnowLeopard = 1 << 5,
kOsMacLion = 1 << 6,
@@ -36,6 +35,8 @@ class GPU_EXPORT GPUTestConfig {
kOsLinux = 1 << 10,
kOsChromeOS = 1 << 11,
kOsAndroid = 1 << 12,
+ kOsWin10 = 1 << 13,
+ kOsWin = kOsWinXP | kOsWinVista | kOsWin7 | kOsWin8 | kOsWin10,
};
enum BuildType {
@@ -44,12 +45,21 @@ class GPU_EXPORT GPUTestConfig {
kBuildTypeDebug = 1 << 1,
};
+ enum API {
+ kAPIUnknown = 0,
+ kAPID3D9 = 1 << 0,
+ kAPID3D11 = 1 << 1,
+ kAPIGLDesktop = 1 << 2,
+ kAPIGLES = 1 << 3,
+ };
+
GPUTestConfig();
virtual ~GPUTestConfig();
void set_os(int32 os);
void set_gpu_device_id(uint32 id);
void set_build_type(int32 build_type);
+ void set_api(int32 api);
virtual void AddGPUVendor(uint32 gpu_vendor);
@@ -57,6 +67,7 @@ class GPU_EXPORT GPUTestConfig {
const std::vector<uint32>& gpu_vendor() const { return gpu_vendor_; }
uint32 gpu_device_id() const { return gpu_device_id_; }
int32 build_type() const { return build_type_; }
+ int32 api() const { return api_; }
// Check if the config is valid. For example, if gpu_device_id_ is set, but
// gpu_vendor_ is unknown, then it's invalid.
@@ -88,6 +99,9 @@ class GPU_EXPORT GPUTestConfig {
// Release or Debug.
int32 build_type_;
+
+ // Back-end rendering APIs.
+ int32 api_;
};
class GPU_EXPORT GPUTestBotConfig : public GPUTestConfig {
diff --git a/chromium/gpu/config/gpu_test_config_unittest.cc b/chromium/gpu/config/gpu_test_config_unittest.cc
index 40188f35aef..e42a805b2d8 100644
--- a/chromium/gpu/config/gpu_test_config_unittest.cc
+++ b/chromium/gpu/config/gpu_test_config_unittest.cc
@@ -26,6 +26,7 @@ TEST_F(GPUTestConfigTest, EmptyValues) {
EXPECT_EQ(0u, config.gpu_vendor().size());
EXPECT_EQ(0u, config.gpu_device_id());
EXPECT_EQ(GPUTestConfig::kBuildTypeUnknown, config.build_type());
+ EXPECT_EQ(GPUTestConfig::kAPIUnknown, config.api());
}
TEST_F(GPUTestConfigTest, SetGPUInfo) {
@@ -89,6 +90,7 @@ TEST_F(GPUTestConfigTest, Matches) {
config.set_build_type(GPUTestConfig::kBuildTypeRelease);
config.AddGPUVendor(0x10de);
config.set_gpu_device_id(0x0640);
+ config.set_api(GPUTestConfig::kAPID3D11);
EXPECT_TRUE(config.IsValid());
{ // os matching
@@ -140,6 +142,21 @@ TEST_F(GPUTestConfigTest, Matches) {
config2.set_gpu_device_id(0x0641);
EXPECT_FALSE(config.Matches(config2));
}
+
+ { // api matching
+ {
+ GPUTestConfig config2;
+ config2.set_api(GPUTestConfig::kAPID3D11);
+ EXPECT_TRUE(config.Matches(config2));
+ config2.set_api(config2.api() | GPUTestConfig::kAPID3D9);
+ EXPECT_TRUE(config.Matches(config2));
+ }
+ {
+ GPUTestConfig config2;
+ config2.set_api(GPUTestConfig::kAPID3D9);
+ EXPECT_FALSE(config.Matches(config2));
+ }
+ }
}
TEST_F(GPUTestConfigTest, StringMatches) {
@@ -148,6 +165,7 @@ TEST_F(GPUTestConfigTest, StringMatches) {
config.set_build_type(GPUTestConfig::kBuildTypeRelease);
config.AddGPUVendor(0x10de);
config.set_gpu_device_id(0x0640);
+ config.set_api(GPUTestConfig::kAPID3D11);
EXPECT_TRUE(config.IsValid());
EXPECT_TRUE(config.Matches(std::string()));
@@ -171,6 +189,10 @@ TEST_F(GPUTestConfigTest, StringMatches) {
// exact matching
EXPECT_TRUE(config.Matches("WIN7 RELEASE NVIDIA 0X0640"));
EXPECT_FALSE(config.Matches("WIN7 RELEASE NVIDIA 0X0641"));
+
+ // api matching
+ EXPECT_TRUE(config.Matches("D3D11"));
+ EXPECT_FALSE(config.Matches("D3D9 OPENGL GLES"));
}
TEST_F(GPUTestConfigTest, OverlapsWith) {
diff --git a/chromium/gpu/config/gpu_test_expectations_parser.cc b/chromium/gpu/config/gpu_test_expectations_parser.cc
index ca4031d92c3..27a1487b937 100644
--- a/chromium/gpu/config/gpu_test_expectations_parser.cc
+++ b/chromium/gpu/config/gpu_test_expectations_parser.cc
@@ -31,6 +31,7 @@ enum Token {
kConfigWinVista,
kConfigWin7,
kConfigWin8,
+ kConfigWin10,
kConfigWin,
kConfigMacLeopard,
kConfigMacSnowLeopard,
@@ -50,6 +51,11 @@ enum Token {
// build type
kConfigRelease,
kConfigDebug,
+ // ANGLE renderer
+ kConfigD3D9,
+ kConfigD3D11,
+ kConfigGLDesktop,
+ kConfigGLES,
// expectation
kExpectationPass,
kExpectationFail,
@@ -74,34 +80,39 @@ struct TokenInfo {
};
const TokenInfo kTokenData[] = {
- { "xp", GPUTestConfig::kOsWinXP },
- { "vista", GPUTestConfig::kOsWinVista },
- { "win7", GPUTestConfig::kOsWin7 },
- { "win8", GPUTestConfig::kOsWin8 },
- { "win", GPUTestConfig::kOsWin },
- { "leopard", GPUTestConfig::kOsMacLeopard },
- { "snowleopard", GPUTestConfig::kOsMacSnowLeopard },
- { "lion", GPUTestConfig::kOsMacLion },
- { "mountainlion", GPUTestConfig::kOsMacMountainLion },
- { "mavericks", GPUTestConfig::kOsMacMavericks },
- { "yosemite", GPUTestConfig::kOsMacYosemite },
- { "mac", GPUTestConfig::kOsMac },
- { "linux", GPUTestConfig::kOsLinux },
- { "chromeos", GPUTestConfig::kOsChromeOS },
- { "android", GPUTestConfig::kOsAndroid },
- { "nvidia", 0x10DE },
- { "amd", 0x1002 },
- { "intel", 0x8086 },
- { "vmware", 0x15ad },
- { "release", GPUTestConfig::kBuildTypeRelease },
- { "debug", GPUTestConfig::kBuildTypeDebug },
- { "pass", GPUTestExpectationsParser::kGpuTestPass },
- { "fail", GPUTestExpectationsParser::kGpuTestFail },
- { "flaky", GPUTestExpectationsParser::kGpuTestFlaky },
- { "timeout", GPUTestExpectationsParser::kGpuTestTimeout },
- { "skip", GPUTestExpectationsParser::kGpuTestSkip },
- { ":", 0 },
- { "=", 0 },
+ {"xp", GPUTestConfig::kOsWinXP},
+ {"vista", GPUTestConfig::kOsWinVista},
+ {"win7", GPUTestConfig::kOsWin7},
+ {"win8", GPUTestConfig::kOsWin8},
+ {"win10", GPUTestConfig::kOsWin10},
+ {"win", GPUTestConfig::kOsWin},
+ {"leopard", GPUTestConfig::kOsMacLeopard},
+ {"snowleopard", GPUTestConfig::kOsMacSnowLeopard},
+ {"lion", GPUTestConfig::kOsMacLion},
+ {"mountainlion", GPUTestConfig::kOsMacMountainLion},
+ {"mavericks", GPUTestConfig::kOsMacMavericks},
+ {"yosemite", GPUTestConfig::kOsMacYosemite},
+ {"mac", GPUTestConfig::kOsMac},
+ {"linux", GPUTestConfig::kOsLinux},
+ {"chromeos", GPUTestConfig::kOsChromeOS},
+ {"android", GPUTestConfig::kOsAndroid},
+ {"nvidia", 0x10DE},
+ {"amd", 0x1002},
+ {"intel", 0x8086},
+ {"vmware", 0x15ad},
+ {"release", GPUTestConfig::kBuildTypeRelease},
+ {"debug", GPUTestConfig::kBuildTypeDebug},
+ {"d3d9", GPUTestConfig::kAPID3D9},
+ {"d3d11", GPUTestConfig::kAPID3D11},
+ {"opengl", GPUTestConfig::kAPIGLDesktop},
+ {"gles", GPUTestConfig::kAPIGLES},
+ {"pass", GPUTestExpectationsParser::kGpuTestPass},
+ {"fail", GPUTestExpectationsParser::kGpuTestFail},
+ {"flaky", GPUTestExpectationsParser::kGpuTestFlaky},
+ {"timeout", GPUTestExpectationsParser::kGpuTestTimeout},
+ {"skip", GPUTestExpectationsParser::kGpuTestSkip},
+ {":", 0},
+ {"=", 0},
};
enum ErrorType {
@@ -111,6 +122,7 @@ enum ErrorType {
kErrorEntryWithOsConflicts,
kErrorEntryWithGpuVendorConflicts,
kErrorEntryWithBuildTypeConflicts,
+ kErrorEntryWithAPIConflicts,
kErrorEntryWithGpuDeviceIdConflicts,
kErrorEntryWithExpectationConflicts,
kErrorEntriesOverlap,
@@ -119,21 +131,22 @@ enum ErrorType {
};
const char* kErrorMessage[] = {
- "file IO failed",
- "entry with wrong format",
- "entry invalid, likely wrong modifiers combination",
- "entry with OS modifier conflicts",
- "entry with GPU vendor modifier conflicts",
- "entry with GPU build type conflicts",
- "entry with GPU device id conflicts or malformat",
- "entry with expectation modifier conflicts",
- "two entries's configs overlap",
+ "file IO failed",
+ "entry with wrong format",
+ "entry invalid, likely wrong modifiers combination",
+ "entry with OS modifier conflicts",
+ "entry with GPU vendor modifier conflicts",
+ "entry with GPU build type conflicts",
+ "entry with GPU API conflicts",
+ "entry with GPU device id conflicts or malformat",
+ "entry with expectation modifier conflicts",
+ "two entries' configs overlap",
};
Token ParseToken(const std::string& word) {
- if (base::StartsWithASCII(word, "//", false))
+ if (base::StartsWith(word, "//", base::CompareCase::INSENSITIVE_ASCII))
return kTokenComment;
- if (base::StartsWithASCII(word, "0x", false))
+ if (base::StartsWith(word, "0x", base::CompareCase::INSENSITIVE_ASCII))
return kConfigGPUDeviceID;
for (int32 i = 0; i < kNumberOfExactMatchTokens; ++i) {
@@ -174,8 +187,8 @@ bool GPUTestExpectationsParser::LoadTestExpectations(const std::string& data) {
entries_.clear();
error_messages_.clear();
- std::vector<std::string> lines;
- base::SplitString(data, '\n', &lines);
+ std::vector<std::string> lines = base::SplitString(
+ data, "\n", base::TRIM_WHITESPACE, base::SPLIT_WANT_ALL);
bool rt = true;
for (size_t i = 0; i < lines.size(); ++i) {
if (!ParseLine(lines[i], i + 1))
@@ -221,8 +234,9 @@ GPUTestExpectationsParser::GetErrorMessages() const {
bool GPUTestExpectationsParser::ParseConfig(
const std::string& config_data, GPUTestConfig* config) {
DCHECK(config);
- std::vector<std::string> tokens;
- base::SplitStringAlongWhitespace(config_data, &tokens);
+ std::vector<std::string> tokens = base::SplitString(
+ config_data, base::kWhitespaceASCII, base::KEEP_WHITESPACE,
+ base::SPLIT_WANT_NONEMPTY);
for (size_t i = 0; i < tokens.size(); ++i) {
Token token = ParseToken(tokens[i]);
@@ -231,6 +245,7 @@ bool GPUTestExpectationsParser::ParseConfig(
case kConfigWinVista:
case kConfigWin7:
case kConfigWin8:
+ case kConfigWin10:
case kConfigWin:
case kConfigMacLeopard:
case kConfigMacSnowLeopard:
@@ -248,6 +263,10 @@ bool GPUTestExpectationsParser::ParseConfig(
case kConfigVMWare:
case kConfigRelease:
case kConfigDebug:
+ case kConfigD3D9:
+ case kConfigD3D11:
+ case kConfigGLDesktop:
+ case kConfigGLES:
case kConfigGPUDeviceID:
if (token == kConfigGPUDeviceID) {
if (!UpdateTestConfig(config, tokens[i], 0))
@@ -266,8 +285,9 @@ bool GPUTestExpectationsParser::ParseConfig(
bool GPUTestExpectationsParser::ParseLine(
const std::string& line_data, size_t line_number) {
- std::vector<std::string> tokens;
- base::SplitStringAlongWhitespace(line_data, &tokens);
+ std::vector<std::string> tokens = base::SplitString(
+ line_data, base::kWhitespaceASCII, base::KEEP_WHITESPACE,
+ base::SPLIT_WANT_NONEMPTY);
int32 stage = kLineParserBegin;
GPUTestExpectationEntry entry;
entry.line_number = line_number;
@@ -283,6 +303,7 @@ bool GPUTestExpectationsParser::ParseLine(
case kConfigWinVista:
case kConfigWin7:
case kConfigWin8:
+ case kConfigWin10:
case kConfigWin:
case kConfigMacLeopard:
case kConfigMacSnowLeopard:
@@ -300,6 +321,10 @@ bool GPUTestExpectationsParser::ParseLine(
case kConfigVMWare:
case kConfigRelease:
case kConfigDebug:
+ case kConfigD3D9:
+ case kConfigD3D11:
+ case kConfigGLDesktop:
+ case kConfigGLES:
case kConfigGPUDeviceID:
// MODIFIERS, could be in any order, need at least one.
if (stage != kLineParserConfigs && stage != kLineParserBugID) {
@@ -398,6 +423,7 @@ bool GPUTestExpectationsParser::UpdateTestConfig(
case kConfigWinVista:
case kConfigWin7:
case kConfigWin8:
+ case kConfigWin10:
case kConfigWin:
case kConfigMacLeopard:
case kConfigMacSnowLeopard:
@@ -445,6 +471,17 @@ bool GPUTestExpectationsParser::UpdateTestConfig(
config->set_build_type(
config->build_type() | kTokenData[token].flag);
break;
+ case kConfigD3D9:
+ case kConfigD3D11:
+ case kConfigGLDesktop:
+ case kConfigGLES:
+ if ((config->api() & kTokenData[token].flag) != 0) {
+ PushErrorMessage(kErrorMessage[kErrorEntryWithAPIConflicts],
+ line_number);
+ return false;
+ }
+ config->set_api(config->api() | kTokenData[token].flag);
+ break;
default:
DCHECK(false);
break;
diff --git a/chromium/gpu/config/gpu_test_expectations_parser_unittest.cc b/chromium/gpu/config/gpu_test_expectations_parser_unittest.cc
index 0639a776d8d..126394ce83c 100644
--- a/chromium/gpu/config/gpu_test_expectations_parser_unittest.cc
+++ b/chromium/gpu/config/gpu_test_expectations_parser_unittest.cc
@@ -26,6 +26,7 @@ static const struct TestOsWithFamily {
{ { "VISTA", GPUTestConfig::kOsWinVista }, kOsFamilyWin },
{ { "WIN7", GPUTestConfig::kOsWin7 }, kOsFamilyWin },
{ { "WIN8", GPUTestConfig::kOsWin8 }, kOsFamilyWin },
+ { { "WIN10", GPUTestConfig::kOsWin10 }, kOsFamilyWin },
{ { "LEOPARD", GPUTestConfig::kOsMacLeopard }, kOsFamilyMac },
{ { "SNOWLEOPARD", GPUTestConfig::kOsMacSnowLeopard }, kOsFamilyMac },
{ { "LION", GPUTestConfig::kOsMacLion }, kOsFamilyMac },
@@ -70,6 +71,7 @@ class GPUTestExpectationsParserTest : public testing::Test {
bot_config_.set_build_type(GPUTestConfig::kBuildTypeRelease);
bot_config_.AddGPUVendor(0x10de);
bot_config_.set_gpu_device_id(0x0640);
+ bot_config_.set_api(GPUTestConfig::kAPID3D11);
ASSERT_TRUE(bot_config_.IsValid());
}
@@ -165,7 +167,7 @@ TEST_F(GPUTestExpectationsParserTest, ValidUnrelatedTestEntry) {
TEST_F(GPUTestExpectationsParserTest, AllModifiers) {
const std::string text =
- "BUG12345 XP VISTA WIN7 WIN8 LEOPARD SNOWLEOPARD LION MOUNTAINLION "
+ "BUG12345 XP VISTA WIN7 WIN8 WIN10 LEOPARD SNOWLEOPARD LION MOUNTAINLION "
"MAVERICKS LINUX CHROMEOS ANDROID "
"NVIDIA INTEL AMD VMWARE RELEASE DEBUG : MyTest = "
"PASS FAIL FLAKY TIMEOUT SKIP";
@@ -194,8 +196,8 @@ TEST_P(GPUTestExpectationsParserParamTest, DuplicateModifiers) {
TEST_F(GPUTestExpectationsParserTest, AllModifiersLowerCase) {
const std::string text =
- "BUG12345 xp vista win7 leopard snowleopard lion linux chromeos android "
- "nvidia intel amd vmware release debug : MyTest = "
+ "BUG12345 xp vista win7 win8 win10 leopard snowleopard lion linux "
+ "chromeos android nvidia intel amd vmware release debug : MyTest = "
"pass fail flaky timeout skip";
GPUTestExpectationsParser parser;
@@ -320,6 +322,25 @@ TEST_F(GPUTestExpectationsParserTest, StarMatching) {
parser.GetTestExpectation("OtherTest", bot_config()));
}
+TEST_F(GPUTestExpectationsParserTest, ValidAPI) {
+ const std::string text =
+ "BUG12345 WIN7 NVIDIA D3D9 D3D11 OPENGL GLES : MyTest = FAIL";
+
+ GPUTestExpectationsParser parser;
+ EXPECT_TRUE(parser.LoadTestExpectations(text));
+ EXPECT_EQ(0u, parser.GetErrorMessages().size());
+ EXPECT_EQ(GPUTestExpectationsParser::kGpuTestFail,
+ parser.GetTestExpectation("MyTest", bot_config()));
+}
+
+TEST_F(GPUTestExpectationsParserTest, MultipleAPIsConflict) {
+ const std::string text = "BUG12345 WIN7 NVIDIA D3D9 D3D9 : MyTest = FAIL";
+
+ GPUTestExpectationsParser parser;
+ EXPECT_FALSE(parser.LoadTestExpectations(text));
+ EXPECT_NE(0u, parser.GetErrorMessages().size());
+}
+
INSTANTIATE_TEST_CASE_P(GPUTestExpectationsParser,
GPUTestExpectationsParserParamTest,
::testing::ValuesIn(kOSVersionsWithFamily));
diff --git a/chromium/gpu/config/gpu_util.cc b/chromium/gpu/config/gpu_util.cc
index 5d679881698..80a99fba4e6 100644
--- a/chromium/gpu/config/gpu_util.cc
+++ b/chromium/gpu/config/gpu_util.cc
@@ -34,11 +34,11 @@ std::string IntSetToString(const std::set<int>& list) {
void StringToIntSet(const std::string& str, std::set<int>* list) {
DCHECK(list);
- std::vector<std::string> pieces;
- base::SplitString(str, ',', &pieces);
- for (size_t i = 0; i < pieces.size(); ++i) {
+ for (const base::StringPiece& piece :
+ base::SplitStringPiece(str, ",", base::TRIM_WHITESPACE,
+ base::SPLIT_WANT_ALL)) {
int number = 0;
- bool succeed = base::StringToInt(pieces[i], &number);
+ bool succeed = base::StringToInt(piece, &number);
DCHECK(succeed);
list->insert(number);
}
diff --git a/chromium/gpu/config/software_rendering_list_json.cc b/chromium/gpu/config/software_rendering_list_json.cc
index a4cf2b088fe..cf157c51c3f 100644
--- a/chromium/gpu/config/software_rendering_list_json.cc
+++ b/chromium/gpu/config/software_rendering_list_json.cc
@@ -18,7 +18,7 @@ const char kSoftwareRenderingListJson[] = LONG_STRING_CONST(
{
"name": "software rendering list",
// Please update the version number whenever you change this file.
- "version": "10.9",
+ "version": "10.11",
"entries": [
{
"id": 1,
@@ -733,10 +733,11 @@ const char kSoftwareRenderingListJson[] = LONG_STRING_CONST(
LONG_STRING_CONST(
{
"id": 76,
- "description": "WebGL is disabled on Android unless GPU reset notification is supported",
+ "description": "WebGL is disabled on Android unless the GPU runs in a separate process or reset notification is supported",
"os": {
"type": "android"
},
+ "in_process_gpu": true,
"exceptions": [
{
"gl_reset_notification_strategy": {
@@ -745,7 +746,7 @@ LONG_STRING_CONST(
}
},
{
- "gl_renderer": "Mali-400.*",
+ "gl_renderer": "Mali-4.*",
"gl_extensions": ".*EXT_robustness.*"
}
],
@@ -1011,9 +1012,13 @@ LONG_STRING_CONST(
},
{
"os": {
- "type": "android"
+ "type": "android",
+ "version": {
+ "op": ">=",
+ "value": "4.4"
+ }
},
- "gl_renderer": "Mali-400.*"
+ "gl_renderer": "Mali-4.*"
},
{
"os": {
@@ -1023,12 +1028,6 @@ LONG_STRING_CONST(
},
{
"os": {
- "type": "android"
- },
- "gl_renderer": "VideoCore IV.*"
- },
- {
- "os": {
"type": "android",
"version": {
"op": ">=",
diff --git a/chromium/gpu/gl_tests_apk.isolate b/chromium/gpu/gl_tests_apk.isolate
new file mode 100644
index 00000000000..8abb49712e1
--- /dev/null
+++ b/chromium/gpu/gl_tests_apk.isolate
@@ -0,0 +1,17 @@
+# Copyright 2015 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.
+{
+ 'includes': [
+ '../build/android/android.isolate',
+ ],
+ 'variables': {
+ 'command': [
+ '<(PRODUCT_DIR)/bin/run_gl_tests',
+ ],
+ 'files': [
+ '<(PRODUCT_DIR)/bin/run_gl_tests',
+ '<(PRODUCT_DIR)/gl_tests_apk/',
+ ]
+ },
+}
diff --git a/chromium/gpu/gles2_conform_support/BUILD.gn b/chromium/gpu/gles2_conform_support/BUILD.gn
index c91ecb31795..87f03624a38 100644
--- a/chromium/gpu/gles2_conform_support/BUILD.gn
+++ b/chromium/gpu/gles2_conform_support/BUILD.gn
@@ -2,6 +2,11 @@
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
+declare_args() {
+ # Set to true to compile with the OpenGL ES 2.0 conformance tests.
+ internal_gles2_conform_tests = false
+}
+
import("//build/config/allocator.gni")
import("//testing/test.gni")
@@ -21,10 +26,11 @@ executable("gles2_conform_support") {
]
deps = [
"//base",
- "//gpu/gles2_conform_support/egl",
"//base/third_party/dynamic_annotations",
- "//ui/gl",
+ "//build/config/sanitizers:deps",
"//gpu/command_buffer/client:gles2_c_lib_nocheck",
+ "//gpu/gles2_conform_support/egl",
+ "//ui/gl",
]
if (is_linux) {
sources += [
@@ -41,46 +47,50 @@ executable("gles2_conform_support") {
if (internal_gles2_conform_tests) {
action("generate_gles2_conform_embedded_data") {
script = "generate_gles2_embedded_data.py"
- output = [
- "$target_gen_dir/gles2_conform_test_embedded_data/FilesData.c",
- "$target_gen_dir/gles2_conform_test_embedded_data/FilesData.h",
+ outputs = [
+ "$target_gen_dir/gles2_conform_test_embedded_data/FilesDATA.c",
+ "$target_gen_dir/gles2_conform_test_embedded_data/FilesDATA.h",
"$target_gen_dir/gles2_conform_test_embedded_data/FilesTOC.c",
]
args = [
- "../../third_party/gles2_conform/GTF_ES/glsl/GTF",
- "$target_gen_dir/gles2_conform_test_embedded_data",
+ rebase_path("//third_party/gles2_conform/GTF_ES/glsl/GTF"),
+ rebase_path("$target_gen_dir/gles2_conform_test_embedded_data"),
]
}
- gles2_conform_gypi = exec_script("//build/gypi_to_gn.py",
- [ rebase_path("gles2_conform_gypi") ],
- "scoped",
- [ "gles2_conform_gypi" ])
+ gles2_conform_gypi =
+ exec_script("//build/gypi_to_gn.py",
+ [
+ rebase_path("gles2_conform.gypi"),
+ "--replace=<(DEPTH)=../..",
+ "--replace=<(SHARED_INTERMEDIATE_DIR)=$target_gen_dir",
+ ],
+ "scope",
+ [ "gles2_conform.gypi" ])
executable("gles2_conform_test_windowless") {
testonly = true
- sources = [
- # Include a dummy c++ file to force linking of libstdc++.
- "dummy.cc",
- gles2_conform_gypi.gtf_es_sources,
- ]
+
+ # Include a dummy c++ file to force linking of libstdc++.
+ sources = [ "dummy.cc" ] + gles2_conform_gypi.gtf_es_sources
defines = [
"GTF_API=GTF_GLES20",
"HKEMBEDDEDFILESYSTEM",
]
deps = [
":generate_gles2_conform_embedded_data",
+ "//build/config/sanitizers:deps",
+ "//gpu/command_buffer/client:gles2_c_lib_nocheck",
"//gpu/gles2_conform_support/egl",
"//gpu/gles2_conform_support/native:windowless",
- "//gpu/command_buffer/client:gles2_c_libnocheck",
]
+ configs += [ "//build/config/compiler:no_incompatible_pointer_warnings" ]
if (is_linux) {
if (!is_chromeos) {
- deps += [ "//build/linux/system/gtk" ]
+ deps += [ "//build/config/linux/gtk2" ]
if (is_clang) {
cflags = [
"-Wno-array-bounds",
"-Wno-implicit-function-declaration",
- "-Wno-incompatible-pointer-types",
"-Wno-parentheses-equality",
"-Wno-pointer-sign",
"-Wno-return-type",
@@ -153,6 +163,15 @@ if (internal_gles2_conform_tests) {
}
}
+# TODO(GYP): Delete this after we've converted everything to GN.
+# The _run targets exist only for compatibility w/ GYP.
+group("gles2_conform_test_run") {
+ testonly = true
+ deps = [
+ ":gles2_conform_test",
+ ]
+}
+
test("gles2_conform_test") {
sources = [
"gles2_conform_test.cc",
@@ -162,7 +181,14 @@ test("gles2_conform_test") {
"//gpu/config",
"//testing/gtest",
]
+
+ data = [
+ "gles2_conform_test_expectations.txt",
+ ]
+
if (internal_gles2_conform_tests) {
- deps += [ "gles2_conform_test_windowless" ]
+ deps += [ ":gles2_conform_test_windowless" ]
+ # TODO: Make these tests pull in the correct data dependencies once they
+ # are exported in GN. Maybe from //third_party/gles2_conform/GTF_ES/
}
}
diff --git a/chromium/gpu/gles2_conform_support/egl/display.cc b/chromium/gpu/gles2_conform_support/egl/display.cc
index dce6599acf0..546184d1a7f 100644
--- a/chromium/gpu/gles2_conform_support/egl/display.cc
+++ b/chromium/gpu/gles2_conform_support/egl/display.cc
@@ -5,6 +5,7 @@
#include "gpu/gles2_conform_support/egl/display.h"
#include <vector>
+#include "base/at_exit.h"
#include "base/bind.h"
#include "base/bind_helpers.h"
#include "gpu/command_buffer/client/gles2_implementation.h"
@@ -29,6 +30,9 @@ namespace egl {
Display::Display(EGLNativeDisplayType display_id)
: display_id_(display_id),
is_initialized_(false),
+#if defined(COMMAND_BUFFER_GLES_LIB_SUPPORT_ONLY)
+ exit_manager_(new base::AtExitManager),
+#endif
create_offscreen_(false),
create_offscreen_width_(0),
create_offscreen_height_(0) {
@@ -107,7 +111,8 @@ EGLSurface Display::CreateWindowSurface(EGLConfig config,
}
{
- gpu::TransferBufferManager* manager = new gpu::TransferBufferManager();
+ gpu::TransferBufferManager* manager =
+ new gpu::TransferBufferManager(nullptr);
transfer_buffer_manager_ = manager;
manager->Initialize();
}
@@ -116,14 +121,9 @@ EGLSurface Display::CreateWindowSurface(EGLConfig config,
if (!command_buffer->Initialize())
return NULL;
- scoped_refptr<gpu::gles2::ContextGroup> group(
- new gpu::gles2::ContextGroup(NULL,
- NULL,
- new gpu::gles2::ShaderTranslatorCache,
- NULL,
- NULL,
- NULL,
- true));
+ scoped_refptr<gpu::gles2::ContextGroup> group(new gpu::gles2::ContextGroup(
+ NULL, NULL, new gpu::gles2::ShaderTranslatorCache,
+ new gpu::gles2::FramebufferCompletenessCache, NULL, NULL, NULL, true));
decoder_.reset(gpu::gles2::GLES2Decoder::Create(group.get()));
if (!decoder_.get())
@@ -344,4 +344,12 @@ bool Display::IsGpuChannelLost() {
return false;
}
+gpu::CommandBufferNamespace Display::GetNamespaceID() const {
+ return gpu::CommandBufferNamespace::IN_PROCESS;
+}
+
+uint64_t Display::GetCommandBufferID() const {
+ return 0;
+}
+
} // namespace egl
diff --git a/chromium/gpu/gles2_conform_support/egl/display.h b/chromium/gpu/gles2_conform_support/egl/display.h
index adf39490f73..8954c2a97ab 100644
--- a/chromium/gpu/gles2_conform_support/egl/display.h
+++ b/chromium/gpu/gles2_conform_support/egl/display.h
@@ -30,6 +30,10 @@ class GLES2Implementation;
} // namespace gles2
} // namespace gpu
+namespace base {
+class AtExitManager;
+} // namespace base
+
namespace egl {
class Config;
@@ -94,11 +98,21 @@ class Display : private gpu::GpuControl {
uint32 CreateStreamTexture(uint32 texture_id) override;
void SetLock(base::Lock*) override;
bool IsGpuChannelLost() override;
+ gpu::CommandBufferNamespace GetNamespaceID() const override;
+ uint64_t GetCommandBufferID() const override;
private:
EGLNativeDisplayType display_id_;
bool is_initialized_;
+
+// elg::Display is used for comformance tests and command_buffer_gles. We only
+// need the exit manager for the command_buffer_gles library.
+// TODO(hendrikw): Find a cleaner solution for this.
+#if defined(COMMAND_BUFFER_GLES_LIB_SUPPORT_ONLY)
+ scoped_ptr<base::AtExitManager> exit_manager_;
+#endif // COMMAND_BUFFER_GLES_LIB_SUPPORT_ONLY
+
bool create_offscreen_;
int create_offscreen_width_;
int create_offscreen_height_;
diff --git a/chromium/gpu/gles2_conform_support/egl/egl.cc b/chromium/gpu/gles2_conform_support/egl/egl.cc
index f23cf76e994..e64285a02ea 100644
--- a/chromium/gpu/gles2_conform_support/egl/egl.cc
+++ b/chromium/gpu/gles2_conform_support/egl/egl.cc
@@ -85,16 +85,18 @@ EGLint ValidateDisplayContext(EGLDisplay dpy, EGLContext context) {
} // namespace
extern "C" {
-EGLint eglGetError() {
+EGLAPI EGLint EGLAPIENTRY eglGetError() {
// TODO(alokp): Fix me.
return EGL_SUCCESS;
}
-EGLDisplay eglGetDisplay(EGLNativeDisplayType display_id) {
+EGLAPI EGLDisplay EGLAPIENTRY eglGetDisplay(EGLNativeDisplayType display_id) {
return new egl::Display(display_id);
}
-EGLBoolean eglInitialize(EGLDisplay dpy, EGLint *major, EGLint *minor) {
+EGLAPI EGLBoolean EGLAPIENTRY eglInitialize(EGLDisplay dpy,
+ EGLint* major,
+ EGLint* minor) {
if (dpy == EGL_NO_DISPLAY)
return EglError(EGL_BAD_DISPLAY, EGL_FALSE);
@@ -102,19 +104,21 @@ EGLBoolean eglInitialize(EGLDisplay dpy, EGLint *major, EGLint *minor) {
if (!display->Initialize())
return EglError(EGL_NOT_INITIALIZED, EGL_FALSE);
- int argc = 1;
- const char* const argv[] = {
- "dummy"
- };
- base::CommandLine::Init(argc, argv);
- gfx::GLSurface::InitializeOneOff();
+ // eglInitialize can be called multiple times, prevent InitializeOneOff from
+ // being called multiple times.
+ if (gfx::GetGLImplementation() == gfx::kGLImplementationNone) {
+ int argc = 1;
+ const char* const argv[] = {"dummy"};
+ base::CommandLine::Init(argc, argv);
+ gfx::GLSurface::InitializeOneOff();
+ }
*major = 1;
*minor = 4;
return EglSuccess(EGL_TRUE);
}
-EGLBoolean eglTerminate(EGLDisplay dpy) {
+EGLAPI EGLBoolean EGLAPIENTRY eglTerminate(EGLDisplay dpy) {
EGLint error_code = ValidateDisplay(dpy);
if (error_code != EGL_SUCCESS)
return EglError(error_code, EGL_FALSE);
@@ -125,7 +129,7 @@ EGLBoolean eglTerminate(EGLDisplay dpy) {
return EglSuccess(EGL_TRUE);
}
-const char* eglQueryString(EGLDisplay dpy, EGLint name) {
+EGLAPI const char* EGLAPIENTRY eglQueryString(EGLDisplay dpy, EGLint name) {
EGLint error_code = ValidateDisplay(dpy);
if (error_code != EGL_SUCCESS)
return EglError(error_code, static_cast<const char*>(NULL));
@@ -144,11 +148,11 @@ const char* eglQueryString(EGLDisplay dpy, EGLint name) {
}
}
-EGLBoolean eglChooseConfig(EGLDisplay dpy,
- const EGLint* attrib_list,
- EGLConfig* configs,
- EGLint config_size,
- EGLint* num_config) {
+EGLAPI EGLBoolean EGLAPIENTRY eglChooseConfig(EGLDisplay dpy,
+ const EGLint* attrib_list,
+ EGLConfig* configs,
+ EGLint config_size,
+ EGLint* num_config) {
EGLint error_code = ValidateDisplay(dpy);
if (error_code != EGL_SUCCESS)
return EglError(error_code, EGL_FALSE);
@@ -163,10 +167,10 @@ EGLBoolean eglChooseConfig(EGLDisplay dpy,
return EglSuccess(EGL_TRUE);
}
-EGLBoolean eglGetConfigs(EGLDisplay dpy,
- EGLConfig* configs,
- EGLint config_size,
- EGLint* num_config) {
+EGLAPI EGLBoolean EGLAPIENTRY eglGetConfigs(EGLDisplay dpy,
+ EGLConfig* configs,
+ EGLint config_size,
+ EGLint* num_config) {
EGLint error_code = ValidateDisplay(dpy);
if (error_code != EGL_SUCCESS)
return EglError(error_code, EGL_FALSE);
@@ -181,10 +185,10 @@ EGLBoolean eglGetConfigs(EGLDisplay dpy,
return EglSuccess(EGL_TRUE);
}
-EGLBoolean eglGetConfigAttrib(EGLDisplay dpy,
- EGLConfig config,
- EGLint attribute,
- EGLint* value) {
+EGLAPI EGLBoolean EGLAPIENTRY eglGetConfigAttrib(EGLDisplay dpy,
+ EGLConfig config,
+ EGLint attribute,
+ EGLint* value) {
EGLint error_code = ValidateDisplayConfig(dpy, config);
if (error_code != EGL_SUCCESS)
return EglError(error_code, EGL_FALSE);
@@ -196,10 +200,11 @@ EGLBoolean eglGetConfigAttrib(EGLDisplay dpy,
return EglSuccess(EGL_TRUE);
}
-EGLSurface eglCreateWindowSurface(EGLDisplay dpy,
- EGLConfig config,
- EGLNativeWindowType win,
- const EGLint* attrib_list) {
+EGLAPI EGLSurface EGLAPIENTRY
+eglCreateWindowSurface(EGLDisplay dpy,
+ EGLConfig config,
+ EGLNativeWindowType win,
+ const EGLint* attrib_list) {
EGLint error_code = ValidateDisplayConfig(dpy, config);
if (error_code != EGL_SUCCESS)
return EglError(error_code, EGL_NO_SURFACE);
@@ -215,21 +220,48 @@ EGLSurface eglCreateWindowSurface(EGLDisplay dpy,
return EglSuccess(surface);
}
-EGLSurface eglCreatePbufferSurface(EGLDisplay dpy,
- EGLConfig config,
- const EGLint* attrib_list) {
- return EGL_NO_SURFACE;
+EGLAPI EGLSurface EGLAPIENTRY
+eglCreatePbufferSurface(EGLDisplay dpy,
+ EGLConfig config,
+ const EGLint* attrib_list) {
+ EGLint error_code = ValidateDisplayConfig(dpy, config);
+ if (error_code != EGL_SUCCESS)
+ return EglError(error_code, EGL_NO_SURFACE);
+
+ egl::Display* display = static_cast<egl::Display*>(dpy);
+ int width = 1;
+ int height = 1;
+ if (attrib_list) {
+ for (const int32_t* attr = attrib_list; attr[0] != EGL_NONE; attr += 2) {
+ switch (attr[0]) {
+ case EGL_WIDTH:
+ width = attr[1];
+ break;
+ case EGL_HEIGHT:
+ height = attr[1];
+ break;
+ }
+ }
+ }
+ display->SetCreateOffscreen(width, height);
+
+ EGLSurface surface = display->CreateWindowSurface(config, 0, attrib_list);
+ if (surface == EGL_NO_SURFACE)
+ return EglError(EGL_BAD_ALLOC, EGL_NO_SURFACE);
+
+ return EglSuccess(surface);
}
-EGLSurface eglCreatePixmapSurface(EGLDisplay dpy,
- EGLConfig config,
- EGLNativePixmapType pixmap,
- const EGLint* attrib_list) {
+EGLAPI EGLSurface EGLAPIENTRY
+eglCreatePixmapSurface(EGLDisplay dpy,
+ EGLConfig config,
+ EGLNativePixmapType pixmap,
+ const EGLint* attrib_list) {
return EGL_NO_SURFACE;
}
-EGLBoolean eglDestroySurface(EGLDisplay dpy,
- EGLSurface surface) {
+EGLAPI EGLBoolean EGLAPIENTRY eglDestroySurface(EGLDisplay dpy,
+ EGLSurface surface) {
EGLint error_code = ValidateDisplaySurface(dpy, surface);
if (error_code != EGL_SUCCESS)
return EglError(error_code, EGL_FALSE);
@@ -239,64 +271,65 @@ EGLBoolean eglDestroySurface(EGLDisplay dpy,
return EglSuccess(EGL_TRUE);
}
-EGLBoolean eglQuerySurface(EGLDisplay dpy,
- EGLSurface surface,
- EGLint attribute,
- EGLint* value) {
+EGLAPI EGLBoolean EGLAPIENTRY eglQuerySurface(EGLDisplay dpy,
+ EGLSurface surface,
+ EGLint attribute,
+ EGLint* value) {
return EGL_FALSE;
}
-EGLBoolean eglBindAPI(EGLenum api) {
+EGLAPI EGLBoolean EGLAPIENTRY eglBindAPI(EGLenum api) {
return EGL_FALSE;
}
-EGLenum eglQueryAPI() {
+EGLAPI EGLenum EGLAPIENTRY eglQueryAPI() {
return EGL_OPENGL_ES_API;
}
-EGLBoolean eglWaitClient(void) {
+EGLAPI EGLBoolean EGLAPIENTRY eglWaitClient(void) {
return EGL_FALSE;
}
-EGLBoolean eglReleaseThread(void) {
+EGLAPI EGLBoolean EGLAPIENTRY eglReleaseThread(void) {
return EGL_FALSE;
}
-EGLSurface eglCreatePbufferFromClientBuffer(EGLDisplay dpy,
- EGLenum buftype,
- EGLClientBuffer buffer,
- EGLConfig config,
- const EGLint* attrib_list) {
+EGLAPI EGLSurface EGLAPIENTRY
+eglCreatePbufferFromClientBuffer(EGLDisplay dpy,
+ EGLenum buftype,
+ EGLClientBuffer buffer,
+ EGLConfig config,
+ const EGLint* attrib_list) {
return EGL_NO_SURFACE;
}
-EGLBoolean eglSurfaceAttrib(EGLDisplay dpy,
- EGLSurface surface,
- EGLint attribute,
- EGLint value) {
+EGLAPI EGLBoolean EGLAPIENTRY eglSurfaceAttrib(EGLDisplay dpy,
+ EGLSurface surface,
+ EGLint attribute,
+ EGLint value) {
return EGL_FALSE;
}
-EGLBoolean eglBindTexImage(EGLDisplay dpy,
- EGLSurface surface,
- EGLint buffer) {
+EGLAPI EGLBoolean EGLAPIENTRY eglBindTexImage(EGLDisplay dpy,
+ EGLSurface surface,
+ EGLint buffer) {
return EGL_FALSE;
}
-EGLBoolean eglReleaseTexImage(EGLDisplay dpy,
- EGLSurface surface,
- EGLint buffer) {
+EGLAPI EGLBoolean EGLAPIENTRY eglReleaseTexImage(EGLDisplay dpy,
+ EGLSurface surface,
+ EGLint buffer) {
return EGL_FALSE;
}
-EGLBoolean eglSwapInterval(EGLDisplay dpy, EGLint interval) {
+EGLAPI EGLBoolean EGLAPIENTRY eglSwapInterval(EGLDisplay dpy, EGLint interval) {
return EGL_FALSE;
}
-EGLContext eglCreateContext(EGLDisplay dpy,
- EGLConfig config,
- EGLContext share_context,
- const EGLint* attrib_list) {
+EGLAPI EGLContext EGLAPIENTRY eglCreateContext(EGLDisplay dpy,
+ EGLConfig config,
+ EGLContext share_context,
+ const EGLint* attrib_list) {
EGLint error_code = ValidateDisplayConfig(dpy, config);
if (error_code != EGL_SUCCESS)
return EglError(error_code, EGL_NO_CONTEXT);
@@ -316,7 +349,8 @@ EGLContext eglCreateContext(EGLDisplay dpy,
return EglSuccess(context);
}
-EGLBoolean eglDestroyContext(EGLDisplay dpy, EGLContext ctx) {
+EGLAPI EGLBoolean EGLAPIENTRY eglDestroyContext(EGLDisplay dpy,
+ EGLContext ctx) {
EGLint error_code = ValidateDisplayContext(dpy, ctx);
if (error_code != EGL_SUCCESS)
return EglError(error_code, EGL_FALSE);
@@ -326,10 +360,10 @@ EGLBoolean eglDestroyContext(EGLDisplay dpy, EGLContext ctx) {
return EGL_TRUE;
}
-EGLBoolean eglMakeCurrent(EGLDisplay dpy,
- EGLSurface draw,
- EGLSurface read,
- EGLContext ctx) {
+EGLAPI EGLBoolean EGLAPIENTRY eglMakeCurrent(EGLDisplay dpy,
+ EGLSurface draw,
+ EGLSurface read,
+ EGLContext ctx) {
if (ctx != EGL_NO_CONTEXT) {
EGLint error_code = ValidateDisplaySurface(dpy, draw);
if (error_code != EGL_SUCCESS)
@@ -353,34 +387,35 @@ EGLBoolean eglMakeCurrent(EGLDisplay dpy,
return EGL_TRUE;
}
-EGLContext eglGetCurrentContext() {
+EGLAPI EGLContext EGLAPIENTRY eglGetCurrentContext() {
return EGL_NO_CONTEXT;
}
-EGLSurface eglGetCurrentSurface(EGLint readdraw) {
+EGLAPI EGLSurface EGLAPIENTRY eglGetCurrentSurface(EGLint readdraw) {
return EGL_NO_SURFACE;
}
-EGLDisplay eglGetCurrentDisplay() {
+EGLAPI EGLDisplay EGLAPIENTRY eglGetCurrentDisplay() {
return EGL_NO_DISPLAY;
}
-EGLBoolean eglQueryContext(EGLDisplay dpy,
- EGLContext ctx,
- EGLint attribute,
- EGLint* value) {
+EGLAPI EGLBoolean EGLAPIENTRY eglQueryContext(EGLDisplay dpy,
+ EGLContext ctx,
+ EGLint attribute,
+ EGLint* value) {
return EGL_FALSE;
}
-EGLBoolean eglWaitGL() {
+EGLAPI EGLBoolean EGLAPIENTRY eglWaitGL() {
return EGL_FALSE;
}
-EGLBoolean eglWaitNative(EGLint engine) {
+EGLAPI EGLBoolean EGLAPIENTRY eglWaitNative(EGLint engine) {
return EGL_FALSE;
}
-EGLBoolean eglSwapBuffers(EGLDisplay dpy, EGLSurface surface) {
+EGLAPI EGLBoolean EGLAPIENTRY eglSwapBuffers(EGLDisplay dpy,
+ EGLSurface surface) {
EGLint error_code = ValidateDisplaySurface(dpy, surface);
if (error_code != EGL_SUCCESS)
return EglError(error_code, EGL_FALSE);
@@ -390,15 +425,16 @@ EGLBoolean eglSwapBuffers(EGLDisplay dpy, EGLSurface surface) {
return EglSuccess(EGL_TRUE);
}
-EGLBoolean eglCopyBuffers(EGLDisplay dpy,
- EGLSurface surface,
- EGLNativePixmapType target) {
+EGLAPI EGLBoolean EGLAPIENTRY eglCopyBuffers(EGLDisplay dpy,
+ EGLSurface surface,
+ EGLNativePixmapType target) {
return EGL_FALSE;
}
/* Now, define eglGetProcAddress using the generic function ptr. type */
-__eglMustCastToProperFunctionPointerType
+EGLAPI __eglMustCastToProperFunctionPointerType EGLAPIENTRY
eglGetProcAddress(const char* procname) {
- return gles2::GetGLFunctionPointer(procname);
+ return reinterpret_cast<__eglMustCastToProperFunctionPointerType>(
+ gles2::GetGLFunctionPointer(procname));
}
} // extern "C"
diff --git a/chromium/gpu/gles2_conform_support/gles2_conform_support.gyp b/chromium/gpu/gles2_conform_support/gles2_conform_support.gyp
index 3835c4bfc8f..cfc6cc7d340 100644
--- a/chromium/gpu/gles2_conform_support/gles2_conform_support.gyp
+++ b/chromium/gpu/gles2_conform_support/gles2_conform_support.gyp
@@ -40,7 +40,6 @@
'../../gpu/gpu.gyp:gpu',
'../../third_party/khronos/khronos.gyp:khronos_headers',
'../../ui/base/ui_base.gyp:ui_base',
- '../../ui/gfx/gfx.gyp:gfx',
'../../ui/gfx/gfx.gyp:gfx_geometry',
'../../ui/gl/gl.gyp:gl',
],
diff --git a/chromium/gpu/gles2_conform_support/gles2_conform_test.cc b/chromium/gpu/gles2_conform_support/gles2_conform_test.cc
index 906e1af2754..42964e41ada 100644
--- a/chromium/gpu/gles2_conform_support/gles2_conform_test.cc
+++ b/chromium/gpu/gles2_conform_support/gles2_conform_test.cc
@@ -44,6 +44,36 @@ bool RunGLES2ConformTest(const char* path) {
LOG(ERROR) << "Fail to load bot configuration";
return false;
}
+
+ // Set the bot config api based on the OS and command line
+ base::CommandLine* current_cmd_line = base::CommandLine::ForCurrentProcess();
+ int32 config_os = bot_config.os();
+ if ((config_os & gpu::GPUTestConfig::kOsWin) != 0) {
+ std::string angle_renderer =
+ current_cmd_line->HasSwitch("use-angle")
+ ? current_cmd_line->GetSwitchValueASCII("use-angle")
+ : "d3d11";
+ if (angle_renderer == "d3d11") {
+ bot_config.set_api(gpu::GPUTestConfig::kAPID3D11);
+ } else if (angle_renderer == "d3d9") {
+ bot_config.set_api(gpu::GPUTestConfig::kAPID3D9);
+ } else if (angle_renderer == "gl") {
+ bot_config.set_api(gpu::GPUTestConfig::kAPIGLDesktop);
+ } else if (angle_renderer == "gles") {
+ bot_config.set_api(gpu::GPUTestConfig::kAPIGLES);
+ } else {
+ bot_config.set_api(gpu::GPUTestConfig::kAPIUnknown);
+ }
+ } else if ((config_os & gpu::GPUTestConfig::kOsMac) != 0 ||
+ config_os == gpu::GPUTestConfig::kOsLinux) {
+ bot_config.set_api(gpu::GPUTestConfig::kAPIGLDesktop);
+ } else if (config_os == gpu::GPUTestConfig::kOsChromeOS ||
+ config_os == gpu::GPUTestConfig::kOsAndroid) {
+ bot_config.set_api(gpu::GPUTestConfig::kAPIGLES);
+ } else {
+ bot_config.set_api(gpu::GPUTestConfig::kAPIUnknown);
+ }
+
if (!bot_config.IsValid()) {
LOG(ERROR) << "Invalid bot configuration";
return false;
@@ -63,14 +93,13 @@ bool RunGLES2ConformTest(const char* path) {
base::FilePath program(test_path.Append(FILE_PATH_LITERAL(
"gles2_conform_test_windowless")));
- base::CommandLine* currentCmdLine = base::CommandLine::ForCurrentProcess();
- base::CommandLine cmdline(program);
- cmdline.AppendArguments(*currentCmdLine, false);
- cmdline.AppendSwitch(std::string("--"));
- cmdline.AppendArg(std::string("-run=") + path);
+ base::CommandLine cmd_line(program);
+ cmd_line.AppendArguments(*current_cmd_line, false);
+ cmd_line.AppendSwitch(std::string("--"));
+ cmd_line.AppendArg(std::string("-run=") + path);
std::string output;
- bool success = base::GetAppOutput(cmdline, &output);
+ bool success = base::GetAppOutput(cmd_line, &output);
if (success) {
size_t success_index = output.find("Conformance PASSED all");
size_t failed_index = output.find("FAILED");
diff --git a/chromium/gpu/gles2_conform_support/gles2_conform_test.gyp b/chromium/gpu/gles2_conform_support/gles2_conform_test.gyp
index 1f23efa3c3c..0571dd890ca 100644
--- a/chromium/gpu/gles2_conform_support/gles2_conform_test.gyp
+++ b/chromium/gpu/gles2_conform_support/gles2_conform_test.gyp
@@ -108,7 +108,7 @@
['OS=="linux"', {
'conditions': [
[ 'chromeos==0', {
- 'dependencies': ['../../build/linux/system.gyp:gtk']
+ 'dependencies': ['../../build/linux/system.gyp:gtk2']
}],
[ 'clang==1', {
'cflags': [
diff --git a/chromium/gpu/gles2_conform_support/gles2_conform_test_expectations.txt b/chromium/gpu/gles2_conform_support/gles2_conform_test_expectations.txt
index 76b7431eec8..4e2d45262cf 100644
--- a/chromium/gpu/gles2_conform_support/gles2_conform_test_expectations.txt
+++ b/chromium/gpu/gles2_conform_support/gles2_conform_test_expectations.txt
@@ -24,6 +24,21 @@
// 91531 MAC WIN LINUX : conformance_more_* = SKIP
// 91532 MAC NVIDIA 0x0640 : tex_image_and_sub_image_2d_with_video = PASS FAIL
+517966 WIN OPENGL : GL2FixedTests_blend_input_run = FAIL
+517966 WIN OPENGL : GL2FixedTests_buffer_clear_input_run = FAIL
+517966 WIN OPENGL : GL2FixedTests_buffer_color_input_run = FAIL
+517966 WIN OPENGL : GL2FixedTests_copy_texture_input_run = FAIL
+517966 WIN OPENGL : GL2FixedTests_depth_buffer_clear_input_run = FAIL
+517966 WIN OPENGL : GL2FixedTests_stencil_plane_clear_input_run = FAIL
+517966 WIN OPENGL : GL2FixedTests_user_clip_planes_input_run = FAIL
+517966 WIN OPENGL : GL2Tests_framebuffer_objects_input_run = FAIL
+
+490149 WIN OPENGL INTEL : GL2ExtensionTests_dFdy_input_run = FAIL
+490149 WIN OPENGL INTEL : GL2Tests_fixed_data_type_input_run = FAIL
+490149 WIN OPENGL INTEL : GL2Tests_glUniform_input_run = FAIL
+490149 WIN OPENGL INTEL : GL2Tests_three_uniforms_input_run = FAIL
+490149 WIN OPENGL INTEL : GL_build_input_run = FAIL
+
253674 LION INTEL : GL2ExtensionTests_dFdy_input_run = FAIL
253674 LION INTEL : GL2FixedTests_point_sprites_input_run = FAIL
253674 LION INTEL : GL_control_flow_input_run = FAIL
diff --git a/chromium/gpu/gpu.gyp b/chromium/gpu/gpu.gyp
index 82e3f1347a8..930153a08a3 100644
--- a/chromium/gpu/gpu.gyp
+++ b/chromium/gpu/gpu.gyp
@@ -32,7 +32,7 @@
'includes': [
# Disable LTO due to ELF section name out of range
# crbug.com/422251
- '../build/android/disable_lto.gypi',
+ '../build/android/disable_gcc_lto.gypi',
],
# TODO(jschuh): crbug.com/167187 fix size_t to int truncations.
'msvs_disabled_warnings': [4267, ],
@@ -124,8 +124,7 @@
],
},
{
- # GN version: //gpu:angle_unittests
- # TODO(kbr): port this refactoring to the GN build.
+ # GN version: //third_party/angle/src/tests:angle_unittests
'target_name': 'angle_unittests',
'type': '<(gtest_target_type)',
'includes': [
@@ -155,10 +154,11 @@
'../testing/gmock.gyp:gmock',
'../testing/gtest.gyp:gtest',
'<(angle_path)/src/angle.gyp:translator',
- '../ui/gl/gl.gyp:gl',
'../ui/gfx/gfx.gyp:gfx',
'../ui/gfx/gfx.gyp:gfx_geometry',
'../ui/gfx/gfx.gyp:gfx_test_support',
+ '../ui/gl/gl.gyp:gl',
+ '../ui/gl/gl.gyp:gl_test_support',
'command_buffer/command_buffer.gyp:gles2_utils',
'command_buffer_client',
'command_buffer_common',
@@ -194,10 +194,6 @@
'command_buffer/common/id_allocator_test.cc',
'command_buffer/common/trace_event.h',
'command_buffer/common/unittest_main.cc',
- 'command_buffer/service/async_pixel_transfer_delegate_mock.cc',
- 'command_buffer/service/async_pixel_transfer_delegate_mock.h',
- 'command_buffer/service/async_pixel_transfer_manager_mock.cc',
- 'command_buffer/service/async_pixel_transfer_manager_mock.h',
'command_buffer/service/buffer_manager_unittest.cc',
'command_buffer/service/cmd_parser_test.cc',
'command_buffer/service/command_buffer_service_unittest.cc',
@@ -219,7 +215,6 @@
'command_buffer/service/gles2_cmd_decoder_unittest_2_autogen.h',
'command_buffer/service/gles2_cmd_decoder_unittest_3.cc',
'command_buffer/service/gles2_cmd_decoder_unittest_3_autogen.h',
- 'command_buffer/service/gles2_cmd_decoder_unittest_async_pixel.cc',
'command_buffer/service/gles2_cmd_decoder_unittest_attribs.cc',
'command_buffer/service/gles2_cmd_decoder_unittest_base.cc',
'command_buffer/service/gles2_cmd_decoder_unittest_base.h',
@@ -251,6 +246,7 @@
'command_buffer/service/shader_translator_unittest.cc',
'command_buffer/service/test_helper.cc',
'command_buffer/service/test_helper.h',
+ 'command_buffer/service/path_manager_unittest.cc',
'command_buffer/service/texture_manager_unittest.cc',
'command_buffer/service/transfer_buffer_manager_unittest.cc',
'command_buffer/service/valuebuffer_manager_unittest.cc',
@@ -354,12 +350,14 @@
'sources': [
# Note: sources list duplicated in GN build.
'command_buffer/tests/compressed_texture_test.cc',
+ 'command_buffer/tests/es3_misc_functions_unittest.cc',
'command_buffer/tests/gl_bind_uniform_location_unittest.cc',
'command_buffer/tests/gl_chromium_framebuffer_multisample_unittest.cc',
'command_buffer/tests/gl_chromium_path_rendering_unittest.cc',
'command_buffer/tests/gl_clear_framebuffer_unittest.cc',
'command_buffer/tests/gl_compressed_copy_texture_CHROMIUM_unittest.cc',
'command_buffer/tests/gl_copy_texture_CHROMIUM_unittest.cc',
+ 'command_buffer/tests/gl_cube_map_texture_unittest.cc',
'command_buffer/tests/gl_depth_texture_unittest.cc',
'command_buffer/tests/gl_gpu_memory_buffer_unittest.cc',
'command_buffer/tests/gl_lose_context_chromium_unittest.cc',
@@ -418,6 +416,45 @@
'command_buffer/service/gles2_cmd_decoder_mock.cc',
],
},
+ {
+ # GN version: //gpu:command_buffer_gles2
+ 'target_name': 'command_buffer_gles2',
+ 'type': 'shared_library',
+ 'dependencies': [
+ '../base/base.gyp:base',
+ '../gpu/gpu.gyp:command_buffer_service',
+ '../ui/gfx/gfx.gyp:gfx_geometry',
+ '../ui/gl/gl.gyp:gl',
+ 'gles2_c_lib',
+ 'gles2_implementation',
+ ],
+ 'sources': [
+ # Note: sources list duplicated in GN build.
+ # TODO(hendrikw): Move egl out of gles2_conform_support.
+ 'gles2_conform_support/egl/config.cc',
+ 'gles2_conform_support/egl/config.h',
+ 'gles2_conform_support/egl/display.cc',
+ 'gles2_conform_support/egl/display.h',
+ 'gles2_conform_support/egl/egl.cc',
+ 'gles2_conform_support/egl/surface.cc',
+ 'gles2_conform_support/egl/surface.h',
+ ],
+ 'conditions': [
+ ['OS=="win"', {
+ 'defines': [
+ 'COMMAND_BUFFER_GLES_LIB_SUPPORT_ONLY',
+ 'EGLAPIENTRY=',
+ 'EGLAPI=__declspec(dllexport)',
+ ],
+ }, { # OS!="win"
+ 'defines': [
+ 'COMMAND_BUFFER_GLES_LIB_SUPPORT_ONLY',
+ 'EGLAPIENTRY=',
+ 'EGLAPI=__attribute__((visibility(\"default\")))'
+ ],
+ }, ],
+ ],
+ }
],
'conditions': [
['component=="static_library"', {
@@ -502,7 +539,7 @@
'../build/android/increase_size_for_speed.gypi',
# Disable LTO due to ELF section name out of range
# crbug.com/422251
- '../build/android/disable_lto.gypi',
+ '../build/android/disable_gcc_lto.gypi',
],
'dependencies': [
'command_buffer_common',
@@ -706,10 +743,9 @@
},
],
}],
- ['OS == "win" or (OS == "linux" and use_x11==1)', {
+ ['OS == "win" or (OS == "linux" and use_x11==1) or OS == "mac"', {
'targets': [
{
- # TODO(kbr): port this target to the GN build.
'target_name': 'angle_end2end_tests',
'type': '<(gtest_target_type)',
'dependencies': [
@@ -772,19 +808,36 @@
},
],
}],
- ['OS == "win" and archive_gpu_tests==1', {
+ ['(OS == "win" or OS == "linux") and archive_gpu_tests==1', {
'targets': [
{
# Only build dEQP on test configs. Note that dEQP is test-only code,
# and is only a part of the Chromium build to allow easy integration
# with the GPU bot waterfall. (Note that dEQP uses exceptions, and
# currently can't build with Clang on Windows)
- 'target_name': 'angle_deqp_tests',
+ 'target_name': 'angle_deqp_gles2_tests',
'type': '<(gtest_target_type)',
'dependencies': [
'../base/base.gyp:base',
'../base/base.gyp:test_support_base',
'../third_party/angle/src/tests/tests.gyp:angle_deqp_gtest_support',
+ '../third_party/angle/src/tests/tests.gyp:angle_deqp_libgles2',
+ ],
+ 'includes': [
+ '../third_party/angle/build/common_defines.gypi',
+ ],
+ 'sources': [
+ 'angle_deqp_tests_main.cc',
+ ],
+ },
+ {
+ 'target_name': 'angle_deqp_gles3_tests',
+ 'type': '<(gtest_target_type)',
+ 'dependencies': [
+ '../base/base.gyp:base',
+ '../base/base.gyp:test_support_base',
+ '../third_party/angle/src/tests/tests.gyp:angle_deqp_gtest_support',
+ '../third_party/angle/src/tests/tests.gyp:angle_deqp_libgles3',
],
'includes': [
'../third_party/angle/build/common_defines.gypi',
@@ -794,6 +847,38 @@
],
},
],
- }]
+ }],
+ ['OS == "android" and test_isolation_mode != "noop"',
+ {
+ 'targets': [
+ {
+ 'target_name': 'gl_tests_apk_run',
+ 'type': 'none',
+ 'dependencies': [
+ 'gl_tests_apk',
+ ],
+ 'includes': [
+ '../build/isolate.gypi',
+ ],
+ 'sources': [
+ 'gl_tests_apk.isolate',
+ ],
+ },
+ {
+ 'target_name': 'gpu_unittests_apk_run',
+ 'type': 'none',
+ 'dependencies': [
+ 'gpu_unittests_apk',
+ ],
+ 'includes': [
+ '../build/isolate.gypi',
+ ],
+ 'sources': [
+ 'gpu_unittests_apk.isolate',
+ ],
+ },
+ ],
+ },
+ ],
],
}
diff --git a/chromium/gpu/gpu_unittests.isolate b/chromium/gpu/gpu_unittests.isolate
index 999c8703247..91eafce948e 100644
--- a/chromium/gpu/gpu_unittests.isolate
+++ b/chromium/gpu/gpu_unittests.isolate
@@ -38,7 +38,6 @@
'variables': {
'files': [
'../testing/test_env.py',
- '<(PRODUCT_DIR)/gpu_unittests<(EXECUTABLE_SUFFIX)',
],
},
}],
@@ -59,6 +58,6 @@
],
'includes': [
'../base/base.isolate',
- '../third_party/angle/angle.isolate',
+ '../ui/gl/gl.isolate',
],
}
diff --git a/chromium/gpu/gpu_unittests_apk.isolate b/chromium/gpu/gpu_unittests_apk.isolate
new file mode 100644
index 00000000000..94411b1b070
--- /dev/null
+++ b/chromium/gpu/gpu_unittests_apk.isolate
@@ -0,0 +1,17 @@
+# Copyright 2015 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.
+{
+ 'includes': [
+ '../build/android/android.isolate',
+ ],
+ 'variables': {
+ 'command': [
+ '<(PRODUCT_DIR)/bin/run_gpu_unittests',
+ ],
+ 'files': [
+ '<(PRODUCT_DIR)/bin/run_gpu_unittests',
+ '<(PRODUCT_DIR)/gpu_unittests_apk/',
+ ]
+ },
+}
diff --git a/chromium/gpu/ipc/gpu_command_buffer_traits_multi.h b/chromium/gpu/ipc/gpu_command_buffer_traits_multi.h
index b869327d4fd..1c69e8efbb1 100644
--- a/chromium/gpu/ipc/gpu_command_buffer_traits_multi.h
+++ b/chromium/gpu/ipc/gpu_command_buffer_traits_multi.h
@@ -94,9 +94,11 @@ IPC_STRUCT_TRAITS_BEGIN(gpu::Capabilities)
IPC_STRUCT_TRAITS_MEMBER(blend_equation_advanced)
IPC_STRUCT_TRAITS_MEMBER(blend_equation_advanced_coherent)
IPC_STRUCT_TRAITS_MEMBER(texture_rg)
+ IPC_STRUCT_TRAITS_MEMBER(image_ycbcr_422)
IPC_STRUCT_TRAITS_MEMBER(render_buffer_format_bgra8888)
IPC_STRUCT_TRAITS_MEMBER(occlusion_query_boolean)
IPC_STRUCT_TRAITS_MEMBER(timer_queries)
+ IPC_STRUCT_TRAITS_MEMBER(surfaceless)
IPC_STRUCT_TRAITS_MEMBER(major_version)
IPC_STRUCT_TRAITS_MEMBER(minor_version)
diff --git a/chromium/gpu/khronos_glcts_support/BUILD.gn b/chromium/gpu/khronos_glcts_support/BUILD.gn
index 78fb4e7732a..b2d758484fe 100644
--- a/chromium/gpu/khronos_glcts_support/BUILD.gn
+++ b/chromium/gpu/khronos_glcts_support/BUILD.gn
@@ -4,6 +4,11 @@
import("//testing/test.gni")
+declare_args() {
+ # TODO(GYP) - make this work. crbug.com/471903
+ internal_khronos_glcts_tests = false
+}
+
test("khronos_glcts_test") {
sources = [
"khronos_glcts_test.cc",
@@ -16,7 +21,6 @@ test("khronos_glcts_test") {
]
# TODO(GYP) - make this work. crbug.com/471903
- internal_khronos_glcts_tests = false
if (internal_khronos_glcts_tests) {
# TODO(GYP) implement me ...
}
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 36ff45bc7a3..024c9ccf4e2 100644
--- a/chromium/gpu/skia_bindings/gl_bindings_skia_cmd_buffer.cc
+++ b/chromium/gpu/skia_bindings/gl_bindings_skia_cmd_buffer.cc
@@ -146,8 +146,27 @@ GrGLInterface* CreateCommandBufferSkiaGLBinding() {
functions->fBindUniformLocation = glBindUniformLocationCHROMIUM;
functions->fBlitFramebuffer = glBlitFramebufferCHROMIUM;
functions->fGenerateMipmap = glGenerateMipmap;
- functions->fMatrixLoadf = glMatrixLoadfCHROMIUM;
- functions->fMatrixLoadIdentity = glMatrixLoadIdentityCHROMIUM;
+ if (false) {
+ // These are disabled until the full extension is implemented.
+ // Otherwise the interface fails validation and the context can not
+ // be created.
+ functions->fMatrixLoadf = glMatrixLoadfCHROMIUM;
+ functions->fMatrixLoadIdentity = glMatrixLoadIdentityCHROMIUM;
+ functions->fPathCommands = glPathCommandsCHROMIUM;
+ functions->fPathParameteri = glPathParameteriCHROMIUM;
+ functions->fPathParameterf = glPathParameterfCHROMIUM;
+ functions->fGenPaths = glGenPathsCHROMIUM;
+ functions->fIsPath = glIsPathCHROMIUM;
+ functions->fDeletePaths = glDeletePathsCHROMIUM;
+ functions->fPathStencilFunc = glPathStencilFuncCHROMIUM;
+ functions->fStencilFillPath = glStencilFillPathCHROMIUM;
+ functions->fStencilStrokePath = glStencilStrokePathCHROMIUM;
+ functions->fCoverFillPath = glCoverFillPathCHROMIUM;
+ functions->fCoverStrokePath = glCoverStrokePathCHROMIUM;
+ functions->fStencilThenCoverFillPath = glStencilThenCoverFillPathCHROMIUM;
+ functions->fStencilThenCoverStrokePath =
+ glStencilThenCoverStrokePathCHROMIUM;
+ }
return interface;
}
diff --git a/chromium/gpu/skia_runner/BUILD.gn b/chromium/gpu/skia_runner/BUILD.gn
index cd34057cd2b..9040d5b2119 100644
--- a/chromium/gpu/skia_runner/BUILD.gn
+++ b/chromium/gpu/skia_runner/BUILD.gn
@@ -14,6 +14,7 @@ executable("skia_runner") {
deps = [
"//base",
+ "//build/config/sanitizers:deps",
"//gpu/command_buffer/common:gles2_utils",
"//gpu/command_buffer/client:gles2_implementation",
"//gpu/command_buffer/client:gl_in_process_context",
diff --git a/chromium/gpu/skia_runner/in_process_graphics_system.cc b/chromium/gpu/skia_runner/in_process_graphics_system.cc
index e5294b1777f..c9f02e0659d 100644
--- a/chromium/gpu/skia_runner/in_process_graphics_system.cc
+++ b/chromium/gpu/skia_runner/in_process_graphics_system.cc
@@ -10,6 +10,9 @@
#include "base/memory/discardable_memory.h"
#include "base/memory/discardable_memory_allocator.h"
#include "base/thread_task_runner_handle.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"
#include "gpu/command_buffer/client/gles2_implementation.h"
#include "gpu/command_buffer/client/gles2_lib.h"
#include "gpu/skia_bindings/gl_bindings_skia_cmd_buffer.h"
@@ -21,13 +24,30 @@ namespace {
// TODO(hendrikw): Replace TestDiscardableMemoryAllocator and move to base?
class NonDiscardableMemory : public base::DiscardableMemory {
public:
- explicit NonDiscardableMemory(size_t size) : data_(new uint8_t[size]) {}
+ explicit NonDiscardableMemory(size_t size)
+ : data_(new uint8_t[size]), size_(size) {}
bool Lock() override { return false; }
void Unlock() override {}
void* data() const override { return data_.get(); }
+ base::trace_event::MemoryAllocatorDump* CreateMemoryAllocatorDump(
+ const char* name,
+ base::trace_event::ProcessMemoryDump* pmd) const override {
+ base::trace_event::MemoryAllocatorDump* dump =
+ pmd->CreateAllocatorDump(name);
+ dump->AddScalar(base::trace_event::MemoryAllocatorDump::kNameSize,
+ base::trace_event::MemoryAllocatorDump::kUnitsBytes, size_);
+
+ // Memory is allocated from system allocator (malloc).
+ pmd->AddSuballocation(dump->guid(),
+ base::trace_event::MemoryDumpManager::GetInstance()
+ ->system_allocator_pool_name());
+ return dump;
+ }
+
private:
scoped_ptr<uint8_t[]> data_;
+ size_t size_;
};
class NonDiscardableMemoryAllocator : public base::DiscardableMemoryAllocator {
diff --git a/chromium/gpu/tools/compositor_model_bench/BUILD.gn b/chromium/gpu/tools/compositor_model_bench/BUILD.gn
index 8eadc6b9716..b074ee772ea 100644
--- a/chromium/gpu/tools/compositor_model_bench/BUILD.gn
+++ b/chromium/gpu/tools/compositor_model_bench/BUILD.gn
@@ -22,6 +22,7 @@ if (is_linux && !is_chromeos && target_cpu != "arm" && use_x11) {
deps = [
"//base",
+ "//build/config/sanitizers:deps",
"//ui/gl",
]
}
diff --git a/chromium/gpu/tools/compositor_model_bench/render_tree.cc b/chromium/gpu/tools/compositor_model_bench/render_tree.cc
index f2369df18ef..e1a3804b993 100644
--- a/chromium/gpu/tools/compositor_model_bench/render_tree.cc
+++ b/chromium/gpu/tools/compositor_model_bench/render_tree.cc
@@ -23,7 +23,7 @@ using base::ReadFileToString;
using std::string;
using std::vector;
-GLenum TextureFormatFromString(std::string format) {
+GLenum TextureFormatFromString(const std::string& format) {
if (format == "RGBA")
return GL_RGBA;
if (format == "RGB")
diff --git a/chromium/gpu/tools/compositor_model_bench/render_tree.h b/chromium/gpu/tools/compositor_model_bench/render_tree.h
index 6b43fbe77f9..5a460bc701c 100644
--- a/chromium/gpu/tools/compositor_model_bench/render_tree.h
+++ b/chromium/gpu/tools/compositor_model_bench/render_tree.h
@@ -35,7 +35,7 @@ struct Texture {
GLenum format;
};
-GLenum TextureFormatFromString(std::string format);
+GLenum TextureFormatFromString(const std::string& format);
const char* TextureFormatName(GLenum format);
int FormatBytesPerPixel(GLenum format);
diff --git a/chromium/gpu/tools/compositor_model_bench/shaders.cc b/chromium/gpu/tools/compositor_model_bench/shaders.cc
index 5559e73a558..66f5aac63e2 100644
--- a/chromium/gpu/tools/compositor_model_bench/shaders.cc
+++ b/chromium/gpu/tools/compositor_model_bench/shaders.cc
@@ -81,7 +81,7 @@ static void TranslateInPlace(float* m, float tx, float ty, float tz) {
///////////////////////////////////////////////////////////////////////////////
-ShaderID ShaderIDFromString(std::string name) {
+ShaderID ShaderIDFromString(const std::string& name) {
if (name == "VertexShaderPosTexYUVStretch")
return VERTEX_SHADER_POS_TEX_YUV_STRETCH;
if (name == "VertexShaderPosTex")
diff --git a/chromium/gpu/tools/compositor_model_bench/shaders.h b/chromium/gpu/tools/compositor_model_bench/shaders.h
index 459403542fd..5aece20060a 100644
--- a/chromium/gpu/tools/compositor_model_bench/shaders.h
+++ b/chromium/gpu/tools/compositor_model_bench/shaders.h
@@ -26,7 +26,7 @@ enum ShaderID {
SHADER_ID_MAX
};
-ShaderID ShaderIDFromString(std::string name);
+ShaderID ShaderIDFromString(const std::string& name);
std::string ShaderNameFromID(ShaderID id);
void ConfigAndActivateShaderForNode(CCNode* n);