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 <limits> | 8 #include <limits> |
9 | 9 |
10 #include "base/time.h" | 10 #include "base/time.h" |
11 #include "cc/animation_events.h" | 11 #include "cc/animation_events.h" |
12 #include "cc/layer_tree_host_impl.h" | 12 #include "cc/layer_tree_host_impl.h" |
13 #include "cc/proxy.h" | 13 #include "cc/proxy.h" |
14 | 14 |
15 namespace cc { | 15 namespace cc { |
16 | 16 |
17 class LayerTreeHost; | 17 class LayerTreeHost; |
18 | 18 |
19 class SingleThreadProxy : public Proxy, LayerTreeHostImplClient { | 19 class SingleThreadProxy : public Proxy, LayerTreeHostImplClient { |
20 public: | 20 public: |
21 static scoped_ptr<Proxy> create(LayerTreeHost*); | 21 static scoped_ptr<Proxy> create(LayerTreeHost*); |
22 virtual ~SingleThreadProxy(); | 22 virtual ~SingleThreadProxy(); |
23 | 23 |
24 // Proxy implementation | 24 // Proxy implementation |
25 virtual bool compositeAndReadback(void *pixels, const IntRect&) OVERRIDE; | 25 virtual bool compositeAndReadback(void *pixels, const IntRect&) OVERRIDE; |
26 virtual void startPageScaleAnimation(const IntSize& targetPosition, bool use
Anchor, float scale, double duration) OVERRIDE; | 26 virtual void startPageScaleAnimation(const IntSize& targetPosition, bool use
Anchor, float scale, base::TimeDelta duration) OVERRIDE; |
27 virtual void finishAllRendering() OVERRIDE; | 27 virtual void finishAllRendering() OVERRIDE; |
28 virtual bool isStarted() const OVERRIDE; | 28 virtual bool isStarted() const OVERRIDE; |
29 virtual bool initializeContext() OVERRIDE; | 29 virtual bool initializeContext() OVERRIDE; |
30 virtual void setSurfaceReady() OVERRIDE; | 30 virtual void setSurfaceReady() OVERRIDE; |
31 virtual void setVisible(bool) OVERRIDE; | 31 virtual void setVisible(bool) OVERRIDE; |
32 virtual bool initializeRenderer() OVERRIDE; | 32 virtual bool initializeRenderer() OVERRIDE; |
33 virtual bool recreateContext() OVERRIDE; | 33 virtual bool recreateContext() OVERRIDE; |
34 virtual void renderingStats(RenderingStats*) OVERRIDE; | 34 virtual void renderingStats(RenderingStats*) OVERRIDE; |
35 virtual const RendererCapabilities& rendererCapabilities() const OVERRIDE; | 35 virtual const RendererCapabilities& rendererCapabilities() const OVERRIDE; |
36 virtual void loseContext() OVERRIDE; | 36 virtual void loseContext() OVERRIDE; |
37 virtual void setNeedsAnimate() OVERRIDE; | 37 virtual void setNeedsAnimate() OVERRIDE; |
38 virtual void setNeedsCommit() OVERRIDE; | 38 virtual void setNeedsCommit() OVERRIDE; |
39 virtual void setNeedsRedraw() OVERRIDE; | 39 virtual void setNeedsRedraw() OVERRIDE; |
40 virtual void setDeferCommits(bool) OVERRIDE; | 40 virtual void setDeferCommits(bool) OVERRIDE; |
41 virtual bool commitRequested() const OVERRIDE; | 41 virtual bool commitRequested() const OVERRIDE; |
42 virtual void didAddAnimation() OVERRIDE; | 42 virtual void didAddAnimation() OVERRIDE; |
43 virtual void start() OVERRIDE; | 43 virtual void start() OVERRIDE; |
44 virtual void stop() OVERRIDE; | 44 virtual void stop() OVERRIDE; |
45 virtual size_t maxPartialTextureUpdates() const OVERRIDE; | 45 virtual size_t maxPartialTextureUpdates() const OVERRIDE; |
46 virtual void acquireLayerTextures() OVERRIDE { } | 46 virtual void acquireLayerTextures() OVERRIDE { } |
47 virtual void forceSerializeOnSwapBuffers() OVERRIDE; | 47 virtual void forceSerializeOnSwapBuffers() OVERRIDE; |
48 | 48 |
49 // LayerTreeHostImplClient implementation | 49 // LayerTreeHostImplClient implementation |
50 virtual void didLoseContextOnImplThread() OVERRIDE { } | 50 virtual void didLoseContextOnImplThread() OVERRIDE { } |
51 virtual void onSwapBuffersCompleteOnImplThread() OVERRIDE; | 51 virtual void onSwapBuffersCompleteOnImplThread() OVERRIDE; |
52 virtual void onVSyncParametersChanged(double monotonicTimebase, double inter
valInSeconds) OVERRIDE { } | 52 virtual void onVSyncParametersChanged(base::TimeTicks timebase, base::TimeDe
lta interval) OVERRIDE { } |
53 virtual void onCanDrawStateChanged(bool canDraw) OVERRIDE { } | 53 virtual void onCanDrawStateChanged(bool canDraw) OVERRIDE { } |
54 virtual void setNeedsRedrawOnImplThread() OVERRIDE; | 54 virtual void setNeedsRedrawOnImplThread() OVERRIDE; |
55 virtual void setNeedsCommitOnImplThread() OVERRIDE; | 55 virtual void setNeedsCommitOnImplThread() OVERRIDE; |
56 virtual void postAnimationEventsToMainThreadOnImplThread(scoped_ptr<Animatio
nEventsVector>, double wallClockTime) OVERRIDE; | 56 virtual void postAnimationEventsToMainThreadOnImplThread(scoped_ptr<Animatio
nEventsVector>, base::Time wallClockTime) OVERRIDE; |
57 virtual bool reduceContentsTextureMemoryOnImplThread(size_t limitBytes, int
priorityCutoff) OVERRIDE; | 57 virtual bool reduceContentsTextureMemoryOnImplThread(size_t limitBytes, int
priorityCutoff) OVERRIDE; |
58 virtual void sendManagedMemoryStats() OVERRIDE; | 58 virtual void sendManagedMemoryStats() OVERRIDE; |
59 | 59 |
60 // Called by the legacy path where RenderWidget does the scheduling. | 60 // Called by the legacy path where RenderWidget does the scheduling. |
61 void compositeImmediately(); | 61 void compositeImmediately(); |
62 | 62 |
63 private: | 63 private: |
64 explicit SingleThreadProxy(LayerTreeHost*); | 64 explicit SingleThreadProxy(LayerTreeHost*); |
65 | 65 |
66 bool commitAndComposite(); | 66 bool commitAndComposite(); |
(...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
128 // satisfy assertion checks | 128 // satisfy assertion checks |
129 class DebugScopedSetImplThreadAndMainThreadBlocked { | 129 class DebugScopedSetImplThreadAndMainThreadBlocked { |
130 private: | 130 private: |
131 DebugScopedSetImplThread m_implThread; | 131 DebugScopedSetImplThread m_implThread; |
132 DebugScopedSetMainThreadBlocked m_mainThreadBlocked; | 132 DebugScopedSetMainThreadBlocked m_mainThreadBlocked; |
133 }; | 133 }; |
134 | 134 |
135 } // namespace cc | 135 } // namespace cc |
136 | 136 |
137 #endif | 137 #endif |
OLD | NEW |