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

Side by Side Diff: src/pathops/SkPathOpsPoint.h

Issue 237263004: change 'char' to 'int8_t' (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: #if SK_DEBUG should be #ifdef SK_DEBUG (broke canary) Created 6 years, 8 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
« no previous file with comments | « no previous file | no next file » | 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 * Copyright 2012 Google Inc. 2 * Copyright 2012 Google Inc.
3 * 3 *
4 * Use of this source code is governed by a BSD-style license that can be 4 * Use of this source code is governed by a BSD-style license that can be
5 * found in the LICENSE file. 5 * found in the LICENSE file.
6 */ 6 */
7 #ifndef SkPathOpsPoint_DEFINED 7 #ifndef SkPathOpsPoint_DEFINED
8 #define SkPathOpsPoint_DEFINED 8 #define SkPathOpsPoint_DEFINED
9 9
10 #include "SkPathOpsTypes.h" 10 #include "SkPathOpsTypes.h"
(...skipping 130 matching lines...) Expand 10 before | Expand all | Expand 10 after
141 SkDPoint dA, dB; 141 SkDPoint dA, dB;
142 dA.set(a); 142 dA.set(a);
143 dB.set(b); 143 dB.set(b);
144 double dist = dA.distance(dB); // OPTIMIZATION: can we compare against distSq instead ? 144 double dist = dA.distance(dB); // OPTIMIZATION: can we compare against distSq instead ?
145 float tiniest = SkTMin(SkTMin(SkTMin(a.fX, b.fX), a.fY), b.fY); 145 float tiniest = SkTMin(SkTMin(SkTMin(a.fX, b.fX), a.fY), b.fY);
146 float largest = SkTMax(SkTMax(SkTMax(a.fX, b.fX), a.fY), b.fY); 146 float largest = SkTMax(SkTMax(SkTMax(a.fX, b.fX), a.fY), b.fY);
147 largest = SkTMax(largest, -tiniest); 147 largest = SkTMax(largest, -tiniest);
148 return AlmostBequalUlps((double) largest, largest + dist); // is dist wi thin ULPS tolerance? 148 return AlmostBequalUlps((double) largest, largest + dist); // is dist wi thin ULPS tolerance?
149 } 149 }
150 150
151 #if SK_DEBUG 151 #ifdef SK_DEBUG
152 static bool RoughlyEqual(const SkPoint& a, const SkPoint& b) { 152 static bool RoughlyEqual(const SkPoint& a, const SkPoint& b) {
153 if (approximately_equal(a.fX, b.fX) && approximately_equal(a.fY, b.fY)) { 153 if (approximately_equal(a.fX, b.fX) && approximately_equal(a.fY, b.fY)) {
154 return true; 154 return true;
155 } 155 }
156 return RoughlyEqualUlps(a.fX, b.fX) && RoughlyEqualUlps(a.fY, b.fY); 156 return RoughlyEqualUlps(a.fX, b.fX) && RoughlyEqualUlps(a.fY, b.fY);
157 } 157 }
158 #endif 158 #endif
159 159
160 bool approximatelyPEqual(const SkDPoint& a) const { 160 bool approximatelyPEqual(const SkDPoint& a) const {
161 if (approximately_equal(fX, a.fX) && approximately_equal(fY, a.fY)) { 161 if (approximately_equal(fX, a.fX) && approximately_equal(fY, a.fY)) {
(...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after
225 bool roughlyEqual(const SkDPoint& a) const { 225 bool roughlyEqual(const SkDPoint& a) const {
226 return roughly_equal(a.fY, fY) && roughly_equal(a.fX, fX); 226 return roughly_equal(a.fY, fY) && roughly_equal(a.fX, fX);
227 } 227 }
228 228
229 // utilities callable by the user from the debugger when the implementation code is linked in 229 // utilities callable by the user from the debugger when the implementation code is linked in
230 void dump() const; 230 void dump() const;
231 static void Dump(const SkPoint& pt); 231 static void Dump(const SkPoint& pt);
232 }; 232 };
233 233
234 #endif 234 #endif
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698