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

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

Issue 1407003016: Reland of path ops: fix conic weight and partial coincidence (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 5 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 | « src/pathops/SkPathOpsQuad.h ('k') | src/pathops/SkPathOpsTSect.h » ('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 SkPathOpsRect_DEFINED 7 #ifndef SkPathOpsRect_DEFINED
8 #define SkPathOpsRect_DEFINED 8 #define SkPathOpsRect_DEFINED
9 9
10 #include "SkPathOpsPoint.h" 10 #include "SkPathOpsPoint.h"
11 11
12 struct SkDRect { 12 struct SkDRect {
13 double fLeft, fTop, fRight, fBottom; 13 double fLeft, fTop, fRight, fBottom;
14 14
15 void add(const SkDPoint& pt) { 15 void add(const SkDPoint& pt) {
16 fLeft = SkTMin(fLeft, pt.fX); 16 fLeft = SkTMin(fLeft, pt.fX);
17 fTop = SkTMin(fTop, pt.fY); 17 fTop = SkTMin(fTop, pt.fY);
18 fRight = SkTMax(fRight, pt.fX); 18 fRight = SkTMax(fRight, pt.fX);
19 fBottom = SkTMax(fBottom, pt.fY); 19 fBottom = SkTMax(fBottom, pt.fY);
20 } 20 }
21 21
22 bool contains(const SkDPoint& pt) const { 22 bool contains(const SkDPoint& pt) const {
23 return approximately_between(fLeft, pt.fX, fRight) 23 return approximately_between(fLeft, pt.fX, fRight)
24 && approximately_between(fTop, pt.fY, fBottom); 24 && approximately_between(fTop, pt.fY, fBottom);
25 } 25 }
26 26
27 void debugInit();
28
27 bool intersects(const SkDRect& r) const { 29 bool intersects(const SkDRect& r) const {
28 SkASSERT(fLeft <= fRight); 30 SkASSERT(fLeft <= fRight);
29 SkASSERT(fTop <= fBottom); 31 SkASSERT(fTop <= fBottom);
30 SkASSERT(r.fLeft <= r.fRight); 32 SkASSERT(r.fLeft <= r.fRight);
31 SkASSERT(r.fTop <= r.fBottom); 33 SkASSERT(r.fTop <= r.fBottom);
32 return r.fLeft <= fRight && fLeft <= r.fRight && r.fTop <= fBottom && fT op <= r.fBottom; 34 return r.fLeft <= fRight && fLeft <= r.fRight && r.fTop <= fBottom && fT op <= r.fBottom;
33 } 35 }
34 36
35 void set(const SkDPoint& pt) { 37 void set(const SkDPoint& pt) {
36 fLeft = fRight = pt.fX; 38 fLeft = fRight = pt.fX;
(...skipping 21 matching lines...) Expand all
58 void setBounds(const SkDCubic& curve, const SkDCubic& sub, double tStart, do uble tEnd); 60 void setBounds(const SkDCubic& curve, const SkDCubic& sub, double tStart, do uble tEnd);
59 61
60 void setBounds(const SkDQuad& curve) { 62 void setBounds(const SkDQuad& curve) {
61 setBounds(curve, curve, 0, 1); 63 setBounds(curve, curve, 0, 1);
62 } 64 }
63 65
64 void setBounds(const SkDQuad& curve, const SkDQuad& sub, double tStart, doub le tEnd); 66 void setBounds(const SkDQuad& curve, const SkDQuad& sub, double tStart, doub le tEnd);
65 }; 67 };
66 68
67 #endif 69 #endif
OLDNEW
« no previous file with comments | « src/pathops/SkPathOpsQuad.h ('k') | src/pathops/SkPathOpsTSect.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698