Title: [110219] branches/subpixellayout/Source/WebCore

Diff

Modified: branches/subpixellayout/Source/WebCore/Target.pri (110218 => 110219)


--- branches/subpixellayout/Source/WebCore/Target.pri	2012-03-08 23:24:14 UTC (rev 110218)
+++ branches/subpixellayout/Source/WebCore/Target.pri	2012-03-08 23:24:48 UTC (rev 110219)
@@ -1075,8 +1075,6 @@
     platform/graphics/BitmapImage.cpp \
     platform/graphics/Color.cpp \
     platform/graphics/CrossfadeGeneratedImage.cpp \
-    platform/graphics/FractionalLayoutRect.cpp \
-    platform/graphics/FractionalLayoutSize.cpp \
     platform/graphics/FloatPoint3D.cpp \
     platform/graphics/FloatPoint.cpp \
     platform/graphics/FloatQuad.cpp \
@@ -1085,6 +1083,8 @@
     platform/graphics/FontData.cpp \
     platform/graphics/Font.cpp \
     platform/graphics/FontCache.cpp \
+    platform/graphics/FractionalLayoutRect.cpp \
+    platform/graphics/FractionalLayoutSize.cpp \
     platform/graphics/GeneratorGeneratedImage.cpp \
     platform/graphics/Gradient.cpp \
     platform/graphics/GraphicsContext.cpp \

Modified: branches/subpixellayout/Source/WebCore/bindings/objc/DOM.mm (110218 => 110219)


--- branches/subpixellayout/Source/WebCore/bindings/objc/DOM.mm	2012-03-08 23:24:14 UTC (rev 110218)
+++ branches/subpixellayout/Source/WebCore/bindings/objc/DOM.mm	2012-03-08 23:24:48 UTC (rev 110219)
@@ -248,7 +248,7 @@
     return objcClass;
 }
 
-static NSArray *kit(const Vector<FractionalLayoutRect>& rects)
+static NSArray *kit(const Vector<IntRect>& rects)
 {
     size_t size = rects.size();
     NSMutableArray *array = [NSMutableArray arrayWithCapacity:size];
@@ -385,7 +385,7 @@
     RefPtr<Range> range = Range::create(core(self)->document());
     WebCore::ExceptionCode ec = 0;
     range->selectNodeContents(core(self), ec);
-    Vector<FractionalLayoutRect> rects;
+    Vector<IntRect> rects;
     range->textRects(rects);
     return kit(rects);
 }
@@ -413,7 +413,7 @@
 - (NSArray *)textRects
 {
     // FIXME: The call to updateLayoutIgnorePendingStylesheets should be moved into WebCore::Range.
-    Vector<FractionalLayoutRect> rects;
+    Vector<IntRect> rects;
     core(self)->ownerDocument()->updateLayoutIgnorePendingStylesheets();
     core(self)->textRects(rects);
     return kit(rects);

Modified: branches/subpixellayout/Source/WebCore/dom/Range.cpp (110218 => 110219)


--- branches/subpixellayout/Source/WebCore/dom/Range.cpp	2012-03-08 23:24:14 UTC (rev 110218)
+++ branches/subpixellayout/Source/WebCore/dom/Range.cpp	2012-03-08 23:24:48 UTC (rev 110219)
@@ -1664,16 +1664,16 @@
 
 IntRect Range::boundingBox()
 {
-    LayoutRect result;
-    Vector<LayoutRect> rects;
+    IntRect result;
+    Vector<IntRect> rects;
     textRects(rects);
     const size_t n = rects.size();
     for (size_t i = 0; i < n; ++i)
         result.unite(rects[i]);
-    return pixelSnappedIntRect(result);
+    return result;
 }
 
-void Range::textRects(Vector<LayoutRect>& rects, bool useSelectionHeight, RangeInFixedPosition* inFixed)
+void Range::textRects(Vector<IntRect>& rects, bool useSelectionHeight, RangeInFixedPosition* inFixed)
 {
     Node* startContainer = m_start.container();
     Node* endContainer = m_end.container();

Modified: branches/subpixellayout/Source/WebCore/dom/Range.h (110218 => 110219)


--- branches/subpixellayout/Source/WebCore/dom/Range.h	2012-03-08 23:24:14 UTC (rev 110218)
+++ branches/subpixellayout/Source/WebCore/dom/Range.h	2012-03-08 23:24:48 UTC (rev 110219)
@@ -122,7 +122,7 @@
     };
     
     // Not transform-friendly
-    void textRects(Vector<LayoutRect>&, bool useSelectionHeight = false, RangeInFixedPosition* = 0);
+    void textRects(Vector<IntRect>&, bool useSelectionHeight = false, RangeInFixedPosition* = 0);
     // Transform-friendly
     void textQuads(Vector<FloatQuad>&, bool useSelectionHeight = false, RangeInFixedPosition* = 0) const;
     void getBorderAndTextQuads(Vector<FloatQuad>&) const;

Modified: branches/subpixellayout/Source/WebCore/platform/FractionalLayoutUnit.h (110218 => 110219)


--- branches/subpixellayout/Source/WebCore/platform/FractionalLayoutUnit.h	2012-03-08 23:24:14 UTC (rev 110218)
+++ branches/subpixellayout/Source/WebCore/platform/FractionalLayoutUnit.h	2012-03-08 23:24:48 UTC (rev 110219)
@@ -448,6 +448,11 @@
     return a - FractionalLayoutUnit(b);
 }
 
+inline FractionalLayoutUnit operator-(const FractionalLayoutUnit& a, unsigned b)
+{
+    return a - FractionalLayoutUnit(b);
+}
+
 inline float operator-(const FractionalLayoutUnit& a, float b)
 {
     return a.toFloat() - b;

Modified: branches/subpixellayout/Source/WebCore/platform/graphics/transforms/AffineTransform.cpp (110218 => 110219)


--- branches/subpixellayout/Source/WebCore/platform/graphics/transforms/AffineTransform.cpp	2012-03-08 23:24:14 UTC (rev 110218)
+++ branches/subpixellayout/Source/WebCore/platform/graphics/transforms/AffineTransform.cpp	2012-03-08 23:24:48 UTC (rev 110219)
@@ -27,7 +27,6 @@
 #include "config.h"
 #include "AffineTransform.h"
 
-#include "FractionalLayoutSize.h"
 #include "FloatConversion.h"
 #include "FloatQuad.h"
 #include "FloatRect.h"
@@ -251,12 +250,12 @@
     return FloatPoint(narrowPrecisionToFloat(x2), narrowPrecisionToFloat(y2));
 }
 
-FractionalLayoutSize AffineTransform::mapSize(const FractionalLayoutSize& size) const
+IntSize AffineTransform::mapSize(const IntSize& size) const
 {
     double width2 = size.width() * xScale();
     double height2 = size.height() * yScale();
 
-    return FractionalLayoutSize(width2, height2);
+    return IntSize(lround(width2), lround(height2));
 }
 
 FloatSize AffineTransform::mapSize(const FloatSize& size) const

Modified: branches/subpixellayout/Source/WebCore/platform/graphics/transforms/AffineTransform.h (110218 => 110219)


--- branches/subpixellayout/Source/WebCore/platform/graphics/transforms/AffineTransform.h	2012-03-08 23:24:14 UTC (rev 110218)
+++ branches/subpixellayout/Source/WebCore/platform/graphics/transforms/AffineTransform.h	2012-03-08 23:24:48 UTC (rev 110219)
@@ -76,7 +76,7 @@
 
     FloatPoint mapPoint(const FloatPoint&) const;
 
-    FractionalLayoutSize mapSize(const FractionalLayoutSize&) const;
+    IntSize mapSize(const IntSize&) const;
 
     FloatSize mapSize(const FloatSize&) const;
 

Modified: branches/subpixellayout/Source/WebCore/rendering/RenderInline.cpp (110218 => 110219)


--- branches/subpixellayout/Source/WebCore/rendering/RenderInline.cpp	2012-03-08 23:24:14 UTC (rev 110218)
+++ branches/subpixellayout/Source/WebCore/rendering/RenderInline.cpp	2012-03-08 23:24:48 UTC (rev 110219)
@@ -1451,7 +1451,7 @@
 
     bool antialias = shouldAntialiasLines(graphicsContext);
 
-    LayoutUnit offset = style()->outlineOffset();
+    int offset = style()->outlineOffset();
 
     LayoutUnit top = paintOffset.y() + thisline.y() - offset;
     LayoutUnit left = paintOffset.x() + thisline.x() - offset;

Modified: branches/subpixellayout/Source/WebCore/rendering/RenderText.cpp (110218 => 110219)


--- branches/subpixellayout/Source/WebCore/rendering/RenderText.cpp	2012-03-08 23:24:14 UTC (rev 110218)
+++ branches/subpixellayout/Source/WebCore/rendering/RenderText.cpp	2012-03-08 23:24:48 UTC (rev 110219)
@@ -330,7 +330,7 @@
     return FloatRect();
 }
 
-void RenderText::absoluteRectsForRange(Vector<LayoutRect>& rects, unsigned start, unsigned end, bool useSelectionHeight, bool* wasFixed)
+void RenderText::absoluteRectsForRange(Vector<IntRect>& rects, unsigned start, unsigned end, bool useSelectionHeight, bool* wasFixed)
 {
     // Work around signed/unsigned issues. This function takes unsigneds, and is often passed UINT_MAX
     // to mean "all the way to the end". InlineTextBox coordinates are unsigneds, so changing this 
@@ -347,7 +347,6 @@
         if (start <= box->start() && box->end() < end) {
             FloatRect r = box->calculateBoundaries();
             if (useSelectionHeight) {
-                // FIXME: localSelectionRect should switch to return FloatRect soon with the subpixellayout branch.
                 IntRect selectionRect = box->localSelectionRect(start, end);
                 if (box->isHorizontal()) {
                     r.setHeight(selectionRect.height());

Modified: branches/subpixellayout/Source/WebCore/rendering/RenderText.h (110218 => 110219)


--- branches/subpixellayout/Source/WebCore/rendering/RenderText.h	2012-03-08 23:24:14 UTC (rev 110218)
+++ branches/subpixellayout/Source/WebCore/rendering/RenderText.h	2012-03-08 23:24:48 UTC (rev 110219)
@@ -55,7 +55,7 @@
     void dirtyLineBoxes(bool fullLayout);
 
     virtual void absoluteRects(Vector<IntRect>&, const LayoutPoint& accumulatedOffset) const;
-    void absoluteRectsForRange(Vector<LayoutRect>&, unsigned startOffset = 0, unsigned endOffset = UINT_MAX, bool useSelectionHeight = false, bool* wasFixed = 0);
+    void absoluteRectsForRange(Vector<IntRect>&, unsigned startOffset = 0, unsigned endOffset = UINT_MAX, bool useSelectionHeight = false, bool* wasFixed = 0);
 
     virtual void absoluteQuads(Vector<FloatQuad>&, bool* wasFixed) const;
     void absoluteQuadsForRange(Vector<FloatQuad>&, unsigned startOffset = 0, unsigned endOffset = UINT_MAX, bool useSelectionHeight = false, bool* wasFixed = 0);

Modified: branches/subpixellayout/Source/WebCore/rendering/mathml/RenderMathMLBlock.cpp (110218 => 110219)


--- branches/subpixellayout/Source/WebCore/rendering/mathml/RenderMathMLBlock.cpp	2012-03-08 23:24:14 UTC (rev 110218)
+++ branches/subpixellayout/Source/WebCore/rendering/mathml/RenderMathMLBlock.cpp	2012-03-08 23:24:48 UTC (rev 110219)
@@ -91,7 +91,7 @@
     
     info.context->setStrokeColor(Color(0, 255, 0), ColorSpaceSRGB);
     
-    info.context->drawLine(IngPoint(adjustedPaintOffset.x(), adjustedPaintOffset.y() + topStart), IntPoint(adjustedPaintOffset.x() + pixelSnappedOffsetWidth(), adjustedPaintOffset.y() + topStart));
+    info.context->drawLine(IntPoint(adjustedPaintOffset.x(), adjustedPaintOffset.y() + topStart), IntPoint(adjustedPaintOffset.x() + pixelSnappedOffsetWidth(), adjustedPaintOffset.y() + topStart));
     
     int baseline = roundToInt(baselinePosition(AlphabeticBaseline, true, HorizontalLine));
     

Modified: branches/subpixellayout/Source/WebCore/rendering/mathml/RenderMathMLRoot.cpp (110218 => 110219)


--- branches/subpixellayout/Source/WebCore/rendering/mathml/RenderMathMLRoot.cpp	2012-03-08 23:24:14 UTC (rev 110218)
+++ branches/subpixellayout/Source/WebCore/rendering/mathml/RenderMathMLRoot.cpp	2012-03-08 23:24:48 UTC (rev 110219)
@@ -232,7 +232,8 @@
     
     int indexShift = indexBox->pixelSnappedOffsetWidth() + topStartShift;
     int radicalHeight = static_cast<int>((1 - gRadicalTopLeftPointYPos) * maxHeight);
-    int rootMarginTop = radicalHeight + style()->paddingBottom().value() + indexBox->pixelSnappedOffsetHeight() - (maxHeight + static_cast<int>(gRootPadding * style()->fontSize()));
+    int rootMarginTop = radicalHeight + style()->paddingBottom().value() + indexBox->pixelSnappedOffsetHeight()
+        - (maxHeight + static_cast<int>(gRootPadding * style()->fontSize()));
     
     style()->setPaddingLeft(Length(indexShift, Fixed));
     if (rootMarginTop > 0)

Modified: branches/subpixellayout/Source/WebCore/rendering/svg/RenderSVGModelObject.cpp (110218 => 110219)


--- branches/subpixellayout/Source/WebCore/rendering/svg/RenderSVGModelObject.cpp	2012-03-08 23:24:14 UTC (rev 110218)
+++ branches/subpixellayout/Source/WebCore/rendering/svg/RenderSVGModelObject.cpp	2012-03-08 23:24:48 UTC (rev 110219)
@@ -74,9 +74,9 @@
 
 void RenderSVGModelObject::absoluteRects(Vector<IntRect>& rects, const LayoutPoint& accumulatedOffset) const
 {
-    LayoutRect rect = enclosingIntRect(strokeBoundingBox());
-    rect.moveBy(accumulatedOffset);
-    rects.append(pixelSnappedIntRect(rect));
+    IntRect rect = enclosingIntRect(strokeBoundingBox());
+    rect.moveBy(roundedIntPoint(accumulatedOffset));
+    rects.append(rect);
 }
 
 void RenderSVGModelObject::absoluteQuads(Vector<FloatQuad>& quads, bool* wasFixed) const
_______________________________________________
webkit-changes mailing list
[email protected]
http://lists.webkit.org/mailman/listinfo.cgi/webkit-changes

Reply via email to