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

Side by Side Diff: gm/tileimagefilter.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/texturedomaineffect.cpp ('k') | gm/tilemodes.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 2013 Google Inc. 2 * Copyright 2013 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 "sk_tool_utils.h" 8 #include "sk_tool_utils.h"
9 #include "SkBitmapSource.h" 9 #include "SkBitmapSource.h"
10 #include "SkColorFilterImageFilter.h" 10 #include "SkColorFilterImageFilter.h"
(...skipping 80 matching lines...) Expand 10 before | Expand all | Expand 10 after
91 91
92 SkScalar matrix[20] = { SK_Scalar1, 0, 0, 0, 0, 92 SkScalar matrix[20] = { SK_Scalar1, 0, 0, 0, 0,
93 0, SK_Scalar1, 0, 0, 0, 93 0, SK_Scalar1, 0, 0, 0,
94 0, 0, SK_Scalar1, 0, 0, 94 0, 0, SK_Scalar1, 0, 0,
95 0, 0, 0, SK_Scalar1, 0 }; 95 0, 0, 0, SK_Scalar1, 0 };
96 96
97 SkRect srcRect = SkRect::MakeWH(SkIntToScalar(fBitmap.width()), 97 SkRect srcRect = SkRect::MakeWH(SkIntToScalar(fBitmap.width()),
98 SkIntToScalar(fBitmap.height())); 98 SkIntToScalar(fBitmap.height()));
99 SkRect dstRect = SkRect::MakeWH(SkIntToScalar(fBitmap.width() * 2), 99 SkRect dstRect = SkRect::MakeWH(SkIntToScalar(fBitmap.width() * 2),
100 SkIntToScalar(fBitmap.height() * 2)); 100 SkIntToScalar(fBitmap.height() * 2));
101 SkAutoTUnref<SkImageFilter> tile(SkTileImageFilter::Create(srcRect, dstR ect, NULL)); 101 SkAutoTUnref<SkImageFilter> tile(SkTileImageFilter::Create(srcRect, dstR ect, nullptr));
102 SkAutoTUnref<SkColorFilter> cf(SkColorMatrixFilter::Create(matrix)); 102 SkAutoTUnref<SkColorFilter> cf(SkColorMatrixFilter::Create(matrix));
103 103
104 SkAutoTUnref<SkImageFilter> cfif(SkColorFilterImageFilter::Create(cf, ti le.get())); 104 SkAutoTUnref<SkImageFilter> cfif(SkColorFilterImageFilter::Create(cf, ti le.get()));
105 SkPaint paint; 105 SkPaint paint;
106 paint.setImageFilter(cfif); 106 paint.setImageFilter(cfif);
107 canvas->save(); 107 canvas->save();
108 canvas->translate(SkIntToScalar(x), SkIntToScalar(y)); 108 canvas->translate(SkIntToScalar(x), SkIntToScalar(y));
109 canvas->clipRect(dstRect); 109 canvas->clipRect(dstRect);
110 canvas->saveLayer(&dstRect, &paint); 110 canvas->saveLayer(&dstRect, &paint);
111 canvas->drawBitmap(fBitmap, 0, 0); 111 canvas->drawBitmap(fBitmap, 0, 0);
112 canvas->restore(); 112 canvas->restore();
113 canvas->restore(); 113 canvas->restore();
114 } 114 }
115 private: 115 private:
116 SkBitmap fBitmap; 116 SkBitmap fBitmap;
117 SkBitmap fCheckerboard; 117 SkBitmap fCheckerboard;
118 118
119 typedef GM INHERITED; 119 typedef GM INHERITED;
120 }; 120 };
121 121
122 ////////////////////////////////////////////////////////////////////////////// 122 //////////////////////////////////////////////////////////////////////////////
123 123
124 DEF_GM(return new TileImageFilterGM;) 124 DEF_GM(return new TileImageFilterGM;)
125 } 125 }
OLDNEW
« no previous file with comments | « gm/texturedomaineffect.cpp ('k') | gm/tilemodes.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698