Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1015)

Unified Diff: third_party/WebKit/WebKit/chromium/src/WebFrameImpl.cpp

Issue 1520014: Linux: fix printing somewhat.... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 10 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « printing/pdf_ps_metafile_cairo_unittest.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/WebKit/chromium/src/WebFrameImpl.cpp
===================================================================
--- third_party/WebKit/WebKit/chromium/src/WebFrameImpl.cpp (revision 57160)
+++ third_party/WebKit/WebKit/chromium/src/WebFrameImpl.cpp (working copy)
@@ -288,15 +288,20 @@
return m_printedPageWidth / pageRect.width();
}
- // Spools the printed page, a subrect of m_frame. Skip the scale step.
+ // Spools the printed page, a subrect of m_frame. Skip the scale step.
// NativeTheme doesn't play well with scaling. Scaling is done browser side
- // instead. Returns the scale to be applied.
+ // instead. Returns the scale to be applied.
+ // On Linux, we don't have the problem with NativeTheme, hence we let WebKit
+ // do the scaling and ignore the return value.
virtual float spoolPage(GraphicsContext& ctx, int pageNumber)
{
IntRect pageRect = m_pageRects[pageNumber];
float scale = m_printedPageWidth / pageRect.width();
ctx.save();
+#if OS(LINUX)
+ ctx.scale(WebCore::FloatSize(scale, scale));
+#endif
ctx.translate(static_cast<float>(-pageRect.x()),
static_cast<float>(-pageRect.y()));
ctx.clip(pageRect);
« no previous file with comments | « printing/pdf_ps_metafile_cairo_unittest.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698