| 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 |
| (...skipping 25 matching lines...) Expand all Loading... |
| 36 * Currently the edges are specified in device space. In the future we may p
refer to specify | 36 * Currently the edges are specified in device space. In the future we may p
refer to specify |
| 37 * them in src space. There are a number of ways this could be accomplished
but we'd probably | 37 * them in src space. There are a number of ways this could be accomplished
but we'd probably |
| 38 * have to modify the effect/shaderbuilder interface to make it possible (e.
g. give access | 38 * have to modify the effect/shaderbuilder interface to make it possible (e.
g. give access |
| 39 * to the view matrix or untransformed positions in the fragment shader). | 39 * to the view matrix or untransformed positions in the fragment shader). |
| 40 */ | 40 */ |
| 41 static GrFragmentProcessor* Create(GrPrimitiveEdgeType edgeType, int n, | 41 static GrFragmentProcessor* Create(GrPrimitiveEdgeType edgeType, int n, |
| 42 const SkScalar edges[]) { | 42 const SkScalar edges[]) { |
| 43 if (n <= 0 || n > kMaxEdges || kHairlineAA_GrProcessorEdgeType == edgeTy
pe) { | 43 if (n <= 0 || n > kMaxEdges || kHairlineAA_GrProcessorEdgeType == edgeTy
pe) { |
| 44 return NULL; | 44 return NULL; |
| 45 } | 45 } |
| 46 return SkNEW_ARGS(GrConvexPolyEffect, (edgeType, n, edges)); | 46 return new GrConvexPolyEffect(edgeType, n, edges); |
| 47 } | 47 } |
| 48 | 48 |
| 49 /** | 49 /** |
| 50 * Creates an effect that clips against the path. If the path is not a conve
x polygon, is | 50 * Creates an effect that clips against the path. If the path is not a conve
x polygon, is |
| 51 * inverse filled, or has too many edges, this will return NULL. If offset i
s non-NULL, then | 51 * inverse filled, or has too many edges, this will return NULL. If offset i
s non-NULL, then |
| 52 * the path is translated by the vector. | 52 * the path is translated by the vector. |
| 53 */ | 53 */ |
| 54 static GrFragmentProcessor* Create(GrPrimitiveEdgeType, const SkPath&, | 54 static GrFragmentProcessor* Create(GrPrimitiveEdgeType, const SkPath&, |
| 55 const SkVector* offset = NULL); | 55 const SkVector* offset = NULL); |
| 56 | 56 |
| (...skipping 27 matching lines...) Expand all Loading... |
| 84 int fEdgeCount; | 84 int fEdgeCount; |
| 85 SkScalar fEdges[3 * kMaxEdges]; | 85 SkScalar fEdges[3 * kMaxEdges]; |
| 86 | 86 |
| 87 GR_DECLARE_FRAGMENT_PROCESSOR_TEST; | 87 GR_DECLARE_FRAGMENT_PROCESSOR_TEST; |
| 88 | 88 |
| 89 typedef GrFragmentProcessor INHERITED; | 89 typedef GrFragmentProcessor INHERITED; |
| 90 }; | 90 }; |
| 91 | 91 |
| 92 | 92 |
| 93 #endif | 93 #endif |
| OLD | NEW |