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

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

Issue 1034683002: [S.P.] Use LayoutObject references in SVGFilterPainter. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 5 years, 9 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 | « Source/core/paint/SVGFilterPainter.h ('k') | Source/core/paint/SVGPaintContext.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/paint/SVGFilterPainter.cpp
diff --git a/Source/core/paint/SVGFilterPainter.cpp b/Source/core/paint/SVGFilterPainter.cpp
index fa5a889001a9f8c031da843a7e52ad13cf194534..3d41d259cc26833a8de34d4c30c32a0ac82965fd 100644
--- a/Source/core/paint/SVGFilterPainter.cpp
+++ b/Source/core/paint/SVGFilterPainter.cpp
@@ -120,14 +120,13 @@ static void paintFilteredContent(GraphicsContext* context, FilterData* filterDat
filterData->m_state = FilterData::ReadyToPaint;
}
-GraphicsContext* SVGFilterPainter::prepareEffect(LayoutObject* object, GraphicsContext* context)
+GraphicsContext* SVGFilterPainter::prepareEffect(LayoutObject& object, GraphicsContext* context)
{
- ASSERT(object);
ASSERT(context);
m_filter.clearInvalidationMask();
- if (FilterData* filterData = m_filter.getFilterDataForLayoutObject(object)) {
+ if (FilterData* filterData = m_filter.getFilterDataForLayoutObject(&object)) {
// If the filterData already exists we do not need to record the content
// to be filtered. This can occur if the content was previously recorded
// or we are in a cycle.
@@ -138,7 +137,7 @@ GraphicsContext* SVGFilterPainter::prepareEffect(LayoutObject* object, GraphicsC
}
OwnPtrWillBeRawPtr<FilterData> filterData = FilterData::create();
- FloatRect targetBoundingBox = object->objectBoundingBox();
+ FloatRect targetBoundingBox = object.objectBoundingBox();
SVGFilterElement* filterElement = toSVGFilterElement(m_filter.element());
filterData->boundaries = SVGLengthContext::resolveRectangle<SVGFilterElement>(filterElement, filterElement->filterUnits()->currentValue()->enumValue(), targetBoundingBox);
@@ -146,7 +145,7 @@ GraphicsContext* SVGFilterPainter::prepareEffect(LayoutObject* object, GraphicsC
return nullptr;
// Create the SVGFilter object.
- FloatRect drawingRegion = object->strokeBoundingBox();
+ FloatRect drawingRegion = object.strokeBoundingBox();
drawingRegion.intersect(filterData->boundaries);
bool primitiveBoundingBoxMode = filterElement->primitiveUnits()->currentValue()->enumValue() == SVGUnitTypes::SVG_UNIT_TYPE_OBJECTBOUNDINGBOX;
filterData->filter = SVGFilter::create(enclosingIntRect(drawingRegion), targetBoundingBox, filterData->boundaries, primitiveBoundingBoxMode);
@@ -163,16 +162,15 @@ GraphicsContext* SVGFilterPainter::prepareEffect(LayoutObject* object, GraphicsC
lastEffect->determineFilterPrimitiveSubregion(ClipToFilterRegion);
FilterData* data = filterData.get();
- m_filter.setFilterDataForLayoutObject(object, filterData.release());
+ m_filter.setFilterDataForLayoutObject(&object, filterData.release());
return beginRecordingContent(context, data);
}
-void SVGFilterPainter::finishEffect(LayoutObject* object, GraphicsContext* context)
+void SVGFilterPainter::finishEffect(LayoutObject& object, GraphicsContext* context)
{
- ASSERT(object);
ASSERT(context);
- FilterData* filterData = m_filter.getFilterDataForLayoutObject(object);
+ FilterData* filterData = m_filter.getFilterDataForLayoutObject(&object);
if (!filterData)
return;
« no previous file with comments | « Source/core/paint/SVGFilterPainter.h ('k') | Source/core/paint/SVGPaintContext.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698