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

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

Issue 2458233002: Fix under-invalidation on SVG shape/image resize in subpixels (Closed)
Patch Set: - Created 4 years, 1 month 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) 2004, 2005, 2007 Nikolas Zimmermann <zimmermann@kde.org> 2 * Copyright (C) 2004, 2005, 2007 Nikolas Zimmermann <zimmermann@kde.org>
3 * Copyright (C) 2004, 2005, 2008 Rob Buis <buis@kde.org> 3 * Copyright (C) 2004, 2005, 2008 Rob Buis <buis@kde.org>
4 * Copyright (C) 2005, 2007 Eric Seidel <eric@webkit.org> 4 * Copyright (C) 2005, 2007 Eric Seidel <eric@webkit.org>
5 * Copyright (C) 2009 Google, Inc. 5 * Copyright (C) 2009 Google, Inc.
6 * Copyright (C) 2009 Dirk Schulze <krit@webkit.org> 6 * Copyright (C) 2009 Dirk Schulze <krit@webkit.org>
7 * Copyright (C) Research In Motion Limited 2010. All rights reserved. 7 * Copyright (C) Research In Motion Limited 2010. All rights reserved.
8 * Copyright (C) 2009 Jeff Schiller <codedread@gmail.com> 8 * Copyright (C) 2009 Jeff Schiller <codedread@gmail.com>
9 * Copyright (C) 2011 Renata Hodovan <reni@webkit.org> 9 * Copyright (C) 2011 Renata Hodovan <reni@webkit.org>
10 * Copyright (C) 2011 University of Szeged 10 * Copyright (C) 2011 University of Szeged
(...skipping 164 matching lines...) Expand 10 before | Expand all | Expand 10 after
175 void LayoutSVGShape::layout() { 175 void LayoutSVGShape::layout() {
176 LayoutAnalyzer::Scope analyzer(*this); 176 LayoutAnalyzer::Scope analyzer(*this);
177 177
178 // Invalidate all resources of this client if our layout changed. 178 // Invalidate all resources of this client if our layout changed.
179 if (everHadLayout() && selfNeedsLayout()) 179 if (everHadLayout() && selfNeedsLayout())
180 SVGResourcesCache::clientLayoutChanged(this); 180 SVGResourcesCache::clientLayoutChanged(this);
181 181
182 bool updateParentBoundaries = false; 182 bool updateParentBoundaries = false;
183 // updateShapeFromElement() also updates the object & stroke bounds - which 183 // updateShapeFromElement() also updates the object & stroke bounds - which
184 // feeds into the paint invalidation rect - so we need to call it for both 184 // feeds into the paint invalidation rect - so we need to call it for both
185 // the shape-update and the bounds-update flag, since . 185 // the shape-update and the bounds-update flag, since .
pdr. 2016/10/31 20:49:05 Not your fault (https://crrev.com/fe8421b9573ca696
Xianzhu 2016/10/31 22:10:30 The fix is in https://codereview.chromium.org/2465
186 if (m_needsShapeUpdate || m_needsBoundariesUpdate) { 186 if (m_needsShapeUpdate || m_needsBoundariesUpdate) {
187 FloatRect oldStrokeBoundingBox = strokeBoundingBox();
pdr. 2016/10/31 20:49:05 Are you using the stroke bounding box because it i
Xianzhu 2016/10/31 22:10:30 Used strokeBoundingBox just because it is used for
187 updateShapeFromElement(); 188 updateShapeFromElement();
189 if (oldStrokeBoundingBox != strokeBoundingBox())
190 setShouldDoFullPaintInvalidation();
188 m_needsShapeUpdate = false; 191 m_needsShapeUpdate = false;
189 192
190 m_paintInvalidationBoundingBox = strokeBoundingBox(); 193 m_paintInvalidationBoundingBox = strokeBoundingBox();
191 SVGLayoutSupport::intersectPaintInvalidationRectWithResources( 194 SVGLayoutSupport::intersectPaintInvalidationRectWithResources(
192 this, m_paintInvalidationBoundingBox); 195 this, m_paintInvalidationBoundingBox);
193 m_needsBoundariesUpdate = false; 196 m_needsBoundariesUpdate = false;
194 197
195 updateParentBoundaries = true; 198 updateParentBoundaries = true;
196 } 199 }
197 200
(...skipping 131 matching lines...) Expand 10 before | Expand all | Expand 10 after
329 return lengthContext.valueForLength(style()->svgStyle().strokeWidth()); 332 return lengthContext.valueForLength(style()->svgStyle().strokeWidth());
330 } 333 }
331 334
332 LayoutSVGShapeRareData& LayoutSVGShape::ensureRareData() const { 335 LayoutSVGShapeRareData& LayoutSVGShape::ensureRareData() const {
333 if (!m_rareData) 336 if (!m_rareData)
334 m_rareData = wrapUnique(new LayoutSVGShapeRareData()); 337 m_rareData = wrapUnique(new LayoutSVGShapeRareData());
335 return *m_rareData.get(); 338 return *m_rareData.get();
336 } 339 }
337 340
338 } // namespace blink 341 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698