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

Issue 549203003: Hash .pngs instead of SkBitmaps. (Closed)

Created:
6 years, 3 months ago by mtklein_C
Modified:
6 years, 3 months ago
CC:
reviews_skia.org
Base URL:
https://skia.googlesource.com/skia.git@master
Project:
skia
Visibility:
Public.

Description

Hash .pngs instead of SkBitmaps. This has the nice property of being able to double-check hashes after the fact. mtklein@mtklein ~/skia (hash-png)> md5sum bad/8888/3x3bitmaprect.png deede70ab2f34067d461fb4a93332d4c bad/8888/3x3bitmaprect.png mtklein@mtklein ~/skia (hash-png)> grep 3x3bitmaprect_8888 bad/dm.json "3x3bitmaprect_8888" : "deede70ab2f34067d461fb4a93332d4c", I have checked that no two premultiplied colors map to the same unpremultiplied color (math nerds: unpremultiplication is injective), so a change in premultiplied SkBitmap will always imply a change in the encoded unpremultiplied .png. This means, it's safe to hash .pngs; we won't miss subtle changes. BUG=skia: Committed: https://skia.googlesource.com/skia/+/e2d4eb70724475035d6148ba279f9cb1c2433564

Patch Set 1 #

Patch Set 2 : test #

Patch Set 3 : comment #

Patch Set 4 : gypi #

Unified diffs Side-by-side diffs Delta from patch set Stats (+69 lines, -47 lines) Patch
M dm/DMWriteTask.cpp View 3 chunks +30 lines, -47 lines 0 comments Download
M gyp/tests.gypi View 1 2 3 1 chunk +1 line, -0 lines 0 comments Download
A tests/UnpremultiplyTest.cpp View 1 2 1 chunk +38 lines, -0 lines 0 comments Download

Messages

Total messages: 10 (2 generated)
mtklein
6 years, 3 months ago (2014-09-08 19:09:32 UTC) #2
jcgregorio
On 2014/09/08 19:09:32, mtklein wrote: LGTM
6 years, 3 months ago (2014-09-08 19:15:38 UTC) #3
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://skia-tree-status.appspot.com/cq/mtklein@chromium.org/549203003/60001
6 years, 3 months ago (2014-09-08 19:35:29 UTC) #5
commit-bot: I haz the power
Committed patchset #4 (id:60001) as e2d4eb70724475035d6148ba279f9cb1c2433564
6 years, 3 months ago (2014-09-08 19:42:26 UTC) #6
mikerreed
On 2014/09/08 19:42:26, I haz the power (commit-bot) wrote: > Committed patchset #4 (id:60001) as ...
6 years, 3 months ago (2014-09-09 03:26:27 UTC) #7
jcgregorio
On 2014/09/09 03:26:27, mikerreed wrote: > On 2014/09/08 19:42:26, I haz the power (commit-bot) wrote: ...
6 years, 3 months ago (2014-09-09 12:22:04 UTC) #8
reed1
On 2014/09/09 12:22:04, jcgregorio wrote: > On 2014/09/09 03:26:27, mikerreed wrote: > > On 2014/09/08 ...
6 years, 3 months ago (2014-09-09 13:01:34 UTC) #9
mtklein
6 years, 3 months ago (2014-09-09 14:24:06 UTC) #10
Message was sent while issue was closed.
Took me a while to get there, but I'm back to thinking hashing the original
SkBitmap was correct.  We want to be testing Skia, not Skia plus some arbitrary
PNG encoder.

Naming files based on their own hashes is nice, but I think we can depend on
Google Storage for consistency rather than have to check it ourselves.  In the
worst case, we'll find a file's corrupted and just delete it and rebaseline.

On the other hand, naming files based on the hash of their original content will
improve our sharing ratio.  We'll have baselines per test, which is nice on all
fronts: storage, computation, rebaselining cognitive load, and as a sort of
converge-all-the-platforms progress meter.

Going to undo this as part of landing those other pending CLs.

Powered by Google App Engine
This is Rietveld 408576698