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

Side by Side Diff: src/pathops/SkPathOpsBounds.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/SkOpSpan.cpp ('k') | src/pathops/SkPathOpsCommon.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 SkPathOpBounds_DEFINED 7 #ifndef SkPathOpBounds_DEFINED
8 #define SkPathOpBounds_DEFINED 8 #define SkPathOpBounds_DEFINED
9 9
10 #include "SkPathOpsRect.h" 10 #include "SkPathOpsRect.h"
(...skipping 29 matching lines...) Expand all
40 if (pt.fY > fBottom) fBottom = SkDoubleToScalar(pt.fY); 40 if (pt.fY > fBottom) fBottom = SkDoubleToScalar(pt.fY);
41 } 41 }
42 42
43 bool almostContains(const SkPoint& pt) { 43 bool almostContains(const SkPoint& pt) {
44 return AlmostLessOrEqualUlps(fLeft, pt.fX) 44 return AlmostLessOrEqualUlps(fLeft, pt.fX)
45 && AlmostLessOrEqualUlps(pt.fX, fRight) 45 && AlmostLessOrEqualUlps(pt.fX, fRight)
46 && AlmostLessOrEqualUlps(fTop, pt.fY) 46 && AlmostLessOrEqualUlps(fTop, pt.fY)
47 && AlmostLessOrEqualUlps(pt.fY, fBottom); 47 && AlmostLessOrEqualUlps(pt.fY, fBottom);
48 } 48 }
49 49
50 // unlike isEmpty(), this permits lines, but not points
51 // FIXME: unused for now
52 bool isReallyEmpty() const {
53 // use !<= instead of > to detect NaN values
54 return !(fLeft <= fRight) || !(fTop <= fBottom)
55 || (fLeft == fRight && fTop == fBottom);
56 }
57
58 void setPointBounds(const SkDPoint& pt) {
59 fLeft = fRight = SkDoubleToScalar(pt.fX);
60 fTop = fBottom = SkDoubleToScalar(pt.fY);
61 }
62
63 typedef SkRect INHERITED; 50 typedef SkRect INHERITED;
64 }; 51 };
65 52
66 #endif 53 #endif
OLDNEW
« no previous file with comments | « src/pathops/SkOpSpan.cpp ('k') | src/pathops/SkPathOpsCommon.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698