Diff
Modified: trunk/Source/WebCore/ChangeLog (208370 => 208371)
--- trunk/Source/WebCore/ChangeLog 2016-11-04 05:08:29 UTC (rev 208370)
+++ trunk/Source/WebCore/ChangeLog 2016-11-04 05:11:12 UTC (rev 208371)
@@ -1,3 +1,74 @@
+2016-11-03 Simon Fraser <[email protected]>
+
+ 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.
+
+ 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):
+
2016-11-03 Antti Koivisto <[email protected]>
REGRESSION (r207669): Crash under media controls shadow root construction
Modified: trunk/Source/WebCore/dom/Document.cpp (208370 => 208371)
--- trunk/Source/WebCore/dom/Document.cpp 2016-11-04 05:08:29 UTC (rev 208370)
+++ trunk/Source/WebCore/dom/Document.cpp 2016-11-04 05:11:12 UTC (rev 208371)
@@ -6460,9 +6460,9 @@
for (auto& quad : quads) {
quad.move(-visibleContentRect.x(), -visibleContentRect.y());
if (zoom != 1)
- quad.scale(1 / zoom, 1 / zoom);
+ quad.scale(1 / zoom);
if (inverseFrameScale != 1)
- quad.scale(inverseFrameScale, inverseFrameScale);
+ quad.scale(inverseFrameScale);
}
}
Modified: trunk/Source/WebCore/dom/MouseRelatedEvent.cpp (208370 => 208371)
--- trunk/Source/WebCore/dom/MouseRelatedEvent.cpp 2016-11-04 05:08:29 UTC (rev 208370)
+++ trunk/Source/WebCore/dom/MouseRelatedEvent.cpp 2016-11-04 05:11:12 UTC (rev 208371)
@@ -94,8 +94,8 @@
adjustedPageLocation = frameView->windowToContents(windowLocation);
float scaleFactor = 1 / (frame->pageZoomFactor() * frame->frameScaleFactor());
if (scaleFactor != 1.0f) {
- adjustedPageLocation.scale(scaleFactor, scaleFactor);
- scrollPosition.scale(scaleFactor, scaleFactor);
+ adjustedPageLocation.scale(scaleFactor);
+ scrollPosition.scale(scaleFactor);
}
}
}
@@ -182,7 +182,7 @@
m_offsetLocation = LayoutPoint(r->absoluteToLocal(absoluteLocation(), UseTransforms));
float scaleFactor = 1 / (pageZoomFactor(this) * frameScaleFactor(this));
if (scaleFactor != 1.0f)
- m_offsetLocation.scale(scaleFactor, scaleFactor);
+ m_offsetLocation.scale(scaleFactor);
}
// Adjust layerLocation to be relative to the layer.
Modified: trunk/Source/WebCore/dom/TreeScope.cpp (208370 => 208371)
--- trunk/Source/WebCore/dom/TreeScope.cpp 2016-11-04 05:08:29 UTC (rev 208370)
+++ trunk/Source/WebCore/dom/TreeScope.cpp 2016-11-04 05:11:12 UTC (rev 208371)
@@ -284,7 +284,7 @@
float scaleFactor = frame->pageZoomFactor() * frame->frameScaleFactor();
LayoutPoint contentsPoint = clientPoint;
- contentsPoint.scale(scaleFactor, scaleFactor);
+ contentsPoint.scale(scaleFactor);
contentsPoint.moveBy(view->contentsScrollPosition());
LayoutRect visibleRect;
Modified: trunk/Source/WebCore/page/PrintContext.cpp (208370 => 208371)
--- trunk/Source/WebCore/page/PrintContext.cpp 2016-11-04 05:08:29 UTC (rev 208370)
+++ trunk/Source/WebCore/page/PrintContext.cpp 2016-11-04 05:11:12 UTC (rev 208371)
@@ -187,7 +187,7 @@
float scale = width / pageRect.width();
ctx.save();
- ctx.scale(FloatSize(scale, scale));
+ ctx.scale(scale);
ctx.translate(-pageRect.x(), -pageRect.y());
ctx.clip(pageRect);
m_frame->view()->paintContents(ctx, pageRect);
Modified: trunk/Source/WebCore/platform/cocoa/ThemeCocoa.mm (208370 => 208371)
--- trunk/Source/WebCore/platform/cocoa/ThemeCocoa.mm 2016-11-04 05:08:29 UTC (rev 208370)
+++ trunk/Source/WebCore/platform/cocoa/ThemeCocoa.mm 2016-11-04 05:11:12 UTC (rev 208371)
@@ -47,7 +47,7 @@
translationX = (dstSize.width() - scale * srcImageSize.width()) / 2;
}
context.translate(translationX, translationY);
- context.scale(FloatSize(scale, scale));
+ context.scale(scale);
}
#if ENABLE(APPLE_PAY)
Modified: trunk/Source/WebCore/platform/graphics/FloatPoint.h (208370 => 208371)
--- trunk/Source/WebCore/platform/graphics/FloatPoint.h 2016-11-04 05:08:29 UTC (rev 208370)
+++ trunk/Source/WebCore/platform/graphics/FloatPoint.h 2016-11-04 05:11:12 UTC (rev 208371)
@@ -76,36 +76,49 @@
void setX(float x) { m_x = x; }
void setY(float y) { m_y = y; }
+
void set(float x, float y)
{
m_x = x;
m_y = y;
}
+
void move(float dx, float dy)
{
m_x += dx;
m_y += dy;
}
+
void move(const IntSize& a)
{
m_x += a.width();
m_y += a.height();
}
+
void move(const FloatSize& a)
{
m_x += a.width();
m_y += a.height();
}
+
void moveBy(const IntPoint& a)
{
m_x += a.x();
m_y += a.y();
}
+
void moveBy(const FloatPoint& a)
{
m_x += a.x();
m_y += a.y();
}
+
+ void scale(float scale)
+ {
+ m_x *= scale;
+ m_y *= scale;
+ }
+
void scale(float sx, float sy)
{
m_x *= sx;
@@ -121,6 +134,7 @@
float slopeAngleRadians() const;
float length() const;
+
float lengthSquared() const
{
return m_x * m_x + m_y * m_y;
Modified: trunk/Source/WebCore/platform/graphics/FloatQuad.h (208370 => 208371)
--- trunk/Source/WebCore/platform/graphics/FloatQuad.h 2016-11-04 05:08:29 UTC (rev 208370)
+++ trunk/Source/WebCore/platform/graphics/FloatQuad.h 2016-11-04 05:11:12 UTC (rev 208371)
@@ -126,6 +126,11 @@
m_p3.move(dx, dy);
m_p4.move(dx, dy);
}
+
+ void scale(float s)
+ {
+ scale(s, s);
+ }
void scale(float dx, float dy)
{
Modified: trunk/Source/WebCore/platform/graphics/FloatSize.h (208370 => 208371)
--- trunk/Source/WebCore/platform/graphics/FloatSize.h 2016-11-04 05:08:29 UTC (rev 208370)
+++ trunk/Source/WebCore/platform/graphics/FloatSize.h 2016-11-04 05:11:12 UTC (rev 208371)
@@ -83,7 +83,11 @@
m_height += height;
}
- void scale(float s) { scale(s, s); }
+ void scale(float s)
+ {
+ m_width *= s;
+ m_height *= s;
+ }
void scale(float scaleX, float scaleY)
{
@@ -104,6 +108,7 @@
}
WEBCORE_EXPORT float diagonalLength() const;
+
float diagonalLengthSquared() const
{
return m_width * m_width + m_height * m_height;
Modified: trunk/Source/WebCore/platform/graphics/GraphicsContext.cpp (208370 => 208371)
--- trunk/Source/WebCore/platform/graphics/GraphicsContext.cpp 2016-11-04 05:08:29 UTC (rev 208370)
+++ trunk/Source/WebCore/platform/graphics/GraphicsContext.cpp 2016-11-04 05:11:12 UTC (rev 208371)
@@ -1021,7 +1021,7 @@
void GraphicsContext::applyDeviceScaleFactor(float deviceScaleFactor)
{
- scale(FloatSize(deviceScaleFactor, deviceScaleFactor));
+ scale(deviceScaleFactor);
if (isRecording()) {
m_displayListRecorder->applyDeviceScaleFactor(deviceScaleFactor);
Modified: trunk/Source/WebCore/platform/graphics/GraphicsContext.h (208370 => 208371)
--- trunk/Source/WebCore/platform/graphics/GraphicsContext.h 2016-11-04 05:08:29 UTC (rev 208370)
+++ trunk/Source/WebCore/platform/graphics/GraphicsContext.h 2016-11-04 05:11:12 UTC (rev 208371)
@@ -463,6 +463,10 @@
void canvasClip(const Path&, WindRule = RULE_EVENODD);
void clipOut(const Path&);
+ void scale(float s)
+ {
+ scale({ s, s });
+ }
WEBCORE_EXPORT void scale(const FloatSize&);
void rotate(float angleInRadians);
void translate(const FloatSize& size) { translate(size.width(), size.height()); }
Modified: trunk/Source/WebCore/platform/graphics/LayoutPoint.h (208370 => 208371)
--- trunk/Source/WebCore/platform/graphics/LayoutPoint.h 2016-11-04 05:08:29 UTC (rev 208370)
+++ trunk/Source/WebCore/platform/graphics/LayoutPoint.h 2016-11-04 05:11:12 UTC (rev 208371)
@@ -55,6 +55,13 @@
void move(const LayoutSize& s) { move(s.width(), s.height()); }
void moveBy(const LayoutPoint& offset) { move(offset.x(), offset.y()); }
void move(LayoutUnit dx, LayoutUnit dy) { m_x += dx; m_y += dy; }
+
+ void scale(float s)
+ {
+ m_x *= s;
+ m_y *= s;
+ }
+
void scale(float sx, float sy)
{
m_x *= sx;
Modified: trunk/Source/WebCore/platform/graphics/ca/TileCoverageMap.cpp (208370 => 208371)
--- trunk/Source/WebCore/platform/graphics/ca/TileCoverageMap.cpp 2016-11-04 05:08:29 UTC (rev 208370)
+++ trunk/Source/WebCore/platform/graphics/ca/TileCoverageMap.cpp 2016-11-04 05:11:12 UTC (rev 208371)
@@ -105,13 +105,13 @@
float indicatorScale = scale * m_controller.tileGrid().scale();
FloatRect mapBounds = containerBounds;
- mapBounds.scale(indicatorScale, indicatorScale);
+ mapBounds.scale(indicatorScale);
m_layer.get().setPosition(m_position + FloatPoint(2, 2));
m_layer.get().setBounds(mapBounds);
m_layer.get().setNeedsDisplay();
- visibleRect.scale(indicatorScale, indicatorScale);
+ visibleRect.scale(indicatorScale);
visibleRect.expand(2, 2);
m_visibleViewportIndicatorLayer->setPosition(visibleRect.location());
m_visibleViewportIndicatorLayer->setBounds(FloatRect(FloatPoint(), visibleRect.size()));
@@ -118,7 +118,7 @@
if (auto layoutViewportRect = m_controller.layoutViewportRect()) {
FloatRect layoutRect = layoutViewportRect.value();
- layoutRect.scale(indicatorScale, indicatorScale);
+ layoutRect.scale(indicatorScale);
layoutRect.expand(2, 2);
m_layoutViewportIndicatorLayer->setPosition(layoutRect.location());
m_layoutViewportIndicatorLayer->setBounds(FloatRect(FloatPoint(), layoutRect.size()));
@@ -128,7 +128,7 @@
} else if (m_layoutViewportIndicatorLayer->superlayer())
m_layoutViewportIndicatorLayer->removeFromSuperlayer();
- coverageRect.scale(indicatorScale, indicatorScale);
+ coverageRect.scale(indicatorScale);
coverageRect.expand(2, 2);
m_coverageRectIndicatorLayer->setPosition(coverageRect.location());
m_coverageRectIndicatorLayer->setBounds(FloatRect(FloatPoint(), coverageRect.size()));
Modified: trunk/Source/WebCore/platform/graphics/ca/TileGrid.cpp (208370 => 208371)
--- trunk/Source/WebCore/platform/graphics/ca/TileGrid.cpp 2016-11-04 05:08:29 UTC (rev 208370)
+++ trunk/Source/WebCore/platform/graphics/ca/TileGrid.cpp 2016-11-04 05:11:12 UTC (rev 208371)
@@ -698,7 +698,7 @@
FloatPoint3D layerOrigin = platformCALayer->position();
context.translate(-layerOrigin.x(), -layerOrigin.y());
- context.scale(FloatSize(m_scale, m_scale));
+ context.scale(m_scale);
PlatformCALayer::RepaintRectList dirtyRects = PlatformCALayer::collectRectsToPaint(context.platformContext(), platformCALayer);
PlatformCALayer::drawLayerContents(context.platformContext(), &m_controller.rootLayer(), dirtyRects);
Modified: trunk/Source/WebCore/platform/graphics/cg/ImageBufferCG.cpp (208370 => 208371)
--- trunk/Source/WebCore/platform/graphics/cg/ImageBufferCG.cpp 2016-11-04 05:08:29 UTC (rev 208370)
+++ trunk/Source/WebCore/platform/graphics/cg/ImageBufferCG.cpp 2016-11-04 05:11:12 UTC (rev 208371)
@@ -343,7 +343,7 @@
RetainPtr<CGImageRef> image = IOSurface::sinkIntoImage(IOSurface::createFromImageBuffer(WTFMove(imageBuffer)));
FloatRect adjustedSrcRect = srcRect;
- adjustedSrcRect.scale(resolutionScale, resolutionScale);
+ adjustedSrcRect.scale(resolutionScale);
destContext.drawNativeImage(image.get(), backingStoreSize, destRect, adjustedSrcRect, op, blendMode);
#else
imageBuffer->draw(destContext, destRect, srcRect, op, blendMode);
@@ -359,7 +359,7 @@
image = copyNativeImage(DontCopyBackingStore);
FloatRect adjustedSrcRect = srcRect;
- adjustedSrcRect.scale(m_resolutionScale, m_resolutionScale);
+ adjustedSrcRect.scale(m_resolutionScale);
destContext.drawNativeImage(image.get(), m_data.backingStoreSize, destRect, adjustedSrcRect, op, blendMode);
}
@@ -366,7 +366,7 @@
void ImageBuffer::drawPattern(GraphicsContext& destContext, const FloatRect& destRect, const FloatRect& srcRect, const AffineTransform& patternTransform, const FloatPoint& phase, const FloatSize& spacing, CompositeOperator op, BlendMode blendMode)
{
FloatRect adjustedSrcRect = srcRect;
- adjustedSrcRect.scale(m_resolutionScale, m_resolutionScale);
+ adjustedSrcRect.scale(m_resolutionScale);
if (!context().isAcceleratedContext()) {
if (&destContext == &context() || destContext.isAcceleratedContext()) {
Modified: trunk/Source/WebCore/platform/mac/ThemeMac.mm (208370 => 208371)
--- trunk/Source/WebCore/platform/mac/ThemeMac.mm 2016-11-04 05:08:29 UTC (rev 208370)
+++ trunk/Source/WebCore/platform/mac/ThemeMac.mm 2016-11-04 05:11:12 UTC (rev 208371)
@@ -411,7 +411,7 @@
inflatedRect.setWidth(inflatedRect.width() / zoomFactor);
inflatedRect.setHeight(inflatedRect.height() / zoomFactor);
context.translate(inflatedRect.x(), inflatedRect.y());
- context.scale(FloatSize(zoomFactor, zoomFactor));
+ context.scale(zoomFactor);
context.translate(-inflatedRect.x(), -inflatedRect.y());
}
@@ -539,7 +539,7 @@
inflatedRect.setWidth(inflatedRect.width() / zoomFactor);
inflatedRect.setHeight(inflatedRect.height() / zoomFactor);
context.translate(inflatedRect.x(), inflatedRect.y());
- context.scale(FloatSize(zoomFactor, zoomFactor));
+ context.scale(zoomFactor);
context.translate(-inflatedRect.x(), -inflatedRect.y());
}
}
@@ -616,7 +616,7 @@
rect.setWidth(rect.width() / zoomFactor);
rect.setHeight(rect.height() / zoomFactor);
context.translate(rect.x(), rect.y());
- context.scale(FloatSize(zoomFactor, zoomFactor));
+ context.scale(zoomFactor);
context.translate(-rect.x(), -rect.y());
}
CGRect bounds(rect);
Modified: trunk/Source/WebCore/rendering/RenderImage.cpp (208370 => 208371)
--- trunk/Source/WebCore/rendering/RenderImage.cpp 2016-11-04 05:08:29 UTC (rev 208370)
+++ trunk/Source/WebCore/rendering/RenderImage.cpp 2016-11-04 05:11:12 UTC (rev 208371)
@@ -633,7 +633,7 @@
LayoutRect contentBox = contentBoxRect();
float scaleFactor = 1 / style().effectiveZoom();
LayoutPoint mapLocation = locationInContainer.point() - toLayoutSize(accumulatedOffset) - locationOffset() - toLayoutSize(contentBox.location());
- mapLocation.scale(scaleFactor, scaleFactor);
+ mapLocation.scale(scaleFactor);
if (map->mapMouseEvent(mapLocation, contentBox.size(), tempResult))
tempResult.setInnerNonSharedNode(element());
Modified: trunk/Source/WebCore/rendering/RenderMediaControls.cpp (208370 => 208371)
--- trunk/Source/WebCore/rendering/RenderMediaControls.cpp 2016-11-04 05:08:29 UTC (rev 208370)
+++ trunk/Source/WebCore/rendering/RenderMediaControls.cpp 2016-11-04 05:11:12 UTC (rev 208371)
@@ -93,7 +93,7 @@
unzoomedRect.setWidth(unzoomedRect.width() / zoomLevel);
unzoomedRect.setHeight(unzoomedRect.height() / zoomLevel);
paintInfo.context().translate(unzoomedRect.x(), unzoomedRect.y());
- paintInfo.context().scale(FloatSize(zoomLevel, zoomLevel));
+ paintInfo.context().scale(zoomLevel);
paintInfo.context().translate(-unzoomedRect.x(), -unzoomedRect.y());
}
return unzoomedRect;
Modified: trunk/Source/WebCore/rendering/RenderThemeMac.mm (208370 => 208371)
--- trunk/Source/WebCore/rendering/RenderThemeMac.mm 2016-11-04 05:08:29 UTC (rev 208370)
+++ trunk/Source/WebCore/rendering/RenderThemeMac.mm 2016-11-04 05:11:12 UTC (rev 208371)
@@ -964,7 +964,7 @@
inflatedRect.setWidth(inflatedRect.width() / zoomLevel);
inflatedRect.setHeight(inflatedRect.height() / zoomLevel);
paintInfo.context().translate(inflatedRect.x(), inflatedRect.y());
- paintInfo.context().scale(FloatSize(zoomLevel, zoomLevel));
+ paintInfo.context().scale(zoomLevel);
paintInfo.context().translate(-inflatedRect.x(), -inflatedRect.y());
}
@@ -1608,7 +1608,7 @@
unzoomedRect.setWidth(unzoomedRect.width() / zoomLevel);
unzoomedRect.setHeight(unzoomedRect.height() / zoomLevel);
paintInfo.context().translate(unzoomedRect.x(), unzoomedRect.y());
- paintInfo.context().scale(FloatSize(zoomLevel, zoomLevel));
+ paintInfo.context().scale(zoomLevel);
paintInfo.context().translate(-unzoomedRect.x(), -unzoomedRect.y());
}
@@ -1639,7 +1639,7 @@
unzoomedRect.setWidth(unzoomedRect.width() / zoomLevel);
unzoomedRect.setHeight(unzoomedRect.height() / zoomLevel);
paintInfo.context().translate(unzoomedRect.x(), unzoomedRect.y());
- paintInfo.context().scale(FloatSize(zoomLevel, zoomLevel));
+ paintInfo.context().scale(zoomLevel);
paintInfo.context().translate(-unzoomedRect.x(), -unzoomedRect.y());
}
@@ -1767,7 +1767,7 @@
unzoomedRect.setWidth(unzoomedRect.width() / zoomLevel);
unzoomedRect.setHeight(unzoomedRect.height() / zoomLevel);
paintInfo.context().translate(unzoomedRect.x(), unzoomedRect.y());
- paintInfo.context().scale(FloatSize(zoomLevel, zoomLevel));
+ paintInfo.context().scale(zoomLevel);
paintInfo.context().translate(-unzoomedRect.x(), -unzoomedRect.y());
}
[[search cancelButtonCell] drawWithFrame:unzoomedRect inView:documentViewFor(box)];
@@ -1903,7 +1903,7 @@
unzoomedRect.setWidth(unzoomedRect.width() / zoomLevel);
unzoomedRect.setHeight(unzoomedRect.height() / zoomLevel);
paintInfo.context().translate(unzoomedRect.x(), unzoomedRect.y());
- paintInfo.context().scale(FloatSize(zoomLevel, zoomLevel));
+ paintInfo.context().scale(zoomLevel);
paintInfo.context().translate(-unzoomedRect.x(), -unzoomedRect.y());
}
Modified: trunk/Source/WebCore/rendering/svg/SVGInlineTextBox.cpp (208370 => 208371)
--- trunk/Source/WebCore/rendering/svg/SVGInlineTextBox.cpp 2016-11-04 05:08:29 UTC (rev 208370)
+++ trunk/Source/WebCore/rendering/svg/SVGInlineTextBox.cpp 2016-11-04 05:11:12 UTC (rev 208371)
@@ -118,7 +118,7 @@
const FontMetrics& scaledFontMetrics = scaledFont.fontMetrics();
FloatPoint textOrigin(fragment.x, fragment.y);
if (scalingFactor != 1)
- textOrigin.scale(scalingFactor, scalingFactor);
+ textOrigin.scale(scalingFactor);
textOrigin.move(0, -scaledFontMetrics.floatAscent());
@@ -527,8 +527,8 @@
GraphicsContextStateSaver stateSaver(context);
if (scalingFactor != 1) {
width *= scalingFactor;
- decorationOrigin.scale(scalingFactor, scalingFactor);
- context.scale(FloatSize(1 / scalingFactor, 1 / scalingFactor));
+ decorationOrigin.scale(scalingFactor);
+ context.scale(1 / scalingFactor);
}
decorationOrigin.move(0, -scaledFontMetrics.floatAscent() + positionOffsetForDecoration(decoration, scaledFontMetrics, thickness));
@@ -553,7 +553,7 @@
FloatSize textSize(fragment.width, fragment.height);
if (scalingFactor != 1) {
- textOrigin.scale(scalingFactor, scalingFactor);
+ textOrigin.scale(scalingFactor);
textSize.scale(scalingFactor);
}
@@ -569,7 +569,7 @@
if (!shadowApplier.didSaveContext())
usedContext->save();
- usedContext->scale(FloatSize(1 / scalingFactor, 1 / scalingFactor));
+ usedContext->scale(1 / scalingFactor);
scaledFont.drawText(*usedContext, textRun, textOrigin + shadowApplier.extraOffset(), startPosition, endPosition);
Modified: trunk/Source/WebCore/svg/SVGPathBlender.cpp (208370 => 208371)
--- trunk/Source/WebCore/svg/SVGPathBlender.cpp 2016-11-04 05:08:29 UTC (rev 208370)
+++ trunk/Source/WebCore/svg/SVGPathBlender.cpp 2016-11-04 05:11:12 UTC (rev 208371)
@@ -88,7 +88,7 @@
if (m_addTypesCount) {
ASSERT(m_fromMode == m_toMode);
FloatPoint repeatedToPoint = toPoint;
- repeatedToPoint.scale(m_addTypesCount, m_addTypesCount);
+ repeatedToPoint.scale(m_addTypesCount);
return fromPoint + repeatedToPoint;
}
@@ -291,7 +291,7 @@
if (m_addTypesCount) {
ASSERT(m_fromMode == m_toMode);
FloatPoint scaledToTargetPoint = toTargetPoint;
- scaledToTargetPoint.scale(m_addTypesCount, m_addTypesCount);
+ scaledToTargetPoint.scale(m_addTypesCount);
m_consumer->arcTo(fromRx + toRx * m_addTypesCount,
fromRy + toRy * m_addTypesCount,
fromAngle + toAngle * m_addTypesCount,
Modified: trunk/Source/WebCore/svg/SVGPathParser.cpp (208370 => 208371)
--- trunk/Source/WebCore/svg/SVGPathParser.cpp 2016-11-04 05:08:29 UTC (rev 208370)
+++ trunk/Source/WebCore/svg/SVGPathParser.cpp 2016-11-04 05:11:12 UTC (rev 208371)
@@ -179,7 +179,7 @@
if (m_pathParsingMode == NormalizedParsing) {
FloatPoint point1 = m_currentPoint;
- point1.scale(2, 2);
+ point1.scale(2);
point1.move(-m_controlPoint.x(), -m_controlPoint.y());
if (m_mode == RelativeCoordinates) {
point2 += m_currentPoint;
@@ -212,8 +212,8 @@
point2.move(3 * m_currentPoint.x(), 3 * m_currentPoint.y());
targetPoint += m_currentPoint;
}
- point1.scale(gOneOverThree, gOneOverThree);
- point2.scale(gOneOverThree, gOneOverThree);
+ point1.scale(gOneOverThree);
+ point2.scale(gOneOverThree);
m_consumer.curveToCubic(point1, point2, targetPoint, AbsoluteCoordinates);
@@ -239,7 +239,7 @@
if (m_pathParsingMode == NormalizedParsing) {
FloatPoint cubicPoint = m_currentPoint;
- cubicPoint.scale(2, 2);
+ cubicPoint.scale(2);
cubicPoint.move(-m_controlPoint.x(), -m_controlPoint.y());
FloatPoint point1(m_currentPoint.x() + 2 * cubicPoint.x(), m_currentPoint.y() + 2 * cubicPoint.y());
FloatPoint point2(targetPoint.x() + 2 * cubicPoint.x(), targetPoint.y() + 2 * cubicPoint.y());
@@ -247,8 +247,8 @@
point2 += m_currentPoint;
targetPoint += m_currentPoint;
}
- point1.scale(gOneOverThree, gOneOverThree);
- point2.scale(gOneOverThree, gOneOverThree);
+ point1.scale(gOneOverThree);
+ point2.scale(gOneOverThree);
m_consumer.curveToCubic(point1, point2, targetPoint, AbsoluteCoordinates);
@@ -461,7 +461,7 @@
delta.scale(scaleFactor);
FloatPoint centerPoint = point1 + point2;
- centerPoint.scale(0.5f, 0.5f);
+ centerPoint.scale(0.5f);
centerPoint.move(-delta.height(), delta.width());
float theta1 = FloatPoint(point1 - centerPoint).slopeAngleRadians();
Modified: trunk/Source/WebCore/svg/SVGSVGElement.cpp (208370 => 208371)
--- trunk/Source/WebCore/svg/SVGSVGElement.cpp 2016-11-04 05:08:29 UTC (rev 208370)
+++ trunk/Source/WebCore/svg/SVGSVGElement.cpp 2016-11-04 05:11:12 UTC (rev 208371)
@@ -409,7 +409,7 @@
// Translate in our CSS parent coordinate space
// FIXME: This doesn't work correctly with CSS transforms.
location = renderer->localToAbsolute(location, UseTransforms);
- location.scale(zoomFactor, zoomFactor);
+ location.scale(zoomFactor);
// Be careful here! localToBorderBoxTransform() included the x/y offset coming from the viewBoxToViewTransform(),
// so we have to subtract it here (original cause of bug #27183)
@@ -418,7 +418,7 @@
// Respect scroll offset.
if (FrameView* view = document().view()) {
LayoutPoint scrollPosition = view->scrollPosition();
- scrollPosition.scale(zoomFactor, zoomFactor);
+ scrollPosition.scale(zoomFactor);
transform.translate(-scrollPosition.x(), -scrollPosition.y());
}
}
Modified: trunk/Source/WebKit2/ChangeLog (208370 => 208371)
--- trunk/Source/WebKit2/ChangeLog 2016-11-04 05:08:29 UTC (rev 208370)
+++ trunk/Source/WebKit2/ChangeLog 2016-11-04 05:11:12 UTC (rev 208371)
@@ -1,3 +1,48 @@
+2016-11-03 Simon Fraser <[email protected]>
+
+ 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.
+
+ 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):
+
2016-11-03 Chris Dumez <[email protected]>
[WK2][Cocoa] Implement user interface for HTML form validation
Modified: trunk/Source/WebKit2/PluginProcess/PluginControllerProxy.cpp (208370 => 208371)
--- trunk/Source/WebKit2/PluginProcess/PluginControllerProxy.cpp 2016-11-04 05:08:29 UTC (rev 208370)
+++ trunk/Source/WebKit2/PluginProcess/PluginControllerProxy.cpp 2016-11-04 05:11:12 UTC (rev 208371)
@@ -188,7 +188,7 @@
#if PLATFORM(COCOA)
// FIXME: We should really call applyDeviceScaleFactor instead of scale, but that ends up calling into WKSI
// which we currently don't have initiated in the plug-in process.
- graphicsContext->scale(FloatSize(m_contentsScaleFactor, m_contentsScaleFactor));
+ graphicsContext->scale(m_contentsScaleFactor);
#endif
if (m_plugin->isTransparent())
Modified: trunk/Source/WebKit2/Shared/mac/RemoteLayerBackingStore.mm (208370 => 208371)
--- trunk/Source/WebKit2/Shared/mac/RemoteLayerBackingStore.mm 2016-11-04 05:08:29 UTC (rev 208370)
+++ trunk/Source/WebKit2/Shared/mac/RemoteLayerBackingStore.mm 2016-11-04 05:11:12 UTC (rev 208371)
@@ -345,7 +345,7 @@
context.fillRect(scaledLayerBounds, Color(255, 0, 0));
#endif
- context.scale(FloatSize(m_scale, m_scale));
+ context.scale(m_scale);
// FIXME: This should be moved to PlatformCALayerRemote for better layering.
switch (m_layer->layerType()) {
Modified: trunk/Source/WebKit2/UIProcess/API/Cocoa/WKWebView.mm (208370 => 208371)
--- trunk/Source/WebKit2/UIProcess/API/Cocoa/WKWebView.mm 2016-11-04 05:08:29 UTC (rev 208370)
+++ trunk/Source/WebKit2/UIProcess/API/Cocoa/WKWebView.mm 2016-11-04 05:11:12 UTC (rev 208371)
@@ -1289,7 +1289,7 @@
if (areEssentiallyEqualAsFloat(contentZoomScale(self), _scaleToRestore)) {
WebCore::FloatPoint scaledScrollOffset = _scrollOffsetToRestore;
- scaledScrollOffset.scale(_scaleToRestore, _scaleToRestore);
+ scaledScrollOffset.scale(_scaleToRestore);
WebCore::FloatPoint contentOffsetInScrollViewCoordinates = scaledScrollOffset - _obscuredInsetWhenSaved;
changeContentOffsetBoundedInValidRange(_scrollView.get(), contentOffsetInScrollViewCoordinates);
@@ -1309,7 +1309,7 @@
WebCore::FloatSize unobscuredContentSizeAtNewScale(unobscuredRect.size.width / _scaleToRestore, unobscuredRect.size.height / _scaleToRestore);
WebCore::FloatPoint topLeftInDocumentCoordinates(_unobscuredCenterToRestore.x() - unobscuredContentSizeAtNewScale.width() / 2, _unobscuredCenterToRestore.y() - unobscuredContentSizeAtNewScale.height() / 2);
- topLeftInDocumentCoordinates.scale(_scaleToRestore, _scaleToRestore);
+ topLeftInDocumentCoordinates.scale(_scaleToRestore);
topLeftInDocumentCoordinates.moveBy(WebCore::FloatPoint(-_obscuredInsets.left, -_obscuredInsets.top));
changeContentOffsetBoundedInValidRange(_scrollView.get(), topLeftInDocumentCoordinates);
@@ -1391,7 +1391,7 @@
{
float deviceScale = WebCore::screenScaleFactor();
WebCore::FloatSize snapshotSize(self.bounds.size);
- snapshotSize.scale(deviceScale, deviceScale);
+ snapshotSize.scale(deviceScale);
CATransform3D transform = CATransform3DMakeScale(deviceScale, deviceScale, 1);
@@ -1491,7 +1491,7 @@
WebCore::FloatPoint scaledOffset = contentOffset;
CGFloat zoomScale = contentZoomScale(self);
- scaledOffset.scale(zoomScale, zoomScale);
+ scaledOffset.scale(zoomScale);
CGPoint contentOffsetInScrollViewCoordinates = [self _adjustedContentOffset:scaledOffset];
contentOffsetInScrollViewCoordinates = contentOffsetBoundedInValidRange(_scrollView.get(), contentOffsetInScrollViewCoordinates);
@@ -1554,7 +1554,7 @@
{
WebCore::FloatPoint scaledOffsetDelta = contentOffsetDelta;
CGFloat zoomScale = contentZoomScale(self);
- scaledOffsetDelta.scale(zoomScale, zoomScale);
+ scaledOffsetDelta.scale(zoomScale);
CGPoint currentOffset = [_scrollView _isAnimatingScroll] ? [_scrollView _animatedTargetOffset] : [_scrollView contentOffset];
CGPoint boundedOffset = contentOffsetBoundedInValidRange(_scrollView.get(), currentOffset + scaledOffsetDelta);
@@ -1693,7 +1693,7 @@
LOG_WITH_STREAM(VisibleRects, stream << "_zoomToFocusRect: zooming to " << newCenter << " scale:" << scale);
// The newCenter has been computed in the new scale, but _zoomToCenter expected the center to be in the original scale.
- newCenter.scale(1 / scale, 1 / scale);
+ newCenter.scale(1 / scale);
[_scrollView _zoomToCenter:newCenter
scale:scale
duration:UIWebFormAnimationDuration
Modified: trunk/Source/WebKit2/UIProcess/ios/WKContentView.mm (208370 => 208371)
--- trunk/Source/WebKit2/UIProcess/ios/WKContentView.mm 2016-11-04 05:08:29 UTC (rev 208370)
+++ trunk/Source/WebKit2/UIProcess/ios/WKContentView.mm 2016-11-04 05:11:12 UTC (rev 208371)
@@ -531,7 +531,7 @@
if (_interactionViewsContainerView) {
FloatPoint scaledOrigin = layerTreeTransaction.scrollOrigin();
float scale = [[_webView scrollView] zoomScale];
- scaledOrigin.scale(scale, scale);
+ scaledOrigin.scale(scale);
[_interactionViewsContainerView setFrame:CGRectMake(scaledOrigin.x(), scaledOrigin.y(), 0, 0)];
}
Modified: trunk/Source/WebKit2/UIProcess/ios/WKContentViewInteraction.mm (208370 => 208371)
--- trunk/Source/WebKit2/UIProcess/ios/WKContentViewInteraction.mm 2016-11-04 05:08:29 UTC (rev 208370)
+++ trunk/Source/WebKit2/UIProcess/ios/WKContentViewInteraction.mm 2016-11-04 05:11:12 UTC (rev 208371)
@@ -963,7 +963,7 @@
RetainPtr<NSMutableArray> quads = adoptNS([[NSMutableArray alloc] initWithCapacity:static_cast<const NSUInteger>(quadCount)]);
for (size_t i = 0; i < quadCount; ++i) {
FloatQuad quad = highlightedQuads[i];
- quad.scale(selfScale, selfScale);
+ quad.scale(selfScale);
FloatQuad extendedQuad = inflateQuad(quad, minimumTapHighlightRadius);
[quads addObject:[NSValue valueWithCGPoint:extendedQuad.p1()]];
[quads addObject:[NSValue valueWithCGPoint:extendedQuad.p2()]];
Modified: trunk/Source/WebKit2/UIProcess/mac/RemoteLayerTreeDrawingAreaProxy.mm (208370 => 208371)
--- trunk/Source/WebKit2/UIProcess/mac/RemoteLayerTreeDrawingAreaProxy.mm 2016-11-04 05:08:29 UTC (rev 208370)
+++ trunk/Source/WebKit2/UIProcess/mac/RemoteLayerTreeDrawingAreaProxy.mm 2016-11-04 05:11:12 UTC (rev 208371)
@@ -280,7 +280,7 @@
tiledMapLocation += FloatSize(indicatorInset, indicatorInset);
float scale = 1 / m_webPageProxy.pageScaleFactor();
- tiledMapLocation.scale(scale, scale);
+ tiledMapLocation.scale(scale);
#endif
return tiledMapLocation;
}
@@ -349,7 +349,7 @@
if (viewExposedRect())
scaledExposedRect = viewExposedRect().value();
float scale = 1 / m_webPageProxy.pageScaleFactor();
- scaledExposedRect.scale(scale, scale);
+ scaledExposedRect.scale(scale);
#endif
[m_exposedRectIndicatorLayer setPosition:scaledExposedRect.location()];
[m_exposedRectIndicatorLayer setBounds:FloatRect(FloatPoint(), scaledExposedRect.size())];
Modified: trunk/Source/WebKit2/UIProcess/mac/ViewGestureControllerMac.mm (208370 => 208371)
--- trunk/Source/WebKit2/UIProcess/mac/ViewGestureControllerMac.mm 2016-11-04 05:08:29 UTC (rev 208370)
+++ trunk/Source/WebKit2/UIProcess/mac/ViewGestureControllerMac.mm 2016-11-04 05:11:12 UTC (rev 208371)
@@ -117,7 +117,7 @@
FloatPoint scaledMagnificationOrigin(origin);
scaledMagnificationOrigin.moveBy(m_visibleContentRect.location());
float magnificationOriginScale = 1 - (scale / m_webPageProxy.pageScaleFactor());
- scaledMagnificationOrigin.scale(magnificationOriginScale, magnificationOriginScale);
+ scaledMagnificationOrigin.scale(magnificationOriginScale);
return scaledMagnificationOrigin;
}
Modified: trunk/Source/WebKit2/WebProcess/InjectedBundle/DOM/InjectedBundleRangeHandle.cpp (208370 => 208371)
--- trunk/Source/WebKit2/WebProcess/InjectedBundle/DOM/InjectedBundleRangeHandle.cpp 2016-11-04 05:08:29 UTC (rev 208370)
+++ trunk/Source/WebKit2/WebProcess/InjectedBundle/DOM/InjectedBundleRangeHandle.cpp 2016-11-04 05:11:12 UTC (rev 208371)
@@ -129,7 +129,7 @@
return nullptr;
auto graphicsContext = backingStore->createGraphicsContext();
- graphicsContext->scale(FloatSize(scaleFactor, scaleFactor));
+ graphicsContext->scale(scaleFactor);
paintRect.move(frameView->frameRect().x(), frameView->frameRect().y());
paintRect.moveBy(-frameView->scrollPosition());
Modified: trunk/Source/WebKit2/WebProcess/Plugins/Netscape/NetscapePlugin.cpp (208370 => 208371)
--- trunk/Source/WebKit2/WebProcess/Plugins/Netscape/NetscapePlugin.cpp 2016-11-04 05:08:29 UTC (rev 208370)
+++ trunk/Source/WebKit2/WebProcess/Plugins/Netscape/NetscapePlugin.cpp 2016-11-04 05:11:12 UTC (rev 208371)
@@ -759,7 +759,7 @@
// FIXME: We should really call applyDeviceScaleFactor instead of scale, but that ends up calling into WKSI
// which we currently don't have initiated in the plug-in process.
- context->scale(FloatSize(contentsScaleFactor(), contentsScaleFactor()));
+ context->scale(contentsScaleFactor());
platformPaint(*context, IntRect(IntPoint(), m_pluginSize), true);
Modified: trunk/Source/WebKit2/WebProcess/Plugins/PDF/PDFPlugin.mm (208370 => 208371)
--- trunk/Source/WebKit2/WebProcess/Plugins/PDF/PDFPlugin.mm 2016-11-04 05:08:29 UTC (rev 208370)
+++ trunk/Source/WebKit2/WebProcess/Plugins/PDF/PDFPlugin.mm 2016-11-04 05:11:12 UTC (rev 208371)
@@ -1592,7 +1592,7 @@
{
Frame* frame = pluginView()->frame();
float scale = frame->page()->pageScaleFactor();
- scrollPoint.scale(scale, scale);
+ scrollPoint.scale(scale);
frame->view()->scrollToOffsetWithoutAnimation(scrollPoint);
}
Modified: trunk/Source/WebKit2/WebProcess/WebPage/WebFrame.cpp (208370 => 208371)
--- trunk/Source/WebKit2/WebProcess/WebPage/WebFrame.cpp 2016-11-04 05:08:29 UTC (rev 208370)
+++ trunk/Source/WebKit2/WebProcess/WebPage/WebFrame.cpp 2016-11-04 05:11:12 UTC (rev 208371)
@@ -840,7 +840,7 @@
// if we're compositing this image onto a solid color (e.g. the modern find indicator style).
auto graphicsContext = sharedSnapshot->createGraphicsContext();
float deviceScaleFactor = coreFrame()->page()->deviceScaleFactor();
- graphicsContext->scale(FloatSize(deviceScaleFactor, deviceScaleFactor));
+ graphicsContext->scale(deviceScaleFactor);
graphicsContext->drawConsumingImageBuffer(WTFMove(snapshot), FloatPoint());
return WTFMove(sharedSnapshot);
Modified: trunk/Source/WebKit2/WebProcess/WebPage/WebPage.cpp (208370 => 208371)
--- trunk/Source/WebKit2/WebProcess/WebPage/WebPage.cpp 2016-11-04 05:08:29 UTC (rev 208370)
+++ trunk/Source/WebKit2/WebProcess/WebPage/WebPage.cpp 2016-11-04 05:11:12 UTC (rev 208371)
@@ -1599,7 +1599,7 @@
IntPoint scrollPositionAtNewScale = mainFrameView()->rootViewToContents(-centerInViewCoordinates);
double scaleRatio = scale / pageScaleFactor();
- scrollPositionAtNewScale.scale(scaleRatio, scaleRatio);
+ scrollPositionAtNewScale.scale(scaleRatio);
scalePage(scale, scrollPositionAtNewScale);
}
@@ -1633,7 +1633,7 @@
if (FrameView* mainFrameView = m_page->mainFrame().view()) {
double scaleRatio = scale / viewScaleFactor();
scrollPositionAtNewScale = mainFrameView->scrollPosition();
- scrollPositionAtNewScale.scale(scaleRatio, scaleRatio);
+ scrollPositionAtNewScale.scale(scaleRatio);
}
m_page->setViewScaleFactor(scale);
@@ -1943,7 +1943,7 @@
scaleFactor /= deviceScaleFactor;
}
- graphicsContext->scale(FloatSize(scaleFactor, scaleFactor));
+ graphicsContext->scale(scaleFactor);
graphicsContext->translate(-snapshotRect.x(), -snapshotRect.y());
FrameView::SelectionInSnapshot shouldPaintSelection = FrameView::IncludeSelection;
@@ -2003,7 +2003,7 @@
scaleFactor /= deviceScaleFactor;
}
- graphicsContext->scale(FloatSize(scaleFactor, scaleFactor));
+ graphicsContext->scale(scaleFactor);
graphicsContext->translate(-snapshotRect.x(), -snapshotRect.y());
Color savedBackgroundColor = frameView->baseBackgroundColor();
@@ -4244,7 +4244,7 @@
auto graphicsContext = bitmap->createGraphicsContext();
float printingScale = static_cast<float>(imageSize.width()) / rect.width();
- graphicsContext->scale(FloatSize(printingScale, printingScale));
+ graphicsContext->scale(printingScale);
#if PLATFORM(MAC)
if (RetainPtr<PDFDocument> pdfDocument = pdfDocumentForPrintingFrame(coreFrame)) {
Modified: trunk/Source/WebKit2/WebProcess/WebPage/ios/WebPageIOS.mm (208370 => 208371)
--- trunk/Source/WebKit2/WebProcess/WebPage/ios/WebPageIOS.mm 2016-11-04 05:08:29 UTC (rev 208370)
+++ trunk/Source/WebKit2/WebProcess/WebPage/ios/WebPageIOS.mm 2016-11-04 05:11:12 UTC (rev 208371)
@@ -299,7 +299,7 @@
newCenter = FloatRect(historyItem.unobscuredContentRect()).center();
FloatSize unobscuredRectAtNewScale = frameView.customSizeForResizeEvent();
- unobscuredRectAtNewScale.scale(1 / newScale, 1 / newScale);
+ unobscuredRectAtNewScale.scale(1 / newScale);
FloatRect oldExposedRect = frameView.exposedContentRect();
FloatRect adjustedExposedRect = adjustExposedRectForNewScale(oldExposedRect, m_page->pageScaleFactor(), newScale);
Modified: trunk/Tools/ChangeLog (208370 => 208371)
--- trunk/Tools/ChangeLog 2016-11-04 05:08:29 UTC (rev 208370)
+++ trunk/Tools/ChangeLog 2016-11-04 05:11:12 UTC (rev 208371)
@@ -1,3 +1,15 @@
+2016-11-03 Simon Fraser <[email protected]>
+
+ 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.
+
+ Test single-argument scale().
+
+ * TestWebKitAPI/Tests/WebCore/FloatPoint.cpp:
+ (TestWebKitAPI::TEST):
+
2016-11-03 Chris Dumez <[email protected]>
[WK2][Cocoa] Implement user interface for HTML form validation
Modified: trunk/Tools/TestWebKitAPI/Tests/WebCore/FloatPoint.cpp (208370 => 208371)
--- trunk/Tools/TestWebKitAPI/Tests/WebCore/FloatPoint.cpp 2016-11-04 05:08:29 UTC (rev 208370)
+++ trunk/Tools/TestWebKitAPI/Tests/WebCore/FloatPoint.cpp 2016-11-04 05:11:12 UTC (rev 208371)
@@ -289,10 +289,15 @@
EXPECT_FLOAT_EQ(100.0f, test.x());
EXPECT_FLOAT_EQ(200.0f, test.y());
+ test.scale(2);
+
+ EXPECT_FLOAT_EQ(200.0f, test.x());
+ EXPECT_FLOAT_EQ(400.0f, test.y());
+
test.scale(1.0f, 0.5f);
- EXPECT_FLOAT_EQ(100.0f, test.x());
- EXPECT_FLOAT_EQ(100.0f, test.y());
+ EXPECT_FLOAT_EQ(200.0f, test.x());
+ EXPECT_FLOAT_EQ(200.0f, test.y());
}
TEST(FloatPoint, Normalize)