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 108 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
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_decendantNeedsToUpdateAncestorDependentProperties(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 1067 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1207 { | 1208 { |
1208 const RenderLayer* curr = (includeSelf == IncludeSelf) ? this : parent(); | 1209 const RenderLayer* curr = (includeSelf == IncludeSelf) ? this : parent(); |
1209 for (; curr; curr = curr->parent()) { | 1210 for (; curr; curr = curr->parent()) { |
1210 if (curr->requiresFullLayerImageForFilters()) | 1211 if (curr->requiresFullLayerImageForFilters()) |
1211 return const_cast<RenderLayer*>(curr); | 1212 return const_cast<RenderLayer*>(curr); |
1212 } | 1213 } |
1213 | 1214 |
1214 return 0; | 1215 return 0; |
1215 } | 1216 } |
1216 | 1217 |
1217 void RenderLayer::clearNeedsToRecomputeBounds() | 1218 void RenderLayer::setNeedsToUpdateAncestorDependentProperties() |
1218 { | 1219 { |
1219 m_needsToRecomputeBounds = false; | 1220 m_needsToUpdateAncestorDependentProperties = true; |
| 1221 |
| 1222 for (RenderLayer* current = this; current && !current->m_decendantNeedsToUpd
ateAncestorDependentProperties; current = current->parent()) |
| 1223 current->m_decendantNeedsToUpdateAncestorDependentProperties = true; |
1220 } | 1224 } |
1221 | 1225 |
1222 void RenderLayer::setAbsoluteBoundingBox(const IntRect& rect) | 1226 void RenderLayer::updateAncestorDependentProperties(const AncestorDependentPrope
rties& ancestorDependentProperties) |
1223 { | 1227 { |
1224 m_absoluteBoundingBox = rect; | 1228 m_ancestorDependentProperties = ancestorDependentProperties; |
1225 clearNeedsToRecomputeBounds(); | 1229 m_needsToUpdateAncestorDependentProperties = false; |
| 1230 } |
| 1231 |
| 1232 void RenderLayer::clearDecendantNeedsToUpdateAncestorDependentProperties() |
| 1233 { |
| 1234 ASSERT(!m_needsToUpdateAncestorDependentProperties); |
| 1235 m_decendantNeedsToUpdateAncestorDependentProperties = false; |
1226 } | 1236 } |
1227 | 1237 |
1228 void RenderLayer::setCompositingReasons(CompositingReasons reasons, CompositingR
easons mask) | 1238 void RenderLayer::setCompositingReasons(CompositingReasons reasons, CompositingR
easons mask) |
1229 { | 1239 { |
1230 ASSERT(reasons == (reasons & mask)); | 1240 ASSERT(reasons == (reasons & mask)); |
1231 if ((m_compositingProperties.compositingReasons & mask) == (reasons & mask)) | 1241 if ((m_compositingProperties.compositingReasons & mask) == (reasons & mask)) |
1232 return; | 1242 return; |
1233 m_compositingProperties.compositingReasons = (reasons & mask) | (m_compositi
ngProperties.compositingReasons & ~mask); | 1243 m_compositingProperties.compositingReasons = (reasons & mask) | (m_compositi
ngProperties.compositingReasons & ~mask); |
1234 m_clipper.setCompositingClipRectsDirty(); | 1244 m_clipper.setCompositingClipRectsDirty(); |
1235 } | 1245 } |
(...skipping 185 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1421 | 1431 |
1422 if (beforeChild) { | 1432 if (beforeChild) { |
1423 beforeChild->setPreviousSibling(child); | 1433 beforeChild->setPreviousSibling(child); |
1424 child->setNextSibling(beforeChild); | 1434 child->setNextSibling(beforeChild); |
1425 ASSERT(beforeChild != child); | 1435 ASSERT(beforeChild != child); |
1426 } else | 1436 } else |
1427 setLastChild(child); | 1437 setLastChild(child); |
1428 | 1438 |
1429 child->setParent(this); | 1439 child->setParent(this); |
1430 | 1440 |
| 1441 setNeedsToUpdateAncestorDependentProperties(); |
| 1442 |
1431 if (child->stackingNode()->isNormalFlowOnly()) | 1443 if (child->stackingNode()->isNormalFlowOnly()) |
1432 m_stackingNode->dirtyNormalFlowList(); | 1444 m_stackingNode->dirtyNormalFlowList(); |
1433 | 1445 |
1434 if (!child->stackingNode()->isNormalFlowOnly() || child->firstChild()) { | 1446 if (!child->stackingNode()->isNormalFlowOnly() || child->firstChild()) { |
1435 // Dirty the z-order list in which we are contained. The ancestorStackin
gContainerNode() can be null in the | 1447 // Dirty the z-order list in which we are contained. The ancestorStackin
gContainerNode() can be null in the |
1436 // case where we're building up generated content layers. This is ok, si
nce the lists will start | 1448 // case where we're building up generated content layers. This is ok, si
nce the lists will start |
1437 // off dirty in that case anyway. | 1449 // off dirty in that case anyway. |
1438 child->stackingNode()->dirtyStackingContainerZOrderLists(); | 1450 child->stackingNode()->dirtyStackingContainerZOrderLists(); |
1439 } | 1451 } |
1440 | 1452 |
(...skipping 2523 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3964 { | 3976 { |
3965 // https://code.google.com/p/chromium/issues/detail?id=343759 | 3977 // https://code.google.com/p/chromium/issues/detail?id=343759 |
3966 DisableCompositingQueryAsserts disabler; | 3978 DisableCompositingQueryAsserts disabler; |
3967 if (paintsWithFilters()) | 3979 if (paintsWithFilters()) |
3968 didPaintWithFilters = true; | 3980 didPaintWithFilters = true; |
3969 updateFilters(oldStyle, renderer()->style()); | 3981 updateFilters(oldStyle, renderer()->style()); |
3970 } | 3982 } |
3971 | 3983 |
3972 compositor()->updateStyleDeterminedCompositingReasons(this); | 3984 compositor()->updateStyleDeterminedCompositingReasons(this); |
3973 | 3985 |
| 3986 setNeedsToUpdateAncestorDependentProperties(); |
| 3987 |
3974 // FIXME: Remove incremental compositing updates after fixing the chicken/eg
g issues | 3988 // FIXME: Remove incremental compositing updates after fixing the chicken/eg
g issues |
3975 // https://code.google.com/p/chromium/issues/detail?id=343756 | 3989 // https://code.google.com/p/chromium/issues/detail?id=343756 |
3976 DisableCompositingQueryAsserts disabler; | 3990 DisableCompositingQueryAsserts disabler; |
3977 | 3991 |
3978 // FIXME: We could avoid doing this ancestor walk by keeping a childNeedsToR
ecomputeBounds bit | 3992 // FIXME: Move this work to CompositingPropertyUpdater::updateAncestorDepend
entProperties. |
3979 // and using that along with needsToRecomputeBounds to set this bit in a lat
er layer tree walk | |
3980 // e.g. during assignLayersToBackings or computeCompositingRequirements. | |
3981 if (RenderLayer* compositingLayer = enclosingCompositingLayer()) | 3993 if (RenderLayer* compositingLayer = enclosingCompositingLayer()) |
3982 compositingLayer->compositedLayerMapping()->setNeedsGeometryUpdate(); | 3994 compositingLayer->compositedLayerMapping()->setNeedsGeometryUpdate(); |
3983 // FIXME: We only need to set this if something changed that can change our
absolute bounding rect. | |
3984 m_needsToRecomputeBounds = true; | |
3985 | 3995 |
3986 const RenderStyle* newStyle = renderer()->style(); | 3996 const RenderStyle* newStyle = renderer()->style(); |
3987 | 3997 |
3988 compositor()->updateLayerCompositingState(this, RenderLayerCompositor::UseCh
ickenEggHacks); | 3998 compositor()->updateLayerCompositingState(this, RenderLayerCompositor::UseCh
ickenEggHacks); |
3989 // FIXME: this compositing logic should be pushed into the compositing code,
not here. | 3999 // FIXME: this compositing logic should be pushed into the compositing code,
not here. |
3990 if (needsCompositingLayersRebuiltForClip(oldStyle, newStyle) | 4000 if (needsCompositingLayersRebuiltForClip(oldStyle, newStyle) |
3991 || needsCompositingLayersRebuiltForOverflow(oldStyle, newStyle) | 4001 || needsCompositingLayersRebuiltForOverflow(oldStyle, newStyle) |
3992 || needsCompositingLayersRebuiltForFilters(oldStyle, newStyle, didPaintW
ithFilters) | 4002 || needsCompositingLayersRebuiltForFilters(oldStyle, newStyle, didPaintW
ithFilters) |
3993 || needsCompositingLayersRebuiltForBlending(oldStyle, newStyle)) { | 4003 || needsCompositingLayersRebuiltForBlending(oldStyle, newStyle)) { |
3994 compositor()->setCompositingLayersNeedRebuild(); | 4004 compositor()->setCompositingLayersNeedRebuild(); |
(...skipping 182 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4177 } | 4187 } |
4178 } | 4188 } |
4179 | 4189 |
4180 void showLayerTree(const WebCore::RenderObject* renderer) | 4190 void showLayerTree(const WebCore::RenderObject* renderer) |
4181 { | 4191 { |
4182 if (!renderer) | 4192 if (!renderer) |
4183 return; | 4193 return; |
4184 showLayerTree(renderer->enclosingLayer()); | 4194 showLayerTree(renderer->enclosingLayer()); |
4185 } | 4195 } |
4186 #endif | 4196 #endif |
OLD | NEW |