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

Unified Diff: ui/gfx/codec/png_codec_unittest.cc

Issue 361643002: setConfig is deprecated, use setInfo or allocPixels instead (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: don't call allocPixels+rowbytes yet (skia bug) 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 | « ui/gfx/codec/png_codec.cc ('k') | ui/gfx/color_analysis.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/gfx/codec/png_codec_unittest.cc
diff --git a/ui/gfx/codec/png_codec_unittest.cc b/ui/gfx/codec/png_codec_unittest.cc
index 37816807ba991962eb7f2a24c7b5004240b6b0ee..6613a63c66b77efc020b5c0f2fc9a66336eea459 100644
--- a/ui/gfx/codec/png_codec_unittest.cc
+++ b/ui/gfx/codec/png_codec_unittest.cc
@@ -257,8 +257,7 @@ bool BGRAGrayEqualsA8Gray(uint32_t a, uint8_t b) {
}
void MakeTestBGRASkBitmap(int w, int h, SkBitmap* bmp) {
- bmp->setConfig(SkBitmap::kARGB_8888_Config, w, h);
- bmp->allocPixels();
+ bmp->allocN32Pixels(w, h);
uint32_t* src_data = bmp->getAddr32(0, 0);
for (int i = 0; i < w * h; i++)
@@ -266,8 +265,7 @@ void MakeTestBGRASkBitmap(int w, int h, SkBitmap* bmp) {
}
void MakeTestA8SkBitmap(int w, int h, SkBitmap* bmp) {
- bmp->setConfig(SkBitmap::kA8_Config, w, h);
- bmp->allocPixels();
+ bmp->allocPixels(SkImageInfo::MakeA8(w, h));
uint8_t* src_data = bmp->getAddr8(0, 0);
for (int i = 0; i < w * h; i++)
@@ -994,9 +992,9 @@ TEST(PNGCodec, EncodeBGRASkBitmapStridePadded) {
const int kPaddedSize = kPaddedWidth * kHeight;
const int kRowBytes = kPaddedWidth * kBytesPerPixel;
+ SkImageInfo info = SkImageInfo::MakeN32Premul(kWidth, kHeight);
SkBitmap original_bitmap;
- original_bitmap.setConfig(SkBitmap::kARGB_8888_Config,
- kWidth, kHeight, kRowBytes);
+ original_bitmap.setInfo(info, kRowBytes);
original_bitmap.allocPixels();
// Write data over the source bitmap.
« no previous file with comments | « ui/gfx/codec/png_codec.cc ('k') | ui/gfx/color_analysis.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698