Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(112)

Unified Diff: gm/fadefilter.cpp

Issue 1081173002: GM: add fadefilter gm (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 5 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | gyp/gmslides.gypi » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: gm/fadefilter.cpp
diff --git a/gm/fadefilter.cpp b/gm/fadefilter.cpp
new file mode 100644
index 0000000000000000000000000000000000000000..6f64e1e30e3d1e54df1ee32e0972bb8c97ba00fc
--- /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);
+}
« no previous file with comments | « no previous file | gyp/gmslides.gypi » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698