Commit b6486594 authored by Daniele Castagna's avatar Daniele Castagna Committed by Commit Bot

Use SCANOUT_* usage in GpuMemoryBufferVideoFramePool

Currently GpuMemoryBufferVideoFramePool allocates buffers with
GPU_READ_CPU_READ_WRITE usage. This means these buffers won't be used for
scanout (no fb added on CrOS).

This CL simply changes the usage used when allocating buffers to
SCANOUT_CPU_READ_WRITE, in this way this buffers will be created for
scanout, if possible.

Note that SCANOUT implies GPU_READ, meaning that in case the allocation
of the buffer for scanout will fail, the buffers will be allocated
exactly as they'd be if GPU_READ_CPU_READ_WRITE were used instead.

Bug: b/71837407
Change-Id: I3a03daf721f1cc04038a4f6f91985b5affe2a276
Reviewed-on: https://chromium-review.googlesource.com/884401
Commit-Queue: Daniele Castagna <dcastagna@chromium.org>
Reviewed-by: default avatarMiguel Casas <mcasas@chromium.org>
Reviewed-by: default avatarDale Curtis <dalecurtis@chromium.org>
Cr-Commit-Position: refs/heads/master@{#532286}
parent 26058f9e
......@@ -908,7 +908,7 @@ GpuMemoryBufferVideoFramePool::PoolImpl::GetOrCreateFrameResources(
const gfx::BufferFormat buffer_format = GpuMemoryBufferFormat(format, i);
plane_resource.gpu_memory_buffer = gpu_factories_->CreateGpuMemoryBuffer(
plane_resource.size, buffer_format,
gfx::BufferUsage::GPU_READ_CPU_READ_WRITE);
gfx::BufferUsage::SCANOUT_CPU_READ_WRITE);
unsigned texture_target = gpu_factories_->ImageTextureTarget(buffer_format);
gles2->GenTextures(1, &plane_resource.texture_id);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment