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

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

Issue 285103003: [RAL] Make sure RenderLayers are invalidated when moved. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Test Expectations Created 6 years, 6 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/RenderLayerModelObject.cpp » ('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 245 matching lines...) Expand 10 before | Expand all | Expand 10 after
256 { 256 {
257 TRACE_EVENT0("blink_rendering", "RenderLayer::updateLayerPositionsAfterLayou t"); 257 TRACE_EVENT0("blink_rendering", "RenderLayer::updateLayerPositionsAfterLayou t");
258 258
259 // FIXME: Remove incremental compositing updates after fixing the chicken/eg g issues 259 // FIXME: Remove incremental compositing updates after fixing the chicken/eg g issues
260 // https://code.google.com/p/chromium/issues/detail?id=343756 260 // https://code.google.com/p/chromium/issues/detail?id=343756
261 DisableCompositingQueryAsserts disabler; 261 DisableCompositingQueryAsserts disabler;
262 262
263 RenderGeometryMap geometryMap(UseTransforms); 263 RenderGeometryMap geometryMap(UseTransforms);
264 if (this != rootLayer) 264 if (this != rootLayer)
265 geometryMap.pushMappingsToAncestor(parent(), 0); 265 geometryMap.pushMappingsToAncestor(parent(), 0);
266 updateLayerPositions(&geometryMap, flags); 266 updateLayerPositions(&geometryMap, rootLayer->renderer()->containerForRepain t(), flags);
267 } 267 }
268 268
269 void RenderLayer::updateLayerPositions(RenderGeometryMap* geometryMap, UpdateLay erPositionsFlags flags) 269 void RenderLayer::updateLayerPositions(RenderGeometryMap* geometryMap, const Ren derLayerModelObject* paintInvalidationContainer, UpdateLayerPositionsFlags flags )
270 { 270 {
271 // For performance reasons we only check if the RenderObject has moved if we
272 // have a geometryMap. If not, blank out the paint invalidation container so we
273 // can skip doing any further work to update it.
274 if (!geometryMap)
275 paintInvalidationContainer = 0;
276
271 updateLayerPosition(); // For relpositioned layers or non-positioned layers, 277 updateLayerPosition(); // For relpositioned layers or non-positioned layers,
272 // we need to keep in sync, since we may have shifted relative 278 // we need to keep in sync, since we may have shifted relative
273 // to our parent layer. 279 // to our parent layer.
274 if (geometryMap) 280 if (geometryMap)
275 geometryMap->pushMappingsToAncestor(this, parent()); 281 geometryMap->pushMappingsToAncestor(this, parent());
276 282
277 // Clear our cached clip rect information. 283 // Clear our cached clip rect information.
278 m_clipper.clearClipRects(); 284 m_clipper.clearClipRects();
279 285
280 if (hasOverflowControls()) { 286 if (hasOverflowControls()) {
(...skipping 10 matching lines...) Expand all
291 297
292 updateDescendantDependentFlags(); 298 updateDescendantDependentFlags();
293 299
294 if (flags & UpdatePagination) 300 if (flags & UpdatePagination)
295 updatePagination(); 301 updatePagination();
296 else { 302 else {
297 m_isPaginated = false; 303 m_isPaginated = false;
298 m_enclosingPaginationLayer = 0; 304 m_enclosingPaginationLayer = 0;
299 } 305 }
300 306
307 const RenderLayerModelObject* newPaintInvalidationContainer = paintInvalidat ionContainer;
308 // If we don't have a paintInvalidationContainer then we can't check if
309 // the object has moved.
310 if (RuntimeEnabledFeatures::repaintAfterLayoutEnabled() && paintInvalidation Container) {
311 bool establishesNewPaintInvalidationContainer = isRepaintContainer();
312 newPaintInvalidationContainer = renderer()->adjustCompositedContainerFor SpecialAncestors(establishesNewPaintInvalidationContainer ? renderer() : paintIn validationContainer);
313
314 LayoutPoint offset = renderer()->isBox() ? toRenderBox(renderer())->loca tion() : LayoutPoint();
315 if (renderer()->previousPositionFromPaintInvalidationContainer() != geom etryMap->mapToContainer(offset, newPaintInvalidationContainer))
316 renderer()->setMayNeedPaintInvalidation(true);
317 }
318
301 repainter().repaintAfterLayout(flags & CheckForRepaint); 319 repainter().repaintAfterLayout(flags & CheckForRepaint);
302 320
303 // Go ahead and update the reflection's position and size. 321 // Go ahead and update the reflection's position and size.
304 if (m_reflectionInfo) 322 if (m_reflectionInfo)
305 m_reflectionInfo->reflection()->layout(); 323 m_reflectionInfo->reflection()->layout();
306 324
307 if (useRegionBasedColumns() && renderer()->isRenderFlowThread()) { 325 if (useRegionBasedColumns() && renderer()->isRenderFlowThread()) {
308 updatePagination(); 326 updatePagination();
309 flags |= UpdatePagination; 327 flags |= UpdatePagination;
310 } 328 }
311 329
312 if (renderer()->hasColumns()) 330 if (renderer()->hasColumns())
313 flags |= UpdatePagination; 331 flags |= UpdatePagination;
314 332
315 for (RenderLayer* child = firstChild(); child; child = child->nextSibling()) 333 for (RenderLayer* child = firstChild(); child; child = child->nextSibling())
316 child->updateLayerPositions(geometryMap, flags); 334 child->updateLayerPositions(geometryMap, newPaintInvalidationContainer, flags);
317 335
318 if ((flags & NeedsFullRepaintInBacking) && hasCompositedLayerMapping() && !c ompositedLayerMapping()->paintsIntoCompositedAncestor()) 336 if ((flags & NeedsFullRepaintInBacking) && hasCompositedLayerMapping() && !c ompositedLayerMapping()->paintsIntoCompositedAncestor())
319 compositedLayerMapping()->setContentsNeedDisplay(); 337 compositedLayerMapping()->setContentsNeedDisplay();
320 338
321 if (geometryMap) 339 if (geometryMap)
322 geometryMap->popMappingsToAncestor(parent()); 340 geometryMap->popMappingsToAncestor(parent());
323 } 341 }
324 342
325 void RenderLayer::setAncestorChainHasSelfPaintingLayerDescendant() 343 void RenderLayer::setAncestorChainHasSelfPaintingLayerDescendant()
326 { 344 {
(...skipping 1149 matching lines...) Expand 10 before | Expand all | Expand 10 after
1476 m_parent->addChild(current, nextSib); 1494 m_parent->addChild(current, nextSib);
1477 1495
1478 if (RuntimeEnabledFeatures::repaintAfterLayoutEnabled()) 1496 if (RuntimeEnabledFeatures::repaintAfterLayoutEnabled())
1479 current->renderer()->setShouldDoFullPaintInvalidationAfterLayout(tru e); 1497 current->renderer()->setShouldDoFullPaintInvalidationAfterLayout(tru e);
1480 else 1498 else
1481 current->repainter().setRepaintStatus(NeedsFullRepaint); 1499 current->repainter().setRepaintStatus(NeedsFullRepaint);
1482 1500
1483 // Hits in compositing/overflow/automatically-opt-into-composited-scroll ing-part-1.html 1501 // Hits in compositing/overflow/automatically-opt-into-composited-scroll ing-part-1.html
1484 DisableCompositingQueryAsserts disabler; 1502 DisableCompositingQueryAsserts disabler;
1485 1503
1486 current->updateLayerPositions(0); // FIXME: use geometry map. 1504 current->updateLayerPositions(0, 0); // FIXME: use geometry map.
1487 current = next; 1505 current = next;
1488 } 1506 }
1489 1507
1490 // Remove us from the parent. 1508 // Remove us from the parent.
1491 m_parent->removeChild(this); 1509 m_parent->removeChild(this);
1492 m_renderer->destroyLayer(); 1510 m_renderer->destroyLayer();
1493 } 1511 }
1494 1512
1495 void RenderLayer::insertOnlyThisLayer() 1513 void RenderLayer::insertOnlyThisLayer()
1496 { 1514 {
(...skipping 2430 matching lines...) Expand 10 before | Expand all | Expand 10 after
3927 } 3945 }
3928 } 3946 }
3929 3947
3930 void showLayerTree(const WebCore::RenderObject* renderer) 3948 void showLayerTree(const WebCore::RenderObject* renderer)
3931 { 3949 {
3932 if (!renderer) 3950 if (!renderer)
3933 return; 3951 return;
3934 showLayerTree(renderer->enclosingLayer()); 3952 showLayerTree(renderer->enclosingLayer());
3935 } 3953 }
3936 #endif 3954 #endif
OLDNEW
« no previous file with comments | « Source/core/rendering/RenderLayer.h ('k') | Source/core/rendering/RenderLayerModelObject.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698