Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(59)

Side by Side Diff: cc/layer_tree_host.h

Issue 11598005: Ref count layer animation controllers. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: . Created 8 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « cc/layer_impl.cc ('k') | cc/layer_tree_host.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 CC_LAYER_TREE_HOST_H_ 5 #ifndef CC_LAYER_TREE_HOST_H_
6 #define CC_LAYER_TREE_HOST_H_ 6 #define CC_LAYER_TREE_HOST_H_
7 7
8 #include <limits> 8 #include <limits>
9 9
10 #include "base/basictypes.h" 10 #include "base/basictypes.h"
(...skipping 23 matching lines...) Expand all
34 struct hash<WebKit::WebGraphicsContext3D*> { 34 struct hash<WebKit::WebGraphicsContext3D*> {
35 size_t operator()(WebKit::WebGraphicsContext3D* ptr) const { 35 size_t operator()(WebKit::WebGraphicsContext3D* ptr) const {
36 return hash<size_t>()(reinterpret_cast<size_t>(ptr)); 36 return hash<size_t>()(reinterpret_cast<size_t>(ptr));
37 } 37 }
38 }; 38 };
39 } // namespace BASE_HASH_NAMESPACE 39 } // namespace BASE_HASH_NAMESPACE
40 #endif // COMPILER 40 #endif // COMPILER
41 41
42 namespace cc { 42 namespace cc {
43 43
44 class AnimationRegistrar;
44 class Layer; 45 class Layer;
45 class LayerTreeHostImpl; 46 class LayerTreeHostImpl;
46 class LayerTreeHostImplClient; 47 class LayerTreeHostImplClient;
47 class PrioritizedResourceManager; 48 class PrioritizedResourceManager;
48 class ResourceUpdateQueue; 49 class ResourceUpdateQueue;
49 class HeadsUpDisplayLayer; 50 class HeadsUpDisplayLayer;
50 class Region; 51 class Region;
51 struct ScrollAndScaleSet; 52 struct ScrollAndScaleSet;
52 53
53 54
(...skipping 85 matching lines...) Expand 10 before | Expand all | Expand 10 after
139 void loseOutputSurface(int numTimes); 140 void loseOutputSurface(int numTimes);
140 141
141 void setNeedsAnimate(); 142 void setNeedsAnimate();
142 // virtual for testing 143 // virtual for testing
143 virtual void setNeedsCommit(); 144 virtual void setNeedsCommit();
144 virtual void setNeedsFullTreeSync(); 145 virtual void setNeedsFullTreeSync();
145 void setNeedsRedraw(); 146 void setNeedsRedraw();
146 bool commitRequested() const; 147 bool commitRequested() const;
147 148
148 void setAnimationEvents(scoped_ptr<AnimationEventsVector>, base::Time wallCl ockTime); 149 void setAnimationEvents(scoped_ptr<AnimationEventsVector>, base::Time wallCl ockTime);
149 virtual void didAddAnimation();
150 150
151 Layer* rootLayer() { return m_rootLayer.get(); } 151 Layer* rootLayer() { return m_rootLayer.get(); }
152 const Layer* rootLayer() const { return m_rootLayer.get(); } 152 const Layer* rootLayer() const { return m_rootLayer.get(); }
153 void setRootLayer(scoped_refptr<Layer>); 153 void setRootLayer(scoped_refptr<Layer>);
154 154
155 const LayerTreeSettings& settings() const { return m_settings; } 155 const LayerTreeSettings& settings() const { return m_settings; }
156 156
157 void setDebugState(const LayerTreeDebugState& debugState); 157 void setDebugState(const LayerTreeDebugState& debugState);
158 const LayerTreeDebugState& debugState() const { return m_debugState; } 158 const LayerTreeDebugState& debugState() const { return m_debugState; }
159 159
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after
192 bool bufferedUpdates(); 192 bool bufferedUpdates();
193 bool requestPartialTextureUpdate(); 193 bool requestPartialTextureUpdate();
194 194
195 void setDeviceScaleFactor(float); 195 void setDeviceScaleFactor(float);
196 float deviceScaleFactor() const { return m_deviceScaleFactor; } 196 float deviceScaleFactor() const { return m_deviceScaleFactor; }
197 197
198 HeadsUpDisplayLayer* hudLayer() const { return m_hudLayer.get(); } 198 HeadsUpDisplayLayer* hudLayer() const { return m_hudLayer.get(); }
199 199
200 Proxy* proxy() const { return m_proxy.get(); } 200 Proxy* proxy() const { return m_proxy.get(); }
201 201
202 AnimationRegistrar* animationRegistrar() const { return m_animationRegistrar .get(); }
203
202 protected: 204 protected:
203 LayerTreeHost(LayerTreeHostClient*, const LayerTreeSettings&); 205 LayerTreeHost(LayerTreeHostClient*, const LayerTreeSettings&);
204 bool initialize(scoped_ptr<Thread> implThread); 206 bool initialize(scoped_ptr<Thread> implThread);
205 bool initializeForTesting(scoped_ptr<Proxy> proxyForTesting); 207 bool initializeForTesting(scoped_ptr<Proxy> proxyForTesting);
206 208
207 private: 209 private:
208 typedef std::vector<scoped_refptr<Layer> > LayerList; 210 typedef std::vector<scoped_refptr<Layer> > LayerList;
209 211
210 bool initializeProxy(scoped_ptr<Proxy> proxy); 212 bool initializeProxy(scoped_ptr<Proxy> proxy);
211 void initializeRenderer(); 213 void initializeRenderer();
212 214
213 void update(Layer*, ResourceUpdateQueue&, const OcclusionTracker*); 215 void update(Layer*, ResourceUpdateQueue&, const OcclusionTracker*);
214 bool paintLayerContents(const LayerList&, ResourceUpdateQueue&); 216 bool paintLayerContents(const LayerList&, ResourceUpdateQueue&);
215 bool paintMasksForRenderSurface(Layer*, ResourceUpdateQueue&); 217 bool paintMasksForRenderSurface(Layer*, ResourceUpdateQueue&);
216 218
217 void updateLayers(Layer*, ResourceUpdateQueue&); 219 void updateLayers(Layer*, ResourceUpdateQueue&);
218 void triggerPrepaint(); 220 void triggerPrepaint();
219 221
220 void prioritizeTextures(const LayerList&, OverdrawMetrics&); 222 void prioritizeTextures(const LayerList&, OverdrawMetrics&);
221 void setPrioritiesForSurfaces(size_t surfaceMemoryBytes); 223 void setPrioritiesForSurfaces(size_t surfaceMemoryBytes);
222 void setPrioritiesForLayers(const LayerList&); 224 void setPrioritiesForLayers(const LayerList&);
223 size_t calculateMemoryForRenderSurfaces(const LayerList& updateList); 225 size_t calculateMemoryForRenderSurfaces(const LayerList& updateList);
224 226
225 void animateLayers(base::TimeTicks monotonicTime); 227 void animateLayers(base::TimeTicks monotonicTime);
226 bool animateLayersRecursive(Layer* current, base::TimeTicks time); 228 bool animateLayersRecursive(Layer* current, base::TimeTicks time);
227 void setAnimationEventsRecursive(const AnimationEventsVector&, Layer*, base: :Time wallClockTime); 229 void setAnimationEventsRecursive(const AnimationEventsVector&, Layer*, base: :Time wallClockTime);
228 230
229 bool m_animating; 231 bool m_animating;
230 bool m_needsAnimateLayers;
231 bool m_needsFullTreeSync; 232 bool m_needsFullTreeSync;
232 233
233 base::CancelableClosure m_prepaintCallback; 234 base::CancelableClosure m_prepaintCallback;
234 235
235 LayerTreeHostClient* m_client; 236 LayerTreeHostClient* m_client;
236 scoped_ptr<Proxy> m_proxy; 237 scoped_ptr<Proxy> m_proxy;
237 238
238 int m_commitNumber; 239 int m_commitNumber;
239 RenderingStats m_renderingStats; 240 RenderingStats m_renderingStats;
240 241
(...skipping 24 matching lines...) Expand all
265 float m_minPageScaleFactor, m_maxPageScaleFactor; 266 float m_minPageScaleFactor, m_maxPageScaleFactor;
266 gfx::Transform m_implTransform; 267 gfx::Transform m_implTransform;
267 bool m_triggerIdleUpdates; 268 bool m_triggerIdleUpdates;
268 269
269 SkColor m_backgroundColor; 270 SkColor m_backgroundColor;
270 bool m_hasTransparentBackground; 271 bool m_hasTransparentBackground;
271 272
272 typedef ScopedPtrVector<PrioritizedResource> TextureList; 273 typedef ScopedPtrVector<PrioritizedResource> TextureList;
273 size_t m_partialTextureUpdateRequests; 274 size_t m_partialTextureUpdateRequests;
274 275
276 scoped_ptr<AnimationRegistrar> m_animationRegistrar;
277
275 static bool s_needsFilterContext; 278 static bool s_needsFilterContext;
276 279
277 DISALLOW_COPY_AND_ASSIGN(LayerTreeHost); 280 DISALLOW_COPY_AND_ASSIGN(LayerTreeHost);
278 }; 281 };
279 282
280 } // namespace cc 283 } // namespace cc
281 284
282 #endif // CC_LAYER_TREE_HOST_H_ 285 #endif // CC_LAYER_TREE_HOST_H_
OLDNEW
« no previous file with comments | « cc/layer_impl.cc ('k') | cc/layer_tree_host.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698