Bug 1034257 - Implement CreateSourceSurfaceForNativeSurface for Cairo surface types, to enable Xlib surfaces to be drawn properly when using Skia content rendering r=jrmuizel

This commit is contained in:
George Wright 2014-07-03 17:06:48 -04:00
Родитель 43074631ad
Коммит 4a6bad38d6
1 изменённых файлов: 10 добавлений и 0 удалений

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

@ -657,6 +657,16 @@ DrawTargetSkia::OptimizeSourceSurface(SourceSurface *aSurface) const
TemporaryRef<SourceSurface>
DrawTargetSkia::CreateSourceSurfaceFromNativeSurface(const NativeSurface &aSurface) const
{
if (aSurface.mType == NativeSurfaceType::CAIRO_SURFACE) {
if (aSurface.mSize.width <= 0 ||
aSurface.mSize.height <= 0) {
gfxWarning() << "Can't create a SourceSurface without a valid size";
return nullptr;
}
cairo_surface_t* surf = static_cast<cairo_surface_t*>(aSurface.mSurface);
return new SourceSurfaceCairo(surf, aSurface.mSize, aSurface.mFormat);
}
return nullptr;
}