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..5e01a7071809aa42fe4e71fbca526056cb2351b3 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,19 @@ 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; |
+ handle.native_pixmap_handle = pixmap->ExportHandle(); |
+ |
+ { |
+ base::AutoLock lock(native_pixmaps_lock_); |
+ NativePixmapMapKey key(id, client_id); |
+ DCHECK(native_pixmaps_.find(key) == native_pixmaps_.end()); |
+ native_pixmaps_[key] = pixmap; |
+ } |
+ |
return handle; |
} |
@@ -87,7 +92,7 @@ void GpuMemoryBufferFactoryOzoneNativePixmap::DestroyGpuMemoryBuffer( |
int client_id) { |
base::AutoLock lock(native_pixmaps_lock_); |
auto it = native_pixmaps_.find(NativePixmapMapKey(id, client_id)); |
- DCHECK(it != native_pixmaps_.end()) << "pixmap with this key must exist"; |
+ DCHECK(it != native_pixmaps_.end()); |
native_pixmaps_.erase(it); |
} |