Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(44)

Side by Side Diff: Source/core/rendering/RenderLayer.cpp

Issue 30383002: Merge 159961 "Defer the real work in updateCompositingLayers unt..." (Closed) Base URL: svn://svn.chromium.org/blink/branches/chromium/1675/
Patch Set: Created 7 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « Source/core/rendering/RenderLayer.h ('k') | Source/core/rendering/RenderLayerCompositor.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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
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
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 704 matching lines...) Expand 10 before | Expand all | Expand 10 after
5264 } 5250 }
5265 5251
5266 IntRect RenderLayer::scrollCornerAndResizerRect() const 5252 IntRect RenderLayer::scrollCornerAndResizerRect() const
5267 { 5253 {
5268 if (!m_scrollableArea) 5254 if (!m_scrollableArea)
5269 return IntRect(); 5255 return IntRect();
5270 5256
5271 return m_scrollableArea->scrollCornerAndResizerRect(); 5257 return m_scrollableArea->scrollCornerAndResizerRect();
5272 } 5258 }
5273 5259
5260 void RenderLayer::positionOverflowControls()
5261 {
5262 RenderGeometryMap geometryMap(UseTransforms);
5263 RenderView* view = renderer()->view();
5264 if (this != view->layer() && parent())
5265 geometryMap.pushMappingsToAncestor(parent(), 0);
5266
5267 LayoutPoint offsetFromRoot = LayoutPoint(geometryMap.absolutePoint(FloatPoin t()));
5268 positionOverflowControls(toIntSize(roundedIntPoint(offsetFromRoot)));
5269 }
5270
5274 void RenderLayer::positionOverflowControls(const IntSize& offsetFromRoot) 5271 void RenderLayer::positionOverflowControls(const IntSize& offsetFromRoot)
5275 { 5272 {
5276 if (m_scrollableArea) 5273 if (m_scrollableArea)
5277 m_scrollableArea->positionOverflowControls(offsetFromRoot); 5274 m_scrollableArea->positionOverflowControls(offsetFromRoot);
5278 } 5275 }
5279 5276
5280 void RenderLayer::paintScrollCorner(GraphicsContext* context, const IntPoint& pa intOffset, const IntRect& damageRect) 5277 void RenderLayer::paintScrollCorner(GraphicsContext* context, const IntPoint& pa intOffset, const IntRect& damageRect)
5281 { 5278 {
5282 if (m_scrollableArea) 5279 if (m_scrollableArea)
5283 m_scrollableArea->paintScrollCorner(context, paintOffset, damageRect); 5280 m_scrollableArea->paintScrollCorner(context, paintOffset, damageRect);
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after
5325 } 5322 }
5326 } 5323 }
5327 5324
5328 void showLayerTree(const WebCore::RenderObject* renderer) 5325 void showLayerTree(const WebCore::RenderObject* renderer)
5329 { 5326 {
5330 if (!renderer) 5327 if (!renderer)
5331 return; 5328 return;
5332 showLayerTree(renderer->enclosingLayer()); 5329 showLayerTree(renderer->enclosingLayer());
5333 } 5330 }
5334 #endif 5331 #endif
OLDNEW
« no previous file with comments | « Source/core/rendering/RenderLayer.h ('k') | Source/core/rendering/RenderLayerCompositor.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698