Give all the geometry classes a single-argument scale() function for consistency
authorsimon.fraser@apple.com <simon.fraser@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 4 Nov 2016 05:11:12 +0000 (05:11 +0000)
committersimon.fraser@apple.com <simon.fraser@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 4 Nov 2016 05:11:12 +0000 (05:11 +0000)
commit4c72c2bb2e334223946da3eca8ffbd0febb970c0
tree623790c68f93b2388bdfb825d3b873163a6f2c3e
parentf742806b245bf49f52811de2067f1921e319f061
Give all the geometry classes a single-argument scale() function for consistency
https://bugs.webkit.org/show_bug.cgi?id=164400

Reviewed by Zalan Bujtas.
Source/WebCore:

Add single-argument scale() to FloatPoint, FloatQuad, FloatSize and LayoutPoint, as well
as adding one to GraphicsContext. Switch callers who passed the same value for sx and sy
to the new functions.

* dom/Document.cpp:
(WebCore::Document::adjustFloatQuadsForScrollAndAbsoluteZoomAndFrameScale):
* dom/MouseRelatedEvent.cpp:
(WebCore::MouseRelatedEvent::init):
(WebCore::MouseRelatedEvent::computeRelativePosition):
* dom/TreeScope.cpp:
(WebCore::TreeScope::nodeFromPoint):
* page/PrintContext.cpp:
(WebCore::PrintContext::spoolPage):
* platform/cocoa/ThemeCocoa.mm:
(WebCore::fitContextToBox):
* platform/graphics/FloatPoint.h:
(WebCore::FloatPoint::scale):
* platform/graphics/FloatQuad.h:
(WebCore::FloatQuad::scale):
* platform/graphics/FloatSize.h:
(WebCore::FloatSize::scale):
* platform/graphics/GraphicsContext.cpp:
(WebCore::GraphicsContext::applyDeviceScaleFactor):
* platform/graphics/GraphicsContext.h:
(WebCore::GraphicsContext::scale):
* platform/graphics/LayoutPoint.h:
(WebCore::LayoutPoint::scale):
* platform/graphics/ca/TileCoverageMap.cpp:
(WebCore::TileCoverageMap::update):
* platform/graphics/ca/TileGrid.cpp:
(WebCore::TileGrid::platformCALayerPaintContents):
* platform/graphics/cg/ImageBufferCG.cpp:
(WebCore::ImageBuffer::drawConsuming):
(WebCore::ImageBuffer::draw):
(WebCore::ImageBuffer::drawPattern):
* platform/mac/ThemeMac.mm:
(WebCore::paintToggleButton):
(WebCore::paintButton):
(WebCore::paintStepper):
* rendering/RenderImage.cpp:
(WebCore::RenderImage::nodeAtPoint):
* rendering/RenderMediaControls.cpp:
(WebCore::getUnzoomedRectAndAdjustCurrentContext):
* rendering/RenderThemeMac.mm:
(WebCore::RenderThemeMac::paintMenuList):
(WebCore::RenderThemeMac::paintSliderThumb):
(WebCore::RenderThemeMac::paintSearchField):
(WebCore::RenderThemeMac::paintSearchFieldCancelButton):
(WebCore::RenderThemeMac::paintSearchFieldResultsButton):
* rendering/svg/SVGInlineTextBox.cpp:
(WebCore::SVGInlineTextBox::selectionRectForTextFragment):
(WebCore::SVGInlineTextBox::paintDecorationWithStyle):
(WebCore::SVGInlineTextBox::paintTextWithShadows):
* svg/SVGPathBlender.cpp:
(WebCore::SVGPathBlender::blendAnimatedFloatPoint):
(WebCore::SVGPathBlender::blendArcToSegment):
* svg/SVGPathParser.cpp:
(WebCore::SVGPathParser::parseCurveToCubicSmoothSegment):
(WebCore::SVGPathParser::parseCurveToQuadraticSegment):
(WebCore::SVGPathParser::parseCurveToQuadraticSmoothSegment):
(WebCore::SVGPathParser::decomposeArcToCubic):
* svg/SVGSVGElement.cpp:
(WebCore::SVGSVGElement::localCoordinateSpaceTransform):

Source/WebKit2:

Use single-argument scale() functions.

* PluginProcess/PluginControllerProxy.cpp:
(WebKit::PluginControllerProxy::paint):
* Shared/mac/RemoteLayerBackingStore.mm:
(WebKit::RemoteLayerBackingStore::drawInContext):
* UIProcess/API/Cocoa/WKWebView.mm:
(-[WKWebView _didCommitLayerTree:]):
(-[WKWebView _takeViewSnapshot]):
(-[WKWebView _scrollToContentScrollPosition:scrollOrigin:]):
(-[WKWebView _scrollByContentOffset:]):
(-[WKWebView _zoomToFocusRect:selectionRect:fontSize:minimumScale:maximumScale:allowScaling:forceScroll:]):
* UIProcess/ios/WKContentView.mm:
(-[WKContentView _didCommitLayerTree:]):
* UIProcess/ios/WKContentViewInteraction.mm:
(-[WKContentView _updateTapHighlight]):
* UIProcess/mac/RemoteLayerTreeDrawingAreaProxy.mm:
(WebKit::RemoteLayerTreeDrawingAreaProxy::indicatorLocation):
(WebKit::RemoteLayerTreeDrawingAreaProxy::updateDebugIndicator):
* UIProcess/mac/ViewGestureControllerMac.mm:
(WebKit::ViewGestureController::scaledMagnificationOrigin):
* WebProcess/InjectedBundle/DOM/InjectedBundleRangeHandle.cpp:
(WebKit::InjectedBundleRangeHandle::renderedImage):
* WebProcess/Plugins/Netscape/NetscapePlugin.cpp:
(WebKit::NetscapePlugin::snapshot):
* WebProcess/Plugins/PDF/PDFPlugin.mm:
(WebKit::PDFPlugin::scrollToPoint):
* WebProcess/WebPage/WebFrame.cpp:
(WebKit::WebFrame::createSelectionSnapshot):
* WebProcess/WebPage/WebPage.cpp:
(WebKit::WebPage::scalePageInViewCoordinates):
(WebKit::WebPage::scaleView):
(WebKit::WebPage::snapshotAtSize):
(WebKit::WebPage::snapshotNode):
(WebKit::WebPage::drawRectToImage):
* WebProcess/WebPage/ios/WebPageIOS.mm:
(WebKit::WebPage::restorePageState):

Tools:

Test single-argument scale().

* TestWebKitAPI/Tests/WebCore/FloatPoint.cpp:
(TestWebKitAPI::TEST):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@208371 268f45cc-cd09-0410-ab3c-d52691b4dbfc
39 files changed:
Source/WebCore/ChangeLog
Source/WebCore/dom/Document.cpp
Source/WebCore/dom/MouseRelatedEvent.cpp
Source/WebCore/dom/TreeScope.cpp
Source/WebCore/page/PrintContext.cpp
Source/WebCore/platform/cocoa/ThemeCocoa.mm
Source/WebCore/platform/graphics/FloatPoint.h
Source/WebCore/platform/graphics/FloatQuad.h
Source/WebCore/platform/graphics/FloatSize.h
Source/WebCore/platform/graphics/GraphicsContext.cpp
Source/WebCore/platform/graphics/GraphicsContext.h
Source/WebCore/platform/graphics/LayoutPoint.h
Source/WebCore/platform/graphics/ca/TileCoverageMap.cpp
Source/WebCore/platform/graphics/ca/TileGrid.cpp
Source/WebCore/platform/graphics/cg/ImageBufferCG.cpp
Source/WebCore/platform/mac/ThemeMac.mm
Source/WebCore/rendering/RenderImage.cpp
Source/WebCore/rendering/RenderMediaControls.cpp
Source/WebCore/rendering/RenderThemeMac.mm
Source/WebCore/rendering/svg/SVGInlineTextBox.cpp
Source/WebCore/svg/SVGPathBlender.cpp
Source/WebCore/svg/SVGPathParser.cpp
Source/WebCore/svg/SVGSVGElement.cpp
Source/WebKit2/ChangeLog
Source/WebKit2/PluginProcess/PluginControllerProxy.cpp
Source/WebKit2/Shared/mac/RemoteLayerBackingStore.mm
Source/WebKit2/UIProcess/API/Cocoa/WKWebView.mm
Source/WebKit2/UIProcess/ios/WKContentView.mm
Source/WebKit2/UIProcess/ios/WKContentViewInteraction.mm
Source/WebKit2/UIProcess/mac/RemoteLayerTreeDrawingAreaProxy.mm
Source/WebKit2/UIProcess/mac/ViewGestureControllerMac.mm
Source/WebKit2/WebProcess/InjectedBundle/DOM/InjectedBundleRangeHandle.cpp
Source/WebKit2/WebProcess/Plugins/Netscape/NetscapePlugin.cpp
Source/WebKit2/WebProcess/Plugins/PDF/PDFPlugin.mm
Source/WebKit2/WebProcess/WebPage/WebFrame.cpp
Source/WebKit2/WebProcess/WebPage/WebPage.cpp
Source/WebKit2/WebProcess/WebPage/ios/WebPageIOS.mm
Tools/ChangeLog
Tools/TestWebKitAPI/Tests/WebCore/FloatPoint.cpp