Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(346)

Unified Diff: gpu/ipc/service/gpu_memory_buffer_factory_ozone_native_pixmap.cc

Issue 2171713004: gpu: Keep original GMB alive to workaround problem with importing of UDL/EVDI buffers. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: use std::unordered_map Created 4 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « gpu/ipc/service/gpu_memory_buffer_factory_ozone_native_pixmap.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: gpu/ipc/service/gpu_memory_buffer_factory_ozone_native_pixmap.cc
diff --git a/gpu/ipc/service/gpu_memory_buffer_factory_ozone_native_pixmap.cc b/gpu/ipc/service/gpu_memory_buffer_factory_ozone_native_pixmap.cc
index e4de3983dc711f3cb9af0b60791645de06257727..4d233c6fbf688892c18f1206d8e64f4d099e4b6d 100644
--- a/gpu/ipc/service/gpu_memory_buffer_factory_ozone_native_pixmap.cc
+++ b/gpu/ipc/service/gpu_memory_buffer_factory_ozone_native_pixmap.cc
@@ -42,9 +42,26 @@ GpuMemoryBufferFactoryOzoneNativePixmap::CreateGpuMemoryBuffer(
new_handle.type = gfx::OZONE_NATIVE_PIXMAP;
new_handle.id = id;
new_handle.native_pixmap_handle = pixmap->ExportHandle();
+
+ // TODO(reveman): Remove this once crbug.com/628334 has been fixed.
+ {
+ base::AutoLock lock(native_pixmaps_lock_);
+ NativePixmapMapKey key(id.id, client_id);
+ DCHECK(native_pixmaps_.find(key) == native_pixmaps_.end());
+ native_pixmaps_[key] = pixmap;
+ }
+
return new_handle;
}
+void GpuMemoryBufferFactoryOzoneNativePixmap::DestroyGpuMemoryBuffer(
+ gfx::GpuMemoryBufferId id,
+ int client_id) {
+ base::AutoLock lock(native_pixmaps_lock_);
+ NativePixmapMapKey key(id.id, client_id);
+ native_pixmaps_.erase(key);
+}
+
ImageFactory* GpuMemoryBufferFactoryOzoneNativePixmap::AsImageFactory() {
return this;
}
« no previous file with comments | « gpu/ipc/service/gpu_memory_buffer_factory_ozone_native_pixmap.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698