Bug 1209801 - Part 2: Do not allow big image textures to be used with TiledLayerBuffers. r=mattwoodrow

Big-image textures (where multiple textures are tiled together to act as
a single larger texture, e.g. TiledTextureImage) were in some cases
being used to back the TextureSources associated with each Tile in a
TiledLayerBuffer. CompositorOGL was unaware of this, so when compositing
would only render the first tile in each big image, stretching it to the
size of the entire big image.

It doesn't make much sense to allow tiling-within-tiling, so set the
DISALLOW_BIGIMAGE flag for textures created for use with TiledLayerBuffers.
---
 gfx/layers/client/SingleTiledContentClient.cpp | 2 +-
 gfx/layers/client/TiledContentClient.cpp       | 2 +-
 gfx/layers/composite/TextureHost.cpp           | 2 +-
 3 files changed, 3 insertions(+), 3 deletions(-)
This commit is contained in:
Jamie Nicol 2015-10-11 18:13:10 +02:00
parent c13ab94c8e
commit 22bfcfd371
3 changed files with 3 additions and 3 deletions

View File

@ -110,7 +110,7 @@ ClientSingleTiledLayerBuffer::GetTextureClient()
{
return mCompositableClient->CreateTextureClientForDrawing(
gfx::ImageFormatToSurfaceFormat(mFormat), mSize, BackendSelector::Content,
TextureFlags::IMMEDIATE_UPLOAD);
TextureFlags::DISALLOW_BIGIMAGE | TextureFlags::IMMEDIATE_UPLOAD);
}
void

View File

@ -1241,7 +1241,7 @@ ClientMultiTiledLayerBuffer::ValidateTile(TileClient& aTile,
aTile.SetLayerManager(mManager);
aTile.SetTextureAllocator(mManager->GetTexturePool(
gfxPlatform::GetPlatform()->Optimal2DFormatForContent(content),
TextureFlags::IMMEDIATE_UPLOAD));
TextureFlags::DISALLOW_BIGIMAGE | TextureFlags::IMMEDIATE_UPLOAD));
}
aTile.SetCompositableClient(mCompositableClient);

View File

@ -599,7 +599,7 @@ BufferTextureHost::Upload(nsIntRegion *aRegion)
} else {
// non-YCbCr case
if (!mFirstSource) {
mFirstSource = mCompositor->CreateDataTextureSource();
mFirstSource = mCompositor->CreateDataTextureSource(mFlags);
}
ImageDataDeserializer deserializer(GetBuffer(), GetBufferSize());
if (!deserializer.IsValid()) {