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

Side by Side Diff: samplecode/SampleXfermodesBlur.cpp

Issue 245963010: Move SkShader::fLocalMatrix into SkShader constructor. (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: nit Created 6 years, 7 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 | « samplecode/SampleLayers.cpp ('k') | src/animator/SkDrawGradient.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 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 133 matching lines...) Expand 10 before | Expand all | Expand 10 after
144 { SkXfermode::kColorDodge_Mode, "ColorDodge" }, 144 { SkXfermode::kColorDodge_Mode, "ColorDodge" },
145 { SkXfermode::kColorBurn_Mode, "ColorBurn" }, 145 { SkXfermode::kColorBurn_Mode, "ColorBurn" },
146 { SkXfermode::kHardLight_Mode, "HardLight" }, 146 { SkXfermode::kHardLight_Mode, "HardLight" },
147 { SkXfermode::kSoftLight_Mode, "SoftLight" }, 147 { SkXfermode::kSoftLight_Mode, "SoftLight" },
148 { SkXfermode::kDifference_Mode, "Difference" }, 148 { SkXfermode::kDifference_Mode, "Difference" },
149 { SkXfermode::kExclusion_Mode, "Exclusion" },*/ 149 { SkXfermode::kExclusion_Mode, "Exclusion" },*/
150 }; 150 };
151 151
152 const SkScalar w = SkIntToScalar(W); 152 const SkScalar w = SkIntToScalar(W);
153 const SkScalar h = SkIntToScalar(H); 153 const SkScalar h = SkIntToScalar(H);
154 SkMatrix m;
155 m.setScale(SkIntToScalar(6), SkIntToScalar(6));
154 SkShader* s = SkShader::CreateBitmapShader(fBG, 156 SkShader* s = SkShader::CreateBitmapShader(fBG,
155 SkShader::kRepeat_TileMode, 157 SkShader::kRepeat_TileMode,
156 SkShader::kRepeat_TileMode); 158 SkShader::kRepeat_TileMode,
157 SkMatrix m; 159 &m);
158 m.setScale(SkIntToScalar(6), SkIntToScalar(6));
159 s->setLocalMatrix(m);
160 160
161 SkPaint labelP; 161 SkPaint labelP;
162 labelP.setAntiAlias(true); 162 labelP.setAntiAlias(true);
163 labelP.setLCDRenderText(true); 163 labelP.setLCDRenderText(true);
164 labelP.setTextAlign(SkPaint::kCenter_Align); 164 labelP.setTextAlign(SkPaint::kCenter_Align);
165 setNamedTypeface(&labelP, "Menlo Regular"); 165 setNamedTypeface(&labelP, "Menlo Regular");
166 166
167 const int W = 5; 167 const int W = 5;
168 168
169 SkScalar x0 = 0; 169 SkScalar x0 = 0;
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after
203 } 203 }
204 204
205 private: 205 private:
206 typedef SampleView INHERITED; 206 typedef SampleView INHERITED;
207 }; 207 };
208 208
209 ////////////////////////////////////////////////////////////////////////////// 209 //////////////////////////////////////////////////////////////////////////////
210 210
211 static SkView* MyFactory() { return new XfermodesBlurView; } 211 static SkView* MyFactory() { return new XfermodesBlurView; }
212 static SkViewRegister reg(MyFactory); 212 static SkViewRegister reg(MyFactory);
OLDNEW
« no previous file with comments | « samplecode/SampleLayers.cpp ('k') | src/animator/SkDrawGradient.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698