Bug 1293759. Memset RGBX surfaces with basic layers and a skia backend. r=lsalzman
authorMason Chang <mchang@mozilla.com>
Thu, 11 Aug 2016 07:53:07 -0700
changeset 309065 7fbf4eba5db4bd358ed0ce8dcfe81aadbb52d06e
parent 309064 13f74c2a6ec21d33f6be5e5797d1219db65a8f75
child 309066 efbbc635257e8087b3ae77bae677b0fa52e6da26
push id20299
push userkwierso@gmail.com
push dateFri, 12 Aug 2016 23:39:35 +0000
treeherderfx-team@1ba6215e84c3 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerslsalzman
bugs1293759
milestone51.0a1
Bug 1293759. Memset RGBX surfaces with basic layers and a skia backend. r=lsalzman
gfx/layers/client/TextureClient.cpp
--- a/gfx/layers/client/TextureClient.cpp
+++ b/gfx/layers/client/TextureClient.cpp
@@ -1099,16 +1099,21 @@ TextureClient::CreateForDrawing(TextureF
     data = MacIOSurfaceTextureData::Create(aSize, aFormat, moz2DBackend);
   }
 #endif
 
   if (data) {
     return MakeAndAddRef<TextureClient>(data, aTextureFlags, aAllocator);
   }
 
+  if (moz2DBackend == BackendType::SKIA && aFormat == SurfaceFormat::B8G8R8X8) {
+    // Skia doesn't support RGBX, so ensure we clear the buffer for the proper alpha values.
+    aAllocFlags = TextureAllocationFlags(aAllocFlags | ALLOC_CLEAR_BUFFER);
+  }
+
   // Can't do any better than a buffer texture client.
   return TextureClient::CreateForRawBufferAccess(aAllocator, aFormat, aSize,
                                                  moz2DBackend, aTextureFlags, aAllocFlags);
 }
 
 // static
 already_AddRefed<TextureClient>
 TextureClient::CreateFromSurface(TextureForwarder* aAllocator,