| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2006, 2007, 2008, 2009, 2010, 2011, 2012 Apple Inc. All rights
reserved. | 2 * Copyright (C) 2006, 2007, 2008, 2009, 2010, 2011, 2012 Apple Inc. All rights
reserved. |
| 3 * | 3 * |
| 4 * Portions are Copyright (C) 1998 Netscape Communications Corporation. | 4 * Portions are Copyright (C) 1998 Netscape Communications Corporation. |
| 5 * | 5 * |
| 6 * Other contributors: | 6 * Other contributors: |
| 7 * Robert O'Callahan <roc+@cs.cmu.edu> | 7 * Robert O'Callahan <roc+@cs.cmu.edu> |
| 8 * David Baron <dbaron@fas.harvard.edu> | 8 * David Baron <dbaron@fas.harvard.edu> |
| 9 * Christian Biesinger <cbiesinger@web.de> | 9 * Christian Biesinger <cbiesinger@web.de> |
| 10 * Randall Jesup <rjesup@wgate.com> | 10 * Randall Jesup <rjesup@wgate.com> |
| (...skipping 683 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 694 child->updateLayerPositionsAfterScroll(geometryMap, flags); | 694 child->updateLayerPositionsAfterScroll(geometryMap, flags); |
| 695 | 695 |
| 696 // We don't update our reflection as scrolling is a translation which does n
ot change the size() | 696 // We don't update our reflection as scrolling is a translation which does n
ot change the size() |
| 697 // of an object, thus RenderReplica will still repaint itself properly as th
e layer position was | 697 // of an object, thus RenderReplica will still repaint itself properly as th
e layer position was |
| 698 // updated above. | 698 // updated above. |
| 699 | 699 |
| 700 if (geometryMap) | 700 if (geometryMap) |
| 701 geometryMap->popMappingsToAncestor(parent()); | 701 geometryMap->popMappingsToAncestor(parent()); |
| 702 } | 702 } |
| 703 | 703 |
| 704 void RenderLayer::positionNewlyCreatedOverflowControls() | |
| 705 { | |
| 706 if (!compositedLayerMapping()->hasUnpositionedOverflowControlsLayers()) | |
| 707 return; | |
| 708 | |
| 709 RenderGeometryMap geometryMap(UseTransforms); | |
| 710 RenderView* view = renderer()->view(); | |
| 711 if (this != view->layer() && parent()) | |
| 712 geometryMap.pushMappingsToAncestor(parent(), 0); | |
| 713 | |
| 714 LayoutPoint offsetFromRoot = LayoutPoint(geometryMap.absolutePoint(FloatPoin
t())); | |
| 715 positionOverflowControls(toIntSize(roundedIntPoint(offsetFromRoot))); | |
| 716 } | |
| 717 | |
| 718 bool RenderLayer::hasBlendMode() const | 704 bool RenderLayer::hasBlendMode() const |
| 719 { | 705 { |
| 720 return RuntimeEnabledFeatures::cssCompositingEnabled() && renderer()->hasBle
ndMode(); | 706 return RuntimeEnabledFeatures::cssCompositingEnabled() && renderer()->hasBle
ndMode(); |
| 721 } | 707 } |
| 722 | 708 |
| 723 void RenderLayer::updateBlendMode() | 709 void RenderLayer::updateBlendMode() |
| 724 { | 710 { |
| 725 if (!RuntimeEnabledFeatures::cssCompositingEnabled()) | 711 if (!RuntimeEnabledFeatures::cssCompositingEnabled()) |
| 726 return; | 712 return; |
| 727 | 713 |
| (...skipping 1300 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2028 updateIsNormalFlowOnly(); | 2014 updateIsNormalFlowOnly(); |
| 2029 updateSelfPaintingLayer(); | 2015 updateSelfPaintingLayer(); |
| 2030 | 2016 |
| 2031 if (isStackingContainer()) | 2017 if (isStackingContainer()) |
| 2032 dirtyZOrderLists(); | 2018 dirtyZOrderLists(); |
| 2033 else | 2019 else |
| 2034 clearZOrderLists(); | 2020 clearZOrderLists(); |
| 2035 | 2021 |
| 2036 dirtyStackingContainerZOrderLists(); | 2022 dirtyStackingContainerZOrderLists(); |
| 2037 | 2023 |
| 2038 compositor()->setShouldReevaluateCompositingAfterLayout(); | 2024 compositor()->setNeedsToRecomputeCompositingRequirements(); |
| 2039 compositor()->setCompositingLayersNeedRebuild(); | 2025 compositor()->setCompositingLayersNeedRebuild(); |
| 2040 } | 2026 } |
| 2041 | 2027 |
| 2042 static inline int adjustedScrollDelta(int beginningDelta) { | 2028 static inline int adjustedScrollDelta(int beginningDelta) { |
| 2043 // This implemention matches Firefox's. | 2029 // This implemention matches Firefox's. |
| 2044 // http://mxr.mozilla.org/firefox/source/toolkit/content/widgets/browser.xml
#856. | 2030 // http://mxr.mozilla.org/firefox/source/toolkit/content/widgets/browser.xml
#856. |
| 2045 const int speedReducer = 12; | 2031 const int speedReducer = 12; |
| 2046 | 2032 |
| 2047 int adjustedDelta = beginningDelta / speedReducer; | 2033 int adjustedDelta = beginningDelta / speedReducer; |
| 2048 if (adjustedDelta > 1) | 2034 if (adjustedDelta > 1) |
| (...skipping 2492 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4541 if (m_negZOrderList) | 4527 if (m_negZOrderList) |
| 4542 m_negZOrderList->clear(); | 4528 m_negZOrderList->clear(); |
| 4543 m_zOrderListsDirty = true; | 4529 m_zOrderListsDirty = true; |
| 4544 | 4530 |
| 4545 m_canBePromotedToStackingContainerDirty = true; | 4531 m_canBePromotedToStackingContainerDirty = true; |
| 4546 | 4532 |
| 4547 if (!renderer()->documentBeingDestroyed()) { | 4533 if (!renderer()->documentBeingDestroyed()) { |
| 4548 compositor()->setNeedsUpdateCompositingRequirementsState(); | 4534 compositor()->setNeedsUpdateCompositingRequirementsState(); |
| 4549 compositor()->setCompositingLayersNeedRebuild(); | 4535 compositor()->setCompositingLayersNeedRebuild(); |
| 4550 if (acceleratedCompositingForOverflowScrollEnabled()) | 4536 if (acceleratedCompositingForOverflowScrollEnabled()) |
| 4551 compositor()->setShouldReevaluateCompositingAfterLayout(); | 4537 compositor()->setNeedsToRecomputeCompositingRequirements(); |
| 4552 } | 4538 } |
| 4553 } | 4539 } |
| 4554 | 4540 |
| 4555 void RenderLayer::dirtyStackingContainerZOrderLists() | 4541 void RenderLayer::dirtyStackingContainerZOrderLists() |
| 4556 { | 4542 { |
| 4557 // Any siblings in the ancestor stacking context could also be affected. | 4543 // Any siblings in the ancestor stacking context could also be affected. |
| 4558 // Changing z-index, for example, could cause us to stack in between a | 4544 // Changing z-index, for example, could cause us to stack in between a |
| 4559 // sibling's descendants, meaning that we have to recompute | 4545 // sibling's descendants, meaning that we have to recompute |
| 4560 // m_canBePromotedToStackingContainer for that sibling. | 4546 // m_canBePromotedToStackingContainer for that sibling. |
| 4561 dirtySiblingStackingContextCanBePromotedToStackingContainer(); | 4547 dirtySiblingStackingContextCanBePromotedToStackingContainer(); |
| (...skipping 16 matching lines...) Expand all Loading... |
| 4578 { | 4564 { |
| 4579 ASSERT(m_layerListMutationAllowed); | 4565 ASSERT(m_layerListMutationAllowed); |
| 4580 | 4566 |
| 4581 if (m_normalFlowList) | 4567 if (m_normalFlowList) |
| 4582 m_normalFlowList->clear(); | 4568 m_normalFlowList->clear(); |
| 4583 m_normalFlowListDirty = true; | 4569 m_normalFlowListDirty = true; |
| 4584 | 4570 |
| 4585 if (!renderer()->documentBeingDestroyed()) { | 4571 if (!renderer()->documentBeingDestroyed()) { |
| 4586 compositor()->setCompositingLayersNeedRebuild(); | 4572 compositor()->setCompositingLayersNeedRebuild(); |
| 4587 if (acceleratedCompositingForOverflowScrollEnabled()) | 4573 if (acceleratedCompositingForOverflowScrollEnabled()) |
| 4588 compositor()->setShouldReevaluateCompositingAfterLayout(); | 4574 compositor()->setNeedsToRecomputeCompositingRequirements(); |
| 4589 } | 4575 } |
| 4590 } | 4576 } |
| 4591 | 4577 |
| 4592 void RenderLayer::rebuildZOrderLists() | 4578 void RenderLayer::rebuildZOrderLists() |
| 4593 { | 4579 { |
| 4594 ASSERT(m_layerListMutationAllowed); | 4580 ASSERT(m_layerListMutationAllowed); |
| 4595 ASSERT(isDirtyStackingContainer()); | 4581 ASSERT(isDirtyStackingContainer()); |
| 4596 rebuildZOrderLists(m_posZOrderList, m_negZOrderList); | 4582 rebuildZOrderLists(m_posZOrderList, m_negZOrderList); |
| 4597 m_zOrderListsDirty = false; | 4583 m_zOrderListsDirty = false; |
| 4598 } | 4584 } |
| (...skipping 712 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 5311 } | 5297 } |
| 5312 | 5298 |
| 5313 IntRect RenderLayer::scrollCornerAndResizerRect() const | 5299 IntRect RenderLayer::scrollCornerAndResizerRect() const |
| 5314 { | 5300 { |
| 5315 if (!m_scrollableArea) | 5301 if (!m_scrollableArea) |
| 5316 return IntRect(); | 5302 return IntRect(); |
| 5317 | 5303 |
| 5318 return m_scrollableArea->scrollCornerAndResizerRect(); | 5304 return m_scrollableArea->scrollCornerAndResizerRect(); |
| 5319 } | 5305 } |
| 5320 | 5306 |
| 5307 void RenderLayer::positionOverflowControls() |
| 5308 { |
| 5309 RenderGeometryMap geometryMap(UseTransforms); |
| 5310 RenderView* view = renderer()->view(); |
| 5311 if (this != view->layer() && parent()) |
| 5312 geometryMap.pushMappingsToAncestor(parent(), 0); |
| 5313 |
| 5314 LayoutPoint offsetFromRoot = LayoutPoint(geometryMap.absolutePoint(FloatPoin
t())); |
| 5315 positionOverflowControls(toIntSize(roundedIntPoint(offsetFromRoot))); |
| 5316 } |
| 5317 |
| 5321 void RenderLayer::positionOverflowControls(const IntSize& offsetFromRoot) | 5318 void RenderLayer::positionOverflowControls(const IntSize& offsetFromRoot) |
| 5322 { | 5319 { |
| 5323 if (m_scrollableArea) | 5320 if (m_scrollableArea) |
| 5324 m_scrollableArea->positionOverflowControls(offsetFromRoot); | 5321 m_scrollableArea->positionOverflowControls(offsetFromRoot); |
| 5325 } | 5322 } |
| 5326 | 5323 |
| 5327 void RenderLayer::paintScrollCorner(GraphicsContext* context, const IntPoint& pa
intOffset, const IntRect& damageRect) | 5324 void RenderLayer::paintScrollCorner(GraphicsContext* context, const IntPoint& pa
intOffset, const IntRect& damageRect) |
| 5328 { | 5325 { |
| 5329 if (m_scrollableArea) | 5326 if (m_scrollableArea) |
| 5330 m_scrollableArea->paintScrollCorner(context, paintOffset, damageRect); | 5327 m_scrollableArea->paintScrollCorner(context, paintOffset, damageRect); |
| (...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 5372 } | 5369 } |
| 5373 } | 5370 } |
| 5374 | 5371 |
| 5375 void showLayerTree(const WebCore::RenderObject* renderer) | 5372 void showLayerTree(const WebCore::RenderObject* renderer) |
| 5376 { | 5373 { |
| 5377 if (!renderer) | 5374 if (!renderer) |
| 5378 return; | 5375 return; |
| 5379 showLayerTree(renderer->enclosingLayer()); | 5376 showLayerTree(renderer->enclosingLayer()); |
| 5380 } | 5377 } |
| 5381 #endif | 5378 #endif |
| OLD | NEW |