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

Unified Diff: tests/CanvasStateTest.cpp

Issue 23718005: fix build breakage for missing SkScalarToInt (Closed) Base URL: https://skia.googlecode.com/svn/trunk
Patch Set: Created 7 years, 3 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tests/CanvasStateTest.cpp
diff --git a/tests/CanvasStateTest.cpp b/tests/CanvasStateTest.cpp
index 604c4948db85072f2dec0d84a798206415dc0354..91d369e3f5ddf71451e18b419faf87cf8474bf75 100644
--- a/tests/CanvasStateTest.cpp
+++ b/tests/CanvasStateTest.cpp
@@ -94,17 +94,16 @@ static void test_complex_clips(skiatest::Reporter* reporter) {
const int WIDTH = 400;
const int HEIGHT = 400;
- const SkScalar SPACER = SkIntToScalar(10);
+ const int SPACER = 10;
- SkRect layerRect = SkRect::MakeWH(SkIntToScalar(WIDTH), SkIntToScalar(HEIGHT / 4));
+ SkIRect layerRect = SkIRect::MakeWH(WIDTH, HEIGHT / 4);
layerRect.inset(2*SPACER, 2*SPACER);
- SkRect clipRect = layerRect;
+ SkIRect clipRect = layerRect;
clipRect.fRight = clipRect.fLeft + (clipRect.width() / 2) - (2*SPACER);
clipRect.outset(SPACER, SPACER);
- SkIRect regionBounds;
- clipRect.roundIn(&regionBounds);
+ SkIRect regionBounds = clipRect;
regionBounds.offset(clipRect.width() + (2*SPACER), 0);
SkIRect regionInterior = regionBounds;
@@ -138,7 +137,8 @@ static void test_complex_clips(skiatest::Reporter* reporter) {
SkRegion localRegion = clipRegion;
for (int j = 0; j < layerCombinations; ++j) {
- canvas.saveLayerAlpha(&layerRect, 128, flags[j]);
+ SkRect layerBounds = SkRect::Make(layerRect);
+ canvas.saveLayerAlpha(&layerBounds, 128, flags[j]);
SkCanvasState* state = NULL;
SkCanvas* tmpCanvas = NULL;
@@ -152,7 +152,7 @@ static void test_complex_clips(skiatest::Reporter* reporter) {
}
tmpCanvas->save();
- tmpCanvas->clipRect(clipRect, clipOps[j]);
+ tmpCanvas->clipRect(SkRect::Make(clipRect), clipOps[j]);
tmpCanvas->drawColor(SK_ColorBLUE);
tmpCanvas->restore();
@@ -165,7 +165,7 @@ static void test_complex_clips(skiatest::Reporter* reporter) {
canvas.restore();
// translate the canvas and region for the next iteration
- canvas.translate(0, 2*(layerRect.height() + SPACER));
+ canvas.translate(0, SkIntToScalar(2*(layerRect.height() + (SPACER))));
localRegion.translate(0, 2*(layerRect.height() + SPACER));
}
}
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698