Represent scroll timeline information in the Layers API
MozReview-Commit-ID: C3BgVuu3ce8
--- a/gfx/ipc/GfxMessageUtils.h
+++ b/gfx/ipc/GfxMessageUtils.h
@@ -12,16 +12,17 @@
#include "ImageTypes.h"
#include "RegionBuilder.h"
#include "base/process_util.h"
#include "chrome/common/ipc_message_utils.h"
#include "gfxPoint.h"
#include "gfxRect.h"
#include "gfxTypes.h"
#include "ipc/IPCMessageUtils.h"
+#include "mozilla/dom/ScrollTimelineBinding.h" // for mozilla::dom::ScrollDirection
#include "mozilla/gfx/Matrix.h"
#include "mozilla/layers/AsyncDragMetrics.h"
#include "mozilla/layers/CompositorTypes.h"
#include "mozilla/layers/GeckoContentController.h"
#include "mozilla/layers/LayersTypes.h"
#include "nsRect.h"
#include "nsRegion.h"
@@ -1226,11 +1227,19 @@ struct ParamTraits<mozilla::layers::Asyn
ReadParam(aMsg, aIter, &aResult->mPresShellId) &&
ReadParam(aMsg, aIter, &aResult->mDragStartSequenceNumber) &&
ReadParam(aMsg, aIter, &aResult->mScrollbarDragOffset) &&
ReadParam(aMsg, aIter, &aResult->mScrollTrack) &&
ReadParam(aMsg, aIter, &aResult->mDirection));
}
};
+template <>
+struct ParamTraits<mozilla::dom::ScrollDirection>
+ : public ContiguousEnumSerializer<
+ mozilla::dom::ScrollDirection,
+ mozilla::dom::ScrollDirection::Vertical,
+ mozilla::dom::ScrollDirection::EndGuard_>
+{};
+
} /* namespace IPC */
#endif /* __GFXMESSAGEUTILS_H__ */
--- a/gfx/layers/ipc/LayersMessages.ipdlh
+++ b/gfx/layers/ipc/LayersMessages.ipdlh
@@ -32,16 +32,17 @@ using nsCSSProperty from "nsCSSProperty.
using mozilla::dom::ScreenOrientationInternal from "mozilla/dom/ScreenOrientation.h";
using struct mozilla::layers::TextureInfo from "mozilla/layers/CompositorTypes.h";
using mozilla::LayerMargin from "Units.h";
using mozilla::LayerPoint 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::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 struct mozilla::layers::FenceHandle from "mozilla/layers/FenceUtils.h";
using mozilla::layers::LayersBackend from "mozilla/layers/LayersTypes.h";
@@ -172,16 +173,27 @@ struct TransformData {
int32_t appUnitsPerDevPixel;
};
union AnimationData {
null_t;
TransformData;
};
+struct ScrollTimelineInfo {
+ ScrollDirection direction;
+ ViewID scrollFrame;
+ TimeDuration timeRange;
+};
+
+union MaybeScrollTimelineInfo {
+ null_t;
+ ScrollTimelineInfo;
+};
+
struct Animation {
// Unlike in nsAnimationManager, this start time is at the end of the
// delay. If the delay is changed dynamically, the layer's data will
// be updated.
TimeStamp startTime;
// The value of the animation's current time at the moment it was created.
// For animations that are waiting to start, their startTime will be null.
// Once the animation is ready to start, we calculate an appropriate value
@@ -199,16 +211,19 @@ struct Animation {
float iterationStart;
// This uses the NS_STYLE_ANIMATION_DIRECTION_* constants.
int32_t direction;
nsCSSProperty property;
AnimationData data;
float playbackRate;
// This is used in the transformed progress calculation.
TimingFunction easingFunction;
+ // If this is present, the animation is driven by a ScrollTimeline, and
+ // this structure contains information about that timeline.
+ MaybeScrollTimelineInfo scrollTimelineInfo;
};
// Change a layer's attributes
struct CommonLayerAttributes {
IntRect layerBounds;
LayerIntRegion visibleRegion;
EventRegions eventRegions;
TransformMatrix transform;