Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(243)

Issue 2629633003: Refactor GL bindings so there is no global GLApi or DriverGL. (Closed)

Created:
3 years, 11 months ago by Geoff Lang
Modified:
3 years, 10 months ago
Reviewers:
jbauman
CC:
chromium-reviews, ozone-reviews_chromium.org, extensions-reviews_chromium.org, mac-reviews_chromium.org, chromium-apps-reviews_chromium.org, fuzzing_chromium.org, kalyank, piman+watch_chromium.org
Target Ref:
refs/pending/heads/master
Project:
chromium
Visibility:
Public.

Description

Refactor GL bindings so there is no global GLApi or DriverGL. Having a single global API and Driver object doesn't mirror the real GL context state that may have different entry points, extensions and version numbers per context. This can cause entry points to be called when they are not loaded or extensions used when they are not present. * Refactored the GLApi and DriverGL objects to be owned by GLContext objects. * Moved all driver-level GL workarounds into RealGLApi so no swapping of function pointers in DriverGL is needed. * Instead of having separate debug function pointers in the drivers that call back to global variables, add new DebugApi objects that wrap the RealApi objects. BUG=671217 CQ_INCLUDE_TRYBOTS=master.tryserver.chromium.linux:linux_optional_gpu_tests_rel;master.tryserver.chromium.mac:mac_optional_gpu_tests_rel;master.tryserver.chromium.win:win_optional_gpu_tests_rel R=jbauman@chromium.org Review-Url: https://codereview.chromium.org/2629633003 . Cr-Commit-Position: refs/heads/master@{#447005} Committed: https://chromium.googlesource.com/chromium/src/+/ceb64f73f7bf1e1ae1914970c9adc455f564a1e9

Patch Set 1 #

Total comments: 8

Patch Set 2 : Address comments #

Patch Set 3 : rebase #

Unified diffs Side-by-side diffs Delta from patch set Stats (+18346 lines, -3513 lines) Patch
M gpu/command_buffer/service/context_group.cc View 1 2 1 chunk +5 lines, -3 lines 0 comments Download
M gpu/command_buffer/service/gl_context_mock.h View 1 2 1 chunk +2 lines, -2 lines 0 comments Download
M gpu/command_buffer/service/gl_context_virtual.h View 1 2 1 chunk +2 lines, -0 lines 0 comments Download
M gpu/command_buffer/service/gl_context_virtual.cc View 1 2 2 chunks +8 lines, -1 line 0 comments Download
M gpu/command_buffer/service/gles2_cmd_decoder.cc View 1 2 1 chunk +4 lines, -0 lines 0 comments Download
M gpu/command_buffer/service/gles2_cmd_decoder_passthrough.cc View 1 2 1 chunk +9 lines, -0 lines 0 comments Download
M gpu/command_buffer/service/gles2_cmd_decoder_unittest.h View 1 2 1 chunk +0 lines, -1 line 0 comments Download
M gpu/command_buffer/service/gles2_cmd_decoder_unittest_base.cc View 1 2 1 chunk +2 lines, -2 lines 0 comments Download
M gpu/command_buffer/service/gles2_cmd_decoder_unittest_framebuffers.cc View 1 2 4 chunks +4 lines, -4 lines 0 comments Download
M gpu/command_buffer/service/gpu_service_test.h View 1 2 2 chunks +2 lines, -2 lines 0 comments Download
M gpu/command_buffer/service/gpu_service_test.cc View 1 2 2 chunks +3 lines, -3 lines 0 comments Download
M gpu/command_buffer/service/mailbox_manager_sync.cc View 1 2 1 chunk +2 lines, -1 line 0 comments Download
M gpu/command_buffer/service/memory_program_cache.cc View 1 2 3 chunks +15 lines, -0 lines 0 comments Download
M gpu/command_buffer/service/program_manager.cc View 1 2 1 chunk +1 line, -1 line 0 comments Download
M gpu/command_buffer/service/program_manager_unittest.cc View 1 2 1 chunk +1 line, -1 line 0 comments Download
M gpu/command_buffer/service/texture_definition.cc View 1 2 2 chunks +2 lines, -1 line 0 comments Download
M gpu/command_buffer/tests/fuzzer_main.cc View 1 2 3 chunks +7 lines, -10 lines 0 comments Download
M gpu/config/gpu_info_collector_unittest.cc View 1 2 3 chunks +12 lines, -0 lines 0 comments Download
M gpu/ipc/in_process_command_buffer.cc View 1 2 1 chunk +2 lines, -2 lines 0 comments Download
M gpu/ipc/service/gpu_channel_manager.cc View 1 2 1 chunk +0 lines, -2 lines 0 comments Download
M gpu/ipc/service/gpu_channel_unittest.cc View 1 2 3 chunks +1 line, -5 lines 0 comments Download
M gpu/ipc/service/gpu_command_buffer_stub.cc View 1 2 2 chunks +8 lines, -5 lines 0 comments Download
M gpu/ipc/service/image_transport_surface_android.cc View 1 2 1 chunk +2 lines, -1 line 0 comments Download
M gpu/ipc/service/image_transport_surface_mac.mm View 1 2 1 chunk +1 line, -0 lines 0 comments Download
M gpu/ipc/service/image_transport_surface_overlay_mac.h View 1 2 1 chunk +1 line, -2 lines 0 comments Download
M gpu/ipc/service/image_transport_surface_overlay_mac.mm View 1 2 4 chunks +0 lines, -4 lines 0 comments Download
M ui/gl/BUILD.gn View 1 2 3 chunks +5 lines, -5 lines 0 comments Download
M ui/gl/generate_bindings.py View 1 2 6 chunks +64 lines, -91 lines 0 comments Download
M ui/gl/gl_api_unittest.cc View 1 2 6 chunks +17 lines, -38 lines 0 comments Download
M ui/gl/gl_bindings.h View 1 2 5 chunks +13 lines, -22 lines 0 comments Download
M ui/gl/gl_bindings_autogen_egl.cc View 1 2 3 chunks +948 lines, -1314 lines 0 comments Download
A ui/gl/gl_bindings_autogen_gl0.cc View 1 2 1 chunk +2453 lines, -0 lines 0 comments Download
A ui/gl/gl_bindings_autogen_gl1.cc View 1 2 1 chunk +2587 lines, -0 lines 0 comments Download
A ui/gl/gl_bindings_autogen_gl2.cc View 1 2 1 chunk +4020 lines, -0 lines 0 comments Download
A ui/gl/gl_bindings_autogen_gl3.cc View 1 2 1 chunk +3040 lines, -0 lines 0 comments Download
A ui/gl/gl_bindings_autogen_gl4.cc View 1 2 1 chunk +3428 lines, -0 lines 0 comments Download
M ui/gl/gl_bindings_autogen_glx.cc View 1 2 2 chunks +706 lines, -1000 lines 0 comments Download
M ui/gl/gl_bindings_autogen_osmesa.cc View 1 2 3 chunks +114 lines, -183 lines 0 comments Download
M ui/gl/gl_bindings_autogen_wgl.cc View 1 2 3 chunks +180 lines, -304 lines 0 comments Download
M ui/gl/gl_context.h View 1 2 4 chunks +28 lines, -1 line 0 comments Download
M ui/gl/gl_context.cc View 1 2 9 chunks +74 lines, -15 lines 0 comments Download
M ui/gl/gl_context_cgl.cc View 1 2 3 chunks +14 lines, -1 line 0 comments Download
M ui/gl/gl_context_egl.cc View 1 2 1 chunk +1 line, -1 line 0 comments Download
M ui/gl/gl_context_glx.cc View 1 2 1 chunk +1 line, -1 line 0 comments Download
M ui/gl/gl_context_osmesa.cc View 1 2 1 chunk +1 line, -1 line 0 comments Download
M ui/gl/gl_context_stub.h View 1 2 1 chunk +13 lines, -0 lines 0 comments Download
M ui/gl/gl_context_stub.cc View 1 2 3 chunks +47 lines, -3 lines 0 comments Download
D ui/gl/gl_context_stub_with_extensions.h View 1 2 1 chunk +0 lines, -40 lines 0 comments Download
D ui/gl/gl_context_stub_with_extensions.cc View 1 2 1 chunk +0 lines, -36 lines 0 comments Download
M ui/gl/gl_context_wgl.cc View 1 2 1 chunk +1 line, -1 line 0 comments Download
M ui/gl/gl_egl_api_implementation.h View 1 2 1 chunk +14 lines, -0 lines 0 comments Download
M ui/gl/gl_egl_api_implementation.cc View 1 2 3 chunks +14 lines, -20 lines 0 comments Download
M ui/gl/gl_fence.cc View 1 2 3 chunks +11 lines, -10 lines 0 comments Download
M ui/gl/gl_fence_arb.cc View 1 2 1 chunk +4 lines, -2 lines 0 comments Download
M ui/gl/gl_gl_api_implementation.h View 1 2 5 chunks +80 lines, -14 lines 0 comments Download
M ui/gl/gl_gl_api_implementation.cc View 1 2 10 chunks +173 lines, -266 lines 0 comments Download
M ui/gl/gl_glx_api_implementation.h View 1 2 1 chunk +15 lines, -0 lines 0 comments Download
M ui/gl/gl_glx_api_implementation.cc View 1 2 3 chunks +12 lines, -1 line 0 comments Download
M ui/gl/gl_image_io_surface.mm View 1 2 2 chunks +0 lines, -3 lines 0 comments Download
M ui/gl/gl_image_memory.cc View 1 2 1 chunk +1 line, -1 line 0 comments Download
M ui/gl/gl_implementation.h View 1 2 4 chunks +10 lines, -1 line 0 comments Download
M ui/gl/gl_implementation.cc View 1 2 5 chunks +33 lines, -15 lines 0 comments Download
M ui/gl/gl_osmesa_api_implementation.h View 1 2 1 chunk +15 lines, -0 lines 0 comments Download
M ui/gl/gl_osmesa_api_implementation.cc View 1 2 3 chunks +14 lines, -2 lines 0 comments Download
M ui/gl/gl_stub_api.cc View 1 2 1 chunk +1 line, -2 lines 0 comments Download
M ui/gl/gl_switches.h View 1 2 1 chunk +1 line, -0 lines 0 comments Download
M ui/gl/gl_switches.cc View 1 2 1 chunk +1 line, -0 lines 0 comments Download
M ui/gl/gl_wgl_api_implementation.h View 1 2 1 chunk +15 lines, -0 lines 0 comments Download
M ui/gl/gl_wgl_api_implementation.cc View 1 2 3 chunks +14 lines, -2 lines 0 comments Download
M ui/gl/gpu_timing_unittest.cc View 1 2 3 chunks +4 lines, -4 lines 0 comments Download
M ui/gl/init/gl_factory_android.cc View 1 2 3 chunks +8 lines, -1 line 0 comments Download
M ui/gl/init/gl_factory_mac.cc View 1 2 3 chunks +8 lines, -0 lines 0 comments Download
M ui/gl/init/gl_factory_ozone.cc View 1 2 4 chunks +10 lines, -1 line 0 comments Download
M ui/gl/init/gl_factory_win.cc View 1 2 3 chunks +8 lines, -0 lines 0 comments Download
M ui/gl/init/gl_factory_x11.cc View 1 2 3 chunks +8 lines, -0 lines 0 comments Download
M ui/gl/init/gl_initializer_android.cc View 1 2 1 chunk +2 lines, -1 line 0 comments Download
M ui/gl/init/gl_initializer_mac.cc View 1 2 1 chunk +2 lines, -1 line 0 comments Download
M ui/gl/init/gl_initializer_ozone.cc View 1 2 2 chunks +3 lines, -1 line 0 comments Download
M ui/gl/init/gl_initializer_win.cc View 1 2 2 chunks +3 lines, -1 line 0 comments Download
M ui/gl/init/gl_initializer_x11.cc View 1 2 1 chunk +2 lines, -1 line 0 comments Download
D ui/gl/scoped_api.h View 1 2 1 chunk +0 lines, -28 lines 0 comments Download
D ui/gl/scoped_api.cc View 1 2 1 chunk +0 lines, -20 lines 0 comments Download
M ui/gl/test/gl_surface_test_support.h View 1 2 1 chunk +1 line, -0 lines 0 comments Download
M ui/gl/test/gl_surface_test_support.cc View 1 2 1 chunk +8 lines, -0 lines 0 comments Download
M ui/gl/yuv_to_rgb_converter.cc View 1 2 4 chunks +0 lines, -5 lines 0 comments Download

Messages

Total messages: 27 (19 generated)
Geoff Lang
PTAL The changes to the autogen'd file gl_bindings_autogen_gl.cc ended up being too big for rietveld ...
3 years, 11 months ago (2017-01-13 17:53:42 UTC) #4
jbauman
Generally sounds good, but I've got a couple of questions. https://codereview.chromium.org/2629633003/diff/1/gpu/command_buffer/service/context_group.cc File gpu/command_buffer/service/context_group.cc (right): https://codereview.chromium.org/2629633003/diff/1/gpu/command_buffer/service/context_group.cc#newcode556 ...
3 years, 11 months ago (2017-01-18 21:32:09 UTC) #11
Geoff Lang
Thanks for the review, sorry that this CL is so big https://codereview.chromium.org/2629633003/diff/1/gpu/command_buffer/service/context_group.cc File gpu/command_buffer/service/context_group.cc (right): ...
3 years, 11 months ago (2017-01-19 15:40:06 UTC) #12
jbauman
lgtm
3 years, 11 months ago (2017-01-20 23:34:00 UTC) #17
Geoff Lang
Thanks, going to wait until I'm back from the Khronos F2F to land this.
3 years, 11 months ago (2017-01-23 17:47:53 UTC) #18
Geoff Lang
Committed patchset #3 (id:20001) manually as ceb64f73f7bf1e1ae1914970c9adc455f564a1e9.
3 years, 10 months ago (2017-01-30 17:04:06 UTC) #25
Geoff Lang
On 2017/01/30 17:04:06, Geoff Lang wrote: > Committed patchset #3 (id:20001) manually as > ceb64f73f7bf1e1ae1914970c9adc455f564a1e9. ...
3 years, 10 months ago (2017-01-30 17:07:11 UTC) #26
msw
3 years, 10 months ago (2017-01-30 20:23:42 UTC) #27
Message was sent while issue was closed.
On 2017/01/30 17:07:11, Geoff Lang wrote:
> On 2017/01/30 17:04:06, Geoff Lang wrote:
> > Committed patchset #3 (id:20001) manually as
> > ceb64f73f7bf1e1ae1914970c9adc455f564a1e9.
> 
> had to manually land this because the changes to
ui/gl/gl_bindings_autogen_gl.cc
> were too big to upload.  Please ping me before reverting if there are issues.

This causes a chrome --mash startup crash; http://crbug.com/686856
Please take a look at your earliest convenience, thanks!

Powered by Google App Engine
This is Rietveld 408576698