Index: cc/proxy.h |
diff --git a/cc/proxy.h b/cc/proxy.h |
index 85b3554c6415fb5bc99f878b396b7f87380ebf63..d57f6f0a0934a37c41e60d21b156241d0c1c18e8 100644 |
--- a/cc/proxy.h |
+++ b/cc/proxy.h |
@@ -7,7 +7,9 @@ |
#include "base/basictypes.h" |
#include "base/logging.h" |
+#include "base/memory/scoped_ptr.h" |
#include <public/WebCompositorOutputSurface.h> |
+#include <public/WebThread.h> |
jamesr
2012/10/22 22:00:36
again, not great :( cc::CCThread?
|
namespace cc { |
@@ -21,15 +23,24 @@ struct RendererCapabilities; |
// the compositor over to the compositor implementation. |
class CCProxy { |
public: |
- static void setMainThread(CCThread*); |
- static CCThread* mainThread(); |
- |
- static bool hasImplThread(); |
- static void setImplThread(CCThread*); |
- static CCThread* implThread(); |
+ CCThread* mainThread() const; |
+ bool hasImplThread() const; |
+ CCThread* implThread() const; |
// Returns 0 if the current thread is neither the main thread nor the impl thread. |
- static CCThread* currentThread(); |
+ CCThread* currentThread() const; |
+ |
+ // Debug hooks |
+ bool isMainThread() const; |
+ bool isImplThread() const; |
+ bool isMainThreadBlocked() const; |
+ void setMainThread(CCThread*); |
+ void setImplThread(CCThread*); |
+#ifndef NDEBUG |
+ void setMainThreadBlocked(bool); |
+ void setCurrentThreadIsImplThread(bool); |
+#endif |
+ |
virtual ~CCProxy(); |
@@ -81,28 +92,23 @@ public: |
virtual void acquireLayerTextures() = 0; |
- // Debug hooks |
- static bool isMainThread(); |
- static bool isImplThread(); |
- static bool isMainThreadBlocked(); |
-#ifndef NDEBUG |
- static void setMainThreadBlocked(bool); |
-#endif |
- |
// Testing hooks |
virtual void loseContext() = 0; |
-#ifndef NDEBUG |
- static void setCurrentThreadIsImplThread(bool); |
-#endif |
- |
protected: |
- CCProxy(); |
+ explicit CCProxy(WebKit::WebThread* implThread); |
friend class DebugScopedSetImplThread; |
friend class DebugScopedSetMainThreadBlocked; |
private: |
DISALLOW_COPY_AND_ASSIGN(CCProxy); |
+ |
+ CompositorSupportState* m_compositorSupportState; |
+#ifndef NDEBUG |
+ bool m_implThreadIsOverridden; |
+ bool m_isMainThreadBlocked; |
+ base::PlatformThreadId m_threadIDOverridenToBeImplThread; |
+#endif |
}; |
class DebugScopedSetMainThreadBlocked { |