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

Unified Diff: third_party/WebKit/Source/core/paint/SVGFilterPainter.cpp

Issue 2341923002: Harmonize FilterEffect::mapRect and mapPaintRect (Closed)
Patch Set: Rebase Created 4 years, 3 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
Index: third_party/WebKit/Source/core/paint/SVGFilterPainter.cpp
diff --git a/third_party/WebKit/Source/core/paint/SVGFilterPainter.cpp b/third_party/WebKit/Source/core/paint/SVGFilterPainter.cpp
index e59b678faf644797ab11235e974a15d26071933c..624f8ad26e8facd4851c21cde395bb3cacd46f80 100644
--- a/third_party/WebKit/Source/core/paint/SVGFilterPainter.cpp
+++ b/third_party/WebKit/Source/core/paint/SVGFilterPainter.cpp
@@ -50,7 +50,7 @@ void SVGFilterRecordingContext::endContent(FilterData* filterData)
filterData->m_state = FilterData::ReadyToPaint;
}
-static void paintFilteredContent(GraphicsContext& context, FilterData* filterData)
+static void paintFilteredContent(GraphicsContext& context, const LayoutObject& object, FilterData* filterData)
{
DCHECK_EQ(filterData->m_state, FilterData::ReadyToPaint);
DCHECK(filterData->lastEffect->getFilter()->getSourceGraphic());
@@ -62,7 +62,7 @@ static void paintFilteredContent(GraphicsContext& context, FilterData* filterDat
context.save();
// Clip drawing of filtered image to the minimum required paint rect.
- context.clipRect(lastEffect->determineAbsolutePaintRect(lastEffect->absoluteBounds()));
+ context.clipRect(lastEffect->mapRect(object.strokeBoundingBox()));
FloatRect boundaries = lastEffect->getFilter()->filterRegion();
context.beginLayer(1, SkXfermode::kSrcOver_Mode, &boundaries, ColorFilterNone, std::move(imageFilter));
@@ -133,7 +133,7 @@ void SVGFilterPainter::finishEffect(const LayoutObject& object, SVGFilterRecordi
FloatRect filterRegion = filterData ? filterData->lastEffect->getFilter()->filterRegion() : FloatRect();
LayoutObjectDrawingRecorder recorder(context, object, DisplayItem::kSVGFilter, filterRegion);
if (filterData && filterData->m_state == FilterData::ReadyToPaint)
- paintFilteredContent(context, filterData);
+ paintFilteredContent(context, object, filterData);
}
} // namespace blink

Powered by Google App Engine
This is Rietveld 408576698