| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2006 Eric Seidel <eric@webkit.org> | 2 * Copyright (C) 2006 Eric Seidel <eric@webkit.org> |
| 3 * Copyright (C) 2008, 2009 Apple Inc. All rights reserved. | 3 * Copyright (C) 2008, 2009 Apple Inc. All rights reserved. |
| 4 * Copyright (C) Research In Motion Limited 2011. All rights reserved. | 4 * Copyright (C) Research In Motion Limited 2011. All rights reserved. |
| 5 * | 5 * |
| 6 * Redistribution and use in source and binary forms, with or without | 6 * Redistribution and use in source and binary forms, with or without |
| 7 * modification, are permitted provided that the following conditions | 7 * modification, are permitted provided that the following conditions |
| 8 * are met: | 8 * are met: |
| 9 * 1. Redistributions of source code must retain the above copyright | 9 * 1. Redistributions of source code must retain the above copyright |
| 10 * notice, this list of conditions and the following disclaimer. | 10 * notice, this list of conditions and the following disclaimer. |
| (...skipping 402 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 413 // compute where the top left of the image would be if we were drawing | 413 // compute where the top left of the image would be if we were drawing |
| 414 // without clipping, and translate accordingly. | 414 // without clipping, and translate accordingly. |
| 415 FloatSize scale(dstRect.width() / srcRect.width(), | 415 FloatSize scale(dstRect.width() / srcRect.width(), |
| 416 dstRect.height() / srcRect.height()); | 416 dstRect.height() / srcRect.height()); |
| 417 FloatSize topLeftOffset(srcRect.location().x() * scale.width(), | 417 FloatSize topLeftOffset(srcRect.location().x() * scale.width(), |
| 418 srcRect.location().y() * scale.height()); | 418 srcRect.location().y() * scale.height()); |
| 419 FloatPoint destOffset = dstRect.location() - topLeftOffset; | 419 FloatPoint destOffset = dstRect.location() - topLeftOffset; |
| 420 AffineTransform transform = | 420 AffineTransform transform = |
| 421 AffineTransform::translation(destOffset.x(), destOffset.y()); | 421 AffineTransform::translation(destOffset.x(), destOffset.y()); |
| 422 transform.scale(scale.width(), scale.height()); | 422 transform.scale(scale.width(), scale.height()); |
| 423 TransformRecorder transformRecorder(builder.context(), builder, transform); | 423 TransformRecorder transformRecorder( |
| 424 builder.context(), transform, builder.visualRect(), builder.debugName(), |
| 425 builder.paintedOutputOfObjectHasNoEffectRegardlessOfSize()); |
| 424 | 426 |
| 425 view->updateAllLifecyclePhasesExceptPaint(); | 427 view->updateAllLifecyclePhasesExceptPaint(); |
| 426 view->paint(builder.context(), CullRect(enclosingIntRect(srcRect))); | 428 view->paint(builder.context(), CullRect(enclosingIntRect(srcRect))); |
| 427 ASSERT(!view->needsLayout()); | 429 ASSERT(!view->needsLayout()); |
| 428 } | 430 } |
| 429 | 431 |
| 430 { | 432 { |
| 431 PaintCanvasAutoRestore ar(canvas, false); | 433 PaintCanvasAutoRestore ar(canvas, false); |
| 432 if (drawNeedsLayer(flags)) { | 434 if (drawNeedsLayer(flags)) { |
| 433 SkRect layerRect = dstRect; | 435 SkRect layerRect = dstRect; |
| (...skipping 218 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 652 } | 654 } |
| 653 | 655 |
| 654 return m_page ? SizeAvailable : SizeUnavailable; | 656 return m_page ? SizeAvailable : SizeUnavailable; |
| 655 } | 657 } |
| 656 | 658 |
| 657 String SVGImage::filenameExtension() const { | 659 String SVGImage::filenameExtension() const { |
| 658 return "svg"; | 660 return "svg"; |
| 659 } | 661 } |
| 660 | 662 |
| 661 } // namespace blink | 663 } // namespace blink |
| OLD | NEW |