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

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

Issue 1408923003: Revert 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
29 bool intersects(const SkDRect& r) const { 27 bool intersects(const SkDRect& r) const {
30 SkASSERT(fLeft <= fRight); 28 SkASSERT(fLeft <= fRight);
31 SkASSERT(fTop <= fBottom); 29 SkASSERT(fTop <= fBottom);
32 SkASSERT(r.fLeft <= r.fRight); 30 SkASSERT(r.fLeft <= r.fRight);
33 SkASSERT(r.fTop <= r.fBottom); 31 SkASSERT(r.fTop <= r.fBottom);
34 return r.fLeft <= fRight && fLeft <= r.fRight && r.fTop <= fBottom && fT op <= r.fBottom; 32 return r.fLeft <= fRight && fLeft <= r.fRight && r.fTop <= fBottom && fT op <= r.fBottom;
35 } 33 }
36 34
37 void set(const SkDPoint& pt) { 35 void set(const SkDPoint& pt) {
38 fLeft = fRight = pt.fX; 36 fLeft = fRight = pt.fX;
(...skipping 21 matching lines...) Expand all
60 void setBounds(const SkDCubic& curve, const SkDCubic& sub, double tStart, do uble tEnd); 58 void setBounds(const SkDCubic& curve, const SkDCubic& sub, double tStart, do uble tEnd);
61 59
62 void setBounds(const SkDQuad& curve) { 60 void setBounds(const SkDQuad& curve) {
63 setBounds(curve, curve, 0, 1); 61 setBounds(curve, curve, 0, 1);
64 } 62 }
65 63
66 void setBounds(const SkDQuad& curve, const SkDQuad& sub, double tStart, doub le tEnd); 64 void setBounds(const SkDQuad& curve, const SkDQuad& sub, double tStart, doub le tEnd);
67 }; 65 };
68 66
69 #endif 67 #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