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_CLIENT_CONTEXT_SUPPORT_H_ | 5 #ifndef GPU_COMMAND_BUFFER_CLIENT_CONTEXT_SUPPORT_H_ |
6 #define GPU_COMMAND_BUFFER_CLIENT_CONTEXT_SUPPORT_H_ | 6 #define GPU_COMMAND_BUFFER_CLIENT_CONTEXT_SUPPORT_H_ |
7 | 7 |
8 #include "base/callback.h" | 8 #include "base/callback.h" |
9 #include "ui/gfx/overlay_transform.h" | 9 #include "ui/gfx/overlay_transform.h" |
10 #include "ui/gfx/rect.h" | 10 #include "ui/gfx/rect.h" |
11 | 11 |
12 namespace gpu { | 12 namespace gpu { |
13 struct ManagedMemoryStats; | |
14 | 13 |
15 class ContextSupport { | 14 class ContextSupport { |
16 public: | 15 public: |
17 // Runs |callback| when a sync point is reached. | 16 // Runs |callback| when a sync point is reached. |
18 virtual void SignalSyncPoint(uint32 sync_point, | 17 virtual void SignalSyncPoint(uint32 sync_point, |
19 const base::Closure& callback) = 0; | 18 const base::Closure& callback) = 0; |
20 | 19 |
21 // Runs |callback| when a query created via glCreateQueryEXT() has cleared | 20 // Runs |callback| when a query created via glCreateQueryEXT() has cleared |
22 // passed the glEndQueryEXT() point. | 21 // passed the glEndQueryEXT() point. |
23 virtual void SignalQuery(uint32 query, const base::Closure& callback) = 0; | 22 virtual void SignalQuery(uint32 query, const base::Closure& callback) = 0; |
24 | 23 |
25 // For onscreen contexts, indicates that the surface visibility has changed. | 24 // For onscreen contexts, indicates that the surface visibility has changed. |
26 // Clients aren't expected to draw to an invisible surface. | 25 // Clients aren't expected to draw to an invisible surface. |
27 virtual void SetSurfaceVisible(bool visible) = 0; | 26 virtual void SetSurfaceVisible(bool visible) = 0; |
28 | 27 |
29 virtual void SendManagedMemoryStats(const ManagedMemoryStats& stats) = 0; | |
30 | |
31 virtual void Swap() = 0; | 28 virtual void Swap() = 0; |
32 virtual void PartialSwapBuffers(const gfx::Rect& sub_buffer) = 0; | 29 virtual void PartialSwapBuffers(const gfx::Rect& sub_buffer) = 0; |
33 | 30 |
34 virtual void SetSwapBuffersCompleteCallback( | 31 virtual void SetSwapBuffersCompleteCallback( |
35 const base::Closure& callback) = 0; | 32 const base::Closure& callback) = 0; |
36 | 33 |
37 // Schedule a texture to be presented as an overlay synchronously with the | 34 // Schedule a texture to be presented as an overlay synchronously with the |
38 // primary surface during the next buffer swap. | 35 // primary surface during the next buffer swap. |
39 // This method is not stateful and needs to be re-scheduled every frame. | 36 // This method is not stateful and needs to be re-scheduled every frame. |
40 virtual void ScheduleOverlayPlane(int plane_z_order, | 37 virtual void ScheduleOverlayPlane(int plane_z_order, |
41 gfx::OverlayTransform plane_transform, | 38 gfx::OverlayTransform plane_transform, |
42 unsigned overlay_texture_id, | 39 unsigned overlay_texture_id, |
43 const gfx::Rect& display_bounds, | 40 const gfx::Rect& display_bounds, |
44 const gfx::RectF& uv_rect) = 0; | 41 const gfx::RectF& uv_rect) = 0; |
45 | 42 |
46 protected: | 43 protected: |
47 ContextSupport() {} | 44 ContextSupport() {} |
48 virtual ~ContextSupport() {} | 45 virtual ~ContextSupport() {} |
49 }; | 46 }; |
50 | 47 |
51 } | 48 } |
52 | 49 |
53 #endif // GPU_COMMAND_BUFFER_CLIENT_CONTEXT_SUPPORT_H_ | 50 #endif // GPU_COMMAND_BUFFER_CLIENT_CONTEXT_SUPPORT_H_ |
OLD | NEW |