Upstream version 10.39.225.0
[platform/framework/web/crosswalk.git] / src / content / common / gpu / client / gpu_memory_buffer_impl_surface_texture.h
index cfce0ff..c8e43be 100644 (file)
@@ -14,17 +14,17 @@ namespace content {
 // Implementation of GPU memory buffer based on SurfaceTextures.
 class GpuMemoryBufferImplSurfaceTexture : public GpuMemoryBufferImpl {
  public:
-  GpuMemoryBufferImplSurfaceTexture(const gfx::Size& size,
-                                    unsigned internalformat);
-  virtual ~GpuMemoryBufferImplSurfaceTexture();
+  static scoped_ptr<GpuMemoryBufferImpl> CreateFromHandle(
+      const gfx::GpuMemoryBufferHandle& handle,
+      const gfx::Size& size,
+      unsigned internalformat,
+      const DestructionCallback& callback);
 
   static bool IsFormatSupported(unsigned internalformat);
   static bool IsUsageSupported(unsigned usage);
   static bool IsConfigurationSupported(unsigned internalformat, unsigned usage);
   static int WindowFormat(unsigned internalformat);
 
-  bool InitializeFromHandle(const gfx::GpuMemoryBufferHandle& handle);
-
   // Overridden from gfx::GpuMemoryBuffer:
   virtual void* Map() OVERRIDE;
   virtual void Unmap() OVERRIDE;
@@ -32,6 +32,14 @@ class GpuMemoryBufferImplSurfaceTexture : public GpuMemoryBufferImpl {
   virtual uint32 GetStride() const OVERRIDE;
 
  private:
+  GpuMemoryBufferImplSurfaceTexture(
+      const gfx::Size& size,
+      unsigned internalformat,
+      const DestructionCallback& callback,
+      const gfx::SurfaceTextureId& surface_texture_id,
+      ANativeWindow* native_window);
+  virtual ~GpuMemoryBufferImplSurfaceTexture();
+
   gfx::SurfaceTextureId surface_texture_id_;
   ANativeWindow* native_window_;
   size_t stride_;