From cc9856cdd51fa9530496d8080cf84997838314a9 Mon Sep 17 00:00:00 2001 From: Mike Klein Date: Thu, 19 Apr 2018 09:18:33 -0400 Subject: clean up setReserve() rule-bending These routines call setReserve(N), write M Reviewed-by: Brian Osman Commit-Queue: Mike Klein Commit-Queue: Brian Osman Auto-Submit: Mike Klein --- src/gpu/ops/GrAAConvexTessellator.cpp | 4 ++-- src/utils/SkShadowTessellator.cpp | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) (limited to 'src') diff --git a/src/gpu/ops/GrAAConvexTessellator.cpp b/src/gpu/ops/GrAAConvexTessellator.cpp index f72142eda8..05fe2eaf7e 100644 --- a/src/gpu/ops/GrAAConvexTessellator.cpp +++ b/src/gpu/ops/GrAAConvexTessellator.cpp @@ -934,7 +934,7 @@ void GrAAConvexTessellator::lineTo(const SkMatrix& m, SkPoint p, CurveState curv void GrAAConvexTessellator::quadTo(const SkPoint pts[3]) { int maxCount = GrPathUtils::quadraticPointCount(pts, kQuadTolerance); - fPointBuffer.setReserve(maxCount); + fPointBuffer.setCount(maxCount); SkPoint* target = fPointBuffer.begin(); int count = GrPathUtils::generateQuadraticPoints(pts[0], pts[1], pts[2], kQuadTolerance, &target, maxCount); @@ -953,7 +953,7 @@ void GrAAConvexTessellator::quadTo(const SkMatrix& m, SkPoint pts[3]) { void GrAAConvexTessellator::cubicTo(const SkMatrix& m, SkPoint pts[4]) { m.mapPoints(pts, 4); int maxCount = GrPathUtils::cubicPointCount(pts, kCubicTolerance); - fPointBuffer.setReserve(maxCount); + fPointBuffer.setCount(maxCount); SkPoint* target = fPointBuffer.begin(); int count = GrPathUtils::generateCubicPoints(pts[0], pts[1], pts[2], pts[3], kCubicTolerance, &target, maxCount); diff --git a/src/utils/SkShadowTessellator.cpp b/src/utils/SkShadowTessellator.cpp index 5d6a4cc15d..98c47a6f2d 100755 --- a/src/utils/SkShadowTessellator.cpp +++ b/src/utils/SkShadowTessellator.cpp @@ -188,7 +188,7 @@ void SkBaseShadowTessellator::handleQuad(const SkPoint pts[3]) { } // TODO: Pull PathUtils out of Ganesh? int maxCount = GrPathUtils::quadraticPointCount(pts, kQuadTolerance); - fPointBuffer.setReserve(maxCount); + fPointBuffer.setCount(maxCount); SkPoint* target = fPointBuffer.begin(); int count = GrPathUtils::generateQuadraticPoints(pts[0], pts[1], pts[2], kQuadTolerance, &target, maxCount); @@ -213,7 +213,7 @@ void SkBaseShadowTessellator::handleCubic(const SkMatrix& m, SkPoint pts[4]) { #if SK_SUPPORT_GPU // TODO: Pull PathUtils out of Ganesh? int maxCount = GrPathUtils::cubicPointCount(pts, kCubicTolerance); - fPointBuffer.setReserve(maxCount); + fPointBuffer.setCount(maxCount); SkPoint* target = fPointBuffer.begin(); int count = GrPathUtils::generateCubicPoints(pts[0], pts[1], pts[2], pts[3], kCubicTolerance, &target, maxCount); -- cgit v1.2.3