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

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

Issue 1113963002: use pathops utils to improve precision of cubic chopping in scan converter (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: use LineCubicIntersect utility for more robustness Created 5 years, 7 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 | « src/core/SkEdgeClipper.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 148 matching lines...) Expand 10 before | Expand all | Expand 10 after
159 /** Return 1 for no chop, 2 for having chopped the cubic at a single 159 /** Return 1 for no chop, 2 for having chopped the cubic at a single
160 inflection point, 3 for having chopped at 2 inflection points. 160 inflection point, 3 for having chopped at 2 inflection points.
161 dst will hold the resulting 1, 2, or 3 cubics. 161 dst will hold the resulting 1, 2, or 3 cubics.
162 */ 162 */
163 int SkChopCubicAtInflections(const SkPoint src[4], SkPoint dst[10]); 163 int SkChopCubicAtInflections(const SkPoint src[4], SkPoint dst[10]);
164 164
165 int SkFindCubicMaxCurvature(const SkPoint src[4], SkScalar tValues[3]); 165 int SkFindCubicMaxCurvature(const SkPoint src[4], SkScalar tValues[3]);
166 int SkChopCubicAtMaxCurvature(const SkPoint src[4], SkPoint dst[13], 166 int SkChopCubicAtMaxCurvature(const SkPoint src[4], SkPoint dst[13],
167 SkScalar tValues[3] = NULL); 167 SkScalar tValues[3] = NULL);
168 168
169 bool SkChopMonoCubicAtX(SkPoint src[4], SkScalar y, SkPoint dst[7]);
170 bool SkChopMonoCubicAtY(SkPoint src[4], SkScalar x, SkPoint dst[7]);
171
169 enum SkCubicType { 172 enum SkCubicType {
170 kSerpentine_SkCubicType, 173 kSerpentine_SkCubicType,
171 kCusp_SkCubicType, 174 kCusp_SkCubicType,
172 kLoop_SkCubicType, 175 kLoop_SkCubicType,
173 kQuadratic_SkCubicType, 176 kQuadratic_SkCubicType,
174 kLine_SkCubicType, 177 kLine_SkCubicType,
175 kPoint_SkCubicType 178 kPoint_SkCubicType
176 }; 179 };
177 180
178 /** Returns the cubic classification. Pass scratch storage for computing inflect ion data, 181 /** Returns the cubic classification. Pass scratch storage for computing inflect ion data,
(...skipping 146 matching lines...) Expand 10 before | Expand all | Expand 10 after
325 private: 328 private:
326 enum { 329 enum {
327 kQuadCount = 8, // should handle most conics 330 kQuadCount = 8, // should handle most conics
328 kPointCount = 1 + 2 * kQuadCount, 331 kPointCount = 1 + 2 * kQuadCount,
329 }; 332 };
330 SkAutoSTMalloc<kPointCount, SkPoint> fStorage; 333 SkAutoSTMalloc<kPointCount, SkPoint> fStorage;
331 int fQuadCount; // #quads for current usage 334 int fQuadCount; // #quads for current usage
332 }; 335 };
333 336
334 #endif 337 #endif
OLDNEW
« no previous file with comments | « src/core/SkEdgeClipper.cpp ('k') | src/core/SkGeometry.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698