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

Issue 2616723002: Refactor GL surface format handling (Closed)

Created:
3 years, 11 months ago by klausw
Modified:
3 years, 11 months ago
Reviewers:
dnicoara, bajones, jbauman
CC:
chromium-reviews, ozone-reviews_chromium.org, piman+watch_chromium.org, kalyank, mac-reviews_chromium.org
Target Ref:
refs/pending/heads/master
Project:
chromium
Visibility:
Public.

Description

Refactor GL surface format handling Replace the GLSurface::Format enum with a proper class in preparation to supporting types with configurable depth_size / samples / stencil_size. Doing this in the current enum format would lead to a combinatorial explosion. The basic idea is that GetFormat can be used to initialize a new surface with the same format as a pre-existing surface, and a IsCompatible predicate is used to check if two formats are equivalent for the purpose of avoiding BAD_MATCH errors. Code should no longer be comparing formats to SURFACE_DEFAULT or similar. Also add a new CreateOffscreenGLSurfaceWithFormat function that can be used to request a specific surface format. (These changes were suggested during review of https://crrev.com/2461803002 which is now forked into https://crrev.com/2586803003 .) BUG=655722 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 Review-Url: https://codereview.chromium.org/2616723002 Cr-Commit-Position: refs/heads/master@{#441993} Committed: https://chromium.googlesource.com/chromium/src/+/ec8edae43017bf5ea65d3b65edbcfd740af453c7

Patch Set 1 #

Total comments: 4

Patch Set 2 : Add explicit copy constructor, fix missing conversion #

Patch Set 3 : More mac build fixes #

Patch Set 4 : Refactor to preserve properties and remove old types, add unittest #

Patch Set 5 : Fix mac and ozone typos, remove stray var #

Patch Set 6 : More fixes for surface_mock and gbm_surfaceless #

Patch Set 7 : (surfaceformat) Fix mock #

Patch Set 8 : (surfaceformat) Add missing GL_EXPORT #

Patch Set 9 : (surfaceformat) More gbm fixes #

Patch Set 10 : (surfaceformat) More gbm fixes #

Total comments: 2

Patch Set 11 : Add underscores to private attributes #

Total comments: 2

Patch Set 12 : Fix copyright notice on new files #

Unified diffs Side-by-side diffs Delta from patch set Stats (+427 lines, -120 lines) Patch
M gpu/command_buffer/service/gl_surface_mock.h View 1 2 3 4 5 6 9 2 chunks +2 lines, -2 lines 0 comments Download
M gpu/command_buffer/tests/gl_dynamic_config_unittest.cc View 1 2 3 9 1 chunk +5 lines, -1 line 0 comments Download
M gpu/ipc/in_process_command_buffer.cc View 9 1 chunk +2 lines, -2 lines 0 comments Download
M gpu/ipc/service/gpu_command_buffer_stub.cc View 1 2 3 9 2 chunks +5 lines, -3 lines 0 comments Download
M gpu/ipc/service/image_transport_surface.h View 9 1 chunk +1 line, -1 line 0 comments Download
M gpu/ipc/service/image_transport_surface_android.cc View 9 1 chunk +1 line, -1 line 0 comments Download
M gpu/ipc/service/image_transport_surface_linux.cc View 9 1 chunk +1 line, -1 line 0 comments Download
M gpu/ipc/service/image_transport_surface_mac.mm View 1 2 3 4 9 2 chunks +4 lines, -2 lines 0 comments Download
M gpu/ipc/service/image_transport_surface_overlay_mac.h View 1 9 1 chunk +1 line, -1 line 0 comments Download
M gpu/ipc/service/image_transport_surface_overlay_mac.mm View 1 2 9 1 chunk +1 line, -1 line 0 comments Download
M gpu/ipc/service/image_transport_surface_win.cc View 9 1 chunk +1 line, -1 line 0 comments Download
M gpu/ipc/service/pass_through_image_transport_surface.h View 9 1 chunk +1 line, -1 line 0 comments Download
M gpu/ipc/service/pass_through_image_transport_surface.cc View 9 1 chunk +1 line, -1 line 0 comments Download
M ui/gl/BUILD.gn View 1 2 3 9 2 chunks +3 lines, -0 lines 0 comments Download
M ui/gl/gl_context_osmesa.cc View 1 2 3 9 1 chunk +3 lines, -3 lines 0 comments Download
M ui/gl/gl_surface.h View 9 6 chunks +13 lines, -14 lines 0 comments Download
M ui/gl/gl_surface.cc View 9 6 chunks +14 lines, -8 lines 0 comments Download
M ui/gl/gl_surface_egl.h View 9 5 chunks +5 lines, -7 lines 0 comments Download
M ui/gl/gl_surface_egl.cc View 1 2 3 9 10 chunks +18 lines, -22 lines 0 comments Download
A ui/gl/gl_surface_format.h View 1 2 3 4 5 6 7 8 9 10 11 1 chunk +73 lines, -0 lines 0 comments Download
A ui/gl/gl_surface_format.cc View 1 2 3 4 5 6 7 8 9 10 11 1 chunk +126 lines, -0 lines 0 comments Download
A ui/gl/gl_surface_format_unittest.cc View 1 2 3 9 1 chunk +64 lines, -0 lines 0 comments Download
M ui/gl/gl_surface_glx.h View 9 2 chunks +2 lines, -2 lines 0 comments Download
M ui/gl/gl_surface_glx.cc View 9 2 chunks +2 lines, -2 lines 0 comments Download
M ui/gl/gl_surface_osmesa.h View 9 2 chunks +4 lines, -4 lines 0 comments Download
M ui/gl/gl_surface_osmesa.cc View 1 2 3 9 4 chunks +6 lines, -4 lines 0 comments Download
M ui/gl/gl_surface_osmesa_win.h View 9 1 chunk +1 line, -1 line 0 comments Download
M ui/gl/gl_surface_osmesa_win.cc View 1 2 3 9 2 chunks +3 lines, -2 lines 0 comments Download
M ui/gl/gl_surface_osmesa_x11.h View 9 1 chunk +1 line, -1 line 0 comments Download
M ui/gl/gl_surface_osmesa_x11.cc View 1 2 3 9 2 chunks +4 lines, -2 lines 0 comments Download
M ui/gl/gl_surface_wgl.h View 9 3 chunks +3 lines, -3 lines 0 comments Download
M ui/gl/gl_surface_wgl.cc View 9 2 chunks +2 lines, -2 lines 0 comments Download
M ui/gl/init/gl_factory.h View 9 2 chunks +4 lines, -0 lines 0 comments Download
M ui/gl/init/gl_factory.cc View 9 1 chunk +4 lines, -0 lines 0 comments Download
M ui/gl/init/gl_factory_android.cc View 1 2 3 4 9 1 chunk +9 lines, -6 lines 0 comments Download
M ui/gl/init/gl_factory_mac.cc View 1 2 3 9 2 chunks +8 lines, -5 lines 0 comments Download
M ui/gl/init/gl_factory_ozone.cc View 1 2 3 4 9 2 chunks +9 lines, -2 lines 0 comments Download
M ui/gl/init/gl_factory_win.cc View 1 2 3 9 1 chunk +9 lines, -5 lines 0 comments Download
M ui/gl/init/gl_factory_x11.cc View 1 2 3 9 1 chunk +9 lines, -5 lines 0 comments Download
M ui/ozone/platform/drm/gpu/gbm_surfaceless.h View 1 2 3 4 5 6 7 8 9 1 chunk +1 line, -1 line 0 comments Download
M ui/ozone/platform/drm/gpu/gbm_surfaceless.cc View 1 2 3 4 5 9 1 chunk +1 line, -1 line 0 comments Download

Messages

Total messages: 57 (42 generated)
klausw
What do you think of this approach? It should essentially be a no-op. I'll add ...
3 years, 11 months ago (2017-01-04 21:57:12 UTC) #3
bajones
Generally looks good, the one bit I question is the various places where we check ...
3 years, 11 months ago (2017-01-04 22:31:55 UTC) #12
klausw
> the one bit I question is the various places where we check for IsDefault ...
3 years, 11 months ago (2017-01-05 00:55:13 UTC) #13
klausw
jbauman@chromium.org: This is a followup to revisit bajones's https://crrev.com/2461803002, splitting it into two patches. This ...
3 years, 11 months ago (2017-01-05 02:37:50 UTC) #30
klausw
dnicoara@chromium.org: Please review changes in ui/ozone, this should be a no-op.
3 years, 11 months ago (2017-01-05 02:40:40 UTC) #32
bajones
LGTM now, though I'm not an owner for most of it.
3 years, 11 months ago (2017-01-05 17:16:01 UTC) #41
jbauman
https://codereview.chromium.org/2616723002/diff/160001/ui/gl/gl_surface_format.h File ui/gl/gl_surface_format.h (right): https://codereview.chromium.org/2616723002/diff/160001/ui/gl/gl_surface_format.h#newcode59 ui/gl/gl_surface_format.h:59: bool is_default = true; is_default_, pixel_layout_, is_surfaceless_, etc.
3 years, 11 months ago (2017-01-06 02:51:30 UTC) #43
klausw
https://codereview.chromium.org/2616723002/diff/160001/ui/gl/gl_surface_format.h File ui/gl/gl_surface_format.h (right): https://codereview.chromium.org/2616723002/diff/160001/ui/gl/gl_surface_format.h#newcode59 ui/gl/gl_surface_format.h:59: bool is_default = true; On 2017/01/06 02:51:30, jbauman wrote: ...
3 years, 11 months ago (2017-01-06 03:44:40 UTC) #44
jbauman
lgtm with one nit. https://codereview.chromium.org/2616723002/diff/180001/ui/gl/gl_surface_format.h File ui/gl/gl_surface_format.h (right): https://codereview.chromium.org/2616723002/diff/180001/ui/gl/gl_surface_format.h#newcode1 ui/gl/gl_surface_format.h:1: // Copyright (c) 2017 The ...
3 years, 11 months ago (2017-01-06 03:51:37 UTC) #45
klausw
https://codereview.chromium.org/2616723002/diff/180001/ui/gl/gl_surface_format.h File ui/gl/gl_surface_format.h (right): https://codereview.chromium.org/2616723002/diff/180001/ui/gl/gl_surface_format.h#newcode1 ui/gl/gl_surface_format.h:1: // Copyright (c) 2017 The Chromium Authors. All rights ...
3 years, 11 months ago (2017-01-06 06:21:29 UTC) #46
dnicoara
ui/ozone lgtm
3 years, 11 months ago (2017-01-06 14:09:19 UTC) #47
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.org/2616723002/200001
3 years, 11 months ago (2017-01-06 16:27:38 UTC) #50
commit-bot: I haz the power
Try jobs failed on following builders: linux_chromium_asan_rel_ng on master.tryserver.chromium.linux (JOB_FAILED, http://build.chromium.org/p/tryserver.chromium.linux/builders/linux_chromium_asan_rel_ng/builds/288431)
3 years, 11 months ago (2017-01-06 17:41:58 UTC) #52
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.org/2616723002/200001
3 years, 11 months ago (2017-01-06 17:47:11 UTC) #54
commit-bot: I haz the power
3 years, 11 months ago (2017-01-06 18:49:20 UTC) #57
Message was sent while issue was closed.
Committed patchset #12 (id:200001) as
https://chromium.googlesource.com/chromium/src/+/ec8edae43017bf5ea65d3b65edbc...

Powered by Google App Engine
This is Rietveld 408576698