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

Side by Side Diff: samplecode/SampleUnitMapper.cpp

Issue 12480002: Fixing some warnings on Linux (Closed) Base URL: http://skia.googlecode.com/svn/trunk/
Patch Set: Created 7 years, 9 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/SampleTextAlpha.cpp ('k') | samplecode/SampleVertices.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 123 matching lines...) Expand 10 before | Expand all | Expand 10 after
134 SkPoint pts[2] = { fPts[1], fPts[2] }; 134 SkPoint pts[2] = { fPts[1], fPts[2] };
135 fMatrix.mapPoints(pts, 2); 135 fMatrix.mapPoints(pts, 2);
136 for (int i = 0; i < 2; i++) { 136 for (int i = 0; i < 2; i++) {
137 if (SkPoint::Distance(pts[i], target) < SkIntToScalar(4)) { 137 if (SkPoint::Distance(pts[i], target) < SkIntToScalar(4)) {
138 return i + 1; 138 return i + 1;
139 } 139 }
140 } 140 }
141 return -1; 141 return -1;
142 } 142 }
143 143
144 virtual SkView::Click* onFindClickHandler(SkScalar x, SkScalar y) { 144 virtual SkView::Click* onFindClickHandler(SkScalar x, SkScalar y, unsigned) SK_OVERRIDE {
145 fDragIndex = hittest(x, y); 145 fDragIndex = hittest(x, y);
146 return fDragIndex >= 0 ? new Click(this) : NULL; 146 return fDragIndex >= 0 ? new Click(this) : NULL;
147 } 147 }
148 148
149 virtual bool onClick(Click* click) { 149 virtual bool onClick(Click* click) {
150 if (fDragIndex >= 0) { 150 if (fDragIndex >= 0) {
151 if (!invertPt(click->fCurr.fX, click->fCurr.fY, 151 if (!invertPt(click->fCurr.fX, click->fCurr.fY,
152 &fPts[fDragIndex])) { 152 &fPts[fDragIndex])) {
153 return false; 153 return false;
154 } 154 }
155 155
156 this->setViews(); 156 this->setViews();
157 this->inval(NULL); 157 this->inval(NULL);
158 return true; 158 return true;
159 } 159 }
160 return false; 160 return false;
161 } 161 }
162 162
163 private: 163 private:
164 int fDragIndex; 164 int fDragIndex;
165 165
166 typedef SampleView INHERITED; 166 typedef SampleView INHERITED;
167 }; 167 };
168 168
169 ////////////////////////////////////////////////////////////////////////////// 169 //////////////////////////////////////////////////////////////////////////////
170 170
171 static SkView* MyFactory() { return new UnitMapperView; } 171 static SkView* MyFactory() { return new UnitMapperView; }
172 static SkViewRegister reg(MyFactory); 172 static SkViewRegister reg(MyFactory);
OLDNEW
« no previous file with comments | « samplecode/SampleTextAlpha.cpp ('k') | samplecode/SampleVertices.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698