Index: cc/resources/resource_provider.h |
diff --git a/cc/resources/resource_provider.h b/cc/resources/resource_provider.h |
index d5b57127c205db172299d6cc7048e747779e56a8..74e87f38c1eeb526e041f6c50315449753a59f7f 100644 |
--- a/cc/resources/resource_provider.h |
+++ b/cc/resources/resource_provider.h |
@@ -331,6 +331,54 @@ class CC_EXPORT ResourceProvider { |
DISALLOW_COPY_AND_ASSIGN(ScopedWriteLockGpuMemoryBuffer); |
}; |
+ class CC_EXPORT ScopedWriteLockGpuMemoryBufferForThread { |
+ public: |
+ ScopedWriteLockGpuMemoryBufferForThread(ResourceProvider* resource_provider, |
+ ResourceId resource_id); |
+ ~ScopedWriteLockGpuMemoryBufferForThread(); |
+ |
+ gfx::GpuMemoryBuffer* GetGpuMemoryBuffer(); |
+ ContextProvider* worker_context() { return worker_context_; } |
+ ResourceFormat format() { return format_; } |
+ gfx::Size size() { return size_; } |
+ |
+ unsigned bound_image_id() { return bound_image_id_; } |
+ void set_bound_image_id(unsigned id) { bound_image_id_ = id; } |
+ unsigned image_id() { return image_id_; } |
+ void set_image_id(unsigned id) { image_id_ = id; } |
+ unsigned dirty_image() { return dirty_image_; } |
+ void set_dirty_image(unsigned id) { dirty_image_ = id; } |
+ bool allocated() { return allocated_; } |
+ void set_allocated(bool status) { allocated_ = status; } |
+ bool read_lock_fences_enabled() { return read_lock_fences_enabled_; } |
+ void set_read_lock_fences_enabled(bool status) { |
+ read_lock_fences_enabled_ = status; |
+ } |
+ GLenum internal_format() { return internal_format_; } |
+ unsigned source_gl_id() { return source_gl_id_; } |
+ unsigned dest_gl_id() { return dest_gl_id_; } |
+ |
+ private: |
+ ResourceProvider* resource_provider_; |
+ ResourceProvider::Resource* resource_; |
+ gpu::GpuMemoryBufferManager* gpu_memory_buffer_manager_; |
+ gfx::GpuMemoryBuffer* gpu_memory_buffer_; |
+ base::ThreadChecker thread_checker_; |
+ ContextProvider* worker_context_; |
+ unsigned image_id_; |
+ unsigned bound_image_id_; |
+ bool allocated_; |
+ bool dirty_image_; |
+ bool read_lock_fences_enabled_; |
+ unsigned source_gl_id_; |
+ unsigned dest_gl_id_; |
piman
2015/07/01 22:11:05
These 2 fields are not initialized. For that matte
sohanjg
2015/07/02 14:40:28
Done.
|
+ gfx::Size size_; |
+ ResourceFormat format_; |
+ GLenum internal_format_; |
+ |
+ DISALLOW_COPY_AND_ASSIGN(ScopedWriteLockGpuMemoryBufferForThread); |
+ }; |
+ |
class CC_EXPORT ScopedWriteLockGr { |
public: |
ScopedWriteLockGr(ResourceProvider* resource_provider, |