Changeset 75267 in webkit


Ignore:
Timestamp:
Jan 7, 2011 1:19:58 PM (13 years ago)
Author:
Adam Roben
Message:

Fill the WKView with white when the web process hasn't drawn anything yet

Fixes <http://webkit.org/b/52023> WKView accumulates pixel garbage
before web process has had a chance to draw anything (if Aero is
disabled)

Reviewed by Jon Honeycutt.

  • UIProcess/ChunkedUpdateDrawingAreaProxy.cpp:

(WebKit::ChunkedUpdateDrawingAreaProxy::paint):

  • UIProcess/ChunkedUpdateDrawingAreaProxy.h:
  • UIProcess/DrawingAreaProxy.h:
  • UIProcess/LayerBackedDrawingAreaProxy.cpp:

(WebKit::LayerBackedDrawingAreaProxy::paint):

  • UIProcess/LayerBackedDrawingAreaProxy.h:
  • UIProcess/TiledDrawingAreaProxy.cpp:

(WebKit::TiledDrawingAreaProxy::paint):

  • UIProcess/TiledDrawingAreaProxy.h:
  • UIProcess/mac/ChunkedUpdateDrawingAreaProxyMac.mm:

(WebKit::ChunkedUpdateDrawingAreaProxy::platformPaint):

  • UIProcess/qt/ChunkedUpdateDrawingAreaProxyQt.cpp:

(WebKit::ChunkedUpdateDrawingAreaProxy::platformPaint):

  • UIProcess/win/ChunkedUpdateDrawingAreaProxyWin.cpp:

(WebKit::ChunkedUpdateDrawingAreaProxy::platformPaint):

  • UIProcess/win/LayerBackedDrawingAreaProxyWin.cpp:

(WebKit::LayerBackedDrawingAreaProxy::paint):
Changed these functions to return a boolean indicating whether we
actually painted anything.

  • UIProcess/win/WebView.cpp:

(WebKit::WebView::onPaintEvent): Fill with white (and don't call
didDraw) when the DrawingAreaProxy isn't able to paint.

Location:
trunk/WebKit2
Files:
13 edited

Legend:

Unmodified
Added
Removed
  • trunk/WebKit2/ChangeLog

    r75253 r75267  
     12011-01-06  Adam Roben  <aroben@apple.com>
     2
     3        Fill the WKView with white when the web process hasn't drawn anything
     4        yet
     5
     6        Fixes <http://webkit.org/b/52023> WKView accumulates pixel garbage
     7        before web process has had a chance to draw anything (if Aero is
     8        disabled)
     9
     10        Reviewed by Jon Honeycutt.
     11
     12        * UIProcess/ChunkedUpdateDrawingAreaProxy.cpp:
     13        (WebKit::ChunkedUpdateDrawingAreaProxy::paint):
     14        * UIProcess/ChunkedUpdateDrawingAreaProxy.h:
     15        * UIProcess/DrawingAreaProxy.h:
     16        * UIProcess/LayerBackedDrawingAreaProxy.cpp:
     17        (WebKit::LayerBackedDrawingAreaProxy::paint):
     18        * UIProcess/LayerBackedDrawingAreaProxy.h:
     19        * UIProcess/TiledDrawingAreaProxy.cpp:
     20        (WebKit::TiledDrawingAreaProxy::paint):
     21        * UIProcess/TiledDrawingAreaProxy.h:
     22        * UIProcess/mac/ChunkedUpdateDrawingAreaProxyMac.mm:
     23        (WebKit::ChunkedUpdateDrawingAreaProxy::platformPaint):
     24        * UIProcess/qt/ChunkedUpdateDrawingAreaProxyQt.cpp:
     25        (WebKit::ChunkedUpdateDrawingAreaProxy::platformPaint):
     26        * UIProcess/win/ChunkedUpdateDrawingAreaProxyWin.cpp:
     27        (WebKit::ChunkedUpdateDrawingAreaProxy::platformPaint):
     28        * UIProcess/win/LayerBackedDrawingAreaProxyWin.cpp:
     29        (WebKit::LayerBackedDrawingAreaProxy::paint):
     30        Changed these functions to return a boolean indicating whether we
     31        actually painted anything.
     32
     33        * UIProcess/win/WebView.cpp:
     34        (WebKit::WebView::onPaintEvent): Fill with white (and don't call
     35        didDraw) when the DrawingAreaProxy isn't able to paint.
     36
    1372011-01-06  Jessie Berlin  <jberlin@apple.com>
    238
  • trunk/WebKit2/UIProcess/ChunkedUpdateDrawingAreaProxy.cpp

    r74669 r75267  
    5656}
    5757
    58 void ChunkedUpdateDrawingAreaProxy::paint(const IntRect& rect, PlatformDrawingContext context)
     58bool ChunkedUpdateDrawingAreaProxy::paint(const IntRect& rect, PlatformDrawingContext context)
    5959{
    6060    if (m_isWaitingForDidSetFrameNotification) {
    6161        WebPageProxy* page = this->page();
    6262        if (!page->isValid())
    63             return;
     63            return false;
    6464       
    6565        if (page->process()->isLaunching())
    66             return;
     66            return false;
    6767
    6868        OwnPtr<CoreIPC::ArgumentDecoder> arguments = page->process()->connection()->waitFor(DrawingAreaProxyLegacyMessage::DidSetSize, page->pageID(), 0.04);
     
    7171    }
    7272
    73     platformPaint(rect, context);
     73    return platformPaint(rect, context);
    7474}
    7575
  • trunk/WebKit2/UIProcess/ChunkedUpdateDrawingAreaProxy.h

    r74300 r75267  
    6969    // DrawingAreaProxy
    7070    virtual void didReceiveMessage(CoreIPC::Connection*, CoreIPC::MessageID, CoreIPC::ArgumentDecoder*);
    71     virtual void paint(const WebCore::IntRect&, PlatformDrawingContext);
     71    virtual bool paint(const WebCore::IntRect&, PlatformDrawingContext);
    7272    virtual void sizeDidChange();
    7373    virtual void setPageIsVisible(bool isVisible);
     
    7575    void ensureBackingStore();
    7676    void invalidateBackingStore();
    77     void platformPaint(const WebCore::IntRect&, PlatformDrawingContext);
     77    bool platformPaint(const WebCore::IntRect&, PlatformDrawingContext);
    7878    void drawUpdateChunkIntoBackingStore(UpdateChunk*);
    7979    void didSetSize(UpdateChunk*);
  • trunk/WebKit2/UIProcess/DrawingAreaProxy.h

    r74668 r75267  
    5757    virtual void didReceiveSyncMessage(CoreIPC::Connection*, CoreIPC::MessageID, CoreIPC::ArgumentDecoder*, CoreIPC::ArgumentEncoder*) { ASSERT_NOT_REACHED(); }
    5858
    59     virtual void paint(const WebCore::IntRect&, PlatformDrawingContext) = 0;
     59    // Returns true if painting was successful, false otherwise.
     60    virtual bool paint(const WebCore::IntRect&, PlatformDrawingContext) = 0;
     61
    6062    virtual void sizeDidChange() = 0;
    6163    virtual void setPageIsVisible(bool isVisible) = 0;
  • trunk/WebKit2/UIProcess/LayerBackedDrawingAreaProxy.cpp

    r74669 r75267  
    5757
    5858#if !PLATFORM(WIN)
    59 void LayerBackedDrawingAreaProxy::paint(const IntRect& rect, PlatformDrawingContext context)
     59bool LayerBackedDrawingAreaProxy::paint(const IntRect& rect, PlatformDrawingContext context)
    6060{
     61    return true;
    6162}
    6263#endif
  • trunk/WebKit2/UIProcess/LayerBackedDrawingAreaProxy.h

    r74294 r75267  
    6868    virtual void didReceiveSyncMessage(CoreIPC::Connection*, CoreIPC::MessageID, CoreIPC::ArgumentDecoder*, CoreIPC::ArgumentEncoder*);
    6969
    70     virtual void paint(const WebCore::IntRect&, PlatformDrawingContext);
     70    virtual bool paint(const WebCore::IntRect&, PlatformDrawingContext);
    7171    virtual void sizeDidChange();
    7272    virtual void setPageIsVisible(bool isVisible);
  • trunk/WebKit2/UIProcess/TiledDrawingAreaProxy.cpp

    r74669 r75267  
    316316}
    317317
    318 void TiledDrawingAreaProxy::paint(const IntRect& rect, PlatformDrawingContext context)
     318bool TiledDrawingAreaProxy::paint(const IntRect& rect, PlatformDrawingContext context)
    319319{
    320320    if (m_isWaitingForDidSetFrameNotification) {
    321321        WebPageProxy* page = this->page();
    322322        if (!page->isValid())
    323             return;
     323            return false;
    324324
    325325        if (page->process()->isLaunching())
    326             return;
     326            return false;
    327327    }
    328328
     
    349349        }
    350350    }
     351
    351352    gc.restore();
     353    return true;
    352354}
    353355
  • trunk/WebKit2/UIProcess/TiledDrawingAreaProxy.h

    r74294 r75267  
    116116    virtual void didReceiveMessage(CoreIPC::Connection*, CoreIPC::MessageID, CoreIPC::ArgumentDecoder*);
    117117    virtual void didReceiveSyncMessage(CoreIPC::Connection*, CoreIPC::MessageID, CoreIPC::ArgumentDecoder*, CoreIPC::ArgumentEncoder&);
    118     virtual void paint(const WebCore::IntRect&, PlatformDrawingContext);
     118    virtual bool paint(const WebCore::IntRect&, PlatformDrawingContext);
    119119    virtual void sizeDidChange();
    120120    virtual void setPageIsVisible(bool isVisible);
  • trunk/WebKit2/UIProcess/mac/ChunkedUpdateDrawingAreaProxyMac.mm

    r73666 r75267  
    6161}
    6262
    63 void ChunkedUpdateDrawingAreaProxy::platformPaint(const IntRect& rect, CGContextRef context)
     63bool ChunkedUpdateDrawingAreaProxy::platformPaint(const IntRect& rect, CGContextRef context)
    6464{
    6565    if (!m_bitmapContext)
    66         return;
     66        return false;
    6767
    6868    CGContextSaveGState(context);
     
    8080
    8181    CGContextRestoreGState(context);
     82    return true;
    8283}
    8384
  • trunk/WebKit2/UIProcess/qt/ChunkedUpdateDrawingAreaProxyQt.cpp

    r71780 r75267  
    5757}
    5858
    59 void ChunkedUpdateDrawingAreaProxy::platformPaint(const IntRect& rect, QPainter* painter)
     59bool ChunkedUpdateDrawingAreaProxy::platformPaint(const IntRect& rect, QPainter* painter)
    6060{
    6161    if (m_backingStoreImage.isNull())
    62         return;
     62        return false;
    6363
    6464    painter->drawImage(QPoint(0, 0), m_backingStoreImage);
     65    return true;
    6566}
    6667
  • trunk/WebKit2/UIProcess/win/ChunkedUpdateDrawingAreaProxyWin.cpp

    r71780 r75267  
    6565}
    6666
    67 void ChunkedUpdateDrawingAreaProxy::platformPaint(const IntRect& rect, HDC hdc)
     67bool ChunkedUpdateDrawingAreaProxy::platformPaint(const IntRect& rect, HDC hdc)
    6868{
    6969    if (!m_backingStoreBitmap)
    70         return;
     70        return false;
    7171
    7272    // BitBlt from the backing-store to the passed in hdc.
    7373    ::BitBlt(hdc, rect.x(), rect.y(), rect.width(), rect.height(), m_backingStoreDC.get(), rect.x(), rect.y(), SRCCOPY);
     74    return true;
    7475}
    7576
  • trunk/WebKit2/UIProcess/win/LayerBackedDrawingAreaProxyWin.cpp

    r72212 r75267  
    5656}
    5757
    58 void LayerBackedDrawingAreaProxy::paint(const IntRect&, PlatformDrawingContext)
     58bool LayerBackedDrawingAreaProxy::paint(const IntRect&, PlatformDrawingContext)
    5959{
     60    return false;
    6061}
    6162
  • trunk/WebKit2/UIProcess/win/WebView.cpp

    r75187 r75267  
    388388    HDC hdc = ::BeginPaint(m_window, &paintStruct);
    389389
    390     if (m_page->isValid() && m_page->drawingArea()) {
    391         m_page->drawingArea()->paint(IntRect(paintStruct.rcPaint), hdc);
     390    if (m_page->isValid() && m_page->drawingArea() && m_page->drawingArea()->paint(IntRect(paintStruct.rcPaint), hdc))
    392391        m_page->didDraw();
    393     } else {
     392    else {
    394393        // Mac checks WebPageProxy::drawsBackground and
    395394        // WebPageProxy::drawsTransparentBackground here, but those are always false on Windows
Note: See TracChangeset for help on using the changeset viewer.