mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 934842. CopySurface for data source surfaces. r=Bas
This commit is contained in:
parent
54fb84bbdf
commit
54557b996d
@ -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;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user