Title: [110717] branches/subpixellayout/Source

Diff

Modified: branches/subpixellayout/Source/WebCore/rendering/RenderBoxModelObject.cpp (110716 => 110717)


--- branches/subpixellayout/Source/WebCore/rendering/RenderBoxModelObject.cpp	2012-03-14 18:12:29 UTC (rev 110716)
+++ branches/subpixellayout/Source/WebCore/rendering/RenderBoxModelObject.cpp	2012-03-14 18:16:49 UTC (rev 110717)
@@ -879,55 +879,53 @@
     }
 }
 
-static inline LayoutUnit resolveWidthForRatio(LayoutUnit height, const FloatSize& intrinsicRatio)
+static inline int resolveWidthForRatio(int height, const FloatSize& intrinsicRatio)
 {
-    // FIXME: Remove unnecessary rounding when layout is off ints: webkit.org/b/63656
-    return static_cast<LayoutUnit>(ceilf(height * intrinsicRatio.width() / intrinsicRatio.height()));
+    return ceilf(height * intrinsicRatio.width() / intrinsicRatio.height());
 }
 
-static inline LayoutUnit resolveHeightForRatio(LayoutUnit width, const FloatSize& intrinsicRatio)
+static inline int resolveHeightForRatio(int width, const FloatSize& intrinsicRatio)
 {
-    // FIXME: Remove unnecessary rounding when layout is off ints: webkit.org/b/63656
-    return static_cast<LayoutUnit>(ceilf(width * intrinsicRatio.height() / intrinsicRatio.width()));
+    return ceilf(width * intrinsicRatio.height() / intrinsicRatio.width());
 }
 
-static inline LayoutSize resolveAgainstIntrinsicWidthOrHeightAndRatio(const LayoutSize& size, const FloatSize& intrinsicRatio, LayoutUnit useWidth, LayoutUnit useHeight)
+static inline IntSize resolveAgainstIntrinsicWidthOrHeightAndRatio(const IntSize& size, const FloatSize& intrinsicRatio, int useWidth, int useHeight)
 {
     if (intrinsicRatio.isEmpty()) {
         if (useWidth)
-            return LayoutSize(useWidth, size.height());
-        return LayoutSize(size.width(), useHeight);
+            return IntSize(useWidth, size.height());
+        return IntSize(size.width(), useHeight);
     }
 
     if (useWidth)
-        return LayoutSize(useWidth, resolveHeightForRatio(useWidth, intrinsicRatio));
-    return LayoutSize(resolveWidthForRatio(useHeight, intrinsicRatio), useHeight);
+        return IntSize(useWidth, resolveHeightForRatio(useWidth, intrinsicRatio));
+    return IntSize(resolveWidthForRatio(useHeight, intrinsicRatio), useHeight);
 }
 
-static inline LayoutSize resolveAgainstIntrinsicRatio(const LayoutSize& size, const FloatSize& intrinsicRatio)
+static inline IntSize resolveAgainstIntrinsicRatio(const IntSize& size, const FloatSize& intrinsicRatio)
 {
     // Two possible solutions: (size.width(), solutionHeight) or (solutionWidth, size.height())
     // "... must be assumed to be the largest dimensions..." = easiest answer: the rect with the largest surface area.
 
-    LayoutUnit solutionWidth = resolveWidthForRatio(size.height(), intrinsicRatio);
-    LayoutUnit solutionHeight = resolveHeightForRatio(size.width(), intrinsicRatio);
+    int solutionWidth = resolveWidthForRatio(size.height(), intrinsicRatio);
+    int solutionHeight = resolveHeightForRatio(size.width(), intrinsicRatio);
     if (solutionWidth <= size.width()) {
         if (solutionHeight <= size.height()) {
             // If both solutions fit, choose the one covering the larger area.
-            LayoutUnit areaOne = solutionWidth * size.height();
-            LayoutUnit areaTwo = size.width() * solutionHeight;
+            int areaOne = solutionWidth * size.height();
+            int areaTwo = size.width() * solutionHeight;
             if (areaOne < areaTwo)
-                return LayoutSize(size.width(), solutionHeight);
-            return LayoutSize(solutionWidth, size.height());
+                return IntSize(size.width(), solutionHeight);
+            return IntSize(solutionWidth, size.height());
         }
 
         // Only the first solution fits.
-        return LayoutSize(solutionWidth, size.height());
+        return IntSize(solutionWidth, size.height());
     }
 
     // Only the second solution fits, assert that.
     ASSERT(solutionHeight <= size.height());
-    return LayoutSize(size.width(), solutionHeight);
+    return IntSize(size.width(), solutionHeight);
 }
 
 IntSize RenderBoxModelObject::calculateImageIntrinsicDimensions(StyleImage* image, const IntSize& positioningAreaSize) const
@@ -969,13 +967,13 @@
     // * and no intrinsic aspect ratio, then the missing dimension is assumed to be the size of the rectangle that
     //   establishes the coordinate system for the 'background-position' property.
     if ((resolvedWidth && !resolvedHeight) || (!resolvedWidth && resolvedHeight))
-        return expandedIntSize(resolveAgainstIntrinsicWidthOrHeightAndRatio(positioningAreaSize, intrinsicRatio, resolvedWidth, resolvedHeight));
+        return resolveAgainstIntrinsicWidthOrHeightAndRatio(positioningAreaSize, intrinsicRatio, resolvedWidth, resolvedHeight);
 
     // If the image has no intrinsic dimensions and has an intrinsic ratio the dimensions must be assumed to be the
     // largest dimensions at that ratio such that neither dimension exceeds the dimensions of the rectangle that
     // establishes the coordinate system for the 'background-position' property.
     if (!resolvedWidth && !resolvedHeight && !intrinsicRatio.isEmpty())
-        return expandedIntSize(resolveAgainstIntrinsicRatio(positioningAreaSize, intrinsicRatio));
+        return resolveAgainstIntrinsicRatio(positioningAreaSize, intrinsicRatio);
 
     // If the image has no intrinsic ratio either, then the dimensions must be assumed to be the rectangle that
     // establishes the coordinate system for the 'background-position' property.
@@ -1062,7 +1060,7 @@
 void RenderBoxModelObject::BackgroundImageGeometry::useFixedAttachment(const IntPoint& attachmentPoint)
 {
     IntPoint alignedPoint = attachmentPoint;
-    m_phase.move(max<LayoutUnit>(alignedPoint.x() - m_destRect.x(), 0), max<LayoutUnit>(alignedPoint.y() - m_destRect.y(), 0));
+    m_phase.move(max(alignedPoint.x() - m_destRect.x(), 0), max(alignedPoint.y() - m_destRect.y(), 0));
 }
 
 void RenderBoxModelObject::BackgroundImageGeometry::clip(const IntRect& clipRect)
@@ -1122,11 +1120,11 @@
         // its margins. Since those were added in already, we have to factor them out when computing
         // the background positioning area.
         if (isRoot()) {
-            positioningAreaSize = roundedIntSize(LayoutSize(toRenderBox(this)->width() - left - right, toRenderBox(this)->height() - top - bottom));
+            positioningAreaSize = IntSize(toRenderBox(this)->pixelSnappedWidth() - left - right, toRenderBox(this)->pixelSnappedHeight() - top - bottom);
             left += marginLeft();
             top += marginTop();
         } else
-            positioningAreaSize = roundedIntSize(LayoutSize(alignedRect.width() - left - right, alignedRect.height() - top - bottom));
+            positioningAreaSize = IntSize(alignedRect.width() - left - right, alignedRect.height() - top - bottom);
     } else {
         geometry.setDestRect(pixelSnappedIntRect(viewRect()));
         positioningAreaSize = geometry.destRect().size();

Modified: branches/subpixellayout/Source/WebCore/rendering/RenderInline.cpp (110716 => 110717)


--- branches/subpixellayout/Source/WebCore/rendering/RenderInline.cpp	2012-03-14 18:12:29 UTC (rev 110716)
+++ branches/subpixellayout/Source/WebCore/rendering/RenderInline.cpp	2012-03-14 18:16:49 UTC (rev 110717)
@@ -1453,15 +1453,16 @@
 
     int offset = style()->outlineOffset();
 
-    LayoutUnit top = paintOffset.y() + thisline.y() - offset;
-    LayoutUnit left = paintOffset.x() + thisline.x() - offset;
-    LayoutUnit bottom = paintOffset.y() + thisline.maxY() + offset;
-    LayoutUnit right = paintOffset.x() + thisline.maxX() + offset;
+    LayoutRect box(LayoutPoint(paintOffset.x() + thisline.x() - offset, paintOffset.y() + thisline.y() - offset),
+        LayoutSize(thisline.width() + offset, thisline.height() + offset));
 
-    IntRect pixelSnappedBox = pixelSnappedIntRectFromEdges(left, top, right, bottom);
+    IntRect pixelSnappedBox = pixelSnappedIntRect(box);
 
-    int snappedAndAdjustedNextLineLeft = roundToInt(paintOffset.x() + nextline.x());
-    int snappedAndAdjustedNextLineRight = snapSizeToPixel(nextline.width(), nextline.x() + paintOffset.x()) + snappedAndAdjustedNextLineLeft;
+    int pixelSnappedLastLineLeft = roundToInt(paintOffset.x() + lastline.x());
+    int pixelSnappedLastLineRight = snapSizeToPixel(lastline.width(), paintOffset.x() + lastline.x()) + pixelSnappedLastLineLeft;
+
+    int pixelSnappedNextLineLeft = roundToInt(paintOffset.x() + nextline.x());
+    int pixelSnappedNextLineRight = snapSizeToPixel(nextline.width(), paintOffset.x() + nextline.x()) + pixelSnappedNextLineLeft;
     
     // left edge
     drawLineForBoxSide(graphicsContext,
@@ -1491,8 +1492,7 @@
         drawLineForBoxSide(graphicsContext,
             pixelSnappedBox.x() - outlineWidth,
             pixelSnappedBox.y() - outlineWidth,
-            // FIXME: What's this random constant?
-            min(pixelSnappedBox.maxX() + outlineWidth, (lastline.isEmpty() ? 1000000 : snappedAndAdjustedNextLineLeft)),
+            min(pixelSnappedBox.maxX() + outlineWidth, (lastline.isEmpty() ? 1000000 : pixelSnappedLastLineLeft)),
             pixelSnappedBox.y(),
             BSTop, outlineColor, outlineStyle,
             outlineWidth,
@@ -1501,7 +1501,7 @@
     
     if (lastline.maxX() < thisline.maxX())
         drawLineForBoxSide(graphicsContext,
-            max(lastline.isEmpty() ? -1000000 : snappedAndAdjustedNextLineRight, pixelSnappedBox.x() - outlineWidth),
+            max(lastline.isEmpty() ? -1000000 : pixelSnappedLastLineRight, pixelSnappedBox.x() - outlineWidth),
             pixelSnappedBox.y() - outlineWidth,
             pixelSnappedBox.maxX() + outlineWidth,
             pixelSnappedBox.y(),
@@ -1525,7 +1525,7 @@
         drawLineForBoxSide(graphicsContext,
             pixelSnappedBox.x() - outlineWidth,
             pixelSnappedBox.maxY(),
-            min(pixelSnappedBox.maxX() + outlineWidth, !nextline.isEmpty() ? snappedAndAdjustedNextLineLeft + 1 : 1000000),
+            min(pixelSnappedBox.maxX() + outlineWidth, !nextline.isEmpty() ? pixelSnappedNextLineLeft + 1 : 1000000),
             pixelSnappedBox.maxY() + outlineWidth,
             BSBottom, outlineColor, outlineStyle,
             outlineWidth,
@@ -1534,7 +1534,7 @@
     
     if (nextline.maxX() < thisline.maxX())
         drawLineForBoxSide(graphicsContext,
-            max(!nextline.isEmpty() ? snappedAndAdjustedNextLineRight : -1000000, pixelSnappedBox.x() - outlineWidth),
+            max(!nextline.isEmpty() ? pixelSnappedNextLineRight : -1000000, pixelSnappedBox.x() - outlineWidth),
             pixelSnappedBox.maxY(),
             pixelSnappedBox.maxX() + outlineWidth,
             pixelSnappedBox.maxY() + outlineWidth,

Modified: branches/subpixellayout/Source/WebKit/chromium/src/WebViewImpl.cpp (110716 => 110717)


--- branches/subpixellayout/Source/WebKit/chromium/src/WebViewImpl.cpp	2012-03-14 18:12:29 UTC (rev 110716)
+++ branches/subpixellayout/Source/WebKit/chromium/src/WebViewImpl.cpp	2012-03-14 18:16:49 UTC (rev 110717)
@@ -3343,7 +3343,7 @@
     if (!m_page->settings()->acceleratedCompositingEnabled() || !allowsAcceleratedCompositing())
         return 0;
 
-    return GraphicsContext3DPrivate::extractWebGraphicsContext3D(SharedGraphicsContext3D::get());
+    return GraphicsContext3DPrivate::extractWebGraphicsContext3D(SharedGraphicsContext3D::get().get());
 }
 
 void WebViewImpl::setVisibilityState(WebPageVisibilityState visibilityState,

Modified: branches/subpixellayout/Source/WebKit/mac/WebView/WebHTMLView.mm (110716 => 110717)


--- branches/subpixellayout/Source/WebKit/mac/WebView/WebHTMLView.mm	2012-03-14 18:12:29 UTC (rev 110716)
+++ branches/subpixellayout/Source/WebKit/mac/WebView/WebHTMLView.mm	2012-03-14 18:16:49 UTC (rev 110717)
@@ -6215,7 +6215,7 @@
     if (!document)
         return [NSArray array];
 
-    Vector<WebCore::IntRect> rects = document->markers()->renderedRectsForMarkers(DocumentMarker::TextMatch);
+    Vector<IntRect> rects = document->markers()->renderedRectsForMarkers(DocumentMarker::TextMatch);
     unsigned count = rects.size();
     NSMutableArray *result = [NSMutableArray arrayWithCapacity:count];
     for (unsigned index = 0; index < count; ++index)

Modified: branches/subpixellayout/Source/WebKit/win/WebCoreSupport/WebChromeClient.cpp (110716 => 110717)


--- branches/subpixellayout/Source/WebKit/win/WebCoreSupport/WebChromeClient.cpp	2012-03-14 18:12:29 UTC (rev 110716)
+++ branches/subpixellayout/Source/WebKit/win/WebCoreSupport/WebChromeClient.cpp	2012-03-14 18:16:49 UTC (rev 110717)
@@ -105,7 +105,7 @@
         uiDelegate->Release();
 
         if (SUCCEEDED(retval))
-            return static_cast<IntRect>(rect);
+            return rect;
     }
 
     return FloatRect();
@@ -115,7 +115,7 @@
 {
     RECT rect;
     m_webView->frameRect(&rect);
-    return static_cast<IntRect>(rect);
+    return rect;
 }
 
 void WebChromeClient::focus()

Modified: branches/subpixellayout/Source/WebKit/win/WebFrame.cpp (110716 => 110717)


--- branches/subpixellayout/Source/WebKit/win/WebFrame.cpp	2012-03-14 18:12:29 UTC (rev 110716)
+++ branches/subpixellayout/Source/WebKit/win/WebFrame.cpp	2012-03-14 18:16:49 UTC (rev 110717)
@@ -2492,8 +2492,8 @@
     if (!view)
         return E_FAIL;
 
-    result->bottom = view->contentsHeight().round();
-    result->right = view->contentsWidth().round();
+    result->bottom = view->contentsHeight();
+    result->right = view->contentsWidth();
     return S_OK;
 }
 
_______________________________________________
webkit-changes mailing list
[email protected]
http://lists.webkit.org/mailman/listinfo.cgi/webkit-changes

Reply via email to