OLD | NEW |
1 /* | 1 /* |
2 * Copyright (c) 2012, Google Inc. All rights reserved. | 2 * Copyright (c) 2012, Google 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 are | 5 * modification, are permitted provided that the following conditions are |
6 * met: | 6 * met: |
7 * | 7 * |
8 * * Redistributions of source code must retain the above copyright | 8 * * Redistributions of source code must retain the above copyright |
9 * notice, this list of conditions and the following disclaimer. | 9 * notice, this list of conditions and the following disclaimer. |
10 * * Redistributions in binary form must reproduce the above | 10 * * Redistributions in binary form must reproduce the above |
(...skipping 153 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
164 LayoutRect transposedRect() const { return LayoutRect(m_location.transposedP
oint(), m_size.transposedSize()); } | 164 LayoutRect transposedRect() const { return LayoutRect(m_location.transposedP
oint(), m_size.transposedSize()); } |
165 | 165 |
166 static LayoutRect infiniteRect() | 166 static LayoutRect infiniteRect() |
167 { | 167 { |
168 // Return a rect that is slightly smaller than the true max rect to allo
w pixelSnapping to round up to the nearest IntRect without overflowing. | 168 // Return a rect that is slightly smaller than the true max rect to allo
w pixelSnapping to round up to the nearest IntRect without overflowing. |
169 return LayoutRect(LayoutUnit::nearlyMin() / 2, LayoutUnit::nearlyMin() /
2, LayoutUnit::nearlyMax(), LayoutUnit::nearlyMax()); | 169 return LayoutRect(LayoutUnit::nearlyMin() / 2, LayoutUnit::nearlyMin() /
2, LayoutUnit::nearlyMax(), LayoutUnit::nearlyMax()); |
170 } | 170 } |
171 | 171 |
172 #ifndef NDEBUG | 172 #ifndef NDEBUG |
173 // Prints the rect to the screen. | 173 // Prints the rect to the screen. |
174 void show(bool showRawValue = false); | 174 void show(bool showRawValue = false) const; |
175 #endif | 175 #endif |
176 | 176 |
177 private: | 177 private: |
178 LayoutPoint m_location; | 178 LayoutPoint m_location; |
179 LayoutSize m_size; | 179 LayoutSize m_size; |
180 }; | 180 }; |
181 | 181 |
182 inline LayoutRect intersection(const LayoutRect& a, const LayoutRect& b) | 182 inline LayoutRect intersection(const LayoutRect& a, const LayoutRect& b) |
183 { | 183 { |
184 LayoutRect c = a; | 184 LayoutRect c = a; |
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
226 } | 226 } |
227 | 227 |
228 inline IntRect pixelSnappedIntRect(LayoutPoint location, LayoutSize size) | 228 inline IntRect pixelSnappedIntRect(LayoutPoint location, LayoutSize size) |
229 { | 229 { |
230 return IntRect(roundedIntPoint(location), pixelSnappedIntSize(size, location
)); | 230 return IntRect(roundedIntPoint(location), pixelSnappedIntSize(size, location
)); |
231 } | 231 } |
232 | 232 |
233 } // namespace WebCore | 233 } // namespace WebCore |
234 | 234 |
235 #endif // LayoutRect_h | 235 #endif // LayoutRect_h |
OLD | NEW |