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

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

Issue 2596623002: Create compositor animations for effect animations in SPv2. (Closed)
Patch Set: Add unit tests. Created 3 years, 12 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 | third_party/WebKit/Source/core/animation/CompositorAnimationsTest.cpp » ('j') | 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 328 matching lines...) Expand 10 before | Expand all | Expand 10 after
339 attachedAnimation->affects(targetElement, CSSPropertyBackdropFilter))) 339 attachedAnimation->affects(targetElement, CSSPropertyBackdropFilter)))
340 attachedAnimation->cancelAnimationOnCompositor(); 340 attachedAnimation->cancelAnimationOnCompositor();
341 } 341 }
342 } 342 }
343 343
344 bool CompositorAnimations::canStartAnimationOnCompositor( 344 bool CompositorAnimations::canStartAnimationOnCompositor(
345 const Element& element) { 345 const Element& element) {
346 if (!Platform::current()->isThreadedAnimationEnabled()) 346 if (!Platform::current()->isThreadedAnimationEnabled())
347 return false; 347 return false;
348 348
349 if (RuntimeEnabledFeatures::slimmingPaintV2Enabled()) { 349 if (RuntimeEnabledFeatures::slimmingPaintV2Enabled()) {
pdr. 2016/12/20 23:34:18 I noticed this can be called during style recalc (
wkorman 2016/12/21 23:12:39 Good point, updated comment and filed http://crbug
350 // TODO(wkorman): Consider effect node for opacity. 350 const ObjectPaintProperties* paintProperties =
351 element.layoutObject()->paintProperties();
351 const TransformPaintPropertyNode* transformNode = 352 const TransformPaintPropertyNode* transformNode =
352 element.layoutObject()->paintProperties()->transform(); 353 paintProperties->transform();
353 return transformNode && transformNode->hasDirectCompositingReasons(); 354 const EffectPaintPropertyNode* effectNode = paintProperties->effect();
355 return (transformNode && transformNode->hasDirectCompositingReasons()) ||
356 (effectNode && effectNode->hasDirectCompositingReasons());
354 } 357 }
355 358
356 return element.layoutObject() && 359 return element.layoutObject() &&
357 element.layoutObject()->compositingState() == PaintsIntoOwnBacking; 360 element.layoutObject()->compositingState() == PaintsIntoOwnBacking;
358 } 361 }
359 362
360 void CompositorAnimations::startAnimationOnCompositor( 363 void CompositorAnimations::startAnimationOnCompositor(
361 const Element& element, 364 const Element& element,
362 int group, 365 int group,
363 double startTime, 366 double startTime,
(...skipping 261 matching lines...) Expand 10 before | Expand all | Expand 10 after
625 animation->setTimeOffset(compositorTiming.scaledTimeOffset); 628 animation->setTimeOffset(compositorTiming.scaledTimeOffset);
626 animation->setDirection(compositorTiming.direction); 629 animation->setDirection(compositorTiming.direction);
627 animation->setPlaybackRate(compositorTiming.playbackRate); 630 animation->setPlaybackRate(compositorTiming.playbackRate);
628 animation->setFillMode(compositorTiming.fillMode); 631 animation->setFillMode(compositorTiming.fillMode);
629 animations.push_back(std::move(animation)); 632 animations.push_back(std::move(animation));
630 } 633 }
631 DCHECK(!animations.isEmpty()); 634 DCHECK(!animations.isEmpty());
632 } 635 }
633 636
634 } // namespace blink 637 } // namespace blink
OLDNEW
« no previous file with comments | « no previous file | third_party/WebKit/Source/core/animation/CompositorAnimationsTest.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698