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

Side by Side Diff: samplecode/SampleShaderText.cpp

Issue 147683003: fix more 64bit warnings (Closed) Base URL: https://skia.googlecode.com/svn/trunk
Patch Set: Created 6 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 | Annotate | Revision Log
« no previous file with comments | « samplecode/SampleRotateCircles.cpp ('k') | samplecode/SampleSlides.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 "SampleCode.h" 8 #include "SampleCode.h"
9 #include "SkView.h" 9 #include "SkView.h"
10 #include "SkCanvas.h" 10 #include "SkCanvas.h"
(...skipping 168 matching lines...) Expand 10 before | Expand all | Expand 10 after
179 SkIntToScalar(225), SkIntToScalar(90), 179 SkIntToScalar(225), SkIntToScalar(90),
180 false); 180 false);
181 path.close(); 181 path.close();
182 182
183 static const int testsPerCol = 8; 183 static const int testsPerCol = 8;
184 static const int rowHeight = 60; 184 static const int rowHeight = 60;
185 static const int colWidth = 300; 185 static const int colWidth = 300;
186 canvas->save(); 186 canvas->save();
187 for (size_t s = 0; s < SK_ARRAY_COUNT(shaders); s++) { 187 for (size_t s = 0; s < SK_ARRAY_COUNT(shaders); s++) {
188 canvas->save(); 188 canvas->save();
189 int i = 2*s; 189 size_t i = 2*s;
190 canvas->translate(SkIntToScalar((i / testsPerCol) * colWidth), 190 canvas->translate(SkIntToScalar((i / testsPerCol) * colWidth),
191 SkIntToScalar((i % testsPerCol) * rowHeight)); 191 SkIntToScalar((i % testsPerCol) * rowHeight));
192 paint.setShader(shaders[s])->unref(); 192 paint.setShader(shaders[s])->unref();
193 canvas->drawText(text, textLen, 0, textBase, paint); 193 canvas->drawText(text, textLen, 0, textBase, paint);
194 canvas->restore(); 194 canvas->restore();
195 canvas->save(); 195 canvas->save();
196 ++i; 196 ++i;
197 canvas->translate(SkIntToScalar((i / testsPerCol) * colWidth), 197 canvas->translate(SkIntToScalar((i / testsPerCol) * colWidth),
198 SkIntToScalar((i % testsPerCol) * rowHeight)); 198 SkIntToScalar((i % testsPerCol) * rowHeight));
199 canvas->drawTextOnPath(text, textLen, path, NULL, paint); 199 canvas->drawTextOnPath(text, textLen, path, NULL, paint);
200 canvas->restore(); 200 canvas->restore();
201 } 201 }
202 canvas->restore(); 202 canvas->restore();
203 203
204 canvas->translate(0, SkIntToScalar(370)); 204 canvas->translate(0, SkIntToScalar(370));
205 this->inval(NULL); 205 this->inval(NULL);
206 } 206 }
207 207
208 private: 208 private:
209 typedef SampleView INHERITED; 209 typedef SampleView INHERITED;
210 }; 210 };
211 211
212 /////////////////////////////////////////////////////////////////////////////// 212 ///////////////////////////////////////////////////////////////////////////////
213 213
214 static SkView* MyFactory() { return new ShaderTextView; } 214 static SkView* MyFactory() { return new ShaderTextView; }
215 static SkViewRegister reg(MyFactory); 215 static SkViewRegister reg(MyFactory);
OLDNEW
« no previous file with comments | « samplecode/SampleRotateCircles.cpp ('k') | samplecode/SampleSlides.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698