Bug 1321428 - Represent scroll timeline information in the Layers API. r=mattwoodrow
MozReview-Commit-ID: BwmhOp6E5Nk
--- a/gfx/ipc/GfxMessageUtils.h
+++ b/gfx/ipc/GfxMessageUtils.h
@@ -13,16 +13,18 @@
#include "RegionBuilder.h"
#include "base/process_util.h"
#include "chrome/common/ipc_message_utils.h"
#include "gfxPoint.h"
#include "gfxRect.h"
#include "gfxTelemetry.h"
#include "gfxTypes.h"
#include "ipc/IPCMessageUtils.h"
+#include "mozilla/dom/ScrollTimelineBinding.h" // for mozilla::dom::ScrollDirection
+#include "mozilla/dom/AnimationEffectReadOnlyBinding.h" // for mozilla::dom::FillMode
#include "mozilla/gfx/Matrix.h"
#include "mozilla/layers/AsyncDragMetrics.h"
#include "mozilla/layers/CompositorOptions.h"
#include "mozilla/layers/CompositorTypes.h"
#include "mozilla/layers/GeckoContentController.h"
#include "mozilla/layers/LayerAttributes.h"
#include "mozilla/layers/LayersTypes.h"
#include "nsRect.h"
@@ -1373,11 +1375,27 @@ struct ParamTraits<mozilla::layers::Simp
aMsg->WriteBytes(&aParam, sizeof(aParam));
}
static bool Read(const Message* aMsg, PickleIterator* aIter, paramType* aResult) {
return aMsg->ReadBytesInto(aIter, aResult, sizeof(paramType));
}
};
+template <>
+struct ParamTraits<mozilla::dom::ScrollDirection>
+ : public ContiguousEnumSerializer<
+ mozilla::dom::ScrollDirection,
+ mozilla::dom::ScrollDirection::Vertical,
+ mozilla::dom::ScrollDirection::EndGuard_>
+{};
+
+template <>
+struct ParamTraits<mozilla::dom::FillMode>
+ : public ContiguousEnumSerializer<
+ mozilla::dom::FillMode,
+ mozilla::dom::FillMode::None,
+ mozilla::dom::FillMode::EndGuard_>
+{};
+
} /* namespace IPC */
#endif /* __GFXMESSAGEUTILS_H__ */
--- a/gfx/layers/ipc/LayersMessages.ipdlh
+++ b/gfx/layers/ipc/LayersMessages.ipdlh
@@ -31,16 +31,18 @@ using struct mozilla::layers::TextureInf
using mozilla::LayerMargin from "Units.h";
using mozilla::LayerPoint from "Units.h";
using mozilla::LayerCoord from "Units.h";
using mozilla::LayerSize from "Units.h";
using mozilla::LayerRect from "Units.h";
using mozilla::LayerIntRegion from "Units.h";
using mozilla::ParentLayerIntRect from "Units.h";
using mozilla::LayoutDeviceIntRect from "Units.h";
+using mozilla::dom::ScrollDirection from "mozilla/dom/ScrollTimelineBinding.h";
+using mozilla::dom::FillMode from "mozilla/dom/AnimationEffectReadOnlyBinding.h";
using mozilla::layers::ScaleMode from "mozilla/layers/LayersTypes.h";
using mozilla::layers::EventRegions from "mozilla/layers/LayersTypes.h";
using mozilla::layers::EventRegionsOverride from "mozilla/layers/LayersTypes.h";
using mozilla::layers::DiagnosticTypes from "mozilla/layers/CompositorTypes.h";
using struct mozilla::layers::ScrollMetadata from "FrameMetrics.h";
using mozilla::layers::FrameMetrics::ViewID from "FrameMetrics.h";
using mozilla::layers::LayersBackend from "mozilla/layers/LayersTypes.h";
using mozilla::layers::MaybeLayerClip from "FrameMetrics.h";
@@ -189,16 +191,30 @@ struct TransformData {
int32_t appUnitsPerDevPixel;
};
union AnimationData {
null_t;
TransformData;
};
+struct ScrollTimelineInfo {
+ ScrollDirection direction;
+ ViewID scrollFrame;
+ TimeDuration timeRange;
+ nscoord minScroll;
+ nscoord maxScroll;
+ FillMode fillMode;
+};
+
+union MaybeScrollTimelineInfo {
+ null_t;
+ ScrollTimelineInfo;
+};
+
struct Animation {
TimeStamp startTime;
TimeDuration delay;
TimeDuration endDelay;
// The value of the animation's current time at the moment it was sent to the
// compositor. This value will be used for below cases:
// 1) Animations that are play-pending. Initially these animations will have a
// null |startTime|. Once the animation is read to start (i.e. painting has
@@ -231,16 +247,19 @@ struct Animation {
// True if the animation has a fixed current time (e.g. paused and
// forward-filling animations).
bool isNotPlaying;
// The base style that animations should composite with. This is only set for
// animations with a composite mode of additive or accumulate, and only for
// the first animation in the set (i.e. the animation that is lowest in the
// stack). In all other cases the value is null_t.
Animatable baseStyle;
+ // If this is present, the animation is driven by a ScrollTimeline, and
+ // this structure contains information about that timeline.
+ MaybeScrollTimelineInfo scrollTimelineInfo;
};
struct CompositorAnimations {
Animation[] animations;
// This id is used to map the layer animations between content
// and compositor side
uint64_t id;
};