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

Side by Side Diff: gm/imagefiltersgraph.cpp

Issue 1316233002: Style Change: NULL->nullptr (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: 2015-08-27 (Thursday) 10:25:06 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 unified diff | Download patch
« no previous file with comments | « gm/imagefilterscropped.cpp ('k') | gm/imagefiltersscaled.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 176 matching lines...) Expand 10 before | Expand all | Expand 10 after
187 drawClippedBitmap(canvas, fBitmap, paint); 187 drawClippedBitmap(canvas, fBitmap, paint);
188 canvas->translate(SkIntToScalar(100), 0); 188 canvas->translate(SkIntToScalar(100), 0);
189 } 189 }
190 { 190 {
191 SkAutoTUnref<SkImageFilter> blur(SkBlurImageFilter::Create( 191 SkAutoTUnref<SkImageFilter> blur(SkBlurImageFilter::Create(
192 SkIntToScalar(10), SkIntToScalar(10))); 192 SkIntToScalar(10), SkIntToScalar(10)));
193 193
194 SkAutoTUnref<SkXfermode> mode(SkXfermode::Create(SkXfermode::kSrcIn_ Mode)); 194 SkAutoTUnref<SkXfermode> mode(SkXfermode::Create(SkXfermode::kSrcIn_ Mode));
195 SkImageFilter::CropRect cropRect(SkRect::MakeWH(SkIntToScalar(95), S kIntToScalar(100))); 195 SkImageFilter::CropRect cropRect(SkRect::MakeWH(SkIntToScalar(95), S kIntToScalar(100)));
196 SkAutoTUnref<SkImageFilter> blend( 196 SkAutoTUnref<SkImageFilter> blend(
197 SkXfermodeImageFilter::Create(mode, blur, NULL, &cropRect)); 197 SkXfermodeImageFilter::Create(mode, blur, nullptr, &cropRect));
198 198
199 SkPaint paint; 199 SkPaint paint;
200 paint.setImageFilter(blend); 200 paint.setImageFilter(blend);
201 drawClippedBitmap(canvas, fBitmap, paint); 201 drawClippedBitmap(canvas, fBitmap, paint);
202 canvas->translate(SkIntToScalar(100), 0); 202 canvas->translate(SkIntToScalar(100), 0);
203 } 203 }
204 { 204 {
205 // Test that crop offsets are absolute, not relative to the parent's crop rect. 205 // Test that crop offsets are absolute, not relative to the parent's crop rect.
206 SkAutoTUnref<SkColorFilter> cf1(SkColorFilter::CreateModeFilter(SK_C olorBLUE, 206 SkAutoTUnref<SkColorFilter> cf1(SkColorFilter::CreateModeFilter(SK_C olorBLUE,
207 SkXf ermode::kSrcIn_Mode)); 207 SkXf ermode::kSrcIn_Mode));
208 SkAutoTUnref<SkColorFilter> cf2(SkColorFilter::CreateModeFilter(SK_C olorGREEN, 208 SkAutoTUnref<SkColorFilter> cf2(SkColorFilter::CreateModeFilter(SK_C olorGREEN,
209 SkXf ermode::kSrcIn_Mode)); 209 SkXf ermode::kSrcIn_Mode));
210 SkImageFilter::CropRect outerRect(SkRect::MakeXYWH(SkIntToScalar(10) , SkIntToScalar(10), 210 SkImageFilter::CropRect outerRect(SkRect::MakeXYWH(SkIntToScalar(10) , SkIntToScalar(10),
211 SkIntToScalar(80) , SkIntToScalar(80))); 211 SkIntToScalar(80) , SkIntToScalar(80)));
212 SkImageFilter::CropRect innerRect(SkRect::MakeXYWH(SkIntToScalar(20) , SkIntToScalar(20), 212 SkImageFilter::CropRect innerRect(SkRect::MakeXYWH(SkIntToScalar(20) , SkIntToScalar(20),
213 SkIntToScalar(60) , SkIntToScalar(60))); 213 SkIntToScalar(60) , SkIntToScalar(60)));
214 SkAutoTUnref<SkImageFilter> color1(SkColorFilterImageFilter::Create( cf1, NULL, &outerRect)); 214 SkAutoTUnref<SkImageFilter> color1(SkColorFilterImageFilter::Create( cf1, nullptr, &outerRect));
215 SkAutoTUnref<SkImageFilter> color2(SkColorFilterImageFilter::Create( cf2, color1, &innerRect)); 215 SkAutoTUnref<SkImageFilter> color2(SkColorFilterImageFilter::Create( cf2, color1, &innerRect));
216 216
217 SkPaint paint; 217 SkPaint paint;
218 paint.setImageFilter(color2); 218 paint.setImageFilter(color2);
219 paint.setColor(SK_ColorRED); 219 paint.setColor(SK_ColorRED);
220 canvas->drawRect(SkRect::MakeXYWH(0, 0, 100, 100), paint); 220 canvas->drawRect(SkRect::MakeXYWH(0, 0, 100, 100), paint);
221 canvas->translate(SkIntToScalar(100), 0); 221 canvas->translate(SkIntToScalar(100), 0);
222 } 222 }
223 } 223 }
224 224
225 private: 225 private:
226 typedef GM INHERITED; 226 typedef GM INHERITED;
227 SkBitmap fBitmap; 227 SkBitmap fBitmap;
228 }; 228 };
229 229
230 /////////////////////////////////////////////////////////////////////////////// 230 ///////////////////////////////////////////////////////////////////////////////
231 231
232 static skiagm::GM* MyFactory(void*) { return new ImageFiltersGraphGM; } 232 static skiagm::GM* MyFactory(void*) { return new ImageFiltersGraphGM; }
233 static skiagm::GMRegistry reg(MyFactory); 233 static skiagm::GMRegistry reg(MyFactory);
OLDNEW
« no previous file with comments | « gm/imagefilterscropped.cpp ('k') | gm/imagefiltersscaled.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698