Sophie

Sophie

distrib > Mageia > 4 > x86_64 > media > core-updates-src > by-pkgid > efd0537004b31b5b79729a66e54be278 > files > 2

qtwebkit-2.3.3-3.1.mga4.src.rpm

From 974c1dfeb826cc6d6e96d316d63bf13c645b1ac8 Mon Sep 17 00:00:00 2001
From: Allan Sandfeld Jensen <allan.jensen@digia.com>
Date: Mon, 9 Sep 2013 14:35:31 +0200
Subject: [PATCH 3/9] [Qt] Tiled-backing store not clipped to frame or visible
 rect https://bugs.webkit.org/show_bug.cgi?id=120606

Reviewed by Jocelyn Turcotte.

Clip painting from the tiled-backing store to the frame rect.

* WebCoreSupport/QWebFrameAdapter.cpp:
(QWebFrameAdapter::renderFromTiledBackingStore):

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@154983 268f45cc-cd09-0410-ab3c-d52691b4dbfc
---
 Source/WebKit/qt/Api/qwebframe.cpp | 17 ++++++++---------
 Source/WebKit/qt/ChangeLog         | 12 ++++++++++++
 2 files changed, 20 insertions(+), 9 deletions(-)

diff --git a/Source/WebKit/qt/Api/qwebframe.cpp b/Source/WebKit/qt/Api/qwebframe.cpp
index f37457e..6205a9c 100644
--- a/Source/WebKit/qt/Api/qwebframe.cpp
+++ b/Source/WebKit/qt/Api/qwebframe.cpp
@@ -200,25 +200,24 @@ void QWebFramePrivate::renderFromTiledBackingStore(GraphicsContext* context, con
     if (vector.isEmpty())
         return;
 
-    QPainter* painter = context->platformContext();
-
     WebCore::FrameView* view = frame->view();
-    
+
     int scrollX = view->scrollX();
     int scrollY = view->scrollY();
-    context->translate(-scrollX, -scrollY);
+    QRect frameRect = view->frameRect();
 
     for (int i = 0; i < vector.size(); ++i) {
         const QRect& clipRect = vector.at(i);
 
-        painter->save();
-        
-        QRect rect = clipRect.translated(scrollX, scrollY);
-        painter->setClipRect(rect, Qt::IntersectClip);
+        context->save();
+        QRect rect = clipRect.intersected(frameRect);
+        context->translate(-scrollX, -scrollY);
+        rect.translate(scrollX, scrollY);
+        context->clip(rect);
 
         frame->tiledBackingStore()->paint(context, rect);
 
-        painter->restore();
+        context->restore();
     }
 
 #if USE(ACCELERATED_COMPOSITING)
diff --git a/Source/WebKit/qt/ChangeLog b/Source/WebKit/qt/ChangeLog
index ecb4acb..62f60c5 100644
--- a/Source/WebKit/qt/ChangeLog
+++ b/Source/WebKit/qt/ChangeLog
@@ -1,3 +1,15 @@
+2013-09-03  Allan Sandfeld Jensen  <allan.jensen@digia.com>
+
+        [Qt] Tiled-backing store not clipped to frame or visible rect
+        https://bugs.webkit.org/show_bug.cgi?id=120606
+
+        Reviewed by Jocelyn Turcotte.
+
+        Clip painting from the tiled-backing store to the frame rect.
+
+        * WebCoreSupport/QWebFrameAdapter.cpp:
+        (QWebFrameAdapter::renderFromTiledBackingStore):
+
 2013-06-05  Allan Sandfeld Jensen  <allan.jensen@digia.com>
 
         [Qt] Handle Return key without key text
-- 
1.8.3.1