mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 1211615: Upload the full texture on the first upload for component alpha textures. r=nical
This commit is contained in:
parent
9561adfe2a
commit
026b90f054
@ -598,8 +598,13 @@ BufferTextureHost::Upload(nsIntRegion *aRegion)
|
||||
}
|
||||
} else {
|
||||
// non-YCbCr case
|
||||
nsIntRegion* regionToUpdate = aRegion;
|
||||
if (!mFirstSource) {
|
||||
mFirstSource = mCompositor->CreateDataTextureSource(mFlags);
|
||||
if (mFlags & TextureFlags::COMPONENT_ALPHA) {
|
||||
// Update the full region the first time for component alpha textures.
|
||||
regionToUpdate = nullptr;
|
||||
}
|
||||
}
|
||||
ImageDataDeserializer deserializer(GetBuffer(), GetBufferSize());
|
||||
if (!deserializer.IsValid()) {
|
||||
@ -612,7 +617,7 @@ BufferTextureHost::Upload(nsIntRegion *aRegion)
|
||||
return false;
|
||||
}
|
||||
|
||||
if (!mFirstSource->Update(surf.get(), aRegion)) {
|
||||
if (!mFirstSource->Update(surf.get(), regionToUpdate)) {
|
||||
NS_WARNING("failed to update the DataTextureSource");
|
||||
return false;
|
||||
}
|
||||
|
@ -860,12 +860,17 @@ TextureHostD3D9::UpdatedInternal(const nsIntRegion* aRegion)
|
||||
return;
|
||||
}
|
||||
|
||||
const nsIntRegion* regionToUpdate = aRegion;
|
||||
if (!mTextureSource) {
|
||||
mTextureSource = new DataTextureSourceD3D9(mFormat, mSize, mCompositor,
|
||||
nullptr, mFlags);
|
||||
if (mFlags & TextureFlags::COMPONENT_ALPHA) {
|
||||
// Update the full region the first time for component alpha textures.
|
||||
regionToUpdate = nullptr;
|
||||
}
|
||||
}
|
||||
|
||||
if (!mTextureSource->UpdateFromTexture(mTexture, aRegion)) {
|
||||
if (!mTextureSource->UpdateFromTexture(mTexture, regionToUpdate)) {
|
||||
gfxCriticalError() << "[D3D9] DataTextureSourceD3D9::UpdateFromTexture failed";
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user