зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1405399 - Update due to API change in WR cset 75216e5. r=Gankro
MozReview-Commit-ID: GM8qA0MKaHv --HG-- extra : rebase_source : cb8cddeab931e34ad5cc7392308f177970cdabde
This commit is contained in:
Родитель
f079e04ec7
Коммит
561b271b7d
|
@ -1079,18 +1079,18 @@ DisplayListBuilder::PushLine(const wr::LayoutRect& aClip,
|
|||
}
|
||||
|
||||
void
|
||||
DisplayListBuilder::PushTextShadow(const wr::LayoutRect& aRect,
|
||||
const wr::LayoutRect& aClip,
|
||||
bool aIsBackfaceVisible,
|
||||
const wr::TextShadow& aShadow)
|
||||
DisplayListBuilder::PushShadow(const wr::LayoutRect& aRect,
|
||||
const wr::LayoutRect& aClip,
|
||||
bool aIsBackfaceVisible,
|
||||
const wr::Shadow& aShadow)
|
||||
{
|
||||
wr_dp_push_text_shadow(mWrState, aRect, aClip, aIsBackfaceVisible, aShadow);
|
||||
wr_dp_push_shadow(mWrState, aRect, aClip, aIsBackfaceVisible, aShadow);
|
||||
}
|
||||
|
||||
void
|
||||
DisplayListBuilder::PopTextShadow()
|
||||
DisplayListBuilder::PopShadow()
|
||||
{
|
||||
wr_dp_pop_text_shadow(mWrState);
|
||||
wr_dp_pop_shadow(mWrState);
|
||||
}
|
||||
|
||||
void
|
||||
|
|
|
@ -366,12 +366,12 @@ public:
|
|||
bool aIsBackfaceVisible,
|
||||
const wr::Line& aLine);
|
||||
|
||||
void PushTextShadow(const wr::LayoutRect& aBounds,
|
||||
void PushShadow(const wr::LayoutRect& aBounds,
|
||||
const wr::LayoutRect& aClip,
|
||||
bool aIsBackfaceVisible,
|
||||
const wr::TextShadow& aShadow);
|
||||
const wr::Shadow& aShadow);
|
||||
|
||||
void PopTextShadow();
|
||||
void PopShadow();
|
||||
|
||||
|
||||
|
||||
|
|
|
@ -1428,23 +1428,23 @@ pub extern "C" fn wr_dp_push_text(state: &mut WrState,
|
|||
}
|
||||
|
||||
#[no_mangle]
|
||||
pub extern "C" fn wr_dp_push_text_shadow(state: &mut WrState,
|
||||
bounds: LayoutRect,
|
||||
clip: LayoutRect,
|
||||
is_backface_visible: bool,
|
||||
shadow: TextShadow) {
|
||||
pub extern "C" fn wr_dp_push_shadow(state: &mut WrState,
|
||||
bounds: LayoutRect,
|
||||
clip: LayoutRect,
|
||||
is_backface_visible: bool,
|
||||
shadow: Shadow) {
|
||||
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_text_shadow(&prim_info, shadow.into());
|
||||
state.frame_builder.dl_builder.push_shadow(&prim_info, shadow.into());
|
||||
}
|
||||
|
||||
#[no_mangle]
|
||||
pub extern "C" fn wr_dp_pop_text_shadow(state: &mut WrState) {
|
||||
pub extern "C" fn wr_dp_pop_shadow(state: &mut WrState) {
|
||||
debug_assert!(unsafe { is_in_main_thread() });
|
||||
|
||||
state.frame_builder.dl_builder.pop_text_shadow();
|
||||
state.frame_builder.dl_builder.pop_shadow();
|
||||
}
|
||||
|
||||
#[no_mangle]
|
||||
|
|
|
@ -546,6 +546,18 @@ typedef TypedVector2D_f32__LayerPixel LayerVector2D;
|
|||
|
||||
typedef LayerVector2D LayoutVector2D;
|
||||
|
||||
struct Shadow {
|
||||
LayoutVector2D offset;
|
||||
ColorF color;
|
||||
float blur_radius;
|
||||
|
||||
bool operator==(const Shadow& aOther) const {
|
||||
return offset == aOther.offset &&
|
||||
color == aOther.color &&
|
||||
blur_radius == aOther.blur_radius;
|
||||
}
|
||||
};
|
||||
|
||||
struct WrFilterOp {
|
||||
WrFilterOpType filter_type;
|
||||
float argument;
|
||||
|
@ -588,18 +600,6 @@ struct GlyphOptions {
|
|||
}
|
||||
};
|
||||
|
||||
struct TextShadow {
|
||||
LayoutVector2D offset;
|
||||
ColorF color;
|
||||
float blur_radius;
|
||||
|
||||
bool operator==(const TextShadow& aOther) const {
|
||||
return offset == aOther.offset &&
|
||||
color == aOther.color &&
|
||||
blur_radius == aOther.blur_radius;
|
||||
}
|
||||
};
|
||||
|
||||
typedef YuvColorSpace WrYuvColorSpace;
|
||||
|
||||
struct ByteSlice {
|
||||
|
@ -889,11 +889,11 @@ void wr_dp_pop_scroll_layer(WrState *aState)
|
|||
WR_FUNC;
|
||||
|
||||
WR_INLINE
|
||||
void wr_dp_pop_stacking_context(WrState *aState)
|
||||
void wr_dp_pop_shadow(WrState *aState)
|
||||
WR_FUNC;
|
||||
|
||||
WR_INLINE
|
||||
void wr_dp_pop_text_shadow(WrState *aState)
|
||||
void wr_dp_pop_stacking_context(WrState *aState)
|
||||
WR_FUNC;
|
||||
|
||||
WR_INLINE
|
||||
|
@ -1053,6 +1053,14 @@ void wr_dp_push_scroll_layer(WrState *aState,
|
|||
uint64_t aScrollId)
|
||||
WR_FUNC;
|
||||
|
||||
WR_INLINE
|
||||
void wr_dp_push_shadow(WrState *aState,
|
||||
LayoutRect aBounds,
|
||||
LayoutRect aClip,
|
||||
bool aIsBackfaceVisible,
|
||||
Shadow aShadow)
|
||||
WR_FUNC;
|
||||
|
||||
WR_INLINE
|
||||
void wr_dp_push_stacking_context(WrState *aState,
|
||||
LayoutRect aBounds,
|
||||
|
@ -1079,14 +1087,6 @@ void wr_dp_push_text(WrState *aState,
|
|||
const GlyphOptions *aGlyphOptions)
|
||||
WR_FUNC;
|
||||
|
||||
WR_INLINE
|
||||
void wr_dp_push_text_shadow(WrState *aState,
|
||||
LayoutRect aBounds,
|
||||
LayoutRect aClip,
|
||||
bool aIsBackfaceVisible,
|
||||
TextShadow aShadow)
|
||||
WR_FUNC;
|
||||
|
||||
// Push a 2 planar NV12 image.
|
||||
WR_INLINE
|
||||
void wr_dp_push_yuv_NV12_image(WrState *aState,
|
||||
|
|
|
@ -6182,7 +6182,7 @@ nsLayoutUtils::PaintTextShadow(const nsIFrame* aFrame,
|
|||
|
||||
// Webrender just needs the shadow details
|
||||
if (auto* textDrawer = aContext->GetTextDrawer()) {
|
||||
wr::TextShadow wrShadow;
|
||||
wr::Shadow wrShadow;
|
||||
|
||||
wrShadow.offset = {
|
||||
presCtx->AppUnitsToFloatDevPixels(shadowDetails->mXOffset),
|
||||
|
|
|
@ -49,7 +49,7 @@ struct SelectionFragment {
|
|||
// For almost all nsTextFrames, there will be only one SelectedTextRunFragment.
|
||||
struct SelectedTextRunFragment {
|
||||
Maybe<SelectionFragment> selection;
|
||||
nsTArray<wr::TextShadow> shadows;
|
||||
nsTArray<wr::Shadow> shadows;
|
||||
nsTArray<TextRunFragment> text;
|
||||
nsTArray<wr::Line> beforeDecorations;
|
||||
nsTArray<wr::Line> afterDecorations;
|
||||
|
@ -163,7 +163,7 @@ public:
|
|||
}
|
||||
|
||||
void
|
||||
AppendShadow(const wr::TextShadow& aShadow) {
|
||||
AppendShadow(const wr::Shadow& aShadow) {
|
||||
mCurrentPart->shadows.AppendElement(aShadow);
|
||||
}
|
||||
|
||||
|
@ -338,8 +338,8 @@ public:
|
|||
for (auto& part : GetParts()) {
|
||||
// WR takes the shadows in CSS-order (reverse of rendering order),
|
||||
// because the drawing of a shadow actually occurs when it's popped.
|
||||
for (const wr::TextShadow& shadow : part.shadows) {
|
||||
aBuilder.PushTextShadow(wrBoundsRect, wrClipRect, backfaceVisible, shadow);
|
||||
for (const wr::Shadow& shadow : part.shadows) {
|
||||
aBuilder.PushShadow(wrBoundsRect, wrClipRect, backfaceVisible, shadow);
|
||||
}
|
||||
|
||||
for (const wr::Line& decoration : part.beforeDecorations) {
|
||||
|
@ -357,7 +357,7 @@ public:
|
|||
}
|
||||
|
||||
for (size_t i = 0; i < part.shadows.Length(); ++i) {
|
||||
aBuilder.PopTextShadow();
|
||||
aBuilder.PopShadow();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -6435,7 +6435,7 @@ nsTextFrame::PaintOneShadow(const PaintShadowParams& aParams,
|
|||
|
||||
auto* textDrawer = aParams.context->GetTextDrawer();
|
||||
if (textDrawer) {
|
||||
wr::TextShadow wrShadow;
|
||||
wr::Shadow wrShadow;
|
||||
|
||||
wrShadow.offset = {
|
||||
PresContext()->AppUnitsToFloatDevPixels(aShadowDetails->mXOffset),
|
||||
|
|
Загрузка…
Ссылка в новой задаче