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

Side by Side Diff: gm/shadertext.cpp

Issue 933483002: add Method param to drawTextOnPath, supporting SVG spec Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: rebase Created 5 years, 10 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/bitmapscroll.cpp ('k') | gm/shadertext2.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 "gm.h" 8 #include "gm.h"
9 #include "SkCanvas.h" 9 #include "SkCanvas.h"
10 #include "SkGradientShader.h" 10 #include "SkGradientShader.h"
(...skipping 155 matching lines...) Expand 10 before | Expand all | Expand 10 after
166 int i = 2*s; 166 int i = 2*s;
167 canvas->translate(SkIntToScalar((i / testsPerCol) * colWidth), 167 canvas->translate(SkIntToScalar((i / testsPerCol) * colWidth),
168 SkIntToScalar((i % testsPerCol) * rowHeight)); 168 SkIntToScalar((i % testsPerCol) * rowHeight));
169 paint.setShader(shaders[s])->unref(); 169 paint.setShader(shaders[s])->unref();
170 canvas->drawText(text, textLen, 0, textBase, paint); 170 canvas->drawText(text, textLen, 0, textBase, paint);
171 canvas->restore(); 171 canvas->restore();
172 canvas->save(); 172 canvas->save();
173 ++i; 173 ++i;
174 canvas->translate(SkIntToScalar((i / testsPerCol) * colWidth), 174 canvas->translate(SkIntToScalar((i / testsPerCol) * colWidth),
175 SkIntToScalar((i % testsPerCol) * rowHeight)); 175 SkIntToScalar((i % testsPerCol) * rowHeight));
176 canvas->drawTextOnPath(text, textLen, path, NULL, paint); 176 canvas->drawTextOnPath(text, textLen, path, NULL,
177 SkCanvas::kStretch_TextOnPathMethod, paint);
177 canvas->restore(); 178 canvas->restore();
178 } 179 }
179 canvas->restore(); 180 canvas->restore();
180 181
181 } 182 }
182 183
183 private: 184 private:
184 typedef GM INHERITED; 185 typedef GM INHERITED;
185 }; 186 };
186 187
187 /////////////////////////////////////////////////////////////////////////////// 188 ///////////////////////////////////////////////////////////////////////////////
188 189
189 static GM* MyFactory(void*) { return new ShaderTextGM; } 190 static GM* MyFactory(void*) { return new ShaderTextGM; }
190 static GMRegistry reg(MyFactory); 191 static GMRegistry reg(MyFactory);
191 } 192 }
OLDNEW
« no previous file with comments | « gm/bitmapscroll.cpp ('k') | gm/shadertext2.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698