| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2010, 2011 Apple Inc. All rights reserved. | 2 * Copyright (C) 2010, 2011 Apple Inc. All rights reserved. |
| 3 * | 3 * |
| 4 * Redistribution and use in source and binary forms, with or without | 4 * Redistribution and use in source and binary forms, with or without |
| 5 * modification, are permitted provided that the following conditions | 5 * modification, are permitted provided that the following conditions |
| 6 * are met: | 6 * are met: |
| 7 * 1. Redistributions of source code must retain the above copyright | 7 * 1. Redistributions of source code must retain the above copyright |
| 8 * notice, this list of conditions and the following disclaimer. | 8 * notice, this list of conditions and the following disclaimer. |
| 9 * 2. Redistributions in binary form must reproduce the above copyright | 9 * 2. Redistributions in binary form must reproduce the above copyright |
| 10 * notice, this list of conditions and the following disclaimer in the | 10 * notice, this list of conditions and the following disclaimer in the |
| (...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 50 void translate(const IntSize&); | 50 void translate(const IntSize&); |
| 51 | 51 |
| 52 // Returns true if the query region is a subset of this region. | 52 // Returns true if the query region is a subset of this region. |
| 53 bool contains(const Region&) const; | 53 bool contains(const Region&) const; |
| 54 | 54 |
| 55 bool contains(const IntPoint&) const; | 55 bool contains(const IntPoint&) const; |
| 56 | 56 |
| 57 // Returns true if the query region intersects any part of this region. | 57 // Returns true if the query region intersects any part of this region. |
| 58 bool intersects(const Region&) const; | 58 bool intersects(const Region&) const; |
| 59 | 59 |
| 60 unsigned totalArea() const; | |
| 61 | |
| 62 #ifndef NDEBUG | 60 #ifndef NDEBUG |
| 63 void dump() const; | 61 void dump() const; |
| 64 #endif | 62 #endif |
| 65 | 63 |
| 66 private: | 64 private: |
| 67 struct Span { | 65 struct Span { |
| 68 Span(int y, size_t segmentIndex) | 66 Span(int y, size_t segmentIndex) |
| 69 : y(y), segmentIndex(segmentIndex) | 67 : y(y), segmentIndex(segmentIndex) |
| 70 { | 68 { |
| 71 } | 69 } |
| (...skipping 104 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 176 } | 174 } |
| 177 | 175 |
| 178 inline bool operator==(const Region::Span& a, const Region::Span& b) | 176 inline bool operator==(const Region::Span& a, const Region::Span& b) |
| 179 { | 177 { |
| 180 return a.y == b.y && a.segmentIndex == b.segmentIndex; | 178 return a.y == b.y && a.segmentIndex == b.segmentIndex; |
| 181 } | 179 } |
| 182 | 180 |
| 183 } // namespace blink | 181 } // namespace blink |
| 184 | 182 |
| 185 #endif // Region_h | 183 #endif // Region_h |
| OLD | NEW |