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

Side by Side Diff: samplecode/SampleLines.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/SampleLayerMask.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 81 matching lines...) Expand 10 before | Expand all | Expand 10 after
92 // y += SK_Scalar1/2; 92 // y += SK_Scalar1/2;
93 93
94 canvas->drawLine(x, y, x + SkIntToScalar(90), y + SkIntToScalar(90), pai nt); 94 canvas->drawLine(x, y, x + SkIntToScalar(90), y + SkIntToScalar(90), pai nt);
95 95
96 paint.setAntiAlias(true); // with anti-aliasing 96 paint.setAntiAlias(true); // with anti-aliasing
97 y += SkIntToScalar(10); 97 y += SkIntToScalar(10);
98 canvas->drawLine(x, y, x + SkIntToScalar(90), y + SkIntToScalar(90), pai nt); 98 canvas->drawLine(x, y, x + SkIntToScalar(90), y + SkIntToScalar(90), pai nt);
99 } 99 }
100 100
101 virtual SkView::Click* onFindClickHandler(SkScalar x, SkScalar y, unsigned) SK_OVERRIDE { 101 virtual SkView::Click* onFindClickHandler(SkScalar x, SkScalar y, unsigned) SK_OVERRIDE {
102 fAlpha = SkScalarRound(y); 102 fAlpha = SkScalarRoundToInt(y);
103 this->inval(NULL); 103 this->inval(NULL);
104 return NULL; 104 return NULL;
105 } 105 }
106 private: 106 private:
107 107
108 int fAlpha; 108 int fAlpha;
109 typedef SampleView INHERITED; 109 typedef SampleView INHERITED;
110 }; 110 };
111 111
112 ////////////////////////////////////////////////////////////////////////////// 112 //////////////////////////////////////////////////////////////////////////////
113 113
114 static SkView* MyFactory() { return new LinesView; } 114 static SkView* MyFactory() { return new LinesView; }
115 static SkViewRegister reg(MyFactory); 115 static SkViewRegister reg(MyFactory);
OLDNEW
« no previous file with comments | « samplecode/SampleLayerMask.cpp ('k') | samplecode/SampleRegion.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698