mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 1146912 - Finish replacing TextureHost::GetTextureSource by BindTextureSource. r=sotaro
This commit is contained in:
parent
ba24a94dc6
commit
2683def1bf
@ -131,14 +131,15 @@ DIBTextureHost::DIBTextureHost(TextureFlags aFlags,
|
||||
gfxPlatform::GetPlatform()->OptimalFormatForContent(mSurface->GetContentType()));
|
||||
}
|
||||
|
||||
TextureSource*
|
||||
DIBTextureHost::GetTextureSources()
|
||||
bool
|
||||
DIBTextureHost::BindTextureSource(CompositableTextureSourceRef& aTexture)
|
||||
{
|
||||
if (!mTextureSource) {
|
||||
Updated();
|
||||
}
|
||||
|
||||
return mTextureSource;
|
||||
aTexture = mTextureSource;
|
||||
return !!aTexture;
|
||||
}
|
||||
|
||||
void
|
||||
|
@ -72,7 +72,7 @@ public:
|
||||
DIBTextureHost(TextureFlags aFlags,
|
||||
const SurfaceDescriptorDIB& aDescriptor);
|
||||
|
||||
virtual TextureSource* GetTextureSources() override;
|
||||
virtual bool BindTextureSource(CompositableTextureSourceRef& aTexture) override;
|
||||
|
||||
virtual void DeallocateDeviceData() override;
|
||||
|
||||
|
@ -64,9 +64,10 @@ public:
|
||||
|
||||
virtual gfx::SurfaceFormat GetFormat() const override;
|
||||
|
||||
virtual TextureSource* GetTextureSources() override
|
||||
virtual bool BindTextureSource(CompositableTextureSourceRef& aTexture) override
|
||||
{
|
||||
return mTextureSource;
|
||||
aTexture = mTextureSource;
|
||||
return !!aTexture;
|
||||
}
|
||||
|
||||
virtual TemporaryRef<gfx::DataSourceSurface> GetAsSurface() override
|
||||
|
@ -147,13 +147,6 @@ TextureHost::GetIPDLActor()
|
||||
return mActor;
|
||||
}
|
||||
|
||||
bool
|
||||
TextureHost::BindTextureSource(CompositableTextureSourceRef& texture)
|
||||
{
|
||||
texture = GetTextureSources();
|
||||
return !!texture;
|
||||
}
|
||||
|
||||
FenceHandle
|
||||
TextureHost::GetAndResetReleaseFenceHandle()
|
||||
{
|
||||
@ -450,12 +443,13 @@ BufferTextureHost::Unlock()
|
||||
mLocked = false;
|
||||
}
|
||||
|
||||
TextureSource*
|
||||
BufferTextureHost::GetTextureSources()
|
||||
bool
|
||||
BufferTextureHost::BindTextureSource(CompositableTextureSourceRef& aTexture)
|
||||
{
|
||||
MOZ_ASSERT(mLocked);
|
||||
MOZ_ASSERT(mFirstSource);
|
||||
return mFirstSource;
|
||||
aTexture = mFirstSource;
|
||||
return !!aTexture;
|
||||
}
|
||||
|
||||
gfx::SurfaceFormat
|
||||
|
@ -204,19 +204,6 @@ public:
|
||||
return *this;
|
||||
}
|
||||
|
||||
CompositableTextureRef& operator=(const TemporaryRef<T>& aOther)
|
||||
{
|
||||
RefPtr<T> temp = aOther;
|
||||
if (temp) {
|
||||
temp->AddCompositableRef();
|
||||
}
|
||||
if (mRef) {
|
||||
mRef->ReleaseCompositableRef();
|
||||
}
|
||||
mRef = temp;
|
||||
return *this;
|
||||
}
|
||||
|
||||
CompositableTextureRef& operator=(T* aOther)
|
||||
{
|
||||
if (aOther) {
|
||||
@ -378,15 +365,6 @@ public:
|
||||
*/
|
||||
virtual gfx::SurfaceFormat GetFormat() const = 0;
|
||||
|
||||
/**
|
||||
* Return a list of TextureSources for use with a Compositor.
|
||||
*
|
||||
* This can trigger texture uploads, so do not call it inside transactions
|
||||
* so as to not upload textures while the main thread is blocked.
|
||||
* Must not be called while this TextureHost is not sucessfully Locked.
|
||||
*/
|
||||
virtual TextureSource* GetTextureSources() = 0;
|
||||
|
||||
/**
|
||||
* Called during the transaction. The TextureSource may or may not be composited.
|
||||
*
|
||||
@ -399,7 +377,7 @@ public:
|
||||
*
|
||||
* Note that this is called only withing lock/unlock.
|
||||
*/
|
||||
virtual bool BindTextureSource(CompositableTextureSourceRef& aTexture);
|
||||
virtual bool BindTextureSource(CompositableTextureSourceRef& aTexture) = 0;
|
||||
|
||||
/**
|
||||
* Called when another TextureHost will take over.
|
||||
@ -586,7 +564,7 @@ public:
|
||||
|
||||
virtual void Unlock() override;
|
||||
|
||||
virtual TextureSource* GetTextureSources() override;
|
||||
virtual bool BindTextureSource(CompositableTextureSourceRef& aTexture) override;
|
||||
|
||||
virtual void DeallocateDeviceData() override;
|
||||
|
||||
@ -594,7 +572,7 @@ public:
|
||||
|
||||
/**
|
||||
* Return the format that is exposed to the compositor when calling
|
||||
* GetTextureSources.
|
||||
* BindTextureSource.
|
||||
*
|
||||
* If the shared format is YCbCr and the compositor does not support it,
|
||||
* GetFormat will be RGB32 (even though mFormat is SurfaceFormat::YUV).
|
||||
@ -723,10 +701,11 @@ public:
|
||||
virtual bool Lock() override;
|
||||
virtual void Unlock() override;
|
||||
|
||||
virtual TextureSource* GetTextureSources() override {
|
||||
virtual bool BindTextureSource(CompositableTextureSourceRef& aTexture) override {
|
||||
MOZ_ASSERT(mIsLocked);
|
||||
MOZ_ASSERT(mTexSource);
|
||||
return mTexSource;
|
||||
aTexture = mTexSource;
|
||||
return !!aTexture;
|
||||
}
|
||||
|
||||
virtual gfx::SurfaceFormat GetFormat() const override;
|
||||
|
@ -30,9 +30,10 @@ public:
|
||||
|
||||
virtual gfx::IntSize GetSize() const override;
|
||||
|
||||
virtual TextureSource* GetTextureSources() override
|
||||
virtual bool BindTextureSource(CompositableTextureSourceRef& aTexture) override
|
||||
{
|
||||
return mTextureSource;
|
||||
aTexture = mTextureSource;
|
||||
return !!aTexture;
|
||||
}
|
||||
|
||||
virtual TemporaryRef<gfx::DataSourceSurface> GetAsSurface() override
|
||||
|
@ -637,13 +637,14 @@ DXGITextureHostD3D11::Unlock()
|
||||
mIsLocked = false;
|
||||
}
|
||||
|
||||
TextureSource*
|
||||
DXGITextureHostD3D11::GetTextureSources()
|
||||
bool
|
||||
DXGITextureHostD3D11::BindTextureSource(CompositableTextureSourceRef& aTexture)
|
||||
{
|
||||
MOZ_ASSERT(mIsLocked);
|
||||
// If Lock was successful we must have a valid TextureSource.
|
||||
MOZ_ASSERT(mTextureSource);
|
||||
return mTextureSource.get();
|
||||
aTexture = mTextureSource;
|
||||
return !!aTexture;
|
||||
}
|
||||
|
||||
DXGIYCbCrTextureHostD3D11::DXGIYCbCrTextureHostD3D11(TextureFlags aFlags,
|
||||
@ -740,13 +741,14 @@ DXGIYCbCrTextureHostD3D11::Unlock()
|
||||
mIsLocked = false;
|
||||
}
|
||||
|
||||
TextureSource*
|
||||
DXGIYCbCrTextureHostD3D11::GetTextureSources()
|
||||
bool
|
||||
DXGIYCbCrTextureHostD3D11::BindTextureSource(CompositableTextureSourceRef& aTexture)
|
||||
{
|
||||
MOZ_ASSERT(mIsLocked);
|
||||
// If Lock was successful we must have a valid TextureSource.
|
||||
MOZ_ASSERT(mTextureSources[0] && mTextureSources[1] && mTextureSources[2]);
|
||||
return mTextureSources[0].get();
|
||||
aTexture = mTextureSources[0].get();
|
||||
return !!aTexture;
|
||||
}
|
||||
|
||||
bool
|
||||
|
@ -244,7 +244,7 @@ public:
|
||||
DXGITextureHostD3D11(TextureFlags aFlags,
|
||||
const SurfaceDescriptorD3D10& aDescriptor);
|
||||
|
||||
virtual TextureSource* GetTextureSources() override;
|
||||
virtual bool BindTextureSource(CompositableTextureSourceRef& aTexture) override;
|
||||
|
||||
virtual void DeallocateDeviceData() override {}
|
||||
|
||||
@ -283,7 +283,7 @@ public:
|
||||
DXGIYCbCrTextureHostD3D11(TextureFlags aFlags,
|
||||
const SurfaceDescriptorDXGIYCbCr& aDescriptor);
|
||||
|
||||
virtual TextureSource* GetTextureSources() override;
|
||||
virtual bool BindTextureSource(CompositableTextureSourceRef& aTexture) override;
|
||||
|
||||
virtual void DeallocateDeviceData() override{}
|
||||
|
||||
|
@ -918,12 +918,13 @@ TextureHostD3D9::SetCompositor(Compositor* aCompositor)
|
||||
}
|
||||
}
|
||||
|
||||
TextureSource*
|
||||
TextureHostD3D9::GetTextureSources()
|
||||
bool
|
||||
TextureHostD3D9::BindTextureSource(CompositableTextureSourceRef& aTexture)
|
||||
{
|
||||
MOZ_ASSERT(mIsLocked);
|
||||
MOZ_ASSERT(mTextureSource);
|
||||
return mTextureSource;
|
||||
aTexture = mTextureSource;
|
||||
return !!aTexture;
|
||||
}
|
||||
|
||||
bool
|
||||
@ -994,12 +995,13 @@ DXGITextureHostD3D9::OpenSharedHandle()
|
||||
return;
|
||||
}
|
||||
|
||||
TextureSource*
|
||||
DXGITextureHostD3D9::GetTextureSources()
|
||||
bool
|
||||
DXGITextureHostD3D9::BindTextureSource(CompositableTextureSourceRef& aTexture)
|
||||
{
|
||||
MOZ_ASSERT(mIsLocked);
|
||||
MOZ_ASSERT(mTextureSource);
|
||||
return mTextureSource;
|
||||
aTexture = mTextureSource;
|
||||
return !!aTexture;
|
||||
}
|
||||
|
||||
bool
|
||||
@ -1112,13 +1114,14 @@ DXGIYCbCrTextureHostD3D9::Unlock()
|
||||
mIsLocked = false;
|
||||
}
|
||||
|
||||
TextureSource*
|
||||
DXGIYCbCrTextureHostD3D9::GetTextureSources()
|
||||
bool
|
||||
DXGIYCbCrTextureHostD3D9::BindTextureSource(CompositableTextureSourceRef& aTexture)
|
||||
{
|
||||
MOZ_ASSERT(mIsLocked);
|
||||
// If Lock was successful we must have a valid TextureSource.
|
||||
MOZ_ASSERT(mTextureSources[0] && mTextureSources[1] && mTextureSources[2]);
|
||||
return mTextureSources[0].get();
|
||||
aTexture = mTextureSources[0].get();
|
||||
return !!aTexture;
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -298,7 +298,7 @@ public:
|
||||
TextureHostD3D9(TextureFlags aFlags,
|
||||
const SurfaceDescriptorD3D9& aDescriptor);
|
||||
|
||||
virtual TextureSource* GetTextureSources() override;
|
||||
virtual bool BindTextureSource(CompositableTextureSourceRef& aTexture) override;
|
||||
|
||||
virtual void DeallocateDeviceData() override;
|
||||
|
||||
@ -339,7 +339,7 @@ public:
|
||||
DXGITextureHostD3D9(TextureFlags aFlags,
|
||||
const SurfaceDescriptorD3D10& aDescriptor);
|
||||
|
||||
virtual TextureSource* GetTextureSources() override;
|
||||
virtual bool BindTextureSource(CompositableTextureSourceRef& aTexture) override;
|
||||
|
||||
virtual void DeallocateDeviceData() override;
|
||||
|
||||
@ -376,7 +376,7 @@ public:
|
||||
DXGIYCbCrTextureHostD3D9(TextureFlags aFlags,
|
||||
const SurfaceDescriptorDXGIYCbCr& aDescriptor);
|
||||
|
||||
virtual TextureSource* GetTextureSources() override;
|
||||
virtual bool BindTextureSource(CompositableTextureSourceRef& aTexture) override;
|
||||
|
||||
virtual void DeallocateDeviceData() override {}
|
||||
|
||||
|
@ -244,12 +244,6 @@ GrallocTextureHostOGL::GetAsSurface() {
|
||||
return surf.forget();
|
||||
}
|
||||
|
||||
TextureSource*
|
||||
GrallocTextureHostOGL::GetTextureSources()
|
||||
{
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
void
|
||||
GrallocTextureHostOGL::UnbindTextureSource()
|
||||
{
|
||||
|
@ -53,8 +53,6 @@ public:
|
||||
|
||||
virtual void UnbindTextureSource() override;
|
||||
|
||||
virtual TextureSource* GetTextureSources() override;
|
||||
|
||||
#if defined(MOZ_WIDGET_GONK) && ANDROID_VERSION >= 17
|
||||
virtual TextureHostOGL* AsHostOGL() override
|
||||
{
|
||||
|
@ -74,9 +74,10 @@ public:
|
||||
|
||||
virtual gfx::SurfaceFormat GetFormat() const override;
|
||||
|
||||
virtual TextureSource* GetTextureSources() override
|
||||
virtual bool BindTextureSource(CompositableTextureSourceRef& aTexture) override
|
||||
{
|
||||
return mTextureSource;
|
||||
aTexture = mTextureSource;
|
||||
return !!aTexture;
|
||||
}
|
||||
|
||||
virtual TemporaryRef<gfx::DataSourceSurface> GetAsSurface() override
|
||||
|
@ -400,9 +400,10 @@ public:
|
||||
|
||||
virtual gfx::SurfaceFormat GetFormat() const override;
|
||||
|
||||
virtual TextureSource* GetTextureSources() override
|
||||
virtual bool BindTextureSource(CompositableTextureSourceRef& aTexture) override
|
||||
{
|
||||
return mTextureSource;
|
||||
aTexture = mTextureSource;
|
||||
return !!aTexture;
|
||||
}
|
||||
|
||||
virtual TemporaryRef<gfx::DataSourceSurface> GetAsSurface() override
|
||||
@ -492,9 +493,10 @@ public:
|
||||
|
||||
virtual gfx::SurfaceFormat GetFormat() const override;
|
||||
|
||||
virtual TextureSource* GetTextureSources() override
|
||||
virtual bool BindTextureSource(CompositableTextureSourceRef& aTexture) override
|
||||
{
|
||||
return mTextureSource;
|
||||
aTexture = mTextureSource;
|
||||
return !!aTexture;
|
||||
}
|
||||
|
||||
virtual TemporaryRef<gfx::DataSourceSurface> GetAsSurface() override
|
||||
|
Loading…
Reference in New Issue
Block a user