| 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 "config.h" | 5 #include "config.h" |
| 6 | 6 |
| 7 #if USE(ACCELERATED_COMPOSITING) | 7 #if USE(ACCELERATED_COMPOSITING) |
| 8 | 8 |
| 9 #include "CCLayerImpl.h" | 9 #include "CCLayerImpl.h" |
| 10 | 10 |
| (...skipping 19 matching lines...) Expand all Loading... |
| 30 , m_anchorPoint(0.5, 0.5) | 30 , m_anchorPoint(0.5, 0.5) |
| 31 , m_anchorPointZ(0) | 31 , m_anchorPointZ(0) |
| 32 , m_scrollable(false) | 32 , m_scrollable(false) |
| 33 , m_shouldScrollOnMainThread(false) | 33 , m_shouldScrollOnMainThread(false) |
| 34 , m_haveWheelEventHandlers(false) | 34 , m_haveWheelEventHandlers(false) |
| 35 , m_backgroundColor(0) | 35 , m_backgroundColor(0) |
| 36 , m_doubleSided(true) | 36 , m_doubleSided(true) |
| 37 , m_layerPropertyChanged(false) | 37 , m_layerPropertyChanged(false) |
| 38 , m_layerSurfacePropertyChanged(false) | 38 , m_layerSurfacePropertyChanged(false) |
| 39 , m_masksToBounds(false) | 39 , m_masksToBounds(false) |
| 40 , m_opaque(false) | 40 , m_contentsOpaque(false) |
| 41 , m_opacity(1.0) | 41 , m_opacity(1.0) |
| 42 , m_preserves3D(false) | 42 , m_preserves3D(false) |
| 43 , m_useParentBackfaceVisibility(false) | 43 , m_useParentBackfaceVisibility(false) |
| 44 , m_drawCheckerboardForMissingTiles(false) | 44 , m_drawCheckerboardForMissingTiles(false) |
| 45 , m_useLCDText(false) | 45 , m_useLCDText(false) |
| 46 , m_drawsContent(false) | 46 , m_drawsContent(false) |
| 47 , m_forceRenderSurface(false) | 47 , m_forceRenderSurface(false) |
| 48 , m_isContainerForFixedPositionLayers(false) | 48 , m_isContainerForFixedPositionLayers(false) |
| 49 , m_fixedToContainerLayer(false) | 49 , m_fixedToContainerLayer(false) |
| 50 , m_pageScaleDelta(1) | 50 , m_pageScaleDelta(1) |
| (...skipping 66 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 117 { | 117 { |
| 118 for (size_t i = 0; i < m_children.size(); ++i) { | 118 for (size_t i = 0; i < m_children.size(); ++i) { |
| 119 if (m_children[i]->drawsContent() || m_children[i]->descendantDrawsConte
nt()) | 119 if (m_children[i]->drawsContent() || m_children[i]->descendantDrawsConte
nt()) |
| 120 return true; | 120 return true; |
| 121 } | 121 } |
| 122 return false; | 122 return false; |
| 123 } | 123 } |
| 124 | 124 |
| 125 scoped_ptr<CCSharedQuadState> CCLayerImpl::createSharedQuadState() const | 125 scoped_ptr<CCSharedQuadState> CCLayerImpl::createSharedQuadState() const |
| 126 { | 126 { |
| 127 return CCSharedQuadState::create(m_drawTransform, m_visibleContentRect, m_dr
awableContentRect, m_drawOpacity, m_opaque); | 127 return CCSharedQuadState::create(m_drawTransform, m_visibleContentRect, m_dr
awableContentRect, m_drawOpacity, m_contentsOpaque); |
| 128 } | 128 } |
| 129 | 129 |
| 130 void CCLayerImpl::willDraw(CCResourceProvider*) | 130 void CCLayerImpl::willDraw(CCResourceProvider*) |
| 131 { | 131 { |
| 132 #ifndef NDEBUG | 132 #ifndef NDEBUG |
| 133 // willDraw/didDraw must be matched. | 133 // willDraw/didDraw must be matched. |
| 134 ASSERT(!m_betweenWillDrawAndDidDraw); | 134 ASSERT(!m_betweenWillDrawAndDidDraw); |
| 135 m_betweenWillDrawAndDidDraw = true; | 135 m_betweenWillDrawAndDidDraw = true; |
| 136 #endif | 136 #endif |
| 137 } | 137 } |
| (...skipping 347 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 485 | 485 |
| 486 void CCLayerImpl::setMasksToBounds(bool masksToBounds) | 486 void CCLayerImpl::setMasksToBounds(bool masksToBounds) |
| 487 { | 487 { |
| 488 if (m_masksToBounds == masksToBounds) | 488 if (m_masksToBounds == masksToBounds) |
| 489 return; | 489 return; |
| 490 | 490 |
| 491 m_masksToBounds = masksToBounds; | 491 m_masksToBounds = masksToBounds; |
| 492 noteLayerPropertyChangedForSubtree(); | 492 noteLayerPropertyChangedForSubtree(); |
| 493 } | 493 } |
| 494 | 494 |
| 495 void CCLayerImpl::setOpaque(bool opaque) | 495 void CCLayerImpl::setContentsOpaque(bool opaque) |
| 496 { | 496 { |
| 497 if (m_opaque == opaque) | 497 if (m_contentsOpaque == opaque) |
| 498 return; | 498 return; |
| 499 | 499 |
| 500 m_opaque = opaque; | 500 m_contentsOpaque = opaque; |
| 501 noteLayerPropertyChangedForSubtree(); | 501 noteLayerPropertyChangedForSubtree(); |
| 502 } | 502 } |
| 503 | 503 |
| 504 void CCLayerImpl::setOpacity(float opacity) | 504 void CCLayerImpl::setOpacity(float opacity) |
| 505 { | 505 { |
| 506 if (m_opacity == opacity) | 506 if (m_opacity == opacity) |
| 507 return; | 507 return; |
| 508 | 508 |
| 509 m_opacity = opacity; | 509 m_opacity = opacity; |
| 510 m_layerSurfacePropertyChanged = true; | 510 m_layerSurfacePropertyChanged = true; |
| (...skipping 109 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 620 { | 620 { |
| 621 if (m_doubleSided == doubleSided) | 621 if (m_doubleSided == doubleSided) |
| 622 return; | 622 return; |
| 623 | 623 |
| 624 m_doubleSided = doubleSided; | 624 m_doubleSided = doubleSided; |
| 625 noteLayerPropertyChangedForSubtree(); | 625 noteLayerPropertyChangedForSubtree(); |
| 626 } | 626 } |
| 627 | 627 |
| 628 Region CCLayerImpl::visibleContentOpaqueRegion() const | 628 Region CCLayerImpl::visibleContentOpaqueRegion() const |
| 629 { | 629 { |
| 630 if (opaque()) | 630 if (contentsOpaque()) |
| 631 return visibleContentRect(); | 631 return visibleContentRect(); |
| 632 return Region(); | 632 return Region(); |
| 633 } | 633 } |
| 634 | 634 |
| 635 void CCLayerImpl::didLoseContext() | 635 void CCLayerImpl::didLoseContext() |
| 636 { | 636 { |
| 637 } | 637 } |
| 638 | 638 |
| 639 void CCLayerImpl::setMaxScrollPosition(const IntSize& maxScrollPosition) | 639 void CCLayerImpl::setMaxScrollPosition(const IntSize& maxScrollPosition) |
| 640 { | 640 { |
| (...skipping 27 matching lines...) Expand all Loading... |
| 668 if (!m_scrollbarAnimationController) | 668 if (!m_scrollbarAnimationController) |
| 669 m_scrollbarAnimationController = CCScrollbarAnimationController::create(
this); | 669 m_scrollbarAnimationController = CCScrollbarAnimationController::create(
this); |
| 670 m_scrollbarAnimationController->setVerticalScrollbarLayer(scrollbarLayer); | 670 m_scrollbarAnimationController->setVerticalScrollbarLayer(scrollbarLayer); |
| 671 m_scrollbarAnimationController->updateScrollOffset(this); | 671 m_scrollbarAnimationController->updateScrollOffset(this); |
| 672 } | 672 } |
| 673 | 673 |
| 674 } | 674 } |
| 675 | 675 |
| 676 | 676 |
| 677 #endif // USE(ACCELERATED_COMPOSITING) | 677 #endif // USE(ACCELERATED_COMPOSITING) |
| OLD | NEW |