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

Side by Side Diff: tests/PathOpsExtendedTest.cpp

Issue 943453002: Avoid wrong memory access due to double substitution and %% (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 5 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/gpu/gl/builders/GrGLShaderStringBuilder.cpp ('k') | tests/PathOpsSkpClipTest.cpp » ('j') | 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 2012 Google Inc. 2 * Copyright 2012 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 "PathOpsExtendedTest.h" 8 #include "PathOpsExtendedTest.h"
9 #include "PathOpsThreadedCommon.h" 9 #include "PathOpsThreadedCommon.h"
10 #include "SkBitmap.h" 10 #include "SkBitmap.h"
(...skipping 425 matching lines...) Expand 10 before | Expand all | Expand 10 after
436 sk_bzero(temp, sizeof(temp)); 436 sk_bzero(temp, sizeof(temp));
437 SkMemoryWStream stream(temp, sizeof(temp)); 437 SkMemoryWStream stream(temp, sizeof(temp));
438 const char* pathPrefix = NULL; 438 const char* pathPrefix = NULL;
439 const char* nameSuffix = NULL; 439 const char* nameSuffix = NULL;
440 if (fillType == SkPath::kEvenOdd_FillType) { 440 if (fillType == SkPath::kEvenOdd_FillType) {
441 pathPrefix = " path.setFillType(SkPath::kEvenOdd_FillType);\n"; 441 pathPrefix = " path.setFillType(SkPath::kEvenOdd_FillType);\n";
442 nameSuffix = "x"; 442 nameSuffix = "x";
443 } 443 }
444 const char testFunction[] = "testSimplify(reporter, path);"; 444 const char testFunction[] = "testSimplify(reporter, path);";
445 outputToStream(pathStr, pathPrefix, nameSuffix, testFunction, false, str eam); 445 outputToStream(pathStr, pathPrefix, nameSuffix, testFunction, false, str eam);
446 SkDebugf(temp); 446 SkDebugf("%s", temp);
447 REPORTER_ASSERT(state.fReporter, 0); 447 REPORTER_ASSERT(state.fReporter, 0);
448 } 448 }
449 state.fReporter->bumpTestCount(); 449 state.fReporter->bumpTestCount();
450 return result == 0; 450 return result == 0;
451 } 451 }
452 452
453 bool testSimplify(skiatest::Reporter* reporter, const SkPath& path, const char* filename) { 453 bool testSimplify(skiatest::Reporter* reporter, const SkPath& path, const char* filename) {
454 #if DEBUG_SHOW_TEST_NAME 454 #if DEBUG_SHOW_TEST_NAME
455 showPathData(path); 455 showPathData(path);
456 #endif 456 #endif
(...skipping 176 matching lines...) Expand 10 before | Expand all | Expand 10 after
633 if (tests[index].fun == stopTest) { 633 if (tests[index].fun == stopTest) {
634 SkDebugf("lastTest\n"); 634 SkDebugf("lastTest\n");
635 break; 635 break;
636 } 636 }
637 if (index == last) { 637 if (index == last) {
638 break; 638 break;
639 } 639 }
640 index += reverse ? -1 : 1; 640 index += reverse ? -1 : 1;
641 } while (true); 641 } while (true);
642 } 642 }
OLDNEW
« no previous file with comments | « src/gpu/gl/builders/GrGLShaderStringBuilder.cpp ('k') | tests/PathOpsSkpClipTest.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698