Title: [109347] trunk/Source/WebCore
Revision
109347
Author
[email protected]
Date
2012-03-01 08:13:19 -0800 (Thu, 01 Mar 2012)

Log Message

[Qt] Fixed incorrect size pixmap creation for a new transparency layer.
https://bugs.webkit.org/show_bug.cgi?id=79658

If QPainter does not have clipping, beginPlatformTransparencyLayer can create
wrong size pixmap, so it causes incorrect rendering.

Patch by Huang Dongsung <[email protected]> on 2012-03-01
Reviewed by Simon Hausmann.

* platform/graphics/qt/GraphicsContextQt.cpp:
(WebCore::GraphicsContext::beginPlatformTransparencyLayer):

Modified Paths

Diff

Modified: trunk/Source/WebCore/ChangeLog (109346 => 109347)


--- trunk/Source/WebCore/ChangeLog	2012-03-01 15:18:23 UTC (rev 109346)
+++ trunk/Source/WebCore/ChangeLog	2012-03-01 16:13:19 UTC (rev 109347)
@@ -1,3 +1,16 @@
+2012-03-01  Huang Dongsung  <[email protected]>
+
+        [Qt] Fixed incorrect size pixmap creation for a new transparency layer.
+        https://bugs.webkit.org/show_bug.cgi?id=79658
+
+        If QPainter does not have clipping, beginPlatformTransparencyLayer can create
+        wrong size pixmap, so it causes incorrect rendering.
+
+        Reviewed by Simon Hausmann.
+
+        * platform/graphics/qt/GraphicsContextQt.cpp:
+        (WebCore::GraphicsContext::beginPlatformTransparencyLayer):
+
 2012-03-01  Simon Hausmann  <[email protected]>
 
         [Qt] Remove dead style option code.

Modified: trunk/Source/WebCore/platform/graphics/qt/GraphicsContextQt.cpp (109346 => 109347)


--- trunk/Source/WebCore/platform/graphics/qt/GraphicsContextQt.cpp	2012-03-01 15:18:23 UTC (rev 109346)
+++ trunk/Source/WebCore/platform/graphics/qt/GraphicsContextQt.cpp	2012-03-01 16:13:19 UTC (rev 109347)
@@ -1068,12 +1068,14 @@
     w = device->width();
     h = device->height();
 
-    QRectF clip = m_data->clipBoundingRect();
-    QRectF deviceClip = p->transform().mapRect(clip);
-    x = int(qBound(qreal(0), deviceClip.x(), (qreal)w));
-    y = int(qBound(qreal(0), deviceClip.y(), (qreal)h));
-    w = int(qBound(qreal(0), deviceClip.width(), (qreal)w) + 2);
-    h = int(qBound(qreal(0), deviceClip.height(), (qreal)h) + 2);
+    if (p->hasClipping()) {
+        QRectF clip = m_data->clipBoundingRect();
+        QRectF deviceClip = p->transform().mapRect(clip);
+        x = int(qBound(qreal(0), deviceClip.x(), (qreal)w));
+        y = int(qBound(qreal(0), deviceClip.y(), (qreal)h));
+        w = int(qBound(qreal(0), deviceClip.width(), (qreal)w) + 2);
+        h = int(qBound(qreal(0), deviceClip.height(), (qreal)h) + 2);
+    }
 
     QPixmap emptyAlphaMask;
     m_data->layers.push(new TransparencyLayer(p, QRect(x, y, w, h), opacity, emptyAlphaMask));
_______________________________________________
webkit-changes mailing list
[email protected]
http://lists.webkit.org/mailman/listinfo.cgi/webkit-changes

Reply via email to