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

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

Issue 337593002: Remove call to setMayNeedPaintInvalidation in RenderLayer::updateLayerPositionRecursive (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: MOre cleanup 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
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 244 matching lines...) Expand 10 before | Expand all | Expand 10 after
255 { 255 {
256 TRACE_EVENT0("blink_rendering", "RenderLayer::updateLayerPositionsAfterLayou t"); 256 TRACE_EVENT0("blink_rendering", "RenderLayer::updateLayerPositionsAfterLayou t");
257 257
258 // FIXME: Remove incremental compositing updates after fixing the chicken/eg g issues 258 // FIXME: Remove incremental compositing updates after fixing the chicken/eg g issues
259 // https://code.google.com/p/chromium/issues/detail?id=343756 259 // https://code.google.com/p/chromium/issues/detail?id=343756
260 DisableCompositingQueryAsserts disabler; 260 DisableCompositingQueryAsserts disabler;
261 261
262 RenderGeometryMap geometryMap(UseTransforms); 262 RenderGeometryMap geometryMap(UseTransforms);
263 if (this != rootLayer) 263 if (this != rootLayer)
264 geometryMap.pushMappingsToAncestor(parent(), 0); 264 geometryMap.pushMappingsToAncestor(parent(), 0);
265 updateLayerPositionRecursive(&geometryMap, rootLayer->renderer()->containerF orPaintInvalidation(), flags); 265 updateLayerPositionRecursive(&geometryMap, flags);
266 } 266 }
267 267
268 void RenderLayer::updateLayerPositionRecursive(RenderGeometryMap* geometryMap, c onst RenderLayerModelObject* paintInvalidationContainer, UpdateLayerPositionsFla gs flags) 268 void RenderLayer::updateLayerPositionRecursive(RenderGeometryMap* geometryMap, U pdateLayerPositionsFlags flags)
269 { 269 {
270 // For performance reasons we only check if the RenderObject has moved if we 270 updateLayerPosition();
271 // have a geometryMap. If not, blank out the paint invalidation container so we
272 // can skip doing any further work to update it.
273 if (!geometryMap)
274 paintInvalidationContainer = 0;
275 271
276 updateLayerPosition(); // For relpositioned layers or non-positioned layers,
277 // we need to keep in sync, since we may have shifted relative
278 // to our parent layer.
279 if (geometryMap) 272 if (geometryMap)
280 geometryMap->pushMappingsToAncestor(this, parent()); 273 geometryMap->pushMappingsToAncestor(this, parent());
281 274
282 // Clear our cached clip rect information. 275 // Clear our cached clip rect information.
283 m_clipper.clearClipRects(); 276 m_clipper.clearClipRects();
284 277
285 if (hasOverflowControls()) { 278 if (hasOverflowControls()) {
286 LayoutPoint offsetFromRoot; 279 LayoutPoint offsetFromRoot;
287 if (geometryMap) 280 if (geometryMap)
288 offsetFromRoot = LayoutPoint(geometryMap->absolutePoint(FloatPoint() )); 281 offsetFromRoot = LayoutPoint(geometryMap->absolutePoint(FloatPoint() ));
289 else { 282 else {
290 // FIXME: It looks suspicious to call convertToLayerCoords here 283 // FIXME: It looks suspicious to call convertToLayerCoords here
291 // as canUseConvertToLayerCoords may be true for an ancestor layer. 284 // as canUseConvertToLayerCoords may be true for an ancestor layer.
292 convertToLayerCoords(root(), offsetFromRoot); 285 convertToLayerCoords(root(), offsetFromRoot);
293 } 286 }
294 scrollableArea()->positionOverflowControls(toIntSize(roundedIntPoint(off setFromRoot))); 287 scrollableArea()->positionOverflowControls(toIntSize(roundedIntPoint(off setFromRoot)));
295 } 288 }
296 289
297 updateDescendantDependentFlags(); 290 updateDescendantDependentFlags();
298 291
299 if (flags & UpdatePagination) 292 if (flags & UpdatePagination)
300 updatePagination(); 293 updatePagination();
301 else { 294 else {
302 m_isPaginated = false; 295 m_isPaginated = false;
303 m_enclosingPaginationLayer = 0; 296 m_enclosingPaginationLayer = 0;
304 } 297 }
305 298
306 const RenderLayerModelObject* newPaintInvalidationContainer = paintInvalidat ionContainer;
307 // If we don't have a paintInvalidationContainer then we can't check if
308 // the object has moved.
309 if (RuntimeEnabledFeatures::repaintAfterLayoutEnabled() && paintInvalidation Container) {
310 bool establishesNewPaintInvalidationContainer = isRepaintContainer();
311 newPaintInvalidationContainer = renderer()->adjustCompositedContainerFor SpecialAncestors(establishesNewPaintInvalidationContainer ? renderer() : paintIn validationContainer);
312
313 LayoutPoint offset = renderer()->isBox() ? toRenderBox(renderer())->loca tion() : LayoutPoint();
314 if (renderer()->previousPositionFromPaintInvalidationContainer() != geom etryMap->mapToContainer(offset, newPaintInvalidationContainer))
315 renderer()->setMayNeedPaintInvalidation(true);
316 }
317
318 repainter().repaintAfterLayout(flags & CheckForRepaint); 299 repainter().repaintAfterLayout(flags & CheckForRepaint);
319 300
320 // Go ahead and update the reflection's position and size. 301 // Go ahead and update the reflection's position and size.
321 if (m_reflectionInfo) 302 if (m_reflectionInfo)
322 m_reflectionInfo->reflection()->layout(); 303 m_reflectionInfo->reflection()->layout();
323 304
324 if (useRegionBasedColumns() && renderer()->isRenderFlowThread()) { 305 if (useRegionBasedColumns() && renderer()->isRenderFlowThread()) {
325 updatePagination(); 306 updatePagination();
326 flags |= UpdatePagination; 307 flags |= UpdatePagination;
327 } 308 }
328 309
329 if (renderer()->hasColumns()) 310 if (renderer()->hasColumns())
330 flags |= UpdatePagination; 311 flags |= UpdatePagination;
331 312
332 for (RenderLayer* child = firstChild(); child; child = child->nextSibling()) 313 for (RenderLayer* child = firstChild(); child; child = child->nextSibling())
333 child->updateLayerPositionRecursive(geometryMap, newPaintInvalidationCon tainer, flags); 314 child->updateLayerPositionRecursive(geometryMap, flags);
334 315
335 if ((flags & NeedsFullRepaintInBacking) && hasCompositedLayerMapping() && !c ompositedLayerMapping()->paintsIntoCompositedAncestor()) 316 if ((flags & NeedsFullRepaintInBacking) && hasCompositedLayerMapping() && !c ompositedLayerMapping()->paintsIntoCompositedAncestor())
336 compositedLayerMapping()->setContentsNeedDisplay(); 317 compositedLayerMapping()->setContentsNeedDisplay();
337 318
338 if (geometryMap) 319 if (geometryMap)
339 geometryMap->popMappingsToAncestor(parent()); 320 geometryMap->popMappingsToAncestor(parent());
340 } 321 }
341 322
342 void RenderLayer::setAncestorChainHasSelfPaintingLayerDescendant() 323 void RenderLayer::setAncestorChainHasSelfPaintingLayerDescendant()
343 { 324 {
(...skipping 1116 matching lines...) Expand 10 before | Expand all | Expand 10 after
1460 m_parent->addChild(current, nextSib); 1441 m_parent->addChild(current, nextSib);
1461 1442
1462 if (RuntimeEnabledFeatures::repaintAfterLayoutEnabled()) 1443 if (RuntimeEnabledFeatures::repaintAfterLayoutEnabled())
1463 current->renderer()->setShouldDoFullPaintInvalidationAfterLayout(tru e); 1444 current->renderer()->setShouldDoFullPaintInvalidationAfterLayout(tru e);
1464 else 1445 else
1465 current->repainter().setRepaintStatus(NeedsFullRepaint); 1446 current->repainter().setRepaintStatus(NeedsFullRepaint);
1466 1447
1467 // Hits in compositing/overflow/automatically-opt-into-composited-scroll ing-part-1.html 1448 // Hits in compositing/overflow/automatically-opt-into-composited-scroll ing-part-1.html
1468 DisableCompositingQueryAsserts disabler; 1449 DisableCompositingQueryAsserts disabler;
1469 1450
1470 current->updateLayerPositionRecursive(0, 0); // FIXME: use geometry map. 1451 current->updateLayerPositionRecursive(0);
1471 current = next; 1452 current = next;
1472 } 1453 }
1473 1454
1474 // Remove us from the parent. 1455 // Remove us from the parent.
1475 m_parent->removeChild(this); 1456 m_parent->removeChild(this);
1476 m_renderer->destroyLayer(); 1457 m_renderer->destroyLayer();
1477 } 1458 }
1478 1459
1479 void RenderLayer::insertOnlyThisLayer() 1460 void RenderLayer::insertOnlyThisLayer()
1480 { 1461 {
(...skipping 2383 matching lines...) Expand 10 before | Expand all | Expand 10 after
3864 } 3845 }
3865 } 3846 }
3866 3847
3867 void showLayerTree(const WebCore::RenderObject* renderer) 3848 void showLayerTree(const WebCore::RenderObject* renderer)
3868 { 3849 {
3869 if (!renderer) 3850 if (!renderer)
3870 return; 3851 return;
3871 showLayerTree(renderer->enclosingLayer()); 3852 showLayerTree(renderer->enclosingLayer());
3872 } 3853 }
3873 #endif 3854 #endif
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698