Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(388)

Side by Side Diff: cc/proxy.h

Issue 11048044: cc: Switch to Chromium DCHECKs and LOGs (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: rebase Created 8 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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"
9 #include <public/WebCompositorOutputSurface.h> 10 #include <public/WebCompositorOutputSurface.h>
10 #include <wtf/PassOwnPtr.h> 11 #include <wtf/PassOwnPtr.h>
11 #include <wtf/PassRefPtr.h> 12 #include <wtf/PassRefPtr.h>
12 13
13 namespace cc { 14 namespace cc {
14 15
15 class CCThread; 16 class CCThread;
16 class IntRect; 17 class IntRect;
17 class IntSize; 18 class IntSize;
18 struct CCRenderingStats; 19 struct CCRenderingStats;
(...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after
76 // Forces 3D commands on all contexts to wait for all previous SwapBuffers t o finish before executing in the GPU 77 // Forces 3D commands on all contexts to wait for all previous SwapBuffers t o finish before executing in the GPU
77 // process. 78 // process.
78 virtual void forceSerializeOnSwapBuffers() = 0; 79 virtual void forceSerializeOnSwapBuffers() = 0;
79 80
80 // Maximum number of sub-region texture updates supported for each commit. 81 // Maximum number of sub-region texture updates supported for each commit.
81 virtual size_t maxPartialTextureUpdates() const = 0; 82 virtual size_t maxPartialTextureUpdates() const = 0;
82 83
83 virtual void acquireLayerTextures() = 0; 84 virtual void acquireLayerTextures() = 0;
84 85
85 // Debug hooks 86 // Debug hooks
86 #ifndef NDEBUG 87 #if CC_DCHECK_ENABLED
87 static bool isMainThread(); 88 static bool isMainThread();
88 static bool isImplThread(); 89 static bool isImplThread();
89 static bool isMainThreadBlocked(); 90 static bool isMainThreadBlocked();
90 static void setMainThreadBlocked(bool); 91 static void setMainThreadBlocked(bool);
91 #endif 92 #endif
92 93
93 // Testing hooks 94 // Testing hooks
94 virtual void loseContext() = 0; 95 virtual void loseContext() = 0;
95 96
96 #ifndef NDEBUG 97 #if CC_DCHECK_ENABLED
97 static void setCurrentThreadIsImplThread(bool); 98 static void setCurrentThreadIsImplThread(bool);
98 #endif 99 #endif
99 100
100 protected: 101 protected:
101 CCProxy(); 102 CCProxy();
102 friend class DebugScopedSetImplThread; 103 friend class DebugScopedSetImplThread;
103 friend class DebugScopedSetMainThreadBlocked; 104 friend class DebugScopedSetMainThreadBlocked;
104 105
105 private: 106 private:
106 DISALLOW_COPY_AND_ASSIGN(CCProxy); 107 DISALLOW_COPY_AND_ASSIGN(CCProxy);
107 }; 108 };
108 109
109 class DebugScopedSetMainThreadBlocked { 110 class DebugScopedSetMainThreadBlocked {
110 public: 111 public:
111 DebugScopedSetMainThreadBlocked() 112 DebugScopedSetMainThreadBlocked()
112 { 113 {
113 #if !ASSERT_DISABLED 114 #if CC_DCHECK_ENABLED
114 ASSERT(!CCProxy::isMainThreadBlocked()); 115 CC_DCHECK(!CCProxy::isMainThreadBlocked());
115 CCProxy::setMainThreadBlocked(true); 116 CCProxy::setMainThreadBlocked(true);
116 #endif 117 #endif
117 } 118 }
118 ~DebugScopedSetMainThreadBlocked() 119 ~DebugScopedSetMainThreadBlocked()
119 { 120 {
120 #if !ASSERT_DISABLED 121 #if CC_DCHECK_ENABLED
121 ASSERT(CCProxy::isMainThreadBlocked()); 122 CC_DCHECK(CCProxy::isMainThreadBlocked());
122 CCProxy::setMainThreadBlocked(false); 123 CCProxy::setMainThreadBlocked(false);
123 #endif 124 #endif
124 } 125 }
125 }; 126 };
126 127
127 } 128 }
128 129
129 #endif 130 #endif
OLDNEW
« no previous file with comments | « cc/program_binding.cc ('k') | cc/proxy.cc » ('j') | cc/yuv_video_draw_quad.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698