Revert of Rename WebAnimation to WebCompositorAnimation (patchset #5 of...

Revert of Rename WebAnimation to WebCompositorAnimation (patchset #5 of https://codereview.chromium.org/412123002/)

Reason for revert:
BUG=402897

TBR=samli@chromium.org, jochen@chromium.org, vollick@chromium.org

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
parent 9a666be4
...@@ -35,7 +35,7 @@ ...@@ -35,7 +35,7 @@
#include "platform/transforms/ScaleTransformOperation.h" #include "platform/transforms/ScaleTransformOperation.h"
#include "platform/transforms/TransformOperations.h" #include "platform/transforms/TransformOperations.h"
#include "platform/transforms/TranslateTransformOperation.h" #include "platform/transforms/TranslateTransformOperation.h"
#include "public/platform/WebCompositorAnimation.h" #include "public/platform/WebAnimation.h"
#include "public/platform/WebFilterOperations.h" #include "public/platform/WebFilterOperations.h"
#include "public/platform/WebTransformOperations.h" #include "public/platform/WebTransformOperations.h"
#include "wtf/RefPtr.h" #include "wtf/RefPtr.h"
......
...@@ -43,7 +43,7 @@ ...@@ -43,7 +43,7 @@
#include "core/rendering/compositing/CompositedLayerMapping.h" #include "core/rendering/compositing/CompositedLayerMapping.h"
#include "platform/geometry/FloatBox.h" #include "platform/geometry/FloatBox.h"
#include "public/platform/Platform.h" #include "public/platform/Platform.h"
#include "public/platform/WebCompositorAnimation.h" #include "public/platform/WebAnimation.h"
#include "public/platform/WebCompositorSupport.h" #include "public/platform/WebCompositorSupport.h"
#include "public/platform/WebFilterAnimationCurve.h" #include "public/platform/WebFilterAnimationCurve.h"
#include "public/platform/WebFilterKeyframe.h" #include "public/platform/WebFilterKeyframe.h"
...@@ -257,7 +257,7 @@ bool CompositorAnimations::startAnimationOnCompositor(const Element& element, do ...@@ -257,7 +257,7 @@ bool CompositorAnimations::startAnimationOnCompositor(const Element& element, do
RenderLayer* layer = toRenderBoxModelObject(element.renderer())->layer(); RenderLayer* layer = toRenderBoxModelObject(element.renderer())->layer();
ASSERT(layer); ASSERT(layer);
Vector<OwnPtr<WebCompositorAnimation> > animations; Vector<OwnPtr<blink::WebAnimation> > animations;
CompositorAnimationsImpl::getAnimationOnCompositor(timing, startTime, keyframeEffect, animations); CompositorAnimationsImpl::getAnimationOnCompositor(timing, startTime, keyframeEffect, animations);
ASSERT(!animations.isEmpty()); ASSERT(!animations.isEmpty());
for (size_t i = 0; i < animations.size(); ++i) { for (size_t i = 0; i < animations.size(); ++i) {
...@@ -366,7 +366,7 @@ void addKeyframeWithTimingFunction(PlatformAnimationCurveType& curve, const Plat ...@@ -366,7 +366,7 @@ void addKeyframeWithTimingFunction(PlatformAnimationCurveType& curve, const Plat
switch (timingFunction->type()) { switch (timingFunction->type()) {
case TimingFunction::LinearFunction: case TimingFunction::LinearFunction:
curve.add(keyframe, WebCompositorAnimationCurve::TimingFunctionTypeLinear); curve.add(keyframe, blink::WebAnimationCurve::TimingFunctionTypeLinear);
return; return;
case TimingFunction::CubicBezierFunction: { case TimingFunction::CubicBezierFunction: {
...@@ -376,19 +376,19 @@ void addKeyframeWithTimingFunction(PlatformAnimationCurveType& curve, const Plat ...@@ -376,19 +376,19 @@ void addKeyframeWithTimingFunction(PlatformAnimationCurveType& curve, const Plat
curve.add(keyframe, cubic->x1(), cubic->y1(), cubic->x2(), cubic->y2()); curve.add(keyframe, cubic->x1(), cubic->y1(), cubic->x2(), cubic->y2());
} else { } else {
WebCompositorAnimationCurve::TimingFunctionType easeType; blink::WebAnimationCurve::TimingFunctionType easeType;
switch (cubic->subType()) { switch (cubic->subType()) {
case CubicBezierTimingFunction::Ease: case CubicBezierTimingFunction::Ease:
easeType = WebCompositorAnimationCurve::TimingFunctionTypeEase; easeType = blink::WebAnimationCurve::TimingFunctionTypeEase;
break; break;
case CubicBezierTimingFunction::EaseIn: case CubicBezierTimingFunction::EaseIn:
easeType = WebCompositorAnimationCurve::TimingFunctionTypeEaseIn; easeType = blink::WebAnimationCurve::TimingFunctionTypeEaseIn;
break; break;
case CubicBezierTimingFunction::EaseOut: case CubicBezierTimingFunction::EaseOut:
easeType = WebCompositorAnimationCurve::TimingFunctionTypeEaseOut; easeType = blink::WebAnimationCurve::TimingFunctionTypeEaseOut;
break; break;
case CubicBezierTimingFunction::EaseInOut: case CubicBezierTimingFunction::EaseInOut:
easeType = WebCompositorAnimationCurve::TimingFunctionTypeEaseInOut; easeType = blink::WebAnimationCurve::TimingFunctionTypeEaseInOut;
break; break;
// Custom Bezier are handled seperately. // Custom Bezier are handled seperately.
...@@ -412,7 +412,7 @@ void addKeyframeWithTimingFunction(PlatformAnimationCurveType& curve, const Plat ...@@ -412,7 +412,7 @@ void addKeyframeWithTimingFunction(PlatformAnimationCurveType& curve, const Plat
} // namespace anoymous } // 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++) { for (size_t i = 0; i < keyframes.size(); i++) {
RefPtr<TimingFunction> reversedTimingFunction; RefPtr<TimingFunction> reversedTimingFunction;
...@@ -432,27 +432,27 @@ void CompositorAnimationsImpl::addKeyframesToCurve(WebCompositorAnimationCurve& ...@@ -432,27 +432,27 @@ void CompositorAnimationsImpl::addKeyframesToCurve(WebCompositorAnimationCurve&
const AnimatableValue* value = keyframes[i]->getAnimatableValue().get(); const AnimatableValue* value = keyframes[i]->getAnimatableValue().get();
switch (curve.type()) { switch (curve.type()) {
case WebCompositorAnimationCurve::AnimationCurveTypeFilter: { case blink::WebAnimationCurve::AnimationCurveTypeFilter: {
OwnPtr<WebFilterOperations> ops = adoptPtr(Platform::current()->compositorSupport()->createFilterOperations()); OwnPtr<blink::WebFilterOperations> ops = adoptPtr(blink::Platform::current()->compositorSupport()->createFilterOperations());
toWebFilterOperations(toAnimatableFilterOperations(value)->operations(), ops.get()); toWebFilterOperations(toAnimatableFilterOperations(value)->operations(), ops.get());
WebFilterKeyframe filterKeyframe(keyframes[i]->offset(), ops.release()); blink::WebFilterKeyframe filterKeyframe(keyframes[i]->offset(), ops.release());
WebFilterAnimationCurve* filterCurve = static_cast<WebFilterAnimationCurve*>(&curve); blink::WebFilterAnimationCurve* filterCurve = static_cast<blink::WebFilterAnimationCurve*>(&curve);
addKeyframeWithTimingFunction(*filterCurve, filterKeyframe, keyframeTimingFunction); addKeyframeWithTimingFunction(*filterCurve, filterKeyframe, keyframeTimingFunction);
break; break;
} }
case WebCompositorAnimationCurve::AnimationCurveTypeFloat: { case blink::WebAnimationCurve::AnimationCurveTypeFloat: {
WebFloatKeyframe floatKeyframe(keyframes[i]->offset(), toAnimatableDouble(value)->toDouble()); blink::WebFloatKeyframe floatKeyframe(keyframes[i]->offset(), toAnimatableDouble(value)->toDouble());
WebFloatAnimationCurve* floatCurve = static_cast<WebFloatAnimationCurve*>(&curve); blink::WebFloatAnimationCurve* floatCurve = static_cast<blink::WebFloatAnimationCurve*>(&curve);
addKeyframeWithTimingFunction(*floatCurve, floatKeyframe, keyframeTimingFunction); addKeyframeWithTimingFunction(*floatCurve, floatKeyframe, keyframeTimingFunction);
break; break;
} }
case WebCompositorAnimationCurve::AnimationCurveTypeTransform: { case blink::WebAnimationCurve::AnimationCurveTypeTransform: {
OwnPtr<WebTransformOperations> ops = adoptPtr(Platform::current()->compositorSupport()->createTransformOperations()); OwnPtr<blink::WebTransformOperations> ops = adoptPtr(blink::Platform::current()->compositorSupport()->createTransformOperations());
toWebTransformOperations(toAnimatableTransform(value)->transformOperations(), ops.get()); toWebTransformOperations(toAnimatableTransform(value)->transformOperations(), ops.get());
WebTransformKeyframe transformKeyframe(keyframes[i]->offset(), ops.release()); blink::WebTransformKeyframe transformKeyframe(keyframes[i]->offset(), ops.release());
WebTransformAnimationCurve* transformCurve = static_cast<WebTransformAnimationCurve*>(&curve); blink::WebTransformAnimationCurve* transformCurve = static_cast<blink::WebTransformAnimationCurve*>(&curve);
addKeyframeWithTimingFunction(*transformCurve, transformKeyframe, keyframeTimingFunction); addKeyframeWithTimingFunction(*transformCurve, transformKeyframe, keyframeTimingFunction);
break; break;
} }
...@@ -462,7 +462,7 @@ void CompositorAnimationsImpl::addKeyframesToCurve(WebCompositorAnimationCurve& ...@@ -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()); ASSERT(animations.isEmpty());
CompositorTiming compositorTiming; CompositorTiming compositorTiming;
...@@ -476,27 +476,27 @@ void CompositorAnimationsImpl::getAnimationOnCompositor(const Timing& timing, do ...@@ -476,27 +476,27 @@ void CompositorAnimationsImpl::getAnimationOnCompositor(const Timing& timing, do
PropertySpecificKeyframeVector values; PropertySpecificKeyframeVector values;
getKeyframeValuesForProperty(&effect, *it, compositorTiming.scaledDuration, compositorTiming.reverse, values); getKeyframeValuesForProperty(&effect, *it, compositorTiming.scaledDuration, compositorTiming.reverse, values);
WebCompositorAnimation::TargetProperty targetProperty; blink::WebAnimation::TargetProperty targetProperty;
OwnPtr<WebCompositorAnimationCurve> curve; OwnPtr<blink::WebAnimationCurve> curve;
switch (*it) { switch (*it) {
case CSSPropertyOpacity: { 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); addKeyframesToCurve(*floatCurve, values, compositorTiming.reverse);
curve = adoptPtr(floatCurve); curve = adoptPtr(floatCurve);
break; break;
} }
case CSSPropertyWebkitFilter: { case CSSPropertyWebkitFilter: {
targetProperty = WebCompositorAnimation::TargetPropertyFilter; targetProperty = blink::WebAnimation::TargetPropertyFilter;
WebFilterAnimationCurve* filterCurve = Platform::current()->compositorSupport()->createFilterAnimationCurve(); blink::WebFilterAnimationCurve* filterCurve = blink::Platform::current()->compositorSupport()->createFilterAnimationCurve();
addKeyframesToCurve(*filterCurve, values, compositorTiming.reverse); addKeyframesToCurve(*filterCurve, values, compositorTiming.reverse);
curve = adoptPtr(filterCurve); curve = adoptPtr(filterCurve);
break; break;
} }
case CSSPropertyTransform: { case CSSPropertyTransform: {
targetProperty = WebCompositorAnimation::TargetPropertyTransform; targetProperty = blink::WebAnimation::TargetPropertyTransform;
WebTransformAnimationCurve* transformCurve = Platform::current()->compositorSupport()->createTransformAnimationCurve(); blink::WebTransformAnimationCurve* transformCurve = blink::Platform::current()->compositorSupport()->createTransformAnimationCurve();
addKeyframesToCurve(*transformCurve, values, compositorTiming.reverse); addKeyframesToCurve(*transformCurve, values, compositorTiming.reverse);
curve = adoptPtr(transformCurve); curve = adoptPtr(transformCurve);
break; break;
...@@ -507,7 +507,7 @@ void CompositorAnimationsImpl::getAnimationOnCompositor(const Timing& timing, do ...@@ -507,7 +507,7 @@ void CompositorAnimationsImpl::getAnimationOnCompositor(const Timing& timing, do
} }
ASSERT(curve.get()); 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)) if (!std::isnan(startTime))
animation->setStartTime(startTime); animation->setStartTime(startTime);
......
...@@ -32,12 +32,10 @@ ...@@ -32,12 +32,10 @@
#include "core/animation/KeyframeEffectModel.h" #include "core/animation/KeyframeEffectModel.h"
#include "core/animation/Timing.h" #include "core/animation/Timing.h"
#include "platform/animation/TimingFunction.h" #include "platform/animation/TimingFunction.h"
#include "public/platform/WebCompositorAnimation.h" #include "public/platform/WebAnimation.h"
namespace blink { namespace blink {
class WebCompositorAnimationCurve;
class CompositorAnimationsImpl { class CompositorAnimationsImpl {
private: private:
struct CompositorTiming { struct CompositorTiming {
...@@ -50,9 +48,9 @@ private: ...@@ -50,9 +48,9 @@ private:
static bool convertTimingForCompositor(const Timing&, CompositorTiming& out); 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 CompositorAnimations;
friend class AnimationCompositorAnimationsTest; friend class AnimationCompositorAnimationsTest;
......
...@@ -47,11 +47,11 @@ PassOwnPtr<T> CloneToPassOwnPtr(T& o) ...@@ -47,11 +47,11 @@ PassOwnPtr<T> CloneToPassOwnPtr(T& o)
} // namespace testing } // namespace testing
// Test helpers and mocks for Web* types // Test helpers and mocks for blink::Web* types
// ----------------------------------------------------------------------- // -----------------------------------------------------------------------
namespace blink { namespace blink {
// WebFloatKeyframe is a plain struct, so we just create an == operator // blink::WebFloatKeyframe is a plain struct, so we just create an == operator
// for it. // for it.
inline bool operator==(const WebFloatKeyframe& a, const WebFloatKeyframe& b) inline bool operator==(const WebFloatKeyframe& a, const WebFloatKeyframe& b)
{ {
...@@ -65,14 +65,14 @@ inline void PrintTo(const WebFloatKeyframe& frame, ::std::ostream* os) ...@@ -65,14 +65,14 @@ inline void PrintTo(const WebFloatKeyframe& frame, ::std::ostream* os)
// ----------------------------------------------------------------------- // -----------------------------------------------------------------------
class WebCompositorAnimationMock : public WebCompositorAnimation { class WebAnimationMock : public blink::WebAnimation {
private: private:
WebCompositorAnimation::TargetProperty m_property; blink::WebAnimation::TargetProperty m_property;
public: public:
// Target Property is set through the constructor. // Target Property is set through the constructor.
WebCompositorAnimationMock(WebCompositorAnimation::TargetProperty p) : m_property(p) { } WebAnimationMock(blink::WebAnimation::TargetProperty p) : m_property(p) { }
virtual WebCompositorAnimation::TargetProperty targetProperty() const { return m_property; }; virtual blink::WebAnimation::TargetProperty targetProperty() const { return m_property; };
MOCK_METHOD0(id, int()); MOCK_METHOD0(id, int());
...@@ -89,25 +89,25 @@ public: ...@@ -89,25 +89,25 @@ public:
MOCK_METHOD1(setAlternatesDirection, void(bool)); MOCK_METHOD1(setAlternatesDirection, void(bool));
MOCK_METHOD0(delete_, void()); MOCK_METHOD0(delete_, void());
~WebCompositorAnimationMock() { delete_(); } ~WebAnimationMock() { delete_(); }
}; };
template<typename CurveType, WebCompositorAnimationCurve::AnimationCurveType CurveId, typename KeyframeType> template<typename CurveType, blink::WebAnimationCurve::AnimationCurveType CurveId, typename KeyframeType>
class WebCompositorAnimationCurveMock : public CurveType { class WebAnimationCurveMock : public CurveType {
public: public:
MOCK_METHOD1_T(add, void(const KeyframeType&)); MOCK_METHOD1_T(add, void(const KeyframeType&));
MOCK_METHOD2_T(add, void(const KeyframeType&, WebCompositorAnimationCurve::TimingFunctionType)); MOCK_METHOD2_T(add, void(const KeyframeType&, blink::WebAnimationCurve::TimingFunctionType));
MOCK_METHOD5_T(add, void(const KeyframeType&, double, double, double, double)); MOCK_METHOD5_T(add, void(const KeyframeType&, double, double, double, double));
MOCK_CONST_METHOD1_T(getValue, float(double)); // Only on WebFloatAnimationCurve, but can't hurt to have here. MOCK_CONST_METHOD1_T(getValue, float(double)); // Only on WebFloatAnimationCurve, but can't hurt to have here.
virtual WebCompositorAnimationCurve::AnimationCurveType type() const { return CurveId; }; virtual blink::WebAnimationCurve::AnimationCurveType type() const { return CurveId; };
MOCK_METHOD0(delete_, void()); MOCK_METHOD0(delete_, void());
~WebCompositorAnimationCurveMock() { delete_(); } ~WebAnimationCurveMock() { delete_(); }
}; };
typedef WebCompositorAnimationCurveMock<WebFloatAnimationCurve, WebCompositorAnimationCurve::AnimationCurveTypeFloat, WebFloatKeyframe> WebFloatAnimationCurveMock; typedef WebAnimationCurveMock<blink::WebFloatAnimationCurve, blink::WebAnimationCurve::AnimationCurveTypeFloat, blink::WebFloatKeyframe> WebFloatAnimationCurveMock;
} // namespace blink } // namespace blink
...@@ -117,39 +117,39 @@ class AnimationCompositorAnimationsTestBase : public ::testing::Test { ...@@ -117,39 +117,39 @@ class AnimationCompositorAnimationsTestBase : public ::testing::Test {
public: public:
AnimationCompositorAnimationsTestBase() : m_proxyPlatform(&m_mockCompositor) { }; AnimationCompositorAnimationsTestBase() : m_proxyPlatform(&m_mockCompositor) { };
class WebCompositorSupportMock : public WebCompositorSupport { class WebCompositorSupportMock : public blink::WebCompositorSupport {
public: public:
MOCK_METHOD3(createAnimation, WebCompositorAnimation*(const WebCompositorAnimationCurve& curve, WebCompositorAnimation::TargetProperty target, int animationId)); MOCK_METHOD3(createAnimation, blink::WebAnimation*(const blink::WebAnimationCurve& curve, blink::WebAnimation::TargetProperty target, int animationId));
MOCK_METHOD0(createFloatAnimationCurve, WebFloatAnimationCurve*()); MOCK_METHOD0(createFloatAnimationCurve, blink::WebFloatAnimationCurve*());
}; };
private: private:
class PlatformProxy : public Platform { class PlatformProxy : public blink::Platform {
public: public:
PlatformProxy(WebCompositorSupportMock** compositor) : m_compositor(compositor) { } PlatformProxy(WebCompositorSupportMock** compositor) : m_compositor(compositor) { }
virtual void cryptographicallyRandomValues(unsigned char* buffer, size_t length) { ASSERT_NOT_REACHED(); } virtual void cryptographicallyRandomValues(unsigned char* buffer, size_t length) { ASSERT_NOT_REACHED(); }
private: private:
WebCompositorSupportMock** m_compositor; WebCompositorSupportMock** m_compositor;
virtual WebCompositorSupport* compositorSupport() OVERRIDE { return *m_compositor; } virtual blink::WebCompositorSupport* compositorSupport() OVERRIDE { return *m_compositor; }
}; };
WebCompositorSupportMock* m_mockCompositor; WebCompositorSupportMock* m_mockCompositor;
PlatformProxy m_proxyPlatform; PlatformProxy m_proxyPlatform;
protected: protected:
Platform* m_platform; blink::Platform* m_platform;
virtual void SetUp() virtual void SetUp()
{ {
m_mockCompositor = 0; m_mockCompositor = 0;
m_platform = Platform::current(); m_platform = blink::Platform::current();
Platform::initialize(&m_proxyPlatform); blink::Platform::initialize(&m_proxyPlatform);
} }
virtual void TearDown() virtual void TearDown()
{ {
Platform::initialize(m_platform); blink::Platform::initialize(m_platform);
} }
void setCompositorForTesting(WebCompositorSupportMock& mock) void setCompositorForTesting(WebCompositorSupportMock& mock)
......
...@@ -38,7 +38,7 @@ ...@@ -38,7 +38,7 @@
#include "platform/scroll/ScrollableArea.h" #include "platform/scroll/ScrollableArea.h"
#include "platform/text/TextStream.h" #include "platform/text/TextStream.h"
#include "public/platform/Platform.h" #include "public/platform/Platform.h"
#include "public/platform/WebCompositorAnimation.h" #include "public/platform/WebAnimation.h"
#include "public/platform/WebCompositorSupport.h" #include "public/platform/WebCompositorSupport.h"
#include "public/platform/WebFilterOperations.h" #include "public/platform/WebFilterOperations.h"
#include "public/platform/WebFloatPoint.h" #include "public/platform/WebFloatPoint.h"
...@@ -59,7 +59,7 @@ ...@@ -59,7 +59,7 @@
#endif #endif
using blink::Platform; using blink::Platform;
using blink::WebCompositorAnimation; using blink::WebAnimation;
using blink::WebFilterOperations; using blink::WebFilterOperations;
using blink::WebLayer; using blink::WebLayer;
using blink::WebPoint; using blink::WebPoint;
...@@ -952,9 +952,9 @@ void GraphicsLayer::setContentsToNinePatch(Image* image, const IntRect& aperture ...@@ -952,9 +952,9 @@ void GraphicsLayer::setContentsToNinePatch(Image* image, const IntRect& aperture
setContentsTo(m_ninePatchLayer ? m_ninePatchLayer->layer() : 0); setContentsTo(m_ninePatchLayer ? m_ninePatchLayer->layer() : 0);
} }
bool GraphicsLayer::addAnimation(PassOwnPtr<WebCompositorAnimation> popAnimation) bool GraphicsLayer::addAnimation(PassOwnPtr<WebAnimation> popAnimation)
{ {
OwnPtr<WebCompositorAnimation> animation(popAnimation); OwnPtr<WebAnimation> animation(popAnimation);
ASSERT(animation); ASSERT(animation);
platformLayer()->setAnimationDelegate(this); platformLayer()->setAnimationDelegate(this);
...@@ -1033,13 +1033,13 @@ void GraphicsLayer::paint(GraphicsContext& context, const IntRect& clip) ...@@ -1033,13 +1033,13 @@ void GraphicsLayer::paint(GraphicsContext& context, const IntRect& clip)
} }
void GraphicsLayer::notifyAnimationStarted(double monotonicTime, WebCompositorAnimation::TargetProperty) void GraphicsLayer::notifyAnimationStarted(double monotonicTime, WebAnimation::TargetProperty)
{ {
if (m_client) if (m_client)
m_client->notifyAnimationStarted(this, monotonicTime); m_client->notifyAnimationStarted(this, monotonicTime);
} }
void GraphicsLayer::notifyAnimationFinished(double, WebCompositorAnimation::TargetProperty) void GraphicsLayer::notifyAnimationFinished(double, WebAnimation::TargetProperty)
{ {
// Do nothing. // Do nothing.
} }
......
...@@ -38,7 +38,7 @@ ...@@ -38,7 +38,7 @@
#include "platform/graphics/OpaqueRectTrackingContentLayerDelegate.h" #include "platform/graphics/OpaqueRectTrackingContentLayerDelegate.h"
#include "platform/graphics/filters/FilterOperations.h" #include "platform/graphics/filters/FilterOperations.h"
#include "platform/transforms/TransformationMatrix.h" #include "platform/transforms/TransformationMatrix.h"
#include "public/platform/WebCompositorAnimationDelegate.h" #include "public/platform/WebAnimationDelegate.h"
#include "public/platform/WebContentLayer.h" #include "public/platform/WebContentLayer.h"
#include "public/platform/WebImageLayer.h" #include "public/platform/WebImageLayer.h"
#include "public/platform/WebLayerClient.h" #include "public/platform/WebLayerClient.h"
...@@ -50,7 +50,7 @@ ...@@ -50,7 +50,7 @@
namespace blink { namespace blink {
class GraphicsLayerFactoryChromium; class GraphicsLayerFactoryChromium;
class WebCompositorAnimation; class WebAnimation;
class WebLayer; class WebLayer;
} }
...@@ -70,7 +70,7 @@ class PLATFORM_EXPORT LinkHighlightClient { ...@@ -70,7 +70,7 @@ class PLATFORM_EXPORT LinkHighlightClient {
public: public:
virtual void invalidate() = 0; virtual void invalidate() = 0;
virtual void clearCurrentGraphicsLayer() = 0; virtual void clearCurrentGraphicsLayer() = 0;
virtual WebLayer* layer() = 0; virtual blink::WebLayer* layer() = 0;
protected: protected:
virtual ~LinkHighlightClient() { } virtual ~LinkHighlightClient() { }
...@@ -81,7 +81,7 @@ typedef Vector<GraphicsLayer*, 64> GraphicsLayerVector; ...@@ -81,7 +81,7 @@ typedef Vector<GraphicsLayer*, 64> GraphicsLayerVector;
// GraphicsLayer is an abstraction for a rendering surface with backing store, // GraphicsLayer is an abstraction for a rendering surface with backing store,
// which may have associated transformation and animations. // which may have associated transformation and animations.
class PLATFORM_EXPORT GraphicsLayer : public GraphicsContextPainter, public WebCompositorAnimationDelegate, public WebLayerScrollClient, public WebLayerClient { class PLATFORM_EXPORT GraphicsLayer : public GraphicsContextPainter, public blink::WebAnimationDelegate, public blink::WebLayerScrollClient, public blink::WebLayerClient {
WTF_MAKE_NONCOPYABLE(GraphicsLayer); WTF_MAKE_FAST_ALLOCATED; WTF_MAKE_NONCOPYABLE(GraphicsLayer); WTF_MAKE_FAST_ALLOCATED;
public: public:
static PassOwnPtr<GraphicsLayer> create(GraphicsLayerFactory*, GraphicsLayerClient*); static PassOwnPtr<GraphicsLayer> create(GraphicsLayerFactory*, GraphicsLayerClient*);
...@@ -90,8 +90,8 @@ public: ...@@ -90,8 +90,8 @@ public:
GraphicsLayerClient* client() const { return m_client; } GraphicsLayerClient* client() const { return m_client; }
// WebLayerClient implementation. // blink::WebLayerClient implementation.
virtual WebGraphicsLayerDebugInfo* takeDebugInfoFor(WebLayer*) OVERRIDE; virtual blink::WebGraphicsLayerDebugInfo* takeDebugInfoFor(blink::WebLayer*) OVERRIDE;
GraphicsLayerDebugInfo& debugInfo(); GraphicsLayerDebugInfo& debugInfo();
...@@ -158,8 +158,8 @@ public: ...@@ -158,8 +158,8 @@ public:
bool contentsAreVisible() const { return m_contentsVisible; } bool contentsAreVisible() const { return m_contentsVisible; }
void setContentsVisible(bool); void setContentsVisible(bool);
void setScrollParent(WebLayer*); void setScrollParent(blink::WebLayer*);
void setClipParent(WebLayer*); void setClipParent(blink::WebLayer*);
// For special cases, e.g. drawing missing tiles on Android. // For special cases, e.g. drawing missing tiles on Android.
// The compositor should never paint this color in normal cases because the RenderLayer // The compositor should never paint this color in normal cases because the RenderLayer
...@@ -176,7 +176,7 @@ public: ...@@ -176,7 +176,7 @@ public:
float opacity() const { return m_opacity; } float opacity() const { return m_opacity; }
void setOpacity(float); void setOpacity(float);
void setBlendMode(WebBlendMode); void setBlendMode(blink::WebBlendMode);
void setIsRootForIsolatedGroup(bool); void setIsRootForIsolatedGroup(bool);
void setFilters(const FilterOperations&); void setFilters(const FilterOperations&);
...@@ -196,18 +196,18 @@ public: ...@@ -196,18 +196,18 @@ public:
// Return true if the animation is handled by the compositing system. If this returns // Return true if the animation is handled by the compositing system. If this returns
// false, the animation will be run by AnimationController. // false, the animation will be run by AnimationController.
// These methods handle both transitions and keyframe animations. // These methods handle both transitions and keyframe animations.
bool addAnimation(PassOwnPtr<WebCompositorAnimation>); bool addAnimation(PassOwnPtr<blink::WebAnimation>);
void pauseAnimation(int animationId, double /*timeOffset*/); void pauseAnimation(int animationId, double /*timeOffset*/);
void removeAnimation(int animationId); void removeAnimation(int animationId);
// Layer contents // Layer contents
void setContentsToImage(Image*); void setContentsToImage(Image*);
void setContentsToNinePatch(Image*, const IntRect& aperture); void setContentsToNinePatch(Image*, const IntRect& aperture);
void setContentsToPlatformLayer(WebLayer* layer) { setContentsTo(layer); } void setContentsToPlatformLayer(blink::WebLayer* layer) { setContentsTo(layer); }
bool hasContentsLayer() const { return m_contentsLayer; } bool hasContentsLayer() const { return m_contentsLayer; }
// For hosting this GraphicsLayer in a native layer hierarchy. // For hosting this GraphicsLayer in a native layer hierarchy.
WebLayer* platformLayer() const; blink::WebLayer* platformLayer() const;
typedef HashMap<int, int> RenderingContextMap; typedef HashMap<int, int> RenderingContextMap;
PassRefPtr<JSONObject> layerTreeAsJSON(LayerTreeFlags, RenderingContextMap&) const; PassRefPtr<JSONObject> layerTreeAsJSON(LayerTreeFlags, RenderingContextMap&) const;
...@@ -230,30 +230,30 @@ public: ...@@ -230,30 +230,30 @@ public:
void setScrollableArea(ScrollableArea*, bool isMainFrame); void setScrollableArea(ScrollableArea*, bool isMainFrame);
ScrollableArea* scrollableArea() const { return m_scrollableArea; } ScrollableArea* scrollableArea() const { return m_scrollableArea; }
WebContentLayer* contentLayer() const { return m_layer.get(); } blink::WebContentLayer* contentLayer() const { return m_layer.get(); }
static void registerContentsLayer(WebLayer*); static void registerContentsLayer(blink::WebLayer*);
static void unregisterContentsLayer(WebLayer*); static void unregisterContentsLayer(blink::WebLayer*);
// GraphicsContextPainter implementation. // GraphicsContextPainter implementation.
virtual void paint(GraphicsContext&, const IntRect& clip) OVERRIDE; virtual void paint(GraphicsContext&, const IntRect& clip) OVERRIDE;
// WebCompositorAnimationDelegate implementation. // WebAnimationDelegate implementation.
virtual void notifyAnimationStarted(double monotonicTime, WebCompositorAnimation::TargetProperty) OVERRIDE; virtual void notifyAnimationStarted(double monotonicTime, blink::WebAnimation::TargetProperty) OVERRIDE;
virtual void notifyAnimationFinished(double monotonicTime, WebCompositorAnimation::TargetProperty) OVERRIDE; virtual void notifyAnimationFinished(double monotonicTime, blink::WebAnimation::TargetProperty) OVERRIDE;
// WebLayerScrollClient implementation. // WebLayerScrollClient implementation.
virtual void didScroll() OVERRIDE; virtual void didScroll() OVERRIDE;
protected: protected:
String debugName(WebLayer*) const; String debugName(blink::WebLayer*) const;
explicit GraphicsLayer(GraphicsLayerClient*); explicit GraphicsLayer(GraphicsLayerClient*);
// GraphicsLayerFactoryChromium that wants to create a GraphicsLayer need to be friends. // GraphicsLayerFactoryChromium that wants to create a GraphicsLayer need to be friends.
friend class GraphicsLayerFactoryChromium; friend class blink::GraphicsLayerFactoryChromium;
// Exposed for tests. // Exposed for tests.
virtual WebLayer* contentsLayer() const { return m_contentsLayer; } virtual blink::WebLayer* contentsLayer() const { return m_contentsLayer; }
private: private:
// Callback from the underlying graphics system to draw layer contents. // Callback from the underlying graphics system to draw layer contents.
...@@ -276,10 +276,10 @@ private: ...@@ -276,10 +276,10 @@ private:
void updateLayerIsDrawable(); void updateLayerIsDrawable();
void updateContentsRect(); void updateContentsRect();
void setContentsTo(WebLayer*); void setContentsTo(blink::WebLayer*);
void setupContentsLayer(WebLayer*); void setupContentsLayer(blink::WebLayer*);
void clearContentsLayerIfUnregistered(); void clearContentsLayerIfUnregistered();
WebLayer* contentsLayerIfRegistered(); blink::WebLayer* contentsLayerIfRegistered();
GraphicsLayerClient* m_client; GraphicsLayerClient* m_client;
...@@ -296,7 +296,7 @@ private: ...@@ -296,7 +296,7 @@ private:
Color m_backgroundColor; Color m_backgroundColor;
float m_opacity; float m_opacity;
WebBlendMode m_blendMode; blink::WebBlendMode m_blendMode;
bool m_hasTransformOrigin : 1; bool m_hasTransformOrigin : 1;
bool m_contentsOpaque : 1; bool m_contentsOpaque : 1;
...@@ -327,10 +327,10 @@ private: ...@@ -327,10 +327,10 @@ private:
int m_paintCount; int m_paintCount;
OwnPtr<WebContentLayer> m_layer; OwnPtr<blink::WebContentLayer> m_layer;
OwnPtr<WebImageLayer> m_imageLayer; OwnPtr<blink::WebImageLayer> m_imageLayer;
OwnPtr<WebNinePatchLayer> m_ninePatchLayer; OwnPtr<blink::WebNinePatchLayer> m_ninePatchLayer;
WebLayer* m_contentsLayer; blink::WebLayer* m_contentsLayer;
// We don't have ownership of m_contentsLayer, but we do want to know if a given layer is the // We don't have ownership of m_contentsLayer, but we do want to know if a given layer is the
// same as our current layer in setContentsTo(). Since m_contentsLayer may be deleted at this point, // same as our current layer in setContentsTo(). Since m_contentsLayer may be deleted at this point,
// we stash an ID away when we know m_contentsLayer is alive and use that for comparisons from that point // we stash an ID away when we know m_contentsLayer is alive and use that for comparisons from that point
......
...@@ -101,7 +101,7 @@ TEST_F(GraphicsLayerTest, updateLayerShouldFlattenTransformWithAnimations) ...@@ -101,7 +101,7 @@ TEST_F(GraphicsLayerTest, updateLayerShouldFlattenTransformWithAnimations)
OwnPtr<WebFloatAnimationCurve> curve = adoptPtr(Platform::current()->compositorSupport()->createFloatAnimationCurve()); OwnPtr<WebFloatAnimationCurve> curve = adoptPtr(Platform::current()->compositorSupport()->createFloatAnimationCurve());
curve->add(WebFloatKeyframe(0.0, 0.0)); curve->add(WebFloatKeyframe(0.0, 0.0));
OwnPtr<WebCompositorAnimation> floatAnimation(adoptPtr(Platform::current()->compositorSupport()->createAnimation(*curve, WebCompositorAnimation::TargetPropertyOpacity))); OwnPtr<WebAnimation> floatAnimation(adoptPtr(Platform::current()->compositorSupport()->createAnimation(*curve, WebAnimation::TargetPropertyOpacity)));
int animationId = floatAnimation->id(); int animationId = floatAnimation->id();
ASSERT_TRUE(m_platformLayer->addAnimation(floatAnimation.leakPtr())); ASSERT_TRUE(m_platformLayer->addAnimation(floatAnimation.leakPtr()));
......
...@@ -38,7 +38,7 @@ void ProgrammaticScrollAnimator::animateToOffset(FloatPoint offset) ...@@ -38,7 +38,7 @@ void ProgrammaticScrollAnimator::animateToOffset(FloatPoint offset)
{ {
m_startTime = 0.0; m_startTime = 0.0;
m_targetOffset = offset; m_targetOffset = offset;
m_animationCurve = adoptPtr(Platform::current()->compositorSupport()->createScrollOffsetAnimationCurve(m_targetOffset, WebCompositorAnimationCurve::TimingFunctionTypeEaseInOut)); m_animationCurve = adoptPtr(Platform::current()->compositorSupport()->createScrollOffsetAnimationCurve(m_targetOffset, WebAnimationCurve::TimingFunctionTypeEaseInOut));
m_animationCurve->setInitialValue(FloatPoint(m_scrollableArea->scrollPosition())); m_animationCurve->setInitialValue(FloatPoint(m_scrollableArea->scrollPosition()));
if (!m_scrollableArea->scheduleAnimation()) { if (!m_scrollableArea->scheduleAnimation()) {
......
...@@ -40,7 +40,7 @@ ...@@ -40,7 +40,7 @@
#include "core/rendering/style/ShadowData.h" #include "core/rendering/style/ShadowData.h"
#include "platform/graphics/Color.h" #include "platform/graphics/Color.h"
#include "public/platform/Platform.h" #include "public/platform/Platform.h"
#include "public/platform/WebCompositorAnimationCurve.h" #include "public/platform/WebAnimationCurve.h"
#include "public/platform/WebCompositorSupport.h" #include "public/platform/WebCompositorSupport.h"
#include "public/platform/WebFloatAnimationCurve.h" #include "public/platform/WebFloatAnimationCurve.h"
#include "public/platform/WebFloatPoint.h" #include "public/platform/WebFloatPoint.h"
...@@ -289,9 +289,9 @@ void LinkHighlight::startHighlightAnimationIfNeeded() ...@@ -289,9 +289,9 @@ void LinkHighlight::startHighlightAnimationIfNeeded()
if (extraDurationRequired) if (extraDurationRequired)
curve->add(WebFloatKeyframe(extraDurationRequired, startOpacity)); curve->add(WebFloatKeyframe(extraDurationRequired, startOpacity));
// For layout tests we don't fade out. // For layout tests we don't fade out.
curve->add(WebFloatKeyframe(fadeDuration + extraDurationRequired, layoutTestMode() ? startOpacity : 0)); curve->add(WebFloatKeyframe(fadeDuration + extraDurationRequired, blink::layoutTestMode() ? startOpacity : 0));
OwnPtr<WebCompositorAnimation> animation = adoptPtr(compositorSupport->createAnimation(*curve, WebCompositorAnimation::TargetPropertyOpacity)); OwnPtr<WebAnimation> animation = adoptPtr(compositorSupport->createAnimation(*curve, WebAnimation::TargetPropertyOpacity));
m_contentLayer->layer()->setDrawsContent(true); m_contentLayer->layer()->setDrawsContent(true);
m_contentLayer->layer()->addAnimation(animation.leakPtr()); m_contentLayer->layer()->addAnimation(animation.leakPtr());
...@@ -308,11 +308,11 @@ void LinkHighlight::clearGraphicsLayerLinkHighlightPointer() ...@@ -308,11 +308,11 @@ void LinkHighlight::clearGraphicsLayerLinkHighlightPointer()
} }
} }
void LinkHighlight::notifyAnimationStarted(double, WebCompositorAnimation::TargetProperty) void LinkHighlight::notifyAnimationStarted(double, blink::WebAnimation::TargetProperty)
{ {
} }
void LinkHighlight::notifyAnimationFinished(double, WebCompositorAnimation::TargetProperty) void LinkHighlight::notifyAnimationFinished(double, blink::WebAnimation::TargetProperty)
{ {
// Since WebViewImpl may hang on to us for a while, make sure we // Since WebViewImpl may hang on to us for a while, make sure we
// release resources as soon as possible. // release resources as soon as possible.
......
...@@ -30,7 +30,7 @@ ...@@ -30,7 +30,7 @@
#include "platform/geometry/IntPoint.h" #include "platform/geometry/IntPoint.h"
#include "platform/graphics/GraphicsLayer.h" #include "platform/graphics/GraphicsLayer.h"
#include "platform/graphics/Path.h" #include "platform/graphics/Path.h"
#include "public/platform/WebCompositorAnimationDelegate.h" #include "public/platform/WebAnimationDelegate.h"
#include "public/platform/WebContentLayer.h" #include "public/platform/WebContentLayer.h"
#include "public/platform/WebContentLayerClient.h" #include "public/platform/WebContentLayerClient.h"
#include "public/platform/WebLayer.h" #include "public/platform/WebLayer.h"
...@@ -46,7 +46,7 @@ struct WebFloatRect; ...@@ -46,7 +46,7 @@ struct WebFloatRect;
struct WebRect; struct WebRect;
class WebViewImpl; class WebViewImpl;
class LinkHighlight FINAL : public WebContentLayerClient, public WebCompositorAnimationDelegate, LinkHighlightClient { class LinkHighlight FINAL : public WebContentLayerClient, public WebAnimationDelegate, blink::LinkHighlightClient {
public: public:
static PassOwnPtr<LinkHighlight> create(Node*, WebViewImpl*); static PassOwnPtr<LinkHighlight> create(Node*, WebViewImpl*);
virtual ~LinkHighlight(); virtual ~LinkHighlight();
...@@ -60,9 +60,9 @@ public: ...@@ -60,9 +60,9 @@ public:
virtual void paintContents(WebCanvas*, const WebRect& clipRect, bool canPaintLCDText, WebFloatRect& opaque, virtual void paintContents(WebCanvas*, const WebRect& clipRect, bool canPaintLCDText, WebFloatRect& opaque,
WebContentLayerClient::GraphicsContextStatus = GraphicsContextEnabled) OVERRIDE; WebContentLayerClient::GraphicsContextStatus = GraphicsContextEnabled) OVERRIDE;
// WebCompositorAnimationDelegate implementation. // WebAnimationDelegate implementation.
virtual void notifyAnimationStarted(double monotonicTime, WebCompositorAnimation::TargetProperty) OVERRIDE; virtual void notifyAnimationStarted(double monotonicTime, blink::WebAnimation::TargetProperty) OVERRIDE;
virtual void notifyAnimationFinished(double monotonicTime, WebCompositorAnimation::TargetProperty) OVERRIDE; virtual void notifyAnimationFinished(double monotonicTime, blink::WebAnimation::TargetProperty) OVERRIDE;
// LinkHighlightClient inplementation. // LinkHighlightClient inplementation.
virtual void invalidate() OVERRIDE; virtual void invalidate() OVERRIDE;
......
/*
* Copyright (C) 2012 Google Inc. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
*
* THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS'' AND ANY
* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
* DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS BE LIABLE FOR ANY
* DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
* ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#ifndef WebAnimation_h
#define WebAnimation_h
#include "WebCommon.h"
#include "WebNonCopyable.h"
#include "WebPrivateOwnPtr.h"
#if BLINK_IMPLEMENTATION
#include "wtf/Forward.h"
#endif
#define WebCompositorAnimation WebAnimation
namespace blink {
class CCActiveAnimation;
}
namespace blink {
class WebAnimationCurve;
// A compositor driven animation.
class WebAnimation {
public:
enum TargetProperty {
TargetPropertyTransform = 0,
TargetPropertyOpacity,
TargetPropertyFilter,
TargetPropertyScrollOffset
};
virtual ~WebAnimation() { }
// An id is effectively the animation's name, and it is not unique.
virtual int id() = 0;
virtual TargetProperty targetProperty() const = 0;
// This is the number of times that the animation will play. If this
// value is zero the animation will not play. If it is negative, then
// the animation will loop indefinitely.
virtual int iterations() const = 0;
virtual void setIterations(int) = 0;
virtual double startTime() const = 0;
virtual void setStartTime(double monotonicTime) = 0;
virtual double timeOffset() const = 0;
virtual void setTimeOffset(double monotonicTime) = 0;
// If alternatesDirection is true, on odd numbered iterations we reverse the curve.
virtual bool alternatesDirection() const = 0;
virtual void setAlternatesDirection(bool) = 0;
};
} // namespace blink
#endif // WebAnimation_h
/*
* Copyright (C) 2012 Google Inc. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
*
* THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS'' AND ANY
* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
* DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS BE LIABLE FOR ANY
* DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
* ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#ifndef WebAnimationCurve_h
#define WebAnimationCurve_h
#include "WebCommon.h"
#define WebCompositorAnimationCurve WebAnimationCurve
#define WEB_SCROLL_OFFSET_ANIMATION_CURVE_IS_DEFINED 1
namespace blink {
class WebAnimationCurve {
public:
virtual ~WebAnimationCurve() { }
enum TimingFunctionType {
TimingFunctionTypeEase,
TimingFunctionTypeEaseIn,
TimingFunctionTypeEaseOut,
TimingFunctionTypeEaseInOut,
TimingFunctionTypeLinear
};
enum AnimationCurveType {
AnimationCurveTypeFilter,
AnimationCurveTypeFloat,
AnimationCurveTypeScrollOffset,
AnimationCurveTypeTransform,
};
virtual AnimationCurveType type() const = 0;
};
} // namespace blink
#endif // WebAnimationCurve_h
/*
* Copyright (C) 2012 Google Inc. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
*
* THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS'' AND ANY
* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
* DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS BE LIABLE FOR ANY
* DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
* ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#ifndef WebAnimationDelegate_h
#define WebAnimationDelegate_h
#include "WebAnimation.h"
#define WebCompositorAnimationDelegate WebAnimationDelegate
#define WEB_ANIMATION_DELEGATE_TAKES_MONOTONIC_TIME 1
namespace blink {
class WebAnimationDelegate {
public:
virtual void notifyAnimationStarted(double monotonicTime, WebAnimation::TargetProperty) = 0;
virtual void notifyAnimationFinished(double monotonicTime, WebAnimation::TargetProperty) = 0;
};
} // namespace blink
#endif // WebAnimationDelegate_h
...@@ -5,42 +5,6 @@ ...@@ -5,42 +5,6 @@
#ifndef WebCompositorAnimation_h #ifndef WebCompositorAnimation_h
#define WebCompositorAnimation_h #define WebCompositorAnimation_h
namespace blink { #include "WebAnimation.h"
// A compositor driven animation.
class WebCompositorAnimation {
public:
enum TargetProperty {
TargetPropertyTransform = 0,
TargetPropertyOpacity,
TargetPropertyFilter,
TargetPropertyScrollOffset
};
virtual ~WebCompositorAnimation() { }
// An id is effectively the animation's name, and it is not unique.
virtual int id() = 0;
virtual TargetProperty targetProperty() const = 0;
// This is the number of times that the animation will play. If this
// value is zero the animation will not play. If it is negative, then
// the animation will loop indefinitely.
virtual int iterations() const = 0;
virtual void setIterations(int) = 0;
virtual double startTime() const = 0;
virtual void setStartTime(double monotonicTime) = 0;
virtual double timeOffset() const = 0;
virtual void setTimeOffset(double monotonicTime) = 0;
// If alternatesDirection is true, on odd numbered iterations we reverse the curve.
virtual bool alternatesDirection() const = 0;
virtual void setAlternatesDirection(bool) = 0;
};
} // namespace blink
#endif // WebCompositorAnimation_h #endif // WebCompositorAnimation_h
...@@ -5,32 +5,6 @@ ...@@ -5,32 +5,6 @@
#ifndef WebCompositorAnimationCurve_h #ifndef WebCompositorAnimationCurve_h
#define WebCompositorAnimationCurve_h #define WebCompositorAnimationCurve_h
#define WEB_SCROLL_OFFSET_ANIMATION_CURVE_IS_DEFINED 1 #include "WebAnimationCurve.h"
namespace blink {
class WebCompositorAnimationCurve {
public:
virtual ~WebCompositorAnimationCurve() { }
enum TimingFunctionType {
TimingFunctionTypeEase,
TimingFunctionTypeEaseIn,
TimingFunctionTypeEaseOut,
TimingFunctionTypeEaseInOut,
TimingFunctionTypeLinear
};
enum AnimationCurveType {
AnimationCurveTypeFilter,
AnimationCurveTypeFloat,
AnimationCurveTypeScrollOffset,
AnimationCurveTypeTransform,
};
virtual AnimationCurveType type() const = 0;
};
} // namespace blink
#endif // WebCompositorAnimationCurve_h #endif // WebCompositorAnimationCurve_h
...@@ -5,21 +5,7 @@ ...@@ -5,21 +5,7 @@
#ifndef WebCompositorAnimationDelegate_h #ifndef WebCompositorAnimationDelegate_h
#define WebCompositorAnimationDelegate_h #define WebCompositorAnimationDelegate_h
#include "WebCommon.h" #include "WebAnimationDelegate.h"
#include "WebCompositorAnimation.h"
#define WEB_ANIMATION_DELEGATE_TAKES_MONOTONIC_TIME 1
namespace blink {
class BLINK_PLATFORM_EXPORT WebCompositorAnimationDelegate {
public:
virtual ~WebCompositorAnimationDelegate() { }
virtual void notifyAnimationStarted(double monotonicTime, WebCompositorAnimation::TargetProperty) = 0;
virtual void notifyAnimationFinished(double monotonicTime, WebCompositorAnimation::TargetProperty) = 0;
};
} // namespace blink
#endif // WebCompositorAnimationDelegate_h #endif // WebCompositorAnimationDelegate_h
...@@ -26,9 +26,9 @@ ...@@ -26,9 +26,9 @@
#ifndef WebCompositorSupport_h #ifndef WebCompositorSupport_h
#define WebCompositorSupport_h #define WebCompositorSupport_h
#include "WebAnimation.h"
#include "WebAnimationCurve.h"
#include "WebCommon.h" #include "WebCommon.h"
#include "WebCompositorAnimation.h"
#include "WebCompositorAnimationCurve.h"
#include "WebFloatPoint.h" #include "WebFloatPoint.h"
#include "WebLayerTreeView.h" #include "WebLayerTreeView.h"
#include "WebScrollbar.h" #include "WebScrollbar.h"
...@@ -36,7 +36,7 @@ ...@@ -36,7 +36,7 @@
namespace blink { namespace blink {
class WebCompositorAnimationCurve; class WebAnimationCurve;
class WebCompositorOutputSurface; class WebCompositorOutputSurface;
class WebContentLayer; class WebContentLayer;
class WebContentLayerClient; class WebContentLayerClient;
...@@ -88,7 +88,7 @@ public: ...@@ -88,7 +88,7 @@ public:
virtual WebFloatAnimationCurve* createFloatAnimationCurve() { return 0; } virtual WebFloatAnimationCurve* createFloatAnimationCurve() { return 0; }
virtual WebScrollOffsetAnimationCurve* createScrollOffsetAnimationCurve(WebFloatPoint targetValue, WebCompositorAnimationCurve::TimingFunctionType) { return 0; } virtual WebScrollOffsetAnimationCurve* createScrollOffsetAnimationCurve(WebFloatPoint targetValue, WebAnimationCurve::TimingFunctionType) { return 0; }
virtual WebTransformAnimationCurve* createTransformAnimationCurve() { return 0; } virtual WebTransformAnimationCurve* createTransformAnimationCurve() { return 0; }
......
...@@ -31,7 +31,7 @@ ...@@ -31,7 +31,7 @@
#ifndef WebFilterAnimationCurve_h #ifndef WebFilterAnimationCurve_h
#define WebFilterAnimationCurve_h #define WebFilterAnimationCurve_h
#include "WebCompositorAnimationCurve.h" #include "WebAnimationCurve.h"
#include "WebCommon.h" #include "WebCommon.h"
#include "WebFilterKeyframe.h" #include "WebFilterKeyframe.h"
...@@ -39,7 +39,7 @@ ...@@ -39,7 +39,7 @@
namespace blink { namespace blink {
// A keyframed filter animation curve. // A keyframed filter animation curve.
class WebFilterAnimationCurve : public WebCompositorAnimationCurve { class WebFilterAnimationCurve : public WebAnimationCurve {
public: public:
virtual ~WebFilterAnimationCurve() { } virtual ~WebFilterAnimationCurve() { }
......
...@@ -25,7 +25,7 @@ ...@@ -25,7 +25,7 @@
#ifndef WebFloatAnimationCurve_h #ifndef WebFloatAnimationCurve_h
#define WebFloatAnimationCurve_h #define WebFloatAnimationCurve_h
#include "WebCompositorAnimationCurve.h" #include "WebAnimationCurve.h"
#include "WebCommon.h" #include "WebCommon.h"
#include "WebFloatKeyframe.h" #include "WebFloatKeyframe.h"
...@@ -33,7 +33,7 @@ ...@@ -33,7 +33,7 @@
namespace blink { namespace blink {
// A keyframed float animation curve. // A keyframed float animation curve.
class WebFloatAnimationCurve : public WebCompositorAnimationCurve { class WebFloatAnimationCurve : public WebAnimationCurve {
public: public:
virtual ~WebFloatAnimationCurve() { } virtual ~WebFloatAnimationCurve() { }
......
...@@ -26,10 +26,11 @@ ...@@ -26,10 +26,11 @@
#ifndef WebLayer_h #ifndef WebLayer_h
#define WebLayer_h #define WebLayer_h
#include "WebAnimation.h"
#include "WebBlendMode.h" #include "WebBlendMode.h"
#include "WebColor.h" #include "WebColor.h"
#include "WebCommon.h" #include "WebCommon.h"
#include "WebCompositorAnimation.h" #include "WebCompositorAnimationDelegate.h"
#include "WebFloatPoint3D.h" #include "WebFloatPoint3D.h"
#include "WebPoint.h" #include "WebPoint.h"
#include "WebRect.h" #include "WebRect.h"
...@@ -42,7 +43,6 @@ class SkImageFilter; ...@@ -42,7 +43,6 @@ class SkImageFilter;
namespace blink { namespace blink {
class WebCompositorAnimationDelegate;
class WebFilterOperations; class WebFilterOperations;
class WebLayerClient; class WebLayerClient;
class WebLayerScrollClient; class WebLayerScrollClient;
...@@ -132,18 +132,18 @@ public: ...@@ -132,18 +132,18 @@ public:
// stopped. The WebLayer does not take ownership of the delegate, and it is // stopped. The WebLayer does not take ownership of the delegate, and it is
// the responsibility of the client to reset the layer's delegate before // the responsibility of the client to reset the layer's delegate before
// deleting the delegate. // deleting the delegate.
virtual void setAnimationDelegate(WebCompositorAnimationDelegate*) = 0; virtual void setAnimationDelegate(WebAnimationDelegate*) = 0;
// Returns false if the animation cannot be added. // Returns false if the animation cannot be added.
// Takes ownership of the WebCompositorAnimation object. // Takes ownership of the WebAnimation object.
virtual bool addAnimation(WebCompositorAnimation*) = 0; virtual bool addAnimation(WebCompositorAnimation*) = 0;
// Removes all animations with the given id. // Removes all animations with the given id.
virtual void removeAnimation(int animationId) = 0; virtual void removeAnimation(int animationId) = 0;
// Removes all animations with the given id targeting the given property. // Removes all animations with the given id targeting the given property.
virtual void removeAnimation(int animationId, WebCompositorAnimation::TargetProperty) = 0; virtual void removeAnimation(int animationId, WebAnimation::TargetProperty) = 0;
// Pauses all animations with the given id. // Pauses all animations with the given id.
virtual void pauseAnimation(int animationId, double timeOffset) = 0; virtual void pauseAnimation(int animationId, double timeOffset) = 0;
......
...@@ -5,12 +5,12 @@ ...@@ -5,12 +5,12 @@
#ifndef WebScrollOffsetAnimationCurve_h #ifndef WebScrollOffsetAnimationCurve_h
#define WebScrollOffsetAnimationCurve_h #define WebScrollOffsetAnimationCurve_h
#include "WebCompositorAnimationCurve.h" #include "WebAnimationCurve.h"
#include "WebFloatPoint.h" #include "WebFloatPoint.h"
namespace blink { namespace blink {
class WebScrollOffsetAnimationCurve : public WebCompositorAnimationCurve { class WebScrollOffsetAnimationCurve : public WebAnimationCurve {
public: public:
virtual ~WebScrollOffsetAnimationCurve() { } virtual ~WebScrollOffsetAnimationCurve() { }
......
...@@ -25,6 +25,7 @@ ...@@ -25,6 +25,7 @@
#ifndef WebTransformAnimationCurve_h #ifndef WebTransformAnimationCurve_h
#define WebTransformAnimationCurve_h #define WebTransformAnimationCurve_h
#include "WebAnimationCurve.h"
#include "WebCommon.h" #include "WebCommon.h"
#include "WebCompositorAnimationCurve.h" #include "WebCompositorAnimationCurve.h"
#include "WebTransformKeyframe.h" #include "WebTransformKeyframe.h"
...@@ -32,7 +33,7 @@ ...@@ -32,7 +33,7 @@
namespace blink { namespace blink {
// A keyframed transform animation curve. // A keyframed transform animation curve.
class WebTransformAnimationCurve : public WebCompositorAnimationCurve { class WebTransformAnimationCurve : public WebAnimationCurve {
public: public:
virtual ~WebTransformAnimationCurve() { } virtual ~WebTransformAnimationCurve() { }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment