mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-11-28 23:31:56 +00:00
Bug 1370682 - Allow passing in LayoutDeviceSize to wr::ToBorderRadius for convenience. r=jrmuizel,mstange
There's no real reason to restrict this to LayerSize, since we use use Layer and LayoutDevice coordinate spaces interchangeably for webrender. With the templating of the function the compiler doesn't know what type to use for {0, 0} so I added a new function to deal with that. MozReview-Commit-ID: KyabB6P6LiA --HG-- extra : rebase_source : d5fff8f21a17c433d3c8c580fdd3153140d61545
This commit is contained in:
parent
a824d7cc43
commit
9d778bce61
@ -354,8 +354,15 @@ static inline wr::BorderRadius ToUniformBorderRadius(const mozilla::LayerSize& a
|
||||
return br;
|
||||
}
|
||||
|
||||
static inline wr::BorderRadius ToBorderRadius(const mozilla::LayerSize& topLeft, const mozilla::LayerSize& topRight,
|
||||
const mozilla::LayerSize& bottomLeft, const mozilla::LayerSize& bottomRight)
|
||||
static inline wr::BorderRadius EmptyBorderRadius()
|
||||
{
|
||||
wr::BorderRadius br;
|
||||
memset(&br, 0, sizeof(br));
|
||||
}
|
||||
|
||||
template<class T>
|
||||
static inline wr::BorderRadius ToBorderRadius(const gfx::SizeTyped<T>& topLeft, const gfx::SizeTyped<T>& topRight,
|
||||
const gfx::SizeTyped<T>& bottomLeft, const gfx::SizeTyped<T>& bottomRight)
|
||||
{
|
||||
wr::BorderRadius br;
|
||||
br.top_left = ToLayoutSize(topLeft);
|
||||
|
@ -7449,7 +7449,7 @@ BCBlockDirSeg::CreateWebRenderCommands(BCPaintBorderIterator& aIter,
|
||||
}
|
||||
wrSide[eSideLeft] = wr::ToBorderSide(ToDeviceColor(param->mBorderColor), param->mBorderStyle);
|
||||
|
||||
wr::BorderRadius borderRadii = wr::ToBorderRadius( {0, 0}, {0, 0}, {0, 0}, {0, 0} );
|
||||
wr::BorderRadius borderRadii = wr::EmptyBorderRadius();
|
||||
|
||||
// All border style is set to none except left side. So setting the widths of
|
||||
// each side to width of rect is fine.
|
||||
@ -7707,7 +7707,7 @@ BCInlineDirSeg::CreateWebRenderCommands(BCPaintBorderIterator& aIter,
|
||||
}
|
||||
wrSide[eSideTop] = wr::ToBorderSide(ToDeviceColor(param->mBorderColor), param->mBorderStyle);
|
||||
|
||||
wr::BorderRadius borderRadii = wr::ToBorderRadius( {0, 0}, {0, 0}, {0, 0}, {0, 0} );
|
||||
wr::BorderRadius borderRadii = wr::EmptyBorderRadius();
|
||||
|
||||
// All border style is set to none except top side. So setting the widths of
|
||||
// each side to height of rect is fine.
|
||||
|
Loading…
Reference in New Issue
Block a user