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

Side by Side Diff: cc/layer.h

Issue 11659004: Add support for tagging layers. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: exposing enum in cc. 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 | « no previous file | cc/layer.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 2010 The Chromium Authors. All rights reserved. 1 // Copyright 2010 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_H_ 5 #ifndef CC_LAYER_H_
6 #define CC_LAYER_H_ 6 #define CC_LAYER_H_
7 7
8 #include <string> 8 #include <string>
9 #include <vector> 9 #include <vector>
10 10
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after
45 struct AnimationEvent; 45 struct AnimationEvent;
46 struct RenderingStats; 46 struct RenderingStats;
47 47
48 // Base class for composited layers. Special layer types are derived from 48 // Base class for composited layers. Special layer types are derived from
49 // this class. 49 // this class.
50 class CC_EXPORT Layer : public base::RefCounted<Layer>, 50 class CC_EXPORT Layer : public base::RefCounted<Layer>,
51 public LayerAnimationValueObserver { 51 public LayerAnimationValueObserver {
52 public: 52 public:
53 typedef std::vector<scoped_refptr<Layer> > LayerList; 53 typedef std::vector<scoped_refptr<Layer> > LayerList;
54 54
55 enum Tag {
56 kTagNone = 0x00,
57 kTagNonCompositedContentHost = 0x01,
58 kTagIgnoreForContinuousRepaints = 0x02,
59 };
60
55 static scoped_refptr<Layer> create(); 61 static scoped_refptr<Layer> create();
56 62
57 int id() const; 63 int id() const;
58 64
59 Layer* rootLayer(); 65 Layer* rootLayer();
60 Layer* parent() { return m_parent; } 66 Layer* parent() { return m_parent; }
61 const Layer* parent() const { return m_parent; } 67 const Layer* parent() const { return m_parent; }
62 void addChild(scoped_refptr<Layer>); 68 void addChild(scoped_refptr<Layer>);
63 void insertChild(scoped_refptr<Layer>, size_t index); 69 void insertChild(scoped_refptr<Layer>, size_t index);
64 void replaceChild(Layer* reference, scoped_refptr<Layer> newLayer); 70 void replaceChild(Layer* reference, scoped_refptr<Layer> newLayer);
(...skipping 212 matching lines...) Expand 10 before | Expand all | Expand 10 after
277 283
278 void addLayerAnimationEventObserver(LayerAnimationEventObserver* animationOb server); 284 void addLayerAnimationEventObserver(LayerAnimationEventObserver* animationOb server);
279 void removeLayerAnimationEventObserver(LayerAnimationEventObserver* animatio nObserver); 285 void removeLayerAnimationEventObserver(LayerAnimationEventObserver* animatio nObserver);
280 286
281 virtual Region visibleContentOpaqueRegion() const; 287 virtual Region visibleContentOpaqueRegion() const;
282 288
283 virtual ScrollbarLayer* toScrollbarLayer(); 289 virtual ScrollbarLayer* toScrollbarLayer();
284 290
285 gfx::Rect layerRectToContentRect(const gfx::RectF& layerRect) const; 291 gfx::Rect layerRectToContentRect(const gfx::RectF& layerRect) const;
286 292
293 void setTags(unsigned int tags);
294 unsigned int getTags() const;
295 void addTag(Tag tag);
296 bool getTag(Tag tag) const;
297
287 // In impl-side painting, this returns true if this layer type is not 298 // In impl-side painting, this returns true if this layer type is not
288 // compatible with the main thread running freely, such as a double-buffered 299 // compatible with the main thread running freely, such as a double-buffered
289 // canvas that doesn't want to be triple-buffered across all three trees. 300 // canvas that doesn't want to be triple-buffered across all three trees.
290 virtual bool blocksPendingCommit() const; 301 virtual bool blocksPendingCommit() const;
291 302
292 protected: 303 protected:
293 friend class LayerImpl; 304 friend class LayerImpl;
294 friend class TreeSynchronizer; 305 friend class TreeSynchronizer;
295 virtual ~Layer(); 306 virtual ~Layer();
296 307
(...skipping 97 matching lines...) Expand 10 before | Expand all | Expand 10 after
394 float m_rasterScale; 405 float m_rasterScale;
395 bool m_automaticallyComputeRasterScale; 406 bool m_automaticallyComputeRasterScale;
396 bool m_boundsContainPageScale; 407 bool m_boundsContainPageScale;
397 408
398 gfx::Transform m_implTransform; 409 gfx::Transform m_implTransform;
399 410
400 WebKit::WebAnimationDelegate* m_layerAnimationDelegate; 411 WebKit::WebAnimationDelegate* m_layerAnimationDelegate;
401 WebKit::WebLayerScrollClient* m_layerScrollClient; 412 WebKit::WebLayerScrollClient* m_layerScrollClient;
402 413
403 DrawProperties<Layer, RenderSurface> m_drawProperties; 414 DrawProperties<Layer, RenderSurface> m_drawProperties;
415
416 unsigned int m_tags;
404 }; 417 };
405 418
406 void sortLayers(std::vector<scoped_refptr<Layer> >::iterator, std::vector<scoped _refptr<Layer> >::iterator, void*); 419 void sortLayers(std::vector<scoped_refptr<Layer> >::iterator, std::vector<scoped _refptr<Layer> >::iterator, void*);
407 420
408 } // namespace cc 421 } // namespace cc
409 422
410 #endif // CC_LAYER_H_ 423 #endif // CC_LAYER_H_
OLDNEW
« no previous file with comments | « no previous file | cc/layer.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698