aboutsummaryrefslogtreecommitdiffhomepage
path: root/tests/CanvasStateTest.cpp
diff options
context:
space:
mode:
authorGravatar djsollen@google.com <djsollen@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81>2013-09-04 18:20:30 +0000
committerGravatar djsollen@google.com <djsollen@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81>2013-09-04 18:20:30 +0000
commit1037c7b9f2f0220c4f0a90faebe3c89d4981c1e3 (patch)
tree29e0dd9c0bd60b2fec330bc7a46c72fa321bcf89 /tests/CanvasStateTest.cpp
parent19bcf6e8078acc7949353c6cba2bb9e5aa3564ec (diff)
fix build breakage for missing SkScalarToInt
Review URL: https://codereview.chromium.org/23718005 git-svn-id: http://skia.googlecode.com/svn/trunk@11085 2bbb7eff-a529-9590-31e7-b0007b416f81
Diffstat (limited to 'tests/CanvasStateTest.cpp')
-rw-r--r--tests/CanvasStateTest.cpp16
1 files changed, 8 insertions, 8 deletions
diff --git a/tests/CanvasStateTest.cpp b/tests/CanvasStateTest.cpp
index 604c4948db..91d369e3f5 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));
}
}