Always initialize SkDashPathEffect fields.
authormtklein <mtklein@chromium.org>
Wed, 9 Jul 2014 16:54:10 +0000 (09:54 -0700)
committerCommit bot <commit-bot@chromium.org>
Wed, 9 Jul 2014 16:54:11 +0000 (09:54 -0700)
commit1c577cd3ee331944b9061ee0eec147b211ee563c
treeca4e2ea83c7b2343844c4e60d5d7c03353178d30
parent2e09d18f78f5772d2d9506ff8024ca8542654358
Always initialize SkDashPathEffect fields.

SkDashPathEffect is flattened into a hash key as part of the old-and-busted
SkPicture paint deduping code.  If all its fields aren't intialized, this hash
will be based on uninitialized data.  This means the hash won't be
deterministic, and worse, Valgrind and MSAN will make us feel bad.

An alternative to this is to have SkDashPath::CalcDashParameters always
guarantee it writes something to all its output parameters, even when the dash
intervals make no sense.  I like it being dumb and its users defensive, but
could go either way.

BUG=391001
R=reed@google.com, mtklein@google.com

Author: mtklein@chromium.org

Review URL: https://codereview.chromium.org/379813004
src/effects/SkDashPathEffect.cpp