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

Unified Diff: gm/filterbitmap.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/extractbitmap.cpp ('k') | gm/giantbitmap.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: gm/filterbitmap.cpp
diff --git a/gm/filterbitmap.cpp b/gm/filterbitmap.cpp
index efe4d4aa2b5cabd5144538742e05262a84c628f8..c580591b39a8bbebd289c76e68ebbb30e1683cbb 100644
--- a/gm/filterbitmap.cpp
+++ b/gm/filterbitmap.cpp
@@ -115,8 +115,7 @@ class FilterBitmapTextGM: public FilterBitmapGM {
}
void makeBitmap() 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);
@@ -155,9 +154,7 @@ class FilterBitmapCheckerboardGM: public FilterBitmapGM {
}
void makeBitmap() 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);
@@ -207,8 +204,7 @@ class FilterBitmapImageGM: public FilterBitmapGM {
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/extractbitmap.cpp ('k') | gm/giantbitmap.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698