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 247 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
258 { | 258 { |
259 TRACE_EVENT0("blink_rendering", "RenderLayer::updateLayerPositionsAfterLayou
t"); | 259 TRACE_EVENT0("blink_rendering", "RenderLayer::updateLayerPositionsAfterLayou
t"); |
260 | 260 |
261 // FIXME: Remove incremental compositing updates after fixing the chicken/eg
g issues | 261 // FIXME: Remove incremental compositing updates after fixing the chicken/eg
g issues |
262 // https://code.google.com/p/chromium/issues/detail?id=343756 | 262 // https://code.google.com/p/chromium/issues/detail?id=343756 |
263 DisableCompositingQueryAsserts disabler; | 263 DisableCompositingQueryAsserts disabler; |
264 | 264 |
265 RenderGeometryMap geometryMap(UseTransforms); | 265 RenderGeometryMap geometryMap(UseTransforms); |
266 if (this != rootLayer) | 266 if (this != rootLayer) |
267 geometryMap.pushMappingsToAncestor(parent(), 0); | 267 geometryMap.pushMappingsToAncestor(parent(), 0); |
268 updateLayerPositions(&geometryMap, rootLayer->renderer()->containerForRepain
t(), flags); | 268 updateLayerPositionRecursive(&geometryMap, rootLayer->renderer()->containerF
orRepaint(), flags); |
269 } | 269 } |
270 | 270 |
271 void RenderLayer::updateLayerPositions(RenderGeometryMap* geometryMap, const Ren
derLayerModelObject* paintInvalidationContainer, UpdateLayerPositionsFlags flags
) | 271 void RenderLayer::updateLayerPositionRecursive(RenderGeometryMap* geometryMap, c
onst RenderLayerModelObject* paintInvalidationContainer, UpdateLayerPositionsFla
gs flags) |
272 { | 272 { |
273 // For performance reasons we only check if the RenderObject has moved if we | 273 // For performance reasons we only check if the RenderObject has moved if we |
274 // have a geometryMap. If not, blank out the paint invalidation container so
we | 274 // have a geometryMap. If not, blank out the paint invalidation container so
we |
275 // can skip doing any further work to update it. | 275 // can skip doing any further work to update it. |
276 if (!geometryMap) | 276 if (!geometryMap) |
277 paintInvalidationContainer = 0; | 277 paintInvalidationContainer = 0; |
278 | 278 |
279 updateLayerPosition(); // For relpositioned layers or non-positioned layers, | 279 updateLayerPosition(); // For relpositioned layers or non-positioned layers, |
280 // we need to keep in sync, since we may have shifted
relative | 280 // we need to keep in sync, since we may have shifted
relative |
281 // to our parent layer. | 281 // to our parent layer. |
(...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
326 | 326 |
327 if (useRegionBasedColumns() && renderer()->isRenderFlowThread()) { | 327 if (useRegionBasedColumns() && renderer()->isRenderFlowThread()) { |
328 updatePagination(); | 328 updatePagination(); |
329 flags |= UpdatePagination; | 329 flags |= UpdatePagination; |
330 } | 330 } |
331 | 331 |
332 if (renderer()->hasColumns()) | 332 if (renderer()->hasColumns()) |
333 flags |= UpdatePagination; | 333 flags |= UpdatePagination; |
334 | 334 |
335 for (RenderLayer* child = firstChild(); child; child = child->nextSibling()) | 335 for (RenderLayer* child = firstChild(); child; child = child->nextSibling()) |
336 child->updateLayerPositions(geometryMap, newPaintInvalidationContainer,
flags); | 336 child->updateLayerPositionRecursive(geometryMap, newPaintInvalidationCon
tainer, flags); |
337 | 337 |
338 if ((flags & NeedsFullRepaintInBacking) && hasCompositedLayerMapping() && !c
ompositedLayerMapping()->paintsIntoCompositedAncestor()) | 338 if ((flags & NeedsFullRepaintInBacking) && hasCompositedLayerMapping() && !c
ompositedLayerMapping()->paintsIntoCompositedAncestor()) |
339 compositedLayerMapping()->setContentsNeedDisplay(); | 339 compositedLayerMapping()->setContentsNeedDisplay(); |
340 | 340 |
341 if (geometryMap) | 341 if (geometryMap) |
342 geometryMap->popMappingsToAncestor(parent()); | 342 geometryMap->popMappingsToAncestor(parent()); |
343 } | 343 } |
344 | 344 |
345 void RenderLayer::setAncestorChainHasSelfPaintingLayerDescendant() | 345 void RenderLayer::setAncestorChainHasSelfPaintingLayerDescendant() |
346 { | 346 { |
(...skipping 1138 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1485 m_parent->addChild(current, nextSib); | 1485 m_parent->addChild(current, nextSib); |
1486 | 1486 |
1487 if (RuntimeEnabledFeatures::repaintAfterLayoutEnabled()) | 1487 if (RuntimeEnabledFeatures::repaintAfterLayoutEnabled()) |
1488 current->renderer()->setShouldDoFullPaintInvalidationAfterLayout(tru
e); | 1488 current->renderer()->setShouldDoFullPaintInvalidationAfterLayout(tru
e); |
1489 else | 1489 else |
1490 current->repainter().setRepaintStatus(NeedsFullRepaint); | 1490 current->repainter().setRepaintStatus(NeedsFullRepaint); |
1491 | 1491 |
1492 // Hits in compositing/overflow/automatically-opt-into-composited-scroll
ing-part-1.html | 1492 // Hits in compositing/overflow/automatically-opt-into-composited-scroll
ing-part-1.html |
1493 DisableCompositingQueryAsserts disabler; | 1493 DisableCompositingQueryAsserts disabler; |
1494 | 1494 |
1495 current->updateLayerPositions(0, 0); // FIXME: use geometry map. | 1495 current->updateLayerPositionRecursive(0, 0); // FIXME: use geometry map. |
1496 current = next; | 1496 current = next; |
1497 } | 1497 } |
1498 | 1498 |
1499 // Remove us from the parent. | 1499 // Remove us from the parent. |
1500 m_parent->removeChild(this); | 1500 m_parent->removeChild(this); |
1501 m_renderer->destroyLayer(); | 1501 m_renderer->destroyLayer(); |
1502 } | 1502 } |
1503 | 1503 |
1504 void RenderLayer::insertOnlyThisLayer() | 1504 void RenderLayer::insertOnlyThisLayer() |
1505 { | 1505 { |
(...skipping 1011 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2517 Vector<RenderLayer*> columnLayers; | 2517 Vector<RenderLayer*> columnLayers; |
2518 RenderLayerStackingNode* ancestorNode = m_stackingNode->isNormalFlowOnly() ?
parent()->stackingNode() : m_stackingNode->ancestorStackingContextNode(); | 2518 RenderLayerStackingNode* ancestorNode = m_stackingNode->isNormalFlowOnly() ?
parent()->stackingNode() : m_stackingNode->ancestorStackingContextNode(); |
2519 for (RenderLayer* curr = childLayer->parent(); curr; curr = curr->parent())
{ | 2519 for (RenderLayer* curr = childLayer->parent(); curr; curr = curr->parent())
{ |
2520 if (curr->renderer()->hasColumns() && checkContainingBlockChainForPagina
tion(childLayer->renderer(), curr->renderBox())) | 2520 if (curr->renderer()->hasColumns() && checkContainingBlockChainForPagina
tion(childLayer->renderer(), curr->renderBox())) |
2521 columnLayers.append(curr); | 2521 columnLayers.append(curr); |
2522 if (curr->stackingNode() == ancestorNode) | 2522 if (curr->stackingNode() == ancestorNode) |
2523 break; | 2523 break; |
2524 } | 2524 } |
2525 | 2525 |
2526 // It is possible for paintLayer() to be called after the child layer ceases
to be paginated but before | 2526 // It is possible for paintLayer() to be called after the child layer ceases
to be paginated but before |
2527 // updateLayerPositions() is called and resets the isPaginated() flag, see <
rdar://problem/10098679>. | 2527 // updateLayerPositionRecursive() is called and resets the isPaginated() fla
g, see <rdar://problem/10098679>. |
2528 // If this is the case, just bail out, since the upcoming call to updateLaye
rPositions() will repaint the layer. | 2528 // If this is the case, just bail out, since the upcoming call to updateLaye
rPositionRecursive() will repaint the layer. |
2529 if (!columnLayers.size()) | 2529 if (!columnLayers.size()) |
2530 return; | 2530 return; |
2531 | 2531 |
2532 paintChildLayerIntoColumns(childLayer, context, paintingInfo, paintFlags, co
lumnLayers, columnLayers.size() - 1); | 2532 paintChildLayerIntoColumns(childLayer, context, paintingInfo, paintFlags, co
lumnLayers, columnLayers.size() - 1); |
2533 } | 2533 } |
2534 | 2534 |
2535 void RenderLayer::paintChildLayerIntoColumns(RenderLayer* childLayer, GraphicsCo
ntext* context, const LayerPaintingInfo& paintingInfo, | 2535 void RenderLayer::paintChildLayerIntoColumns(RenderLayer* childLayer, GraphicsCo
ntext* context, const LayerPaintingInfo& paintingInfo, |
2536 PaintLayerFlags paintFlags, const Vector<RenderLayer*>& columnLayers, size_t
colIndex) | 2536 PaintLayerFlags paintFlags, const Vector<RenderLayer*>& columnLayers, size_t
colIndex) |
2537 { | 2537 { |
2538 RenderBlock* columnBlock = toRenderBlock(columnLayers[colIndex]->renderer())
; | 2538 RenderBlock* columnBlock = toRenderBlock(columnLayers[colIndex]->renderer())
; |
(...skipping 1350 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3889 } | 3889 } |
3890 } | 3890 } |
3891 | 3891 |
3892 void showLayerTree(const WebCore::RenderObject* renderer) | 3892 void showLayerTree(const WebCore::RenderObject* renderer) |
3893 { | 3893 { |
3894 if (!renderer) | 3894 if (!renderer) |
3895 return; | 3895 return; |
3896 showLayerTree(renderer->enclosingLayer()); | 3896 showLayerTree(renderer->enclosingLayer()); |
3897 } | 3897 } |
3898 #endif | 3898 #endif |
OLD | NEW |