| 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 1375 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2103 updateIsNormalFlowOnly(); | 2089 updateIsNormalFlowOnly(); |
| 2104 updateSelfPaintingLayer(); | 2090 updateSelfPaintingLayer(); |
| 2105 | 2091 |
| 2106 if (isStackingContainer()) | 2092 if (isStackingContainer()) |
| 2107 dirtyZOrderLists(); | 2093 dirtyZOrderLists(); |
| 2108 else | 2094 else |
| 2109 clearZOrderLists(); | 2095 clearZOrderLists(); |
| 2110 | 2096 |
| 2111 dirtyStackingContainerZOrderLists(); | 2097 dirtyStackingContainerZOrderLists(); |
| 2112 | 2098 |
| 2113 compositor()->setShouldReevaluateCompositingAfterLayout(); | 2099 compositor()->setNeedsToRecomputeCompositingRequirements(); |
| 2114 compositor()->setCompositingLayersNeedRebuild(); | 2100 compositor()->setCompositingLayersNeedRebuild(); |
| 2115 } | 2101 } |
| 2116 | 2102 |
| 2117 static inline int adjustedScrollDelta(int beginningDelta) { | 2103 static inline int adjustedScrollDelta(int beginningDelta) { |
| 2118 // This implemention matches Firefox's. | 2104 // This implemention matches Firefox's. |
| 2119 // http://mxr.mozilla.org/firefox/source/toolkit/content/widgets/browser.xml
#856. | 2105 // http://mxr.mozilla.org/firefox/source/toolkit/content/widgets/browser.xml
#856. |
| 2120 const int speedReducer = 12; | 2106 const int speedReducer = 12; |
| 2121 | 2107 |
| 2122 int adjustedDelta = beginningDelta / speedReducer; | 2108 int adjustedDelta = beginningDelta / speedReducer; |
| 2123 if (adjustedDelta > 1) | 2109 if (adjustedDelta > 1) |
| (...skipping 2378 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4502 if (m_negZOrderList) | 4488 if (m_negZOrderList) |
| 4503 m_negZOrderList->clear(); | 4489 m_negZOrderList->clear(); |
| 4504 m_zOrderListsDirty = true; | 4490 m_zOrderListsDirty = true; |
| 4505 | 4491 |
| 4506 m_descendantsAreContiguousInStackingOrderDirty = true; | 4492 m_descendantsAreContiguousInStackingOrderDirty = true; |
| 4507 | 4493 |
| 4508 if (!renderer()->documentBeingDestroyed()) { | 4494 if (!renderer()->documentBeingDestroyed()) { |
| 4509 compositor()->setNeedsUpdateCompositingRequirementsState(); | 4495 compositor()->setNeedsUpdateCompositingRequirementsState(); |
| 4510 compositor()->setCompositingLayersNeedRebuild(); | 4496 compositor()->setCompositingLayersNeedRebuild(); |
| 4511 if (acceleratedCompositingForOverflowScrollEnabled()) | 4497 if (acceleratedCompositingForOverflowScrollEnabled()) |
| 4512 compositor()->setShouldReevaluateCompositingAfterLayout(); | 4498 compositor()->setNeedsToRecomputeCompositingRequirements(); |
| 4513 } | 4499 } |
| 4514 } | 4500 } |
| 4515 | 4501 |
| 4516 void RenderLayer::dirtyStackingContainerZOrderLists() | 4502 void RenderLayer::dirtyStackingContainerZOrderLists() |
| 4517 { | 4503 { |
| 4518 // Any siblings in the ancestor stacking context could also be affected. | 4504 // Any siblings in the ancestor stacking context could also be affected. |
| 4519 // Changing z-index, for example, could cause us to stack in between a | 4505 // Changing z-index, for example, could cause us to stack in between a |
| 4520 // sibling's descendants, meaning that we have to recompute | 4506 // sibling's descendants, meaning that we have to recompute |
| 4521 // m_descendantsAreContiguousInStackingOrder for that sibling. | 4507 // m_descendantsAreContiguousInStackingOrder for that sibling. |
| 4522 dirtySiblingStackingContextCanBePromotedToStackingContainer(); | 4508 dirtySiblingStackingContextCanBePromotedToStackingContainer(); |
| (...skipping 16 matching lines...) Expand all Loading... |
| 4539 { | 4525 { |
| 4540 ASSERT(m_layerListMutationAllowed); | 4526 ASSERT(m_layerListMutationAllowed); |
| 4541 | 4527 |
| 4542 if (m_normalFlowList) | 4528 if (m_normalFlowList) |
| 4543 m_normalFlowList->clear(); | 4529 m_normalFlowList->clear(); |
| 4544 m_normalFlowListDirty = true; | 4530 m_normalFlowListDirty = true; |
| 4545 | 4531 |
| 4546 if (!renderer()->documentBeingDestroyed()) { | 4532 if (!renderer()->documentBeingDestroyed()) { |
| 4547 compositor()->setCompositingLayersNeedRebuild(); | 4533 compositor()->setCompositingLayersNeedRebuild(); |
| 4548 if (acceleratedCompositingForOverflowScrollEnabled()) | 4534 if (acceleratedCompositingForOverflowScrollEnabled()) |
| 4549 compositor()->setShouldReevaluateCompositingAfterLayout(); | 4535 compositor()->setNeedsToRecomputeCompositingRequirements(); |
| 4550 } | 4536 } |
| 4551 } | 4537 } |
| 4552 | 4538 |
| 4553 void RenderLayer::rebuildZOrderLists() | 4539 void RenderLayer::rebuildZOrderLists() |
| 4554 { | 4540 { |
| 4555 ASSERT(m_layerListMutationAllowed); | 4541 ASSERT(m_layerListMutationAllowed); |
| 4556 ASSERT(isDirtyStackingContainer()); | 4542 ASSERT(isDirtyStackingContainer()); |
| 4557 rebuildZOrderLists(m_posZOrderList, m_negZOrderList); | 4543 rebuildZOrderLists(m_posZOrderList, m_negZOrderList); |
| 4558 m_zOrderListsDirty = false; | 4544 m_zOrderListsDirty = false; |
| 4559 } | 4545 } |
| (...skipping 716 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 5276 } | 5262 } |
| 5277 | 5263 |
| 5278 IntRect RenderLayer::scrollCornerAndResizerRect() const | 5264 IntRect RenderLayer::scrollCornerAndResizerRect() const |
| 5279 { | 5265 { |
| 5280 if (!m_scrollableArea) | 5266 if (!m_scrollableArea) |
| 5281 return IntRect(); | 5267 return IntRect(); |
| 5282 | 5268 |
| 5283 return m_scrollableArea->scrollCornerAndResizerRect(); | 5269 return m_scrollableArea->scrollCornerAndResizerRect(); |
| 5284 } | 5270 } |
| 5285 | 5271 |
| 5272 void RenderLayer::positionOverflowControls() |
| 5273 { |
| 5274 RenderGeometryMap geometryMap(UseTransforms); |
| 5275 RenderView* view = renderer()->view(); |
| 5276 if (this != view->layer() && parent()) |
| 5277 geometryMap.pushMappingsToAncestor(parent(), 0); |
| 5278 |
| 5279 LayoutPoint offsetFromRoot = LayoutPoint(geometryMap.absolutePoint(FloatPoin
t())); |
| 5280 positionOverflowControls(toIntSize(roundedIntPoint(offsetFromRoot))); |
| 5281 } |
| 5282 |
| 5286 void RenderLayer::positionOverflowControls(const IntSize& offsetFromRoot) | 5283 void RenderLayer::positionOverflowControls(const IntSize& offsetFromRoot) |
| 5287 { | 5284 { |
| 5288 if (m_scrollableArea) | 5285 if (m_scrollableArea) |
| 5289 m_scrollableArea->positionOverflowControls(offsetFromRoot); | 5286 m_scrollableArea->positionOverflowControls(offsetFromRoot); |
| 5290 } | 5287 } |
| 5291 | 5288 |
| 5292 void RenderLayer::paintScrollCorner(GraphicsContext* context, const IntPoint& pa
intOffset, const IntRect& damageRect) | 5289 void RenderLayer::paintScrollCorner(GraphicsContext* context, const IntPoint& pa
intOffset, const IntRect& damageRect) |
| 5293 { | 5290 { |
| 5294 if (m_scrollableArea) | 5291 if (m_scrollableArea) |
| 5295 m_scrollableArea->paintScrollCorner(context, paintOffset, damageRect); | 5292 m_scrollableArea->paintScrollCorner(context, paintOffset, damageRect); |
| (...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 5337 } | 5334 } |
| 5338 } | 5335 } |
| 5339 | 5336 |
| 5340 void showLayerTree(const WebCore::RenderObject* renderer) | 5337 void showLayerTree(const WebCore::RenderObject* renderer) |
| 5341 { | 5338 { |
| 5342 if (!renderer) | 5339 if (!renderer) |
| 5343 return; | 5340 return; |
| 5344 showLayerTree(renderer->enclosingLayer()); | 5341 showLayerTree(renderer->enclosingLayer()); |
| 5345 } | 5342 } |
| 5346 #endif | 5343 #endif |
| OLD | NEW |