| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 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 | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #ifndef GPU_IPC_SERVICE_GPU_MEMORY_BUFFER_FACTORY_H_ | 5 #ifndef GPU_IPC_SERVICE_GPU_MEMORY_BUFFER_FACTORY_H_ |
| 6 #define GPU_IPC_SERVICE_GPU_MEMORY_BUFFER_FACTORY_H_ | 6 #define GPU_IPC_SERVICE_GPU_MEMORY_BUFFER_FACTORY_H_ |
| 7 | 7 |
| 8 #include <memory> |
| 8 #include <vector> | 9 #include <vector> |
| 9 | 10 |
| 10 #include "base/macros.h" | 11 #include "base/macros.h" |
| 11 #include "base/memory/ref_counted.h" | 12 #include "base/memory/ref_counted.h" |
| 12 #include "base/memory/scoped_ptr.h" | |
| 13 #include "gpu/gpu_export.h" | 13 #include "gpu/gpu_export.h" |
| 14 #include "gpu/ipc/common/surface_handle.h" | 14 #include "gpu/ipc/common/surface_handle.h" |
| 15 #include "ui/gfx/geometry/size.h" | 15 #include "ui/gfx/geometry/size.h" |
| 16 #include "ui/gfx/gpu_memory_buffer.h" | 16 #include "ui/gfx/gpu_memory_buffer.h" |
| 17 | 17 |
| 18 namespace gpu { | 18 namespace gpu { |
| 19 | 19 |
| 20 class ImageFactory; | 20 class ImageFactory; |
| 21 | 21 |
| 22 class GPU_EXPORT GpuMemoryBufferFactory { | 22 class GPU_EXPORT GpuMemoryBufferFactory { |
| 23 public: | 23 public: |
| 24 virtual ~GpuMemoryBufferFactory() {} | 24 virtual ~GpuMemoryBufferFactory() {} |
| 25 | 25 |
| 26 // Creates a new factory instance for native GPU memory buffers. | 26 // Creates a new factory instance for native GPU memory buffers. |
| 27 static scoped_ptr<GpuMemoryBufferFactory> CreateNativeType(); | 27 static std::unique_ptr<GpuMemoryBufferFactory> CreateNativeType(); |
| 28 | 28 |
| 29 // Creates a new GPU memory buffer instance. A valid handle is returned on | 29 // Creates a new GPU memory buffer instance. A valid handle is returned on |
| 30 // success. It can be called on any thread. | 30 // success. It can be called on any thread. |
| 31 virtual gfx::GpuMemoryBufferHandle CreateGpuMemoryBuffer( | 31 virtual gfx::GpuMemoryBufferHandle CreateGpuMemoryBuffer( |
| 32 gfx::GpuMemoryBufferId id, | 32 gfx::GpuMemoryBufferId id, |
| 33 const gfx::Size& size, | 33 const gfx::Size& size, |
| 34 gfx::BufferFormat format, | 34 gfx::BufferFormat format, |
| 35 gfx::BufferUsage usage, | 35 gfx::BufferUsage usage, |
| 36 int client_id, | 36 int client_id, |
| 37 SurfaceHandle surface_handle) = 0; | 37 SurfaceHandle surface_handle) = 0; |
| (...skipping 18 matching lines...) Expand all Loading... |
| 56 protected: | 56 protected: |
| 57 GpuMemoryBufferFactory() {} | 57 GpuMemoryBufferFactory() {} |
| 58 | 58 |
| 59 private: | 59 private: |
| 60 DISALLOW_COPY_AND_ASSIGN(GpuMemoryBufferFactory); | 60 DISALLOW_COPY_AND_ASSIGN(GpuMemoryBufferFactory); |
| 61 }; | 61 }; |
| 62 | 62 |
| 63 } // namespace gpu | 63 } // namespace gpu |
| 64 | 64 |
| 65 #endif // GPU_IPC_SERVICE_GPU_MEMORY_BUFFER_FACTORY_H_ | 65 #endif // GPU_IPC_SERVICE_GPU_MEMORY_BUFFER_FACTORY_H_ |
| OLD | NEW |