Title: [187274] trunk/Source/WebCore
- Revision
- 187274
- Author
- [email protected]
- Date
- 2015-07-23 17:19:58 -0700 (Thu, 23 Jul 2015)
Log Message
[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.
Modified Paths
Diff
Modified: trunk/Source/WebCore/ChangeLog (187273 => 187274)
--- trunk/Source/WebCore/ChangeLog 2015-07-24 00:08:54 UTC (rev 187273)
+++ trunk/Source/WebCore/ChangeLog 2015-07-24 00:19:58 UTC (rev 187274)
@@ -1,3 +1,28 @@
+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-23 Jon Davis <[email protected]>
Adding Web Components to feature status page.
Modified: trunk/Source/WebCore/page/FrameSnapshotting.cpp (187273 => 187274)
--- trunk/Source/WebCore/page/FrameSnapshotting.cpp 2015-07-24 00:08:54 UTC (rev 187273)
+++ trunk/Source/WebCore/page/FrameSnapshotting.cpp 2015-07-24 00:19:58 UTC (rev 187274)
@@ -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: trunk/Source/WebCore/page/TextIndicator.cpp (187273 => 187274)
--- trunk/Source/WebCore/page/TextIndicator.cpp 2015-07-24 00:08:54 UTC (rev 187273)
+++ trunk/Source/WebCore/page/TextIndicator.cpp 2015-07-24 00:19:58 UTC (rev 187274)
@@ -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: trunk/Source/WebCore/platform/graphics/ImageBuffer.h (187273 => 187274)
--- trunk/Source/WebCore/platform/graphics/ImageBuffer.h 2015-07-24 00:08:54 UTC (rev 187273)
+++ trunk/Source/WebCore/platform/graphics/ImageBuffer.h 2015-07-24 00:19:58 UTC (rev 187274)
@@ -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: trunk/Source/WebCore/rendering/RenderLayerCompositor.cpp (187273 => 187274)
--- trunk/Source/WebCore/rendering/RenderLayerCompositor.cpp 2015-07-24 00:08:54 UTC (rev 187273)
+++ trunk/Source/WebCore/rendering/RenderLayerCompositor.cpp 2015-07-24 00:19:58 UTC (rev 187274)
@@ -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