Bug 1216366: Ensure D3D11 uploads the entire surface the first time for component alpha textures. r=nical
authorBas Schouten <bschouten@mozilla.com>
Tue, 24 Nov 2015 17:04:13 +0100
changeset 308099 ce1ab07ca57672c5bf9f64169847a832ec91eb81
parent 308098 60e8107592ff765e7b0057e72ef932b77f8d8c06
child 308100 c2c730d6bd73378267abea71eacf0d7d5a5c57a9
push id5513
push userraliiev@mozilla.com
push dateMon, 25 Jan 2016 13:55:34 +0000
treeherdermozilla-beta@5ee97dd05b5c [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersnical
bugs1216366
milestone45.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 1216366: Ensure D3D11 uploads the entire surface the first time for component alpha textures. r=nical
gfx/layers/d3d11/TextureD3D11.cpp
--- a/gfx/layers/d3d11/TextureD3D11.cpp
+++ b/gfx/layers/d3d11/TextureD3D11.cpp
@@ -1013,34 +1013,39 @@ DataTextureSourceD3D11::Update(DataSourc
       if (currentDesc.Width != mSize.width || currentDesc.Height != mSize.height ||
           currentDesc.Format != dxgiFormat) {
         mTexture = nullptr;
         // Make sure we upload the whole surface.
         aDestRegion = nullptr;
       }
     }
 
+    nsIntRegion *regionToUpdate = aDestRegion;
     if (!mTexture) {
       hr = mCompositor->GetDevice()->CreateTexture2D(&desc, nullptr, getter_AddRefs(mTexture));
       mIsTiled = false;
       if (FAILED(hr) || !mTexture) {
         Reset();
         return false;
       }
+
+      if (mFlags & TextureFlags::COMPONENT_ALPHA) {
+        regionToUpdate = nullptr;
+      }
     }
 
     DataSourceSurface::MappedSurface map;
     if (!aSurface->Map(DataSourceSurface::MapType::READ, &map)) {
       gfxCriticalError() << "Failed to map surface.";
       Reset();
       return false;
     }
 
-    if (aDestRegion) {
-      nsIntRegionRectIterator iter(*aDestRegion);
+    if (regionToUpdate) {
+      nsIntRegionRectIterator iter(*regionToUpdate);
       const IntRect *iterRect;
       while ((iterRect = iter.Next())) {
         D3D11_BOX box;
         box.front = 0;
         box.back = 1;
         box.left = iterRect->x;
         box.top = iterRect->y;
         box.right = iterRect->XMost();