OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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_COMMAND_BUFFER_COMMON_GPU_CONTROL_H_ | 5 #ifndef GPU_COMMAND_BUFFER_COMMON_GPU_CONTROL_H_ |
6 #define GPU_COMMAND_BUFFER_COMMON_GPU_CONTROL_H_ | 6 #define GPU_COMMAND_BUFFER_COMMON_GPU_CONTROL_H_ |
7 | 7 |
8 #include <vector> | 8 #include <vector> |
9 | 9 |
10 #include "base/callback.h" | 10 #include "base/callback.h" |
11 #include "gpu/command_buffer/common/capabilities.h" | 11 #include "gpu/command_buffer/common/capabilities.h" |
12 #include "gpu/command_buffer/common/mailbox.h" | 12 #include "gpu/command_buffer/common/mailbox.h" |
13 #include "gpu/command_buffer/common/types.h" | 13 #include "gpu/command_buffer/common/types.h" |
14 #include "gpu/gpu_export.h" | 14 #include "gpu/gpu_export.h" |
15 | 15 #include "ui/gfx/gpu_memory_buffer.h" |
16 namespace gfx { | |
17 class GpuMemoryBuffer; | |
18 } | |
19 | 16 |
20 namespace gpu { | 17 namespace gpu { |
21 struct ManagedMemoryStats; | 18 struct ManagedMemoryStats; |
22 | 19 |
23 // Common interface for GpuControl implementations. | 20 // Common interface for GpuControl implementations. |
24 class GPU_EXPORT GpuControl { | 21 class GPU_EXPORT GpuControl { |
25 public: | 22 public: |
26 GpuControl() {} | 23 GpuControl() {} |
27 virtual ~GpuControl() {} | 24 virtual ~GpuControl() {} |
28 | 25 |
29 virtual Capabilities GetCapabilities() = 0; | 26 virtual Capabilities GetCapabilities() = 0; |
30 | 27 |
31 // Create a gpu memory buffer of the given dimensions and format. Returns | 28 // Create a gpu memory buffer of the given dimensions and format. Returns |
32 // its ID or -1 on error. | 29 // its ID or -1 on error. |
33 virtual gfx::GpuMemoryBuffer* CreateGpuMemoryBuffer( | 30 virtual gfx::GpuMemoryBuffer* CreateGpuMemoryBuffer( |
34 size_t width, | 31 size_t width, |
35 size_t height, | 32 size_t height, |
36 unsigned internalformat, | 33 unsigned internalformat, |
| 34 gfx::GpuMemoryBuffer::Usage usage, |
37 int32* id) = 0; | 35 int32* id) = 0; |
38 | 36 |
39 // Destroy a gpu memory buffer. The ID must be positive. | 37 // Destroy a gpu memory buffer. The ID must be positive. |
40 virtual void DestroyGpuMemoryBuffer(int32 id) = 0; | 38 virtual void DestroyGpuMemoryBuffer(int32 id) = 0; |
41 | 39 |
42 // Inserts a sync point, returning its ID. Sync point IDs are global and can | 40 // Inserts a sync point, returning its ID. Sync point IDs are global and can |
43 // be used for cross-context synchronization. | 41 // be used for cross-context synchronization. |
44 virtual uint32 InsertSyncPoint() = 0; | 42 virtual uint32 InsertSyncPoint() = 0; |
45 | 43 |
46 // Runs |callback| when a sync point is reached. | 44 // Runs |callback| when a sync point is reached. |
(...skipping 15 matching lines...) Expand all Loading... |
62 // returns a stream identifier. | 60 // returns a stream identifier. |
63 virtual uint32 CreateStreamTexture(uint32 texture_id) = 0; | 61 virtual uint32 CreateStreamTexture(uint32 texture_id) = 0; |
64 | 62 |
65 private: | 63 private: |
66 DISALLOW_COPY_AND_ASSIGN(GpuControl); | 64 DISALLOW_COPY_AND_ASSIGN(GpuControl); |
67 }; | 65 }; |
68 | 66 |
69 } // namespace gpu | 67 } // namespace gpu |
70 | 68 |
71 #endif // GPU_COMMAND_BUFFER_COMMON_GPU_CONTROL_H_ | 69 #endif // GPU_COMMAND_BUFFER_COMMON_GPU_CONTROL_H_ |
OLD | NEW |