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

Unified Diff: skia/ext/image_operations_unittest.cc

Issue 331283002: stop calling deprecated setConfig (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rebase + android typo Created 6 years, 6 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 | « skia/ext/image_operations_bench.cc ('k') | skia/ext/pixel_ref_utils.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: skia/ext/image_operations_unittest.cc
diff --git a/skia/ext/image_operations_unittest.cc b/skia/ext/image_operations_unittest.cc
index da55e4f269d3043ef2037f34fe954aadcc66cc68..9a3dcffb22dd941eadfd3f6b4d0e609d14c3e152 100644
--- a/skia/ext/image_operations_unittest.cc
+++ b/skia/ext/image_operations_unittest.cc
@@ -111,8 +111,7 @@ bool ColorsClose(uint32_t a, uint32_t b) {
}
void FillDataToBitmap(int w, int h, SkBitmap* bmp) {
- bmp->setConfig(SkBitmap::kARGB_8888_Config, w, h);
- bmp->allocPixels();
+ bmp->allocN32Pixels(w, h);
for (int y = 0; y < h; ++y) {
for (int x = 0; x < w; ++x) {
@@ -140,8 +139,7 @@ void DrawGridToBitmap(int w, int h,
ASSERT_GT(grid_width, 0);
ASSERT_NE(background_color, grid_color);
- bmp->setConfig(SkBitmap::kARGB_8888_Config, w, h);
- bmp->allocPixels();
+ bmp->allocN32Pixels(w, h);
for (int y = 0; y < h; ++y) {
bool y_on_grid = ((y % grid_pitch) < grid_width);
@@ -166,8 +164,7 @@ void DrawCheckerToBitmap(int w, int h,
ASSERT_GT(rect_h, 0);
ASSERT_NE(color1, color2);
- bmp->setConfig(SkBitmap::kARGB_8888_Config, w, h);
- bmp->allocPixels();
+ bmp->allocN32Pixels(w, h);
for (int y = 0; y < h; ++y) {
bool y_bit = (((y / rect_h) & 0x1) == 0);
@@ -464,8 +461,7 @@ TEST(ImageOperations, HalveSubset) {
TEST(ImageOperations, InvalidParams) {
// Make our source bitmap.
SkBitmap src;
- src.setConfig(SkBitmap::kA8_Config, 16, 34);
- src.allocPixels();
+ src.allocPixels(SkImageInfo::MakeA8(16, 34));
// Scale it, don't die.
SkBitmap full_results = skia::ImageOperations::Resize(
@@ -667,8 +663,7 @@ TEST(ImageOperations, ScaleUp) {
const int dst_w = 9;
const int dst_h = 9;
SkBitmap src;
- src.setConfig(SkBitmap::kARGB_8888_Config, src_w, src_h);
- src.allocPixels();
+ src.allocN32Pixels(src_w, src_h);
for (int src_y = 0; src_y < src_h; ++src_y) {
for (int src_x = 0; src_x < src_w; ++src_x) {
« no previous file with comments | « skia/ext/image_operations_bench.cc ('k') | skia/ext/pixel_ref_utils.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698