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

Unified Diff: src/effects/gradients/SkTwoPointConicalGradient_gpu.h

Issue 224083002: Add base effect for gpu 2pt conical gradients (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Patch merging Created 6 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
Index: src/effects/gradients/SkTwoPointConicalGradient_gpu.h
diff --git a/src/effects/gradients/SkTwoPointConicalGradient_gpu.h b/src/effects/gradients/SkTwoPointConicalGradient_gpu.h
index 8b871e5045c618d7339742f8c0ef89d0fe468a2b..7f8db672bf80c392f413e435ed4ecd3d4abb5d41 100644
--- a/src/effects/gradients/SkTwoPointConicalGradient_gpu.h
+++ b/src/effects/gradients/SkTwoPointConicalGradient_gpu.h
@@ -8,66 +8,19 @@
#ifndef SkTwoPointConicalGradient_gpu_DEFINED
#define SkTwoPointConicalGradient_gpu_DEFINED
-#if SK_SUPPORT_GPU
-
#include "SkGradientShaderPriv.h"
class GrEffectRef;
class SkTwoPointConicalGradient;
-class GrGL2PtConicalGradientEffect;
-
-class Gr2PtConicalGradientEffect : public GrGradientEffect {
-public:
-
- static GrEffectRef* Create(GrContext* ctx,
- const SkTwoPointConicalGradient& shader,
- const SkMatrix& matrix,
- SkShader::TileMode tm) {
- AutoEffectUnref effect(SkNEW_ARGS(Gr2PtConicalGradientEffect, (ctx, shader, matrix, tm)));
- return CreateEffectRef(effect);
- }
-
- virtual ~Gr2PtConicalGradientEffect() { }
-
- static const char* Name() { return "Two-Point Conical Gradient"; }
- virtual const GrBackendEffectFactory& getFactory() const SK_OVERRIDE;
-
- // The radial gradient parameters can collapse to a linear (instead of quadratic) equation.
- bool isDegenerate() const { return SkScalarAbs(fDiffRadius) == SkScalarAbs(fCenterX1); }
- SkScalar center() const { return fCenterX1; }
- SkScalar diffRadius() const { return fDiffRadius; }
- SkScalar radius() const { return fRadius0; }
-
- typedef GrGL2PtConicalGradientEffect GLEffect;
-
-private:
- virtual bool onIsEqual(const GrEffect& sBase) const SK_OVERRIDE {
- const Gr2PtConicalGradientEffect& s = CastEffect<Gr2PtConicalGradientEffect>(sBase);
- return (INHERITED::onIsEqual(sBase) &&
- this->fCenterX1 == s.fCenterX1 &&
- this->fRadius0 == s.fRadius0 &&
- this->fDiffRadius == s.fDiffRadius);
- }
- Gr2PtConicalGradientEffect(GrContext* ctx,
- const SkTwoPointConicalGradient& shader,
- const SkMatrix& matrix,
- SkShader::TileMode tm);
-
- GR_DECLARE_EFFECT_TEST;
-
- // @{
- // Cache of values - these can change arbitrarily, EXCEPT
- // we shouldn't change between degenerate and non-degenerate?!
-
- GrCoordTransform fBTransform;
- SkScalar fCenterX1;
- SkScalar fRadius0;
- SkScalar fDiffRadius;
-
- // @}
-
- typedef GrGradientEffect INHERITED;
+namespace Gr2PtConicalGradientEffect {
+ /**
+ * Creates an effect that produces a two point conical gradient based on the
+ * shader passed in.
+ */
+ GrEffectRef* Create(GrContext* ctx, const SkTwoPointConicalGradient& shader,
+ SkShader::TileMode tm);
};
+
#endif
-#endif
+
« no previous file with comments | « src/effects/gradients/SkTwoPointConicalGradient.cpp ('k') | src/effects/gradients/SkTwoPointConicalGradient_gpu.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698