| Index: ui/ozone/gpu/gpu_memory_buffer_factory_ozone_native_buffer.cc
|
| diff --git a/ui/ozone/gpu/gpu_memory_buffer_factory_ozone_native_buffer.cc b/ui/ozone/gpu/gpu_memory_buffer_factory_ozone_native_buffer.cc
|
| index 4dfdba36cdbbdc2e95b2da85a6eb566e265d6374..6f33d39ab7f730b7c4711265a4dbdeed256389aa 100644
|
| --- a/ui/ozone/gpu/gpu_memory_buffer_factory_ozone_native_buffer.cc
|
| +++ b/ui/ozone/gpu/gpu_memory_buffer_factory_ozone_native_buffer.cc
|
| @@ -89,6 +89,19 @@ SurfaceFactoryOzone::BufferFormat GetOzoneFormatFor(
|
| return SurfaceFactoryOzone::RGBA_8888;
|
| }
|
|
|
| +SurfaceFactoryOzone::BufferUsage GetOzoneUsageFor(
|
| + gfx::GpuMemoryBuffer::Usage usage) {
|
| + switch (usage) {
|
| + case gfx::GpuMemoryBuffer::MAP:
|
| + return SurfaceFactoryOzone::MAP;
|
| + case gfx::GpuMemoryBuffer::SCANOUT:
|
| + return SurfaceFactoryOzone::SCANOUT;
|
| + }
|
| +
|
| + NOTREACHED();
|
| + return SurfaceFactoryOzone::MAP;
|
| +}
|
| +
|
| std::pair<uint32_t, uint32_t> GetIndex(gfx::GpuMemoryBufferId id,
|
| int client_id) {
|
| return std::pair<uint32_t, uint32_t>(id, client_id);
|
| @@ -111,7 +124,7 @@ bool GpuMemoryBufferFactoryOzoneNativeBuffer::CreateGpuMemoryBuffer(
|
| int client_id) {
|
| scoped_refptr<NativePixmap> pixmap =
|
| SurfaceFactoryOzone::GetInstance()->CreateNativePixmap(
|
| - size, GetOzoneFormatFor(format));
|
| + size, GetOzoneFormatFor(format), GetOzoneUsageFor(usage));
|
| if (!pixmap.get()) {
|
| LOG(ERROR) << "Failed to create pixmap " << size.width() << "x"
|
| << size.height() << " format " << format << ", usage " << usage;
|
|
|