--- a/gfx/webrender_bindings/WebRenderAPI.cpp
+++ b/gfx/webrender_bindings/WebRenderAPI.cpp
@@ -780,63 +780,63 @@ DisplayListBuilder::PushIFrame(const wr:
PipelineId aPipeline)
{
wr_dp_push_iframe(mWrState, aBounds, aPipeline);
}
void
DisplayListBuilder::PushBorder(const wr::LayoutRect& aBounds,
const wr::LayoutRect& aClip,
- const wr::WrBorderWidths& aWidths,
- const Range<const wr::WrBorderSide>& aSides,
- const wr::WrBorderRadius& aRadius)
+ const wr::BorderWidths& aWidths,
+ const Range<const wr::BorderSide>& aSides,
+ const wr::BorderRadius& aRadius)
{
MOZ_ASSERT(aSides.length() == 4);
if (aSides.length() != 4) {
return;
}
wr_dp_push_border(mWrState, aBounds, aClip,
aWidths, aSides[0], aSides[1], aSides[2], aSides[3], aRadius);
}
void
DisplayListBuilder::PushBorderImage(const wr::LayoutRect& aBounds,
const wr::LayoutRect& aClip,
- const wr::WrBorderWidths& aWidths,
+ const wr::BorderWidths& aWidths,
wr::ImageKey aImage,
- const wr::WrNinePatchDescriptor& aPatch,
+ const wr::NinePatchDescriptor& aPatch,
const wr::SideOffsets2D_f32& aOutset,
- const wr::WrRepeatMode& aRepeatHorizontal,
- const wr::WrRepeatMode& aRepeatVertical)
+ const wr::RepeatMode& aRepeatHorizontal,
+ const wr::RepeatMode& aRepeatVertical)
{
wr_dp_push_border_image(mWrState, aBounds, aClip,
aWidths, aImage, aPatch, aOutset,
aRepeatHorizontal, aRepeatVertical);
}
void
DisplayListBuilder::PushBorderGradient(const wr::LayoutRect& aBounds,
const wr::LayoutRect& aClip,
- const wr::WrBorderWidths& aWidths,
+ const wr::BorderWidths& aWidths,
const wr::LayoutPoint& aStartPoint,
const wr::LayoutPoint& aEndPoint,
const nsTArray<wr::GradientStop>& aStops,
wr::ExtendMode aExtendMode,
const wr::SideOffsets2D_f32& aOutset)
{
wr_dp_push_border_gradient(mWrState, aBounds, aClip,
aWidths, aStartPoint, aEndPoint,
aStops.Elements(), aStops.Length(),
aExtendMode, aOutset);
}
void
DisplayListBuilder::PushBorderRadialGradient(const wr::LayoutRect& aBounds,
const wr::LayoutRect& aClip,
- const wr::WrBorderWidths& aWidths,
+ const wr::BorderWidths& aWidths,
const wr::LayoutPoint& aCenter,
const wr::LayoutSize& aRadius,
const nsTArray<wr::GradientStop>& aStops,
wr::ExtendMode aExtendMode,
const wr::SideOffsets2D_f32& aOutset)
{
wr_dp_push_border_radial_gradient(
mWrState, aBounds, aClip, aWidths, aCenter,
--- a/gfx/webrender_bindings/WebRenderAPI.h
+++ b/gfx/webrender_bindings/WebRenderAPI.h
@@ -230,41 +230,41 @@ public:
void PushIFrame(const wr::LayoutRect& aBounds,
wr::PipelineId aPipeline);
// XXX WrBorderSides are passed with Range.
// It is just to bypass compiler bug. See Bug 1357734.
void PushBorder(const wr::LayoutRect& aBounds,
const wr::LayoutRect& aClip,
- const wr::WrBorderWidths& aWidths,
- const Range<const wr::WrBorderSide>& aSides,
- const wr::WrBorderRadius& aRadius);
+ const wr::BorderWidths& aWidths,
+ const Range<const wr::BorderSide>& aSides,
+ const wr::BorderRadius& aRadius);
void PushBorderImage(const wr::LayoutRect& aBounds,
const wr::LayoutRect& aClip,
- const wr::WrBorderWidths& aWidths,
+ const wr::BorderWidths& aWidths,
wr::ImageKey aImage,
- const wr::WrNinePatchDescriptor& aPatch,
+ const wr::NinePatchDescriptor& aPatch,
const wr::SideOffsets2D_f32& aOutset,
- const wr::WrRepeatMode& aRepeatHorizontal,
- const wr::WrRepeatMode& aRepeatVertical);
+ const wr::RepeatMode& aRepeatHorizontal,
+ const wr::RepeatMode& aRepeatVertical);
void PushBorderGradient(const wr::LayoutRect& aBounds,
const wr::LayoutRect& aClip,
- const wr::WrBorderWidths& aWidths,
+ const wr::BorderWidths& aWidths,
const wr::LayoutPoint& aStartPoint,
const wr::LayoutPoint& aEndPoint,
const nsTArray<wr::GradientStop>& aStops,
wr::ExtendMode aExtendMode,
const wr::SideOffsets2D_f32& aOutset);
void PushBorderRadialGradient(const wr::LayoutRect& aBounds,
const wr::LayoutRect& aClip,
- const wr::WrBorderWidths& aWidths,
+ const wr::BorderWidths& aWidths,
const wr::LayoutPoint& aCenter,
const wr::LayoutSize& aRadius,
const nsTArray<wr::GradientStop>& aStops,
wr::ExtendMode aExtendMode,
const wr::SideOffsets2D_f32& aOutset);
void PushText(const wr::LayoutRect& aBounds,
const wr::LayoutRect& aClip,
--- a/gfx/webrender_bindings/WebRenderTypes.h
+++ b/gfx/webrender_bindings/WebRenderTypes.h
@@ -319,88 +319,88 @@ static inline wr::LayoutTransform ToLayo
transform.m34 = m._34;
transform.m41 = m._41;
transform.m42 = m._42;
transform.m43 = m._43;
transform.m44 = m._44;
return transform;
}
-static inline wr::WrBorderStyle ToWrBorderStyle(const uint8_t& style)
+static inline wr::BorderStyle ToBorderStyle(const uint8_t& style)
{
switch (style) {
case NS_STYLE_BORDER_STYLE_NONE:
- return wr::WrBorderStyle::None;
+ return wr::BorderStyle::None;
case NS_STYLE_BORDER_STYLE_SOLID:
- return wr::WrBorderStyle::Solid;
+ return wr::BorderStyle::Solid;
case NS_STYLE_BORDER_STYLE_DOUBLE:
- return wr::WrBorderStyle::Double;
+ return wr::BorderStyle::Double;
case NS_STYLE_BORDER_STYLE_DOTTED:
- return wr::WrBorderStyle::Dotted;
+ return wr::BorderStyle::Dotted;
case NS_STYLE_BORDER_STYLE_DASHED:
- return wr::WrBorderStyle::Dashed;
+ return wr::BorderStyle::Dashed;
case NS_STYLE_BORDER_STYLE_HIDDEN:
- return wr::WrBorderStyle::Hidden;
+ return wr::BorderStyle::Hidden;
case NS_STYLE_BORDER_STYLE_GROOVE:
- return wr::WrBorderStyle::Groove;
+ return wr::BorderStyle::Groove;
case NS_STYLE_BORDER_STYLE_RIDGE:
- return wr::WrBorderStyle::Ridge;
+ return wr::BorderStyle::Ridge;
case NS_STYLE_BORDER_STYLE_INSET:
- return wr::WrBorderStyle::Inset;
+ return wr::BorderStyle::Inset;
case NS_STYLE_BORDER_STYLE_OUTSET:
- return wr::WrBorderStyle::Outset;
+ return wr::BorderStyle::Outset;
default:
MOZ_ASSERT(false);
}
- return wr::WrBorderStyle::None;
+ return wr::BorderStyle::None;
}
-static inline wr::WrBorderSide ToWrBorderSide(const gfx::Color& color, const uint8_t& style)
+static inline wr::BorderSide ToBorderSide(const gfx::Color& color, const uint8_t& style)
{
- wr::WrBorderSide bs;
+ wr::BorderSide bs;
bs.color = ToColorF(color);
- bs.style = ToWrBorderStyle(style);
+ bs.style = ToBorderStyle(style);
return bs;
}
-static inline wr::WrBorderRadius ToWrUniformBorderRadius(const LayerSize& aSize)
+static inline wr::BorderRadius ToUniformBorderRadius(const LayerSize& aSize)
{
- wr::WrBorderRadius br;
+ wr::BorderRadius br;
br.top_left = ToLayoutSize(aSize);
br.top_right = ToLayoutSize(aSize);
br.bottom_left = ToLayoutSize(aSize);
br.bottom_right = ToLayoutSize(aSize);
return br;
}
-static inline wr::WrBorderRadius ToWrBorderRadius(const LayerSize& topLeft, const LayerSize& topRight,
- const LayerSize& bottomLeft, const LayerSize& bottomRight)
+static inline wr::BorderRadius ToBorderRadius(const LayerSize& topLeft, const LayerSize& topRight,
+ const LayerSize& bottomLeft, const LayerSize& bottomRight)
{
- wr::WrBorderRadius br;
+ wr::BorderRadius br;
br.top_left = ToLayoutSize(topLeft);
br.top_right = ToLayoutSize(topRight);
br.bottom_left = ToLayoutSize(bottomLeft);
br.bottom_right = ToLayoutSize(bottomRight);
return br;
}
-static inline wr::WrBorderWidths ToWrBorderWidths(float top, float right, float bottom, float left)
+static inline wr::BorderWidths ToBorderWidths(float top, float right, float bottom, float left)
{
- wr::WrBorderWidths bw;
+ wr::BorderWidths bw;
bw.top = top;
bw.right = right;
bw.bottom = bottom;
bw.left = left;
return bw;
}
-static inline wr::WrNinePatchDescriptor ToWrNinePatchDescriptor(uint32_t width, uint32_t height,
- const wr::SideOffsets2D_u32& slice)
+static inline wr::NinePatchDescriptor ToNinePatchDescriptor(uint32_t width, uint32_t height,
+ const wr::SideOffsets2D_u32& slice)
{
- WrNinePatchDescriptor patch;
+ NinePatchDescriptor patch;
patch.width = width;
patch.height = height;
patch.slice = slice;
return patch;
}
static inline wr::SideOffsets2D_u32 ToSideOffsets2D_u32(uint32_t top, uint32_t right, uint32_t bottom, uint32_t left)
{
@@ -417,32 +417,32 @@ static inline wr::SideOffsets2D_f32 ToSi
SideOffsets2D_f32 offset;
offset.top = top;
offset.right = right;
offset.bottom = bottom;
offset.left = left;
return offset;
}
-static inline wr::WrRepeatMode ToWrRepeatMode(uint8_t repeatMode)
+static inline wr::RepeatMode ToRepeatMode(uint8_t repeatMode)
{
switch (repeatMode) {
case NS_STYLE_BORDER_IMAGE_REPEAT_STRETCH:
- return wr::WrRepeatMode::Stretch;
+ return wr::RepeatMode::Stretch;
case NS_STYLE_BORDER_IMAGE_REPEAT_REPEAT:
- return wr::WrRepeatMode::Repeat;
+ return wr::RepeatMode::Repeat;
case NS_STYLE_BORDER_IMAGE_REPEAT_ROUND:
- return wr::WrRepeatMode::Round;
+ return wr::RepeatMode::Round;
case NS_STYLE_BORDER_IMAGE_REPEAT_SPACE:
- return wr::WrRepeatMode::Space;
+ return wr::RepeatMode::Space;
default:
MOZ_ASSERT(false);
}
- return wr::WrRepeatMode::Stretch;
+ return wr::RepeatMode::Stretch;
}
template<class S, class T>
static inline wr::WrTransformProperty ToWrTransformProperty(uint64_t id,
const gfx::Matrix4x4Typed<S, T>& transform)
{
wr::WrTransformProperty prop;
prop.id = id;
@@ -458,17 +458,17 @@ static inline wr::WrOpacityProperty ToWr
return prop;
}
static inline wr::WrComplexClipRegion ToWrComplexClipRegion(const wr::LayoutRect& rect,
const LayerSize& size)
{
wr::WrComplexClipRegion complex_clip;
complex_clip.rect = rect;
- complex_clip.radii = wr::ToWrUniformBorderRadius(size);
+ complex_clip.radii = wr::ToUniformBorderRadius(size);
return complex_clip;
}
template<class T>
static inline wr::WrComplexClipRegion ToWrComplexClipRegion(const gfx::RectTyped<T>& rect,
const LayerSize& size)
{
return ToWrComplexClipRegion(wr::ToLayoutRect(rect), size);
--- a/gfx/webrender_bindings/src/bindings.rs
+++ b/gfx/webrender_bindings/src/bindings.rs
@@ -14,17 +14,16 @@ use thread_profiler::register_thread_wit
use moz2d_renderer::Moz2dImageRenderer;
use app_units::Au;
use rayon;
use euclid::SideOffsets2D;
extern crate webrender_api;
type WrAPI = RenderApi;
-type WrBorderStyle = BorderStyle;
type WrBoxShadowClipMode = BoxShadowClipMode;
type WrBuiltDisplayListDescriptor = BuiltDisplayListDescriptor;
type WrImageFormat = ImageFormat;
type WrImageRendering = ImageRendering;
type WrMixBlendMode = MixBlendMode;
type WrTransformStyle = TransformStyle;
type WrRenderer = Renderer;
@@ -138,109 +137,16 @@ impl MutByteSlice {
pub fn as_mut_slice(&mut self) -> &mut [u8] {
make_slice_mut(self.buffer, self.len)
}
}
#[repr(C)]
#[derive(Debug, Clone, Copy)]
-pub struct WrBorderSide {
- color: ColorF,
- style: WrBorderStyle,
-}
-
-impl Into<BorderSide> for WrBorderSide {
- fn into(self) -> BorderSide {
- BorderSide {
- color: self.color.into(),
- style: self.style,
- }
- }
-}
-
-#[repr(C)]
-#[derive(Debug, Clone, Copy)]
-pub struct WrBorderRadius {
- pub top_left: LayoutSize,
- pub top_right: LayoutSize,
- pub bottom_left: LayoutSize,
- pub bottom_right: LayoutSize,
-}
-
-impl Into<BorderRadius> for WrBorderRadius {
- fn into(self) -> BorderRadius {
- BorderRadius {
- top_left: self.top_left.into(),
- top_right: self.top_right.into(),
- bottom_left: self.bottom_left.into(),
- bottom_right: self.bottom_right.into(),
- }
- }
-}
-
-#[repr(C)]
-#[derive(Debug, Clone, Copy)]
-pub struct WrBorderWidths {
- left: f32,
- top: f32,
- right: f32,
- bottom: f32,
-}
-
-impl Into<BorderWidths> for WrBorderWidths {
- fn into(self) -> BorderWidths {
- BorderWidths {
- left: self.left,
- top: self.top,
- right: self.right,
- bottom: self.bottom,
- }
- }
-}
-
-#[repr(C)]
-#[derive(Debug, Clone, Copy)]
-pub struct WrNinePatchDescriptor {
- width: u32,
- height: u32,
- slice: SideOffsets2D<u32>,
-}
-
-impl Into<NinePatchDescriptor> for WrNinePatchDescriptor {
- fn into(self) -> NinePatchDescriptor {
- NinePatchDescriptor {
- width: self.width,
- height: self.height,
- slice: self.slice.into(),
- }
- }
-}
-
-#[repr(u32)]
-pub enum WrRepeatMode {
- Stretch,
- Repeat,
- Round,
- Space,
-}
-
-impl Into<RepeatMode> for WrRepeatMode {
- fn into(self) -> RepeatMode {
- match self {
- WrRepeatMode::Stretch => RepeatMode::Stretch,
- WrRepeatMode::Repeat => RepeatMode::Repeat,
- WrRepeatMode::Round => RepeatMode::Round,
- WrRepeatMode::Space => RepeatMode::Space,
- }
- }
-}
-
-#[repr(C)]
-#[derive(Debug, Clone, Copy)]
pub struct WrImageMask {
image: WrImageKey,
rect: LayoutRect,
repeat: bool,
}
impl Into<ImageMask> for WrImageMask {
fn into(self) -> ImageMask {
@@ -269,17 +175,17 @@ impl From<ImageMask> for WrImageMask {
}
}
}
#[repr(C)]
#[derive(Debug, Clone, Copy)]
pub struct WrComplexClipRegion {
rect: LayoutRect,
- radii: WrBorderRadius,
+ radii: BorderRadius,
}
impl<'a> Into<ComplexClipRegion> for &'a WrComplexClipRegion {
fn into(self) -> ComplexClipRegion {
ComplexClipRegion {
rect: self.rect.into(),
radii: self.radii.into(),
}
@@ -1287,22 +1193,22 @@ pub extern "C" fn wr_dp_push_text(state:
Au::from_f32_px(glyph_size),
glyph_options);
}
#[no_mangle]
pub extern "C" fn wr_dp_push_border(state: &mut WrState,
rect: LayoutRect,
clip: LayoutRect,
- widths: WrBorderWidths,
- top: WrBorderSide,
- right: WrBorderSide,
- bottom: WrBorderSide,
- left: WrBorderSide,
- radius: WrBorderRadius) {
+ widths: BorderWidths,
+ top: BorderSide,
+ right: BorderSide,
+ bottom: BorderSide,
+ left: BorderSide,
+ radius: BorderRadius) {
assert!(unsafe { is_in_main_thread() });
let border_details = BorderDetails::Normal(NormalBorder {
left: left.into(),
right: right.into(),
top: top.into(),
bottom: bottom.into(),
radius: radius.into(),
@@ -1314,22 +1220,22 @@ pub extern "C" fn wr_dp_push_border(stat
widths.into(),
border_details);
}
#[no_mangle]
pub extern "C" fn wr_dp_push_border_image(state: &mut WrState,
rect: LayoutRect,
clip: LayoutRect,
- widths: WrBorderWidths,
+ widths: BorderWidths,
image: WrImageKey,
- patch: WrNinePatchDescriptor,
+ patch: NinePatchDescriptor,
outset: SideOffsets2D<f32>,
- repeat_horizontal: WrRepeatMode,
- repeat_vertical: WrRepeatMode) {
+ repeat_horizontal: RepeatMode,
+ repeat_vertical: RepeatMode) {
assert!(unsafe { is_in_main_thread() });
let border_details =
BorderDetails::Image(ImageBorder {
image_key: image,
patch: patch.into(),
fill: false,
outset: outset.into(),
repeat_horizontal: repeat_horizontal.into(),
@@ -1342,17 +1248,17 @@ pub extern "C" fn wr_dp_push_border_imag
widths.into(),
border_details);
}
#[no_mangle]
pub extern "C" fn wr_dp_push_border_gradient(state: &mut WrState,
rect: LayoutRect,
clip: LayoutRect,
- widths: WrBorderWidths,
+ widths: BorderWidths,
start_point: LayoutPoint,
end_point: LayoutPoint,
stops: *const GradientStop,
stops_count: usize,
extend_mode: ExtendMode,
outset: SideOffsets2D<f32>) {
assert!(unsafe { is_in_main_thread() });
@@ -1376,17 +1282,17 @@ pub extern "C" fn wr_dp_push_border_grad
widths.into(),
border_details);
}
#[no_mangle]
pub extern "C" fn wr_dp_push_border_radial_gradient(state: &mut WrState,
rect: LayoutRect,
clip: LayoutRect,
- widths: WrBorderWidths,
+ widths: BorderWidths,
center: LayoutPoint,
radius: LayoutSize,
stops: *const GradientStop,
stops_count: usize,
extend_mode: ExtendMode,
outset: SideOffsets2D<f32>) {
assert!(unsafe { is_in_main_thread() });
--- a/gfx/webrender_bindings/webrender_ffi_generated.h
+++ b/gfx/webrender_bindings/webrender_ffi_generated.h
@@ -14,38 +14,47 @@
#include <cstdint>
#include <cstdlib>
extern "C" {
namespace mozilla {
namespace wr {
-enum class ExtendMode : uint32_t {
- Clamp = 0,
- Repeat = 1,
-
- Sentinel /* this must be last for serialization purposes. */
-};
-
-enum class WrBorderStyle : uint32_t {
+enum class BorderStyle : uint32_t {
None = 0,
Solid = 1,
Double = 2,
Dotted = 3,
Dashed = 4,
Hidden = 5,
Groove = 6,
Ridge = 7,
Inset = 8,
Outset = 9,
Sentinel /* this must be last for serialization purposes. */
};
+enum class ExtendMode : uint32_t {
+ Clamp = 0,
+ Repeat = 1,
+
+ Sentinel /* this must be last for serialization purposes. */
+};
+
+enum class RepeatMode : uint32_t {
+ Stretch = 0,
+ Repeat = 1,
+ Round = 2,
+ Space = 3,
+
+ Sentinel /* this must be last for serialization purposes. */
+};
+
enum class WrBoxShadowClipMode : uint32_t {
None = 0,
Outset = 1,
Inset = 2,
Sentinel /* this must be last for serialization purposes. */
};
@@ -114,25 +123,16 @@ enum class WrMixBlendMode : uint32_t {
Hue = 12,
Saturation = 13,
Color = 14,
Luminosity = 15,
Sentinel /* this must be last for serialization purposes. */
};
-enum class WrRepeatMode : uint32_t {
- Stretch = 0,
- Repeat = 1,
- Round = 2,
- Space = 3,
-
- Sentinel /* this must be last for serialization purposes. */
-};
-
enum class WrTransformStyle : uint32_t {
Flat = 0,
Preserve3D = 1,
Sentinel /* this must be last for serialization purposes. */
};
enum class WrYuvColorSpace : uint32_t {
@@ -370,47 +370,47 @@ struct LayoutRect {
TypedSize2D_f32__LayerPixel size;
bool operator==(const LayoutRect& aOther) const {
return origin == aOther.origin &&
size == aOther.size;
}
};
-struct WrBorderWidths {
+struct BorderWidths {
float left;
float top;
float right;
float bottom;
- bool operator==(const WrBorderWidths& aOther) const {
+ bool operator==(const BorderWidths& aOther) const {
return left == aOther.left &&
top == aOther.top &&
right == aOther.right &&
bottom == aOther.bottom;
}
};
-struct WrBorderSide {
+struct BorderSide {
ColorF color;
- WrBorderStyle style;
+ BorderStyle style;
- bool operator==(const WrBorderSide& aOther) const {
+ bool operator==(const BorderSide& aOther) const {
return color == aOther.color &&
style == aOther.style;
}
};
-struct WrBorderRadius {
+struct BorderRadius {
LayoutSize top_left;
LayoutSize top_right;
LayoutSize bottom_left;
LayoutSize bottom_right;
- bool operator==(const WrBorderRadius& aOther) const {
+ bool operator==(const BorderRadius& aOther) const {
return top_left == aOther.top_left &&
top_right == aOther.top_right &&
bottom_left == aOther.bottom_left &&
bottom_right == aOther.bottom_right;
}
};
struct LayoutPoint {
@@ -456,22 +456,22 @@ struct SideOffsets2D_u32 {
bool operator==(const SideOffsets2D_u32& aOther) const {
return top == aOther.top &&
right == aOther.right &&
bottom == aOther.bottom &&
left == aOther.left;
}
};
-struct WrNinePatchDescriptor {
+struct NinePatchDescriptor {
uint32_t width;
uint32_t height;
SideOffsets2D_u32 slice;
- bool operator==(const WrNinePatchDescriptor& aOther) const {
+ bool operator==(const NinePatchDescriptor& aOther) const {
return width == aOther.width &&
height == aOther.height &&
slice == aOther.slice;
}
};
struct LayoutVector2D {
float x;
@@ -480,17 +480,17 @@ struct LayoutVector2D {
bool operator==(const LayoutVector2D& aOther) const {
return x == aOther.x &&
y == aOther.y;
}
};
struct WrComplexClipRegion {
LayoutRect rect;
- WrBorderRadius radii;
+ BorderRadius radii;
bool operator==(const WrComplexClipRegion& aOther) const {
return rect == aOther.rect &&
radii == aOther.radii;
}
};
struct WrImageMask {
@@ -736,54 +736,54 @@ 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,
- WrBorderWidths aWidths,
- WrBorderSide aTop,
- WrBorderSide aRight,
- WrBorderSide aBottom,
- WrBorderSide aLeft,
- WrBorderRadius aRadius)
+ BorderWidths aWidths,
+ BorderSide aTop,
+ BorderSide aRight,
+ BorderSide aBottom,
+ BorderSide aLeft,
+ BorderRadius aRadius)
WR_FUNC;
WR_INLINE
void wr_dp_push_border_gradient(WrState *aState,
LayoutRect aRect,
LayoutRect aClip,
- WrBorderWidths aWidths,
+ BorderWidths aWidths,
LayoutPoint aStartPoint,
LayoutPoint aEndPoint,
const GradientStop *aStops,
size_t aStopsCount,
ExtendMode aExtendMode,
SideOffsets2D_f32 aOutset)
WR_FUNC;
WR_INLINE
void wr_dp_push_border_image(WrState *aState,
LayoutRect aRect,
LayoutRect aClip,
- WrBorderWidths aWidths,
+ BorderWidths aWidths,
WrImageKey aImage,
- WrNinePatchDescriptor aPatch,
+ NinePatchDescriptor aPatch,
SideOffsets2D_f32 aOutset,
- WrRepeatMode aRepeatHorizontal,
- WrRepeatMode aRepeatVertical)
+ RepeatMode aRepeatHorizontal,
+ RepeatMode aRepeatVertical)
WR_FUNC;
WR_INLINE
void wr_dp_push_border_radial_gradient(WrState *aState,
LayoutRect aRect,
LayoutRect aClip,
- WrBorderWidths aWidths,
+ BorderWidths aWidths,
LayoutPoint aCenter,
LayoutSize aRadius,
const GradientStop *aStops,
size_t aStopsCount,
ExtendMode aExtendMode,
SideOffsets2D_f32 aOutset)
WR_FUNC;
--- a/layout/painting/nsCSSRenderingBorders.cpp
+++ b/layout/painting/nsCSSRenderingBorders.cpp
@@ -3551,29 +3551,29 @@ nsCSSBorderRenderer::CanCreateWebRenderC
}
void
nsCSSBorderRenderer::CreateWebRenderCommands(wr::DisplayListBuilder& aBuilder,
const layers::StackingContextHelper& aSc)
{
LayoutDeviceRect outerRect = LayoutDeviceRect::FromUnknownRect(mOuterRect);
wr::LayoutRect transformedRect = aSc.ToRelativeLayoutRect(outerRect);
- wr::WrBorderSide side[4];
+ wr::BorderSide side[4];
NS_FOR_CSS_SIDES(i) {
- side[i] = wr::ToWrBorderSide(ToDeviceColor(mBorderColors[i]), mBorderStyles[i]);
+ side[i] = wr::ToBorderSide(ToDeviceColor(mBorderColors[i]), mBorderStyles[i]);
}
- wr::WrBorderRadius borderRadius = wr::ToWrBorderRadius(LayerSize(mBorderRadii[0].width, mBorderRadii[0].height),
- LayerSize(mBorderRadii[1].width, mBorderRadii[1].height),
- LayerSize(mBorderRadii[3].width, mBorderRadii[3].height),
- LayerSize(mBorderRadii[2].width, mBorderRadii[2].height));
- Range<const wr::WrBorderSide> wrsides(side, 4);
+ wr::BorderRadius borderRadius = wr::ToBorderRadius(LayerSize(mBorderRadii[0].width, mBorderRadii[0].height),
+ LayerSize(mBorderRadii[1].width, mBorderRadii[1].height),
+ LayerSize(mBorderRadii[3].width, mBorderRadii[3].height),
+ LayerSize(mBorderRadii[2].width, mBorderRadii[2].height));
+ Range<const wr::BorderSide> wrsides(side, 4);
aBuilder.PushBorder(transformedRect,
transformedRect,
- wr::ToWrBorderWidths(mBorderWidths[0], mBorderWidths[1], mBorderWidths[2], mBorderWidths[3]),
+ wr::ToBorderWidths(mBorderWidths[0], mBorderWidths[1], mBorderWidths[2], mBorderWidths[3]),
wrsides,
borderRadius);
}
/* static */Maybe<nsCSSBorderImageRenderer>
nsCSSBorderImageRenderer::CreateBorderImageRenderer(nsPresContext* aPresContext,
nsIFrame* aForFrame,
const nsRect& aBorderArea,
--- a/layout/painting/nsDisplayList.cpp
+++ b/layout/painting/nsDisplayList.cpp
@@ -4994,25 +4994,25 @@ nsDisplayBorder::CreateBorderImageWebRen
gfx::IntSize size;
Maybe<wr::ImageKey> key = aManager->CreateImageKey(this, container, aBuilder, aSc, size);
if (key.isNothing()) {
return;
}
aBuilder.PushBorderImage(dest,
clip,
- wr::ToWrBorderWidths(widths[0], widths[1], widths[2], widths[3]),
+ wr::ToBorderWidths(widths[0], widths[1], widths[2], widths[3]),
key.value(),
- wr::ToWrNinePatchDescriptor(
+ wr::ToNinePatchDescriptor(
(float)(mBorderImageRenderer->mImageSize.width) / appUnitsPerDevPixel,
(float)(mBorderImageRenderer->mImageSize.height) / appUnitsPerDevPixel,
wr::ToSideOffsets2D_u32(slice[0], slice[1], slice[2], slice[3])),
wr::ToSideOffsets2D_f32(outset[0], outset[1], outset[2], outset[3]),
- wr::ToWrRepeatMode(mBorderImageRenderer->mRepeatModeHorizontal),
- wr::ToWrRepeatMode(mBorderImageRenderer->mRepeatModeVertical));
+ wr::ToRepeatMode(mBorderImageRenderer->mRepeatModeHorizontal),
+ wr::ToRepeatMode(mBorderImageRenderer->mRepeatModeVertical));
break;
}
case eStyleImageType_Gradient:
{
RefPtr<nsStyleGradient> gradientData = mBorderImageRenderer->mImageRenderer.GetGradientData();
nsCSSGradientRenderer renderer =
nsCSSGradientRenderer::Create(mFrame->PresContext(), gradientData,
mBorderImageRenderer->mImageSize);
@@ -5027,26 +5027,26 @@ nsDisplayBorder::CreateBorderImageWebRen
if (gradientData->mShape == NS_STYLE_GRADIENT_SHAPE_LINEAR) {
LayerPoint startPoint = LayerPoint(dest.origin.x, dest.origin.y);
startPoint = startPoint + ViewAs<LayerPixel>(lineStart, PixelCastJustification::WebRenderHasUnitResolution);
LayerPoint endPoint = LayerPoint(dest.origin.x, dest.origin.y);
endPoint = endPoint + ViewAs<LayerPixel>(lineEnd, PixelCastJustification::WebRenderHasUnitResolution);
aBuilder.PushBorderGradient(dest,
clip,
- wr::ToWrBorderWidths(widths[0], widths[1], widths[2], widths[3]),
+ wr::ToBorderWidths(widths[0], widths[1], widths[2], widths[3]),
wr::ToLayoutPoint(startPoint),
wr::ToLayoutPoint(endPoint),
stops,
extendMode,
wr::ToSideOffsets2D_f32(outset[0], outset[1], outset[2], outset[3]));
} else {
aBuilder.PushBorderRadialGradient(dest,
clip,
- wr::ToWrBorderWidths(widths[0], widths[1], widths[2], widths[3]),
+ wr::ToBorderWidths(widths[0], widths[1], widths[2], widths[3]),
wr::ToLayoutPoint(lineStart),
wr::ToLayoutSize(gradientRadius),
stops,
extendMode,
wr::ToSideOffsets2D_f32(outset[0], outset[1], outset[2], outset[3]));
}
break;
}
--- a/layout/tables/nsTableFrame.cpp
+++ b/layout/tables/nsTableFrame.cpp
@@ -7440,32 +7440,32 @@ BCBlockDirSeg::CreateWebRenderCommands(B
return;
}
//TODO: Currently, we don't support border with m{Start,End}Bevel{Side,Offset} attributes.
LayoutDeviceRect borderRect = LayoutDeviceRect::FromUnknownRect(NSRectToRect(param->mBorderRect + aOffset,
param->mAppUnitsPerDevPixel));
wr::LayoutRect transformedRect = aSc.ToRelativeLayoutRect(borderRect);
- wr::WrBorderSide wrSide[4];
+ wr::BorderSide wrSide[4];
NS_FOR_CSS_SIDES(i) {
- wrSide[i] = wr::ToWrBorderSide(ToDeviceColor(param->mBorderColor), NS_STYLE_BORDER_STYLE_NONE);
- }
- wrSide[eSideLeft] = wr::ToWrBorderSide(ToDeviceColor(param->mBorderColor), param->mBorderStyle);
-
- wr::WrBorderRadius borderRadii = wr::ToWrBorderRadius( {0, 0}, {0, 0}, {0, 0}, {0, 0} );
+ wrSide[i] = wr::ToBorderSide(ToDeviceColor(param->mBorderColor), NS_STYLE_BORDER_STYLE_NONE);
+ }
+ wrSide[eSideLeft] = wr::ToBorderSide(ToDeviceColor(param->mBorderColor), param->mBorderStyle);
+
+ wr::BorderRadius borderRadii = wr::ToBorderRadius( {0, 0}, {0, 0}, {0, 0}, {0, 0} );
// All border style is set to none except left side. So setting the widths of
// each side to width of rect is fine.
- wr::WrBorderWidths borderWidths = wr::ToWrBorderWidths(transformedRect.size.width,
- transformedRect.size.width,
- transformedRect.size.width,
- transformedRect.size.width);
+ wr::BorderWidths borderWidths = wr::ToBorderWidths(transformedRect.size.width,
+ transformedRect.size.width,
+ transformedRect.size.width,
+ transformedRect.size.width);
transformedRect.size.width *= 2.0f;
- Range<const wr::WrBorderSide> wrsides(wrSide, 4);
+ Range<const wr::BorderSide> wrsides(wrSide, 4);
aBuilder.PushBorder(transformedRect,
transformedRect,
borderWidths,
wrsides,
borderRadii);
}
/**
@@ -7698,32 +7698,32 @@ BCInlineDirSeg::CreateWebRenderCommands(
return;
}
//TODO: Currently, we don't support border with m{Start,End}Bevel{Side,Offset} attributes.
LayoutDeviceRect borderRect = LayoutDeviceRect::FromUnknownRect(NSRectToRect(param->mBorderRect + aPt,
param->mAppUnitsPerDevPixel));
wr::LayoutRect transformedRect = aSc.ToRelativeLayoutRect(borderRect);
- wr::WrBorderSide wrSide[4];
+ wr::BorderSide wrSide[4];
NS_FOR_CSS_SIDES(i) {
- wrSide[i] = wr::ToWrBorderSide(ToDeviceColor(param->mBorderColor), NS_STYLE_BORDER_STYLE_NONE);
- }
- wrSide[eSideTop] = wr::ToWrBorderSide(ToDeviceColor(param->mBorderColor), param->mBorderStyle);
-
- wr::WrBorderRadius borderRadii = wr::ToWrBorderRadius( {0, 0}, {0, 0}, {0, 0}, {0, 0} );
+ wrSide[i] = wr::ToBorderSide(ToDeviceColor(param->mBorderColor), NS_STYLE_BORDER_STYLE_NONE);
+ }
+ wrSide[eSideTop] = wr::ToBorderSide(ToDeviceColor(param->mBorderColor), param->mBorderStyle);
+
+ wr::BorderRadius borderRadii = wr::ToBorderRadius( {0, 0}, {0, 0}, {0, 0}, {0, 0} );
// All border style is set to none except top side. So setting the widths of
// each side to height of rect is fine.
- wr::WrBorderWidths borderWidths = wr::ToWrBorderWidths(transformedRect.size.height,
- transformedRect.size.height,
- transformedRect.size.height,
- transformedRect.size.height);
+ wr::BorderWidths borderWidths = wr::ToBorderWidths(transformedRect.size.height,
+ transformedRect.size.height,
+ transformedRect.size.height,
+ transformedRect.size.height);
transformedRect.size.height *= 2.0f;
- Range<const wr::WrBorderSide> wrsides(wrSide, 4);
+ Range<const wr::BorderSide> wrsides(wrSide, 4);
aBuilder.PushBorder(transformedRect,
transformedRect,
borderWidths,
wrsides,
borderRadii);
}
/**