| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2009 Google Inc. All rights reserved. | 2 * Copyright (C) 2009 Google Inc. All rights reserved. |
| 3 * | 3 * |
| 4 * Redistribution and use in source and binary forms, with or without | 4 * Redistribution and use in source and binary forms, with or without |
| 5 * modification, are permitted provided that the following conditions are | 5 * modification, are permitted provided that the following conditions are |
| 6 * met: | 6 * met: |
| 7 * | 7 * |
| 8 * * Redistributions of source code must retain the above copyright | 8 * * Redistributions of source code must retain the above copyright |
| 9 * notice, this list of conditions and the following disclaimer. | 9 * notice, this list of conditions and the following disclaimer. |
| 10 * * Redistributions in binary form must reproduce the above | 10 * * Redistributions in binary form must reproduce the above |
| (...skipping 270 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 281 { | 281 { |
| 282 PrintContext::end(); | 282 PrintContext::end(); |
| 283 } | 283 } |
| 284 | 284 |
| 285 virtual float getPageShrink(int pageNumber) const | 285 virtual float getPageShrink(int pageNumber) const |
| 286 { | 286 { |
| 287 IntRect pageRect = m_pageRects[pageNumber]; | 287 IntRect pageRect = m_pageRects[pageNumber]; |
| 288 return m_printedPageWidth / pageRect.width(); | 288 return m_printedPageWidth / pageRect.width(); |
| 289 } | 289 } |
| 290 | 290 |
| 291 // Spools the printed page, a subrect of m_frame. Skip the scale step. | 291 // Spools the printed page, a subrect of m_frame. Skip the scale step. |
| 292 // NativeTheme doesn't play well with scaling. Scaling is done browser side | 292 // NativeTheme doesn't play well with scaling. Scaling is done browser side |
| 293 // instead. Returns the scale to be applied. | 293 // instead. Returns the scale to be applied. |
| 294 // On Linux, we don't have the problem with NativeTheme, hence we let WebKit |
| 295 // do the scaling and ignore the return value. |
| 294 virtual float spoolPage(GraphicsContext& ctx, int pageNumber) | 296 virtual float spoolPage(GraphicsContext& ctx, int pageNumber) |
| 295 { | 297 { |
| 296 IntRect pageRect = m_pageRects[pageNumber]; | 298 IntRect pageRect = m_pageRects[pageNumber]; |
| 297 float scale = m_printedPageWidth / pageRect.width(); | 299 float scale = m_printedPageWidth / pageRect.width(); |
| 298 | 300 |
| 299 ctx.save(); | 301 ctx.save(); |
| 302 #if OS(LINUX) |
| 303 ctx.scale(WebCore::FloatSize(scale, scale)); |
| 304 #endif |
| 300 ctx.translate(static_cast<float>(-pageRect.x()), | 305 ctx.translate(static_cast<float>(-pageRect.x()), |
| 301 static_cast<float>(-pageRect.y())); | 306 static_cast<float>(-pageRect.y())); |
| 302 ctx.clip(pageRect); | 307 ctx.clip(pageRect); |
| 303 m_frame->view()->paintContents(&ctx, pageRect); | 308 m_frame->view()->paintContents(&ctx, pageRect); |
| 304 ctx.restore(); | 309 ctx.restore(); |
| 305 return scale; | 310 return scale; |
| 306 } | 311 } |
| 307 | 312 |
| 308 virtual void computePageRects(const FloatRect& printRect, float headerHeight
, float footerHeight, float userScaleFactor, float& outPageHeight) | 313 virtual void computePageRects(const FloatRect& printRect, float headerHeight
, float footerHeight, float userScaleFactor, float& outPageHeight) |
| 309 { | 314 { |
| (...skipping 1827 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2137 | 2142 |
| 2138 if (!m_frame->redirectScheduler()->locationChangePending()) { | 2143 if (!m_frame->redirectScheduler()->locationChangePending()) { |
| 2139 m_frame->loader()->stopAllLoaders(); | 2144 m_frame->loader()->stopAllLoaders(); |
| 2140 m_frame->loader()->begin(m_frame->loader()->url(), true, securityOrigin)
; | 2145 m_frame->loader()->begin(m_frame->loader()->url(), true, securityOrigin)
; |
| 2141 m_frame->loader()->write(scriptResult); | 2146 m_frame->loader()->write(scriptResult); |
| 2142 m_frame->loader()->end(); | 2147 m_frame->loader()->end(); |
| 2143 } | 2148 } |
| 2144 } | 2149 } |
| 2145 | 2150 |
| 2146 } // namespace WebKit | 2151 } // namespace WebKit |
| OLD | NEW |