aboutsummaryrefslogtreecommitdiffhomepage
path: root/tests
diff options
context:
space:
mode:
authorGravatar halcanary <halcanary@google.com>2014-10-24 12:54:53 -0700
committerGravatar Commit bot <commit-bot@chromium.org>2014-10-24 12:54:53 -0700
commitf622a6c8fd176acf9944de8df00d7f0bb56b67d3 (patch)
tree11a136e816a7dfd26804f199c5d123a28e70c896 /tests
parent87ab51862731ab0cd017e63d828fef31a193be40 (diff)
Add `SkIRect bounds()` convenience method to SkImageInfo and SkBitmap.
Diffstat (limited to 'tests')
-rw-r--r--tests/ImageNewShaderTest.cpp2
-rw-r--r--tests/WritePixelsTest.cpp2
2 files changed, 2 insertions, 2 deletions
diff --git a/tests/ImageNewShaderTest.cpp b/tests/ImageNewShaderTest.cpp
index dfc5a24c33..1bc77fba66 100644
--- a/tests/ImageNewShaderTest.cpp
+++ b/tests/ImageNewShaderTest.cpp
@@ -56,7 +56,7 @@ void runShaderTest(skiatest::Reporter* reporter, SkSurface* sourceSurface, SkSur
destinationCanvas->clear(SK_ColorTRANSPARENT);
destinationCanvas->drawPaint(paint);
- SkIRect rect = SkIRect::MakeWH(info.width(), info.height());
+ SkIRect rect = info.bounds();
SkBitmap bmOrig;
sourceSurface->getCanvas()->readPixels(rect, &bmOrig);
diff --git a/tests/WritePixelsTest.cpp b/tests/WritePixelsTest.cpp
index 567d99412e..eca5adec82 100644
--- a/tests/WritePixelsTest.cpp
+++ b/tests/WritePixelsTest.cpp
@@ -195,7 +195,7 @@ static bool check_write(skiatest::Reporter* reporter, SkCanvas* canvas, const Sk
// At some point this will be unsupported, as we won't allow accessBitmap() to magically call
// readPixels for the client.
SkBitmap secretDevBitmap;
- canvas->readPixels(SkIRect::MakeWH(canvasInfo.width(), canvasInfo.height()), &secretDevBitmap);
+ canvas->readPixels(canvasInfo.bounds(), &secretDevBitmap);
SkAutoLockPixels alp(secretDevBitmap);
canvasRowBytes = secretDevBitmap.rowBytes();