Bug 1138934 - Make sure the white texture of a component alpha pair is fully uploaded when new. r=nical, a=lmandel
authorBas Schouten <bschouten@mozilla.com>
Fri, 06 Mar 2015 02:37:12 +0100
changeset 250308 a0dcce408108
parent 250307 b06724f2ed0a
child 250309 116d059a1e7d
push id4542
push userryanvm@gmail.com
push date2015-03-09 19:13 +0000
treeherdermozilla-beta@46392e569cb6 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersnical, lmandel
bugs1138934
milestone37.0
Bug 1138934 - Make sure the white texture of a component alpha pair is fully uploaded when new. r=nical, a=lmandel This is slightly wasteful since this will also always upload the full black texture. The wastage here is so rare and generally so few though that I don't think it's worth adding plumming for the texture host to know if this is the texture on white of on black.
gfx/layers/composite/TextureHost.cpp
--- a/gfx/layers/composite/TextureHost.cpp
+++ b/gfx/layers/composite/TextureHost.cpp
@@ -355,17 +355,24 @@ TextureSource::~TextureSource()
 BufferTextureHost::BufferTextureHost(gfx::SurfaceFormat aFormat,
                                      TextureFlags aFlags)
 : TextureHost(aFlags)
 , mCompositor(nullptr)
 , mFormat(aFormat)
 , mUpdateSerial(1)
 , mLocked(false)
 , mNeedsFullUpdate(false)
-{}
+{
+  if (aFlags & TextureFlags::COMPONENT_ALPHA) {
+    // One texture of a component alpha texture pair will start out all white.
+    // This hack allows us to easily make sure that white will be uploaded.
+    // See bug 1138934
+    mNeedsFullUpdate = true;
+  }
+}
 
 void
 BufferTextureHost::InitSize()
 {
   if (mFormat == gfx::SurfaceFormat::YUV) {
     YCbCrImageDataDeserializer yuvDeserializer(GetBuffer(), GetBufferSize());
     if (yuvDeserializer.IsValid()) {
       mSize = yuvDeserializer.GetYSize();