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

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

Issue 213773002: Make compositing updates 30.7% faster for calculator (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Fix ASSERT Created 6 years, 9 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
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 108 matching lines...) Expand 10 before | Expand all | Expand 10 after
119 , m_hasVisibleContent(false) 119 , m_hasVisibleContent(false)
120 , m_visibleDescendantStatusDirty(false) 120 , m_visibleDescendantStatusDirty(false)
121 , m_hasVisibleDescendant(false) 121 , m_hasVisibleDescendant(false)
122 , m_hasVisibleNonLayerContent(false) 122 , m_hasVisibleNonLayerContent(false)
123 , m_isPaginated(false) 123 , m_isPaginated(false)
124 , m_3DTransformedDescendantStatusDirty(true) 124 , m_3DTransformedDescendantStatusDirty(true)
125 , m_has3DTransformedDescendant(false) 125 , m_has3DTransformedDescendant(false)
126 , m_containsDirtyOverlayScrollbars(false) 126 , m_containsDirtyOverlayScrollbars(false)
127 , m_canSkipRepaintRectsUpdateOnScroll(renderer->isTableCell()) 127 , m_canSkipRepaintRectsUpdateOnScroll(renderer->isTableCell())
128 , m_hasFilterInfo(false) 128 , m_hasFilterInfo(false)
129 , m_needsToRecomputeBounds(true) 129 , m_needsToUpdateAncestorDependentProperties(true)
130 , m_childNeedsToUpdateAncestorDependantProperties(true)
130 , m_renderer(renderer) 131 , m_renderer(renderer)
131 , m_parent(0) 132 , m_parent(0)
132 , m_previous(0) 133 , m_previous(0)
133 , m_next(0) 134 , m_next(0)
134 , m_first(0) 135 , m_first(0)
135 , m_last(0) 136 , m_last(0)
136 , m_staticInlinePosition(0) 137 , m_staticInlinePosition(0)
137 , m_staticBlockPosition(0) 138 , m_staticBlockPosition(0)
138 , m_enclosingPaginationLayer(0) 139 , m_enclosingPaginationLayer(0)
139 , m_groupedMapping(0) 140 , m_groupedMapping(0)
(...skipping 1066 matching lines...) Expand 10 before | Expand all | Expand 10 after
1206 { 1207 {
1207 const RenderLayer* curr = (includeSelf == IncludeSelf) ? this : parent(); 1208 const RenderLayer* curr = (includeSelf == IncludeSelf) ? this : parent();
1208 for (; curr; curr = curr->parent()) { 1209 for (; curr; curr = curr->parent()) {
1209 if (curr->requiresFullLayerImageForFilters()) 1210 if (curr->requiresFullLayerImageForFilters())
1210 return const_cast<RenderLayer*>(curr); 1211 return const_cast<RenderLayer*>(curr);
1211 } 1212 }
1212 1213
1213 return 0; 1214 return 0;
1214 } 1215 }
1215 1216
1216 void RenderLayer::clearNeedsToRecomputeBounds() 1217 void RenderLayer::setNeedsToUpdateAncestorDependentProperties()
1217 { 1218 {
1218 m_needsToRecomputeBounds = false; 1219 m_needsToUpdateAncestorDependentProperties = true;
1220
1221 for (RenderLayer* current = this; current && !current->m_childNeedsToUpdateA ncestorDependantProperties; current = current->parent())
1222 current->m_childNeedsToUpdateAncestorDependantProperties = true;
1219 } 1223 }
1220 1224
1221 void RenderLayer::setAbsoluteBoundingBox(const IntRect& rect) 1225 void RenderLayer::updateAncestorDependentProperties(const AncestorDependentPrope rties& ancestorDependentProperties)
1222 { 1226 {
1223 m_absoluteBoundingBox = rect; 1227 m_ancestorDependentProperties = ancestorDependentProperties;
1224 clearNeedsToRecomputeBounds(); 1228 m_needsToUpdateAncestorDependentProperties = false;
1229 }
1230
1231 void RenderLayer::clearChildNeedsToUpdateAncestorDependantProperties()
1232 {
1233 ASSERT(!m_needsToUpdateAncestorDependentProperties);
1234 m_childNeedsToUpdateAncestorDependantProperties = false;
1225 } 1235 }
1226 1236
1227 void RenderLayer::setCompositingReasons(CompositingReasons reasons, CompositingR easons mask) 1237 void RenderLayer::setCompositingReasons(CompositingReasons reasons, CompositingR easons mask)
1228 { 1238 {
1229 ASSERT(reasons == (reasons & mask)); 1239 ASSERT(reasons == (reasons & mask));
1230 if ((m_compositingProperties.compositingReasons & mask) == (reasons & mask)) 1240 if ((m_compositingProperties.compositingReasons & mask) == (reasons & mask))
1231 return; 1241 return;
1232 m_compositingProperties.compositingReasons = (reasons & mask) | (m_compositi ngProperties.compositingReasons & ~mask); 1242 m_compositingProperties.compositingReasons = (reasons & mask) | (m_compositi ngProperties.compositingReasons & ~mask);
1233 m_clipper.setCompositingClipRectsDirty(); 1243 m_clipper.setCompositingClipRectsDirty();
1234 } 1244 }
(...skipping 185 matching lines...) Expand 10 before | Expand all | Expand 10 after
1420 1430
1421 if (beforeChild) { 1431 if (beforeChild) {
1422 beforeChild->setPreviousSibling(child); 1432 beforeChild->setPreviousSibling(child);
1423 child->setNextSibling(beforeChild); 1433 child->setNextSibling(beforeChild);
1424 ASSERT(beforeChild != child); 1434 ASSERT(beforeChild != child);
1425 } else 1435 } else
1426 setLastChild(child); 1436 setLastChild(child);
1427 1437
1428 child->setParent(this); 1438 child->setParent(this);
1429 1439
1440 setNeedsToUpdateAncestorDependentProperties();
1441
1430 if (child->stackingNode()->isNormalFlowOnly()) 1442 if (child->stackingNode()->isNormalFlowOnly())
1431 m_stackingNode->dirtyNormalFlowList(); 1443 m_stackingNode->dirtyNormalFlowList();
1432 1444
1433 if (!child->stackingNode()->isNormalFlowOnly() || child->firstChild()) { 1445 if (!child->stackingNode()->isNormalFlowOnly() || child->firstChild()) {
1434 // Dirty the z-order list in which we are contained. The ancestorStackin gContainerNode() can be null in the 1446 // Dirty the z-order list in which we are contained. The ancestorStackin gContainerNode() can be null in the
1435 // case where we're building up generated content layers. This is ok, si nce the lists will start 1447 // case where we're building up generated content layers. This is ok, si nce the lists will start
1436 // off dirty in that case anyway. 1448 // off dirty in that case anyway.
1437 child->stackingNode()->dirtyStackingContainerZOrderLists(); 1449 child->stackingNode()->dirtyStackingContainerZOrderLists();
1438 } 1450 }
1439 1451
(...skipping 2523 matching lines...) Expand 10 before | Expand all | Expand 10 after
3963 { 3975 {
3964 // https://code.google.com/p/chromium/issues/detail?id=343759 3976 // https://code.google.com/p/chromium/issues/detail?id=343759
3965 DisableCompositingQueryAsserts disabler; 3977 DisableCompositingQueryAsserts disabler;
3966 if (paintsWithFilters()) 3978 if (paintsWithFilters())
3967 didPaintWithFilters = true; 3979 didPaintWithFilters = true;
3968 updateFilters(oldStyle, renderer()->style()); 3980 updateFilters(oldStyle, renderer()->style());
3969 } 3981 }
3970 3982
3971 compositor()->updateStyleDeterminedCompositingReasons(this); 3983 compositor()->updateStyleDeterminedCompositingReasons(this);
3972 3984
3985 setNeedsToUpdateAncestorDependentProperties();
3986
3973 // FIXME: Remove incremental compositing updates after fixing the chicken/eg g issues 3987 // FIXME: Remove incremental compositing updates after fixing the chicken/eg g issues
3974 // https://code.google.com/p/chromium/issues/detail?id=343756 3988 // https://code.google.com/p/chromium/issues/detail?id=343756
3975 DisableCompositingQueryAsserts disabler; 3989 DisableCompositingQueryAsserts disabler;
3976 3990
3977 // FIXME: We could avoid doing this ancestor walk by keeping a childNeedsToR ecomputeBounds bit 3991 // FIXME: Move this work to CompositingPropertyUpdater::updateAncestorDepend entProperties.
3978 // and using that along with needsToRecomputeBounds to set this bit in a lat er layer tree walk
3979 // e.g. during assignLayersToBackings or computeCompositingRequirements.
3980 if (RenderLayer* compositingLayer = enclosingCompositingLayer()) 3992 if (RenderLayer* compositingLayer = enclosingCompositingLayer())
3981 compositingLayer->compositedLayerMapping()->setNeedsGeometryUpdate(); 3993 compositingLayer->compositedLayerMapping()->setNeedsGeometryUpdate();
3982 // FIXME: We only need to set this if something changed that can change our absolute bounding rect.
3983 m_needsToRecomputeBounds = true;
3984 3994
3985 const RenderStyle* newStyle = renderer()->style(); 3995 const RenderStyle* newStyle = renderer()->style();
3986 3996
3987 compositor()->updateLayerCompositingState(this, RenderLayerCompositor::UseCh ickenEggHacks); 3997 compositor()->updateLayerCompositingState(this, RenderLayerCompositor::UseCh ickenEggHacks);
3988 // FIXME: this compositing logic should be pushed into the compositing code, not here. 3998 // FIXME: this compositing logic should be pushed into the compositing code, not here.
3989 if (needsCompositingLayersRebuiltForClip(oldStyle, newStyle) 3999 if (needsCompositingLayersRebuiltForClip(oldStyle, newStyle)
3990 || needsCompositingLayersRebuiltForOverflow(oldStyle, newStyle) 4000 || needsCompositingLayersRebuiltForOverflow(oldStyle, newStyle)
3991 || needsCompositingLayersRebuiltForFilters(oldStyle, newStyle, didPaintW ithFilters) 4001 || needsCompositingLayersRebuiltForFilters(oldStyle, newStyle, didPaintW ithFilters)
3992 || needsCompositingLayersRebuiltForBlending(oldStyle, newStyle)) { 4002 || needsCompositingLayersRebuiltForBlending(oldStyle, newStyle)) {
3993 compositor()->setCompositingLayersNeedRebuild(); 4003 compositor()->setCompositingLayersNeedRebuild();
(...skipping 182 matching lines...) Expand 10 before | Expand all | Expand 10 after
4176 } 4186 }
4177 } 4187 }
4178 4188
4179 void showLayerTree(const WebCore::RenderObject* renderer) 4189 void showLayerTree(const WebCore::RenderObject* renderer)
4180 { 4190 {
4181 if (!renderer) 4191 if (!renderer)
4182 return; 4192 return;
4183 showLayerTree(renderer->enclosingLayer()); 4193 showLayerTree(renderer->enclosingLayer());
4184 } 4194 }
4185 #endif 4195 #endif
OLDNEW
« no previous file with comments | « Source/core/rendering/RenderLayer.h ('k') | Source/core/rendering/compositing/CompositingPropertyUpdater.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698