Chromium Code Reviews| Index: content/common/gpu/gpu_memory_buffer_factory_ozone_native_pixmap.cc |
| diff --git a/content/common/gpu/gpu_memory_buffer_factory_ozone_native_pixmap.cc b/content/common/gpu/gpu_memory_buffer_factory_ozone_native_pixmap.cc |
| index d3e0576124a9be60c8f6e67f2dddfbc0ca0f63d8..d54ee2180cdef90ada8a406309ddc3e9d90ec038 100644 |
| --- a/content/common/gpu/gpu_memory_buffer_factory_ozone_native_pixmap.cc |
| +++ b/content/common/gpu/gpu_memory_buffer_factory_ozone_native_pixmap.cc |
| @@ -5,6 +5,7 @@ |
| #include "content/common/gpu/gpu_memory_buffer_factory_ozone_native_pixmap.h" |
| #include "ui/gl/gl_image_ozone_native_pixmap.h" |
| +#include "ui/ozone/public/client_native_pixmap.h" |
| #include "ui/ozone/public/client_native_pixmap_factory.h" |
| #include "ui/ozone/public/ozone_platform.h" |
| #include "ui/ozone/public/surface_factory_ozone.h" |
| @@ -70,15 +71,23 @@ GpuMemoryBufferFactoryOzoneNativePixmap::CreateGpuMemoryBuffer( |
| << ", usage " << static_cast<int>(usage); |
| return gfx::GpuMemoryBufferHandle(); |
| } |
| - base::AutoLock lock(native_pixmaps_lock_); |
| - NativePixmapMapKey key(id, client_id); |
| - DCHECK(native_pixmaps_.find(key) == native_pixmaps_.end()) |
| - << "pixmap with this key must not exist"; |
| - native_pixmaps_[key] = pixmap; |
| gfx::GpuMemoryBufferHandle handle; |
| handle.type = gfx::OZONE_NATIVE_PIXMAP; |
| handle.id = id; |
| + |
| + if (usage == gfx::BufferUsage::MAP && |
|
reveman
2015/08/05 04:18:00
Can you remove the MAP check from here and not fai
spang
2015/08/05 13:26:15
Done.. now it imports scanout as well.
It is not
|
| + !pixmap->ExportHandle(&handle.native_pixmap_handle)) |
| + return gfx::GpuMemoryBufferHandle(); |
| + |
| + { |
| + base::AutoLock lock(native_pixmaps_lock_); |
| + NativePixmapMapKey key(id, client_id); |
| + DCHECK(native_pixmaps_.find(key) == native_pixmaps_.end()) |
| + << "pixmap with this key must not exist"; |
| + native_pixmaps_[key] = pixmap; |
| + } |
| + |
| return handle; |
| } |