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 #include "GrDrawPathBatch.h" | 8 #include "GrDrawPathBatch.h" |
9 | 9 |
10 static void pre_translate_transform_values(const float* xforms, | 10 static void pre_translate_transform_values(const float* xforms, |
(...skipping 121 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
132 const InstanceData& instances = *head.fInstanceData; | 132 const InstanceData& instances = *head.fInstanceData; |
133 state->gpu()->pathRendering()->drawPaths(args, fPathRange.get(), instanc
es.indices(), | 133 state->gpu()->pathRendering()->drawPaths(args, fPathRange.get(), instanc
es.indices(), |
134 GrPathRange::kU16_PathIndexType
, | 134 GrPathRange::kU16_PathIndexType
, |
135 instances.transformValues(), | 135 instances.transformValues(), |
136 instances.transformType(), | 136 instances.transformType(), |
137 instances.count()); | 137 instances.count()); |
138 } else { | 138 } else { |
139 int floatsPerTransform = GrPathRendering::PathTransformSize(this->transf
ormType()); | 139 int floatsPerTransform = GrPathRendering::PathTransformSize(this->transf
ormType()); |
140 #if defined(GOOGLE3) | 140 #if defined(GOOGLE3) |
141 //Stack frame size is limited in GOOGLE3. | 141 //Stack frame size is limited in GOOGLE3. |
142 SkAutoSTMalloc<512, float> transformStorage(transformSize * fTotalPathCo
unt); | 142 SkAutoSTMalloc<512, float> transformStorage(floatsPerTransform * fTotalP
athCount); |
143 SkAutoSTMalloc<256, uint16_t> indexStorage(fTotalPathCount); | 143 SkAutoSTMalloc<256, uint16_t> indexStorage(fTotalPathCount); |
144 #else | 144 #else |
145 SkAutoSTMalloc<4096, float> transformStorage(floatsPerTransform * fTotal
PathCount); | 145 SkAutoSTMalloc<4096, float> transformStorage(floatsPerTransform * fTotal
PathCount); |
146 SkAutoSTMalloc<2048, uint16_t> indexStorage(fTotalPathCount); | 146 SkAutoSTMalloc<2048, uint16_t> indexStorage(fTotalPathCount); |
147 #endif | 147 #endif |
148 int idx = 0; | 148 int idx = 0; |
149 for (DrawList::Iter iter(fDraws); iter.get(); iter.next()) { | 149 for (DrawList::Iter iter(fDraws); iter.get(); iter.next()) { |
150 const Draw& draw = *iter.get(); | 150 const Draw& draw = *iter.get(); |
151 const InstanceData& instances = *draw.fInstanceData; | 151 const InstanceData& instances = *draw.fInstanceData; |
152 memcpy(&indexStorage[idx], instances.indices(), instances.count() *
sizeof(uint16_t)); | 152 memcpy(&indexStorage[idx], instances.indices(), instances.count() *
sizeof(uint16_t)); |
(...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
204 dst[i + 3] = xforms[i + 3]; | 204 dst[i + 3] = xforms[i + 3]; |
205 dst[i + 4] = xforms[i + 4]; | 205 dst[i + 4] = xforms[i + 4]; |
206 dst[i + 5] = xforms[i + 3] * x + xforms[i + 4] * y + xforms[i +
5]; | 206 dst[i + 5] = xforms[i + 3] * x + xforms[i + 4] * y + xforms[i +
5]; |
207 } | 207 } |
208 break; | 208 break; |
209 default: | 209 default: |
210 SkFAIL("Unknown transform type."); | 210 SkFAIL("Unknown transform type."); |
211 break; | 211 break; |
212 } | 212 } |
213 } | 213 } |
OLD | NEW |