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

Side by Side Diff: cc/layer.cc

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 | « cc/layer.h ('k') | cc/layer_tree_host.h » ('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 #include "cc/layer.h" 5 #include "cc/layer.h"
6 6
7 #include "cc/active_animation.h" 7 #include "cc/active_animation.h"
8 #include "cc/animation_events.h" 8 #include "cc/animation_events.h"
9 #include "cc/layer_animation_controller.h" 9 #include "cc/layer_animation_controller.h"
10 #include "cc/layer_impl.h" 10 #include "cc/layer_impl.h"
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after
51 , m_preserves3D(false) 51 , m_preserves3D(false)
52 , m_useParentBackfaceVisibility(false) 52 , m_useParentBackfaceVisibility(false)
53 , m_drawCheckerboardForMissingTiles(false) 53 , m_drawCheckerboardForMissingTiles(false)
54 , m_forceRenderSurface(false) 54 , m_forceRenderSurface(false)
55 , m_replicaLayer(0) 55 , m_replicaLayer(0)
56 , m_rasterScale(1.0) 56 , m_rasterScale(1.0)
57 , m_automaticallyComputeRasterScale(false) 57 , m_automaticallyComputeRasterScale(false)
58 , m_boundsContainPageScale(false) 58 , m_boundsContainPageScale(false)
59 , m_layerAnimationDelegate(0) 59 , m_layerAnimationDelegate(0)
60 , m_layerScrollClient(0) 60 , m_layerScrollClient(0)
61 , m_tags(kTagNone)
61 { 62 {
62 if (m_layerId < 0) { 63 if (m_layerId < 0) {
63 s_nextLayerId = 1; 64 s_nextLayerId = 1;
64 m_layerId = s_nextLayerId++; 65 m_layerId = s_nextLayerId++;
65 } 66 }
66 67
67 m_layerAnimationController = LayerAnimationController::create(m_layerId); 68 m_layerAnimationController = LayerAnimationController::create(m_layerId);
68 m_layerAnimationController->addObserver(this); 69 m_layerAnimationController->addObserver(this);
69 addLayerAnimationEventObserver(m_layerAnimationController.get()); 70 addLayerAnimationEventObserver(m_layerAnimationController.get());
70 } 71 }
(...skipping 768 matching lines...) Expand 10 before | Expand all | Expand 10 after
839 if (contentsOpaque()) 840 if (contentsOpaque())
840 return visibleContentRect(); 841 return visibleContentRect();
841 return Region(); 842 return Region();
842 } 843 }
843 844
844 ScrollbarLayer* Layer::toScrollbarLayer() 845 ScrollbarLayer* Layer::toScrollbarLayer()
845 { 846 {
846 return 0; 847 return 0;
847 } 848 }
848 849
850 void Layer::setTags(unsigned int tags)
851 {
852 m_tags = tags;
853 }
854
855 unsigned int Layer::getTags() const
856 {
857 return m_tags;
858 }
859
860 void Layer::addTag(Tag tag)
861 {
862 m_tags |= tag;
863 }
864
865 bool Layer::getTag(Tag tag) const
866 {
867 return m_tags & tag;
868 }
869
849 void sortLayers(std::vector<scoped_refptr<Layer> >::iterator, std::vector<scoped _refptr<Layer> >::iterator, void*) 870 void sortLayers(std::vector<scoped_refptr<Layer> >::iterator, std::vector<scoped _refptr<Layer> >::iterator, void*)
850 { 871 {
851 // Currently we don't use z-order to decide what to paint, so there's no nee d to actually sort Layers. 872 // Currently we don't use z-order to decide what to paint, so there's no nee d to actually sort Layers.
852 } 873 }
853 874
854 } // namespace cc 875 } // namespace cc
OLDNEW
« no previous file with comments | « cc/layer.h ('k') | cc/layer_tree_host.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698