aboutsummaryrefslogtreecommitdiffhomepage
path: root/tests/BlurTest.cpp
diff options
context:
space:
mode:
authorGravatar commit-bot@chromium.org <commit-bot@chromium.org@2bbb7eff-a529-9590-31e7-b0007b416f81>2014-02-13 22:00:04 +0000
committerGravatar commit-bot@chromium.org <commit-bot@chromium.org@2bbb7eff-a529-9590-31e7-b0007b416f81>2014-02-13 22:00:04 +0000
commitfa9e5fa42a555712fb7a29d08d2ae2bdef0ed68e (patch)
tree3b697b22d1fa371f6e1a0420cc19f5c093aa9fa0 /tests/BlurTest.cpp
parenta7692a9ac6cb8a0bbe6bbdfc83f86014a7dc265e (diff)
replace setConfig+allocPixels with alloc-or-install-pixels
BUG=skia: R=scroggo@google.com, halcanary@google.com, reed@google.com Author: reed@chromium.org Review URL: https://codereview.chromium.org/164203003 git-svn-id: http://skia.googlecode.com/svn/trunk@13442 2bbb7eff-a529-9590-31e7-b0007b416f81
Diffstat (limited to 'tests/BlurTest.cpp')
-rw-r--r--tests/BlurTest.cpp15
1 files changed, 6 insertions, 9 deletions
diff --git a/tests/BlurTest.cpp b/tests/BlurTest.cpp
index 386581c74c..1e9f31479b 100644
--- a/tests/BlurTest.cpp
+++ b/tests/BlurTest.cpp
@@ -27,9 +27,8 @@ static const int outset = 100;
static const SkColor bgColor = SK_ColorWHITE;
static const int strokeWidth = 4;
-static void create(SkBitmap* bm, SkIRect bound, SkBitmap::Config config) {
- bm->setConfig(config, bound.width(), bound.height());
- bm->allocPixels();
+static void create(SkBitmap* bm, const SkIRect& bound) {
+ bm->allocN32Pixels(bound.width(), bound.height());
}
static void drawBG(SkCanvas* canvas) {
@@ -126,7 +125,7 @@ static void test_blur_drawing(skiatest::Reporter* reporter) {
refBound.roundOut(&iref);
iref.inset(-outset, -outset);
SkBitmap refBitmap;
- create(&refBitmap, iref, SkBitmap::kARGB_8888_Config);
+ create(&refBitmap, iref);
SkCanvas refCanvas(refBitmap);
refCanvas.translate(SkIntToScalar(-iref.fLeft),
@@ -137,7 +136,7 @@ static void test_blur_drawing(skiatest::Reporter* reporter) {
for (int view = 0; view < tests[test].viewLen; ++view) {
SkIRect itest = tests[test].views[view];
SkBitmap testBitmap;
- create(&testBitmap, itest, SkBitmap::kARGB_8888_Config);
+ create(&testBitmap, itest);
SkCanvas testCanvas(testBitmap);
testCanvas.translate(SkIntToScalar(-itest.fLeft),
@@ -244,8 +243,7 @@ static void blur_path(SkCanvas* canvas, const SkPath& path,
// Readback the blurred draw results from the canvas
static void readback(SkCanvas* canvas, int* result, int resultCount) {
SkBitmap readback;
- readback.setConfig(SkBitmap::kARGB_8888_Config, resultCount, 30);
- readback.allocPixels();
+ readback.allocN32Pixels(resultCount, 30);
SkIRect readBackRect = { 0, 0, resultCount, 30 };
@@ -265,8 +263,7 @@ static void cpu_blur_path(const SkPath& path, SkScalar gaussianSigma,
int* result, int resultCount) {
SkBitmap bitmap;
- bitmap.setConfig(SkBitmap::kARGB_8888_Config, resultCount, 30);
- bitmap.allocPixels();
+ bitmap.allocN32Pixels(resultCount, 30);
SkCanvas canvas(bitmap);
blur_path(&canvas, path, gaussianSigma);