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

Unified Diff: tests/ARGBImageEncoderTest.cpp

Issue 322963002: hide SkBitmap::setConfig (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: 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 | « src/ports/SkImageDecoder_empty.cpp ('k') | tests/CachedDecodingPixelRefTest.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tests/ARGBImageEncoderTest.cpp
diff --git a/tests/ARGBImageEncoderTest.cpp b/tests/ARGBImageEncoderTest.cpp
index 710116554721de8acbad8e5ea1d483e5c8c0af64..18f315fca9bf05a782120ecd8f151ccad784c61e 100644
--- a/tests/ARGBImageEncoderTest.cpp
+++ b/tests/ARGBImageEncoderTest.cpp
@@ -12,9 +12,9 @@
#include "SkStream.h"
#include "Test.h"
-static SkBitmap::Config configs[] = {
- SkBitmap::kRGB_565_Config,
- SkBitmap::kARGB_8888_Config,
+static SkColorType gColorTypes[] = {
+ kRGB_565_SkColorType,
+ kN32_SkColorType,
};
DEF_TEST(ARGBImageEncoder, reporter) {
@@ -31,13 +31,13 @@ DEF_TEST(ARGBImageEncoder, reporter) {
};
SkAutoTDelete<SkImageEncoder> enc(CreateARGBImageEncoder());
- for (size_t configIndex = 0; configIndex < SK_ARRAY_COUNT(configs); ++configIndex) {
+ for (size_t ctIndex = 0; ctIndex < SK_ARRAY_COUNT(gColorTypes); ++ctIndex) {
// A bitmap that should generate the above bytes:
SkBitmap bitmap;
{
- bitmap.setConfig(configs[configIndex], kWidth, kHeight);
- REPORTER_ASSERT(reporter, bitmap.allocPixels());
- bitmap.setAlphaType(kOpaque_SkAlphaType);
+ bool success = bitmap.allocPixels(SkImageInfo::Make(kWidth, kHeight,
+ gColorTypes[ctIndex], kOpaque_SkAlphaType));
+ REPORTER_ASSERT(reporter, success);
bitmap.eraseColor(SK_ColorBLUE);
// Change rows [0,1] from blue to [red,green].
SkCanvas canvas(bitmap);
« no previous file with comments | « src/ports/SkImageDecoder_empty.cpp ('k') | tests/CachedDecodingPixelRefTest.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698