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> | 8 #include <stdint.h> |
9 #include <vector> | 9 #include <vector> |
10 | 10 |
11 #include "base/callback.h" | 11 #include "base/callback.h" |
12 #include "ui/gfx/overlay_transform.h" | 12 #include "ui/gfx/overlay_transform.h" |
13 | 13 |
14 namespace gfx { | 14 namespace gfx { |
15 class Rect; | 15 class Rect; |
16 class RectF; | 16 class RectF; |
17 } | 17 } |
18 | 18 |
19 namespace gpu { | 19 namespace gpu { |
20 | 20 |
21 struct SyncToken; | 21 struct SyncToken; |
22 | 22 |
23 class ContextSupport { | 23 class ContextSupport { |
24 public: | 24 public: |
25 // Runs |callback| when the given sync token is signalled. The sync token may | 25 // Runs |callback| when the given sync token is signalled. The sync token may |
26 // belong to any context. | 26 // belong to any context. |
27 virtual void SignalSyncToken(const SyncToken& sync_token, | 27 virtual void SignalSyncToken(const SyncToken& sync_token, |
28 const base::Closure& callback) = 0; | 28 const base::Closure& callback) = 0; |
29 | 29 |
30 // Returns true if the given sync token has been signalled. The sync token | 30 // Returns true if the given sync token has been signaled. The sync token must |
31 // must belong to this context. This may be called from any thread. | 31 // belong to this context. This may be called from any thread. |
32 virtual bool IsSyncTokenSignalled(const SyncToken& sync_token) = 0; | 32 virtual bool IsSyncTokenSignaled(const SyncToken& sync_token) = 0; |
33 | 33 |
34 // Runs |callback| when a query created via glCreateQueryEXT() has cleared | 34 // Runs |callback| when a query created via glCreateQueryEXT() has cleared |
35 // passed the glEndQueryEXT() point. | 35 // passed the glEndQueryEXT() point. |
36 virtual void SignalQuery(uint32_t query, const base::Closure& callback) = 0; | 36 virtual void SignalQuery(uint32_t query, const base::Closure& callback) = 0; |
37 | 37 |
38 // Indicates whether the context should aggressively free allocated resources. | 38 // Indicates whether the context should aggressively free allocated resources. |
39 // If set to true, the context will purge all temporary resources when | 39 // If set to true, the context will purge all temporary resources when |
40 // flushed. | 40 // flushed. |
41 virtual void SetAggressivelyFreeResources( | 41 virtual void SetAggressivelyFreeResources( |
42 bool aggressively_free_resources) = 0; | 42 bool aggressively_free_resources) = 0; |
(...skipping 21 matching lines...) Expand all Loading... |
64 const base::Callback<void(const char*, int32_t)>& callback) = 0; | 64 const base::Callback<void(const char*, int32_t)>& callback) = 0; |
65 | 65 |
66 protected: | 66 protected: |
67 ContextSupport() {} | 67 ContextSupport() {} |
68 virtual ~ContextSupport() {} | 68 virtual ~ContextSupport() {} |
69 }; | 69 }; |
70 | 70 |
71 } | 71 } |
72 | 72 |
73 #endif // GPU_COMMAND_BUFFER_CLIENT_CONTEXT_SUPPORT_H_ | 73 #endif // GPU_COMMAND_BUFFER_CLIENT_CONTEXT_SUPPORT_H_ |
OLD | NEW |