OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2010 Google Inc. All rights reserved. | 2 * Copyright (C) 2010 Google Inc. All rights reserved. |
3 * | 3 * |
4 * Redistribution and use in source and binary forms, with or without | 4 * Redistribution and use in source and binary forms, with or without |
5 * modification, are permitted provided that the following conditions are | 5 * modification, are permitted provided that the following conditions are |
6 * met: | 6 * met: |
7 * | 7 * |
8 * * Redistributions of source code must retain the above copyright | 8 * * Redistributions of source code must retain the above copyright |
9 * notice, this list of conditions and the following disclaimer. | 9 * notice, this list of conditions and the following disclaimer. |
10 * * Redistributions in binary form must reproduce the above | 10 * * Redistributions in binary form must reproduce the above |
(...skipping 609 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
620 | 620 |
621 void LayerChromium::resumeAnimations(double monotonicTime) | 621 void LayerChromium::resumeAnimations(double monotonicTime) |
622 { | 622 { |
623 m_layerAnimationController->resumeAnimations(monotonicTime); | 623 m_layerAnimationController->resumeAnimations(monotonicTime); |
624 setNeedsCommit(); | 624 setNeedsCommit(); |
625 } | 625 } |
626 | 626 |
627 void LayerChromium::setLayerAnimationController(PassOwnPtr<CCLayerAnimationContr
oller> layerAnimationController) | 627 void LayerChromium::setLayerAnimationController(PassOwnPtr<CCLayerAnimationContr
oller> layerAnimationController) |
628 { | 628 { |
629 m_layerAnimationController = layerAnimationController; | 629 m_layerAnimationController = layerAnimationController; |
| 630 if (m_layerAnimationController) { |
| 631 m_layerAnimationController->setClient(this); |
| 632 m_layerAnimationController->setForceSync(); |
| 633 } |
630 setNeedsCommit(); | 634 setNeedsCommit(); |
631 } | 635 } |
632 | 636 |
| 637 PassOwnPtr<CCLayerAnimationController> LayerChromium::releaseLayerAnimationContr
oller() |
| 638 { |
| 639 OwnPtr<CCLayerAnimationController> toReturn = m_layerAnimationController.rel
ease(); |
| 640 m_layerAnimationController = CCLayerAnimationController::create(this); |
| 641 return toReturn.release(); |
| 642 } |
| 643 |
633 bool LayerChromium::hasActiveAnimation() const | 644 bool LayerChromium::hasActiveAnimation() const |
634 { | 645 { |
635 return m_layerAnimationController->hasActiveAnimation(); | 646 return m_layerAnimationController->hasActiveAnimation(); |
636 } | 647 } |
637 | 648 |
638 void LayerChromium::notifyAnimationStarted(const CCAnimationEvent& event, double
wallClockTime) | 649 void LayerChromium::notifyAnimationStarted(const CCAnimationEvent& event, double
wallClockTime) |
639 { | 650 { |
640 m_layerAnimationController->notifyAnimationStarted(event); | 651 m_layerAnimationController->notifyAnimationStarted(event); |
641 m_layerAnimationDelegate->notifyAnimationStarted(wallClockTime); | 652 if (m_layerAnimationDelegate) |
| 653 m_layerAnimationDelegate->notifyAnimationStarted(wallClockTime); |
642 } | 654 } |
643 | 655 |
644 void LayerChromium::notifyAnimationFinished(double wallClockTime) | 656 void LayerChromium::notifyAnimationFinished(double wallClockTime) |
645 { | 657 { |
646 m_layerAnimationDelegate->notifyAnimationFinished(wallClockTime); | 658 m_layerAnimationDelegate->notifyAnimationFinished(wallClockTime); |
647 } | 659 } |
648 | 660 |
649 Region LayerChromium::visibleContentOpaqueRegion() const | 661 Region LayerChromium::visibleContentOpaqueRegion() const |
650 { | 662 { |
651 if (opaque()) | 663 if (opaque()) |
652 return visibleLayerRect(); | 664 return visibleLayerRect(); |
653 return Region(); | 665 return Region(); |
654 } | 666 } |
655 | 667 |
656 void sortLayers(Vector<RefPtr<LayerChromium> >::iterator, Vector<RefPtr<LayerChr
omium> >::iterator, void*) | 668 void sortLayers(Vector<RefPtr<LayerChromium> >::iterator, Vector<RefPtr<LayerChr
omium> >::iterator, void*) |
657 { | 669 { |
658 // Currently we don't use z-order to decide what to paint, so there's no nee
d to actually sort LayerChromiums. | 670 // Currently we don't use z-order to decide what to paint, so there's no nee
d to actually sort LayerChromiums. |
659 } | 671 } |
660 | 672 |
661 } | 673 } |
662 #endif // USE(ACCELERATED_COMPOSITING) | 674 #endif // USE(ACCELERATED_COMPOSITING) |
OLD | NEW |