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 <stdint.h> | 8 #include <stdint.h> |
9 | 9 |
10 #include <vector> | 10 #include <vector> |
11 | 11 |
12 #include "base/callback.h" | 12 #include "base/callback.h" |
13 #include "base/macros.h" | 13 #include "base/macros.h" |
14 #include "gpu/command_buffer/common/capabilities.h" | 14 #include "gpu/command_buffer/common/capabilities.h" |
15 #include "gpu/command_buffer/common/mailbox.h" | 15 #include "gpu/command_buffer/common/mailbox.h" |
16 #include "gpu/gpu_export.h" | 16 #include "gpu/gpu_export.h" |
17 | 17 |
18 namespace gfx { | 18 namespace gfx { |
19 class GpuMemoryBuffer; | 19 class GpuMemoryBuffer; |
20 } | 20 } |
21 | 21 |
22 namespace gpu { | 22 namespace gpu { |
23 struct ManagedMemoryStats; | |
24 | 23 |
25 // Common interface for GpuControl implementations. | 24 // Common interface for GpuControl implementations. |
26 class GPU_EXPORT GpuControl { | 25 class GPU_EXPORT GpuControl { |
27 public: | 26 public: |
28 GpuControl() {} | 27 GpuControl() {} |
29 virtual ~GpuControl() {} | 28 virtual ~GpuControl() {} |
30 | 29 |
31 virtual Capabilities GetCapabilities() = 0; | 30 virtual Capabilities GetCapabilities() = 0; |
32 | 31 |
33 // Create a gpu memory buffer of the given dimensions and format. Returns | 32 // Create a gpu memory buffer of the given dimensions and format. Returns |
(...skipping 15 matching lines...) Expand all Loading... |
49 // Runs |callback| when a sync point is reached. | 48 // Runs |callback| when a sync point is reached. |
50 virtual void SignalSyncPoint(uint32_t sync_point, | 49 virtual void SignalSyncPoint(uint32_t sync_point, |
51 const base::Closure& callback) = 0; | 50 const base::Closure& callback) = 0; |
52 | 51 |
53 // Runs |callback| when a query created via glCreateQueryEXT() has cleared | 52 // Runs |callback| when a query created via glCreateQueryEXT() has cleared |
54 // passed the glEndQueryEXT() point. | 53 // passed the glEndQueryEXT() point. |
55 virtual void SignalQuery(uint32_t query, const base::Closure& callback) = 0; | 54 virtual void SignalQuery(uint32_t query, const base::Closure& callback) = 0; |
56 | 55 |
57 virtual void SetSurfaceVisible(bool visible) = 0; | 56 virtual void SetSurfaceVisible(bool visible) = 0; |
58 | 57 |
59 virtual void SendManagedMemoryStats(const ManagedMemoryStats& stats) = 0; | |
60 | |
61 // Invokes the callback once the context has been flushed. | 58 // Invokes the callback once the context has been flushed. |
62 virtual void Echo(const base::Closure& callback) = 0; | 59 virtual void Echo(const base::Closure& callback) = 0; |
63 | 60 |
64 // Attaches an external stream to the texture given by |texture_id| and | 61 // Attaches an external stream to the texture given by |texture_id| and |
65 // returns a stream identifier. | 62 // returns a stream identifier. |
66 virtual uint32_t CreateStreamTexture(uint32_t texture_id) = 0; | 63 virtual uint32_t CreateStreamTexture(uint32_t texture_id) = 0; |
67 | 64 |
68 private: | 65 private: |
69 DISALLOW_COPY_AND_ASSIGN(GpuControl); | 66 DISALLOW_COPY_AND_ASSIGN(GpuControl); |
70 }; | 67 }; |
71 | 68 |
72 } // namespace gpu | 69 } // namespace gpu |
73 | 70 |
74 #endif // GPU_COMMAND_BUFFER_CLIENT_GPU_CONTROL_H_ | 71 #endif // GPU_COMMAND_BUFFER_CLIENT_GPU_CONTROL_H_ |
OLD | NEW |