| 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 473 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 484 | 484 |
| 485 // serviceScriptedAnimations runs requestAnimationFrame callbacks, but SVG | 485 // serviceScriptedAnimations runs requestAnimationFrame callbacks, but SVG |
| 486 // images can't have any so we assert there's no script. | 486 // images can't have any so we assert there's no script. |
| 487 ScriptForbiddenScope forbidScript; | 487 ScriptForbiddenScope forbidScript; |
| 488 | 488 |
| 489 // The calls below may trigger GCs, so set up the required persistent | 489 // The calls below may trigger GCs, so set up the required persistent |
| 490 // reference on the ImageResource which owns this SVGImage. By transitivity, | 490 // reference on the ImageResource which owns this SVGImage. By transitivity, |
| 491 // that will keep the associated SVGImageChromeClient object alive. | 491 // that will keep the associated SVGImageChromeClient object alive. |
| 492 Persistent<ImageObserver> protect(getImageObserver()); | 492 Persistent<ImageObserver> protect(getImageObserver()); |
| 493 m_page->animator().serviceScriptedAnimations(monotonicAnimationStartTime); | 493 m_page->animator().serviceScriptedAnimations(monotonicAnimationStartTime); |
| 494 m_page->animator().updateAllLifecyclePhases( | 494 // Do *not* update the paint phase. It's critical to paint only when |
| 495 *toLocalFrame(m_page->mainFrame())); | 495 // actually generating painted output, not only for performance reasons, |
| 496 // but to preserve correct coherence of the cache of the output with |
| 497 // the needsRepaint bits of the PaintLayers in the image. |
| 498 toLocalFrame(m_page->mainFrame()) |
| 499 ->view() |
| 500 ->updateAllLifecyclePhasesExceptPaint(); |
| 496 } | 501 } |
| 497 | 502 |
| 498 void SVGImage::advanceAnimationForTesting() { | 503 void SVGImage::advanceAnimationForTesting() { |
| 499 if (SVGSVGElement* rootElement = svgRootElement(m_page.get())) { | 504 if (SVGSVGElement* rootElement = svgRootElement(m_page.get())) { |
| 500 rootElement->timeContainer()->advanceFrameForTesting(); | 505 rootElement->timeContainer()->advanceFrameForTesting(); |
| 501 | 506 |
| 502 // The following triggers animation updates which can issue a new draw | 507 // The following triggers animation updates which can issue a new draw |
| 503 // but will not permanently change the animation timeline. | 508 // but will not permanently change the animation timeline. |
| 504 // TODO(pdr): Actually advance the document timeline so CSS animations | 509 // TODO(pdr): Actually advance the document timeline so CSS animations |
| 505 // can be properly tested. | 510 // can be properly tested. |
| (...skipping 111 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 617 } | 622 } |
| 618 | 623 |
| 619 return m_page ? SizeAvailable : SizeUnavailable; | 624 return m_page ? SizeAvailable : SizeUnavailable; |
| 620 } | 625 } |
| 621 | 626 |
| 622 String SVGImage::filenameExtension() const { | 627 String SVGImage::filenameExtension() const { |
| 623 return "svg"; | 628 return "svg"; |
| 624 } | 629 } |
| 625 | 630 |
| 626 } // namespace blink | 631 } // namespace blink |
| OLD | NEW |