| 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 30 matching lines...) Expand all Loading... |
| 41 // Create an image for a client buffer with the given dimensions and | 41 // Create an image for a client buffer with the given dimensions and |
| 42 // format. Returns its ID or -1 on error. | 42 // format. Returns its ID or -1 on error. |
| 43 virtual int32_t CreateImage(ClientBuffer buffer, | 43 virtual int32_t CreateImage(ClientBuffer buffer, |
| 44 size_t width, | 44 size_t width, |
| 45 size_t height, | 45 size_t height, |
| 46 unsigned internalformat) = 0; | 46 unsigned internalformat) = 0; |
| 47 | 47 |
| 48 // Destroy an image. The ID must be positive. | 48 // Destroy an image. The ID must be positive. |
| 49 virtual void DestroyImage(int32_t id) = 0; | 49 virtual void DestroyImage(int32_t id) = 0; |
| 50 | 50 |
| 51 // Create a gpu memory buffer backed image with the given dimensions and | |
| 52 // format for |usage|. Returns its ID or -1 on error. | |
| 53 virtual int32_t CreateGpuMemoryBufferImage(size_t width, | |
| 54 size_t height, | |
| 55 unsigned internalformat, | |
| 56 unsigned usage) = 0; | |
| 57 | |
| 58 // Runs |callback| when a query created via glCreateQueryEXT() has cleared | 51 // Runs |callback| when a query created via glCreateQueryEXT() has cleared |
| 59 // passed the glEndQueryEXT() point. | 52 // passed the glEndQueryEXT() point. |
| 60 virtual void SignalQuery(uint32_t query, const base::Closure& callback) = 0; | 53 virtual void SignalQuery(uint32_t query, const base::Closure& callback) = 0; |
| 61 | 54 |
| 62 // Sets a lock this will be held on every callback from the GPU | 55 // Sets a lock this will be held on every callback from the GPU |
| 63 // implementation. This lock must be set and must be held on every call into | 56 // implementation. This lock must be set and must be held on every call into |
| 64 // the GPU implementation if it is to be used from multiple threads. This | 57 // the GPU implementation if it is to be used from multiple threads. This |
| 65 // may not be supported with all implementations. | 58 // may not be supported with all implementations. |
| 66 virtual void SetLock(base::Lock*) = 0; | 59 virtual void SetLock(base::Lock*) = 0; |
| 67 | 60 |
| (...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 115 // be enqueued first so does not need to be flushed. | 108 // be enqueued first so does not need to be flushed. |
| 116 virtual bool CanWaitUnverifiedSyncToken(const SyncToken* sync_token) = 0; | 109 virtual bool CanWaitUnverifiedSyncToken(const SyncToken* sync_token) = 0; |
| 117 | 110 |
| 118 private: | 111 private: |
| 119 DISALLOW_COPY_AND_ASSIGN(GpuControl); | 112 DISALLOW_COPY_AND_ASSIGN(GpuControl); |
| 120 }; | 113 }; |
| 121 | 114 |
| 122 } // namespace gpu | 115 } // namespace gpu |
| 123 | 116 |
| 124 #endif // GPU_COMMAND_BUFFER_CLIENT_GPU_CONTROL_H_ | 117 #endif // GPU_COMMAND_BUFFER_CLIENT_GPU_CONTROL_H_ |
| OLD | NEW |