Title: [187329] branches/safari-601.1-branch/Source/WebCore

Diff

Modified: branches/safari-601.1-branch/Source/WebCore/ChangeLog (187328 => 187329)


--- branches/safari-601.1-branch/Source/WebCore/ChangeLog	2015-07-24 07:54:53 UTC (rev 187328)
+++ branches/safari-601.1-branch/Source/WebCore/ChangeLog	2015-07-24 07:54:56 UTC (rev 187329)
@@ -1,5 +1,34 @@
 2015-07-24  Matthew Hanson  <[email protected]>
 
+        Merge r187274. rdar://problem/21905756
+
+    2015-07-23  Timothy Horton  <[email protected]>
+
+            [iOS] Frame snapshots don't factor in page scale
+            https://bugs.webkit.org/show_bug.cgi?id=147239
+            <rdar://problem/21905756>
+
+            Reviewed by Simon Fraser.
+
+            * page/FrameSnapshotting.cpp:
+            (WebCore::snapshotFrameRect):
+            Apply page scale when determining the backing store size and setting up the context.
+
+            * page/TextIndicator.cpp:
+            (WebCore::TextIndicator::createWithSelectionInFrame):
+            Don't assume snapshotFrameRect gave us an image with scale=deviceScale, because it
+            will factor in the pageScale too.
+
+            * platform/graphics/ImageBuffer.h:
+            (WebCore::ImageBuffer::resolutionScale):
+            Expose resolutionScale.
+
+            * rendering/RenderLayerCompositor.cpp:
+            (WebCore::RenderLayerCompositor::addToOverlapMap):
+            This has been true for a long time.
+
+2015-07-24  Matthew Hanson  <[email protected]>
+
         Merge r187271. rdar://problem/21929247
 
     2015-07-22  Simon Fraser  <[email protected]>

Modified: branches/safari-601.1-branch/Source/WebCore/page/FrameSnapshotting.cpp (187328 => 187329)


--- branches/safari-601.1-branch/Source/WebCore/page/FrameSnapshotting.cpp	2015-07-24 07:54:53 UTC (rev 187328)
+++ branches/safari-601.1-branch/Source/WebCore/page/FrameSnapshotting.cpp	2015-07-24 07:54:56 UTC (rev 187329)
@@ -39,6 +39,7 @@
 #include "ImageBuffer.h"
 #include "Page.h"
 #include "RenderObject.h"
+#include "Settings.h"
 
 namespace WebCore {
 
@@ -93,7 +94,12 @@
     // Other paint behaviors are set by paintContentsForSnapshot.
     frame.view()->setPaintBehavior(paintBehavior);
 
-    std::unique_ptr<ImageBuffer> buffer = ImageBuffer::create(imageRect.size(), frame.page()->deviceScaleFactor(), ColorSpaceDeviceRGB);
+    float scaleFactor = frame.page()->deviceScaleFactor();
+
+    if (frame.settings().delegatesPageScaling())
+        scaleFactor *= frame.page()->pageScaleFactor();
+
+    std::unique_ptr<ImageBuffer> buffer = ImageBuffer::create(imageRect.size(), scaleFactor, ColorSpaceDeviceRGB);
     if (!buffer)
         return nullptr;
     buffer->context()->translate(-imageRect.x(), -imageRect.y());

Modified: branches/safari-601.1-branch/Source/WebCore/page/TextIndicator.cpp (187328 => 187329)


--- branches/safari-601.1-branch/Source/WebCore/page/TextIndicator.cpp	2015-07-24 07:54:53 UTC (rev 187328)
+++ branches/safari-601.1-branch/Source/WebCore/page/TextIndicator.cpp	2015-07-24 07:54:56 UTC (rev 187329)
@@ -163,7 +163,7 @@
     data.selectionRectInRootViewCoordinates = frame.view()->contentsToRootView(enclosingIntRect(frame.selection().selectionBounds()));
     data.textBoundingRectInRootViewCoordinates = textBoundingRectInRootViewCoordinates;
     data.textRectsInBoundingRectCoordinates = textRectsInBoundingRectCoordinates;
-    data.contentImageScaleFactor = frame.page()->deviceScaleFactor();
+    data.contentImageScaleFactor = indicatorBuffer->resolutionScale();
     data.contentImage = indicatorBitmap;
     data.contentImageWithHighlight = indicatorBitmapWithHighlight;
     data.presentationTransition = presentationTransition;

Modified: branches/safari-601.1-branch/Source/WebCore/platform/graphics/ImageBuffer.h (187328 => 187329)


--- branches/safari-601.1-branch/Source/WebCore/platform/graphics/ImageBuffer.h	2015-07-24 07:54:53 UTC (rev 187328)
+++ branches/safari-601.1-branch/Source/WebCore/platform/graphics/ImageBuffer.h	2015-07-24 07:54:56 UTC (rev 187329)
@@ -92,6 +92,8 @@
     const IntSize& internalSize() const { return m_size; }
     const IntSize& logicalSize() const { return m_logicalSize; }
 
+    float resolutionScale() const { return m_resolutionScale; }
+
     WEBCORE_EXPORT GraphicsContext* context() const;
 
     WEBCORE_EXPORT RefPtr<Image> copyImage(BackingStoreCopy = CopyBackingStore, ScaleBehavior = Scaled) const;

Modified: branches/safari-601.1-branch/Source/WebCore/rendering/RenderLayerCompositor.cpp (187328 => 187329)


--- branches/safari-601.1-branch/Source/WebCore/rendering/RenderLayerCompositor.cpp	2015-07-24 07:54:53 UTC (rev 187328)
+++ branches/safari-601.1-branch/Source/WebCore/rendering/RenderLayerCompositor.cpp	2015-07-24 07:54:56 UTC (rev 187329)
@@ -1233,12 +1233,9 @@
     LayoutRect clipRect = layer.backgroundClipRect(RenderLayer::ClipRectsContext(&rootRenderLayer(), AbsoluteClipRects)).rect(); // FIXME: Incorrect for CSS regions.
 
     // On iOS, pageScaleFactor() is not applied by RenderView, so we should not scale here.
-    // FIXME: Set Settings::delegatesPageScaling to true for iOS.
-#if !PLATFORM(IOS)
     const Settings& settings = m_renderView.frameView().frame().settings();
     if (!settings.delegatesPageScaling())
         clipRect.scale(pageScaleFactor());
-#endif
     clipRect.intersect(extent.bounds);
     overlapMap.add(clipRect);
 }
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to