OLD | NEW |
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 329 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
340 bool drawAsciiPaths(const SkPath& one, const SkPath& two, bool drawPaths) { | 340 bool drawAsciiPaths(const SkPath& one, const SkPath& two, bool drawPaths) { |
341 if (!drawPaths) { | 341 if (!drawPaths) { |
342 return true; | 342 return true; |
343 } | 343 } |
344 const SkRect& bounds1 = one.getBounds(); | 344 const SkRect& bounds1 = one.getBounds(); |
345 const SkRect& bounds2 = two.getBounds(); | 345 const SkRect& bounds2 = two.getBounds(); |
346 SkRect larger = bounds1; | 346 SkRect larger = bounds1; |
347 larger.join(bounds2); | 347 larger.join(bounds2); |
348 SkBitmap bits; | 348 SkBitmap bits; |
349 char out[256]; | 349 char out[256]; |
350 int bitWidth = SkScalarCeil(larger.width()) + 2; | 350 int bitWidth = SkScalarCeilToInt(larger.width()) + 2; |
351 if (bitWidth * 2 + 1 >= (int) sizeof(out)) { | 351 if (bitWidth * 2 + 1 >= (int) sizeof(out)) { |
352 return false; | 352 return false; |
353 } | 353 } |
354 int bitHeight = SkScalarCeil(larger.height()) + 2; | 354 int bitHeight = SkScalarCeilToInt(larger.height()) + 2; |
355 if (bitHeight >= (int) sizeof(out)) { | 355 if (bitHeight >= (int) sizeof(out)) { |
356 return false; | 356 return false; |
357 } | 357 } |
358 bits.setConfig(SkBitmap::kARGB_8888_Config, bitWidth * 2, bitHeight); | 358 bits.setConfig(SkBitmap::kARGB_8888_Config, bitWidth * 2, bitHeight); |
359 bits.allocPixels(); | 359 bits.allocPixels(); |
360 SkCanvas canvas(bits); | 360 SkCanvas canvas(bits); |
361 canvas.drawColor(SK_ColorWHITE); | 361 canvas.drawColor(SK_ColorWHITE); |
362 SkPaint paint; | 362 SkPaint paint; |
363 canvas.save(); | 363 canvas.save(); |
364 canvas.translate(-bounds1.fLeft + 1, -bounds1.fTop + 1); | 364 canvas.translate(-bounds1.fLeft + 1, -bounds1.fTop + 1); |
(...skipping 347 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
712 } | 712 } |
713 if (tests[index].fun == stopTest) { | 713 if (tests[index].fun == stopTest) { |
714 SkDebugf("lastTest\n"); | 714 SkDebugf("lastTest\n"); |
715 } | 715 } |
716 if (index == last) { | 716 if (index == last) { |
717 break; | 717 break; |
718 } | 718 } |
719 index += reverse ? -1 : 1; | 719 index += reverse ? -1 : 1; |
720 } while (true); | 720 } while (true); |
721 } | 721 } |
OLD | NEW |