capture repro case for gradient bug (inside if-false for now)

git-svn-id: http://skia.googlecode.com/svn/trunk@6574 2bbb7eff-a529-9590-31e7-b0007b416f81
This commit is contained in:
reed@google.com 2012-11-27 21:11:05 +00:00
parent 68d6bb0c11
commit e2f8c7c876

View File

@ -9,6 +9,22 @@
#include "SkCanvas.h"
#include "SkPath.h"
// Reproduces bug found here: http://jsfiddle.net/R8Cu5/1/
//
#include "SkGradientShader.h"
static void test_grad(SkCanvas* canvas) {
SkPoint pts[] = {
{ 478.544067f, -84.2041016f },
{ 602.455933f, 625.204102f },
};
SkColor colors[] = { SK_ColorBLACK, SK_ColorBLACK, SK_ColorRED, SK_ColorRED };
SkScalar pos[] = { 0, 0.3f, 0.3f, 1.0f };
SkShader* s = SkGradientShader::CreateLinear(pts, colors, pos, 4, SkShader::kClamp_TileMode);
SkPaint p;
p.setShader(s)->unref();
canvas->drawPaint(p);
}
static SkCanvas* MakeCanvas(const SkIRect& bounds) {
SkBitmap bm;
bm.setConfig(SkBitmap::kARGB_8888_Config, bounds.width(), bounds.height());
@ -158,6 +174,9 @@ protected:
}
virtual void onDraw(SkCanvas* canvas) {
if (false) {
test_grad(canvas); return;
}
if (false) { // avoid bit rot, suppress warning
test_mask();
}