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

Unified Diff: gm/downsamplebitmap.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/displacement.cpp ('k') | gm/drawbitmaprect.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: gm/downsamplebitmap.cpp
diff --git a/gm/downsamplebitmap.cpp b/gm/downsamplebitmap.cpp
index 034538c15c08bbe8864f5820a66b3be34d9a7e38..4b97804b01f74e70c627f5ecc80319d37a2eb943 100644
--- a/gm/downsamplebitmap.cpp
+++ b/gm/downsamplebitmap.cpp
@@ -99,8 +99,7 @@ class DownsampleBitmapTextGM: public DownsampleBitmapGM {
float fTextSize;
virtual void make_bitmap() SK_OVERRIDE {
- fBM.setConfig(SkBitmap::kARGB_8888_Config, int(fTextSize * 8), int(fTextSize * 6));
- fBM.allocPixels();
+ fBM.allocN32Pixels(int(fTextSize * 8), int(fTextSize * 6));
SkCanvas canvas(fBM);
canvas.drawColor(SK_ColorWHITE);
@@ -135,9 +134,7 @@ class DownsampleBitmapCheckerboardGM: public DownsampleBitmapGM {
int fNumChecks;
virtual void make_bitmap() SK_OVERRIDE {
- fBM.setConfig(SkBitmap::kARGB_8888_Config, fSize, fSize);
- fBM.allocPixels();
- SkAutoLockPixels lock(fBM);
+ fBM.allocN32Pixels(fSize, fSize);
for (int y = 0; y < fSize; ++y) {
for (int x = 0; x < fSize; ++x) {
SkPMColor* s = fBM.getAddr32(x, y);
@@ -183,8 +180,7 @@ class DownsampleBitmapImageGM: public DownsampleBitmapGM {
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();
« no previous file with comments | « gm/displacement.cpp ('k') | gm/drawbitmaprect.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698