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

Issue 195583003: Add initial GpuMemoryBufferSurfaceTexture implementation. (Closed)

Created:
6 years, 9 months ago by reveman
Modified:
6 years, 8 months ago
CC:
chromium-reviews, jbauman+watch_chromium.org, jam, sievers+watch_chromium.org, joi+watch-content_chromium.org, darin-cc_chromium.org, kalyank, piman+watch_chromium.org, danakj+watch_chromium.org
Visibility:
Public.

Description

Add initial GpuMemoryBufferSurfaceTexture implementation. This adds the plumbing and allocation logic needed to implement a surface texture backed GpuMemoryBuffer on Android. The allocation flow is the same as other GpuMemoryBuffer implementations. That is; the browser process decides if a renderer is allowed to allocate a new GpuMemoryBuffer or not. Successful allocation results in a valid GpuMemoryBufferHandle being returned to the renderer. This handle can be used to create a GpuMemoryBufferImpl instance on the renderer side, which can be mapped into the renderer address space and used as existing GpuMemoryBufferImpls. The same handle can also be used to register the GpuMemoryBuffer with the GPU process and and create a GLImage that can be used for sampling. Two new interfaces are added to allow sharing of surface textures across process boundaries: SurfaceTextureLookup, this interface is used by a renderer to acquire a native widget for a surface texture. The native widget allows the renderer to map the storage of the surface texture into its address space. The current implementation of this interface uses Java Binder IPC to share the surface texture surface with a renderer process. SurfaceTextureTracker, this interface is used by GLImage implementation to acquire ownership of surface textures allocated by the browser process. Current implementation of this interface only works with GLImage instances in the browser process. A different implementation can be added to support out of process GLImage instances. This is currently limited to buffered surface textures and GL_TEXTURE_EXTERNAL_OES texture target. BUG=269808 Committed: https://src.chromium.org/viewvc/chrome?view=rev&revision=260498

Patch Set 1 #

Patch Set 2 : #

Total comments: 36

Patch Set 3 : Fix potential races and limit surface texture access to specific renderer. #

Patch Set 4 : Add ::InitInstance comments. #

Total comments: 11

Patch Set 5 : Remove unnecessary calls to DetachFromGLContext #

Patch Set 6 : add missing include #

Patch Set 7 : Add CalledOnValidThread() check. #

Total comments: 4

Patch Set 8 : address review feedback #

Total comments: 5

Patch Set 9 : use base::ProcessHandle explicitly in a few places #

Total comments: 11

Patch Set 10 : use child process id instead of pid for secondary id #

Patch Set 11 : java ref stuff.. #

Patch Set 12 : rebase #

Unified diffs Side-by-side diffs Delta from patch set Stats (+665 lines, -36 lines) Patch
M content/app/android/child_process_service.cc View 1 2 3 4 5 6 7 6 chunks +29 lines, -2 lines 0 comments Download
M content/browser/android/child_process_launcher_android.h View 1 2 3 4 5 6 7 1 chunk +1 line, -0 lines 0 comments Download
M content/browser/android/child_process_launcher_android.cc View 1 2 3 4 5 6 7 8 9 10 3 chunks +15 lines, -1 line 0 comments Download
M content/browser/child_process_launcher.cc View 1 2 3 4 5 6 7 1 chunk +1 line, -1 line 0 comments Download
M content/browser/renderer_host/compositor_impl_android.h View 1 2 3 4 5 6 7 8 9 10 2 chunks +14 lines, -1 line 0 comments Download
M content/browser/renderer_host/compositor_impl_android.cc View 1 2 3 4 5 6 7 8 9 10 5 chunks +123 lines, -3 lines 0 comments Download
M content/browser/renderer_host/render_message_filter.cc View 1 2 3 4 5 6 7 8 9 3 chunks +21 lines, -0 lines 0 comments Download
A content/common/android/surface_texture_lookup.h View 1 2 3 4 5 6 7 1 chunk +26 lines, -0 lines 0 comments Download
A content/common/android/surface_texture_lookup.cc View 1 2 3 4 5 6 7 1 chunk +27 lines, -0 lines 0 comments Download
M content/common/child_process_messages.h View 1 2 3 4 5 6 7 1 chunk +10 lines, -0 lines 0 comments Download
M content/common/gpu/client/gpu_channel_host.cc View 2 chunks +7 lines, -0 lines 0 comments Download
M content/common/gpu/client/gpu_memory_buffer_impl_android.cc View 2 chunks +9 lines, -0 lines 0 comments Download
A content/common/gpu/client/gpu_memory_buffer_impl_surface_texture.h View 1 2 3 4 5 6 7 1 chunk +41 lines, -0 lines 0 comments Download
A content/common/gpu/client/gpu_memory_buffer_impl_surface_texture.cc View 1 2 3 4 5 6 7 1 chunk +105 lines, -0 lines 0 comments Download
M content/common/gpu/gpu_channel.h View 1 2 3 4 5 6 7 8 9 1 chunk +2 lines, -0 lines 0 comments Download
M content/common/gpu/gpu_command_buffer_stub.cc View 1 2 3 4 5 6 7 8 9 1 chunk +9 lines, -0 lines 0 comments Download
M content/content_common.gypi View 1 2 3 4 5 6 7 8 9 2 chunks +6 lines, -0 lines 0 comments Download
M content/public/android/java/src/org/chromium/content/app/ChildProcessService.java View 1 2 3 4 5 6 7 1 chunk +16 lines, -0 lines 0 comments Download
M content/public/android/java/src/org/chromium/content/browser/ChildProcessLauncher.java View 1 2 3 4 5 6 7 8 9 5 chunks +21 lines, -2 lines 0 comments Download
M content/public/android/java/src/org/chromium/content/common/IChildProcessCallback.aidl View 1 2 3 4 5 6 7 1 chunk +2 lines, -0 lines 0 comments Download
M ui/gfx/gpu_memory_buffer.h View 1 2 3 4 5 6 7 8 9 10 11 1 chunk +20 lines, -9 lines 0 comments Download
A ui/gl/android/surface_texture_tracker.h View 1 2 3 4 5 6 7 1 chunk +32 lines, -0 lines 0 comments Download
A ui/gl/android/surface_texture_tracker.cc View 1 2 3 4 5 1 chunk +26 lines, -0 lines 0 comments Download
M ui/gl/gl.gyp View 1 2 3 4 5 6 7 8 9 10 11 2 chunks +4 lines, -0 lines 0 comments Download
M ui/gl/gl_image_android.cc View 1 2 3 4 5 6 7 8 9 10 11 2 chunks +9 lines, -0 lines 0 comments Download
A + ui/gl/gl_image_surface_texture.h View 1 2 3 4 5 6 7 8 9 10 2 chunks +14 lines, -17 lines 0 comments Download
A ui/gl/gl_image_surface_texture.cc View 1 2 3 4 5 6 7 8 9 10 1 chunk +75 lines, -0 lines 0 comments Download

Messages

Total messages: 60 (0 generated)
reveman
https://codereview.chromium.org/195583003/diff/20001/content/browser/renderer_host/compositor_impl_android.cc File content/browser/renderer_host/compositor_impl_android.cc (right): https://codereview.chromium.org/195583003/diff/20001/content/browser/renderer_host/compositor_impl_android.cc#newcode168 content/browser/renderer_host/compositor_impl_android.cc:168: jobject GetSurface(int surface_texture_id) const { This should probably take ...
6 years, 9 months ago (2014-03-11 22:59:35 UTC) #1
reveman
This initial patch is focused on getting the allocation and integration with the rest of ...
6 years, 9 months ago (2014-03-11 23:12:49 UTC) #2
epennerAtGoogle
https://codereview.chromium.org/195583003/diff/20001/content/browser/renderer_host/compositor_impl_android.cc File content/browser/renderer_host/compositor_impl_android.cc (right): https://codereview.chromium.org/195583003/diff/20001/content/browser/renderer_host/compositor_impl_android.cc#newcode191 content/browser/renderer_host/compositor_impl_android.cc:191: base::LazyInstance<SurfaceTextureTrackerImpl> g_surface_texture_tracker = Hold on, I thought the gfx::SurfaceTextureTracker ...
6 years, 9 months ago (2014-03-12 00:45:06 UTC) #3
reveman
https://codereview.chromium.org/195583003/diff/20001/content/browser/renderer_host/compositor_impl_android.cc File content/browser/renderer_host/compositor_impl_android.cc (right): https://codereview.chromium.org/195583003/diff/20001/content/browser/renderer_host/compositor_impl_android.cc#newcode191 content/browser/renderer_host/compositor_impl_android.cc:191: base::LazyInstance<SurfaceTextureTrackerImpl> g_surface_texture_tracker = On 2014/03/12 00:45:06, epennerAtGoogle wrote: > ...
6 years, 9 months ago (2014-03-12 16:07:05 UTC) #4
epennerAtGoogle
LGTM % hashing out the pointer bit and % sievers@ review. https://codereview.chromium.org/195583003/diff/20001/content/browser/renderer_host/compositor_impl_android.cc File content/browser/renderer_host/compositor_impl_android.cc (right): ...
6 years, 9 months ago (2014-03-12 19:46:28 UTC) #5
epennerAtGoogle
https://codereview.chromium.org/195583003/diff/20001/ui/gl/gl_image_surface_texture.cc File ui/gl/gl_image_surface_texture.cc (right): https://codereview.chromium.org/195583003/diff/20001/ui/gl/gl_image_surface_texture.cc#newcode41 ui/gl/gl_image_surface_texture.cc:41: void DetachFromGLContext(SurfaceTexture* surface_texture) { Oh, one thought here would ...
6 years, 9 months ago (2014-03-12 20:52:33 UTC) #6
reveman
https://codereview.chromium.org/195583003/diff/20001/content/browser/renderer_host/compositor_impl_android.cc File content/browser/renderer_host/compositor_impl_android.cc (right): https://codereview.chromium.org/195583003/diff/20001/content/browser/renderer_host/compositor_impl_android.cc#newcode191 content/browser/renderer_host/compositor_impl_android.cc:191: base::LazyInstance<SurfaceTextureTrackerImpl> g_surface_texture_tracker = On 2014/03/12 19:46:28, epennerAtGoogle wrote: > ...
6 years, 9 months ago (2014-03-12 21:19:10 UTC) #7
epennerAtGoogle
https://codereview.chromium.org/195583003/diff/20001/content/browser/renderer_host/compositor_impl_android.cc File content/browser/renderer_host/compositor_impl_android.cc (right): https://codereview.chromium.org/195583003/diff/20001/content/browser/renderer_host/compositor_impl_android.cc#newcode191 content/browser/renderer_host/compositor_impl_android.cc:191: base::LazyInstance<SurfaceTextureTrackerImpl> g_surface_texture_tracker = Ah, your other comment cleared up ...
6 years, 9 months ago (2014-03-12 23:10:14 UTC) #8
epenner
Also, note that this still SGTM (%sievers@ review) I just want to understand if this ...
6 years, 9 months ago (2014-03-13 19:59:39 UTC) #9
reveman
PTAL https://codereview.chromium.org/195583003/diff/20001/content/browser/renderer_host/compositor_impl_android.cc File content/browser/renderer_host/compositor_impl_android.cc (right): https://codereview.chromium.org/195583003/diff/20001/content/browser/renderer_host/compositor_impl_android.cc#newcode168 content/browser/renderer_host/compositor_impl_android.cc:168: jobject GetSurface(int surface_texture_id) const { On 2014/03/11 22:59:36, ...
6 years, 9 months ago (2014-03-13 21:36:00 UTC) #10
epenner
> These type of global instances are usually set very early > before any threads ...
6 years, 9 months ago (2014-03-13 22:37:24 UTC) #11
reveman
On 2014/03/13 22:37:24, epenner wrote: > > These type of global instances are usually set ...
6 years, 9 months ago (2014-03-13 23:04:10 UTC) #12
no sievers
Very cool! Can we move all the code from CompositorImpl to somewhere else? Maybe it ...
6 years, 9 months ago (2014-03-14 01:24:51 UTC) #13
reveman
SurfaceTextureTrackerImpl doesn't have to be in CompositorImpl but I think it belongs in content/ as ...
6 years, 9 months ago (2014-03-14 19:44:52 UTC) #14
no sievers
On 2014/03/14 19:44:52, reveman wrote: > SurfaceTextureTrackerImpl doesn't have to be in CompositorImpl but I ...
6 years, 9 months ago (2014-03-18 20:58:02 UTC) #15
no sievers
https://codereview.chromium.org/195583003/diff/60001/content/app/android/child_process_service.cc File content/app/android/child_process_service.cc (right): https://codereview.chromium.org/195583003/diff/60001/content/app/android/child_process_service.cc#newcode88 content/app/android/child_process_service.cc:88: const base::android::ScopedJavaLocalRef<jobject>& service) On 2014/03/14 19:44:53, reveman wrote: > ...
6 years, 9 months ago (2014-03-18 20:58:12 UTC) #16
reveman
PTAL https://codereview.chromium.org/195583003/diff/120001/ui/gl/gl_image_surface_texture.cc File ui/gl/gl_image_surface_texture.cc (right): https://codereview.chromium.org/195583003/diff/120001/ui/gl/gl_image_surface_texture.cc#newcode58 ui/gl/gl_image_surface_texture.cc:58: SurfaceTextureTracker::GetInstance()->AcquireSurfaceTexture( On 2014/03/18 20:58:13, sievers wrote: > This ...
6 years, 9 months ago (2014-03-24 18:35:06 UTC) #17
no sievers
LGTM with nits. Still think the tracker impl should be somewhere other than inside CompositorImpl. ...
6 years, 9 months ago (2014-03-24 19:26:07 UTC) #18
reveman
It's easy to move the SurfaceTrackerImpl as it's a global instance. Just let me know ...
6 years, 9 months ago (2014-03-25 01:31:23 UTC) #19
no sievers
On 2014/03/25 01:31:23, reveman wrote: > It's easy to move the SurfaceTrackerImpl as it's a ...
6 years, 9 months ago (2014-03-25 01:43:01 UTC) #20
reveman
+piman I started working on out-of-process GPU service support to make sure the current design ...
6 years, 9 months ago (2014-03-26 21:00:58 UTC) #21
no sievers
On 2014/03/26 21:00:58, reveman wrote: > +piman > > I started working on out-of-process GPU ...
6 years, 9 months ago (2014-03-27 00:22:17 UTC) #22
piman
https://codereview.chromium.org/195583003/diff/160001/content/browser/android/child_process_launcher_android.cc File content/browser/android/child_process_launcher_android.cc (right): https://codereview.chromium.org/195583003/diff/160001/content/browser/android/child_process_launcher_android.cc#newcode172 content/browser/android/child_process_launcher_android.cc:172: return CompositorImpl::GetSurfaceTextureSurface(surface_texture_id, pid); Should there be a check somewhere ...
6 years, 9 months ago (2014-03-27 01:07:25 UTC) #23
reveman
The jobject ref problem still needs to be fixed but PTAL while I figure out ...
6 years, 9 months ago (2014-03-27 14:48:10 UTC) #24
piman
thanks for the comments. LGTM % figuring out the jobject thing.
6 years, 9 months ago (2014-03-27 17:51:15 UTC) #25
no sievers
https://codereview.chromium.org/195583003/diff/160001/content/browser/renderer_host/compositor_impl_android.cc File content/browser/renderer_host/compositor_impl_android.cc (right): https://codereview.chromium.org/195583003/diff/160001/content/browser/renderer_host/compositor_impl_android.cc#newcode190 content/browser/renderer_host/compositor_impl_android.cc:190: : it->second->surface.j_surface().obj(); On 2014/03/27 14:48:11, reveman wrote: > On ...
6 years, 9 months ago (2014-03-27 18:25:25 UTC) #26
reveman
+cdn for content/common/child_process_messages.h +sky for ui/gfx
6 years, 9 months ago (2014-03-28 01:19:17 UTC) #27
sky
ui/gfx/gpu_memory_buffer.h LGTM
6 years, 9 months ago (2014-03-28 15:38:26 UTC) #28
Cris Neckar
IPC changes LGTM
6 years, 9 months ago (2014-03-28 17:00:24 UTC) #29
reveman
The CQ bit was checked by reveman@chromium.org
6 years, 9 months ago (2014-03-28 18:44:22 UTC) #30
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/reveman@chromium.org/195583003/200001
6 years, 9 months ago (2014-03-28 18:45:59 UTC) #31
commit-bot: I haz the power
The CQ bit was unchecked by commit-bot@chromium.org
6 years, 9 months ago (2014-03-28 20:28:52 UTC) #32
commit-bot: I haz the power
Try jobs failed on following builders: tryserver.chromium on linux_chromium_chromeos_rel
6 years, 9 months ago (2014-03-28 20:28:52 UTC) #33
reveman
The CQ bit was checked by reveman@chromium.org
6 years, 9 months ago (2014-03-28 20:37:18 UTC) #34
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/reveman@chromium.org/195583003/200001
6 years, 9 months ago (2014-03-28 20:38:22 UTC) #35
commit-bot: I haz the power
The CQ bit was unchecked by commit-bot@chromium.org
6 years, 9 months ago (2014-03-28 21:38:19 UTC) #36
commit-bot: I haz the power
Commit queue rejected this change because the description was changed between the time the change ...
6 years, 9 months ago (2014-03-28 21:38:20 UTC) #37
reveman
The CQ bit was checked by reveman@chromium.org
6 years, 9 months ago (2014-03-28 21:41:54 UTC) #38
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/reveman@chromium.org/195583003/200001
6 years, 9 months ago (2014-03-28 21:50:08 UTC) #39
commit-bot: I haz the power
The CQ bit was unchecked by commit-bot@chromium.org
6 years, 9 months ago (2014-03-28 23:45:13 UTC) #40
commit-bot: I haz the power
Commit queue rejected this change because the description was changed between the time the change ...
6 years, 9 months ago (2014-03-28 23:45:14 UTC) #41
reveman
The CQ bit was checked by reveman@chromium.org
6 years, 9 months ago (2014-03-28 23:51:10 UTC) #42
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/reveman@chromium.org/195583003/200001
6 years, 9 months ago (2014-03-28 23:56:39 UTC) #43
commit-bot: I haz the power
The CQ bit was unchecked by commit-bot@chromium.org
6 years, 9 months ago (2014-03-29 01:37:12 UTC) #44
commit-bot: I haz the power
Try jobs failed on following builders: tryserver.chromium on linux_chromium_chromeos_rel
6 years, 9 months ago (2014-03-29 01:37:13 UTC) #45
reveman
The CQ bit was checked by reveman@chromium.org
6 years, 9 months ago (2014-03-29 01:49:14 UTC) #46
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/reveman@chromium.org/195583003/200001
6 years, 9 months ago (2014-03-29 01:51:25 UTC) #47
commit-bot: I haz the power
The CQ bit was unchecked by commit-bot@chromium.org
6 years, 9 months ago (2014-03-29 03:25:16 UTC) #48
commit-bot: I haz the power
Try jobs failed on following builders: tryserver.chromium on linux_chromium_chromeos_rel
6 years, 9 months ago (2014-03-29 03:25:17 UTC) #49
reveman
The CQ bit was checked by reveman@chromium.org
6 years, 9 months ago (2014-03-29 04:10:17 UTC) #50
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/reveman@chromium.org/195583003/200001
6 years, 9 months ago (2014-03-29 04:11:20 UTC) #51
commit-bot: I haz the power
The CQ bit was unchecked by commit-bot@chromium.org
6 years, 9 months ago (2014-03-29 05:42:40 UTC) #52
commit-bot: I haz the power
Try jobs failed on following builders: tryserver.chromium on linux_chromium_chromeos_rel
6 years, 9 months ago (2014-03-29 05:42:41 UTC) #53
reveman
The CQ bit was checked by reveman@chromium.org
6 years, 8 months ago (2014-03-30 04:32:03 UTC) #54
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/reveman@chromium.org/195583003/200001
6 years, 8 months ago (2014-03-30 04:32:07 UTC) #55
commit-bot: I haz the power
The CQ bit was unchecked by commit-bot@chromium.org
6 years, 8 months ago (2014-03-30 06:07:12 UTC) #56
commit-bot: I haz the power
Try jobs failed on following builders: tryserver.chromium on linux_chromium_chromeos_rel
6 years, 8 months ago (2014-03-30 06:07:13 UTC) #57
reveman
The CQ bit was checked by reveman@chromium.org
6 years, 8 months ago (2014-03-31 05:10:21 UTC) #58
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/reveman@chromium.org/195583003/200001
6 years, 8 months ago (2014-03-31 05:10:38 UTC) #59
commit-bot: I haz the power
6 years, 8 months ago (2014-03-31 06:45:04 UTC) #60
Message was sent while issue was closed.
Change committed as 260498

Powered by Google App Engine
This is Rietveld 408576698