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

Side by Side Diff: third_party/WebKit/Source/core/style/ComputedStyle.cpp

Issue 2571283002: Remove StyleDifference::needsPaintPropertyUpdate() (Closed)
Patch Set: Fix layout test failures Created 4 years 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 Antti Koivisto (koivisto@kde.org) 2 * Copyright (C) 1999 Antti Koivisto (koivisto@kde.org)
3 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010 Apple Inc. All rights 3 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010 Apple Inc. All rights
4 * reserved. 4 * reserved.
5 * Copyright (C) 2011 Adobe Systems Incorporated. All rights reserved. 5 * Copyright (C) 2011 Adobe Systems Incorporated. All rights reserved.
6 * 6 *
7 * This library is free software; you can redistribute it and/or 7 * This library is free software; you can redistribute it and/or
8 * modify it under the terms of the GNU Library General Public 8 * modify it under the terms of the GNU Library General Public
9 * License as published by the Free Software Foundation; either 9 * License as published by the Free Software Foundation; either
10 * version 2 of the License, or (at your option) any later version. 10 * version 2 of the License, or (at your option) any later version.
(...skipping 568 matching lines...) Expand 10 before | Expand all | Expand 10 after
579 diff.setNeedsPositionedMovementLayout(); 579 diff.setNeedsPositionedMovementLayout();
580 } 580 }
581 581
582 if (diffNeedsPaintInvalidationSubtree(other)) 582 if (diffNeedsPaintInvalidationSubtree(other))
583 diff.setNeedsPaintInvalidationSubtree(); 583 diff.setNeedsPaintInvalidationSubtree();
584 else if (diffNeedsPaintInvalidationObject(other)) 584 else if (diffNeedsPaintInvalidationObject(other))
585 diff.setNeedsPaintInvalidationObject(); 585 diff.setNeedsPaintInvalidationObject();
586 586
587 updatePropertySpecificDifferences(other, diff); 587 updatePropertySpecificDifferences(other, diff);
588 588
589 // The following conditions need to be at last, because they may depend on 589 // The following condition needs to be at last, because it may depend on
590 // conditions in diff computed above. 590 // conditions in diff computed above.
591 if (scrollAnchorDisablingPropertyChanged(other, diff)) 591 if (scrollAnchorDisablingPropertyChanged(other, diff))
592 diff.setScrollAnchorDisablingPropertyChanged(); 592 diff.setScrollAnchorDisablingPropertyChanged();
593 if (diffNeedsPaintPropertyUpdate(other, diff))
594 diff.setNeedsPaintPropertyUpdate();
595 593
596 // Cursors are not checked, since they will be set appropriately in response 594 // Cursors are not checked, since they will be set appropriately in response
597 // to mouse events, so they don't need to cause any paint invalidation or 595 // to mouse events, so they don't need to cause any paint invalidation or
598 // layout. 596 // layout.
599 597
600 // Animations don't need to be checked either. We always set the new style on 598 // Animations don't need to be checked either. We always set the new style on
601 // the layoutObject, so we will get a chance to fire off the resulting 599 // the layoutObject, so we will get a chance to fire off the resulting
602 // transition properly. 600 // transition properly.
603 601
604 return diff; 602 return diff;
(...skipping 520 matching lines...) Expand 10 before | Expand all | Expand 10 after
1125 } 1123 }
1126 1124
1127 bool hasClip = hasOutOfFlowPosition() && !m_visual->hasAutoClip; 1125 bool hasClip = hasOutOfFlowPosition() && !m_visual->hasAutoClip;
1128 bool otherHasClip = 1126 bool otherHasClip =
1129 other.hasOutOfFlowPosition() && !other.m_visual->hasAutoClip; 1127 other.hasOutOfFlowPosition() && !other.m_visual->hasAutoClip;
1130 if (hasClip != otherHasClip || 1128 if (hasClip != otherHasClip ||
1131 (hasClip && m_visual->clip != other.m_visual->clip)) 1129 (hasClip && m_visual->clip != other.m_visual->clip))
1132 diff.setCSSClipChanged(); 1130 diff.setCSSClipChanged();
1133 } 1131 }
1134 1132
1135 bool ComputedStyle::diffNeedsPaintPropertyUpdate(
1136 const ComputedStyle& other,
1137 const StyleDifference& diff) const {
1138 if (diff.transformChanged() || diff.opacityChanged() ||
1139 diff.zIndexChanged() || diff.filterChanged() ||
1140 diff.backdropFilterChanged() || diff.cssClipChanged())
1141 return true;
1142
1143 return false;
1144 }
1145
1146 void ComputedStyle::addPaintImage(StyleImage* image) { 1133 void ComputedStyle::addPaintImage(StyleImage* image) {
1147 if (!m_rareNonInheritedData.access()->m_paintImages) { 1134 if (!m_rareNonInheritedData.access()->m_paintImages) {
1148 m_rareNonInheritedData.access()->m_paintImages = 1135 m_rareNonInheritedData.access()->m_paintImages =
1149 WTF::makeUnique<Vector<Persistent<StyleImage>>>(); 1136 WTF::makeUnique<Vector<Persistent<StyleImage>>>();
1150 } 1137 }
1151 m_rareNonInheritedData.access()->m_paintImages->append(image); 1138 m_rareNonInheritedData.access()->m_paintImages->append(image);
1152 } 1139 }
1153 1140
1154 void ComputedStyle::addCursor(StyleImage* image, 1141 void ComputedStyle::addCursor(StyleImage* image,
1155 bool hotSpotSpecified, 1142 bool hotSpotSpecified,
(...skipping 1318 matching lines...) Expand 10 before | Expand all | Expand 10 after
2474 if (value < 0) 2461 if (value < 0)
2475 fvalue -= 0.5f; 2462 fvalue -= 0.5f;
2476 else 2463 else
2477 fvalue += 0.5f; 2464 fvalue += 0.5f;
2478 } 2465 }
2479 2466
2480 return roundForImpreciseConversion<int>(fvalue / zoomFactor); 2467 return roundForImpreciseConversion<int>(fvalue / zoomFactor);
2481 } 2468 }
2482 2469
2483 } // namespace blink 2470 } // namespace blink
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/core/style/ComputedStyle.h ('k') | third_party/WebKit/Source/core/style/StyleDifference.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698