RESOLVED INVALID66523
[chromium] RenderView should register for WebGraphics3D callbacks
https://bugs.webkit.org/show_bug.cgi?id=66523
Summary [chromium] RenderView should register for WebGraphics3D callbacks
Iain Merrick
Reported 2011-08-18 19:58:09 PDT
WebGraphics3DCommandBufferImpl has a WebView member variable. On certain events (context lost, swapBuffers started and finished) it extracts a RenderView from the WebView and calls methods on it. We'd like to get rid of that WebView. Instead, RenderView should register for callbacks with the WebGraphicsContext3D -- the hooks for this mostly exist already.
Attachments
First draft. (4.43 KB, patch)
2011-08-18 20:03 PDT, Iain Merrick
no flags
Added bug URL to ChangeLog. (4.59 KB, patch)
2011-08-19 09:11 PDT, Iain Merrick
no flags
Address Nat's comments (2.29 KB, patch)
2011-08-19 09:36 PDT, Iain Merrick
jamesr: review+
jamesr: commit-queue-
Iain Merrick
Comment 1 2011-08-18 20:03:20 PDT
Created attachment 104442 [details] First draft.
Iain Merrick
Comment 2 2011-08-18 20:06:57 PDT
WebKit Review Bot
Comment 3 2011-08-18 20:09:18 PDT
Attachment 104442 [details] did not pass style-queue: Failed to run "['Tools/Scripts/check-webkit-style', '--diff-files', u'Source/WebKit/chromium/ChangeLog', u'Sourc..." exit_code: 1 Source/WebKit/chromium/ChangeLog:1: ChangeLog entry has no bug number [changelog/bugnumber] [5] Total errors found: 1 in 4 files If any of these errors are false positives, please file a bug against check-webkit-style.
Nat Duca
Comment 4 2011-08-19 09:07:34 PDT
I think we can do this with a 100% Chromium-side patch to render_view.cc... lets talk when you get in, and sorry in advance for any confusion that I caused on my part in underspecifying this change in the first place.
Nat Duca
Comment 5 2011-08-19 09:11:21 PDT
Oh, snap, now I get it. We do need the posted callback, you're totally right and I'm majorly wrong. /me goes and drinks more coffee. Can we get by without the changes to WebViewClient? For example, what if we make WebGraphicsContext3DCommandBufferImpl::initialize call through to RenderView directly with a "hey, you just had a context attached to you" sort of way? That would be safe in the threaded case too since ::initialize will be called on the main thread too and the RenderView can ignore it.
Iain Merrick
Comment 6 2011-08-19 09:11:41 PDT
Created attachment 104516 [details] Added bug URL to ChangeLog.
Iain Merrick
Comment 7 2011-08-19 09:36:24 PDT
Created attachment 104518 [details] Address Nat's comments We don't need the extra WebViewClient method, so this is a lot simpler now -- just the extra callback.
James Robinson
Comment 8 2011-08-22 20:14:03 PDT
Comment on attachment 104518 [details] Address Nat's comments View in context: https://bugs.webkit.org/attachment.cgi?id=104518&action=review Seems reasonable. Where's the chromium side? Given how many callbacks we have now (lost context, swapbuffers complete, swapbuffers posted, etc etc) I wonder if it's time to move to a more general interface for this sort of thing. > WebKit/chromium/ChangeLog:18 > + * public/WebGraphicsContext3D.h: > + (WebKit::WebGraphicsContext3D::WebGraphicsSwapBuffersPostedCallbackCHROMIUM::~WebGraphicsSwapBuffersPostedCallbackCHROMIUM): > + (WebKit::WebGraphicsContext3D::setSwapBuffersPostedCallbackCHROMIUM): > + * public/WebViewClient.h: > + (WebKit::WebViewClient::initCompositorContext): > + * src/WebViewImpl.cpp: > + (WebKit::WebViewImpl::createLayerTreeHostContext3D): > + (WebKit::WebViewImpl::graphicsContext3D): This is out of date, please regenerate (or just edit).
Nat Duca
Comment 9 2011-08-22 22:52:13 PDT
Iirw, I think we figured out a way to not need this patch at all. The "so many callbacks" was smelling funny to Iain and I as well, so we switched to making #ifdef'd calls from WGC3D to RenderView . The long term fix for this is to move main-thread scheduling into the compositor as well. The main challenge I see there is plugin window moves and updateRects...
Iain Merrick
Comment 10 2011-08-23 08:16:25 PDT
As Nat said, this bug is obsolete, but I forgot to close it out, sorry.
Note You need to log in before you can comment on or make changes to this bug.