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 350 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
361 } | 361 } |
362 | 362 |
363 AffineTransform transform; | 363 AffineTransform transform; |
364 transform.translate(0, currentHeight); | 364 transform.translate(0, currentHeight); |
365 #if OS(WIN) || OS(MACOSX) | 365 #if OS(WIN) || OS(MACOSX) |
366 // Account for the disabling of scaling in spoolPage. In the context | 366 // Account for the disabling of scaling in spoolPage. In the context |
367 // of spoolAllPagesWithBoundaries the scale HAS NOT been pre-applied. | 367 // of spoolAllPagesWithBoundaries the scale HAS NOT been pre-applied. |
368 float scale = getPageShrink(pageIndex); | 368 float scale = getPageShrink(pageIndex); |
369 transform.scale(scale, scale); | 369 transform.scale(scale, scale); |
370 #endif | 370 #endif |
371 TransformRecorder transformRecorder(context, builder, transform); | 371 TransformRecorder transformRecorder( |
| 372 context, transform, builder.visualRect(), builder.debugName(), |
| 373 builder.paintedOutputOfObjectHasNoEffectRegardlessOfSize()); |
372 spoolPage(builder, pageIndex); | 374 spoolPage(builder, pageIndex); |
373 | 375 |
374 currentHeight += pageSizeInPixels.height() + 1; | 376 currentHeight += pageSizeInPixels.height() + 1; |
375 } | 377 } |
376 } | 378 } |
377 builder.endRecording()->playback(canvas); | 379 builder.endRecording()->playback(canvas); |
378 } | 380 } |
379 | 381 |
380 protected: | 382 protected: |
381 // Spools the printed page, a subrect of frame(). Skip the scale step. | 383 // Spools the printed page, a subrect of frame(). Skip the scale step. |
382 // NativeTheme doesn't play well with scaling. Scaling is done browser side | 384 // NativeTheme doesn't play well with scaling. Scaling is done browser side |
383 // instead. Returns the scale to be applied. | 385 // instead. Returns the scale to be applied. |
384 // On Linux, we don't have the problem with NativeTheme, hence we let WebKit | 386 // On Linux, we don't have the problem with NativeTheme, hence we let WebKit |
385 // do the scaling and ignore the return value. | 387 // do the scaling and ignore the return value. |
386 virtual float spoolPage(PaintRecordBuilder& builder, int pageNumber) { | 388 virtual float spoolPage(PaintRecordBuilder& builder, int pageNumber) { |
387 IntRect pageRect = m_pageRects[pageNumber]; | 389 IntRect pageRect = m_pageRects[pageNumber]; |
388 float scale = m_printedPageWidth / pageRect.width(); | 390 float scale = m_printedPageWidth / pageRect.width(); |
389 GraphicsContext& context = builder.context(); | 391 GraphicsContext& context = builder.context(); |
390 | 392 |
391 AffineTransform transform; | 393 AffineTransform transform; |
392 #if OS(POSIX) && !OS(MACOSX) | 394 #if OS(POSIX) && !OS(MACOSX) |
393 transform.scale(scale); | 395 transform.scale(scale); |
394 #endif | 396 #endif |
395 transform.translate(static_cast<float>(-pageRect.x()), | 397 transform.translate(static_cast<float>(-pageRect.x()), |
396 static_cast<float>(-pageRect.y())); | 398 static_cast<float>(-pageRect.y())); |
397 TransformRecorder transformRecorder(context, builder, transform); | 399 TransformRecorder transformRecorder( |
| 400 context, transform, builder.visualRect(), builder.debugName(), |
| 401 builder.paintedOutputOfObjectHasNoEffectRegardlessOfSize()); |
398 | 402 |
399 ClipRecorder clipRecorder(context, builder, DisplayItem::kClipPrintedPage, | 403 ClipRecorder clipRecorder(context, builder, DisplayItem::kClipPrintedPage, |
400 pageRect); | 404 pageRect); |
401 | 405 |
402 frame()->view()->paintContents(context, GlobalPaintNormalPhase, pageRect); | 406 frame()->view()->paintContents(context, GlobalPaintNormalPhase, pageRect); |
403 | 407 |
404 { | 408 { |
405 DrawingRecorder lineBoundaryRecorder( | 409 DrawingRecorder lineBoundaryRecorder( |
406 context, builder, DisplayItem::kPrintedContentDestinationLocations, | 410 context, builder, DisplayItem::kPrintedContentDestinationLocations, |
407 pageRect); | 411 pageRect); |
(...skipping 2003 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2411 createMarkup(startPosition, endPosition, AnnotateForInterchange, | 2415 createMarkup(startPosition, endPosition, AnnotateForInterchange, |
2412 ConvertBlocksToInlines::NotConvert, ResolveNonLocalURLs); | 2416 ConvertBlocksToInlines::NotConvert, ResolveNonLocalURLs); |
2413 } else { | 2417 } else { |
2414 clipHtml = | 2418 clipHtml = |
2415 createMarkup(endPosition, startPosition, AnnotateForInterchange, | 2419 createMarkup(endPosition, startPosition, AnnotateForInterchange, |
2416 ConvertBlocksToInlines::NotConvert, ResolveNonLocalURLs); | 2420 ConvertBlocksToInlines::NotConvert, ResolveNonLocalURLs); |
2417 } | 2421 } |
2418 } | 2422 } |
2419 | 2423 |
2420 } // namespace blink | 2424 } // namespace blink |
OLD | NEW |