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

Unified Diff: src/gpu/GrTestUtils.cpp

Issue 1277433005: Fix for Crashing IOS Stroke test (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Reset SkCommonFlags Created 5 years, 4 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/gpu/GrTestUtils.cpp
diff --git a/src/gpu/GrTestUtils.cpp b/src/gpu/GrTestUtils.cpp
index da9fc106b3b586d6c5fa8b98b8fcad9ce7de943b..ba70ef6cb9f0f02383d7ee1340e63ed2593ac5f6 100644
--- a/src/gpu/GrTestUtils.cpp
+++ b/src/gpu/GrTestUtils.cpp
@@ -244,19 +244,16 @@ GrStrokeInfo TestStrokeInfo(SkRandom* random) {
randomize_stroke_rec(&strokeInfo, random);
SkPathEffect::DashInfo dashInfo;
dashInfo.fCount = random->nextRangeU(1, 50) * 2;
- SkAutoTMalloc<SkScalar> intervals(dashInfo.fCount);
- dashInfo.fIntervals = intervals.get();
+ dashInfo.fIntervals = SkNEW_ARRAY(SkScalar, dashInfo.fCount);
SkScalar sum = 0;
for (int i = 0; i < dashInfo.fCount; i++) {
- #if defined(SK_BUILD_FOR_IOS)
- SkDebugf("&dashInfo.fIntervals[%d] = %p\n", i, &dashInfo.fIntervals[i]);
- #endif
dashInfo.fIntervals[i] = random->nextRangeScalar(SkDoubleToScalar(0.01),
SkDoubleToScalar(10.0));
sum += dashInfo.fIntervals[i];
}
dashInfo.fPhase = random->nextRangeScalar(0, sum);
strokeInfo.setDashInfo(dashInfo);
+ SkDELETE(dashInfo.fIntervals);
return strokeInfo;
}
« 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