OLD | NEW |
1 // Copyright 2011 The Chromium Authors. All rights reserved. | 1 // Copyright 2011 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 CCProxy_h | 5 #ifndef CCProxy_h |
6 #define CCProxy_h | 6 #define CCProxy_h |
7 | 7 |
8 #include "base/basictypes.h" | 8 #include "base/basictypes.h" |
9 #include "cc/dcheck.h" | |
10 #include <public/WebCompositorOutputSurface.h> | 9 #include <public/WebCompositorOutputSurface.h> |
11 | 10 |
12 namespace cc { | 11 namespace cc { |
13 | 12 |
14 class CCThread; | 13 class CCThread; |
15 class IntRect; | 14 class IntRect; |
16 class IntSize; | 15 class IntSize; |
17 struct CCRenderingStats; | 16 struct CCRenderingStats; |
18 struct RendererCapabilities; | 17 struct RendererCapabilities; |
19 | 18 |
(...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
75 // Forces 3D commands on all contexts to wait for all previous SwapBuffers t
o finish before executing in the GPU | 74 // Forces 3D commands on all contexts to wait for all previous SwapBuffers t
o finish before executing in the GPU |
76 // process. | 75 // process. |
77 virtual void forceSerializeOnSwapBuffers() = 0; | 76 virtual void forceSerializeOnSwapBuffers() = 0; |
78 | 77 |
79 // Maximum number of sub-region texture updates supported for each commit. | 78 // Maximum number of sub-region texture updates supported for each commit. |
80 virtual size_t maxPartialTextureUpdates() const = 0; | 79 virtual size_t maxPartialTextureUpdates() const = 0; |
81 | 80 |
82 virtual void acquireLayerTextures() = 0; | 81 virtual void acquireLayerTextures() = 0; |
83 | 82 |
84 // Debug hooks | 83 // Debug hooks |
85 #if CC_DCHECK_ENABLED() | 84 #ifndef NDEBUG |
86 static bool isMainThread(); | 85 static bool isMainThread(); |
87 static bool isImplThread(); | 86 static bool isImplThread(); |
88 static bool isMainThreadBlocked(); | 87 static bool isMainThreadBlocked(); |
89 static void setMainThreadBlocked(bool); | 88 static void setMainThreadBlocked(bool); |
90 #endif | 89 #endif |
91 | 90 |
92 // Testing hooks | 91 // Testing hooks |
93 virtual void loseContext() = 0; | 92 virtual void loseContext() = 0; |
94 | 93 |
95 #if CC_DCHECK_ENABLED() | 94 #ifndef NDEBUG |
96 static void setCurrentThreadIsImplThread(bool); | 95 static void setCurrentThreadIsImplThread(bool); |
97 #endif | 96 #endif |
98 | 97 |
99 protected: | 98 protected: |
100 CCProxy(); | 99 CCProxy(); |
101 friend class DebugScopedSetImplThread; | 100 friend class DebugScopedSetImplThread; |
102 friend class DebugScopedSetMainThreadBlocked; | 101 friend class DebugScopedSetMainThreadBlocked; |
103 | 102 |
104 private: | 103 private: |
105 DISALLOW_COPY_AND_ASSIGN(CCProxy); | 104 DISALLOW_COPY_AND_ASSIGN(CCProxy); |
106 }; | 105 }; |
107 | 106 |
108 class DebugScopedSetMainThreadBlocked { | 107 class DebugScopedSetMainThreadBlocked { |
109 public: | 108 public: |
110 DebugScopedSetMainThreadBlocked() | 109 DebugScopedSetMainThreadBlocked() |
111 { | 110 { |
112 #if CC_DCHECK_ENABLED() | 111 #if !ASSERT_DISABLED |
113 DCHECK(!CCProxy::isMainThreadBlocked()); | 112 ASSERT(!CCProxy::isMainThreadBlocked()); |
114 CCProxy::setMainThreadBlocked(true); | 113 CCProxy::setMainThreadBlocked(true); |
115 #endif | 114 #endif |
116 } | 115 } |
117 ~DebugScopedSetMainThreadBlocked() | 116 ~DebugScopedSetMainThreadBlocked() |
118 { | 117 { |
119 #if CC_DCHECK_ENABLED() | 118 #if !ASSERT_DISABLED |
120 DCHECK(CCProxy::isMainThreadBlocked()); | 119 ASSERT(CCProxy::isMainThreadBlocked()); |
121 CCProxy::setMainThreadBlocked(false); | 120 CCProxy::setMainThreadBlocked(false); |
122 #endif | 121 #endif |
123 } | 122 } |
124 }; | 123 }; |
125 | 124 |
126 } | 125 } |
127 | 126 |
128 #endif | 127 #endif |
OLD | NEW |