Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(575)

Issue 1982753002: Ensure that SkColorTable->fCount is set properly after decodes (Closed)

Created:
4 years, 7 months ago by msarett
Modified:
4 years, 3 months ago
Reviewers:
herb_g, scroggo, reed1
CC:
reviews_skia.org
Base URL:
https://skia.googlesource.com/skia.git@master
Target Ref:
refs/heads/master
Project:
skia
Visibility:
Public.

Description

Ensure that SkColorTable->fCount is set properly after decodes We now have some blits that will process the color table. If we erroneously report that the size of the color table is 256, we will do extra work and annoy MSAN. BUG=skia: GOLD_TRYBOT_URL= https://gold.skia.org/search2?unt=true&query=source_type%3Dgm&master=false&issue=1982753002 Committed: https://skia.googlesource.com/skia/+/b1be46b1d938c21eafa7ded5560bcc10b71cd471

Patch Set 1 #

Total comments: 8

Patch Set 2 : #

Unified diffs Side-by-side diffs Delta from patch set Stats (+77 lines, -115 lines) Patch
M dm/DMSrcSink.cpp View 1 19 chunks +69 lines, -101 lines 0 comments Download
M include/core/SkColorTable.h View 1 chunk +1 line, -0 lines 0 comments Download
M src/android/SkBitmapRegionCodec.cpp View 3 chunks +7 lines, -14 lines 0 comments Download

Messages

Total messages: 17 (7 generated)
msarett
Once this is settled, I'll need to make a similar change in BitmapFactory.cpp in Android.
4 years, 7 months ago (2016-05-16 19:10:27 UTC) #3
scroggo
lgtm https://codereview.chromium.org/1982753002/diff/1/dm/DMSrcSink.cpp File dm/DMSrcSink.cpp (right): https://codereview.chromium.org/1982753002/diff/1/dm/DMSrcSink.cpp#newcode357 dm/DMSrcSink.cpp:357: void draw_to_canvas(SkCanvas* canvas, const SkImageInfo& info, void* pixels, ...
4 years, 7 months ago (2016-05-16 19:28:15 UTC) #4
herb_g
lgtm
4 years, 7 months ago (2016-05-16 20:38:23 UTC) #5
reed1
lgtm https://codereview.chromium.org/1982753002/diff/1/include/core/SkColorTable.h File include/core/SkColorTable.h (right): https://codereview.chromium.org/1982753002/diff/1/include/core/SkColorTable.h#newcode75 include/core/SkColorTable.h:75: if (count < 0 || count > fCount) ...
4 years, 7 months ago (2016-05-17 13:48:38 UTC) #6
msarett
https://codereview.chromium.org/1982753002/diff/1/dm/DMSrcSink.cpp File dm/DMSrcSink.cpp (right): https://codereview.chromium.org/1982753002/diff/1/dm/DMSrcSink.cpp#newcode357 dm/DMSrcSink.cpp:357: void draw_to_canvas(SkCanvas* canvas, const SkImageInfo& info, void* pixels, size_t ...
4 years, 7 months ago (2016-05-17 15:29:35 UTC) #7
commit-bot: I haz the power
Dry run: CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1982753002/20001 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/1982753002/20001
4 years, 7 months ago (2016-05-17 15:29:54 UTC) #9
commit-bot: I haz the power
Dry run: This issue passed the CQ dry run.
4 years, 7 months ago (2016-05-17 15:49:58 UTC) #11
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1982753002/20001 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/1982753002/20001
4 years, 7 months ago (2016-05-17 15:51:17 UTC) #14
commit-bot: I haz the power
Committed patchset #2 (id:20001) as https://skia.googlesource.com/skia/+/b1be46b1d938c21eafa7ded5560bcc10b71cd471
4 years, 7 months ago (2016-05-17 15:52:15 UTC) #16
msarett
4 years, 7 months ago (2016-05-17 19:54:58 UTC) #17
Message was sent while issue was closed.
On 2016/05/16 19:10:27, msarett wrote:
> Once this is settled, I'll need to make a similar change in BitmapFactory.cpp
in
> Android.

Started thinking about how to fix this in BitmapFactory.cpp in Android.

We are very much committed to using bitmap.tryAllocPixels(Allocator,
SkColorTable), which means that we need to have an SkColorTable before we start
the decode.  And we can't really fix the SkColorTable after the decode because
BitmapFactory can't access dangerous_overwrite().

I think we'll need to use Leon's suggestion and change the SkCodec::getPixels()
API to take an SkPixmap (which has an SkColorTable).  Then, the codec be able to
modify the color table as it decodes.

Powered by Google App Engine
This is Rietveld 408576698