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

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

Issue 1111333002: compute initial winding from projected rays (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: add missing test reference 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/pathops/SkPathOpsDebug.cpp ('k') | src/pathops/SkPathOpsOp.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 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 SkPathOpsLine_DEFINED 7 #ifndef SkPathOpsLine_DEFINED
8 #define SkPathOpsLine_DEFINED 8 #define SkPathOpsLine_DEFINED
9 9
10 #include "SkPathOpsPoint.h" 10 #include "SkPathOpsPoint.h"
11 11
12 struct SkDLine { 12 struct SkDLine {
13 SkDPoint fPts[2]; 13 SkDPoint fPts[2];
14 14
15 const SkDPoint& operator[](int n) const { SkASSERT(n >= 0 && n < 2); return fPts[n]; } 15 const SkDPoint& operator[](int n) const { SkASSERT(n >= 0 && n < 2); return fPts[n]; }
16 SkDPoint& operator[](int n) { SkASSERT(n >= 0 && n < 2); return fPts[n]; } 16 SkDPoint& operator[](int n) { SkASSERT(n >= 0 && n < 2); return fPts[n]; }
17 17
18 void set(const SkPoint pts[2]) { 18 const SkDLine& set(const SkPoint pts[2]) {
19 fPts[0] = pts[0]; 19 fPts[0] = pts[0];
20 fPts[1] = pts[1]; 20 fPts[1] = pts[1];
21 return *this;
21 } 22 }
22 23
23 double exactPoint(const SkDPoint& xy) const; 24 double exactPoint(const SkDPoint& xy) const;
24 static double ExactPointH(const SkDPoint& xy, double left, double right, dou ble y); 25 static double ExactPointH(const SkDPoint& xy, double left, double right, dou ble y);
25 static double ExactPointV(const SkDPoint& xy, double top, double bottom, dou ble x); 26 static double ExactPointV(const SkDPoint& xy, double top, double bottom, dou ble x);
26 27
27 // only used by testing 28 // only used by testing
28 double isLeft(const SkDPoint& pt) const; 29 double isLeft(const SkDPoint& pt) const;
29 30
30 double nearPoint(const SkDPoint& xy, bool* unequal) const; 31 double nearPoint(const SkDPoint& xy, bool* unequal) const;
31 bool nearRay(const SkDPoint& xy) const; 32 bool nearRay(const SkDPoint& xy) const;
32 static double NearPointH(const SkDPoint& xy, double left, double right, doub le y); 33 static double NearPointH(const SkDPoint& xy, double left, double right, doub le y);
33 static double NearPointV(const SkDPoint& xy, double top, double bottom, doub le x); 34 static double NearPointV(const SkDPoint& xy, double top, double bottom, doub le x);
34 SkDPoint ptAtT(double t) const; 35 SkDPoint ptAtT(double t) const;
35 36
36 void dump() const; 37 void dump() const;
37 void dumpID(int ) const; 38 void dumpID(int ) const;
38 void dumpInner() const; 39 void dumpInner() const;
39 }; 40 };
40 41
41 #endif 42 #endif
OLDNEW
« no previous file with comments | « src/pathops/SkPathOpsDebug.cpp ('k') | src/pathops/SkPathOpsOp.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698