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

Unified Diff: third_party/WebKit/Source/core/layout/svg/ReferenceFilterBuilder.cpp

Issue 1613193002: Use correct size for unattached canvases when building canvas filters (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 11 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « third_party/WebKit/LayoutTests/fast/canvas/canvas-filter-width-height-off-screen-expected.html ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/Source/core/layout/svg/ReferenceFilterBuilder.cpp
diff --git a/third_party/WebKit/Source/core/layout/svg/ReferenceFilterBuilder.cpp b/third_party/WebKit/Source/core/layout/svg/ReferenceFilterBuilder.cpp
index ddba2fb750601874063136de4c6ce072a34048b5..350a70841536736495e61089ffd6a9eb97f8f24c 100644
--- a/third_party/WebKit/Source/core/layout/svg/ReferenceFilterBuilder.cpp
+++ b/third_party/WebKit/Source/core/layout/svg/ReferenceFilterBuilder.cpp
@@ -100,13 +100,11 @@ PassRefPtrWillBeRawPtr<Filter> ReferenceFilterBuilder::build(float zoom, Element
SVGFilterElement& filterElement = toSVGFilterElement(*filter);
FloatRect referenceBox;
- if (element->inDocument() && element->layoutObject() && element->layoutObject()->enclosingLayer()) {
- if (referenceBoxSize) {
- referenceBox = FloatRect(FloatPoint(), *referenceBoxSize);
- } else {
- FloatSize size(element->layoutObject()->enclosingLayer()->physicalBoundingBoxIncludingReflectionAndStackingChildren(LayoutPoint()).size());
- referenceBox = FloatRect(FloatPoint(), size);
- }
+ if (referenceBoxSize) {
+ referenceBox = FloatRect(FloatPoint(), *referenceBoxSize);
+ } else if (element->inDocument() && element->layoutObject() && element->layoutObject()->enclosingLayer()) {
+ FloatSize size(element->layoutObject()->enclosingLayer()->physicalBoundingBoxIncludingReflectionAndStackingChildren(LayoutPoint()).size());
+ referenceBox = FloatRect(FloatPoint(), size);
}
referenceBox.scale(1.0f / zoom);
FloatRect filterRegion = SVGLengthContext::resolveRectangle<SVGFilterElement>(&filterElement, filterElement.filterUnits()->currentValue()->enumValue(), referenceBox);
« no previous file with comments | « third_party/WebKit/LayoutTests/fast/canvas/canvas-filter-width-height-off-screen-expected.html ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698