Bug 1407213 - Update bindings for changes in WR PR 1853. r?jrmuizel
MozReview-Commit-ID: KjSQkZXXIaX
--- a/gfx/webrender_bindings/WebRenderAPI.cpp
+++ b/gfx/webrender_bindings/WebRenderAPI.cpp
@@ -1079,19 +1079,19 @@ DisplayListBuilder::PushShadow(const wr:
const wr::LayoutRect& aClip,
bool aIsBackfaceVisible,
const wr::Shadow& aShadow)
{
wr_dp_push_shadow(mWrState, aRect, aClip, aIsBackfaceVisible, aShadow);
}
void
-DisplayListBuilder::PopShadow()
+DisplayListBuilder::PopAllShadows()
{
- wr_dp_pop_shadow(mWrState);
+ wr_dp_pop_all_shadows(mWrState);
}
void
DisplayListBuilder::PushBoxShadow(const wr::LayoutRect& aRect,
const wr::LayoutRect& aClip,
bool aIsBackfaceVisible,
const wr::LayoutRect& aBoxBounds,
const wr::LayoutVector2D& aOffset,
--- a/gfx/webrender_bindings/WebRenderAPI.h
+++ b/gfx/webrender_bindings/WebRenderAPI.h
@@ -369,17 +369,17 @@ public:
bool aIsBackfaceVisible,
const wr::Line& aLine);
void PushShadow(const wr::LayoutRect& aBounds,
const wr::LayoutRect& aClip,
bool aIsBackfaceVisible,
const wr::Shadow& aShadow);
- void PopShadow();
+ void PopAllShadows();
void PushBoxShadow(const wr::LayoutRect& aRect,
const wr::LayoutRect& aClip,
bool aIsBackfaceVisible,
const wr::LayoutRect& aBoxBounds,
const wr::LayoutVector2D& aOffset,
--- a/gfx/webrender_bindings/src/bindings.rs
+++ b/gfx/webrender_bindings/src/bindings.rs
@@ -1453,20 +1453,20 @@ pub extern "C" fn wr_dp_push_shadow(stat
debug_assert!(unsafe { is_in_main_thread() });
let mut prim_info = LayoutPrimitiveInfo::with_clip_rect(bounds, clip.into());
prim_info.is_backface_visible = is_backface_visible;
state.frame_builder.dl_builder.push_shadow(&prim_info, shadow.into());
}
#[no_mangle]
-pub extern "C" fn wr_dp_pop_shadow(state: &mut WrState) {
+pub extern "C" fn wr_dp_pop_all_shadows(state: &mut WrState) {
debug_assert!(unsafe { is_in_main_thread() });
- state.frame_builder.dl_builder.pop_shadow();
+ state.frame_builder.dl_builder.pop_all_shadows();
}
#[no_mangle]
pub extern "C" fn wr_dp_push_line(state: &mut WrState,
clip: LayoutRect,
is_backface_visible: bool,
baseline: f32,
start: f32,
--- a/gfx/webrender_bindings/webrender_ffi_generated.h
+++ b/gfx/webrender_bindings/webrender_ffi_generated.h
@@ -934,32 +934,32 @@ uint64_t wr_dp_define_sticky_frame(WrSta
LayoutRect aContentRect,
const StickySideConstraint *aTopRange,
const StickySideConstraint *aRightRange,
const StickySideConstraint *aBottomRange,
const StickySideConstraint *aLeftRange)
WR_FUNC;
WR_INLINE
+void wr_dp_pop_all_shadows(WrState *aState)
+WR_FUNC;
+
+WR_INLINE
void wr_dp_pop_clip(WrState *aState)
WR_FUNC;
WR_INLINE
void wr_dp_pop_clip_and_scroll_info(WrState *aState)
WR_FUNC;
WR_INLINE
void wr_dp_pop_scroll_layer(WrState *aState)
WR_FUNC;
WR_INLINE
-void wr_dp_pop_shadow(WrState *aState)
-WR_FUNC;
-
-WR_INLINE
void wr_dp_pop_stacking_context(WrState *aState)
WR_FUNC;
WR_INLINE
void wr_dp_push_border(WrState *aState,
LayoutRect aRect,
LayoutRect aClip,
bool aIsBackfaceVisible,
--- a/layout/generic/TextDrawTarget.h
+++ b/layout/generic/TextDrawTarget.h
@@ -132,26 +132,26 @@ public:
color, mSc, mBoundsRect, mClipRect,
mBackfaceVisible);
}
void
AppendShadow(const wr::Shadow& aShadow)
{
mBuilder.PushShadow(mBoundsRect, mClipRect, mBackfaceVisible, aShadow);
- mShadowCount++;
+ mHasShadows = true;
}
void
TerminateShadows()
{
- for (size_t i = 0; i < mShadowCount; ++i) {
- mBuilder.PopShadow();
+ if (mHasShadows) {
+ mBuilder.PopAllShadows();
+ mHasShadows = false;
}
- mShadowCount = 0;
}
void
AppendSelectionRect(const LayoutDeviceRect& aRect, const Color& aColor)
{
auto rect = wr::ToLayoutRect(aRect);
auto color = wr::ToColorF(aColor);
mBuilder.PushRect(rect, mClipRect, mBackfaceVisible, color);
@@ -215,18 +215,18 @@ private:
// * SVG fonts
// * Unserializable fonts
// * Tofu glyphs
// * Pratial ligatures
// * Text writing-mode
// * Text stroke
bool mHasUnsupportedFeatures = false;
- // Number of shadows currently pushed, so we can pop them later.
- size_t mShadowCount = 0;
+ // Whether PopAllShadows needs to be called
+ bool mHasShadows = false;
// Things used to push to webrender
wr::DisplayListBuilder& mBuilder;
const layers::StackingContextHelper& mSc;
layers::WebRenderLayerManager* mManager;
// Computed facts
wr::LayerRect mBoundsRect;