diff options
author | reed@google.com <reed@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81> | 2014-01-25 16:46:20 +0000 |
---|---|---|
committer | reed@google.com <reed@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81> | 2014-01-25 16:46:20 +0000 |
commit | eb9a46cbbb475e862a084aa2224ec18d4ac5e95b (patch) | |
tree | 3e0f1b499eb5567989e23ec5b43977d43f6e3200 /gm/drawbitmaprect.cpp | |
parent | d2ac07b64b7d46e81d00d389781f9f83810f0095 (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/drawbitmaprect.cpp')
-rw-r--r-- | gm/drawbitmaprect.cpp | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/gm/drawbitmaprect.cpp b/gm/drawbitmaprect.cpp index c88006312a..31cba51e79 100644 --- a/gm/drawbitmaprect.cpp +++ b/gm/drawbitmaprect.cpp @@ -16,8 +16,7 @@ namespace skiagm { static SkBitmap make_chessbm(int w, int h) { SkBitmap bm; - bm.setConfig(SkBitmap::kARGB_8888_Config , w, h); - bm.allocPixels(); + bm.allocN32Pixels(w, h); for (int y = 0; y < bm.height(); y++) { uint32_t* p = bm.getAddr32(0, y); @@ -30,8 +29,7 @@ static SkBitmap make_chessbm(int w, int h) { } static void makebm(SkBitmap* bm, SkBitmap::Config config, int w, int h) { - bm->setConfig(config, w, h); - bm->allocPixels(); + bm->allocConfigPixels(config, w, h); bm->eraseColor(SK_ColorTRANSPARENT); SkCanvas canvas(*bm); |