OLD | NEW |
---|---|
(Empty) | |
1 /* | |
2 * Copyright 2013 Google Inc. | |
3 * | |
4 * Use of this source code is governed by a BSD-style license that can be | |
5 * found in the LICENSE file. | |
6 */ | |
7 | |
8 #ifndef GrRectEffect_DEFINED | |
9 #define GrRectEffect_DEFINED | |
10 | |
11 #include "GrEffect.h" | |
12 | |
13 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
| |
14 | |
15 /** | |
16 * The output of this effect is a modulation of the input color and coverage | |
17 * for an arbitrarily oriented rect. The rect is specified as: | |
18 * Center of the rect | |
19 * Unit vector point down the height of the rect | |
20 * Half width + 0.5 | |
21 * 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.
| |
22 */ | |
23 class GrRectEffect : public GrEffect { | |
24 public: | |
25 static GrEffectRef* Create() { | |
26 static SkAutoTUnref<GrEffectRef> gRectEffectRef( | |
27 CreateEffectRef(AutoEffectUnref(SkNEW(GrRectEffect)))); | |
28 gRectEffectRef.get()->ref(); | |
29 return gRectEffectRef; | |
30 } | |
31 | |
32 virtual ~GrRectEffect() {} | |
33 | |
34 static const char* Name() { return "RectEdge"; } | |
35 | |
36 virtual void getConstantColorComponents(GrColor* color, uint32_t* validFlags ) const SK_OVERRIDE; | |
37 | |
38 typedef GrGLRectEffect GLEffect; | |
39 | |
40 virtual const GrBackendEffectFactory& getFactory() const SK_OVERRIDE; | |
41 | |
42 private: | |
43 GrRectEffect(); | |
44 | |
45 virtual bool onIsEqual(const GrEffect&) const SK_OVERRIDE { | |
46 return true; | |
47 } | |
48 | |
49 GR_DECLARE_EFFECT_TEST; | |
50 | |
51 typedef GrEffect INHERITED; | |
52 }; | |
53 | |
54 #endif | |
OLD | NEW |