Chromium Code Reviews| 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 "base/callback.h" | |
| 8 #include "gpu/command_buffer/common/types.h" | 9 #include "gpu/command_buffer/common/types.h" |
| 9 #include "gpu/gpu_export.h" | 10 #include "gpu/gpu_export.h" |
| 10 | 11 |
| 11 namespace gfx { | 12 namespace gfx { |
| 12 class GpuMemoryBuffer; | 13 class GpuMemoryBuffer; |
| 13 } | 14 } |
| 14 | 15 |
| 15 namespace gpu { | 16 namespace gpu { |
| 16 | 17 |
| 17 // Common interface for GpuControl implementations. | 18 // Common interface for GpuControl implementations. |
| 18 class GPU_EXPORT GpuControl { | 19 class GPU_EXPORT GpuControl { |
| 19 public: | 20 public: |
| 20 GpuControl() {} | 21 GpuControl() {} |
| 21 virtual ~GpuControl() {} | 22 virtual ~GpuControl() {} |
| 22 | 23 |
| 23 virtual bool SupportsGpuMemoryBuffer() = 0; | 24 virtual bool SupportsGpuMemoryBuffer() = 0; |
| 24 | 25 |
| 25 // Create a gpu memory buffer of the given dimensions and format. Returns | 26 // Create a gpu memory buffer of the given dimensions and format. Returns |
| 26 // its ID or -1 on error. | 27 // its ID or -1 on error. |
| 27 virtual gfx::GpuMemoryBuffer* CreateGpuMemoryBuffer( | 28 virtual gfx::GpuMemoryBuffer* CreateGpuMemoryBuffer( |
| 28 size_t width, | 29 size_t width, |
| 29 size_t height, | 30 size_t height, |
| 30 unsigned internalformat, | 31 unsigned internalformat, |
| 31 int32* id) = 0; | 32 int32* id) = 0; |
| 32 | 33 |
| 33 // Destroy a gpu memory buffer. The ID must be positive. | 34 // Destroy a gpu memory buffer. The ID must be positive. |
| 34 virtual void DestroyGpuMemoryBuffer(int32 id) = 0; | 35 virtual void DestroyGpuMemoryBuffer(int32 id) = 0; |
| 35 | 36 |
| 37 // Inserts a sync point, returning its ID. Sync point IDs are global and can | |
| 38 // be used for cross-context synchronization. | |
| 39 virtual uint32 InsertSyncPoint() = 0; | |
| 40 | |
| 41 // Runs |callback| when a sync point is reached or the context is destroyed. | |
|
no sievers
2013/09/27 18:13:04
Does it really currently really run it when the co
| |
| 42 virtual void SignalSyncPoint(uint32 sync_point, | |
| 43 const base::Closure& callback) = 0; | |
| 44 | |
| 36 private: | 45 private: |
| 37 DISALLOW_COPY_AND_ASSIGN(GpuControl); | 46 DISALLOW_COPY_AND_ASSIGN(GpuControl); |
| 38 }; | 47 }; |
| 39 | 48 |
| 40 } // namespace gpu | 49 } // namespace gpu |
| 41 | 50 |
| 42 #endif // GPU_COMMAND_BUFFER_COMMON_GPU_CONTROL_H_ | 51 #endif // GPU_COMMAND_BUFFER_COMMON_GPU_CONTROL_H_ |
| OLD | NEW |