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_COMMAND_BUFFER_CLIENT_GPU_CONTROL_H_ | 5 #ifndef GPU_COMMAND_BUFFER_CLIENT_GPU_CONTROL_H_ |
6 #define GPU_COMMAND_BUFFER_CLIENT_GPU_CONTROL_H_ | 6 #define GPU_COMMAND_BUFFER_CLIENT_GPU_CONTROL_H_ |
7 | 7 |
8 #include <stddef.h> | 8 #include <stddef.h> |
9 #include <stdint.h> | 9 #include <stdint.h> |
10 | 10 |
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
52 // Destroy an image. The ID must be positive. | 52 // Destroy an image. The ID must be positive. |
53 virtual void DestroyImage(int32_t id) = 0; | 53 virtual void DestroyImage(int32_t id) = 0; |
54 | 54 |
55 // Create a gpu memory buffer backed image with the given dimensions and | 55 // Create a gpu memory buffer backed image with the given dimensions and |
56 // format for |usage|. Returns its ID or -1 on error. | 56 // format for |usage|. Returns its ID or -1 on error. |
57 virtual int32_t CreateGpuMemoryBufferImage(size_t width, | 57 virtual int32_t CreateGpuMemoryBufferImage(size_t width, |
58 size_t height, | 58 size_t height, |
59 unsigned internalformat, | 59 unsigned internalformat, |
60 unsigned usage) = 0; | 60 unsigned usage) = 0; |
61 | 61 |
62 // Returns the id of the GpuMemoryBuffer associated with the given image. If | |
63 // the image doesn't exist, or isn't associated with a GpuMemoryBuffer, | |
64 // returns -1. | |
65 virtual int32_t GetImageGpuMemoryBufferId(unsigned image_id) = 0; | |
66 | |
67 // Runs |callback| when a query created via glCreateQueryEXT() has cleared | 62 // Runs |callback| when a query created via glCreateQueryEXT() has cleared |
68 // passed the glEndQueryEXT() point. | 63 // passed the glEndQueryEXT() point. |
69 virtual void SignalQuery(uint32_t query, const base::Closure& callback) = 0; | 64 virtual void SignalQuery(uint32_t query, const base::Closure& callback) = 0; |
70 | 65 |
71 // Sets a lock this will be held on every callback from the GPU | 66 // Sets a lock this will be held on every callback from the GPU |
72 // implementation. This lock must be set and must be held on every call into | 67 // implementation. This lock must be set and must be held on every call into |
73 // the GPU implementation if it is to be used from multiple threads. This | 68 // the GPU implementation if it is to be used from multiple threads. This |
74 // may not be supported with all implementations. | 69 // may not be supported with all implementations. |
75 virtual void SetLock(base::Lock*) = 0; | 70 virtual void SetLock(base::Lock*) = 0; |
76 | 71 |
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
113 // be enqueued first so does not need to be flushed. | 108 // be enqueued first so does not need to be flushed. |
114 virtual bool CanWaitUnverifiedSyncToken(const SyncToken* sync_token) = 0; | 109 virtual bool CanWaitUnverifiedSyncToken(const SyncToken* sync_token) = 0; |
115 | 110 |
116 private: | 111 private: |
117 DISALLOW_COPY_AND_ASSIGN(GpuControl); | 112 DISALLOW_COPY_AND_ASSIGN(GpuControl); |
118 }; | 113 }; |
119 | 114 |
120 } // namespace gpu | 115 } // namespace gpu |
121 | 116 |
122 #endif // GPU_COMMAND_BUFFER_CLIENT_GPU_CONTROL_H_ | 117 #endif // GPU_COMMAND_BUFFER_CLIENT_GPU_CONTROL_H_ |
OLD | NEW |