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

Unified Diff: gm/colorfilterimagefilter.cpp

Issue 1367993002: SkPDF Implement colorfilters on bitmaps (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: 2015-09-24 (Thursday) 13:13:56 EDT Created 5 years, 3 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 | src/pdf/SkPDFDevice.cpp » ('j') | src/pdf/SkPDFDevice.cpp » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: gm/colorfilterimagefilter.cpp
diff --git a/gm/colorfilterimagefilter.cpp b/gm/colorfilterimagefilter.cpp
index fb5b0d4067fc72523b7cf5af542b09478fed0560..efcd9b336df1e880480009187e103e17a056dc06 100644
--- a/gm/colorfilterimagefilter.cpp
+++ b/gm/colorfilterimagefilter.cpp
@@ -117,3 +117,15 @@ DEF_SIMPLE_GM(colorfilterimagefilter, canvas, 400, 100){
canvas->translate(FILTER_WIDTH + MARGIN, 0);
}
}
+
+DEF_SIMPLE_GM(colorfilterimagefilter_layer, canvas, 32, 32) {
+ SkAutoCanvasRestore autoCanvasRestore(canvas, false);
+ SkColorMatrix cm;
+ cm.setSaturation(0.0f);
+ SkAutoTUnref<SkColorFilter> cf(SkColorMatrixFilter::Create(cm));
+ SkAutoTUnref<SkImageFilter> imf(SkColorFilterImageFilter::Create(cf));
+ SkPaint p;
+ p.setImageFilter(imf);
+ canvas->saveLayer(NULL, &p);
+ canvas->clear(SK_ColorRED);
+}
« no previous file with comments | « no previous file | src/pdf/SkPDFDevice.cpp » ('j') | src/pdf/SkPDFDevice.cpp » ('J')

Powered by Google App Engine
This is Rietveld 408576698