OLD | NEW |
1 /* | 1 /* |
2 * Copyright 2015 Google Inc. | 2 * Copyright 2015 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 GrDrawPathBatch_DEFINED | 8 #ifndef GrDrawPathBatch_DEFINED |
9 #define GrDrawPathBatch_DEFINED | 9 #define GrDrawPathBatch_DEFINED |
10 | 10 |
(...skipping 97 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
108 int count() const { return fIndices.count(); } | 108 int count() const { return fIndices.count(); } |
109 | 109 |
110 TransformType transformType() const { return fTransformType; } | 110 TransformType transformType() const { return fTransformType; } |
111 | 111 |
112 const float* transforms() const { return fTransforms.begin(); } | 112 const float* transforms() const { return fTransforms.begin(); } |
113 | 113 |
114 const uint16_t* indices() const { return fIndices.begin(); } | 114 const uint16_t* indices() const { return fIndices.begin(); } |
115 | 115 |
116 const GrPathRange* range() const { return fPathRange.get(); } | 116 const GrPathRange* range() const { return fPathRange.get(); } |
117 | 117 |
| 118 void loadGlyphPathsIfNeeded() { |
| 119 fPathRange.get()->loadPathsIfNeeded<uint16_t>(fIndices.begin(), fIndices
.count()); |
| 120 } |
| 121 |
118 static bool CanMerge(const GrPathRangeDraw& a, const GrPathRangeDraw& b) { | 122 static bool CanMerge(const GrPathRangeDraw& a, const GrPathRangeDraw& b) { |
119 return a.transformType() == b.transformType() && a.range() == b.range(); | 123 return a.transformType() == b.transformType() && a.range() == b.range(); |
120 } | 124 } |
121 | 125 |
122 private: | 126 private: |
123 GrPathRangeDraw(GrPathRange* range, TransformType transformType, int reserve
Cnt) | 127 GrPathRangeDraw(GrPathRange* range, TransformType transformType, int reserve
Cnt) |
124 : fPathRange(range) | 128 : fPathRange(range) |
125 , fTransformType(transformType) | 129 , fTransformType(transformType) |
126 , fIndices(reserveCnt) | 130 , fIndices(reserveCnt) |
127 , fTransforms(reserveCnt * GrPathRendering::PathTransformSize(transformT
ype)) { | 131 , fTransforms(reserveCnt * GrPathRendering::PathTransformSize(transformT
ype)) { |
(...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
177 | 181 |
178 typedef SkTLList<GrPathRangeDraw*> DrawList; | 182 typedef SkTLList<GrPathRangeDraw*> DrawList; |
179 DrawList fDraws; | 183 DrawList fDraws; |
180 int fTotalPathCount; | 184 int fTotalPathCount; |
181 SkMatrix fLocalMatrix; | 185 SkMatrix fLocalMatrix; |
182 | 186 |
183 typedef GrDrawPathBatchBase INHERITED; | 187 typedef GrDrawPathBatchBase INHERITED; |
184 }; | 188 }; |
185 | 189 |
186 #endif | 190 #endif |
OLD | NEW |