OLD | NEW |
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 "config.h" | 5 #include "config.h" |
6 | 6 |
7 #include "cc/layer.h" | 7 #include "cc/layer.h" |
8 | 8 |
9 #include "cc/active_animation.h" | 9 #include "cc/active_animation.h" |
10 #include "cc/animation_events.h" | 10 #include "cc/animation_events.h" |
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
48 , m_debugBorderWidth(0) | 48 , m_debugBorderWidth(0) |
49 , m_opacity(1.0) | 49 , m_opacity(1.0) |
50 , m_filter(0) | 50 , m_filter(0) |
51 , m_anchorPointZ(0) | 51 , m_anchorPointZ(0) |
52 , m_isContainerForFixedPositionLayers(false) | 52 , m_isContainerForFixedPositionLayers(false) |
53 , m_fixedToContainerLayer(false) | 53 , m_fixedToContainerLayer(false) |
54 , m_isDrawable(false) | 54 , m_isDrawable(false) |
55 , m_masksToBounds(false) | 55 , m_masksToBounds(false) |
56 , m_contentsOpaque(false) | 56 , m_contentsOpaque(false) |
57 , m_doubleSided(true) | 57 , m_doubleSided(true) |
58 , m_useLCDText(false) | 58 , m_canUseLCDText(false) |
59 , m_preserves3D(false) | 59 , m_preserves3D(false) |
60 , m_useParentBackfaceVisibility(false) | 60 , m_useParentBackfaceVisibility(false) |
61 , m_drawCheckerboardForMissingTiles(false) | 61 , m_drawCheckerboardForMissingTiles(false) |
62 , m_forceRenderSurface(false) | 62 , m_forceRenderSurface(false) |
63 , m_replicaLayer(0) | 63 , m_replicaLayer(0) |
64 , m_drawOpacity(0) | 64 , m_drawOpacity(0) |
65 , m_drawOpacityIsAnimating(false) | 65 , m_drawOpacityIsAnimating(false) |
| 66 , m_screenSpaceOpacityIsAnimating(false) |
66 , m_renderTarget(0) | 67 , m_renderTarget(0) |
67 , m_drawTransformIsAnimating(false) | 68 , m_drawTransformIsAnimating(false) |
68 , m_screenSpaceTransformIsAnimating(false) | 69 , m_screenSpaceTransformIsAnimating(false) |
69 , m_rasterScale(1.0) | 70 , m_rasterScale(1.0) |
70 , m_automaticallyComputeRasterScale(false) | 71 , m_automaticallyComputeRasterScale(false) |
71 , m_boundsContainPageScale(false) | 72 , m_boundsContainPageScale(false) |
72 , m_layerAnimationDelegate(0) | 73 , m_layerAnimationDelegate(0) |
73 , m_layerScrollClient(0) | 74 , m_layerScrollClient(0) |
74 { | 75 { |
75 if (m_layerId < 0) { | 76 if (m_layerId < 0) { |
76 s_nextLayerId = 1; | 77 s_nextLayerId = 1; |
77 m_layerId = s_nextLayerId++; | 78 m_layerId = s_nextLayerId++; |
78 } | 79 } |
79 } | 80 } |
80 | 81 |
81 Layer::~Layer() | 82 Layer::~Layer() |
82 { | 83 { |
83 // Our parent should be holding a reference to us so there should be no | 84 // Our parent should be holding a reference to us so there should be no |
84 // way for us to be destroyed while we still have a parent. | 85 // way for us to be destroyed while we still have a parent. |
85 DCHECK(!parent()); | 86 DCHECK(!parent()); |
86 | 87 |
87 // Remove the parent reference from all children. | 88 // Remove the parent reference from all children. |
88 removeAllChildren(); | 89 removeAllChildren(); |
89 | 90 |
90 SkSafeUnref(m_filter); | 91 SkSafeUnref(m_filter); |
91 } | 92 } |
92 | 93 |
93 void Layer::setUseLCDText(bool useLCDText) | 94 void Layer::setCanUseLCDText(bool useLCDText) |
94 { | 95 { |
95 m_useLCDText = useLCDText; | 96 m_canUseLCDText = useLCDText; |
96 } | 97 } |
97 | 98 |
98 void Layer::setLayerTreeHost(LayerTreeHost* host) | 99 void Layer::setLayerTreeHost(LayerTreeHost* host) |
99 { | 100 { |
100 if (m_layerTreeHost == host) | 101 if (m_layerTreeHost == host) |
101 return; | 102 return; |
102 | 103 |
103 m_layerTreeHost = host; | 104 m_layerTreeHost = host; |
104 | 105 |
105 for (size_t i = 0; i < m_children.size(); ++i) | 106 for (size_t i = 0; i < m_children.size(); ++i) |
(...skipping 464 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
570 layer->setDebugBorderColor(m_debugBorderColor); | 571 layer->setDebugBorderColor(m_debugBorderColor); |
571 layer->setDebugBorderWidth(m_debugBorderWidth); | 572 layer->setDebugBorderWidth(m_debugBorderWidth); |
572 layer->setDebugName(m_debugName); | 573 layer->setDebugName(m_debugName); |
573 layer->setDoubleSided(m_doubleSided); | 574 layer->setDoubleSided(m_doubleSided); |
574 layer->setDrawCheckerboardForMissingTiles(m_drawCheckerboardForMissingTiles)
; | 575 layer->setDrawCheckerboardForMissingTiles(m_drawCheckerboardForMissingTiles)
; |
575 layer->setForceRenderSurface(m_forceRenderSurface); | 576 layer->setForceRenderSurface(m_forceRenderSurface); |
576 layer->setDrawsContent(drawsContent()); | 577 layer->setDrawsContent(drawsContent()); |
577 layer->setFilters(filters()); | 578 layer->setFilters(filters()); |
578 layer->setFilter(filter()); | 579 layer->setFilter(filter()); |
579 layer->setBackgroundFilters(backgroundFilters()); | 580 layer->setBackgroundFilters(backgroundFilters()); |
580 layer->setUseLCDText(m_useLCDText); | 581 layer->setCanUseLCDText(m_canUseLCDText); |
581 layer->setMasksToBounds(m_masksToBounds); | 582 layer->setMasksToBounds(m_masksToBounds); |
582 layer->setScrollable(m_scrollable); | 583 layer->setScrollable(m_scrollable); |
583 layer->setShouldScrollOnMainThread(m_shouldScrollOnMainThread); | 584 layer->setShouldScrollOnMainThread(m_shouldScrollOnMainThread); |
584 layer->setHaveWheelEventHandlers(m_haveWheelEventHandlers); | 585 layer->setHaveWheelEventHandlers(m_haveWheelEventHandlers); |
585 // Copying a Region is more expensive than most layer properties, since it i
nvolves copying two Vectors that may be | 586 // Copying a Region is more expensive than most layer properties, since it i
nvolves copying two Vectors that may be |
586 // arbitrarily large depending on page content, so we only push the property
if it's changed. | 587 // arbitrarily large depending on page content, so we only push the property
if it's changed. |
587 if (m_nonFastScrollableRegionChanged) { | 588 if (m_nonFastScrollableRegionChanged) { |
588 layer->setNonFastScrollableRegion(m_nonFastScrollableRegion); | 589 layer->setNonFastScrollableRegion(m_nonFastScrollableRegion); |
589 m_nonFastScrollableRegionChanged = false; | 590 m_nonFastScrollableRegionChanged = false; |
590 } | 591 } |
(...skipping 260 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
851 { | 852 { |
852 return 0; | 853 return 0; |
853 } | 854 } |
854 | 855 |
855 void sortLayers(std::vector<scoped_refptr<Layer> >::iterator, std::vector<scoped
_refptr<Layer> >::iterator, void*) | 856 void sortLayers(std::vector<scoped_refptr<Layer> >::iterator, std::vector<scoped
_refptr<Layer> >::iterator, void*) |
856 { | 857 { |
857 // Currently we don't use z-order to decide what to paint, so there's no nee
d to actually sort Layers. | 858 // Currently we don't use z-order to decide what to paint, so there's no nee
d to actually sort Layers. |
858 } | 859 } |
859 | 860 |
860 } // namespace cc | 861 } // namespace cc |
OLD | NEW |