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

Side by Side Diff: gm/fadefilter.cpp

Issue 1821103004: Revert of Revert[2] of "switch colorfilters to sk_sp (patchset #11 id:200001 of https://codereview.chromium.o… (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 4 years, 9 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 | « gm/emboss.cpp ('k') | gm/imagefilters.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright 2015 Google Inc. 2 * Copyright 2015 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 "SkColorMatrixFilter.h" 9 #include "SkColorMatrixFilter.h"
10 #include "SkColorFilterImageFilter.h" 10 #include "SkColorFilterImageFilter.h"
11 11
12 // This GM renders correctly in 8888, but fails in PDF 12 // This GM renders correctly in 8888, but fails in PDF
13 DEF_SIMPLE_GM(fadefilter, canvas, 256, 256) { 13 DEF_SIMPLE_GM(fadefilter, canvas, 256, 256) {
14 SkScalar matrix[20] = { 1, 0, 0, 0, 128.0f, 14 SkScalar matrix[20] = { 1, 0, 0, 0, 128.0f,
15 0, 1, 0, 0, 128.0f, 15 0, 1, 0, 0, 128.0f,
16 0, 0, 1, 0, 128.0f, 16 0, 0, 1, 0, 128.0f,
17 0, 0, 0, 1, 0 }; 17 0, 0, 0, 1, 0 };
18 auto colorFilter(SkColorFilter::MakeMatrixFilterRowMajor255(matrix)); 18 SkAutoTUnref<SkColorFilter> colorFilter(
19 SkAutoTUnref<SkImageFilter> filter(SkColorFilterImageFilter::Create(colorFil ter.get())); 19 SkColorMatrixFilter::Create(matrix));
20 SkAutoTUnref<SkImageFilter> filter(
21 SkColorFilterImageFilter::Create(colorFilter));
20 SkPaint layerPaint; 22 SkPaint layerPaint;
21 layerPaint.setImageFilter(filter); 23 layerPaint.setImageFilter(filter);
22 canvas->drawRect(SkRect::MakeLTRB(64, 64, 192, 192), layerPaint); 24 canvas->drawRect(SkRect::MakeLTRB(64, 64, 192, 192), layerPaint);
23 } 25 }
OLDNEW
« no previous file with comments | « gm/emboss.cpp ('k') | gm/imagefilters.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698