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

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

Issue 12827020: Add base types for path ops (Closed) Base URL: http://skia.googlecode.com/svn/trunk/
Patch Set: Created 7 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 | Annotate | Revision Log
« no previous file with comments | « src/pathops/SkPathOpsDebug.cpp ('k') | src/pathops/SkPathOpsLine.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 /*
2 * Copyright 2012 Google Inc.
3 *
4 * Use of this source code is governed by a BSD-style license that can be
5 * found in the LICENSE file.
6 */
7 #ifndef SkPathOpsLine_DEFINED
8 #define SkPathOpsLine_DEFINED
9
10 #include "SkPathOpsPoint.h"
11
12 struct SkDLine {
13 SkDPoint fPts[2];
14
15 void set(const SkPoint pts[2]) {
16 fPts[0] = pts[0];
17 fPts[1] = pts[1];
18 }
19
20 const SkDPoint& operator[](int n) const { SkASSERT(n >= 0 && n < 2); return fPts[n]; }
21 SkDPoint& operator[](int n) { SkASSERT(n >= 0 && n < 2); return fPts[n]; }
22
23 double isLeft(const SkDPoint& pt) const;
24 SkDLine subDivide(double t1, double t2) const;
25 static SkDLine SubDivide(const SkPoint a[2], double t1, double t2) {
26 SkDLine line;
27 line.set(a);
28 return line.subDivide(t1, t2);
29 }
30 SkDPoint xyAtT(double t) const;
31 private:
32 SkDVector tangent() const { return fPts[0] - fPts[1]; }
33 };
34
35 #endif
OLDNEW
« no previous file with comments | « src/pathops/SkPathOpsDebug.cpp ('k') | src/pathops/SkPathOpsLine.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698