Bug 1209801 - Part 2: Do not allow big image textures to be used with TiledLayerBuffers. r=mattwoodrow
☠☠ backed out by 796d79ac842b ☠ ☠
authorJamie Nicol <jnicol@mozilla.com>
Sun, 11 Oct 2015 18:13:10 +0200
changeset 267154 9e69375c47ed56f6846708892a90e66da1d4e21f
parent 267153 ae5f03f140a86f0a8eae37efed15a2d9be8a8e5e
child 267155 3ea27fe2f790397dbce194054d627ee0a3c18fc0
push id66402
push userarchaeopteryx@coole-files.de
push dateSun, 11 Oct 2015 16:15:00 +0000
treeherdermozilla-inbound@ee4cb52e6b15 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersmattwoodrow
bugs1209801
milestone44.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
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(-)
gfx/layers/client/SingleTiledContentClient.cpp
gfx/layers/client/TiledContentClient.cpp
gfx/layers/composite/TextureHost.cpp
--- a/gfx/layers/client/SingleTiledContentClient.cpp
+++ b/gfx/layers/client/SingleTiledContentClient.cpp
@@ -105,17 +105,17 @@ ClientSingleTiledLayerBuffer::GetSurface
                                 mFrameResolution.yScale);
 }
 
 already_AddRefed<TextureClient>
 ClientSingleTiledLayerBuffer::GetTextureClient()
 {
   return mCompositableClient->CreateTextureClientForDrawing(
     gfx::ImageFormatToSurfaceFormat(mFormat), mSize, BackendSelector::Content,
-    TextureFlags::IMMEDIATE_UPLOAD);
+    TextureFlags::DISALLOW_BIGIMAGE | TextureFlags::IMMEDIATE_UPLOAD);
 }
 
 void
 ClientSingleTiledLayerBuffer::PaintThebes(const nsIntRegion& aNewValidRegion,
                                           const nsIntRegion& aPaintRegion,
                                           const nsIntRegion& aDirtyRegion,
                                           LayerManager::DrawPaintedLayerCallback aCallback,
                                           void* aCallbackData)
--- a/gfx/layers/client/TiledContentClient.cpp
+++ b/gfx/layers/client/TiledContentClient.cpp
@@ -1236,17 +1236,17 @@ ClientMultiTiledLayerBuffer::ValidateTil
 
   SurfaceMode mode;
   gfxContentType content = GetContentType(&mode);
 
   if (aTile.IsPlaceholderTile()) {
     aTile.SetLayerManager(mManager);
     aTile.SetTextureAllocator(mManager->GetTexturePool(
       gfxPlatform::GetPlatform()->Optimal2DFormatForContent(content),
-      TextureFlags::IMMEDIATE_UPLOAD));
+      TextureFlags::DISALLOW_BIGIMAGE | TextureFlags::IMMEDIATE_UPLOAD));
   }
   aTile.SetCompositableClient(mCompositableClient);
 
   nsIntRegion offsetScaledDirtyRegion = aDirtyRegion.MovedBy(-aTileOrigin);
   offsetScaledDirtyRegion.ScaleRoundOut(mResolution, mResolution);
 
   bool usingTiledDrawTarget = gfxPrefs::TiledDrawTargetEnabled();
   MOZ_ASSERT(usingTiledDrawTarget || !!mSinglePaintDrawTarget);
--- a/gfx/layers/composite/TextureHost.cpp
+++ b/gfx/layers/composite/TextureHost.cpp
@@ -594,17 +594,17 @@ BufferTextureHost::Upload(nsIntRegion *a
         !srcU->Update(tempCb) ||
         !srcV->Update(tempCr)) {
       NS_WARNING("failed to update the DataTextureSource");
       return false;
     }
   } else {
     // non-YCbCr case
     if (!mFirstSource) {
-      mFirstSource = mCompositor->CreateDataTextureSource();
+      mFirstSource = mCompositor->CreateDataTextureSource(mFlags);
     }
     ImageDataDeserializer deserializer(GetBuffer(), GetBufferSize());
     if (!deserializer.IsValid()) {
       NS_ERROR("Failed to deserialize image!");
       return false;
     }
 
     RefPtr<gfx::DataSourceSurface> surf = deserializer.GetAsSurface();