aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorGravatar halcanary <halcanary@google.com>2015-04-14 06:25:19 -0700
committerGravatar Commit bot <commit-bot@chromium.org>2015-04-14 06:25:19 -0700
commit86e5ab633865be3336ca266bd60131832cd8ab28 (patch)
treec98035ee5f31a6670efba6c43e2a8fed2c0cf651
parent30ac464d4845ef6566c436de9bc3404f097da942 (diff)
GM: add fadefilter gm
-rw-r--r--gm/fadefilter.cpp25
-rw-r--r--gyp/gmslides.gypi1
2 files changed, 26 insertions, 0 deletions
diff --git a/gm/fadefilter.cpp b/gm/fadefilter.cpp
new file mode 100644
index 0000000000..6f64e1e30e
--- /dev/null
+++ b/gm/fadefilter.cpp
@@ -0,0 +1,25 @@
+/*
+ * Copyright 2015 Google Inc.
+ *
+ * Use of this source code is governed by a BSD-style license that can be
+ * found in the LICENSE file.
+ */
+
+#include "gm.h"
+#include "SkColorMatrixFilter.h"
+#include "SkColorFilterImageFilter.h"
+
+// This GM renders correctly in 8888, but fails in PDF
+DEF_SIMPLE_GM(fadefilter, canvas, 256, 256) {
+ SkScalar matrix[20] = { 1, 0, 0, 0, 128.0f,
+ 0, 1, 0, 0, 128.0f,
+ 0, 0, 1, 0, 128.0f,
+ 0, 0, 0, 1, 0 };
+ SkAutoTUnref<SkColorFilter> colorFilter(
+ SkColorMatrixFilter::Create(matrix));
+ SkAutoTUnref<SkImageFilter> filter(
+ SkColorFilterImageFilter::Create(colorFilter));
+ SkPaint layerPaint;
+ layerPaint.setImageFilter(filter);
+ canvas->drawRect(SkRect::MakeLTRB(64, 64, 192, 192), layerPaint);
+}
diff --git a/gyp/gmslides.gypi b/gyp/gmslides.gypi
index 0694e4bf41..d2db10690b 100644
--- a/gyp/gmslides.gypi
+++ b/gyp/gmslides.gypi
@@ -93,6 +93,7 @@
'../gm/extractbitmap.cpp',
'../gm/emboss.cpp',
'../gm/emptypath.cpp',
+ '../gm/fadefilter.cpp',
'../gm/fatpathfill.cpp',
'../gm/factory.cpp',
'../gm/filltypes.cpp',