aboutsummaryrefslogtreecommitdiffhomepage
path: root/tests/BitmapCopyTest.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/BitmapCopyTest.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/BitmapCopyTest.cpp')
-rw-r--r--tests/BitmapCopyTest.cpp16
1 files changed, 10 insertions, 6 deletions
diff --git a/tests/BitmapCopyTest.cpp b/tests/BitmapCopyTest.cpp
index 4578bbb7d7..70958cae55 100644
--- a/tests/BitmapCopyTest.cpp
+++ b/tests/BitmapCopyTest.cpp
@@ -62,11 +62,11 @@ static void init_src(const SkBitmap& bitmap) {
}
}
-static sk_sp<SkColorTable> init_ctable() {
+static SkColorTable* init_ctable() {
static const SkColor colors[] = {
SK_ColorBLACK, SK_ColorRED, SK_ColorGREEN, SK_ColorBLUE, SK_ColorWHITE
};
- return SkColorTable::Make(colors, SK_ARRAY_COUNT(colors));
+ return new SkColorTable(colors, SK_ARRAY_COUNT(colors));
}
struct Pair {
@@ -194,13 +194,16 @@ static const int H = 33;
static void setup_src_bitmaps(SkBitmap* srcOpaque, SkBitmap* srcPremul,
SkColorType ct) {
- sk_sp<SkColorTable> ctable;
+ SkColorTable* ctable = nullptr;
if (kIndex_8_SkColorType == ct) {
ctable = init_ctable();
}
- srcOpaque->allocPixels(SkImageInfo::Make(W, H, ct, kOpaque_SkAlphaType), ctable);
- srcPremul->allocPixels(SkImageInfo::Make(W, H, ct, kPremul_SkAlphaType), ctable);
+ srcOpaque->allocPixels(SkImageInfo::Make(W, H, ct, kOpaque_SkAlphaType),
+ nullptr, ctable);
+ srcPremul->allocPixels(SkImageInfo::Make(W, H, ct, kPremul_SkAlphaType),
+ nullptr, ctable);
+ SkSafeUnref(ctable);
init_src(*srcOpaque);
init_src(*srcPremul);
}
@@ -375,7 +378,7 @@ DEF_TEST(BitmapCopy, reporter) {
// Create bitmap to act as source for copies and subsets.
SkBitmap src, subset;
- sk_sp<SkColorTable> ct;
+ SkColorTable* ct = nullptr;
if (kIndex_8_SkColorType == src.colorType()) {
ct = init_ctable();
}
@@ -391,6 +394,7 @@ DEF_TEST(BitmapCopy, reporter) {
kPremul_SkAlphaType))) {
// failure is fine, as we will notice later on
}
+ SkSafeUnref(ct);
// Either copy src or extract into 'subset', which is used
// for subsequent calls to copyPixelsTo/From.