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

Side by Side Diff: src/pdf/SkPDFDevice.cpp

Issue 1200323005: remove SK_SUPPORT_LEGACY_PATHOP_ENUMS (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 5 years, 6 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 | « include/pathops/SkPathOps.h ('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 2011 Google Inc. 2 * Copyright 2011 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 "SkPDFDevice.h" 8 #include "SkPDFDevice.h"
9 9
10 #include "SkAnnotation.h" 10 #include "SkAnnotation.h"
(...skipping 327 matching lines...) Expand 10 before | Expand all | Expand 10 after
338 * canvas bounds. 338 * canvas bounds.
339 * outPath may alias with invPath (since this is supported by PathOps). 339 * outPath may alias with invPath (since this is supported by PathOps).
340 */ 340 */
341 static bool calculate_inverse_path(const SkRect& bounds, const SkPath& invPath, 341 static bool calculate_inverse_path(const SkRect& bounds, const SkPath& invPath,
342 SkPath* outPath) { 342 SkPath* outPath) {
343 SkASSERT(invPath.isInverseFillType()); 343 SkASSERT(invPath.isInverseFillType());
344 344
345 SkPath clipPath; 345 SkPath clipPath;
346 clipPath.addRect(bounds); 346 clipPath.addRect(bounds);
347 347
348 return Op(clipPath, invPath, kIntersect_PathOp, outPath); 348 return Op(clipPath, invPath, kIntersect_SkPathOp, outPath);
349 } 349 }
350 350
351 #ifdef SK_PDF_USE_PATHOPS_CLIPPING 351 #ifdef SK_PDF_USE_PATHOPS_CLIPPING
352 // Sanity check the numerical values of the SkRegion ops and PathOps ops 352 // Sanity check the numerical values of the SkRegion ops and PathOps ops
353 // enums so region_op_to_pathops_op can do a straight passthrough cast. 353 // enums so region_op_to_pathops_op can do a straight passthrough cast.
354 // If these are failing, it may be necessary to make region_op_to_pathops_op 354 // If these are failing, it may be necessary to make region_op_to_pathops_op
355 // do more. 355 // do more.
356 SK_COMPILE_ASSERT(SkRegion::kDifference_Op == (int)kDifference_PathOp, 356 SK_COMPILE_ASSERT(SkRegion::kDifference_Op == (int)kDifference_SkPathOp,
357 region_pathop_mismatch); 357 region_pathop_mismatch);
358 SK_COMPILE_ASSERT(SkRegion::kIntersect_Op == (int)kIntersect_PathOp, 358 SK_COMPILE_ASSERT(SkRegion::kIntersect_Op == (int)kIntersect_SkPathOp,
359 region_pathop_mismatch); 359 region_pathop_mismatch);
360 SK_COMPILE_ASSERT(SkRegion::kUnion_Op == (int)kUnion_PathOp, 360 SK_COMPILE_ASSERT(SkRegion::kUnion_Op == (int)kUnion_SkPathOp,
361 region_pathop_mismatch); 361 region_pathop_mismatch);
362 SK_COMPILE_ASSERT(SkRegion::kXOR_Op == (int)kXOR_PathOp, 362 SK_COMPILE_ASSERT(SkRegion::kXOR_Op == (int)kXOR_SkPathOp,
363 region_pathop_mismatch); 363 region_pathop_mismatch);
364 SK_COMPILE_ASSERT(SkRegion::kReverseDifference_Op == 364 SK_COMPILE_ASSERT(SkRegion::kReverseDifference_Op ==
365 (int)kReverseDifference_PathOp, 365 (int)kReverseDifference_SkPathOp,
366 region_pathop_mismatch); 366 region_pathop_mismatch);
367 367
368 static SkPathOp region_op_to_pathops_op(SkRegion::Op op) { 368 static SkPathOp region_op_to_pathops_op(SkRegion::Op op) {
369 SkASSERT(op >= 0); 369 SkASSERT(op >= 0);
370 SkASSERT(op <= SkRegion::kReverseDifference_Op); 370 SkASSERT(op <= SkRegion::kReverseDifference_Op);
371 return (SkPathOp)op; 371 return (SkPathOp)op;
372 } 372 }
373 373
374 /* Uses Path Ops to calculate a vector SkPath clip from a clip stack. 374 /* Uses Path Ops to calculate a vector SkPath clip from a clip stack.
375 * Returns true if successful, or false if not successful. 375 * Returns true if successful, or false if not successful.
(...skipping 1819 matching lines...) Expand 10 before | Expand all | Expand 10 after
2195 return; 2195 return;
2196 } 2196 }
2197 SkAutoTUnref<SkPDFObject> image(SkPDFBitmap::Create(fCanon, subsetBitmap)); 2197 SkAutoTUnref<SkPDFObject> image(SkPDFBitmap::Create(fCanon, subsetBitmap));
2198 if (!image) { 2198 if (!image) {
2199 return; 2199 return;
2200 } 2200 }
2201 2201
2202 SkPDFUtils::DrawFormXObject(this->addXObjectResource(image.get()), 2202 SkPDFUtils::DrawFormXObject(this->addXObjectResource(image.get()),
2203 &content.entry()->fContent); 2203 &content.entry()->fContent);
2204 } 2204 }
OLDNEW
« no previous file with comments | « include/pathops/SkPathOps.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698