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

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

Issue 276583002: Fix const correctness of containerForRepaint (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Fix LayoutRepainter Created 6 years, 7 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/RenderObject.h ('k') | Source/core/rendering/RenderSelectionInfo.h » ('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) 1999 Lars Knoll (knoll@kde.org) 2 * Copyright (C) 1999 Lars Knoll (knoll@kde.org)
3 * (C) 1999 Antti Koivisto (koivisto@kde.org) 3 * (C) 1999 Antti Koivisto (koivisto@kde.org)
4 * (C) 2000 Dirk Mueller (mueller@kde.org) 4 * (C) 2000 Dirk Mueller (mueller@kde.org)
5 * (C) 2004 Allan Sandfeld Jensen (kde@carewolf.com) 5 * (C) 2004 Allan Sandfeld Jensen (kde@carewolf.com)
6 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2011 Apple Inc. All rights reserv ed. 6 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2011 Apple Inc. All rights reserv ed.
7 * Copyright (C) 2009 Google Inc. All rights reserved. 7 * Copyright (C) 2009 Google Inc. All rights reserved.
8 * Copyright (C) 2009 Torch Mobile Inc. All rights reserved. (http://www.torchmo bile.com/) 8 * Copyright (C) 2009 Torch Mobile Inc. All rights reserved. (http://www.torchmo bile.com/)
9 * 9 *
10 * This library is free software; you can redistribute it and/or 10 * This library is free software; you can redistribute it and/or
(...skipping 1317 matching lines...) Expand 10 before | Expand all | Expand 10 after
1328 topLevelRect = result; 1328 topLevelRect = result;
1329 for (RenderObject* current = firstChild(); current; current = current->nextS ibling()) 1329 for (RenderObject* current = firstChild(); current; current = current->nextS ibling())
1330 current->addAbsoluteRectForLayer(result); 1330 current->addAbsoluteRectForLayer(result);
1331 return result; 1331 return result;
1332 } 1332 }
1333 1333
1334 void RenderObject::paint(PaintInfo&, const LayoutPoint&) 1334 void RenderObject::paint(PaintInfo&, const LayoutPoint&)
1335 { 1335 {
1336 } 1336 }
1337 1337
1338 RenderLayerModelObject* RenderObject::containerForRepaint() const 1338 const RenderLayerModelObject* RenderObject::containerForRepaint() const
1339 { 1339 {
1340 if (!isRooted()) 1340 if (!isRooted())
1341 return 0; 1341 return 0;
1342 1342
1343 RenderLayerModelObject* repaintContainer = 0; 1343 const RenderLayerModelObject* repaintContainer = 0;
1344 1344
1345 RenderView* renderView = view(); 1345 RenderView* renderView = view();
1346 if (renderView->usesCompositing()) { 1346 if (renderView->usesCompositing()) {
1347 // FIXME: CompositingState is not necessarily up to date for many caller s of this function. 1347 // FIXME: CompositingState is not necessarily up to date for many caller s of this function.
1348 DisableCompositingQueryAsserts disabler; 1348 DisableCompositingQueryAsserts disabler;
1349 1349
1350 if (RenderLayer* compositingLayer = enclosingLayer()->enclosingCompositi ngLayerForRepaint()) 1350 if (RenderLayer* compositingLayer = enclosingLayer()->enclosingCompositi ngLayerForRepaint())
1351 repaintContainer = compositingLayer->renderer(); 1351 repaintContainer = compositingLayer->renderer();
1352 } 1352 }
1353 1353
(...skipping 88 matching lines...) Expand 10 before | Expand all | Expand 10 after
1442 { 1442 {
1443 if (!isRooted()) 1443 if (!isRooted())
1444 return; 1444 return;
1445 1445
1446 if (view()->document().printing()) 1446 if (view()->document().printing())
1447 return; // Don't repaint if we're printing. 1447 return; // Don't repaint if we're printing.
1448 1448
1449 // FIXME: really, we're in the repaint phase here, and the following queries are legal. 1449 // FIXME: really, we're in the repaint phase here, and the following queries are legal.
1450 // Until those states are fully fledged, I'll just disable the ASSERTS. 1450 // Until those states are fully fledged, I'll just disable the ASSERTS.
1451 DisableCompositingQueryAsserts disabler; 1451 DisableCompositingQueryAsserts disabler;
1452 RenderLayerModelObject* repaintContainer = containerForRepaint(); 1452 const RenderLayerModelObject* repaintContainer = containerForRepaint();
1453 repaintUsingContainer(repaintContainer, pixelSnappedIntRect(clippedOverflowR ectForRepaint(repaintContainer)), InvalidationRepaint); 1453 repaintUsingContainer(repaintContainer, pixelSnappedIntRect(clippedOverflowR ectForRepaint(repaintContainer)), InvalidationRepaint);
1454 } 1454 }
1455 1455
1456 void RenderObject::repaintRectangle(const LayoutRect& r) const 1456 void RenderObject::repaintRectangle(const LayoutRect& r) const
1457 { 1457 {
1458 if (!isRooted()) 1458 if (!isRooted())
1459 return; 1459 return;
1460 1460
1461 if (view()->document().printing()) 1461 if (view()->document().printing())
1462 return; // Don't repaint if we're printing. 1462 return; // Don't repaint if we're printing.
1463 1463
1464 LayoutRect dirtyRect(r); 1464 LayoutRect dirtyRect(r);
1465 1465
1466 if (!RuntimeEnabledFeatures::repaintAfterLayoutEnabled()) { 1466 if (!RuntimeEnabledFeatures::repaintAfterLayoutEnabled()) {
1467 // FIXME: layoutDelta needs to be applied in parts before/after transfor ms and 1467 // FIXME: layoutDelta needs to be applied in parts before/after transfor ms and
1468 // repaint containers. https://bugs.webkit.org/show_bug.cgi?id=23308 1468 // repaint containers. https://bugs.webkit.org/show_bug.cgi?id=23308
1469 dirtyRect.move(view()->layoutDelta()); 1469 dirtyRect.move(view()->layoutDelta());
1470 } 1470 }
1471 1471
1472 RenderLayerModelObject* repaintContainer = containerForRepaint(); 1472 const RenderLayerModelObject* repaintContainer = containerForRepaint();
1473 computeRectForRepaint(repaintContainer, dirtyRect); 1473 computeRectForRepaint(repaintContainer, dirtyRect);
1474 repaintUsingContainer(repaintContainer, pixelSnappedIntRect(dirtyRect), Inva lidationRepaintRectangle); 1474 repaintUsingContainer(repaintContainer, pixelSnappedIntRect(dirtyRect), Inva lidationRepaintRectangle);
1475 } 1475 }
1476 1476
1477 IntRect RenderObject::pixelSnappedAbsoluteClippedOverflowRect() const 1477 IntRect RenderObject::pixelSnappedAbsoluteClippedOverflowRect() const
1478 { 1478 {
1479 return pixelSnappedIntRect(absoluteClippedOverflowRect()); 1479 return pixelSnappedIntRect(absoluteClippedOverflowRect());
1480 } 1480 }
1481 1481
1482 const char* RenderObject::invalidationReasonToString(InvalidationReason reason) const 1482 const char* RenderObject::invalidationReasonToString(InvalidationReason reason) const
(...skipping 1953 matching lines...) Expand 10 before | Expand all | Expand 10 after
3436 { 3436 {
3437 if (object1) { 3437 if (object1) {
3438 const WebCore::RenderObject* root = object1; 3438 const WebCore::RenderObject* root = object1;
3439 while (root->parent()) 3439 while (root->parent())
3440 root = root->parent(); 3440 root = root->parent();
3441 root->showRenderTreeAndMark(object1, "*", object2, "-", 0); 3441 root->showRenderTreeAndMark(object1, "*", object2, "-", 0);
3442 } 3442 }
3443 } 3443 }
3444 3444
3445 #endif 3445 #endif
OLDNEW
« no previous file with comments | « Source/core/rendering/RenderObject.h ('k') | Source/core/rendering/RenderSelectionInfo.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698