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.mSupportsTextureBlitting);
WriteParam(aMsg, aParam.mSupportsPartialUploads); WriteParam(aMsg, aParam.mSupportsPartialUploads);
WriteParam(aMsg, aParam.mSyncHandle); WriteParam(aMsg, aParam.mSyncHandle);
#ifdef XP_WIN
WriteParam(aMsg, (void*)aParam.mSwapChain);
#endif
} }
static bool Read(const Message* aMsg, void** aIter, paramType* aResult) static bool Read(const Message* aMsg, void** aIter, paramType* aResult)
{ {
uint32_t supportedBlendModes = 0; uint32_t supportedBlendModes = 0;
IDXGISwapChain* swapChain = nullptr;
bool result = ReadParam(aMsg, aIter, &aResult->mParentBackend) && bool result = ReadParam(aMsg, aIter, &aResult->mParentBackend) &&
ReadParam(aMsg, aIter, &supportedBlendModes) && ReadParam(aMsg, aIter, &supportedBlendModes) &&
ReadParam(aMsg, aIter, &aResult->mMaxTextureSize) && ReadParam(aMsg, aIter, &aResult->mMaxTextureSize) &&
ReadParam(aMsg, aIter, &aResult->mSupportsTextureBlitting) && ReadParam(aMsg, aIter, &aResult->mSupportsTextureBlitting) &&
ReadParam(aMsg, aIter, &aResult->mSupportsPartialUploads) && ReadParam(aMsg, aIter, &aResult->mSupportsPartialUploads) &&
ReadParam(aMsg, aIter, &aResult->mSyncHandle) ReadParam(aMsg, aIter, &aResult->mSyncHandle);
#ifdef XP_WIN
&& ReadParam(aMsg, aIter, (void**)&swapChain)
#endif
;
if (XRE_IsParentProcess()) {
aResult->SetSwapChain(swapChain);
}
aResult->mSupportedBlendModes.deserialize(supportedBlendModes); aResult->mSupportedBlendModes.deserialize(supportedBlendModes);
return result; return result;
} }

View File

@ -18,48 +18,10 @@
#include "nsScreenManagerGonk.h" #include "nsScreenManagerGonk.h"
#endif #endif
#ifdef XP_WIN
#include "dxgi.h"
#endif
namespace mozilla { namespace mozilla {
namespace layers { 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 /* static */ void
Compositor::AssertOnCompositorThread() Compositor::AssertOnCompositorThread()
{ {

View File

@ -15,8 +15,6 @@
#include "mozilla/TypedEnumBits.h" #include "mozilla/TypedEnumBits.h"
struct IDXGISwapChain;
namespace mozilla { namespace mozilla {
namespace layers { namespace layers {
@ -168,31 +166,21 @@ struct TextureFactoryIdentifier
bool mSupportsTextureBlitting; bool mSupportsTextureBlitting;
bool mSupportsPartialUploads; bool mSupportsPartialUploads;
SyncHandle mSyncHandle; 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, explicit TextureFactoryIdentifier(LayersBackend aLayersBackend = LayersBackend::LAYERS_NONE,
GeckoProcessType aParentProcessId = GeckoProcessType_Default, GeckoProcessType aParentProcessId = GeckoProcessType_Default,
int32_t aMaxTextureSize = 4096, int32_t aMaxTextureSize = 4096,
bool aSupportsTextureBlitting = false, bool aSupportsTextureBlitting = false,
bool aSupportsPartialUploads = false, bool aSupportsPartialUploads = false,
SyncHandle aSyncHandle = 0, SyncHandle aSyncHandle = 0)
IDXGISwapChain* aSwapChain = nullptr); : mParentBackend(aLayersBackend)
~TextureFactoryIdentifier(); , mParentProcessId(aParentProcessId)
, mSupportedBlendModes(gfx::CompositionOp::OP_OVER)
void SetSwapChain(IDXGISwapChain* aSwapChain); , mMaxTextureSize(aMaxTextureSize)
, mSupportsTextureBlitting(aSupportsTextureBlitting)
, mSupportsPartialUploads(aSupportsPartialUploads)
, mSyncHandle(aSyncHandle)
{}
}; };
/** /**

View File

@ -461,7 +461,6 @@ CompositorD3D11::GetTextureFactoryIdentifier()
ident.mParentProcessId = XRE_GetProcessType(); ident.mParentProcessId = XRE_GetProcessType();
ident.mParentBackend = LayersBackend::LAYERS_D3D11; ident.mParentBackend = LayersBackend::LAYERS_D3D11;
ident.mSyncHandle = mAttachments->mSyncHandle; ident.mSyncHandle = mAttachments->mSyncHandle;
ident.mSwapChain = mSwapChain;
for (uint8_t op = 0; op < uint8_t(gfx::CompositionOp::OP_COUNT); op++) { for (uint8_t op = 0; op < uint8_t(gfx::CompositionOp::OP_COUNT); op++) {
if (BlendOpIsMixBlendMode(gfx::CompositionOp(op))) { if (BlendOpIsMixBlendMode(gfx::CompositionOp(op))) {
ident.mSupportedBlendModes += gfx::CompositionOp(op); ident.mSupportedBlendModes += gfx::CompositionOp(op);

View File

@ -2407,12 +2407,6 @@ gfxWindowsPlatform::InitializeD3D11()
return; 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. // Either device creation function should have returned Available.
MOZ_ASSERT(mD3D11Status == FeatureStatus::Available); MOZ_ASSERT(mD3D11Status == FeatureStatus::Available);
} else { } else {

View File

@ -516,18 +516,8 @@ bool nsWindow::OnPaint(HDC aDC, uint32_t aNestingLevel)
} }
break; break;
case LayersBackend::LAYERS_CLIENT: case LayersBackend::LAYERS_CLIENT:
{ result = listener->PaintWindow(
result = listener->PaintWindow( this, LayoutDeviceIntRegion::FromUnknownRegion(region));
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);
}
}
break; break;
default: default:
NS_ERROR("Unknown layers backend used!"); NS_ERROR("Unknown layers backend used!");