[SCM] WebKit Debian packaging branch, debian/experimental, updated. upstream/1.3.3-9427-gc2be6fc
andreas.kling at nokia.com
andreas.kling at nokia.com
Wed Dec 22 11:19:15 UTC 2010
The following commit has been merged in the debian/experimental branch:
commit 695a296da4b8d915e3d73145ff2f3250831533df
Author: andreas.kling at nokia.com <andreas.kling at nokia.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date: Mon Jul 19 14:24:36 2010 +0000
2010-07-19 Andreas Kling <andreas.kling at nokia.com>
Reviewed by Kenneth Rohde Christiansen.
[Qt] Render shadow when drawing one canvas onto another
https://bugs.webkit.org/show_bug.cgi?id=42508
* platform/graphics/qt/StillImageQt.cpp:
(WebCore::StillImage::draw):
2010-07-19 Andreas Kling <andreas.kling at nokia.com>
Reviewed by Kenneth Rohde Christiansen.
[Qt] Render shadow when drawing one canvas onto another
https://bugs.webkit.org/show_bug.cgi?id=42508
Unskip:
- canvas/philip/tests/2d.shadow.canvas.basic.html
Reskip (bug now exposed):
- canvas/philip/tests/2d.shadow.canvas.transparent.1.html
* platform/qt/Skipped:
git-svn-id: http://svn.webkit.org/repository/webkit/trunk@63656 268f45cc-cd09-0410-ab3c-d52691b4dbfc
diff --git a/LayoutTests/ChangeLog b/LayoutTests/ChangeLog
index 1fd5a79..9e318a0 100644
--- a/LayoutTests/ChangeLog
+++ b/LayoutTests/ChangeLog
@@ -1,3 +1,18 @@
+2010-07-19 Andreas Kling <andreas.kling at nokia.com>
+
+ Reviewed by Kenneth Rohde Christiansen.
+
+ [Qt] Render shadow when drawing one canvas onto another
+ https://bugs.webkit.org/show_bug.cgi?id=42508
+
+ Unskip:
+ - canvas/philip/tests/2d.shadow.canvas.basic.html
+
+ Reskip (bug now exposed):
+ - canvas/philip/tests/2d.shadow.canvas.transparent.1.html
+
+ * platform/qt/Skipped:
+
2010-07-19 Csaba Osztrogonác <ossy at webkit.org>
Unreviewed.
diff --git a/LayoutTests/platform/qt/Skipped b/LayoutTests/platform/qt/Skipped
index b03bb8d..9c10590 100644
--- a/LayoutTests/platform/qt/Skipped
+++ b/LayoutTests/platform/qt/Skipped
@@ -5288,7 +5288,7 @@ canvas/philip/tests/2d.pattern.image.incomplete.html
canvas/philip/tests/2d.pattern.image.null.html
canvas/philip/tests/2d.pattern.image.undefined.html
canvas/philip/tests/2d.shadow.canvas.alpha.html
-canvas/philip/tests/2d.shadow.canvas.basic.html
+canvas/philip/tests/2d.shadow.canvas.transparent.1.html
canvas/philip/tests/2d.shadow.canvas.transparent.2.html
canvas/philip/tests/2d.shadow.image.alpha.html
canvas/philip/tests/2d.shadow.image.transparent.1.html
diff --git a/WebCore/ChangeLog b/WebCore/ChangeLog
index b7ae9c6..e3373fe 100644
--- a/WebCore/ChangeLog
+++ b/WebCore/ChangeLog
@@ -2,6 +2,16 @@
Reviewed by Kenneth Rohde Christiansen.
+ [Qt] Render shadow when drawing one canvas onto another
+ https://bugs.webkit.org/show_bug.cgi?id=42508
+
+ * platform/graphics/qt/StillImageQt.cpp:
+ (WebCore::StillImage::draw):
+
+2010-07-19 Andreas Kling <andreas.kling at nokia.com>
+
+ Reviewed by Kenneth Rohde Christiansen.
+
[Qt] Some composition modes fail when color has alpha zero
https://bugs.webkit.org/show_bug.cgi?id=36973
diff --git a/WebCore/platform/graphics/qt/StillImageQt.cpp b/WebCore/platform/graphics/qt/StillImageQt.cpp
index 034234d..a85d41e 100644
--- a/WebCore/platform/graphics/qt/StillImageQt.cpp
+++ b/WebCore/platform/graphics/qt/StillImageQt.cpp
@@ -67,46 +67,34 @@ void StillImage::draw(GraphicsContext* ctxt, const FloatRect& dst,
if (m_pixmap->isNull())
return;
- ctxt->save();
- ctxt->setCompositeOperation(op);
-
- // To support width or height is negative
- float sx = src.x();
- float sy = src.y();
- float sw = src.width();
- float sh = src.height();
-
- if (sw < 0) {
- sx = sx + sw;
- sw = -sw;
- }
- if (sh < 0) {
- sy = sy + sh;
- sh = -sh;
- }
+ FloatRect normalizedSrc = src.normalized();
+ FloatRect normalizedDst = dst.normalized();
- float dx = dst.x();
- float dy = dst.y();
- float dw = dst.width();
- float dh = dst.height();
+ QPainter* painter = ctxt->platformContext();
+ QPainter::CompositionMode oldCompositionMode = painter->compositionMode();
- if (dw < 0) {
- dx = dx + dw;
- dw = -dw;
- }
+ ctxt->setCompositeOperation(op);
- if (dh < 0) {
- dy = dy + dh;
- dh = -dh;
+ FloatSize shadowSize;
+ float shadowBlur;
+ Color shadowColor;
+ if (ctxt->getShadow(shadowSize, shadowBlur, shadowColor)) {
+ FloatRect shadowImageRect(normalizedDst);
+ shadowImageRect.move(shadowSize.width(), shadowSize.height());
+
+ QImage shadowImage(QSize(static_cast<int>(normalizedSrc.width()), static_cast<int>(normalizedSrc.height())), QImage::Format_ARGB32_Premultiplied);
+ QPainter p(&shadowImage);
+ p.setCompositionMode(QPainter::CompositionMode_Source);
+ p.fillRect(shadowImage.rect(), shadowColor);
+ p.setCompositionMode(QPainter::CompositionMode_DestinationIn);
+ p.drawPixmap(normalizedDst, *m_pixmap, normalizedSrc);
+ p.end();
+ painter->drawImage(shadowImageRect, shadowImage, normalizedSrc);
}
- FloatRect srcM(sx, sy, sw, sh);
- FloatRect dstM(dx, dy, dw, dh);
- QPainter* painter(ctxt->platformContext());
-
- painter->drawPixmap(dstM, *m_pixmap, srcM);
- ctxt->restore();
+ painter->drawPixmap(normalizedDst, *m_pixmap, normalizedSrc);
+ painter->setCompositionMode(oldCompositionMode);
}
}
--
WebKit Debian packaging
More information about the Pkg-webkit-commits
mailing list