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

Issue 22277004: Add gfx::SurfaceFactoryWebview (Closed)

Created:
7 years, 4 months ago by boliu
Modified:
7 years, 4 months ago
Reviewers:
Ted C, joth, no sievers, piman
CC:
chromium-reviews, rjkroege
Visibility:
Public.

Description

Add AwGLSurface and use it in WGC3D Android can put the webview into an FBO, and compositor should draw into the FBO instead of directly on screen. Use AwGLSurface and explicitly set the FBO at the beginning of each hardware draw. Add new APIs in GLInProcessContext and WGC3DIPCBI to allow the underlying GLSurface to be created separately. BUG=251501 Committed: https://src.chromium.org/viewvc/chrome?view=rev&revision=216136

Patch Set 1 #

Patch Set 2 : rename factory #

Patch Set 3 : implementation #

Total comments: 9

Patch Set 4 : s/SurfaceFactoryWebview/SurfaceFactoryAndroid/, address nits and such #

Total comments: 4

Patch Set 5 : static member var #

Total comments: 1

Patch Set 6 : per webview surface #

Patch Set 7 : minor cleanups #

Patch Set 8 : null out on detach #

Total comments: 2

Patch Set 9 : always create Aw surface even if not associated with webview #

Patch Set 10 : directly set/unset factory #

Total comments: 2

Patch Set 11 : Get/SetCurrent #

Patch Set 12 : rename to GLFactoryAndroid #

Total comments: 5

Patch Set 13 : merge with codereview.chromium.org/22066002, no clean up yet #

Patch Set 14 : Add thread check #

Total comments: 3

Patch Set 15 : InProcessContext takes attrib struct #

Total comments: 15

Patch Set 16 : typo #

Total comments: 4

Patch Set 17 : Address Daniel's comments #

Patch Set 18 : rebase, address joth's comments #

Patch Set 19 : export GLInProcessContextAttribs #

Patch Set 20 : fix clang build #

Unified diffs Side-by-side diffs Delta from patch set Stats (+447 lines, -143 lines) Patch
M android_webview/android_webview.gyp View 1 2 3 4 5 6 7 8 9 1 chunk +2 lines, -0 lines 0 comments Download
A android_webview/browser/aw_gl_surface.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 1 chunk +42 lines, -0 lines 0 comments Download
A android_webview/browser/aw_gl_surface.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 1 chunk +48 lines, -0 lines 0 comments Download
M android_webview/browser/in_process_view_renderer.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 3 chunks +5 lines, -0 lines 0 comments Download
M android_webview/browser/in_process_view_renderer.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 6 chunks +26 lines, -9 lines 0 comments Download
M android_webview/browser/scoped_app_gl_state_restore.h View 1 2 3 4 5 2 chunks +3 lines, -0 lines 0 comments Download
M android_webview/browser/scoped_app_gl_state_restore.cc View 1 2 3 4 5 6 7 8 9 2 chunks +2 lines, -0 lines 0 comments Download
M content/browser/android/in_process/synchronous_compositor_impl.h View 1 2 3 4 5 6 7 8 9 10 11 12 1 chunk +2 lines, -1 line 0 comments Download
M content/browser/android/in_process/synchronous_compositor_impl.cc View 1 2 3 4 5 6 7 8 9 10 11 12 2 chunks +4 lines, -1 line 0 comments Download
M content/browser/android/in_process/synchronous_compositor_output_surface.h View 1 2 3 4 5 6 7 8 9 10 11 12 1 chunk +3 lines, -1 line 0 comments Download
M content/browser/android/in_process/synchronous_compositor_output_surface.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 3 chunks +30 lines, -10 lines 0 comments Download
M content/public/browser/android/synchronous_compositor.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 3 chunks +5 lines, -2 lines 0 comments Download
M gpu/command_buffer/client/gl_in_process_context.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 4 chunks +30 lines, -17 lines 0 comments Download
M gpu/command_buffer/client/gl_in_process_context.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 8 chunks +111 lines, -53 lines 0 comments Download
M gpu/command_buffer/service/in_process_command_buffer.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 4 chunks +15 lines, -1 line 0 comments Download
M gpu/command_buffer/service/in_process_command_buffer.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 22 chunks +48 lines, -7 lines 0 comments Download
M webkit/common/gpu/webgraphicscontext3d_in_process_command_buffer_impl.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 3 chunks +12 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 5 chunks +59 lines, -41 lines 0 comments Download

Messages

Total messages: 37 (0 generated)
boliu
fbo attempt #3, probably in pretty rough shape right now, conceptually much simpler though
7 years, 4 months ago (2013-08-06 01:35:56 UTC) #1
no sievers
LGTM with nits. https://codereview.chromium.org/22277004/diff/5001/android_webview/browser/gl_surface_factory.cc File android_webview/browser/gl_surface_factory.cc (right): https://codereview.chromium.org/22277004/diff/5001/android_webview/browser/gl_surface_factory.cc#newcode69 android_webview/browser/gl_surface_factory.cc:69: gfx::SurfaceFactoryWebView::SetInstance(g_gl_surface_factory.Pointer()); do you need the LazyInstance ...
7 years, 4 months ago (2013-08-06 01:50:06 UTC) #2
boliu
s/SurfaceFactoryWebview/SurfaceFactoryAndroid/ as well https://codereview.chromium.org/22277004/diff/5001/android_webview/browser/gl_surface_factory.cc File android_webview/browser/gl_surface_factory.cc (right): https://codereview.chromium.org/22277004/diff/5001/android_webview/browser/gl_surface_factory.cc#newcode69 android_webview/browser/gl_surface_factory.cc:69: gfx::SurfaceFactoryWebView::SetInstance(g_gl_surface_factory.Pointer()); On 2013/08/06 01:50:06, sievers wrote: ...
7 years, 4 months ago (2013-08-06 02:14:26 UTC) #3
boliu
Antoine, could you take a look changes in ui/gl please. Thanks.
7 years, 4 months ago (2013-08-06 02:24:02 UTC) #4
piman
globals, globals... what happens if one app has 2 webviews in it? https://codereview.chromium.org/22277004/diff/12001/android_webview/browser/gl_surface_factory.cc File android_webview/browser/gl_surface_factory.cc ...
7 years, 4 months ago (2013-08-06 03:09:45 UTC) #5
boliu
On 2013/08/06 03:09:45, piman wrote: > globals, globals... what happens if one app has 2 ...
7 years, 4 months ago (2013-08-06 03:33:40 UTC) #6
joth
lgtm if piman is OK with it https://codereview.chromium.org/22277004/diff/5001/android_webview/browser/gl_surface_factory.cc File android_webview/browser/gl_surface_factory.cc (right): https://codereview.chromium.org/22277004/diff/5001/android_webview/browser/gl_surface_factory.cc#newcode69 android_webview/browser/gl_surface_factory.cc:69: gfx::SurfaceFactoryWebView::SetInstance(g_gl_surface_factory.Pointer()); On ...
7 years, 4 months ago (2013-08-06 03:55:41 UTC) #7
piman
On Mon, Aug 5, 2013 at 8:33 PM, <boliu@chromium.org> wrote: > On 2013/08/06 03:09:45, piman ...
7 years, 4 months ago (2013-08-06 04:06:30 UTC) #8
boliu
On 2013/08/06 04:06:30, piman wrote: > Maybe with just a bit more effort, we can ...
7 years, 4 months ago (2013-08-06 04:24:33 UTC) #9
boliu
AwGLSurface now owned by InProcessViewRenderer. Using raw pointer for the global factory instance. Re-implementing OnExit ...
7 years, 4 months ago (2013-08-06 05:37:24 UTC) #10
no sievers
https://codereview.chromium.org/22277004/diff/38001/android_webview/browser/in_process_view_renderer.cc File android_webview/browser/in_process_view_renderer.cc (right): https://codereview.chromium.org/22277004/diff/38001/android_webview/browser/in_process_view_renderer.cc#newcode306 android_webview/browser/in_process_view_renderer.cc:306: TRACE_EVENT0("android_webview", "InitializeHwDraw"); Do you need GLSurfaceFactory if you are ...
7 years, 4 months ago (2013-08-06 17:30:07 UTC) #11
boliu
https://codereview.chromium.org/22277004/diff/38001/android_webview/browser/in_process_view_renderer.cc File android_webview/browser/in_process_view_renderer.cc (right): https://codereview.chromium.org/22277004/diff/38001/android_webview/browser/in_process_view_renderer.cc#newcode306 android_webview/browser/in_process_view_renderer.cc:306: TRACE_EVENT0("android_webview", "InitializeHwDraw"); On 2013/08/06 17:30:07, sievers wrote: > Do ...
7 years, 4 months ago (2013-08-06 18:11:16 UTC) #12
no sievers
On 2013/08/06 18:11:16, boliu wrote: > https://codereview.chromium.org/22277004/diff/38001/android_webview/browser/in_process_view_renderer.cc > File android_webview/browser/in_process_view_renderer.cc (right): > > https://codereview.chromium.org/22277004/diff/38001/android_webview/browser/in_process_view_renderer.cc#newcode306 > ...
7 years, 4 months ago (2013-08-06 18:49:56 UTC) #13
boliu
On 2013/08/06 18:49:56, sievers wrote: > We know that creating the underlying context is synchronous ...
7 years, 4 months ago (2013-08-06 20:16:02 UTC) #14
no sievers
And since you pointed out iffy semantics - I assume you meant Get/SetInstance() maybe suggesting ...
7 years, 4 months ago (2013-08-06 20:31:29 UTC) #15
no sievers
Another thought: gl_context_android.cc has the counterpart for this webview path: if (compatible_surface->GetHandle()) { ... } ...
7 years, 4 months ago (2013-08-06 20:36:00 UTC) #16
boliu
On 2013/08/06 20:31:29, sievers wrote: > And since you pointed out iffy semantics - I ...
7 years, 4 months ago (2013-08-06 21:10:05 UTC) #17
no sievers
On 2013/08/06 21:10:05, boliu wrote: > On 2013/08/06 20:31:29, sievers wrote: > > And since ...
7 years, 4 months ago (2013-08-06 21:13:17 UTC) #18
boliu
On 2013/08/06 21:13:17, sievers wrote: > Sure, but then you might be renaming all over ...
7 years, 4 months ago (2013-08-06 21:24:33 UTC) #19
piman
https://codereview.chromium.org/22277004/diff/20002/android_webview/browser/aw_gl_surface.h File android_webview/browser/aw_gl_surface.h (right): https://codereview.chromium.org/22277004/diff/20002/android_webview/browser/aw_gl_surface.h#newcode34 android_webview/browser/aw_gl_surface.h:34: unsigned int fbo_; nit: DISALLOW_COPY_AND_ASSIGN https://codereview.chromium.org/22277004/diff/20002/android_webview/browser/in_process_view_renderer.cc File android_webview/browser/in_process_view_renderer.cc (right): ...
7 years, 4 months ago (2013-08-06 21:41:55 UTC) #20
no sievers
https://codereview.chromium.org/22277004/diff/20002/android_webview/browser/in_process_view_renderer.cc File android_webview/browser/in_process_view_renderer.cc (right): https://codereview.chromium.org/22277004/diff/20002/android_webview/browser/in_process_view_renderer.cc#newcode322 android_webview/browser/in_process_view_renderer.cc:322: ScopedSetSurfaceFactory setter(this); On 2013/08/06 21:41:55, piman wrote: > So, ...
7 years, 4 months ago (2013-08-06 21:44:49 UTC) #21
boliu
https://codereview.chromium.org/22277004/diff/20002/android_webview/browser/in_process_view_renderer.cc File android_webview/browser/in_process_view_renderer.cc (right): https://codereview.chromium.org/22277004/diff/20002/android_webview/browser/in_process_view_renderer.cc#newcode322 android_webview/browser/in_process_view_renderer.cc:322: ScopedSetSurfaceFactory setter(this); On 2013/08/06 21:41:55, piman wrote: > So, ...
7 years, 4 months ago (2013-08-06 21:51:16 UTC) #22
piman
On Tue, Aug 6, 2013 at 2:51 PM, <boliu@chromium.org> wrote: > > https://codereview.chromium.**org/22277004/diff/20002/** > android_webview/browser/in_**process_view_renderer.cc<https://codereview.chromium.org/22277004/diff/20002/android_webview/browser/in_process_view_renderer.cc> ...
7 years, 4 months ago (2013-08-06 22:01:18 UTC) #23
boliu
https://codereview.chromium.org/22277004/diff/58001/content/browser/android/in_process/synchronous_compositor_output_surface.cc File content/browser/android/in_process/synchronous_compositor_output_surface.cc (right): https://codereview.chromium.org/22277004/diff/58001/content/browser/android/in_process/synchronous_compositor_output_surface.cc#newcode38 content/browser/android/in_process/synchronous_compositor_output_surface.cc:38: // TODO(boliu): Much of this code is copied and ...
7 years, 4 months ago (2013-08-06 23:38:21 UTC) #24
piman
Looks reasonable. https://codereview.chromium.org/22277004/diff/58001/gpu/command_buffer/service/in_process_command_buffer.cc File gpu/command_buffer/service/in_process_command_buffer.cc (right): https://codereview.chromium.org/22277004/diff/58001/gpu/command_buffer/service/in_process_command_buffer.cc#newcode500 gpu/command_buffer/service/in_process_command_buffer.cc:500: DCHECK(sequence_checker_->CalledOnValidSequencedThread()); maybe DCHECK(!sequence_checker_ || sequence_checker_->CalledOnValidSequencedThread()), that way ...
7 years, 4 months ago (2013-08-07 00:03:41 UTC) #25
boliu
Made GLInProcessContext take a struct of int32s instead of a null terminated int array. The ...
7 years, 4 months ago (2013-08-07 00:24:56 UTC) #26
piman
LGTM if Daniel is happy too. https://codereview.chromium.org/22277004/diff/22004/gpu/command_buffer/client/gl_in_process_context.h File gpu/command_buffer/client/gl_in_process_context.h (right): https://codereview.chromium.org/22277004/diff/22004/gpu/command_buffer/client/gl_in_process_context.h#newcode27 gpu/command_buffer/client/gl_in_process_context.h:27: // The default ...
7 years, 4 months ago (2013-08-07 00:35:29 UTC) #27
boliu
+Ted for content/public/browser/android Daniel/Joth, should look over this again since it has changed a lot.
7 years, 4 months ago (2013-08-07 01:14:33 UTC) #28
no sievers
lgtm with small comments https://codereview.chromium.org/22277004/diff/22004/android_webview/browser/aw_gl_surface.cc File android_webview/browser/aw_gl_surface.cc (right): https://codereview.chromium.org/22277004/diff/22004/android_webview/browser/aw_gl_surface.cc#newcode44 android_webview/browser/aw_gl_surface.cc:44: void AwGLSurface::ResetBackingFrameBufferObject() { nit: Do ...
7 years, 4 months ago (2013-08-07 01:52:38 UTC) #29
boliu
https://codereview.chromium.org/22277004/diff/22004/android_webview/browser/aw_gl_surface.cc File android_webview/browser/aw_gl_surface.cc (right): https://codereview.chromium.org/22277004/diff/22004/android_webview/browser/aw_gl_surface.cc#newcode44 android_webview/browser/aw_gl_surface.cc:44: void AwGLSurface::ResetBackingFrameBufferObject() { On 2013/08/07 01:52:38, sievers wrote: > ...
7 years, 4 months ago (2013-08-07 02:58:48 UTC) #30
joth
aw/ and content/ lgtm % 2 nits https://codereview.chromium.org/22277004/diff/71001/android_webview/browser/in_process_view_renderer.cc File android_webview/browser/in_process_view_renderer.cc (right): https://codereview.chromium.org/22277004/diff/71001/android_webview/browser/in_process_view_renderer.cc#newcode326 android_webview/browser/in_process_view_renderer.cc:326: return; nit: ...
7 years, 4 months ago (2013-08-07 02:59:44 UTC) #31
boliu
https://codereview.chromium.org/22277004/diff/71001/android_webview/browser/in_process_view_renderer.cc File android_webview/browser/in_process_view_renderer.cc (right): https://codereview.chromium.org/22277004/diff/71001/android_webview/browser/in_process_view_renderer.cc#newcode326 android_webview/browser/in_process_view_renderer.cc:326: return; On 2013/08/07 02:59:44, joth wrote: > nit: use ...
7 years, 4 months ago (2013-08-07 03:34:45 UTC) #32
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/boliu@chromium.org/22277004/35002
7 years, 4 months ago (2013-08-07 05:25:45 UTC) #33
commit-bot: I haz the power
Sorry for I got bad news for ya. Compile failed with a clobber build on ...
7 years, 4 months ago (2013-08-07 05:45:15 UTC) #34
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/boliu@chromium.org/22277004/86003
7 years, 4 months ago (2013-08-07 05:50:07 UTC) #35
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/boliu@chromium.org/22277004/108001
7 years, 4 months ago (2013-08-07 06:19:27 UTC) #36
commit-bot: I haz the power
7 years, 4 months ago (2013-08-07 09:46:13 UTC) #37
Message was sent while issue was closed.
Change committed as 216136

Powered by Google App Engine
This is Rietveld 408576698