зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1170390 - Detect 16bpp cairo xlib surface format. r=jrmuizel
This commit is contained in:
Родитель
9486e52615
Коммит
6f442f976d
|
@ -675,6 +675,23 @@ DrawTargetCairo::GetSize()
|
|||
return mSize;
|
||||
}
|
||||
|
||||
SurfaceFormat
|
||||
GfxFormatForCairoSurface(cairo_surface_t* surface)
|
||||
{
|
||||
cairo_surface_type_t type = cairo_surface_get_type(surface);
|
||||
if (type == CAIRO_SURFACE_TYPE_IMAGE) {
|
||||
return CairoFormatToGfxFormat(cairo_image_surface_get_format(surface));
|
||||
}
|
||||
#ifdef CAIRO_HAS_XLIB_SURFACE
|
||||
// xlib is currently the only Cairo backend that creates 16bpp surfaces
|
||||
if (type == CAIRO_SURFACE_TYPE_XLIB &&
|
||||
cairo_xlib_surface_get_depth(surface) == 16) {
|
||||
return SurfaceFormat::R5G6B5;
|
||||
}
|
||||
#endif
|
||||
return CairoContentToGfxFormat(cairo_surface_get_content(surface));
|
||||
}
|
||||
|
||||
already_AddRefed<SourceSurface>
|
||||
DrawTargetCairo::Snapshot()
|
||||
{
|
||||
|
|
|
@ -234,15 +234,7 @@ CairoFormatToGfxFormat(cairo_format_t format)
|
|||
}
|
||||
}
|
||||
|
||||
static inline SurfaceFormat
|
||||
GfxFormatForCairoSurface(cairo_surface_t* surface)
|
||||
{
|
||||
if (cairo_surface_get_type(surface) == CAIRO_SURFACE_TYPE_IMAGE) {
|
||||
return CairoFormatToGfxFormat(cairo_image_surface_get_format(surface));
|
||||
}
|
||||
|
||||
return CairoContentToGfxFormat(cairo_surface_get_content(surface));
|
||||
}
|
||||
SurfaceFormat GfxFormatForCairoSurface(cairo_surface_t* surface);
|
||||
|
||||
static inline void
|
||||
GfxMatrixToCairoMatrix(const Matrix& mat, cairo_matrix_t& retval)
|
||||
|
|
Загрузка…
Ссылка в новой задаче