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

Unified Diff: skia/ext/skia_utils_mac_unittest.mm

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/skia_utils_mac.mm ('k') | skia/ext/vector_platform_device_emf_win.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: skia/ext/skia_utils_mac_unittest.mm
diff --git a/skia/ext/skia_utils_mac_unittest.mm b/skia/ext/skia_utils_mac_unittest.mm
index dd467025ffa948c3e9d03e57661597b7df27d209..bd1755fb108cb84d4a4cdee16e7516e1828b97a1 100644
--- a/skia/ext/skia_utils_mac_unittest.mm
+++ b/skia/ext/skia_utils_mac_unittest.mm
@@ -43,13 +43,11 @@ class SkiaUtilsMacTest : public testing::Test {
SkBitmap SkiaUtilsMacTest::CreateSkBitmap(int width, int height,
bool isred, bool tfbit) {
- SkBitmap bitmap;
+ SkColorType ct = tfbit ? kN32_SkColorType : kARGB_4444_SkColorType;
+ SkImageInfo info = SkImageInfo::Make(width, height, ct, kPremul_SkAlphaType);
- if (tfbit)
- bitmap.setConfig(SkBitmap::kARGB_8888_Config, width, height);
- else
- bitmap.setConfig(SkBitmap::kARGB_4444_Config, width, height);
- bitmap.allocPixels();
+ SkBitmap bitmap;
+ bitmap.allocPixels(info);
if (isred)
bitmap.eraseARGB(0xff, 0xff, 0, 0);
@@ -123,9 +121,9 @@ void SkiaUtilsMacTest::RunBitLockerTest(BitLockerTest test) {
EXPECT_EQ(storageSize, sizeof(original) / sizeof(original[0]));
unsigned bits[storageSize];
memcpy(bits, original, sizeof(original));
+ SkImageInfo info = SkImageInfo::MakeN32Premul(width, height);
SkBitmap bitmap;
- bitmap.setConfig(SkBitmap::kARGB_8888_Config, width, height);
- bitmap.setPixels(bits);
+ bitmap.installPixels(info, bits, info.minRowBytes());
SkCanvas canvas(bitmap);
if (test & TestTranslate)
« no previous file with comments | « skia/ext/skia_utils_mac.mm ('k') | skia/ext/vector_platform_device_emf_win.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698