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

Unified Diff: gm/clippedbitmapshaders.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/bleed.cpp ('k') | gm/colormatrix.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: gm/clippedbitmapshaders.cpp
diff --git a/gm/clippedbitmapshaders.cpp b/gm/clippedbitmapshaders.cpp
index 4087c89c38b3b189fc4333d3586965a2ebf3e3c7..72c04742608c1591e2a02f0dd62c4fd0cb10b36f 100644
--- a/gm/clippedbitmapshaders.cpp
+++ b/gm/clippedbitmapshaders.cpp
@@ -27,15 +27,12 @@ namespace skiagm {
static SkBitmap create_bitmap() {
SkBitmap bmp;
- bmp.setConfig(SkBitmap::kARGB_8888_Config, 2, 2);
- bmp.allocPixels();
- bmp.lockPixels();
+ bmp.allocN32Pixels(2, 2);
uint32_t* pixels = reinterpret_cast<uint32_t*>(bmp.getPixels());
pixels[0] = SkPreMultiplyColor(SK_ColorRED);
pixels[1] = SkPreMultiplyColor(SK_ColorGREEN);
pixels[2] = SkPreMultiplyColor(SK_ColorBLACK);
pixels[3] = SkPreMultiplyColor(SK_ColorBLUE);
- bmp.unlockPixels();
return bmp;
}
« no previous file with comments | « gm/bleed.cpp ('k') | gm/colormatrix.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698