diff options
author | Mike Reed <reed@google.com> | 2017-04-01 17:21:42 +0000 |
---|---|---|
committer | Skia Commit-Bot <skia-commit-bot@chromium.org> | 2017-04-01 17:21:52 +0000 |
commit | b14131c1851eea6acbd34cc42a8f860daed36b21 (patch) | |
tree | 39e74b29ec1a34ff63fc347ba9b616186f435ff6 /samplecode | |
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 'samplecode')
-rw-r--r-- | samplecode/SampleBlur.cpp | 6 | ||||
-rw-r--r-- | samplecode/SampleDitherBitmap.cpp | 5 | ||||
-rw-r--r-- | samplecode/SampleFilter.cpp | 4 | ||||
-rw-r--r-- | samplecode/SampleTinyBitmap.cpp | 4 |
4 files changed, 14 insertions, 5 deletions
diff --git a/samplecode/SampleBlur.cpp b/samplecode/SampleBlur.cpp index c43dc9bd43..7e6a32562d 100644 --- a/samplecode/SampleBlur.cpp +++ b/samplecode/SampleBlur.cpp @@ -4,7 +4,6 @@ * Use of this source code is governed by a BSD-style license that can be * found in the LICENSE file. */ - #include "SampleCode.h" #include "SkBlurMask.h" #include "SkBlurMaskFilter.h" @@ -21,9 +20,12 @@ static SkBitmap make_bitmap() { } SkBitmap bm; + SkColorTable* ctable = new SkColorTable(c, 256); + bm.allocPixels(SkImageInfo::Make(256, 256, kIndex_8_SkColorType, kPremul_SkAlphaType), - SkColorTable::Make(c, 256)); + nullptr, ctable); + ctable->unref(); bm.lockPixels(); const float cx = bm.width() * 0.5f; diff --git a/samplecode/SampleDitherBitmap.cpp b/samplecode/SampleDitherBitmap.cpp index bdd3071c0b..676d4c3530 100644 --- a/samplecode/SampleDitherBitmap.cpp +++ b/samplecode/SampleDitherBitmap.cpp @@ -56,9 +56,12 @@ static SkBitmap make_bitmap() { for (int i = 0; i < 256; i++) { c[i] = SkPackARGB32(0xFF, i, 0, 0); } + SkColorTable* ctable = new SkColorTable(c, 256); + SkBitmap bm; bm.allocPixels(SkImageInfo::Make(256, 32, kIndex_8_SkColorType, kPremul_SkAlphaType), - SkColorTable::Make(c, 256)); + nullptr, ctable); + ctable->unref(); bm.lockPixels(); for (int y = 0; y < bm.height(); y++) { diff --git a/samplecode/SampleFilter.cpp b/samplecode/SampleFilter.cpp index d12f804d19..66de8f317f 100644 --- a/samplecode/SampleFilter.cpp +++ b/samplecode/SampleFilter.cpp @@ -26,9 +26,11 @@ static void make_bm(SkBitmap* bm) { SkPreMultiplyColor(SK_ColorRED), SkPreMultiplyColor(SK_ColorGREEN), SkPreMultiplyColor(SK_ColorBLUE), SkPreMultiplyColor(SK_ColorWHITE) }; + SkColorTable* ctable = new SkColorTable(colors, 4); bm->allocPixels(SkImageInfo::Make(2, 2, kIndex_8_SkColorType, kOpaque_SkAlphaType), - SkColorTable::Make(colors, 4)); + nullptr, ctable); + ctable->unref(); *bm->getAddr8(0, 0) = 0; *bm->getAddr8(1, 0) = 1; diff --git a/samplecode/SampleTinyBitmap.cpp b/samplecode/SampleTinyBitmap.cpp index 6b01d11d5a..4fb508b898 100644 --- a/samplecode/SampleTinyBitmap.cpp +++ b/samplecode/SampleTinyBitmap.cpp @@ -19,11 +19,13 @@ static SkBitmap make_bitmap() { for (int i = 0; i < N; i++) { c[i] = SkPackARGB32(0x80, 0x80, 0, 0); } + SkColorTable* ctable = new SkColorTable(c, N); SkBitmap bm; bm.allocPixels(SkImageInfo::Make(1, 1, kIndex_8_SkColorType, kPremul_SkAlphaType), - SkColorTable::Make(c, N)); + nullptr, ctable); + ctable->unref(); bm.lockPixels(); for (int y = 0; y < bm.height(); y++) { |