| 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 98 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 109 const uint16_t* indices() const { return fIndices.begin(); } | 109 const uint16_t* indices() const { return fIndices.begin(); } |
| 110 | 110 |
| 111 const GrPathRange* range() const { return fPathRange.get(); } | 111 const GrPathRange* range() const { return fPathRange.get(); } |
| 112 | 112 |
| 113 static bool CanMerge(const GrPathRangeDraw& a, const GrPathRangeDraw& b) { | 113 static bool CanMerge(const GrPathRangeDraw& a, const GrPathRangeDraw& b) { |
| 114 return a.transformType() == b.transformType() && a.range() == b.range(); | 114 return a.transformType() == b.transformType() && a.range() == b.range(); |
| 115 } | 115 } |
| 116 | 116 |
| 117 private: | 117 private: |
| 118 GrPathRangeDraw(GrPathRange* range, TransformType transformType, int reserve
Cnt) | 118 GrPathRangeDraw(GrPathRange* range, TransformType transformType, int reserve
Cnt) |
| 119 : fPathRange(SkRef(range)) | 119 : fPathRange(range) |
| 120 , fTransformType(transformType) | 120 , fTransformType(transformType) |
| 121 , fIndices(reserveCnt) | 121 , fIndices(reserveCnt) |
| 122 , fTransforms(reserveCnt * GrPathRendering::PathTransformSize(transformT
ype)) { | 122 , fTransforms(reserveCnt * GrPathRendering::PathTransformSize(transformT
ype)) { |
| 123 SkDEBUGCODE(fUsedInBatch = false;) | 123 SkDEBUGCODE(fUsedInBatch = false;) |
| 124 } | 124 } |
| 125 | 125 |
| 126 // Reserve space for 64 paths where indices are 16 bit and transforms are tr
anslations. | 126 // Reserve space for 64 paths where indices are 16 bit and transforms are tr
anslations. |
| 127 static const int kIndexReserveCnt = 64; | 127 static const int kIndexReserveCnt = 64; |
| 128 static const int kTransformBufferReserveCnt = 2 * 64; | 128 static const int kTransformBufferReserveCnt = 2 * 64; |
| 129 | 129 |
| (...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 168 void onDraw(GrBatchFlushState* state) override; | 168 void onDraw(GrBatchFlushState* state) override; |
| 169 | 169 |
| 170 typedef SkTLList<GrPathRangeDraw*> DrawList; | 170 typedef SkTLList<GrPathRangeDraw*> DrawList; |
| 171 DrawList fDraws; | 171 DrawList fDraws; |
| 172 int fTotalPathCount; | 172 int fTotalPathCount; |
| 173 | 173 |
| 174 typedef GrDrawPathBatchBase INHERITED; | 174 typedef GrDrawPathBatchBase INHERITED; |
| 175 }; | 175 }; |
| 176 | 176 |
| 177 #endif | 177 #endif |
| OLD | NEW |