Bug 1127925 - Lazily open shared handles in DXGITextureHostD3D11 to avoid holding references to textures that might not be used. r=jrmuizel, a=sledru
authorMatt Woodrow <mwoodrow@mozilla.com>
Fri, 13 Feb 2015 14:23:43 +1300
changeset 245416 47ec64cc562f
parent 245414 89cfa8ff9fc5
child 245417 c2a6bab25617
push id662
push userryanvm@gmail.com
push date2015-02-20 00:54 +0000
treeherdermozilla-release@a2ffa9047bf4 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersjrmuizel, sledru
bugs1127925
milestone36.0
Bug 1127925 - Lazily open shared handles in DXGITextureHostD3D11 to avoid holding references to textures that might not be used. r=jrmuizel, a=sledru
gfx/layers/d3d11/TextureD3D11.cpp
--- a/gfx/layers/d3d11/TextureD3D11.cpp
+++ b/gfx/layers/d3d11/TextureD3D11.cpp
@@ -413,21 +413,21 @@ TextureClientD3D11::ToSurfaceDescriptor(
 
   aOutDescriptor = SurfaceDescriptorD3D10((WindowsHandle)sharedHandle, mFormat, mSize);
   return true;
 }
 
 DXGITextureHostD3D11::DXGITextureHostD3D11(TextureFlags aFlags,
                                            const SurfaceDescriptorD3D10& aDescriptor)
   : TextureHost(aFlags)
+  , mSize(aDescriptor.size())
   , mHandle(aDescriptor.handle())
   , mFormat(aDescriptor.format())
   , mIsLocked(false)
 {
-  OpenSharedHandle();
 }
 
 bool
 DXGITextureHostD3D11::OpenSharedHandle()
 {
   if (!GetDevice()) {
     return false;
   }