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

Side by Side Diff: third_party/WebKit/Source/core/layout/LayoutObject.cpp

Issue 2000763003: Check subtree paint invalidation when overflow clip status changes (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 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
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 1296 matching lines...) Expand 10 before | Expand all | Expand 10 after
1307 { 1307 {
1308 ASSERT(!needsLayout()); 1308 ASSERT(!needsLayout());
1309 1309
1310 // If we didn't need paint invalidation then our children don't need as well . 1310 // If we didn't need paint invalidation then our children don't need as well .
1311 // Skip walking down the tree as everything should be fine below us. 1311 // Skip walking down the tree as everything should be fine below us.
1312 if (!shouldCheckForPaintInvalidation(paintInvalidationState)) 1312 if (!shouldCheckForPaintInvalidation(paintInvalidationState))
1313 return; 1313 return;
1314 1314
1315 PaintInvalidationState newPaintInvalidationState(paintInvalidationState, *th is); 1315 PaintInvalidationState newPaintInvalidationState(paintInvalidationState, *th is);
1316 PaintInvalidationReason reason = invalidatePaintIfNeeded(newPaintInvalidatio nState); 1316 PaintInvalidationReason reason = invalidatePaintIfNeeded(newPaintInvalidatio nState);
1317 clearPaintInvalidationFlags(newPaintInvalidationState);
1318 1317
1319 newPaintInvalidationState.updateForChildren(reason); 1318 newPaintInvalidationState.updateForChildren(reason);
1319 clearPaintInvalidationFlags(newPaintInvalidationState);
1320 invalidatePaintOfSubtreesIfNeeded(newPaintInvalidationState); 1320 invalidatePaintOfSubtreesIfNeeded(newPaintInvalidationState);
1321 } 1321 }
1322 1322
1323 void LayoutObject::invalidatePaintOfSubtreesIfNeeded(const PaintInvalidationStat e& childPaintInvalidationState) 1323 void LayoutObject::invalidatePaintOfSubtreesIfNeeded(const PaintInvalidationStat e& childPaintInvalidationState)
1324 { 1324 {
1325 for (LayoutObject* child = slowFirstChild(); child; child = child->nextSibli ng()) { 1325 for (LayoutObject* child = slowFirstChild(); child; child = child->nextSibli ng()) {
1326 // Column spanners are invalidated through their placeholders. 1326 // Column spanners are invalidated through their placeholders.
1327 // See LayoutMultiColumnSpannerPlaceholder::invalidatePaintOfSubtreesIfN eeded(). 1327 // See LayoutMultiColumnSpannerPlaceholder::invalidatePaintOfSubtreesIfN eeded().
1328 if (child->isColumnSpanAll()) 1328 if (child->isColumnSpanAll())
1329 continue; 1329 continue;
(...skipping 2117 matching lines...) Expand 10 before | Expand all | Expand 10 after
3447 3447
3448 void LayoutObject::setMayNeedPaintInvalidation() 3448 void LayoutObject::setMayNeedPaintInvalidation()
3449 { 3449 {
3450 if (mayNeedPaintInvalidation()) 3450 if (mayNeedPaintInvalidation())
3451 return; 3451 return;
3452 m_bitfields.setMayNeedPaintInvalidation(true); 3452 m_bitfields.setMayNeedPaintInvalidation(true);
3453 markAncestorsForPaintInvalidation(); 3453 markAncestorsForPaintInvalidation();
3454 frameView()->scheduleVisualUpdateForPaintInvalidationIfNeeded(); 3454 frameView()->scheduleVisualUpdateForPaintInvalidationIfNeeded();
3455 } 3455 }
3456 3456
3457 void LayoutObject::setMayNeedPaintInvalidationSubtree()
3458 {
3459 if (mayNeedPaintInvalidationSubtree())
3460 return;
3461 m_bitfields.setMayNeedPaintInvalidationSubtree(true);
3462 setMayNeedPaintInvalidation();
3463 }
3464
3457 void LayoutObject::clearPaintInvalidationFlags(const PaintInvalidationState& pai ntInvalidationState) 3465 void LayoutObject::clearPaintInvalidationFlags(const PaintInvalidationState& pai ntInvalidationState)
3458 { 3466 {
3459 // paintInvalidationStateIsDirty should be kept in sync with the 3467 // paintInvalidationStateIsDirty should be kept in sync with the
3460 // booleans that are cleared below. 3468 // booleans that are cleared below.
3461 ASSERT(!shouldCheckForPaintInvalidationRegardlessOfPaintInvalidationState() || paintInvalidationStateIsDirty()); 3469 ASSERT(!shouldCheckForPaintInvalidationRegardlessOfPaintInvalidationState() || paintInvalidationStateIsDirty());
3462 clearShouldDoFullPaintInvalidation(); 3470 clearShouldDoFullPaintInvalidation();
3463 m_bitfields.setChildShouldCheckForPaintInvalidation(false); 3471 m_bitfields.setChildShouldCheckForPaintInvalidation(false);
3464 m_bitfields.setNeededLayoutBecauseOfChildren(false); 3472 m_bitfields.setNeededLayoutBecauseOfChildren(false);
3465 m_bitfields.setShouldInvalidateOverflowForPaint(false); 3473 m_bitfields.setShouldInvalidateOverflowForPaint(false);
3466 m_bitfields.setMayNeedPaintInvalidation(false); 3474 m_bitfields.setMayNeedPaintInvalidation(false);
3475 m_bitfields.setMayNeedPaintInvalidationSubtree(false);
3467 m_bitfields.setShouldInvalidateSelection(false); 3476 m_bitfields.setShouldInvalidateSelection(false);
3468 } 3477 }
3469 3478
3470 bool LayoutObject::isAllowedToModifyLayoutTreeStructure(Document& document) 3479 bool LayoutObject::isAllowedToModifyLayoutTreeStructure(Document& document)
3471 { 3480 {
3472 return DeprecatedDisableModifyLayoutTreeStructureAsserts::canModifyLayoutTre eStateInAnyState() 3481 return DeprecatedDisableModifyLayoutTreeStructureAsserts::canModifyLayoutTre eStateInAnyState()
3473 || document.lifecycle().stateAllowsLayoutTreeMutations(); 3482 || document.lifecycle().stateAllowsLayoutTreeMutations();
3474 } 3483 }
3475 3484
3476 DeprecatedDisableModifyLayoutTreeStructureAsserts::DeprecatedDisableModifyLayout TreeStructureAsserts() 3485 DeprecatedDisableModifyLayoutTreeStructureAsserts::DeprecatedDisableModifyLayout TreeStructureAsserts()
(...skipping 212 matching lines...) Expand 10 before | Expand all | Expand 10 after
3689 const blink::LayoutObject* root = object1; 3698 const blink::LayoutObject* root = object1;
3690 while (root->parent()) 3699 while (root->parent())
3691 root = root->parent(); 3700 root = root->parent();
3692 root->showLayoutTreeAndMark(object1, "*", object2, "-", 0); 3701 root->showLayoutTreeAndMark(object1, "*", object2, "-", 0);
3693 } else { 3702 } else {
3694 fprintf(stderr, "Cannot showLayoutTree. Root is (nil)\n"); 3703 fprintf(stderr, "Cannot showLayoutTree. Root is (nil)\n");
3695 } 3704 }
3696 } 3705 }
3697 3706
3698 #endif 3707 #endif
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698