Changeset 69162 in webkit


Ignore:
Timestamp:
Oct 5, 2010 4:55:49 PM (13 years ago)
Author:
commit-queue@webkit.org
Message:

2010-10-05 Nat Duca <nduca@chromium.org>

Reviewed by James Robinson.

[chromium] Handle composited root layer invalidations in screenspace,
fixing the disappearing scrollbar problem.
https://bugs.webkit.org/show_bug.cgi?id=46864

  • src/WebViewImpl.cpp: (WebKit::WebViewImpl::composite): (WebKit::WebViewImpl::scrollRootLayerRect): (WebKit::WebViewImpl::invalidateRootLayerRect): (WebKit::WebViewImpl::doComposite):
Location:
trunk/WebKit/chromium
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/WebKit/chromium/ChangeLog

    r69157 r69162  
     12010-10-05  Nat Duca  <nduca@chromium.org>
     2
     3        Reviewed by James Robinson.
     4
     5        [chromium] Handle composited root layer invalidations in screenspace,
     6        fixing the disappearing scrollbar problem.
     7        https://bugs.webkit.org/show_bug.cgi?id=46864
     8
     9        * src/WebViewImpl.cpp:
     10        (WebKit::WebViewImpl::composite):
     11        (WebKit::WebViewImpl::scrollRootLayerRect):
     12        (WebKit::WebViewImpl::invalidateRootLayerRect):
     13        (WebKit::WebViewImpl::doComposite):
     14
    1152010-10-05  Kenneth Russell  <kbr@google.com>
    216
  • trunk/WebKit/chromium/src/WebViewImpl.cpp

    r69053 r69162  
    22582258
    22592259    IntRect contentRect = view->visibleContentRect(false);
     2260    IntRect screenRect = view->contentsToWindow(contentRect);
    22602261
    22612262    // We support fast scrolling in one direction at a time.
    22622263    if (scrollDelta.width() && scrollDelta.height()) {
    2263         invalidateRootLayerRect(WebRect(contentRect));
     2264        invalidateRootLayerRect(WebRect(screenRect));
    22642265        return;
    22652266    }
     
    22712272    if (scrollDelta.width()) {
    22722273        int dx = scrollDelta.width();
    2273         damagedContentsRect.setY(contentRect.y());
    2274         damagedContentsRect.setHeight(contentRect.height());
     2274        damagedContentsRect.setY(screenRect.y());
     2275        damagedContentsRect.setHeight(screenRect.height());
    22752276        if (dx > 0) {
    2276             damagedContentsRect.setX(contentRect.x());
     2277            damagedContentsRect.setX(screenRect.x());
    22772278            damagedContentsRect.setWidth(dx);
    22782279        } else {
    2279             damagedContentsRect.setX(contentRect.right() + dx);
     2280            damagedContentsRect.setX(screenRect.right() + dx);
    22802281            damagedContentsRect.setWidth(-dx);
    22812282        }
    22822283    } else {
    22832284        int dy = scrollDelta.height();
    2284         damagedContentsRect.setX(contentRect.x());
    2285         damagedContentsRect.setWidth(contentRect.width());
     2285        damagedContentsRect.setX(screenRect.x());
     2286        damagedContentsRect.setWidth(screenRect.width());
    22862287        if (dy > 0) {
    2287             damagedContentsRect.setY(contentRect.y());
     2288            damagedContentsRect.setY(screenRect.y());
    22882289            damagedContentsRect.setHeight(dy);
    22892290        } else {
    2290             damagedContentsRect.setY(contentRect.bottom() + dy);
     2291            damagedContentsRect.setY(screenRect.bottom() + dy);
    22912292            damagedContentsRect.setHeight(-dy);
    22922293        }
     
    22942295
    22952296    m_rootLayerScrollDamage.unite(damagedContentsRect);
     2297
     2298    // Scroll any existing damage that intersects with clip rect
     2299    if (clipRect.intersects(m_rootLayerDirtyRect)) {
     2300        // Find the inner damage
     2301        IntRect innerDamage(clipRect);
     2302        innerDamage.intersect(m_rootLayerDirtyRect);
     2303
     2304        // Move the damage
     2305        innerDamage.move(scrollDelta.width(), scrollDelta.height());
     2306       
     2307        // Merge it back into the damaged rect
     2308        m_rootLayerDirtyRect.unite(innerDamage);
     2309    }
     2310
    22962311    setRootLayerNeedsDisplay();
    22972312}
     
    23082323    if (!page())
    23092324        return;
    2310     FrameView* view = page()->mainFrame()->view();
    2311 
    2312     // rect is in viewport space. Convert to content space
    2313     // so that invalidations and scroll invalidations play well with one-another.
    2314     IntRect contentRect = view->windowToContents(rect);
    23152325
    23162326    // FIXME: add a smarter damage aggregation logic and/or unify with
    23172327    // LayerChromium's damage logic
    2318     m_rootLayerDirtyRect.unite(contentRect);
     2328    m_rootLayerDirtyRect.unite(rect);
    23192329    setRootLayerNeedsDisplay();
    23202330}
     
    24262436    damageRects.append(m_rootLayerDirtyRect);
    24272437    for (size_t i = 0; i < damageRects.size(); ++i) {
    2428         // The damage rect for the root layer is in content space [e.g. unscrolled].
    2429         // Convert from content space to viewPort space.
    2430         const IntRect damagedContentRect = damageRects[i];
    2431         IntRect damagedRect = view->contentsToWindow(damagedContentRect);
     2438        IntRect damagedRect = damageRects[i];
    24322439
    24332440        // Intersect this rectangle with the viewPort.
Note: See TracChangeset for help on using the changeset viewer.