| 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 CCSingleThreadProxy_h | 5 #ifndef CCSingleThreadProxy_h |
| 6 #define CCSingleThreadProxy_h | 6 #define CCSingleThreadProxy_h |
| 7 | 7 |
| 8 #include "CCAnimationEvents.h" | 8 #include "CCAnimationEvents.h" |
| 9 #include "CCLayerTreeHostImpl.h" | 9 #include "CCLayerTreeHostImpl.h" |
| 10 #include "CCProxy.h" | 10 #include "CCProxy.h" |
| (...skipping 12 matching lines...) Expand all Loading... |
| 23 // CCProxy implementation | 23 // CCProxy implementation |
| 24 virtual bool compositeAndReadback(void *pixels, const IntRect&) OVERRIDE; | 24 virtual bool compositeAndReadback(void *pixels, const IntRect&) OVERRIDE; |
| 25 virtual void startPageScaleAnimation(const IntSize& targetPosition, bool use
Anchor, float scale, double duration) OVERRIDE; | 25 virtual void startPageScaleAnimation(const IntSize& targetPosition, bool use
Anchor, float scale, double duration) OVERRIDE; |
| 26 virtual void finishAllRendering() OVERRIDE; | 26 virtual void finishAllRendering() OVERRIDE; |
| 27 virtual bool isStarted() const OVERRIDE; | 27 virtual bool isStarted() const OVERRIDE; |
| 28 virtual bool initializeContext() OVERRIDE; | 28 virtual bool initializeContext() OVERRIDE; |
| 29 virtual void setSurfaceReady() OVERRIDE; | 29 virtual void setSurfaceReady() OVERRIDE; |
| 30 virtual void setVisible(bool) OVERRIDE; | 30 virtual void setVisible(bool) OVERRIDE; |
| 31 virtual bool initializeRenderer() OVERRIDE; | 31 virtual bool initializeRenderer() OVERRIDE; |
| 32 virtual bool recreateContext() OVERRIDE; | 32 virtual bool recreateContext() OVERRIDE; |
| 33 virtual void implSideRenderingStats(CCRenderingStats&) OVERRIDE; | 33 virtual void renderingStats(CCRenderingStats&) OVERRIDE; |
| 34 virtual const RendererCapabilities& rendererCapabilities() const OVERRIDE; | 34 virtual const RendererCapabilities& rendererCapabilities() const OVERRIDE; |
| 35 virtual void loseContext() OVERRIDE; | 35 virtual void loseContext() OVERRIDE; |
| 36 virtual void setNeedsAnimate() OVERRIDE; | 36 virtual void setNeedsAnimate() OVERRIDE; |
| 37 virtual void setNeedsCommit() OVERRIDE; | 37 virtual void setNeedsCommit() OVERRIDE; |
| 38 virtual void setNeedsRedraw() OVERRIDE; | 38 virtual void setNeedsRedraw() OVERRIDE; |
| 39 virtual bool commitRequested() const OVERRIDE; | 39 virtual bool commitRequested() const OVERRIDE; |
| 40 virtual void didAddAnimation() OVERRIDE; | 40 virtual void didAddAnimation() OVERRIDE; |
| 41 virtual void start() OVERRIDE; | 41 virtual void start() OVERRIDE; |
| 42 virtual void stop() OVERRIDE; | 42 virtual void stop() OVERRIDE; |
| 43 virtual size_t maxPartialTextureUpdates() const OVERRIDE { return std::numer
ic_limits<size_t>::max(); } | |
| 44 virtual void acquireLayerTextures() OVERRIDE { } | 43 virtual void acquireLayerTextures() OVERRIDE { } |
| 45 virtual void forceSerializeOnSwapBuffers() OVERRIDE; | 44 virtual void forceSerializeOnSwapBuffers() OVERRIDE; |
| 46 | 45 |
| 47 // CCLayerTreeHostImplClient implementation | 46 // CCLayerTreeHostImplClient implementation |
| 48 virtual void didLoseContextOnImplThread() OVERRIDE { } | 47 virtual void didLoseContextOnImplThread() OVERRIDE { } |
| 49 virtual void onSwapBuffersCompleteOnImplThread() OVERRIDE { ASSERT_NOT_REACH
ED(); } | 48 virtual void onSwapBuffersCompleteOnImplThread() OVERRIDE { ASSERT_NOT_REACH
ED(); } |
| 50 virtual void onVSyncParametersChanged(double monotonicTimebase, double inter
valInSeconds) OVERRIDE { } | 49 virtual void onVSyncParametersChanged(double monotonicTimebase, double inter
valInSeconds) OVERRIDE { } |
| 51 virtual void onCanDrawStateChanged(bool canDraw) OVERRIDE { } | 50 virtual void onCanDrawStateChanged(bool canDraw) OVERRIDE { } |
| 52 virtual void setNeedsRedrawOnImplThread() OVERRIDE { m_layerTreeHost->schedu
leComposite(); } | 51 virtual void setNeedsRedrawOnImplThread() OVERRIDE { m_layerTreeHost->schedu
leComposite(); } |
| 53 virtual void setNeedsCommitOnImplThread() OVERRIDE { m_layerTreeHost->schedu
leComposite(); } | 52 virtual void setNeedsCommitOnImplThread() OVERRIDE { m_layerTreeHost->schedu
leComposite(); } |
| (...skipping 17 matching lines...) Expand all Loading... |
| 71 // Holds on to the context between initializeContext() and initializeRendere
r() calls. Shouldn't | 70 // Holds on to the context between initializeContext() and initializeRendere
r() calls. Shouldn't |
| 72 // be used for anything else. | 71 // be used for anything else. |
| 73 OwnPtr<CCGraphicsContext> m_contextBeforeInitialization; | 72 OwnPtr<CCGraphicsContext> m_contextBeforeInitialization; |
| 74 | 73 |
| 75 // Used on the CCThread, but checked on main thread during initialization/sh
utdown. | 74 // Used on the CCThread, but checked on main thread during initialization/sh
utdown. |
| 76 OwnPtr<CCLayerTreeHostImpl> m_layerTreeHostImpl; | 75 OwnPtr<CCLayerTreeHostImpl> m_layerTreeHostImpl; |
| 77 bool m_rendererInitialized; | 76 bool m_rendererInitialized; |
| 78 RendererCapabilities m_RendererCapabilitiesForMainThread; | 77 RendererCapabilities m_RendererCapabilitiesForMainThread; |
| 79 | 78 |
| 80 bool m_nextFrameIsNewlyCommittedFrame; | 79 bool m_nextFrameIsNewlyCommittedFrame; |
| 80 |
| 81 // Statistics |
| 82 double m_totalCommitTime; |
| 83 size_t m_totalCommitCount; |
| 81 }; | 84 }; |
| 82 | 85 |
| 83 // For use in the single-threaded case. In debug builds, it pretends that the | 86 // For use in the single-threaded case. In debug builds, it pretends that the |
| 84 // code is running on the impl thread to satisfy assertion checks. | 87 // code is running on the impl thread to satisfy assertion checks. |
| 85 class DebugScopedSetImplThread { | 88 class DebugScopedSetImplThread { |
| 86 public: | 89 public: |
| 87 DebugScopedSetImplThread() | 90 DebugScopedSetImplThread() |
| 88 { | 91 { |
| 89 #if !ASSERT_DISABLED | 92 #if !ASSERT_DISABLED |
| 90 CCProxy::setCurrentThreadIsImplThread(true); | 93 CCProxy::setCurrentThreadIsImplThread(true); |
| (...skipping 30 matching lines...) Expand all Loading... |
| 121 // satisfy assertion checks | 124 // satisfy assertion checks |
| 122 class DebugScopedSetImplThreadAndMainThreadBlocked { | 125 class DebugScopedSetImplThreadAndMainThreadBlocked { |
| 123 private: | 126 private: |
| 124 DebugScopedSetImplThread m_implThread; | 127 DebugScopedSetImplThread m_implThread; |
| 125 DebugScopedSetMainThreadBlocked m_mainThreadBlocked; | 128 DebugScopedSetMainThreadBlocked m_mainThreadBlocked; |
| 126 }; | 129 }; |
| 127 | 130 |
| 128 } // namespace WebCore | 131 } // namespace WebCore |
| 129 | 132 |
| 130 #endif | 133 #endif |
| OLD | NEW |