| 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 23 matching lines...) Expand all Loading... |
| 34 : m_needsDisplay(false) | 34 : m_needsDisplay(false) |
| 35 , m_stackingOrderChanged(false) | 35 , m_stackingOrderChanged(false) |
| 36 , m_layerId(s_nextLayerId++) | 36 , m_layerId(s_nextLayerId++) |
| 37 , m_parent(0) | 37 , m_parent(0) |
| 38 , m_layerTreeHost(0) | 38 , m_layerTreeHost(0) |
| 39 , m_layerAnimationController(LayerAnimationController::create(this)) | 39 , m_layerAnimationController(LayerAnimationController::create(this)) |
| 40 , m_scrollable(false) | 40 , m_scrollable(false) |
| 41 , m_shouldScrollOnMainThread(false) | 41 , m_shouldScrollOnMainThread(false) |
| 42 , m_haveWheelEventHandlers(false) | 42 , m_haveWheelEventHandlers(false) |
| 43 , m_nonFastScrollableRegionChanged(false) | 43 , m_nonFastScrollableRegionChanged(false) |
| 44 , m_touchEventHandlerRegionChanged(false) |
| 44 , m_anchorPoint(0.5, 0.5) | 45 , m_anchorPoint(0.5, 0.5) |
| 45 , m_backgroundColor(0) | 46 , m_backgroundColor(0) |
| 46 , m_debugBorderColor(0) | 47 , m_debugBorderColor(0) |
| 47 , m_debugBorderWidth(0) | 48 , m_debugBorderWidth(0) |
| 48 , m_opacity(1.0) | 49 , m_opacity(1.0) |
| 49 , m_filter(0) | 50 , m_filter(0) |
| 50 , m_anchorPointZ(0) | 51 , m_anchorPointZ(0) |
| 51 , m_isContainerForFixedPositionLayers(false) | 52 , m_isContainerForFixedPositionLayers(false) |
| 52 , m_fixedToContainerLayer(false) | 53 , m_fixedToContainerLayer(false) |
| 53 , m_isDrawable(false) | 54 , m_isDrawable(false) |
| (...skipping 398 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 452 | 453 |
| 453 void Layer::setNonFastScrollableRegion(const Region& region) | 454 void Layer::setNonFastScrollableRegion(const Region& region) |
| 454 { | 455 { |
| 455 if (m_nonFastScrollableRegion == region) | 456 if (m_nonFastScrollableRegion == region) |
| 456 return; | 457 return; |
| 457 m_nonFastScrollableRegion = region; | 458 m_nonFastScrollableRegion = region; |
| 458 m_nonFastScrollableRegionChanged = true; | 459 m_nonFastScrollableRegionChanged = true; |
| 459 setNeedsCommit(); | 460 setNeedsCommit(); |
| 460 } | 461 } |
| 461 | 462 |
| 463 void Layer::setTouchEventHandlerRegion(const Region& region) |
| 464 { |
| 465 if (m_touchEventHandlerRegion == region) |
| 466 return; |
| 467 m_touchEventHandlerRegion = region; |
| 468 m_touchEventHandlerRegionChanged = true; |
| 469 } |
| 470 |
| 462 void Layer::setDrawCheckerboardForMissingTiles(bool checkerboard) | 471 void Layer::setDrawCheckerboardForMissingTiles(bool checkerboard) |
| 463 { | 472 { |
| 464 if (m_drawCheckerboardForMissingTiles == checkerboard) | 473 if (m_drawCheckerboardForMissingTiles == checkerboard) |
| 465 return; | 474 return; |
| 466 m_drawCheckerboardForMissingTiles = checkerboard; | 475 m_drawCheckerboardForMissingTiles = checkerboard; |
| 467 setNeedsCommit(); | 476 setNeedsCommit(); |
| 468 } | 477 } |
| 469 | 478 |
| 470 void Layer::setForceRenderSurface(bool force) | 479 void Layer::setForceRenderSurface(bool force) |
| 471 { | 480 { |
| (...skipping 100 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 572 layer->setMasksToBounds(m_masksToBounds); | 581 layer->setMasksToBounds(m_masksToBounds); |
| 573 layer->setScrollable(m_scrollable); | 582 layer->setScrollable(m_scrollable); |
| 574 layer->setShouldScrollOnMainThread(m_shouldScrollOnMainThread); | 583 layer->setShouldScrollOnMainThread(m_shouldScrollOnMainThread); |
| 575 layer->setHaveWheelEventHandlers(m_haveWheelEventHandlers); | 584 layer->setHaveWheelEventHandlers(m_haveWheelEventHandlers); |
| 576 // Copying a Region is more expensive than most layer properties, since it i
nvolves copying two Vectors that may be | 585 // Copying a Region is more expensive than most layer properties, since it i
nvolves copying two Vectors that may be |
| 577 // arbitrarily large depending on page content, so we only push the property
if it's changed. | 586 // arbitrarily large depending on page content, so we only push the property
if it's changed. |
| 578 if (m_nonFastScrollableRegionChanged) { | 587 if (m_nonFastScrollableRegionChanged) { |
| 579 layer->setNonFastScrollableRegion(m_nonFastScrollableRegion); | 588 layer->setNonFastScrollableRegion(m_nonFastScrollableRegion); |
| 580 m_nonFastScrollableRegionChanged = false; | 589 m_nonFastScrollableRegionChanged = false; |
| 581 } | 590 } |
| 591 if (m_touchEventHandlerRegionChanged) { |
| 592 layer->setTouchEventHandlerRegion(m_touchEventHandlerRegion); |
| 593 m_touchEventHandlerRegionChanged = false; |
| 594 } |
| 582 layer->setContentsOpaque(m_contentsOpaque); | 595 layer->setContentsOpaque(m_contentsOpaque); |
| 583 if (!opacityIsAnimating()) | 596 if (!opacityIsAnimating()) |
| 584 layer->setOpacity(m_opacity); | 597 layer->setOpacity(m_opacity); |
| 585 layer->setPosition(m_position); | 598 layer->setPosition(m_position); |
| 586 layer->setIsContainerForFixedPositionLayers(m_isContainerForFixedPositionLay
ers); | 599 layer->setIsContainerForFixedPositionLayers(m_isContainerForFixedPositionLay
ers); |
| 587 layer->setFixedToContainerLayer(m_fixedToContainerLayer); | 600 layer->setFixedToContainerLayer(m_fixedToContainerLayer); |
| 588 layer->setPreserves3D(preserves3D()); | 601 layer->setPreserves3D(preserves3D()); |
| 589 layer->setUseParentBackfaceVisibility(m_useParentBackfaceVisibility); | 602 layer->setUseParentBackfaceVisibility(m_useParentBackfaceVisibility); |
| 590 layer->setScrollPosition(m_scrollPosition); | 603 layer->setScrollPosition(m_scrollPosition); |
| 591 layer->setMaxScrollPosition(m_maxScrollPosition); | 604 layer->setMaxScrollPosition(m_maxScrollPosition); |
| (...skipping 246 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 838 { | 851 { |
| 839 return 0; | 852 return 0; |
| 840 } | 853 } |
| 841 | 854 |
| 842 void sortLayers(std::vector<scoped_refptr<Layer> >::iterator, std::vector<scoped
_refptr<Layer> >::iterator, void*) | 855 void sortLayers(std::vector<scoped_refptr<Layer> >::iterator, std::vector<scoped
_refptr<Layer> >::iterator, void*) |
| 843 { | 856 { |
| 844 // Currently we don't use z-order to decide what to paint, so there's no nee
d to actually sort Layers. | 857 // Currently we don't use z-order to decide what to paint, so there's no nee
d to actually sort Layers. |
| 845 } | 858 } |
| 846 | 859 |
| 847 } | 860 } |
| OLD | NEW |