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

Side by Side 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, 2 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 unified diff | Download patch
« no previous file with comments | « no previous file | src/pdf/SkPDFDevice.cpp » ('j') | src/pdf/SkPDFDevice.cpp » ('J')
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright 2012 Google Inc. 2 * Copyright 2012 Google Inc.
3 * 3 *
4 * Use of this source code is governed by a BSD-style license that can be 4 * Use of this source code is governed by a BSD-style license that can be
5 * found in the LICENSE file. 5 * found in the LICENSE file.
6 */ 6 */
7 7
8 #include "gm.h" 8 #include "gm.h"
9 #include "SkCanvas.h" 9 #include "SkCanvas.h"
10 #include "SkColorMatrixFilter.h" 10 #include "SkColorMatrixFilter.h"
(...skipping 99 matching lines...) Expand 10 before | Expand all | Expand 10 after
110 drawClippedRect(canvas, r, paint, 3); 110 drawClippedRect(canvas, r, paint, 3);
111 canvas->translate(FILTER_WIDTH + MARGIN, 0); 111 canvas->translate(FILTER_WIDTH + MARGIN, 0);
112 } 112 }
113 { 113 {
114 SkAutoTUnref<SkImageFilter> blue(make_mode_blue()); 114 SkAutoTUnref<SkImageFilter> blue(make_mode_blue());
115 paint.setImageFilter(blue.get()); 115 paint.setImageFilter(blue.get());
116 drawClippedRect(canvas, r, paint, 5); 116 drawClippedRect(canvas, r, paint, 5);
117 canvas->translate(FILTER_WIDTH + MARGIN, 0); 117 canvas->translate(FILTER_WIDTH + MARGIN, 0);
118 } 118 }
119 } 119 }
120
121 DEF_SIMPLE_GM(colorfilterimagefilter_layer, canvas, 32, 32) {
122 SkAutoCanvasRestore autoCanvasRestore(canvas, false);
123 SkColorMatrix cm;
124 cm.setSaturation(0.0f);
125 SkAutoTUnref<SkColorFilter> cf(SkColorMatrixFilter::Create(cm));
126 SkAutoTUnref<SkImageFilter> imf(SkColorFilterImageFilter::Create(cf));
127 SkPaint p;
128 p.setImageFilter(imf);
129 canvas->saveLayer(NULL, &p);
130 canvas->clear(SK_ColorRED);
131 }
OLDNEW
« 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