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

Unified Diff: ui/ozone/gpu/gpu_memory_buffer_factory_ozone_native_buffer.h

Issue 1050923003: zero-copy: Clarify to allocate/destroy GpuMemoryBuffer on any thread and use it on the main thread o (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: just add thread check Created 5 years, 8 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
Index: ui/ozone/gpu/gpu_memory_buffer_factory_ozone_native_buffer.h
diff --git a/ui/ozone/gpu/gpu_memory_buffer_factory_ozone_native_buffer.h b/ui/ozone/gpu/gpu_memory_buffer_factory_ozone_native_buffer.h
index 006a4a5497ac72a7242ce4506e0ceee8de39bd3b..f449bbb82af61a48d569bf86ed9454278709d861 100644
--- a/ui/ozone/gpu/gpu_memory_buffer_factory_ozone_native_buffer.h
+++ b/ui/ozone/gpu/gpu_memory_buffer_factory_ozone_native_buffer.h
@@ -9,6 +9,7 @@
#include "base/memory/ref_counted.h"
#include "base/synchronization/lock.h"
+#include "base/threading/thread_checker.h"
#include "ui/gfx/geometry/size.h"
#include "ui/gfx/gpu_memory_buffer.h"
#include "ui/gfx/native_widget_types.h"
@@ -31,6 +32,7 @@ class OZONE_GPU_EXPORT GpuMemoryBufferFactoryOzoneNativeBuffer {
virtual ~GpuMemoryBufferFactoryOzoneNativeBuffer();
// Creates a GPU memory buffer identified by |id|.
+ // It can be called on any thread.
bool CreateGpuMemoryBuffer(gfx::GpuMemoryBufferId id,
const gfx::Size& size,
gfx::GpuMemoryBuffer::Format format,
@@ -39,6 +41,7 @@ class OZONE_GPU_EXPORT GpuMemoryBufferFactoryOzoneNativeBuffer {
gfx::PluginWindowHandle surface_handle);
// Destroys GPU memory buffer identified by |id|.
+ // It can be called on any thread.
void DestroyGpuMemoryBuffer(gfx::GpuMemoryBufferId id, int client_id);
// Creates a GLImage instance for GPU memory buffer identified by |id|.
@@ -58,6 +61,7 @@ class OZONE_GPU_EXPORT GpuMemoryBufferFactoryOzoneNativeBuffer {
private:
BufferToPixmapMap native_pixmap_map_;
base::Lock native_pixmap_map_lock_;
+ base::ThreadChecker thread_checker_;
};
} // namespace ui

Powered by Google App Engine
This is Rietveld 408576698