diff --git a/gfx/ipc/GfxMessageUtils.h b/gfx/ipc/GfxMessageUtils.h index 0d0036c1c64..f19948145f2 100644 --- a/gfx/ipc/GfxMessageUtils.h +++ b/gfx/ipc/GfxMessageUtils.h @@ -788,28 +788,17 @@ struct ParamTraits WriteParam(aMsg, aParam.mSupportsTextureBlitting); WriteParam(aMsg, aParam.mSupportsPartialUploads); WriteParam(aMsg, aParam.mSyncHandle); -#ifdef XP_WIN - WriteParam(aMsg, (void*)aParam.mSwapChain); -#endif } static bool Read(const Message* aMsg, void** aIter, paramType* aResult) { uint32_t supportedBlendModes = 0; - IDXGISwapChain* swapChain = nullptr; bool result = ReadParam(aMsg, aIter, &aResult->mParentBackend) && ReadParam(aMsg, aIter, &supportedBlendModes) && ReadParam(aMsg, aIter, &aResult->mMaxTextureSize) && ReadParam(aMsg, aIter, &aResult->mSupportsTextureBlitting) && ReadParam(aMsg, aIter, &aResult->mSupportsPartialUploads) && - ReadParam(aMsg, aIter, &aResult->mSyncHandle) -#ifdef XP_WIN - && ReadParam(aMsg, aIter, (void**)&swapChain) -#endif - ; - if (XRE_IsParentProcess()) { - aResult->SetSwapChain(swapChain); - } + ReadParam(aMsg, aIter, &aResult->mSyncHandle); aResult->mSupportedBlendModes.deserialize(supportedBlendModes); return result; } diff --git a/gfx/layers/Compositor.cpp b/gfx/layers/Compositor.cpp index 0d39bed82c8..e10b20a1ac0 100644 --- a/gfx/layers/Compositor.cpp +++ b/gfx/layers/Compositor.cpp @@ -18,48 +18,10 @@ #include "nsScreenManagerGonk.h" #endif -#ifdef XP_WIN -#include "dxgi.h" -#endif - namespace mozilla { namespace layers { -TextureFactoryIdentifier& -TextureFactoryIdentifier::operator=(const TextureFactoryIdentifier& aOther) = default; - -TextureFactoryIdentifier::TextureFactoryIdentifier(const TextureFactoryIdentifier& aOther) -{ - *this = aOther; -} - -TextureFactoryIdentifier::TextureFactoryIdentifier(LayersBackend aLayersBackend, - GeckoProcessType aParentProcessId, - int32_t aMaxTextureSize, - bool aSupportsTextureBlitting, - bool aSupportsPartialUploads, - SyncHandle aSyncHandle, - IDXGISwapChain* aSwapChain) - : mParentBackend(aLayersBackend) - , mParentProcessId(aParentProcessId) - , mSupportedBlendModes(gfx::CompositionOp::OP_OVER) - , mMaxTextureSize(aMaxTextureSize) - , mSupportsTextureBlitting(aSupportsTextureBlitting) - , mSupportsPartialUploads(aSupportsPartialUploads) - , mSyncHandle(aSyncHandle) - , mSwapChain(aSwapChain) -{} - -TextureFactoryIdentifier::~TextureFactoryIdentifier() -{} - -void -TextureFactoryIdentifier::SetSwapChain(IDXGISwapChain* aSwapChain) -{ - mSwapChain = aSwapChain; -} - /* static */ void Compositor::AssertOnCompositorThread() { diff --git a/gfx/layers/CompositorTypes.h b/gfx/layers/CompositorTypes.h index 9c48804fefa..ca0f72ad468 100644 --- a/gfx/layers/CompositorTypes.h +++ b/gfx/layers/CompositorTypes.h @@ -15,8 +15,6 @@ #include "mozilla/TypedEnumBits.h" -struct IDXGISwapChain; - namespace mozilla { namespace layers { @@ -168,31 +166,21 @@ struct TextureFactoryIdentifier bool mSupportsTextureBlitting; bool mSupportsPartialUploads; SyncHandle mSyncHandle; - // This member is required to send the SwapChain to the main thread in order - // to workaround bug 1232042. -#ifdef XP_WIN - RefPtr mSwapChain; -#else - void* mSwapChain; -#endif - - // We can't include dxgi.h here because WinUser.h conflicts with some parts - // of the tree. Therefor we compile all constructors & operators in a single - // compile unit. - TextureFactoryIdentifier& operator=(const TextureFactoryIdentifier& aOther); - - TextureFactoryIdentifier(const TextureFactoryIdentifier& aOther); explicit TextureFactoryIdentifier(LayersBackend aLayersBackend = LayersBackend::LAYERS_NONE, GeckoProcessType aParentProcessId = GeckoProcessType_Default, int32_t aMaxTextureSize = 4096, bool aSupportsTextureBlitting = false, bool aSupportsPartialUploads = false, - SyncHandle aSyncHandle = 0, - IDXGISwapChain* aSwapChain = nullptr); - ~TextureFactoryIdentifier(); - - void SetSwapChain(IDXGISwapChain* aSwapChain); + SyncHandle aSyncHandle = 0) + : mParentBackend(aLayersBackend) + , mParentProcessId(aParentProcessId) + , mSupportedBlendModes(gfx::CompositionOp::OP_OVER) + , mMaxTextureSize(aMaxTextureSize) + , mSupportsTextureBlitting(aSupportsTextureBlitting) + , mSupportsPartialUploads(aSupportsPartialUploads) + , mSyncHandle(aSyncHandle) + {} }; /** diff --git a/gfx/layers/d3d11/CompositorD3D11.cpp b/gfx/layers/d3d11/CompositorD3D11.cpp index 4c93c0e0a81..d4300e3d90d 100644 --- a/gfx/layers/d3d11/CompositorD3D11.cpp +++ b/gfx/layers/d3d11/CompositorD3D11.cpp @@ -461,7 +461,6 @@ CompositorD3D11::GetTextureFactoryIdentifier() ident.mParentProcessId = XRE_GetProcessType(); ident.mParentBackend = LayersBackend::LAYERS_D3D11; ident.mSyncHandle = mAttachments->mSyncHandle; - ident.mSwapChain = mSwapChain; for (uint8_t op = 0; op < uint8_t(gfx::CompositionOp::OP_COUNT); op++) { if (BlendOpIsMixBlendMode(gfx::CompositionOp(op))) { ident.mSupportedBlendModes += gfx::CompositionOp(op); diff --git a/gfx/thebes/gfxWindowsPlatform.cpp b/gfx/thebes/gfxWindowsPlatform.cpp index 480b2ebf8e0..a88723549ae 100755 --- a/gfx/thebes/gfxWindowsPlatform.cpp +++ b/gfx/thebes/gfxWindowsPlatform.cpp @@ -2407,12 +2407,6 @@ gfxWindowsPlatform::InitializeD3D11() return; } - RefPtr multi; - HRESULT hr = mD3D11Device->QueryInterface(__uuidof(ID3D10Multithread), getter_AddRefs(multi)); - if (SUCCEEDED(hr) && multi) { - multi->SetMultithreadProtected(TRUE); - } - // Either device creation function should have returned Available. MOZ_ASSERT(mD3D11Status == FeatureStatus::Available); } else { diff --git a/widget/windows/nsWindowGfx.cpp b/widget/windows/nsWindowGfx.cpp index b503ff1e845..2399dff9199 100644 --- a/widget/windows/nsWindowGfx.cpp +++ b/widget/windows/nsWindowGfx.cpp @@ -516,18 +516,8 @@ bool nsWindow::OnPaint(HDC aDC, uint32_t aNestingLevel) } break; case LayersBackend::LAYERS_CLIENT: - { - result = listener->PaintWindow( - this, LayoutDeviceIntRegion::FromUnknownRegion(region)); - ClientLayerManager* clientLM = - static_cast(GetLayerManager()); - IDXGISwapChain* swapChain = clientLM->GetTextureFactoryIdentifier().mSwapChain.get(); - if (swapChain) { - // Workaround for bug 1232042. On some devices artifacts will occur - // is we don't do a main thread present call from the WM_PAINT event. - swapChain->Present(0, 0); - } - } + result = listener->PaintWindow( + this, LayoutDeviceIntRegion::FromUnknownRegion(region)); break; default: NS_ERROR("Unknown layers backend used!");