From b14131c1851eea6acbd34cc42a8f860daed36b21 Mon Sep 17 00:00:00 2001 From: Mike Reed Date: Sat, 1 Apr 2017 17:21:42 +0000 Subject: 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 > Commit-Queue: Mike Reed > 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 Commit-Queue: Mike Reed --- tools/Resources.cpp | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'tools/Resources.cpp') diff --git a/tools/Resources.cpp b/tools/Resources.cpp index 224bf3f66e..d7f90189a6 100644 --- a/tools/Resources.cpp +++ b/tools/Resources.cpp @@ -34,10 +34,9 @@ bool GetResourceAsBitmap(const char* resource, SkBitmap* dst) { return false; } SkPMColor ctStorage[256]; - auto ctable = SkColorTable::Make(ctStorage, 256); + sk_sp ctable(new SkColorTable(ctStorage, 256)); int count = ctable->count(); - // ICK -- gotta clean up this pattern of writing to the ctable - return dst->tryAllocPixels(gen->getInfo(), ctable) && + return dst->tryAllocPixels(gen->getInfo(), nullptr, ctable.get()) && gen->getPixels(gen->getInfo().makeColorSpace(nullptr), dst->getPixels(), dst->rowBytes(), const_cast(ctable->readColors()), &count); } -- cgit v1.2.3