aboutsummaryrefslogtreecommitdiffhomepage
path: root/tests/CodecTest.cpp
diff options
context:
space:
mode:
authorGravatar Mike Reed <reed@google.com>2017-04-03 14:41:44 -0400
committerGravatar Skia Commit-Bot <skia-commit-bot@chromium.org>2017-04-03 19:29:38 +0000
commit6b3155c4be0476bc53541b0431c368a44e69f0a7 (patch)
tree2de5a87716b38a587c475731df815e5c8178e133 /tests/CodecTest.cpp
parent2db3232c88cbaec5585f263111f334ca7272fe10 (diff)
Revert[4] "clean up (partially) colortable api""""
Fixes: - create temp api for android to pass nullptr - don't release and access sk_sp<SkData> at the same time in parameters This reverts commit b14131c1851eea6acbd34cc42a8f860daed36b21. Bug: skia: Change-Id: Ic0e4f62520ba9f35455499ed30d306ad19d998a8 Reviewed-on: https://skia-review.googlesource.com/11129 Commit-Queue: Mike Reed <reed@google.com> Reviewed-by: Matt Sarett <msarett@google.com>
Diffstat (limited to 'tests/CodecTest.cpp')
-rw-r--r--tests/CodecTest.cpp11
1 files changed, 5 insertions, 6 deletions
diff --git a/tests/CodecTest.cpp b/tests/CodecTest.cpp
index dd11ff84fd..f3a393d7ac 100644
--- a/tests/CodecTest.cpp
+++ b/tests/CodecTest.cpp
@@ -700,8 +700,7 @@ static void test_invalid_parameters(skiatest::Reporter* r, const char path[]) {
} else if (SkCodec::kUnimplemented == result) {
// New method should be supported:
SkBitmap bm;
- sk_sp<SkColorTable> colorTable(new SkColorTable(colorStorage, 256));
- bm.allocPixels(info, nullptr, colorTable.get());
+ bm.allocPixels(info, SkColorTable::Make(colorStorage, 256));
result = decoder->startIncrementalDecode(info, bm.getPixels(), bm.rowBytes(), nullptr,
colorStorage, &colorCount);
REPORTER_ASSERT(r, SkCodec::kSuccess == result);
@@ -1108,8 +1107,8 @@ static bool alpha_type_match(SkAlphaType origAlphaType, SkAlphaType codecAlphaTy
static void check_round_trip(skiatest::Reporter* r, SkCodec* origCodec, const SkImageInfo& info) {
SkBitmap bm1;
SkPMColor colors[256];
- sk_sp<SkColorTable> colorTable1(new SkColorTable(colors, 256));
- bm1.allocPixels(info, nullptr, colorTable1.get());
+ sk_sp<SkColorTable> colorTable1 = SkColorTable::Make(colors, 256);
+ bm1.allocPixels(info, colorTable1);
int numColors;
SkCodec::Result result = origCodec->getPixels(info, bm1.getPixels(), bm1.rowBytes(), nullptr,
const_cast<SkPMColor*>(colorTable1->readColors()),
@@ -1126,8 +1125,8 @@ static void check_round_trip(skiatest::Reporter* r, SkCodec* origCodec, const Sk
REPORTER_ASSERT(r, alpha_type_match(info.alphaType(), codec->getInfo().alphaType()));
SkBitmap bm2;
- sk_sp<SkColorTable> colorTable2(new SkColorTable(colors, 256));
- bm2.allocPixels(info, nullptr, colorTable2.get());
+ sk_sp<SkColorTable> colorTable2 = SkColorTable::Make(colors, 256);
+ bm2.allocPixels(info, colorTable2);
result = codec->getPixels(info, bm2.getPixels(), bm2.rowBytes(), nullptr,
const_cast<SkPMColor*>(colorTable2->readColors()), &numColors);
REPORTER_ASSERT(r, SkCodec::kSuccess == result);