OLD | NEW |
1 /* | 1 /* |
2 * Copyright 2011 Google Inc. | 2 * Copyright 2011 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 "GrDefaultPathRenderer.h" | 8 #include "GrDefaultPathRenderer.h" |
9 | 9 |
10 #include "GrBatchFlushState.h" | 10 #include "GrBatchFlushState.h" |
(...skipping 271 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
282 const Geometry& args = fGeoData[i]; | 282 const Geometry& args = fGeoData[i]; |
283 | 283 |
284 int contourCount; | 284 int contourCount; |
285 maxVertices += GrPathUtils::worstCasePointCount(args.fPath, &contour
Count, | 285 maxVertices += GrPathUtils::worstCasePointCount(args.fPath, &contour
Count, |
286 args.fTolerance); | 286 args.fTolerance); |
287 | 287 |
288 isIndexed = isIndexed || contourCount > 1; | 288 isIndexed = isIndexed || contourCount > 1; |
289 } | 289 } |
290 | 290 |
291 if (maxVertices == 0 || maxVertices > ((int)SK_MaxU16 + 1)) { | 291 if (maxVertices == 0 || maxVertices > ((int)SK_MaxU16 + 1)) { |
292 SkDebugf("Cannot render path (%d)\n", maxVertices); | 292 //SkDebugf("Cannot render path (%d)\n", maxVertices); |
293 return; | 293 return; |
294 } | 294 } |
295 | 295 |
296 // determine primitiveType | 296 // determine primitiveType |
297 int maxIndices = 0; | 297 int maxIndices = 0; |
298 GrPrimitiveType primitiveType; | 298 GrPrimitiveType primitiveType; |
299 if (this->isHairline()) { | 299 if (this->isHairline()) { |
300 if (isIndexed) { | 300 if (isIndexed) { |
301 maxIndices = 2 * maxVertices; | 301 maxIndices = 2 * maxVertices; |
302 primitiveType = kLines_GrPrimitiveType; | 302 primitiveType = kLines_GrPrimitiveType; |
(...skipping 461 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
764 geometry.fColor = color; | 764 geometry.fColor = color; |
765 geometry.fPath = path; | 765 geometry.fPath = path; |
766 geometry.fTolerance = srcSpaceTol; | 766 geometry.fTolerance = srcSpaceTol; |
767 | 767 |
768 viewMatrix.mapRect(&bounds); | 768 viewMatrix.mapRect(&bounds); |
769 uint8_t coverage = GrRandomCoverage(random); | 769 uint8_t coverage = GrRandomCoverage(random); |
770 return DefaultPathBatch::Create(geometry, coverage, viewMatrix, true, bounds
); | 770 return DefaultPathBatch::Create(geometry, coverage, viewMatrix, true, bounds
); |
771 } | 771 } |
772 | 772 |
773 #endif | 773 #endif |
OLD | NEW |