| 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 340 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 351 | 351 |
| 352 // We can only draw the entire frame, clipped to the rect we want. So co
mpute where the top left | 352 // We can only draw the entire frame, clipped to the rect we want. So co
mpute where the top left |
| 353 // of the image would be if we were drawing without clipping, and transl
ate accordingly. | 353 // of the image would be if we were drawing without clipping, and transl
ate accordingly. |
| 354 FloatSize scale(dstRect.width() / srcRect.width(), dstRect.height() / sr
cRect.height()); | 354 FloatSize scale(dstRect.width() / srcRect.width(), dstRect.height() / sr
cRect.height()); |
| 355 FloatSize topLeftOffset(srcRect.location().x() * scale.width(), srcRect.
location().y() * scale.height()); | 355 FloatSize topLeftOffset(srcRect.location().x() * scale.width(), srcRect.
location().y() * scale.height()); |
| 356 FloatPoint destOffset = dstRect.location() - topLeftOffset; | 356 FloatPoint destOffset = dstRect.location() - topLeftOffset; |
| 357 AffineTransform transform = AffineTransform::translation(destOffset.x(),
destOffset.y()); | 357 AffineTransform transform = AffineTransform::translation(destOffset.x(),
destOffset.y()); |
| 358 transform.scale(scale.width(), scale.height()); | 358 transform.scale(scale.width(), scale.height()); |
| 359 TransformRecorder transformRecorder(imagePicture.context(), *this, trans
form); | 359 TransformRecorder transformRecorder(imagePicture.context(), *this, trans
form); |
| 360 | 360 |
| 361 view->updateAllLifecyclePhases(); | 361 view->updateLifecycleToCompositingCleanPlusScrolling(); |
| 362 view->paint(imagePicture.context(), CullRect(enclosingIntRect(srcRect)))
; | 362 view->paint(imagePicture.context(), CullRect(enclosingIntRect(srcRect)))
; |
| 363 ASSERT(!view->needsLayout()); | 363 ASSERT(!view->needsLayout()); |
| 364 } | 364 } |
| 365 | 365 |
| 366 { | 366 { |
| 367 SkAutoCanvasRestore ar(canvas, false); | 367 SkAutoCanvasRestore ar(canvas, false); |
| 368 if (drawNeedsLayer(paint)) { | 368 if (drawNeedsLayer(paint)) { |
| 369 SkRect layerRect = dstRect; | 369 SkRect layerRect = dstRect; |
| 370 canvas->saveLayer(&layerRect, &paint); | 370 canvas->saveLayer(&layerRect, &paint); |
| 371 } | 371 } |
| (...skipping 164 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 536 | 536 |
| 537 return m_page; | 537 return m_page; |
| 538 } | 538 } |
| 539 | 539 |
| 540 String SVGImage::filenameExtension() const | 540 String SVGImage::filenameExtension() const |
| 541 { | 541 { |
| 542 return "svg"; | 542 return "svg"; |
| 543 } | 543 } |
| 544 | 544 |
| 545 } // namespace blink | 545 } // namespace blink |
| OLD | NEW |