Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 /* | 1 /* |
| 2 * Copyright (C) 2013 Google Inc. All rights reserved. | 2 * Copyright (C) 2013 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 426 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 437 } | 437 } |
| 438 | 438 |
| 439 void CompositorAnimations::attachCompositedLayers(Element& element, | 439 void CompositorAnimations::attachCompositedLayers(Element& element, |
| 440 const Animation& animation) { | 440 const Animation& animation) { |
| 441 if (!animation.compositorPlayer()) | 441 if (!animation.compositorPlayer()) |
| 442 return; | 442 return; |
| 443 | 443 |
| 444 if (!element.layoutObject() || !element.layoutObject()->isBoxModelObject()) | 444 if (!element.layoutObject() || !element.layoutObject()->isBoxModelObject()) |
| 445 return; | 445 return; |
| 446 | 446 |
| 447 PaintLayer* layer = toLayoutBoxModelObject(element.layoutObject())->layer(); | 447 // Composited animations do not depend on a composited layer mapping for SPv2. |
| 448 if (!RuntimeEnabledFeatures::slimmingPaintV2Enabled()) { | |
| 449 PaintLayer* layer = toLayoutBoxModelObject(element.layoutObject())->layer(); | |
| 448 | 450 |
| 449 if (!layer || !layer->isAllowedToQueryCompositingState() || | 451 if (!layer || !layer->isAllowedToQueryCompositingState() || |
| 450 !layer->compositedLayerMapping() || | 452 !layer->compositedLayerMapping() || |
| 451 !layer->compositedLayerMapping()->mainGraphicsLayer()) | 453 !layer->compositedLayerMapping()->mainGraphicsLayer()) |
| 452 return; | 454 return; |
| 453 | 455 |
| 454 if (!layer->compositedLayerMapping()->mainGraphicsLayer()->platformLayer()) | 456 if (!layer->compositedLayerMapping()->mainGraphicsLayer()->platformLayer()) |
| 455 return; | 457 return; |
| 458 } | |
| 456 | 459 |
| 457 CompositorAnimationPlayer* compositorPlayer = animation.compositorPlayer(); | 460 CompositorAnimationPlayer* compositorPlayer = animation.compositorPlayer(); |
| 458 compositorPlayer->attachElement(createCompositorElementId( | 461 compositorPlayer->attachElement(createCompositorElementId( |
|
wkorman
2017/01/20 23:45:47
This will end up at this check:
https://cs.chro
loyso (OOO)
2017/01/24 00:48:20
cc::AnimationPlayer::animation_host_ is not nullpt
| |
| 459 DOMNodeIds::idForNode(&element), CompositorSubElementId::Primary)); | 462 DOMNodeIds::idForNode(&element), CompositorSubElementId::Primary)); |
| 460 } | 463 } |
| 461 | 464 |
| 462 bool CompositorAnimations::convertTimingForCompositor( | 465 bool CompositorAnimations::convertTimingForCompositor( |
| 463 const Timing& timing, | 466 const Timing& timing, |
| 464 double timeOffset, | 467 double timeOffset, |
| 465 CompositorTiming& out, | 468 CompositorTiming& out, |
| 466 double animationPlaybackRate) { | 469 double animationPlaybackRate) { |
| 467 timing.assertValid(); | 470 timing.assertValid(); |
| 468 | 471 |
| (...skipping 167 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 636 animation->setTimeOffset(compositorTiming.scaledTimeOffset); | 639 animation->setTimeOffset(compositorTiming.scaledTimeOffset); |
| 637 animation->setDirection(compositorTiming.direction); | 640 animation->setDirection(compositorTiming.direction); |
| 638 animation->setPlaybackRate(compositorTiming.playbackRate); | 641 animation->setPlaybackRate(compositorTiming.playbackRate); |
| 639 animation->setFillMode(compositorTiming.fillMode); | 642 animation->setFillMode(compositorTiming.fillMode); |
| 640 animations.push_back(std::move(animation)); | 643 animations.push_back(std::move(animation)); |
| 641 } | 644 } |
| 642 DCHECK(!animations.isEmpty()); | 645 DCHECK(!animations.isEmpty()); |
| 643 } | 646 } |
| 644 | 647 |
| 645 } // namespace blink | 648 } // namespace blink |
| OLD | NEW |