| 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" |
| 11 #include <base/time.h> | 11 #include <base/time.h> |
| 12 #include <limits> | 12 #include <limits> |
| 13 #include <wtf/OwnPtr.h> | |
| 14 | 13 |
| 15 namespace cc { | 14 namespace cc { |
| 16 | 15 |
| 17 class CCLayerTreeHost; | 16 class CCLayerTreeHost; |
| 18 | 17 |
| 19 class CCSingleThreadProxy : public CCProxy, CCLayerTreeHostImplClient { | 18 class CCSingleThreadProxy : public CCProxy, CCLayerTreeHostImplClient { |
| 20 public: | 19 public: |
| 21 static PassOwnPtr<CCProxy> create(CCLayerTreeHost*); | 20 static scoped_ptr<CCProxy> create(CCLayerTreeHost*); |
| 22 virtual ~CCSingleThreadProxy(); | 21 virtual ~CCSingleThreadProxy(); |
| 23 | 22 |
| 24 // CCProxy implementation | 23 // CCProxy implementation |
| 25 virtual bool compositeAndReadback(void *pixels, const IntRect&) OVERRIDE; | 24 virtual bool compositeAndReadback(void *pixels, const IntRect&) OVERRIDE; |
| 26 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; |
| 27 virtual void finishAllRendering() OVERRIDE; | 26 virtual void finishAllRendering() OVERRIDE; |
| 28 virtual bool isStarted() const OVERRIDE; | 27 virtual bool isStarted() const OVERRIDE; |
| 29 virtual bool initializeContext() OVERRIDE; | 28 virtual bool initializeContext() OVERRIDE; |
| 30 virtual void setSurfaceReady() OVERRIDE; | 29 virtual void setSurfaceReady() OVERRIDE; |
| 31 virtual void setVisible(bool) OVERRIDE; | 30 virtual void setVisible(bool) OVERRIDE; |
| (...skipping 13 matching lines...) Expand all Loading... |
| 45 virtual void acquireLayerTextures() OVERRIDE { } | 44 virtual void acquireLayerTextures() OVERRIDE { } |
| 46 virtual void forceSerializeOnSwapBuffers() OVERRIDE; | 45 virtual void forceSerializeOnSwapBuffers() OVERRIDE; |
| 47 | 46 |
| 48 // CCLayerTreeHostImplClient implementation | 47 // CCLayerTreeHostImplClient implementation |
| 49 virtual void didLoseContextOnImplThread() OVERRIDE { } | 48 virtual void didLoseContextOnImplThread() OVERRIDE { } |
| 50 virtual void onSwapBuffersCompleteOnImplThread() OVERRIDE; | 49 virtual void onSwapBuffersCompleteOnImplThread() OVERRIDE; |
| 51 virtual void onVSyncParametersChanged(double monotonicTimebase, double inter
valInSeconds) OVERRIDE { } | 50 virtual void onVSyncParametersChanged(double monotonicTimebase, double inter
valInSeconds) OVERRIDE { } |
| 52 virtual void onCanDrawStateChanged(bool canDraw) OVERRIDE { } | 51 virtual void onCanDrawStateChanged(bool canDraw) OVERRIDE { } |
| 53 virtual void setNeedsRedrawOnImplThread() OVERRIDE; | 52 virtual void setNeedsRedrawOnImplThread() OVERRIDE; |
| 54 virtual void setNeedsCommitOnImplThread() OVERRIDE; | 53 virtual void setNeedsCommitOnImplThread() OVERRIDE; |
| 55 virtual void postAnimationEventsToMainThreadOnImplThread(PassOwnPtr<CCAnimat
ionEventsVector>, double wallClockTime) OVERRIDE; | 54 virtual void postAnimationEventsToMainThreadOnImplThread(scoped_ptr<CCAnimat
ionEventsVector>, double wallClockTime) OVERRIDE; |
| 56 virtual void releaseContentsTexturesOnImplThread() OVERRIDE; | 55 virtual void releaseContentsTexturesOnImplThread() OVERRIDE; |
| 57 | 56 |
| 58 // Called by the legacy path where RenderWidget does the scheduling. | 57 // Called by the legacy path where RenderWidget does the scheduling. |
| 59 void compositeImmediately(); | 58 void compositeImmediately(); |
| 60 | 59 |
| 61 private: | 60 private: |
| 62 explicit CCSingleThreadProxy(CCLayerTreeHost*); | 61 explicit CCSingleThreadProxy(CCLayerTreeHost*); |
| 63 | 62 |
| 64 bool commitAndComposite(); | 63 bool commitAndComposite(); |
| 65 void doCommit(PassOwnPtr<CCTextureUpdateQueue>); | 64 void doCommit(PassOwnPtr<CCTextureUpdateQueue>); |
| (...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 126 // satisfy assertion checks | 125 // satisfy assertion checks |
| 127 class DebugScopedSetImplThreadAndMainThreadBlocked { | 126 class DebugScopedSetImplThreadAndMainThreadBlocked { |
| 128 private: | 127 private: |
| 129 DebugScopedSetImplThread m_implThread; | 128 DebugScopedSetImplThread m_implThread; |
| 130 DebugScopedSetMainThreadBlocked m_mainThreadBlocked; | 129 DebugScopedSetMainThreadBlocked m_mainThreadBlocked; |
| 131 }; | 130 }; |
| 132 | 131 |
| 133 } // namespace cc | 132 } // namespace cc |
| 134 | 133 |
| 135 #endif | 134 #endif |
| OLD | NEW |