Bug 1088833 - A bit of a clean up of warnings, and catch bad draw target in the d3d11 canvas case. r=bschouten

This commit is contained in:
Milan Sreckovic 2015-01-20 12:47:29 -05:00
Родитель 9ce1941985
Коммит 5c1754eb7a
5 изменённых файлов: 16 добавлений и 9 удалений

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

@ -571,13 +571,13 @@ Factory::CreateDualDrawTargetForD3D10Textures(ID3D10Texture2D *aTextureA,
newTargetA = new DrawTargetD2D();
if (!newTargetA->Init(aTextureA, aFormat)) {
gfxWarning() << "Failed to create draw target for D3D10 texture.";
gfxWarning() << "Failed to create dual draw target for D3D10 texture.";
return nullptr;
}
newTargetB = new DrawTargetD2D();
if (!newTargetB->Init(aTextureB, aFormat)) {
gfxWarning() << "Failed to create draw target for D3D10 texture.";
gfxWarning() << "Failed to create new draw target for D3D10 texture.";
return nullptr;
}
@ -633,7 +633,7 @@ Factory::CreateDrawTargetForD3D11Texture(ID3D11Texture2D *aTexture, SurfaceForma
return retVal;
}
gfxWarning() << "Failed to create draw target for D3D10 texture.";
gfxWarning() << "Failed to create draw target for D3D11 texture.";
// Failed
return nullptr;

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

@ -364,7 +364,7 @@ RotatedContentBuffer::EnsureBufferOnWhite()
}
NS_WARN_IF_FALSE(mDTBufferOnWhite, "no buffer");
return mDTBufferOnWhite;
return !!mDTBufferOnWhite;
}
bool

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

@ -148,7 +148,7 @@ CanvasLayerD3D10::UpdateSurface()
HRESULT hr = mTexture->Map(0, D3D10_MAP_WRITE_DISCARD, 0, &map);
if (FAILED(hr)) {
NS_WARNING("Failed to lock CanvasLayer texture.");
gfxWarning() << "Failed to lock CanvasLayer texture.";
return;
}
@ -156,9 +156,14 @@ CanvasLayerD3D10::UpdateSurface()
Factory::CreateDrawTargetForD3D10Texture(mTexture,
SurfaceFormat::R8G8B8A8);
if (!destTarget) {
gfxWarning() << "Invalid D3D10 texture target R8G8B8A8";
return;
}
if (surf) {
if (!ReadbackSharedSurface(surf, destTarget)) {
NS_WARNING("Failed to readback into texture.");
gfxWarning() << "Failed to readback into texture.";
}
} else if (mSurface) {
Rect r(Point(0, 0), ToRect(mBounds).Size());

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

@ -299,7 +299,7 @@ PaintedLayerD3D10::VerifyContentType(SurfaceMode aMode)
mDrawTarget = Factory::CreateDrawTargetForD3D10Texture(mTexture, format);
if (!mDrawTarget) {
NS_WARNING("Failed to create drawtarget for PaintedLayerD3D10.");
gfxWarning() << "Failed to create drawtarget for PaintedLayerD3D10.";
return;
}
@ -468,8 +468,7 @@ PaintedLayerD3D10::CreateNewTextures(const gfx::IntSize &aSize, SurfaceMode aMod
}
if (!mDrawTarget) {
NS_WARNING("Failed to create DrawTarget for PaintedLayerD3D10.");
mDrawTarget = nullptr;
gfxWarning() << "Failed to create DrawTarget for PaintedLayerD3D10.";
return;
}
}

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

@ -358,6 +358,9 @@ TextureClientD3D11::BorrowDrawTarget()
MOZ_ASSERT(mTexture10);
mDrawTarget = Factory::CreateDrawTargetForD3D10Texture(mTexture10, mFormat);
}
if (!mDrawTarget) {
gfxWarning() << "Invalid draw target for borrowing";
}
return mDrawTarget;
}