Diff
Modified: trunk/Source/WebCore/ChangeLog (206537 => 206538)
--- trunk/Source/WebCore/ChangeLog 2016-09-28 19:56:30 UTC (rev 206537)
+++ trunk/Source/WebCore/ChangeLog 2016-09-28 20:19:47 UTC (rev 206538)
@@ -1,3 +1,143 @@
+2016-09-27 Dean Jackson <[email protected]>
+
+ Use Color references where possible
+ https://bugs.webkit.org/show_bug.cgi?id=162643
+ <rdar://problem/28506550>
+
+ Reviewed by Simon Fraser.
+
+ There were a bunch of places where we pass or use
+ Colors by value. As the Color class gets a bit more
+ complicated, it would be nice to avoid copying, so
+ use references where possible.
+
+ * css/CSSGradientValue.cpp:
+ (WebCore::interpolate):
+ * css/StyleColor.h:
+ (WebCore::StyleColor::getColor):
+ (WebCore::StyleColor::resolve):
+ * css/StyleResolver.h:
+ (WebCore::StyleResolver::State::backgroundColor):
+ * dom/Document.h:
+ (WebCore::Document::textColor):
+ * editing/FrameSelection.cpp:
+ (WebCore::disappearsIntoBackground):
+ * html/canvas/CanvasRenderingContext2D.cpp:
+ (WebCore::CanvasRenderingContext2D::setShadow):
+ * html/canvas/CanvasRenderingContext2D.h:
+ * html/track/TextTrackCueGeneric.h:
+ * page/PageOverlay.cpp:
+ (WebCore::PageOverlay::setBackgroundColor):
+ * page/PageOverlay.h:
+ * page/animation/CSSPropertyAnimation.cpp:
+ (WebCore::PropertyWrapperColor::PropertyWrapperColor):
+ (WebCore::PropertyWrapperMaybeInvalidColor::PropertyWrapperMaybeInvalidColor):
+ (WebCore::PropertyWrapperVisitedAffectedColor::PropertyWrapperVisitedAffectedColor):
+ * platform/graphics/GraphicsContext.cpp:
+ (WebCore::GraphicsContext::fillRectWithRoundedHole):
+ * platform/graphics/GraphicsContext.h:
+ (WebCore::GraphicsContext::strokeColor):
+ (WebCore::GraphicsContext::fillColor):
+ * platform/graphics/InbandTextTrackPrivateClient.h:
+ (WebCore::GenericCueData::foregroundColor):
+ (WebCore::GenericCueData::setForegroundColor):
+ (WebCore::GenericCueData::backgroundColor):
+ (WebCore::GenericCueData::setBackgroundColor):
+ (WebCore::GenericCueData::highlightColor):
+ (WebCore::GenericCueData::setHighlightColor):
+ * platform/graphics/ca/TileController.h:
+ * platform/graphics/cg/GraphicsContextCG.cpp:
+ (WebCore::GraphicsContext::drawRect):
+ (WebCore::GraphicsContext::fillRect):
+ (WebCore::GraphicsContext::platformFillRoundedRect):
+ (WebCore::GraphicsContext::fillRectWithRoundedHole):
+ * platform/graphics/displaylists/DisplayListItems.h:
+ (WebCore::DisplayList::DrawFocusRingPath::color):
+ (WebCore::DisplayList::DrawFocusRingRects::color):
+ (WebCore::DisplayList::FillRectWithColor::color):
+ (WebCore::DisplayList::FillCompositedRect::color):
+ (WebCore::DisplayList::FillRoundedRect::color):
+ (WebCore::DisplayList::FillRectWithRoundedHole::color):
+ * platform/graphics/filters/FEDiffuseLighting.cpp:
+ (WebCore::FEDiffuseLighting::lightingColor):
+ * platform/graphics/filters/FEDiffuseLighting.h:
+ * platform/graphics/filters/FEDropShadow.h:
+ (WebCore::FEDropShadow::shadowColor):
+ * platform/graphics/filters/FEFlood.cpp:
+ (WebCore::FEFlood::floodColor):
+ (WebCore::FEFlood::platformApplySoftware):
+ * platform/graphics/filters/FEFlood.h:
+ * platform/graphics/filters/FESpecularLighting.cpp:
+ (WebCore::FESpecularLighting::lightingColor):
+ * platform/graphics/filters/FESpecularLighting.h:
+ * platform/graphics/filters/FilterOperation.h:
+ * rendering/BorderEdge.h:
+ (WebCore::BorderEdge::color):
+ * rendering/InlineFlowBox.cpp:
+ (WebCore::InlineFlowBox::paintBoxDecorations):
+ * rendering/InlineTextBox.cpp:
+ (WebCore::InlineTextBox::paintSelection):
+ * rendering/InlineTextBox.h:
+ * rendering/RenderFrameSet.cpp:
+ (WebCore::borderStartEdgeColor):
+ (WebCore::borderEndEdgeColor):
+ (WebCore::borderFillColor):
+ * rendering/RenderInline.cpp:
+ (WebCore::RenderInline::paintOutlineForLine):
+ * rendering/RenderInline.h:
+ * rendering/RenderLayerCompositor.h:
+ * rendering/RenderView.cpp:
+ (WebCore::RenderView::paintBoxDecorations):
+ * rendering/TextDecorationPainter.cpp:
+ (WebCore::TextDecorationPainter::paintTextDecoration):
+ * rendering/TextPainter.cpp:
+ (WebCore::TextPainter::paintTextWithShadows):
+ * rendering/style/BorderValue.h:
+ (WebCore::BorderValue::color):
+ * rendering/style/CollapsedBorderValue.h:
+ (WebCore::CollapsedBorderValue::color):
+ * rendering/style/RenderStyle.cpp:
+ (WebCore::RenderStyle::color):
+ (WebCore::RenderStyle::visitedLinkColor):
+ (WebCore::RenderStyle::setColor):
+ (WebCore::RenderStyle::setVisitedLinkColor):
+ * rendering/style/RenderStyle.h:
+ (WebCore::RenderStyle::borderLeftColor):
+ (WebCore::RenderStyle::borderRightColor):
+ (WebCore::RenderStyle::borderTopColor):
+ (WebCore::RenderStyle::borderBottomColor):
+ (WebCore::RenderStyle::backgroundColor):
+ (WebCore::RenderStyle::columnRuleColor):
+ (WebCore::RenderStyle::outlineColor):
+ (WebCore::RenderStyle::textEmphasisColor):
+ (WebCore::RenderStyle::textFillColor):
+ (WebCore::RenderStyle::textStrokeColor):
+ (WebCore::RenderStyle::visitedLinkBackgroundColor):
+ (WebCore::RenderStyle::visitedLinkBorderLeftColor):
+ (WebCore::RenderStyle::visitedLinkBorderRightColor):
+ (WebCore::RenderStyle::visitedLinkBorderBottomColor):
+ (WebCore::RenderStyle::visitedLinkBorderTopColor):
+ (WebCore::RenderStyle::visitedLinkOutlineColor):
+ (WebCore::RenderStyle::visitedLinkColumnRuleColor):
+ (WebCore::RenderStyle::textDecorationColor):
+ (WebCore::RenderStyle::visitedLinkTextDecorationColor):
+ (WebCore::RenderStyle::visitedLinkTextEmphasisColor):
+ (WebCore::RenderStyle::visitedLinkTextFillColor):
+ (WebCore::RenderStyle::visitedLinkTextStrokeColor):
+ (WebCore::RenderStyle::stopColor):
+ (WebCore::RenderStyle::floodColor):
+ (WebCore::RenderStyle::lightingColor):
+ * svg/SVGFEDiffuseLightingElement.cpp:
+ (WebCore::SVGFEDiffuseLightingElement::build):
+ * svg/SVGFEDropShadowElement.cpp:
+ (WebCore::SVGFEDropShadowElement::build):
+ * svg/SVGFEFloodElement.cpp:
+ (WebCore::SVGFEFloodElement::build):
+ * svg/SVGFESpecularLightingElement.cpp:
+ (WebCore::SVGFESpecularLightingElement::build):
+ * svg/SVGGradientElement.cpp:
+ (WebCore::SVGGradientElement::buildStops):
+
2016-09-28 Ryosuke Niwa <[email protected]>
assignedNodes should include fallback contents when flattened option is set
Modified: trunk/Source/WebCore/css/CSSGradientValue.cpp (206537 => 206538)
--- trunk/Source/WebCore/css/CSSGradientValue.cpp 2016-09-28 19:56:30 UTC (rev 206537)
+++ trunk/Source/WebCore/css/CSSGradientValue.cpp 2016-09-28 20:19:47 UTC (rev 206538)
@@ -140,7 +140,7 @@
return min + static_cast<int>(position * (max - min));
}
-static inline Color interpolate(Color color1, Color color2, float position)
+static inline Color interpolate(const Color& color1, const Color& color2, float position)
{
int red = interpolate(color1.red(), color2.red(), position);
int green = interpolate(color1.green(), color2.green(), position);
Modified: trunk/Source/WebCore/css/StyleColor.h (206537 => 206538)
--- trunk/Source/WebCore/css/StyleColor.h 2016-09-28 19:56:30 UTC (rev 206537)
+++ trunk/Source/WebCore/css/StyleColor.h 2016-09-28 20:19:47 UTC (rev 206538)
@@ -46,9 +46,9 @@
static StyleColor currentColor() { return StyleColor(); }
bool isCurrentColor() const { return m_currentColor; }
- Color getColor() const { ASSERT(!isCurrentColor()); return m_color; }
+ const Color& getColor() const { ASSERT(!isCurrentColor()); return m_color; }
- Color resolve(Color currentColor) const { return m_currentColor ? currentColor : m_color; }
+ const Color& resolve(const Color& currentColor) const { return m_currentColor ? currentColor : m_color; }
static Color colorFromKeyword(CSSValueID);
static bool isColorKeyword(CSSValueID);
Modified: trunk/Source/WebCore/css/StyleResolver.h (206537 => 206538)
--- trunk/Source/WebCore/css/StyleResolver.h 2016-09-28 19:56:30 UTC (rev 206537)
+++ trunk/Source/WebCore/css/StyleResolver.h 2016-09-28 20:19:47 UTC (rev 206538)
@@ -391,7 +391,7 @@
bool hasUAAppearance() const { return m_hasUAAppearance; }
BorderData borderData() const { return m_borderData; }
FillLayer backgroundData() const { return m_backgroundData; }
- Color backgroundColor() const { return m_backgroundColor; }
+ const Color& backgroundColor() const { return m_backgroundColor; }
const FontCascadeDescription& fontDescription() { return m_style->fontDescription(); }
const FontCascadeDescription& parentFontDescription() { return m_parentStyle->fontDescription(); }
Modified: trunk/Source/WebCore/dom/Document.h (206537 => 206538)
--- trunk/Source/WebCore/dom/Document.h 2016-09-28 19:56:30 UTC (rev 206537)
+++ trunk/Source/WebCore/dom/Document.h 2016-09-28 20:19:47 UTC (rev 206538)
@@ -688,7 +688,7 @@
std::chrono::milliseconds elapsedTime() const;
void setTextColor(const Color& color) { m_textColor = color; }
- Color textColor() const { return m_textColor; }
+ const Color& textColor() const { return m_textColor; }
const Color& linkColor() const { return m_linkColor; }
const Color& visitedLinkColor() const { return m_visitedLinkColor; }
Modified: trunk/Source/WebCore/editing/FrameSelection.cpp (206537 => 206538)
--- trunk/Source/WebCore/editing/FrameSelection.cpp 2016-09-28 19:56:30 UTC (rev 206537)
+++ trunk/Source/WebCore/editing/FrameSelection.cpp 2016-09-28 20:19:47 UTC (rev 206538)
@@ -1693,7 +1693,7 @@
}
#if ENABLE(TEXT_CARET)
-static inline bool disappearsIntoBackground(Color foreground, Color background)
+static inline bool disappearsIntoBackground(const Color& foreground, const Color& background)
{
return background.blend(foreground) == background;
}
Modified: trunk/Source/WebCore/html/canvas/CanvasRenderingContext2D.cpp (206537 => 206538)
--- trunk/Source/WebCore/html/canvas/CanvasRenderingContext2D.cpp 2016-09-28 19:56:30 UTC (rev 206537)
+++ trunk/Source/WebCore/html/canvas/CanvasRenderingContext2D.cpp 2016-09-28 20:19:47 UTC (rev 206538)
@@ -1276,7 +1276,7 @@
setShadow(FloatSize(), 0, Color::transparent);
}
-void CanvasRenderingContext2D::setShadow(const FloatSize& offset, float blur, Color color)
+void CanvasRenderingContext2D::setShadow(const FloatSize& offset, float blur, const Color& color)
{
if (state().shadowOffset == offset && state().shadowBlur == blur && state().shadowColor == color)
return;
Modified: trunk/Source/WebCore/html/canvas/CanvasRenderingContext2D.h (206537 => 206538)
--- trunk/Source/WebCore/html/canvas/CanvasRenderingContext2D.h 2016-09-28 19:56:30 UTC (rev 206537)
+++ trunk/Source/WebCore/html/canvas/CanvasRenderingContext2D.h 2016-09-28 20:19:47 UTC (rev 206538)
@@ -316,7 +316,7 @@
const State& state() const { return m_stateStack.last(); }
void applyLineDash() const;
- void setShadow(const FloatSize& offset, float blur, Color);
+ void setShadow(const FloatSize& offset, float blur, const Color&);
void applyShadow();
bool shouldDrawShadows() const;
Modified: trunk/Source/WebCore/html/track/TextTrackCueGeneric.h (206537 => 206538)
--- trunk/Source/WebCore/html/track/TextTrackCueGeneric.h 2016-09-28 19:56:30 UTC (rev 206537)
+++ trunk/Source/WebCore/html/track/TextTrackCueGeneric.h 2016-09-28 20:19:47 UTC (rev 206538)
@@ -61,13 +61,13 @@
String fontName() const { return m_fontName; }
void setFontName(String name) { m_fontName = name; }
- Color foregroundColor() const { return m_foregroundColor; }
+ const Color& foregroundColor() const { return m_foregroundColor; }
void setForegroundColor(Color color) { m_foregroundColor = color; }
- Color backgroundColor() const { return m_backgroundColor; }
+ const Color& backgroundColor() const { return m_backgroundColor; }
void setBackgroundColor(Color color) { m_backgroundColor = color; }
- Color highlightColor() const { return m_highlightColor; }
+ const Color& highlightColor() const { return m_highlightColor; }
void setHighlightColor(Color color) { m_highlightColor = color; }
void setFontSize(int, const IntSize&, bool important) override;
Modified: trunk/Source/WebCore/page/PageOverlay.cpp (206537 => 206538)
--- trunk/Source/WebCore/page/PageOverlay.cpp 2016-09-28 19:56:30 UTC (rev 206537)
+++ trunk/Source/WebCore/page/PageOverlay.cpp 2016-09-28 20:19:47 UTC (rev 206538)
@@ -136,7 +136,7 @@
return IntSize();
}
-void PageOverlay::setBackgroundColor(Color backgroundColor)
+void PageOverlay::setBackgroundColor(const Color& backgroundColor)
{
if (m_backgroundColor == backgroundColor)
return;
Modified: trunk/Source/WebCore/page/PageOverlay.h (206537 => 206538)
--- trunk/Source/WebCore/page/PageOverlay.h 2016-09-28 19:56:30 UTC (rev 206537)
+++ trunk/Source/WebCore/page/PageOverlay.h 2016-09-28 20:19:47 UTC (rev 206538)
@@ -106,8 +106,8 @@
WEBCORE_EXPORT IntSize viewToOverlayOffset() const;
- Color backgroundColor() const { return m_backgroundColor; }
- void setBackgroundColor(Color);
+ const Color& backgroundColor() const { return m_backgroundColor; }
+ void setBackgroundColor(const Color&);
void setShouldIgnoreMouseEventsOutsideBounds(bool flag) { m_shouldIgnoreMouseEventsOutsideBounds = flag; }
Modified: trunk/Source/WebCore/page/animation/CSSPropertyAnimation.cpp (206537 => 206538)
--- trunk/Source/WebCore/page/animation/CSSPropertyAnimation.cpp 2016-09-28 19:56:30 UTC (rev 206537)
+++ trunk/Source/WebCore/page/animation/CSSPropertyAnimation.cpp 2016-09-28 20:19:47 UTC (rev 206538)
@@ -567,11 +567,11 @@
}
};
-class PropertyWrapperColor : public PropertyWrapperGetter<Color> {
+class PropertyWrapperColor : public PropertyWrapperGetter<const Color&> {
WTF_MAKE_FAST_ALLOCATED;
public:
- PropertyWrapperColor(CSSPropertyID prop, Color (RenderStyle::*getter)() const, void (RenderStyle::*setter)(const Color&))
- : PropertyWrapperGetter<Color>(prop, getter)
+ PropertyWrapperColor(CSSPropertyID prop, const Color& (RenderStyle::*getter)() const, void (RenderStyle::*setter)(const Color&))
+ : PropertyWrapperGetter<const Color&>(prop, getter)
, m_setter(setter)
{
}
@@ -578,7 +578,7 @@
void blend(const AnimationBase* anim, RenderStyle* dst, const RenderStyle* a, const RenderStyle* b, double progress) const override
{
- (dst->*m_setter)(blendFunc(anim, (a->*PropertyWrapperGetter<Color>::m_getter)(), (b->*PropertyWrapperGetter<Color>::m_getter)(), progress));
+ (dst->*m_setter)(blendFunc(anim, (a->*PropertyWrapperGetter<const Color&>::m_getter)(), (b->*PropertyWrapperGetter<const Color&>::m_getter)(), progress));
}
protected:
@@ -585,7 +585,6 @@
void (RenderStyle::*m_setter)(const Color&);
};
-
class PropertyWrapperAcceleratedOpacity : public PropertyWrapper<float> {
WTF_MAKE_FAST_ALLOCATED;
public:
@@ -811,7 +810,7 @@
class PropertyWrapperMaybeInvalidColor : public AnimationPropertyWrapperBase {
WTF_MAKE_FAST_ALLOCATED;
public:
- PropertyWrapperMaybeInvalidColor(CSSPropertyID prop, Color (RenderStyle::*getter)() const, void (RenderStyle::*setter)(const Color&))
+ PropertyWrapperMaybeInvalidColor(CSSPropertyID prop, const Color& (RenderStyle::*getter)() const, void (RenderStyle::*setter)(const Color&))
: AnimationPropertyWrapperBase(prop)
, m_getter(getter)
, m_setter(setter)
@@ -868,7 +867,7 @@
#endif
private:
- Color (RenderStyle::*m_getter)() const;
+ const Color& (RenderStyle::*m_getter)() const;
void (RenderStyle::*m_setter)(const Color&);
};
@@ -877,15 +876,15 @@
class PropertyWrapperVisitedAffectedColor : public AnimationPropertyWrapperBase {
WTF_MAKE_FAST_ALLOCATED;
public:
- PropertyWrapperVisitedAffectedColor(CSSPropertyID prop, Color (RenderStyle::*getter)() const, void (RenderStyle::*setter)(const Color&),
- Color (RenderStyle::*visitedGetter)() const, void (RenderStyle::*visitedSetter)(const Color&))
+ PropertyWrapperVisitedAffectedColor(CSSPropertyID prop, const Color& (RenderStyle::*getter)() const, void (RenderStyle::*setter)(const Color&),
+ const Color& (RenderStyle::*visitedGetter)() const, void (RenderStyle::*visitedSetter)(const Color&))
: AnimationPropertyWrapperBase(prop)
, m_wrapper(std::make_unique<PropertyWrapperColor>(prop, getter, setter))
, m_visitedWrapper(std::make_unique<PropertyWrapperColor>(prop, visitedGetter, visitedSetter))
{
}
- PropertyWrapperVisitedAffectedColor(CSSPropertyID prop, MaybeInvalidColorTag, Color (RenderStyle::*getter)() const, void (RenderStyle::*setter)(const Color&),
- Color (RenderStyle::*visitedGetter)() const, void (RenderStyle::*visitedSetter)(const Color&))
+ PropertyWrapperVisitedAffectedColor(CSSPropertyID prop, MaybeInvalidColorTag, const Color& (RenderStyle::*getter)() const, void (RenderStyle::*setter)(const Color&),
+ const Color& (RenderStyle::*visitedGetter)() const, void (RenderStyle::*visitedSetter)(const Color&))
: AnimationPropertyWrapperBase(prop)
, m_wrapper(std::make_unique<PropertyWrapperMaybeInvalidColor>(prop, getter, setter))
, m_visitedWrapper(std::make_unique<PropertyWrapperMaybeInvalidColor>(prop, visitedGetter, visitedSetter))
Modified: trunk/Source/WebCore/platform/graphics/GraphicsContext.h (206537 => 206538)
--- trunk/Source/WebCore/platform/graphics/GraphicsContext.h 2016-09-28 19:56:30 UTC (rev 206537)
+++ trunk/Source/WebCore/platform/graphics/GraphicsContext.h 2016-09-28 20:19:47 UTC (rev 206538)
@@ -264,7 +264,7 @@
StrokeStyle strokeStyle() const { return m_state.strokeStyle; }
WEBCORE_EXPORT void setStrokeColor(const Color&);
- Color strokeColor() const { return m_state.strokeColor; }
+ const Color& strokeColor() const { return m_state.strokeColor; }
void setStrokePattern(Ref<Pattern>&&);
Pattern* strokePattern() const { return m_state.strokePattern.get(); }
@@ -276,7 +276,7 @@
WindRule fillRule() const { return m_state.fillRule; }
WEBCORE_EXPORT void setFillColor(const Color&);
- Color fillColor() const { return m_state.fillColor; }
+ const Color& fillColor() const { return m_state.fillColor; }
void setFillPattern(Ref<Pattern>&&);
Pattern* fillPattern() const { return m_state.fillPattern.get(); }
@@ -592,7 +592,7 @@
void platformFillRoundedRect(const FloatRoundedRect&, const Color&);
- FloatRect computeLineBoundsAndAntialiasingModeForText(const FloatPoint&, float width, bool printing, Color&);
+ FloatRect computeLineBoundsAndAntialiasingModeForText(const FloatPoint&, float width, bool printing, Color&);
GraphicsContextPlatformPrivate* m_data { nullptr };
DisplayList::Recorder* m_displayListRecorder { nullptr };
Modified: trunk/Source/WebCore/platform/graphics/InbandTextTrackPrivateClient.h (206537 => 206538)
--- trunk/Source/WebCore/platform/graphics/InbandTextTrackPrivateClient.h 2016-09-28 19:56:30 UTC (rev 206537)
+++ trunk/Source/WebCore/platform/graphics/InbandTextTrackPrivateClient.h 2016-09-28 20:19:47 UTC (rev 206538)
@@ -86,15 +86,15 @@
double relativeFontSize() const { return m_relativeFontSize; }
void setRelativeFontSize(double relativeFontSize) { m_relativeFontSize = relativeFontSize; }
- Color foregroundColor() const { return m_foregroundColor; }
- void setForegroundColor(Color color) { m_foregroundColor = color; }
+ const Color& foregroundColor() const { return m_foregroundColor; }
+ void setForegroundColor(const Color& color) { m_foregroundColor = color; }
- Color backgroundColor() const { return m_backgroundColor; }
- void setBackgroundColor(Color color) { m_backgroundColor = color; }
-
- Color highlightColor() const { return m_highlightColor; }
- void setHighlightColor(Color color) { m_highlightColor = color; }
-
+ const Color& backgroundColor() const { return m_backgroundColor; }
+ void setBackgroundColor(const Color& color) { m_backgroundColor = color; }
+
+ const Color& highlightColor() const { return m_highlightColor; }
+ void setHighlightColor(const Color& color) { m_highlightColor = color; }
+
enum Status {
Uninitialized,
Partial,
Modified: trunk/Source/WebCore/platform/graphics/ca/TileController.h (206537 => 206538)
--- trunk/Source/WebCore/platform/graphics/ca/TileController.h 2016-09-28 19:56:30 UTC (rev 206537)
+++ trunk/Source/WebCore/platform/graphics/ca/TileController.h 2016-09-28 20:19:47 UTC (rev 206538)
@@ -93,7 +93,7 @@
float deviceScaleFactor() const { return m_deviceScaleFactor; }
- Color tileDebugBorderColor() const { return m_tileDebugBorderColor; }
+ const Color& tileDebugBorderColor() const { return m_tileDebugBorderColor; }
float tileDebugBorderWidth() const { return m_tileDebugBorderWidth; }
ScrollingModeIndication indicatorMode() const { return m_indicatorMode; }
Modified: trunk/Source/WebCore/platform/graphics/cg/GraphicsContextCG.cpp (206537 => 206538)
--- trunk/Source/WebCore/platform/graphics/cg/GraphicsContextCG.cpp 2016-09-28 19:56:30 UTC (rev 206537)
+++ trunk/Source/WebCore/platform/graphics/cg/GraphicsContextCG.cpp 2016-09-28 20:19:47 UTC (rev 206538)
@@ -935,7 +935,7 @@
WindRule oldFillRule = fillRule();
Color oldFillColor = fillColor();
-
+
setFillRule(RULE_EVENODD);
setFillColor(color);
Modified: trunk/Source/WebCore/platform/graphics/displaylists/DisplayListItems.h (206537 => 206538)
--- trunk/Source/WebCore/platform/graphics/displaylists/DisplayListItems.h 2016-09-28 19:56:30 UTC (rev 206537)
+++ trunk/Source/WebCore/platform/graphics/displaylists/DisplayListItems.h 2016-09-28 20:19:47 UTC (rev 206538)
@@ -909,7 +909,7 @@
const Path& path() const { return m_path; }
int width() const { return m_width; }
int offset() const { return m_offset; }
- Color color() const { return m_color; }
+ const Color& color() const { return m_color; }
private:
DrawFocusRingPath(const Path& path, int width, int offset, const Color& color)
@@ -941,7 +941,7 @@
const Vector<FloatRect> rects() const { return m_rects; }
int width() const { return m_width; }
int offset() const { return m_offset; }
- Color color() const { return m_color; }
+ const Color& color() const { return m_color; }
private:
DrawFocusRingRects(const Vector<FloatRect>& rects, int width, int offset, const Color& color)
@@ -994,7 +994,7 @@
}
FloatRect rect() const { return m_rect; }
- Color color() const { return m_color; }
+ const Color& color() const { return m_color; }
private:
FillRectWithColor(const FloatRect& rect, const Color& color)
@@ -1043,7 +1043,7 @@
}
FloatRect rect() const { return m_rect; }
- Color color() const { return m_color; }
+ const Color& color() const { return m_color; }
CompositeOperator compositeOperator() const { return m_op; }
BlendMode blendMode() const { return m_blendMode; }
@@ -1074,7 +1074,7 @@
}
const FloatRoundedRect& roundedRect() const { return m_rect; }
- Color color() const { return m_color; }
+ const Color& color() const { return m_color; }
BlendMode blendMode() const { return m_blendMode; }
private:
@@ -1103,7 +1103,7 @@
const FloatRect& rect() const { return m_rect; }
const FloatRoundedRect& roundedHoleRect() const { return m_roundedHoleRect; }
- Color color() const { return m_color; }
+ const Color& color() const { return m_color; }
private:
FillRectWithRoundedHole(const FloatRect& rect, const FloatRoundedRect& roundedHoleRect, const Color& color)
Modified: trunk/Source/WebCore/platform/graphics/filters/FEDiffuseLighting.cpp (206537 => 206538)
--- trunk/Source/WebCore/platform/graphics/filters/FEDiffuseLighting.cpp 2016-09-28 19:56:30 UTC (rev 206537)
+++ trunk/Source/WebCore/platform/graphics/filters/FEDiffuseLighting.cpp 2016-09-28 20:19:47 UTC (rev 206538)
@@ -44,7 +44,7 @@
{
}
-Color FEDiffuseLighting::lightingColor() const
+const Color& FEDiffuseLighting::lightingColor() const
{
return m_lightingColor;
}
Modified: trunk/Source/WebCore/platform/graphics/filters/FEDiffuseLighting.h (206537 => 206538)
--- trunk/Source/WebCore/platform/graphics/filters/FEDiffuseLighting.h 2016-09-28 19:56:30 UTC (rev 206537)
+++ trunk/Source/WebCore/platform/graphics/filters/FEDiffuseLighting.h 2016-09-28 20:19:47 UTC (rev 206538)
@@ -34,7 +34,7 @@
float, float, PassRefPtr<LightSource>);
virtual ~FEDiffuseLighting();
- Color lightingColor() const;
+ const Color& lightingColor() const;
bool setLightingColor(const Color&);
float surfaceScale() const;
Modified: trunk/Source/WebCore/platform/graphics/filters/FEDropShadow.h (206537 => 206538)
--- trunk/Source/WebCore/platform/graphics/filters/FEDropShadow.h 2016-09-28 19:56:30 UTC (rev 206537)
+++ trunk/Source/WebCore/platform/graphics/filters/FEDropShadow.h 2016-09-28 20:19:47 UTC (rev 206538)
@@ -42,7 +42,7 @@
float dy() const { return m_dy; }
void setDy(float dy) { m_dy = dy; }
- Color shadowColor() const { return m_shadowColor; }
+ const Color& shadowColor() const { return m_shadowColor; }
void setShadowColor(const Color& shadowColor) { m_shadowColor = shadowColor; }
float shadowOpacity() const { return m_shadowOpacity; }
Modified: trunk/Source/WebCore/platform/graphics/filters/FEFlood.cpp (206537 => 206538)
--- trunk/Source/WebCore/platform/graphics/filters/FEFlood.cpp 2016-09-28 19:56:30 UTC (rev 206537)
+++ trunk/Source/WebCore/platform/graphics/filters/FEFlood.cpp 2016-09-28 20:19:47 UTC (rev 206538)
@@ -41,7 +41,7 @@
return adoptRef(*new FEFlood(filter, floodColor, floodOpacity));
}
-Color FEFlood::floodColor() const
+const Color& FEFlood::floodColor() const
{
return m_floodColor;
}
@@ -73,7 +73,7 @@
if (!resultImage)
return;
- Color color = colorWithOverrideAlpha(floodColor().rgb(), floodOpacity());
+ const Color& color = colorWithOverrideAlpha(floodColor().rgb(), floodOpacity());
resultImage->context().fillRect(FloatRect(FloatPoint(), absolutePaintRect().size()), color);
}
Modified: trunk/Source/WebCore/platform/graphics/filters/FEFlood.h (206537 => 206538)
--- trunk/Source/WebCore/platform/graphics/filters/FEFlood.h 2016-09-28 19:56:30 UTC (rev 206537)
+++ trunk/Source/WebCore/platform/graphics/filters/FEFlood.h 2016-09-28 20:19:47 UTC (rev 206538)
@@ -32,7 +32,7 @@
public:
static Ref<FEFlood> create(Filter&, const Color&, float);
- Color floodColor() const;
+ const Color& floodColor() const;
bool setFloodColor(const Color&);
float floodOpacity() const;
Modified: trunk/Source/WebCore/platform/graphics/filters/FESpecularLighting.cpp (206537 => 206538)
--- trunk/Source/WebCore/platform/graphics/filters/FESpecularLighting.cpp 2016-09-28 19:56:30 UTC (rev 206537)
+++ trunk/Source/WebCore/platform/graphics/filters/FESpecularLighting.cpp 2016-09-28 20:19:47 UTC (rev 206538)
@@ -46,7 +46,7 @@
{
}
-Color FESpecularLighting::lightingColor() const
+const Color& FESpecularLighting::lightingColor() const
{
return m_lightingColor;
}
Modified: trunk/Source/WebCore/platform/graphics/filters/FESpecularLighting.h (206537 => 206538)
--- trunk/Source/WebCore/platform/graphics/filters/FESpecularLighting.h 2016-09-28 19:56:30 UTC (rev 206537)
+++ trunk/Source/WebCore/platform/graphics/filters/FESpecularLighting.h 2016-09-28 20:19:47 UTC (rev 206538)
@@ -32,7 +32,7 @@
float, float, float, PassRefPtr<LightSource>);
virtual ~FESpecularLighting();
- Color lightingColor() const;
+ const Color& lightingColor() const;
bool setLightingColor(const Color&);
float surfaceScale() const;
Modified: trunk/Source/WebCore/platform/graphics/filters/FilterOperation.h (206537 => 206538)
--- trunk/Source/WebCore/platform/graphics/filters/FilterOperation.h 2016-09-28 19:56:30 UTC (rev 206537)
+++ trunk/Source/WebCore/platform/graphics/filters/FilterOperation.h 2016-09-28 20:19:47 UTC (rev 206538)
@@ -302,7 +302,7 @@
class WEBCORE_EXPORT DropShadowFilterOperation : public FilterOperation {
public:
- static PassRefPtr<DropShadowFilterOperation> create(const IntPoint& location, int stdDeviation, Color color)
+ static PassRefPtr<DropShadowFilterOperation> create(const IntPoint& location, int stdDeviation, const Color& color)
{
return adoptRef(new DropShadowFilterOperation(location, stdDeviation, color));
}
@@ -316,7 +316,7 @@
int y() const { return m_location.y(); }
IntPoint location() const { return m_location; }
int stdDeviation() const { return m_stdDeviation; }
- Color color() const { return m_color; }
+ const Color& color() const { return m_color; }
bool affectsOpacity() const override { return true; }
bool movesPixels() const override { return true; }
@@ -326,7 +326,7 @@
private:
bool operator==(const FilterOperation&) const override;
- DropShadowFilterOperation(const IntPoint& location, int stdDeviation, Color color)
+ DropShadowFilterOperation(const IntPoint& location, int stdDeviation, const Color& color)
: FilterOperation(DROP_SHADOW)
, m_location(location)
, m_stdDeviation(stdDeviation)
Modified: trunk/Source/WebCore/rendering/BorderEdge.h (206537 => 206538)
--- trunk/Source/WebCore/rendering/BorderEdge.h 2016-09-28 19:56:30 UTC (rev 206537)
+++ trunk/Source/WebCore/rendering/BorderEdge.h 2016-09-28 20:19:47 UTC (rev 206538)
@@ -53,7 +53,7 @@
static void getBorderEdgeInfo(BorderEdge edges[], const RenderStyle&, float deviceScaleFactor, bool includeLogicalLeftEdge = true, bool includeLogicalRightEdge = true);
EBorderStyle style() const { return m_style; }
- Color color() const { return m_color; }
+ const Color& color() const { return m_color; }
bool isTransparent() const { return m_isTransparent; }
bool isPresent() const { return m_isPresent; }
Modified: trunk/Source/WebCore/rendering/InlineFlowBox.cpp (206537 => 206538)
--- trunk/Source/WebCore/rendering/InlineFlowBox.cpp 2016-09-28 19:56:30 UTC (rev 206537)
+++ trunk/Source/WebCore/rendering/InlineFlowBox.cpp 2016-09-28 20:19:47 UTC (rev 206538)
@@ -1379,8 +1379,8 @@
if (!renderer().boxShadowShouldBeAppliedToBackground(adjustedPaintoffset, BackgroundBleedNone, this))
paintBoxShadow(paintInfo, lineStyle, Normal, paintRect);
- Color c = lineStyle.visitedDependentColor(CSSPropertyBackgroundColor);
- paintFillLayers(paintInfo, c, lineStyle.backgroundLayers(), paintRect);
+ const Color& color = lineStyle.visitedDependentColor(CSSPropertyBackgroundColor);
+ paintFillLayers(paintInfo, color, lineStyle.backgroundLayers(), paintRect);
paintBoxShadow(paintInfo, lineStyle, Inset, paintRect);
// :first-line cannot be used to put borders on a line. Always paint borders with our
Modified: trunk/Source/WebCore/rendering/InlineTextBox.cpp (206537 => 206538)
--- trunk/Source/WebCore/rendering/InlineTextBox.cpp 2016-09-28 19:56:30 UTC (rev 206537)
+++ trunk/Source/WebCore/rendering/InlineTextBox.cpp 2016-09-28 20:19:47 UTC (rev 206538)
@@ -617,7 +617,7 @@
return { clampedOffset(start), clampedOffset(end) };
}
-void InlineTextBox::paintSelection(GraphicsContext& context, const FloatPoint& boxOrigin, const RenderStyle& style, const FontCascade& font, Color textColor)
+void InlineTextBox::paintSelection(GraphicsContext& context, const FloatPoint& boxOrigin, const RenderStyle& style, const FontCascade& font, const Color& textColor)
{
#if ENABLE(TEXT_SELECTION)
if (context.paintingDisabled())
Modified: trunk/Source/WebCore/rendering/InlineTextBox.h (206537 => 206538)
--- trunk/Source/WebCore/rendering/InlineTextBox.h 2016-09-28 19:56:30 UTC (rev 206537)
+++ trunk/Source/WebCore/rendering/InlineTextBox.h 2016-09-28 20:19:47 UTC (rev 206538)
@@ -161,7 +161,7 @@
private:
void paintDecoration(GraphicsContext&, const FontCascade&, RenderCombineText*, const TextRun&, const FloatPoint& textOrigin, const FloatRect& boxRect,
TextDecoration, TextPaintStyle, const ShadowData*);
- void paintSelection(GraphicsContext&, const FloatPoint& boxOrigin, const RenderStyle&, const FontCascade&, Color textColor);
+ void paintSelection(GraphicsContext&, const FloatPoint& boxOrigin, const RenderStyle&, const FontCascade&, const Color& textColor);
void paintDocumentMarker(GraphicsContext&, const FloatPoint& boxOrigin, RenderedDocumentMarker&, const RenderStyle&, const FontCascade&, bool grammar);
void paintTextMatchMarker(GraphicsContext&, const FloatPoint& boxOrigin, RenderedDocumentMarker&, const RenderStyle&, const FontCascade&);
Modified: trunk/Source/WebCore/rendering/RenderFrameSet.cpp (206537 => 206538)
--- trunk/Source/WebCore/rendering/RenderFrameSet.cpp 2016-09-28 19:56:30 UTC (rev 206537)
+++ trunk/Source/WebCore/rendering/RenderFrameSet.cpp 2016-09-28 20:19:47 UTC (rev 206538)
@@ -67,19 +67,22 @@
{
}
-static Color borderStartEdgeColor()
+static const Color& borderStartEdgeColor()
{
- return Color(170, 170, 170);
+ static const Color color(170, 170, 170);
+ return color;
}
-static Color borderEndEdgeColor()
+static const Color& borderEndEdgeColor()
{
- return Color::black;
+ static const Color color = Color::black;
+ return color;
}
-static Color borderFillColor()
+static const Color& borderFillColor()
{
- return Color(208, 208, 208);
+ static const Color color(208, 208, 208);
+ return color;
}
void RenderFrameSet::paintColumnBorder(const PaintInfo& paintInfo, const IntRect& borderRect)
Modified: trunk/Source/WebCore/rendering/RenderInline.cpp (206537 => 206538)
--- trunk/Source/WebCore/rendering/RenderInline.cpp 2016-09-28 19:56:30 UTC (rev 206537)
+++ trunk/Source/WebCore/rendering/RenderInline.cpp 2016-09-28 20:19:47 UTC (rev 206538)
@@ -1644,7 +1644,7 @@
}
void RenderInline::paintOutlineForLine(GraphicsContext& graphicsContext, const LayoutPoint& paintOffset,
- const LayoutRect& previousLine, const LayoutRect& thisLine, const LayoutRect& nextLine, const Color outlineColor)
+ const LayoutRect& previousLine, const LayoutRect& thisLine, const LayoutRect& nextLine, const Color& outlineColor)
{
const auto& styleToUse = style();
float outlineOffset = styleToUse.outlineOffset();
Modified: trunk/Source/WebCore/rendering/RenderInline.h (206537 => 206538)
--- trunk/Source/WebCore/rendering/RenderInline.h 2016-09-28 19:56:30 UTC (rev 206537)
+++ trunk/Source/WebCore/rendering/RenderInline.h 2016-09-28 20:19:47 UTC (rev 206538)
@@ -173,8 +173,7 @@
RenderPtr<RenderInline> clone() const;
- void paintOutlineForLine(GraphicsContext&, const LayoutPoint&, const LayoutRect& prevLine, const LayoutRect& thisLine,
- const LayoutRect& nextLine, const Color);
+ void paintOutlineForLine(GraphicsContext&, const LayoutPoint&, const LayoutRect& prevLine, const LayoutRect& thisLine, const LayoutRect& nextLine, const Color&);
RenderBoxModelObject* continuationBefore(RenderObject* beforeChild);
bool willChangeCreatesStackingContext() const
Modified: trunk/Source/WebCore/rendering/RenderLayerCompositor.h (206537 => 206538)
--- trunk/Source/WebCore/rendering/RenderLayerCompositor.h 2016-09-28 19:56:30 UTC (rev 206537)
+++ trunk/Source/WebCore/rendering/RenderLayerCompositor.h 2016-09-28 20:19:47 UTC (rev 206538)
@@ -312,7 +312,7 @@
void didPaintBacking(RenderLayerBacking*);
void setRootExtendedBackgroundColor(const Color&);
- Color rootExtendedBackgroundColor() const { return m_rootExtendedBackgroundColor; }
+ const Color& rootExtendedBackgroundColor() const { return m_rootExtendedBackgroundColor; }
#if ENABLE(CSS_SCROLL_SNAP)
void updateScrollSnapPropertiesWithFrameView(const FrameView&);
Modified: trunk/Source/WebCore/rendering/RenderView.cpp (206537 => 206538)
--- trunk/Source/WebCore/rendering/RenderView.cpp 2016-09-28 19:56:30 UTC (rev 206537)
+++ trunk/Source/WebCore/rendering/RenderView.cpp 2016-09-28 20:19:47 UTC (rev 206538)
@@ -578,8 +578,8 @@
if (frameView().isTransparent()) // FIXME: This needs to be dynamic. We should be able to go back to blitting if we ever stop being transparent.
frameView().setCannotBlitToWindow(); // The parent must show behind the child.
else {
- Color documentBackgroundColor = frameView().documentBackgroundColor();
- Color backgroundColor = (backgroundShouldExtendBeyondPage && documentBackgroundColor.isValid()) ? documentBackgroundColor : frameView().baseBackgroundColor();
+ const Color& documentBackgroundColor = frameView().documentBackgroundColor();
+ const Color& backgroundColor = (backgroundShouldExtendBeyondPage && documentBackgroundColor.isValid()) ? documentBackgroundColor : frameView().baseBackgroundColor();
if (backgroundColor.alpha()) {
CompositeOperator previousOperator = paintInfo.context().compositeOperation();
paintInfo.context().setCompositeOperation(CompositeCopy);
Modified: trunk/Source/WebCore/rendering/TextDecorationPainter.cpp (206537 => 206538)
--- trunk/Source/WebCore/rendering/TextDecorationPainter.cpp 2016-09-28 19:56:30 UTC (rev 206537)
+++ trunk/Source/WebCore/rendering/TextDecorationPainter.cpp 2016-09-28 20:19:47 UTC (rev 206538)
@@ -262,7 +262,7 @@
m_context.setStrokeThickness(textDecorationThickness);
FloatPoint localOrigin = boxOrigin;
- auto paintDecoration = [&](TextDecoration decoration, TextDecorationStyle style, Color color, const FloatPoint& start, const FloatPoint& end, int offset) {
+ auto paintDecoration = [&](TextDecoration decoration, TextDecorationStyle style, const Color& color, const FloatPoint& start, const FloatPoint& end, int offset) {
m_context.setStrokeColor(color);
auto strokeStyle = textDecorationStyleToStrokeStyle(style);
Modified: trunk/Source/WebCore/rendering/style/BorderValue.h (206537 => 206538)
--- trunk/Source/WebCore/rendering/style/BorderValue.h 2016-09-28 19:56:30 UTC (rev 206537)
+++ trunk/Source/WebCore/rendering/style/BorderValue.h 2016-09-28 20:19:47 UTC (rev 206538)
@@ -69,7 +69,7 @@
m_color = color;
}
- Color color() const { return m_color; }
+ const Color& color() const { return m_color; }
float width() const { return m_width; }
EBorderStyle style() const { return static_cast<EBorderStyle>(m_style); }
Modified: trunk/Source/WebCore/rendering/style/CollapsedBorderValue.h (206537 => 206538)
--- trunk/Source/WebCore/rendering/style/CollapsedBorderValue.h 2016-09-28 19:56:30 UTC (rev 206537)
+++ trunk/Source/WebCore/rendering/style/CollapsedBorderValue.h 2016-09-28 20:19:47 UTC (rev 206538)
@@ -51,7 +51,7 @@
LayoutUnit width() const { return m_style > BHIDDEN ? m_width : LayoutUnit::fromPixel(0); }
EBorderStyle style() const { return static_cast<EBorderStyle>(m_style); }
bool exists() const { return m_precedence != BOFF; }
- Color color() const { return m_color; }
+ const Color& color() const { return m_color; }
bool isTransparent() const { return m_transparent; }
EBorderPrecedence precedence() const { return static_cast<EBorderPrecedence>(m_precedence); }
Modified: trunk/Source/WebCore/rendering/style/RenderStyle.cpp (206537 => 206538)
--- trunk/Source/WebCore/rendering/style/RenderStyle.cpp 2016-09-28 19:56:30 UTC (rev 206537)
+++ trunk/Source/WebCore/rendering/style/RenderStyle.cpp 2016-09-28 20:19:47 UTC (rev 206538)
@@ -1189,11 +1189,26 @@
rareInheritedData.access()->listStyleImage = v;
}
-Color RenderStyle::color() const { return inherited->color; }
-Color RenderStyle::visitedLinkColor() const { return inherited->visitedLinkColor; }
-void RenderStyle::setColor(const Color& v) { SET_VAR(inherited, color, v); }
-void RenderStyle::setVisitedLinkColor(const Color& v) { SET_VAR(inherited, visitedLinkColor, v); }
+const Color& RenderStyle::color() const
+{
+ return inherited->color;
+}
+const Color& RenderStyle::visitedLinkColor() const
+{
+ return inherited->visitedLinkColor;
+}
+
+void RenderStyle::setColor(const Color& v)
+{
+ SET_VAR(inherited, color, v);
+}
+
+void RenderStyle::setVisitedLinkColor(const Color& v)
+{
+ SET_VAR(inherited, visitedLinkColor, v);
+}
+
float RenderStyle::horizontalBorderSpacing() const { return inherited->horizontal_border_spacing; }
float RenderStyle::verticalBorderSpacing() const { return inherited->vertical_border_spacing; }
void RenderStyle::setHorizontalBorderSpacing(float v) { SET_VAR(inherited, horizontal_border_spacing, v); }
Modified: trunk/Source/WebCore/rendering/style/RenderStyle.h (206537 => 206538)
--- trunk/Source/WebCore/rendering/style/RenderStyle.h 2016-09-28 19:56:30 UTC (rev 206537)
+++ trunk/Source/WebCore/rendering/style/RenderStyle.h 2016-09-28 20:19:47 UTC (rev 206538)
@@ -2238,36 +2238,36 @@
// Color accessors are all private to make sure callers use visitedDependentColor instead to access them.
static Color invalidColor() { return Color(); }
- Color borderLeftColor() const { return surround->border.left().color(); }
- Color borderRightColor() const { return surround->border.right().color(); }
- Color borderTopColor() const { return surround->border.top().color(); }
- Color borderBottomColor() const { return surround->border.bottom().color(); }
- Color backgroundColor() const { return m_background->color(); }
- Color color() const;
- Color columnRuleColor() const { return rareNonInheritedData->m_multiCol->m_rule.color(); }
- Color outlineColor() const { return m_background->outline().color(); }
- Color textEmphasisColor() const { return rareInheritedData->textEmphasisColor; }
- Color textFillColor() const { return rareInheritedData->textFillColor; }
- Color textStrokeColor() const { return rareInheritedData->textStrokeColor; }
- Color visitedLinkColor() const;
- Color visitedLinkBackgroundColor() const { return rareNonInheritedData->m_visitedLinkBackgroundColor; }
- Color visitedLinkBorderLeftColor() const { return rareNonInheritedData->m_visitedLinkBorderLeftColor; }
- Color visitedLinkBorderRightColor() const { return rareNonInheritedData->m_visitedLinkBorderRightColor; }
- Color visitedLinkBorderBottomColor() const { return rareNonInheritedData->m_visitedLinkBorderBottomColor; }
- Color visitedLinkBorderTopColor() const { return rareNonInheritedData->m_visitedLinkBorderTopColor; }
- Color visitedLinkOutlineColor() const { return rareNonInheritedData->m_visitedLinkOutlineColor; }
- Color visitedLinkColumnRuleColor() const { return rareNonInheritedData->m_multiCol->m_visitedLinkColumnRuleColor; }
- Color textDecorationColor() const { return rareNonInheritedData->m_textDecorationColor; }
- Color visitedLinkTextDecorationColor() const { return rareNonInheritedData->m_visitedLinkTextDecorationColor; }
- Color visitedLinkTextEmphasisColor() const { return rareInheritedData->visitedLinkTextEmphasisColor; }
- Color visitedLinkTextFillColor() const { return rareInheritedData->visitedLinkTextFillColor; }
- Color visitedLinkTextStrokeColor() const { return rareInheritedData->visitedLinkTextStrokeColor; }
+ const Color& borderLeftColor() const { return surround->border.left().color(); }
+ const Color& borderRightColor() const { return surround->border.right().color(); }
+ const Color& borderTopColor() const { return surround->border.top().color(); }
+ const Color& borderBottomColor() const { return surround->border.bottom().color(); }
+ const Color& backgroundColor() const { return m_background->color(); }
+ const Color& color() const;
+ const Color& columnRuleColor() const { return rareNonInheritedData->m_multiCol->m_rule.color(); }
+ const Color& outlineColor() const { return m_background->outline().color(); }
+ const Color& textEmphasisColor() const { return rareInheritedData->textEmphasisColor; }
+ const Color& textFillColor() const { return rareInheritedData->textFillColor; }
+ const Color& textStrokeColor() const { return rareInheritedData->textStrokeColor; }
+ const Color& visitedLinkColor() const;
+ const Color& visitedLinkBackgroundColor() const { return rareNonInheritedData->m_visitedLinkBackgroundColor; }
+ const Color& visitedLinkBorderLeftColor() const { return rareNonInheritedData->m_visitedLinkBorderLeftColor; }
+ const Color& visitedLinkBorderRightColor() const { return rareNonInheritedData->m_visitedLinkBorderRightColor; }
+ const Color& visitedLinkBorderBottomColor() const { return rareNonInheritedData->m_visitedLinkBorderBottomColor; }
+ const Color& visitedLinkBorderTopColor() const { return rareNonInheritedData->m_visitedLinkBorderTopColor; }
+ const Color& visitedLinkOutlineColor() const { return rareNonInheritedData->m_visitedLinkOutlineColor; }
+ const Color& visitedLinkColumnRuleColor() const { return rareNonInheritedData->m_multiCol->m_visitedLinkColumnRuleColor; }
+ const Color& textDecorationColor() const { return rareNonInheritedData->m_textDecorationColor; }
+ const Color& visitedLinkTextDecorationColor() const { return rareNonInheritedData->m_visitedLinkTextDecorationColor; }
+ const Color& visitedLinkTextEmphasisColor() const { return rareInheritedData->visitedLinkTextEmphasisColor; }
+ const Color& visitedLinkTextFillColor() const { return rareInheritedData->visitedLinkTextFillColor; }
+ const Color& visitedLinkTextStrokeColor() const { return rareInheritedData->visitedLinkTextStrokeColor; }
Color colorIncludingFallback(int colorProperty, bool visitedLink) const;
- Color stopColor() const { return svgStyle().stopColor(); }
- Color floodColor() const { return svgStyle().floodColor(); }
- Color lightingColor() const { return svgStyle().lightingColor(); }
+ const Color& stopColor() const { return svgStyle().stopColor(); }
+ const Color& floodColor() const { return svgStyle().floodColor(); }
+ const Color& lightingColor() const { return svgStyle().lightingColor(); }
void appendContent(std::unique_ptr<ContentData>);
};
Modified: trunk/Source/WebCore/svg/SVGFEDiffuseLightingElement.cpp (206537 => 206538)
--- trunk/Source/WebCore/svg/SVGFEDiffuseLightingElement.cpp 2016-09-28 19:56:30 UTC (rev 206537)
+++ trunk/Source/WebCore/svg/SVGFEDiffuseLightingElement.cpp 2016-09-28 20:19:47 UTC (rev 206538)
@@ -186,9 +186,9 @@
RenderObject* renderer = this->renderer();
if (!renderer)
return nullptr;
-
- Color color = renderer->style().svgStyle().lightingColor();
+ const Color& color = renderer->style().svgStyle().lightingColor();
+
RefPtr<FilterEffect> effect = FEDiffuseLighting::create(filter, color, surfaceScale(), diffuseConstant(),
kernelUnitLengthX(), kernelUnitLengthY(), WTFMove(lightSource));
effect->inputEffects().append(input1);
Modified: trunk/Source/WebCore/svg/SVGFEDropShadowElement.cpp (206537 => 206538)
--- trunk/Source/WebCore/svg/SVGFEDropShadowElement.cpp 2016-09-28 19:56:30 UTC (rev 206537)
+++ trunk/Source/WebCore/svg/SVGFEDropShadowElement.cpp 2016-09-28 20:19:47 UTC (rev 206538)
@@ -130,7 +130,7 @@
const SVGRenderStyle& svgStyle = renderer->style().svgStyle();
- Color color = svgStyle.floodColor();
+ const Color& color = svgStyle.floodColor();
float opacity = svgStyle.floodOpacity();
FilterEffect* input1 = filterBuilder->getEffectById(in1());
Modified: trunk/Source/WebCore/svg/SVGFEFloodElement.cpp (206537 => 206538)
--- trunk/Source/WebCore/svg/SVGFEFloodElement.cpp 2016-09-28 19:56:30 UTC (rev 206537)
+++ trunk/Source/WebCore/svg/SVGFEFloodElement.cpp 2016-09-28 20:19:47 UTC (rev 206538)
@@ -62,7 +62,7 @@
const SVGRenderStyle& svgStyle = renderer->style().svgStyle();
- Color color = svgStyle.floodColor();
+ const Color& color = svgStyle.floodColor();
float opacity = svgStyle.floodOpacity();
return FEFlood::create(filter, color, opacity);
Modified: trunk/Source/WebCore/svg/SVGFESpecularLightingElement.cpp (206537 => 206538)
--- trunk/Source/WebCore/svg/SVGFESpecularLightingElement.cpp 2016-09-28 19:56:30 UTC (rev 206537)
+++ trunk/Source/WebCore/svg/SVGFESpecularLightingElement.cpp 2016-09-28 20:19:47 UTC (rev 206538)
@@ -198,7 +198,7 @@
if (!renderer)
return nullptr;
- Color color = renderer->style().svgStyle().lightingColor();
+ const Color& color = renderer->style().svgStyle().lightingColor();
RefPtr<FilterEffect> effect = FESpecularLighting::create(filter, color, surfaceScale(), specularConstant(),
specularExponent(), kernelUnitLengthX(), kernelUnitLengthY(), WTFMove(lightSource));
Modified: trunk/Source/WebCore/svg/SVGGradientElement.cpp (206537 => 206538)
--- trunk/Source/WebCore/svg/SVGGradientElement.cpp 2016-09-28 19:56:30 UTC (rev 206537)
+++ trunk/Source/WebCore/svg/SVGGradientElement.cpp 2016-09-28 20:19:47 UTC (rev 206538)
@@ -133,7 +133,7 @@
float previousOffset = 0.0f;
for (auto& stop : childrenOfType<SVGStopElement>(*this)) {
- Color color = stop.stopColorIncludingOpacity();
+ const Color& color = stop.stopColorIncludingOpacity();
// Figure out right monotonic offset
float offset = stop.offset();