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

Unified Diff: gm/scalebitmap.cpp

Issue 140593005: add legacy/helper allocN32Pixels, and convert gm to use it (Closed) Base URL: https://skia.googlecode.com/svn/trunk
Patch Set: Created 6 years, 11 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/samplerstress.cpp ('k') | gm/shadertext.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: gm/scalebitmap.cpp
diff --git a/gm/scalebitmap.cpp b/gm/scalebitmap.cpp
index c0150627caaedbc4ec8a8916fa1bac6c7f19d2e8..10a1d86c84be6b55a5f58465cbe5e1c17f1b493f 100644
--- a/gm/scalebitmap.cpp
+++ b/gm/scalebitmap.cpp
@@ -35,8 +35,7 @@ public:
SkImageDecoder::kDecodePixels_Mode);
SkDELETE(codec);
} else {
- fBM.setConfig(SkBitmap::kARGB_8888_Config, 1, 1);
- fBM.allocPixels();
+ fBM.allocN32Pixels(1, 1);
*(fBM.getAddr32(0,0)) = 0xFF0000FF; // red == bad
}
fSize = fBM.height();
@@ -62,8 +61,7 @@ protected:
virtual void onDraw(SkCanvas* canvas) SK_OVERRIDE {
SkBitmap dst;
- dst.setConfig(SkBitmap::kARGB_8888_Config, fBM.width() * fScale, fBM.height() * fScale);
- dst.allocPixels();
+ dst.allocN32Pixels(fBM.width() * fScale, fBM.height() * fScale);
fBM.scale(&dst);
canvas->drawBitmap(dst, 0, 0);
« no previous file with comments | « gm/samplerstress.cpp ('k') | gm/shadertext.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698