Changeset 247245 in webkit


Ignore:
Timestamp:
Jul 8, 2019 6:07:18 PM (5 years ago)
Author:
Fujii Hironori
Message:

[WinCairo] ASSERTION FAILED: info.bmBitsPixel == 32 in createCairoContextWithHDC
https://bugs.webkit.org/show_bug.cgi?id=198323

Reviewed by Per Arne Vollan.

WebView::paint binds m_backingStoreBitmap to a DC by using
SelectObject. WebView::paint can be called recursively, but
m_backingStoreBitmap can't be bound to multiple DCs at the same
time. Then, SelectObject was failing in such case.

Call WebCore::Page::updateRendering before binding
m_backingStoreBitmap instead of after it.

Reverted r202744 change which won't be needed since this change.

  • WebView.cpp:

(WebView::scrollBackingStore): Removed r202744's change.
(WebView::updateBackingStore): Removed m_page->updateRendering().
(WebView::paint): Do m_page->updateRendering() before binding m_backingStoreBitmap.

  • WebView.h: Removed unused WebView::isPainting.
Location:
trunk/Source/WebKitLegacy/win
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebKitLegacy/win/ChangeLog

    r247043 r247245  
     12019-07-08  Fujii Hironori  <Hironori.Fujii@sony.com>
     2
     3        [WinCairo] ASSERTION FAILED: info.bmBitsPixel == 32 in createCairoContextWithHDC
     4        https://bugs.webkit.org/show_bug.cgi?id=198323
     5
     6        Reviewed by Per Arne Vollan.
     7
     8        WebView::paint binds m_backingStoreBitmap to a DC by using
     9        SelectObject. WebView::paint can be called recursively, but
     10        m_backingStoreBitmap can't be bound to multiple DCs at the same
     11        time. Then, SelectObject was failing in such case.
     12
     13        Call WebCore::Page::updateRendering before binding
     14        m_backingStoreBitmap instead of after it.
     15
     16        Reverted r202744 change which won't be needed since this change.
     17
     18        * WebView.cpp:
     19        (WebView::scrollBackingStore): Removed r202744's change.
     20        (WebView::updateBackingStore): Removed m_page->updateRendering().
     21        (WebView::paint): Do m_page->updateRendering() before binding m_backingStoreBitmap.
     22        * WebView.h: Removed unused WebView::isPainting.
     23
    1242019-07-02  Devin Rousso  <drousso@apple.com>
    225
  • trunk/Source/WebKitLegacy/win/WebView.cpp

    r246960 r247245  
    10161016    auto bitmapDC = adoptGDIObject(::CreateCompatibleDC(windowDC));
    10171017    HGDIOBJ oldBitmap = ::SelectObject(bitmapDC.get(), m_backingStoreBitmap->get());
    1018     if (!oldBitmap) {
    1019         // The ::SelectObject call will fail if m_backingStoreBitmap is already selected into a device context.
    1020         // This happens when this method is called indirectly from WebView::updateBackingStore during normal WM_PAINT handling.
    1021         // There is no point continuing, since we would just be scrolling a 1x1 bitmap which is selected into the device context by default.
    1022         // We can just scroll by repainting the scroll rectangle.
    1023         RECT scrollRect(scrollViewRect);
    1024         ::InvalidateRect(m_viewWindow, &scrollRect, FALSE);
    1025         return;
    1026     }
     1018    ASSERT(oldBitmap);
    10271019
    10281020    // Scroll the bitmap.
     
    11651157        bitmapDC = bitmapDCObject.get();
    11661158        oldBitmap = ::SelectObject(bitmapDC, m_backingStoreBitmap->get());
     1159        ASSERT(oldBitmap);
    11671160#if USE(DIRECT2D)
    11681161        HRESULT hr = m_backingStoreGdiInterop->GetDC(D2D1_DC_INITIALIZE_MODE_COPY, &bitmapDC);
     
    11721165
    11731166    if (m_backingStoreBitmap && (m_backingStoreDirtyRegion || backingStoreCompletelyDirty)) {
    1174         // Do a layout first so that everything we render to the backing store is always current.
    1175         m_page->updateRendering();
    1176 
    11771167        Vector<IntRect> paintRects;
    11781168        if (!backingStoreCompletelyDirty && m_backingStoreDirtyRegion) {
     
    13051295        return;
    13061296    }
     1297
     1298    m_page->updateRendering();
    13071299
    13081300    Frame* coreFrame = core(m_mainFrame);
     
    13421334    }
    13431335
    1344     m_paintCount++;
    1345 
    13461336    auto bitmapDC = adoptGDIObject(::CreateCompatibleDC(hdc));
    13471337    HGDIOBJ oldBitmap = ::SelectObject(bitmapDC.get(), m_backingStoreBitmap->get());
     
    13771367    m_backingStoreGdiInterop->ReleaseDC(nullptr);
    13781368#endif
    1379 
    1380     m_paintCount--;
    13811369
    13821370    if (active())
  • trunk/Source/WebKitLegacy/win/WebView.h

    r245950 r247245  
    476476    bool handleEditingKeyboardEvent(WebCore::KeyboardEvent&);
    477477
    478     bool isPainting() const { return m_paintCount > 0; }
    479 
    480478    void setToolTip(const WTF::String&);
    481479
     
    671669    UChar m_currentCharacterCode { 0 };
    672670    bool m_isBeingDestroyed { false };
    673     unsigned m_paintCount { 0 };
    674671    bool m_hasSpellCheckerDocumentTag { false };
    675672    bool m_didClose { false };
Note: See TracChangeset for help on using the changeset viewer.