Changeset 107296 in webkit
- Timestamp:
- Feb 9, 2012, 3:09:38 PM (15 years ago)
- Location:
- trunk/Source/WebCore
- Files:
-
- 17 edited
-
ChangeLog (modified) (1 diff)
-
accessibility/AccessibilityRenderObject.cpp (modified) (2 diffs)
-
page/EventHandler.cpp (modified) (4 diffs)
-
rendering/LayoutTypes.h (modified) (1 diff)
-
rendering/RenderBlock.cpp (modified) (1 diff)
-
rendering/RenderEmbeddedObject.cpp (modified) (1 diff)
-
rendering/RenderFlowThread.cpp (modified) (1 diff)
-
rendering/RenderFrameSet.cpp (modified) (1 diff)
-
rendering/RenderImage.cpp (modified) (1 diff)
-
rendering/RenderLayer.cpp (modified) (5 diffs)
-
rendering/RenderLayerBacking.cpp (modified) (1 diff)
-
rendering/RenderLayerCompositor.cpp (modified) (1 diff)
-
rendering/RenderListMarker.cpp (modified) (1 diff)
-
rendering/mathml/RenderMathMLBlock.cpp (modified) (1 diff)
-
rendering/mathml/RenderMathMLFraction.cpp (modified) (1 diff)
-
rendering/mathml/RenderMathMLRoot.cpp (modified) (1 diff)
-
rendering/mathml/RenderMathMLSquareRoot.cpp (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebCore/ChangeLog
r107291 r107296 1 2012-02-09 Levi Weintraub <leviw@chromium.org> 2 3 Add roundedIntPoint method for LayoutPoints 4 https://bugs.webkit.org/show_bug.cgi?id=78262 5 6 Reviewed by Eric Seidel. 7 8 Adding a roundedIntPoint method that operates on a LayoutPoint. Currently, this does 9 nothing as LayoutPoint is a typedef to IntPoint. When we enable sub-pixel LayoutUnits, 10 this is a critical part in our pixel snapping strategy, where we round the logical top- 11 left point, then snap the right and bottom edges. 12 13 Also using this new method where we wish to convert LayoutPoints to IntPoints, which 14 we're currently doing implicitly (since they're the same thing). 15 16 No new tests. No change in functionality. 17 18 * accessibility/AccessibilityRenderObject.cpp: 19 (WebCore::AccessibilityRenderObject::visiblePositionForPoint): 20 (WebCore::AccessibilityRenderObject::accessibilityHitTest): 21 * page/EventHandler.cpp: 22 (WebCore::EventHandler::eventMayStartDrag): 23 (WebCore::EventHandler::hitTestResultAtPoint): 24 (WebCore::EventHandler::selectCursor): 25 * rendering/LayoutTypes.h: 26 (WebCore::roundedIntPoint): 27 (WebCore): 28 * rendering/RenderEmbeddedObject.cpp: 29 (WebCore::RenderEmbeddedObject::getReplacementTextGeometry): 30 * rendering/RenderFlowThread.cpp: 31 (WebCore::RenderFlowThread::paintIntoRegion): 32 * rendering/RenderFrameSet.cpp: 33 (WebCore::RenderFrameSet::getCursor): 34 * rendering/RenderImage.cpp: 35 (WebCore::RenderImage::paintReplaced): 36 * rendering/RenderLayer.cpp: 37 (WebCore::RenderLayer::scrollRectToVisible): 38 (WebCore::RenderLayer::offsetFromResizeCorner): 39 (WebCore::RenderLayer::isPointInResizeControl): 40 (WebCore::RenderLayer::paintLayerContents): 41 * rendering/RenderLayerBacking.cpp: 42 (WebCore::RenderLayerBacking::paintContents): 43 * rendering/RenderLayerCompositor.cpp: 44 (WebCore::RenderLayerCompositor::paintContents): 45 * rendering/mathml/RenderMathMLBlock.cpp: 46 (WebCore::RenderMathMLBlock::paint): 47 * rendering/mathml/RenderMathMLFraction.cpp: 48 (WebCore::RenderMathMLFraction::paint): 49 * rendering/mathml/RenderMathMLRoot.cpp: 50 (WebCore::RenderMathMLRoot::paint): 51 * rendering/mathml/RenderMathMLSquareRoot.cpp: 52 (WebCore::RenderMathMLSquareRoot::paint): 53 1 54 2012-02-09 John Bates <jbates@google.com> 2 55 -
trunk/Source/WebCore/accessibility/AccessibilityRenderObject.cpp
r106884 r107296 2676 2676 LayoutPoint ourpoint; 2677 2677 #if PLATFORM(MAC) 2678 ourpoint = frameView->screenToContents( point);2678 ourpoint = frameView->screenToContents(roundedIntPoint(point)); 2679 2679 #else 2680 2680 ourpoint = point; … … 2855 2855 2856 2856 if (node->hasTagName(areaTag)) 2857 return accessibilityImageMapHitTest(static_cast<HTMLAreaElement*>(node), point);2857 return accessibilityImageMapHitTest(static_cast<HTMLAreaElement*>(node), roundedIntPoint(point)); 2858 2858 2859 2859 if (node->hasTagName(optionTag)) -
trunk/Source/WebCore/page/EventHandler.cpp
r107062 r107296 698 698 m_frame->contentRenderer()->layer()->hitTest(request, result); 699 699 DragState state; 700 return result.innerNode() && page->dragController()->draggableNode(m_frame, result.innerNode(), r esult.point(), state);700 return result.innerNode() && page->dragController()->draggableNode(m_frame, result.innerNode(), roundedIntPoint(result.point()), state); 701 701 } 702 702 … … 1032 1032 1033 1033 if (testScrollbars == ShouldHitTestScrollbars) { 1034 Scrollbar* eventScrollbar = view->scrollbarAtPoint( point);1034 Scrollbar* eventScrollbar = view->scrollbarAtPoint(roundedIntPoint(point)); 1035 1035 if (eventScrollbar) 1036 1036 result.setScrollbar(eventScrollbar); … … 1047 1047 FrameView* mainView = mainFrame->view(); 1048 1048 if (resultView && mainView) { 1049 LayoutPoint mainFramePoint = mainView->rootViewToContents(resultView->contentsToRootView(result.point()));1049 IntPoint mainFramePoint = mainView->rootViewToContents(resultView->contentsToRootView(roundedIntPoint(result.point()))); 1050 1050 result = mainFrame->eventHandler()->hitTestResultAtPoint(mainFramePoint, allowShadowContent, ignoreClipping, testScrollbars, hitType, padding); 1051 1051 } … … 1266 1266 if (renderer) { 1267 1267 Cursor overrideCursor; 1268 switch (renderer->getCursor( event.localPoint(), overrideCursor)) {1268 switch (renderer->getCursor(roundedIntPoint(event.localPoint()), overrideCursor)) { 1269 1269 case SetCursorBasedOnStyle: 1270 1270 break; -
trunk/Source/WebCore/rendering/LayoutTypes.h
r95901 r107296 57 57 } 58 58 59 inline IntPoint roundedIntPoint(const LayoutPoint& p) 60 { 61 return p; 62 } 63 59 64 inline LayoutPoint roundedLayoutPoint(const FloatPoint& p) 60 65 { -
trunk/Source/WebCore/rendering/RenderBlock.cpp
r107160 r107296 2441 2441 // sit above the background/border. 2442 2442 if (hasOverflowClip() && style()->visibility() == VISIBLE && (phase == PaintPhaseBlockBackground || phase == PaintPhaseChildBlockBackground) && paintInfo.shouldPaintWithinRoot(this)) 2443 layer()->paintOverflowControls(paintInfo.context, adjustedPaintOffset, paintInfo.rect);2443 layer()->paintOverflowControls(paintInfo.context, roundedIntPoint(adjustedPaintOffset), paintInfo.rect); 2444 2444 } 2445 2445 -
trunk/Source/WebCore/rendering/RenderEmbeddedObject.cpp
r106492 r107296 191 191 { 192 192 contentRect = contentBoxRect(); 193 contentRect.moveBy( accumulatedOffset);193 contentRect.moveBy(roundedIntPoint(accumulatedOffset)); 194 194 195 195 FontDescription fontDescription; -
trunk/Source/WebCore/rendering/RenderFlowThread.cpp
r106694 r107296 465 465 466 466 context->translate(renderFlowThreadOffset.x(), renderFlowThreadOffset.y()); 467 info.rect.moveBy(-r enderFlowThreadOffset);467 info.rect.moveBy(-roundedIntPoint(renderFlowThreadOffset)); 468 468 469 469 layer()->paint(context, info.rect, 0, 0, region, RenderLayer::PaintLayerTemporaryClipRects); -
trunk/Source/WebCore/rendering/RenderFrameSet.cpp
r107009 r107296 803 803 CursorDirective RenderFrameSet::getCursor(const LayoutPoint& point, Cursor& cursor) const 804 804 { 805 if (canResizeRow( point)) {805 if (canResizeRow(roundedIntPoint(point))) { 806 806 cursor = rowResizeCursor(); 807 807 return SetCursor; -
trunk/Source/WebCore/rendering/RenderImage.cpp
r106492 r107296 300 300 centerY = 0; 301 301 imageOffset = LayoutSize(leftBorder + leftPad + centerX + 1, topBorder + topPad + centerY + 1); 302 context->drawImage(image.get(), style()->colorSpace(), IntRect( paintOffset + imageOffset, imageSize));302 context->drawImage(image.get(), style()->colorSpace(), IntRect(roundedIntPoint(paintOffset + imageOffset), imageSize)); 303 303 errorPictureDrawn = true; 304 304 } -
trunk/Source/WebCore/rendering/RenderLayer.cpp
r107168 r107296 1579 1579 LayoutRect r = getRectToExpose(viewRect, rect, alignX, alignY); 1580 1580 1581 frameView->setScrollPosition(r .location());1581 frameView->setScrollPosition(roundedIntPoint(r.location())); 1582 1582 1583 1583 // This is the outermost view of a web page, so after scrolling this view we … … 2136 2136 // Currently the resize corner is always the bottom right corner 2137 2137 // FIXME: This assumes the location is 0, 0. Is this guaranteed to always be the case? 2138 LayoutPoint bottomRight = toPoint(size());2139 LayoutPoint localPoint = absoluteToContents(absolutePoint);2138 IntPoint bottomRight = toPoint(size()); 2139 IntPoint localPoint = roundedIntPoint(absoluteToContents(absolutePoint)); 2140 2140 return localPoint - bottomRight; 2141 2141 } … … 2544 2544 } 2545 2545 2546 bool RenderLayer::isPointInResizeControl(const LayoutPoint& absolutePoint) const2546 bool RenderLayer::isPointInResizeControl(const IntPoint& absolutePoint) const 2547 2547 { 2548 2548 if (!renderer()->hasOverflowClip() || renderer()->style()->resize() == RESIZE_NONE) … … 2552 2552 ASSERT(box); 2553 2553 2554 LayoutPoint localPoint = absoluteToContents(absolutePoint);2555 2556 LayoutRect localBounds(0, 0, box->width(), box->height());2554 IntPoint localPoint = roundedIntPoint(absoluteToContents(absolutePoint)); 2555 2556 IntRect localBounds(0, 0, box->pixelSnappedWidth(), box->pixelSnappedHeight()); 2557 2557 return resizerCornerRect(this, localBounds).contains(localPoint); 2558 2558 } … … 2947 2947 if (isPaintingOverlayScrollbars) { 2948 2948 clipToRect(rootLayer, context, paintDirtyRect, damageRect); 2949 paintOverflowControls(context, paintOffset, damageRect.rect(), true);2949 paintOverflowControls(context, roundedIntPoint(paintOffset), damageRect.rect(), true); 2950 2950 restoreClip(context, paintDirtyRect, damageRect); 2951 2951 } -
trunk/Source/WebCore/rendering/RenderLayerBacking.cpp
r106459 r107296 1162 1162 context.translate(-scrollCornerAndResizer.x(), -scrollCornerAndResizer.y()); 1163 1163 LayoutRect transformedClip = clip; 1164 transformedClip.moveBy( scrollCornerAndResizer.location());1164 transformedClip.moveBy(roundedIntPoint(scrollCornerAndResizer.location())); 1165 1165 m_owningLayer->paintScrollCorner(&context, LayoutPoint(), transformedClip); 1166 1166 m_owningLayer->paintResizer(&context, LayoutPoint(), transformedClip); -
trunk/Source/WebCore/rendering/RenderLayerCompositor.cpp
r107119 r107296 1618 1618 context.translate(-scrollCorner.x(), -scrollCorner.y()); 1619 1619 LayoutRect transformedClip = clip; 1620 transformedClip.moveBy( scrollCorner.location());1620 transformedClip.moveBy(roundedIntPoint(scrollCorner.location())); 1621 1621 m_renderView->frameView()->paintScrollCorner(&context, transformedClip); 1622 1622 context.restore(); -
trunk/Source/WebCore/rendering/RenderListMarker.cpp
r106900 r107296 1111 1111 return; 1112 1112 1113 LayoutPoint boxOrigin(paintOffset + location());1113 IntPoint boxOrigin(paintOffset + location()); 1114 1114 LayoutRect overflowRect(visualOverflowRect()); 1115 1115 overflowRect.moveBy(boxOrigin); -
trunk/Source/WebCore/rendering/mathml/RenderMathMLBlock.cpp
r107019 r107296 83 83 return; 84 84 85 LayoutPoint adjustedPaintOffset = paintOffset + location();85 IntPoint adjustedPaintOffset = roundedIntPoint(paintOffset + location()); 86 86 87 87 GraphicsContextStateSaver stateSaver(*info.context); -
trunk/Source/WebCore/rendering/mathml/RenderMathMLFraction.cpp
r107263 r107296 154 154 } 155 155 156 LayoutPoint adjustedPaintOffset = paintOffset + location();156 IntPoint adjustedPaintOffset = roundedIntPoint(paintOffset + location()); 157 157 adjustedPaintOffset.setY(adjustedPaintOffset.y() + verticalOffset); 158 158 -
trunk/Source/WebCore/rendering/mathml/RenderMathMLRoot.cpp
r107263 r107296 105 105 return; 106 106 107 LayoutPoint adjustedPaintOffset = paintOffset + location();107 IntPoint adjustedPaintOffset = roundedIntPoint(paintOffset + location()); 108 108 109 109 RenderBoxModelObject* indexBox = toRenderBoxModelObject(lastChild()); -
trunk/Source/WebCore/rendering/mathml/RenderMathMLSquareRoot.cpp
r107263 r107296 74 74 return; 75 75 76 LayoutPoint adjustedPaintOffset = paintOffset + location();76 IntPoint adjustedPaintOffset = roundedIntPoint(paintOffset + location()); 77 77 78 78 LayoutUnit maxHeight = 0;
Note:
See TracChangeset
for help on using the changeset viewer.