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

Side by Side Diff: gm/xfermodes.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 | « gm/shadertext3.cpp ('k') | gm/xfermodes2.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 /* 2 /*
3 * Copyright 2011 Google Inc. 3 * Copyright 2011 Google Inc.
4 * 4 *
5 * Use of this source code is governed by a BSD-style license that can be 5 * Use of this source code is governed by a BSD-style license that can be
6 * found in the LICENSE file. 6 * found in the LICENSE file.
7 */ 7 */
8 #include "gm.h" 8 #include "gm.h"
9 #include "SkBitmap.h" 9 #include "SkBitmap.h"
10 #include "SkShader.h" 10 #include "SkShader.h"
(...skipping 198 matching lines...) Expand 10 before | Expand all | Expand 10 after
209 { SkXfermode::kExclusion_Mode, "Exclusion", kBasic_SrcType }, 209 { SkXfermode::kExclusion_Mode, "Exclusion", kBasic_SrcType },
210 { SkXfermode::kMultiply_Mode, "Multiply", kAll_SrcType }, 210 { SkXfermode::kMultiply_Mode, "Multiply", kAll_SrcType },
211 { SkXfermode::kHue_Mode, "Hue", kBasic_SrcType }, 211 { SkXfermode::kHue_Mode, "Hue", kBasic_SrcType },
212 { SkXfermode::kSaturation_Mode, "Saturation", kBasic_SrcType }, 212 { SkXfermode::kSaturation_Mode, "Saturation", kBasic_SrcType },
213 { SkXfermode::kColor_Mode, "Color", kBasic_SrcType }, 213 { SkXfermode::kColor_Mode, "Color", kBasic_SrcType },
214 { SkXfermode::kLuminosity_Mode, "Luminosity", kBasic_SrcType }, 214 { SkXfermode::kLuminosity_Mode, "Luminosity", kBasic_SrcType },
215 }; 215 };
216 216
217 const SkScalar w = SkIntToScalar(W); 217 const SkScalar w = SkIntToScalar(W);
218 const SkScalar h = SkIntToScalar(H); 218 const SkScalar h = SkIntToScalar(H);
219 SkMatrix m;
220 m.setScale(SkIntToScalar(6), SkIntToScalar(6));
219 SkShader* s = SkShader::CreateBitmapShader(fBG, 221 SkShader* s = SkShader::CreateBitmapShader(fBG,
220 SkShader::kRepeat_TileMode, 222 SkShader::kRepeat_TileMode,
221 SkShader::kRepeat_TileMode); 223 SkShader::kRepeat_TileMode,
222 SkMatrix m; 224 &m);
223 m.setScale(SkIntToScalar(6), SkIntToScalar(6));
224 s->setLocalMatrix(m);
225 225
226 SkPaint labelP; 226 SkPaint labelP;
227 labelP.setAntiAlias(true); 227 labelP.setAntiAlias(true);
228 labelP.setTextAlign(SkPaint::kCenter_Align); 228 labelP.setTextAlign(SkPaint::kCenter_Align);
229 229
230 const int W = 5; 230 const int W = 5;
231 231
232 SkScalar x0 = 0; 232 SkScalar x0 = 0;
233 SkScalar y0 = 0; 233 SkScalar y0 = 0;
234 for (int sourceType = 1; sourceType & kAll_SrcType; sourceType <<= 1) { 234 for (int sourceType = 1; sourceType & kAll_SrcType; sourceType <<= 1) {
(...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after
283 private: 283 private:
284 typedef GM INHERITED; 284 typedef GM INHERITED;
285 }; 285 };
286 286
287 ////////////////////////////////////////////////////////////////////////////// 287 //////////////////////////////////////////////////////////////////////////////
288 288
289 static GM* MyFactory(void*) { return new XfermodesGM; } 289 static GM* MyFactory(void*) { return new XfermodesGM; }
290 static GMRegistry reg(MyFactory); 290 static GMRegistry reg(MyFactory);
291 291
292 } 292 }
OLDNEW
« no previous file with comments | « gm/shadertext3.cpp ('k') | gm/xfermodes2.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698