Changeset 140816 in webkit


Ignore:
Timestamp:
Jan 25, 2013 5:05:06 AM (11 years ago)
Author:
anilsson@rim.com
Message:

[BlackBerry] AC layers appear in the wrong place on RTL page
https://bugs.webkit.org/show_bug.cgi?id=107930

Reviewed by George Staikos.

The public API of the BlackBerry port always reports a minimum scroll
position of (0, 0), even on RTL pages with left overflow. We
accomplish this by translating the WebCore scroll position by an
amount equal in size to the minimum scroll position, to obtain the API
scroll position reported to the API client.

This means the API client will ask us to render a rect that needs to
be corrected for the minimum scroll position, or we'll render the wrong
part. This is done for BackingStore, but not for WebPageCompositor.

WebPageCompositor was rendering the wrong part of the web page when
the minimum scroll position was non-zero. Fixed by communicating the
minimum scroll position to the WebPageCompositor, and accounting for it
when interpreting the requested content rectangle to render.

PR 280229.

  • Api/WebPage.cpp:

(BlackBerry::WebKit::WebPagePrivate::commitRootLayer):
(BlackBerry::WebKit::WebPagePrivate::commitRootLayerIfNeeded):

  • Api/WebPageCompositor.cpp:

(BlackBerry::WebKit::WebPageCompositorPrivate::render):
(BlackBerry::WebKit::WebPageCompositorPrivate::drawLayers):

  • Api/WebPageCompositor_p.h:

(BlackBerry::WebKit::WebPageCompositorPrivate::layoutRect):
(BlackBerry::WebKit::WebPageCompositorPrivate::setLayoutRect):
(BlackBerry::WebKit::WebPageCompositorPrivate::documentRect):
(BlackBerry::WebKit::WebPageCompositorPrivate::setDocumentRect):
(WebPageCompositorPrivate):

  • Api/WebPage_p.h:

(WebPagePrivate):

Location:
trunk/Source/WebKit/blackberry
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebKit/blackberry/Api/WebPage.cpp

    r140541 r140816  
    54285428}
    54295429
    5430 void WebPagePrivate::commitRootLayer(const IntRect& layoutRectForCompositing,
    5431                                      const IntSize& contentsSizeForCompositing,
    5432                                      bool drawsRootLayer)
     5430void WebPagePrivate::commitRootLayer(const IntRect& layoutRect, const IntRect& documentRect, bool drawsRootLayer)
    54335431{
    54345432#if DEBUG_AC_COMMIT
     
    54575455        m_compositor->setOverlayLayer(overlayLayer->layerCompositingThread());
    54585456
    5459     m_compositor->setLayoutRectForCompositing(layoutRectForCompositing);
    5460     m_compositor->setContentsSizeForCompositing(contentsSizeForCompositing);
     5457    m_compositor->setLayoutRect(layoutRect);
     5458    m_compositor->setDocumentRect(documentRect);
    54615459    m_compositor->setDrawsRootLayer(drawsRootLayer);
    54625460
     
    55315529    // This is the rectangle used to layout fixed positioned elements,
    55325530    // and that's what the layer renderer wants.
    5533     IntRect layoutRectForCompositing(scrollPosition(), actualVisibleSize());
    5534     IntSize contentsSizeForCompositing = contentsSize();
     5531    IntRect layoutRect(scrollPosition(), actualVisibleSize());
     5532    IntRect documentRect(view->minimumScrollPosition(), view->contentsSize());
    55355533    bool drawsRootLayer = compositorDrawsRootLayer();
    55365534
     
    55405538            &WebPagePrivate::commitRootLayer,
    55415539            this,
    5542             layoutRectForCompositing,
    5543             contentsSizeForCompositing,
     5540            layoutRect,
     5541            documentRect,
    55445542            drawsRootLayer));
    55455543
  • trunk/Source/WebKit/blackberry/Api/WebPageCompositor.cpp

    r138024 r140816  
    141141    FloatRect contents = m_webPage->mapFromTransformedFloatRect(transformedContents);
    142142
    143     m_layerRenderer->setViewport(targetRect, clipRect, contents, m_layoutRectForCompositing, m_contentsSizeForCompositing);
     143    m_layerRenderer->setViewport(targetRect, clipRect, contents, m_layoutRect, m_documentRect.size());
    144144
    145145    TransformationMatrix transform(transformIn);
    146146    transform *= *m_webPage->m_transformationMatrix;
     147    transform.translate(-m_documentRect.x(), -m_documentRect.y());
    147148
    148149    if (!drawsRootLayer())
     
    197198    IntRect viewport = IntRect(dstRect.x(), viewportY, dstRect.width(), dstRect.height());
    198199
    199     m_layerRenderer->setViewport(viewport, viewport, contents, m_layoutRectForCompositing, m_contentsSizeForCompositing);
     200    m_layerRenderer->setViewport(viewport, viewport, contents, m_layoutRect, m_documentRect.size());
    200201
    201202    // WebKit uses row vectors which are multiplied by the matrix on the left (i.e. v*M)
     
    204205    // as the last transformation.
    205206    TransformationMatrix transform = LayerRenderer::orthoMatrix(0, contents.width(), contents.height(), 0, -1000, 1000);
    206     transform.translate3d(-contents.x(), -contents.y(), 0);
     207    transform.translate3d(-contents.x() - m_documentRect.x(), -contents.y() - m_documentRect.y(), 0);
    207208    compositeLayers(transform);
    208209
  • trunk/Source/WebKit/blackberry/Api/WebPageCompositor_p.h

    r122056 r140816  
    7676    bool drawLayers(const WebCore::IntRect& dstRect, const WebCore::FloatRect& contents);
    7777
    78     WebCore::IntRect layoutRectForCompositing() const { return m_layoutRectForCompositing; }
    79     void setLayoutRectForCompositing(const WebCore::IntRect& rect) { m_layoutRectForCompositing = rect; }
     78    WebCore::IntRect layoutRect() const { return m_layoutRect; }
     79    void setLayoutRect(const WebCore::IntRect& rect) { m_layoutRect = rect; }
    8080
    81     WebCore::IntSize contentsSizeForCompositing() const { return m_contentsSizeForCompositing; }
    82     void setContentsSizeForCompositing(const WebCore::IntSize& size) { m_contentsSizeForCompositing = size; }
     81    WebCore::IntRect documentRect() const { return m_documentRect; }
     82    void setDocumentRect(const WebCore::IntRect& rect) { m_documentRect = rect; }
    8383
    8484    WebCore::LayerRenderingResults lastCompositingResults() const { return m_lastCompositingResults; }
     
    113113    RefPtr<WebCore::LayerCompositingThread> m_overlayLayer;
    114114    RefPtr<WebCore::LayerCompositingThread> m_compositingThreadOverlayLayer;
    115     WebCore::IntRect m_layoutRectForCompositing;
    116     WebCore::IntSize m_contentsSizeForCompositing;
     115    WebCore::IntRect m_layoutRect;
     116    WebCore::IntRect m_documentRect;
    117117    WebCore::LayerRenderingResults m_lastCompositingResults;
    118118    WebCore::Color m_backgroundColor;
  • trunk/Source/WebKit/blackberry/Api/WebPage_p.h

    r139955 r140816  
    409409    // Compositing thread.
    410410    void setRootLayerCompositingThread(WebCore::LayerCompositingThread*);
    411     void commitRootLayer(const WebCore::IntRect&, const WebCore::IntSize&, bool);
     411    void commitRootLayer(const WebCore::IntRect& layoutRect, const WebCore::IntRect& documentRect, bool);
    412412    bool isAcceleratedCompositingActive() const { return m_compositor; }
    413413    WebPageCompositorPrivate* compositor() const { return m_compositor.get(); }
  • trunk/Source/WebKit/blackberry/ChangeLog

    r140708 r140816  
     12013-01-25  Arvid Nilsson  <anilsson@rim.com>
     2
     3        [BlackBerry] AC layers appear in the wrong place on RTL page
     4        https://bugs.webkit.org/show_bug.cgi?id=107930
     5
     6        Reviewed by George Staikos.
     7
     8        The public API of the BlackBerry port always reports a minimum scroll
     9        position of (0, 0), even on RTL pages with left overflow. We
     10        accomplish this by translating the WebCore scroll position by an
     11        amount equal in size to the minimum scroll position, to obtain the API
     12        scroll position reported to the API client.
     13
     14        This means the API client will ask us to render a rect that needs to
     15        be corrected for the minimum scroll position, or we'll render the wrong
     16        part. This is done for BackingStore, but not for WebPageCompositor.
     17
     18        WebPageCompositor was rendering the wrong part of the web page when
     19        the minimum scroll position was non-zero. Fixed by communicating the
     20        minimum scroll position to the WebPageCompositor, and accounting for it
     21        when interpreting the requested content rectangle to render.
     22
     23        PR 280229.
     24
     25        * Api/WebPage.cpp:
     26        (BlackBerry::WebKit::WebPagePrivate::commitRootLayer):
     27        (BlackBerry::WebKit::WebPagePrivate::commitRootLayerIfNeeded):
     28        * Api/WebPageCompositor.cpp:
     29        (BlackBerry::WebKit::WebPageCompositorPrivate::render):
     30        (BlackBerry::WebKit::WebPageCompositorPrivate::drawLayers):
     31        * Api/WebPageCompositor_p.h:
     32        (BlackBerry::WebKit::WebPageCompositorPrivate::layoutRect):
     33        (BlackBerry::WebKit::WebPageCompositorPrivate::setLayoutRect):
     34        (BlackBerry::WebKit::WebPageCompositorPrivate::documentRect):
     35        (BlackBerry::WebKit::WebPageCompositorPrivate::setDocumentRect):
     36        (WebPageCompositorPrivate):
     37        * Api/WebPage_p.h:
     38        (WebPagePrivate):
     39
    1402013-01-24  Nima Ghanavatian  <nghanavatian@rim.com>
    241
Note: See TracChangeset for help on using the changeset viewer.