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

Side by Side Diff: src/pathops/SkPathOpsOp.cpp

Issue 2224823004: template intersection fuzz fixes (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: fix for 633608 Created 4 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 unified diff | Download patch
« no previous file with comments | « src/pathops/SkOpCoincidence.cpp ('k') | src/pathops/SkPathOpsTSect.h » ('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 #include "SkAddIntersections.h" 7 #include "SkAddIntersections.h"
8 #include "SkOpCoincidence.h" 8 #include "SkOpCoincidence.h"
9 #include "SkOpEdgeBuilder.h" 9 #include "SkOpEdgeBuilder.h"
10 #include "SkPathOpsCommon.h" 10 #include "SkPathOpsCommon.h"
(...skipping 180 matching lines...) Expand 10 before | Expand all | Expand 10 after
191 }; 191 };
192 192
193 #define DEBUGGING_PATHOPS_FROM_HOST 0 // enable to debug svg in chrome -- note path hardcoded below 193 #define DEBUGGING_PATHOPS_FROM_HOST 0 // enable to debug svg in chrome -- note path hardcoded below
194 #if DEBUGGING_PATHOPS_FROM_HOST 194 #if DEBUGGING_PATHOPS_FROM_HOST
195 #include "SkData.h" 195 #include "SkData.h"
196 #include "SkStream.h" 196 #include "SkStream.h"
197 197
198 static void dump_path(FILE* file, const SkPath& path, bool force, bool dumpAsHex ) { 198 static void dump_path(FILE* file, const SkPath& path, bool force, bool dumpAsHex ) {
199 SkDynamicMemoryWStream wStream; 199 SkDynamicMemoryWStream wStream;
200 path.dump(&wStream, force, dumpAsHex); 200 path.dump(&wStream, force, dumpAsHex);
201 SkAutoDataUnref data(wStream.copyToData()); 201 sk_sp<SkData> data(wStream.copyToData());
202 fprintf(file, "%.*s\n", (int) data->size(), data->data()); 202 fprintf(file, "%.*s\n", (int) data->size(), data->data());
203 } 203 }
204 204
205 static int dumpID = 0; 205 static int dumpID = 0;
206 206
207 static void dump_op(const SkPath& one, const SkPath& two, SkPathOp op) { 207 static void dump_op(const SkPath& one, const SkPath& two, SkPathOp op) {
208 #if SK_BUILD_FOR_MAC 208 #if SK_BUILD_FOR_MAC
209 FILE* file = fopen("/Users/caryclark/Documents/svgop.txt", "w"); 209 FILE* file = fopen("/Users/caryclark/Documents/svgop.txt", "w");
210 #else 210 #else
211 FILE* file = fopen("/usr/local/google/home/caryclark/Documents/svgop.txt", " w"); 211 FILE* file = fopen("/usr/local/google/home/caryclark/Documents/svgop.txt", " w");
(...skipping 15 matching lines...) Expand all
227 } 227 }
228 #endif 228 #endif
229 229
230 230
231 #if DEBUG_T_SECT_LOOP_COUNT 231 #if DEBUG_T_SECT_LOOP_COUNT
232 232
233 #include "SkMutex.h" 233 #include "SkMutex.h"
234 234
235 SK_DECLARE_STATIC_MUTEX(debugWorstLoop); 235 SK_DECLARE_STATIC_MUTEX(debugWorstLoop);
236 236
237 SkOpGlobalState debugWorstState(nullptr, nullptr SkDEBUGPARAMS(nullptr)); 237 SkOpGlobalState debugWorstState(nullptr, nullptr SkDEBUGPARAMS(false) SkDEBUGPA RAMS(nullptr));
238 238
239 void ReportPathOpsDebugging() { 239 void ReportPathOpsDebugging() {
240 debugWorstState.debugLoopReport(); 240 debugWorstState.debugLoopReport();
241 } 241 }
242 242
243 extern void (*gVerboseFinalize)(); 243 extern void (*gVerboseFinalize)();
244 244
245 #endif 245 #endif
246 246
247 bool OpDebug(const SkPath& one, const SkPath& two, SkPathOp op, SkPath* result 247 bool OpDebug(const SkPath& one, const SkPath& two, SkPathOp op, SkPath* result
(...skipping 207 matching lines...) Expand 10 before | Expand all | Expand 10 after
455 one.dumpHex(); 455 one.dumpHex();
456 SkDebugf("two: fill=%d\n", two.getFillType()); 456 SkDebugf("two: fill=%d\n", two.getFillType());
457 two.dumpHex(); 457 two.dumpHex();
458 SkASSERT(0); 458 SkASSERT(0);
459 } 459 }
460 return true; 460 return true;
461 #else 461 #else
462 return OpDebug(one, two, op, result SkDEBUGPARAMS(true) SkDEBUGPARAMS(nullp tr)); 462 return OpDebug(one, two, op, result SkDEBUGPARAMS(true) SkDEBUGPARAMS(nullp tr));
463 #endif 463 #endif
464 } 464 }
OLDNEW
« no previous file with comments | « src/pathops/SkOpCoincidence.cpp ('k') | src/pathops/SkPathOpsTSect.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698