Changeset 139037 in webkit
- Timestamp:
- Jan 7, 2013 11:46:58 PM (11 years ago)
- Location:
- trunk/Source
- Files:
-
- 8 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebCore/ChangeLog
r139036 r139037 1 2013-01-07 Steve Block <steveblock@chromium.org> 2 3 Use toSize() to convert from Int/FloatPoint to Int/FloatSize 4 https://bugs.webkit.org/show_bug.cgi?id=105992 5 6 Reviewed by Kentaro Hara. 7 8 Refactoring only, no change in behavior. 9 10 * html/HTMLAreaElement.cpp: 11 (WebCore::HTMLAreaElement::computePath): 12 * platform/ScrollView.h: 13 (WebCore::ScrollView::scrollOffset): 14 * platform/graphics/FloatPoint.h: 15 (WebCore::toFloatSize): 16 Add 'inline FloatSize toFloatSize(const FloatPoint&)' to match IntPoint. 17 * rendering/RenderLayerBacking.cpp: 18 (WebCore::RenderLayerBacking::updateGraphicsLayerGeometry): 19 1 20 2013-01-07 Kunihiko Sakamoto <ksakamoto@chromium.org> 2 21 -
trunk/Source/WebCore/html/HTMLAreaElement.cpp
r135069 r139037 116 116 } 117 117 118 p.translate( absPos - FloatPoint());118 p.translate(toFloatSize(absPos)); 119 119 return p; 120 120 } -
trunk/Source/WebCore/platform/ScrollView.h
r135029 r139037 171 171 // Functions for querying the current scrolled position (both as a point, a size, or as individual X and Y values). 172 172 virtual IntPoint scrollPosition() const OVERRIDE { return visibleContentRect().location(); } 173 IntSize scrollOffset() const { return visibleContentRect().location() - IntPoint(); } // Gets the scrolled position as an IntSize. Convenient for adding to other sizes.173 IntSize scrollOffset() const { return toSize(visibleContentRect().location()); } // Gets the scrolled position as an IntSize. Convenient for adding to other sizes. 174 174 virtual IntPoint maximumScrollPosition() const OVERRIDE; // The maximum position we can be scrolled to. 175 175 virtual IntPoint minimumScrollPosition() const OVERRIDE; // The minimum position we can be scrolled to. -
trunk/Source/WebCore/platform/graphics/FloatPoint.h
r138800 r139037 264 264 } 265 265 266 inline FloatSize toFloatSize(const FloatPoint& a) 267 { 268 return FloatSize(a.x(), a.y()); 269 } 270 266 271 float findSlope(const FloatPoint& p1, const FloatPoint& p2, float& c); 267 272 -
trunk/Source/WebCore/rendering/RenderLayerBacking.cpp
r139032 r139037 636 636 637 637 m_graphicsLayer->setPosition(FloatPoint(relativeCompositingBounds.location() - graphicsLayerParentLocation)); 638 m_graphicsLayer->setOffsetFromRenderer( localCompositingBounds.location() - IntPoint());638 m_graphicsLayer->setOffsetFromRenderer(toSize(localCompositingBounds.location())); 639 639 640 640 FloatSize oldSize = m_graphicsLayer->size(); … … 655 655 clipLayer->setPosition(FloatPoint(clippingBox.location() - localCompositingBounds.location())); 656 656 clipLayer->setSize(clippingBox.size()); 657 clipLayer->setOffsetFromRenderer( clippingBox.location() - IntPoint());657 clipLayer->setOffsetFromRenderer(toSize(clippingBox.location())); 658 658 } 659 659 … … 710 710 // so that it gets correctly sorted with children. In that case, position relative to the clipping layer. 711 711 foregroundSize = FloatSize(clippingBox.size()); 712 foregroundOffset = clippingBox.location() - IntPoint();712 foregroundOffset = toSize(clippingBox.location()); 713 713 } 714 714 … … 744 744 745 745 IntSize oldScrollingLayerOffset = m_scrollingLayer->offsetFromRenderer(); 746 m_scrollingLayer->setOffsetFromRenderer( IntPoint() - paddingBox.location());746 m_scrollingLayer->setOffsetFromRenderer(-toSize(paddingBox.location())); 747 747 748 748 bool paddingBoxOffsetChanged = oldScrollingLayerOffset != m_scrollingLayer->offsetFromRenderer(); … … 752 752 m_scrollingContentsLayer->setNeedsDisplay(); 753 753 754 IntSize scrollingContentsOffset = paddingBox.location() - IntPoint() - scrollOffset;754 IntSize scrollingContentsOffset = toSize(paddingBox.location() - scrollOffset); 755 755 if (scrollingContentsOffset != m_scrollingContentsLayer->offsetFromRenderer() || scrollSize != m_scrollingContentsLayer->size()) 756 756 compositor()->scrollingLayerDidChange(m_owningLayer); -
trunk/Source/WebKit/chromium/ChangeLog
r139028 r139037 1 2013-01-07 Steve Block <steveblock@chromium.org> 2 3 Use toSize() to convert from Int/FloatPoint to Int/FloatSize 4 https://bugs.webkit.org/show_bug.cgi?id=105992 5 6 Reviewed by Kentaro Hara. 7 8 * src/LinkHighlight.cpp: 9 (WebKit::LinkHighlight::computeHighlightLayerPathAndPosition): 10 * src/WebFrameImpl.cpp: 11 (WebKit::WebFrameImpl::minimumScrollOffset): 12 (WebKit::WebFrameImpl::maximumScrollOffset): 13 1 14 2013-01-07 Xianzhu Wang <wangxianzhu@chromium.org> 2 15 -
trunk/Source/WebKit/chromium/src/LinkHighlight.cpp
r137847 r139037 215 215 216 216 FloatRect boundingRect = newPath.boundingRect(); 217 newPath.translate( FloatPoint() - boundingRect.location());217 newPath.translate(-toFloatSize(boundingRect.location())); 218 218 219 219 bool pathHasChanged = !m_path.platformPath() || !(*newPath.platformPath() == *m_path.platformPath()); -
trunk/Source/WebKit/chromium/src/WebFrameImpl.cpp
r138893 r139037 603 603 if (!view) 604 604 return WebSize(); 605 return view->minimumScrollPosition() - IntPoint();605 return toSize(view->minimumScrollPosition()); 606 606 } 607 607 … … 611 611 if (!view) 612 612 return WebSize(); 613 return view->maximumScrollPosition() - IntPoint();613 return toSize(view->maximumScrollPosition()); 614 614 } 615 615
Note: See TracChangeset
for help on using the changeset viewer.