| 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 #if USE(ACCELERATED_COMPOSITING) | 7 #if USE(ACCELERATED_COMPOSITING) |
| 8 #include "LayerChromium.h" | 8 #include "LayerChromium.h" |
| 9 | 9 |
| 10 #include "CCActiveAnimation.h" | 10 #include "CCActiveAnimation.h" |
| (...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 43 , m_anchorPoint(0.5, 0.5) | 43 , m_anchorPoint(0.5, 0.5) |
| 44 , m_backgroundColor(0) | 44 , m_backgroundColor(0) |
| 45 , m_debugBorderColor(0) | 45 , m_debugBorderColor(0) |
| 46 , m_debugBorderWidth(0) | 46 , m_debugBorderWidth(0) |
| 47 , m_opacity(1.0) | 47 , m_opacity(1.0) |
| 48 , m_anchorPointZ(0) | 48 , m_anchorPointZ(0) |
| 49 , m_isContainerForFixedPositionLayers(false) | 49 , m_isContainerForFixedPositionLayers(false) |
| 50 , m_fixedToContainerLayer(false) | 50 , m_fixedToContainerLayer(false) |
| 51 , m_isDrawable(false) | 51 , m_isDrawable(false) |
| 52 , m_masksToBounds(false) | 52 , m_masksToBounds(false) |
| 53 , m_opaque(false) | 53 , m_contentsOpaque(false) |
| 54 , m_doubleSided(true) | 54 , m_doubleSided(true) |
| 55 , m_useLCDText(false) | 55 , m_useLCDText(false) |
| 56 , m_preserves3D(false) | 56 , m_preserves3D(false) |
| 57 , m_useParentBackfaceVisibility(false) | 57 , m_useParentBackfaceVisibility(false) |
| 58 , m_drawCheckerboardForMissingTiles(false) | 58 , m_drawCheckerboardForMissingTiles(false) |
| 59 , m_forceRenderSurface(false) | 59 , m_forceRenderSurface(false) |
| 60 , m_replicaLayer(0) | 60 , m_replicaLayer(0) |
| 61 , m_drawOpacity(0) | 61 , m_drawOpacity(0) |
| 62 , m_drawOpacityIsAnimating(false) | 62 , m_drawOpacityIsAnimating(false) |
| 63 , m_renderTarget(0) | 63 , m_renderTarget(0) |
| (...skipping 277 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 341 return; | 341 return; |
| 342 m_opacity = opacity; | 342 m_opacity = opacity; |
| 343 setNeedsCommit(); | 343 setNeedsCommit(); |
| 344 } | 344 } |
| 345 | 345 |
| 346 bool LayerChromium::opacityIsAnimating() const | 346 bool LayerChromium::opacityIsAnimating() const |
| 347 { | 347 { |
| 348 return m_layerAnimationController->isAnimatingProperty(CCActiveAnimation::Op
acity); | 348 return m_layerAnimationController->isAnimatingProperty(CCActiveAnimation::Op
acity); |
| 349 } | 349 } |
| 350 | 350 |
| 351 void LayerChromium::setOpaque(bool opaque) | 351 void LayerChromium::setContentsOpaque(bool opaque) |
| 352 { | 352 { |
| 353 if (m_opaque == opaque) | 353 if (m_contentsOpaque == opaque) |
| 354 return; | 354 return; |
| 355 m_opaque = opaque; | 355 m_contentsOpaque = opaque; |
| 356 setNeedsDisplay(); | 356 setNeedsDisplay(); |
| 357 } | 357 } |
| 358 | 358 |
| 359 void LayerChromium::setPosition(const FloatPoint& position) | 359 void LayerChromium::setPosition(const FloatPoint& position) |
| 360 { | 360 { |
| 361 if (m_position == position) | 361 if (m_position == position) |
| 362 return; | 362 return; |
| 363 m_position = position; | 363 m_position = position; |
| 364 setNeedsCommit(); | 364 setNeedsCommit(); |
| 365 } | 365 } |
| (...skipping 172 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 538 layer->setMasksToBounds(m_masksToBounds); | 538 layer->setMasksToBounds(m_masksToBounds); |
| 539 layer->setScrollable(m_scrollable); | 539 layer->setScrollable(m_scrollable); |
| 540 layer->setShouldScrollOnMainThread(m_shouldScrollOnMainThread); | 540 layer->setShouldScrollOnMainThread(m_shouldScrollOnMainThread); |
| 541 layer->setHaveWheelEventHandlers(m_haveWheelEventHandlers); | 541 layer->setHaveWheelEventHandlers(m_haveWheelEventHandlers); |
| 542 // Copying a Region is more expensive than most layer properties, since it i
nvolves copying two Vectors that may be | 542 // Copying a Region is more expensive than most layer properties, since it i
nvolves copying two Vectors that may be |
| 543 // arbitrarily large depending on page content, so we only push the property
if it's changed. | 543 // arbitrarily large depending on page content, so we only push the property
if it's changed. |
| 544 if (m_nonFastScrollableRegionChanged) { | 544 if (m_nonFastScrollableRegionChanged) { |
| 545 layer->setNonFastScrollableRegion(m_nonFastScrollableRegion); | 545 layer->setNonFastScrollableRegion(m_nonFastScrollableRegion); |
| 546 m_nonFastScrollableRegionChanged = false; | 546 m_nonFastScrollableRegionChanged = false; |
| 547 } | 547 } |
| 548 layer->setOpaque(m_opaque); | 548 layer->setContentsOpaque(m_contentsOpaque); |
| 549 if (!opacityIsAnimating()) | 549 if (!opacityIsAnimating()) |
| 550 layer->setOpacity(m_opacity); | 550 layer->setOpacity(m_opacity); |
| 551 layer->setPosition(m_position); | 551 layer->setPosition(m_position); |
| 552 layer->setIsContainerForFixedPositionLayers(m_isContainerForFixedPositionLay
ers); | 552 layer->setIsContainerForFixedPositionLayers(m_isContainerForFixedPositionLay
ers); |
| 553 layer->setFixedToContainerLayer(m_fixedToContainerLayer); | 553 layer->setFixedToContainerLayer(m_fixedToContainerLayer); |
| 554 layer->setPreserves3D(preserves3D()); | 554 layer->setPreserves3D(preserves3D()); |
| 555 layer->setUseParentBackfaceVisibility(m_useParentBackfaceVisibility); | 555 layer->setUseParentBackfaceVisibility(m_useParentBackfaceVisibility); |
| 556 layer->setScrollPosition(m_scrollPosition); | 556 layer->setScrollPosition(m_scrollPosition); |
| 557 layer->setMaxScrollPosition(m_maxScrollPosition); | 557 layer->setMaxScrollPosition(m_maxScrollPosition); |
| 558 layer->setSublayerTransform(m_sublayerTransform); | 558 layer->setSublayerTransform(m_sublayerTransform); |
| (...skipping 202 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 761 } | 761 } |
| 762 | 762 |
| 763 void LayerChromium::notifyAnimationFinished(double wallClockTime) | 763 void LayerChromium::notifyAnimationFinished(double wallClockTime) |
| 764 { | 764 { |
| 765 if (m_layerAnimationDelegate) | 765 if (m_layerAnimationDelegate) |
| 766 m_layerAnimationDelegate->notifyAnimationFinished(wallClockTime); | 766 m_layerAnimationDelegate->notifyAnimationFinished(wallClockTime); |
| 767 } | 767 } |
| 768 | 768 |
| 769 Region LayerChromium::visibleContentOpaqueRegion() const | 769 Region LayerChromium::visibleContentOpaqueRegion() const |
| 770 { | 770 { |
| 771 if (opaque()) | 771 if (contentsOpaque()) |
| 772 return visibleContentRect(); | 772 return visibleContentRect(); |
| 773 return Region(); | 773 return Region(); |
| 774 } | 774 } |
| 775 | 775 |
| 776 ScrollbarLayerChromium* LayerChromium::toScrollbarLayerChromium() | 776 ScrollbarLayerChromium* LayerChromium::toScrollbarLayerChromium() |
| 777 { | 777 { |
| 778 return 0; | 778 return 0; |
| 779 } | 779 } |
| 780 | 780 |
| 781 void sortLayers(Vector<RefPtr<LayerChromium> >::iterator, Vector<RefPtr<LayerChr
omium> >::iterator, void*) | 781 void sortLayers(Vector<RefPtr<LayerChromium> >::iterator, Vector<RefPtr<LayerChr
omium> >::iterator, void*) |
| 782 { | 782 { |
| 783 // Currently we don't use z-order to decide what to paint, so there's no nee
d to actually sort LayerChromiums. | 783 // Currently we don't use z-order to decide what to paint, so there's no nee
d to actually sort LayerChromiums. |
| 784 } | 784 } |
| 785 | 785 |
| 786 } | 786 } |
| 787 #endif // USE(ACCELERATED_COMPOSITING) | 787 #endif // USE(ACCELERATED_COMPOSITING) |
| OLD | NEW |