Bug 1086670 - Add more gfxCriticalError logging in the D2D backend. r=jrmuizel

This commit is contained in:
Nicolas Silva 2014-11-26 21:05:01 +01:00
Родитель e0e268d8b1
Коммит 01dc7cd769
2 изменённых файлов: 8 добавлений и 9 удалений

Просмотреть файл

@ -652,11 +652,8 @@ DrawTargetD2D1::CreateSourceSurfaceFromData(unsigned char *aData,
D2D1::BitmapProperties1(D2D1_BITMAP_OPTIONS_NONE, D2DPixelFormat(aFormat)), D2D1::BitmapProperties1(D2D1_BITMAP_OPTIONS_NONE, D2DPixelFormat(aFormat)),
byRef(bitmap)); byRef(bitmap));
if (FAILED(hr)) { if (FAILED(hr) || !bitmap) {
gfxCriticalError() << "[D2D1.1] CreateBitmap failure " << aSize << " Code: " << hexa(hr); gfxCriticalError() << "[D2D1.1] CreateBitmap failure " << aSize << " Code: " << hexa(hr);
}
if (!bitmap) {
return nullptr; return nullptr;
} }
@ -745,7 +742,7 @@ DrawTargetD2D1::Init(ID3D11Texture2D* aTexture, SurfaceFormat aFormat)
hr = Factory::GetD2D1Device()->CreateDeviceContext(D2D1_DEVICE_CONTEXT_OPTIONS_ENABLE_MULTITHREADED_OPTIMIZATIONS, byRef(mDC)); hr = Factory::GetD2D1Device()->CreateDeviceContext(D2D1_DEVICE_CONTEXT_OPTIONS_ENABLE_MULTITHREADED_OPTIMIZATIONS, byRef(mDC));
if (FAILED(hr)) { if (FAILED(hr)) {
gfxWarning() << *this << ": Error " << hexa(hr) << " failed to initialize new DeviceContext."; gfxCriticalError() <<"[D2D1.1] Failed to create a DeviceContext, code: " << hexa(hr);
return false; return false;
} }
@ -753,6 +750,7 @@ DrawTargetD2D1::Init(ID3D11Texture2D* aTexture, SurfaceFormat aFormat)
aTexture->QueryInterface(__uuidof(IDXGISurface), aTexture->QueryInterface(__uuidof(IDXGISurface),
(void**)((IDXGISurface**)byRef(dxgiSurface))); (void**)((IDXGISurface**)byRef(dxgiSurface)));
if (!dxgiSurface) { if (!dxgiSurface) {
gfxCriticalError() <<"[D2D1.1] Failed to obtain a DXGI surface.";
return false; return false;
} }
@ -799,14 +797,14 @@ DrawTargetD2D1::Init(const IntSize &aSize, SurfaceFormat aFormat)
hr = Factory::GetD2D1Device()->CreateDeviceContext(D2D1_DEVICE_CONTEXT_OPTIONS_ENABLE_MULTITHREADED_OPTIMIZATIONS, byRef(mDC)); hr = Factory::GetD2D1Device()->CreateDeviceContext(D2D1_DEVICE_CONTEXT_OPTIONS_ENABLE_MULTITHREADED_OPTIMIZATIONS, byRef(mDC));
if (FAILED(hr)) { if (FAILED(hr)) {
gfxWarning() << *this << ": Error " << hexa(hr) << " failed to initialize new DeviceContext."; gfxCriticalError() <<"[D2D1.1] Failed to create a DeviceContext, code: " << hexa(hr);
return false; return false;
} }
if (mDC->GetMaximumBitmapSize() < UINT32(aSize.width) || if (mDC->GetMaximumBitmapSize() < UINT32(aSize.width) ||
mDC->GetMaximumBitmapSize() < UINT32(aSize.height)) { mDC->GetMaximumBitmapSize() < UINT32(aSize.height)) {
// This is 'ok' // This is 'ok'
gfxDebug() << *this << ": Attempt to use unsupported surface size for D2D 1.1."; gfxCriticalError() << "[D2D1.1] Attempt to use unsupported surface size " << aSize;
return false; return false;
} }
@ -819,7 +817,7 @@ DrawTargetD2D1::Init(const IntSize &aSize, SurfaceFormat aFormat)
hr = mDC->CreateBitmap(D2DIntSize(aSize), nullptr, 0, props, (ID2D1Bitmap1**)byRef(mBitmap)); hr = mDC->CreateBitmap(D2DIntSize(aSize), nullptr, 0, props, (ID2D1Bitmap1**)byRef(mBitmap));
if (FAILED(hr)) { if (FAILED(hr)) {
gfxCriticalError() << *this << ": Error " << hexa(hr) << " failed to create new Bitmap. Size: " << aSize; gfxCriticalError() << "[D2D1.1] CreateBitmap failure " << aSize << " Code: " << hexa(hr);
return false; return false;
} }
@ -829,7 +827,7 @@ DrawTargetD2D1::Init(const IntSize &aSize, SurfaceFormat aFormat)
hr = mDC->CreateBitmap(D2DIntSize(aSize), nullptr, 0, props, (ID2D1Bitmap1**)byRef(mTempBitmap)); hr = mDC->CreateBitmap(D2DIntSize(aSize), nullptr, 0, props, (ID2D1Bitmap1**)byRef(mTempBitmap));
if (FAILED(hr)) { if (FAILED(hr)) {
gfxCriticalError() << *this << ": Error " << hexa(hr) << " failed to create new TempBitmap. Size: " << aSize; gfxCriticalError() << "[D2D1.1] failed to create new TempBitmap " << aSize << " Code: " << hexa(hr);
return false; return false;
} }

Просмотреть файл

@ -317,6 +317,7 @@ TextureClientD3D11::BorrowDrawTarget()
MOZ_ASSERT(mIsLocked, "Calling TextureClient::BorrowDrawTarget without locking :("); MOZ_ASSERT(mIsLocked, "Calling TextureClient::BorrowDrawTarget without locking :(");
if (!mIsLocked || (!mTexture && !mTexture10)) { if (!mIsLocked || (!mTexture && !mTexture10)) {
gfxCriticalError() << "Attempted to borrow a DrawTarget without locking the texture.";
return nullptr; return nullptr;
} }