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

Unified Diff: tests/ImageCacheTest.cpp

Issue 162643002: replace setConfig+allocPixels with single call (Closed) Base URL: https://skia.googlecode.com/svn/trunk
Patch Set: Created 6 years, 10 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 | « tests/GradientTest.cpp ('k') | tests/ImageDecodingTest.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tests/ImageCacheTest.cpp
diff --git a/tests/ImageCacheTest.cpp b/tests/ImageCacheTest.cpp
index 15b624aa87bd0fc5314ca092c96fd1800591457c..65c9068853d7e20711f792998946c107c7868416 100644
--- a/tests/ImageCacheTest.cpp
+++ b/tests/ImageCacheTest.cpp
@@ -10,8 +10,7 @@
#include "Test.h"
static void make_bm(SkBitmap* bm, int w, int h) {
- bm->setConfig(SkBitmap::kARGB_8888_Config, w, h);
- bm->allocPixels();
+ bm->allocN32Pixels(w, h);
}
static const int COUNT = 10;
@@ -109,12 +108,10 @@ DEF_TEST(ImageCache_doubleAdd, r) {
SkScaledImageCache cache(1024);
SkBitmap original;
- original.setConfig(SkBitmap::kARGB_8888_Config, 40, 40);
- original.allocPixels();
+ original.allocN32Pixels(40, 40);
SkBitmap scaled;
- scaled.setConfig(SkBitmap::kARGB_8888_Config, 20, 20);
- scaled.allocPixels();
+ scaled.allocN32Pixels(20, 20);
SkScaledImageCache::ID* id1 = cache.addAndLock(original, 0.5f, 0.5f, scaled);
SkScaledImageCache::ID* id2 = cache.addAndLock(original, 0.5f, 0.5f, scaled);
« no previous file with comments | « tests/GradientTest.cpp ('k') | tests/ImageDecodingTest.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698