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

Unified Diff: gm/bitmappremul.cpp

Issue 169913003: replace SkBitmap::Config with SkColorType in gms (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 | « gm/bitmapfilters.cpp ('k') | gm/bitmapshader.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: gm/bitmappremul.cpp
diff --git a/gm/bitmappremul.cpp b/gm/bitmappremul.cpp
index 57d22d700a7c83b2415cca2c858ac83732b82ede..fd563eb7757367320bcce284d416e1d2e4acbcf9 100644
--- a/gm/bitmappremul.cpp
+++ b/gm/bitmappremul.cpp
@@ -22,14 +22,15 @@ static const int SLIDE_SIZE = 256;
static const int PIXEL_SIZE_8888 = SLIDE_SIZE / 256;
static const int PIXEL_SIZE_4444 = SLIDE_SIZE / 16;
-static void init_bitmap(SkBitmap::Config config, SkBitmap* bitmap) {
- bitmap->allocConfigPixels(config, SLIDE_SIZE, SLIDE_SIZE);
+static void init_bitmap(SkColorType ct, SkBitmap* bitmap) {
+ bitmap->allocPixels(SkImageInfo::Make(SLIDE_SIZE, SLIDE_SIZE, ct,
+ kPremul_SkAlphaType));
bitmap->eraseColor(SK_ColorWHITE);
}
static SkBitmap make_argb8888_gradient() {
SkBitmap bitmap;
- init_bitmap(SkBitmap::kARGB_8888_Config, &bitmap);
+ init_bitmap(kPMColor_SkColorType, &bitmap);
uint8_t rowColor = 0;
for (int y = 0; y < SLIDE_SIZE; y++) {
uint32_t* dst = bitmap.getAddr32(0, y);
@@ -46,7 +47,7 @@ static SkBitmap make_argb8888_gradient() {
static SkBitmap make_argb4444_gradient() {
SkBitmap bitmap;
- init_bitmap(SkBitmap::kARGB_4444_Config, &bitmap);
+ init_bitmap(kARGB_4444_SkColorType, &bitmap);
uint8_t rowColor = 0;
for (int y = 0; y < SLIDE_SIZE; y++) {
uint16_t* dst = bitmap.getAddr16(0, y);
@@ -63,7 +64,7 @@ static SkBitmap make_argb4444_gradient() {
static SkBitmap make_argb8888_stripes() {
SkBitmap bitmap;
- init_bitmap(SkBitmap::kARGB_8888_Config, &bitmap);
+ init_bitmap(kPMColor_SkColorType, &bitmap);
uint8_t rowColor = 0;
for (int y = 0; y < SLIDE_SIZE; y++) {
uint32_t* dst = bitmap.getAddr32(0, y);
@@ -82,7 +83,7 @@ static SkBitmap make_argb8888_stripes() {
static SkBitmap make_argb4444_stripes() {
SkBitmap bitmap;
- init_bitmap(SkBitmap::kARGB_4444_Config, &bitmap);
+ init_bitmap(kARGB_4444_SkColorType, &bitmap);
uint8_t rowColor = 0;;
for (int y = 0; y < SLIDE_SIZE; y++) {
uint16_t* dst = bitmap.getAddr16(0, y);
« no previous file with comments | « gm/bitmapfilters.cpp ('k') | gm/bitmapshader.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698