Changeset 150764 in webkit


Ignore:
Timestamp:
May 27, 2013 9:52:10 AM (11 years ago)
Author:
marcelo.lira@openbossa.org
Message:

[WK2][CoordinatedGraphics] Misuse of DrawingAreaProxy::setVisibleContentsRect() in WebView::updateViewportSize()
https://bugs.webkit.org/show_bug.cgi?id=116688

Reviewed by Noam Rosenthal.

Visible contents area passed to DrawingAreaProxy::setVisibleContentsRect()
must be calculated including the page scale factor and avoid crossing the
boundaries of the page contents size. In other words the DrawingArea
must know the actual dimensions of what it being drawn. If the
DrawingArea thinks the visible rectangle is bigger than it is, the
contents will be drawn pixelated and blurry.

  • UIProcess/CoordinatedGraphics/WebView.cpp:

(WebKit::WebView::didChangeContentsSize):
(WebKit::WebView::updateViewportSize):
(WebKit::WebView::visibleContentsSize):
(WebKit):

  • UIProcess/CoordinatedGraphics/WebView.h:

(WebKit::WebView::contentsSize):
(WebView):

Location:
trunk/Source/WebKit2
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebKit2/ChangeLog

    r150763 r150764  
     12013-05-27  Marcelo Lira  <marcelo.lira@openbossa.org>
     2
     3        [WK2][CoordinatedGraphics] Misuse of DrawingAreaProxy::setVisibleContentsRect() in WebView::updateViewportSize()
     4        https://bugs.webkit.org/show_bug.cgi?id=116688
     5
     6        Reviewed by Noam Rosenthal.
     7
     8        Visible contents area passed to DrawingAreaProxy::setVisibleContentsRect()
     9        must be calculated including the page scale factor and avoid crossing the
     10        boundaries of the page contents size. In other words the DrawingArea
     11        must know the actual dimensions of what it being drawn. If the
     12        DrawingArea thinks the visible rectangle is bigger than it is, the
     13        contents will be drawn pixelated and blurry.
     14
     15        * UIProcess/CoordinatedGraphics/WebView.cpp:
     16        (WebKit::WebView::didChangeContentsSize):
     17        (WebKit::WebView::updateViewportSize):
     18        (WebKit::WebView::visibleContentsSize):
     19        (WebKit):
     20        * UIProcess/CoordinatedGraphics/WebView.h:
     21        (WebKit::WebView::contentsSize):
     22        (WebView):
     23
    1242013-05-27  Carlos Garcia Campos  <cgarcia@igalia.com>
    225
  • trunk/Source/WebKit2/UIProcess/CoordinatedGraphics/WebView.cpp

    r150024 r150764  
    187187void WebView::didChangeContentsSize(const WebCore::IntSize& size)
    188188{
     189    m_contentsSize = size;
    189190    m_client.didChangeContentsSize(this, size);
    190191}
     
    225226        // Web Process expects sizes in UI units, and not raw device units.
    226227        drawingArea->setSize(roundedIntSize(dipSize()), IntSize(), IntSize());
    227         drawingArea->setVisibleContentsRect(FloatRect(contentPosition(), dipSize()), FloatPoint());
     228        FloatRect visibleContentsRect(contentPosition(), visibleContentsSize());
     229        visibleContentsRect.intersect(FloatRect(FloatPoint(), contentsSize()));
     230        drawingArea->setVisibleContentsRect(visibleContentsRect, FloatPoint());
    228231    }
    229232}
     
    235238
    236239    return dipSize;
     240}
     241
     242WebCore::FloatSize WebView::visibleContentsSize() const
     243{
     244    FloatSize visibleContentsSize(dipSize());
     245    visibleContentsSize.scale(1 / m_contentScaleFactor);
     246
     247    return visibleContentsSize;
    237248}
    238249
  • trunk/Source/WebKit2/UIProcess/CoordinatedGraphics/WebView.h

    r150012 r150764  
    9898
    9999    void didChangeContentsSize(const WebCore::IntSize&);
     100    const WebCore::IntSize& contentsSize() const { return m_contentsSize; }
     101    WebCore::FloatSize visibleContentsSize() const;
    100102
    101103    // FIXME: Should become private when Web Events creation is moved to WebView.
     
    196198    double m_opacity;
    197199    WebCore::FloatPoint m_contentPosition; // Position in UI units.
     200    WebCore::IntSize m_contentsSize;
    198201};
    199202
Note: See TracChangeset for help on using the changeset viewer.