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

Issue 135213003: Ensure GL initialization only happens once, and provide common init path (Closed)

Created:
6 years, 11 months ago by danakj
Modified:
6 years, 10 months ago
CC:
chromium-reviews, rjkroege, joi+watch-content_chromium.org, ozone-reviews_chromium.org, Ian Vollick, jam, sievers+watch_chromium.org, jbauman+watch_chromium.org, feature-media-reviews_chromium.org, darin-cc_chromium.org, kalyank, piman+watch_chromium.org, cc-bugs_chromium.org, danakj+watch_chromium.org
Visibility:
Public.

Description

Ensure GL initialization only happens once, and provide common init path Currently tests initialize GL by calling into methods that should be internal to the gl bindings code. Instead, everyone should go through GLSurface::InitializeOneOff. Also GLSurface::InitializeOneOff early outs if it was already called, leading to a pattern of initializing GL all over the place just in case and not having a clear idea of where it should be set up. Instead, DCHECK that it is not called more than once, and move calls to this method to be during process startup for unit test suites instead of mid-test. This adds two test variants of InitializeOneOff for tests to call, that set up OSMesa or Mock GL bindings, via GLSurface::InitializeOneOff. R=ben@chromium.org, piman@chromium.org, sievers@chromium.org, piman, sievers BUG=270918 Committed: https://src.chromium.org/viewvc/chrome?view=rev&revision=247793 Committed: https://src.chromium.org/viewvc/chrome?view=rev&revision=248049 Committed: https://src.chromium.org/viewvc/chrome?view=rev&revision=248557

Patch Set 1 #

Patch Set 2 : initgl: #

Patch Set 3 : initgl: export#itsnotworthit #

Patch Set 4 : initgl: linux_gpu #

Patch Set 5 : initgl: ios #

Patch Set 6 : initgl: #

Patch Set 7 : initgl: #

Patch Set 8 : initgl: #

Patch Set 9 : initgl: #

Patch Set 10 : initgl: #

Total comments: 4

Patch Set 11 : initgl: reviewed #

Patch Set 12 : initgl: header #

Patch Set 13 : initgl: export #

Patch Set 14 : initgl: commandlineandmacstuff #

Patch Set 15 : initgl: #

Patch Set 16 : initgl: headerremoved #

Patch Set 17 : initgl: ut #

Patch Set 18 : initgl: headers #

Patch Set 19 : initgl: rebase #

Patch Set 20 : initgl: ios #

Patch Set 21 : initgl: android #

Patch Set 22 : initgl: android2 #

Patch Set 23 : initgl: android3 #

Patch Set 24 : initgl: android4 #

Patch Set 25 : initgl: android5 #

Patch Set 26 : initgl: android6 #

Patch Set 27 : initgl: include #

Patch Set 28 : initgl: compile #

Patch Set 29 : initgl: rebase #

Total comments: 3

Patch Set 30 : initgl: rebaseearlyout #

Patch Set 31 : initgl: remove constructor #

Patch Set 32 : initgl: onmacuserealgl #

Patch Set 33 : initgl: switch #

Patch Set 34 : initgl: compile #

Patch Set 35 : initgl: compile2 #

Patch Set 36 : initgl: compile3 #

Unified diffs Side-by-side diffs Delta from patch set Stats (+238 lines, -119 lines) Patch
M cc/test/cc_test_suite.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 2 chunks +2 lines, -0 lines 0 comments Download
M cc/test/layer_tree_pixel_test.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 3 chunks +0 lines, -5 lines 0 comments Download
M cc/test/pixel_test.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 2 chunks +0 lines, -3 lines 0 comments Download
M chrome/browser/media/DEPS View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 1 chunk +1 line, -0 lines 0 comments Download
M chrome/browser/media/chrome_webrtc_apprtc_browsertest.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 1 chunk +1 line, -1 line 0 comments Download
M chrome/browser/media/chrome_webrtc_video_quality_browsertest.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 1 chunk +1 line, -0 lines 0 comments Download
M content/browser/browser_main_loop.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 2 chunks +8 lines, -0 lines 0 comments Download
M content/browser/compositor/software_browser_compositor_output_surface_unittest.cc View 2 chunks +0 lines, -2 lines 0 comments Download
M content/browser/compositor/software_output_device_ozone_unittest.cc View 1 chunk +0 lines, -1 line 0 comments Download
M content/common/gpu/client/gl_helper_unittest.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 1 chunk +0 lines, -1 line 0 comments Download
M content/gpu/gpu_child_thread.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 1 chunk +6 lines, -3 lines 0 comments Download
M content/gpu/gpu_main.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 1 chunk +18 lines, -1 line 0 comments Download
M content/public/common/content_switches.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 1 chunk +0 lines, -1 line 0 comments Download
M content/public/common/content_switches.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 1 chunk +0 lines, -3 lines 0 comments Download
M content/test/content_test_suite.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 3 chunks +13 lines, -0 lines 0 comments Download
M gpu/command_buffer/common/unittest_main.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 3 chunks +8 lines, -3 lines 0 comments Download
M gpu/command_buffer/service/gles2_cmd_decoder_unittest_base.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 3 chunks +3 lines, -3 lines 0 comments Download
M gpu/config/gpu_info_collector.cc View 1 2 3 1 chunk +0 lines, -4 lines 0 comments Download
M gpu/config/gpu_info_collector_android.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 1 chunk +6 lines, -10 lines 0 comments Download
M gpu/config/gpu_info_collector_unittest.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 2 chunks +0 lines, -6 lines 0 comments Download
M gpu/tools/compositor_model_bench/compositor_model_bench.cc View 1 2 chunks +3 lines, -4 lines 0 comments Download
M media/tools/player_x11/gl_video_renderer.cc View 1 2 3 4 5 6 7 8 9 10 11 2 chunks +3 lines, -3 lines 0 comments Download
M ui/aura/bench/DEPS View 1 2 3 4 5 6 7 8 9 10 1 chunk +1 line, -0 lines 0 comments Download
M ui/aura/bench/bench_main.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 2 chunks +4 lines, -0 lines 0 comments Download
A ui/aura/demo/DEPS View 1 2 3 4 5 6 7 8 9 10 1 chunk +3 lines, -0 lines 0 comments Download
M ui/aura/demo/demo_main.cc View 1 2 3 4 5 6 7 8 9 10 2 chunks +3 lines, -0 lines 0 comments Download
M ui/compositor/test/context_factories_for_test.cc View 1 2 3 4 5 2 chunks +3 lines, -4 lines 0 comments Download
M ui/compositor/test/default_context_factory.h View 1 2 3 4 5 1 chunk +0 lines, -2 lines 0 comments Download
M ui/compositor/test/default_context_factory.cc View 1 2 3 4 5 1 chunk +1 line, -9 lines 0 comments Download
M ui/compositor/test/test_suite.cc View 1 2 3 4 5 6 7 8 9 2 chunks +2 lines, -2 lines 0 comments Download
M ui/gl/gl_gl_api_implementation.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 1 chunk +16 lines, -1 line 0 comments Download
M ui/gl/gl_implementation.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 1 chunk +1 line, -1 line 0 comments Download
M ui/gl/gl_implementation_android.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 1 chunk +1 line, -2 lines 0 comments Download
M ui/gl/gl_implementation_mac.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 1 chunk +1 line, -2 lines 0 comments Download
M ui/gl/gl_implementation_ozone.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 1 chunk +1 line, -2 lines 0 comments Download
M ui/gl/gl_implementation_win.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 1 chunk +1 line, -2 lines 0 comments Download
M ui/gl/gl_implementation_x11.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 1 chunk +1 line, -2 lines 0 comments Download
M ui/gl/gl_surface.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 3 chunks +12 lines, -0 lines 0 comments Download
M ui/gl/gl_surface.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 4 chunks +83 lines, -10 lines 0 comments Download
M ui/gl/gl_surface_egl.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 1 chunk +8 lines, -8 lines 0 comments Download
M ui/gl/gl_switches.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 1 chunk +1 line, -0 lines 0 comments Download
M ui/gl/gl_switches.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 1 chunk +3 lines, -0 lines 0 comments Download
M ui/keyboard/DEPS View 1 chunk +1 line, -0 lines 0 comments Download
M ui/keyboard/test/run_all_unittests.cc View 1 2 3 4 5 6 7 8 9 2 chunks +2 lines, -0 lines 0 comments Download
M ui/views/examples/DEPS View 1 2 3 4 5 6 7 8 9 10 1 chunk +1 line, -0 lines 0 comments Download
M ui/views/examples/examples_main.cc View 1 2 3 4 5 6 7 8 9 10 2 chunks +3 lines, -0 lines 0 comments Download
M webkit/common/gpu/webgraphicscontext3d_in_process_command_buffer_impl.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 3 chunks +12 lines, -18 lines 0 comments Download

Messages

Total messages: 28 (0 generated)
danakj
6 years, 11 months ago (2014-01-24 19:11:48 UTC) #1
piman
https://codereview.chromium.org/135213003/diff/370001/ui/compositor/test/default_context_factory.cc File ui/compositor/test/default_context_factory.cc (left): https://codereview.chromium.org/135213003/diff/370001/ui/compositor/test/default_context_factory.cc#oldcode24 ui/compositor/test/default_context_factory.cc:24: if (!gfx::GLSurface::InitializeOneOff() || So, there are a few non-unit-test ...
6 years, 11 months ago (2014-01-24 19:22:20 UTC) #2
danakj
Done. PTAL https://codereview.chromium.org/135213003/diff/370001/ui/compositor/test/default_context_factory.cc File ui/compositor/test/default_context_factory.cc (left): https://codereview.chromium.org/135213003/diff/370001/ui/compositor/test/default_context_factory.cc#oldcode24 ui/compositor/test/default_context_factory.cc:24: if (!gfx::GLSurface::InitializeOneOff() || On 2014/01/24 19:22:23, piman ...
6 years, 11 months ago (2014-01-24 20:17:23 UTC) #3
piman
LGTM. +ben for ui/ stuff.
6 years, 11 months ago (2014-01-24 20:24:35 UTC) #4
danakj
I updated the GLSurface code to not modify the command line anymore in tests. This ...
6 years, 11 months ago (2014-01-25 01:37:21 UTC) #5
piman
lgtm
6 years, 11 months ago (2014-01-25 01:48:13 UTC) #6
Ben Goodger (Google)
ui lgtm
6 years, 11 months ago (2014-01-25 02:45:25 UTC) #7
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/danakj@chromium.org/135213003/930001
6 years, 11 months ago (2014-01-25 03:02:22 UTC) #8
commit-bot: I haz the power
Retried try job too often on linux_rel for step(s) unit_tests http://build.chromium.org/p/tryserver.chromium/buildstatus?builder=linux_rel&number=218738
6 years, 11 months ago (2014-01-25 03:56:00 UTC) #9
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/danakj@chromium.org/135213003/1290001
6 years, 11 months ago (2014-01-27 20:16:24 UTC) #10
danakj
Daniel, can you please take a look, in particular at: content/browser/browser_main_loop.cc content/gpu/gpu_child_thread.cc content/gpu/gpu_main.cc gpu/config/gpu_info_collector_android.cc These ...
6 years, 10 months ago (2014-01-29 01:06:11 UTC) #11
no sievers
On 2014/01/29 01:06:11, danakj wrote: > Daniel, can you please take a look, in particular ...
6 years, 10 months ago (2014-01-29 01:54:22 UTC) #12
no sievers
https://codereview.chromium.org/135213003/diff/1540001/gpu/config/gpu_info_collector_android.cc File gpu/config/gpu_info_collector_android.cc (right): https://codereview.chromium.org/135213003/diff/1540001/gpu/config/gpu_info_collector_android.cc#newcode75 gpu/config/gpu_info_collector_android.cc:75: if (!eglMakeCurrent(display_, draw_surface_, read_surface_, context_)) I think display_ at ...
6 years, 10 months ago (2014-01-29 02:00:21 UTC) #13
no sievers
https://codereview.chromium.org/135213003/diff/1540001/gpu/config/gpu_info_collector_android.cc File gpu/config/gpu_info_collector_android.cc (right): https://codereview.chromium.org/135213003/diff/1540001/gpu/config/gpu_info_collector_android.cc#newcode75 gpu/config/gpu_info_collector_android.cc:75: if (!eglMakeCurrent(display_, draw_surface_, read_surface_, context_)) On 2014/01/29 02:00:22, sievers ...
6 years, 10 months ago (2014-01-29 02:14:57 UTC) #14
danakj
https://codereview.chromium.org/135213003/diff/1540001/gpu/config/gpu_info_collector_android.cc File gpu/config/gpu_info_collector_android.cc (right): https://codereview.chromium.org/135213003/diff/1540001/gpu/config/gpu_info_collector_android.cc#newcode75 gpu/config/gpu_info_collector_android.cc:75: if (!eglMakeCurrent(display_, draw_surface_, read_surface_, context_)) On 2014/01/29 02:14:58, sievers ...
6 years, 10 months ago (2014-01-29 19:05:58 UTC) #15
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/danakj@chromium.org/135213003/1560001
6 years, 10 months ago (2014-01-29 20:13:41 UTC) #16
commit-bot: I haz the power
Change committed as 247793
6 years, 10 months ago (2014-01-30 01:04:57 UTC) #17
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/danakj@chromium.org/135213003/1580001
6 years, 10 months ago (2014-01-30 20:30:31 UTC) #18
commit-bot: I haz the power
Change committed as 248049
6 years, 10 months ago (2014-01-30 22:05:45 UTC) #19
commit-bot: I haz the power
CQ bit was unchecked on CL. Ignoring.
6 years, 10 months ago (2014-01-30 22:05:59 UTC) #20
danakj
Mac GL unit tests expect to use real GL not osmesa. So I've updated the ...
6 years, 10 months ago (2014-01-31 16:08:01 UTC) #21
danakj
On 2014/01/31 16:08:01, danakj wrote: > Mac GL unit tests expect to use real GL ...
6 years, 10 months ago (2014-01-31 16:15:44 UTC) #22
danakj
The CQ bit was checked by danakj@chromium.org
6 years, 10 months ago (2014-02-03 18:12:30 UTC) #23
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/danakj@chromium.org/135213003/1640005
6 years, 10 months ago (2014-02-03 18:12:47 UTC) #24
danakj
Committed patchset #36 manually as r248557 (presubmit successful).
6 years, 10 months ago (2014-02-03 19:53:24 UTC) #25
commit-bot: I haz the power
CQ bit was unchecked on CL. Ignoring.
6 years, 10 months ago (2014-02-03 19:53:27 UTC) #26
commit-bot: I haz the power
CQ bit was unchecked on CL. Ignoring.
6 years, 10 months ago (2014-02-03 19:53:29 UTC) #27
commit-bot: I haz the power
6 years, 10 months ago (2014-02-03 19:53:49 UTC) #28
Message was sent while issue was closed.
CQ bit was unchecked on CL. Ignoring.

Powered by Google App Engine
This is Rietveld 408576698