Subpixel layout: Remove unused pixel snapping functions.
authorzalan@apple.com <zalan@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 28 Aug 2014 19:48:50 +0000 (19:48 +0000)
committerzalan@apple.com <zalan@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 28 Aug 2014 19:48:50 +0000 (19:48 +0000)
https://bugs.webkit.org/show_bug.cgi?id=136341

Reviewed by Simon Fraser.

Let's not encourage integral snapping by having these functions around.

No change in functionality.

Source/WebCore:

* accessibility/AccessibilityObject.h:
(WebCore::AccessibilityObject::pixelSnappedElementRect): Deleted.
(WebCore::AccessibilityObject::pixelSnappedSize): Deleted.
* accessibility/mac/WebAccessibilityObjectWrapperMac.mm:
(-[WebAccessibilityObjectWrapper accessibilityAttributeValue:]):
* html/HTMLImageElement.cpp:
(WebCore::HTMLImageElement::width):
(WebCore::HTMLImageElement::height):
* page/FrameView.cpp:
(WebCore::FrameView::qualifiesAsVisuallyNonEmpty):
* platform/graphics/LayoutPoint.h:
(WebCore::snappedIntSize):
(WebCore::snapSizeToDevicePixel):
* platform/graphics/LayoutRect.h:
(WebCore::LayoutRect::pixelSnappedLocation): Deleted.
(WebCore::LayoutRect::pixelSnappedX): Deleted.
(WebCore::LayoutRect::pixelSnappedY): Deleted.
(WebCore::LayoutRect::pixelSnappedWidth): Deleted.
(WebCore::LayoutRect::pixelSnappedHeight): Deleted.
(WebCore::LayoutRect::pixelSnappedMaxX): Deleted.
(WebCore::LayoutRect::pixelSnappedMaxY): Deleted.
(WebCore::snappedIntRectFromEdges): Deleted.
* rendering/RenderBlockFlow.h:
(WebCore::RenderBlockFlow::pixelSnappedLogicalTopForFloat): Deleted.
(WebCore::RenderBlockFlow::pixelSnappedLogicalBottomForFloat): Deleted.
(WebCore::RenderBlockFlow::pixelSnappedLogicalLeftForFloat): Deleted.
(WebCore::RenderBlockFlow::pixelSnappedLogicalRightForFloat): Deleted.
* rendering/RenderBox.h:
(WebCore::RenderBox::pixelSnappedLogicalHeight):
(WebCore::RenderBox::pixelSnappedLogicalWidth):
(WebCore::RenderBox::pixelSnappedBorderBoxRect):
(WebCore::RenderBox::pixelSnappedWidth): Deleted.
(WebCore::RenderBox::pixelSnappedHeight): Deleted.
(WebCore::RenderBox::pixelSnappedFrameRect): Deleted.
* rendering/RenderFileUploadControl.cpp:
(WebCore::nodeWidth):
(WebCore::nodeHeight):
(WebCore::RenderFileUploadControl::maxFilenameWidth):
* rendering/RenderLayer.cpp:
(WebCore::RenderLayer::updateLayerPosition):
(WebCore::RenderLayer::isPointInResizeControl):
* rendering/RenderLayerCompositor.cpp:
(WebCore::RenderLayerCompositor::ensureRootLayer):
* rendering/RenderMediaControls.cpp:
(WebCore::RenderMediaControls::volumeSliderOffsetFromMuteButton):
* rendering/RenderMultiColumnSet.cpp:
(WebCore::RenderMultiColumnSet::paintColumnRules):
* rendering/RenderScrollbar.cpp:
(WebCore::RenderScrollbar::buttonRect):
* rendering/RenderView.h:

Source/WebKit2:

* Shared/WebRenderObject.cpp:
(WebKit::WebRenderObject::WebRenderObject):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@173073 268f45cc-cd09-0410-ab3c-d52691b4dbfc

20 files changed:
Source/WebCore/ChangeLog
Source/WebCore/accessibility/AccessibilityObject.h
Source/WebCore/accessibility/atk/WebKitAccessibleInterfaceImage.cpp
Source/WebCore/accessibility/mac/WebAccessibilityObjectWrapperMac.mm
Source/WebCore/html/HTMLImageElement.cpp
Source/WebCore/page/FrameView.cpp
Source/WebCore/platform/graphics/LayoutPoint.h
Source/WebCore/platform/graphics/LayoutRect.h
Source/WebCore/rendering/RenderBlockFlow.h
Source/WebCore/rendering/RenderBox.h
Source/WebCore/rendering/RenderFileUploadControl.cpp
Source/WebCore/rendering/RenderLayer.cpp
Source/WebCore/rendering/RenderLayerCompositor.cpp
Source/WebCore/rendering/RenderMediaControls.cpp
Source/WebCore/rendering/RenderMultiColumnSet.cpp
Source/WebCore/rendering/RenderScrollbar.cpp
Source/WebCore/rendering/RenderView.h
Source/WebKit/win/AccessibleBase.cpp
Source/WebKit2/ChangeLog
Source/WebKit2/Shared/WebRenderObject.cpp

index ba43bb0..61abb44 100644 (file)
@@ -1,3 +1,65 @@
+2014-08-28  Zalan Bujtas  <zalan@apple.com>
+
+        Subpixel layout: Remove unused pixel snapping functions.
+        https://bugs.webkit.org/show_bug.cgi?id=136341
+
+        Reviewed by Simon Fraser.
+
+        Let's not encourage integral snapping by having these functions around.
+        
+        No change in functionality.
+
+        * accessibility/AccessibilityObject.h:
+        (WebCore::AccessibilityObject::pixelSnappedElementRect): Deleted.
+        (WebCore::AccessibilityObject::pixelSnappedSize): Deleted.
+        * accessibility/mac/WebAccessibilityObjectWrapperMac.mm:
+        (-[WebAccessibilityObjectWrapper accessibilityAttributeValue:]):
+        * html/HTMLImageElement.cpp:
+        (WebCore::HTMLImageElement::width):
+        (WebCore::HTMLImageElement::height):
+        * page/FrameView.cpp:
+        (WebCore::FrameView::qualifiesAsVisuallyNonEmpty):
+        * platform/graphics/LayoutPoint.h:
+        (WebCore::snappedIntSize):
+        (WebCore::snapSizeToDevicePixel):
+        * platform/graphics/LayoutRect.h:
+        (WebCore::LayoutRect::pixelSnappedLocation): Deleted.
+        (WebCore::LayoutRect::pixelSnappedX): Deleted.
+        (WebCore::LayoutRect::pixelSnappedY): Deleted.
+        (WebCore::LayoutRect::pixelSnappedWidth): Deleted.
+        (WebCore::LayoutRect::pixelSnappedHeight): Deleted.
+        (WebCore::LayoutRect::pixelSnappedMaxX): Deleted.
+        (WebCore::LayoutRect::pixelSnappedMaxY): Deleted.
+        (WebCore::snappedIntRectFromEdges): Deleted.
+        * rendering/RenderBlockFlow.h:
+        (WebCore::RenderBlockFlow::pixelSnappedLogicalTopForFloat): Deleted.
+        (WebCore::RenderBlockFlow::pixelSnappedLogicalBottomForFloat): Deleted.
+        (WebCore::RenderBlockFlow::pixelSnappedLogicalLeftForFloat): Deleted.
+        (WebCore::RenderBlockFlow::pixelSnappedLogicalRightForFloat): Deleted.
+        * rendering/RenderBox.h:
+        (WebCore::RenderBox::pixelSnappedLogicalHeight):
+        (WebCore::RenderBox::pixelSnappedLogicalWidth):
+        (WebCore::RenderBox::pixelSnappedBorderBoxRect):
+        (WebCore::RenderBox::pixelSnappedWidth): Deleted.
+        (WebCore::RenderBox::pixelSnappedHeight): Deleted.
+        (WebCore::RenderBox::pixelSnappedFrameRect): Deleted.
+        * rendering/RenderFileUploadControl.cpp:
+        (WebCore::nodeWidth):
+        (WebCore::nodeHeight):
+        (WebCore::RenderFileUploadControl::maxFilenameWidth):
+        * rendering/RenderLayer.cpp:
+        (WebCore::RenderLayer::updateLayerPosition):
+        (WebCore::RenderLayer::isPointInResizeControl):
+        * rendering/RenderLayerCompositor.cpp:
+        (WebCore::RenderLayerCompositor::ensureRootLayer):
+        * rendering/RenderMediaControls.cpp:
+        (WebCore::RenderMediaControls::volumeSliderOffsetFromMuteButton):
+        * rendering/RenderMultiColumnSet.cpp:
+        (WebCore::RenderMultiColumnSet::paintColumnRules):
+        * rendering/RenderScrollbar.cpp:
+        (WebCore::RenderScrollbar::buttonRect):
+        * rendering/RenderView.h:
+
 2014-08-27  Enrica Casucci  <enrica@apple.com>
 
         textStylingAtPosition returns incorrect values after executing toggleBold, toggleItalic and toggleUnderline.
index 1a22776..0af09dd 100644 (file)
@@ -690,9 +690,7 @@ public:
     virtual LayoutRect boundingBoxRect() const { return LayoutRect(); }
     IntRect pixelSnappedBoundingBoxRect() const { return snappedIntRect(boundingBoxRect()); }
     virtual LayoutRect elementRect() const = 0;
-    IntRect pixelSnappedElementRect() const { return snappedIntRect(elementRect()); }
     LayoutSize size() const { return elementRect().size(); }
-    IntSize pixelSnappedSize() const { return elementRect().pixelSnappedSize(); }
     virtual IntPoint clickPoint();
     static IntRect boundingBoxForQuads(RenderObject*, const Vector<FloatQuad>&);
     virtual Path elementPath() const { return Path(); }
index 3b20936..2f4015f 100644 (file)
@@ -71,7 +71,7 @@ static void webkitAccessibleImageGetImageSize(AtkImage* image, gint* width, gint
     g_return_if_fail(ATK_IMAGE(image));
     returnIfWebKitAccessibleIsInvalid(WEBKIT_ACCESSIBLE(image));
 
-    IntSize size = core(image)->pixelSnappedSize();
+    IntSize size = core(image)->elementRect().pixelSnappedSize();
 
     if (width)
         *width = size.width();
index dc21ff1..48bd667 100644 (file)
@@ -2494,7 +2494,7 @@ static NSString* roleValueToNSString(AccessibilityRole value)
         return [NSNumber numberWithBool: m_object->isEnabled()];
     
     if ([attributeName isEqualToString: NSAccessibilitySizeAttribute]) {
-        IntSize s = m_object->pixelSnappedSize();
+        IntSize s = m_object->elementRect().pixelSnappedSize();
         return [NSValue valueWithSize: NSMakeSize(s.width(), s.height())];
     }
     
index f700939..c0f9ecc 100644 (file)
@@ -303,7 +303,7 @@ int HTMLImageElement::width(bool ignorePendingStylesheets)
         document().updateLayout();
 
     RenderBox* box = renderBox();
-    return box ? adjustForAbsoluteZoom(box->contentBoxRect().pixelSnappedWidth(), *box) : 0;
+    return box ? adjustForAbsoluteZoom(box->contentBoxRect().pixelSnappedSize().width(), *box) : 0;
 }
 
 int HTMLImageElement::height(bool ignorePendingStylesheets)
@@ -326,7 +326,7 @@ int HTMLImageElement::height(bool ignorePendingStylesheets)
         document().updateLayout();
 
     RenderBox* box = renderBox();
-    return box ? adjustForAbsoluteZoom(box->contentBoxRect().pixelSnappedHeight(), *box) : 0;
+    return box ? adjustForAbsoluteZoom(box->contentBoxRect().pixelSnappedSize().height(), *box) : 0;
 }
 
 int HTMLImageElement::naturalWidth() const
index 11b6e15..339233d 100644 (file)
@@ -3871,7 +3871,7 @@ bool FrameView::qualifiesAsVisuallyNonEmpty() const
 
     // Require the document to grow a bit.
     static const int documentHeightThreshold = 200;
-    if (documentElement->renderBox()->layoutOverflowRect().pixelSnappedHeight() < documentHeightThreshold)
+    if (documentElement->renderBox()->layoutOverflowRect().pixelSnappedSize().height() < documentHeightThreshold)
         return false;
 
     // The first few hundred characters rarely contain the interesting content of the page.
index cda67fb..24087ad 100644 (file)
@@ -185,7 +185,6 @@ inline IntSize snappedIntSize(const LayoutSize& size, const LayoutPoint& locatio
         LayoutUnit fraction = b.fraction();
         return roundToInt(fraction + a) - roundToInt(fraction);
     };
-
     return IntSize(snap(size.width(), location.x()), snap(size.height(), location.y()));
 }
 
@@ -210,7 +209,6 @@ inline FloatSize snapSizeToDevicePixel(const LayoutSize& size, const LayoutPoint
         LayoutUnit fraction = b.fraction();
         return roundToDevicePixel(fraction + a, pixelSnappingFactor) - roundToDevicePixel(fraction, pixelSnappingFactor);
     };
-
     return FloatSize(snap(size.width(), location.x()), snap(size.height(), location.y()));
 }
 
index dac68fa..bd6f5d1 100644 (file)
@@ -55,7 +55,6 @@ public:
     LayoutPoint location() const { return m_location; }
     LayoutSize size() const { return m_size; }
 
-    IntPoint pixelSnappedLocation() const { return roundedIntPoint(m_location); }
     IntSize pixelSnappedSize() const { return snappedIntSize(m_size, m_location); }
 
     void setLocation(const LayoutPoint& location) { m_location = location; }
@@ -68,13 +67,6 @@ public:
     LayoutUnit width() const { return m_size.width(); }
     LayoutUnit height() const { return m_size.height(); }
 
-    int pixelSnappedX() const { return x().round(); }
-    int pixelSnappedY() const { return y().round(); }
-    int pixelSnappedWidth() const { return snappedIntSize(m_size, m_location).width(); }
-    int pixelSnappedHeight() const { return snappedIntSize(m_size, m_location).height(); }
-    int pixelSnappedMaxX() const { return (m_location.x() + m_size.width()).round(); }
-    int pixelSnappedMaxY() const { return (m_location.y() + m_size.height()).round(); }
-
     void setX(LayoutUnit x) { m_location.setX(x); }
     void setY(LayoutUnit y) { m_location.setY(y); }
     void setWidth(LayoutUnit width) { m_size.setWidth(width); }
@@ -201,9 +193,7 @@ inline bool operator!=(const LayoutRect& a, const LayoutRect& b)
     return a.location() != b.location() || a.size() != b.size();
 }
 
-WEBCORE_EXPORT IntRect enclosingIntRect(const LayoutRect&);
-WEBCORE_EXPORT LayoutRect enclosingLayoutRect(const FloatRect&);
-
+// Integral snapping functions.
 inline IntRect snappedIntRect(const LayoutRect& rect)
 {
     return IntRect(roundedIntPoint(rect.location()), snappedIntSize(rect.size(), rect.location()));
@@ -214,18 +204,15 @@ inline IntRect snappedIntRect(LayoutUnit left, LayoutUnit top, LayoutUnit width,
     return IntRect(IntPoint(left.round(), top.round()), snappedIntSize(LayoutSize(width, height), LayoutPoint(left, top)));
 }
 
-inline IntRect snappedIntRectFromEdges(LayoutUnit left, LayoutUnit top, LayoutUnit right, LayoutUnit bottom)
-{
-    return IntRect(IntPoint(left.round(), top.round()), snappedIntSize(LayoutSize(right - left, bottom - top), LayoutPoint(left, top)));
-}
-
 inline IntRect snappedIntRect(LayoutPoint location, LayoutSize size)
 {
     return IntRect(roundedIntPoint(location), snappedIntSize(size, location));
 }
 
-FloatRect encloseRectToDevicePixels(const LayoutRect&, float pixelSnappingFactor);
+WEBCORE_EXPORT IntRect enclosingIntRect(const LayoutRect&);
+WEBCORE_EXPORT LayoutRect enclosingLayoutRect(const FloatRect&);
 
+// Device pixel snapping functions.
 inline FloatRect snapRectToDevicePixels(const LayoutRect& rect, float pixelSnappingFactor)
 {
     return FloatRect(FloatPoint(roundToDevicePixel(rect.x(), pixelSnappingFactor), roundToDevicePixel(rect.y(), pixelSnappingFactor)), snapSizeToDevicePixel(rect.size(), rect.location(), pixelSnappingFactor));
@@ -247,6 +234,8 @@ inline FloatRect snapRectToDevicePixelsWithWritingDirection(const LayoutRect& re
     return snapRectToDevicePixels(rect, deviceScaleFactor);
 }
 
+FloatRect encloseRectToDevicePixels(const LayoutRect&, float pixelSnappingFactor);
+
 } // namespace WebCore
 
 #endif // LayoutRect_h
index ded9223..723d77c 100644 (file)
@@ -301,11 +301,6 @@ public:
     LayoutUnit logicalHeightForFloat(const FloatingObject* floatingObject) const { return isHorizontalWritingMode() ? floatingObject->height() : floatingObject->width(); }
     LayoutSize logicalSizeForFloat(const FloatingObject* floatingObject) const { return isHorizontalWritingMode() ? LayoutSize(floatingObject->width(), floatingObject->height()) : LayoutSize(floatingObject->height(), floatingObject->width()); }
 
-    int pixelSnappedLogicalTopForFloat(const FloatingObject* floatingObject) const { return isHorizontalWritingMode() ? floatingObject->frameRect().pixelSnappedY() : floatingObject->frameRect().pixelSnappedX(); }
-    int pixelSnappedLogicalBottomForFloat(const FloatingObject* floatingObject) const { return isHorizontalWritingMode() ? floatingObject->frameRect().pixelSnappedMaxY() : floatingObject->frameRect().pixelSnappedMaxX(); }
-    int pixelSnappedLogicalLeftForFloat(const FloatingObject* floatingObject) const { return isHorizontalWritingMode() ? floatingObject->frameRect().pixelSnappedX() : floatingObject->frameRect().pixelSnappedY(); }
-    int pixelSnappedLogicalRightForFloat(const FloatingObject* floatingObject) const { return isHorizontalWritingMode() ? floatingObject->frameRect().pixelSnappedMaxX() : floatingObject->frameRect().pixelSnappedMaxY(); }
-
     void setLogicalTopForFloat(FloatingObject* floatingObject, LayoutUnit logicalTop)
     {
         if (isHorizontalWritingMode())
index ecedf91..ee20976 100644 (file)
@@ -68,9 +68,6 @@ public:
     LayoutUnit width() const { return m_frameRect.width(); }
     LayoutUnit height() const { return m_frameRect.height(); }
 
-    int pixelSnappedWidth() const { return m_frameRect.pixelSnappedWidth(); }
-    int pixelSnappedHeight() const { return m_frameRect.pixelSnappedHeight(); }
-
     // These represent your location relative to your container as a physical offset.
     // In layout related methods you almost always want the logical location (e.g. x() and y()).
     LayoutUnit top() const { return topLeftLocation().y(); }
@@ -92,8 +89,8 @@ public:
     LayoutUnit constrainLogicalHeightByMinMax(LayoutUnit) const;
     LayoutUnit constrainContentBoxLogicalHeightByMinMax(LayoutUnit) const;
 
-    int pixelSnappedLogicalHeight() const { return style().isHorizontalWritingMode() ? pixelSnappedHeight() : pixelSnappedWidth(); }
-    int pixelSnappedLogicalWidth() const { return style().isHorizontalWritingMode() ? pixelSnappedWidth() : pixelSnappedHeight(); }
+    int pixelSnappedLogicalHeight() const { return style().isHorizontalWritingMode() ? pixelSnappedSize().height() : pixelSnappedSize().width(); }
+    int pixelSnappedLogicalWidth() const { return style().isHorizontalWritingMode() ? pixelSnappedSize().width() : pixelSnappedSize().height(); }
 
     void setLogicalLeft(LayoutUnit left)
     {
@@ -149,7 +146,6 @@ public:
     void move(LayoutUnit dx, LayoutUnit dy) { m_frameRect.move(dx, dy); }
 
     LayoutRect frameRect() const { return m_frameRect; }
-    IntRect pixelSnappedFrameRect() const { return snappedIntRect(m_frameRect); }
     void setFrameRect(const LayoutRect& rect) { m_frameRect = rect; }
 
     LayoutRect marginBoxRect() const
@@ -160,7 +156,7 @@ public:
     }
     LayoutRect borderBoxRect() const { return LayoutRect(LayoutPoint(), size()); }
     LayoutRect paddingBoxRect() const { return LayoutRect(borderLeft(), borderTop(), contentWidth() + paddingLeft() + paddingRight(), contentHeight() + paddingTop() + paddingBottom()); }
-    IntRect pixelSnappedBorderBoxRect() const { return IntRect(IntPoint(), m_frameRect.pixelSnappedSize()); }
+    IntRect pixelSnappedBorderBoxRect() const { return IntRect(IntPoint(), pixelSnappedSize()); }
     virtual IntRect borderBoundingBox() const override final { return pixelSnappedBorderBoxRect(); }
 
     WEBCORE_EXPORT RoundedRect::Radii borderRadii() const;
index 55e6e62..501c51e 100644 (file)
@@ -95,13 +95,13 @@ void RenderFileUploadControl::updateFromElement()
 
 static int nodeWidth(Node* node)
 {
-    return (node && node->renderBox()) ? node->renderBox()->pixelSnappedWidth() : 0;
+    return (node && node->renderBox()) ? node->renderBox()->pixelSnappedSize().width() : 0;
 }
 
 #if PLATFORM(IOS)
 static int nodeHeight(Node* node)
 {
-    return (node && node->renderBox()) ? node->renderBox()->pixelSnappedHeight() : 0;
+    return (node && node->renderBox()) ? node->renderBox()->pixelSnappedSize().height() : 0;
 }
 #endif
 
@@ -110,7 +110,7 @@ int RenderFileUploadControl::maxFilenameWidth() const
 #if PLATFORM(IOS)
     int iconWidth = nodeHeight(uploadButton());
 #endif
-    return std::max(0, contentBoxRect().pixelSnappedWidth() - nodeWidth(uploadButton()) - afterButtonSpacing
+    return std::max(0, contentBoxRect().pixelSnappedSize().width() - nodeWidth(uploadButton()) - afterButtonSpacing
         - (inputElement().icon() ? iconWidth + iconFilenameSpacing : 0));
 }
 
index 9b1f2b1..4c774d6 100644 (file)
@@ -1226,7 +1226,7 @@ bool RenderLayer::updateLayerPosition()
         localPoint += inlineBoundingBoxOffset;
     } else if (RenderBox* box = renderBox()) {
         // FIXME: Is snapping the size really needed here for the RenderBox case?
-        setSize(snappedIntSize(box->size(), box->location()));
+        setSize(box->pixelSnappedSize());
         localPoint += box->topLeftLocationOffset();
     }
 
@@ -3558,7 +3558,7 @@ bool RenderLayer::isPointInResizeControl(const IntPoint& absolutePoint) const
 
     IntPoint localPoint = roundedIntPoint(absoluteToContents(absolutePoint));
 
-    IntRect localBounds(0, 0, box->pixelSnappedWidth(), box->pixelSnappedHeight());
+    IntRect localBounds(IntPoint(), box->pixelSnappedSize());
     return resizerCornerRect(this, localBounds).contains(localPoint);
 }
 
index 37efd82..567c366 100644 (file)
@@ -3241,7 +3241,7 @@ void RenderLayerCompositor::ensureRootLayer()
 #ifndef NDEBUG
         m_rootContentLayer->setName("content root");
 #endif
-        IntRect overflowRect = m_renderView.pixelSnappedLayoutOverflowRect();
+        IntRect overflowRect = snappedIntRect(m_renderView.layoutOverflowRect());
         m_rootContentLayer->setSize(FloatSize(overflowRect.maxX(), overflowRect.maxY()));
         m_rootContentLayer->setPosition(FloatPoint());
 
index 2e742e4..499e42d 100644 (file)
@@ -229,7 +229,7 @@ IntPoint RenderMediaControls::volumeSliderOffsetFromMuteButton(RenderBox* muteBu
     int y = yOffset * zoomLevel + muteButtonBox->pixelSnappedOffsetHeight() - size.height();
     FloatPoint absPoint = muteButtonBox->localToAbsolute(FloatPoint(muteButtonBox->pixelSnappedOffsetLeft(), y), IsFixed | UseTransforms);
     if (absPoint.y() < 0)
-        y = muteButtonBox->pixelSnappedHeight();
+        y = muteButtonBox->pixelSnappedSize().height();
     return IntPoint(xOffset * zoomLevel, y);
 }
 
index 844a7dc..33ab794 100644 (file)
@@ -614,7 +614,7 @@ void RenderMultiColumnSet::paintColumnRules(PaintInfo& paintInfo, const LayoutPo
                 LayoutUnit ruleRight = isHorizontalWritingMode() ? ruleLeft + ruleThickness : ruleLeft + contentWidth();
                 LayoutUnit ruleTop = isHorizontalWritingMode() ? paintOffset.y() + borderTop() + paddingTop() : paintOffset.y() + ruleLogicalLeft - ruleThickness / 2 + ruleAdd;
                 LayoutUnit ruleBottom = isHorizontalWritingMode() ? ruleTop + contentHeight() : ruleTop + ruleThickness;
-                IntRect pixelSnappedRuleRect = snappedIntRectFromEdges(ruleLeft, ruleTop, ruleRight, ruleBottom);
+                IntRect pixelSnappedRuleRect = snappedIntRect(ruleLeft, ruleTop, ruleRight - ruleLeft, ruleBottom - ruleTop);
                 drawLineForBoxSide(paintInfo.context, pixelSnappedRuleRect.x(), pixelSnappedRuleRect.y(), pixelSnappedRuleRect.maxX(), pixelSnappedRuleRect.maxY(), boxSide, ruleColor, ruleStyle, 0, 0, antialias);
             }
             
index 82e5dd6..c2c944c 100644 (file)
@@ -269,27 +269,27 @@ IntRect RenderScrollbar::buttonRect(ScrollbarPart partType)
     partRenderer->layout();
     
     bool isHorizontal = orientation() == HorizontalScrollbar;
+    IntSize pixelSnappedIntSize = partRenderer->pixelSnappedSize();
     if (partType == BackButtonStartPart)
-        return IntRect(location(), IntSize(isHorizontal ? partRenderer->pixelSnappedWidth() : width(), isHorizontal ? height() : partRenderer->pixelSnappedHeight()));
+        return IntRect(location(), IntSize(isHorizontal ? pixelSnappedIntSize.width() : width(), isHorizontal ? height() : pixelSnappedIntSize.height()));
     if (partType == ForwardButtonEndPart)
-        return IntRect(isHorizontal ? x() + width() - partRenderer->pixelSnappedWidth() : x(),
-                       isHorizontal ? y() : y() + height() - partRenderer->pixelSnappedHeight(),
-                       isHorizontal ? partRenderer->pixelSnappedWidth() : width(),
-                       isHorizontal ? height() : partRenderer->pixelSnappedHeight());
+        return IntRect(isHorizontal ? x() + width() - pixelSnappedIntSize.width() : x(), isHorizontal ? y() : y() + height() - pixelSnappedIntSize.height(),
+                       isHorizontal ? pixelSnappedIntSize.width() : width(),
+                       isHorizontal ? height() : pixelSnappedIntSize.height());
     
     if (partType == ForwardButtonStartPart) {
         IntRect previousButton = buttonRect(BackButtonStartPart);
         return IntRect(isHorizontal ? x() + previousButton.width() : x(),
                        isHorizontal ? y() : y() + previousButton.height(),
-                       isHorizontal ? partRenderer->pixelSnappedWidth() : width(),
-                       isHorizontal ? height() : partRenderer->pixelSnappedHeight());
+                       isHorizontal ? pixelSnappedIntSize.width() : width(),
+                       isHorizontal ? height() : pixelSnappedIntSize.height());
     }
     
     IntRect followingButton = buttonRect(ForwardButtonEndPart);
-    return IntRect(isHorizontal ? x() + width() - followingButton.width() - partRenderer->pixelSnappedWidth() : x(),
-                   isHorizontal ? y() : y() + height() - followingButton.height() - partRenderer->pixelSnappedHeight(),
-                   isHorizontal ? partRenderer->pixelSnappedWidth() : width(),
-                   isHorizontal ? height() : partRenderer->pixelSnappedHeight());
+    return IntRect(isHorizontal ? x() + width() - followingButton.width() - pixelSnappedIntSize.width() : x(),
+                   isHorizontal ? y() : y() + height() - followingButton.height() - pixelSnappedIntSize.height(),
+                   isHorizontal ? pixelSnappedIntSize.width() : width(),
+                   isHorizontal ? height() : pixelSnappedIntSize.height());
 }
 
 IntRect RenderScrollbar::trackRect(int startLength, int endLength)
index fcc98f0..4768c42 100644 (file)
@@ -218,8 +218,6 @@ public:
     void removeRenderCounter() { ASSERT(m_renderCounterCount > 0); m_renderCounterCount--; }
     bool hasRenderCounters() { return m_renderCounterCount; }
     
-    IntRect pixelSnappedLayoutOverflowRect() const { return snappedIntRect(layoutOverflowRect()); }
-
     ImageQualityController& imageQualityController();
 
 #if ENABLE(CSS_FILTERS)
index 8858c77..82e83c8 100644 (file)
@@ -712,7 +712,7 @@ HRESULT STDMETHODCALLTYPE AccessibleBase::accLocation(long* left, long* top, lon
     if (!childObj->documentFrameView())
         return E_FAIL;
 
-    IntRect screenRect(childObj->documentFrameView()->contentsToScreen(childObj->pixelSnappedElementRect()));
+    IntRect screenRect(childObj->documentFrameView()->contentsToScreen(snappedIntRect(childObj->elementRect())));
     *left = screenRect.x();
     *top = screenRect.y();
     *width = screenRect.width();
index 47f9015..7e17b2f 100644 (file)
@@ -1,3 +1,17 @@
+2014-08-28  Zalan Bujtas  <zalan@apple.com>
+
+        Subpixel layout: Remove unused pixel snapping functions.
+        https://bugs.webkit.org/show_bug.cgi?id=136341
+
+        Reviewed by Simon Fraser.
+
+        Let's not encourage integral snapping by having these functions around.
+        
+        No change in functionality.
+
+        * Shared/WebRenderObject.cpp:
+        (WebKit::WebRenderObject::WebRenderObject):
+
 2014-08-27  Enrica Casucci  <enrica@apple.com>
 
         textStylingAtPosition returns incorrect values after executing toggleBold, toggleItalic and toggleUnderline.
index 1104d44..6cedada 100644 (file)
@@ -87,7 +87,7 @@ WebRenderObject::WebRenderObject(RenderObject* renderer, bool shouldIncludeDesce
     m_absolutePosition = flooredIntPoint(renderer->localToAbsolute());
 
     if (renderer->isBox())
-        m_frameRect = toRenderBox(renderer)->pixelSnappedFrameRect();
+        m_frameRect = snappedIntRect(toRenderBox(renderer)->frameRect());
     else if (renderer->isText()) {
         m_frameRect = toRenderText(renderer)->linesBoundingBox();
         m_frameRect.setLocation(toRenderText(renderer)->firstRunLocation());