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

Side by Side Diff: tests/PathOpsExtendedTest.cpp

Issue 111353003: deprecate SkScalarRound (and its ilk), use SkScalarRound[ToInt,ToScalar]. #define SK_SUPPORT_DEPREC… (Closed) Base URL: https://skia.googlecode.com/svn/trunk
Patch Set: Created 7 years 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 | Annotate | Revision Log
« no previous file with comments | « tests/PathCoverageTest.cpp ('k') | tools/skhello.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 329 matching lines...) Expand 10 before | Expand all | Expand 10 after
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
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 }
OLDNEW
« no previous file with comments | « tests/PathCoverageTest.cpp ('k') | tools/skhello.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698