⚠ Archived content — this site is no longer maintained.   Current WebKit documentation is at docs.webkit.org.

Changeset 187274 in webkit


Ignore:
Timestamp:
Jul 23, 2015, 5:19:58 PM (11 years ago)
Author:
timothy_horton@apple.com
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.

Location:
trunk/Source/WebCore
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebCore/ChangeLog

    r187273 r187274  
     12015-07-23  Timothy Horton  <timothy_horton@apple.com>
     2
     3        [iOS] Frame snapshots don't factor in page scale
     4        https://bugs.webkit.org/show_bug.cgi?id=147239
     5        <rdar://problem/21905756>
     6
     7        Reviewed by Simon Fraser.
     8
     9        * page/FrameSnapshotting.cpp:
     10        (WebCore::snapshotFrameRect):
     11        Apply page scale when determining the backing store size and setting up the context.
     12
     13        * page/TextIndicator.cpp:
     14        (WebCore::TextIndicator::createWithSelectionInFrame):
     15        Don't assume snapshotFrameRect gave us an image with scale=deviceScale, because it
     16        will factor in the pageScale too.
     17
     18        * platform/graphics/ImageBuffer.h:
     19        (WebCore::ImageBuffer::resolutionScale):
     20        Expose resolutionScale.
     21
     22        * rendering/RenderLayerCompositor.cpp:
     23        (WebCore::RenderLayerCompositor::addToOverlapMap):
     24        This has been true for a long time.
     25
    1262015-07-23  Jon Davis  <jond@apple.com>
    227
  • trunk/Source/WebCore/page/FrameSnapshotting.cpp

    r186956 r187274  
    4040#include "Page.h"
    4141#include "RenderObject.h"
     42#include "Settings.h"
    4243
    4344namespace WebCore {
     
    9495    frame.view()->setPaintBehavior(paintBehavior);
    9596
    96     std::unique_ptr<ImageBuffer> buffer = ImageBuffer::create(imageRect.size(), frame.page()->deviceScaleFactor(), ColorSpaceDeviceRGB);
     97    float scaleFactor = frame.page()->deviceScaleFactor();
     98
     99    if (frame.settings().delegatesPageScaling())
     100        scaleFactor *= frame.page()->pageScaleFactor();
     101
     102    std::unique_ptr<ImageBuffer> buffer = ImageBuffer::create(imageRect.size(), scaleFactor, ColorSpaceDeviceRGB);
    97103    if (!buffer)
    98104        return nullptr;
  • trunk/Source/WebCore/page/TextIndicator.cpp

    r186978 r187274  
    164164    data.textBoundingRectInRootViewCoordinates = textBoundingRectInRootViewCoordinates;
    165165    data.textRectsInBoundingRectCoordinates = textRectsInBoundingRectCoordinates;
    166     data.contentImageScaleFactor = frame.page()->deviceScaleFactor();
     166    data.contentImageScaleFactor = indicatorBuffer->resolutionScale();
    167167    data.contentImage = indicatorBitmap;
    168168    data.contentImageWithHighlight = indicatorBitmapWithHighlight;
  • trunk/Source/WebCore/platform/graphics/ImageBuffer.h

    r185731 r187274  
    9393    const IntSize& logicalSize() const { return m_logicalSize; }
    9494
     95    float resolutionScale() const { return m_resolutionScale; }
     96
    9597    WEBCORE_EXPORT GraphicsContext* context() const;
    9698
  • trunk/Source/WebCore/rendering/RenderLayerCompositor.cpp

    r187271 r187274  
    12341234
    12351235    // On iOS, pageScaleFactor() is not applied by RenderView, so we should not scale here.
    1236     // FIXME: Set Settings::delegatesPageScaling to true for iOS.
    1237 #if !PLATFORM(IOS)
    12381236    const Settings& settings = m_renderView.frameView().frame().settings();
    12391237    if (!settings.delegatesPageScaling())
    12401238        clipRect.scale(pageScaleFactor());
    1241 #endif
    12421239    clipRect.intersect(extent.bounds);
    12431240    overlapMap.add(clipRect);
Note: See TracChangeset for help on using the changeset viewer.