| OLD | NEW | 
|---|
|  | (Empty) | 
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. |  | 
| 2 // Use of this source code is governed by a BSD-style license that can be |  | 
| 3 // found in the LICENSE file. |  | 
| 4 |  | 
| 5 #ifndef CONTENT_COMMON_GPU_GPU_MEMORY_BUFFER_FACTORY_H_ |  | 
| 6 #define CONTENT_COMMON_GPU_GPU_MEMORY_BUFFER_FACTORY_H_ |  | 
| 7 |  | 
| 8 #include <vector> |  | 
| 9 |  | 
| 10 #include "base/macros.h" |  | 
| 11 #include "base/memory/ref_counted.h" |  | 
| 12 #include "base/memory/scoped_ptr.h" |  | 
| 13 #include "content/common/content_export.h" |  | 
| 14 #include "gpu/ipc/common/surface_handle.h" |  | 
| 15 #include "ui/gfx/geometry/size.h" |  | 
| 16 #include "ui/gfx/gpu_memory_buffer.h" |  | 
| 17 |  | 
| 18 namespace gpu { |  | 
| 19 class ImageFactory; |  | 
| 20 } |  | 
| 21 |  | 
| 22 namespace content { |  | 
| 23 |  | 
| 24 class CONTENT_EXPORT GpuMemoryBufferFactory { |  | 
| 25  public: |  | 
| 26   virtual ~GpuMemoryBufferFactory() {} |  | 
| 27 |  | 
| 28   // Creates a new factory instance for native GPU memory buffers. |  | 
| 29   static scoped_ptr<GpuMemoryBufferFactory> CreateNativeType(); |  | 
| 30 |  | 
| 31   // Creates a new GPU memory buffer instance. A valid handle is returned on |  | 
| 32   // success. It can be called on any thread. |  | 
| 33   virtual gfx::GpuMemoryBufferHandle CreateGpuMemoryBuffer( |  | 
| 34       gfx::GpuMemoryBufferId id, |  | 
| 35       const gfx::Size& size, |  | 
| 36       gfx::BufferFormat format, |  | 
| 37       gfx::BufferUsage usage, |  | 
| 38       int client_id, |  | 
| 39       gpu::SurfaceHandle surface_handle) = 0; |  | 
| 40 |  | 
| 41   // Creates a new GPU memory buffer instance from an existing handle. A valid |  | 
| 42   // handle is returned on success. It can be called on any thread. |  | 
| 43   virtual gfx::GpuMemoryBufferHandle CreateGpuMemoryBufferFromHandle( |  | 
| 44       const gfx::GpuMemoryBufferHandle& handle, |  | 
| 45       gfx::GpuMemoryBufferId id, |  | 
| 46       const gfx::Size& size, |  | 
| 47       gfx::BufferFormat format, |  | 
| 48       int client_id) = 0; |  | 
| 49 |  | 
| 50   // Destroys GPU memory buffer identified by |id|. |  | 
| 51   // It can be called on any thread. |  | 
| 52   virtual void DestroyGpuMemoryBuffer(gfx::GpuMemoryBufferId id, |  | 
| 53                                       int client_id) = 0; |  | 
| 54 |  | 
| 55   // Type-checking downcast routine. |  | 
| 56   virtual gpu::ImageFactory* AsImageFactory() = 0; |  | 
| 57 |  | 
| 58  protected: |  | 
| 59   GpuMemoryBufferFactory() {} |  | 
| 60 |  | 
| 61  private: |  | 
| 62   DISALLOW_COPY_AND_ASSIGN(GpuMemoryBufferFactory); |  | 
| 63 }; |  | 
| 64 |  | 
| 65 }  // namespace content |  | 
| 66 |  | 
| 67 #endif  // CONTENT_COMMON_GPU_GPU_MEMORY_BUFFER_FACTORY_H_ |  | 
| OLD | NEW | 
|---|