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 306 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
317 // instead. Returns the scale to be applied. | 317 // instead. Returns the scale to be applied. |
318 // On Linux, we don't have the problem with NativeTheme, hence we let WebKit | 318 // On Linux, we don't have the problem with NativeTheme, hence we let WebKit |
319 // do the scaling and ignore the return value. | 319 // do the scaling and ignore the return value. |
320 virtual float spoolPage(GraphicsContext& context, int pageNumber) | 320 virtual float spoolPage(GraphicsContext& context, int pageNumber) |
321 { | 321 { |
322 IntRect pageRect = m_pageRects[pageNumber]; | 322 IntRect pageRect = m_pageRects[pageNumber]; |
323 float scale = m_printedPageWidth / pageRect.width(); | 323 float scale = m_printedPageWidth / pageRect.width(); |
324 | 324 |
325 context.save(); | 325 context.save(); |
326 #if OS(POSIX) && !OS(MACOSX) | 326 #if OS(POSIX) && !OS(MACOSX) |
327 context.scale(WebCore::FloatSize(scale, scale)); | 327 context.scale(scale, scale); |
328 #endif | 328 #endif |
329 context.translate(static_cast<float>(-pageRect.x()), static_cast<float>(
-pageRect.y())); | 329 context.translate(static_cast<float>(-pageRect.x()), static_cast<float>(
-pageRect.y())); |
330 context.clip(pageRect); | 330 context.clip(pageRect); |
331 frame()->view()->paintContents(&context, pageRect); | 331 frame()->view()->paintContents(&context, pageRect); |
332 if (context.supportsURLFragments()) | 332 if (context.supportsURLFragments()) |
333 outputLinkedDestinations(context, frame()->document(), pageRect); | 333 outputLinkedDestinations(context, frame()->document(), pageRect); |
334 context.restore(); | 334 context.restore(); |
335 return scale; | 335 return scale; |
336 } | 336 } |
337 | 337 |
(...skipping 26 matching lines...) Expand all Loading... |
364 graphicsContext.restore(); | 364 graphicsContext.restore(); |
365 } | 365 } |
366 | 366 |
367 graphicsContext.save(); | 367 graphicsContext.save(); |
368 | 368 |
369 graphicsContext.translate(0, currentHeight); | 369 graphicsContext.translate(0, currentHeight); |
370 #if OS(WIN) || OS(MACOSX) | 370 #if OS(WIN) || OS(MACOSX) |
371 // Account for the disabling of scaling in spoolPage. In the context | 371 // Account for the disabling of scaling in spoolPage. In the context |
372 // of spoolAllPagesWithBoundaries the scale HAS NOT been pre-applied
. | 372 // of spoolAllPagesWithBoundaries the scale HAS NOT been pre-applied
. |
373 float scale = getPageShrink(pageIndex); | 373 float scale = getPageShrink(pageIndex); |
374 graphicsContext.scale(WebCore::FloatSize(scale, scale)); | 374 graphicsContext.scale(scale, scale); |
375 #endif | 375 #endif |
376 spoolPage(graphicsContext, pageIndex); | 376 spoolPage(graphicsContext, pageIndex); |
377 graphicsContext.restore(); | 377 graphicsContext.restore(); |
378 | 378 |
379 currentHeight += pageSizeInPixels.height() + 1; | 379 currentHeight += pageSizeInPixels.height() + 1; |
380 } | 380 } |
381 } | 381 } |
382 | 382 |
383 virtual void computePageRects(const FloatRect& printRect, float headerHeight
, float footerHeight, float userScaleFactor, float& outPageHeight) | 383 virtual void computePageRects(const FloatRect& printRect, float headerHeight
, float footerHeight, float userScaleFactor, float& outPageHeight) |
384 { | 384 { |
(...skipping 1537 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1922 | 1922 |
1923 void WebLocalFrameImpl::invalidateAll() const | 1923 void WebLocalFrameImpl::invalidateAll() const |
1924 { | 1924 { |
1925 ASSERT(frame() && frame()->view()); | 1925 ASSERT(frame() && frame()->view()); |
1926 FrameView* view = frame()->view(); | 1926 FrameView* view = frame()->view(); |
1927 view->invalidateRect(view->frameRect()); | 1927 view->invalidateRect(view->frameRect()); |
1928 invalidateScrollbar(); | 1928 invalidateScrollbar(); |
1929 } | 1929 } |
1930 | 1930 |
1931 } // namespace blink | 1931 } // namespace blink |
OLD | NEW |