Make the Qt port not crash on many sites such as www.apple.com: painter was closed too
authorstaikos <staikos@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 29 Dec 2006 14:47:17 +0000 (14:47 +0000)
committerstaikos <staikos@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 29 Dec 2006 14:47:17 +0000 (14:47 +0000)
early, and I think also there is a Qt bug that it complains about a painter being
around on a destroyed object that's really just a QShared reference going away.  Worked
around.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@18474 268f45cc-cd09-0410-ab3c-d52691b4dbfc

WebCore/ChangeLog
WebCore/platform/graphics/qt/GraphicsContextQt.cpp
WebCore/platform/qt/ScrollViewCanvasQt.cpp
WebKitQt/ChangeLog
WebKitQt/WebCoreSupport/FrameLoaderClientQt.cpp

index 428f6eef12278f8e41454a150db535a23d8f1655..ebff469bf3e9b59284d25d1762b3ec4b9885a0ea 100644 (file)
@@ -1,3 +1,16 @@
+2006-12-29  George Staikos  <staikos@kde.org>
+
+        Reviewed by Sam.
+
+        Don't crash on sites such as www.apple.com.  Painter was ended incorrectly among other issues.
+
+        * platform/graphics/qt/GraphicsContextQt.cpp:
+        (WebCore::TransparencyLayer::TransparencyLayer):
+        (WebCore::TransparencyLayer::cleanup):
+        (WebCore::GraphicsContext::endTransparencyLayer):
+        * platform/qt/ScrollViewCanvasQt.cpp:
+        (WebCore::ScrollViewCanvasQt::paintEvent):
+
 2006-12-29  Nikolas Zimmermann  <zimmermann@kde.org>
 
         Build fixed, not reviewed. Noticed by Daniel Molkentin.
index 0176bcc2b266125df40f0618f2a196cd25509d04..2852678d954774c99c44c6d82b8e2f6c44a5e071 100644 (file)
@@ -145,9 +145,9 @@ struct TransparencyLayer
 {
     TransparencyLayer(const QPainter& p, int width, int height)
     {
-        pixmap = QPixmap(width, height);
+        pixmap = new QPixmap(width, height);
 
-        painter = new QPainter(&pixmap);
+        painter = new QPainter(pixmap);
         painter->setPen(p.pen());
         painter->setBrush(p.brush());
         painter->setMatrix(p.matrix());
@@ -160,16 +160,18 @@ struct TransparencyLayer
     }
 
     TransparencyLayer()
-        : painter(0)
+        : pixmap(0)
+        , painter(0)
     {
     }
 
     void cleanup()
     {
         delete painter;
+        delete pixmap;
     }
 
-    QPixmap pixmap;
+    QPixmap* pixmap;
     QPainter* painter;
     qreal opacity;
 };
@@ -613,9 +615,8 @@ void GraphicsContext::endTransparencyLayer()
 #if QT_VERSION >= 0x040200
     m_data->p().setOpacity(layer.opacity);
 #endif
-    m_data->p().drawPixmap(0, 0, layer.pixmap);
+    m_data->p().drawPixmap(0, 0, *layer.pixmap);
     m_data->p().restore();
-    m_data->p().end();
 
     layer.cleanup();
 }
index 884ea8d632d7714f521850262b600796b45dcf4d..e0e8c1dd9d57fe8adce08d65849c6150e9e76b9a 100644 (file)
@@ -67,10 +67,11 @@ void ScrollViewCanvasQt::paintEvent(QPaintEvent* ev)
 
     QRect clip = ev->rect();
 
+    fv->layout();
+
     QPainter p(this);
     GraphicsContext ctx(&p);
 
-    fv->layout();
     fv->frame()->paint(&ctx, clip);
 }
 
index 685ef9bf9d642071a89b51364b1019ece5aadbab..c636e7e2cc1805c7ad8317968ffa0508fc1378d2 100644 (file)
@@ -1,3 +1,12 @@
+2006-12-29  George Staikos  <staikos@kde.org>
+
+        Add missing notimplemented.
+
+        * WebCoreSupport/FrameLoaderClientQt.cpp:
+        (WebCore::FrameLoaderClientQt::frameLoaderDestroyed):
+        (WebCore::FrameLoaderClientQt::canHandleRequest):
+        (WebCore::FrameLoaderClientQt::partClearedInBegin):
+
 2006-12-21  Lars Knoll <lars@trolltech.com>
 
         Reviewed by Zack
index 67fc5e5bf451da8f5a6650c9584a83c98bc8bd2e..4303f64d0e6c50f3f6f39dfeb40c7dd945458119 100644 (file)
@@ -505,16 +505,17 @@ void FrameLoaderClientQt::dispatchDidReceiveIcon()
 
 void FrameLoaderClientQt::frameLoaderDestroyed()
 {
-
+    notImplemented();
 }
 
 bool FrameLoaderClientQt::canHandleRequest(const WebCore::ResourceRequest&) const
 {
-
+    notImplemented();
 }
 
 void FrameLoaderClientQt::partClearedInBegin()
 {
+    notImplemented();
 }
 
 }