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

Unified Diff: Source/WebCore/platform/graphics/FractionalLayoutRect.h

Issue 10908295: Merge 127933 (Closed) Base URL: http://svn.webkit.org/repository/webkit/branches/chromium/1229/
Patch Set: Created 8 years, 3 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « Source/WebCore/platform/FractionalLayoutUnit.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/WebCore/platform/graphics/FractionalLayoutRect.h
===================================================================
--- Source/WebCore/platform/graphics/FractionalLayoutRect.h (revision 128804)
+++ Source/WebCore/platform/graphics/FractionalLayoutRect.h (working copy)
@@ -165,7 +165,11 @@
FractionalLayoutRect transposedRect() const { return FractionalLayoutRect(m_location.transposedPoint(), m_size.transposedSize()); }
- static FractionalLayoutRect infiniteRect() {return FractionalLayoutRect(FractionalLayoutUnit::min() / 2, FractionalLayoutUnit::min() / 2, FractionalLayoutUnit::max(), FractionalLayoutUnit::max()); }
+ static FractionalLayoutRect infiniteRect()
+ {
+ // Return a rect that is slightly smaller than the true max rect to allow pixelSnapping to round up to the nearest IntRect without overflowing.
+ return FractionalLayoutRect(FractionalLayoutUnit::nearlyMin() / 2, FractionalLayoutUnit::nearlyMin() / 2, FractionalLayoutUnit::nearlyMax(), FractionalLayoutUnit::nearlyMax());
+ }
#if PLATFORM(QT)
explicit FractionalLayoutRect(const QRect&);
@@ -207,9 +211,9 @@
inline IntRect pixelSnappedIntRect(const FractionalLayoutRect& rect)
{
#if ENABLE(SUBPIXEL_LAYOUT)
- IntPoint roundedLocation = roundedIntPoint(rect.location());
- return IntRect(roundedLocation, IntSize((rect.x() + rect.width()).round() - roundedLocation.x(),
- (rect.y() + rect.height()).round() - roundedLocation.y()));
+ return IntRect(roundedIntPoint(rect.location()), IntSize(snapSizeToPixel(rect.width(), rect.x()),
+ snapSizeToPixel(rect.height(), rect.y())));
+
#else
return IntRect(rect);
#endif
« no previous file with comments | « Source/WebCore/platform/FractionalLayoutUnit.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698