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

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

Issue 2357633003: Move buildFilterOperations to FilterEffectBuilder (Closed)
Patch Set: Fold toCompositorFilterOperations 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
« no previous file with comments | « no previous file | third_party/WebKit/Source/core/paint/FilterEffectBuilder.h » ('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 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 345 matching lines...) Expand 10 before | Expand all | Expand 10 after
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 void addKeyframeToCurve(CompositorFilterAnimationCurve& curve, Keyframe::Propert ySpecificKeyframe* keyframe, 419 void addKeyframeToCurve(CompositorFilterAnimationCurve& curve, Keyframe::Propert ySpecificKeyframe* keyframe,
420 const AnimatableValue* value, const TimingFunction& keyframeTimingFunction) 420 const AnimatableValue* value, const TimingFunction& keyframeTimingFunction)
421 { 421 {
422 FilterEffectBuilder builder(nullptr, FloatRect(), 1);
422 CompositorFilterKeyframe filterKeyframe( 423 CompositorFilterKeyframe filterKeyframe(
423 keyframe->offset(), 424 keyframe->offset(),
424 toCompositorFilterOperations(toAnimatableFilterOperations(value)->operat ions()), 425 builder.buildFilterOperations(toAnimatableFilterOperations(value)->opera tions()),
425 keyframeTimingFunction); 426 keyframeTimingFunction);
426 curve.addKeyframe(filterKeyframe); 427 curve.addKeyframe(filterKeyframe);
427 } 428 }
428 429
429 void addKeyframeToCurve(CompositorFloatAnimationCurve& curve, Keyframe::Property SpecificKeyframe* keyframe, 430 void addKeyframeToCurve(CompositorFloatAnimationCurve& curve, Keyframe::Property SpecificKeyframe* keyframe,
430 const AnimatableValue* value, const TimingFunction& keyframeTimingFunction) 431 const AnimatableValue* value, const TimingFunction& keyframeTimingFunction)
431 { 432 {
432 CompositorFloatKeyframe floatKeyframe(keyframe->offset(), toAnimatableDouble (value)->toDouble(), keyframeTimingFunction); 433 CompositorFloatKeyframe floatKeyframe(keyframe->offset(), toAnimatableDouble (value)->toDouble(), keyframeTimingFunction);
433 curve.addKeyframe(floatKeyframe); 434 curve.addKeyframe(floatKeyframe);
434 } 435 }
(...skipping 101 matching lines...) Expand 10 before | Expand all | Expand 10 after
536 animation->setTimeOffset(compositorTiming.scaledTimeOffset); 537 animation->setTimeOffset(compositorTiming.scaledTimeOffset);
537 animation->setDirection(compositorTiming.direction); 538 animation->setDirection(compositorTiming.direction);
538 animation->setPlaybackRate(compositorTiming.playbackRate); 539 animation->setPlaybackRate(compositorTiming.playbackRate);
539 animation->setFillMode(compositorTiming.fillMode); 540 animation->setFillMode(compositorTiming.fillMode);
540 animations.append(std::move(animation)); 541 animations.append(std::move(animation));
541 } 542 }
542 DCHECK(!animations.isEmpty()); 543 DCHECK(!animations.isEmpty());
543 } 544 }
544 545
545 } // namespace blink 546 } // namespace blink
OLDNEW
« no previous file with comments | « no previous file | third_party/WebKit/Source/core/paint/FilterEffectBuilder.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698