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

Issue 2446523002: cc: Use CHROMIUM_copy_image for one-copy tile updates.

Created:
4 years, 2 months ago by reveman
Modified:
3 years, 11 months ago
Reviewers:
sunnyps, ericrk
CC:
cc-bugs_chromium.org, chromium-reviews
Target Ref:
refs/pending/heads/master
Project:
chromium
Visibility:
Public.

Description

cc: Use CHROMIUM_copy_image for one-copy tile updates. This reduces complexitiy and improves tile update performance by using the new CHROMIUM_copy_image extension. BUG=653908 TEST=cc_unittests CQ_INCLUDE_TRYBOTS=master.tryserver.blink:linux_precise_blink_rel

Patch Set 1 #

Patch Set 2 : rebase #

Total comments: 6
Unified diffs Side-by-side diffs Delta from patch set Stats (+89 lines, -111 lines) Patch
M cc/raster/one_copy_raster_buffer_provider.cc View 5 chunks +26 lines, -45 lines 2 comments Download
M cc/raster/staging_buffer_pool.h View 2 chunks +6 lines, -2 lines 0 comments Download
M cc/raster/staging_buffer_pool.cc View 4 chunks +57 lines, -59 lines 4 comments Download
M cc/resources/resource_provider.h View 2 chunks +0 lines, -2 lines 0 comments Download
M cc/resources/resource_provider.cc View 2 chunks +0 lines, -3 lines 0 comments Download

Depends on Patchset:

Dependent Patchsets:

Messages

Total messages: 7 (4 generated)
reveman
3 years, 11 months ago (2017-01-06 08:24:10 UTC) #3
ericrk
Looks much nicer! a few small questions. https://codereview.chromium.org/2446523002/diff/20001/cc/raster/one_copy_raster_buffer_provider.cc File cc/raster/one_copy_raster_buffer_provider.cc (right): https://codereview.chromium.org/2446523002/diff/20001/cc/raster/one_copy_raster_buffer_provider.cc#newcode318 cc/raster/one_copy_raster_buffer_provider.cc:318: gl->CopyImageSubDataCHROMIUM(staging_buffer->image_id, resource_texture_id, ...
3 years, 11 months ago (2017-01-10 03:50:31 UTC) #6
reveman
3 years, 11 months ago (2017-01-10 19:37:56 UTC) #7
https://codereview.chromium.org/2446523002/diff/20001/cc/raster/one_copy_rast...
File cc/raster/one_copy_raster_buffer_provider.cc (right):

https://codereview.chromium.org/2446523002/diff/20001/cc/raster/one_copy_rast...
cc/raster/one_copy_raster_buffer_provider.cc:318:
gl->CopyImageSubDataCHROMIUM(staging_buffer->image_id, resource_texture_id,
On 2017/01/10 at 03:50:31, ericrk wrote:
> Internally (if I traced through the code correctly), it looks like we end up
issuing a glCompressedTexSubImage2D rather than the previous
glCompressedTexImage2D. I assume this is fine, but after reading the above
comment I wanted to double check that calling SubImage with the full image rect
is fine wrt/ dealing with an unallocated resource.

We might need to add some special code for this on the service side or do an
initial CompressedTexImage2D call here to make this work. I'll make sure this
works correctly before we get to a point where this can land.

https://codereview.chromium.org/2446523002/diff/20001/cc/raster/staging_buffe...
File cc/raster/staging_buffer_pool.cc (right):

https://codereview.chromium.org/2446523002/diff/20001/cc/raster/staging_buffe...
cc/raster/staging_buffer_pool.cc:37: if (gpu_fence->Wait(end - now))
On 2017/01/10 at 03:50:31, ericrk wrote:
> nit: I understand that things like this sometimes return early, but I wonder
if it's nicer for the GpuFence::Wait implementation to handle this logic? Not
sure if the "may return early" is desirable in other use cases.

That was my initial approach but I decided it was better to just push this up to
the caller where it can in some cases be handled more efficiently and it's also
consistent with base::ConditionVariable
(https://cs.chromium.org/chromium/src/base/synchronization/condition_variable....)

https://codereview.chromium.org/2446523002/diff/20001/cc/raster/staging_buffe...
cc/raster/staging_buffer_pool.cc:323: ContextProvider::ScopedContextLock
scoped_context(
On 2017/01/10 at 03:50:31, ericrk wrote:
> not sure what the overhead of locking/re-locking, but I wonder if it's worth
making scoped_context a unique_ptr or base::Optional scoped outside of the while
loop. It could be initialized the first time it would be used - so it's only
taken once, if necessary.
> 
> I guess that brings the MarkStagingBuffersAsBusy and RemoveStagingBuffers
calls into the lock scope, but they seem pretty lightweight?

Makes sense. I'll address this as I rebase this patch.

Powered by Google App Engine
This is Rietveld 408576698