mirror of
https://gitlab.freedesktop.org/cairo/cairo.git
synced 2026-05-05 07:38:22 +02:00
subsurface: Make CAIRO_SURFACE_TYPE_SUBSURFACE public
This commit is contained in:
parent
40459dacb5
commit
e79acf47a5
12 changed files with 25 additions and 21 deletions
|
|
@ -118,7 +118,7 @@ _analyze_recording_surface_pattern (cairo_analysis_surface_t *surface,
|
|||
surface->has_ctm = ! _cairo_matrix_is_identity (&surface->ctm);
|
||||
|
||||
source = surface_pattern->surface;
|
||||
if (source->backend->type == CAIRO_INTERNAL_SURFACE_TYPE_SUBSURFACE) {
|
||||
if (source->backend->type == CAIRO_SURFACE_TYPE_SUBSURFACE) {
|
||||
cairo_surface_subsurface_t *sub = (cairo_surface_subsurface_t *) source;
|
||||
source = sub->target;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1410,7 +1410,7 @@ _pixman_image_for_surface (const cairo_surface_pattern_t *pattern,
|
|||
source->stride);
|
||||
if (unlikely (pixman_image == NULL))
|
||||
return NULL;
|
||||
} else if (type == CAIRO_INTERNAL_SURFACE_TYPE_SUBSURFACE) {
|
||||
} else if (type == CAIRO_SURFACE_TYPE_SUBSURFACE) {
|
||||
cairo_surface_subsurface_t *sub;
|
||||
cairo_bool_t is_contained = FALSE;
|
||||
|
||||
|
|
|
|||
|
|
@ -1080,7 +1080,7 @@ _get_source_surface_size (cairo_surface_t *source,
|
|||
unsigned long mime_data_length;
|
||||
|
||||
if (source->type == CAIRO_SURFACE_TYPE_RECORDING) {
|
||||
if (source->backend->type == CAIRO_INTERNAL_SURFACE_TYPE_SUBSURFACE) {
|
||||
if (source->backend->type == CAIRO_SURFACE_TYPE_SUBSURFACE) {
|
||||
cairo_surface_subsurface_t *sub = (cairo_surface_subsurface_t *) source;
|
||||
|
||||
*width = sub->extents.width;
|
||||
|
|
@ -2343,7 +2343,7 @@ _cairo_pdf_surface_emit_surface (cairo_pdf_surface_t *surface,
|
|||
cairo_pdf_source_surface_t *src_surface)
|
||||
{
|
||||
if (src_surface->surface->type == CAIRO_SURFACE_TYPE_RECORDING) {
|
||||
if (src_surface->surface->backend->type == CAIRO_INTERNAL_SURFACE_TYPE_SUBSURFACE) {
|
||||
if (src_surface->surface->backend->type == CAIRO_SURFACE_TYPE_SUBSURFACE) {
|
||||
cairo_surface_subsurface_t *sub = (cairo_surface_subsurface_t *) src_surface->surface;
|
||||
return _cairo_pdf_surface_emit_recording_subsurface (surface,
|
||||
sub->target,
|
||||
|
|
|
|||
|
|
@ -2620,7 +2620,7 @@ _cairo_ps_surface_acquire_surface (cairo_ps_surface_t *surface,
|
|||
surface->image = NULL;
|
||||
|
||||
if (pattern->surface->type == CAIRO_SURFACE_TYPE_RECORDING) {
|
||||
if (pattern->surface->backend->type == CAIRO_INTERNAL_SURFACE_TYPE_SUBSURFACE) {
|
||||
if (pattern->surface->backend->type == CAIRO_SURFACE_TYPE_SUBSURFACE) {
|
||||
cairo_surface_subsurface_t *sub = (cairo_surface_subsurface_t *) pattern->surface;
|
||||
|
||||
*width = sub->extents.width;
|
||||
|
|
@ -2710,7 +2710,7 @@ _cairo_ps_surface_emit_surface (cairo_ps_surface_t *surface,
|
|||
if (pattern->surface->type == CAIRO_SURFACE_TYPE_RECORDING) {
|
||||
cairo_surface_t *source = pattern->surface;
|
||||
|
||||
if (source->backend->type == CAIRO_INTERNAL_SURFACE_TYPE_SUBSURFACE) {
|
||||
if (source->backend->type == CAIRO_SURFACE_TYPE_SUBSURFACE) {
|
||||
cairo_surface_subsurface_t *sub = (cairo_surface_subsurface_t *) source;
|
||||
status = _cairo_ps_surface_emit_recording_subsurface (surface, sub->target, &sub->extents);
|
||||
} else {
|
||||
|
|
|
|||
|
|
@ -1429,7 +1429,7 @@ _emit_surface_pattern (cairo_script_surface_t *surface,
|
|||
case CAIRO_SURFACE_TYPE_SCRIPT:
|
||||
status = _emit_script_surface_pattern (surface, (cairo_script_surface_t *) source);
|
||||
break;
|
||||
case CAIRO_INTERNAL_SURFACE_TYPE_SUBSURFACE:
|
||||
case CAIRO_SURFACE_TYPE_SUBSURFACE:
|
||||
status = _emit_subsurface_pattern (surface, (cairo_surface_subsurface_t *) source);
|
||||
break;
|
||||
default:
|
||||
|
|
|
|||
|
|
@ -428,7 +428,7 @@ _cairo_surface_subsurface_snapshot (void *abstract_surface)
|
|||
}
|
||||
|
||||
static const cairo_surface_backend_t _cairo_surface_subsurface_backend = {
|
||||
CAIRO_INTERNAL_SURFACE_TYPE_SUBSURFACE,
|
||||
CAIRO_SURFACE_TYPE_SUBSURFACE,
|
||||
_cairo_surface_subsurface_create_similar,
|
||||
_cairo_surface_subsurface_finish,
|
||||
|
||||
|
|
@ -520,7 +520,7 @@ cairo_surface_create_for_rectangle (cairo_surface_t *target,
|
|||
if (_cairo_surface_get_extents (target, &target_extents))
|
||||
ret = _cairo_rectangle_intersect (&surface->extents, &target_extents);
|
||||
|
||||
if (target->backend->type == CAIRO_INTERNAL_SURFACE_TYPE_SUBSURFACE) {
|
||||
if (target->backend->type == CAIRO_SURFACE_TYPE_SUBSURFACE) {
|
||||
/* Maintain subsurfaces as 1-depth */
|
||||
cairo_surface_subsurface_t *sub = (cairo_surface_subsurface_t *) target;
|
||||
surface->extents.x += sub->extents.x;
|
||||
|
|
|
|||
|
|
@ -223,8 +223,7 @@ typedef enum _cairo_int_status {
|
|||
} cairo_int_status_t;
|
||||
|
||||
typedef enum _cairo_internal_surface_type {
|
||||
CAIRO_INTERNAL_SURFACE_TYPE_SUBSURFACE = 0x1000,
|
||||
CAIRO_INTERNAL_SURFACE_TYPE_SNAPSHOT,
|
||||
CAIRO_INTERNAL_SURFACE_TYPE_SNAPSHOT = 0x1000,
|
||||
CAIRO_INTERNAL_SURFACE_TYPE_PAGINATED,
|
||||
CAIRO_INTERNAL_SURFACE_TYPE_ANALYSIS,
|
||||
CAIRO_INTERNAL_SURFACE_TYPE_TEST_FALLBACK,
|
||||
|
|
|
|||
|
|
@ -1186,7 +1186,7 @@ _cairo_xcb_surface_picture (cairo_xcb_surface_t *target,
|
|||
if (unlikely (picture->base.status))
|
||||
return picture;
|
||||
}
|
||||
} else if (source->backend->type == CAIRO_INTERNAL_SURFACE_TYPE_SUBSURFACE) {
|
||||
} else if (source->backend->type == CAIRO_SURFACE_TYPE_SUBSURFACE) {
|
||||
cairo_surface_subsurface_t *sub = (cairo_surface_subsurface_t *) source;
|
||||
cairo_xcb_surface_t *xcb = (cairo_xcb_surface_t *) sub->target;
|
||||
|
||||
|
|
@ -1233,7 +1233,7 @@ _cairo_xcb_surface_picture (cairo_xcb_surface_t *target,
|
|||
if (unlikely (picture->base.status))
|
||||
return picture;
|
||||
}
|
||||
} else if (source->backend->type == CAIRO_INTERNAL_SURFACE_TYPE_SUBSURFACE) {
|
||||
} else if (source->backend->type == CAIRO_SURFACE_TYPE_SUBSURFACE) {
|
||||
cairo_surface_subsurface_t *sub = (cairo_surface_subsurface_t *) source;
|
||||
cairo_xcb_surface_t *xcb = ((cairo_xlib_xcb_surface_t *) sub->target)->xcb;
|
||||
|
||||
|
|
|
|||
|
|
@ -2342,7 +2342,7 @@ _cairo_xlib_surface_upload(cairo_xlib_surface_t *surface,
|
|||
extents.x = extents.y = 0;
|
||||
extents.width = image->width;
|
||||
extents.height = image->height;
|
||||
} else if (image->base.backend->type == CAIRO_INTERNAL_SURFACE_TYPE_SUBSURFACE) {
|
||||
} else if (image->base.backend->type == CAIRO_SURFACE_TYPE_SUBSURFACE) {
|
||||
cairo_surface_subsurface_t *sub = (cairo_surface_subsurface_t *) image;
|
||||
image = (cairo_image_surface_t *) sub->target;
|
||||
src_x += sub->extents.x;
|
||||
|
|
|
|||
|
|
@ -1963,6 +1963,8 @@ cairo_device_reference (cairo_device_t *device);
|
|||
* @CAIRO_DEVICE_TYPE_DRM: The surface is of type Direct Render Manager
|
||||
* @CAIRO_DEVICE_TYPE_XML: The surface is of type XML
|
||||
* @CAIRO_DEVICE_TYPE_SKIA: The surface is of type Skia
|
||||
* @CAIRO_DEVICE_TYPE_SUBSURFACE: The surface is a subsurface created with
|
||||
* cairo_surface_create_for_rectangle()
|
||||
*
|
||||
* #cairo_device_type_t is used to describe the type of a given
|
||||
* device. The devices types are also known as "backends" within cairo.
|
||||
|
|
@ -2100,6 +2102,8 @@ cairo_surface_status (cairo_surface_t *surface);
|
|||
* @CAIRO_SURFACE_TYPE_TEE: The surface is of type 'tee' (a multiplexing surface), since 1.10
|
||||
* @CAIRO_SURFACE_TYPE_XML: The surface is of type XML (for debugging), since 1.10
|
||||
* @CAIRO_SURFACE_TYPE_SKIA: The surface is of type Skia, since 1.10
|
||||
* @CAIRO_SURFACE_TYPE_SUBSURFACE: The surface is a subsurface created with
|
||||
* cairo_surface_create_for_rectangle(), since 1.10
|
||||
*
|
||||
* #cairo_surface_type_t is used to describe the type of a given
|
||||
* surface. The surface types are also known as "backends" or "surface
|
||||
|
|
@ -2147,7 +2151,8 @@ typedef enum _cairo_surface_type {
|
|||
CAIRO_SURFACE_TYPE_DRM,
|
||||
CAIRO_SURFACE_TYPE_TEE,
|
||||
CAIRO_SURFACE_TYPE_XML,
|
||||
CAIRO_SURFACE_TYPE_SKIA
|
||||
CAIRO_SURFACE_TYPE_SKIA,
|
||||
CAIRO_SURFACE_TYPE_SUBSURFACE
|
||||
} cairo_surface_type_t;
|
||||
|
||||
cairo_public cairo_surface_type_t
|
||||
|
|
|
|||
|
|
@ -1537,7 +1537,7 @@ i915_shader_acquire_surface (i915_shader_t *shader,
|
|||
if (surface->type == CAIRO_SURFACE_TYPE_XCB) {
|
||||
cairo_surface_t *xcb = surface;
|
||||
|
||||
if (xcb->backend->type == CAIRO_INTERNAL_SURFACE_TYPE_SUBSURFACE) {
|
||||
if (xcb->backend->type == CAIRO_SURFACE_TYPE_SUBSURFACE) {
|
||||
xcb = ((cairo_surface_subsurface_t *) surface)->target;
|
||||
} else if (xcb->backend->type == CAIRO_INTERNAL_SURFACE_TYPE_SNAPSHOT) {
|
||||
xcb = ((cairo_surface_snapshot_t *) surface)->target;
|
||||
|
|
@ -1553,7 +1553,7 @@ i915_shader_acquire_surface (i915_shader_t *shader,
|
|||
#endif
|
||||
|
||||
if (surface->type == CAIRO_SURFACE_TYPE_DRM) {
|
||||
if (surface->backend->type == CAIRO_INTERNAL_SURFACE_TYPE_SUBSURFACE) {
|
||||
if (surface->backend->type == CAIRO_SURFACE_TYPE_SUBSURFACE) {
|
||||
drm = ((cairo_surface_subsurface_t *) surface)->target;
|
||||
} else if (surface->backend->type == CAIRO_INTERNAL_SURFACE_TYPE_SNAPSHOT) {
|
||||
drm = ((cairo_surface_snapshot_t *) surface)->target;
|
||||
|
|
@ -1563,7 +1563,7 @@ i915_shader_acquire_surface (i915_shader_t *shader,
|
|||
if (drm->type == CAIRO_SURFACE_TYPE_DRM) {
|
||||
i915_surface_t *s = (i915_surface_t *) drm;
|
||||
|
||||
if (surface->backend->type == CAIRO_INTERNAL_SURFACE_TYPE_SUBSURFACE) {
|
||||
if (surface->backend->type == CAIRO_SURFACE_TYPE_SUBSURFACE) {
|
||||
if (s->intel.drm.base.device == shader->target->intel.drm.base.device &&
|
||||
s != shader->target)
|
||||
{
|
||||
|
|
|
|||
|
|
@ -402,7 +402,7 @@ i965_shader_acquire_surface (i965_shader_t *shader,
|
|||
if (surface->type == CAIRO_SURFACE_TYPE_XCB) {
|
||||
cairo_surface_t *xcb = surface;
|
||||
|
||||
if (xcb->backend->type == CAIRO_INTERNAL_SURFACE_TYPE_SUBSURFACE) {
|
||||
if (xcb->backend->type == CAIRO_SURFACE_TYPE_SUBSURFACE) {
|
||||
xcb = ((cairo_surface_subsurface_t *) surface)->target;
|
||||
} else if (xcb->backend->type == CAIRO_INTERNAL_SURFACE_TYPE_SNAPSHOT) {
|
||||
xcb = ((cairo_surface_snapshot_t *) surface)->target;
|
||||
|
|
@ -418,7 +418,7 @@ i965_shader_acquire_surface (i965_shader_t *shader,
|
|||
#endif
|
||||
|
||||
if (surface->type == CAIRO_SURFACE_TYPE_DRM) {
|
||||
if (surface->backend->type == CAIRO_INTERNAL_SURFACE_TYPE_SUBSURFACE) {
|
||||
if (surface->backend->type == CAIRO_SURFACE_TYPE_SUBSURFACE) {
|
||||
drm = ((cairo_surface_subsurface_t *) surface)->target;
|
||||
} else if (surface->backend->type == CAIRO_INTERNAL_SURFACE_TYPE_SNAPSHOT) {
|
||||
drm = ((cairo_surface_snapshot_t *) surface)->target;
|
||||
|
|
@ -430,7 +430,7 @@ i965_shader_acquire_surface (i965_shader_t *shader,
|
|||
if (drm->type == CAIRO_SURFACE_TYPE_DRM) {
|
||||
i965_surface_t *s = (i965_surface_t *) drm;
|
||||
|
||||
if (surface->backend->type == CAIRO_INTERNAL_SURFACE_TYPE_SUBSURFACE) {
|
||||
if (surface->backend->type == CAIRO_SURFACE_TYPE_SUBSURFACE) {
|
||||
if (s->intel.drm.base.device == shader->target->intel.drm.base.device) {
|
||||
cairo_surface_subsurface_t *sub = (cairo_surface_subsurface_t *) surface;
|
||||
if (s != shader->target) {
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue