Skip to content

Commit

Permalink
Revert of Rename WebAnimation to WebCompositorAnimation (patchset #5 of
Browse files Browse the repository at this point in the history
https://codereview.chromium.org/412123002/)

Reason for revert:
BUG=402897

[email protected], [email protected], [email protected]

Original issue's description:
> Rename WebAnimation to WebCompositorAnimation
>
> Change WebAnimation to WebCompositorAnimation
> Change WebAnimationCurve to WebCompositorAnimationCurve
> Change WebAnimationDelegate to WebCompositorAnimationDelegate
>
> This is patch 3 of 3. It builds on http://crrev.com/413983002
>
> BUG=396358
>
> Committed: https://src.chromium.org/viewvc/blink?view=rev&revision=179910

Review URL: https://codereview.chromium.org/467123002

git-svn-id: svn://svn.chromium.org/blink/trunk@180155 bbb929c8-8fbe-4397-9dbb-9b2b20218538
  • Loading branch information
[email protected] committed Aug 13, 2014
1 parent 7235118 commit da69749
Show file tree
Hide file tree
Showing 23 changed files with 366 additions and 258 deletions.
2 changes: 1 addition & 1 deletion Source/core/animation/AnimationTranslationUtilTest.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@
#include "platform/transforms/ScaleTransformOperation.h"
#include "platform/transforms/TransformOperations.h"
#include "platform/transforms/TranslateTransformOperation.h"
#include "public/platform/WebCompositorAnimation.h"
#include "public/platform/WebAnimation.h"
#include "public/platform/WebFilterOperations.h"
#include "public/platform/WebTransformOperations.h"
#include "wtf/RefPtr.h"
Expand Down
60 changes: 30 additions & 30 deletions Source/core/animation/CompositorAnimations.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@
#include "core/rendering/compositing/CompositedLayerMapping.h"
#include "platform/geometry/FloatBox.h"
#include "public/platform/Platform.h"
#include "public/platform/WebCompositorAnimation.h"
#include "public/platform/WebAnimation.h"
#include "public/platform/WebCompositorSupport.h"
#include "public/platform/WebFilterAnimationCurve.h"
#include "public/platform/WebFilterKeyframe.h"
Expand Down Expand Up @@ -257,7 +257,7 @@ bool CompositorAnimations::startAnimationOnCompositor(const Element& element, do
RenderLayer* layer = toRenderBoxModelObject(element.renderer())->layer();
ASSERT(layer);

Vector<OwnPtr<WebCompositorAnimation> > animations;
Vector<OwnPtr<blink::WebAnimation> > animations;
CompositorAnimationsImpl::getAnimationOnCompositor(timing, startTime, keyframeEffect, animations);
ASSERT(!animations.isEmpty());
for (size_t i = 0; i < animations.size(); ++i) {
Expand Down Expand Up @@ -366,7 +366,7 @@ void addKeyframeWithTimingFunction(PlatformAnimationCurveType& curve, const Plat

switch (timingFunction->type()) {
case TimingFunction::LinearFunction:
curve.add(keyframe, WebCompositorAnimationCurve::TimingFunctionTypeLinear);
curve.add(keyframe, blink::WebAnimationCurve::TimingFunctionTypeLinear);
return;

case TimingFunction::CubicBezierFunction: {
Expand All @@ -376,19 +376,19 @@ void addKeyframeWithTimingFunction(PlatformAnimationCurveType& curve, const Plat
curve.add(keyframe, cubic->x1(), cubic->y1(), cubic->x2(), cubic->y2());
} else {

WebCompositorAnimationCurve::TimingFunctionType easeType;
blink::WebAnimationCurve::TimingFunctionType easeType;
switch (cubic->subType()) {
case CubicBezierTimingFunction::Ease:
easeType = WebCompositorAnimationCurve::TimingFunctionTypeEase;
easeType = blink::WebAnimationCurve::TimingFunctionTypeEase;
break;
case CubicBezierTimingFunction::EaseIn:
easeType = WebCompositorAnimationCurve::TimingFunctionTypeEaseIn;
easeType = blink::WebAnimationCurve::TimingFunctionTypeEaseIn;
break;
case CubicBezierTimingFunction::EaseOut:
easeType = WebCompositorAnimationCurve::TimingFunctionTypeEaseOut;
easeType = blink::WebAnimationCurve::TimingFunctionTypeEaseOut;
break;
case CubicBezierTimingFunction::EaseInOut:
easeType = WebCompositorAnimationCurve::TimingFunctionTypeEaseInOut;
easeType = blink::WebAnimationCurve::TimingFunctionTypeEaseInOut;
break;

// Custom Bezier are handled seperately.
Expand All @@ -412,7 +412,7 @@ void addKeyframeWithTimingFunction(PlatformAnimationCurveType& curve, const Plat

} // namespace anoymous

void CompositorAnimationsImpl::addKeyframesToCurve(WebCompositorAnimationCurve& curve, const PropertySpecificKeyframeVector& keyframes, bool reverse)
void CompositorAnimationsImpl::addKeyframesToCurve(blink::WebAnimationCurve& curve, const PropertySpecificKeyframeVector& keyframes, bool reverse)
{
for (size_t i = 0; i < keyframes.size(); i++) {
RefPtr<TimingFunction> reversedTimingFunction;
Expand All @@ -432,27 +432,27 @@ void CompositorAnimationsImpl::addKeyframesToCurve(WebCompositorAnimationCurve&
const AnimatableValue* value = keyframes[i]->getAnimatableValue().get();

switch (curve.type()) {
case WebCompositorAnimationCurve::AnimationCurveTypeFilter: {
OwnPtr<WebFilterOperations> ops = adoptPtr(Platform::current()->compositorSupport()->createFilterOperations());
case blink::WebAnimationCurve::AnimationCurveTypeFilter: {
OwnPtr<blink::WebFilterOperations> ops = adoptPtr(blink::Platform::current()->compositorSupport()->createFilterOperations());
toWebFilterOperations(toAnimatableFilterOperations(value)->operations(), ops.get());

WebFilterKeyframe filterKeyframe(keyframes[i]->offset(), ops.release());
WebFilterAnimationCurve* filterCurve = static_cast<WebFilterAnimationCurve*>(&curve);
blink::WebFilterKeyframe filterKeyframe(keyframes[i]->offset(), ops.release());
blink::WebFilterAnimationCurve* filterCurve = static_cast<blink::WebFilterAnimationCurve*>(&curve);
addKeyframeWithTimingFunction(*filterCurve, filterKeyframe, keyframeTimingFunction);
break;
}
case WebCompositorAnimationCurve::AnimationCurveTypeFloat: {
WebFloatKeyframe floatKeyframe(keyframes[i]->offset(), toAnimatableDouble(value)->toDouble());
WebFloatAnimationCurve* floatCurve = static_cast<WebFloatAnimationCurve*>(&curve);
case blink::WebAnimationCurve::AnimationCurveTypeFloat: {
blink::WebFloatKeyframe floatKeyframe(keyframes[i]->offset(), toAnimatableDouble(value)->toDouble());
blink::WebFloatAnimationCurve* floatCurve = static_cast<blink::WebFloatAnimationCurve*>(&curve);
addKeyframeWithTimingFunction(*floatCurve, floatKeyframe, keyframeTimingFunction);
break;
}
case WebCompositorAnimationCurve::AnimationCurveTypeTransform: {
OwnPtr<WebTransformOperations> ops = adoptPtr(Platform::current()->compositorSupport()->createTransformOperations());
case blink::WebAnimationCurve::AnimationCurveTypeTransform: {
OwnPtr<blink::WebTransformOperations> ops = adoptPtr(blink::Platform::current()->compositorSupport()->createTransformOperations());
toWebTransformOperations(toAnimatableTransform(value)->transformOperations(), ops.get());

WebTransformKeyframe transformKeyframe(keyframes[i]->offset(), ops.release());
WebTransformAnimationCurve* transformCurve = static_cast<WebTransformAnimationCurve*>(&curve);
blink::WebTransformKeyframe transformKeyframe(keyframes[i]->offset(), ops.release());
blink::WebTransformAnimationCurve* transformCurve = static_cast<blink::WebTransformAnimationCurve*>(&curve);
addKeyframeWithTimingFunction(*transformCurve, transformKeyframe, keyframeTimingFunction);
break;
}
Expand All @@ -462,7 +462,7 @@ void CompositorAnimationsImpl::addKeyframesToCurve(WebCompositorAnimationCurve&
}
}

void CompositorAnimationsImpl::getAnimationOnCompositor(const Timing& timing, double startTime, const KeyframeEffectModelBase& effect, Vector<OwnPtr<WebCompositorAnimation> >& animations)
void CompositorAnimationsImpl::getAnimationOnCompositor(const Timing& timing, double startTime, const KeyframeEffectModelBase& effect, Vector<OwnPtr<blink::WebAnimation> >& animations)
{
ASSERT(animations.isEmpty());
CompositorTiming compositorTiming;
Expand All @@ -476,27 +476,27 @@ void CompositorAnimationsImpl::getAnimationOnCompositor(const Timing& timing, do
PropertySpecificKeyframeVector values;
getKeyframeValuesForProperty(&effect, *it, compositorTiming.scaledDuration, compositorTiming.reverse, values);

WebCompositorAnimation::TargetProperty targetProperty;
OwnPtr<WebCompositorAnimationCurve> curve;
blink::WebAnimation::TargetProperty targetProperty;
OwnPtr<blink::WebAnimationCurve> curve;
switch (*it) {
case CSSPropertyOpacity: {
targetProperty = WebCompositorAnimation::TargetPropertyOpacity;
targetProperty = blink::WebAnimation::TargetPropertyOpacity;

WebFloatAnimationCurve* floatCurve = Platform::current()->compositorSupport()->createFloatAnimationCurve();
blink::WebFloatAnimationCurve* floatCurve = blink::Platform::current()->compositorSupport()->createFloatAnimationCurve();
addKeyframesToCurve(*floatCurve, values, compositorTiming.reverse);
curve = adoptPtr(floatCurve);
break;
}
case CSSPropertyWebkitFilter: {
targetProperty = WebCompositorAnimation::TargetPropertyFilter;
WebFilterAnimationCurve* filterCurve = Platform::current()->compositorSupport()->createFilterAnimationCurve();
targetProperty = blink::WebAnimation::TargetPropertyFilter;
blink::WebFilterAnimationCurve* filterCurve = blink::Platform::current()->compositorSupport()->createFilterAnimationCurve();
addKeyframesToCurve(*filterCurve, values, compositorTiming.reverse);
curve = adoptPtr(filterCurve);
break;
}
case CSSPropertyTransform: {
targetProperty = WebCompositorAnimation::TargetPropertyTransform;
WebTransformAnimationCurve* transformCurve = Platform::current()->compositorSupport()->createTransformAnimationCurve();
targetProperty = blink::WebAnimation::TargetPropertyTransform;
blink::WebTransformAnimationCurve* transformCurve = blink::Platform::current()->compositorSupport()->createTransformAnimationCurve();
addKeyframesToCurve(*transformCurve, values, compositorTiming.reverse);
curve = adoptPtr(transformCurve);
break;
Expand All @@ -507,7 +507,7 @@ void CompositorAnimationsImpl::getAnimationOnCompositor(const Timing& timing, do
}
ASSERT(curve.get());

OwnPtr<WebCompositorAnimation> animation = adoptPtr(Platform::current()->compositorSupport()->createAnimation(*curve, targetProperty));
OwnPtr<blink::WebAnimation> animation = adoptPtr(blink::Platform::current()->compositorSupport()->createAnimation(*curve, targetProperty));

if (!std::isnan(startTime))
animation->setStartTime(startTime);
Expand Down
8 changes: 3 additions & 5 deletions Source/core/animation/CompositorAnimationsImpl.h
Original file line number Diff line number Diff line change
Expand Up @@ -32,12 +32,10 @@
#include "core/animation/KeyframeEffectModel.h"
#include "core/animation/Timing.h"
#include "platform/animation/TimingFunction.h"
#include "public/platform/WebCompositorAnimation.h"
#include "public/platform/WebAnimation.h"

namespace blink {

class WebCompositorAnimationCurve;

class CompositorAnimationsImpl {
private:
struct CompositorTiming {
Expand All @@ -50,9 +48,9 @@ class CompositorAnimationsImpl {

static bool convertTimingForCompositor(const Timing&, CompositorTiming& out);

static void getAnimationOnCompositor(const Timing&, double startTime, const KeyframeEffectModelBase&, Vector<OwnPtr<WebCompositorAnimation> >& animations);
static void getAnimationOnCompositor(const Timing&, double startTime, const KeyframeEffectModelBase&, Vector<OwnPtr<blink::WebAnimation> >& animations);

static void addKeyframesToCurve(WebCompositorAnimationCurve&, const AnimatableValuePropertySpecificKeyframeVector&, bool reverse);
static void addKeyframesToCurve(blink::WebAnimationCurve&, const AnimatableValuePropertySpecificKeyframeVector&, bool reverse);

friend class CompositorAnimations;
friend class AnimationCompositorAnimationsTest;
Expand Down
Loading

0 comments on commit da69749

Please sign in to comment.