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

Unified Diff: samplecode/SampleBitmapRect.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/SampleApp.cpp ('k') | samplecode/SampleBlur.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: samplecode/SampleBitmapRect.cpp
diff --git a/samplecode/SampleBitmapRect.cpp b/samplecode/SampleBitmapRect.cpp
index 422ed583efb4b7ed79ce71ff110c740fd04a13fc..cf1196c62d7fe9a96328baa0bb2b27804ebc1ae1 100644
--- a/samplecode/SampleBitmapRect.cpp
+++ b/samplecode/SampleBitmapRect.cpp
@@ -34,8 +34,7 @@ class GrContext;
#define SCALAR_SIZE SkIntToScalar(INT_SIZE)
static void make_bitmap(SkBitmap* bitmap) {
- bitmap->setConfig(SkBitmap::kARGB_8888_Config, INT_SIZE, INT_SIZE);
- bitmap->allocPixels();
+ bitmap->allocN32Pixels(INT_SIZE, INT_SIZE);
SkCanvas canvas(*bitmap);
canvas.drawColor(SK_ColorRED);
@@ -164,8 +163,7 @@ static void make_big_bitmap(SkBitmap* bm) {
const int BIG_W = SkScalarRoundToInt(paint.measureText(gText, strlen(gText)));
- bm->setConfig(SkBitmap::kARGB_8888_Config, BIG_W, BIG_H);
- bm->allocPixels();
+ bm->allocN32Pixels(BIG_W, BIG_H);
bm->eraseColor(SK_ColorWHITE);
SkCanvas canvas(*bm);
« no previous file with comments | « samplecode/SampleApp.cpp ('k') | samplecode/SampleBlur.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698