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

Issue 7713015: Split WebGraphicsContext3DCommandBufferImpl::initialize() into two stages. (Closed)

Created:
9 years, 4 months ago by lain Merrick
Modified:
9 years, 3 months ago
CC:
chromium-reviews, joi+watch-content_chromium.org, darin-cc_chromium.org, jam, apatrick_chromium
Visibility:
Public.

Description

Split WebGraphicsContext3DCommandBufferImpl::initialize() into two stages. After the context is created, the remaining calls should be done on the compositor thread. This CL adds a MaybeInitializeGL() method, which we run on each call to makeContextCurrent(). Added asserts to RendererGLContext to check that it's always used on the same thread. Committed: http://src.chromium.org/viewvc/chrome?view=rev&revision=98392

Patch Set 1 #

Patch Set 2 : Removed temporary debug code #

Patch Set 3 : Rebased, noted WebKit dependencies #

Total comments: 12

Patch Set 4 : Added mutex for g_all_contexts #

Total comments: 2

Patch Set 5 : Renamed to MaybeInitializeGL, clarified threading contract, added some asserts #

Total comments: 4

Patch Set 6 : Moved asserts to RendererGLContext #

Total comments: 7

Patch Set 7 : Limited scope of lock, added comment #

Total comments: 1
Unified diffs Side-by-side diffs Delta from patch set Stats (+117 lines, -66 lines) Patch
M content/renderer/gpu/renderer_gl_context.h View 1 2 3 4 5 1 chunk +4 lines, -0 lines 0 comments Download
M content/renderer/gpu/renderer_gl_context.cc View 1 2 3 4 5 6 5 chunks +9 lines, -1 line 0 comments Download
M content/renderer/gpu/webgraphicscontext3d_command_buffer_impl.h View 1 2 3 4 5 4 chunks +16 lines, -0 lines 1 comment Download
M content/renderer/gpu/webgraphicscontext3d_command_buffer_impl.cc View 1 2 3 4 5 6 8 chunks +88 lines, -65 lines 0 comments Download

Messages

Total messages: 21 (0 generated)
lain Merrick
9 years, 4 months ago (2011-08-23 01:10:32 UTC) #1
jamesr
To be clear, the idea is that InitializeGLES2() is called from the compositor thread? If ...
9 years, 4 months ago (2011-08-23 01:23:23 UTC) #2
lain Merrick
http://codereview.chromium.org/7713015/diff/6001/content/renderer/gpu/webgraphicscontext3d_command_buffer_impl.cc File content/renderer/gpu/webgraphicscontext3d_command_buffer_impl.cc (right): http://codereview.chromium.org/7713015/diff/6001/content/renderer/gpu/webgraphicscontext3d_command_buffer_impl.cc#newcode150 content/renderer/gpu/webgraphicscontext3d_command_buffer_impl.cc:150: RenderView* renderview = RenderView::FromWebView(web_view_); On 2011/08/23 01:23:23, jamesr wrote: ...
9 years, 4 months ago (2011-08-23 01:31:03 UTC) #3
nduca
Thanks for doing this Iain! http://codereview.chromium.org/7713015/diff/6001/content/renderer/gpu/webgraphicscontext3d_command_buffer_impl.cc File content/renderer/gpu/webgraphicscontext3d_command_buffer_impl.cc (left): http://codereview.chromium.org/7713015/diff/6001/content/renderer/gpu/webgraphicscontext3d_command_buffer_impl.cc#oldcode134 content/renderer/gpu/webgraphicscontext3d_command_buffer_impl.cc:134: web_view_ = web_view; I ...
9 years, 4 months ago (2011-08-23 05:08:19 UTC) #4
jamesr1
Mutex guarding the all contexts set is fine, it's used to ensure all contexts are ...
9 years, 4 months ago (2011-08-23 05:44:26 UTC) #5
lain Merrick
http://codereview.chromium.org/7713015/diff/6001/content/renderer/gpu/webgraphicscontext3d_command_buffer_impl.cc File content/renderer/gpu/webgraphicscontext3d_command_buffer_impl.cc (right): http://codereview.chromium.org/7713015/diff/6001/content/renderer/gpu/webgraphicscontext3d_command_buffer_impl.cc#newcode214 content/renderer/gpu/webgraphicscontext3d_command_buffer_impl.cc:214: if (!InitializeGLES2()) { On 2011/08/23 05:08:19, nduca wrote: > ...
9 years, 4 months ago (2011-08-23 15:14:01 UTC) #6
lain Merrick
Having gone back to figure out what g_all_contexts is actually needed for, I don't see ...
9 years, 4 months ago (2011-08-23 17:39:21 UTC) #7
nduca
Okie, sorry for the misdirection!
9 years, 4 months ago (2011-08-23 17:40:17 UTC) #8
lain Merrick
Just realised I didn't update the comment on InitializeGLES2() yet. I'll do that now.
9 years, 4 months ago (2011-08-23 18:23:59 UTC) #9
no sievers
Looks good to me. On a related note: We have to delete the WebGraphicsContext3D on ...
9 years, 4 months ago (2011-08-24 02:50:44 UTC) #10
lain Merrick
http://codereview.chromium.org/7713015/diff/6001/content/renderer/gpu/webgraphicscontext3d_command_buffer_impl.h File content/renderer/gpu/webgraphicscontext3d_command_buffer_impl.h (right): http://codereview.chromium.org/7713015/diff/6001/content/renderer/gpu/webgraphicscontext3d_command_buffer_impl.h#newcode436 content/renderer/gpu/webgraphicscontext3d_command_buffer_impl.h:436: bool InitializeGLES2(); On 2011/08/23 05:08:19, nduca wrote: > Any ...
9 years, 4 months ago (2011-08-24 19:52:04 UTC) #11
lain Merrick
Added asserts that makeCurrentContext() and the destructor are called on the same thread (as that ...
9 years, 4 months ago (2011-08-24 19:53:35 UTC) #12
nduca
LGTM with nits http://codereview.chromium.org/7713015/diff/17001/content/renderer/gpu/webgraphicscontext3d_command_buffer_impl.cc File content/renderer/gpu/webgraphicscontext3d_command_buffer_impl.cc (right): http://codereview.chromium.org/7713015/diff/17001/content/renderer/gpu/webgraphicscontext3d_command_buffer_impl.cc#newcode229 content/renderer/gpu/webgraphicscontext3d_command_buffer_impl.cc:229: if (!MaybeInitializeGL()) { remove {'s since ...
9 years, 4 months ago (2011-08-25 02:10:00 UTC) #13
lain Merrick
http://codereview.chromium.org/7713015/diff/17001/content/renderer/gpu/webgraphicscontext3d_command_buffer_impl.cc File content/renderer/gpu/webgraphicscontext3d_command_buffer_impl.cc (right): http://codereview.chromium.org/7713015/diff/17001/content/renderer/gpu/webgraphicscontext3d_command_buffer_impl.cc#newcode229 content/renderer/gpu/webgraphicscontext3d_command_buffer_impl.cc:229: if (!MaybeInitializeGL()) { On 2011/08/25 02:10:01, nduca wrote: > ...
9 years, 3 months ago (2011-08-25 19:55:16 UTC) #14
jamesr
still not threadsafe http://codereview.chromium.org/7713015/diff/21001/content/renderer/gpu/webgraphicscontext3d_command_buffer_impl.cc File content/renderer/gpu/webgraphicscontext3d_command_buffer_impl.cc (right): http://codereview.chromium.org/7713015/diff/21001/content/renderer/gpu/webgraphicscontext3d_command_buffer_impl.cc#newcode115 content/renderer/gpu/webgraphicscontext3d_command_buffer_impl.cc:115: web_view_ = NULL; web_view_ is set ...
9 years, 3 months ago (2011-08-25 20:05:53 UTC) #15
lain Merrick
http://codereview.chromium.org/7713015/diff/21001/content/renderer/gpu/webgraphicscontext3d_command_buffer_impl.cc File content/renderer/gpu/webgraphicscontext3d_command_buffer_impl.cc (right): http://codereview.chromium.org/7713015/diff/21001/content/renderer/gpu/webgraphicscontext3d_command_buffer_impl.cc#newcode115 content/renderer/gpu/webgraphicscontext3d_command_buffer_impl.cc:115: web_view_ = NULL; On 2011/08/25 20:05:53, jamesr wrote: > ...
9 years, 3 months ago (2011-08-25 20:11:17 UTC) #16
lain Merrick
http://codereview.chromium.org/7713015/diff/21001/content/renderer/gpu/renderer_gl_context.cc File content/renderer/gpu/renderer_gl_context.cc (right): http://codereview.chromium.org/7713015/diff/21001/content/renderer/gpu/renderer_gl_context.cc#newcode212 content/renderer/gpu/renderer_gl_context.cc:212: DCHECK(MessageLoop::current() == message_loop_); Oops, this is static. Will fix.
9 years, 3 months ago (2011-08-25 20:13:22 UTC) #17
Ken Russell (switch to Gerrit)
LGTM from OWNERS standpoint.
9 years, 3 months ago (2011-08-26 00:40:42 UTC) #18
commit-bot: I haz the power
Change committed as 98392
9 years, 3 months ago (2011-08-26 05:01:27 UTC) #19
jbates
Drive by.. http://codereview.chromium.org/7713015/diff/21004/content/renderer/gpu/webgraphicscontext3d_command_buffer_impl.h File content/renderer/gpu/webgraphicscontext3d_command_buffer_impl.h (right): http://codereview.chromium.org/7713015/diff/21004/content/renderer/gpu/webgraphicscontext3d_command_buffer_impl.h#newcode64 content/renderer/gpu/webgraphicscontext3d_command_buffer_impl.h:64: // enforce strictly in all implementations. This ...
9 years, 3 months ago (2011-08-26 17:12:46 UTC) #20
lain Merrick
9 years, 3 months ago (2011-09-02 14:10:11 UTC) #21
On 2011/08/26 17:12:46, jbates wrote:
> Drive by..
> 
>
http://codereview.chromium.org/7713015/diff/21004/content/renderer/gpu/webgra...
> File content/renderer/gpu/webgraphicscontext3d_command_buffer_impl.h (right):
> 
>
http://codereview.chromium.org/7713015/diff/21004/content/renderer/gpu/webgra...
> content/renderer/gpu/webgraphicscontext3d_command_buffer_impl.h:64: // enforce
> strictly in all implementations.
> This is a bit confusing, can it be rephrased?
> "Permanently binds to the first calling thread. Returns false if the graphics
> context fails to create. Does not do any thread checking on consecutive calls
--
> the return value will may remain true even when called from the wrong thread."

Turns out this CL got reverted so I need to fix it and submit again anyway. I'll
CC you on the new review.

Powered by Google App Engine
This is Rietveld 408576698