Bug 722269: Make DrawTargetD2D::DrawSurface deal with any SourceSurface convertible to a DataSourceSurface. r=joedrew

This commit is contained in:
Bas Schouten 2012-09-20 21:24:12 +00:00
Родитель 6cef98eb96
Коммит 5161d422fa
1 изменённых файлов: 8 добавлений и 4 удалений

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

@ -291,9 +291,15 @@ DrawTargetD2D::DrawSurface(SourceSurface *aSurface,
AddDependencyOnSource(srcSurf);
}
break;
case SURFACE_DATA:
default:
{
DataSourceSurface *srcSurf = static_cast<DataSourceSurface*>(aSurface);
RefPtr<DataSourceSurface> srcSurf = aSurface->GetDataSurface();
if (!srcSurf) {
gfxDebug() << "Not able to deal with non-data source surface.";
return;
}
if (aSource.width > rt->GetMaximumBitmapSize() ||
aSource.height > rt->GetMaximumBitmapSize()) {
gfxDebug() << "Bitmap source larger than texture size specified. DrawBitmap will silently fail.";
@ -315,8 +321,6 @@ DrawTargetD2D::DrawSurface(SourceSurface *aSurface,
srcRect.y -= (uint32_t)aSource.y;
}
break;
default:
break;
}
rt->DrawBitmap(bitmap, D2DRect(aDest), aOptions.mAlpha, D2DFilter(aSurfOptions.mFilter), D2DRect(srcRect));