Changeset 98401 in webkit
- Timestamp:
- Oct 25, 2011, 3:51:34 PM (15 years ago)
- Location:
- branches/subpixellayout/Source
- Files:
-
- 8 edited
-
WebCore/rendering/InlineFlowBox.cpp (modified) (4 diffs)
-
WebCore/rendering/RenderBlock.cpp (modified) (4 diffs)
-
WebCore/rendering/RenderBlock.h (modified) (4 diffs)
-
WebCore/rendering/RenderBlockLineLayout.cpp (modified) (1 diff)
-
WebKit/mac/WebView/WebView.mm (modified) (1 diff)
-
WebKit2/WebProcess/Plugins/PDF/BuiltInPDFView.cpp (modified) (3 diffs)
-
WebKit2/WebProcess/Plugins/PluginView.cpp (modified) (1 diff)
-
WebKit2/WebProcess/WebPage/WebPage.cpp (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
branches/subpixellayout/Source/WebCore/rendering/InlineFlowBox.cpp
r98165 r98401 577 577 LayoutUnit& lineTopIncludingMargins, LayoutUnit& lineBottomIncludingMargins, bool& hasAnnotationsBefore, bool& hasAnnotationsAfter, FontBaseline baselineType) 578 578 { 579 // We need to use an integer topfor positioning inline boxes because we can't round in painting in the inline box tree580 int roundedTop = top.round();579 // We need to snap the top to pixel bounds for positioning inline boxes because we can't round in painting in the inline box tree 580 LayoutUnit pixelSnappedTop = top.round(); 581 581 bool isRootBox = isRootInlineBox(); 582 582 if (isRootBox) { 583 583 const FontMetrics& fontMetrics = renderer()->style(m_firstLine)->fontMetrics(); 584 setLogicalTop( roundedTop + maxAscent - fontMetrics.ascent(baselineType));584 setLogicalTop(pixelSnappedTop + maxAscent - fontMetrics.ascent(baselineType)); 585 585 } 586 586 … … 604 604 bool childAffectsTopBottomPos = true; 605 605 if (curr->verticalAlign() == TOP) 606 curr->setLogicalTop( roundedTop);606 curr->setLogicalTop(pixelSnappedTop); 607 607 else if (curr->verticalAlign() == BOTTOM) 608 curr->setLogicalTop( roundedTop + maxHeight - curr->lineHeight());608 curr->setLogicalTop(pixelSnappedTop + maxHeight - curr->lineHeight()); 609 609 else { 610 610 if (!strictMode && inlineFlowBox && !inlineFlowBox->hasTextChildren() && !curr->boxModelObject()->hasInlineDirectionBordersOrPadding() … … 612 612 childAffectsTopBottomPos = false; 613 613 LayoutUnit posAdjust = maxAscent - curr->baselinePosition(baselineType); 614 curr->setLogicalTop(curr->logicalTop() + roundedTop + posAdjust);614 curr->setLogicalTop(curr->logicalTop() + pixelSnappedTop + posAdjust); 615 615 } 616 616 … … 684 684 // line-height). 685 685 if (inlineFlowBox) 686 inlineFlowBox->placeBoxesInBlockDirection( roundedTop, maxHeight, maxAscent, strictMode, lineTop, lineBottom, setLineTop,686 inlineFlowBox->placeBoxesInBlockDirection(pixelSnappedTop, maxHeight, maxAscent, strictMode, lineTop, lineBottom, setLineTop, 687 687 lineTopIncludingMargins, lineBottomIncludingMargins, hasAnnotationsBefore, hasAnnotationsAfter, baselineType); 688 688 } -
branches/subpixellayout/Source/WebCore/rendering/RenderBlock.cpp
r98391 r98401 3571 3571 if (r->type() == FloatTypeValue && interval.low() <= m_value && m_value < interval.high()) { 3572 3572 // All the objects returned from the tree should be already placed. 3573 ASSERT(r->isPlaced() && m_renderer-> logicalTopForFloat(r).round() <= m_value && m_renderer->logicalBottomForFloat(r).round() > m_value);3573 ASSERT(r->isPlaced() && m_renderer->pixelSnappedLogicalTopForFloat(r) <= m_value && m_renderer->pixelSnappedLogicalBottomForFloat(r) > m_value); 3574 3574 3575 3575 if (FloatTypeValue == FloatingObject::FloatLeft 3576 && m_renderer-> logicalRightForFloat(r).round() > m_offset) {3577 m_offset = m_renderer-> logicalRightForFloat(r).round();3576 && m_renderer->pixelSnappedLogicalRightForFloat(r) > m_offset) { 3577 m_offset = m_renderer->pixelSnappedLogicalRightForFloat(r); 3578 3578 if (m_heightRemaining) 3579 3579 *m_heightRemaining = m_renderer->logicalBottomForFloat(r) - m_value; … … 3581 3581 3582 3582 if (FloatTypeValue == FloatingObject::FloatRight 3583 && m_renderer-> logicalLeftForFloat(r).round() < m_offset) {3584 m_offset = m_renderer-> logicalLeftForFloat(r).round();3583 && m_renderer->pixelSnappedLogicalRightForFloat(r) < m_offset) { 3584 m_offset = m_renderer->pixelSnappedLogicalLeftForFloat(r); 3585 3585 if (m_heightRemaining) 3586 3586 *m_heightRemaining = m_renderer->logicalBottomForFloat(r) - m_value; … … 3641 3641 3642 3642 LayoutUnit rightFloatOffset = fixedOffset; 3643 FloatIntervalSearchAdapter<FloatingObject::FloatRight> adapter(this, logicalTop .round(), rightFloatOffset, heightRemaining);3643 FloatIntervalSearchAdapter<FloatingObject::FloatRight> adapter(this, logicalTop, rightFloatOffset, heightRemaining); 3644 3644 m_floatingObjects->placedFloatsTree().allOverlapsWithAdapter(adapter); 3645 3645 right = min(right, rightFloatOffset); … … 6803 6803 { 6804 6804 if (m_horizontalWritingMode) 6805 return RenderBlock::FloatingObjectInterval(floatingObject-> y().round(), floatingObject->maxY().round(), floatingObject);6806 return RenderBlock::FloatingObjectInterval(floatingObject-> x().round(), floatingObject->maxX().round(), floatingObject);6805 return RenderBlock::FloatingObjectInterval(floatingObject->pixelSnappedY(), floatingObject->pixelSnappedMaxY(), floatingObject); 6806 return RenderBlock::FloatingObjectInterval(floatingObject->pixelSnappedX(), floatingObject->pixelSnappedMaxX(), floatingObject); 6807 6807 } 6808 6808 -
branches/subpixellayout/Source/WebCore/rendering/RenderBlock.h
r98297 r98401 164 164 : logicalWidth() - logicalRightOffsetForLine(position, firstLine); 165 165 } 166 167 int pixelSnappedLogicalRightOffsetForLine(LayoutUnit position, bool firstLine) const 168 { 169 return logicalRightOffsetForLine(position, logicalRightOffsetForContent(position), firstLine, 0).round(); 170 } 171 int pixelSnappedLogicalLeftOffsetForLine(LayoutUnit position, bool firstLine) const 172 { 173 return logicalLeftOffsetForLine(position, logicalLeftOffsetForContent(position), firstLine, 0).round(); 174 } 166 175 167 176 LayoutUnit startAlignedOffsetForLine(RenderBox* child, LayoutUnit position, bool firstLine); … … 542 551 LayoutUnit height() const { return m_frameRect.height(); } 543 552 553 int pixelSnappedX() const { return x().round(); } 554 int pixelSnappedMaxX() const { return maxX().round(); } 555 int pixelSnappedY() const { return y().round(); } 556 int pixelSnappedMaxY() const { return maxY().round(); } 557 int pixelSnappedWidth() const { return width().round(); } 558 int pixelSnappedHeight() const { return height().round(); } 559 544 560 void setX(LayoutUnit x) { ASSERT(!isInPlacedTree()); m_frameRect.setX(x); } 545 561 void setY(LayoutUnit y) { ASSERT(!isInPlacedTree()); m_frameRect.setY(y); } … … 575 591 LayoutUnit logicalRightForFloat(const FloatingObject* child) const { return isHorizontalWritingMode() ? child->maxX() : child->maxY(); } 576 592 LayoutUnit logicalWidthForFloat(const FloatingObject* child) const { return isHorizontalWritingMode() ? child->width() : child->height(); } 593 594 int pixelSnappedLogicalTopForFloat(const FloatingObject* child) const { return logicalTopForFloat(child).round(); } 595 int pixelSnappedLogicalBottomForFloat(const FloatingObject* child) const { return logicalBottomForFloat(child).round(); } 596 int pixelSnappedLogicalLeftForFloat(const FloatingObject* child) const { return logicalLeftForFloat(child).round(); } 597 int pixelSnappedLogicalRightForFloat(const FloatingObject* child) const { return logicalRightForFloat(child).round(); } 598 int pixelSnappedLogicalWidthForFloat(const FloatingObject* child) const { return logicalWidthForFloat(child).round(); } 577 599 void setLogicalTopForFloat(FloatingObject* child, LayoutUnit logicalTop) 578 600 { … … 932 954 } 933 955 956 FloatIntervalSearchAdapter(const RenderBlock* renderer, LayoutUnit value, LayoutUnit& offset, LayoutUnit* heightRemaining) 957 : m_renderer(renderer) 958 , m_value(value.round()) 959 , m_offset(offset) 960 , m_heightRemaining(heightRemaining) 961 { 962 } 963 934 964 inline int lowValue() const { return m_value; } 935 965 inline int highValue() const { return m_value; } -
branches/subpixellayout/Source/WebCore/rendering/RenderBlockLineLayout.cpp
r98297 r98401 751 751 { 752 752 ETextAlign textAlign = textAlignmentForLine(!reachedEnd && !lineBox->endsWithBreak()); 753 float logicalLeft = logicalLeftOffsetForLine(logicalHeight(), lineInfo.isFirstLine()).round();754 float availableLogicalWidth = logicalRightOffsetForLine(logicalHeight(), lineInfo.isFirstLine()).round() - logicalLeft;753 float logicalLeft = pixelSnappedLogicalLeftOffsetForLine(logicalHeight(), lineInfo.isFirstLine()); 754 float availableLogicalWidth = pixelSnappedLogicalRightOffsetForLine(logicalHeight(), lineInfo.isFirstLine()) - logicalLeft; 755 755 756 756 bool needsWordSpacing = false; -
branches/subpixellayout/Source/WebKit/mac/WebView/WebView.mm
r97886 r98401 2449 2449 return nil; 2450 2450 2451 const Vector< IntRect>& repaintRects = view->trackedRepaintRects();2451 const Vector<WebCore::FixedRect>& repaintRects = view->trackedRepaintRects(); 2452 2452 NSMutableArray* rectsArray = [[NSMutableArray alloc] initWithCapacity:repaintRects.size()]; 2453 2453 -
branches/subpixellayout/Source/WebKit2/WebProcess/Plugins/PDF/BuiltInPDFView.cpp
r98391 r98401 304 304 GraphicsContextStateSaver stateSaver(*graphicsContext); 305 305 IntRect scrollbarDirtyRect = dirtyRect; 306 scrollbarDirtyRect.moveBy( pluginView()->frameRect().location());306 scrollbarDirtyRect.moveBy(roundedIntPoint(pluginView()->frameRect().location())); 307 307 graphicsContext->translate(-pluginView()->frameRect().x(), -pluginView()->frameRect().y()); 308 308 … … 314 314 } 315 315 316 IntRect dirtyCornerRect = intersection( scrollCornerRect(), dirtyRect);316 IntRect dirtyCornerRect = intersection(enclosingIntRect(scrollCornerRect()), dirtyRect); 317 317 ScrollbarTheme::theme()->paintScrollCorner(0, graphicsContext, dirtyCornerRect); 318 318 } … … 665 665 IntPoint BuiltInPDFView::convertFromContainingViewToScrollbar(const Scrollbar* scrollbar, const IntPoint& parentPoint) const 666 666 { 667 IntPoint point = pluginView()->frame()->view()->convertToRenderer(pluginView()->renderer(), parentPoint);667 WebCore::FixedPoint point = pluginView()->frame()->view()->convertToRenderer(pluginView()->renderer(), parentPoint); 668 668 point.move(pluginView()->location() - scrollbar->location()); 669 669 670 return point;670 return roundedIntPoint(point); 671 671 } 672 672 -
branches/subpixellayout/Source/WebKit2/WebProcess/Plugins/PluginView.cpp
r98391 r98401 575 575 } else { 576 576 // FIXME: We should try to intersect the dirty rect with the plug-in's clip rect here. 577 paintRect = IntRect(IntPoint(), frameRect().size());577 paintRect = IntRect(IntPoint(), expandedIntSize(frameRect().size())); 578 578 } 579 579 -
branches/subpixellayout/Source/WebKit2/WebProcess/WebPage/WebPage.cpp
r98391 r98401 420 420 return ImmutableArray::create(); 421 421 422 const Vector< IntRect>& rects = view->trackedRepaintRects();422 const Vector<WebCore::FixedRect>& rects = view->trackedRepaintRects(); 423 423 size_t size = rects.size(); 424 424 if (!size)
Note:
See TracChangeset
for help on using the changeset viewer.