already_AddRefed<gfxXlibSurface> SurfaceDescriptorX11::OpenForeign() const { Display* display = DefaultXDisplay(); Screen* screen = DefaultScreenOfDisplay(display); RefPtr<gfxXlibSurface> surf; XRenderPictFormat* pictFormat = GetXRenderPictFormatFromId(display, mFormat); if (pictFormat) { surf = new gfxXlibSurface(screen, mId, pictFormat, mSize); } else { Visual* visual; int depth; FindVisualAndDepth(display, mFormat, &visual, &depth); if (!visual) return nullptr; surf = new gfxXlibSurface(display, mId, visual, mSize); } #ifdef GL_PROVIDER_GLX if (mGLXPixmap) surf->BindGLXPixmap(mGLXPixmap); #endif return surf->CairoStatus() ? nullptr : surf.forget(); }
already_AddRefed<gfxXlibSurface> SurfaceDescriptorX11::OpenForeign() const { Display* display = DefaultXDisplay(); Screen* screen = DefaultScreenOfDisplay(display); XRenderPictFormat* format = GetXRenderPictFormatFromId(display, mFormat); nsRefPtr<gfxXlibSurface> surf = new gfxXlibSurface(screen, mId, format, mSize); return surf->CairoStatus() ? nsnull : surf.forget(); }
already_AddRefed<gfxXlibSurface> SurfaceDescriptorX11::OpenForeign() const { Display* display = DefaultXDisplay(); Screen* screen = DefaultScreenOfDisplay(display); nsRefPtr<gfxXlibSurface> surf; XRenderPictFormat* pictFormat = GetXRenderPictFormatFromId(display, mFormat); if (pictFormat) { surf = new gfxXlibSurface(screen, mId, pictFormat, gfx::ThebesIntSize(mSize)); } else { Visual* visual; int depth; FindVisualAndDepth(display, mFormat, &visual, &depth); if (!visual) return nullptr; surf = new gfxXlibSurface(display, mId, visual, gfx::ThebesIntSize(mSize)); } return surf->CairoStatus() ? nullptr : surf.forget(); }
already_AddRefed<gfxXlibSurface> SurfaceDescriptorX11::OpenForeign() const { Display* display = DefaultXDisplay(); Screen* screen = DefaultScreenOfDisplay(display); nsRefPtr<gfxXlibSurface> surf; XRenderPictFormat* pictFormat = GetXRenderPictFormatFromId(display, mFormat); if (pictFormat) { surf = new gfxXlibSurface(screen, mId, pictFormat, mSize); } else { Visual* visual = NULL; unsigned int depth; XVisualIDToInfo(display, mFormat, &visual, &depth); if (!visual) return nsnull; surf = new gfxXlibSurface(display, mId, visual, mSize); } return surf->CairoStatus() ? nsnull : surf.forget(); }