Bug 1311642 - Do partial texture uploads on mobile. r=nical
authorJamie Nicol <jnicol@mozilla.com>
Thu, 20 Oct 2016 18:24:12 +0100
changeset 319284 262687aa0bf271c01809f54c6cccd71e3ae052ae
parent 319283 4a4b3074ade68a04ea020a319229dcf59422df30
child 319285 35996f91e760b614ce2e3e5992968bc7465df4bc
push id30869
push userphilringnalda@gmail.com
push dateWed, 26 Oct 2016 04:57:48 +0000
treeherdermozilla-central@9471b3c49b2c [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersnical
bugs1311642
milestone52.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 1311642 - Do partial texture uploads on mobile. r=nical We were always uploading the entire texture region, but still by using glTexSubImage2D. In most cases it should be quicker to use glTexSubImage2D on the updated region only. And where that function has problems we should avoid it by making CanUploadSubTextures return false so that glTexImage2D is used instead. MozReview-Commit-ID: BrobWEPJ82M
gfx/layers/composite/TiledContentHost.cpp
--- a/gfx/layers/composite/TiledContentHost.cpp
+++ b/gfx/layers/composite/TiledContentHost.cpp
@@ -166,26 +166,19 @@ UseTileTexture(CompositableTextureHostRe
     return;
   }
 
   if (aCompositor) {
     aTexture->SetCompositor(aCompositor);
   }
 
   if (!aUpdateRect.IsEmpty()) {
-#ifdef MOZ_GFX_OPTIMIZE_MOBILE
-    aTexture->Updated(nullptr);
-#else
-    // We possibly upload the entire texture contents here. This is a purposeful
-    // decision, as sub-image upload can often be slow and/or unreliable, but
-    // we may want to reevaluate this in the future.
     // For !HasIntermediateBuffer() textures, this is likely a no-op.
     nsIntRegion region = aUpdateRect;
     aTexture->Updated(&region);
-#endif
   }
 
   aTexture->PrepareTextureSource(aTextureSource);
 }
 
 class TextureSourceRecycler
 {
 public: