aboutsummaryrefslogtreecommitdiffhomepage
path: root/tests/CodecTest.cpp
diff options
context:
space:
mode:
authorGravatar Mike Reed <reed@google.com>2017-04-01 17:21:42 +0000
committerGravatar Skia Commit-Bot <skia-commit-bot@chromium.org>2017-04-01 17:21:52 +0000
commitb14131c1851eea6acbd34cc42a8f860daed36b21 (patch)
tree39e74b29ec1a34ff63fc347ba9b616186f435ff6 /tests/CodecTest.cpp
parent9920b10f5292838f00600f676c4578cd11705e60 (diff)
Revert "Revert[2] "clean up (partially) colortable api"""
This reverts commit 9920b10f5292838f00600f676c4578cd11705e60. Reason for revert: trying to get details on w2k failure https://chromium-swarm.appspot.com/task?id=354345d34ba3b310&refresh=10 Caught exception 3221225477 EXCEPTION_ACCESS_VIOLATION, was running: unit test HugeBlurImageFilter unit test FontNames unit test Codec_PngRoundTrip unit test ClampRange unit test FontHost unit test ColorMatrixFilter f16 image scaled_codec_premul abnormal.wbmp 565 image brd_android_codec_divisor_0.167 interlaced3.png_0.167 unit test Codec_png unit test ImageFilterBlurLargeImage unit test FontObj unit test DrawText unit test GrShape 565 image brd_android_codec_divisor_0.333 interlaced2.png_0.333 unit test PathOpsOpCubicsThreaded unit test PathOpsOpLoopsThreaded unit test FontMgr unit test ColorToHSVRoundTrip unit test Image_Serialize_Encoding_Failure Likely culprit: unit test Image_Serialize_Encoding_Failure step returned non-zero exit code: -1073741819 Original change's description: > Revert[2] "clean up (partially) colortable api"" > > This reverts commit 1d1165ca6575e082b892c5460492c411618783ad. > > Bug: skia: > Change-Id: Idbc0634ae3cec2e79f592d252de8751b077e6408 > Reviewed-on: https://skia-review.googlesource.com/11024 > Reviewed-by: Mike Reed <reed@google.com> > Commit-Queue: Mike Reed <reed@google.com> > TBR=reed@google.com,reviews@skia.org NOPRESUBMIT=true NOTREECHECKS=true NOTRY=true Change-Id: Ia4e73434b083224baa36092c69526c2f59bb16aa Reviewed-on: https://skia-review.googlesource.com/11025 Reviewed-by: Mike Reed <reed@google.com> Commit-Queue: Mike Reed <reed@google.com>
Diffstat (limited to 'tests/CodecTest.cpp')
-rw-r--r--tests/CodecTest.cpp11
1 files changed, 6 insertions, 5 deletions
diff --git a/tests/CodecTest.cpp b/tests/CodecTest.cpp
index f3a393d7ac..dd11ff84fd 100644
--- a/tests/CodecTest.cpp
+++ b/tests/CodecTest.cpp
@@ -700,7 +700,8 @@ static void test_invalid_parameters(skiatest::Reporter* r, const char path[]) {
} else if (SkCodec::kUnimplemented == result) {
// New method should be supported:
SkBitmap bm;
- bm.allocPixels(info, SkColorTable::Make(colorStorage, 256));
+ sk_sp<SkColorTable> colorTable(new SkColorTable(colorStorage, 256));
+ bm.allocPixels(info, nullptr, colorTable.get());
result = decoder->startIncrementalDecode(info, bm.getPixels(), bm.rowBytes(), nullptr,
colorStorage, &colorCount);
REPORTER_ASSERT(r, SkCodec::kSuccess == result);
@@ -1107,8 +1108,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 = SkColorTable::Make(colors, 256);
- bm1.allocPixels(info, colorTable1);
+ sk_sp<SkColorTable> colorTable1(new SkColorTable(colors, 256));
+ bm1.allocPixels(info, nullptr, colorTable1.get());
int numColors;
SkCodec::Result result = origCodec->getPixels(info, bm1.getPixels(), bm1.rowBytes(), nullptr,
const_cast<SkPMColor*>(colorTable1->readColors()),
@@ -1125,8 +1126,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 = SkColorTable::Make(colors, 256);
- bm2.allocPixels(info, colorTable2);
+ sk_sp<SkColorTable> colorTable2(new SkColorTable(colors, 256));
+ bm2.allocPixels(info, nullptr, colorTable2.get());
result = codec->getPixels(info, bm2.getPixels(), bm2.rowBytes(), nullptr,
const_cast<SkPMColor*>(colorTable2->readColors()), &numColors);
REPORTER_ASSERT(r, SkCodec::kSuccess == result);