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 #include "cc/layer_impl.h" | 5 #include "cc/layer_impl.h" |
6 | 6 |
7 #include "base/debug/trace_event.h" | 7 #include "base/debug/trace_event.h" |
8 #include "base/stringprintf.h" | 8 #include "base/stringprintf.h" |
9 #include "base/values.h" | 9 #include "base/values.h" |
10 #include "cc/animation_registrar.h" | 10 #include "cc/animation_registrar.h" |
(...skipping 30 matching lines...) Expand all Loading... |
41 , m_layerPropertyChanged(false) | 41 , m_layerPropertyChanged(false) |
42 , m_layerSurfacePropertyChanged(false) | 42 , m_layerSurfacePropertyChanged(false) |
43 , m_masksToBounds(false) | 43 , m_masksToBounds(false) |
44 , m_contentsOpaque(false) | 44 , m_contentsOpaque(false) |
45 , m_opacity(1.0) | 45 , m_opacity(1.0) |
46 , m_preserves3D(false) | 46 , m_preserves3D(false) |
47 , m_useParentBackfaceVisibility(false) | 47 , m_useParentBackfaceVisibility(false) |
48 , m_drawCheckerboardForMissingTiles(false) | 48 , m_drawCheckerboardForMissingTiles(false) |
49 , m_drawsContent(false) | 49 , m_drawsContent(false) |
50 , m_forceRenderSurface(false) | 50 , m_forceRenderSurface(false) |
| 51 , m_visible(true) |
51 , m_isContainerForFixedPositionLayers(false) | 52 , m_isContainerForFixedPositionLayers(false) |
52 , m_fixedToContainerLayer(false) | 53 , m_fixedToContainerLayer(false) |
53 , m_drawDepth(0) | 54 , m_drawDepth(0) |
54 #ifndef NDEBUG | 55 #ifndef NDEBUG |
55 , m_betweenWillDrawAndDidDraw(false) | 56 , m_betweenWillDrawAndDidDraw(false) |
56 #endif | 57 #endif |
57 , m_horizontalScrollbarLayer(0) | 58 , m_horizontalScrollbarLayer(0) |
58 , m_verticalScrollbarLayer(0) | 59 , m_verticalScrollbarLayer(0) |
59 { | 60 { |
60 DCHECK(m_layerId > 0); | 61 DCHECK(m_layerId > 0); |
(...skipping 261 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
322 layer->setAnchorPointZ(m_anchorPointZ); | 323 layer->setAnchorPointZ(m_anchorPointZ); |
323 layer->setBackgroundColor(m_backgroundColor); | 324 layer->setBackgroundColor(m_backgroundColor); |
324 layer->setBounds(m_bounds); | 325 layer->setBounds(m_bounds); |
325 layer->setContentBounds(contentBounds()); | 326 layer->setContentBounds(contentBounds()); |
326 layer->setContentsScale(contentsScaleX(), contentsScaleY()); | 327 layer->setContentsScale(contentsScaleX(), contentsScaleY()); |
327 layer->setDebugName(m_debugName); | 328 layer->setDebugName(m_debugName); |
328 layer->setDoubleSided(m_doubleSided); | 329 layer->setDoubleSided(m_doubleSided); |
329 layer->setDrawCheckerboardForMissingTiles(m_drawCheckerboardForMissingTiles)
; | 330 layer->setDrawCheckerboardForMissingTiles(m_drawCheckerboardForMissingTiles)
; |
330 layer->setForceRenderSurface(m_forceRenderSurface); | 331 layer->setForceRenderSurface(m_forceRenderSurface); |
331 layer->setDrawsContent(drawsContent()); | 332 layer->setDrawsContent(drawsContent()); |
| 333 layer->setVisible(visible()); |
332 layer->setFilters(filters()); | 334 layer->setFilters(filters()); |
333 layer->setFilter(filter()); | 335 layer->setFilter(filter()); |
334 layer->setBackgroundFilters(backgroundFilters()); | 336 layer->setBackgroundFilters(backgroundFilters()); |
335 layer->setMasksToBounds(m_masksToBounds); | 337 layer->setMasksToBounds(m_masksToBounds); |
336 layer->setShouldScrollOnMainThread(m_shouldScrollOnMainThread); | 338 layer->setShouldScrollOnMainThread(m_shouldScrollOnMainThread); |
337 layer->setHaveWheelEventHandlers(m_haveWheelEventHandlers); | 339 layer->setHaveWheelEventHandlers(m_haveWheelEventHandlers); |
338 layer->setNonFastScrollableRegion(m_nonFastScrollableRegion); | 340 layer->setNonFastScrollableRegion(m_nonFastScrollableRegion); |
339 layer->setTouchEventHandlerRegion(m_touchEventHandlerRegion); | 341 layer->setTouchEventHandlerRegion(m_touchEventHandlerRegion); |
340 layer->setContentsOpaque(m_contentsOpaque); | 342 layer->setContentsOpaque(m_contentsOpaque); |
341 if (!opacityIsAnimating()) | 343 if (!opacityIsAnimating()) |
(...skipping 295 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
637 | 639 |
638 void LayerImpl::setDrawsContent(bool drawsContent) | 640 void LayerImpl::setDrawsContent(bool drawsContent) |
639 { | 641 { |
640 if (m_drawsContent == drawsContent) | 642 if (m_drawsContent == drawsContent) |
641 return; | 643 return; |
642 | 644 |
643 m_drawsContent = drawsContent; | 645 m_drawsContent = drawsContent; |
644 noteLayerPropertyChanged(); | 646 noteLayerPropertyChanged(); |
645 } | 647 } |
646 | 648 |
| 649 void LayerImpl::setVisible(bool visible) |
| 650 { |
| 651 if (m_visible == visible) |
| 652 return; |
| 653 |
| 654 m_visible = visible; |
| 655 noteLayerSurfacePropertyChanged(); |
| 656 } |
| 657 |
647 void LayerImpl::setAnchorPoint(const gfx::PointF& anchorPoint) | 658 void LayerImpl::setAnchorPoint(const gfx::PointF& anchorPoint) |
648 { | 659 { |
649 if (m_anchorPoint == anchorPoint) | 660 if (m_anchorPoint == anchorPoint) |
650 return; | 661 return; |
651 | 662 |
652 m_anchorPoint = anchorPoint; | 663 m_anchorPoint = anchorPoint; |
653 noteLayerPropertyChangedForSubtree(); | 664 noteLayerPropertyChangedForSubtree(); |
654 } | 665 } |
655 | 666 |
656 void LayerImpl::setAnchorPointZ(float anchorPointZ) | 667 void LayerImpl::setAnchorPointZ(float anchorPointZ) |
(...skipping 300 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
957 } | 968 } |
958 | 969 |
959 void LayerImpl::setVerticalScrollbarLayer(ScrollbarLayerImpl* scrollbarLayer) | 970 void LayerImpl::setVerticalScrollbarLayer(ScrollbarLayerImpl* scrollbarLayer) |
960 { | 971 { |
961 m_verticalScrollbarLayer = scrollbarLayer; | 972 m_verticalScrollbarLayer = scrollbarLayer; |
962 if (m_verticalScrollbarLayer) | 973 if (m_verticalScrollbarLayer) |
963 m_verticalScrollbarLayer->setScrollLayerId(id()); | 974 m_verticalScrollbarLayer->setScrollLayerId(id()); |
964 } | 975 } |
965 | 976 |
966 } // namespace cc | 977 } // namespace cc |
OLD | NEW |