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

Side by Side Diff: src/effects/SkDashPathEffect.cpp

Issue 1719993002: fix misc asserts and checks found by fuzzer (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: hide the creation of the typeface as well Created 4 years, 10 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 | « src/effects/SkAlphaThresholdFilter.cpp ('k') | 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 2006 The Android Open Source Project 2 * Copyright 2006 The Android Open Source Project
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 "SkDashPathEffect.h" 8 #include "SkDashPathEffect.h"
9 9
10 #include "SkDashPathPriv.h" 10 #include "SkDashPathPriv.h"
(...skipping 366 matching lines...) Expand 10 before | Expand all | Expand 10 after
377 str->appendf("count: %d phase %.2f intervals: (", fCount, fPhase); 377 str->appendf("count: %d phase %.2f intervals: (", fCount, fPhase);
378 for (int i = 0; i < fCount; ++i) { 378 for (int i = 0; i < fCount; ++i) {
379 str->appendf("%.2f", fIntervals[i]); 379 str->appendf("%.2f", fIntervals[i]);
380 if (i < fCount-1) { 380 if (i < fCount-1) {
381 str->appendf(", "); 381 str->appendf(", ");
382 } 382 }
383 } 383 }
384 str->appendf("))"); 384 str->appendf("))");
385 } 385 }
386 #endif 386 #endif
387
388 //////////////////////////////////////////////////////////////////////////////// //////////////////
389
390 SkPathEffect* SkDashPathEffect::Create(const SkScalar intervals[], int count, Sk Scalar phase) {
391 if ((count < 2) || !SkIsAlign2(count)) {
392 return nullptr;
393 }
394 for (int i = 0; i < count; i++) {
395 if (intervals[i] < 0) {
396 return nullptr;
397 }
398 }
399 return new SkDashPathEffect(intervals, count, phase);
400 }
OLDNEW
« no previous file with comments | « src/effects/SkAlphaThresholdFilter.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698