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

Unified Diff: gm/bigmatrix.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/bicubicfilter.cpp ('k') | gm/bitmapmatrix.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: gm/bigmatrix.cpp
diff --git a/gm/bigmatrix.cpp b/gm/bigmatrix.cpp
index 9b49a64ea24407b0748e64781dc0b8efed13c206..b663b2b1ef2192cab2767846d0267b3e7fae18e8 100644
--- a/gm/bigmatrix.cpp
+++ b/gm/bigmatrix.cpp
@@ -59,15 +59,12 @@ protected:
canvas->drawRect(rect, paint);
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] = SkPackARGB32(0xFF, 0xFF, 0x00, 0x00);
pixels[1] = SkPackARGB32(0xFF, 0x00, 0xFF, 0x00);
pixels[2] = SkPackARGB32(0x80, 0x00, 0x00, 0x00);
pixels[3] = SkPackARGB32(0xFF, 0x00, 0x00, 0xFF);
- bmp.unlockPixels();
pt.set(30 * SK_Scalar1, 30 * SK_Scalar1);
m.mapPoints(&pt, 1);
SkShader* shader = SkShader::CreateBitmapShader(
« no previous file with comments | « gm/bicubicfilter.cpp ('k') | gm/bitmapmatrix.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698