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 /chromecast | |
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 'chromecast')
-rw-r--r-- | chromecast/renderer/media/hole_frame_factory.cc | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/chromecast/renderer/media/hole_frame_factory.cc b/chromecast/renderer/media/hole_frame_factory.cc index 510b975..cd905d2 100644 --- a/chromecast/renderer/media/hole_frame_factory.cc +++ b/chromecast/renderer/media/hole_frame_factory.cc @@ -25,8 +25,8 @@ HoleFrameFactory::HoleFrameFactory( gl->GenTextures(1, &texture_); gl->BindTexture(GL_TEXTURE_2D, texture_); - image_id_ = gl->CreateGpuMemoryBufferImageCHROMIUM( - 1, 1, GL_RGBA, GL_SCANOUT_CHROMIUM); + image_id_ = gl->CreateGpuMemoryBufferImageCHROMIUM(1, 1, GL_RGBA, + GL_READ_WRITE_CHROMIUM); gl->BindTexImage2DCHROMIUM(GL_TEXTURE_2D, image_id_); gl->GenMailboxCHROMIUM(mailbox_.name); |