| 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 1306 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2034 updateIsNormalFlowOnly(); | 2020 updateIsNormalFlowOnly(); |
| 2035 updateSelfPaintingLayer(); | 2021 updateSelfPaintingLayer(); |
| 2036 | 2022 |
| 2037 if (isStackingContainer()) | 2023 if (isStackingContainer()) |
| 2038 dirtyZOrderLists(); | 2024 dirtyZOrderLists(); |
| 2039 else | 2025 else |
| 2040 clearZOrderLists(); | 2026 clearZOrderLists(); |
| 2041 | 2027 |
| 2042 dirtyStackingContainerZOrderLists(); | 2028 dirtyStackingContainerZOrderLists(); |
| 2043 | 2029 |
| 2044 compositor()->setShouldReevaluateCompositingAfterLayout(); | 2030 compositor()->setNeedsToRecomputeCompositingRequirements(); |
| 2045 compositor()->setCompositingLayersNeedRebuild(); | 2031 compositor()->setCompositingLayersNeedRebuild(); |
| 2046 } | 2032 } |
| 2047 | 2033 |
| 2048 static inline int adjustedScrollDelta(int beginningDelta) { | 2034 static inline int adjustedScrollDelta(int beginningDelta) { |
| 2049 // This implemention matches Firefox's. | 2035 // This implemention matches Firefox's. |
| 2050 // http://mxr.mozilla.org/firefox/source/toolkit/content/widgets/browser.xml
#856. | 2036 // http://mxr.mozilla.org/firefox/source/toolkit/content/widgets/browser.xml
#856. |
| 2051 const int speedReducer = 12; | 2037 const int speedReducer = 12; |
| 2052 | 2038 |
| 2053 int adjustedDelta = beginningDelta / speedReducer; | 2039 int adjustedDelta = beginningDelta / speedReducer; |
| 2054 if (adjustedDelta > 1) | 2040 if (adjustedDelta > 1) |
| (...skipping 2504 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4559 if (m_negZOrderList) | 4545 if (m_negZOrderList) |
| 4560 m_negZOrderList->clear(); | 4546 m_negZOrderList->clear(); |
| 4561 m_zOrderListsDirty = true; | 4547 m_zOrderListsDirty = true; |
| 4562 | 4548 |
| 4563 m_canBePromotedToStackingContainerDirty = true; | 4549 m_canBePromotedToStackingContainerDirty = true; |
| 4564 | 4550 |
| 4565 if (!renderer()->documentBeingDestroyed()) { | 4551 if (!renderer()->documentBeingDestroyed()) { |
| 4566 compositor()->setNeedsUpdateCompositingRequirementsState(); | 4552 compositor()->setNeedsUpdateCompositingRequirementsState(); |
| 4567 compositor()->setCompositingLayersNeedRebuild(); | 4553 compositor()->setCompositingLayersNeedRebuild(); |
| 4568 if (acceleratedCompositingForOverflowScrollEnabled()) | 4554 if (acceleratedCompositingForOverflowScrollEnabled()) |
| 4569 compositor()->setShouldReevaluateCompositingAfterLayout(); | 4555 compositor()->setNeedsToRecomputeCompositingRequirements(); |
| 4570 } | 4556 } |
| 4571 } | 4557 } |
| 4572 | 4558 |
| 4573 void RenderLayer::dirtyStackingContainerZOrderLists() | 4559 void RenderLayer::dirtyStackingContainerZOrderLists() |
| 4574 { | 4560 { |
| 4575 // Any siblings in the ancestor stacking context could also be affected. | 4561 // Any siblings in the ancestor stacking context could also be affected. |
| 4576 // Changing z-index, for example, could cause us to stack in between a | 4562 // Changing z-index, for example, could cause us to stack in between a |
| 4577 // sibling's descendants, meaning that we have to recompute | 4563 // sibling's descendants, meaning that we have to recompute |
| 4578 // m_canBePromotedToStackingContainer for that sibling. | 4564 // m_canBePromotedToStackingContainer for that sibling. |
| 4579 dirtySiblingStackingContextCanBePromotedToStackingContainer(); | 4565 dirtySiblingStackingContextCanBePromotedToStackingContainer(); |
| (...skipping 16 matching lines...) Expand all Loading... |
| 4596 { | 4582 { |
| 4597 ASSERT(m_layerListMutationAllowed); | 4583 ASSERT(m_layerListMutationAllowed); |
| 4598 | 4584 |
| 4599 if (m_normalFlowList) | 4585 if (m_normalFlowList) |
| 4600 m_normalFlowList->clear(); | 4586 m_normalFlowList->clear(); |
| 4601 m_normalFlowListDirty = true; | 4587 m_normalFlowListDirty = true; |
| 4602 | 4588 |
| 4603 if (!renderer()->documentBeingDestroyed()) { | 4589 if (!renderer()->documentBeingDestroyed()) { |
| 4604 compositor()->setCompositingLayersNeedRebuild(); | 4590 compositor()->setCompositingLayersNeedRebuild(); |
| 4605 if (acceleratedCompositingForOverflowScrollEnabled()) | 4591 if (acceleratedCompositingForOverflowScrollEnabled()) |
| 4606 compositor()->setShouldReevaluateCompositingAfterLayout(); | 4592 compositor()->setNeedsToRecomputeCompositingRequirements(); |
| 4607 } | 4593 } |
| 4608 } | 4594 } |
| 4609 | 4595 |
| 4610 void RenderLayer::rebuildZOrderLists() | 4596 void RenderLayer::rebuildZOrderLists() |
| 4611 { | 4597 { |
| 4612 ASSERT(m_layerListMutationAllowed); | 4598 ASSERT(m_layerListMutationAllowed); |
| 4613 ASSERT(isDirtyStackingContainer()); | 4599 ASSERT(isDirtyStackingContainer()); |
| 4614 rebuildZOrderLists(m_posZOrderList, m_negZOrderList); | 4600 rebuildZOrderLists(m_posZOrderList, m_negZOrderList); |
| 4615 m_zOrderListsDirty = false; | 4601 m_zOrderListsDirty = false; |
| 4616 } | 4602 } |
| (...skipping 731 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 5348 } | 5334 } |
| 5349 | 5335 |
| 5350 IntRect RenderLayer::scrollCornerAndResizerRect() const | 5336 IntRect RenderLayer::scrollCornerAndResizerRect() const |
| 5351 { | 5337 { |
| 5352 if (!m_scrollableArea) | 5338 if (!m_scrollableArea) |
| 5353 return IntRect(); | 5339 return IntRect(); |
| 5354 | 5340 |
| 5355 return m_scrollableArea->scrollCornerAndResizerRect(); | 5341 return m_scrollableArea->scrollCornerAndResizerRect(); |
| 5356 } | 5342 } |
| 5357 | 5343 |
| 5344 void RenderLayer::positionOverflowControls() |
| 5345 { |
| 5346 RenderGeometryMap geometryMap(UseTransforms); |
| 5347 RenderView* view = renderer()->view(); |
| 5348 if (this != view->layer() && parent()) |
| 5349 geometryMap.pushMappingsToAncestor(parent(), 0); |
| 5350 |
| 5351 LayoutPoint offsetFromRoot = LayoutPoint(geometryMap.absolutePoint(FloatPoin
t())); |
| 5352 positionOverflowControls(toIntSize(roundedIntPoint(offsetFromRoot))); |
| 5353 } |
| 5354 |
| 5358 void RenderLayer::positionOverflowControls(const IntSize& offsetFromRoot) | 5355 void RenderLayer::positionOverflowControls(const IntSize& offsetFromRoot) |
| 5359 { | 5356 { |
| 5360 if (m_scrollableArea) | 5357 if (m_scrollableArea) |
| 5361 m_scrollableArea->positionOverflowControls(offsetFromRoot); | 5358 m_scrollableArea->positionOverflowControls(offsetFromRoot); |
| 5362 } | 5359 } |
| 5363 | 5360 |
| 5364 void RenderLayer::paintScrollCorner(GraphicsContext* context, const IntPoint& pa
intOffset, const IntRect& damageRect) | 5361 void RenderLayer::paintScrollCorner(GraphicsContext* context, const IntPoint& pa
intOffset, const IntRect& damageRect) |
| 5365 { | 5362 { |
| 5366 if (m_scrollableArea) | 5363 if (m_scrollableArea) |
| 5367 m_scrollableArea->paintScrollCorner(context, paintOffset, damageRect); | 5364 m_scrollableArea->paintScrollCorner(context, paintOffset, damageRect); |
| (...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 5409 } | 5406 } |
| 5410 } | 5407 } |
| 5411 | 5408 |
| 5412 void showLayerTree(const WebCore::RenderObject* renderer) | 5409 void showLayerTree(const WebCore::RenderObject* renderer) |
| 5413 { | 5410 { |
| 5414 if (!renderer) | 5411 if (!renderer) |
| 5415 return; | 5412 return; |
| 5416 showLayerTree(renderer->enclosingLayer()); | 5413 showLayerTree(renderer->enclosingLayer()); |
| 5417 } | 5414 } |
| 5418 #endif | 5415 #endif |
| OLD | NEW |