Bug 1410334 - Add new WrAnimationProperty, r?kats
Store the animation id and the animation effect type
MozReview-Commit-ID: 10Zxy5vJV1X
--- a/gfx/webrender_bindings/src/bindings.rs
+++ b/gfx/webrender_bindings/src/bindings.rs
@@ -329,16 +329,28 @@ impl ExternalImageHandler for WrExternal
fn unlock(&mut self,
id: ExternalImageId,
channel_index: u8) {
(self.unlock_func)(self.external_image_obj, id.into(), channel_index);
}
}
#[repr(u32)]
+pub enum WrAnimationType {
+ Transform = 0,
+ Opacity = 1,
+}
+
+#[repr(C)]
+pub struct WrAnimationProperty {
+ effect_type: WrAnimationType,
+ id: u64,
+}
+
+#[repr(u32)]
#[derive(Copy, Clone)]
pub enum WrFilterOpType {
Blur = 0,
Brightness = 1,
Contrast = 2,
Grayscale = 3,
HueRotate = 4,
Invert = 5,
@@ -1219,17 +1231,17 @@ pub extern "C" fn wr_dp_restore(state: &
#[no_mangle]
pub extern "C" fn wr_dp_clear_save(state: &mut WrState) {
state.frame_builder.dl_builder.clear_save();
}
#[no_mangle]
pub extern "C" fn wr_dp_push_stacking_context(state: &mut WrState,
bounds: LayoutRect,
- animation_id: u64,
+ animation: *const WrAnimationProperty,
opacity: *const f32,
transform: *const LayoutTransform,
transform_style: TransformStyle,
perspective: *const LayoutTransform,
mix_blend_mode: MixBlendMode,
filters: *const WrFilterOp,
filter_count: usize,
is_backface_visible: bool) {
--- a/gfx/webrender_bindings/webrender_ffi_generated.h
+++ b/gfx/webrender_bindings/webrender_ffi_generated.h
@@ -1,13 +1,13 @@
/* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
-/* Generated with cbindgen:0.1.29 */
+/* Generated with cbindgen:0.2.0 */
/* DO NOT MODIFY THIS MANUALLY! This file was generated using cbindgen.
* To generate this file:
* 1. Get the latest cbindgen using `cargo install --force cbindgen`
* a. Alternatively, you can clone `https://github.com/rlhunt/cbindgen` and use a tagged release
* 2. Run `rustup run nightly cbindgen toolkit/library/rust/ --crate webrender_bindings -o gfx/webrender_bindings/webrender_ffi_generated.h`
*/
@@ -197,16 +197,23 @@ enum class SubpixelDirection : uint32_t
enum class TransformStyle : uint32_t {
Flat = 0,
Preserve3D = 1,
Sentinel /* this must be last for serialization purposes. */
};
+enum class WrAnimationType : uint32_t {
+ Transform = 0,
+ Opacity = 1,
+
+ Sentinel /* this must be last for serialization purposes. */
+};
+
enum class WrExternalImageType : uint32_t {
NativeTexture = 0,
RawData = 1,
Sentinel /* this must be last for serialization purposes. */
};
enum class WrFilterOpType : uint32_t {
@@ -648,16 +655,26 @@ struct Shadow {
bool operator==(const Shadow& aOther) const {
return offset == aOther.offset &&
color == aOther.color &&
blur_radius == aOther.blur_radius;
}
};
+struct WrAnimationProperty {
+ WrAnimationType effect_type;
+ uint64_t id;
+
+ bool operator==(const WrAnimationProperty& aOther) const {
+ return effect_type == aOther.effect_type &&
+ id == aOther.id;
+ }
+};
+
struct WrFilterOp {
WrFilterOpType filter_type;
float argument;
bool operator==(const WrFilterOp& aOther) const {
return filter_type == aOther.filter_type &&
argument == aOther.argument;
}
@@ -1271,17 +1288,17 @@ void wr_dp_push_shadow(WrState *aState,
LayoutRect aClip,
bool aIsBackfaceVisible,
Shadow aShadow)
WR_FUNC;
WR_INLINE
void wr_dp_push_stacking_context(WrState *aState,
LayoutRect aBounds,
- uint64_t aAnimationId,
+ const WrAnimationProperty *aAnimation,
const float *aOpacity,
const LayoutTransform *aTransform,
TransformStyle aTransformStyle,
const LayoutTransform *aPerspective,
MixBlendMode aMixBlendMode,
const WrFilterOp *aFilters,
size_t aFilterCount,
bool aIsBackfaceVisible)