Bug 934842. CopySurface for data source surfaces. r=Bas

This commit is contained in:
Nicholas Cameron 2013-11-08 14:39:34 +13:00
Родитель 6b3aa88fb2
Коммит 21a12a201c
2 изменённых файлов: 8 добавлений и 22 удалений

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

@ -724,14 +724,19 @@ DrawTargetCairo::CopySurface(SourceSurface *aSurface,
AutoPrepareForDrawing prep(this, mContext);
AutoClearDeviceOffset clear(aSurface);
if (!aSurface || aSurface->GetType() != SURFACE_CAIRO) {
if (!aSurface) {
gfxWarning() << "Unsupported surface type specified";
return;
}
cairo_surface_t* surf = static_cast<SourceSurfaceCairo*>(aSurface)->GetSurface();
cairo_surface_t* surf = GetCairoSurfaceForSourceSurface(aSurface);
if (!surf) {
gfxWarning() << "Unsupported surface type specified";
return;
}
CopySurfaceInternal(surf, aSource, aDest);
cairo_surface_destroy(surf);
}
void

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

@ -763,26 +763,7 @@ DrawTargetD2D::CopySurface(SourceSurface *aSurface,
mRT->Clear(D2D1::ColorF(0, 0.0f));
mRT->PopAxisAlignedClip();
RefPtr<ID2D1Bitmap> bitmap;
switch (aSurface->GetType()) {
case SURFACE_D2D1_BITMAP:
{
SourceSurfaceD2D *srcSurf = static_cast<SourceSurfaceD2D*>(aSurface);
bitmap = srcSurf->GetBitmap();
}
break;
case SURFACE_D2D1_DRAWTARGET:
{
SourceSurfaceD2DTarget *srcSurf = static_cast<SourceSurfaceD2DTarget*>(aSurface);
bitmap = srcSurf->GetBitmap(mRT);
AddDependencyOnSource(srcSurf);
}
break;
default:
return;
}
RefPtr<ID2D1Bitmap> bitmap = GetBitmapForSurface(aSurface, srcRect);
if (!bitmap) {
return;
}