| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright 2014 Google Inc. | 2 * Copyright 2014 Google Inc. |
| 3 * | 3 * |
| 4 * Use of this source code is governed by a BSD-style license that can be | 4 * Use of this source code is governed by a BSD-style license that can be |
| 5 * found in the LICENSE file. | 5 * found in the LICENSE file. |
| 6 */ | 6 */ |
| 7 | 7 |
| 8 #ifndef GrConvexPolyEffect_DEFINED | 8 #ifndef GrConvexPolyEffect_DEFINED |
| 9 #define GrConvexPolyEffect_DEFINED | 9 #define GrConvexPolyEffect_DEFINED |
| 10 | 10 |
| 11 #include "GrDrawTargetCaps.h" | 11 #include "GrDrawTargetCaps.h" |
| 12 #include "GrProcessor.h" | 12 #include "GrProcessor.h" |
| 13 #include "GrTypesPriv.h" | 13 #include "GrTypesPriv.h" |
| 14 | 14 |
| 15 class GrGLConvexPolyEffect; | 15 class GrGLConvexPolyEffect; |
| 16 class GrInvariantOutput; |
| 16 class SkPath; | 17 class SkPath; |
| 17 | 18 |
| 18 /** | 19 /** |
| 19 * An effect that renders a convex polygon. It is intended to be used as a cover
age effect. | 20 * An effect that renders a convex polygon. It is intended to be used as a cover
age effect. |
| 20 * Bounding geometry is rendered and the effect computes coverage based on the f
ragment's | 21 * Bounding geometry is rendered and the effect computes coverage based on the f
ragment's |
| 21 * position relative to the polygon. | 22 * position relative to the polygon. |
| 22 */ | 23 */ |
| 23 class GrConvexPolyEffect : public GrFragmentProcessor { | 24 class GrConvexPolyEffect : public GrFragmentProcessor { |
| 24 public: | 25 public: |
| 25 enum { | 26 enum { |
| (...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 70 | 71 |
| 71 typedef GrGLConvexPolyEffect GLProcessor; | 72 typedef GrGLConvexPolyEffect GLProcessor; |
| 72 | 73 |
| 73 virtual const GrBackendFragmentProcessorFactory& getFactory() const SK_OVERR
IDE; | 74 virtual const GrBackendFragmentProcessorFactory& getFactory() const SK_OVERR
IDE; |
| 74 | 75 |
| 75 private: | 76 private: |
| 76 GrConvexPolyEffect(GrPrimitiveEdgeType edgeType, int n, const SkScalar edges
[]); | 77 GrConvexPolyEffect(GrPrimitiveEdgeType edgeType, int n, const SkScalar edges
[]); |
| 77 | 78 |
| 78 virtual bool onIsEqual(const GrFragmentProcessor& other) const SK_OVERRIDE; | 79 virtual bool onIsEqual(const GrFragmentProcessor& other) const SK_OVERRIDE; |
| 79 | 80 |
| 80 virtual void onComputeInvariantOutput(InvariantOutput* inout) const SK_OVERR
IDE; | 81 virtual void onComputeInvariantOutput(GrInvariantOutput* inout) const SK_OVE
RRIDE; |
| 81 | 82 |
| 82 GrPrimitiveEdgeType fEdgeType; | 83 GrPrimitiveEdgeType fEdgeType; |
| 83 int fEdgeCount; | 84 int fEdgeCount; |
| 84 SkScalar fEdges[3 * kMaxEdges]; | 85 SkScalar fEdges[3 * kMaxEdges]; |
| 85 | 86 |
| 86 GR_DECLARE_FRAGMENT_PROCESSOR_TEST; | 87 GR_DECLARE_FRAGMENT_PROCESSOR_TEST; |
| 87 | 88 |
| 88 typedef GrFragmentProcessor INHERITED; | 89 typedef GrFragmentProcessor INHERITED; |
| 89 }; | 90 }; |
| 90 | 91 |
| 91 | 92 |
| 92 #endif | 93 #endif |
| OLD | NEW |