diff options
author | caryclark <caryclark@google.com> | 2016-01-04 14:17:47 -0800 |
---|---|---|
committer | Commit bot <commit-bot@chromium.org> | 2016-01-04 14:17:47 -0800 |
commit | 6df611574a3cf8abf2617af0d03a5553bb17360d (patch) | |
tree | 1e5bcb0e8c8048ad8958286ff4a7a37cf4829790 /gm/composeshader.cpp | |
parent | 512f3e3b2592097a39bde9331829b38d16c0f85d (diff) |
handle halfway case in scan converter
Scan edges that start at exactly -0.5 aren't trimmed by
clipping or by rounding, triggering a debug assert.
One way to fix this is to round the top and left
down instead of up.
Also, move the path initialization of gm/composeshader.cpp
to make debugging other path problems easier.
R=reed@google.com
BUG=skia:2715
GOLD_TRYBOT_URL= https://gold.skia.org/search2?unt=true&query=source_type%3Dgm&master=false&issue=1544873002
Review URL: https://codereview.chromium.org/1544873002
Diffstat (limited to 'gm/composeshader.cpp')
-rw-r--r-- | gm/composeshader.cpp | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/gm/composeshader.cpp b/gm/composeshader.cpp index e012bbb285..b2be9ba28e 100644 --- a/gm/composeshader.cpp +++ b/gm/composeshader.cpp @@ -162,7 +162,14 @@ static SkShader* make_linear_gradient_shader(int length) { class ComposeShaderBitmapGM : public skiagm::GM { public: - ComposeShaderBitmapGM() { + ComposeShaderBitmapGM() + : fColorBitmapShader(nullptr) + , fAlpha8BitmapShader(nullptr) + , fLinearGradientShader(nullptr) + { + } + + void onOnceBeforeDraw() override { draw_color_bm(&fColorBitmap, squareLength); draw_alpha8_bm(&fAlpha8Bitmap, squareLength); SkMatrix s; @@ -173,6 +180,7 @@ public: SkShader::kRepeat_TileMode, &s); fLinearGradientShader = make_linear_gradient_shader(squareLength); } + ~ComposeShaderBitmapGM() { SkSafeUnref(fColorBitmapShader); SkSafeUnref(fAlpha8BitmapShader); |