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

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

Issue 264963004: Mark when we may have been invalidated to early out on repaintTreeAfterLayout. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: 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
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 1494 matching lines...) Expand 10 before | Expand all | Expand 10 after
1505 return "repaint"; 1505 return "repaint";
1506 case InvalidationRepaintRectangle: 1506 case InvalidationRepaintRectangle:
1507 return "repaint rectangle"; 1507 return "repaint rectangle";
1508 } 1508 }
1509 ASSERT_NOT_REACHED(); 1509 ASSERT_NOT_REACHED();
1510 return ""; 1510 return "";
1511 } 1511 }
1512 1512
1513 void RenderObject::repaintTreeAfterLayout() 1513 void RenderObject::repaintTreeAfterLayout()
1514 { 1514 {
1515 // If we didn't need invalidation then our children don't need as well.
1516 // Skip walking down the tree as everything should be fine below us.
1517 if (!mayNeedInvalidation())
1518 return;
1519
1515 clearRepaintState(); 1520 clearRepaintState();
1516 1521
1517 for (RenderObject* child = firstChild(); child; child = child->nextSibling() ) { 1522 for (RenderObject* child = firstChild(); child; child = child->nextSibling() ) {
1518 if (!child->isOutOfFlowPositioned()) 1523 if (!child->isOutOfFlowPositioned())
fs 2014/05/02 17:21:42 Could the children be "gated" here instead? Won't
1519 child->repaintTreeAfterLayout(); 1524 child->repaintTreeAfterLayout();
1520 } 1525 }
1521 } 1526 }
1522 1527
1523 static PassRefPtr<JSONValue> jsonObjectForOldAndNewRects(const LayoutRect& oldRe ct, const LayoutRect& newRect) 1528 static PassRefPtr<JSONValue> jsonObjectForOldAndNewRects(const LayoutRect& oldRe ct, const LayoutRect& newRect)
1524 { 1529 {
1525 RefPtr<JSONObject> object = JSONObject::create(); 1530 RefPtr<JSONObject> object = JSONObject::create();
1526 1531
1527 object->setValue("old", jsonObjectForRect(oldRect)); 1532 object->setValue("old", jsonObjectForRect(oldRect));
1528 object->setValue("new", jsonObjectForRect(newRect)); 1533 object->setValue("new", jsonObjectForRect(newRect));
(...skipping 1862 matching lines...) Expand 10 before | Expand all | Expand 10 after
3391 { 3396 {
3392 return objectIsRelayoutBoundary(this); 3397 return objectIsRelayoutBoundary(this);
3393 } 3398 }
3394 3399
3395 void RenderObject::clearRepaintState() 3400 void RenderObject::clearRepaintState()
3396 { 3401 {
3397 setShouldDoFullRepaintAfterLayout(false); 3402 setShouldDoFullRepaintAfterLayout(false);
3398 setShouldDoFullRepaintIfSelfPaintingLayer(false); 3403 setShouldDoFullRepaintIfSelfPaintingLayer(false);
3399 setShouldRepaintOverflow(false); 3404 setShouldRepaintOverflow(false);
3400 setLayoutDidGetCalled(false); 3405 setLayoutDidGetCalled(false);
3406 setMayNeedInvalidation(false);
3401 } 3407 }
3402 3408
3403 } // namespace WebCore 3409 } // namespace WebCore
3404 3410
3405 #ifndef NDEBUG 3411 #ifndef NDEBUG
3406 3412
3407 void showTree(const WebCore::RenderObject* object) 3413 void showTree(const WebCore::RenderObject* object)
3408 { 3414 {
3409 if (object) 3415 if (object)
3410 object->showTreeForThis(); 3416 object->showTreeForThis();
(...skipping 14 matching lines...) Expand all
3425 { 3431 {
3426 if (object1) { 3432 if (object1) {
3427 const WebCore::RenderObject* root = object1; 3433 const WebCore::RenderObject* root = object1;
3428 while (root->parent()) 3434 while (root->parent())
3429 root = root->parent(); 3435 root = root->parent();
3430 root->showRenderTreeAndMark(object1, "*", object2, "-", 0); 3436 root->showRenderTreeAndMark(object1, "*", object2, "-", 0);
3431 } 3437 }
3432 } 3438 }
3433 3439
3434 #endif 3440 #endif
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698