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

Unified Diff: gm/bitmaprect.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/bitmappremul.cpp ('k') | gm/bitmaprecttest.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: gm/bitmaprect.cpp
diff --git a/gm/bitmaprect.cpp b/gm/bitmaprect.cpp
index 9c6d472b5794caf1a56ee901946d31850f3936bd..e1034a9255824fa39428c02445b08b5e58e160c9 100644
--- a/gm/bitmaprect.cpp
+++ b/gm/bitmaprect.cpp
@@ -14,8 +14,7 @@
#include "SkShader.h"
static void make_bitmap(SkBitmap* bitmap) {
- bitmap->setConfig(SkBitmap::kARGB_8888_Config, 64, 64);
- bitmap->allocPixels();
+ bitmap->allocN32Pixels(64, 64);
SkCanvas canvas(*bitmap);
@@ -100,10 +99,7 @@ static void make_3x3_bitmap(SkBitmap* bitmap) {
};
- bitmap->setConfig(SkBitmap::kARGB_8888_Config, gXSize, gYSize);
- bitmap->allocPixels();
-
- SkAutoLockPixels lock(*bitmap);
+ bitmap->allocN32Pixels(gXSize, gYSize);
for (int y = 0; y < gYSize; y++) {
for (int x = 0; x < gXSize; x++) {
*bitmap->getAddr32(x, y) = textureData[x][y];
@@ -157,10 +153,7 @@ static void make_big_bitmap(SkBitmap* bitmap) {
static const int gYSize = 4096;
static const int gBorderWidth = 10;
- bitmap->setConfig(SkBitmap::kARGB_8888_Config, gXSize, gYSize);
- bitmap->allocPixels();
-
- SkAutoLockPixels lock(*bitmap);
+ bitmap->allocN32Pixels(gXSize, gYSize);
for (int y = 0; y < gYSize; ++y) {
for (int x = 0; x < gXSize; ++x) {
if (x <= gBorderWidth || x >= gXSize-gBorderWidth ||
« no previous file with comments | « gm/bitmappremul.cpp ('k') | gm/bitmaprecttest.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698