| 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 358 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 369 { | 369 { |
| 370 SkAutoCanvasRestore ar(canvas, false); | 370 SkAutoCanvasRestore ar(canvas, false); |
| 371 if (drawNeedsLayer(paint)) { | 371 if (drawNeedsLayer(paint)) { |
| 372 SkRect layerRect = dstRect; | 372 SkRect layerRect = dstRect; |
| 373 canvas->saveLayer(&layerRect, &paint); | 373 canvas->saveLayer(&layerRect, &paint); |
| 374 } | 374 } |
| 375 RefPtr<const SkPicture> recording = imagePicture.endRecording(); | 375 RefPtr<const SkPicture> recording = imagePicture.endRecording(); |
| 376 canvas->drawPicture(recording.get()); | 376 canvas->drawPicture(recording.get()); |
| 377 } | 377 } |
| 378 | 378 |
| 379 if (imageObserver()) | 379 if (getImageObserver()) |
| 380 imageObserver()->didDraw(this); | 380 getImageObserver()->didDraw(this); |
| 381 | 381 |
| 382 // Start any (SMIL) animations if needed. This will restart or continue | 382 // Start any (SMIL) animations if needed. This will restart or continue |
| 383 // animations if preceded by calls to resetAnimation or stopAnimation | 383 // animations if preceded by calls to resetAnimation or stopAnimation |
| 384 // respectively. | 384 // respectively. |
| 385 startAnimation(); | 385 startAnimation(); |
| 386 } | 386 } |
| 387 | 387 |
| 388 LayoutBox* SVGImage::embeddedContentBox() const | 388 LayoutBox* SVGImage::embeddedContentBox() const |
| 389 { | 389 { |
| 390 SVGSVGElement* rootElement = svgRootElement(m_page.get()); | 390 SVGSVGElement* rootElement = svgRootElement(m_page.get()); |
| (...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 438 void SVGImage::advanceAnimationForTesting() | 438 void SVGImage::advanceAnimationForTesting() |
| 439 { | 439 { |
| 440 if (SVGSVGElement* rootElement = svgRootElement(m_page.get())) { | 440 if (SVGSVGElement* rootElement = svgRootElement(m_page.get())) { |
| 441 rootElement->timeContainer()->advanceFrameForTesting(); | 441 rootElement->timeContainer()->advanceFrameForTesting(); |
| 442 | 442 |
| 443 // The following triggers animation updates which can issue a new draw | 443 // The following triggers animation updates which can issue a new draw |
| 444 // but will not permanently change the animation timeline. | 444 // but will not permanently change the animation timeline. |
| 445 // TODO(pdr): Actually advance the document timeline so CSS animations | 445 // TODO(pdr): Actually advance the document timeline so CSS animations |
| 446 // can be properly tested. | 446 // can be properly tested. |
| 447 rootElement->document().page()->animator().serviceScriptedAnimations(roo
tElement->getCurrentTime()); | 447 rootElement->document().page()->animator().serviceScriptedAnimations(roo
tElement->getCurrentTime()); |
| 448 imageObserver()->animationAdvanced(this); | 448 getImageObserver()->animationAdvanced(this); |
| 449 } | 449 } |
| 450 } | 450 } |
| 451 | 451 |
| 452 void SVGImage::updateUseCounters(Document& document) const | 452 void SVGImage::updateUseCounters(Document& document) const |
| 453 { | 453 { |
| 454 if (SVGSVGElement* rootElement = svgRootElement(m_page.get())) { | 454 if (SVGSVGElement* rootElement = svgRootElement(m_page.get())) { |
| 455 if (rootElement->timeContainer()->hasAnimations()) | 455 if (rootElement->timeContainer()->hasAnimations()) |
| 456 Deprecation::countDeprecation(document, UseCounter::SVGSMILAnimation
InImageRegardlessOfCache); | 456 Deprecation::countDeprecation(document, UseCounter::SVGSMILAnimation
InImageRegardlessOfCache); |
| 457 } | 457 } |
| 458 } | 458 } |
| (...skipping 80 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 539 | 539 |
| 540 return m_page; | 540 return m_page; |
| 541 } | 541 } |
| 542 | 542 |
| 543 String SVGImage::filenameExtension() const | 543 String SVGImage::filenameExtension() const |
| 544 { | 544 { |
| 545 return "svg"; | 545 return "svg"; |
| 546 } | 546 } |
| 547 | 547 |
| 548 } // namespace blink | 548 } // namespace blink |
| OLD | NEW |