[haiku-webkit-commits] r246 - webkit/trunk/WebKit/haiku/API

  • From: webkit@xxxxxxxxxxxxxxx
  • To: haiku-webkit-commits@xxxxxxxxxxxxx
  • Date: Sun, 28 Feb 2010 15:20:49 +0000

Author: stippi
Date: Sun Feb 28 15:20:49 2010
New Revision: 246
URL: http://mmlr.dyndns.org/changeset/246

Log:
Running a debug build, it appears we are required to layout in paint(). I've
rearranged things so we don't reenter paint() while we have the offscreen view
already locked.

Modified:
   webkit/trunk/WebKit/haiku/API/WebPage.cpp
   webkit/trunk/WebKit/haiku/API/WebPage.h

Modified: webkit/trunk/WebKit/haiku/API/WebPage.cpp
==============================================================================
--- webkit/trunk/WebKit/haiku/API/WebPage.cpp   Sun Feb 28 13:50:06 2010        
(r245)
+++ webkit/trunk/WebKit/haiku/API/WebPage.cpp   Sun Feb 28 15:20:49 2010        
(r246)
@@ -161,7 +161,6 @@
     , m_page(0)
     , m_pageVisible(true)
     , m_pageDirty(false)
-    , m_inPaint(false)
     , m_toolbarsVisible(true)
     , m_statusbarVisible(true)
     , m_menubarVisible(true)
@@ -532,12 +531,6 @@
 void BWebPage::paint(BRect rect, bool contentChanged, bool immediate,
     bool repaintContentOnly)
 {
-       if (m_inPaint) {
-               printf("%p->BWebPage::paint(BRect(%.1f, %.1f, %.1f, %.1f), %d, 
%d, %d) - already painting!\n",
-                       this, rect.left, rect.top, rect.right, rect.bottom, 
contentChanged, immediate,
-                       repaintContentOnly);
-               return;
-       }
     // Block any drawing as long as the BWebView is hidden
     // (should be extended to when the containing BWebWindow is not
     // currently on screen either...)
@@ -557,13 +550,14 @@
     if (!view || !frame->contentRenderer())
         return;
 
-       m_inPaint = true;
+       // Since calling layoutIfNeededRecursive can cycle back into paint(),
+       // call this method before locking the window and before holding the
+       // offscreen view lock.
+       view->layoutIfNeededRecursive();
 
 //    if (m_webView->LockLooperWithTimeout(5000) != B_OK)
-    if (!m_webView->LockLooper()) {
-       m_inPaint = false;
+    if (!m_webView->LockLooper())
         return;
-    }
     BView* offscreenView = m_webView->OffscreenView();
 
     // Lock the offscreen bitmap while we still have the
@@ -588,8 +582,6 @@
 
     // Notify the window that it can now pull the bitmap in its own thread
     m_webView->SetOffscreenViewClean(rect, immediate);
-
-       m_inPaint = false;
 }
 
 // #pragma mark - private

Modified: webkit/trunk/WebKit/haiku/API/WebPage.h
==============================================================================
--- webkit/trunk/WebKit/haiku/API/WebPage.h     Sun Feb 28 13:50:06 2010        
(r245)
+++ webkit/trunk/WebKit/haiku/API/WebPage.h     Sun Feb 28 15:20:49 2010        
(r246)
@@ -196,7 +196,6 @@
 
     bool m_pageVisible;
     bool m_pageDirty;
-    bool m_inPaint;
 
        bool m_toolbarsVisible;
        bool m_statusbarVisible;

Other related posts:

  • » [haiku-webkit-commits] r246 - webkit/trunk/WebKit/haiku/API - webkit