From 6df611574a3cf8abf2617af0d03a5553bb17360d Mon Sep 17 00:00:00 2001 From: caryclark Date: Mon, 4 Jan 2016 14:17:47 -0800 Subject: 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 --- gm/composeshader.cpp | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) (limited to 'gm/composeshader.cpp') 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); -- cgit v1.2.3