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 CCThreadProxy_h | 5 #ifndef CCThreadProxy_h |
6 #define CCThreadProxy_h | 6 #define CCThreadProxy_h |
7 | 7 |
8 #include "base/time.h" | 8 #include "base/time.h" |
9 #include "cc/animation_events.h" | 9 #include "cc/animation_events.h" |
10 #include "cc/completion_event.h" | 10 #include "cc/completion_event.h" |
11 #include "cc/layer_tree_host_impl.h" | 11 #include "cc/layer_tree_host_impl.h" |
12 #include "cc/proxy.h" | 12 #include "cc/proxy.h" |
13 #include "cc/resource_update_controller.h" | 13 #include "cc/resource_update_controller.h" |
14 #include "cc/scheduler.h" | 14 #include "cc/scheduler.h" |
15 | 15 |
16 namespace cc { | 16 namespace cc { |
17 | 17 |
18 class InputHandler; | 18 class InputHandler; |
19 class LayerTreeHost; | 19 class LayerTreeHost; |
20 class ResourceUpdateQueue; | 20 class ResourceUpdateQueue; |
21 class Scheduler; | 21 class Scheduler; |
22 class ScopedThreadProxy; | 22 class ScopedThreadProxy; |
23 class Thread; | 23 class Thread; |
24 class ThreadProxyContextRecreationTimer; | |
25 | 24 |
26 class ThreadProxy : public Proxy, LayerTreeHostImplClient, SchedulerClient, Reso
urceUpdateControllerClient { | 25 class ThreadProxy : public Proxy, LayerTreeHostImplClient, SchedulerClient, Reso
urceUpdateControllerClient { |
27 public: | 26 public: |
28 static scoped_ptr<Proxy> create(LayerTreeHost*); | 27 static scoped_ptr<Proxy> create(LayerTreeHost*); |
29 | 28 |
30 virtual ~ThreadProxy(); | 29 virtual ~ThreadProxy(); |
31 | 30 |
32 // Proxy implementation | 31 // Proxy implementation |
33 virtual bool compositeAndReadback(void *pixels, const IntRect&) OVERRIDE; | 32 virtual bool compositeAndReadback(void *pixels, const IntRect&) OVERRIDE; |
34 virtual void startPageScaleAnimation(const IntSize& targetPosition, bool use
Anchor, float scale, base::TimeDelta duration) OVERRIDE; | 33 virtual void startPageScaleAnimation(const IntSize& targetPosition, bool use
Anchor, float scale, base::TimeDelta duration) OVERRIDE; |
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
72 virtual void scheduledActionCommit() OVERRIDE; | 71 virtual void scheduledActionCommit() OVERRIDE; |
73 virtual void scheduledActionBeginContextRecreation() OVERRIDE; | 72 virtual void scheduledActionBeginContextRecreation() OVERRIDE; |
74 virtual void scheduledActionAcquireLayerTexturesForMainThread() OVERRIDE; | 73 virtual void scheduledActionAcquireLayerTexturesForMainThread() OVERRIDE; |
75 virtual void didAnticipatedDrawTimeChange(base::TimeTicks) OVERRIDE; | 74 virtual void didAnticipatedDrawTimeChange(base::TimeTicks) OVERRIDE; |
76 | 75 |
77 // ResourceUpdateControllerClient implementation | 76 // ResourceUpdateControllerClient implementation |
78 virtual void readyToFinalizeTextureUpdates() OVERRIDE; | 77 virtual void readyToFinalizeTextureUpdates() OVERRIDE; |
79 | 78 |
80 private: | 79 private: |
81 explicit ThreadProxy(LayerTreeHost*); | 80 explicit ThreadProxy(LayerTreeHost*); |
82 friend class ThreadProxyContextRecreationTimer; | |
83 | 81 |
84 // Set on impl thread, read on main thread. | 82 // Set on impl thread, read on main thread. |
85 struct BeginFrameAndCommitState { | 83 struct BeginFrameAndCommitState { |
86 BeginFrameAndCommitState(); | 84 BeginFrameAndCommitState(); |
87 ~BeginFrameAndCommitState(); | 85 ~BeginFrameAndCommitState(); |
88 | 86 |
89 base::TimeTicks monotonicFrameBeginTime; | 87 base::TimeTicks monotonicFrameBeginTime; |
90 scoped_ptr<ScrollAndScaleSet> scrollInfo; | 88 scoped_ptr<ScrollAndScaleSet> scrollInfo; |
91 WebKit::WebTransformationMatrix implTransform; | 89 WebKit::WebTransformationMatrix implTransform; |
92 PrioritizedTextureManager::BackingList evictedContentsTexturesBackings; | 90 PrioritizedTextureManager::BackingList evictedContentsTexturesBackings; |
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
127 void renderingStatsOnImplThread(CompletionEvent*, RenderingStats*); | 125 void renderingStatsOnImplThread(CompletionEvent*, RenderingStats*); |
128 ScheduledActionDrawAndSwapResult scheduledActionDrawAndSwapInternal(bool for
cedDraw); | 126 ScheduledActionDrawAndSwapResult scheduledActionDrawAndSwapInternal(bool for
cedDraw); |
129 void forceSerializeOnSwapBuffersOnImplThread(CompletionEvent*); | 127 void forceSerializeOnSwapBuffersOnImplThread(CompletionEvent*); |
130 void setNeedsForcedCommitOnImplThread(); | 128 void setNeedsForcedCommitOnImplThread(); |
131 | 129 |
132 // Accessed on main thread only. | 130 // Accessed on main thread only. |
133 bool m_animateRequested; // Set only when setNeedsAnimate is called. | 131 bool m_animateRequested; // Set only when setNeedsAnimate is called. |
134 bool m_commitRequested; // Set only when setNeedsCommit is called. | 132 bool m_commitRequested; // Set only when setNeedsCommit is called. |
135 bool m_commitRequestSentToImplThread; // Set by setNeedsCommit and setNeedsA
nimate. | 133 bool m_commitRequestSentToImplThread; // Set by setNeedsCommit and setNeedsA
nimate. |
136 bool m_forcedCommitRequested; | 134 bool m_forcedCommitRequested; |
137 scoped_ptr<ThreadProxyContextRecreationTimer> m_contextRecreationTimer; | 135 base::CancelableClosure m_contextRecreationCallback; |
138 LayerTreeHost* m_layerTreeHost; | 136 LayerTreeHost* m_layerTreeHost; |
139 bool m_rendererInitialized; | 137 bool m_rendererInitialized; |
140 RendererCapabilities m_RendererCapabilitiesMainThreadCopy; | 138 RendererCapabilities m_RendererCapabilitiesMainThreadCopy; |
141 bool m_started; | 139 bool m_started; |
142 bool m_texturesAcquired; | 140 bool m_texturesAcquired; |
143 bool m_inCompositeAndReadback; | 141 bool m_inCompositeAndReadback; |
144 | 142 |
145 scoped_ptr<LayerTreeHostImpl> m_layerTreeHostImpl; | 143 scoped_ptr<LayerTreeHostImpl> m_layerTreeHostImpl; |
146 | 144 |
147 scoped_ptr<InputHandler> m_inputHandlerOnImplThread; | 145 scoped_ptr<InputHandler> m_inputHandlerOnImplThread; |
(...skipping 28 matching lines...) Expand all Loading... |
176 base::TimeDelta m_totalCommitTime; | 174 base::TimeDelta m_totalCommitTime; |
177 size_t m_totalCommitCount; | 175 size_t m_totalCommitCount; |
178 | 176 |
179 bool m_deferCommits; | 177 bool m_deferCommits; |
180 bool m_deferredCommitPending; | 178 bool m_deferredCommitPending; |
181 }; | 179 }; |
182 | 180 |
183 } // namespace cc | 181 } // namespace cc |
184 | 182 |
185 #endif | 183 #endif |
OLD | NEW |