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

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

Issue 1977793003: Minor SVGFilterPainter cleanups (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 7 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 | « no previous file | 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/paint/SVGFilterPainter.cpp
diff --git a/third_party/WebKit/Source/core/paint/SVGFilterPainter.cpp b/third_party/WebKit/Source/core/paint/SVGFilterPainter.cpp
index 852431671124d183ac90ad595fe529ab56c05d06..e9e93af63f3cae5a204e668f76abd3cb6f4c26ef 100644
--- a/third_party/WebKit/Source/core/paint/SVGFilterPainter.cpp
+++ b/third_party/WebKit/Source/core/paint/SVGFilterPainter.cpp
@@ -20,15 +20,12 @@ GraphicsContext* SVGFilterRecordingContext::beginContent(FilterData* filterData)
{
ASSERT(filterData->m_state == FilterData::Initial);
- GraphicsContext* context = &paintingContext();
-
// Create a new context so the contents of the filter can be drawn and cached.
m_paintController = PaintController::create();
m_context = adoptPtr(new GraphicsContext(*m_paintController));
- context = m_context.get();
filterData->m_state = FilterData::RecordingContent;
- return context;
+ return m_context.get();
}
void SVGFilterRecordingContext::endContent(FilterData* filterData)
@@ -38,17 +35,14 @@ void SVGFilterRecordingContext::endContent(FilterData* filterData)
SourceGraphic* sourceGraphic = filterData->filter->getSourceGraphic();
ASSERT(sourceGraphic);
- GraphicsContext* context = &paintingContext();
-
// Use the context that contains the filtered content.
ASSERT(m_paintController);
ASSERT(m_context);
- context = m_context.get();
- context->beginRecording(filterData->filter->filterRegion());
+ m_context->beginRecording(filterData->filter->filterRegion());
m_paintController->commitNewDisplayItems();
- m_paintController->paintArtifact().replay(*context);
+ m_paintController->paintArtifact().replay(*m_context);
- SkiaImageFilterBuilder::buildSourceGraphic(sourceGraphic, toSkSp(context->endRecording()));
+ SkiaImageFilterBuilder::buildSourceGraphic(sourceGraphic, toSkSp(m_context->endRecording()));
// Content is cached by the source graphic so temporaries can be freed.
m_paintController = nullptr;
@@ -57,7 +51,7 @@ void SVGFilterRecordingContext::endContent(FilterData* filterData)
filterData->m_state = FilterData::ReadyToPaint;
}
-static void paintFilteredContent(const LayoutObject& object, GraphicsContext& context, FilterData* filterData)
+static void paintFilteredContent(GraphicsContext& context, FilterData* filterData)
{
ASSERT(filterData->m_state == FilterData::ReadyToPaint);
ASSERT(filterData->filter->getSourceGraphic());
@@ -155,7 +149,7 @@ void SVGFilterPainter::finishEffect(const LayoutObject& object, SVGFilterRecordi
// TODO(chrishtr): stop using an infinite rect, and instead bound the filter.
LayoutObjectDrawingRecorder recorder(context, object, DisplayItem::SVGFilter, LayoutRect::infiniteIntRect());
if (filterData && filterData->m_state == FilterData::ReadyToPaint)
- paintFilteredContent(object, context, filterData);
+ paintFilteredContent(context, filterData);
}
} // namespace blink
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698