| 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->updateLifecycleToCompositingCleanPlusScrolling(); | 361 // TODO(crbug.com/603230): Synchronized painting is unnecessary in this
lifecycle update. |
| 362 view->updateAllLifecyclePhases(); |
| 362 view->paint(imagePicture.context(), CullRect(enclosingIntRect(srcRect)))
; | 363 view->paint(imagePicture.context(), CullRect(enclosingIntRect(srcRect)))
; |
| 363 ASSERT(!view->needsLayout()); | 364 ASSERT(!view->needsLayout()); |
| 364 } | 365 } |
| 365 | 366 |
| 366 { | 367 { |
| 367 SkAutoCanvasRestore ar(canvas, false); | 368 SkAutoCanvasRestore ar(canvas, false); |
| 368 if (drawNeedsLayer(paint)) { | 369 if (drawNeedsLayer(paint)) { |
| 369 SkRect layerRect = dstRect; | 370 SkRect layerRect = dstRect; |
| 370 canvas->saveLayer(&layerRect, &paint); | 371 canvas->saveLayer(&layerRect, &paint); |
| 371 } | 372 } |
| (...skipping 164 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 536 | 537 |
| 537 return m_page; | 538 return m_page; |
| 538 } | 539 } |
| 539 | 540 |
| 540 String SVGImage::filenameExtension() const | 541 String SVGImage::filenameExtension() const |
| 541 { | 542 { |
| 542 return "svg"; | 543 return "svg"; |
| 543 } | 544 } |
| 544 | 545 |
| 545 } // namespace blink | 546 } // namespace blink |
| OLD | NEW |