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 <memory> |
9 #include <vector> | 9 #include <vector> |
10 | 10 |
11 #include "base/macros.h" | 11 #include "base/macros.h" |
12 #include "base/memory/ref_counted.h" | 12 #include "base/memory/ref_counted.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. Returns null |
| 27 // if native buffers are not supported. |
27 static std::unique_ptr<GpuMemoryBufferFactory> CreateNativeType(); | 28 static std::unique_ptr<GpuMemoryBufferFactory> CreateNativeType(); |
28 | 29 |
29 // Creates a new GPU memory buffer instance. A valid handle is returned on | 30 // Creates a new GPU memory buffer instance. A valid handle is returned on |
30 // success. It can be called on any thread. | 31 // success. It can be called on any thread. |
31 virtual gfx::GpuMemoryBufferHandle CreateGpuMemoryBuffer( | 32 virtual gfx::GpuMemoryBufferHandle CreateGpuMemoryBuffer( |
32 gfx::GpuMemoryBufferId id, | 33 gfx::GpuMemoryBufferId id, |
33 const gfx::Size& size, | 34 const gfx::Size& size, |
34 gfx::BufferFormat format, | 35 gfx::BufferFormat format, |
35 gfx::BufferUsage usage, | 36 gfx::BufferUsage usage, |
36 int client_id, | 37 int client_id, |
(...skipping 10 matching lines...) Expand all Loading... |
47 protected: | 48 protected: |
48 GpuMemoryBufferFactory() {} | 49 GpuMemoryBufferFactory() {} |
49 | 50 |
50 private: | 51 private: |
51 DISALLOW_COPY_AND_ASSIGN(GpuMemoryBufferFactory); | 52 DISALLOW_COPY_AND_ASSIGN(GpuMemoryBufferFactory); |
52 }; | 53 }; |
53 | 54 |
54 } // namespace gpu | 55 } // namespace gpu |
55 | 56 |
56 #endif // GPU_IPC_SERVICE_GPU_MEMORY_BUFFER_FACTORY_H_ | 57 #endif // GPU_IPC_SERVICE_GPU_MEMORY_BUFFER_FACTORY_H_ |
OLD | NEW |