Title: [202744] trunk/Source/WebKit/win
Revision
202744
Author
[email protected]
Date
2016-07-01 11:08:30 -0700 (Fri, 01 Jul 2016)

Log 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.

Modified Paths

Diff

Modified: trunk/Source/WebKit/win/ChangeLog (202743 => 202744)


--- trunk/Source/WebKit/win/ChangeLog	2016-07-01 17:08:38 UTC (rev 202743)
+++ trunk/Source/WebKit/win/ChangeLog	2016-07-01 18:08:30 UTC (rev 202744)
@@ -1,3 +1,18 @@
+2016-07-01  Per Arne Vollan  <[email protected]>
+
+        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.
+
 2016-07-01  Youenn Fablet  <[email protected]>
 
         Add a runtime flag for DOM iterators

Modified: trunk/Source/WebKit/win/WebView.cpp (202743 => 202744)


--- trunk/Source/WebKit/win/WebView.cpp	2016-07-01 17:08:38 UTC (rev 202743)
+++ trunk/Source/WebKit/win/WebView.cpp	2016-07-01 18:08:30 UTC (rev 202744)
@@ -936,6 +936,15 @@
     HWndDC windowDC(m_viewWindow);
     auto bitmapDC = adoptGDIObject(::CreateCompatibleDC(windowDC));
     HGDIOBJ oldBitmap = ::SelectObject(bitmapDC.get(), m_backingStoreBitmap->get());
+    if (!oldBitmap) {
+        // 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 WM_PAINT handling.
+        // 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.
+        RECT scrollRect(scrollViewRect);
+        ::InvalidateRect(m_viewWindow, &scrollRect, FALSE);
+        return;
+    }
 
     // Scroll the bitmap.
     RECT scrollRectWin(scrollViewRect);
@@ -7593,4 +7602,3 @@
     *found = m_page->findString(toString(string), options);
     return S_OK;
 }
-
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to