Title: [110785] branches/subpixellayout/Source/WebCore/rendering
Revision
110785
Author
[email protected]
Date
2012-03-14 16:41:29 -0700 (Wed, 14 Mar 2012)

Log Message

Correcting flooredLayoutPoint/Size to not floor on our branch (these preserve precision instead). Rounding image sizes inline with our RenderReplaced strategy. Fixing a pixel snapping bug in RenderListBox. Shuffling code in InlineTextBox for precision.

Modified Paths

Diff

Modified: branches/subpixellayout/Source/WebCore/rendering/InlineTextBox.cpp (110784 => 110785)


--- branches/subpixellayout/Source/WebCore/rendering/InlineTextBox.cpp	2012-03-14 23:41:04 UTC (rev 110784)
+++ branches/subpixellayout/Source/WebCore/rendering/InlineTextBox.cpp	2012-03-14 23:41:29 UTC (rev 110785)
@@ -475,16 +475,16 @@
 
     ASSERT(paintInfo.phase != PaintPhaseSelfOutline && paintInfo.phase != PaintPhaseChildOutlines);
 
-    LayoutPoint adjustedPaintOffset = roundedIntPoint(paintOffset);
-
     LayoutUnit logicalLeftSide = logicalLeftVisualOverflow();
     LayoutUnit logicalRightSide = logicalRightVisualOverflow();
-    LayoutUnit logicalStart = logicalLeftSide + (isHorizontal() ? adjustedPaintOffset.x() : adjustedPaintOffset.y());
+    LayoutUnit logicalStart = logicalLeftSide + (isHorizontal() ? paintOffset.x() : paintOffset.y());
     LayoutUnit logicalExtent = logicalRightSide - logicalLeftSide;
     
     LayoutUnit paintEnd = isHorizontal() ? paintInfo.rect.maxX() : paintInfo.rect.maxY();
     LayoutUnit paintStart = isHorizontal() ? paintInfo.rect.x() : paintInfo.rect.y();
     
+    LayoutPoint adjustedPaintOffset = roundedIntPoint(paintOffset);
+    
     if (logicalStart >= paintEnd || logicalStart + logicalExtent <= paintStart)
         return;
 

Modified: branches/subpixellayout/Source/WebCore/rendering/LayoutTypes.h (110784 => 110785)


--- branches/subpixellayout/Source/WebCore/rendering/LayoutTypes.h	2012-03-14 23:41:04 UTC (rev 110784)
+++ branches/subpixellayout/Source/WebCore/rendering/LayoutTypes.h	2012-03-14 23:41:29 UTC (rev 110785)
@@ -79,17 +79,17 @@
 
 inline LayoutPoint flooredLayoutPoint(const FloatPoint& p)
 {
-    return LayoutPoint(static_cast<int>(p.x()), static_cast<int>(p.y()));
+    return LayoutPoint(p.x(), p.y());
 }
 
 inline LayoutPoint flooredLayoutPoint(const FloatSize& s)
 {
-    return LayoutPoint(static_cast<int>(s.width()), static_cast<int>(s.height()));;
+    return LayoutPoint(s.width(), s.height());
 }
 
 inline LayoutSize flooredLayoutSize(const FloatPoint& p)
 {
-    return LayoutSize(static_cast<int>(p.x()), static_cast<int>(p.y()));
+    return LayoutSize(p.x(), p.y());
 }
 
 inline int roundToInt(LayoutUnit value)

Modified: branches/subpixellayout/Source/WebCore/rendering/RenderBlock.cpp (110784 => 110785)


--- branches/subpixellayout/Source/WebCore/rendering/RenderBlock.cpp	2012-03-14 23:41:04 UTC (rev 110784)
+++ branches/subpixellayout/Source/WebCore/rendering/RenderBlock.cpp	2012-03-14 23:41:29 UTC (rev 110785)
@@ -6581,7 +6581,7 @@
                     pos = curr->localToAbsolute();
                 else
                     pos = FloatPoint(additionalOffset.x() + box->x(), additionalOffset.y() + box->y());
-                box->addFocusRingRects(rects, LayoutPoint(pos));
+                box->addFocusRingRects(rects, flooredLayoutPoint(pos));
             }
         }
     }

Modified: branches/subpixellayout/Source/WebCore/rendering/RenderBlockLineLayout.cpp (110784 => 110785)


--- branches/subpixellayout/Source/WebCore/rendering/RenderBlockLineLayout.cpp	2012-03-14 23:41:04 UTC (rev 110784)
+++ branches/subpixellayout/Source/WebCore/rendering/RenderBlockLineLayout.cpp	2012-03-14 23:41:29 UTC (rev 110785)
@@ -2690,8 +2690,8 @@
     const Font& font = style()->font();
     DEFINE_STATIC_LOCAL(AtomicString, ellipsisStr, (&horizontalEllipsis, 1));
     const Font& firstLineFont = firstLineStyle()->font();
-    LayoutUnit firstLineEllipsisWidth = firstLineFont.width(constructTextRun(this, firstLineFont, &horizontalEllipsis, 1, firstLineStyle()));
-    LayoutUnit ellipsisWidth = (font == firstLineFont) ? firstLineEllipsisWidth : static_cast<LayoutUnit>(font.width(constructTextRun(this, font, &horizontalEllipsis, 1, style())));
+    int firstLineEllipsisWidth = firstLineFont.width(constructTextRun(this, firstLineFont, &horizontalEllipsis, 1, firstLineStyle()));
+    int ellipsisWidth = (font == firstLineFont) ? firstLineEllipsisWidth : font.width(constructTextRun(this, font, &horizontalEllipsis, 1, style()));
 
     // For LTR text truncation, we want to get the right edge of our padding box, and then we want to see
     // if the right edge of a line box exceeds that.  For RTL, we use the left edge of the padding box and

Modified: branches/subpixellayout/Source/WebCore/rendering/RenderImage.cpp (110784 => 110785)


--- branches/subpixellayout/Source/WebCore/rendering/RenderImage.cpp	2012-03-14 23:41:04 UTC (rev 110784)
+++ branches/subpixellayout/Source/WebCore/rendering/RenderImage.cpp	2012-03-14 23:41:29 UTC (rev 110785)
@@ -518,16 +518,15 @@
         RenderObject* containingBlock = isPositioned() ? container() : this->containingBlock();
         if (containingBlock->isBox()) {
             RenderBox* box = toRenderBox(containingBlock);
-            containerSize = IntSize(box->availableWidth(), box->availableHeight()); // Already contains zooming information.
+            containerSize = IntSize(roundToInt(box->availableWidth()), roundToInt(box->availableHeight())); // Already contains zooming information.
         }
     } else {
         // Propagate the current zoomed image size to the image resource, otherwhise the image size will remain the same on-screen.
         CachedImage* cachedImage = m_imageResource->cachedImage();
         if (cachedImage && cachedImage->image()) {
             containerSize = cachedImage->image()->size();
-            // FIXME: Remove unnecessary rounding when layout is off ints: webkit.org/b/63656
-            containerSize.setWidth(static_cast<int>(containerSize.width() * style()->effectiveZoom()));
-            containerSize.setHeight(static_cast<int>(containerSize.height() * style()->effectiveZoom()));
+            containerSize.setWidth(roundToInt(containerSize.width() * style()->effectiveZoom()));
+            containerSize.setHeight(roundToInt(containerSize.height() * style()->effectiveZoom()));
         }
     }
 

Modified: branches/subpixellayout/Source/WebCore/rendering/RenderListBox.cpp (110784 => 110785)


--- branches/subpixellayout/Source/WebCore/rendering/RenderListBox.cpp	2012-03-14 23:41:04 UTC (rev 110784)
+++ branches/subpixellayout/Source/WebCore/rendering/RenderListBox.cpp	2012-03-14 23:41:29 UTC (rev 110785)
@@ -345,7 +345,7 @@
 void RenderListBox::paintScrollbar(PaintInfo& paintInfo, const LayoutPoint& paintOffset)
 {
     if (m_vBar) {
-        IntRect scrollRect(paintOffset.x() + width() - borderRight() - m_vBar->width(),
+        IntRect scrollRect = pixelSnappedIntRect(paintOffset.x() + width() - borderRight() - m_vBar->width(),
             paintOffset.y() + borderTop(),
             m_vBar->width(),
             height() - (borderTop() + borderBottom()));
_______________________________________________
webkit-changes mailing list
[email protected]
http://lists.webkit.org/mailman/listinfo.cgi/webkit-changes

Reply via email to