Bug 1382128 part 1 - Use a namespace in webrender_bindings. r=kats

MozReview-Commit-ID: 3JTMa9Ix5S7

--HG--
extra : rebase_source : 0bea14d9e395cab260d2db5135b1f64e9f82b2e2
This commit is contained in:
Ryan Hunt 2017-06-27 19:20:36 -04:00
Родитель df2c48e657
Коммит 3f3cb0a954
59 изменённых файлов: 580 добавлений и 566 удалений

Просмотреть файл

@ -70,7 +70,7 @@ AppendToString(std::stringstream& aStream, const nsRect& r,
}
void
AppendToString(std::stringstream& aStream, const WrColor& c,
AppendToString(std::stringstream& aStream, const wr::WrColor& c,
const char* pfx, const char* sfx)
{
aStream << pfx;
@ -81,7 +81,7 @@ AppendToString(std::stringstream& aStream, const WrColor& c,
}
void
AppendToString(std::stringstream& aStream, const WrRect& r,
AppendToString(std::stringstream& aStream, const wr::WrRect& r,
const char* pfx, const char* sfx)
{
aStream << pfx;
@ -92,7 +92,7 @@ AppendToString(std::stringstream& aStream, const WrRect& r,
}
void
AppendToString(std::stringstream& aStream, const WrSize& s,
AppendToString(std::stringstream& aStream, const wr::WrSize& s,
const char* pfx, const char* sfx)
{
aStream << pfx;

Просмотреть файл

@ -18,11 +18,14 @@
#include "nsRegion.h" // for nsRegion, nsIntRegion
#include "nscore.h" // for nsACString, etc
namespace mozilla {
namespace wr {
struct WrColor;
struct WrRect;
struct WrSize;
} // namespace wr
namespace mozilla {
namespace gfx {
template <class units, class F> struct RectTyped;
} // namespace gfx
@ -92,15 +95,15 @@ AppendToString(std::stringstream& aStream, const mozilla::gfx::IntRectTyped<T>&
}
void
AppendToString(std::stringstream& aStream, const WrColor& c,
AppendToString(std::stringstream& aStream, const wr::WrColor& c,
const char* pfx="", const char* sfx="");
void
AppendToString(std::stringstream& aStream, const WrRect& r,
AppendToString(std::stringstream& aStream, const wr::WrRect& r,
const char* pfx="", const char* sfx="");
void
AppendToString(std::stringstream& aStream, const WrSize& s,
AppendToString(std::stringstream& aStream, const wr::WrSize& s,
const char* pfx="", const char* sfx="");
void

Просмотреть файл

@ -447,7 +447,7 @@ APZCTreeManager::UpdateHitTestingTree(uint64_t aRootLayerTreeId,
bool
APZCTreeManager::PushStateToWR(wr::WebRenderAPI* aWrApi,
const TimeStamp& aSampleTime,
nsTArray<WrTransformProperty>& aTransformArray)
nsTArray<wr::WrTransformProperty>& aTransformArray)
{
APZThreadUtils::AssertOnCompositorThread();
MOZ_ASSERT(aWrApi);
@ -463,7 +463,7 @@ APZCTreeManager::PushStateToWR(wr::WebRenderAPI* aWrApi,
bool activeAnimations = false;
uint64_t lastLayersId = -1;
WrPipelineId lastPipelineId;
wr::WrPipelineId lastPipelineId;
// We iterate backwards here because the HitTestingTreeNode is optimized
// for backwards iteration. The equivalent code in AsyncCompositionManager

Просмотреть файл

@ -25,13 +25,12 @@
#include "mozilla/layers/AndroidDynamicToolbarAnimator.h"
#endif // defined(MOZ_WIDGET_ANDROID)
struct WrTransformProperty;
namespace mozilla {
class MultiTouchInput;
namespace wr {
class WebRenderAPI;
struct WrTransformProperty;
}
namespace layers {
@ -179,7 +178,7 @@ public:
*/
bool PushStateToWR(wr::WebRenderAPI* aWrApi,
const TimeStamp& aSampleTime,
nsTArray<WrTransformProperty>& aTransformArray);
nsTArray<wr::WrTransformProperty>& aTransformArray);
/**
* Walk the tree of APZCs and flushes the repaint requests for all the APZCS

Просмотреть файл

@ -133,8 +133,8 @@ GPUVideoTextureHost::AddWRImage(wr::WebRenderAPI* aAPI,
void
GPUVideoTextureHost::PushExternalImage(wr::DisplayListBuilder& aBuilder,
const WrRect& aBounds,
const WrRect& aClip,
const wr::WrRect& aBounds,
const wr::WrRect& aClip,
wr::ImageRendering aFilter,
Range<const wr::ImageKey>& aImageKeys)
{

Просмотреть файл

@ -56,8 +56,8 @@ public:
const wr::ExternalImageId& aExtID) override;
virtual void PushExternalImage(wr::DisplayListBuilder& aBuilder,
const WrRect& aBounds,
const WrRect& aClip,
const wr::WrRect& aBounds,
const wr::WrRect& aClip,
wr::ImageRendering aFilter,
Range<const wr::ImageKey>& aImageKeys) override;

Просмотреть файл

@ -607,25 +607,25 @@ BufferTextureHost::AddWRImage(wr::WebRenderAPI* aAPI,
aAPI->AddExternalImage(aImageKeys[0],
yDescriptor,
aExtID,
WrExternalImageBufferType::ExternalBuffer,
wr::WrExternalImageBufferType::ExternalBuffer,
0);
aAPI->AddExternalImage(aImageKeys[1],
cbcrDescriptor,
aExtID,
WrExternalImageBufferType::ExternalBuffer,
wr::WrExternalImageBufferType::ExternalBuffer,
1);
aAPI->AddExternalImage(aImageKeys[2],
cbcrDescriptor,
aExtID,
WrExternalImageBufferType::ExternalBuffer,
wr::WrExternalImageBufferType::ExternalBuffer,
2);
}
}
void
BufferTextureHost::PushExternalImage(wr::DisplayListBuilder& aBuilder,
const WrRect& aBounds,
const WrRect& aClip,
const wr::WrRect& aBounds,
const wr::WrRect& aClip,
wr::ImageRendering aFilter,
Range<const wr::ImageKey>& aImageKeys)
{
@ -639,7 +639,7 @@ BufferTextureHost::PushExternalImage(wr::DisplayListBuilder& aBuilder,
aImageKeys[0],
aImageKeys[1],
aImageKeys[2],
WrYuvColorSpace::Rec601,
wr::WrYuvColorSpace::Rec601,
aFilter);
}
}

Просмотреть файл

@ -643,8 +643,8 @@ public:
// Put all necessary WR commands into DisplayListBuilder for this textureHost rendering.
virtual void PushExternalImage(wr::DisplayListBuilder& aBuilder,
const WrRect& aBounds,
const WrRect& aClip,
const wr::WrRect& aBounds,
const wr::WrRect& aClip,
wr::ImageRendering aFilter,
Range<const wr::ImageKey>& aKeys)
{
@ -749,8 +749,8 @@ public:
const wr::ExternalImageId& aExtID) override;
virtual void PushExternalImage(wr::DisplayListBuilder& aBuilder,
const WrRect& aBounds,
const WrRect& aClip,
const wr::WrRect& aBounds,
const wr::WrRect& aClip,
wr::ImageRendering aFilter,
Range<const wr::ImageKey>& aImageKeys) override;

Просмотреть файл

@ -984,8 +984,8 @@ DXGITextureHostD3D11::AddWRImage(wr::WebRenderAPI* aAPI,
void
DXGITextureHostD3D11::PushExternalImage(wr::DisplayListBuilder& aBuilder,
const WrRect& aBounds,
const WrRect& aClip,
const wr::WrRect& aBounds,
const wr::WrRect& aClip,
wr::ImageRendering aFilter,
Range<const wr::ImageKey>& aImageKeys)
{
@ -1151,8 +1151,8 @@ DXGIYCbCrTextureHostD3D11::AddWRImage(wr::WebRenderAPI* aAPI,
void
DXGIYCbCrTextureHostD3D11::PushExternalImage(wr::DisplayListBuilder& aBuilder,
const WrRect& aBounds,
const WrRect& aClip,
const wr::WrRect& aBounds,
const wr::WrRect& aClip,
wr::ImageRendering aFilter,
Range<const wr::ImageKey>& aImageKeys)
{

Просмотреть файл

@ -331,8 +331,8 @@ public:
const wr::ExternalImageId& aExtID) override;
virtual void PushExternalImage(wr::DisplayListBuilder& aBuilder,
const WrRect& aBounds,
const WrRect& aClip,
const wr::WrRect& aBounds,
const wr::WrRect& aClip,
wr::ImageRendering aFilter,
Range<const wr::ImageKey>& aImageKeys) override;
@ -392,8 +392,8 @@ public:
const wr::ExternalImageId& aExtID) override;
virtual void PushExternalImage(wr::DisplayListBuilder& aBuilder,
const WrRect& aBounds,
const WrRect& aClip,
const wr::WrRect& aBounds,
const wr::WrRect& aClip,
wr::ImageRendering aFilter,
Range<const wr::ImageKey>& aImageKeys) override;

Просмотреть файл

@ -23,7 +23,7 @@ using mozilla::wr::ExternalImageId from "mozilla/webrender/WebRenderTypes.h";
using mozilla::wr::ImageKey from "mozilla/webrender/WebRenderTypes.h";
using mozilla::wr::FontKey from "mozilla/webrender/WebRenderTypes.h";
using mozilla::wr::PipelineId from "mozilla/webrender/WebRenderTypes.h";
using WrBuiltDisplayListDescriptor from "mozilla/webrender/webrender_ffi.h";
using mozilla::wr::WrBuiltDisplayListDescriptor from "mozilla/webrender/webrender_ffi.h";
using mozilla::layers::WebRenderScrollData from "mozilla/layers/WebRenderScrollData.h";
namespace mozilla {

Просмотреть файл

@ -9,10 +9,10 @@ include LayersSurfaces;
include LayersMessages;
include protocol PTexture;
using WrSize from "mozilla/webrender/webrender_ffi.h";
using WrImageRendering from "mozilla/webrender/webrender_ffi.h";
using WrMixBlendMode from "mozilla/webrender/webrender_ffi.h";
using MaybeImageMask from "mozilla/webrender/WebRenderTypes.h";
using mozilla::wr::WrSize from "mozilla/webrender/webrender_ffi.h";
using mozilla::wr::WrImageRendering from "mozilla/webrender/webrender_ffi.h";
using mozilla::wr::WrMixBlendMode from "mozilla/webrender/webrender_ffi.h";
using mozilla::wr::MaybeImageMask from "mozilla/webrender/WebRenderTypes.h";
using mozilla::wr::ExternalImageId from "mozilla/webrender/WebRenderTypes.h";
using mozilla::wr::ImageKey from "mozilla/webrender/WebRenderTypes.h";
using mozilla::wr::PipelineId from "mozilla/webrender/WebRenderTypes.h";

Просмотреть файл

@ -178,7 +178,7 @@ MacIOSurfaceTextureHostOGL::AddWRImage(wr::WebRenderAPI* aAPI,
aAPI->AddExternalImage(aImageKeys[0],
descriptor,
aExtID,
WrExternalImageBufferType::TextureRectHandle,
wr::WrExternalImageBufferType::TextureRectHandle,
0);
break;
}
@ -193,7 +193,7 @@ MacIOSurfaceTextureHostOGL::AddWRImage(wr::WebRenderAPI* aAPI,
aAPI->AddExternalImage(aImageKeys[0],
descriptor,
aExtID,
WrExternalImageBufferType::TextureRectHandle,
wr::WrExternalImageBufferType::TextureRectHandle,
0);
break;
}
@ -207,12 +207,12 @@ MacIOSurfaceTextureHostOGL::AddWRImage(wr::WebRenderAPI* aAPI,
aAPI->AddExternalImage(aImageKeys[0],
descriptor0,
aExtID,
WrExternalImageBufferType::TextureRectHandle,
wr::WrExternalImageBufferType::TextureRectHandle,
0);
aAPI->AddExternalImage(aImageKeys[1],
descriptor1,
aExtID,
WrExternalImageBufferType::TextureRectHandle,
wr::WrExternalImageBufferType::TextureRectHandle,
1);
break;
}
@ -224,8 +224,8 @@ MacIOSurfaceTextureHostOGL::AddWRImage(wr::WebRenderAPI* aAPI,
void
MacIOSurfaceTextureHostOGL::PushExternalImage(wr::DisplayListBuilder& aBuilder,
const WrRect& aBounds,
const WrRect& aClip,
const wr::WrRect& aBounds,
const wr::WrRect& aClip,
wr::ImageRendering aFilter,
Range<const wr::ImageKey>& aImageKeys)
{
@ -245,7 +245,7 @@ MacIOSurfaceTextureHostOGL::PushExternalImage(wr::DisplayListBuilder& aBuilder,
aBuilder.PushYCbCrInterleavedImage(aBounds,
aClip,
aImageKeys[0],
WrYuvColorSpace::Rec601,
wr::WrYuvColorSpace::Rec601,
aFilter);
break;
}
@ -256,7 +256,7 @@ MacIOSurfaceTextureHostOGL::PushExternalImage(wr::DisplayListBuilder& aBuilder,
aClip,
aImageKeys[0],
aImageKeys[1],
WrYuvColorSpace::Rec601,
wr::WrYuvColorSpace::Rec601,
aFilter);
break;
}

Просмотреть файл

@ -75,8 +75,8 @@ public:
const wr::ExternalImageId& aExtID) override;
virtual void PushExternalImage(wr::DisplayListBuilder& aBuilder,
const WrRect& aBounds,
const WrRect& aClip,
const wr::WrRect& aBounds,
const wr::WrRect& aClip,
wr::ImageRendering aFilter,
Range<const wr::ImageKey>& aImageKeys) override;

Просмотреть файл

@ -120,7 +120,7 @@ ScrollingLayersHelper::PushLayerLocalClip(const StackingContextHelper& aStacking
clip = Some(layer->GetLocalTransformTyped().TransformBounds(mLayer->Bounds()));
}
if (clip) {
Maybe<WrImageMask> mask = mLayer->BuildWrMaskLayer(aStackingContext);
Maybe<wr::WrImageMask> mask = mLayer->BuildWrMaskLayer(aStackingContext);
LayerRect clipRect = ViewAs<LayerPixel>(clip.ref(),
PixelCastJustification::MovingDownToChildren);
mBuilder->PushClip(aStackingContext.ToRelativeWrRect(clipRect), mask.ptrOr(nullptr));
@ -134,7 +134,7 @@ ScrollingLayersHelper::PushLayerClip(const LayerClip& aClip,
{
LayerRect clipRect = IntRectToRect(ViewAs<LayerPixel>(aClip.GetClipRect(),
PixelCastJustification::MovingDownToChildren));
Maybe<WrImageMask> mask;
Maybe<wr::WrImageMask> mask;
if (Maybe<size_t> maskLayerIndex = aClip.GetMaskLayerIndex()) {
Layer* maskLayer = mLayer->GetLayer()->GetAncestorMaskLayerAt(maskLayerIndex.value());
WebRenderLayer* maskWrLayer = WebRenderLayer::ToWebRenderLayer(maskLayer);

Просмотреть файл

@ -24,10 +24,10 @@ StackingContextHelper::StackingContextHelper(const StackingContextHelper& aParen
uint64_t aAnimationsId,
float* aOpacityPtr,
gfx::Matrix4x4* aTransformPtr,
const nsTArray<WrFilterOp>& aFilters)
const nsTArray<wr::WrFilterOp>& aFilters)
: mBuilder(&aBuilder)
{
WrRect scBounds = aParentSC.ToRelativeWrRect(aBoundForSC);
wr::WrRect scBounds = aParentSC.ToRelativeWrRect(aBoundForSC);
if (aTransformPtr) {
mTransform = *aTransformPtr;
}
@ -36,7 +36,7 @@ StackingContextHelper::StackingContextHelper(const StackingContextHelper& aParen
aAnimationsId,
aOpacityPtr,
aTransformPtr,
WrTransformStyle::Flat,
wr::WrTransformStyle::Flat,
// TODO: set correct blend mode.
wr::ToWrMixBlendMode(gfx::CompositionOp::OP_OVER),
aFilters);
@ -48,17 +48,17 @@ StackingContextHelper::StackingContextHelper(const StackingContextHelper& aParen
wr::DisplayListBuilder& aBuilder,
WebRenderLayer* aLayer,
const Maybe<gfx::Matrix4x4>& aTransform,
const nsTArray<WrFilterOp>& aFilters)
const nsTArray<wr::WrFilterOp>& aFilters)
: mBuilder(&aBuilder)
{
WrRect scBounds = aParentSC.ToRelativeWrRect(aLayer->BoundsForStackingContext());
wr::WrRect scBounds = aParentSC.ToRelativeWrRect(aLayer->BoundsForStackingContext());
Layer* layer = aLayer->GetLayer();
mTransform = aTransform.valueOr(layer->GetTransform());
float opacity = 1.0f;
mBuilder->PushStackingContext(scBounds, 0, &opacity,
mTransform.IsIdentity() ? nullptr : &mTransform,
WrTransformStyle::Flat,
wr::WrTransformStyle::Flat,
wr::ToWrMixBlendMode(layer->GetMixBlendMode()),
aFilters);
mOrigin = aLayer->Bounds().TopLeft();
@ -70,10 +70,10 @@ StackingContextHelper::StackingContextHelper(const StackingContextHelper& aParen
uint64_t aAnimationsId,
float* aOpacityPtr,
gfx::Matrix4x4* aTransformPtr,
const nsTArray<WrFilterOp>& aFilters)
const nsTArray<wr::WrFilterOp>& aFilters)
: mBuilder(&aBuilder)
{
WrRect scBounds = aParentSC.ToRelativeWrRect(aLayer->BoundsForStackingContext());
wr::WrRect scBounds = aParentSC.ToRelativeWrRect(aLayer->BoundsForStackingContext());
if (aTransformPtr) {
mTransform = *aTransformPtr;
}
@ -82,7 +82,7 @@ StackingContextHelper::StackingContextHelper(const StackingContextHelper& aParen
aAnimationsId,
aOpacityPtr,
aTransformPtr,
WrTransformStyle::Flat,
wr::WrTransformStyle::Flat,
wr::ToWrMixBlendMode(aLayer->GetLayer()->GetMixBlendMode()),
aFilters);
mOrigin = aLayer->Bounds().TopLeft();
@ -95,25 +95,25 @@ StackingContextHelper::~StackingContextHelper()
}
}
WrRect
wr::WrRect
StackingContextHelper::ToRelativeWrRect(const LayerRect& aRect) const
{
return wr::ToWrRect(aRect - mOrigin);
}
WrRect
wr::WrRect
StackingContextHelper::ToRelativeWrRect(const LayoutDeviceRect& aRect) const
{
return wr::ToWrRect(ViewAs<LayerPixel>(aRect, PixelCastJustification::WebRenderHasUnitResolution) - mOrigin);
}
WrPoint
wr::WrPoint
StackingContextHelper::ToRelativeWrPoint(const LayerPoint& aPoint) const
{
return wr::ToWrPoint(aPoint - mOrigin);
}
WrRect
wr::WrRect
StackingContextHelper::ToRelativeWrRectRounded(const LayoutDeviceRect& aRect) const
{
return wr::ToWrRect(RoundedToInt(ViewAs<LayerPixel>(aRect, PixelCastJustification::WebRenderHasUnitResolution) - mOrigin));

Просмотреть файл

@ -32,7 +32,7 @@ public:
wr::DisplayListBuilder& aBuilder,
WebRenderLayer* aLayer,
const Maybe<gfx::Matrix4x4>& aTransform = Nothing(),
const nsTArray<WrFilterOp>& aFilters = nsTArray<WrFilterOp>());
const nsTArray<wr::WrFilterOp>& aFilters = nsTArray<wr::WrFilterOp>());
// Alternate constructor which invokes the version of PushStackingContext
// for animations.
StackingContextHelper(const StackingContextHelper& aParentSC,
@ -41,7 +41,7 @@ public:
uint64_t aAnimationsId,
float* aOpacityPtr,
gfx::Matrix4x4* aTransformPtr,
const nsTArray<WrFilterOp>& aFilters = nsTArray<WrFilterOp>());
const nsTArray<wr::WrFilterOp>& aFilters = nsTArray<wr::WrFilterOp>());
// The constructor for layers-free mode.
StackingContextHelper(const StackingContextHelper& aParentSC,
wr::DisplayListBuilder& aBuilder,
@ -50,7 +50,7 @@ public:
uint64_t aAnimationsId,
float* aOpacityPtr,
gfx::Matrix4x4* aTransformPtr,
const nsTArray<WrFilterOp>& aFilters = nsTArray<WrFilterOp>());
const nsTArray<wr::WrFilterOp>& aFilters = nsTArray<wr::WrFilterOp>());
// This version of the constructor should only be used at the root level
// of the tree, so that we have a StackingContextHelper to pass down into
// the RenderLayer traversal, but don't actually want it to push a stacking
@ -68,12 +68,12 @@ public:
// We allow passing in a LayoutDeviceRect for convenience because in a lot of
// cases with WebRender display item generate the layout device space is the
// same as the layer space. (TODO: try to make this more explicit somehow).
WrRect ToRelativeWrRect(const LayerRect& aRect) const;
WrRect ToRelativeWrRect(const LayoutDeviceRect& aRect) const;
wr::WrRect ToRelativeWrRect(const LayerRect& aRect) const;
wr::WrRect ToRelativeWrRect(const LayoutDeviceRect& aRect) const;
// Same but for points
WrPoint ToRelativeWrPoint(const LayerPoint& aPoint) const;
wr::WrPoint ToRelativeWrPoint(const LayerPoint& aPoint) const;
// Same but rounds the rectangle to ints after transforming.
WrRect ToRelativeWrRectRounded(const LayoutDeviceRect& aRect) const;
wr::WrRect ToRelativeWrRectRounded(const LayoutDeviceRect& aRect) const;
private:
wr::DisplayListBuilder* mBuilder;

Просмотреть файл

@ -108,7 +108,7 @@ WebRenderBridgeChild::DPEnd(wr::DisplayListBuilder &aBuilder,
MOZ_ASSERT(mIsInTransaction);
wr::BuiltDisplayList dl;
WrSize contentSize;
wr::WrSize contentSize;
aBuilder.Finalize(contentSize, dl);
ByteBuffer dlData(Move(dl.dl));
@ -206,14 +206,14 @@ WebRenderBridgeChild::PushGlyphs(wr::DisplayListBuilder& aBuilder, const nsTArra
MOZ_ASSERT(aFont);
MOZ_ASSERT(!aGlyphs.IsEmpty());
WrFontKey key = GetFontKeyForScaledFont(aFont);
wr::WrFontKey key = GetFontKeyForScaledFont(aFont);
MOZ_ASSERT(key.mNamespace && key.mHandle);
for (size_t i = 0; i < aGlyphs.Length(); i++) {
GlyphArray glyph_array = aGlyphs[i];
nsTArray<gfx::Glyph>& glyphs = glyph_array.glyphs();
nsTArray<WrGlyphInstance> wr_glyph_instances;
nsTArray<wr::WrGlyphInstance> wr_glyph_instances;
wr_glyph_instances.SetLength(glyphs.Length());
for (size_t j = 0; j < glyphs.Length(); j++) {
@ -226,7 +226,7 @@ WebRenderBridgeChild::PushGlyphs(wr::DisplayListBuilder& aBuilder, const nsTArra
aSc.ToRelativeWrRect(aClip),
glyph_array.color().value(),
key,
Range<const WrGlyphInstance>(wr_glyph_instances.Elements(), wr_glyph_instances.Length()),
Range<const wr::WrGlyphInstance>(wr_glyph_instances.Elements(), wr_glyph_instances.Length()),
aFont->GetSize());
}

Просмотреть файл

@ -96,9 +96,9 @@ public:
mIdNamespace = aIdNamespace;
}
WrImageKey GetNextImageKey()
wr::WrImageKey GetNextImageKey()
{
return WrImageKey{ GetNamespace(), GetNextResourceId() };
return wr::WrImageKey{ GetNamespace(), GetNextResourceId() };
}
void PushGlyphs(wr::DisplayListBuilder& aBuilder, const nsTArray<GlyphArray>& aGlyphs,

Просмотреть файл

@ -400,9 +400,9 @@ WebRenderBridgeParent::HandleDPEnd(const gfx::IntSize& aSize,
InfallibleTArray<OpDestroy>&& aToDestroy,
const uint64_t& aFwdTransactionId,
const uint64_t& aTransactionId,
const WrSize& aContentSize,
const ByteBuffer& dl,
const WrBuiltDisplayListDescriptor& dlDesc,
const wr::WrSize& aContentSize,
const wr::ByteBuffer& dl,
const wr::WrBuiltDisplayListDescriptor& dlDesc,
const WebRenderScrollData& aScrollData,
const uint32_t& aIdNameSpace)
{
@ -480,7 +480,7 @@ WebRenderBridgeParent::UpdateAPZ()
}
bool
WebRenderBridgeParent::PushAPZStateToWR(nsTArray<WrTransformProperty>& aTransformArray)
WebRenderBridgeParent::PushAPZStateToWR(nsTArray<wr::WrTransformProperty>& aTransformArray)
{
CompositorBridgeParent* cbp = GetRootCompositorBridgeParent();
if (!cbp) {
@ -513,9 +513,9 @@ WebRenderBridgeParent::RecvDPEnd(const gfx::IntSize& aSize,
InfallibleTArray<OpDestroy>&& aToDestroy,
const uint64_t& aFwdTransactionId,
const uint64_t& aTransactionId,
const WrSize& aContentSize,
const ByteBuffer& dl,
const WrBuiltDisplayListDescriptor& dlDesc,
const wr::WrSize& aContentSize,
const wr::ByteBuffer& dl,
const wr::WrBuiltDisplayListDescriptor& dlDesc,
const WebRenderScrollData& aScrollData,
const uint32_t& aIdNameSpace)
{
@ -533,9 +533,9 @@ WebRenderBridgeParent::RecvDPSyncEnd(const gfx::IntSize &aSize,
InfallibleTArray<OpDestroy>&& aToDestroy,
const uint64_t& aFwdTransactionId,
const uint64_t& aTransactionId,
const WrSize& aContentSize,
const ByteBuffer& dl,
const WrBuiltDisplayListDescriptor& dlDesc,
const wr::WrSize& aContentSize,
const wr::ByteBuffer& dl,
const wr::WrBuiltDisplayListDescriptor& dlDesc,
const WebRenderScrollData& aScrollData,
const uint32_t& aIdNameSpace)
{
@ -656,8 +656,8 @@ WebRenderBridgeParent::ProcessWebRenderParentCommands(InfallibleTArray<WebRender
void
WebRenderBridgeParent::ProcessWebRenderCommands(const gfx::IntSize &aSize,
InfallibleTArray<WebRenderParentCommand>& aCommands, const wr::Epoch& aEpoch,
const WrSize& aContentSize, const ByteBuffer& dl,
const WrBuiltDisplayListDescriptor& dlDesc,
const wr::WrSize& aContentSize, const wr::ByteBuffer& dl,
const wr::WrBuiltDisplayListDescriptor& dlDesc,
const uint32_t& aIdNameSpace)
{
mCompositableHolder->SetCompositionTime(TimeStamp::Now());
@ -1057,8 +1057,8 @@ WebRenderBridgeParent::AdvanceAnimations()
}
void
WebRenderBridgeParent::SampleAnimations(nsTArray<WrOpacityProperty>& aOpacityArray,
nsTArray<WrTransformProperty>& aTransformArray)
WebRenderBridgeParent::SampleAnimations(nsTArray<wr::WrOpacityProperty>& aOpacityArray,
nsTArray<wr::WrTransformProperty>& aTransformArray)
{
AdvanceAnimations();
@ -1096,8 +1096,8 @@ WebRenderBridgeParent::CompositeToTarget(gfx::DrawTarget* aTarget, const gfx::In
}
bool scheduleComposite = false;
nsTArray<WrOpacityProperty> opacityArray;
nsTArray<WrTransformProperty> transformArray;
nsTArray<wr::WrOpacityProperty> opacityArray;
nsTArray<wr::WrTransformProperty> transformArray;
mCompositableHolder->SetCompositionTime(TimeStamp::Now());
mCompositableHolder->ApplyAsyncImages(mApi);

Просмотреть файл

@ -98,9 +98,9 @@ public:
InfallibleTArray<OpDestroy>&& aToDestroy,
const uint64_t& aFwdTransactionId,
const uint64_t& aTransactionId,
const WrSize& aContentSize,
const ByteBuffer& dl,
const WrBuiltDisplayListDescriptor& dlDesc,
const wr::WrSize& aContentSize,
const wr::ByteBuffer& dl,
const wr::WrBuiltDisplayListDescriptor& dlDesc,
const WebRenderScrollData& aScrollData,
const uint32_t& aIdNameSpace) override;
mozilla::ipc::IPCResult RecvDPSyncEnd(const gfx::IntSize& aSize,
@ -108,9 +108,9 @@ public:
InfallibleTArray<OpDestroy>&& aToDestroy,
const uint64_t& aFwdTransactionId,
const uint64_t& aTransactionId,
const WrSize& aContentSize,
const ByteBuffer& dl,
const WrBuiltDisplayListDescriptor& dlDesc,
const wr::WrSize& aContentSize,
const wr::ByteBuffer& dl,
const wr::WrBuiltDisplayListDescriptor& dlDesc,
const WebRenderScrollData& aScrollData,
const uint32_t& aIdNameSpace) override;
mozilla::ipc::IPCResult RecvParentCommands(nsTArray<WebRenderParentCommand>&& commands) override;
@ -217,9 +217,9 @@ private:
void ProcessWebRenderCommands(const gfx::IntSize &aSize,
InfallibleTArray<WebRenderParentCommand>& commands,
const wr::Epoch& aEpoch,
const WrSize& aContentSize,
const ByteBuffer& dl,
const WrBuiltDisplayListDescriptor& dlDesc,
const wr::WrSize& aContentSize,
const wr::ByteBuffer& dl,
const wr::WrBuiltDisplayListDescriptor& dlDesc,
const uint32_t& aIdNameSpace);
void ClearResources();
uint64_t GetChildLayerObserverEpoch() const { return mChildLayerObserverEpoch; }
@ -229,16 +229,16 @@ private:
InfallibleTArray<OpDestroy>&& aToDestroy,
const uint64_t& aFwdTransactionId,
const uint64_t& aTransactionId,
const WrSize& aContentSize,
const ByteBuffer& dl,
const WrBuiltDisplayListDescriptor& dlDesc,
const wr::WrSize& aContentSize,
const wr::ByteBuffer& dl,
const wr::WrBuiltDisplayListDescriptor& dlDesc,
const WebRenderScrollData& aScrollData,
const uint32_t& aIdNameSpace);
mozilla::ipc::IPCResult HandleShutdown();
void AdvanceAnimations();
void SampleAnimations(nsTArray<WrOpacityProperty>& aOpacityArray,
nsTArray<WrTransformProperty>& aTransformArray);
void SampleAnimations(nsTArray<wr::WrOpacityProperty>& aOpacityArray,
nsTArray<wr::WrTransformProperty>& aTransformArray);
CompositorBridgeParent* GetRootCompositorBridgeParent() const;
@ -246,7 +246,7 @@ private:
// animation is in effect and we need to schedule another composition.
// If scrollbars need their transforms updated, the provided aTransformArray
// is populated with the property update details.
bool PushAPZStateToWR(nsTArray<WrTransformProperty>& aTransformArray);
bool PushAPZStateToWR(nsTArray<wr::WrTransformProperty>& aTransformArray);
// Helper method to get an APZC reference from a scroll id. Uses the layers
// id of this bridge, and may return null if the APZC wasn't found.

Просмотреть файл

@ -83,11 +83,11 @@ WebRenderCanvasLayer::RenderLayer(wr::DisplayListBuilder& aBuilder,
Stringify(filter).c_str());
}
WrImageKey key = GetImageKey();
wr::WrImageKey key = GetImageKey();
WrBridge()->AddWebRenderParentCommand(OpAddExternalImage(mExternalImageId.value(), key));
WrManager()->AddImageKeyForDiscard(key);
WrRect r = sc.ToRelativeWrRect(rect);
wr::WrRect r = sc.ToRelativeWrRect(rect);
aBuilder.PushImage(r, r, filter, key);
}

Просмотреть файл

@ -28,7 +28,7 @@ WebRenderColorLayer::RenderLayer(wr::DisplayListBuilder& aBuilder,
LayerRect rect = Bounds();
DumpLayerInfo("ColorLayer", rect);
WrRect r = sc.ToRelativeWrRect(rect);
wr::WrRect r = sc.ToRelativeWrRect(rect);
aBuilder.PushRect(r, r, wr::ToWrColor(mColor));
}

Просмотреть файл

@ -19,8 +19,8 @@ WebRenderCompositableHolder::AsyncImagePipelineHolder::AsyncImagePipelineHolder(
: mInitialised(false)
, mIsChanged(false)
, mUseExternalImage(false)
, mFilter(WrImageRendering::Auto)
, mMixBlendMode(WrMixBlendMode::Normal)
, mFilter(wr::WrImageRendering::Auto)
, mMixBlendMode(wr::WrMixBlendMode::Normal)
{}
WebRenderCompositableHolder::WebRenderCompositableHolder(uint32_t aIdNamespace)
@ -135,8 +135,8 @@ WebRenderCompositableHolder::UpdateAsyncImagePipeline(const wr::PipelineId& aPip
const LayerRect& aScBounds,
const gfx::Matrix4x4& aScTransform,
const gfx::MaybeIntSize& aScaleToSize,
const WrImageRendering& aFilter,
const WrMixBlendMode& aMixBlendMode)
const wr::WrImageRendering& aFilter,
const wr::WrMixBlendMode& aMixBlendMode)
{
if (mDestroyed) {
return;
@ -264,7 +264,7 @@ WebRenderCompositableHolder::ApplyAsyncImages(wr::WebRenderAPI* aApi)
continue;
}
WrSize contentSize { holder->mScBounds.width, holder->mScBounds.height };
wr::WrSize contentSize { holder->mScBounds.width, holder->mScBounds.height };
wr::DisplayListBuilder builder(pipelineId, contentSize);
if (!keys.IsEmpty()) {
@ -275,9 +275,9 @@ WebRenderCompositableHolder::ApplyAsyncImages(wr::WebRenderAPI* aApi)
0,
&opacity,
holder->mScTransform.IsIdentity() ? nullptr : &holder->mScTransform,
WrTransformStyle::Flat,
wr::WrTransformStyle::Flat,
holder->mMixBlendMode,
nsTArray<WrFilterOp>());
nsTArray<wr::WrFilterOp>());
LayerRect rect(0, 0, holder->mCurrentTexture->GetSize().width, holder->mCurrentTexture->GetSize().height);
if (holder->mScaleToSize.isSome()) {
@ -304,7 +304,7 @@ WebRenderCompositableHolder::ApplyAsyncImages(wr::WebRenderAPI* aApi)
}
wr::BuiltDisplayList dl;
WrSize builderContentSize;
wr::WrSize builderContentSize;
builder.Finalize(builderContentSize, dl);
aApi->SetRootDisplayList(gfx::Color(0.f, 0.f, 0.f, 0.f), epoch, LayerSize(holder->mScBounds.width, holder->mScBounds.height),
pipelineId, builderContentSize,

Просмотреть файл

@ -75,8 +75,8 @@ public:
const LayerRect& aScBounds,
const gfx::Matrix4x4& aScTransform,
const gfx::MaybeIntSize& aScaleToSize,
const WrImageRendering& aFilter,
const WrMixBlendMode& aMixBlendMode);
const wr::WrImageRendering& aFilter,
const wr::WrMixBlendMode& aMixBlendMode);
void ApplyAsyncImages(wr::WebRenderAPI* aApi);
private:
@ -117,8 +117,8 @@ private:
LayerRect mScBounds;
gfx::Matrix4x4 mScTransform;
gfx::MaybeIntSize mScaleToSize;
WrImageRendering mFilter;
WrMixBlendMode mMixBlendMode;
wr::WrImageRendering mFilter;
wr::WrMixBlendMode mMixBlendMode;
RefPtr<WebRenderImageHost> mImageHost;
CompositableTextureHostRef mCurrentTexture;
nsTArray<wr::ImageKey> mKeys;

Просмотреть файл

@ -114,7 +114,7 @@ WebRenderContainerLayer::RenderLayer(wr::DisplayListBuilder& aBuilder,
transformForSC = nullptr;
}
nsTArray<WrFilterOp> filters;
nsTArray<wr::WrFilterOp> filters;
for (const CSSFilter& filter : this->GetFilterChain()) {
filters.AppendElement(wr::ToWrFilterOp(filter));
}
@ -150,7 +150,7 @@ WebRenderRefLayer::RenderLayer(wr::DisplayListBuilder& aBuilder,
PixelCastJustification::MovingDownToChildren);
DumpLayerInfo("RefLayer", rect);
WrRect r = aSc.ToRelativeWrRect(rect);
wr::WrRect r = aSc.ToRelativeWrRect(rect);
aBuilder.PushIFrame(r, wr::AsPipelineId(mId));
}

Просмотреть файл

@ -34,7 +34,7 @@ WebRenderDisplayItemLayer::RenderLayer(wr::DisplayListBuilder& aBuilder,
ScrollingLayersHelper scroller(this, aBuilder, aSc);
if (mItem) {
WrSize contentSize; // this won't actually be used by anything
wr::WrSize contentSize; // this won't actually be used by anything
wr::DisplayListBuilder builder(WrBridge()->GetPipeline(), contentSize);
// We might have recycled this layer. Throw away the old commands.
mParentCommands.Clear();

Просмотреть файл

@ -167,7 +167,7 @@ WebRenderImageLayer::RenderLayer(wr::DisplayListBuilder& aBuilder,
PixelCastJustification::MovingDownToChildren);
DumpLayerInfo("Image Layer async", rect);
WrRect r = aSc.ToRelativeWrRect(rect);
wr::WrRect r = aSc.ToRelativeWrRect(rect);
aBuilder.PushIFrame(r, mPipelineId.ref());
gfx::Matrix4x4 scTransform = GetTransform();
@ -231,11 +231,11 @@ WebRenderImageLayer::RenderLayer(wr::DisplayListBuilder& aBuilder,
GetLayer(),
Stringify(filter).c_str());
}
WrRect r = sc.ToRelativeWrRect(rect);
wr::WrRect r = sc.ToRelativeWrRect(rect);
aBuilder.PushImage(r, r, filter, mKey.value());
}
Maybe<WrImageMask>
Maybe<wr::WrImageMask>
WebRenderImageLayer::RenderMaskLayer(const StackingContextHelper& aSc,
const gfx::Matrix4x4& aTransform)
{
@ -283,7 +283,7 @@ WebRenderImageLayer::RenderMaskLayer(const StackingContextHelper& aSc,
}
gfx::IntSize size = image->GetSize();
WrImageMask imageMask;
wr::WrImageMask imageMask;
imageMask.image = mKey.value();
Rect maskRect = aTransform.TransformBounds(Rect(0, 0, size.width, size.height));
imageMask.rect = aSc.ToRelativeWrRect(ViewAs<LayerPixel>(maskRect));

Просмотреть файл

@ -33,8 +33,8 @@ public:
Layer* GetLayer() override { return this; }
void RenderLayer(wr::DisplayListBuilder& aBuilder,
const StackingContextHelper& aSc) override;
Maybe<WrImageMask> RenderMaskLayer(const StackingContextHelper& aSc,
const gfx::Matrix4x4& aTransform) override;
Maybe<wr::WrImageMask> RenderMaskLayer(const StackingContextHelper& aSc,
const gfx::Matrix4x4& aTransform) override;
protected:
CompositableType GetImageClientType();

Просмотреть файл

@ -31,16 +31,16 @@ WebRenderLayer::WrBridge()
return WrManager()->WrBridge();
}
WrImageKey
wr::WrImageKey
WebRenderLayer::GetImageKey()
{
WrImageKey key;
wr::WrImageKey key;
key.mNamespace = WrBridge()->GetNamespace();
key.mHandle = WrBridge()->GetNextResourceId();
return key;
}
Maybe<WrImageMask>
Maybe<wr::WrImageMask>
WebRenderLayer::BuildWrMaskLayer(const StackingContextHelper& aRelativeTo)
{
if (GetLayer()->GetMaskLayer()) {
@ -111,7 +111,7 @@ WebRenderLayer::UpdateImageKey(ImageClientSingle* aImageClient,
WrManager()->AddImageKeyForDiscard(aOldKey.value());
}
WrImageKey key = GetImageKey();
wr::WrImageKey key = GetImageKey();
WrBridge()->AddWebRenderParentCommand(OpAddExternalImage(aExternalImageId, key));
return Some(key);
}
@ -126,7 +126,7 @@ WebRenderLayer::DumpLayerInfo(const char* aLayerType, const LayerRect& aRect)
Layer* layer = GetLayer();
Matrix4x4 transform = layer->GetTransform();
LayerRect bounds = Bounds();
WrMixBlendMode mixBlendMode = wr::ToWrMixBlendMode(GetLayer()->GetMixBlendMode());
wr::WrMixBlendMode mixBlendMode = wr::ToWrMixBlendMode(GetLayer()->GetMixBlendMode());
printf_stderr("%s %p using bounds=%s, transform=%s, rect=%s, clip=%s, mix-blend-mode=%s\n",
aLayerType,

Просмотреть файл

@ -26,7 +26,7 @@ public:
virtual Layer* GetLayer() = 0;
virtual void RenderLayer(wr::DisplayListBuilder& aBuilder,
const StackingContextHelper& aSc) = 0;
virtual Maybe<WrImageMask> RenderMaskLayer(const StackingContextHelper& aSc,
virtual Maybe<wr::WrImageMask> RenderMaskLayer(const StackingContextHelper& aSc,
const gfx::Matrix4x4& aTransform)
{
MOZ_ASSERT(false);
@ -47,7 +47,7 @@ public:
WebRenderLayerManager* WrManager();
WebRenderBridgeChild* WrBridge();
WrImageKey GetImageKey();
wr::WrImageKey GetImageKey();
LayerRect Bounds();
LayerRect BoundsForStackingContext();
@ -57,7 +57,7 @@ public:
// that we want this mask to be relative to. This is usually the stacking
// context of the *parent* layer of |this|, because that is what the mask
// is relative to in the layer tree.
Maybe<WrImageMask> BuildWrMaskLayer(const StackingContextHelper& aRelativeTo);
Maybe<wr::WrImageMask> BuildWrMaskLayer(const StackingContextHelper& aRelativeTo);
protected:
BoundsTransformMatrix BoundsTransform();

Просмотреть файл

@ -438,7 +438,7 @@ WebRenderLayerManager::PushItemAsImage(nsDisplayItem* aItem,
MOZ_ASSERT(fallbackData->GetKey());
WrRect dest = aSc.ToRelativeWrRect(imageRect + offset);
wr::WrRect dest = aSc.ToRelativeWrRect(imageRect + offset);
aBuilder.PushImage(dest,
dest,
wr::ImageRendering::Auto,
@ -482,7 +482,7 @@ WebRenderLayerManager::EndTransactionInternal(DrawPaintedLayerCallback aCallback
}
DiscardCompositorAnimations();
WrSize contentSize { (float)size.width, (float)size.height };
wr::WrSize contentSize { (float)size.width, (float)size.height };
wr::DisplayListBuilder builder(WrBridge()->GetPipeline(), contentSize);
if (mEndTransactionWithoutLayers) {

Просмотреть файл

@ -106,26 +106,26 @@ struct ParamTraits<mozilla::wr::PipelineId>
};
template<>
struct ParamTraits<WrImageFormat>
struct ParamTraits<mozilla::wr::WrImageFormat>
: public ContiguousEnumSerializer<
WrImageFormat,
WrImageFormat::Invalid,
WrImageFormat::Sentinel>
mozilla::wr::WrImageFormat,
mozilla::wr::WrImageFormat::Invalid,
mozilla::wr::WrImageFormat::Sentinel>
{
};
template<>
struct ParamTraits<WrSize>
struct ParamTraits<mozilla::wr::WrSize>
{
static void
Write(Message* aMsg, const WrSize& aParam)
Write(Message* aMsg, const mozilla::wr::WrSize& aParam)
{
WriteParam(aMsg, aParam.width);
WriteParam(aMsg, aParam.height);
}
static bool
Read(const Message* aMsg, PickleIterator* aIter, WrSize* aResult)
Read(const Message* aMsg, PickleIterator* aIter, mozilla::wr::WrSize* aResult)
{
return ReadParam(aMsg, aIter, &aResult->width)
&& ReadParam(aMsg, aIter, &aResult->height);
@ -133,10 +133,10 @@ struct ParamTraits<WrSize>
};
template<>
struct ParamTraits<WrRect>
struct ParamTraits<mozilla::wr::WrRect>
{
static void
Write(Message* aMsg, const WrRect& aParam)
Write(Message* aMsg, const mozilla::wr::WrRect& aParam)
{
WriteParam(aMsg, aParam.x);
WriteParam(aMsg, aParam.y);
@ -145,7 +145,7 @@ struct ParamTraits<WrRect>
}
static bool
Read(const Message* aMsg, PickleIterator* aIter, WrRect* aResult)
Read(const Message* aMsg, PickleIterator* aIter, mozilla::wr::WrRect* aResult)
{
return ReadParam(aMsg, aIter, &aResult->x)
&& ReadParam(aMsg, aIter, &aResult->y)
@ -155,17 +155,17 @@ struct ParamTraits<WrRect>
};
template<>
struct ParamTraits<WrPoint>
struct ParamTraits<mozilla::wr::WrPoint>
{
static void
Write(Message* aMsg, const WrPoint& aParam)
Write(Message* aMsg, const mozilla::wr::WrPoint& aParam)
{
WriteParam(aMsg, aParam.x);
WriteParam(aMsg, aParam.y);
}
static bool
Read(const Message* aMsg, PickleIterator* aIter, WrPoint* aResult)
Read(const Message* aMsg, PickleIterator* aIter, mozilla::wr::WrPoint* aResult)
{
return ReadParam(aMsg, aIter, &aResult->x) &&
ReadParam(aMsg, aIter, &aResult->y);
@ -173,10 +173,10 @@ struct ParamTraits<WrPoint>
};
template<>
struct ParamTraits<WrImageMask>
struct ParamTraits<mozilla::wr::WrImageMask>
{
static void
Write(Message* aMsg, const WrImageMask& aParam)
Write(Message* aMsg, const mozilla::wr::WrImageMask& aParam)
{
WriteParam(aMsg, aParam.image);
WriteParam(aMsg, aParam.rect);
@ -184,7 +184,7 @@ struct ParamTraits<WrImageMask>
}
static bool
Read(const Message* aMsg, PickleIterator* aIter, WrImageMask* aResult)
Read(const Message* aMsg, PickleIterator* aIter, mozilla::wr::WrImageMask* aResult)
{
return ReadParam(aMsg, aIter, &aResult->image)
&& ReadParam(aMsg, aIter, &aResult->rect)
@ -193,35 +193,35 @@ struct ParamTraits<WrImageMask>
};
template<>
struct ParamTraits<WrImageRendering>
struct ParamTraits<mozilla::wr::WrImageRendering>
: public ContiguousEnumSerializer<
WrImageRendering,
WrImageRendering::Auto,
WrImageRendering::Sentinel>
mozilla::wr::WrImageRendering,
mozilla::wr::WrImageRendering::Auto,
mozilla::wr::WrImageRendering::Sentinel>
{
};
template<>
struct ParamTraits<WrMixBlendMode>
struct ParamTraits<mozilla::wr::WrMixBlendMode>
: public ContiguousEnumSerializer<
WrMixBlendMode,
WrMixBlendMode::Normal,
WrMixBlendMode::Sentinel>
mozilla::wr::WrMixBlendMode,
mozilla::wr::WrMixBlendMode::Normal,
mozilla::wr::WrMixBlendMode::Sentinel>
{
};
template<>
struct ParamTraits<WrBuiltDisplayListDescriptor>
struct ParamTraits<mozilla::wr::WrBuiltDisplayListDescriptor>
{
static void
Write(Message* aMsg, const WrBuiltDisplayListDescriptor& aParam)
Write(Message* aMsg, const mozilla::wr::WrBuiltDisplayListDescriptor& aParam)
{
WriteParam(aMsg, aParam.builder_start_time);
WriteParam(aMsg, aParam.builder_finish_time);
}
static bool
Read(const Message* aMsg, PickleIterator* aIter, WrBuiltDisplayListDescriptor* aResult)
Read(const Message* aMsg, PickleIterator* aIter, mozilla::wr::WrBuiltDisplayListDescriptor* aResult)
{
return ReadParam(aMsg, aIter, &aResult->builder_start_time)
&& ReadParam(aMsg, aIter, &aResult->builder_finish_time);

Просмотреть файл

@ -99,11 +99,11 @@ WebRenderPaintedLayer::CreateWebRenderDisplayList(wr::DisplayListBuilder& aBuild
LayerRect rect = Bounds();
DumpLayerInfo("PaintedLayer", rect);
WrImageKey key = GetImageKey();
wr::WrImageKey key = GetImageKey();
WrBridge()->AddWebRenderParentCommand(OpAddExternalImage(mExternalImageId.value(), key));
WrManager()->AddImageKeyForDiscard(key);
WrRect r = sc.ToRelativeWrRect(rect);
wr::WrRect r = sc.ToRelativeWrRect(rect);
aBuilder.PushImage(r, r, wr::ImageRendering::Auto, key);
}

Просмотреть файл

@ -62,7 +62,7 @@ public:
void RenderLayer(wr::DisplayListBuilder& aBuilder,
const StackingContextHelper& aSc) override;
private:
Maybe<WrImageKey> mImageKey;
Maybe<wr::WrImageKey> mImageKey;
LayerIntRect mImageBounds;
};

Просмотреть файл

@ -178,8 +178,8 @@ WebRenderTextureHost::AddWRImage(wr::WebRenderAPI* aAPI,
void
WebRenderTextureHost::PushExternalImage(wr::DisplayListBuilder& aBuilder,
const WrRect& aBounds,
const WrRect& aClip,
const wr::WrRect& aBounds,
const wr::WrRect& aClip,
wr::ImageRendering aFilter,
Range<const wr::ImageKey>& aImageKeys)
{

Просмотреть файл

@ -73,8 +73,8 @@ public:
const wr::ExternalImageId& aExtID) override;
virtual void PushExternalImage(wr::DisplayListBuilder& aBuilder,
const WrRect& aBounds,
const WrRect& aClip,
const wr::WrRect& aBounds,
const wr::WrRect& aClip,
wr::ImageRendering aFilter,
Range<const wr::ImageKey>& aImageKeys) override;

Просмотреть файл

@ -71,7 +71,7 @@ WebRenderImageData::UpdateImageKey(ImageContainer* aContainer, bool aForceUpdate
mWRManager->AddImageKeyForDiscard(mKey.value());
}
WrImageKey key = WrBridge()->GetNextImageKey();
wr::WrImageKey key = WrBridge()->GetNextImageKey();
mWRManager->WrBridge()->AddWebRenderParentCommand(OpAddExternalImage(mExternalImageId.value(), key));
mKey = Some(key);
@ -93,8 +93,8 @@ WebRenderImageData::CreateAsyncImageWebRenderCommands(mozilla::wr::DisplayListBu
const LayerRect& aSCBounds,
const Matrix4x4& aSCTransform,
const MaybeIntSize& aScaleToSize,
const WrImageRendering& aFilter,
const WrMixBlendMode& aMixBlendMode)
const wr::WrImageRendering& aFilter,
const wr::WrMixBlendMode& aMixBlendMode)
{
MOZ_ASSERT(aContainer->IsAsync());
if (!mPipelineId) {
@ -114,7 +114,7 @@ WebRenderImageData::CreateAsyncImageWebRenderCommands(mozilla::wr::DisplayListBu
// context need to be done manually and pushed over to the parent side,
// where it will be done when we build the display list for the iframe.
// That happens in WebRenderCompositableHolder.
WrRect r = aSc.ToRelativeWrRect(aBounds);
wr::WrRect r = aSc.ToRelativeWrRect(aBounds);
aBuilder.PushIFrame(r, mPipelineId.ref());
WrBridge()->AddWebRenderParentCommand(OpUpdateAsyncImagePipeline(mPipelineId.value(),

Просмотреть файл

@ -67,8 +67,8 @@ public:
const LayerRect& aSCBounds,
const gfx::Matrix4x4& aSCTransform,
const gfx::MaybeIntSize& aScaleToSize,
const WrImageRendering& aFilter,
const WrMixBlendMode& aMixBlendMode);
const wr::WrImageRendering& aFilter,
const wr::WrMixBlendMode& aMixBlendMode);
void CreateImageClientIfNeeded();

Просмотреть файл

@ -90,10 +90,10 @@ static bool Moz2DRenderCallback(const Range<const uint8_t> aBlob,
extern "C" {
bool wr_moz2d_render_cb(const WrByteSlice blob,
bool wr_moz2d_render_cb(const mozilla::wr::WrByteSlice blob,
uint32_t width, uint32_t height,
mozilla::wr::ImageFormat aFormat,
MutByteSlice output)
mozilla::wr::MutByteSlice output)
{
return mozilla::wr::Moz2DRenderCallback(mozilla::wr::ByteSliceToRange(blob),
mozilla::gfx::IntSize(width, height),

Просмотреть файл

@ -190,12 +190,12 @@ RenderThread::RunEvent(wr::WindowId aWindowId, UniquePtr<RendererEvent> aEvent)
static void
NotifyDidRender(layers::CompositorBridgeParentBase* aBridge,
WrRenderedEpochs* aEpochs,
wr::WrRenderedEpochs* aEpochs,
TimeStamp aStart,
TimeStamp aEnd)
{
WrPipelineId pipeline;
WrEpoch epoch;
wr::WrPipelineId pipeline;
wr::WrEpoch epoch;
while (wr_rendered_epochs_next(aEpochs, &pipeline, &epoch)) {
aBridge->NotifyDidCompositeToPipeline(pipeline, epoch, aStart, aEnd);
}
@ -352,7 +352,7 @@ RenderThread::DeferredRenderTextureHostDestroy(RefPtr<RenderTextureHost>)
}
RenderTextureHost*
RenderThread::GetRenderTexture(WrExternalImageId aExternalImageId)
RenderThread::GetRenderTexture(wr::WrExternalImageId aExternalImageId)
{
MOZ_ASSERT(IsInRenderThread());
@ -376,13 +376,13 @@ WebRenderThreadPool::~WebRenderThreadPool()
extern "C" {
void wr_notifier_new_frame_ready(WrWindowId aWindowId)
void wr_notifier_new_frame_ready(mozilla::wr::WrWindowId aWindowId)
{
mozilla::wr::RenderThread::Get()->IncPendingFrameCount(aWindowId);
mozilla::wr::RenderThread::Get()->NewFrameReady(mozilla::wr::WindowId(aWindowId));
}
void wr_notifier_new_scroll_frame_ready(WrWindowId aWindowId, bool aCompositeNeeded)
void wr_notifier_new_scroll_frame_ready(mozilla::wr::WrWindowId aWindowId, bool aCompositeNeeded)
{
// It is not necessary to update rendering with new_scroll_frame_ready.
// WebRenderBridgeParent::CompositeToTarget() is implemented to call
@ -390,7 +390,7 @@ void wr_notifier_new_scroll_frame_ready(WrWindowId aWindowId, bool aCompositeNee
// See Bug 1377688.
}
void wr_notifier_external_event(WrWindowId aWindowId, size_t aRawEvent)
void wr_notifier_external_event(mozilla::wr::WrWindowId aWindowId, size_t aRawEvent)
{
mozilla::UniquePtr<mozilla::wr::RendererEvent> evt(
reinterpret_cast<mozilla::wr::RendererEvent*>(aRawEvent));

Просмотреть файл

@ -34,10 +34,10 @@ public:
~WebRenderThreadPool();
WrThreadPool* Raw() { return mThreadPool; }
wr::WrThreadPool* Raw() { return mThreadPool; }
protected:
WrThreadPool* mThreadPool;
wr::WrThreadPool* mThreadPool;
};

Просмотреть файл

@ -16,7 +16,7 @@
namespace mozilla {
namespace wr {
WrExternalImage LockExternalImage(void* aObj, WrExternalImageId aId, uint8_t aChannelIndex)
wr::WrExternalImage LockExternalImage(void* aObj, wr::WrExternalImageId aId, uint8_t aChannelIndex)
{
RendererOGL* renderer = reinterpret_cast<RendererOGL*>(aObj);
RenderTextureHost* texture = renderer->GetRenderTexture(aId);
@ -44,7 +44,7 @@ WrExternalImage LockExternalImage(void* aObj, WrExternalImageId aId, uint8_t aCh
}
}
void UnlockExternalImage(void* aObj, WrExternalImageId aId, uint8_t aChannelIndex)
void UnlockExternalImage(void* aObj, wr::WrExternalImageId aId, uint8_t aChannelIndex)
{
RendererOGL* renderer = reinterpret_cast<RendererOGL*>(aObj);
RenderTextureHost* texture = renderer->GetRenderTexture(aId);
@ -56,7 +56,7 @@ RendererOGL::RendererOGL(RefPtr<RenderThread>&& aThread,
RefPtr<gl::GLContext>&& aGL,
RefPtr<widget::CompositorWidget>&& aWidget,
wr::WindowId aWindowId,
WrRenderer* aWrRenderer,
wr::WrRenderer* aWrRenderer,
layers::CompositorBridgeParentBase* aBridge)
: mThread(aThread)
, mGL(aGL)
@ -84,10 +84,10 @@ RendererOGL::~RendererOGL()
wr_renderer_delete(mWrRenderer);
}
WrExternalImageHandler
wr::WrExternalImageHandler
RendererOGL::GetExternalImageHandler()
{
return WrExternalImageHandler {
return wr::WrExternalImageHandler {
this,
LockExternalImage,
UnlockExternalImage,
@ -170,14 +170,14 @@ RendererOGL::SetProfilerEnabled(bool aEnabled)
wr_renderer_set_profiler_enabled(mWrRenderer, aEnabled);
}
WrRenderedEpochs*
wr::WrRenderedEpochs*
RendererOGL::FlushRenderedEpochs()
{
return wr_renderer_flush_rendered_epochs(mWrRenderer);
}
RenderTextureHost*
RendererOGL::GetRenderTexture(WrExternalImageId aExternalImageId)
RendererOGL::GetRenderTexture(wr::WrExternalImageId aExternalImageId)
{
return mThread->GetRenderTexture(aExternalImageId);
}

Просмотреть файл

@ -40,11 +40,11 @@ class RenderTextureHost;
/// on the render thread instead of the compositor thread.
class RendererOGL
{
friend WrExternalImage LockExternalImage(void* aObj, WrExternalImageId aId, uint8_t aChannelIndex);
friend void UnlockExternalImage(void* aObj, WrExternalImageId aId, uint8_t aChannelIndex);
friend wr::WrExternalImage LockExternalImage(void* aObj, wr::WrExternalImageId aId, uint8_t aChannelIndex);
friend void UnlockExternalImage(void* aObj, wr::WrExternalImageId aId, uint8_t aChannelIndex);
public:
WrExternalImageHandler GetExternalImageHandler();
wr::WrExternalImageHandler GetExternalImageHandler();
/// This can be called on the render thread only.
void Update();
@ -66,7 +66,7 @@ public:
RefPtr<gl::GLContext>&& aGL,
RefPtr<widget::CompositorWidget>&&,
wr::WindowId aWindowId,
WrRenderer* aWrRenderer,
wr::WrRenderer* aWrRenderer,
layers::CompositorBridgeParentBase* aBridge);
/// This can be called on the render thread only.
@ -77,18 +77,18 @@ public:
layers::CompositorBridgeParentBase* GetCompositorBridge() { return mBridge; }
WrRenderedEpochs* FlushRenderedEpochs();
wr::WrRenderedEpochs* FlushRenderedEpochs();
RenderTextureHost* GetRenderTexture(WrExternalImageId aExternalImageId);
RenderTextureHost* GetRenderTexture(wr::WrExternalImageId aExternalImageId);
WrRenderer* GetWrRenderer() { return mWrRenderer; }
wr::WrRenderer* GetWrRenderer() { return mWrRenderer; }
protected:
RefPtr<RenderThread> mThread;
RefPtr<gl::GLContext> mGL;
RefPtr<widget::CompositorWidget> mWidget;
WrRenderer* mWrRenderer;
wr::WrRenderer* mWrRenderer;
layers::CompositorBridgeParentBase* mBridge;
wr::WindowId mWindowId;
};

Просмотреть файл

@ -23,7 +23,7 @@ using layers::Stringify;
class NewRenderer : public RendererEvent
{
public:
NewRenderer(WrAPI** aApi, layers::CompositorBridgeParentBase* aBridge,
NewRenderer(wr::WrAPI** aApi, layers::CompositorBridgeParentBase* aBridge,
GLint* aMaxTextureSize,
bool* aUseANGLE,
RefPtr<widget::CompositorWidget>&& aWidget,
@ -70,7 +70,7 @@ public:
gl->fGetIntegerv(LOCAL_GL_MAX_TEXTURE_SIZE, mMaxTextureSize);
*mUseANGLE = gl->IsANGLE();
WrRenderer* wrRenderer = nullptr;
wr::WrRenderer* wrRenderer = nullptr;
if (!wr_window_new(aWindowId, mSize.width, mSize.height, gl.get(),
aRenderThread.ThreadPool().Raw(),
this->mEnableProfiler, mWrApi, &wrRenderer)) {
@ -87,7 +87,7 @@ public:
wrRenderer,
mBridge);
if (wrRenderer && renderer) {
WrExternalImageHandler handler = renderer->GetExternalImageHandler();
wr::WrExternalImageHandler handler = renderer->GetExternalImageHandler();
wr_renderer_set_external_image_handler(wrRenderer, &handler);
}
@ -95,7 +95,7 @@ public:
}
private:
WrAPI** mWrApi;
wr::WrAPI** mWrApi;
GLint* mMaxTextureSize;
bool* mUseANGLE;
layers::CompositorBridgeParentBase* mBridge;
@ -143,7 +143,7 @@ WebRenderAPI::Create(bool aEnableProfiler,
static uint64_t sNextId = 1;
auto id = NewWindowId(sNextId++);
WrAPI* wrApi = nullptr;
wr::WrAPI* wrApi = nullptr;
GLint maxTextureSize = 0;
bool useANGLE = false;
@ -164,7 +164,7 @@ WebRenderAPI::Create(bool aEnableProfiler,
return RefPtr<WebRenderAPI>(new WebRenderAPI(wrApi, id, maxTextureSize, useANGLE)).forget();
}
WrIdNamespace
wr::WrIdNamespace
WebRenderAPI::GetNamespace() {
return wr_api_get_namespace(mWrApi);
}
@ -180,9 +180,9 @@ WebRenderAPI::~WebRenderAPI()
}
void
WebRenderAPI::UpdateScrollPosition(const WrPipelineId& aPipelineId,
WebRenderAPI::UpdateScrollPosition(const wr::WrPipelineId& aPipelineId,
const layers::FrameMetrics::ViewID& aScrollId,
const WrPoint& aScrollPosition)
const wr::WrPoint& aScrollPosition)
{
wr_scroll_layer_with_id(mWrApi, aPipelineId, aScrollId, aScrollPosition);
}
@ -194,8 +194,8 @@ WebRenderAPI::GenerateFrame()
}
void
WebRenderAPI::GenerateFrame(const nsTArray<WrOpacityProperty>& aOpacityArray,
const nsTArray<WrTransformProperty>& aTransformArray)
WebRenderAPI::GenerateFrame(const nsTArray<wr::WrOpacityProperty>& aOpacityArray,
const nsTArray<wr::WrTransformProperty>& aTransformArray)
{
wr_api_generate_frame_with_properties(mWrApi,
aOpacityArray.IsEmpty() ?
@ -210,9 +210,9 @@ void
WebRenderAPI::SetRootDisplayList(gfx::Color aBgColor,
Epoch aEpoch,
LayerSize aViewportSize,
WrPipelineId pipeline_id,
wr::WrPipelineId pipeline_id,
const WrSize& content_size,
WrBuiltDisplayListDescriptor dl_descriptor,
wr::WrBuiltDisplayListDescriptor dl_descriptor,
uint8_t *dl_data,
size_t dl_size)
{
@ -229,7 +229,7 @@ WebRenderAPI::SetRootDisplayList(gfx::Color aBgColor,
void
WebRenderAPI::ClearRootDisplayList(Epoch aEpoch,
WrPipelineId pipeline_id)
wr::WrPipelineId pipeline_id)
{
wr_api_clear_root_display_list(mWrApi, aEpoch, pipeline_id);
}
@ -426,7 +426,7 @@ void
WebRenderAPI::AddExternalImage(ImageKey key,
const ImageDescriptor& aDescriptor,
ExternalImageId aExtID,
WrExternalImageBufferType aBufferType,
wr::WrExternalImageBufferType aBufferType,
uint8_t aChannelIndex)
{
wr_api_add_external_image(mWrApi,
@ -518,7 +518,7 @@ WebRenderAPI::RunOnRenderThread(UniquePtr<RendererEvent> aEvent)
}
DisplayListBuilder::DisplayListBuilder(PipelineId aId,
const WrSize& aContentSize)
const wr::WrSize& aContentSize)
{
MOZ_COUNT_CTOR(DisplayListBuilder);
mWrState = wr_state_new(aId, aContentSize);
@ -543,7 +543,7 @@ DisplayListBuilder::End()
}
void
DisplayListBuilder::Finalize(WrSize& aOutContentSize,
DisplayListBuilder::Finalize(wr::WrSize& aOutContentSize,
BuiltDisplayList& aOutDisplayList)
{
wr_api_finalize_builder(mWrState,
@ -553,19 +553,19 @@ DisplayListBuilder::Finalize(WrSize& aOutContentSize,
}
void
DisplayListBuilder::PushStackingContext(const WrRect& aBounds,
DisplayListBuilder::PushStackingContext(const wr::WrRect& aBounds,
const uint64_t& aAnimationId,
const float* aOpacity,
const gfx::Matrix4x4* aTransform,
WrTransformStyle aTransformStyle,
const WrMixBlendMode& aMixBlendMode,
const nsTArray<WrFilterOp>& aFilters)
wr::WrTransformStyle aTransformStyle,
const wr::WrMixBlendMode& aMixBlendMode,
const nsTArray<wr::WrFilterOp>& aFilters)
{
WrMatrix matrix;
wr::WrMatrix matrix;
if (aTransform) {
matrix = ToWrMatrix(*aTransform);
}
const WrMatrix* maybeTransform = aTransform ? &matrix : nullptr;
const wr::WrMatrix* maybeTransform = aTransform ? &matrix : nullptr;
WRDL_LOG("PushStackingContext b=%s t=%s\n", Stringify(aBounds).c_str(),
aTransform ? Stringify(*aTransform).c_str() : "none");
wr_dp_push_stacking_context(mWrState, aBounds, aAnimationId, aOpacity,
@ -581,14 +581,14 @@ DisplayListBuilder::PopStackingContext()
}
void
DisplayListBuilder::PushClip(const WrRect& aClipRect,
const WrImageMask* aMask)
DisplayListBuilder::PushClip(const wr::WrRect& aClipRect,
const wr::WrImageMask* aMask)
{
uint64_t clip_id = wr_dp_push_clip(mWrState, aClipRect, nullptr, 0, aMask);
WRDL_LOG("PushClip id=%" PRIu64 " r=%s m=%p b=%s\n", clip_id,
Stringify(aClipRect).c_str(), aMask,
aMask ? Stringify(aMask->rect).c_str() : "none");
mClipIdStack.push_back(WrClipId { clip_id });
mClipIdStack.push_back(wr::WrClipId { clip_id });
}
void
@ -609,8 +609,8 @@ DisplayListBuilder::PushBuiltDisplayList(BuiltDisplayList &dl)
void
DisplayListBuilder::PushScrollLayer(const layers::FrameMetrics::ViewID& aScrollId,
const WrRect& aContentRect,
const WrRect& aClipRect)
const wr::WrRect& aContentRect,
const wr::WrRect& aClipRect)
{
WRDL_LOG("PushScrollLayer id=%" PRIu64 " co=%s cl=%s\n",
aScrollId, Stringify(aContentRect).c_str(), Stringify(aClipRect).c_str());
@ -635,7 +635,7 @@ DisplayListBuilder::PopScrollLayer()
void
DisplayListBuilder::PushClipAndScrollInfo(const layers::FrameMetrics::ViewID& aScrollId,
const WrClipId* aClipId)
const wr::WrClipId* aClipId)
{
WRDL_LOG("PushClipAndScroll s=%" PRIu64 " c=%s\n", aScrollId,
aClipId ? Stringify(aClipId->id).c_str() : "none");
@ -651,9 +651,9 @@ DisplayListBuilder::PopClipAndScrollInfo()
}
void
DisplayListBuilder::PushRect(const WrRect& aBounds,
const WrRect& aClip,
const WrColor& aColor)
DisplayListBuilder::PushRect(const wr::WrRect& aBounds,
const wr::WrRect& aClip,
const wr::WrColor& aColor)
{
WRDL_LOG("PushRect b=%s cl=%s c=%s\n",
Stringify(aBounds).c_str(),
@ -663,14 +663,14 @@ DisplayListBuilder::PushRect(const WrRect& aBounds,
}
void
DisplayListBuilder::PushLinearGradient(const WrRect& aBounds,
const WrRect& aClip,
const WrPoint& aStartPoint,
const WrPoint& aEndPoint,
const nsTArray<WrGradientStop>& aStops,
DisplayListBuilder::PushLinearGradient(const wr::WrRect& aBounds,
const wr::WrRect& aClip,
const wr::WrPoint& aStartPoint,
const wr::WrPoint& aEndPoint,
const nsTArray<wr::WrGradientStop>& aStops,
wr::GradientExtendMode aExtendMode,
const WrSize aTileSize,
const WrSize aTileSpacing)
const wr::WrSize aTileSize,
const wr::WrSize aTileSpacing)
{
wr_dp_push_linear_gradient(mWrState,
aBounds, aClip,
@ -681,14 +681,14 @@ DisplayListBuilder::PushLinearGradient(const WrRect& aBounds,
}
void
DisplayListBuilder::PushRadialGradient(const WrRect& aBounds,
const WrRect& aClip,
const WrPoint& aCenter,
const WrSize& aRadius,
const nsTArray<WrGradientStop>& aStops,
DisplayListBuilder::PushRadialGradient(const wr::WrRect& aBounds,
const wr::WrRect& aClip,
const wr::WrPoint& aCenter,
const wr::WrSize& aRadius,
const nsTArray<wr::WrGradientStop>& aStops,
wr::GradientExtendMode aExtendMode,
const WrSize aTileSize,
const WrSize aTileSpacing)
const wr::WrSize aTileSize,
const wr::WrSize aTileSpacing)
{
wr_dp_push_radial_gradient(mWrState,
aBounds, aClip,
@ -699,22 +699,22 @@ DisplayListBuilder::PushRadialGradient(const WrRect& aBounds,
}
void
DisplayListBuilder::PushImage(const WrRect& aBounds,
const WrRect& aClip,
DisplayListBuilder::PushImage(const wr::WrRect& aBounds,
const wr::WrRect& aClip,
wr::ImageRendering aFilter,
wr::ImageKey aImage)
{
WrSize size;
wr::WrSize size;
size.width = aBounds.width;
size.height = aBounds.height;
PushImage(aBounds, aClip, size, size, aFilter, aImage);
}
void
DisplayListBuilder::PushImage(const WrRect& aBounds,
const WrRect& aClip,
const WrSize& aStretchSize,
const WrSize& aTileSpacing,
DisplayListBuilder::PushImage(const wr::WrRect& aBounds,
const wr::WrRect& aClip,
const wr::WrSize& aStretchSize,
const wr::WrSize& aTileSpacing,
wr::ImageRendering aFilter,
wr::ImageKey aImage)
{
@ -725,12 +725,12 @@ DisplayListBuilder::PushImage(const WrRect& aBounds,
}
void
DisplayListBuilder::PushYCbCrPlanarImage(const WrRect& aBounds,
const WrRect& aClip,
DisplayListBuilder::PushYCbCrPlanarImage(const wr::WrRect& aBounds,
const wr::WrRect& aClip,
wr::ImageKey aImageChannel0,
wr::ImageKey aImageChannel1,
wr::ImageKey aImageChannel2,
WrYuvColorSpace aColorSpace,
wr::WrYuvColorSpace aColorSpace,
wr::ImageRendering aRendering)
{
wr_dp_push_yuv_planar_image(mWrState,
@ -744,11 +744,11 @@ DisplayListBuilder::PushYCbCrPlanarImage(const WrRect& aBounds,
}
void
DisplayListBuilder::PushNV12Image(const WrRect& aBounds,
const WrRect& aClip,
DisplayListBuilder::PushNV12Image(const wr::WrRect& aBounds,
const wr::WrRect& aClip,
wr::ImageKey aImageChannel0,
wr::ImageKey aImageChannel1,
WrYuvColorSpace aColorSpace,
wr::WrYuvColorSpace aColorSpace,
wr::ImageRendering aRendering)
{
wr_dp_push_yuv_NV12_image(mWrState,
@ -761,10 +761,10 @@ DisplayListBuilder::PushNV12Image(const WrRect& aBounds,
}
void
DisplayListBuilder::PushYCbCrInterleavedImage(const WrRect& aBounds,
const WrRect& aClip,
DisplayListBuilder::PushYCbCrInterleavedImage(const wr::WrRect& aBounds,
const wr::WrRect& aClip,
wr::ImageKey aImageChannel0,
WrYuvColorSpace aColorSpace,
wr::WrYuvColorSpace aColorSpace,
wr::ImageRendering aRendering)
{
wr_dp_push_yuv_interleaved_image(mWrState,
@ -776,18 +776,18 @@ DisplayListBuilder::PushYCbCrInterleavedImage(const WrRect& aBounds,
}
void
DisplayListBuilder::PushIFrame(const WrRect& aBounds,
DisplayListBuilder::PushIFrame(const wr::WrRect& aBounds,
PipelineId aPipeline)
{
wr_dp_push_iframe(mWrState, aBounds, aPipeline);
}
void
DisplayListBuilder::PushBorder(const WrRect& aBounds,
const WrRect& aClip,
const WrBorderWidths& aWidths,
const Range<const WrBorderSide>& aSides,
const WrBorderRadius& aRadius)
DisplayListBuilder::PushBorder(const wr::WrRect& aBounds,
const wr::WrRect& aClip,
const wr::WrBorderWidths& aWidths,
const Range<const wr::WrBorderSide>& aSides,
const wr::WrBorderRadius& aRadius)
{
MOZ_ASSERT(aSides.length() == 4);
if (aSides.length() != 4) {
@ -798,14 +798,14 @@ DisplayListBuilder::PushBorder(const WrRect& aBounds,
}
void
DisplayListBuilder::PushBorderImage(const WrRect& aBounds,
const WrRect& aClip,
const WrBorderWidths& aWidths,
DisplayListBuilder::PushBorderImage(const wr::WrRect& aBounds,
const wr::WrRect& aClip,
const wr::WrBorderWidths& aWidths,
wr::ImageKey aImage,
const WrNinePatchDescriptor& aPatch,
const WrSideOffsets2Df32& aOutset,
const WrRepeatMode& aRepeatHorizontal,
const WrRepeatMode& aRepeatVertical)
const wr::WrNinePatchDescriptor& aPatch,
const wr::WrSideOffsets2Df32& aOutset,
const wr::WrRepeatMode& aRepeatHorizontal,
const wr::WrRepeatMode& aRepeatVertical)
{
wr_dp_push_border_image(mWrState, aBounds, aClip,
aWidths, aImage, aPatch, aOutset,
@ -813,14 +813,14 @@ DisplayListBuilder::PushBorderImage(const WrRect& aBounds,
}
void
DisplayListBuilder::PushBorderGradient(const WrRect& aBounds,
const WrRect& aClip,
const WrBorderWidths& aWidths,
const WrPoint& aStartPoint,
const WrPoint& aEndPoint,
const nsTArray<WrGradientStop>& aStops,
DisplayListBuilder::PushBorderGradient(const wr::WrRect& aBounds,
const wr::WrRect& aClip,
const wr::WrBorderWidths& aWidths,
const wr::WrPoint& aStartPoint,
const wr::WrPoint& aEndPoint,
const nsTArray<wr::WrGradientStop>& aStops,
wr::GradientExtendMode aExtendMode,
const WrSideOffsets2Df32& aOutset)
const wr::WrSideOffsets2Df32& aOutset)
{
wr_dp_push_border_gradient(mWrState, aBounds, aClip,
aWidths, aStartPoint, aEndPoint,
@ -829,14 +829,14 @@ DisplayListBuilder::PushBorderGradient(const WrRect& aBounds,
}
void
DisplayListBuilder::PushBorderRadialGradient(const WrRect& aBounds,
const WrRect& aClip,
const WrBorderWidths& aWidths,
const WrPoint& aCenter,
const WrSize& aRadius,
const nsTArray<WrGradientStop>& aStops,
DisplayListBuilder::PushBorderRadialGradient(const wr::WrRect& aBounds,
const wr::WrRect& aClip,
const wr::WrBorderWidths& aWidths,
const wr::WrPoint& aCenter,
const wr::WrSize& aRadius,
const nsTArray<wr::WrGradientStop>& aStops,
wr::GradientExtendMode aExtendMode,
const WrSideOffsets2Df32& aOutset)
const wr::WrSideOffsets2Df32& aOutset)
{
wr_dp_push_border_radial_gradient(
mWrState, aBounds, aClip, aWidths, aCenter,
@ -845,11 +845,11 @@ DisplayListBuilder::PushBorderRadialGradient(const WrRect& aBounds,
}
void
DisplayListBuilder::PushText(const WrRect& aBounds,
const WrRect& aClip,
DisplayListBuilder::PushText(const wr::WrRect& aBounds,
const wr::WrRect& aClip,
const gfx::Color& aColor,
wr::FontKey aFontKey,
Range<const WrGlyphInstance> aGlyphBuffer,
Range<const wr::WrGlyphInstance> aGlyphBuffer,
float aGlyphSize)
{
wr_dp_push_text(mWrState, aBounds, aClip,
@ -860,15 +860,15 @@ DisplayListBuilder::PushText(const WrRect& aBounds,
}
void
DisplayListBuilder::PushBoxShadow(const WrRect& aRect,
const WrRect& aClip,
const WrRect& aBoxBounds,
const WrPoint& aOffset,
const WrColor& aColor,
DisplayListBuilder::PushBoxShadow(const wr::WrRect& aRect,
const wr::WrRect& aClip,
const wr::WrRect& aBoxBounds,
const wr::WrPoint& aOffset,
const wr::WrColor& aColor,
const float& aBlurRadius,
const float& aSpreadRadius,
const float& aBorderRadius,
const WrBoxShadowClipMode& aClipMode)
const wr::WrBoxShadowClipMode& aClipMode)
{
wr_dp_push_box_shadow(mWrState, aRect, aClip,
aBoxBounds, aOffset, aColor,
@ -876,7 +876,7 @@ DisplayListBuilder::PushBoxShadow(const WrRect& aRect,
aClipMode);
}
Maybe<WrClipId>
Maybe<wr::WrClipId>
DisplayListBuilder::TopmostClipId()
{
if (mClipIdStack.empty()) {

Просмотреть файл

@ -48,26 +48,26 @@ public:
wr::WindowId GetId() const { return mId; }
void UpdateScrollPosition(const WrPipelineId& aPipelineId,
void UpdateScrollPosition(const wr::WrPipelineId& aPipelineId,
const layers::FrameMetrics::ViewID& aScrollId,
const WrPoint& aScrollPosition);
const wr::WrPoint& aScrollPosition);
void GenerateFrame();
void GenerateFrame(const nsTArray<WrOpacityProperty>& aOpacityArray,
const nsTArray<WrTransformProperty>& aTransformArray);
void GenerateFrame(const nsTArray<wr::WrOpacityProperty>& aOpacityArray,
const nsTArray<wr::WrTransformProperty>& aTransformArray);
void SetWindowParameters(LayoutDeviceIntSize size);
void SetRootDisplayList(gfx::Color aBgColor,
Epoch aEpoch,
LayerSize aViewportSize,
WrPipelineId pipeline_id,
const WrSize& content_size,
WrBuiltDisplayListDescriptor dl_descriptor,
wr::WrPipelineId pipeline_id,
const wr::WrSize& content_size,
wr::WrBuiltDisplayListDescriptor dl_descriptor,
uint8_t *dl_data,
size_t dl_size);
void ClearRootDisplayList(Epoch aEpoch,
WrPipelineId pipeline_id);
wr::WrPipelineId pipeline_id);
void SetRootPipeline(wr::PipelineId aPipeline);
@ -107,12 +107,12 @@ public:
void Pause();
bool Resume();
WrIdNamespace GetNamespace();
wr::WrIdNamespace GetNamespace();
GLint GetMaxTextureSize() const { return mMaxTextureSize; }
bool GetUseANGLE() const { return mUseANGLE; }
protected:
WebRenderAPI(WrAPI* aRawApi, wr::WindowId aId, GLint aMaxTextureSize, bool aUseANGLE)
WebRenderAPI(wr::WrAPI* aRawApi, wr::WindowId aId, GLint aMaxTextureSize, bool aUseANGLE)
: mWrApi(aRawApi)
, mId(aId)
, mMaxTextureSize(aMaxTextureSize)
@ -123,7 +123,7 @@ protected:
// Should be used only for shutdown handling
void WaitFlushed();
WrAPI* mWrApi;
wr::WrAPI* mWrApi;
wr::WindowId mId;
GLint mMaxTextureSize;
bool mUseANGLE;
@ -138,7 +138,7 @@ protected:
class DisplayListBuilder {
public:
explicit DisplayListBuilder(wr::PipelineId aId,
const WrSize& aContentSize);
const wr::WrSize& aContentSize);
DisplayListBuilder(DisplayListBuilder&&) = default;
~DisplayListBuilder();
@ -146,162 +146,162 @@ public:
void Begin(const LayerIntSize& aSize);
void End();
void Finalize(WrSize& aOutContentSize,
void Finalize(wr::WrSize& aOutContentSize,
wr::BuiltDisplayList& aOutDisplayList);
void PushStackingContext(const WrRect& aBounds, // TODO: We should work with strongly typed rects
void PushStackingContext(const wr::WrRect& aBounds, // TODO: We should work with strongly typed rects
const uint64_t& aAnimationId,
const float* aOpacity,
const gfx::Matrix4x4* aTransform,
WrTransformStyle aTransformStyle,
const WrMixBlendMode& aMixBlendMode,
const nsTArray<WrFilterOp>& aFilters);
wr::WrTransformStyle aTransformStyle,
const wr::WrMixBlendMode& aMixBlendMode,
const nsTArray<wr::WrFilterOp>& aFilters);
void PopStackingContext();
void PushClip(const WrRect& aClipRect,
const WrImageMask* aMask);
void PushClip(const wr::WrRect& aClipRect,
const wr::WrImageMask* aMask);
void PopClip();
void PushBuiltDisplayList(wr::BuiltDisplayList &dl);
void PushScrollLayer(const layers::FrameMetrics::ViewID& aScrollId,
const WrRect& aContentRect, // TODO: We should work with strongly typed rects
const WrRect& aClipRect);
const wr::WrRect& aContentRect, // TODO: We should work with strongly typed rects
const wr::WrRect& aClipRect);
void PopScrollLayer();
void PushClipAndScrollInfo(const layers::FrameMetrics::ViewID& aScrollId,
const WrClipId* aClipId);
const wr::WrClipId* aClipId);
void PopClipAndScrollInfo();
void PushRect(const WrRect& aBounds,
const WrRect& aClip,
const WrColor& aColor);
void PushRect(const wr::WrRect& aBounds,
const wr::WrRect& aClip,
const wr::WrColor& aColor);
void PushLinearGradient(const WrRect& aBounds,
const WrRect& aClip,
const WrPoint& aStartPoint,
const WrPoint& aEndPoint,
const nsTArray<WrGradientStop>& aStops,
void PushLinearGradient(const wr::WrRect& aBounds,
const wr::WrRect& aClip,
const wr::WrPoint& aStartPoint,
const wr::WrPoint& aEndPoint,
const nsTArray<wr::WrGradientStop>& aStops,
wr::GradientExtendMode aExtendMode,
const WrSize aTileSize,
const WrSize aTileSpacing);
const wr::WrSize aTileSize,
const wr::WrSize aTileSpacing);
void PushRadialGradient(const WrRect& aBounds,
const WrRect& aClip,
const WrPoint& aCenter,
const WrSize& aRadius,
const nsTArray<WrGradientStop>& aStops,
void PushRadialGradient(const wr::WrRect& aBounds,
const wr::WrRect& aClip,
const wr::WrPoint& aCenter,
const wr::WrSize& aRadius,
const nsTArray<wr::WrGradientStop>& aStops,
wr::GradientExtendMode aExtendMode,
const WrSize aTileSize,
const WrSize aTileSpacing);
const wr::WrSize aTileSize,
const wr::WrSize aTileSpacing);
void PushImage(const WrRect& aBounds,
const WrRect& aClip,
void PushImage(const wr::WrRect& aBounds,
const wr::WrRect& aClip,
wr::ImageRendering aFilter,
wr::ImageKey aImage);
void PushImage(const WrRect& aBounds,
const WrRect& aClip,
const WrSize& aStretchSize,
const WrSize& aTileSpacing,
void PushImage(const wr::WrRect& aBounds,
const wr::WrRect& aClip,
const wr::WrSize& aStretchSize,
const wr::WrSize& aTileSpacing,
wr::ImageRendering aFilter,
wr::ImageKey aImage);
void PushYCbCrPlanarImage(const WrRect& aBounds,
const WrRect& aClip,
void PushYCbCrPlanarImage(const wr::WrRect& aBounds,
const wr::WrRect& aClip,
wr::ImageKey aImageChannel0,
wr::ImageKey aImageChannel1,
wr::ImageKey aImageChannel2,
WrYuvColorSpace aColorSpace,
wr::WrYuvColorSpace aColorSpace,
wr::ImageRendering aFilter);
void PushNV12Image(const WrRect& aBounds,
const WrRect& aClip,
void PushNV12Image(const wr::WrRect& aBounds,
const wr::WrRect& aClip,
wr::ImageKey aImageChannel0,
wr::ImageKey aImageChannel1,
WrYuvColorSpace aColorSpace,
wr::WrYuvColorSpace aColorSpace,
wr::ImageRendering aFilter);
void PushYCbCrInterleavedImage(const WrRect& aBounds,
const WrRect& aClip,
void PushYCbCrInterleavedImage(const wr::WrRect& aBounds,
const wr::WrRect& aClip,
wr::ImageKey aImageChannel0,
WrYuvColorSpace aColorSpace,
wr::WrYuvColorSpace aColorSpace,
wr::ImageRendering aFilter);
void PushIFrame(const WrRect& aBounds,
void PushIFrame(const wr::WrRect& aBounds,
wr::PipelineId aPipeline);
// XXX WrBorderSides are passed with Range.
// It is just to bypass compiler bug. See Bug 1357734.
void PushBorder(const WrRect& aBounds,
const WrRect& aClip,
const WrBorderWidths& aWidths,
const Range<const WrBorderSide>& aSides,
const WrBorderRadius& aRadius);
void PushBorder(const wr::WrRect& aBounds,
const wr::WrRect& aClip,
const wr::WrBorderWidths& aWidths,
const Range<const wr::WrBorderSide>& aSides,
const wr::WrBorderRadius& aRadius);
void PushBorderImage(const WrRect& aBounds,
const WrRect& aClip,
const WrBorderWidths& aWidths,
void PushBorderImage(const wr::WrRect& aBounds,
const wr::WrRect& aClip,
const wr::WrBorderWidths& aWidths,
wr::ImageKey aImage,
const WrNinePatchDescriptor& aPatch,
const WrSideOffsets2Df32& aOutset,
const WrRepeatMode& aRepeatHorizontal,
const WrRepeatMode& aRepeatVertical);
const wr::WrNinePatchDescriptor& aPatch,
const wr::WrSideOffsets2Df32& aOutset,
const wr::WrRepeatMode& aRepeatHorizontal,
const wr::WrRepeatMode& aRepeatVertical);
void PushBorderGradient(const WrRect& aBounds,
const WrRect& aClip,
const WrBorderWidths& aWidths,
const WrPoint& aStartPoint,
const WrPoint& aEndPoint,
const nsTArray<WrGradientStop>& aStops,
void PushBorderGradient(const wr::WrRect& aBounds,
const wr::WrRect& aClip,
const wr::WrBorderWidths& aWidths,
const wr::WrPoint& aStartPoint,
const wr::WrPoint& aEndPoint,
const nsTArray<wr::WrGradientStop>& aStops,
wr::GradientExtendMode aExtendMode,
const WrSideOffsets2Df32& aOutset);
const wr::WrSideOffsets2Df32& aOutset);
void PushBorderRadialGradient(const WrRect& aBounds,
const WrRect& aClip,
const WrBorderWidths& aWidths,
const WrPoint& aCenter,
const WrSize& aRadius,
const nsTArray<WrGradientStop>& aStops,
void PushBorderRadialGradient(const wr::WrRect& aBounds,
const wr::WrRect& aClip,
const wr::WrBorderWidths& aWidths,
const wr::WrPoint& aCenter,
const wr::WrSize& aRadius,
const nsTArray<wr::WrGradientStop>& aStops,
wr::GradientExtendMode aExtendMode,
const WrSideOffsets2Df32& aOutset);
const wr::WrSideOffsets2Df32& aOutset);
void PushText(const WrRect& aBounds,
const WrRect& aClip,
void PushText(const wr::WrRect& aBounds,
const wr::WrRect& aClip,
const gfx::Color& aColor,
wr::FontKey aFontKey,
Range<const WrGlyphInstance> aGlyphBuffer,
Range<const wr::WrGlyphInstance> aGlyphBuffer,
float aGlyphSize);
void PushBoxShadow(const WrRect& aRect,
const WrRect& aClip,
const WrRect& aBoxBounds,
const WrPoint& aOffset,
const WrColor& aColor,
void PushBoxShadow(const wr::WrRect& aRect,
const wr::WrRect& aClip,
const wr::WrRect& aBoxBounds,
const wr::WrPoint& aOffset,
const wr::WrColor& aColor,
const float& aBlurRadius,
const float& aSpreadRadius,
const float& aBorderRadius,
const WrBoxShadowClipMode& aClipMode);
const wr::WrBoxShadowClipMode& aClipMode);
// Returns the clip id that was most recently pushed with PushClip and that
// has not yet been popped with PopClip. Return Nothing() if the clip stack
// is empty.
Maybe<WrClipId> TopmostClipId();
Maybe<wr::WrClipId> TopmostClipId();
// Returns the scroll id that was pushed just before the given scroll id. This
// function returns Nothing() if the given scrollid has not been encountered,
// or if it is the rootmost scroll id (and therefore has no ancestor).
Maybe<layers::FrameMetrics::ViewID> ParentScrollIdFor(layers::FrameMetrics::ViewID aScrollId);
// Try to avoid using this when possible.
WrState* Raw() { return mWrState; }
wr::WrState* Raw() { return mWrState; }
protected:
WrState* mWrState;
wr::WrState* mWrState;
// Track the stack of clip ids and scroll layer ids that have been pushed
// (by PushClip and PushScrollLayer, respectively) and are still active.
// This is helpful for knowing e.g. what the ancestor scroll id of a particular
// scroll id is, and doing other "queries" of current state.
std::vector<WrClipId> mClipIdStack;
std::vector<wr::WrClipId> mClipIdStack;
std::vector<layers::FrameMetrics::ViewID> mScrollIdStack;
// Track the parent scroll id of each scroll id that we encountered.
@ -310,7 +310,7 @@ protected:
friend class WebRenderAPI;
};
Maybe<WrImageFormat>
Maybe<wr::WrImageFormat>
SurfaceFormatToWrImageFormat(gfx::SurfaceFormat aFormat);
} // namespace wr

Просмотреть файл

@ -17,22 +17,21 @@
#include "RoundedRect.h"
#include "nsStyleConsts.h"
typedef mozilla::Maybe<WrImageMask> MaybeImageMask;
namespace mozilla {
namespace wr {
typedef WrGradientExtendMode GradientExtendMode;
typedef WrMixBlendMode MixBlendMode;
typedef WrImageRendering ImageRendering;
typedef WrImageFormat ImageFormat;
typedef WrWindowId WindowId;
typedef WrPipelineId PipelineId;
typedef WrImageKey ImageKey;
typedef WrFontKey FontKey;
typedef WrEpoch Epoch;
typedef WrExternalImageId ExternalImageId;
typedef wr::WrGradientExtendMode GradientExtendMode;
typedef wr::WrMixBlendMode MixBlendMode;
typedef wr::WrImageRendering ImageRendering;
typedef wr::WrImageFormat ImageFormat;
typedef wr::WrWindowId WindowId;
typedef wr::WrPipelineId PipelineId;
typedef wr::WrImageKey ImageKey;
typedef wr::WrFontKey FontKey;
typedef wr::WrEpoch Epoch;
typedef wr::WrExternalImageId ExternalImageId;
typedef mozilla::Maybe<mozilla::wr::WrImageMask> MaybeImageMask;
typedef Maybe<ExternalImageId> MaybeExternalImageId;
inline WindowId NewWindowId(uint64_t aId) {
@ -47,25 +46,25 @@ inline Epoch NewEpoch(uint32_t aEpoch) {
return e;
}
inline Maybe<WrImageFormat>
inline Maybe<wr::WrImageFormat>
SurfaceFormatToWrImageFormat(gfx::SurfaceFormat aFormat) {
switch (aFormat) {
case gfx::SurfaceFormat::R8G8B8X8:
// TODO: use RGBA + opaque flag
return Some(WrImageFormat::BGRA8);
return Some(wr::WrImageFormat::BGRA8);
case gfx::SurfaceFormat::B8G8R8X8:
// TODO: WebRender will have a BGRA + opaque flag for this but does not
// have it yet (cf. issue #732).
case gfx::SurfaceFormat::B8G8R8A8:
return Some(WrImageFormat::BGRA8);
return Some(wr::WrImageFormat::BGRA8);
case gfx::SurfaceFormat::B8G8R8:
return Some(WrImageFormat::RGB8);
return Some(wr::WrImageFormat::RGB8);
case gfx::SurfaceFormat::A8:
return Some(WrImageFormat::A8);
return Some(wr::WrImageFormat::A8);
case gfx::SurfaceFormat::R8G8:
return Some(WrImageFormat::RG8);
return Some(wr::WrImageFormat::RG8);
case gfx::SurfaceFormat::UNKNOWN:
return Some(WrImageFormat::Invalid);
return Some(wr::WrImageFormat::Invalid);
default:
return Nothing();
}
@ -85,7 +84,7 @@ WrImageFormatToSurfaceFormat(ImageFormat aFormat) {
}
}
struct ImageDescriptor: public WrImageDescriptor {
struct ImageDescriptor: public wr::WrImageDescriptor {
ImageDescriptor(const gfx::IntSize& aSize, gfx::SurfaceFormat aFormat)
{
format = SurfaceFormatToWrImageFormat(aFormat).value();
@ -194,9 +193,9 @@ static inline MixBlendMode ToWrMixBlendMode(gfx::CompositionOp compositionOp)
}
}
static inline WrColor ToWrColor(const gfx::Color& color)
static inline wr::WrColor ToWrColor(const gfx::Color& color)
{
WrColor c;
wr::WrColor c;
c.r = color.r;
c.g = color.g;
c.b = color.b;
@ -205,32 +204,32 @@ static inline WrColor ToWrColor(const gfx::Color& color)
}
template<class T>
static inline WrPoint ToWrPoint(const gfx::PointTyped<T>& point)
static inline wr::WrPoint ToWrPoint(const gfx::PointTyped<T>& point)
{
WrPoint p;
wr::WrPoint p;
p.x = point.x;
p.y = point.y;
return p;
}
template<class T>
static inline WrPoint ToWrPoint(const gfx::IntPointTyped<T>& point)
static inline wr::WrPoint ToWrPoint(const gfx::IntPointTyped<T>& point)
{
return ToWrPoint(IntPointToPoint(point));
}
static inline WrPoint ToWrPoint(const gfx::Point& point)
static inline wr::WrPoint ToWrPoint(const gfx::Point& point)
{
WrPoint p;
wr::WrPoint p;
p.x = point.x;
p.y = point.y;
return p;
}
template<class T>
static inline WrRect ToWrRect(const gfx::RectTyped<T>& rect)
static inline wr::WrRect ToWrRect(const gfx::RectTyped<T>& rect)
{
WrRect r;
wr::WrRect r;
r.x = rect.x;
r.y = rect.y;
r.width = rect.width;
@ -238,9 +237,9 @@ static inline WrRect ToWrRect(const gfx::RectTyped<T>& rect)
return r;
}
static inline WrRect ToWrRect(const gfxRect rect)
static inline wr::WrRect ToWrRect(const gfxRect rect)
{
WrRect r;
wr::WrRect r;
r.x = rect.x;
r.y = rect.y;
r.width = rect.width;
@ -249,23 +248,23 @@ static inline WrRect ToWrRect(const gfxRect rect)
}
template<class T>
static inline WrRect ToWrRect(const gfx::IntRectTyped<T>& rect)
static inline wr::WrRect ToWrRect(const gfx::IntRectTyped<T>& rect)
{
return ToWrRect(IntRectToRect(rect));
}
template<class T>
static inline WrSize ToWrSize(const gfx::SizeTyped<T>& size)
static inline wr::WrSize ToWrSize(const gfx::SizeTyped<T>& size)
{
WrSize ls;
wr::WrSize ls;
ls.width = size.width;
ls.height = size.height;
return ls;
}
static inline WrComplexClipRegion ToWrComplexClipRegion(const RoundedRect& rect)
static inline wr::WrComplexClipRegion ToWrComplexClipRegion(const RoundedRect& rect)
{
WrComplexClipRegion ret;
wr::WrComplexClipRegion ret;
ret.rect = ToWrRect(rect.rect);
ret.radii.top_left = ToWrSize(rect.corners.radii[mozilla::eCornerTopLeft]);
ret.radii.top_right = ToWrSize(rect.corners.radii[mozilla::eCornerTopRight]);
@ -275,61 +274,61 @@ static inline WrComplexClipRegion ToWrComplexClipRegion(const RoundedRect& rect)
}
template<class T>
static inline WrSize ToWrSize(const gfx::IntSizeTyped<T>& size)
static inline wr::WrSize ToWrSize(const gfx::IntSizeTyped<T>& size)
{
return ToWrSize(IntSizeToSize(size));
}
template<class S, class T>
static inline WrMatrix ToWrMatrix(const gfx::Matrix4x4Typed<S, T>& m)
static inline wr::WrMatrix ToWrMatrix(const gfx::Matrix4x4Typed<S, T>& m)
{
WrMatrix transform;
wr::WrMatrix transform;
static_assert(sizeof(m.components) == sizeof(transform.values),
"Matrix components size mismatch!");
memcpy(transform.values, m.components, sizeof(transform.values));
return transform;
}
static inline WrBorderStyle ToWrBorderStyle(const uint8_t& style)
static inline wr::WrBorderStyle ToWrBorderStyle(const uint8_t& style)
{
switch (style) {
case NS_STYLE_BORDER_STYLE_NONE:
return WrBorderStyle::None;
return wr::WrBorderStyle::None;
case NS_STYLE_BORDER_STYLE_SOLID:
return WrBorderStyle::Solid;
return wr::WrBorderStyle::Solid;
case NS_STYLE_BORDER_STYLE_DOUBLE:
return WrBorderStyle::Double;
return wr::WrBorderStyle::Double;
case NS_STYLE_BORDER_STYLE_DOTTED:
return WrBorderStyle::Dotted;
return wr::WrBorderStyle::Dotted;
case NS_STYLE_BORDER_STYLE_DASHED:
return WrBorderStyle::Dashed;
return wr::WrBorderStyle::Dashed;
case NS_STYLE_BORDER_STYLE_HIDDEN:
return WrBorderStyle::Hidden;
return wr::WrBorderStyle::Hidden;
case NS_STYLE_BORDER_STYLE_GROOVE:
return WrBorderStyle::Groove;
return wr::WrBorderStyle::Groove;
case NS_STYLE_BORDER_STYLE_RIDGE:
return WrBorderStyle::Ridge;
return wr::WrBorderStyle::Ridge;
case NS_STYLE_BORDER_STYLE_INSET:
return WrBorderStyle::Inset;
return wr::WrBorderStyle::Inset;
case NS_STYLE_BORDER_STYLE_OUTSET:
return WrBorderStyle::Outset;
return wr::WrBorderStyle::Outset;
default:
MOZ_ASSERT(false);
}
return WrBorderStyle::None;
return wr::WrBorderStyle::None;
}
static inline WrBorderSide ToWrBorderSide(const gfx::Color& color, const uint8_t& style)
static inline wr::WrBorderSide ToWrBorderSide(const gfx::Color& color, const uint8_t& style)
{
WrBorderSide bs;
wr::WrBorderSide bs;
bs.color = ToWrColor(color);
bs.style = ToWrBorderStyle(style);
return bs;
}
static inline WrBorderRadius ToWrUniformBorderRadius(const LayerSize& aSize)
static inline wr::WrBorderRadius ToWrUniformBorderRadius(const LayerSize& aSize)
{
WrBorderRadius br;
wr::WrBorderRadius br;
br.top_left = ToWrSize(aSize);
br.top_right = ToWrSize(aSize);
br.bottom_left = ToWrSize(aSize);
@ -337,10 +336,10 @@ static inline WrBorderRadius ToWrUniformBorderRadius(const LayerSize& aSize)
return br;
}
static inline WrBorderRadius ToWrBorderRadius(const LayerSize& topLeft, const LayerSize& topRight,
const LayerSize& bottomLeft, const LayerSize& bottomRight)
static inline wr::WrBorderRadius ToWrBorderRadius(const LayerSize& topLeft, const LayerSize& topRight,
const LayerSize& bottomLeft, const LayerSize& bottomRight)
{
WrBorderRadius br;
wr::WrBorderRadius br;
br.top_left = ToWrSize(topLeft);
br.top_right = ToWrSize(topRight);
br.bottom_left = ToWrSize(bottomLeft);
@ -348,9 +347,9 @@ static inline WrBorderRadius ToWrBorderRadius(const LayerSize& topLeft, const La
return br;
}
static inline WrBorderWidths ToWrBorderWidths(float top, float right, float bottom, float left)
static inline wr::WrBorderWidths ToWrBorderWidths(float top, float right, float bottom, float left)
{
WrBorderWidths bw;
wr::WrBorderWidths bw;
bw.top = top;
bw.right = right;
bw.bottom = bottom;
@ -358,8 +357,8 @@ static inline WrBorderWidths ToWrBorderWidths(float top, float right, float bott
return bw;
}
static inline WrNinePatchDescriptor ToWrNinePatchDescriptor(uint32_t width, uint32_t height,
const WrSideOffsets2Du32& slice)
static inline wr::WrNinePatchDescriptor ToWrNinePatchDescriptor(uint32_t width, uint32_t height,
const wr::WrSideOffsets2Du32& slice)
{
WrNinePatchDescriptor patch;
patch.width = width;
@ -368,7 +367,7 @@ static inline WrNinePatchDescriptor ToWrNinePatchDescriptor(uint32_t width, uint
return patch;
}
static inline WrSideOffsets2Du32 ToWrSideOffsets2Du32(uint32_t top, uint32_t right, uint32_t bottom, uint32_t left)
static inline wr::WrSideOffsets2Du32 ToWrSideOffsets2Du32(uint32_t top, uint32_t right, uint32_t bottom, uint32_t left)
{
WrSideOffsets2Du32 offset;
offset.top = top;
@ -378,7 +377,7 @@ static inline WrSideOffsets2Du32 ToWrSideOffsets2Du32(uint32_t top, uint32_t rig
return offset;
}
static inline WrSideOffsets2Df32 ToWrSideOffsets2Df32(float top, float right, float bottom, float left)
static inline wr::WrSideOffsets2Df32 ToWrSideOffsets2Df32(float top, float right, float bottom, float left)
{
WrSideOffsets2Df32 offset;
offset.top = top;
@ -388,54 +387,54 @@ static inline WrSideOffsets2Df32 ToWrSideOffsets2Df32(float top, float right, fl
return offset;
}
static inline WrRepeatMode ToWrRepeatMode(uint8_t repeatMode)
static inline wr::WrRepeatMode ToWrRepeatMode(uint8_t repeatMode)
{
switch (repeatMode) {
case NS_STYLE_BORDER_IMAGE_REPEAT_STRETCH:
return WrRepeatMode::Stretch;
return wr::WrRepeatMode::Stretch;
case NS_STYLE_BORDER_IMAGE_REPEAT_REPEAT:
return WrRepeatMode::Repeat;
return wr::WrRepeatMode::Repeat;
case NS_STYLE_BORDER_IMAGE_REPEAT_ROUND:
return WrRepeatMode::Round;
return wr::WrRepeatMode::Round;
case NS_STYLE_BORDER_IMAGE_REPEAT_SPACE:
return WrRepeatMode::Space;
return wr::WrRepeatMode::Space;
default:
MOZ_ASSERT(false);
}
return WrRepeatMode::Stretch;
return wr::WrRepeatMode::Stretch;
}
template<class S, class T>
static inline WrTransformProperty ToWrTransformProperty(uint64_t id,
const gfx::Matrix4x4Typed<S, T>& transform)
static inline wr::WrTransformProperty ToWrTransformProperty(uint64_t id,
const gfx::Matrix4x4Typed<S, T>& transform)
{
WrTransformProperty prop;
wr::WrTransformProperty prop;
prop.id = id;
prop.transform = ToWrMatrix(transform);
return prop;
}
static inline WrOpacityProperty ToWrOpacityProperty(uint64_t id, const float opacity)
static inline wr::WrOpacityProperty ToWrOpacityProperty(uint64_t id, const float opacity)
{
WrOpacityProperty prop;
wr::WrOpacityProperty prop;
prop.id = id;
prop.opacity = opacity;
return prop;
}
static inline WrComplexClipRegion ToWrComplexClipRegion(const WrRect& rect,
const LayerSize& size)
static inline wr::WrComplexClipRegion ToWrComplexClipRegion(const wr::WrRect& rect,
const LayerSize& size)
{
WrComplexClipRegion complex_clip;
wr::WrComplexClipRegion complex_clip;
complex_clip.rect = rect;
complex_clip.radii = wr::ToWrUniformBorderRadius(size);
return complex_clip;
}
template<class T>
static inline WrComplexClipRegion ToWrComplexClipRegion(const gfx::RectTyped<T>& rect,
const LayerSize& size)
static inline wr::WrComplexClipRegion ToWrComplexClipRegion(const gfx::RectTyped<T>& rect,
const LayerSize& size)
{
return ToWrComplexClipRegion(wr::ToWrRect(rect), size);
}
@ -452,29 +451,29 @@ static inline ExternalImageId ToExternalImageId(uint64_t aID)
return Id;
}
static inline WrExternalImage RawDataToWrExternalImage(const uint8_t* aBuff,
size_t size)
static inline wr::WrExternalImage RawDataToWrExternalImage(const uint8_t* aBuff,
size_t size)
{
return WrExternalImage {
WrExternalImageType::RawData,
return wr::WrExternalImage {
wr::WrExternalImageType::RawData,
0, 0.0f, 0.0f, 0.0f, 0.0f,
aBuff, size
};
}
static inline WrExternalImage NativeTextureToWrExternalImage(uint32_t aHandle,
float u0, float v0,
float u1, float v1)
static inline wr::WrExternalImage NativeTextureToWrExternalImage(uint32_t aHandle,
float u0, float v0,
float u1, float v1)
{
return WrExternalImage {
WrExternalImageType::NativeTexture,
return wr::WrExternalImage {
wr::WrExternalImageType::NativeTexture,
aHandle, u0, v0, u1, v1,
nullptr, 0
};
}
struct VecU8 {
WrVecU8 inner;
wr::WrVecU8 inner;
VecU8() {
SetEmpty();
}
@ -491,9 +490,9 @@ struct VecU8 {
return *this;
}
WrVecU8
wr::WrVecU8
Extract() {
WrVecU8 ret = inner;
wr::WrVecU8 ret = inner;
SetEmpty();
return ret;
}
@ -577,49 +576,49 @@ struct ByteBuffer
bool mOwned;
};
inline WrByteSlice RangeToByteSlice(mozilla::Range<uint8_t> aRange) {
return WrByteSlice { aRange.begin().get(), aRange.length() };
inline wr::WrByteSlice RangeToByteSlice(mozilla::Range<uint8_t> aRange) {
return wr::WrByteSlice { aRange.begin().get(), aRange.length() };
}
inline mozilla::Range<const uint8_t> ByteSliceToRange(WrByteSlice aWrSlice) {
inline mozilla::Range<const uint8_t> ByteSliceToRange(wr::WrByteSlice aWrSlice) {
return mozilla::Range<const uint8_t>(aWrSlice.buffer, aWrSlice.len);
}
inline mozilla::Range<uint8_t> MutByteSliceToRange(MutByteSlice aWrSlice) {
inline mozilla::Range<uint8_t> MutByteSliceToRange(wr::MutByteSlice aWrSlice) {
return mozilla::Range<uint8_t>(aWrSlice.buffer, aWrSlice.len);
}
struct BuiltDisplayList {
VecU8 dl;
WrBuiltDisplayListDescriptor dl_desc;
wr::VecU8 dl;
wr::WrBuiltDisplayListDescriptor dl_desc;
};
static inline WrFilterOpType ToWrFilterOpType(const layers::CSSFilterType type) {
static inline wr::WrFilterOpType ToWrFilterOpType(const layers::CSSFilterType type) {
switch (type) {
case layers::CSSFilterType::BLUR:
return WrFilterOpType::Blur;
return wr::WrFilterOpType::Blur;
case layers::CSSFilterType::BRIGHTNESS:
return WrFilterOpType::Brightness;
return wr::WrFilterOpType::Brightness;
case layers::CSSFilterType::CONTRAST:
return WrFilterOpType::Contrast;
return wr::WrFilterOpType::Contrast;
case layers::CSSFilterType::GRAYSCALE:
return WrFilterOpType::Grayscale;
return wr::WrFilterOpType::Grayscale;
case layers::CSSFilterType::HUE_ROTATE:
return WrFilterOpType::HueRotate;
return wr::WrFilterOpType::HueRotate;
case layers::CSSFilterType::INVERT:
return WrFilterOpType::Invert;
return wr::WrFilterOpType::Invert;
case layers::CSSFilterType::OPACITY:
return WrFilterOpType::Opacity;
return wr::WrFilterOpType::Opacity;
case layers::CSSFilterType::SATURATE:
return WrFilterOpType::Saturate;
return wr::WrFilterOpType::Saturate;
case layers::CSSFilterType::SEPIA:
return WrFilterOpType::Sepia;
return wr::WrFilterOpType::Sepia;
}
MOZ_ASSERT_UNREACHABLE("Tried to convert unknown filter type.");
return WrFilterOpType::Grayscale;
return wr::WrFilterOpType::Grayscale;
}
static inline WrFilterOp ToWrFilterOp(const layers::CSSFilter& filter) {
static inline wr::WrFilterOp ToWrFilterOp(const layers::CSSFilter& filter) {
return {
ToWrFilterOpType(filter.type),
filter.argument,

Просмотреть файл

@ -12,6 +12,7 @@ braces = "SameLine"
line_length = 100
tab_width = 2
language = "C++"
namespaces = ["mozilla", "wr"]
[parse]
parse_deps = true

Просмотреть файл

@ -48,12 +48,15 @@ void* get_proc_address_from_glcontext(void* glcontext_ptr, const char* procname)
#undef WR_FUNC
#undef WR_DESTRUCTOR_SAFE_FUNC
namespace mozilla {
namespace wr {
struct WrGlyphArray
{
mozilla::gfx::Color color;
nsTArray<WrGlyphInstance> glyphs;
nsTArray<wr::WrGlyphInstance> glyphs;
bool operator==(const WrGlyphArray& other) const
bool operator==(const wr::WrGlyphArray& other) const
{
if (!(color == other.color) ||
(glyphs.Length() != other.glyphs.Length())) {
@ -70,4 +73,7 @@ struct WrGlyphArray
}
};
} // namespace wr
} // namespace mozilla
#endif // WR_h

Просмотреть файл

@ -2,7 +2,7 @@
* 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.13 */
/* Generated with cbindgen:0.1.14 */
/* DO NOT MODIFY THIS MANUALLY! This file was generated using cbindgen.
* To generate this file:
@ -16,6 +16,9 @@
extern "C" {
namespace mozilla {
namespace wr {
enum class WrBorderStyle : uint32_t {
None = 0,
Solid = 1,
@ -955,6 +958,9 @@ bool wr_window_new(WrWindowId aWindowId,
WrRenderer **aOutRenderer)
WR_FUNC;
} // namespace wr
} // namespace mozilla
} // extern "C"
/* DO NOT MODIFY THIS MANUALLY! This file was generated using cbindgen.

Просмотреть файл

@ -472,11 +472,11 @@ BulletRenderer::CreateWebRenderCommandsForImage(nsDisplayItem* aItem,
const int32_t appUnitsPerDevPixel = aItem->Frame()->PresContext()->AppUnitsPerDevPixel();
LayoutDeviceRect destRect = LayoutDeviceRect::FromAppUnits(mDest, appUnitsPerDevPixel);
WrRect dest = aSc.ToRelativeWrRectRounded(destRect);
wr::WrRect dest = aSc.ToRelativeWrRectRounded(destRect);
aBuilder.PushImage(dest,
dest,
WrImageRendering::Auto,
wr::WrImageRendering::Auto,
key.value());
}

Просмотреть файл

@ -327,7 +327,7 @@ nsDisplayCanvasBackgroundColor::CreateWebRenderCommands(mozilla::wr::DisplayList
LayoutDeviceRect rect = LayoutDeviceRect::FromAppUnits(
bgClipRect, appUnitsPerDevPixel);
WrRect transformedRect = aSc.ToRelativeWrRect(rect);
wr::WrRect transformedRect = aSc.ToRelativeWrRect(rect);
aBuilder.PushRect(transformedRect,
transformedRect,
wr::ToWrColor(ToDeviceColor(mColor)));

Просмотреть файл

@ -3555,17 +3555,17 @@ nsCSSBorderRenderer::CreateWebRenderCommands(wr::DisplayListBuilder& aBuilder,
const layers::StackingContextHelper& aSc)
{
LayoutDeviceRect outerRect = LayoutDeviceRect::FromUnknownRect(mOuterRect);
WrRect transformedRect = aSc.ToRelativeWrRect(outerRect);
WrBorderSide side[4];
wr::WrRect transformedRect = aSc.ToRelativeWrRect(outerRect);
wr::WrBorderSide side[4];
NS_FOR_CSS_SIDES(i) {
side[i] = wr::ToWrBorderSide(ToDeviceColor(mBorderColors[i]), mBorderStyles[i]);
}
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 WrBorderSide> wrsides(side, 4);
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);
aBuilder.PushBorder(transformedRect,
transformedRect,
wr::ToWrBorderWidths(mBorderWidths[0], mBorderWidths[1], mBorderWidths[2], mBorderWidths[3]),

Просмотреть файл

@ -1001,13 +1001,13 @@ nsCSSGradientRenderer::Paint(gfxContext& aContext,
void
nsCSSGradientRenderer::BuildWebRenderParameters(float aOpacity,
WrGradientExtendMode& aMode,
nsTArray<WrGradientStop>& aStops,
wr::WrGradientExtendMode& aMode,
nsTArray<wr::WrGradientStop>& aStops,
LayoutDevicePoint& aLineStart,
LayoutDevicePoint& aLineEnd,
LayoutDeviceSize& aGradientRadius)
{
aMode = mGradient->mRepeating ? WrGradientExtendMode::Repeat : WrGradientExtendMode::Clamp;
aMode = mGradient->mRepeating ? wr::WrGradientExtendMode::Repeat : wr::WrGradientExtendMode::Clamp;
aStops.SetLength(mStops.Length());
for(uint32_t i = 0; i < mStops.Length(); i++) {
@ -1037,8 +1037,8 @@ nsCSSGradientRenderer::BuildWebRenderDisplayItems(wr::DisplayListBuilder& aBuild
return;
}
WrGradientExtendMode extendMode;
nsTArray<WrGradientStop> stops;
wr::WrGradientExtendMode extendMode;
nsTArray<wr::WrGradientStop> stops;
LayoutDevicePoint lineStart;
LayoutDevicePoint lineEnd;
LayoutDeviceSize gradientRadius;
@ -1064,10 +1064,10 @@ nsCSSGradientRenderer::BuildWebRenderDisplayItems(wr::DisplayListBuilder& aBuild
LayoutDeviceSize tileSpacing = tileRepeat - firstTileBounds.Size();
// Make the rects relative to the parent stacking context
WrRect wrClipBounds = aSc.ToRelativeWrRect(clipBounds);
wr::WrRect wrClipBounds = aSc.ToRelativeWrRect(clipBounds);
LayerSize layerFirstTileSize = ViewAs<LayerPixel>(firstTileBounds.Size(),
PixelCastJustification::WebRenderHasUnitResolution);
WrRect wrGradientBounds = aSc.ToRelativeWrRect(gradientBounds);
wr::WrRect wrGradientBounds = aSc.ToRelativeWrRect(gradientBounds);
// srcTransform is used for scaling the gradient to match aSrc
LayoutDeviceRect srcTransform = LayoutDeviceRect(mPresContext->CSSPixelsToAppUnits(aSrc.x),

Просмотреть файл

@ -65,8 +65,8 @@ public:
* Collect the gradient parameters
*/
void BuildWebRenderParameters(float aOpacity,
WrGradientExtendMode& aMode,
nsTArray<WrGradientStop>& aStops,
wr::WrGradientExtendMode& aMode,
nsTArray<wr::WrGradientStop>& aStops,
LayoutDevicePoint& aLineStart,
LayoutDevicePoint& aLineEnd,
LayoutDeviceSize& aGradientRadius);

Просмотреть файл

@ -4176,7 +4176,7 @@ nsDisplayBackgroundColor::CreateWebRenderCommands(mozilla::wr::DisplayListBuilde
LayoutDeviceRect bounds = LayoutDeviceRect::FromAppUnits(
mBackgroundRect, mFrame->PresContext()->AppUnitsPerDevPixel());
WrRect transformedRect = aSc.ToRelativeWrRect(bounds);
wr::WrRect transformedRect = aSc.ToRelativeWrRect(bounds);
aBuilder.PushRect(transformedRect,
transformedRect,
@ -4690,8 +4690,8 @@ nsDisplayCaret::CreateWebRenderCommands(mozilla::wr::DisplayListBuilder& aBuilde
LayoutDeviceRect devHookRect = LayoutDeviceRect::FromAppUnits(
hookRect + ToReferenceFrame(), appUnitsPerDevPixel);
WrRect caret = aSc.ToRelativeWrRectRounded(devCaretRect);
WrRect hook = aSc.ToRelativeWrRectRounded(devHookRect);
wr::WrRect caret = aSc.ToRelativeWrRectRounded(devCaretRect);
wr::WrRect hook = aSc.ToRelativeWrRectRounded(devHookRect);
// Note, WR will pixel snap anything that is layout aligned.
aBuilder.PushRect(caret,
@ -4969,9 +4969,9 @@ nsDisplayBorder::CreateBorderImageWebRenderCommands(mozilla::wr::DisplayListBuil
LayoutDeviceRect destRect = LayoutDeviceRect::FromAppUnits(
mBorderImageRenderer->mArea, appUnitsPerDevPixel);
WrRect dest = aSc.ToRelativeWrRectRounded(destRect);
wr::WrRect dest = aSc.ToRelativeWrRectRounded(destRect);
WrRect clip = dest;
wr::WrRect clip = dest;
if (!mBorderImageRenderer->mClip.IsEmpty()) {
LayoutDeviceRect clipRect = LayoutDeviceRect::FromAppUnits(
mBorderImageRenderer->mClip, appUnitsPerDevPixel);
@ -5017,8 +5017,8 @@ nsDisplayBorder::CreateBorderImageWebRenderCommands(mozilla::wr::DisplayListBuil
nsCSSGradientRenderer::Create(mFrame->PresContext(), gradientData,
mBorderImageRenderer->mImageSize);
WrGradientExtendMode extendMode;
nsTArray<WrGradientStop> stops;
wr::WrGradientExtendMode extendMode;
nsTArray<wr::WrGradientStop> stops;
LayoutDevicePoint lineStart;
LayoutDevicePoint lineEnd;
LayoutDeviceSize gradientRadius;
@ -5350,8 +5350,8 @@ nsDisplayBoxShadowOuter::CreateWebRenderCommands(mozilla::wr::DisplayListBuilder
LayoutDeviceRect deviceBox = LayoutDeviceRect::FromAppUnits(
shadowRect, appUnitsPerDevPixel);
WrRect deviceBoxRect = aSc.ToRelativeWrRectRounded(deviceBox);
WrRect deviceClipRect = aSc.ToRelativeWrRect(clipRect);
wr::WrRect deviceBoxRect = aSc.ToRelativeWrRectRounded(deviceBox);
wr::WrRect deviceClipRect = aSc.ToRelativeWrRect(clipRect);
// TODO: support non-uniform border radius.
float borderRadius = hasBorderRadius ? borderRadii.TopLeft().width
@ -5366,7 +5366,7 @@ nsDisplayBoxShadowOuter::CreateWebRenderCommands(mozilla::wr::DisplayListBuilder
blurRadius,
spreadRadius,
borderRadius,
WrBoxShadowClipMode::Outset);
wr::WrBoxShadowClipMode::Outset);
}
}
@ -5503,7 +5503,7 @@ nsDisplayBoxShadowInner::CreateInsetBoxShadowWebRenderCommands(mozilla::wr::Disp
// Now translate everything to device pixels.
Rect deviceBoxRect = LayoutDeviceRect::FromAppUnits(
shadowRect, appUnitsPerDevPixel).ToUnknownRect();
WrRect deviceClipRect = aSc.ToRelativeWrRect(clipRect);
wr::WrRect deviceClipRect = aSc.ToRelativeWrRect(clipRect);
Color shadowColor = nsCSSRendering::GetShadowColor(shadowItem, aFrame, 1.0);
Point shadowOffset;
@ -5524,7 +5524,7 @@ nsDisplayBoxShadowInner::CreateInsetBoxShadowWebRenderCommands(mozilla::wr::Disp
blurRadius,
spreadRadius,
borderRadius,
WrBoxShadowClipMode::Inset
wr::WrBoxShadowClipMode::Inset
);
}
}
@ -7583,7 +7583,7 @@ nsDisplayTransform::CreateWebRenderCommands(mozilla::wr::DisplayListBuilder& aBu
// TODO: generate animationsId for OMTA.
uint64_t animationsId = 0;
nsTArray<WrFilterOp> filters;
nsTArray<wr::WrFilterOp> filters;
StackingContextHelper sc(aSc,
aBuilder,
bounds,

Просмотреть файл

@ -651,8 +651,8 @@ nsImageRenderer::BuildWebRenderDisplayItems(nsPresContext* aPresContext,
nsRect(firstTilePos.x, firstTilePos.y,
aFill.XMost() - firstTilePos.x, aFill.YMost() - firstTilePos.y),
appUnitsPerDevPixel);
WrRect fill = aSc.ToRelativeWrRect(fillRect);
WrRect clip = aSc.ToRelativeWrRect(
wr::WrRect fill = aSc.ToRelativeWrRect(fillRect);
wr::WrRect clip = aSc.ToRelativeWrRect(
LayoutDeviceRect::FromAppUnits(aFill, appUnitsPerDevPixel));
LayoutDeviceSize gapSize = LayoutDeviceSize::FromAppUnits(

Просмотреть файл

@ -7444,23 +7444,23 @@ BCBlockDirSeg::CreateWebRenderCommands(BCPaintBorderIterator& aIter,
LayoutDeviceRect borderRect = LayoutDeviceRect::FromUnknownRect(NSRectToRect(param->mBorderRect + aOffset,
param->mAppUnitsPerDevPixel));
WrRect transformedRect = aSc.ToRelativeWrRect(borderRect);
WrBorderSide wrSide[4];
wr::WrRect transformedRect = aSc.ToRelativeWrRect(borderRect);
wr::WrBorderSide 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);
WrBorderRadius borderRadii = wr::ToWrBorderRadius( {0, 0}, {0, 0}, {0, 0}, {0, 0} );
wr::WrBorderRadius borderRadii = wr::ToWrBorderRadius( {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.
WrBorderWidths borderWidths = wr::ToWrBorderWidths(transformedRect.width,
transformedRect.width,
transformedRect.width,
transformedRect.width);
wr::WrBorderWidths borderWidths = wr::ToWrBorderWidths(transformedRect.width,
transformedRect.width,
transformedRect.width,
transformedRect.width);
transformedRect.width *= 2.0f;
Range<const WrBorderSide> wrsides(wrSide, 4);
Range<const wr::WrBorderSide> wrsides(wrSide, 4);
aBuilder.PushBorder(transformedRect,
transformedRect,
borderWidths,
@ -7702,23 +7702,23 @@ BCInlineDirSeg::CreateWebRenderCommands(BCPaintBorderIterator& aIter,
LayoutDeviceRect borderRect = LayoutDeviceRect::FromUnknownRect(NSRectToRect(param->mBorderRect + aPt,
param->mAppUnitsPerDevPixel));
WrRect transformedRect = aSc.ToRelativeWrRect(borderRect);
WrBorderSide wrSide[4];
wr::WrRect transformedRect = aSc.ToRelativeWrRect(borderRect);
wr::WrBorderSide 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);
WrBorderRadius borderRadii = wr::ToWrBorderRadius( {0, 0}, {0, 0}, {0, 0}, {0, 0} );
wr::WrBorderRadius borderRadii = wr::ToWrBorderRadius( {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.
WrBorderWidths borderWidths = wr::ToWrBorderWidths(transformedRect.height,
transformedRect.height,
transformedRect.height,
transformedRect.height);
wr::WrBorderWidths borderWidths = wr::ToWrBorderWidths(transformedRect.height,
transformedRect.height,
transformedRect.height,
transformedRect.height);
transformedRect.height *= 2.0f;
Range<const WrBorderSide> wrsides(wrSide, 4);
Range<const wr::WrBorderSide> wrsides(wrSide, 4);
aBuilder.PushBorder(transformedRect,
transformedRect,
borderWidths,

Просмотреть файл

@ -2114,8 +2114,8 @@ nsChildView::AddWindowOverlayWebRenderCommands(layers::WebRenderBridgeChild* aWr
aWrBridge->SendUpdateImage(*mTitlebarImageKey, size, format, buffer);
}
WrRect rect = wr::ToWrRect(mTitlebarRect);
aBuilder.PushImage(WrRect{ 0, 0, float(size.width), float(size.height) },
wr::WrRect rect = wr::ToWrRect(mTitlebarRect);
aBuilder.PushImage(wr::WrRect{ 0, 0, float(size.width), float(size.height) },
rect, wr::ImageRendering::Auto, *mTitlebarImageKey);
}
}