Bug 1073113 - make D3D11 image layers double buffered. r=mattwoodrow
authorNicolas Silva <nsilva@mozilla.com>
Fri, 03 Oct 2014 11:25:07 +0200
changeset 208768 d84db3f0c1abb252ee23e922c1d6b17515bc928d
parent 208767 697c4b245de04c10bd712b4d8b8c8becfb28e98e
child 208769 0dbe7877aaef0932c61140c3dadae32e37b45f18
push id1
push userroot
push dateMon, 20 Oct 2014 17:29:22 +0000
reviewersmattwoodrow
bugs1073113
milestone35.0a1
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;