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 GrPathRendering_DEFINED | 8 #ifndef GrPathRendering_DEFINED |
9 #define GrPathRendering_DEFINED | 9 #define GrPathRendering_DEFINED |
10 | 10 |
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
52 return 2; | 52 return 2; |
53 case kAffine_PathTransformType: | 53 case kAffine_PathTransformType: |
54 return 6; | 54 return 6; |
55 | 55 |
56 default: | 56 default: |
57 SkFAIL("Unknown path transform type"); | 57 SkFAIL("Unknown path transform type"); |
58 return 0; | 58 return 0; |
59 } | 59 } |
60 } | 60 } |
61 | 61 |
| 62 /** |
| 63 * Creates a new gpu path, based on the specified path and stroke and return
s it. |
| 64 * The caller owns a ref on the returned path which must be balanced by a ca
ll to unref. |
| 65 * |
| 66 * @param skPath the path geometry. |
| 67 * @param stroke the path stroke. |
| 68 * @return a new path. |
| 69 */ |
62 virtual GrPath* createPath(const SkPath&, const SkStrokeRec&) = 0; | 70 virtual GrPath* createPath(const SkPath&, const SkStrokeRec&) = 0; |
| 71 |
| 72 /** |
| 73 * Creates a range of gpu paths with a common stroke. The caller owns a ref
on the |
| 74 * returned path range which must be balanced by a call to unref. |
| 75 * |
| 76 * @param PathGenerator class that generates SkPath objects for each path in
the range. |
| 77 * @param SkStrokeRec the common stroke applied to each path in the range. |
| 78 * @return a new path range. |
| 79 */ |
63 virtual GrPathRange* createPathRange(size_t size, const SkStrokeRec&) = 0; | 80 virtual GrPathRange* createPathRange(size_t size, const SkStrokeRec&) = 0; |
| 81 |
64 virtual void stencilPath(const GrPath*, SkPath::FillType) = 0; | 82 virtual void stencilPath(const GrPath*, SkPath::FillType) = 0; |
65 virtual void drawPath(const GrPath*, SkPath::FillType) = 0; | 83 virtual void drawPath(const GrPath*, SkPath::FillType) = 0; |
66 virtual void drawPaths(const GrPathRange*, const uint32_t indices[], int cou
nt, | 84 virtual void drawPaths(const GrPathRange*, const uint32_t indices[], int cou
nt, |
67 const float transforms[], PathTransformType, SkPath::
FillType) = 0; | 85 const float transforms[], PathTransformType, SkPath::
FillType) = 0; |
68 protected: | 86 protected: |
69 GrPathRendering() { } | 87 GrPathRendering() { } |
70 | 88 |
71 private: | 89 private: |
72 GrPathRendering& operator=(const GrPathRendering&); | 90 GrPathRendering& operator=(const GrPathRendering&); |
73 }; | 91 }; |
74 | 92 |
75 #endif | 93 #endif |
OLD | NEW |