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

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

Issue 26110004: Defer the real work in updateCompositingLayers until it's really needed. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: patch for landing 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 684 matching lines...) Expand 10 before | Expand all | Expand 10 after
695 child->updateLayerPositionsAfterScroll(geometryMap, flags); 695 child->updateLayerPositionsAfterScroll(geometryMap, flags);
696 696
697 // We don't update our reflection as scrolling is a translation which does n ot change the size() 697 // We don't update our reflection as scrolling is a translation which does n ot change the size()
698 // of an object, thus RenderReplica will still repaint itself properly as th e layer position was 698 // of an object, thus RenderReplica will still repaint itself properly as th e layer position was
699 // updated above. 699 // updated above.
700 700
701 if (geometryMap) 701 if (geometryMap)
702 geometryMap->popMappingsToAncestor(parent()); 702 geometryMap->popMappingsToAncestor(parent());
703 } 703 }
704 704
705 void RenderLayer::positionNewlyCreatedOverflowControls()
706 {
707 if (!compositedLayerMapping()->hasUnpositionedOverflowControlsLayers())
708 return;
709
710 RenderGeometryMap geometryMap(UseTransforms);
711 RenderView* view = renderer()->view();
712 if (this != view->layer() && parent())
713 geometryMap.pushMappingsToAncestor(parent(), 0);
714
715 LayoutPoint offsetFromRoot = LayoutPoint(geometryMap.absolutePoint(FloatPoin t()));
716 positionOverflowControls(toIntSize(roundedIntPoint(offsetFromRoot)));
717 }
718
719 bool RenderLayer::hasBlendMode() const 705 bool RenderLayer::hasBlendMode() const
720 { 706 {
721 return RuntimeEnabledFeatures::cssCompositingEnabled() && renderer()->hasBle ndMode(); 707 return RuntimeEnabledFeatures::cssCompositingEnabled() && renderer()->hasBle ndMode();
722 } 708 }
723 709
724 void RenderLayer::updateBlendMode() 710 void RenderLayer::updateBlendMode()
725 { 711 {
726 if (!RuntimeEnabledFeatures::cssCompositingEnabled()) 712 if (!RuntimeEnabledFeatures::cssCompositingEnabled())
727 return; 713 return;
728 714
(...skipping 1375 matching lines...) Expand 10 before | Expand all | Expand 10 after
2104 updateIsNormalFlowOnly(); 2090 updateIsNormalFlowOnly();
2105 updateSelfPaintingLayer(); 2091 updateSelfPaintingLayer();
2106 2092
2107 if (isStackingContainer()) 2093 if (isStackingContainer())
2108 dirtyZOrderLists(); 2094 dirtyZOrderLists();
2109 else 2095 else
2110 clearZOrderLists(); 2096 clearZOrderLists();
2111 2097
2112 dirtyStackingContainerZOrderLists(); 2098 dirtyStackingContainerZOrderLists();
2113 2099
2114 compositor()->setShouldReevaluateCompositingAfterLayout(); 2100 compositor()->setNeedsToRecomputeCompositingRequirements();
2115 compositor()->setCompositingLayersNeedRebuild(); 2101 compositor()->setCompositingLayersNeedRebuild();
2116 } 2102 }
2117 2103
2118 static inline int adjustedScrollDelta(int beginningDelta) { 2104 static inline int adjustedScrollDelta(int beginningDelta) {
2119 // This implemention matches Firefox's. 2105 // This implemention matches Firefox's.
2120 // http://mxr.mozilla.org/firefox/source/toolkit/content/widgets/browser.xml #856. 2106 // http://mxr.mozilla.org/firefox/source/toolkit/content/widgets/browser.xml #856.
2121 const int speedReducer = 12; 2107 const int speedReducer = 12;
2122 2108
2123 int adjustedDelta = beginningDelta / speedReducer; 2109 int adjustedDelta = beginningDelta / speedReducer;
2124 if (adjustedDelta > 1) 2110 if (adjustedDelta > 1)
(...skipping 2378 matching lines...) Expand 10 before | Expand all | Expand 10 after
4503 if (m_negZOrderList) 4489 if (m_negZOrderList)
4504 m_negZOrderList->clear(); 4490 m_negZOrderList->clear();
4505 m_zOrderListsDirty = true; 4491 m_zOrderListsDirty = true;
4506 4492
4507 m_descendantsAreContiguousInStackingOrderDirty = true; 4493 m_descendantsAreContiguousInStackingOrderDirty = true;
4508 4494
4509 if (!renderer()->documentBeingDestroyed()) { 4495 if (!renderer()->documentBeingDestroyed()) {
4510 compositor()->setNeedsUpdateCompositingRequirementsState(); 4496 compositor()->setNeedsUpdateCompositingRequirementsState();
4511 compositor()->setCompositingLayersNeedRebuild(); 4497 compositor()->setCompositingLayersNeedRebuild();
4512 if (acceleratedCompositingForOverflowScrollEnabled()) 4498 if (acceleratedCompositingForOverflowScrollEnabled())
4513 compositor()->setShouldReevaluateCompositingAfterLayout(); 4499 compositor()->setNeedsToRecomputeCompositingRequirements();
4514 } 4500 }
4515 } 4501 }
4516 4502
4517 void RenderLayer::dirtyStackingContainerZOrderLists() 4503 void RenderLayer::dirtyStackingContainerZOrderLists()
4518 { 4504 {
4519 // Any siblings in the ancestor stacking context could also be affected. 4505 // Any siblings in the ancestor stacking context could also be affected.
4520 // Changing z-index, for example, could cause us to stack in between a 4506 // Changing z-index, for example, could cause us to stack in between a
4521 // sibling's descendants, meaning that we have to recompute 4507 // sibling's descendants, meaning that we have to recompute
4522 // m_descendantsAreContiguousInStackingOrder for that sibling. 4508 // m_descendantsAreContiguousInStackingOrder for that sibling.
4523 dirtySiblingStackingContextCanBePromotedToStackingContainer(); 4509 dirtySiblingStackingContextCanBePromotedToStackingContainer();
(...skipping 16 matching lines...) Expand all
4540 { 4526 {
4541 ASSERT(m_layerListMutationAllowed); 4527 ASSERT(m_layerListMutationAllowed);
4542 4528
4543 if (m_normalFlowList) 4529 if (m_normalFlowList)
4544 m_normalFlowList->clear(); 4530 m_normalFlowList->clear();
4545 m_normalFlowListDirty = true; 4531 m_normalFlowListDirty = true;
4546 4532
4547 if (!renderer()->documentBeingDestroyed()) { 4533 if (!renderer()->documentBeingDestroyed()) {
4548 compositor()->setCompositingLayersNeedRebuild(); 4534 compositor()->setCompositingLayersNeedRebuild();
4549 if (acceleratedCompositingForOverflowScrollEnabled()) 4535 if (acceleratedCompositingForOverflowScrollEnabled())
4550 compositor()->setShouldReevaluateCompositingAfterLayout(); 4536 compositor()->setNeedsToRecomputeCompositingRequirements();
4551 } 4537 }
4552 } 4538 }
4553 4539
4554 void RenderLayer::rebuildZOrderLists() 4540 void RenderLayer::rebuildZOrderLists()
4555 { 4541 {
4556 ASSERT(m_layerListMutationAllowed); 4542 ASSERT(m_layerListMutationAllowed);
4557 ASSERT(isDirtyStackingContainer()); 4543 ASSERT(isDirtyStackingContainer());
4558 rebuildZOrderLists(m_posZOrderList, m_negZOrderList); 4544 rebuildZOrderLists(m_posZOrderList, m_negZOrderList);
4559 m_zOrderListsDirty = false; 4545 m_zOrderListsDirty = false;
4560 } 4546 }
(...skipping 704 matching lines...) Expand 10 before | Expand all | Expand 10 after
5265 } 5251 }
5266 5252
5267 IntRect RenderLayer::scrollCornerAndResizerRect() const 5253 IntRect RenderLayer::scrollCornerAndResizerRect() const
5268 { 5254 {
5269 if (!m_scrollableArea) 5255 if (!m_scrollableArea)
5270 return IntRect(); 5256 return IntRect();
5271 5257
5272 return m_scrollableArea->scrollCornerAndResizerRect(); 5258 return m_scrollableArea->scrollCornerAndResizerRect();
5273 } 5259 }
5274 5260
5261 void RenderLayer::positionOverflowControls()
5262 {
5263 RenderGeometryMap geometryMap(UseTransforms);
5264 RenderView* view = renderer()->view();
5265 if (this != view->layer() && parent())
5266 geometryMap.pushMappingsToAncestor(parent(), 0);
5267
5268 LayoutPoint offsetFromRoot = LayoutPoint(geometryMap.absolutePoint(FloatPoin t()));
5269 positionOverflowControls(toIntSize(roundedIntPoint(offsetFromRoot)));
5270 }
5271
5275 void RenderLayer::positionOverflowControls(const IntSize& offsetFromRoot) 5272 void RenderLayer::positionOverflowControls(const IntSize& offsetFromRoot)
5276 { 5273 {
5277 if (m_scrollableArea) 5274 if (m_scrollableArea)
5278 m_scrollableArea->positionOverflowControls(offsetFromRoot); 5275 m_scrollableArea->positionOverflowControls(offsetFromRoot);
5279 } 5276 }
5280 5277
5281 void RenderLayer::paintScrollCorner(GraphicsContext* context, const IntPoint& pa intOffset, const IntRect& damageRect) 5278 void RenderLayer::paintScrollCorner(GraphicsContext* context, const IntPoint& pa intOffset, const IntRect& damageRect)
5282 { 5279 {
5283 if (m_scrollableArea) 5280 if (m_scrollableArea)
5284 m_scrollableArea->paintScrollCorner(context, paintOffset, damageRect); 5281 m_scrollableArea->paintScrollCorner(context, paintOffset, damageRect);
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after
5326 } 5323 }
5327 } 5324 }
5328 5325
5329 void showLayerTree(const WebCore::RenderObject* renderer) 5326 void showLayerTree(const WebCore::RenderObject* renderer)
5330 { 5327 {
5331 if (!renderer) 5328 if (!renderer)
5332 return; 5329 return;
5333 showLayerTree(renderer->enclosingLayer()); 5330 showLayerTree(renderer->enclosingLayer());
5334 } 5331 }
5335 #endif 5332 #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