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 51ff149976c75b71dda485ed30d42ae6305df825..7b42b11a15faeb86f8b36e205d5413bd6eea6e4b 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 |
@@ -72,6 +72,7 @@ class GLImageOzoneNativePixmapDmaBuf : public gfx::GLImageLinuxDMABuffer { |
gfx::OverlayTransform transform, |
const gfx::Rect& bounds_rect, |
const gfx::RectF& crop_rect) override { |
+ DCHECK_EQ(pixmap_->GetBufferUsage(), NativePixmap::SCANOUT); |
return SurfaceFactoryOzone::GetInstance()->ScheduleOverlayPlane( |
widget, z_order, transform, pixmap_, bounds_rect, crop_rect); |
} |
@@ -133,7 +134,8 @@ GpuMemoryBufferFactoryOzoneNativeBuffer:: |
~GpuMemoryBufferFactoryOzoneNativeBuffer() { |
} |
-bool GpuMemoryBufferFactoryOzoneNativeBuffer::CreateGpuMemoryBuffer( |
+gfx::GpuMemoryBufferHandle |
+GpuMemoryBufferFactoryOzoneNativeBuffer::CreateGpuMemoryBuffer( |
gfx::GpuMemoryBufferId id, |
const gfx::Size& size, |
gfx::GpuMemoryBuffer::Format format, |
@@ -147,11 +149,19 @@ bool GpuMemoryBufferFactoryOzoneNativeBuffer::CreateGpuMemoryBuffer( |
if (!pixmap.get()) { |
LOG(ERROR) << "Failed to create pixmap " << size.width() << "x" |
<< size.height() << " format " << format << ", usage " << usage; |
- return false; |
+ return gfx::GpuMemoryBufferHandle(); |
} |
+ |
+ gfx::GpuMemoryBufferHandle handle = |
+ SurfaceFactoryOzone::GetInstance()->ExportGpuMemoryBufferHandle( |
vignatti (out of this project)
2015/05/14 19:20:04
Am I wrong or the concept here is the opposite? GP
dshwang
2015/06/25 10:59:56
GPU process create gbm bo and *exporting* the dma_
|
+ surface_handle, pixmap); |
+ if (handle.type == gfx::EMPTY_BUFFER) |
+ return gfx::GpuMemoryBufferHandle(); |
+ handle.id = id; |
+ |
base::AutoLock lock(native_pixmap_map_lock_); |
native_pixmap_map_[GetIndex(id, client_id)] = pixmap; |
- return true; |
+ return handle; |
} |
void GpuMemoryBufferFactoryOzoneNativeBuffer::DestroyGpuMemoryBuffer( |