From 732aac67040be85be263820ec6061cbfd61fbc3a Mon Sep 17 00:00:00 2001 From: Robert Longson Date: Sat, 29 Apr 2017 14:03:20 +0100 Subject: [PATCH] Bug 1347409 part 1 - introduce nsStyleSVGFallbackType so that we can begin to distinguish the type of paintserver fallback r=cam --- layout/style/nsStyleStruct.cpp | 2 ++ layout/style/nsStyleStruct.h | 13 ++++++++++++- 2 files changed, 14 insertions(+), 1 deletion(-) diff --git a/layout/style/nsStyleStruct.cpp b/layout/style/nsStyleStruct.cpp index bba22a538ca5..f020c477456d 100644 --- a/layout/style/nsStyleStruct.cpp +++ b/layout/style/nsStyleStruct.cpp @@ -1254,6 +1254,7 @@ nsStyleSVGReset::HasMask() const // nsStyleSVGPaint implementation nsStyleSVGPaint::nsStyleSVGPaint(nsStyleSVGPaintType aType) : mType(aType) + , mFallbackType(eStyleSVGFallbackType_NotSet) , mFallbackColor(NS_RGB(0, 0, 0)) { MOZ_ASSERT(aType == nsStyleSVGPaintType(0) || @@ -1288,6 +1289,7 @@ nsStyleSVGPaint::Reset() MOZ_FALLTHROUGH; case eStyleSVGPaintType_ContextFill: case eStyleSVGPaintType_ContextStroke: + mFallbackType = eStyleSVGFallbackType_NotSet; mFallbackColor = NS_RGB(0, 0, 0); break; } diff --git a/layout/style/nsStyleStruct.h b/layout/style/nsStyleStruct.h index df05883174d7..01ed60ee52dd 100644 --- a/layout/style/nsStyleStruct.h +++ b/layout/style/nsStyleStruct.h @@ -3376,7 +3376,7 @@ protected: nscoord mTwipsPerPixel; }; -enum nsStyleSVGPaintType { +enum nsStyleSVGPaintType : uint8_t { eStyleSVGPaintType_None = 1, eStyleSVGPaintType_Color, eStyleSVGPaintType_Server, @@ -3384,6 +3384,12 @@ enum nsStyleSVGPaintType { eStyleSVGPaintType_ContextStroke }; +enum nsStyleSVGFallbackType : uint8_t { + eStyleSVGFallbackType_NotSet, + eStyleSVGFallbackType_None, + eStyleSVGFallbackType_Color, +}; + enum nsStyleSVGOpacitySource : uint8_t { eStyleSVGOpacitySource_Normal, eStyleSVGOpacitySource_ContextFillOpacity, @@ -3418,6 +3424,10 @@ public: return mPaint.mPaintServer; } + nsStyleSVGFallbackType GetFallbackType() const { + return mFallbackType; + } + nscolor GetFallbackColor() const { MOZ_ASSERT(mType == eStyleSVGPaintType_Server || mType == eStyleSVGPaintType_ContextFill || @@ -3439,6 +3449,7 @@ private: mozilla::css::URLValue* mPaintServer; } mPaint; nsStyleSVGPaintType mType; + nsStyleSVGFallbackType mFallbackType; nscolor mFallbackColor; };