[SCM] WebKit Debian packaging branch, webkit-1.2, updated. upstream/1.1.90-6072-g9a69373
bfulgham at webkit.org
bfulgham at webkit.org
Thu Apr 8 01:39:25 UTC 2010
The following commit has been merged in the webkit-1.2 branch:
commit f83c1165a078fac623ba50ba55edc23f18841726
Author: bfulgham at webkit.org <bfulgham at webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date: Thu Feb 4 22:10:24 2010 +0000
Properly handle margin settings when printing Plugins in WinCairo.
https://bugs.webkit.org/show_bug.cgi?id=34613
Reviewed by Adam Roben.
* WebFrame.cpp:
(WebFrame::spoolPage): Adjust the GraphicsContext passed to the
paintContents method so that the World Transform is properly
positioned to account for margin settings at the time that
PluginViewWin.cpp processes the drawing operations.
git-svn-id: http://svn.webkit.org/repository/webkit/trunk@54370 268f45cc-cd09-0410-ab3c-d52691b4dbfc
diff --git a/WebKit/win/ChangeLog b/WebKit/win/ChangeLog
index 9419593..d9eeff2 100644
--- a/WebKit/win/ChangeLog
+++ b/WebKit/win/ChangeLog
@@ -2,6 +2,19 @@
Reviewed by Adam Roben.
+ Properly handle margin settings when printing Plugins in WinCairo.
+ https://bugs.webkit.org/show_bug.cgi?id=34613
+
+ * WebFrame.cpp:
+ (WebFrame::spoolPage): Adjust the GraphicsContext passed to the
+ paintContents method so that the World Transform is properly
+ positioned to account for margin settings at the time that
+ PluginViewWin.cpp processes the drawing operations.
+
+2010-02-04 Brent Fulgham <bfulgham at webkit.org>
+
+ Reviewed by Adam Roben.
+
Properly handle margin settings in WinCairo.
https://bugs.webkit.org/show_bug.cgi?id=34545
diff --git a/WebKit/win/WebFrame.cpp b/WebKit/win/WebFrame.cpp
index 3662bfe..c2c71ee 100644
--- a/WebKit/win/WebFrame.cpp
+++ b/WebKit/win/WebFrame.cpp
@@ -2075,21 +2075,28 @@ void WebFrame::spoolPage(PlatformGraphicsContext* pctx, GraphicsContext* spoolCt
const IntRect& marginRect = printerMarginRect(printDC);
cairo_save(pctx);
+ spoolCtx->save();
float scale = scaleFactor(printDC, marginRect, pageRect);
cairo_scale(pctx, scale, scale);
IntRect cairoMarginRect (marginRect);
cairoMarginRect.scale (1 / scale);
- cairo_translate(pctx, -pageRect.x() + cairoMarginRect.x(), -pageRect.y() + cairoMarginRect.y() + headerHeight);
+ // Modify Cairo and GDI World Transform to account for margin in the
+ // subsequent WebKit-controlled 'paintContents' drawing operations:
+ spoolCtx->translate(cairoMarginRect.x(), cairoMarginRect.y());
+
+ // Modify Cairo (only) to account for page position.
+ cairo_translate(pctx, -pageRect.x(), -pageRect.y() + headerHeight);
coreFrame->view()->paintContents(spoolCtx, pageRect);
- cairo_translate(pctx, pageRect.x() - cairoMarginRect.x(), pageRect.y() - cairoMarginRect.y() - headerHeight);
+ cairo_translate(pctx, pageRect.x(), pageRect.y() - headerHeight);
XFORM originalWorld;
::GetWorldTransform(printDC, &originalWorld);
- // Position world transform to account for margin
+ // Position GDI world transform to account for margin in GDI-only
+ // header/footer calls
XFORM newWorld = originalWorld;
newWorld.eDx = marginRect.x();
newWorld.eDy = marginRect.y();
@@ -2106,6 +2113,7 @@ void WebFrame::spoolPage(PlatformGraphicsContext* pctx, GraphicsContext* spoolCt
cairo_show_page(pctx);
ASSERT(!cairo_status(pctx));
+ spoolCtx->restore();
cairo_restore(pctx);
}
#endif
--
WebKit Debian packaging
More information about the Pkg-webkit-commits
mailing list