Update To 11.40.268.0
[platform/framework/web/crosswalk.git] / src / content / common / gpu / gpu_memory_buffer_factory.h
index 1107c9c..5dd2203 100644 (file)
@@ -14,6 +14,10 @@ namespace gfx {
 class GLImage;
 }
 
+namespace gpu {
+class ImageFactory;
+}
+
 namespace content {
 
 class GpuMemoryBufferFactory {
@@ -24,28 +28,24 @@ class GpuMemoryBufferFactory {
   // Creates a new platform specific factory instance.
   static scoped_ptr<GpuMemoryBufferFactory> Create();
 
-  // Creates a GPU memory buffer instance from |handle|. Whether the storage for
-  // the buffer is passed with the handle or allocated as part of buffer
-  // creation depends on the type. A valid handle is returned on success.
+  // Creates a GPU memory buffer instance of |type|. A valid handle is
+  // returned on success.
   virtual gfx::GpuMemoryBufferHandle CreateGpuMemoryBuffer(
-      const gfx::GpuMemoryBufferHandle& handle,
-      const gfx::Size& size,
-      unsigned internalformat,
-      unsigned usage) = 0;
-
-  // Destroys GPU memory buffer identified by |handle|.
-  virtual void DestroyGpuMemoryBuffer(
-      const gfx::GpuMemoryBufferHandle& handle) = 0;
-
-  // Creates a GLImage instance for GPU memory buffer identified by |handle|.
-  // |client_id| should be set to the client requesting the creation of instance
-  // and can be used by factory implementation to verify access rights.
-  virtual scoped_refptr<gfx::GLImage> CreateImageForGpuMemoryBuffer(
-      const gfx::GpuMemoryBufferHandle& handle,
+      gfx::GpuMemoryBufferType type,
+      gfx::GpuMemoryBufferId id,
       const gfx::Size& size,
-      unsigned internalformat,
+      gfx::GpuMemoryBuffer::Format format,
+      gfx::GpuMemoryBuffer::Usage usage,
       int client_id) = 0;
 
+  // Destroys GPU memory buffer identified by |id|.
+  virtual void DestroyGpuMemoryBuffer(gfx::GpuMemoryBufferType type,
+                                      gfx::GpuMemoryBufferId id,
+                                      int client_id) = 0;
+
+  // Type-checking downcast routine.
+  virtual gpu::ImageFactory* AsImageFactory() = 0;
+
  private:
   DISALLOW_COPY_AND_ASSIGN(GpuMemoryBufferFactory);
 };