Diff
Modified: trunk/Source/WebCore/ChangeLog (158179 => 158180)
--- trunk/Source/WebCore/ChangeLog 2013-10-29 05:13:13 UTC (rev 158179)
+++ trunk/Source/WebCore/ChangeLog 2013-10-29 05:14:42 UTC (rev 158180)
@@ -1,5 +1,16 @@
2013-10-28 Andreas Kling <[email protected]>
+ RenderSVGResource::applyResource() should take a const RenderStyle&.
+ <https://webkit.org/b/123433>
+
+ These functions are always called with an existing RenderStyle object
+ so let them take a const reference instead of a raw pointer.
+ Also sprinkled some missing OVERRIDEs.
+
+ Reviewed by Anders Carlsson.
+
+2013-10-28 Andreas Kling <[email protected]>
+
Remove unused RenderTextControl::textBaseStyle().
<https://webkit.org/b/123432>
Modified: trunk/Source/WebCore/rendering/svg/RenderSVGResource.h (158179 => 158180)
--- trunk/Source/WebCore/rendering/svg/RenderSVGResource.h 2013-10-29 05:13:13 UTC (rev 158179)
+++ trunk/Source/WebCore/rendering/svg/RenderSVGResource.h 2013-10-29 05:14:42 UTC (rev 158180)
@@ -62,7 +62,7 @@
virtual void removeAllClientsFromCache(bool markForInvalidation = true) = 0;
virtual void removeClientFromCache(RenderObject*, bool markForInvalidation = true) = 0;
- virtual bool applyResource(RenderElement&, RenderStyle*, GraphicsContext*&, unsigned short resourceMode) = 0;
+ virtual bool applyResource(RenderElement&, const RenderStyle&, GraphicsContext*&, unsigned short resourceMode) = 0;
virtual void postApplyResource(RenderElement&, GraphicsContext*&, unsigned short, const Path*, const RenderSVGShape*) { }
virtual FloatRect resourceBoundingBox(const RenderObject&) = 0;
Modified: trunk/Source/WebCore/rendering/svg/RenderSVGResourceClipper.cpp (158179 => 158180)
--- trunk/Source/WebCore/rendering/svg/RenderSVGResourceClipper.cpp 2013-10-29 05:13:13 UTC (rev 158179)
+++ trunk/Source/WebCore/rendering/svg/RenderSVGResourceClipper.cpp 2013-10-29 05:14:42 UTC (rev 158180)
@@ -79,7 +79,7 @@
markClientForInvalidation(client, markForInvalidation ? BoundariesInvalidation : ParentOnlyInvalidation);
}
-bool RenderSVGResourceClipper::applyResource(RenderElement& renderer, RenderStyle*, GraphicsContext*& context, unsigned short resourceMode)
+bool RenderSVGResourceClipper::applyResource(RenderElement& renderer, const RenderStyle&, GraphicsContext*& context, unsigned short resourceMode)
{
ASSERT(context);
ASSERT_UNUSED(resourceMode, resourceMode == ApplyToDefaultMode);
Modified: trunk/Source/WebCore/rendering/svg/RenderSVGResourceClipper.h (158179 => 158180)
--- trunk/Source/WebCore/rendering/svg/RenderSVGResourceClipper.h 2013-10-29 05:13:13 UTC (rev 158179)
+++ trunk/Source/WebCore/rendering/svg/RenderSVGResourceClipper.h 2013-10-29 05:14:42 UTC (rev 158180)
@@ -51,7 +51,7 @@
virtual void removeAllClientsFromCache(bool markForInvalidation = true);
virtual void removeClientFromCache(RenderObject*, bool markForInvalidation = true);
- virtual bool applyResource(RenderElement&, RenderStyle*, GraphicsContext*&, unsigned short resourceMode);
+ virtual bool applyResource(RenderElement&, const RenderStyle&, GraphicsContext*&, unsigned short resourceMode) OVERRIDE;
// clipPath can be clipped too, but don't have a boundingBox or repaintRect. So we can't call
// applyResource directly and use the rects from the object, since they are empty for RenderSVGResources
// FIXME: We made applyClippingToContext public because we cannot call applyResource on HTML elements (it asserts on RenderObject::objectBoundingBox)
Modified: trunk/Source/WebCore/rendering/svg/RenderSVGResourceFilter.cpp (158179 => 158180)
--- trunk/Source/WebCore/rendering/svg/RenderSVGResourceFilter.cpp 2013-10-29 05:13:13 UTC (rev 158179)
+++ trunk/Source/WebCore/rendering/svg/RenderSVGResourceFilter.cpp 2013-10-29 05:14:42 UTC (rev 158180)
@@ -126,7 +126,7 @@
return matchesFilterSize;
}
-bool RenderSVGResourceFilter::applyResource(RenderElement& renderer, RenderStyle*, GraphicsContext*& context, unsigned short resourceMode)
+bool RenderSVGResourceFilter::applyResource(RenderElement& renderer, const RenderStyle&, GraphicsContext*& context, unsigned short resourceMode)
{
ASSERT(context);
ASSERT_UNUSED(resourceMode, resourceMode == ApplyToDefaultMode);
Modified: trunk/Source/WebCore/rendering/svg/RenderSVGResourceFilter.h (158179 => 158180)
--- trunk/Source/WebCore/rendering/svg/RenderSVGResourceFilter.h 2013-10-29 05:13:13 UTC (rev 158179)
+++ trunk/Source/WebCore/rendering/svg/RenderSVGResourceFilter.h 2013-10-29 05:14:42 UTC (rev 158180)
@@ -74,7 +74,7 @@
virtual void removeAllClientsFromCache(bool markForInvalidation = true);
virtual void removeClientFromCache(RenderObject*, bool markForInvalidation = true);
- virtual bool applyResource(RenderElement&, RenderStyle*, GraphicsContext*&, unsigned short resourceMode) OVERRIDE;
+ virtual bool applyResource(RenderElement&, const RenderStyle&, GraphicsContext*&, unsigned short resourceMode) OVERRIDE;
virtual void postApplyResource(RenderElement&, GraphicsContext*&, unsigned short resourceMode, const Path*, const RenderSVGShape*) OVERRIDE;
virtual FloatRect resourceBoundingBox(const RenderObject&) OVERRIDE;
Modified: trunk/Source/WebCore/rendering/svg/RenderSVGResourceGradient.cpp (158179 => 158180)
--- trunk/Source/WebCore/rendering/svg/RenderSVGResourceGradient.cpp 2013-10-29 05:13:13 UTC (rev 158179)
+++ trunk/Source/WebCore/rendering/svg/RenderSVGResourceGradient.cpp 2013-10-29 05:14:42 UTC (rev 158180)
@@ -110,9 +110,8 @@
}
#endif
-bool RenderSVGResourceGradient::applyResource(RenderElement& renderer, RenderStyle* style, GraphicsContext*& context, unsigned short resourceMode)
+bool RenderSVGResourceGradient::applyResource(RenderElement& renderer, const RenderStyle& style, GraphicsContext*& context, unsigned short resourceMode)
{
- ASSERT(style);
ASSERT(context);
ASSERT(resourceMode != ApplyToDefaultMode);
@@ -187,7 +186,7 @@
context->setTextDrawingMode(resourceMode & ApplyToFillMode ? TextModeFill : TextModeStroke);
}
- const SVGRenderStyle* svgStyle = style->svgStyle();
+ const SVGRenderStyle* svgStyle = style.svgStyle();
ASSERT(svgStyle);
if (resourceMode & ApplyToFillMode) {
@@ -199,7 +198,7 @@
gradientData->gradient->setGradientSpaceTransform(transformOnNonScalingStroke(&renderer, gradientData->userspaceTransform));
context->setAlpha(svgStyle->strokeOpacity());
context->setStrokeGradient(gradientData->gradient);
- SVGRenderSupport::applyStrokeStyleToContext(context, style, &renderer);
+ SVGRenderSupport::applyStrokeStyleToContext(context, &style, &renderer);
}
return true;
Modified: trunk/Source/WebCore/rendering/svg/RenderSVGResourceGradient.h (158179 => 158180)
--- trunk/Source/WebCore/rendering/svg/RenderSVGResourceGradient.h 2013-10-29 05:13:13 UTC (rev 158179)
+++ trunk/Source/WebCore/rendering/svg/RenderSVGResourceGradient.h 2013-10-29 05:14:42 UTC (rev 158180)
@@ -50,7 +50,7 @@
virtual void removeAllClientsFromCache(bool markForInvalidation = true) OVERRIDE FINAL;
virtual void removeClientFromCache(RenderObject*, bool markForInvalidation = true) OVERRIDE FINAL;
- virtual bool applyResource(RenderElement&, RenderStyle*, GraphicsContext*&, unsigned short resourceMode) OVERRIDE FINAL;
+ virtual bool applyResource(RenderElement&, const RenderStyle&, GraphicsContext*&, unsigned short resourceMode) OVERRIDE FINAL;
virtual void postApplyResource(RenderElement&, GraphicsContext*&, unsigned short resourceMode, const Path*, const RenderSVGShape*) OVERRIDE FINAL;
virtual FloatRect resourceBoundingBox(const RenderObject&) OVERRIDE FINAL { return FloatRect(); }
Modified: trunk/Source/WebCore/rendering/svg/RenderSVGResourceMarker.h (158179 => 158180)
--- trunk/Source/WebCore/rendering/svg/RenderSVGResourceMarker.h 2013-10-29 05:13:13 UTC (rev 158179)
+++ trunk/Source/WebCore/rendering/svg/RenderSVGResourceMarker.h 2013-10-29 05:14:42 UTC (rev 158180)
@@ -55,7 +55,7 @@
virtual const AffineTransform& localToParentTransform() const;
AffineTransform markerTransformation(const FloatPoint& origin, float angle, float strokeWidth) const;
- virtual bool applyResource(RenderElement&, RenderStyle*, GraphicsContext*&, unsigned short) OVERRIDE { return false; }
+ virtual bool applyResource(RenderElement&, const RenderStyle&, GraphicsContext*&, unsigned short) OVERRIDE { return false; }
virtual FloatRect resourceBoundingBox(const RenderObject&) OVERRIDE { return FloatRect(); }
FloatPoint referencePoint() const;
Modified: trunk/Source/WebCore/rendering/svg/RenderSVGResourceMasker.cpp (158179 => 158180)
--- trunk/Source/WebCore/rendering/svg/RenderSVGResourceMasker.cpp 2013-10-29 05:13:13 UTC (rev 158179)
+++ trunk/Source/WebCore/rendering/svg/RenderSVGResourceMasker.cpp 2013-10-29 05:14:42 UTC (rev 158180)
@@ -67,7 +67,7 @@
markClientForInvalidation(client, markForInvalidation ? BoundariesInvalidation : ParentOnlyInvalidation);
}
-bool RenderSVGResourceMasker::applyResource(RenderElement& renderer, RenderStyle*, GraphicsContext*& context, unsigned short resourceMode)
+bool RenderSVGResourceMasker::applyResource(RenderElement& renderer, const RenderStyle&, GraphicsContext*& context, unsigned short resourceMode)
{
ASSERT(context);
ASSERT_UNUSED(resourceMode, resourceMode == ApplyToDefaultMode);
Modified: trunk/Source/WebCore/rendering/svg/RenderSVGResourceMasker.h (158179 => 158180)
--- trunk/Source/WebCore/rendering/svg/RenderSVGResourceMasker.h 2013-10-29 05:13:13 UTC (rev 158179)
+++ trunk/Source/WebCore/rendering/svg/RenderSVGResourceMasker.h 2013-10-29 05:14:42 UTC (rev 158180)
@@ -47,7 +47,7 @@
virtual void removeAllClientsFromCache(bool markForInvalidation = true);
virtual void removeClientFromCache(RenderObject*, bool markForInvalidation = true);
- virtual bool applyResource(RenderElement&, RenderStyle*, GraphicsContext*&, unsigned short resourceMode);
+ virtual bool applyResource(RenderElement&, const RenderStyle&, GraphicsContext*&, unsigned short resourceMode) OVERRIDE;
virtual FloatRect resourceBoundingBox(const RenderObject&) OVERRIDE;
SVGUnitTypes::SVGUnitType maskUnits() const { return maskElement().maskUnits(); }
Modified: trunk/Source/WebCore/rendering/svg/RenderSVGResourcePattern.cpp (158179 => 158180)
--- trunk/Source/WebCore/rendering/svg/RenderSVGResourcePattern.cpp 2013-10-29 05:13:13 UTC (rev 158179)
+++ trunk/Source/WebCore/rendering/svg/RenderSVGResourcePattern.cpp 2013-10-29 05:14:42 UTC (rev 158180)
@@ -137,9 +137,8 @@
return m_patternMap.set(object, patternData.release()).iterator->value.get();
}
-bool RenderSVGResourcePattern::applyResource(RenderElement& renderer, RenderStyle* style, GraphicsContext*& context, unsigned short resourceMode)
+bool RenderSVGResourcePattern::applyResource(RenderElement& renderer, const RenderStyle& style, GraphicsContext*& context, unsigned short resourceMode)
{
- ASSERT(style);
ASSERT(context);
ASSERT(resourceMode != ApplyToDefaultMode);
@@ -156,7 +155,7 @@
// Draw pattern
context->save();
- const SVGRenderStyle* svgStyle = style->svgStyle();
+ const SVGRenderStyle* svgStyle = style.svgStyle();
ASSERT(svgStyle);
if (resourceMode & ApplyToFillMode) {
@@ -168,7 +167,7 @@
patternData->pattern->setPatternSpaceTransform(transformOnNonScalingStroke(&renderer, patternData->transform));
context->setAlpha(svgStyle->strokeOpacity());
context->setStrokePattern(patternData->pattern);
- SVGRenderSupport::applyStrokeStyleToContext(context, style, &renderer);
+ SVGRenderSupport::applyStrokeStyleToContext(context, &style, &renderer);
}
if (resourceMode & ApplyToTextMode) {
Modified: trunk/Source/WebCore/rendering/svg/RenderSVGResourcePattern.h (158179 => 158180)
--- trunk/Source/WebCore/rendering/svg/RenderSVGResourcePattern.h 2013-10-29 05:13:13 UTC (rev 158179)
+++ trunk/Source/WebCore/rendering/svg/RenderSVGResourcePattern.h 2013-10-29 05:14:42 UTC (rev 158180)
@@ -51,7 +51,7 @@
virtual void removeAllClientsFromCache(bool markForInvalidation = true);
virtual void removeClientFromCache(RenderObject*, bool markForInvalidation = true);
- virtual bool applyResource(RenderElement&, RenderStyle*, GraphicsContext*&, unsigned short resourceMode) OVERRIDE;
+ virtual bool applyResource(RenderElement&, const RenderStyle&, GraphicsContext*&, unsigned short resourceMode) OVERRIDE;
virtual void postApplyResource(RenderElement&, GraphicsContext*&, unsigned short resourceMode, const Path*, const RenderSVGShape*) OVERRIDE;
virtual FloatRect resourceBoundingBox(const RenderObject&) OVERRIDE { return FloatRect(); }
Modified: trunk/Source/WebCore/rendering/svg/RenderSVGResourceSolidColor.cpp (158179 => 158180)
--- trunk/Source/WebCore/rendering/svg/RenderSVGResourceSolidColor.cpp 2013-10-29 05:13:13 UTC (rev 158179)
+++ trunk/Source/WebCore/rendering/svg/RenderSVGResourceSolidColor.cpp 2013-10-29 05:14:42 UTC (rev 158180)
@@ -42,13 +42,13 @@
{
}
-bool RenderSVGResourceSolidColor::applyResource(RenderElement& renderer, RenderStyle* style, GraphicsContext*& context, unsigned short resourceMode)
+bool RenderSVGResourceSolidColor::applyResource(RenderElement& renderer, const RenderStyle& style, GraphicsContext*& context, unsigned short resourceMode)
{
ASSERT(context);
ASSERT(resourceMode != ApplyToDefaultMode);
- const SVGRenderStyle* svgStyle = style ? style->svgStyle() : 0;
- ColorSpace colorSpace = style ? style->colorSpace() : ColorSpaceDeviceRGB;
+ const SVGRenderStyle* svgStyle = style.svgStyle();
+ ColorSpace colorSpace = style.colorSpace();
bool isRenderingMask = renderer.view().frameView().paintBehavior() & PaintBehaviorRenderingSVGMask;
@@ -69,8 +69,7 @@
context->setAlpha(svgStyle ? svgStyle->strokeOpacity() : 1);
context->setStrokeColor(m_color, colorSpace);
- if (style)
- SVGRenderSupport::applyStrokeStyleToContext(context, style, &renderer);
+ SVGRenderSupport::applyStrokeStyleToContext(context, &style, &renderer);
if (resourceMode & ApplyToTextMode)
context->setTextDrawingMode(TextModeStroke);
Modified: trunk/Source/WebCore/rendering/svg/RenderSVGResourceSolidColor.h (158179 => 158180)
--- trunk/Source/WebCore/rendering/svg/RenderSVGResourceSolidColor.h 2013-10-29 05:13:13 UTC (rev 158179)
+++ trunk/Source/WebCore/rendering/svg/RenderSVGResourceSolidColor.h 2013-10-29 05:14:42 UTC (rev 158180)
@@ -35,7 +35,7 @@
virtual void removeAllClientsFromCache(bool = true) { }
virtual void removeClientFromCache(RenderObject*, bool = true) { }
- virtual bool applyResource(RenderElement&, RenderStyle*, GraphicsContext*&, unsigned short resourceMode) OVERRIDE;
+ virtual bool applyResource(RenderElement&, const RenderStyle&, GraphicsContext*&, unsigned short resourceMode) OVERRIDE;
virtual void postApplyResource(RenderElement&, GraphicsContext*&, unsigned short resourceMode, const Path*, const RenderSVGShape*) OVERRIDE;
virtual FloatRect resourceBoundingBox(const RenderObject&) OVERRIDE { return FloatRect(); }
Modified: trunk/Source/WebCore/rendering/svg/RenderSVGShape.cpp (158179 => 158180)
--- trunk/Source/WebCore/rendering/svg/RenderSVGShape.cpp 2013-10-29 05:13:13 UTC (rev 158179)
+++ trunk/Source/WebCore/rendering/svg/RenderSVGShape.cpp 2013-10-29 05:14:42 UTC (rev 158180)
@@ -219,12 +219,12 @@
{
Color fallbackColor;
if (RenderSVGResource* fillPaintingResource = RenderSVGResource::fillPaintingResource(*this, style, fallbackColor)) {
- if (fillPaintingResource->applyResource(*this, style, context, ApplyToFillMode))
+ if (fillPaintingResource->applyResource(*this, *style, context, ApplyToFillMode))
fillPaintingResource->postApplyResource(*this, context, ApplyToFillMode, 0, this);
else if (fallbackColor.isValid()) {
RenderSVGResourceSolidColor* fallbackResource = RenderSVGResource::sharedSolidPaintingResource();
fallbackResource->setColor(fallbackColor);
- if (fallbackResource->applyResource(*this, style, context, ApplyToFillMode))
+ if (fallbackResource->applyResource(*this, *style, context, ApplyToFillMode))
fallbackResource->postApplyResource(*this, context, ApplyToFillMode, 0, this);
}
}
@@ -234,12 +234,12 @@
{
Color fallbackColor;
if (RenderSVGResource* strokePaintingResource = RenderSVGResource::strokePaintingResource(*this, style, fallbackColor)) {
- if (strokePaintingResource->applyResource(*this, style, context, ApplyToStrokeMode))
+ if (strokePaintingResource->applyResource(*this, *style, context, ApplyToStrokeMode))
strokePaintingResource->postApplyResource(*this, context, ApplyToStrokeMode, 0, this);
else if (fallbackColor.isValid()) {
RenderSVGResourceSolidColor* fallbackResource = RenderSVGResource::sharedSolidPaintingResource();
fallbackResource->setColor(fallbackColor);
- if (fallbackResource->applyResource(*this, style, context, ApplyToStrokeMode))
+ if (fallbackResource->applyResource(*this, *style, context, ApplyToStrokeMode))
fallbackResource->postApplyResource(*this, context, ApplyToStrokeMode, 0, this);
}
}
Modified: trunk/Source/WebCore/rendering/svg/SVGInlineTextBox.cpp (158179 => 158180)
--- trunk/Source/WebCore/rendering/svg/SVGInlineTextBox.cpp 2013-10-29 05:13:13 UTC (rev 158179)
+++ trunk/Source/WebCore/rendering/svg/SVGInlineTextBox.cpp 2013-10-29 05:14:42 UTC (rev 158180)
@@ -344,13 +344,13 @@
if (!m_paintingResource)
return false;
- if (!m_paintingResource->applyResource(renderer, style, context, m_paintingResourceMode)) {
+ if (!m_paintingResource->applyResource(renderer, *style, context, m_paintingResourceMode)) {
if (fallbackColor.isValid()) {
RenderSVGResourceSolidColor* fallbackResource = RenderSVGResource::sharedSolidPaintingResource();
fallbackResource->setColor(fallbackColor);
m_paintingResource = fallbackResource;
- m_paintingResource->applyResource(renderer, style, context, m_paintingResourceMode);
+ m_paintingResource->applyResource(renderer, *style, context, m_paintingResourceMode);
}
}
Modified: trunk/Source/WebCore/rendering/svg/SVGRenderingContext.cpp (158179 => 158180)
--- trunk/Source/WebCore/rendering/svg/SVGRenderingContext.cpp 2013-10-29 05:13:13 UTC (rev 158179)
+++ trunk/Source/WebCore/rendering/svg/SVGRenderingContext.cpp 2013-10-29 05:14:42 UTC (rev 158180)
@@ -141,14 +141,14 @@
if (!isRenderingMask) {
if (RenderSVGResourceMasker* masker = resources->masker()) {
- if (!masker->applyResource(*m_renderer, &style, m_paintInfo->context, ApplyToDefaultMode))
+ if (!masker->applyResource(*m_renderer, style, m_paintInfo->context, ApplyToDefaultMode))
return;
}
}
RenderSVGResourceClipper* clipper = resources->clipper();
if (!clipPathOperation && clipper) {
- if (!clipper->applyResource(*m_renderer, &style, m_paintInfo->context, ApplyToDefaultMode))
+ if (!clipper->applyResource(*m_renderer, style, m_paintInfo->context, ApplyToDefaultMode))
return;
}
@@ -161,7 +161,7 @@
// Return with false here may mean that we don't need to draw the content
// (because it was either drawn before or empty) but we still need to apply the filter.
m_renderingFlags |= EndFilterLayer;
- if (!m_filter->applyResource(*m_renderer, &style, m_paintInfo->context, ApplyToDefaultMode))
+ if (!m_filter->applyResource(*m_renderer, style, m_paintInfo->context, ApplyToDefaultMode))
return;
// Since we're caching the resulting bitmap and do not invalidate it on repaint rect
Modified: trunk/Source/WebCore/rendering/svg/SVGTextRunRenderingContext.cpp (158179 => 158180)
--- trunk/Source/WebCore/rendering/svg/SVGTextRunRenderingContext.cpp 2013-10-29 05:13:13 UTC (rev 158179)
+++ trunk/Source/WebCore/rendering/svg/SVGTextRunRenderingContext.cpp 2013-10-29 05:14:42 UTC (rev 158180)
@@ -165,7 +165,7 @@
Path glyphPath = svgGlyph.pathData;
glyphPath.transform(glyphPathTransform);
- if (activePaintingResource->applyResource(elementRenderer, &style, context, resourceMode)) {
+ if (activePaintingResource->applyResource(elementRenderer, style, context, resourceMode)) {
float strokeThickness = context->strokeThickness();
if (renderer().isSVGInlineText())
context->setStrokeThickness(strokeThickness * toRenderSVGInlineText(renderer()).scalingFactor());