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

Side by Side Diff: samplecode/SampleRegion.cpp

Issue 111353003: deprecate SkScalarRound (and its ilk), use SkScalarRound[ToInt,ToScalar]. #define SK_SUPPORT_DEPREC… (Closed) Base URL: https://skia.googlecode.com/svn/trunk
Patch Set: Created 7 years 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/SampleLines.cpp ('k') | samplecode/SampleSkLayer.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 378 matching lines...) Expand 10 before | Expand all | Expand 10 after
389 canvas->translate(0, SkIntToScalar(200)); 389 canvas->translate(0, SkIntToScalar(200));
390 this->drawPathOped(canvas, gOps[op].fOp, gOps[op].fColor); 390 this->drawPathOped(canvas, gOps[op].fOp, gOps[op].fColor);
391 canvas->restore(); 391 canvas->restore();
392 392
393 canvas->translate(SkIntToScalar(200), 0); 393 canvas->translate(SkIntToScalar(200), 0);
394 } 394 }
395 } 395 }
396 396
397 virtual SkView::Click* onFindClickHandler(SkScalar x, SkScalar y, 397 virtual SkView::Click* onFindClickHandler(SkScalar x, SkScalar y,
398 unsigned modi) SK_OVERRIDE { 398 unsigned modi) SK_OVERRIDE {
399 return fRect.contains(SkScalarRound(x), SkScalarRound(y)) ? new Click(th is) : NULL; 399 return fRect.contains(SkScalarRoundToInt(x),
400 SkScalarRoundToInt(y)) ? new Click(this) : NULL;
400 } 401 }
401 402
402 virtual bool onClick(Click* click) { 403 virtual bool onClick(Click* click) {
403 fRect.offset(click->fICurr.fX - click->fIPrev.fX, 404 fRect.offset(click->fICurr.fX - click->fIPrev.fX,
404 click->fICurr.fY - click->fIPrev.fY); 405 click->fICurr.fY - click->fIPrev.fY);
405 this->inval(NULL); 406 this->inval(NULL);
406 return true; 407 return true;
407 } 408 }
408 409
409 private: 410 private:
410 SkIRect fBase, fRect; 411 SkIRect fBase, fRect;
411 412
412 typedef SampleView INHERITED; 413 typedef SampleView INHERITED;
413 }; 414 };
414 415
415 ////////////////////////////////////////////////////////////////////////////// 416 //////////////////////////////////////////////////////////////////////////////
416 417
417 static SkView* MyFactory() { return new RegionView; } 418 static SkView* MyFactory() { return new RegionView; }
418 static SkViewRegister reg(MyFactory); 419 static SkViewRegister reg(MyFactory);
OLDNEW
« no previous file with comments | « samplecode/SampleLines.cpp ('k') | samplecode/SampleSkLayer.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698