Bug 781731 - Fixed Azure Cairo GTK perf by removing xlib to buffered image conversion; r=Bas

This commit is contained in:
Anthony Jones 2012-08-27 11:31:33 +02:00
parent 14f7d80c2c
commit a918455be9

View File

@ -535,8 +535,21 @@ gfxPlatform::GetSourceSurfaceForSurface(DrawTarget *aTarget, gfxASurface *aSurfa
dt->Flush();
}
srcBuffer = aTarget->CreateSourceSurfaceFromNativeSurface(surf);
}
} else
#endif
if (aSurface->CairoSurface()) {
// If this is an xlib cairo surface we don't want to fetch it into memory
// because this is a major slow down.
NativeSurface surf;
surf.mFormat = format;
surf.mType = NATIVE_SURFACE_CAIRO_SURFACE;
surf.mSurface = aSurface->CairoSurface();
srcBuffer = aTarget->CreateSourceSurfaceFromNativeSurface(surf);
// It's cheap enough to make a new one so we won't keep it around and
// keeping it creates a cycle.
return srcBuffer;
}
if (!srcBuffer) {
nsRefPtr<gfxImageSurface> imgSurface = aSurface->GetAsImageSurface();