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

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

Issue 2665823002: Invalidate caret during paint invalidation (Closed)
Patch Set: Refactor Created 3 years, 10 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. 6 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2011 Apple Inc.
7 * All rights reserved. 7 * All rights reserved.
8 * Copyright (C) 2009 Google Inc. All rights reserved. 8 * Copyright (C) 2009 Google Inc. All rights reserved.
9 * Copyright (C) 2009 Torch Mobile Inc. All rights reserved. 9 * Copyright (C) 2009 Torch Mobile Inc. All rights reserved.
10 * (http://www.torchmobile.com/) 10 * (http://www.torchmobile.com/)
(...skipping 1496 matching lines...) Expand 10 before | Expand all | Expand 10 after
1507 1507
1508 // TODO(wangxianzhu): We may avoid subtree paint invalidation on CSS clip 1508 // TODO(wangxianzhu): We may avoid subtree paint invalidation on CSS clip
1509 // change for SPv2. 1509 // change for SPv2.
1510 if (diff.cssClipChanged()) 1510 if (diff.cssClipChanged())
1511 diff.setNeedsPaintInvalidationSubtree(); 1511 diff.setNeedsPaintInvalidationSubtree();
1512 1512
1513 // Optimization: for decoration/color property changes, invalidation is only 1513 // Optimization: for decoration/color property changes, invalidation is only
1514 // needed if we have style or text affected by these properties. 1514 // needed if we have style or text affected by these properties.
1515 if (diff.textDecorationOrColorChanged() && !diff.needsPaintInvalidation()) { 1515 if (diff.textDecorationOrColorChanged() && !diff.needsPaintInvalidation()) {
1516 if (style()->hasBorder() || style()->hasOutline() || 1516 if (style()->hasBorder() || style()->hasOutline() ||
1517 style()->hasBackgroundRelatedColorReferencingCurrentColor() 1517 style()->hasBackgroundRelatedColorReferencingCurrentColor() ||
1518 // Skip any text nodes that do not contain text boxes. Whitespace cannot 1518 // Skip any text nodes that do not contain text boxes. Whitespace cannot
1519 // be skipped or we will miss invalidating decorations (e.g., 1519 // be skipped or we will miss invalidating decorations (e.g.,
1520 // underlines). 1520 // underlines).
1521 || (isText() && !isBR() && toLayoutText(this)->hasTextBoxes()) 1521 (isText() && !isBR() && toLayoutText(this)->hasTextBoxes()) ||
1522 // Caret is painted in text color.
1523 || (isLayoutBlock() && toLayoutBlock(this)->hasCaret()) ||
chrishtr 2017/02/03 02:07:01 Why can this line go?
Xianzhu 2017/02/03 04:31:28 Now we always check for caret change in each frame
1524 (isSVG() && style()->svgStyle().isFillColorCurrentColor()) || 1522 (isSVG() && style()->svgStyle().isFillColorCurrentColor()) ||
1525 (isSVG() && style()->svgStyle().isStrokeColorCurrentColor()) || 1523 (isSVG() && style()->svgStyle().isStrokeColorCurrentColor()) ||
1526 isListMarker()) 1524 isListMarker())
1527 diff.setNeedsPaintInvalidationObject(); 1525 diff.setNeedsPaintInvalidationObject();
1528 } 1526 }
1529 1527
1530 // The answer to layerTypeRequired() for plugins, iframes, and canvas can 1528 // The answer to layerTypeRequired() for plugins, iframes, and canvas can
1531 // change without the actual style changing, since it depends on whether we 1529 // change without the actual style changing, since it depends on whether we
1532 // decide to composite these elements. When the/ layer status of one of these 1530 // decide to composite these elements. When the/ layer status of one of these
1533 // elements changes, we need to force a layout. 1531 // elements changes, we need to force a layout.
(...skipping 1965 matching lines...) Expand 10 before | Expand all | Expand 10 after
3499 const blink::LayoutObject* root = object1; 3497 const blink::LayoutObject* root = object1;
3500 while (root->parent()) 3498 while (root->parent())
3501 root = root->parent(); 3499 root = root->parent();
3502 root->showLayoutTreeAndMark(object1, "*", object2, "-", 0); 3500 root->showLayoutTreeAndMark(object1, "*", object2, "-", 0);
3503 } else { 3501 } else {
3504 WTFLogAlways("%s", "Cannot showLayoutTree. Root is (nil)"); 3502 WTFLogAlways("%s", "Cannot showLayoutTree. Root is (nil)");
3505 } 3503 }
3506 } 3504 }
3507 3505
3508 #endif 3506 #endif
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/core/layout/LayoutBlock.cpp ('k') | third_party/WebKit/Source/core/paint/BlockPaintInvalidator.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698