Bug 1073113 - make D3D11 image layers double buffered. r=mattwoodrow
authorNicolas Silva <nsilva@mozilla.com>
Fri, 03 Oct 2014 11:25:07 +0200
changeset 233303 d84db3f0c1abb252ee23e922c1d6b17515bc928d
parent 233302 697c4b245de04c10bd712b4d8b8c8becfb28e98e
child 233304 0dbe7877aaef0932c61140c3dadae32e37b45f18
push id611
push userraliiev@mozilla.com
push dateMon, 05 Jan 2015 23:23:16 +0000
treeherdermozilla-release@345cd3b9c445 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersmattwoodrow
bugs1073113
milestone35.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 1073113 - make D3D11 image layers double buffered. r=mattwoodrow
gfx/layers/client/ClientImageLayer.cpp
--- a/gfx/layers/client/ClientImageLayer.cpp
+++ b/gfx/layers/client/ClientImageLayer.cpp
@@ -100,16 +100,23 @@ protected:
       return mImageClientTypeContainer;
     }
 
     if (mContainer->IsAsync()) {
       mImageClientTypeContainer = CompositableType::BUFFER_BRIDGE;
       return mImageClientTypeContainer;
     }
 
+    // Since D3D11 TextureClient doesn't have an internal buffer, modifying the
+    // front buffer directly may break the transactional property of layer updates.
+    if (ClientManager()->GetCompositorBackendType() == LayersBackend::LAYERS_D3D11) {
+      mImageClientTypeContainer = CompositableType::BUFFER_IMAGE_BUFFERED;
+      return mImageClientTypeContainer;
+    }
+
     AutoLockImage autoLock(mContainer);
 
 #ifdef MOZ_WIDGET_GONK
     // gralloc buffer needs CompositableType::BUFFER_IMAGE_BUFFERED to prevent
     // the buffer's usage conflict.
     if (autoLock.GetImage()->GetFormat() == ImageFormat::OVERLAY_IMAGE) {
       mImageClientTypeContainer = CompositableType::IMAGE_OVERLAY;
       return mImageClientTypeContainer;