Changeset 81347 in webkit


Ignore:
Timestamp:
Mar 17, 2011 5:00:34 AM (13 years ago)
Author:
kov@webkit.org
Message:

2011-03-17 Gustavo Noronha Silva <gustavo.noronha@collabora.co.uk>

Reviewed by Andreas Kling.

Tiled backing store should only request repaint for updated areas
https://bugs.webkit.org/show_bug.cgi?id=56464

Reuse updateBackBuffer's dirty rectangle calculations to only
invalidate the necessary parts of the window.

  • platform/graphics/Tile.h:
  • platform/graphics/TiledBackingStore.cpp: (WebCore::TiledBackingStore::updateTileBuffers):
  • platform/graphics/qt/TileQt.cpp: (WebCore::Tile::updateBackBuffer):
Location:
trunk/Source/WebCore
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebCore/ChangeLog

    r81343 r81347  
     12011-03-17  Gustavo Noronha Silva  <gustavo.noronha@collabora.co.uk>
     2
     3        Reviewed by Andreas Kling.
     4
     5        Tiled backing store should only request repaint for updated areas
     6        https://bugs.webkit.org/show_bug.cgi?id=56464
     7
     8        Reuse updateBackBuffer's dirty rectangle calculations to only
     9        invalidate the necessary parts of the window.
     10
     11        * platform/graphics/Tile.h:
     12        * platform/graphics/TiledBackingStore.cpp:
     13        (WebCore::TiledBackingStore::updateTileBuffers):
     14        * platform/graphics/qt/TileQt.cpp:
     15        (WebCore::Tile::updateBackBuffer):
     16
    1172011-03-17  Mikhail Naganov  <mnaganov@chromium.org>
    218
  • trunk/Source/WebCore/platform/graphics/Tile.h

    r57819 r81347  
    5050    bool isDirty() const;
    5151    void invalidate(const IntRect&);
    52     void updateBackBuffer();
     52    Vector<IntRect> updateBackBuffer();
    5353    void swapBackBufferToFront();
    5454    bool isReadyToPaint() const;
  • trunk/Source/WebCore/platform/graphics/TiledBackingStore.cpp

    r79054 r81347  
    103103            continue;
    104104        dirtyTiles.append(it->second);
    105         // FIXME: should not request system repaint for the full tile.
    106         paintedArea.append(mapToContents(it->second->rect()));
    107105    }
    108106   
     
    116114    // blocking on tile updates.
    117115    unsigned size = dirtyTiles.size();
    118     for (unsigned n = 0; n < size; ++n)
    119         dirtyTiles[n]->updateBackBuffer();
    120 
    121     for (unsigned n = 0; n < size; ++n)
     116    for (unsigned n = 0; n < size; ++n) {
     117        Vector<IntRect> paintedRects = dirtyTiles[n]->updateBackBuffer();
     118        paintedArea.append(paintedRects);
    122119        dirtyTiles[n]->swapBackBufferToFront();
     120    }
    123121
    124122    m_client->tiledBackingStorePaintEnd(paintedArea);
  • trunk/Source/WebCore/platform/graphics/qt/TileQt.cpp

    r70262 r81347  
    9292}
    9393   
    94 void Tile::updateBackBuffer()
     94Vector<IntRect> Tile::updateBackBuffer()
    9595{
    9696    if (m_buffer && !isDirty())
    97         return;
     97        return Vector<IntRect>();
    9898
    9999    if (!m_backBuffer) {
     
    116116    context.translate(-m_rect.x(), -m_rect.y());
    117117
     118    Vector<IntRect> updatedRects;
    118119    int size = dirtyRects.size();
    119120    for (int n = 0; n < size; ++n)  {
    120121        context.save();
    121122        IntRect rect = dirtyRects[n];
     123        updatedRects.append(rect);
    122124        context.clip(FloatRect(rect));
    123125        context.scale(FloatSize(m_backingStore->m_contentsScale, m_backingStore->m_contentsScale));
     
    125127        context.restore();
    126128    }
     129
     130    return updatedRects;
    127131}
    128132
Note: See TracChangeset for help on using the changeset viewer.