fix and test colorfiltershader
Bug: skia:
Change-Id: I02fd77796880b42ce55549a8340b116e1c5f19d6
Reviewed-on: https://skia-review.googlesource.com/18305
Commit-Queue: Mike Reed <reed@google.com>
Commit-Queue: Mike Klein <mtklein@chromium.org>
Reviewed-by: Mike Klein <mtklein@chromium.org>
diff --git a/gm/colorfilterimagefilter.cpp b/gm/colorfilterimagefilter.cpp
index a2e20d3..5ef6379 100644
--- a/gm/colorfilterimagefilter.cpp
+++ b/gm/colorfilterimagefilter.cpp
@@ -186,18 +186,24 @@
///////////////////////////////////////////////////////////////////////////////////////////////////
+#include "SkGradientShader.h"
template <typename T> class SkTRefArray : public SkTDArray<T> {
public:
~SkTRefArray() { this->unrefAll(); }
};
-DEF_SIMPLE_GM(colorfiltershader, canvas, 610, 450) {
+DEF_SIMPLE_GM(colorfiltershader, canvas, 610, 610) {
SkTArray<sk_sp<SkColorFilter>> filters;
sk_gm_get_colorfilters(&filters);
SkTRefArray<SkShader*> shaders;
sk_gm_get_shaders(&shaders);
+ const SkColor colors[] = { SK_ColorRED, SK_ColorBLUE };
+ *shaders.append() = SkGradientShader::MakeTwoPointConical({0, 0}, 50, {0, 0}, 150,
+ colors, nullptr, 2,
+ SkShader::kClamp_TileMode).release();
+
SkPaint paint;
SkRect r = SkRect::MakeWH(120, 120);