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 <stdint.h> |
| 9 |
8 #include "base/callback.h" | 10 #include "base/callback.h" |
9 #include "ui/gfx/overlay_transform.h" | 11 #include "ui/gfx/overlay_transform.h" |
10 | 12 |
11 namespace gfx { | 13 namespace gfx { |
12 class Rect; | 14 class Rect; |
13 class RectF; | 15 class RectF; |
14 } | 16 } |
15 | 17 |
16 namespace gpu { | 18 namespace gpu { |
17 | 19 |
18 struct SyncToken; | 20 struct SyncToken; |
19 | 21 |
20 class ContextSupport { | 22 class ContextSupport { |
21 public: | 23 public: |
22 // Runs |callback| when a sync point is reached. | 24 // Runs |callback| when a sync point is reached. |
23 virtual void SignalSyncPoint(uint32 sync_point, | 25 virtual void SignalSyncPoint(uint32_t sync_point, |
24 const base::Closure& callback) = 0; | 26 const base::Closure& callback) = 0; |
25 | 27 |
26 // Runs |callback| when a sync token is signalled. | 28 // Runs |callback| when a sync token is signalled. |
27 virtual void SignalSyncToken(const SyncToken& sync_token, | 29 virtual void SignalSyncToken(const SyncToken& sync_token, |
28 const base::Closure& callback) = 0; | 30 const base::Closure& callback) = 0; |
29 | 31 |
30 // Runs |callback| when a query created via glCreateQueryEXT() has cleared | 32 // Runs |callback| when a query created via glCreateQueryEXT() has cleared |
31 // passed the glEndQueryEXT() point. | 33 // passed the glEndQueryEXT() point. |
32 virtual void SignalQuery(uint32 query, const base::Closure& callback) = 0; | 34 virtual void SignalQuery(uint32_t query, const base::Closure& callback) = 0; |
33 | 35 |
34 // Indicates whether the context should aggressively free allocated resources. | 36 // Indicates whether the context should aggressively free allocated resources. |
35 // If set to true, the context will purge all temporary resources when | 37 // If set to true, the context will purge all temporary resources when |
36 // flushed. | 38 // flushed. |
37 virtual void SetAggressivelyFreeResources( | 39 virtual void SetAggressivelyFreeResources( |
38 bool aggressively_free_resources) = 0; | 40 bool aggressively_free_resources) = 0; |
39 | 41 |
40 virtual void Swap() = 0; | 42 virtual void Swap() = 0; |
41 virtual void PartialSwapBuffers(const gfx::Rect& sub_buffer) = 0; | 43 virtual void PartialSwapBuffers(const gfx::Rect& sub_buffer) = 0; |
42 virtual void CommitOverlayPlanes() = 0; | 44 virtual void CommitOverlayPlanes() = 0; |
43 | 45 |
44 // Schedule a texture to be presented as an overlay synchronously with the | 46 // Schedule a texture to be presented as an overlay synchronously with the |
45 // primary surface during the next buffer swap or CommitOverlayPlanes. | 47 // primary surface during the next buffer swap or CommitOverlayPlanes. |
46 // This method is not stateful and needs to be re-scheduled every frame. | 48 // This method is not stateful and needs to be re-scheduled every frame. |
47 virtual void ScheduleOverlayPlane(int plane_z_order, | 49 virtual void ScheduleOverlayPlane(int plane_z_order, |
48 gfx::OverlayTransform plane_transform, | 50 gfx::OverlayTransform plane_transform, |
49 unsigned overlay_texture_id, | 51 unsigned overlay_texture_id, |
50 const gfx::Rect& display_bounds, | 52 const gfx::Rect& display_bounds, |
51 const gfx::RectF& uv_rect) = 0; | 53 const gfx::RectF& uv_rect) = 0; |
52 | 54 |
53 virtual uint32 InsertFutureSyncPointCHROMIUM() = 0; | 55 virtual uint32_t InsertFutureSyncPointCHROMIUM() = 0; |
54 virtual void RetireSyncPointCHROMIUM(uint32 sync_point) = 0; | 56 virtual void RetireSyncPointCHROMIUM(uint32_t sync_point) = 0; |
55 | 57 |
56 // Returns an ID that can be used to globally identify the share group that | 58 // Returns an ID that can be used to globally identify the share group that |
57 // this context's resources belong to. | 59 // this context's resources belong to. |
58 virtual uint64_t ShareGroupTracingGUID() const = 0; | 60 virtual uint64_t ShareGroupTracingGUID() const = 0; |
59 | 61 |
60 protected: | 62 protected: |
61 ContextSupport() {} | 63 ContextSupport() {} |
62 virtual ~ContextSupport() {} | 64 virtual ~ContextSupport() {} |
63 }; | 65 }; |
64 | 66 |
65 } | 67 } |
66 | 68 |
67 #endif // GPU_COMMAND_BUFFER_CLIENT_CONTEXT_SUPPORT_H_ | 69 #endif // GPU_COMMAND_BUFFER_CLIENT_CONTEXT_SUPPORT_H_ |
OLD | NEW |