Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(80)

Side by Side Diff: third_party/WebKit/Source/core/animation/CompositorAnimations.cpp

Issue 2643283003: For SPv2, attach element to compositor animation player without a CLM. (Closed)
Patch Set: Created 3 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698