mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 900133 - Recreate the TextureClient for an ImageClient if the image size changes. r=nical
This commit is contained in:
parent
8d1d162923
commit
e49181d0be
@ -146,7 +146,10 @@ ImageClientSingle::UpdateImage(ImageContainer* aContainer,
|
|||||||
nsRefPtr<gfxASurface> surface = image->GetAsSurface();
|
nsRefPtr<gfxASurface> surface = image->GetAsSurface();
|
||||||
MOZ_ASSERT(surface);
|
MOZ_ASSERT(surface);
|
||||||
|
|
||||||
if (mFrontBuffer && mFrontBuffer->IsImmutable()) {
|
gfx::IntSize size = gfx::IntSize(image->GetSize().width, image->GetSize().height);
|
||||||
|
|
||||||
|
if (mFrontBuffer &&
|
||||||
|
(mFrontBuffer->IsImmutable() || mFrontBuffer->GetSize() != size)) {
|
||||||
RemoveTextureClient(mFrontBuffer);
|
RemoveTextureClient(mFrontBuffer);
|
||||||
mFrontBuffer = nullptr;
|
mFrontBuffer = nullptr;
|
||||||
}
|
}
|
||||||
@ -155,7 +158,6 @@ ImageClientSingle::UpdateImage(ImageContainer* aContainer,
|
|||||||
gfxASurface::gfxImageFormat format
|
gfxASurface::gfxImageFormat format
|
||||||
= gfxPlatform::GetPlatform()->OptimalFormatForContent(surface->GetContentType());
|
= gfxPlatform::GetPlatform()->OptimalFormatForContent(surface->GetContentType());
|
||||||
mFrontBuffer = CreateBufferTextureClient(gfx::ImageFormatToSurfaceFormat(format));
|
mFrontBuffer = CreateBufferTextureClient(gfx::ImageFormatToSurfaceFormat(format));
|
||||||
gfx::IntSize size = gfx::IntSize(image->GetSize().width, image->GetSize().height);
|
|
||||||
MOZ_ASSERT(mFrontBuffer->AsTextureClientSurface());
|
MOZ_ASSERT(mFrontBuffer->AsTextureClientSurface());
|
||||||
mFrontBuffer->AsTextureClientSurface()->AllocateForSurface(size);
|
mFrontBuffer->AsTextureClientSurface()->AllocateForSurface(size);
|
||||||
|
|
||||||
|
@ -187,6 +187,7 @@ BufferTextureClient::AllocateForSurface(gfx::IntSize aSize)
|
|||||||
}
|
}
|
||||||
ImageDataSerializer serializer(GetBuffer());
|
ImageDataSerializer serializer(GetBuffer());
|
||||||
serializer.InitializeBufferInfo(aSize, mFormat);
|
serializer.InitializeBufferInfo(aSize, mFormat);
|
||||||
|
mSize = aSize;
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -220,6 +221,7 @@ BufferTextureClient::AllocateForYCbCr(gfx::IntSize aYSize, gfx::IntSize aCbCrSiz
|
|||||||
YCbCrImageDataSerializer serializer(GetBuffer());
|
YCbCrImageDataSerializer serializer(GetBuffer());
|
||||||
serializer.InitializeBufferInfo(aYSize,
|
serializer.InitializeBufferInfo(aYSize,
|
||||||
aCbCrSize);
|
aCbCrSize);
|
||||||
|
mSize = aYSize;
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -124,6 +124,8 @@ public:
|
|||||||
|
|
||||||
virtual bool ToSurfaceDescriptor(SurfaceDescriptor& aDescriptor) = 0;
|
virtual bool ToSurfaceDescriptor(SurfaceDescriptor& aDescriptor) = 0;
|
||||||
|
|
||||||
|
virtual gfx::IntSize GetSize() const = 0;
|
||||||
|
|
||||||
void SetFlags(TextureFlags aFlags)
|
void SetFlags(TextureFlags aFlags)
|
||||||
{
|
{
|
||||||
MOZ_ASSERT(!IsSharedWithCompositor());
|
MOZ_ASSERT(!IsSharedWithCompositor());
|
||||||
@ -193,6 +195,8 @@ public:
|
|||||||
|
|
||||||
virtual size_t GetBufferSize() const = 0;
|
virtual size_t GetBufferSize() const = 0;
|
||||||
|
|
||||||
|
virtual gfx::IntSize GetSize() const { return mSize; }
|
||||||
|
|
||||||
// TextureClientSurface
|
// TextureClientSurface
|
||||||
|
|
||||||
virtual TextureClientSurface* AsTextureClientSurface() MOZ_OVERRIDE { return this; }
|
virtual TextureClientSurface* AsTextureClientSurface() MOZ_OVERRIDE { return this; }
|
||||||
@ -214,6 +218,7 @@ public:
|
|||||||
protected:
|
protected:
|
||||||
CompositableClient* mCompositable;
|
CompositableClient* mCompositable;
|
||||||
gfx::SurfaceFormat mFormat;
|
gfx::SurfaceFormat mFormat;
|
||||||
|
gfx::IntSize mSize;
|
||||||
};
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -39,7 +39,7 @@ public:
|
|||||||
bool aIsCrossProcess = false,
|
bool aIsCrossProcess = false,
|
||||||
bool aInverted = false);
|
bool aInverted = false);
|
||||||
|
|
||||||
gfx::IntSize GetSize() const { return mSize; }
|
virtual gfx::IntSize GetSize() const { return mSize; }
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
gfx::IntSize mSize;
|
gfx::IntSize mSize;
|
||||||
|
Loading…
Reference in New Issue
Block a user