[SCM] WebKit Debian packaging branch, webkit-1.1, updated. upstream/1.1.15.1-1414-gc69ee75
eric at webkit.org
eric at webkit.org
Thu Oct 29 20:40:26 UTC 2009
The following commit has been merged in the webkit-1.1 branch:
commit c607633f4a9670a2eea11b65f0beea883cc74989
Author: eric at webkit.org <eric at webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date: Tue Oct 6 17:49:39 2009 +0000
2009-10-06 Carol Szabo <carol.szabo at nokia.com>
Reviewed by Ariya Hidayat.
[Qt] Some functions in GraphicsContext do not work
as expected if the associated painter has no clipping.
https://bugs.webkit.org/show_bug.cgi?id=29691
No new tests are associated with this because DumpRenderTree
always sets clipping on the painter, thus it would never hit
the test case, but fast/box-shadow/basic-shadows.html is a
good example of what happens if the clipping is not set by
the user of QtWebKit.
* platform/graphics/qt/GraphicsContextQt.cpp:
(WebCore::GraphicsContext::clipOut):
(WebCore::GraphicsContext::clipOutEllipseInRect):
Fixed to handle the case that there is no clipping
before the call.
git-svn-id: http://svn.webkit.org/repository/webkit/trunk@49195 268f45cc-cd09-0410-ab3c-d52691b4dbfc
diff --git a/WebCore/ChangeLog b/WebCore/ChangeLog
index 0c91197..40e1e07 100644
--- a/WebCore/ChangeLog
+++ b/WebCore/ChangeLog
@@ -1,3 +1,23 @@
+2009-10-06 Carol Szabo <carol.szabo at nokia.com>
+
+ Reviewed by Ariya Hidayat.
+
+ [Qt] Some functions in GraphicsContext do not work
+ as expected if the associated painter has no clipping.
+ https://bugs.webkit.org/show_bug.cgi?id=29691
+
+ No new tests are associated with this because DumpRenderTree
+ always sets clipping on the painter, thus it would never hit
+ the test case, but fast/box-shadow/basic-shadows.html is a
+ good example of what happens if the clipping is not set by
+ the user of QtWebKit.
+
+ * platform/graphics/qt/GraphicsContextQt.cpp:
+ (WebCore::GraphicsContext::clipOut):
+ (WebCore::GraphicsContext::clipOutEllipseInRect):
+ Fixed to handle the case that there is no clipping
+ before the call.
+
2009-10-06 Dave Hyatt <hyatt at apple.com>
Reviewed by Adam Roben.
diff --git a/WebCore/platform/graphics/qt/GraphicsContextQt.cpp b/WebCore/platform/graphics/qt/GraphicsContextQt.cpp
index aace4be..fa7b070 100644
--- a/WebCore/platform/graphics/qt/GraphicsContextQt.cpp
+++ b/WebCore/platform/graphics/qt/GraphicsContextQt.cpp
@@ -1059,14 +1059,18 @@ void GraphicsContext::clipOut(const Path& path)
return;
QPainter* p = m_data->p();
- QRectF clipBounds = p->clipPath().boundingRect();
QPainterPath clippedOut = *path.platformPath();
QPainterPath newClip;
newClip.setFillRule(Qt::OddEvenFill);
- newClip.addRect(clipBounds);
- newClip.addPath(clippedOut);
-
- p->setClipPath(newClip, Qt::IntersectClip);
+ if (p->hasClipping()) {
+ newClip.addRect(p->clipPath().boundingRect());
+ newClip.addPath(clippedOut);
+ p->setClipPath(newClip, Qt::IntersectClip);
+ } else {
+ newClip.addRect(p->window());
+ newClip.addPath(clippedOut & newClip);
+ p->setClipPath(newClip);
+ }
}
void GraphicsContext::translate(float x, float y)
@@ -1125,13 +1129,20 @@ void GraphicsContext::clipOut(const IntRect& rect)
return;
QPainter* p = m_data->p();
- QRectF clipBounds = p->clipPath().boundingRect();
QPainterPath newClip;
newClip.setFillRule(Qt::OddEvenFill);
- newClip.addRect(clipBounds);
- newClip.addRect(QRect(rect));
-
- p->setClipPath(newClip, Qt::IntersectClip);
+ if (p->hasClipping()) {
+ newClip.addRect(p->clipPath().boundingRect());
+ newClip.addRect(QRect(rect));
+ p->setClipPath(newClip, Qt::IntersectClip);
+ } else {
+ QRect clipOutRect(rect);
+ QRect window(p->window());
+ clipOutRect &= window;
+ newClip.addRect(window);
+ newClip.addRect(clipOutRect);
+ p->setClipPath(newClip);
+ }
}
void GraphicsContext::clipOutEllipseInRect(const IntRect& rect)
@@ -1140,13 +1151,20 @@ void GraphicsContext::clipOutEllipseInRect(const IntRect& rect)
return;
QPainter* p = m_data->p();
- QRectF clipBounds = p->clipPath().boundingRect();
QPainterPath newClip;
newClip.setFillRule(Qt::OddEvenFill);
- newClip.addRect(clipBounds);
- newClip.addEllipse(QRect(rect));
-
- p->setClipPath(newClip, Qt::IntersectClip);
+ if (p->hasClipping()) {
+ newClip.addRect(p->clipPath().boundingRect());
+ newClip.addEllipse(QRect(rect));
+ p->setClipPath(newClip, Qt::IntersectClip);
+ } else {
+ QRect clipOutRect(rect);
+ QRect window(p->window());
+ clipOutRect &= window;
+ newClip.addRect(window);
+ newClip.addEllipse(clipOutRect);
+ p->setClipPath(newClip);
+ }
}
void GraphicsContext::clipToImageBuffer(const FloatRect&, const ImageBuffer*)
--
WebKit Debian packaging
More information about the Pkg-webkit-commits
mailing list