Bug 1115819: Deal with failure to create a realized bitmap in SourceSurfaceD2D1::DrawTargetWillChange. r=jrmuizel

This commit is contained in:
Bas Schouten 2015-01-08 00:10:48 +00:00
parent 5dfda10072
commit 7622c3a766

View File

@ -108,7 +108,13 @@ SourceSurfaceD2D1::DrawTargetWillChange()
props.pixelFormat = D2DPixelFormat(mFormat);
props.colorContext = nullptr;
props.bitmapOptions = D2D1_BITMAP_OPTIONS_TARGET;
mDC->CreateBitmap(D2DIntSize(mSize), nullptr, 0, props, (ID2D1Bitmap1**)byRef(mRealizedBitmap));
HRESULT hr = mDC->CreateBitmap(D2DIntSize(mSize), nullptr, 0, props, (ID2D1Bitmap1**)byRef(mRealizedBitmap));
if (FAILED(hr)) {
gfxCriticalError() << "Failed to create bitmap to make DrawTarget copy. Size: " << mSize << " Code: " << hexa(hr);
MarkIndependent();
return;
}
D2D1_POINT_2U point = D2D1::Point2U(0, 0);
D2D1_RECT_U rect = D2D1::RectU(0, 0, mSize.width, mSize.height);