Changeset 85794 in webkit


Ignore:
Timestamp:
May 4, 2011 3:20:45 PM (13 years ago)
Author:
andersca@apple.com
Message:

2011-05-04 Anders Carlsson <andersca@apple.com>

Reviewed by Adam Roben.

WKView on Windows has no equivalent of Mac's -[WKView setDraws[Transparent]Background:]
https://bugs.webkit.org/show_bug.cgi?id=52009
<rdar://problem/8829746>

Add and implement WKViewSetDrawsTransparentBackground on windows.

  • UIProcess/API/C/win/WKView.cpp: (WKViewSetDrawsTransparentBackground): (WKViewDrawsTransparentBackground): Call through to the WebPageProxy object.
  • UIProcess/API/C/win/WKView.h:
  • UIProcess/win/WebView.cpp: (WebKit::drawPageBackground): Don't fill the rect with white if WebPageProxy::drawsBackground() or WebPageProxy::drawsTransparentBackground() returns false. Because of limitations in Win32, both drawsBackground and drawsTransparentBackground are pretty much equivalent.

(WebKit::WebView::paint):
Pass the WebPageProxy object to drawPageBackground.

Location:
trunk/Source/WebKit2
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebKit2/ChangeLog

    r85785 r85794  
     12011-05-04  Anders Carlsson  <andersca@apple.com>
     2
     3        Reviewed by Adam Roben.
     4
     5        WKView on Windows has no equivalent of Mac's -[WKView setDraws[Transparent]Background:]
     6        https://bugs.webkit.org/show_bug.cgi?id=52009
     7        <rdar://problem/8829746>
     8
     9        Add and implement WKViewSetDrawsTransparentBackground on windows.
     10
     11        * UIProcess/API/C/win/WKView.cpp:
     12        (WKViewSetDrawsTransparentBackground):
     13        (WKViewDrawsTransparentBackground):
     14        Call through to the WebPageProxy object.
     15
     16        * UIProcess/API/C/win/WKView.h:
     17        * UIProcess/win/WebView.cpp:
     18        (WebKit::drawPageBackground):
     19        Don't fill the rect with white if WebPageProxy::drawsBackground() or
     20        WebPageProxy::drawsTransparentBackground() returns false. Because of limitations in Win32,
     21        both drawsBackground and drawsTransparentBackground are pretty much equivalent.
     22
     23        (WebKit::WebView::paint):
     24        Pass the WebPageProxy object to drawPageBackground.
     25
    1262011-05-04  Tao Bai  <michaelbai@chromium.org>
    227
  • trunk/Source/WebKit2/UIProcess/API/C/win/WKView.cpp

    r81082 r85794  
    104104    toImpl(viewRef)->unapplyEditCommand(toImpl(command));
    105105}
     106
     107void WKViewSetDrawsTransparentBackground(WKViewRef viewRef, bool drawsTransparentBackground)
     108{
     109    toImpl(viewRef)->page()->setDrawsTransparentBackground(drawsTransparentBackground);
     110}
     111
     112bool WKViewDrawsTransparentBackground(WKViewRef viewRef)
     113{
     114    return toImpl(viewRef)->page()->drawsTransparentBackground();
     115}
     116
  • trunk/Source/WebKit2/UIProcess/API/C/win/WKView.h

    r83229 r85794  
    7979WK_EXPORT WKViewFindIndicatorCallback WKViewGetFindIndicatorCallback(WKViewRef view, void** context);
    8080
     81WK_EXPORT void WKViewSetDrawsTransparentBackground(WKViewRef view, bool drawsTransparentBackground);
     82WK_EXPORT bool WKViewDrawsTransparentBackground(WKViewRef view);
     83
    8184#ifdef __cplusplus
    8285}
  • trunk/Source/WebKit2/UIProcess/win/WebView.cpp

    r85699 r85794  
    634634}
    635635
    636 static void drawPageBackground(HDC dc, const RECT& rect)
    637 {
    638     // Mac checks WebPageProxy::drawsBackground and
    639     // WebPageProxy::drawsTransparentBackground here, but those are always false on
    640     // Windows currently (see <http://webkit.org/b/52009>).
     636static void drawPageBackground(HDC dc, const WebPageProxy* page, const RECT& rect)
     637{
     638    if (!page->drawsBackground() || page->drawsTransparentBackground())
     639        return;
     640
    641641    ::FillRect(dc, &rect, reinterpret_cast<HBRUSH>(COLOR_WINDOW + 1));
    642642}
     
    654654            for (size_t i = 0; i < unpaintedRects.size(); ++i) {
    655655                RECT winRect = unpaintedRects[i];
    656                 drawPageBackground(hdc, unpaintedRects[i]);
     656                drawPageBackground(hdc, m_page.get(), unpaintedRects[i]);
    657657            }
    658658        } else
    659             drawPageBackground(hdc, dirtyRect);
     659            drawPageBackground(hdc, m_page.get(), dirtyRect);
    660660
    661661        m_page->didDraw();
     
    664664            m_page->didDraw();
    665665        else
    666             drawPageBackground(hdc, dirtyRect);
     666            drawPageBackground(hdc, m_page.get(), dirtyRect);
    667667    }
    668668}
Note: See TracChangeset for help on using the changeset viewer.