Changeset 202744 in webkit


Ignore:
Timestamp:
Jul 1, 2016 11:08:30 AM (8 years ago)
Author:
pvollan@apple.com
Message:

ASSERTION FAILED: info.bmBitsPixel == 32
https://bugs.webkit.org/show_bug.cgi?id=17737

Reviewed by Brent Fulgham.

The ::SelectObject call will fail if m_backingStoreBitmap is already selected into a device context.
This happens when this method is called indirectly from WebView::updateBackingStore during normal
painting. There is no point continuing, since we would just be scrolling a 1x1 bitmap which is
selected into the device context by default. We can just scroll by repainting the scroll rectangle.

  • WebView.cpp:

(WebView::scrollBackingStore): Invalidate the scroll rectangle if the ::SelectObject call fails.

Location:
trunk/Source/WebKit/win
Files:
2 edited

Legend:

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

    r202728 r202744  
     12016-07-01  Per Arne Vollan  <pvollan@apple.com>
     2
     3        ASSERTION FAILED: info.bmBitsPixel == 32
     4        https://bugs.webkit.org/show_bug.cgi?id=17737
     5
     6        Reviewed by Brent Fulgham.
     7
     8        The ::SelectObject call will fail if m_backingStoreBitmap is already selected into a device context.
     9        This happens when this method is called indirectly from WebView::updateBackingStore during normal
     10        painting. There is no point continuing, since we would just be scrolling a 1x1 bitmap which is
     11        selected into the device context by default. We can just scroll by repainting the scroll rectangle.
     12
     13        * WebView.cpp:
     14        (WebView::scrollBackingStore): Invalidate the scroll rectangle if the ::SelectObject call fails.
     15
    1162016-07-01  Youenn Fablet  <youennf@gmail.com>
    217
  • trunk/Source/WebKit/win/WebView.cpp

    r202728 r202744  
    937937    auto bitmapDC = adoptGDIObject(::CreateCompatibleDC(windowDC));
    938938    HGDIOBJ oldBitmap = ::SelectObject(bitmapDC.get(), m_backingStoreBitmap->get());
     939    if (!oldBitmap) {
     940        // The ::SelectObject call will fail if m_backingStoreBitmap is already selected into a device context.
     941        // This happens when this method is called indirectly from WebView::updateBackingStore during normal WM_PAINT handling.
     942        // There is no point continuing, since we would just be scrolling a 1x1 bitmap which is selected into the device context by default.
     943        // We can just scroll by repainting the scroll rectangle.
     944        RECT scrollRect(scrollViewRect);
     945        ::InvalidateRect(m_viewWindow, &scrollRect, FALSE);
     946        return;
     947    }
    939948
    940949    // Scroll the bitmap.
     
    75947603    return S_OK;
    75957604}
    7596 
Note: See TracChangeset for help on using the changeset viewer.