| 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" |
| (...skipping 12 matching lines...) Expand all Loading... |
| 23 // Common interface for GpuControl implementations. | 23 // Common interface for GpuControl implementations. |
| 24 class GPU_EXPORT GpuControl { | 24 class GPU_EXPORT GpuControl { |
| 25 public: | 25 public: |
| 26 GpuControl() {} | 26 GpuControl() {} |
| 27 virtual ~GpuControl() {} | 27 virtual ~GpuControl() {} |
| 28 | 28 |
| 29 virtual Capabilities GetCapabilities() = 0; | 29 virtual Capabilities GetCapabilities() = 0; |
| 30 | 30 |
| 31 // Create a gpu memory buffer of the given dimensions and format. Returns | 31 // Create a gpu memory buffer of the given dimensions and format. Returns |
| 32 // its ID or -1 on error. | 32 // its ID or -1 on error. |
| 33 virtual gfx::GpuMemoryBuffer* CreateGpuMemoryBuffer( | 33 virtual gfx::GpuMemoryBuffer* CreateGpuMemoryBuffer(size_t width, |
| 34 size_t width, | 34 size_t height, |
| 35 size_t height, | 35 unsigned internalformat, |
| 36 unsigned internalformat, | 36 unsigned usage, |
| 37 int32* id) = 0; | 37 int32* id) = 0; |
| 38 | 38 |
| 39 // Destroy a gpu memory buffer. The ID must be positive. | 39 // Destroy a gpu memory buffer. The ID must be positive. |
| 40 virtual void DestroyGpuMemoryBuffer(int32 id) = 0; | 40 virtual void DestroyGpuMemoryBuffer(int32 id) = 0; |
| 41 | 41 |
| 42 // Inserts a sync point, returning its ID. Sync point IDs are global and can | 42 // Inserts a sync point, returning its ID. Sync point IDs are global and can |
| 43 // be used for cross-context synchronization. | 43 // be used for cross-context synchronization. |
| 44 virtual uint32 InsertSyncPoint() = 0; | 44 virtual uint32 InsertSyncPoint() = 0; |
| 45 | 45 |
| 46 // Runs |callback| when a sync point is reached. | 46 // Runs |callback| when a sync point is reached. |
| 47 virtual void SignalSyncPoint(uint32 sync_point, | 47 virtual void SignalSyncPoint(uint32 sync_point, |
| (...skipping 14 matching lines...) Expand all Loading... |
| 62 // returns a stream identifier. | 62 // returns a stream identifier. |
| 63 virtual uint32 CreateStreamTexture(uint32 texture_id) = 0; | 63 virtual uint32 CreateStreamTexture(uint32 texture_id) = 0; |
| 64 | 64 |
| 65 private: | 65 private: |
| 66 DISALLOW_COPY_AND_ASSIGN(GpuControl); | 66 DISALLOW_COPY_AND_ASSIGN(GpuControl); |
| 67 }; | 67 }; |
| 68 | 68 |
| 69 } // namespace gpu | 69 } // namespace gpu |
| 70 | 70 |
| 71 #endif // GPU_COMMAND_BUFFER_COMMON_GPU_CONTROL_H_ | 71 #endif // GPU_COMMAND_BUFFER_COMMON_GPU_CONTROL_H_ |
| OLD | NEW |