Bug 1024643: Create and upload D2D bitmaps in separate steps. r=mattwoodrow

This commit is contained in:
Bas Schouten 2014-06-12 19:05:37 +00:00
Родитель 6acfa3e394
Коммит 4652eb1967
1 изменённых файлов: 8 добавлений и 1 удалений

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

@ -69,13 +69,20 @@ SourceSurfaceD2D::InitFromData(unsigned char *aData,
}
D2D1_BITMAP_PROPERTIES props = D2D1::BitmapProperties(D2DPixelFormat(aFormat));
hr = aRT->CreateBitmap(D2DIntSize(aSize), aData, aStride, props, byRef(mBitmap));
hr = aRT->CreateBitmap(D2DIntSize(aSize), props, byRef(mBitmap));
if (FAILED(hr)) {
gfxWarning() << "Failed to create D2D Bitmap for data. Code: " << hr;
return false;
}
hr = mBitmap->CopyFromMemory(nullptr, aData, aStride);
if (FAILED(hr)) {
gfxWarning() << "Failed to copy data to D2D bitmap. Code: " << hr;
return false;
}
DrawTargetD2D::mVRAMUsageSS += GetByteSize();
mDevice = Factory::GetDirect3D10Device();