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

Side by Side Diff: gm/imagefiltersgraph.cpp

Issue 1535353002: change all factories to return their base-class (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 5 years 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/circles.cpp ('k') | gm/rects.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 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 9
10 #include "SkArithmeticMode.h" 10 #include "SkArithmeticMode.h"
(...skipping 135 matching lines...) Expand 10 before | Expand all | Expand 10 after
146 SkPaint paint; 146 SkPaint paint;
147 paint.setImageFilter(blendColor); 147 paint.setImageFilter(blendColor);
148 DrawClippedImage(canvas, fImage, paint); 148 DrawClippedImage(canvas, fImage, paint);
149 canvas->translate(SkIntToScalar(100), 0); 149 canvas->translate(SkIntToScalar(100), 0);
150 } 150 }
151 { 151 {
152 SkScalar matrix[20] = { SK_Scalar1, 0, 0, 0, 0, 152 SkScalar matrix[20] = { SK_Scalar1, 0, 0, 0, 0,
153 0, SK_Scalar1, 0, 0, 0, 153 0, SK_Scalar1, 0, 0, 0,
154 0, 0, SK_Scalar1, 0, 0, 154 0, 0, SK_Scalar1, 0, 0,
155 0, 0, 0, 0.5f, 0 }; 155 0, 0, 0, 0.5f, 0 };
156 SkAutoTUnref<SkColorMatrixFilter> matrixCF(SkColorMatrixFilter::Crea te(matrix)); 156 SkAutoTUnref<SkColorFilter> matrixCF(SkColorMatrixFilter::Create(mat rix));
157 SkAutoTUnref<SkImageFilter> matrixFilter(SkColorFilterImageFilter::C reate(matrixCF)); 157 SkAutoTUnref<SkImageFilter> matrixFilter(SkColorFilterImageFilter::C reate(matrixCF));
158 SkAutoTUnref<SkImageFilter> offsetFilter( 158 SkAutoTUnref<SkImageFilter> offsetFilter(
159 SimpleOffsetFilter::Create(10.0f, 10.f, matrixFilter)); 159 SimpleOffsetFilter::Create(10.0f, 10.f, matrixFilter));
160 160
161 SkAutoTUnref<SkXfermode> arith(SkArithmeticMode::Create(0, SK_Scalar 1, SK_Scalar1, 0)); 161 SkAutoTUnref<SkXfermode> arith(SkArithmeticMode::Create(0, SK_Scalar 1, SK_Scalar1, 0));
162 SkAutoTUnref<SkXfermodeImageFilter> arithFilter( 162 SkAutoTUnref<SkImageFilter> arithFilter(
163 SkXfermodeImageFilter::Create(arith, matrixFilter, offsetFilter) ); 163 SkXfermodeImageFilter::Create(arith, matrixFilter, offsetFilter) );
164 164
165 SkPaint paint; 165 SkPaint paint;
166 paint.setImageFilter(arithFilter); 166 paint.setImageFilter(arithFilter);
167 DrawClippedImage(canvas, fImage, paint); 167 DrawClippedImage(canvas, fImage, paint);
168 canvas->translate(SkIntToScalar(100), 0); 168 canvas->translate(SkIntToScalar(100), 0);
169 } 169 }
170 { 170 {
171 SkAutoTUnref<SkImageFilter> blur(SkBlurImageFilter::Create( 171 SkAutoTUnref<SkImageFilter> blur(SkBlurImageFilter::Create(
172 SkIntToScalar(10), SkIntToScalar(10))); 172 SkIntToScalar(10), SkIntToScalar(10)));
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after
211 } 211 }
212 212
213 SkAutoTUnref<SkImage> fImage; 213 SkAutoTUnref<SkImage> fImage;
214 214
215 typedef GM INHERITED; 215 typedef GM INHERITED;
216 }; 216 };
217 217
218 /////////////////////////////////////////////////////////////////////////////// 218 ///////////////////////////////////////////////////////////////////////////////
219 219
220 DEF_GM(return new ImageFiltersGraphGM;) 220 DEF_GM(return new ImageFiltersGraphGM;)
OLDNEW
« no previous file with comments | « gm/circles.cpp ('k') | gm/rects.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698