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

Side by Side Diff: gm/perlinnoise.cpp

Issue 1553743002: change factory to method, to parallel pattern in imagefilters (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 4 years, 11 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 | « no previous file | include/core/SkShader.h » ('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 "gm.h" 8 #include "gm.h"
9 #include "SkPerlinNoiseShader.h" 9 #include "SkPerlinNoiseShader.h"
10 10
(...skipping 136 matching lines...) Expand 10 before | Expand all | Expand 10 after
147 canvas->drawRect(r, paint); 147 canvas->drawRect(r, paint);
148 canvas->restore(); 148 canvas->restore();
149 149
150 // The next row should draw the same as the previous, even though we are using a local 150 // The next row should draw the same as the previous, even though we are using a local
151 // matrix instead of the canvas. 151 // matrix instead of the canvas.
152 152
153 canvas->translate(0, h * 2 + 10); 153 canvas->translate(0, h * 2 + 10);
154 154
155 SkMatrix lm; 155 SkMatrix lm;
156 lm.setScale(2, 2); 156 lm.setScale(2, 2);
157 paint.setShader(SkShader::CreateLocalMatrixShader(paint.getShader(), lm) )->unref(); 157 paint.setShader(paint.getShader()->newWithLocalMatrix(lm))->unref();
158 r.fRight += r.width(); 158 r.fRight += r.width();
159 r.fBottom += r.height(); 159 r.fBottom += r.height();
160 160
161 canvas->save(); 161 canvas->save();
162 canvas->translate(0, h + 10); 162 canvas->translate(0, h + 10);
163 canvas->drawRect(r, paint); 163 canvas->drawRect(r, paint);
164 canvas->restore(); 164 canvas->restore();
165 165
166 canvas->save(); 166 canvas->save();
167 canvas->translate(w + 100, h + 10); 167 canvas->translate(w + 100, h + 10);
168 canvas->drawRect(r, paint); 168 canvas->drawRect(r, paint);
169 canvas->restore(); 169 canvas->restore();
170 } 170 }
171 171
172 private: 172 private:
173 typedef GM INHERITED; 173 typedef GM INHERITED;
174 SkISize fSize; 174 SkISize fSize;
175 }; 175 };
176 176
177 ////////////////////////////////////////////////////////////////////////////// 177 //////////////////////////////////////////////////////////////////////////////
178 178
179 DEF_GM( return new PerlinNoiseGM; ) 179 DEF_GM( return new PerlinNoiseGM; )
180 DEF_GM( return new PerlinNoiseGM2; ) 180 DEF_GM( return new PerlinNoiseGM2; )
OLDNEW
« no previous file with comments | « no previous file | include/core/SkShader.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698