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

Side by Side Diff: src/core/SkGeometry.h

Issue 2368993002: allow conic chop to fail (Closed)
Patch Set: address comment Created 4 years, 2 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 | « samplecode/SampleAAGeometry.cpp ('k') | src/core/SkGeometry.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 * Copyright 2006 The Android Open Source Project 2 * Copyright 2006 The Android Open Source Project
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 7
8 #ifndef SkGeometry_DEFINED 8 #ifndef SkGeometry_DEFINED
9 #define SkGeometry_DEFINED 9 #define SkGeometry_DEFINED
10 10
(...skipping 197 matching lines...) Expand 10 before | Expand all | Expand 10 after
208 } 208 }
209 209
210 /** 210 /**
211 * Given a t-value [0...1] return its position and/or tangent. 211 * Given a t-value [0...1] return its position and/or tangent.
212 * If pos is not null, return its position at the t-value. 212 * If pos is not null, return its position at the t-value.
213 * If tangent is not null, return its tangent at the t-value. NOTE the 213 * If tangent is not null, return its tangent at the t-value. NOTE the
214 * tangent value's length is arbitrary, and only its direction should 214 * tangent value's length is arbitrary, and only its direction should
215 * be used. 215 * be used.
216 */ 216 */
217 void evalAt(SkScalar t, SkPoint* pos, SkVector* tangent = nullptr) const; 217 void evalAt(SkScalar t, SkPoint* pos, SkVector* tangent = nullptr) const;
218 void chopAt(SkScalar t, SkConic dst[2]) const; 218 bool SK_WARN_UNUSED_RESULT chopAt(SkScalar t, SkConic dst[2]) const;
219 void chopAt(SkScalar t1, SkScalar t2, SkConic* dst) const; 219 void chopAt(SkScalar t1, SkScalar t2, SkConic* dst) const;
220 void chop(SkConic dst[2]) const; 220 void chop(SkConic dst[2]) const;
221 221
222 SkPoint evalAt(SkScalar t) const; 222 SkPoint evalAt(SkScalar t) const;
223 SkVector evalTangentAt(SkScalar t) const; 223 SkVector evalTangentAt(SkScalar t) const;
224 224
225 void computeAsQuadError(SkVector* err) const; 225 void computeAsQuadError(SkVector* err) const;
226 bool asQuadTol(SkScalar tol) const; 226 bool asQuadTol(SkScalar tol) const;
227 227
228 /** 228 /**
(...skipping 171 matching lines...) Expand 10 before | Expand all | Expand 10 after
400 private: 400 private:
401 enum { 401 enum {
402 kQuadCount = 8, // should handle most conics 402 kQuadCount = 8, // should handle most conics
403 kPointCount = 1 + 2 * kQuadCount, 403 kPointCount = 1 + 2 * kQuadCount,
404 }; 404 };
405 SkAutoSTMalloc<kPointCount, SkPoint> fStorage; 405 SkAutoSTMalloc<kPointCount, SkPoint> fStorage;
406 int fQuadCount; // #quads for current usage 406 int fQuadCount; // #quads for current usage
407 }; 407 };
408 408
409 #endif 409 #endif
OLDNEW
« no previous file with comments | « samplecode/SampleAAGeometry.cpp ('k') | src/core/SkGeometry.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698