aboutsummaryrefslogtreecommitdiffhomepage
path: root/gm/imagefiltersscaled.cpp
diff options
context:
space:
mode:
authorGravatar reed@google.com <reed@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81>2014-01-25 16:46:20 +0000
committerGravatar reed@google.com <reed@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81>2014-01-25 16:46:20 +0000
commiteb9a46cbbb475e862a084aa2224ec18d4ac5e95b (patch)
tree3e0f1b499eb5567989e23ec5b43977d43f6e3200 /gm/imagefiltersscaled.cpp
parentd2ac07b64b7d46e81d00d389781f9f83810f0095 (diff)
add legacy/helper allocN32Pixels, and convert gm to use it
This is an intermediate api, but might help us quickly get to a point where no one is creating bitmaps in a 2-step process (setConfig + alloc). BUG=skia: R=halcanary@google.com Review URL: https://codereview.chromium.org/140593005 git-svn-id: http://skia.googlecode.com/svn/trunk@13182 2bbb7eff-a529-9590-31e7-b0007b416f81
Diffstat (limited to 'gm/imagefiltersscaled.cpp')
-rw-r--r--gm/imagefiltersscaled.cpp6
1 files changed, 2 insertions, 4 deletions
diff --git a/gm/imagefiltersscaled.cpp b/gm/imagefiltersscaled.cpp
index f5275caae1..ad52d902e7 100644
--- a/gm/imagefiltersscaled.cpp
+++ b/gm/imagefiltersscaled.cpp
@@ -33,8 +33,7 @@ protected:
}
void make_checkerboard() {
- fCheckerboard.setConfig(SkBitmap::kARGB_8888_Config, 64, 64);
- fCheckerboard.allocPixels();
+ fCheckerboard.allocN32Pixels(64, 64);
SkBitmapDevice device(fCheckerboard);
SkCanvas canvas(&device);
canvas.clear(0x00000000);
@@ -59,8 +58,7 @@ protected:
SkScalar x = SkIntToScalar(width / 2);
SkScalar y = SkIntToScalar(height / 2);
SkScalar radius = SkScalarMul(SkMinScalar(x, y), SkIntToScalar(4) / SkIntToScalar(5));
- fGradientCircle.setConfig(SkBitmap::kARGB_8888_Config, width, height);
- fGradientCircle.allocPixels();
+ fGradientCircle.allocN32Pixels(width, height);
SkBitmapDevice device(fGradientCircle);
SkCanvas canvas(&device);
canvas.clear(0x00000000);