Chromium Code Reviews| Index: src/gpu/effects/GrRectEffect.h |
| =================================================================== |
| --- src/gpu/effects/GrRectEffect.h (revision 0) |
| +++ src/gpu/effects/GrRectEffect.h (revision 0) |
| @@ -0,0 +1,54 @@ |
| +/* |
| + * Copyright 2013 Google Inc. |
| + * |
| + * Use of this source code is governed by a BSD-style license that can be |
| + * found in the LICENSE file. |
| + */ |
| + |
| +#ifndef GrRectEffect_DEFINED |
| +#define GrRectEffect_DEFINED |
| + |
| +#include "GrEffect.h" |
| + |
| +class GrGLRectEffect; |
|
bsalomon
2013/04/08 15:48:39
What do you think of putting this in the AARectRen
robertphillips
2013/04/08 19:33:20
Done - we can always move it out if line drawing n
|
| + |
| +/** |
| + * The output of this effect is a modulation of the input color and coverage |
| + * for an arbitrarily oriented rect. The rect is specified as: |
| + * Center of the rect |
| + * Unit vector point down the height of the rect |
| + * Half width + 0.5 |
| + * Half height + 0.5 |
|
bsalomon
2013/04/08 15:48:39
Maybe comment here on what varying that this effec
robertphillips
2013/04/08 19:33:20
Done.
|
| + */ |
| +class GrRectEffect : public GrEffect { |
| +public: |
| + static GrEffectRef* Create() { |
| + static SkAutoTUnref<GrEffectRef> gRectEffectRef( |
| + CreateEffectRef(AutoEffectUnref(SkNEW(GrRectEffect)))); |
| + gRectEffectRef.get()->ref(); |
| + return gRectEffectRef; |
| + } |
| + |
| + virtual ~GrRectEffect() {} |
| + |
| + static const char* Name() { return "RectEdge"; } |
| + |
| + virtual void getConstantColorComponents(GrColor* color, uint32_t* validFlags) const SK_OVERRIDE; |
| + |
| + typedef GrGLRectEffect GLEffect; |
| + |
| + virtual const GrBackendEffectFactory& getFactory() const SK_OVERRIDE; |
| + |
| +private: |
| + GrRectEffect(); |
| + |
| + virtual bool onIsEqual(const GrEffect&) const SK_OVERRIDE { |
| + return true; |
| + } |
| + |
| + GR_DECLARE_EFFECT_TEST; |
| + |
| + typedef GrEffect INHERITED; |
| +}; |
| + |
| +#endif |