aboutsummaryrefslogtreecommitdiff
path: root/samplecode/SampleEncode.cpp
diff options
context:
space:
mode:
authormsarett <msarett@google.com>2015-09-11 09:01:16 -0700
committerCommit bot <commit-bot@chromium.org>2015-09-11 09:01:16 -0700
commit6efbe0537732a729d5bd500707dd0d8b0fc83553 (patch)
tree5d0474e01047b17ca387cfd1b7c25d1cce7a53e1 /samplecode/SampleEncode.cpp
parent465283cdf98ed9ab5285ca7b9814e430fca1d452 (diff)
Remove jpegs with uninitialized memory from Gold
BitmapRegionSampler (uses SkImageDecoder) will often scale to a power of 2 regardless of the sampleSize requested. This is skbug.com/4319. Consider a 60x60 image. To decode a subset with sample size 3, we might ask for the following. [x, y, w, h] = [-15, -15, 30, 30] sampleSize = 3 Since w = 30 and h = 30, this should give us a 10x10 result. Only the bottom right 5x5 quadrant of this 10x10 subset will actually be in the image. We should get a 5 pixel border on the top and left because we ask for 15 extra pixels on the top and left. Unfortunately, SkImageDecoder will take our requested sample size of 3, and then decide to use a sample size of 2. Not only will it scale the image by 2, but it will also scale the border by 2. So while we are expecting pixel data to begin at offset (5, 5) of the result bitmap, it actually begins at offset (7, 7). Making things worse, the pixels between (5, 5) and (7, 7) are uninitialized, causing problems on Gold. Options for fixing this include: (1) Not testing decodes with a border. (2) Changing the test to check the size of the output bitmap. (3) Disable the tests. I think it's best to just disable these tests. We know they don't work, so why do we need to see the results on Gold? BUG=skia:4319 Review URL: https://codereview.chromium.org/1313233007
Diffstat (limited to 'samplecode/SampleEncode.cpp')
0 files changed, 0 insertions, 0 deletions