Bug 1481983 - Don't mix && and ||. r=sotaro
authorJeff Gilbert <jgilbert@mozilla.com>
Thu, 09 Aug 2018 01:34:12 +0000
changeset 430591 beb04e83301f593e6ccee87f167092f1aa50f8ac
parent 430590 b4b3be038ab8e3f6c8aa4c3bcfdba2e581d65a13
child 430592 39f0d4e668981f4b519097050c282e3641ef0404
push id34409
push usertoros@mozilla.com
push dateThu, 09 Aug 2018 10:00:05 +0000
treeherdermozilla-central@eb9ff7de69ef [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerssotaro
bugs1481983
milestone63.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 1481983 - Don't mix && and ||. r=sotaro Differential Revision: https://phabricator.services.mozilla.com/D2982
gfx/layers/ipc/ImageBridgeChild.cpp
--- a/gfx/layers/ipc/ImageBridgeChild.cpp
+++ b/gfx/layers/ipc/ImageBridgeChild.cpp
@@ -704,25 +704,25 @@ void
 ImageBridgeChild::UpdateTextureFactoryIdentifier(const TextureFactoryIdentifier& aIdentifier)
 {
   // ImageHost is incompatible between WebRender enabled and WebRender disabled.
   // Then drop all ImageContainers' ImageClients during disabling WebRender.
   bool disablingWebRender = GetCompositorBackendType() == LayersBackend::LAYERS_WR &&
                             aIdentifier.mParentBackend != LayersBackend::LAYERS_WR;
   // D3DTexture might become obsolte. To prevent to use obsoleted D3DTexture,
   // drop all ImageContainers' ImageClients.
+
+  bool needsDrop = disablingWebRender;
+
 #if defined(XP_WIN)
   RefPtr<ID3D11Device> device = gfx::DeviceManagerDx::Get()->GetImageDevice();
-  bool needsDrop = !!mImageDevice &&
-                   mImageDevice != device &&
-                   GetCompositorBackendType() == LayersBackend::LAYERS_D3D11 ||
-                   disablingWebRender;
+  needsDrop |= !!mImageDevice &&
+               mImageDevice != device &&
+               GetCompositorBackendType() == LayersBackend::LAYERS_D3D11;
   mImageDevice = device;
-#else
-  bool needsDrop = disablingWebRender;
 #endif
 
   IdentifyTextureHost(aIdentifier);
   if (needsDrop) {
     nsTArray<RefPtr<ImageContainerListener> > listeners;
     {
       MutexAutoLock lock(mContainerMapLock);
       for (const auto& entry : mImageContainerListeners) {