Backed out changeset 3dce92c9562d (bug 1232042) for causing Win7 slaves to apparently crash and lock up a=backout

This commit is contained in:
Wes Kocher 2016-02-17 11:11:10 -08:00
parent 3e9ea9b4fc
commit 8114ad6468
6 changed files with 12 additions and 90 deletions

View File

@ -788,28 +788,17 @@ struct ParamTraits<mozilla::layers::TextureFactoryIdentifier>
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;
}

View File

@ -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()
{

View File

@ -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<IDXGISwapChain> 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)
{}
};
/**

View File

@ -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);

View File

@ -2407,12 +2407,6 @@ gfxWindowsPlatform::InitializeD3D11()
return;
}
RefPtr<ID3D10Multithread> 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 {

View File

@ -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<ClientLayerManager*>(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!");