use SkColorType instead of SkBitmap::Config in samplecode
BUG=skia:
R=reed@google.com
Author: reed@chromium.org
Review URL: https://codereview.chromium.org/169063002
git-svn-id: http://skia.googlecode.com/svn/trunk@13473 2bbb7eff-a529-9590-31e7-b0007b416f81
diff --git a/samplecode/SampleHairline.cpp b/samplecode/SampleHairline.cpp
index f08146e..4ac8b62 100644
--- a/samplecode/SampleHairline.cpp
+++ b/samplecode/SampleHairline.cpp
@@ -33,8 +33,7 @@
static void test_chromium_9005() {
SkBitmap bm;
- bm.setConfig(SkBitmap::kARGB_8888_Config, 800, 600);
- bm.allocPixels();
+ bm.allocN32Pixels(800, 600);
SkCanvas canvas(bm);
@@ -227,16 +226,13 @@
}
SkBitmap bm, bm2;
- bm.setConfig(SkBitmap::kARGB_8888_Config,
- WIDTH + MARGIN*2,
- HEIGHT + MARGIN*2);
- bm.allocPixels();
+ bm.allocN32Pixels(WIDTH + MARGIN*2, HEIGHT + MARGIN*2);
// this will erase our margin, which we want to always stay 0
bm.eraseColor(SK_ColorTRANSPARENT);
- bm2.setConfig(SkBitmap::kARGB_8888_Config, WIDTH, HEIGHT,
- bm.rowBytes());
- bm2.setPixels(bm.getAddr32(MARGIN, MARGIN));
+ bm2.installPixels(SkImageInfo::MakeN32Premul(WIDTH, HEIGHT),
+ bm.getAddr32(MARGIN, MARGIN), bm.rowBytes(),
+ NULL, NULL);
SkCanvas c2(bm2);
SkPaint paint;