diff options
author | 2015-12-28 11:15:46 -0800 | |
---|---|---|
committer | 2015-12-28 11:15:46 -0800 | |
commit | 636270245fb486559b0324e9bb9e794d56bc3101 (patch) | |
tree | 4ab44154bc455c93c729adc193e13a5d6b93a252 /gm/path_stroke_with_zero_length.cpp | |
parent | 93eb4b97d4b896e0e4112a79a3caa76b2e99074b (diff) |
initialize offscreen in StrokeZeroGM
Valgrind's complaining that we're drawing uninitialized source pixels
from that offscreen via drawBitmap():
https://uberchromegw.corp.google.com/i/client.skia/builders/Test-Ubuntu-GCC-GCE-CPU-AVX2-x86_64-Release-Valgrind/builds/736/steps/dm/logs/stdio
BUG=skia:
GOLD_TRYBOT_URL= https://gold.skia.org/search2?unt=true&query=source_type%3Dgm&master=false&issue=1546363002
Review URL: https://codereview.chromium.org/1546363002
Diffstat (limited to 'gm/path_stroke_with_zero_length.cpp')
-rw-r--r-- | gm/path_stroke_with_zero_length.cpp | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/gm/path_stroke_with_zero_length.cpp b/gm/path_stroke_with_zero_length.cpp index 6f542bac3f..f69b5f9294 100644 --- a/gm/path_stroke_with_zero_length.cpp +++ b/gm/path_stroke_with_zero_length.cpp @@ -117,7 +117,7 @@ protected: bool aliases[] = { false, true }; for (bool antialias : aliases) { canvas->save(); - for (SkScalar width : widths) { + for (SkScalar width : widths) { canvas->save(); SkPaint butt; butt.setAntiAlias(antialias); @@ -147,6 +147,7 @@ private: SkBitmap offscreen; offscreen.allocN32Pixels(SkScalarRoundToInt(bounds.width() + 4), SkScalarRoundToInt(bounds.height() + 4)); + offscreen.eraseColor(SK_ColorWHITE); SkScalar pathX = bounds.fLeft - 2; SkScalar pathY = bounds.fTop - 2; SkMatrix cMatrix = canvas->getTotalMatrix(); |