Index: content/common/gpu/gpu_memory_buffer_factory.h |
diff --git a/content/common/gpu/gpu_memory_buffer_factory.h b/content/common/gpu/gpu_memory_buffer_factory.h |
new file mode 100644 |
index 0000000000000000000000000000000000000000..a750728475ee3a876b5b1aa7151b04a7616a1dbc |
--- /dev/null |
+++ b/content/common/gpu/gpu_memory_buffer_factory.h |
@@ -0,0 +1,49 @@ |
+// Copyright 2014 The Chromium Authors. All rights reserved. |
+// Use of this source code is governed by a BSD-style license that can be |
+// found in the LICENSE file. |
+ |
+#ifndef CONTENT_COMMON_GPU_GPU_MEMORY_BUFFER_FACTORY_H_ |
+#define CONTENT_COMMON_GPU_GPU_MEMORY_BUFFER_FACTORY_H_ |
+ |
+#include "base/memory/ref_counted.h" |
+#include "ui/gfx/geometry/size.h" |
+#include "ui/gfx/gpu_memory_buffer.h" |
+ |
+namespace gfx { |
+class GLImage; |
+} |
+ |
+namespace content { |
+ |
+class GpuMemoryBufferFactory { |
+ public: |
+ GpuMemoryBufferFactory() {} |
+ virtual ~GpuMemoryBufferFactory() {} |
+ |
+ // Creates a new platform specific factory instance. |
+ static scoped_ptr<GpuMemoryBufferFactory> Create(); |
+ |
+ // TODO: comment. |
+ virtual bool CreateGpuMemoryBuffer(const gfx::GpuMemoryBufferHandle& handle, |
+ const gfx::Size& size, |
+ unsigned internalformat, |
+ unsigned usage) = 0; |
+ |
+ // TODO: comment. |
+ virtual void DestroyGpuMemoryBuffer( |
+ const gfx::GpuMemoryBufferHandle& handle) = 0; |
+ |
+ // TODO: comment. |
+ virtual scoped_refptr<gfx::GLImage> CreateImageForGpuMemoryBuffer( |
+ const gfx::GpuMemoryBufferHandle& handle, |
+ const gfx::Size& size, |
+ unsigned internalformat, |
+ int client_id) = 0; |
+ |
+ private: |
+ DISALLOW_COPY_AND_ASSIGN(GpuMemoryBufferFactory); |
+}; |
+ |
+} // namespace content |
+ |
+#endif // CONTENT_COMMON_GPU_GPU_MEMORY_BUFFER_FACTORY_H_ |