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

Side by Side Diff: samplecode/SampleXfermodesBlur.cpp

Issue 1772463002: use Make instead of Create to return a shared shader (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: partial update of skia call-sites 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
OLDNEW
1 /* 1 /*
2 * Copyright 2011 Google Inc. 2 * Copyright 2011 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 "SampleCode.h" 8 #include "SampleCode.h"
9 #include "SkView.h" 9 #include "SkView.h"
10 #include "SkBlurMask.h" 10 #include "SkBlurMask.h"
(...skipping 132 matching lines...) Expand 10 before | Expand all | Expand 10 after
143 { SkXfermode::kHardLight_Mode, "HardLight" }, 143 { SkXfermode::kHardLight_Mode, "HardLight" },
144 { SkXfermode::kSoftLight_Mode, "SoftLight" }, 144 { SkXfermode::kSoftLight_Mode, "SoftLight" },
145 { SkXfermode::kDifference_Mode, "Difference" }, 145 { SkXfermode::kDifference_Mode, "Difference" },
146 { SkXfermode::kExclusion_Mode, "Exclusion" },*/ 146 { SkXfermode::kExclusion_Mode, "Exclusion" },*/
147 }; 147 };
148 148
149 const SkScalar w = SkIntToScalar(W); 149 const SkScalar w = SkIntToScalar(W);
150 const SkScalar h = SkIntToScalar(H); 150 const SkScalar h = SkIntToScalar(H);
151 SkMatrix m; 151 SkMatrix m;
152 m.setScale(SkIntToScalar(6), SkIntToScalar(6)); 152 m.setScale(SkIntToScalar(6), SkIntToScalar(6));
153 SkShader* s = SkShader::CreateBitmapShader(fBG, 153 auto s = SkShader::MakeBitmapShader(fBG, SkShader::kRepeat_TileMode,
154 SkShader::kRepeat_TileMode, 154 SkShader::kRepeat_TileMode, &m);
155 SkShader::kRepeat_TileMode,
156 &m);
157 155
158 SkPaint labelP; 156 SkPaint labelP;
159 labelP.setAntiAlias(true); 157 labelP.setAntiAlias(true);
160 labelP.setLCDRenderText(true); 158 labelP.setLCDRenderText(true);
161 labelP.setTextAlign(SkPaint::kCenter_Align); 159 labelP.setTextAlign(SkPaint::kCenter_Align);
162 setNamedTypeface(&labelP, "Menlo Regular"); 160 setNamedTypeface(&labelP, "Menlo Regular");
163 161
164 const int W = 5; 162 const int W = 5;
165 163
166 SkScalar x0 = 0; 164 SkScalar x0 = 0;
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after
200 } 198 }
201 199
202 private: 200 private:
203 typedef SampleView INHERITED; 201 typedef SampleView INHERITED;
204 }; 202 };
205 203
206 ////////////////////////////////////////////////////////////////////////////// 204 //////////////////////////////////////////////////////////////////////////////
207 205
208 static SkView* MyFactory() { return new XfermodesBlurView; } 206 static SkView* MyFactory() { return new XfermodesBlurView; }
209 static SkViewRegister reg(MyFactory); 207 static SkViewRegister reg(MyFactory);
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698