static cairo_surface_t * _cairo_skia_surface_create_similar (void *asurface, cairo_content_t content, int width, int height) { cairo_skia_surface_t *surface = (cairo_skia_surface_t *) asurface; SkBitmap::Config config; bool opaque; if (content == surface->image.base.content) { config = surface->bitmap->getConfig (); opaque = surface->bitmap->isOpaque (); } else if (! format_to_sk_config (_cairo_format_from_content (content), config, opaque)) { return NULL; } return &_cairo_skia_surface_create_internal (config, opaque, NULL, width, height, 0)->image.base; }
cairo_surface_t * cairo_skia_surface_create (cairo_format_t format, int width, int height) { SkBitmap::Config config; bool opaque; if (! CAIRO_FORMAT_VALID (format) || ! format_to_sk_config (format, config, opaque)) { return _cairo_surface_create_in_error (_cairo_error (CAIRO_STATUS_INVALID_FORMAT)); } return &_cairo_skia_surface_create_internal (config, opaque, NULL, width, height, 0)->image.base; }
cairo_surface_t * cairo_skia_surface_create_for_data (unsigned char *data, cairo_format_t format, int width, int height, int stride) { SkBitmap::Config config; bool opaque; if (! CAIRO_FORMAT_VALID (format) || ! format_to_sk_config (format, config, opaque)) { return _cairo_surface_create_in_error (_cairo_error (CAIRO_STATUS_INVALID_FORMAT)); } return &_cairo_skia_surface_create_internal (config, opaque, data, width, height, stride)->image.base; }
static cairo_surface_t * _cairo_skia_surface_create_similar (void *asurface, cairo_content_t content, int width, int height) { SkBitmap::Config config; bool opaque; if (! format_to_sk_config (_cairo_format_from_content (content), config, opaque)) { return _cairo_surface_create_in_error (_cairo_error (CAIRO_STATUS_INVALID_FORMAT)); } return &_cairo_skia_surface_create_internal (config, opaque, NULL, width, height, 0)->base; }
static cairo_surface_t * _cairo_skia_surface_create_similar (void *asurface, cairo_content_t content, int width, int height) { SkBitmap::Config config; bool opaque; if (! format_to_sk_config (_cairo_format_from_content (content), config, opaque)) { _skia_unsupported (); return NULL; } return &_cairo_skia_surface_create_internal (config, opaque, NULL, width, height, 0)->base; }