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

Issue 12892005: Implement client side PBOs for glReadPixel (Closed)

Created:
7 years, 9 months ago by hubbe
Modified:
7 years, 8 months ago
CC:
chromium-reviews, joi+watch-content_chromium.org, darin-cc_chromium.org, jam, David Trainor- moved to gerrit, aelias_OOO_until_Jul13
Visibility:
Public.

Description

Implement client side PBOs for glReadPixel Use PBOs in gl_helper swizzle bytes on gpu flip vertically on gpu remove gl_helper_thread Implements GLHelper::CropScaleReadbackAndCleanTexture() to be non-blocking in the client by using shared memory combined with a query (not requiring actual GL PBO support, which would not be available on Android). Committed: https://src.chromium.org/viewvc/chrome?view=rev&revision=191737

Patch Set 1 #

Patch Set 2 : unsigned fix #

Patch Set 3 : android fix #

Patch Set 4 : another unsigned int fix #

Patch Set 5 : update glReadPixels test #

Patch Set 6 : made test better #

Patch Set 7 : pbo unit test added #

Total comments: 34

Patch Set 8 : lots of cleanup, made sure callbacks come back in right order #

Total comments: 9

Patch Set 9 : restore bindings #

Total comments: 1

Patch Set 10 : don't restore bindings #

Total comments: 4

Patch Set 11 : updated tests #

Total comments: 8

Patch Set 12 : git cl try #

Total comments: 4

Patch Set 13 : more comments, GL_STREAM_READ added #

Total comments: 33

Patch Set 14 : feedback incorporated #

Patch Set 15 : use callbacks #

Total comments: 1

Patch Set 16 : make GLHelper constructor explicit #

Unified diffs Side-by-side diffs Delta from patch set Stats (+377 lines, -291 lines) Patch
M content/browser/renderer_host/image_transport_factory.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 1 chunk +2 lines, -8 lines 0 comments Download
M content/browser/renderer_host/image_transport_factory_android.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 1 chunk +1 line, -1 line 0 comments Download
M content/common/gpu/client/gl_helper.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 3 chunks +4 lines, -9 lines 0 comments Download
M content/common/gpu/client/gl_helper.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 20 chunks +103 lines, -236 lines 0 comments Download
M gpu/GLES2/gl2extchromium.h View 1 2 3 4 5 6 7 8 9 10 11 12 3 chunks +8 lines, -1 line 0 comments Download
M gpu/command_buffer/client/buffer_tracker.h View 3 chunks +11 lines, -1 line 0 comments Download
M gpu/command_buffer/client/gles2_implementation.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 2 chunks +5 lines, -1 line 0 comments Download
M gpu/command_buffer/client/gles2_implementation.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 16 chunks +126 lines, -26 lines 0 comments Download
M gpu/command_buffer/client/gles2_implementation_unittest.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 1 chunk +0 lines, -1 line 0 comments Download
M gpu/command_buffer/service/gles2_cmd_decoder.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 2 chunks +12 lines, -4 lines 0 comments Download
A gpu/command_buffer/tests/gl_readback_unittests.cc View 1 2 3 4 5 6 7 8 9 10 11 12 1 chunk +99 lines, -0 lines 0 comments Download
M gpu/gpu.gyp View 1 2 3 4 5 6 7 8 9 10 11 12 1 chunk +4 lines, -3 lines 0 comments Download
M ui/gl/gl_bindings.h View 1 2 3 4 5 6 7 1 chunk +2 lines, -0 lines 0 comments Download

Messages

Total messages: 43 (0 generated)
apatrick_chromium
I've added Gregg because he's the better reviewer for this. In general it looks good. ...
7 years, 9 months ago (2013-03-19 18:34:48 UTC) #1
greggman
https://codereview.chromium.org/12892005/diff/14001/content/common/gpu/client/gl_helper.cc File content/common/gpu/client/gl_helper.cc (right): https://codereview.chromium.org/12892005/diff/14001/content/common/gpu/client/gl_helper.cc#newcode560 content/common/gpu/client/gl_helper.cc:560: context_->endQueryEXT(GL_COMMANDS_ISSUED_CHROMIUM); On 2013/03/19 18:34:48, apatrick_chromium wrote: > You might ...
7 years, 9 months ago (2013-03-19 20:54:11 UTC) #2
hubbe
https://codereview.chromium.org/12892005/diff/14001/content/common/gpu/client/gl_helper.cc File content/common/gpu/client/gl_helper.cc (right): https://codereview.chromium.org/12892005/diff/14001/content/common/gpu/client/gl_helper.cc#newcode383 content/common/gpu/client/gl_helper.cc:383: " gl_FragColor = swizzle * texture2D(s_texture, v_texcoord);" On 2013/03/19 ...
7 years, 9 months ago (2013-03-19 22:42:42 UTC) #3
apatrick_chromium
https://codereview.chromium.org/12892005/diff/14001/content/common/gpu/client/gl_helper.cc File content/common/gpu/client/gl_helper.cc (right): https://codereview.chromium.org/12892005/diff/14001/content/common/gpu/client/gl_helper.cc#newcode560 content/common/gpu/client/gl_helper.cc:560: context_->endQueryEXT(GL_COMMANDS_ISSUED_CHROMIUM); On 2013/03/19 22:42:42, hubbe wrote: > On 2013/03/19 ...
7 years, 9 months ago (2013-03-19 23:31:20 UTC) #4
hubbe
https://codereview.chromium.org/12892005/diff/14001/content/common/gpu/client/gl_helper.cc File content/common/gpu/client/gl_helper.cc (right): https://codereview.chromium.org/12892005/diff/14001/content/common/gpu/client/gl_helper.cc#newcode561 content/common/gpu/client/gl_helper.cc:561: context_->bindBuffer(GL_PIXEL_UNPACK_TRANSFER_BUFFER_CHROMIUM, 0); On 2013/03/19 23:31:20, apatrick_chromium wrote: > On ...
7 years, 9 months ago (2013-03-19 23:39:27 UTC) #5
apatrick_chromium
https://codereview.chromium.org/12892005/diff/14001/content/common/gpu/client/gl_helper.cc File content/common/gpu/client/gl_helper.cc (right): https://codereview.chromium.org/12892005/diff/14001/content/common/gpu/client/gl_helper.cc#newcode561 content/common/gpu/client/gl_helper.cc:561: context_->bindBuffer(GL_PIXEL_UNPACK_TRANSFER_BUFFER_CHROMIUM, 0); Yes it looks like getInteger(GL_PIXEL_PACK_TRANSFER_BUFFER_BINDING_CHROMIUM, ...) will ...
7 years, 9 months ago (2013-03-19 23:53:59 UTC) #6
hubbe
All buffer bindings should now be restored I think.
7 years, 9 months ago (2013-03-20 00:30:09 UTC) #7
greggman
I can't see an easy way to make the unit tests useful. How about writing ...
7 years, 9 months ago (2013-03-20 00:42:17 UTC) #8
hubbe1
#(*@#$ One of the glGetIntegerv() calls is going to the GPU process, which slows the ...
7 years, 9 months ago (2013-03-20 00:47:26 UTC) #9
greggman
https://codereview.chromium.org/12892005/diff/32001/content/common/gpu/client/gl_helper.cc File content/common/gpu/client/gl_helper.cc (right): https://codereview.chromium.org/12892005/diff/32001/content/common/gpu/client/gl_helper.cc#newcode124 content/common/gpu/client/gl_helper.cc:124: context_->getIntegerv(target_binding, &prev_id_); I know al said it was okay ...
7 years, 9 months ago (2013-03-20 00:59:12 UTC) #10
hubbe1
I've changed it back to bind zero when done. I think this is safe, and ...
7 years, 9 months ago (2013-03-20 02:20:52 UTC) #11
apatrick_chromium
Thanks for checking. I'm comfortable with changing the bindings now. A few comments inline. Also, ...
7 years, 9 months ago (2013-03-20 18:38:50 UTC) #12
apatrick_chromium
https://codereview.chromium.org/12892005/diff/39001/content/common/gpu/client/gl_helper.cc File content/common/gpu/client/gl_helper.cc (right): https://codereview.chromium.org/12892005/diff/39001/content/common/gpu/client/gl_helper.cc#newcode16 content/common/gpu/client/gl_helper.cc:16: #include "base/synchronization/waitable_event.h" I think some of these includes are ...
7 years, 9 months ago (2013-03-20 18:39:09 UTC) #13
hubbe1
When you guys say I should write a "gl_test", you mean adding a file to ...
7 years, 9 months ago (2013-03-20 19:54:37 UTC) #14
hubbe
Implemented a gl_test for this. CL Should hopefully be in pretty reasonable shape now. Working ...
7 years, 9 months ago (2013-03-20 22:03:47 UTC) #15
hubbe
Ping?
7 years, 9 months ago (2013-03-21 22:08:04 UTC) #16
apatrick_chromium
Thanks for the tests. A few comments. https://codereview.chromium.org/12892005/diff/47001/gpu/command_buffer/tests/gl_readback_unittests.cc File gpu/command_buffer/tests/gl_readback_unittests.cc (right): https://codereview.chromium.org/12892005/diff/47001/gpu/command_buffer/tests/gl_readback_unittests.cc#newcode30 gpu/command_buffer/tests/gl_readback_unittests.cc:30: TEST_F(GLReadbackTest, ReadPixelsWithPBO) ...
7 years, 9 months ago (2013-03-21 22:51:27 UTC) #17
hubbe
Sorry about the "git cl try" patch name (typeahead error) https://codereview.chromium.org/12892005/diff/47001/gpu/command_buffer/tests/gl_readback_unittests.cc File gpu/command_buffer/tests/gl_readback_unittests.cc (right): https://codereview.chromium.org/12892005/diff/47001/gpu/command_buffer/tests/gl_readback_unittests.cc#newcode30 ...
7 years, 9 months ago (2013-03-21 23:00:58 UTC) #18
apatrick_chromium
LGTM for my part. Over to gman.
7 years, 9 months ago (2013-03-21 23:08:54 UTC) #19
greggman
just a few nit then LGTM https://codereview.chromium.org/12892005/diff/24001/gpu/command_buffer/client/gles2_implementation.cc File gpu/command_buffer/client/gles2_implementation.cc (right): https://codereview.chromium.org/12892005/diff/24001/gpu/command_buffer/client/gles2_implementation.cc#newcode3465 gpu/command_buffer/client/gles2_implementation.cc:3465: // If there's ...
7 years, 9 months ago (2013-03-21 23:18:13 UTC) #20
hubbe
https://codereview.chromium.org/12892005/diff/24001/gpu/command_buffer/client/gles2_implementation.cc File gpu/command_buffer/client/gles2_implementation.cc (right): https://codereview.chromium.org/12892005/diff/24001/gpu/command_buffer/client/gles2_implementation.cc#newcode3465 gpu/command_buffer/client/gles2_implementation.cc:3465: // If there's no data/buffer just issue the AsyncTexImage2D ...
7 years, 9 months ago (2013-03-21 23:36:51 UTC) #21
hubbe
Does anybody have any more comments on this CL, or can I check it in? ...
7 years, 9 months ago (2013-03-27 20:41:42 UTC) #22
apatrick_chromium
lgtm
7 years, 9 months ago (2013-03-27 20:48:15 UTC) #23
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/hubbe@chromium.org/12892005/66001
7 years, 9 months ago (2013-03-28 06:02:17 UTC) #24
commit-bot: I haz the power
Presubmit check for 12892005-66001 failed and returned exit status 1. INFO:root:Found 13 file(s). Running presubmit ...
7 years, 9 months ago (2013-03-28 06:02:25 UTC) #25
hubbe
Adding Daniel Sievers, OWNER for content/browser/render_host/image_transport_factory*
7 years, 9 months ago (2013-03-28 06:11:00 UTC) #26
no sievers
On 2013/03/28 06:11:00, hubbe wrote: > Adding Daniel Sievers, OWNER for > content/browser/render_host/image_transport_factory* From glancing ...
7 years, 9 months ago (2013-03-28 18:37:10 UTC) #27
hubbe
Your summary is absolutely accurate. Added it to the CL description. On 2013/03/28 18:37:10, Daniel ...
7 years, 9 months ago (2013-03-28 19:03:31 UTC) #28
piman
https://codereview.chromium.org/12892005/diff/66001/content/common/gpu/client/gl_helper.cc File content/common/gpu/client/gl_helper.cc (right): https://codereview.chromium.org/12892005/diff/66001/content/common/gpu/client/gl_helper.cc#newcode474 content/common/gpu/client/gl_helper.cc:474: #ifdef USE_SKIA ? What does USE_SKIA mean? All platforms ...
7 years, 9 months ago (2013-03-28 20:22:22 UTC) #29
piman
(note: I'm really excited about this change, it's really cool!) On Thu, Mar 28, 2013 ...
7 years, 9 months ago (2013-03-28 20:24:08 UTC) #30
hubbe
Most feedback incorporated. Need pointer on how to use sync points with callbacks. https://codereview.chromium.org/12892005/diff/66001/content/common/gpu/client/gl_helper.cc File ...
7 years, 9 months ago (2013-03-28 20:52:35 UTC) #31
piman
https://codereview.chromium.org/12892005/diff/66001/content/common/gpu/client/gl_helper.cc File content/common/gpu/client/gl_helper.cc (right): https://codereview.chromium.org/12892005/diff/66001/content/common/gpu/client/gl_helper.cc#newcode556 content/common/gpu/client/gl_helper.cc:556: base::TimeDelta::FromMilliseconds(2)); On 2013/03/28 20:52:35, hubbe wrote: > On 2013/03/28 ...
7 years, 9 months ago (2013-03-28 21:10:06 UTC) #32
no sievers
On 2013/03/28 21:10:06, piman wrote: > https://codereview.chromium.org/12892005/diff/66001/content/common/gpu/client/gl_helper.cc > File content/common/gpu/client/gl_helper.cc (right): > > https://codereview.chromium.org/12892005/diff/66001/content/common/gpu/client/gl_helper.cc#newcode556 > ...
7 years, 9 months ago (2013-03-28 23:33:01 UTC) #33
hubbe1
I'm really tempted to just cast the WebGraphicsContext3D to a WebGraphicsContext3DCommandBufferImpl and call GetCommandBufferProxy()->SignalSyncPoint(....) but ...
7 years, 9 months ago (2013-03-28 23:46:08 UTC) #34
piman
On Thu, Mar 28, 2013 at 4:33 PM, <sievers@chromium.org> wrote: > On 2013/03/28 21:10:06, piman ...
7 years, 9 months ago (2013-03-28 23:55:27 UTC) #35
piman
On Thu, Mar 28, 2013 at 4:46 PM, Fredrik Hubinette <hubbe@google.com> wrote: > I'm really ...
7 years, 9 months ago (2013-03-28 23:58:34 UTC) #36
epenner
On 2013/03/28 23:46:08, hubbe1 wrote: > I'm really tempted to just cast the WebGraphicsContext3D to ...
7 years, 9 months ago (2013-03-29 00:02:15 UTC) #37
no sievers
On 2013/03/28 23:46:08, hubbe1 wrote: > I'm really tempted to just cast the WebGraphicsContext3D to ...
7 years, 9 months ago (2013-03-29 00:14:40 UTC) #38
piman
On Thu, Mar 28, 2013 at 5:14 PM, <sievers@chromium.org> wrote: > On 2013/03/28 23:46:08, hubbe1 ...
7 years, 9 months ago (2013-03-29 00:25:16 UTC) #39
hubbe
Ok, I updated gl_helper to take a WebGraphicsContext3DCommandBufferImpl*, so that I can call SignalSyncPoint. I ...
7 years, 8 months ago (2013-03-29 17:11:13 UTC) #40
piman
LGTM+nit, this is great. Thanks! https://codereview.chromium.org/12892005/diff/101001/content/common/gpu/client/gl_helper.h File content/common/gpu/client/gl_helper.h (right): https://codereview.chromium.org/12892005/diff/101001/content/common/gpu/client/gl_helper.h#newcode27 content/common/gpu/client/gl_helper.h:27: GLHelper(WebGraphicsContext3DCommandBufferImpl* context); nit: explicit
7 years, 8 months ago (2013-04-01 18:06:18 UTC) #41
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/hubbe@chromium.org/12892005/109001
7 years, 8 months ago (2013-04-01 23:42:01 UTC) #42
commit-bot: I haz the power
7 years, 8 months ago (2013-04-02 01:16:12 UTC) #43
Message was sent while issue was closed.
Change committed as 191737

Powered by Google App Engine
This is Rietveld 408576698