зеркало из https://github.com/mozilla/gecko-dev.git
Backed out changeset 0cb5cf87cb27 (bug 1617808) for bustages on bindings.rs . CLOSED TREE
--HG-- extra : rebase_source : be2dec023bc815d6e4ed4410c81345968ded211e
This commit is contained in:
Родитель
32ad653b14
Коммит
4728031ab3
|
@ -150,28 +150,28 @@ uint32_t GPUVideoTextureHost::NumSubTextures() {
|
|||
|
||||
void GPUVideoTextureHost::PushResourceUpdates(
|
||||
wr::TransactionBuilder& aResources, ResourceUpdateOp aOp,
|
||||
const Range<wr::ImageKey>& aImageKeys, const wr::ExternalImageId& aExtID) {
|
||||
const Range<wr::ImageKey>& aImageKeys, const wr::ExternalImageId& aExtID,
|
||||
const bool aPreferCompositorSurface) {
|
||||
MOZ_ASSERT(EnsureWrappedTextureHost());
|
||||
if (!EnsureWrappedTextureHost()) {
|
||||
return;
|
||||
}
|
||||
EnsureWrappedTextureHost()->PushResourceUpdates(aResources, aOp, aImageKeys,
|
||||
aExtID);
|
||||
EnsureWrappedTextureHost()->PushResourceUpdates(
|
||||
aResources, aOp, aImageKeys, aExtID, aPreferCompositorSurface);
|
||||
}
|
||||
|
||||
void GPUVideoTextureHost::PushDisplayItems(
|
||||
wr::DisplayListBuilder& aBuilder, const wr::LayoutRect& aBounds,
|
||||
const wr::LayoutRect& aClip, wr::ImageRendering aFilter,
|
||||
const Range<wr::ImageKey>& aImageKeys,
|
||||
const bool aPreferCompositorSurface) {
|
||||
const Range<wr::ImageKey>& aImageKeys) {
|
||||
MOZ_ASSERT(EnsureWrappedTextureHost());
|
||||
MOZ_ASSERT(aImageKeys.length() > 0);
|
||||
if (!EnsureWrappedTextureHost()) {
|
||||
return;
|
||||
}
|
||||
|
||||
EnsureWrappedTextureHost()->PushDisplayItems(
|
||||
aBuilder, aBounds, aClip, aFilter, aImageKeys, aPreferCompositorSurface);
|
||||
EnsureWrappedTextureHost()->PushDisplayItems(aBuilder, aBounds, aClip,
|
||||
aFilter, aImageKeys);
|
||||
}
|
||||
|
||||
} // namespace layers
|
||||
|
|
|
@ -56,13 +56,13 @@ class GPUVideoTextureHost : public TextureHost {
|
|||
void PushResourceUpdates(wr::TransactionBuilder& aResources,
|
||||
ResourceUpdateOp aOp,
|
||||
const Range<wr::ImageKey>& aImageKeys,
|
||||
const wr::ExternalImageId& aExtID) override;
|
||||
const wr::ExternalImageId& aExtID,
|
||||
const bool aPreferCompositorSurface) override;
|
||||
|
||||
void PushDisplayItems(wr::DisplayListBuilder& aBuilder,
|
||||
const wr::LayoutRect& aBounds,
|
||||
const wr::LayoutRect& aClip, wr::ImageRendering aFilter,
|
||||
const Range<wr::ImageKey>& aImageKeys,
|
||||
const bool aPreferCompositorSurface) override;
|
||||
const Range<wr::ImageKey>& aImageKeys) override;
|
||||
|
||||
protected:
|
||||
GPUVideoTextureHost(TextureFlags aFlags,
|
||||
|
|
|
@ -613,7 +613,8 @@ uint32_t BufferTextureHost::NumSubTextures() {
|
|||
|
||||
void BufferTextureHost::PushResourceUpdates(
|
||||
wr::TransactionBuilder& aResources, ResourceUpdateOp aOp,
|
||||
const Range<wr::ImageKey>& aImageKeys, const wr::ExternalImageId& aExtID) {
|
||||
const Range<wr::ImageKey>& aImageKeys, const wr::ExternalImageId& aExtID,
|
||||
const bool aPreferCompositorSurface) {
|
||||
auto method = aOp == TextureHost::ADD_IMAGE
|
||||
? &wr::TransactionBuilder::AddExternalImage
|
||||
: &wr::TransactionBuilder::UpdateExternalImage;
|
||||
|
@ -625,7 +626,7 @@ void BufferTextureHost::PushResourceUpdates(
|
|||
wr::ImageDescriptor descriptor(
|
||||
GetSize(),
|
||||
ImageDataSerializer::ComputeRGBStride(GetFormat(), GetSize().width),
|
||||
GetFormat());
|
||||
GetFormat(), aPreferCompositorSurface);
|
||||
(aResources.*method)(aImageKeys[0], descriptor, aExtID, imageType, 0);
|
||||
} else {
|
||||
MOZ_ASSERT(aImageKeys.length() == 3);
|
||||
|
@ -633,37 +634,34 @@ void BufferTextureHost::PushResourceUpdates(
|
|||
const layers::YCbCrDescriptor& desc = mDescriptor.get_YCbCrDescriptor();
|
||||
wr::ImageDescriptor yDescriptor(
|
||||
desc.ySize(), desc.yStride(),
|
||||
SurfaceFormatForColorDepth(desc.colorDepth()));
|
||||
SurfaceFormatForColorDepth(desc.colorDepth()),
|
||||
aPreferCompositorSurface);
|
||||
wr::ImageDescriptor cbcrDescriptor(
|
||||
desc.cbCrSize(), desc.cbCrStride(),
|
||||
SurfaceFormatForColorDepth(desc.colorDepth()));
|
||||
SurfaceFormatForColorDepth(desc.colorDepth()),
|
||||
aPreferCompositorSurface);
|
||||
(aResources.*method)(aImageKeys[0], yDescriptor, aExtID, imageType, 0);
|
||||
(aResources.*method)(aImageKeys[1], cbcrDescriptor, aExtID, imageType, 1);
|
||||
(aResources.*method)(aImageKeys[2], cbcrDescriptor, aExtID, imageType, 2);
|
||||
}
|
||||
}
|
||||
|
||||
void BufferTextureHost::PushDisplayItems(wr::DisplayListBuilder& aBuilder,
|
||||
const wr::LayoutRect& aBounds,
|
||||
const wr::LayoutRect& aClip,
|
||||
wr::ImageRendering aFilter,
|
||||
const Range<wr::ImageKey>& aImageKeys,
|
||||
const bool aPreferCompositorSurface) {
|
||||
void BufferTextureHost::PushDisplayItems(
|
||||
wr::DisplayListBuilder& aBuilder, const wr::LayoutRect& aBounds,
|
||||
const wr::LayoutRect& aClip, wr::ImageRendering aFilter,
|
||||
const Range<wr::ImageKey>& aImageKeys) {
|
||||
if (GetFormat() != gfx::SurfaceFormat::YUV) {
|
||||
MOZ_ASSERT(aImageKeys.length() == 1);
|
||||
aBuilder.PushImage(aBounds, aClip, true, aFilter, aImageKeys[0],
|
||||
!(mFlags & TextureFlags::NON_PREMULTIPLIED),
|
||||
wr::ColorF{1.0f, 1.0f, 1.0f, 1.0f},
|
||||
aPreferCompositorSurface);
|
||||
!(mFlags & TextureFlags::NON_PREMULTIPLIED));
|
||||
} else {
|
||||
MOZ_ASSERT(aImageKeys.length() == 3);
|
||||
const YCbCrDescriptor& desc = mDescriptor.get_YCbCrDescriptor();
|
||||
aBuilder.PushYCbCrPlanarImage(aBounds, aClip, true, aImageKeys[0],
|
||||
aImageKeys[1], aImageKeys[2],
|
||||
wr::ToWrColorDepth(desc.colorDepth()),
|
||||
wr::ToWrYuvColorSpace(desc.yUVColorSpace()),
|
||||
wr::ToWrColorRange(desc.colorRange()),
|
||||
aFilter, aPreferCompositorSurface);
|
||||
aBuilder.PushYCbCrPlanarImage(
|
||||
aBounds, aClip, true, aImageKeys[0], aImageKeys[1], aImageKeys[2],
|
||||
wr::ToWrColorDepth(desc.colorDepth()),
|
||||
wr::ToWrYuvColorSpace(desc.yUVColorSpace()),
|
||||
wr::ToWrColorRange(desc.colorRange()), aFilter);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -661,7 +661,8 @@ class TextureHost : public AtomicRefCountedWithFinalize<TextureHost> {
|
|||
virtual void PushResourceUpdates(wr::TransactionBuilder& aResources,
|
||||
ResourceUpdateOp aOp,
|
||||
const Range<wr::ImageKey>& aImageKeys,
|
||||
const wr::ExternalImageId& aExtID) {
|
||||
const wr::ExternalImageId& aExtID,
|
||||
const bool aPreferCompositorSurface) {
|
||||
MOZ_ASSERT_UNREACHABLE("Unimplemented");
|
||||
}
|
||||
|
||||
|
@ -671,8 +672,7 @@ class TextureHost : public AtomicRefCountedWithFinalize<TextureHost> {
|
|||
const wr::LayoutRect& aBounds,
|
||||
const wr::LayoutRect& aClip,
|
||||
wr::ImageRendering aFilter,
|
||||
const Range<wr::ImageKey>& aKeys,
|
||||
const bool aPreferCompositorSurface) {
|
||||
const Range<wr::ImageKey>& aKeys) {
|
||||
MOZ_ASSERT_UNREACHABLE(
|
||||
"No PushDisplayItems() implementation for this TextureHost type.");
|
||||
}
|
||||
|
@ -793,13 +793,13 @@ class BufferTextureHost : public TextureHost {
|
|||
void PushResourceUpdates(wr::TransactionBuilder& aResources,
|
||||
ResourceUpdateOp aOp,
|
||||
const Range<wr::ImageKey>& aImageKeys,
|
||||
const wr::ExternalImageId& aExtID) override;
|
||||
const wr::ExternalImageId& aExtID,
|
||||
const bool aPreferCompositorSurface) override;
|
||||
|
||||
void PushDisplayItems(wr::DisplayListBuilder& aBuilder,
|
||||
const wr::LayoutRect& aBounds,
|
||||
const wr::LayoutRect& aClip, wr::ImageRendering aFilter,
|
||||
const Range<wr::ImageKey>& aImageKeys,
|
||||
const bool aPreferCompositorSurface) override;
|
||||
const Range<wr::ImageKey>& aImageKeys) override;
|
||||
|
||||
void ReadUnlock() override;
|
||||
bool IsDirectMap() override {
|
||||
|
|
|
@ -1010,7 +1010,8 @@ uint32_t DXGITextureHostD3D11::NumSubTextures() {
|
|||
|
||||
void DXGITextureHostD3D11::PushResourceUpdates(
|
||||
wr::TransactionBuilder& aResources, ResourceUpdateOp aOp,
|
||||
const Range<wr::ImageKey>& aImageKeys, const wr::ExternalImageId& aExtID) {
|
||||
const Range<wr::ImageKey>& aImageKeys, const wr::ExternalImageId& aExtID,
|
||||
const bool aPreferCompositorSurface) {
|
||||
if (!gfx::gfxVars::UseWebRenderANGLE()) {
|
||||
MOZ_ASSERT_UNREACHABLE("unexpected to be called without ANGLE");
|
||||
return;
|
||||
|
@ -1027,7 +1028,8 @@ void DXGITextureHostD3D11::PushResourceUpdates(
|
|||
case gfx::SurfaceFormat::B8G8R8X8: {
|
||||
MOZ_ASSERT(aImageKeys.length() == 1);
|
||||
|
||||
wr::ImageDescriptor descriptor(mSize, GetFormat());
|
||||
wr::ImageDescriptor descriptor(mSize, GetFormat(),
|
||||
aPreferCompositorSurface);
|
||||
auto imageType =
|
||||
wr::ExternalImageType::TextureHandle(wr::TextureTarget::External);
|
||||
(aResources.*method)(aImageKeys[0], descriptor, aExtID, imageType, 0);
|
||||
|
@ -1040,13 +1042,16 @@ void DXGITextureHostD3D11::PushResourceUpdates(
|
|||
MOZ_ASSERT(mSize.width % 2 == 0);
|
||||
MOZ_ASSERT(mSize.height % 2 == 0);
|
||||
|
||||
wr::ImageDescriptor descriptor0(mSize, mFormat == gfx::SurfaceFormat::NV12
|
||||
? gfx::SurfaceFormat::A8
|
||||
: gfx::SurfaceFormat::A16);
|
||||
wr::ImageDescriptor descriptor0(mSize,
|
||||
mFormat == gfx::SurfaceFormat::NV12
|
||||
? gfx::SurfaceFormat::A8
|
||||
: gfx::SurfaceFormat::A16,
|
||||
aPreferCompositorSurface);
|
||||
wr::ImageDescriptor descriptor1(mSize / 2,
|
||||
mFormat == gfx::SurfaceFormat::NV12
|
||||
? gfx::SurfaceFormat::R8G8
|
||||
: gfx::SurfaceFormat::R16G16);
|
||||
: gfx::SurfaceFormat::R16G16,
|
||||
aPreferCompositorSurface);
|
||||
auto imageType =
|
||||
wr::ExternalImageType::TextureHandle(wr::TextureTarget::External);
|
||||
(aResources.*method)(aImageKeys[0], descriptor0, aExtID, imageType, 0);
|
||||
|
@ -1062,8 +1067,7 @@ void DXGITextureHostD3D11::PushResourceUpdates(
|
|||
void DXGITextureHostD3D11::PushDisplayItems(
|
||||
wr::DisplayListBuilder& aBuilder, const wr::LayoutRect& aBounds,
|
||||
const wr::LayoutRect& aClip, wr::ImageRendering aFilter,
|
||||
const Range<wr::ImageKey>& aImageKeys,
|
||||
const bool aPreferCompositorSurface) {
|
||||
const Range<wr::ImageKey>& aImageKeys) {
|
||||
switch (GetFormat()) {
|
||||
case gfx::SurfaceFormat::R8G8B8X8:
|
||||
case gfx::SurfaceFormat::R8G8B8A8:
|
||||
|
@ -1071,21 +1075,19 @@ void DXGITextureHostD3D11::PushDisplayItems(
|
|||
case gfx::SurfaceFormat::B8G8R8X8: {
|
||||
MOZ_ASSERT(aImageKeys.length() == 1);
|
||||
aBuilder.PushImage(aBounds, aClip, true, aFilter, aImageKeys[0],
|
||||
!(mFlags & TextureFlags::NON_PREMULTIPLIED),
|
||||
wr::ColorF{1.0f, 1.0f, 1.0f, 1.0f},
|
||||
aPreferCompositorSurface);
|
||||
!(mFlags & TextureFlags::NON_PREMULTIPLIED));
|
||||
break;
|
||||
}
|
||||
case gfx::SurfaceFormat::P010:
|
||||
case gfx::SurfaceFormat::P016:
|
||||
case gfx::SurfaceFormat::NV12: {
|
||||
MOZ_ASSERT(aImageKeys.length() == 2);
|
||||
aBuilder.PushNV12Image(
|
||||
aBounds, aClip, true, aImageKeys[0], aImageKeys[1],
|
||||
GetFormat() == gfx::SurfaceFormat::NV12 ? wr::ColorDepth::Color8
|
||||
: wr::ColorDepth::Color16,
|
||||
wr::ToWrYuvColorSpace(mYUVColorSpace),
|
||||
wr::ToWrColorRange(mColorRange), aFilter, aPreferCompositorSurface);
|
||||
aBuilder.PushNV12Image(aBounds, aClip, true, aImageKeys[0], aImageKeys[1],
|
||||
GetFormat() == gfx::SurfaceFormat::NV12
|
||||
? wr::ColorDepth::Color8
|
||||
: wr::ColorDepth::Color16,
|
||||
wr::ToWrYuvColorSpace(mYUVColorSpace),
|
||||
wr::ToWrColorRange(mColorRange), aFilter);
|
||||
break;
|
||||
}
|
||||
default: {
|
||||
|
@ -1260,7 +1262,8 @@ uint32_t DXGIYCbCrTextureHostD3D11::NumSubTextures() {
|
|||
|
||||
void DXGIYCbCrTextureHostD3D11::PushResourceUpdates(
|
||||
wr::TransactionBuilder& aResources, ResourceUpdateOp aOp,
|
||||
const Range<wr::ImageKey>& aImageKeys, const wr::ExternalImageId& aExtID) {
|
||||
const Range<wr::ImageKey>& aImageKeys, const wr::ExternalImageId& aExtID,
|
||||
const bool aPreferCompositorSurface) {
|
||||
if (!gfx::gfxVars::UseWebRenderANGLE()) {
|
||||
MOZ_ASSERT_UNREACHABLE("unexpected to be called without ANGLE");
|
||||
return;
|
||||
|
@ -1281,9 +1284,11 @@ void DXGIYCbCrTextureHostD3D11::PushResourceUpdates(
|
|||
wr::ExternalImageType::TextureHandle(wr::TextureTarget::External);
|
||||
|
||||
// y
|
||||
wr::ImageDescriptor descriptor0(mSize, gfx::SurfaceFormat::A8);
|
||||
wr::ImageDescriptor descriptor0(mSize, gfx::SurfaceFormat::A8,
|
||||
aPreferCompositorSurface);
|
||||
// cb and cr
|
||||
wr::ImageDescriptor descriptor1(mSizeCbCr, gfx::SurfaceFormat::A8);
|
||||
wr::ImageDescriptor descriptor1(mSizeCbCr, gfx::SurfaceFormat::A8,
|
||||
aPreferCompositorSurface);
|
||||
(aResources.*method)(aImageKeys[0], descriptor0, aExtID, imageType, 0);
|
||||
(aResources.*method)(aImageKeys[1], descriptor1, aExtID, imageType, 1);
|
||||
(aResources.*method)(aImageKeys[2], descriptor1, aExtID, imageType, 2);
|
||||
|
@ -1292,14 +1297,13 @@ void DXGIYCbCrTextureHostD3D11::PushResourceUpdates(
|
|||
void DXGIYCbCrTextureHostD3D11::PushDisplayItems(
|
||||
wr::DisplayListBuilder& aBuilder, const wr::LayoutRect& aBounds,
|
||||
const wr::LayoutRect& aClip, wr::ImageRendering aFilter,
|
||||
const Range<wr::ImageKey>& aImageKeys,
|
||||
const bool aPreferCompositorSurface) {
|
||||
const Range<wr::ImageKey>& aImageKeys) {
|
||||
MOZ_ASSERT(aImageKeys.length() == 3);
|
||||
|
||||
aBuilder.PushYCbCrPlanarImage(
|
||||
aBounds, aClip, true, aImageKeys[0], aImageKeys[1], aImageKeys[2],
|
||||
wr::ToWrColorDepth(mColorDepth), wr::ToWrYuvColorSpace(mYUVColorSpace),
|
||||
wr::ToWrColorRange(mColorRange), aFilter, aPreferCompositorSurface);
|
||||
wr::ToWrColorRange(mColorRange), aFilter);
|
||||
}
|
||||
|
||||
bool DXGIYCbCrTextureHostD3D11::AcquireTextureSource(
|
||||
|
|
|
@ -354,13 +354,13 @@ class DXGITextureHostD3D11 : public TextureHost {
|
|||
void PushResourceUpdates(wr::TransactionBuilder& aResources,
|
||||
ResourceUpdateOp aOp,
|
||||
const Range<wr::ImageKey>& aImageKeys,
|
||||
const wr::ExternalImageId& aExtID) override;
|
||||
const wr::ExternalImageId& aExtID,
|
||||
const bool aPreferCompositorSurface) override;
|
||||
|
||||
void PushDisplayItems(wr::DisplayListBuilder& aBuilder,
|
||||
const wr::LayoutRect& aBounds,
|
||||
const wr::LayoutRect& aClip, wr::ImageRendering aFilter,
|
||||
const Range<wr::ImageKey>& aImageKeys,
|
||||
const bool aPreferCompositorSurface) override;
|
||||
const Range<wr::ImageKey>& aImageKeys) override;
|
||||
|
||||
protected:
|
||||
bool LockInternal();
|
||||
|
@ -423,13 +423,13 @@ class DXGIYCbCrTextureHostD3D11 : public TextureHost {
|
|||
void PushResourceUpdates(wr::TransactionBuilder& aResources,
|
||||
ResourceUpdateOp aOp,
|
||||
const Range<wr::ImageKey>& aImageKeys,
|
||||
const wr::ExternalImageId& aExtID) override;
|
||||
const wr::ExternalImageId& aExtID,
|
||||
const bool aPreferCompositorSurface) override;
|
||||
|
||||
void PushDisplayItems(wr::DisplayListBuilder& aBuilder,
|
||||
const wr::LayoutRect& aBounds,
|
||||
const wr::LayoutRect& aClip, wr::ImageRendering aFilter,
|
||||
const Range<wr::ImageKey>& aImageKeys,
|
||||
const bool aPreferCompositorSurface) override;
|
||||
const Range<wr::ImageKey>& aImageKeys) override;
|
||||
|
||||
private:
|
||||
bool EnsureTextureSource();
|
||||
|
|
|
@ -680,14 +680,14 @@ RefPtr<TextureHost> GetNullPluginTextureHost() {
|
|||
void PushResourceUpdates(wr::TransactionBuilder& aResources,
|
||||
ResourceUpdateOp aOp,
|
||||
const Range<wr::ImageKey>& aImageKeys,
|
||||
const wr::ExternalImageId& aExtID) override {}
|
||||
const wr::ExternalImageId& aExtID,
|
||||
const bool aPreferCompositorSurface) override {}
|
||||
|
||||
void PushDisplayItems(wr::DisplayListBuilder& aBuilder,
|
||||
const wr::LayoutRect& aBounds,
|
||||
const wr::LayoutRect& aClip,
|
||||
wr::ImageRendering aFilter,
|
||||
const Range<wr::ImageKey>& aImageKeys,
|
||||
const bool aPreferCompositorSurface) override {}
|
||||
const Range<wr::ImageKey>& aImageKeys) override {}
|
||||
};
|
||||
|
||||
static StaticRefPtr<TextureHost> sNullPluginTextureHost;
|
||||
|
|
|
@ -160,7 +160,8 @@ uint32_t MacIOSurfaceTextureHostOGL::NumSubTextures() {
|
|||
|
||||
void MacIOSurfaceTextureHostOGL::PushResourceUpdates(
|
||||
wr::TransactionBuilder& aResources, ResourceUpdateOp aOp,
|
||||
const Range<wr::ImageKey>& aImageKeys, const wr::ExternalImageId& aExtID) {
|
||||
const Range<wr::ImageKey>& aImageKeys, const wr::ExternalImageId& aExtID,
|
||||
const bool aPreferCompositorSurface) {
|
||||
MOZ_ASSERT(mSurface);
|
||||
|
||||
auto method = aOp == TextureHost::ADD_IMAGE
|
||||
|
@ -179,7 +180,8 @@ void MacIOSurfaceTextureHostOGL::PushResourceUpdates(
|
|||
auto format = GetFormat() == gfx::SurfaceFormat::R8G8B8A8
|
||||
? gfx::SurfaceFormat::B8G8R8A8
|
||||
: gfx::SurfaceFormat::B8G8R8X8;
|
||||
wr::ImageDescriptor descriptor(GetSize(), format);
|
||||
wr::ImageDescriptor descriptor(GetSize(), format,
|
||||
aPreferCompositorSurface);
|
||||
(aResources.*method)(aImageKeys[0], descriptor, aExtID, imageType, 0);
|
||||
break;
|
||||
}
|
||||
|
@ -190,7 +192,8 @@ void MacIOSurfaceTextureHostOGL::PushResourceUpdates(
|
|||
// and YCbCr at OpenGL 3.1)
|
||||
MOZ_ASSERT(aImageKeys.length() == 1);
|
||||
MOZ_ASSERT(mSurface->GetPlaneCount() == 0);
|
||||
wr::ImageDescriptor descriptor(GetSize(), gfx::SurfaceFormat::B8G8R8X8);
|
||||
wr::ImageDescriptor descriptor(GetSize(), gfx::SurfaceFormat::B8G8R8X8,
|
||||
aPreferCompositorSurface);
|
||||
(aResources.*method)(aImageKeys[0], descriptor, aExtID, imageType, 0);
|
||||
break;
|
||||
}
|
||||
|
@ -200,11 +203,11 @@ void MacIOSurfaceTextureHostOGL::PushResourceUpdates(
|
|||
wr::ImageDescriptor descriptor0(
|
||||
gfx::IntSize(mSurface->GetDevicePixelWidth(0),
|
||||
mSurface->GetDevicePixelHeight(0)),
|
||||
gfx::SurfaceFormat::A8);
|
||||
gfx::SurfaceFormat::A8, aPreferCompositorSurface);
|
||||
wr::ImageDescriptor descriptor1(
|
||||
gfx::IntSize(mSurface->GetDevicePixelWidth(1),
|
||||
mSurface->GetDevicePixelHeight(1)),
|
||||
gfx::SurfaceFormat::R8G8);
|
||||
gfx::SurfaceFormat::R8G8, aPreferCompositorSurface);
|
||||
(aResources.*method)(aImageKeys[0], descriptor0, aExtID, imageType, 0);
|
||||
(aResources.*method)(aImageKeys[1], descriptor1, aExtID, imageType, 1);
|
||||
break;
|
||||
|
@ -218,8 +221,7 @@ void MacIOSurfaceTextureHostOGL::PushResourceUpdates(
|
|||
void MacIOSurfaceTextureHostOGL::PushDisplayItems(
|
||||
wr::DisplayListBuilder& aBuilder, const wr::LayoutRect& aBounds,
|
||||
const wr::LayoutRect& aClip, wr::ImageRendering aFilter,
|
||||
const Range<wr::ImageKey>& aImageKeys,
|
||||
const bool aPreferCompositorSurface) {
|
||||
const Range<wr::ImageKey>& aImageKeys) {
|
||||
switch (GetFormat()) {
|
||||
case gfx::SurfaceFormat::R8G8B8X8:
|
||||
case gfx::SurfaceFormat::R8G8B8A8:
|
||||
|
@ -228,9 +230,7 @@ void MacIOSurfaceTextureHostOGL::PushDisplayItems(
|
|||
MOZ_ASSERT(aImageKeys.length() == 1);
|
||||
MOZ_ASSERT(mSurface->GetPlaneCount() == 0);
|
||||
aBuilder.PushImage(aBounds, aClip, true, aFilter, aImageKeys[0],
|
||||
!(mFlags & TextureFlags::NON_PREMULTIPLIED),
|
||||
wr::ColorF{1.0f, 1.0f, 1.0f, 1.0f},
|
||||
aPreferCompositorSurface);
|
||||
!(mFlags & TextureFlags::NON_PREMULTIPLIED));
|
||||
break;
|
||||
}
|
||||
case gfx::SurfaceFormat::YUV422: {
|
||||
|
@ -241,8 +241,7 @@ void MacIOSurfaceTextureHostOGL::PushDisplayItems(
|
|||
aBuilder.PushYCbCrInterleavedImage(
|
||||
aBounds, aClip, true, aImageKeys[0], wr::ColorDepth::Color8,
|
||||
wr::ToWrYuvColorSpace(GetYUVColorSpace()),
|
||||
wr::ToWrColorRange(GetColorRange()), aFilter,
|
||||
aPreferCompositorSurface);
|
||||
wr::ToWrColorRange(GetColorRange()), aFilter);
|
||||
break;
|
||||
}
|
||||
case gfx::SurfaceFormat::NV12: {
|
||||
|
@ -253,8 +252,7 @@ void MacIOSurfaceTextureHostOGL::PushDisplayItems(
|
|||
aBuilder.PushNV12Image(aBounds, aClip, true, aImageKeys[0], aImageKeys[1],
|
||||
wr::ColorDepth::Color8,
|
||||
wr::ToWrYuvColorSpace(GetYUVColorSpace()),
|
||||
wr::ToWrColorRange(GetColorRange()), aFilter,
|
||||
aPreferCompositorSurface);
|
||||
wr::ToWrColorRange(GetColorRange()), aFilter);
|
||||
break;
|
||||
}
|
||||
default: {
|
||||
|
|
|
@ -71,13 +71,13 @@ class MacIOSurfaceTextureHostOGL : public TextureHost {
|
|||
void PushResourceUpdates(wr::TransactionBuilder& aResources,
|
||||
ResourceUpdateOp aOp,
|
||||
const Range<wr::ImageKey>& aImageKeys,
|
||||
const wr::ExternalImageId& aExtID) override;
|
||||
const wr::ExternalImageId& aExtID,
|
||||
const bool aPreferCompositorSurface) override;
|
||||
|
||||
void PushDisplayItems(wr::DisplayListBuilder& aBuilder,
|
||||
const wr::LayoutRect& aBounds,
|
||||
const wr::LayoutRect& aClip, wr::ImageRendering aFilter,
|
||||
const Range<wr::ImageKey>& aImageKeys,
|
||||
const bool aPreferCompositorSurface) override;
|
||||
const Range<wr::ImageKey>& aImageKeys) override;
|
||||
|
||||
gfx::YUVColorSpace GetYUVColorSpace() const override;
|
||||
gfx::ColorRange GetColorRange() const override;
|
||||
|
|
|
@ -648,7 +648,8 @@ void SurfaceTextureHost::CreateRenderTexture(
|
|||
|
||||
void SurfaceTextureHost::PushResourceUpdates(
|
||||
wr::TransactionBuilder& aResources, ResourceUpdateOp aOp,
|
||||
const Range<wr::ImageKey>& aImageKeys, const wr::ExternalImageId& aExtID) {
|
||||
const Range<wr::ImageKey>& aImageKeys, const wr::ExternalImageId& aExtID,
|
||||
const bool aPreferCompositorSurface) {
|
||||
auto method = aOp == TextureHost::ADD_IMAGE
|
||||
? &wr::TransactionBuilder::AddExternalImage
|
||||
: &wr::TransactionBuilder::UpdateExternalImage;
|
||||
|
@ -665,7 +666,8 @@ void SurfaceTextureHost::PushResourceUpdates(
|
|||
auto format = GetFormat() == gfx::SurfaceFormat::R8G8B8A8
|
||||
? gfx::SurfaceFormat::B8G8R8A8
|
||||
: gfx::SurfaceFormat::B8G8R8X8;
|
||||
wr::ImageDescriptor descriptor(GetSize(), format);
|
||||
wr::ImageDescriptor descriptor(GetSize(), format,
|
||||
aPreferCompositorSurface);
|
||||
(aResources.*method)(aImageKeys[0], descriptor, aExtID, imageType, 0);
|
||||
break;
|
||||
}
|
||||
|
@ -675,12 +677,10 @@ void SurfaceTextureHost::PushResourceUpdates(
|
|||
}
|
||||
}
|
||||
|
||||
void SurfaceTextureHost::PushDisplayItems(wr::DisplayListBuilder& aBuilder,
|
||||
const wr::LayoutRect& aBounds,
|
||||
const wr::LayoutRect& aClip,
|
||||
wr::ImageRendering aFilter,
|
||||
const Range<wr::ImageKey>& aImageKeys,
|
||||
const bool aPreferCompositorSurface) {
|
||||
void SurfaceTextureHost::PushDisplayItems(
|
||||
wr::DisplayListBuilder& aBuilder, const wr::LayoutRect& aBounds,
|
||||
const wr::LayoutRect& aClip, wr::ImageRendering aFilter,
|
||||
const Range<wr::ImageKey>& aImageKeys) {
|
||||
switch (GetFormat()) {
|
||||
case gfx::SurfaceFormat::R8G8B8X8:
|
||||
case gfx::SurfaceFormat::R8G8B8A8:
|
||||
|
@ -688,9 +688,7 @@ void SurfaceTextureHost::PushDisplayItems(wr::DisplayListBuilder& aBuilder,
|
|||
case gfx::SurfaceFormat::B8G8R8X8: {
|
||||
MOZ_ASSERT(aImageKeys.length() == 1);
|
||||
aBuilder.PushImage(aBounds, aClip, true, aFilter, aImageKeys[0],
|
||||
!(mFlags & TextureFlags::NON_PREMULTIPLIED),
|
||||
wr::ColorF{1.0f, 1.0f, 1.0f, 1.0f},
|
||||
aPreferCompositorSurface);
|
||||
!(mFlags & TextureFlags::NON_PREMULTIPLIED));
|
||||
break;
|
||||
}
|
||||
default: {
|
||||
|
@ -858,7 +856,8 @@ void EGLImageTextureHost::CreateRenderTexture(
|
|||
|
||||
void EGLImageTextureHost::PushResourceUpdates(
|
||||
wr::TransactionBuilder& aResources, ResourceUpdateOp aOp,
|
||||
const Range<wr::ImageKey>& aImageKeys, const wr::ExternalImageId& aExtID) {
|
||||
const Range<wr::ImageKey>& aImageKeys, const wr::ExternalImageId& aExtID,
|
||||
const bool aPreferCompositorSurface) {
|
||||
auto method = aOp == TextureHost::ADD_IMAGE
|
||||
? &wr::TransactionBuilder::AddExternalImage
|
||||
: &wr::TransactionBuilder::UpdateExternalImage;
|
||||
|
@ -874,20 +873,18 @@ void EGLImageTextureHost::PushResourceUpdates(
|
|||
auto formatTmp = format == gfx::SurfaceFormat::R8G8B8A8
|
||||
? gfx::SurfaceFormat::B8G8R8A8
|
||||
: gfx::SurfaceFormat::B8G8R8X8;
|
||||
wr::ImageDescriptor descriptor(GetSize(), formatTmp);
|
||||
wr::ImageDescriptor descriptor(GetSize(), formatTmp,
|
||||
aPreferCompositorSurface);
|
||||
(aResources.*method)(aImageKeys[0], descriptor, aExtID, imageType, 0);
|
||||
}
|
||||
|
||||
void EGLImageTextureHost::PushDisplayItems(
|
||||
wr::DisplayListBuilder& aBuilder, const wr::LayoutRect& aBounds,
|
||||
const wr::LayoutRect& aClip, wr::ImageRendering aFilter,
|
||||
const Range<wr::ImageKey>& aImageKeys,
|
||||
const bool aPreferCompositorSurface) {
|
||||
const Range<wr::ImageKey>& aImageKeys) {
|
||||
MOZ_ASSERT(aImageKeys.length() == 1);
|
||||
aBuilder.PushImage(aBounds, aClip, true, aFilter, aImageKeys[0],
|
||||
!(mFlags & TextureFlags::NON_PREMULTIPLIED),
|
||||
wr::ColorF{1.0f, 1.0f, 1.0f, 1.0f},
|
||||
aPreferCompositorSurface);
|
||||
!(mFlags & TextureFlags::NON_PREMULTIPLIED));
|
||||
}
|
||||
|
||||
//
|
||||
|
|
|
@ -433,13 +433,13 @@ class SurfaceTextureHost : public TextureHost {
|
|||
void PushResourceUpdates(wr::TransactionBuilder& aResources,
|
||||
ResourceUpdateOp aOp,
|
||||
const Range<wr::ImageKey>& aImageKeys,
|
||||
const wr::ExternalImageId& aExtID) override;
|
||||
const wr::ExternalImageId& aExtID,
|
||||
const bool aPreferCompositorSurface) override;
|
||||
|
||||
void PushDisplayItems(wr::DisplayListBuilder& aBuilder,
|
||||
const wr::LayoutRect& aBounds,
|
||||
const wr::LayoutRect& aClip, wr::ImageRendering aFilter,
|
||||
const Range<wr::ImageKey>& aImageKeys,
|
||||
const bool aPreferCompositorSurface) override;
|
||||
const Range<wr::ImageKey>& aImageKeys) override;
|
||||
|
||||
protected:
|
||||
bool EnsureAttached();
|
||||
|
@ -539,13 +539,13 @@ class EGLImageTextureHost final : public TextureHost {
|
|||
void PushResourceUpdates(wr::TransactionBuilder& aResources,
|
||||
ResourceUpdateOp aOp,
|
||||
const Range<wr::ImageKey>& aImageKeys,
|
||||
const wr::ExternalImageId& aExtID) override;
|
||||
const wr::ExternalImageId& aExtID,
|
||||
const bool aPreferCompositorSurface) override;
|
||||
|
||||
void PushDisplayItems(wr::DisplayListBuilder& aBuilder,
|
||||
const wr::LayoutRect& aBounds,
|
||||
const wr::LayoutRect& aClip, wr::ImageRendering aFilter,
|
||||
const Range<wr::ImageKey>& aImageKeys,
|
||||
const bool aPreferCompositorSurface) override;
|
||||
const Range<wr::ImageKey>& aImageKeys) override;
|
||||
|
||||
protected:
|
||||
const EGLImage mImage;
|
||||
|
|
|
@ -128,7 +128,8 @@ void WaylandDMABUFTextureHostOGL::CreateRenderTexture(
|
|||
|
||||
void WaylandDMABUFTextureHostOGL::PushResourceUpdates(
|
||||
wr::TransactionBuilder& aResources, ResourceUpdateOp aOp,
|
||||
const Range<wr::ImageKey>& aImageKeys, const wr::ExternalImageId& aExtID) {
|
||||
const Range<wr::ImageKey>& aImageKeys, const wr::ExternalImageId& aExtID,
|
||||
const bool aPreferCompositorSurface) {
|
||||
MOZ_ASSERT(mSurface);
|
||||
|
||||
auto method = aOp == TextureHost::ADD_IMAGE
|
||||
|
@ -145,7 +146,8 @@ void WaylandDMABUFTextureHostOGL::PushResourceUpdates(
|
|||
MOZ_ASSERT(aImageKeys.length() == 1);
|
||||
// XXX Add RGBA handling. Temporary hack to avoid crash
|
||||
// With BGRA format setting, rendering works without problem.
|
||||
wr::ImageDescriptor descriptor(GetSize(), mSurface->GetFormat());
|
||||
wr::ImageDescriptor descriptor(GetSize(), mSurface->GetFormat(),
|
||||
aPreferCompositorSurface);
|
||||
(aResources.*method)(aImageKeys[0], descriptor, aExtID, imageType, 0);
|
||||
break;
|
||||
}
|
||||
|
@ -154,10 +156,10 @@ void WaylandDMABUFTextureHostOGL::PushResourceUpdates(
|
|||
MOZ_ASSERT(mSurface->GetTextureCount() == 2);
|
||||
wr::ImageDescriptor descriptor0(
|
||||
gfx::IntSize(mSurface->GetWidth(0), mSurface->GetHeight(0)),
|
||||
gfx::SurfaceFormat::A8);
|
||||
gfx::SurfaceFormat::A8, aPreferCompositorSurface);
|
||||
wr::ImageDescriptor descriptor1(
|
||||
gfx::IntSize(mSurface->GetWidth(1), mSurface->GetHeight(1)),
|
||||
gfx::SurfaceFormat::R8G8);
|
||||
gfx::SurfaceFormat::R8G8, aPreferCompositorSurface);
|
||||
(aResources.*method)(aImageKeys[0], descriptor0, aExtID, imageType, 0);
|
||||
(aResources.*method)(aImageKeys[1], descriptor1, aExtID, imageType, 1);
|
||||
break;
|
||||
|
@ -171,8 +173,7 @@ void WaylandDMABUFTextureHostOGL::PushResourceUpdates(
|
|||
void WaylandDMABUFTextureHostOGL::PushDisplayItems(
|
||||
wr::DisplayListBuilder& aBuilder, const wr::LayoutRect& aBounds,
|
||||
const wr::LayoutRect& aClip, wr::ImageRendering aFilter,
|
||||
const Range<wr::ImageKey>& aImageKeys,
|
||||
const bool aPreferCompositorSurface) {
|
||||
const Range<wr::ImageKey>& aImageKeys) {
|
||||
switch (mSurface->GetFormat()) {
|
||||
case gfx::SurfaceFormat::R8G8B8X8:
|
||||
case gfx::SurfaceFormat::R8G8B8A8:
|
||||
|
@ -180,9 +181,7 @@ void WaylandDMABUFTextureHostOGL::PushDisplayItems(
|
|||
case gfx::SurfaceFormat::B8G8R8X8: {
|
||||
MOZ_ASSERT(aImageKeys.length() == 1);
|
||||
aBuilder.PushImage(aBounds, aClip, true, aFilter, aImageKeys[0],
|
||||
!(mFlags & TextureFlags::NON_PREMULTIPLIED),
|
||||
wr::ColorF{1.0f, 1.0f, 1.0f, 1.0f},
|
||||
aPreferCompositorSurface);
|
||||
!(mFlags & TextureFlags::NON_PREMULTIPLIED));
|
||||
break;
|
||||
}
|
||||
case gfx::SurfaceFormat::NV12: {
|
||||
|
@ -193,8 +192,7 @@ void WaylandDMABUFTextureHostOGL::PushDisplayItems(
|
|||
aBuilder.PushNV12Image(aBounds, aClip, true, aImageKeys[0], aImageKeys[1],
|
||||
wr::ColorDepth::Color8,
|
||||
wr::ToWrYuvColorSpace(GetYUVColorSpace()),
|
||||
wr::ToWrColorRange(GetColorRange()), aFilter,
|
||||
aPreferCompositorSurface);
|
||||
wr::ToWrColorRange(GetColorRange()), aFilter);
|
||||
break;
|
||||
}
|
||||
default: {
|
||||
|
|
|
@ -60,13 +60,13 @@ class WaylandDMABUFTextureHostOGL : public TextureHost {
|
|||
void PushResourceUpdates(wr::TransactionBuilder& aResources,
|
||||
ResourceUpdateOp aOp,
|
||||
const Range<wr::ImageKey>& aImageKeys,
|
||||
const wr::ExternalImageId& aExtID) override;
|
||||
const wr::ExternalImageId& aExtID,
|
||||
const bool aPreferCompositorSurface) override;
|
||||
|
||||
void PushDisplayItems(wr::DisplayListBuilder& aBuilder,
|
||||
const wr::LayoutRect& aBounds,
|
||||
const wr::LayoutRect& aClip, wr::ImageRendering aFilter,
|
||||
const Range<wr::ImageKey>& aImageKeys,
|
||||
const bool aPreferCompositorSurface) override;
|
||||
const Range<wr::ImageKey>& aImageKeys) override;
|
||||
|
||||
private:
|
||||
GLTextureSource* CreateTextureSourceForPlane(size_t aPlane);
|
||||
|
|
|
@ -266,7 +266,8 @@ Maybe<TextureHost::ResourceUpdateOp> AsyncImagePipelineManager::UpdateImageKeys(
|
|||
|
||||
Range<wr::ImageKey> keys(&aKeys[0], aKeys.Length());
|
||||
auto externalImageKey = wrTexture->GetExternalImageKey();
|
||||
wrTexture->PushResourceUpdates(aMaybeFastTxn, op, keys, externalImageKey);
|
||||
wrTexture->PushResourceUpdates(aMaybeFastTxn, op, keys, externalImageKey,
|
||||
/* aPreferCompositorSurface */ true);
|
||||
|
||||
return Some(op);
|
||||
}
|
||||
|
@ -398,7 +399,7 @@ void AsyncImagePipelineManager::ApplyAsyncImageForPipeline(
|
|||
Range<wr::ImageKey> range_keys(&keys[0], keys.Length());
|
||||
aPipeline->mCurrentTexture->PushDisplayItems(
|
||||
builder, wr::ToLayoutRect(rect), wr::ToLayoutRect(rect),
|
||||
aPipeline->mFilter, range_keys, /* aPreferCompositorSurface */ true);
|
||||
aPipeline->mFilter, range_keys);
|
||||
HoldExternalImage(aPipelineId, aEpoch, aPipeline->mCurrentTexture);
|
||||
} else {
|
||||
MOZ_ASSERT(keys.Length() == 1);
|
||||
|
|
|
@ -834,7 +834,8 @@ bool WebRenderBridgeParent::PushExternalImageForTexture(
|
|||
WebRenderTextureHost* wrTexture = aTexture->AsWebRenderTextureHost();
|
||||
if (wrTexture) {
|
||||
wrTexture->PushResourceUpdates(aResources, op, keys,
|
||||
wrTexture->GetExternalImageKey());
|
||||
wrTexture->GetExternalImageKey(),
|
||||
/* aPreferCompositorSurface */ false);
|
||||
auto it = mTextureHosts.find(wr::AsUint64(aKey));
|
||||
MOZ_ASSERT((it == mTextureHosts.end() && !aIsUpdate) ||
|
||||
(it != mTextureHosts.end() && aIsUpdate));
|
||||
|
|
|
@ -196,23 +196,24 @@ uint32_t WebRenderTextureHost::NumSubTextures() {
|
|||
|
||||
void WebRenderTextureHost::PushResourceUpdates(
|
||||
wr::TransactionBuilder& aResources, ResourceUpdateOp aOp,
|
||||
const Range<wr::ImageKey>& aImageKeys, const wr::ExternalImageId& aExtID) {
|
||||
const Range<wr::ImageKey>& aImageKeys, const wr::ExternalImageId& aExtID,
|
||||
const bool aPreferCompositorSurface) {
|
||||
MOZ_ASSERT(mWrappedTextureHost);
|
||||
MOZ_ASSERT(mExternalImageId == aExtID);
|
||||
|
||||
mWrappedTextureHost->PushResourceUpdates(aResources, aOp, aImageKeys, aExtID);
|
||||
mWrappedTextureHost->PushResourceUpdates(aResources, aOp, aImageKeys, aExtID,
|
||||
aPreferCompositorSurface);
|
||||
}
|
||||
|
||||
void WebRenderTextureHost::PushDisplayItems(
|
||||
wr::DisplayListBuilder& aBuilder, const wr::LayoutRect& aBounds,
|
||||
const wr::LayoutRect& aClip, wr::ImageRendering aFilter,
|
||||
const Range<wr::ImageKey>& aImageKeys,
|
||||
const bool aPreferCompositorSurface) {
|
||||
const Range<wr::ImageKey>& aImageKeys) {
|
||||
MOZ_ASSERT(mWrappedTextureHost);
|
||||
MOZ_ASSERT(aImageKeys.length() > 0);
|
||||
|
||||
mWrappedTextureHost->PushDisplayItems(aBuilder, aBounds, aClip, aFilter,
|
||||
aImageKeys, aPreferCompositorSurface);
|
||||
aImageKeys);
|
||||
}
|
||||
|
||||
bool WebRenderTextureHost::NeedsYFlip() const {
|
||||
|
|
|
@ -75,13 +75,13 @@ class WebRenderTextureHost : public TextureHost {
|
|||
void PushResourceUpdates(wr::TransactionBuilder& aResources,
|
||||
ResourceUpdateOp aOp,
|
||||
const Range<wr::ImageKey>& aImageKeys,
|
||||
const wr::ExternalImageId& aExtID) override;
|
||||
const wr::ExternalImageId& aExtID,
|
||||
const bool aPreferCompositorSurface) override;
|
||||
|
||||
void PushDisplayItems(wr::DisplayListBuilder& aBuilder,
|
||||
const wr::LayoutRect& aBounds,
|
||||
const wr::LayoutRect& aClip, wr::ImageRendering aFilter,
|
||||
const Range<wr::ImageKey>& aImageKeys,
|
||||
const bool aPreferCompositorSurface) override;
|
||||
const Range<wr::ImageKey>& aImageKeys) override;
|
||||
|
||||
bool NeedsYFlip() const override;
|
||||
|
||||
|
|
|
@ -1269,14 +1269,13 @@ void DisplayListBuilder::PushConicGradient(
|
|||
void DisplayListBuilder::PushImage(
|
||||
const wr::LayoutRect& aBounds, const wr::LayoutRect& aClip,
|
||||
bool aIsBackfaceVisible, wr::ImageRendering aFilter, wr::ImageKey aImage,
|
||||
bool aPremultipliedAlpha, const wr::ColorF& aColor,
|
||||
bool aPreferCompositorSurface) {
|
||||
bool aPremultipliedAlpha, const wr::ColorF& aColor) {
|
||||
wr::LayoutRect clip = MergeClipLeaf(aClip);
|
||||
WRDL_LOG("PushImage b=%s cl=%s\n", mWrState, Stringify(aBounds).c_str(),
|
||||
Stringify(clip).c_str());
|
||||
wr_dp_push_image(mWrState, aBounds, clip, aIsBackfaceVisible,
|
||||
&mCurrentSpaceAndClipChain, aFilter, aImage,
|
||||
aPremultipliedAlpha, aColor, aPreferCompositorSurface);
|
||||
aPremultipliedAlpha, aColor);
|
||||
}
|
||||
|
||||
void DisplayListBuilder::PushRepeatingImage(
|
||||
|
@ -1298,13 +1297,11 @@ void DisplayListBuilder::PushYCbCrPlanarImage(
|
|||
bool aIsBackfaceVisible, wr::ImageKey aImageChannel0,
|
||||
wr::ImageKey aImageChannel1, wr::ImageKey aImageChannel2,
|
||||
wr::WrColorDepth aColorDepth, wr::WrYuvColorSpace aColorSpace,
|
||||
wr::WrColorRange aColorRange, wr::ImageRendering aRendering,
|
||||
bool aPreferCompositorSurface) {
|
||||
wr_dp_push_yuv_planar_image(mWrState, aBounds, MergeClipLeaf(aClip),
|
||||
aIsBackfaceVisible, &mCurrentSpaceAndClipChain,
|
||||
aImageChannel0, aImageChannel1, aImageChannel2,
|
||||
aColorDepth, aColorSpace, aColorRange, aRendering,
|
||||
aPreferCompositorSurface);
|
||||
wr::WrColorRange aColorRange, wr::ImageRendering aRendering) {
|
||||
wr_dp_push_yuv_planar_image(
|
||||
mWrState, aBounds, MergeClipLeaf(aClip), aIsBackfaceVisible,
|
||||
&mCurrentSpaceAndClipChain, aImageChannel0, aImageChannel1,
|
||||
aImageChannel2, aColorDepth, aColorSpace, aColorRange, aRendering);
|
||||
}
|
||||
|
||||
void DisplayListBuilder::PushNV12Image(
|
||||
|
@ -1312,23 +1309,22 @@ void DisplayListBuilder::PushNV12Image(
|
|||
bool aIsBackfaceVisible, wr::ImageKey aImageChannel0,
|
||||
wr::ImageKey aImageChannel1, wr::WrColorDepth aColorDepth,
|
||||
wr::WrYuvColorSpace aColorSpace, wr::WrColorRange aColorRange,
|
||||
wr::ImageRendering aRendering, bool aPreferCompositorSurface) {
|
||||
wr_dp_push_yuv_NV12_image(
|
||||
mWrState, aBounds, MergeClipLeaf(aClip), aIsBackfaceVisible,
|
||||
&mCurrentSpaceAndClipChain, aImageChannel0, aImageChannel1, aColorDepth,
|
||||
aColorSpace, aColorRange, aRendering, aPreferCompositorSurface);
|
||||
wr::ImageRendering aRendering) {
|
||||
wr_dp_push_yuv_NV12_image(mWrState, aBounds, MergeClipLeaf(aClip),
|
||||
aIsBackfaceVisible, &mCurrentSpaceAndClipChain,
|
||||
aImageChannel0, aImageChannel1, aColorDepth,
|
||||
aColorSpace, aColorRange, aRendering);
|
||||
}
|
||||
|
||||
void DisplayListBuilder::PushYCbCrInterleavedImage(
|
||||
const wr::LayoutRect& aBounds, const wr::LayoutRect& aClip,
|
||||
bool aIsBackfaceVisible, wr::ImageKey aImageChannel0,
|
||||
wr::WrColorDepth aColorDepth, wr::WrYuvColorSpace aColorSpace,
|
||||
wr::WrColorRange aColorRange, wr::ImageRendering aRendering,
|
||||
bool aPreferCompositorSurface) {
|
||||
wr::WrColorRange aColorRange, wr::ImageRendering aRendering) {
|
||||
wr_dp_push_yuv_interleaved_image(
|
||||
mWrState, aBounds, MergeClipLeaf(aClip), aIsBackfaceVisible,
|
||||
&mCurrentSpaceAndClipChain, aImageChannel0, aColorDepth, aColorSpace,
|
||||
aColorRange, aRendering, aPreferCompositorSurface);
|
||||
aColorRange, aRendering);
|
||||
}
|
||||
|
||||
void DisplayListBuilder::PushIFrame(const wr::LayoutRect& aBounds,
|
||||
|
|
|
@ -526,8 +526,7 @@ class DisplayListBuilder final {
|
|||
void PushImage(const wr::LayoutRect& aBounds, const wr::LayoutRect& aClip,
|
||||
bool aIsBackfaceVisible, wr::ImageRendering aFilter,
|
||||
wr::ImageKey aImage, bool aPremultipliedAlpha = true,
|
||||
const wr::ColorF& aColor = wr::ColorF{1.0f, 1.0f, 1.0f, 1.0f},
|
||||
bool aPreferCompositorSurface = false);
|
||||
const wr::ColorF& aColor = wr::ColorF{1.0f, 1.0f, 1.0f, 1.0f});
|
||||
|
||||
void PushRepeatingImage(
|
||||
const wr::LayoutRect& aBounds, const wr::LayoutRect& aClip,
|
||||
|
@ -541,22 +540,19 @@ class DisplayListBuilder final {
|
|||
bool aIsBackfaceVisible, wr::ImageKey aImageChannel0,
|
||||
wr::ImageKey aImageChannel1, wr::ImageKey aImageChannel2,
|
||||
wr::WrColorDepth aColorDepth, wr::WrYuvColorSpace aColorSpace,
|
||||
wr::WrColorRange aColorRange, wr::ImageRendering aFilter,
|
||||
bool aPreferCompositorSurface = false);
|
||||
wr::WrColorRange aColorRange, wr::ImageRendering aFilter);
|
||||
|
||||
void PushNV12Image(const wr::LayoutRect& aBounds, const wr::LayoutRect& aClip,
|
||||
bool aIsBackfaceVisible, wr::ImageKey aImageChannel0,
|
||||
wr::ImageKey aImageChannel1, wr::WrColorDepth aColorDepth,
|
||||
wr::WrYuvColorSpace aColorSpace,
|
||||
wr::WrColorRange aColorRange, wr::ImageRendering aFilter,
|
||||
bool aPreferCompositorSurface = false);
|
||||
wr::WrColorRange aColorRange, wr::ImageRendering aFilter);
|
||||
|
||||
void PushYCbCrInterleavedImage(
|
||||
const wr::LayoutRect& aBounds, const wr::LayoutRect& aClip,
|
||||
bool aIsBackfaceVisible, wr::ImageKey aImageChannel0,
|
||||
wr::WrColorDepth aColorDepth, wr::WrYuvColorSpace aColorSpace,
|
||||
wr::WrColorRange aColorRange, wr::ImageRendering aFilter,
|
||||
bool aPreferCompositorSurface = false);
|
||||
wr::WrColorRange aColorRange, wr::ImageRendering aFilter);
|
||||
|
||||
void PushIFrame(const wr::LayoutRect& aBounds, bool aIsBackfaceVisible,
|
||||
wr::PipelineId aPipeline, bool aIgnoreMissingPipeline);
|
||||
|
|
|
@ -2690,19 +2690,12 @@ pub extern "C" fn wr_dp_push_iframe(state: &mut WrState,
|
|||
// A helper fn to construct a PrimitiveFlags
|
||||
fn prim_flags(
|
||||
is_backface_visible: bool,
|
||||
prefer_compositor_surface: bool,
|
||||
) -> PrimitiveFlags {
|
||||
let mut flags = PrimitiveFlags::empty();
|
||||
|
||||
if is_backface_visible {
|
||||
flags |= PrimitiveFlags::IS_BACKFACE_VISIBLE;
|
||||
PrimitiveFlags::IS_BACKFACE_VISIBLE
|
||||
} else {
|
||||
PrimitiveFlags::empty()
|
||||
}
|
||||
|
||||
if prefer_compositor_surface {
|
||||
flags |= PrimitiveFlags::PREFER_COMPOSITOR_SURFACE;
|
||||
}
|
||||
|
||||
flags
|
||||
}
|
||||
|
||||
fn common_item_properties_for_rect(
|
||||
|
@ -2722,7 +2715,7 @@ fn common_item_properties_for_rect(
|
|||
clip_rect: clip_rect.unwrap_or(LayoutRect::zero()),
|
||||
clip_id: space_and_clip.clip_id,
|
||||
spatial_id: space_and_clip.spatial_id,
|
||||
flags: prim_flags(is_backface_visible, /* prefer_compositor_surface */ false),
|
||||
flags: prim_flags(is_backface_visible),
|
||||
hit_info: state.current_tag,
|
||||
item_key: state.current_item_key,
|
||||
}
|
||||
|
@ -2805,7 +2798,7 @@ pub extern "C" fn wr_dp_push_rect_with_parent_clip(
|
|||
clip_rect: clip_rect.unwrap(),
|
||||
clip_id: space_and_clip.clip_id,
|
||||
spatial_id: space_and_clip.spatial_id,
|
||||
flags: prim_flags(is_backface_visible, /* prefer_compositor_surface */ false),
|
||||
flags: prim_flags(is_backface_visible),
|
||||
hit_info: state.current_tag,
|
||||
item_key: state.current_item_key,
|
||||
};
|
||||
|
@ -2858,7 +2851,7 @@ pub extern "C" fn wr_dp_push_backdrop_filter_with_parent_clip(
|
|||
clip_rect: clip_rect.unwrap(),
|
||||
clip_id: space_and_clip.clip_id,
|
||||
spatial_id: space_and_clip.spatial_id,
|
||||
flags: prim_flags(is_backface_visible, /* prefer_compositor_surface */ false),
|
||||
flags: prim_flags(is_backface_visible),
|
||||
hit_info: state.current_tag,
|
||||
item_key: state.current_item_key,
|
||||
};
|
||||
|
@ -2887,7 +2880,7 @@ pub extern "C" fn wr_dp_push_clear_rect(state: &mut WrState,
|
|||
clip_rect: clip_rect.unwrap(),
|
||||
clip_id: space_and_clip.clip_id,
|
||||
spatial_id: space_and_clip.spatial_id,
|
||||
flags: prim_flags(true, /* prefer_compositor_surface */ false),
|
||||
flags: prim_flags(true),
|
||||
hit_info: state.current_tag,
|
||||
item_key: state.current_item_key,
|
||||
};
|
||||
|
@ -2914,7 +2907,7 @@ pub extern "C" fn wr_dp_push_hit_test(state: &mut WrState,
|
|||
clip_rect: clip_rect.unwrap(),
|
||||
clip_id: space_and_clip.clip_id,
|
||||
spatial_id: space_and_clip.spatial_id,
|
||||
flags: prim_flags(is_backface_visible, /* prefer_compositor_surface */ false),
|
||||
flags: prim_flags(is_backface_visible),
|
||||
hit_info: state.current_tag,
|
||||
item_key: state.current_item_key,
|
||||
};
|
||||
|
@ -2942,7 +2935,7 @@ pub extern "C" fn wr_dp_push_clear_rect_with_parent_clip(
|
|||
clip_rect: clip_rect.unwrap(),
|
||||
clip_id: space_and_clip.clip_id,
|
||||
spatial_id: space_and_clip.spatial_id,
|
||||
flags: prim_flags(true, /* prefer_compositor_surface */ false),
|
||||
flags: prim_flags(true),
|
||||
hit_info: state.current_tag,
|
||||
item_key: state.current_item_key,
|
||||
};
|
||||
|
@ -2961,8 +2954,7 @@ pub extern "C" fn wr_dp_push_image(state: &mut WrState,
|
|||
image_rendering: ImageRendering,
|
||||
key: WrImageKey,
|
||||
premultiplied_alpha: bool,
|
||||
color: ColorF,
|
||||
prefer_compositor_surface: bool) {
|
||||
color: ColorF) {
|
||||
debug_assert!(unsafe { is_in_main_thread() || is_in_compositor_thread() });
|
||||
|
||||
let space_and_clip = parent.to_webrender(state.pipeline_id);
|
||||
|
@ -2971,7 +2963,7 @@ pub extern "C" fn wr_dp_push_image(state: &mut WrState,
|
|||
clip_rect: clip,
|
||||
clip_id: space_and_clip.clip_id,
|
||||
spatial_id: space_and_clip.spatial_id,
|
||||
flags: prim_flags(is_backface_visible, /* prefer_compositor_surface */ false),
|
||||
flags: prim_flags(is_backface_visible),
|
||||
hit_info: state.current_tag,
|
||||
item_key: state.current_item_key,
|
||||
};
|
||||
|
@ -3012,7 +3004,7 @@ pub extern "C" fn wr_dp_push_repeating_image(state: &mut WrState,
|
|||
clip_rect: clip,
|
||||
clip_id: space_and_clip.clip_id,
|
||||
spatial_id: space_and_clip.spatial_id,
|
||||
flags: prim_flags(is_backface_visible, prefer_compositor_surface),
|
||||
flags: prim_flags(is_backface_visible),
|
||||
hit_info: state.current_tag,
|
||||
item_key: state.current_item_key,
|
||||
};
|
||||
|
@ -3048,8 +3040,7 @@ pub extern "C" fn wr_dp_push_yuv_planar_image(state: &mut WrState,
|
|||
color_depth: WrColorDepth,
|
||||
color_space: WrYuvColorSpace,
|
||||
color_range: WrColorRange,
|
||||
image_rendering: ImageRendering,
|
||||
prefer_compositor_surface: bool) {
|
||||
image_rendering: ImageRendering) {
|
||||
debug_assert!(unsafe { is_in_main_thread() || is_in_compositor_thread() });
|
||||
|
||||
let space_and_clip = parent.to_webrender(state.pipeline_id);
|
||||
|
@ -3058,7 +3049,7 @@ pub extern "C" fn wr_dp_push_yuv_planar_image(state: &mut WrState,
|
|||
clip_rect: clip,
|
||||
clip_id: space_and_clip.clip_id,
|
||||
spatial_id: space_and_clip.spatial_id,
|
||||
flags: prim_flags(is_backface_visible, /* prefer_compositor_surface */ false),
|
||||
flags: prim_flags(is_backface_visible),
|
||||
hit_info: state.current_tag,
|
||||
item_key: state.current_item_key,
|
||||
};
|
||||
|
@ -3086,8 +3077,7 @@ pub extern "C" fn wr_dp_push_yuv_NV12_image(state: &mut WrState,
|
|||
color_depth: WrColorDepth,
|
||||
color_space: WrYuvColorSpace,
|
||||
color_range: WrColorRange,
|
||||
image_rendering: ImageRendering,
|
||||
prefer_compositor_surface: bool) {
|
||||
image_rendering: ImageRendering) {
|
||||
debug_assert!(unsafe { is_in_main_thread() || is_in_compositor_thread() });
|
||||
|
||||
let space_and_clip = parent.to_webrender(state.pipeline_id);
|
||||
|
@ -3096,7 +3086,7 @@ pub extern "C" fn wr_dp_push_yuv_NV12_image(state: &mut WrState,
|
|||
clip_rect: clip,
|
||||
clip_id: space_and_clip.clip_id,
|
||||
spatial_id: space_and_clip.spatial_id,
|
||||
flags: prim_flags(is_backface_visible, prefer_compositor_surface),
|
||||
flags: prim_flags(is_backface_visible),
|
||||
hit_info: state.current_tag,
|
||||
item_key: state.current_item_key,
|
||||
};
|
||||
|
@ -3123,8 +3113,7 @@ pub extern "C" fn wr_dp_push_yuv_interleaved_image(state: &mut WrState,
|
|||
color_depth: WrColorDepth,
|
||||
color_space: WrYuvColorSpace,
|
||||
color_range: WrColorRange,
|
||||
image_rendering: ImageRendering,
|
||||
prefer_compositor_surface: bool) {
|
||||
image_rendering: ImageRendering) {
|
||||
debug_assert!(unsafe { is_in_main_thread() || is_in_compositor_thread() });
|
||||
|
||||
let space_and_clip = parent.to_webrender(state.pipeline_id);
|
||||
|
@ -3133,7 +3122,7 @@ pub extern "C" fn wr_dp_push_yuv_interleaved_image(state: &mut WrState,
|
|||
clip_rect: clip,
|
||||
clip_id: space_and_clip.clip_id,
|
||||
spatial_id: space_and_clip.spatial_id,
|
||||
flags: prim_flags(is_backface_visible, prefer_compositor_surface),
|
||||
flags: prim_flags(is_backface_visible),
|
||||
hit_info: state.current_tag,
|
||||
item_key: state.current_item_key,
|
||||
};
|
||||
|
@ -3170,7 +3159,7 @@ pub extern "C" fn wr_dp_push_text(state: &mut WrState,
|
|||
clip_rect: clip,
|
||||
spatial_id: space_and_clip.spatial_id,
|
||||
clip_id: space_and_clip.clip_id,
|
||||
flags: prim_flags(is_backface_visible, /* prefer_compositor_surface */ false),
|
||||
flags: prim_flags(is_backface_visible),
|
||||
hit_info: state.current_tag,
|
||||
item_key: state.current_item_key,
|
||||
};
|
||||
|
@ -3227,7 +3216,7 @@ pub extern "C" fn wr_dp_push_line(state: &mut WrState,
|
|||
clip_rect: *clip,
|
||||
clip_id: space_and_clip.clip_id,
|
||||
spatial_id: space_and_clip.spatial_id,
|
||||
flags: prim_flags(is_backface_visible, /* prefer_compositor_surface */ false),
|
||||
flags: prim_flags(is_backface_visible),
|
||||
hit_info: state.current_tag,
|
||||
item_key: state.current_item_key,
|
||||
};
|
||||
|
@ -3273,7 +3262,7 @@ pub extern "C" fn wr_dp_push_border(state: &mut WrState,
|
|||
clip_rect: clip,
|
||||
clip_id: space_and_clip.clip_id,
|
||||
spatial_id: space_and_clip.spatial_id,
|
||||
flags: prim_flags(is_backface_visible, prefer_compositor_surface),
|
||||
flags: prim_flags(is_backface_visible),
|
||||
hit_info: state.current_tag,
|
||||
item_key: state.current_item_key,
|
||||
};
|
||||
|
@ -3323,7 +3312,7 @@ pub extern "C" fn wr_dp_push_border_image(state: &mut WrState,
|
|||
clip_rect: clip,
|
||||
clip_id: space_and_clip.clip_id,
|
||||
spatial_id: space_and_clip.spatial_id,
|
||||
flags: prim_flags(is_backface_visible, /* prefer_compositor_surface */ false),
|
||||
flags: prim_flags(is_backface_visible),
|
||||
hit_info: state.current_tag,
|
||||
item_key: state.current_item_key,
|
||||
};
|
||||
|
@ -3382,7 +3371,7 @@ pub extern "C" fn wr_dp_push_border_gradient(state: &mut WrState,
|
|||
clip_rect: clip,
|
||||
clip_id: space_and_clip.clip_id,
|
||||
spatial_id: space_and_clip.spatial_id,
|
||||
flags: prim_flags(is_backface_visible, /* prefer_compositor_surface */ false),
|
||||
flags: prim_flags(is_backface_visible),
|
||||
hit_info: state.current_tag,
|
||||
item_key: state.current_item_key,
|
||||
};
|
||||
|
@ -3445,7 +3434,7 @@ pub extern "C" fn wr_dp_push_border_radial_gradient(state: &mut WrState,
|
|||
clip_rect: clip,
|
||||
clip_id: space_and_clip.clip_id,
|
||||
spatial_id: space_and_clip.spatial_id,
|
||||
flags: prim_flags(is_backface_visible, /* prefer_compositor_surface */ false),
|
||||
flags: prim_flags(is_backface_visible),
|
||||
hit_info: state.current_tag,
|
||||
item_key: state.current_item_key,
|
||||
};
|
||||
|
@ -3508,7 +3497,7 @@ pub extern "C" fn wr_dp_push_border_conic_gradient(state: &mut WrState,
|
|||
clip_rect: clip,
|
||||
clip_id: space_and_clip.clip_id,
|
||||
spatial_id: space_and_clip.spatial_id,
|
||||
flags: prim_flags(is_backface_visible, /* prefer_compositor_surface */ false),
|
||||
flags: prim_flags(is_backface_visible),
|
||||
hit_info: state.current_tag,
|
||||
item_key: state.current_item_key,
|
||||
};
|
||||
|
@ -3552,7 +3541,7 @@ pub extern "C" fn wr_dp_push_linear_gradient(state: &mut WrState,
|
|||
clip_rect: clip,
|
||||
clip_id: space_and_clip.clip_id,
|
||||
spatial_id: space_and_clip.spatial_id,
|
||||
flags: prim_flags(is_backface_visible, /* prefer_compositor_surface */ false),
|
||||
flags: prim_flags(is_backface_visible),
|
||||
hit_info: state.current_tag,
|
||||
item_key: state.current_item_key,
|
||||
};
|
||||
|
@ -3597,7 +3586,7 @@ pub extern "C" fn wr_dp_push_radial_gradient(state: &mut WrState,
|
|||
clip_rect: clip,
|
||||
clip_id: space_and_clip.clip_id,
|
||||
spatial_id: space_and_clip.spatial_id,
|
||||
flags: prim_flags(is_backface_visible, /* prefer_compositor_surface */ false),
|
||||
flags: prim_flags(is_backface_visible),
|
||||
hit_info: state.current_tag,
|
||||
item_key: state.current_item_key,
|
||||
};
|
||||
|
@ -3641,7 +3630,7 @@ pub extern "C" fn wr_dp_push_conic_gradient(state: &mut WrState,
|
|||
clip_rect: clip,
|
||||
clip_id: space_and_clip.clip_id,
|
||||
spatial_id: space_and_clip.spatial_id,
|
||||
flags: prim_flags(is_backface_visible, /* prefer_compositor_surface */ false),
|
||||
flags: prim_flags(is_backface_visible),
|
||||
hit_info: state.current_tag,
|
||||
item_key: state.current_item_key,
|
||||
};
|
||||
|
@ -3675,7 +3664,7 @@ pub extern "C" fn wr_dp_push_box_shadow(state: &mut WrState,
|
|||
clip_rect: clip,
|
||||
clip_id: space_and_clip.clip_id,
|
||||
spatial_id: space_and_clip.spatial_id,
|
||||
flags: prim_flags(is_backface_visible, /* prefer_compositor_surface */ false),
|
||||
flags: prim_flags(is_backface_visible),
|
||||
hit_info: state.current_tag,
|
||||
item_key: state.current_item_key,
|
||||
};
|
||||
|
|
Загрузка…
Ссылка в новой задаче