Loading gfx/2d/2D.h +0 −23 Original line number Diff line number Diff line Loading @@ -290,29 +290,6 @@ class RadialGradientPattern : public Pattern { Matrix mMatrix; //!< A matrix that transforms the pattern into user space }; /** * This class is used for Conic Gradient Patterns, the gradient stops are * stored in a separate object and are backend dependent. This class itself * may be used on the stack. */ class ConicGradientPattern : public Pattern { public: /// For constructor parameter description, see member data documentation. ConicGradientPattern(const Point& aCenter, Float aAngle, GradientStops* aStops, const Matrix& aMatrix = Matrix()) : mCenter(aCenter), mAngle(aAngle), mStops(aStops), mMatrix(aMatrix) {} PatternType GetType() const override { return PatternType::CONIC_GRADIENT; } Point mCenter; //!< Center of the gradient Float mAngle; //!< Start angle of gradient RefPtr<GradientStops> mStops; /**< GradientStops object for this gradient, this should match the backend type of the draw target this pattern will be used with. */ Matrix mMatrix; //!< A matrix that transforms the pattern into user space }; /** * This class is used for Surface Patterns, they wrap a surface and a * repetition mode for the surface. This may be used on the stack. Loading gfx/2d/DrawCommands.h +0 −5 Original line number Diff line number Diff line Loading @@ -68,10 +68,6 @@ class StoredPattern { new (mRadial) RadialGradientPattern( *static_cast<const RadialGradientPattern*>(&aPattern)); return; case PatternType::CONIC_GRADIENT: new (mConic) ConicGradientPattern( *static_cast<const ConicGradientPattern*>(&aPattern)); return; } } Loading Loading @@ -102,7 +98,6 @@ class StoredPattern { char mColor[sizeof(ColorPattern)]; char mLinear[sizeof(LinearGradientPattern)]; char mRadial[sizeof(RadialGradientPattern)]; char mConic[sizeof(ConicGradientPattern)]; char mSurface[sizeof(SurfacePattern)]; }; }; Loading gfx/2d/DrawTargetCairo.cpp +0 −14 Original line number Diff line number Diff line Loading @@ -184,11 +184,6 @@ static bool PatternIsCompatible(const Pattern& aPattern) { static_cast<const RadialGradientPattern&>(aPattern); return pattern.mStops->GetBackendType() == BackendType::CAIRO; } case PatternType::CONIC_GRADIENT: { const ConicGradientPattern& pattern = static_cast<const ConicGradientPattern&>(aPattern); return pattern.mStops->GetBackendType() == BackendType::CAIRO; } default: return true; } Loading Loading @@ -526,15 +521,6 @@ static cairo_pattern_t* GfxPatternToCairoPattern(const Pattern& aPattern, break; } case PatternType::CONIC_GRADIENT: { const ConicGradientPattern& pattern = static_cast<const ConicGradientPattern&>(aPattern); // XXX(ntim): bug 1617039 - implement conic-gradient for Cairo pat = cairo_pattern_create_rgba(0.0, 0.0, 0.0, 0.0); break; } default: { // We should support all pattern types! MOZ_ASSERT(false); Loading gfx/2d/DrawTargetRecording.cpp +0 −7 Original line number Diff line number Diff line Loading @@ -633,13 +633,6 @@ void DrawTargetRecording::EnsurePatternDependenciesStored( static_cast<const RadialGradientPattern*>(&aPattern)->mStops)); return; } case PatternType::CONIC_GRADIENT: { MOZ_ASSERT_IF( static_cast<const ConicGradientPattern*>(&aPattern)->mStops, mRecorder->HasStoredObject( static_cast<const ConicGradientPattern*>(&aPattern)->mStops)); return; } case PatternType::SURFACE: { const SurfacePattern* pat = static_cast<const SurfacePattern*>(&aPattern); EnsureSurfaceStoredRecording(mRecorder, pat->mSurface, Loading gfx/2d/DrawTargetSkia.cpp +0 −36 Original line number Diff line number Diff line Loading @@ -494,42 +494,6 @@ static void SetPaintPattern(SkPaint& aPaint, const Pattern& aPattern, } break; } case PatternType::CONIC_GRADIENT: { const ConicGradientPattern& pat = static_cast<const ConicGradientPattern&>(aPattern); GradientStopsSkia* stops = static_cast<GradientStopsSkia*>(pat.mStops.get()); if (!stops || stops->mCount < 2 || !pat.mCenter.IsFinite() || !IsFinite(pat.mAngle)) { aPaint.setColor(SK_ColorTRANSPARENT); } else { SkMatrix mat; GfxMatrixToSkiaMatrix(pat.mMatrix, mat); if (aMatrix) { mat.postConcat(*aMatrix); } SkScalar cx = SkFloatToScalar(pat.mCenter.x); SkScalar cy = SkFloatToScalar(pat.mCenter.y); // Skia's sweep gradient angles are relative to the x-axis, not the // y-axis. Float angle = (pat.mAngle * 180.0 / M_PI) - 90.0; if (angle != 0.0) { mat.preRotate(angle, cx, cy); } sk_sp<SkShader> shader = SkGradientShader::MakeSweep( cx, cy, &stops->mColors.front(), &stops->mPositions.front(), stops->mCount, 0, &mat); if (shader) { aPaint.setShader(shader); } else { aPaint.setColor(SK_ColorTRANSPARENT); } } break; } case PatternType::SURFACE: { const SurfacePattern& pat = static_cast<const SurfacePattern&>(aPattern); sk_sp<SkImage> image = Loading Loading
gfx/2d/2D.h +0 −23 Original line number Diff line number Diff line Loading @@ -290,29 +290,6 @@ class RadialGradientPattern : public Pattern { Matrix mMatrix; //!< A matrix that transforms the pattern into user space }; /** * This class is used for Conic Gradient Patterns, the gradient stops are * stored in a separate object and are backend dependent. This class itself * may be used on the stack. */ class ConicGradientPattern : public Pattern { public: /// For constructor parameter description, see member data documentation. ConicGradientPattern(const Point& aCenter, Float aAngle, GradientStops* aStops, const Matrix& aMatrix = Matrix()) : mCenter(aCenter), mAngle(aAngle), mStops(aStops), mMatrix(aMatrix) {} PatternType GetType() const override { return PatternType::CONIC_GRADIENT; } Point mCenter; //!< Center of the gradient Float mAngle; //!< Start angle of gradient RefPtr<GradientStops> mStops; /**< GradientStops object for this gradient, this should match the backend type of the draw target this pattern will be used with. */ Matrix mMatrix; //!< A matrix that transforms the pattern into user space }; /** * This class is used for Surface Patterns, they wrap a surface and a * repetition mode for the surface. This may be used on the stack. Loading
gfx/2d/DrawCommands.h +0 −5 Original line number Diff line number Diff line Loading @@ -68,10 +68,6 @@ class StoredPattern { new (mRadial) RadialGradientPattern( *static_cast<const RadialGradientPattern*>(&aPattern)); return; case PatternType::CONIC_GRADIENT: new (mConic) ConicGradientPattern( *static_cast<const ConicGradientPattern*>(&aPattern)); return; } } Loading Loading @@ -102,7 +98,6 @@ class StoredPattern { char mColor[sizeof(ColorPattern)]; char mLinear[sizeof(LinearGradientPattern)]; char mRadial[sizeof(RadialGradientPattern)]; char mConic[sizeof(ConicGradientPattern)]; char mSurface[sizeof(SurfacePattern)]; }; }; Loading
gfx/2d/DrawTargetCairo.cpp +0 −14 Original line number Diff line number Diff line Loading @@ -184,11 +184,6 @@ static bool PatternIsCompatible(const Pattern& aPattern) { static_cast<const RadialGradientPattern&>(aPattern); return pattern.mStops->GetBackendType() == BackendType::CAIRO; } case PatternType::CONIC_GRADIENT: { const ConicGradientPattern& pattern = static_cast<const ConicGradientPattern&>(aPattern); return pattern.mStops->GetBackendType() == BackendType::CAIRO; } default: return true; } Loading Loading @@ -526,15 +521,6 @@ static cairo_pattern_t* GfxPatternToCairoPattern(const Pattern& aPattern, break; } case PatternType::CONIC_GRADIENT: { const ConicGradientPattern& pattern = static_cast<const ConicGradientPattern&>(aPattern); // XXX(ntim): bug 1617039 - implement conic-gradient for Cairo pat = cairo_pattern_create_rgba(0.0, 0.0, 0.0, 0.0); break; } default: { // We should support all pattern types! MOZ_ASSERT(false); Loading
gfx/2d/DrawTargetRecording.cpp +0 −7 Original line number Diff line number Diff line Loading @@ -633,13 +633,6 @@ void DrawTargetRecording::EnsurePatternDependenciesStored( static_cast<const RadialGradientPattern*>(&aPattern)->mStops)); return; } case PatternType::CONIC_GRADIENT: { MOZ_ASSERT_IF( static_cast<const ConicGradientPattern*>(&aPattern)->mStops, mRecorder->HasStoredObject( static_cast<const ConicGradientPattern*>(&aPattern)->mStops)); return; } case PatternType::SURFACE: { const SurfacePattern* pat = static_cast<const SurfacePattern*>(&aPattern); EnsureSurfaceStoredRecording(mRecorder, pat->mSurface, Loading
gfx/2d/DrawTargetSkia.cpp +0 −36 Original line number Diff line number Diff line Loading @@ -494,42 +494,6 @@ static void SetPaintPattern(SkPaint& aPaint, const Pattern& aPattern, } break; } case PatternType::CONIC_GRADIENT: { const ConicGradientPattern& pat = static_cast<const ConicGradientPattern&>(aPattern); GradientStopsSkia* stops = static_cast<GradientStopsSkia*>(pat.mStops.get()); if (!stops || stops->mCount < 2 || !pat.mCenter.IsFinite() || !IsFinite(pat.mAngle)) { aPaint.setColor(SK_ColorTRANSPARENT); } else { SkMatrix mat; GfxMatrixToSkiaMatrix(pat.mMatrix, mat); if (aMatrix) { mat.postConcat(*aMatrix); } SkScalar cx = SkFloatToScalar(pat.mCenter.x); SkScalar cy = SkFloatToScalar(pat.mCenter.y); // Skia's sweep gradient angles are relative to the x-axis, not the // y-axis. Float angle = (pat.mAngle * 180.0 / M_PI) - 90.0; if (angle != 0.0) { mat.preRotate(angle, cx, cy); } sk_sp<SkShader> shader = SkGradientShader::MakeSweep( cx, cy, &stops->mColors.front(), &stops->mPositions.front(), stops->mCount, 0, &mat); if (shader) { aPaint.setShader(shader); } else { aPaint.setColor(SK_ColorTRANSPARENT); } } break; } case PatternType::SURFACE: { const SurfacePattern& pat = static_cast<const SurfacePattern&>(aPattern); sk_sp<SkImage> image = Loading