Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(105)

Unified Diff: samplecode/SampleHairline.cpp

Issue 169063002: use SkColorType instead of SkBitmap::Config in samplecode (Closed) Base URL: https://skia.googlecode.com/svn/trunk
Patch Set: Created 6 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « samplecode/SampleHairModes.cpp ('k') | samplecode/SampleLayerMask.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: samplecode/SampleHairline.cpp
diff --git a/samplecode/SampleHairline.cpp b/samplecode/SampleHairline.cpp
index f08146e672cb1e13e562bbd5ba651b0453aa5fa1..4ac8b6255a26f846cb97d19243d4b622d9d9d298 100644
--- a/samplecode/SampleHairline.cpp
+++ b/samplecode/SampleHairline.cpp
@@ -33,8 +33,7 @@ static SkRandom gRand;
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 @@ protected:
}
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;
« no previous file with comments | « samplecode/SampleHairModes.cpp ('k') | samplecode/SampleLayerMask.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698