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

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

Issue 2357633003: Move buildFilterOperations to FilterEffectBuilder (Closed)
Patch Set: Element -> Node Created 4 years, 2 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
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 23 matching lines...) Expand all
34 #include "core/animation/ElementAnimations.h" 34 #include "core/animation/ElementAnimations.h"
35 #include "core/animation/KeyframeEffectModel.h" 35 #include "core/animation/KeyframeEffectModel.h"
36 #include "core/animation/animatable/AnimatableDouble.h" 36 #include "core/animation/animatable/AnimatableDouble.h"
37 #include "core/animation/animatable/AnimatableFilterOperations.h" 37 #include "core/animation/animatable/AnimatableFilterOperations.h"
38 #include "core/animation/animatable/AnimatableTransform.h" 38 #include "core/animation/animatable/AnimatableTransform.h"
39 #include "core/animation/animatable/AnimatableValue.h" 39 #include "core/animation/animatable/AnimatableValue.h"
40 #include "core/dom/DOMNodeIds.h" 40 #include "core/dom/DOMNodeIds.h"
41 #include "core/layout/LayoutBoxModelObject.h" 41 #include "core/layout/LayoutBoxModelObject.h"
42 #include "core/layout/LayoutObject.h" 42 #include "core/layout/LayoutObject.h"
43 #include "core/layout/compositing/CompositedLayerMapping.h" 43 #include "core/layout/compositing/CompositedLayerMapping.h"
44 #include "core/paint/FilterEffectBuilder.h"
44 #include "core/paint/PaintLayer.h" 45 #include "core/paint/PaintLayer.h"
45 #include "platform/animation/AnimationTranslationUtil.h" 46 #include "platform/animation/AnimationTranslationUtil.h"
46 #include "platform/animation/CompositorAnimation.h" 47 #include "platform/animation/CompositorAnimation.h"
47 #include "platform/animation/CompositorAnimationPlayer.h" 48 #include "platform/animation/CompositorAnimationPlayer.h"
48 #include "platform/animation/CompositorFilterAnimationCurve.h" 49 #include "platform/animation/CompositorFilterAnimationCurve.h"
49 #include "platform/animation/CompositorFilterKeyframe.h" 50 #include "platform/animation/CompositorFilterKeyframe.h"
50 #include "platform/animation/CompositorFloatAnimationCurve.h" 51 #include "platform/animation/CompositorFloatAnimationCurve.h"
51 #include "platform/animation/CompositorFloatKeyframe.h" 52 #include "platform/animation/CompositorFloatKeyframe.h"
52 #include "platform/animation/CompositorTransformAnimationCurve.h" 53 #include "platform/animation/CompositorTransformAnimationCurve.h"
53 #include "platform/animation/CompositorTransformKeyframe.h" 54 #include "platform/animation/CompositorTransformKeyframe.h"
54 #include "platform/geometry/FloatBox.h" 55 #include "platform/geometry/FloatBox.h"
55 #include "public/platform/Platform.h" 56 #include "public/platform/Platform.h"
56 #include "public/platform/WebCompositorSupport.h"
57 #include "wtf/PtrUtil.h" 57 #include "wtf/PtrUtil.h"
58 #include <algorithm> 58 #include <algorithm>
59 #include <cmath> 59 #include <cmath>
60 #include <memory> 60 #include <memory>
61 61
62 namespace blink { 62 namespace blink {
63 63
64 namespace { 64 namespace {
65 65
66 bool considerAnimationAsIncompatible(const Animation& animation, const Animation & animationToAdd) 66 bool considerAnimationAsIncompatible(const Animation& animation, const Animation & animationToAdd)
(...skipping 342 matching lines...) Expand 10 before | Expand all | Expand 10 after
409 DCHECK(std::isfinite(out.scaledTimeOffset)); 409 DCHECK(std::isfinite(out.scaledTimeOffset));
410 DCHECK(out.adjustedIterationCount > 0 || out.adjustedIterationCount == -1); 410 DCHECK(out.adjustedIterationCount > 0 || out.adjustedIterationCount == -1);
411 DCHECK(std::isfinite(out.playbackRate) && out.playbackRate); 411 DCHECK(std::isfinite(out.playbackRate) && out.playbackRate);
412 DCHECK_GE(out.iterationStart, 0); 412 DCHECK_GE(out.iterationStart, 0);
413 413
414 return true; 414 return true;
415 } 415 }
416 416
417 namespace { 417 namespace {
418 418
419 CompositorFilterOperations toCompositorFilterOperations(const FilterOperations& inOperations)
loyso (OOO) 2016/09/22 04:55:51 There is no need to establish this function - ther
420 {
421 FilterEffectBuilder builder(nullptr, FloatRect(), 1);
loyso (OOO) 2016/09/22 04:55:51 Can we have a dedicated ctor with no args for this
422 return builder.buildFilterOperations(inOperations);
423 }
424
419 void addKeyframeToCurve(CompositorFilterAnimationCurve& curve, Keyframe::Propert ySpecificKeyframe* keyframe, 425 void addKeyframeToCurve(CompositorFilterAnimationCurve& curve, Keyframe::Propert ySpecificKeyframe* keyframe,
420 const AnimatableValue* value, const TimingFunction& keyframeTimingFunction) 426 const AnimatableValue* value, const TimingFunction& keyframeTimingFunction)
421 { 427 {
422 CompositorFilterKeyframe filterKeyframe( 428 CompositorFilterKeyframe filterKeyframe(
423 keyframe->offset(), 429 keyframe->offset(),
424 toCompositorFilterOperations(toAnimatableFilterOperations(value)->operat ions()), 430 toCompositorFilterOperations(toAnimatableFilterOperations(value)->operat ions()),
425 keyframeTimingFunction); 431 keyframeTimingFunction);
426 curve.addKeyframe(filterKeyframe); 432 curve.addKeyframe(filterKeyframe);
427 } 433 }
428 434
(...skipping 107 matching lines...) Expand 10 before | Expand all | Expand 10 after
536 animation->setTimeOffset(compositorTiming.scaledTimeOffset); 542 animation->setTimeOffset(compositorTiming.scaledTimeOffset);
537 animation->setDirection(compositorTiming.direction); 543 animation->setDirection(compositorTiming.direction);
538 animation->setPlaybackRate(compositorTiming.playbackRate); 544 animation->setPlaybackRate(compositorTiming.playbackRate);
539 animation->setFillMode(compositorTiming.fillMode); 545 animation->setFillMode(compositorTiming.fillMode);
540 animations.append(std::move(animation)); 546 animations.append(std::move(animation));
541 } 547 }
542 DCHECK(!animations.isEmpty()); 548 DCHECK(!animations.isEmpty());
543 } 549 }
544 550
545 } // namespace blink 551 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698