Bug 1321428 - Represent scroll timeline information in the Layers API. r=mattwoodrow draft
authorBotond Ballo <botond@mozilla.com>
Fri, 02 Dec 2016 17:24:30 -0500
changeset 542199 b14c87d6d8a9e1130608bf2fbd3a6c0688855956
parent 542198 a91fa1e7f87c2da3f99c99fca678b9930b00741d
child 542200 5f1938fd2be6dfe7423c3fd66b1d2f6898f05214
push id50961
push userbballo@mozilla.com
push dateFri, 24 Mar 2017 22:03:27 +0000
reviewersmattwoodrow
bugs1321428
milestone55.0a1
Bug 1321428 - Represent scroll timeline information in the Layers API. r=mattwoodrow MozReview-Commit-ID: BwmhOp6E5Nk
gfx/ipc/GfxMessageUtils.h
gfx/layers/ipc/LayersMessages.ipdlh
--- 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;
 };