Changeset 84542 in webkit


Ignore:
Timestamp:
Apr 21, 2011 1:19:36 PM (13 years ago)
Author:
enne@google.com
Message:

2011-04-21 Adrienne Walker <enne@google.com>

Reviewed by James Robinson.

[chromium] Don't upload partially drawn tiles in the compositor
https://bugs.webkit.org/show_bug.cgi?id=59112

Use the same set of tiles for painting as is used for updating.
Before, a larger set of tiles were being uploaded, causing some to
only be partially undirtied because they were not fully painted.
As tiles are clear their dirty rect after being unpainted, this caused
artifacts to appear when scrolling.

Unfortunately, no layout test can test this behavior yet because
scrolling invalidations are done differently in test shell.

  • platform/graphics/chromium/ImageLayerChromium.cpp: (WebCore::ImageLayerChromium::updateCompositorResources):
  • platform/graphics/chromium/LayerTilerChromium.cpp: (WebCore::LayerTilerChromium::update): (WebCore::LayerTilerChromium::uploadCanvas): (WebCore::LayerTilerChromium::updateFromPixels):
  • platform/graphics/chromium/LayerTilerChromium.h:
Location:
trunk/Source/WebCore
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebCore/ChangeLog

    r84538 r84542  
     12011-04-21  Adrienne Walker  <enne@google.com>
     2
     3        Reviewed by James Robinson.
     4
     5        [chromium] Don't upload partially drawn tiles in the compositor
     6        https://bugs.webkit.org/show_bug.cgi?id=59112
     7
     8        Use the same set of tiles for painting as is used for updating.
     9        Before, a larger set of tiles were being uploaded, causing some to
     10        only be partially undirtied because they were not fully painted.
     11        As tiles are clear their dirty rect after being unpainted, this caused
     12        artifacts to appear when scrolling.
     13
     14        Unfortunately, no layout test can test this behavior yet because
     15        scrolling invalidations are done differently in test shell.
     16
     17        * platform/graphics/chromium/ImageLayerChromium.cpp:
     18        (WebCore::ImageLayerChromium::updateCompositorResources):
     19        * platform/graphics/chromium/LayerTilerChromium.cpp:
     20        (WebCore::LayerTilerChromium::update):
     21        (WebCore::LayerTilerChromium::uploadCanvas):
     22        (WebCore::LayerTilerChromium::updateFromPixels):
     23        * platform/graphics/chromium/LayerTilerChromium.h:
     24
    1252011-04-21  Ben Taylor  <bentaylor.solx86@gmail.com>
    226
  • trunk/Source/WebCore/platform/graphics/chromium/ImageLayerChromium.cpp

    r83915 r84542  
    8787        m_dirtyRect = IntRect();
    8888    }
    89     m_tiler->updateFromPixels(paintRect, m_decodedImage.pixels());
     89    m_tiler->updateFromPixels(paintRect, paintRect, m_decodedImage.pixels());
    9090}
    9191
  • trunk/Source/WebCore/platform/graphics/chromium/LayerTilerChromium.cpp

    r83915 r84542  
    253253    }
    254254
     255    // Due to borders, when the paint rect is extended to tile boundaries, it
     256    // may end up overlapping more tiles than the original content rect. Record
     257    // that original rect so we don't upload more tiles than necessary.
     258    m_updateRect = contentRect;
     259
     260    m_paintRect = layerRectToContentRect(dirtyLayerRect);
    255261    if (dirtyLayerRect.isEmpty())
    256262        return;
    257 
    258     m_paintRect = layerRectToContentRect(dirtyLayerRect);
    259263
    260264    m_canvas.resize(m_paintRect.size());
     
    277281    {
    278282        TRACE_EVENT("LayerTilerChromium::updateFromPixels", this, 0);
    279         updateFromPixels(m_paintRect, locker.pixels());
    280     }
    281 }
    282 
    283 void LayerTilerChromium::updateFromPixels(const IntRect& paintRect, const uint8_t* paintPixels)
     283        updateFromPixels(m_updateRect, m_paintRect, locker.pixels());
     284    }
     285}
     286
     287void LayerTilerChromium::updateFromPixels(const IntRect& contentRect, const IntRect& paintRect, const uint8_t* paintPixels)
    284288{
    285289    // Painting could cause compositing to get turned off, which may cause the tiler to become invalidated mid-update.
     
    290294
    291295    int left, top, right, bottom;
    292     contentRectToTileIndices(paintRect, left, top, right, bottom);
     296    contentRectToTileIndices(contentRect, left, top, right, bottom);
    293297    for (int j = top; j <= bottom; ++j) {
    294298        for (int i = left; i <= right; ++i) {
  • trunk/Source/WebCore/platform/graphics/chromium/LayerTilerChromium.h

    r83915 r84542  
    6969
    7070    // Reserve and upload tile textures from an externally painted buffer.
    71     void updateFromPixels(const IntRect& paintRect, const uint8_t* pixels);
     71    void updateFromPixels(const IntRect& contentRect, const IntRect& paintRect, const uint8_t* pixels);
    7272
    7373    // Draw all tiles that intersect with the content rect.
     
    162162    Vector<RefPtr<Tile> > m_unusedTiles;
    163163
     164    // State held between update and uploadCanvas.
    164165    IntRect m_paintRect;
     166    IntRect m_updateRect;
    165167    PlatformCanvas m_canvas;
    166168
Note: See TracChangeset for help on using the changeset viewer.