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

Issue 12717013: Add reference-counting for mailbox textures. (Closed)

Created:
7 years, 9 months ago by no sievers
Modified:
7 years, 7 months ago
CC:
chromium-reviews, aelias_OOO_until_Jul13, alexst (slow to review), danakj
Visibility:
Public.

Description

Add reference-counting for mailbox textures. Reference mailbox textures from each client texture. When a texture is produced into a mailbox, it becomes immutable (size 0x0), but can still be used to consume back to a mailbox texture. This makes it impossible to leak textures in the mailbox. Next is to actually reference the same texture from all client textures, but make them sort-of read-only (except for the active one). BUG=181640

Patch Set 1 #

Patch Set 2 : #

Total comments: 5

Patch Set 3 : do not reference same GL texture from multiple client textures #

Patch Set 4 : add optional 'pool' reference while textures are in mailbox #

Unified diffs Side-by-side diffs Delta from patch set Stats (+640 lines, -220 lines) Patch
M content/browser/renderer_host/image_transport_factory.h View 1 2 3 1 chunk +2 lines, -1 line 0 comments Download
M content/browser/renderer_host/image_transport_factory.cc View 1 2 3 3 chunks +11 lines, -2 lines 0 comments Download
M content/browser/renderer_host/render_widget_host_view_aura.cc View 1 2 3 3 chunks +5 lines, -2 lines 0 comments Download
M content/common/gpu/gpu_channel.h View 1 2 3 1 chunk +2 lines, -0 lines 0 comments Download
M content/common/gpu/gpu_channel.cc View 1 2 3 1 chunk +6 lines, -0 lines 0 comments Download
M content/common/gpu/gpu_channel_manager.h View 1 2 3 1 chunk +1 line, -0 lines 0 comments Download
M content/common/gpu/gpu_channel_manager.cc View 1 2 3 3 chunks +13 lines, -0 lines 0 comments Download
M content/common/gpu/gpu_command_buffer_stub.h View 1 2 3 1 chunk +2 lines, -0 lines 0 comments Download
M content/common/gpu/gpu_command_buffer_stub.cc View 1 2 3 2 chunks +11 lines, -0 lines 0 comments Download
M content/common/gpu/gpu_memory_manager.h View 1 2 3 1 chunk +1 line, -1 line 0 comments Download
M content/common/gpu/gpu_messages.h View 1 2 3 1 chunk +6 lines, -0 lines 0 comments Download
M content/common/gpu/texture_image_transport_surface.h View 1 2 3 4 chunks +4 lines, -5 lines 0 comments Download
M content/common/gpu/texture_image_transport_surface.cc View 1 2 3 13 chunks +29 lines, -43 lines 0 comments Download
M gpu/command_buffer/service/context_group.cc View 1 chunk +0 lines, -2 lines 0 comments Download
M gpu/command_buffer/service/gles2_cmd_decoder.cc View 1 2 3 3 chunks +4 lines, -4 lines 0 comments Download
M gpu/command_buffer/service/gles2_cmd_decoder_unittest.cc View 1 2 1 chunk +274 lines, -86 lines 0 comments Download
M gpu/command_buffer/service/mailbox_manager.h View 1 2 3 6 chunks +26 lines, -16 lines 0 comments Download
M gpu/command_buffer/service/mailbox_manager.cc View 1 2 3 4 chunks +41 lines, -27 lines 0 comments Download
M gpu/command_buffer/service/texture_definition.h View 1 2 3 5 chunks +38 lines, -4 lines 0 comments Download
M gpu/command_buffer/service/texture_definition.cc View 1 2 3 2 chunks +88 lines, -2 lines 0 comments Download
M gpu/command_buffer/service/texture_manager.h View 1 2 4 chunks +9 lines, -2 lines 0 comments Download
M gpu/command_buffer/service/texture_manager.cc View 1 2 7 chunks +61 lines, -17 lines 0 comments Download
M gpu/command_buffer/service/texture_manager_unittest.cc View 1 2 4 chunks +6 lines, -6 lines 0 comments Download

Messages

Total messages: 19 (0 generated)
no sievers
Maybe not fully polished yet, but probably good to get some feedback on the semantics ...
7 years, 9 months ago (2013-03-19 04:25:24 UTC) #1
apatrick_chromium
I think I like the direction here. There are some other tests that will make ...
7 years, 9 months ago (2013-03-19 18:50:18 UTC) #2
no sievers
Should I simply disallow producing a texture more than once? so there is somewhat of ...
7 years, 9 months ago (2013-03-19 19:06:58 UTC) #3
apatrick_chromium
On 2013/03/19 19:06:58, Daniel Sievers wrote: > Should I simply disallow producing a texture more ...
7 years, 9 months ago (2013-03-19 19:20:58 UTC) #4
no sievers
Per chat with Al: - make shared textures always immutable - fail SetTexParamter() while Texture::mailbox_ ...
7 years, 9 months ago (2013-03-19 20:36:48 UTC) #5
no sievers
On 2013/03/19 20:36:48, Daniel Sievers wrote: > Per chat with Al: > > - make ...
7 years, 9 months ago (2013-03-19 20:56:48 UTC) #6
no sievers
On 2013/03/19 20:56:48, Daniel Sievers wrote: > > - then it would also be nice ...
7 years, 9 months ago (2013-03-19 21:15:37 UTC) #7
alexst (slow to review)
> On second thought, this does not seem very useful, because there is no good ...
7 years, 9 months ago (2013-03-19 21:56:57 UTC) #8
no sievers
another thing: Should Texture::CanRenderTo() only return |true| for shared textures when the client is the ...
7 years, 9 months ago (2013-03-19 22:10:02 UTC) #9
piman
On Tue, Mar 19, 2013 at 1:36 PM, <sievers@chromium.org> wrote: > Per chat with Al: ...
7 years, 9 months ago (2013-03-19 22:50:49 UTC) #10
piman
On Tue, Mar 19, 2013 at 1:56 PM, <sievers@chromium.org> wrote: > On 2013/03/19 20:36:48, Daniel ...
7 years, 9 months ago (2013-03-19 22:56:11 UTC) #11
alexst (slow to review)
> Should Texture::CanRenderTo() only return |true| for shared textures when the > client is the ...
7 years, 9 months ago (2013-03-20 15:06:45 UTC) #12
alexst (slow to review)
> which would require binding the previous id to the framebuffer In fact WebGL paintCompositedResultsToCanvas ...
7 years, 9 months ago (2013-03-20 15:24:47 UTC) #13
piman
On Wed, Mar 20, 2013 at 8:06 AM, <alexst@chromium.org> wrote: > Should Texture::CanRenderTo() only return ...
7 years, 9 months ago (2013-03-20 17:06:29 UTC) #14
alexst (slow to review)
> Otherwise, since you only need to read from the produced texture, you can > ...
7 years, 9 months ago (2013-03-20 21:11:17 UTC) #15
no sievers
Ok, I have taken a step back in that a texture after 'produce' does not ...
7 years, 8 months ago (2013-04-02 03:07:20 UTC) #16
no sievers
On 2013/04/02 03:07:20, Daniel Sievers wrote: > At the same time I have made the ...
7 years, 8 months ago (2013-04-02 03:08:55 UTC) #17
no sievers
So the surface needs more logic to release the reference to the frontbuffer when it's ...
7 years, 8 months ago (2013-04-02 18:27:37 UTC) #18
no sievers
7 years, 8 months ago (2013-04-02 21:38:39 UTC) #19
On 2013/04/02 18:27:37, Daniel Sievers wrote:
> So the surface needs more logic to release the reference to the frontbuffer
when
> it's being freed. But I might have an idea for simplifying the logic needed in
> ImageTransportSurface...

Ok I've hacked on it a bit to show the general idea:

By default shared textures are only referenced from client textures. The mailbox
manager only has a weak ptr (with an observer callback for when the texture gets
destroyed). But optionally it can hold a reference to the shared texture if it
is stored there with a texture pool id.

The pool id for the transport surface is generated from the transport surface
id, so it can start putting textures into the pool without having to wait for
anything from the browser.

When RWHV (or the transport surface browser-side) goes away, it sends an IPC to
gpu process to remove all textures in that pool.

Powered by Google App Engine
This is Rietveld 408576698