diff options
author | reveman <reveman@chromium.org> | 2015-10-26 13:27:47 -0700 |
---|---|---|
committer | Commit bot <commit-bot@chromium.org> | 2015-10-26 20:28:42 +0000 |
commit | eb0fda21bf0fc43f591dfe2a6302fc014c425118 (patch) | |
tree | bb053cf4e4557a8c94910f48a4dbe118988e5a1f /cc/raster | |
parent | b65cfea2a48ce74ac98e2b10006e9d8b868d4553 (diff) | |
download | chromium_src-eb0fda21bf0fc43f591dfe2a6302fc014c425118.zip chromium_src-eb0fda21bf0fc43f591dfe2a6302fc014c425118.tar.gz chromium_src-eb0fda21bf0fc43f591dfe2a6302fc014c425118.tar.bz2 |
ui: Rename gfx::BufferUsage enum values and add BufferUsage::GPU_READ.
The problem with the current usage modes is that we currently use
SCANOUT for anything that doesn't require CPU access. When importing
a buffer we typically don't care about anything but having the GPU
be able to read from it. SCANOUT is not a good description of that
and currently means GPU read/write support.
This patch attempts to make usage more explicit and it solves the
use case where a buffer type can only provide GPU read and not GPU
write support (e.g. SHM fallback). Here are the new usage modes:
- GPU_READ
- GPU_READ_WRITE
- GPU_READ_CPU_READ_WRITE
GPU_READ is useful when importing a buffer and all you care about is
being able to use it for sampling and optionally scanout.
GPU_READ_WRITE is useful for things like WebGL or GPU raster where
we want the ability to write to the buffer using GL and potentially
use it for scanout.
GPU_READ_CPU_READ_WRITE is the usage mode that allows CPU access and
is used for one-copy and zero-copy texture initialization. There's
nothing preventing this mode from also supporting scanout.
- GPU_READ_CPU_READ_WRITE_PERSISTENT
This usage mode indicates that the data will be persistent across
Unmap()/Map() calls but will likely become part of the normal
GPU_READ_CPU_READ_WRITE usage once all buffer types support this.
BUG=538325
CQ_INCLUDE_TRYBOTS=tryserver.blink:linux_blink_rel
Review URL: https://codereview.chromium.org/1420923005
Cr-Commit-Position: refs/heads/master@{#356108}
Diffstat (limited to 'cc/raster')
-rw-r--r-- | cc/raster/one_copy_tile_task_worker_pool.cc | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/cc/raster/one_copy_tile_task_worker_pool.cc b/cc/raster/one_copy_tile_task_worker_pool.cc index 94c8a8e..18be9c2 100644 --- a/cc/raster/one_copy_tile_task_worker_pool.cc +++ b/cc/raster/one_copy_tile_task_worker_pool.cc @@ -388,14 +388,15 @@ void OneCopyTileTaskWorkerPool::PlaybackAndCopyOnWorkerThread( base::AutoUnlock unlock(lock_); // Allocate GpuMemoryBuffer if necessary. If using partial raster, we - // must allocate a buffer with BufferUsage PERSISTENT_MAP. + // must allocate a buffer with BufferUsage CPU_READ_WRITE_PERSISTENT. if (!staging_buffer->gpu_memory_buffer) { staging_buffer->gpu_memory_buffer = resource_provider_->gpu_memory_buffer_manager() ->AllocateGpuMemoryBuffer( staging_buffer->size, BufferFormat(resource->format()), - use_partial_raster_ ? gfx::BufferUsage::PERSISTENT_MAP - : gfx::BufferUsage::MAP); + use_partial_raster_ + ? gfx::BufferUsage::GPU_READ_CPU_READ_WRITE_PERSISTENT + : gfx::BufferUsage::GPU_READ_CPU_READ_WRITE); DCHECK_EQ(gfx::NumberOfPlanesForBufferFormat( staging_buffer->gpu_memory_buffer->GetFormat()), 1u); |