mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 987311 - Fix a bad enum conversion bug found by converting TextureFlags to typed enums - r=nical
This commit is contained in:
parent
a080758483
commit
884b8d3ea5
@ -38,6 +38,22 @@ using namespace gfx;
|
||||
|
||||
namespace layers {
|
||||
|
||||
static TextureFlags TextureFlagsForRotatedContentBufferFlags(uint32_t aBufferFlags)
|
||||
{
|
||||
TextureFlags result = 0;
|
||||
|
||||
if (aBufferFlags & RotatedContentBuffer::BUFFER_COMPONENT_ALPHA) {
|
||||
result |= TEXTURE_COMPONENT_ALPHA;
|
||||
}
|
||||
|
||||
if (aBufferFlags & RotatedContentBuffer::ALLOW_REPEAT) {
|
||||
result |= TEXTURE_ALLOW_REPEAT;
|
||||
}
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
|
||||
/* static */ TemporaryRef<ContentClient>
|
||||
ContentClient::CreateContentClient(CompositableForwarder* aForwarder)
|
||||
{
|
||||
@ -210,7 +226,7 @@ ContentClientRemoteBuffer::BuildTextureClients(SurfaceFormat aFormat,
|
||||
|
||||
mSurfaceFormat = aFormat;
|
||||
mSize = gfx::IntSize(aRect.width, aRect.height);
|
||||
mTextureInfo.mTextureFlags = aFlags & ~TEXTURE_DEALLOCATE_CLIENT;
|
||||
mTextureInfo.mTextureFlags = TextureFlagsForRotatedContentBufferFlags(aFlags);
|
||||
|
||||
if (!CreateAndAllocateTextureClient(mTextureClient, TEXTURE_ON_BLACK) ||
|
||||
!AddTextureClient(mTextureClient)) {
|
||||
@ -396,19 +412,18 @@ DeprecatedContentClientRemoteBuffer::BuildDeprecatedTextureClients(ContentType a
|
||||
|
||||
mContentType = aType;
|
||||
mSize = gfx::IntSize(aRect.width, aRect.height);
|
||||
mTextureInfo.mTextureFlags = aFlags & ~TEXTURE_DEALLOCATE_CLIENT;
|
||||
mTextureInfo.mTextureFlags = TextureFlagsForRotatedContentBufferFlags(aFlags);
|
||||
|
||||
if (!CreateAndAllocateDeprecatedTextureClient(mDeprecatedTextureClient)) {
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
if (aFlags & BUFFER_COMPONENT_ALPHA) {
|
||||
if (!CreateAndAllocateDeprecatedTextureClient(mDeprecatedTextureClientOnWhite)) {
|
||||
mDeprecatedTextureClient->SetFlags(0);
|
||||
mDeprecatedTextureClient = nullptr;
|
||||
return;
|
||||
}
|
||||
mTextureInfo.mTextureFlags |= TEXTURE_COMPONENT_ALPHA;
|
||||
}
|
||||
|
||||
CreateFrontBufferAndNotify(aRect);
|
||||
|
Loading…
Reference in New Issue
Block a user