diff options
author | 2017-04-01 17:21:42 +0000 | |
---|---|---|
committer | 2017-04-01 17:21:52 +0000 | |
commit | b14131c1851eea6acbd34cc42a8f860daed36b21 (patch) | |
tree | 39e74b29ec1a34ff63fc347ba9b616186f435ff6 /gm | |
parent | 9920b10f5292838f00600f676c4578cd11705e60 (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 'gm')
-rw-r--r-- | gm/all_bitmap_configs.cpp | 3 | ||||
-rw-r--r-- | gm/bitmapfilters.cpp | 5 | ||||
-rw-r--r-- | gm/encode-srgb.cpp | 3 | ||||
-rw-r--r-- | gm/image_pict.cpp | 3 | ||||
-rw-r--r-- | gm/tinybitmap.cpp | 4 |
5 files changed, 13 insertions, 5 deletions
diff --git a/gm/all_bitmap_configs.cpp b/gm/all_bitmap_configs.cpp index 60aec88ddf..ea7b73483b 100644 --- a/gm/all_bitmap_configs.cpp +++ b/gm/all_bitmap_configs.cpp @@ -124,9 +124,10 @@ static SkBitmap indexed_bitmap() { pmColors[i] = premultiply_color(colors[i]); } SkBitmap bm; + sk_sp<SkColorTable> ctable(new SkColorTable(pmColors, SK_ARRAY_COUNT(pmColors))); SkImageInfo info = SkImageInfo::Make(SCALE, SCALE, kIndex_8_SkColorType, kPremul_SkAlphaType); - bm.allocPixels(info, SkColorTable::Make(pmColors, SK_ARRAY_COUNT(pmColors))); + bm.allocPixels(info, nullptr, ctable.get()); SkAutoLockPixels autoLockPixels1(n32bitmap); SkAutoLockPixels autoLockPixels2(bm); for (int y = 0; y < SCALE; ++y) { diff --git a/gm/bitmapfilters.cpp b/gm/bitmapfilters.cpp index 22e5d0943f..2cded98236 100644 --- a/gm/bitmapfilters.cpp +++ b/gm/bitmapfilters.cpp @@ -17,9 +17,12 @@ static void make_bm(SkBitmap* bm) { for (size_t i = 0; i < SK_ARRAY_COUNT(colors); ++i) { colorsPM[i] = SkPreMultiplyColor(colors[i]); } + SkColorTable* ctable = new SkColorTable(colorsPM, 4); + bm->allocPixels(SkImageInfo::Make(2, 2, kIndex_8_SkColorType, kPremul_SkAlphaType), - SkColorTable::Make(colorsPM, 4)); + nullptr, ctable); + ctable->unref(); *bm->getAddr8(0, 0) = 0; *bm->getAddr8(1, 0) = 1; diff --git a/gm/encode-srgb.cpp b/gm/encode-srgb.cpp index 894b0ef8d5..f62d48ae2c 100644 --- a/gm/encode-srgb.cpp +++ b/gm/encode-srgb.cpp @@ -67,9 +67,10 @@ static void make_index8(SkBitmap* bitmap, SkAlphaType alphaType, sk_sp<SkColorSp pmColors[i] = toPMColor(colors[i]); } + sk_sp<SkColorTable> colorTable(new SkColorTable(pmColors, SK_ARRAY_COUNT(pmColors))); SkImageInfo info = SkImageInfo::Make(imageWidth, imageHeight, kIndex_8_SkColorType, alphaType, colorSpace); - bitmap->allocPixels(info, SkColorTable::Make(pmColors, SK_ARRAY_COUNT(pmColors))); + bitmap->allocPixels(info, nullptr, colorTable.get()); for (int y = 0; y < imageHeight; y++) { for (int x = 0; x < imageWidth; x++) { *bitmap->getAddr8(x, y) = (x / div_round_up(imageWidth, 2)) + diff --git a/gm/image_pict.cpp b/gm/image_pict.cpp index f23b89e728..792173ce66 100644 --- a/gm/image_pict.cpp +++ b/gm/image_pict.cpp @@ -199,7 +199,8 @@ static std::unique_ptr<SkImageGenerator> make_ctable_generator(GrContext*, sk_sp SkImageInfo info = SkImageInfo::Make(100, 100, kIndex_8_SkColorType, kPremul_SkAlphaType); SkBitmap bm2; - bm2.allocPixels(info, SkColorTable::Make(colors, count)); + sk_sp<SkColorTable> ct(new SkColorTable(colors, count)); + bm2.allocPixels(info, nullptr, ct.get()); for (int y = 0; y < info.height(); ++y) { for (int x = 0; x < info.width(); ++x) { *bm2.getAddr8(x, y) = find_closest(*bm.getAddr32(x, y), colors, count); diff --git a/gm/tinybitmap.cpp b/gm/tinybitmap.cpp index 1640cb23d1..0f0f1374ea 100644 --- a/gm/tinybitmap.cpp +++ b/gm/tinybitmap.cpp @@ -15,11 +15,13 @@ namespace skiagm { static SkBitmap make_bitmap() { const SkPMColor c[] = { SkPackARGB32(0x80, 0x80, 0, 0) }; + SkColorTable* ctable = new SkColorTable(c, SK_ARRAY_COUNT(c)); SkBitmap bm; bm.allocPixels(SkImageInfo::Make(1, 1, kIndex_8_SkColorType, kPremul_SkAlphaType), - SkColorTable::Make(c, SK_ARRAY_COUNT(c))); + nullptr, ctable); + ctable->unref(); bm.lockPixels(); *bm.getAddr8(0, 0) = 0; |