Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(471)

Side by Side Diff: src/gpu/GrDefaultPathRenderer.cpp

Issue 952993004: don't draw if maxVertices returns 0 or > than uin16_t max (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 5 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 "GrBatch.h" 10 #include "GrBatch.h"
(...skipping 272 matching lines...) Expand 10 before | Expand all | Expand 10 after
283 for (int i = 0; i < instanceCount; i++) { 283 for (int i = 0; i < instanceCount; i++) {
284 Geometry& args = fGeoData[i]; 284 Geometry& args = fGeoData[i];
285 285
286 int contourCount; 286 int contourCount;
287 maxVertices += GrPathUtils::worstCasePointCount(args.fPath, &contour Count, 287 maxVertices += GrPathUtils::worstCasePointCount(args.fPath, &contour Count,
288 args.fTolerance); 288 args.fTolerance);
289 289
290 isIndexed = isIndexed || contourCount > 1; 290 isIndexed = isIndexed || contourCount > 1;
291 } 291 }
292 292
293 if (maxVertices == 0 || maxVertices > ((int)SK_MaxU16 + 1)) {
294 SkDebugf("Cannot render path (%d)\n", maxVertices);
295 return;
296 }
297
293 // determine primitiveType 298 // determine primitiveType
294 int maxIndices = 0; 299 int maxIndices = 0;
295 GrPrimitiveType primitiveType; 300 GrPrimitiveType primitiveType;
296 if (this->isHairline()) { 301 if (this->isHairline()) {
297 if (isIndexed) { 302 if (isIndexed) {
298 maxIndices = 2 * maxVertices; 303 maxIndices = 2 * maxVertices;
299 primitiveType = kLines_GrPrimitiveType; 304 primitiveType = kLines_GrPrimitiveType;
300 } else { 305 } else {
301 primitiveType = kLineStrip_GrPrimitiveType; 306 primitiveType = kLineStrip_GrPrimitiveType;
302 } 307 }
(...skipping 423 matching lines...) Expand 10 before | Expand all | Expand 10 after
726 731
727 void GrDefaultPathRenderer::onStencilPath(GrDrawTarget* target, 732 void GrDefaultPathRenderer::onStencilPath(GrDrawTarget* target,
728 GrPipelineBuilder* pipelineBuilder, 733 GrPipelineBuilder* pipelineBuilder,
729 const SkMatrix& viewMatrix, 734 const SkMatrix& viewMatrix,
730 const SkPath& path, 735 const SkPath& path,
731 const SkStrokeRec& stroke) { 736 const SkStrokeRec& stroke) {
732 SkASSERT(SkPath::kInverseEvenOdd_FillType != path.getFillType()); 737 SkASSERT(SkPath::kInverseEvenOdd_FillType != path.getFillType());
733 SkASSERT(SkPath::kInverseWinding_FillType != path.getFillType()); 738 SkASSERT(SkPath::kInverseWinding_FillType != path.getFillType());
734 this->internalDrawPath(target, pipelineBuilder, GrColor_WHITE, viewMatrix, p ath, stroke, true); 739 this->internalDrawPath(target, pipelineBuilder, GrColor_WHITE, viewMatrix, p ath, stroke, true);
735 } 740 }
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698