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

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

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 | « no previous file | gpu/ipc/service/gpu_memory_buffer_factory_ozone_native_pixmap.cc » ('j') | 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.h
diff --git a/gpu/ipc/service/gpu_memory_buffer_factory_ozone_native_pixmap.h b/gpu/ipc/service/gpu_memory_buffer_factory_ozone_native_pixmap.h
index b981a9676ca3730d8f61c4dbe88daaff93ba191d..5a132bbdaeb4ac839d8eca08362c430a067e11f8 100644
--- a/gpu/ipc/service/gpu_memory_buffer_factory_ozone_native_pixmap.h
+++ b/gpu/ipc/service/gpu_memory_buffer_factory_ozone_native_pixmap.h
@@ -5,6 +5,10 @@
#ifndef GPU_IPC_SERVICE_GPU_MEMORY_BUFFER_FACTORY_OZONE_NATIVE_PIXMAP_H_
#define GPU_IPC_SERVICE_GPU_MEMORY_BUFFER_FACTORY_OZONE_NATIVE_PIXMAP_H_
+#include <unordered_map>
+#include <utility>
+
+#include "base/hash.h"
#include "base/macros.h"
#include "base/synchronization/lock.h"
#include "gpu/command_buffer/service/image_factory.h"
@@ -34,7 +38,7 @@ class GPU_EXPORT GpuMemoryBufferFactoryOzoneNativePixmap
int client_id,
SurfaceHandle surface_handle) override;
void DestroyGpuMemoryBuffer(gfx::GpuMemoryBufferId id,
- int client_id) override {}
+ int client_id) override;
ImageFactory* AsImageFactory() override;
// Overridden from ImageFactory:
@@ -47,6 +51,15 @@ class GPU_EXPORT GpuMemoryBufferFactoryOzoneNativePixmap
SurfaceHandle surface_handle) override;
private:
+ using NativePixmapMapKey = std::pair<int, int>;
+ using NativePixmapMapKeyHash = base::IntPairHash<NativePixmapMapKey>;
+ using NativePixmapMap =
+ std::unordered_map<NativePixmapMapKey,
+ scoped_refptr<ui::NativePixmap>,
+ NativePixmapMapKeyHash>;
+ NativePixmapMap native_pixmaps_;
+ base::Lock native_pixmaps_lock_;
+
DISALLOW_COPY_AND_ASSIGN(GpuMemoryBufferFactoryOzoneNativePixmap);
};
« no previous file with comments | « no previous file | gpu/ipc/service/gpu_memory_buffer_factory_ozone_native_pixmap.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698