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

Side by Side Diff: samplecode/SamplePatch.cpp

Issue 147683003: fix more 64bit warnings (Closed) Base URL: https://skia.googlecode.com/svn/trunk
Patch Set: Created 6 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 | Annotate | Revision Log
« no previous file with comments | « samplecode/SampleHairline.cpp ('k') | samplecode/SampleRegion.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 296 matching lines...) Expand 10 before | Expand all | Expand 10 after
307 }; 307 };
308 308
309 static bool hittest(const SkPoint& pt, SkScalar x, SkScalar y) { 309 static bool hittest(const SkPoint& pt, SkScalar x, SkScalar y) {
310 return SkPoint::Length(pt.fX - x, pt.fY - y) < SkIntToScalar(5); 310 return SkPoint::Length(pt.fX - x, pt.fY - y) < SkIntToScalar(5);
311 } 311 }
312 312
313 virtual SkView::Click* onFindClickHandler(SkScalar x, SkScalar y, 313 virtual SkView::Click* onFindClickHandler(SkScalar x, SkScalar y,
314 unsigned modi) SK_OVERRIDE { 314 unsigned modi) SK_OVERRIDE {
315 for (size_t i = 0; i < SK_ARRAY_COUNT(fPts); i++) { 315 for (size_t i = 0; i < SK_ARRAY_COUNT(fPts); i++) {
316 if (hittest(fPts[i], x, y)) { 316 if (hittest(fPts[i], x, y)) {
317 return new PtClick(this, i); 317 return new PtClick(this, (int)i);
318 } 318 }
319 } 319 }
320 return this->INHERITED::onFindClickHandler(x, y, modi); 320 return this->INHERITED::onFindClickHandler(x, y, modi);
321 } 321 }
322 322
323 virtual bool onClick(Click* click) { 323 virtual bool onClick(Click* click) {
324 fPts[((PtClick*)click)->fIndex].set(click->fCurr.fX, click->fCurr.fY); 324 fPts[((PtClick*)click)->fIndex].set(click->fCurr.fX, click->fCurr.fY);
325 this->inval(NULL); 325 this->inval(NULL);
326 return true; 326 return true;
327 } 327 }
328 328
329 private: 329 private:
330 typedef SampleView INHERITED; 330 typedef SampleView INHERITED;
331 }; 331 };
332 332
333 ////////////////////////////////////////////////////////////////////////////// 333 //////////////////////////////////////////////////////////////////////////////
334 334
335 static SkView* MyFactory() { return new PatchView; } 335 static SkView* MyFactory() { return new PatchView; }
336 static SkViewRegister reg(MyFactory); 336 static SkViewRegister reg(MyFactory);
OLDNEW
« no previous file with comments | « samplecode/SampleHairline.cpp ('k') | samplecode/SampleRegion.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698