| 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 291 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 302 | 302 |
| 303 // We can only draw the entire frame, clipped to the rect we want. So co
mpute where the top left | 303 // We can only draw the entire frame, clipped to the rect we want. So co
mpute where the top left |
| 304 // of the image would be if we were drawing without clipping, and transl
ate accordingly. | 304 // of the image would be if we were drawing without clipping, and transl
ate accordingly. |
| 305 FloatSize scale(dstRect.width() / srcRect.width(), dstRect.height() / sr
cRect.height()); | 305 FloatSize scale(dstRect.width() / srcRect.width(), dstRect.height() / sr
cRect.height()); |
| 306 FloatSize topLeftOffset(srcRect.location().x() * scale.width(), srcRect.
location().y() * scale.height()); | 306 FloatSize topLeftOffset(srcRect.location().x() * scale.width(), srcRect.
location().y() * scale.height()); |
| 307 FloatPoint destOffset = dstRect.location() - topLeftOffset; | 307 FloatPoint destOffset = dstRect.location() - topLeftOffset; |
| 308 AffineTransform transform = AffineTransform::translation(destOffset.x(),
destOffset.y()); | 308 AffineTransform transform = AffineTransform::translation(destOffset.x(),
destOffset.y()); |
| 309 transform.scale(scale.width(), scale.height()); | 309 transform.scale(scale.width(), scale.height()); |
| 310 TransformRecorder transformRecorder(imagePicture.context(), *this, trans
form); | 310 TransformRecorder transformRecorder(imagePicture.context(), *this, trans
form); |
| 311 | 311 |
| 312 view->updateLayoutAndStyleForPainting(); | 312 view->updateAllLifecyclePhases(); |
| 313 view->paint(&imagePicture.context(), enclosingIntRect(srcRect)); | 313 view->paint(&imagePicture.context(), enclosingIntRect(srcRect)); |
| 314 ASSERT(!view->needsLayout()); | 314 ASSERT(!view->needsLayout()); |
| 315 } | 315 } |
| 316 | 316 |
| 317 { | 317 { |
| 318 SkAutoCanvasRestore ar(canvas, false); | 318 SkAutoCanvasRestore ar(canvas, false); |
| 319 if (drawNeedsLayer(paint)) { | 319 if (drawNeedsLayer(paint)) { |
| 320 SkRect layerRect = dstRect; | 320 SkRect layerRect = dstRect; |
| 321 canvas->saveLayer(&layerRect, &paint); | 321 canvas->saveLayer(&layerRect, &paint); |
| 322 } | 322 } |
| (...skipping 160 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 483 | 483 |
| 484 return m_page; | 484 return m_page; |
| 485 } | 485 } |
| 486 | 486 |
| 487 String SVGImage::filenameExtension() const | 487 String SVGImage::filenameExtension() const |
| 488 { | 488 { |
| 489 return "svg"; | 489 return "svg"; |
| 490 } | 490 } |
| 491 | 491 |
| 492 } | 492 } |
| OLD | NEW |