[meta] Rename cairo_meta_surface_t to cairo_recording_surface_t.
The new name is more descriptive than the rather opaque meta surface. Discussed with vigour on the mailing list and #cairo: http://lists.cairographics.org/archives/cairo/2009-July/017571.html
7
NEWS
|
|
@ -1,3 +1,10 @@
|
|||
API changes:
|
||||
|
||||
cairo_recording_surface_create()
|
||||
cairo_recording_surface_ink_extents()
|
||||
|
||||
Renamed meta-surfaces to recording-surfaces for clarity.
|
||||
|
||||
Snapshot 1.9.4 (2009-10-15)
|
||||
===========================
|
||||
API additions:
|
||||
|
|
|
|||
|
|
@ -314,13 +314,13 @@ enabled_cairo_boilerplate_headers += $(cairo_boilerplate_image_headers)
|
|||
enabled_cairo_boilerplate_private += $(cairo_boilerplate_image_private)
|
||||
enabled_cairo_boilerplate_sources += $(cairo_boilerplate_image_sources)
|
||||
|
||||
supported_cairo_boilerplate_headers += $(cairo_boilerplate_meta_headers)
|
||||
all_cairo_boilerplate_headers += $(cairo_boilerplate_meta_headers)
|
||||
all_cairo_boilerplate_private += $(cairo_boilerplate_meta_private)
|
||||
all_cairo_boilerplate_sources += $(cairo_boilerplate_meta_sources)
|
||||
enabled_cairo_boilerplate_headers += $(cairo_boilerplate_meta_headers)
|
||||
enabled_cairo_boilerplate_private += $(cairo_boilerplate_meta_private)
|
||||
enabled_cairo_boilerplate_sources += $(cairo_boilerplate_meta_sources)
|
||||
supported_cairo_boilerplate_headers += $(cairo_boilerplate_recording_headers)
|
||||
all_cairo_boilerplate_headers += $(cairo_boilerplate_recording_headers)
|
||||
all_cairo_boilerplate_private += $(cairo_boilerplate_recording_private)
|
||||
all_cairo_boilerplate_sources += $(cairo_boilerplate_recording_sources)
|
||||
enabled_cairo_boilerplate_headers += $(cairo_boilerplate_recording_headers)
|
||||
enabled_cairo_boilerplate_private += $(cairo_boilerplate_recording_private)
|
||||
enabled_cairo_boilerplate_sources += $(cairo_boilerplate_recording_sources)
|
||||
|
||||
supported_cairo_boilerplate_headers += $(cairo_boilerplate_tee_headers)
|
||||
all_cairo_boilerplate_headers += $(cairo_boilerplate_tee_headers)
|
||||
|
|
|
|||
|
|
@ -30,8 +30,8 @@
|
|||
#include <cairo-pdf-surface-private.h>
|
||||
#include <cairo-paginated-surface-private.h>
|
||||
|
||||
#if ! CAIRO_HAS_META_SURFACE
|
||||
#define CAIRO_SURFACE_TYPE_META CAIRO_INTERNAL_SURFACE_TYPE_META
|
||||
#if ! CAIRO_HAS_RECORDING_SURFACE
|
||||
#define CAIRO_SURFACE_TYPE_RECORDING CAIRO_INTERNAL_SURFACE_TYPE_RECORDING
|
||||
#endif
|
||||
|
||||
static const cairo_user_data_key_t pdf_closure_key;
|
||||
|
|
@ -241,7 +241,7 @@ static const cairo_boilerplate_target_t targets[] = {
|
|||
},
|
||||
{
|
||||
"pdf", "pdf", ".pdf", NULL,
|
||||
CAIRO_SURFACE_TYPE_META, CAIRO_CONTENT_COLOR, 0,
|
||||
CAIRO_SURFACE_TYPE_RECORDING, CAIRO_CONTENT_COLOR, 0,
|
||||
"cairo_pdf_surface_create",
|
||||
_cairo_boilerplate_pdf_create_surface,
|
||||
_cairo_boilerplate_pdf_force_fallbacks,
|
||||
|
|
|
|||
|
|
@ -31,8 +31,8 @@
|
|||
#include <cairo-ps-surface-private.h>
|
||||
#include <cairo-paginated-surface-private.h>
|
||||
|
||||
#if ! CAIRO_HAS_META_SURFACE
|
||||
#define CAIRO_SURFACE_TYPE_META CAIRO_INTERNAL_SURFACE_TYPE_META
|
||||
#if ! CAIRO_HAS_RECORDING_SURFACE
|
||||
#define CAIRO_SURFACE_TYPE_RECORDING CAIRO_INTERNAL_SURFACE_TYPE_RECORDING
|
||||
#endif
|
||||
|
||||
static const cairo_user_data_key_t ps_closure_key;
|
||||
|
|
@ -306,7 +306,7 @@ static const cairo_boilerplate_target_t targets[] = {
|
|||
},
|
||||
{
|
||||
"ps2", "ps", ".ps", NULL,
|
||||
CAIRO_SURFACE_TYPE_META, CAIRO_CONTENT_COLOR, 0,
|
||||
CAIRO_SURFACE_TYPE_RECORDING, CAIRO_CONTENT_COLOR, 0,
|
||||
"cairo_ps_surface_create",
|
||||
_cairo_boilerplate_ps2_create_surface,
|
||||
_cairo_boilerplate_ps_force_fallbacks,
|
||||
|
|
@ -331,7 +331,7 @@ static const cairo_boilerplate_target_t targets[] = {
|
|||
},
|
||||
{
|
||||
"ps3", "ps", ".ps", NULL,
|
||||
CAIRO_SURFACE_TYPE_META, CAIRO_CONTENT_COLOR, 0,
|
||||
CAIRO_SURFACE_TYPE_RECORDING, CAIRO_CONTENT_COLOR, 0,
|
||||
"cairo_ps_surface_create",
|
||||
_cairo_boilerplate_ps3_create_surface,
|
||||
_cairo_boilerplate_ps_force_fallbacks,
|
||||
|
|
|
|||
|
|
@ -35,8 +35,8 @@
|
|||
#include <signal.h>
|
||||
#endif
|
||||
|
||||
#if ! CAIRO_HAS_META_SURFACE
|
||||
#define CAIRO_SURFACE_TYPE_META CAIRO_INTERNAL_SURFACE_TYPE_META
|
||||
#if ! CAIRO_HAS_RECORDING_SURFACE
|
||||
#define CAIRO_SURFACE_TYPE_RECORDING CAIRO_INTERNAL_SURFACE_TYPE_RECORDING
|
||||
#endif
|
||||
|
||||
static const cairo_user_data_key_t svg_closure_key;
|
||||
|
|
@ -286,7 +286,7 @@ static const cairo_boilerplate_target_t targets[] = {
|
|||
},
|
||||
{
|
||||
"svg11", "svg", NULL, NULL,
|
||||
CAIRO_SURFACE_TYPE_META, CAIRO_CONTENT_COLOR, 1,
|
||||
CAIRO_SURFACE_TYPE_RECORDING, CAIRO_CONTENT_COLOR, 1,
|
||||
"cairo_svg_surface_create",
|
||||
_cairo_boilerplate_svg11_create_surface,
|
||||
_cairo_boilerplate_svg_force_fallbacks,
|
||||
|
|
@ -310,7 +310,7 @@ static const cairo_boilerplate_target_t targets[] = {
|
|||
},
|
||||
{
|
||||
"svg12", "svg", NULL, NULL,
|
||||
CAIRO_SURFACE_TYPE_META, CAIRO_CONTENT_COLOR, 1,
|
||||
CAIRO_SURFACE_TYPE_RECORDING, CAIRO_CONTENT_COLOR, 1,
|
||||
"cairo_svg_surface_create",
|
||||
_cairo_boilerplate_svg12_create_surface,
|
||||
_cairo_boilerplate_svg_force_fallbacks,
|
||||
|
|
|
|||
|
|
@ -146,7 +146,7 @@ _cairo_boilerplate_test_paginated_create_surface (const char *name,
|
|||
*
|
||||
* If we didn't implement this function then the default
|
||||
* cairo_surface_write_to_png would result in the paginated_surface's
|
||||
* acquire_source_image function replaying the meta-surface to an
|
||||
* acquire_source_image function replaying the recording-surface to an
|
||||
* intermediate image surface. And in that case the
|
||||
* test_paginated_surface would not be involved and wouldn't be
|
||||
* tested.
|
||||
|
|
|
|||
|
|
@ -357,7 +357,7 @@ static const cairo_boilerplate_target_t targets[] = {
|
|||
},
|
||||
{
|
||||
"win32-printing", "win32", ".ps", NULL,
|
||||
CAIRO_SURFACE_TYPE_META, CAIRO_CONTENT_COLOR, 0,
|
||||
CAIRO_SURFACE_TYPE_RECORDING, CAIRO_CONTENT_COLOR, 0,
|
||||
"cairo_win32_printing_surface_create",
|
||||
_cairo_boilerplate_win32_printing_create_surface,
|
||||
NULL, NULL,
|
||||
|
|
|
|||
|
|
@ -149,17 +149,17 @@ _cairo_boilerplate_image_create_surface (const char *name,
|
|||
return cairo_image_surface_create (format, ceil (width), ceil (height));
|
||||
}
|
||||
|
||||
#if CAIRO_HAS_META_SURFACE
|
||||
#if CAIRO_HAS_RECORDING_SURFACE
|
||||
static cairo_surface_t *
|
||||
_cairo_boilerplate_meta_create_surface (const char *name,
|
||||
cairo_content_t content,
|
||||
double width,
|
||||
double height,
|
||||
double max_width,
|
||||
double max_height,
|
||||
cairo_boilerplate_mode_t mode,
|
||||
int id,
|
||||
void **closure)
|
||||
_cairo_boilerplate_recording_create_surface (const char *name,
|
||||
cairo_content_t content,
|
||||
double width,
|
||||
double height,
|
||||
double max_width,
|
||||
double max_height,
|
||||
cairo_boilerplate_mode_t mode,
|
||||
int id,
|
||||
void **closure)
|
||||
{
|
||||
cairo_rectangle_t extents;
|
||||
|
||||
|
|
@ -169,7 +169,7 @@ _cairo_boilerplate_meta_create_surface (const char *name,
|
|||
extents.y = 0;
|
||||
extents.width = width;
|
||||
extents.height = height;
|
||||
return cairo_meta_surface_create (content, &extents);
|
||||
return cairo_recording_surface_create (content, &extents);
|
||||
}
|
||||
#endif
|
||||
|
||||
|
|
@ -195,9 +195,9 @@ _cairo_boilerplate_get_image_surface (cairo_surface_t *src,
|
|||
surface = cairo_image_surface_create (CAIRO_FORMAT_ARGB32, width, height);
|
||||
image = cairo_surface_reference (surface);
|
||||
|
||||
/* open a logging channel (only interesting for meta surfaces) */
|
||||
#if CAIRO_HAS_SCRIPT_SURFACE && CAIRO_HAS_META_SURFACE
|
||||
if (cairo_surface_get_type (src) == CAIRO_SURFACE_TYPE_META) {
|
||||
/* open a logging channel (only interesting for recording surfaces) */
|
||||
#if CAIRO_HAS_SCRIPT_SURFACE && CAIRO_HAS_RECORDING_SURFACE
|
||||
if (cairo_surface_get_type (src) == CAIRO_SURFACE_TYPE_RECORDING) {
|
||||
const char *test_name;
|
||||
|
||||
test_name = cairo_surface_get_user_data (src,
|
||||
|
|
@ -311,12 +311,12 @@ static const cairo_boilerplate_target_t builtin_targets[] = {
|
|||
_cairo_boilerplate_get_image_surface,
|
||||
cairo_surface_write_to_png
|
||||
},
|
||||
#if CAIRO_HAS_META_SURFACE
|
||||
#if CAIRO_HAS_RECORDING_SURFACE
|
||||
{
|
||||
"meta", "image", NULL, NULL,
|
||||
CAIRO_SURFACE_TYPE_META, CAIRO_CONTENT_COLOR_ALPHA, 0,
|
||||
"cairo_meta_surface_create",
|
||||
_cairo_boilerplate_meta_create_surface,
|
||||
"recording", "image", NULL, NULL,
|
||||
CAIRO_SURFACE_TYPE_RECORDING, CAIRO_CONTENT_COLOR_ALPHA, 0,
|
||||
"cairo_recording_surface_create",
|
||||
_cairo_boilerplate_recording_create_surface,
|
||||
NULL, NULL,
|
||||
_cairo_boilerplate_get_image_surface,
|
||||
cairo_surface_write_to_png,
|
||||
|
|
@ -324,10 +324,10 @@ static const cairo_boilerplate_target_t builtin_targets[] = {
|
|||
FALSE, TRUE
|
||||
},
|
||||
{
|
||||
"meta", "image", NULL, NULL,
|
||||
CAIRO_SURFACE_TYPE_META, CAIRO_CONTENT_COLOR, 0,
|
||||
"cairo_meta_surface_create",
|
||||
_cairo_boilerplate_meta_create_surface,
|
||||
"recording", "image", NULL, NULL,
|
||||
CAIRO_SURFACE_TYPE_RECORDING, CAIRO_CONTENT_COLOR, 0,
|
||||
"cairo_recording_surface_create",
|
||||
_cairo_boilerplate_recording_create_surface,
|
||||
NULL, NULL,
|
||||
_cairo_boilerplate_get_image_surface,
|
||||
cairo_surface_write_to_png,
|
||||
|
|
|
|||
|
|
@ -166,7 +166,7 @@ typedef struct _cairo_boilerplate_target {
|
|||
cairo_boilerplate_cleanup_t cleanup;
|
||||
cairo_boilerplate_wait_t synchronize;
|
||||
cairo_bool_t is_vector;
|
||||
cairo_bool_t is_meta;
|
||||
cairo_bool_t is_recording;
|
||||
} cairo_boilerplate_target_t;
|
||||
|
||||
const cairo_boilerplate_target_t *
|
||||
|
|
|
|||
|
|
@ -93,7 +93,7 @@ ifeq ($(CAIRO_HAS_TEST_SURFACES),1)
|
|||
@echo "#define CAIRO_HAS_TEST_SURFACES 1" >> src/cairo-features.h
|
||||
endif
|
||||
@echo "#define CAIRO_HAS_IMAGE_SURFACE 1" >> src/cairo-features.h
|
||||
@echo "#define CAIRO_HAS_META_SURFACE 1" >> src/cairo-features.h
|
||||
@echo "#define CAIRO_HAS_RECORDING_SURFACE 1" >> src/cairo-features.h
|
||||
@echo "#define CAIRO_HAS_TEE_SURFACE 1" >> src/cairo-features.h
|
||||
ifeq ($(CAIRO_HAS_XML_SURFACE),1)
|
||||
@echo "#define CAIRO_HAS_XML_SURFACE 1" >> src/cairo-features.h
|
||||
|
|
|
|||
|
|
@ -617,7 +617,7 @@ CAIRO_ENABLE_SURFACE_BACKEND(image, image, always, [
|
|||
|
||||
dnl ===========================================================================
|
||||
|
||||
CAIRO_ENABLE_SURFACE_BACKEND(meta, meta, always)
|
||||
CAIRO_ENABLE_SURFACE_BACKEND(recording, recording, always)
|
||||
CAIRO_ENABLE_SURFACE_BACKEND(tee, tee, always)
|
||||
CAIRO_ENABLE_SURFACE_BACKEND(xml, xml, yes, [
|
||||
use_xml=$have_libz
|
||||
|
|
|
|||
|
|
@ -216,7 +216,7 @@ The Portable Network Graphics image file format (ISO/IEC 15948). Since 1.10
|
|||
@CAIRO_SURFACE_TYPE_QUARTZ_IMAGE:
|
||||
@CAIRO_SURFACE_TYPE_SCRIPT:
|
||||
@CAIRO_SURFACE_TYPE_QT:
|
||||
@CAIRO_SURFACE_TYPE_META:
|
||||
@CAIRO_SURFACE_TYPE_RECORDING:
|
||||
|
||||
<!-- ##### FUNCTION cairo_surface_get_type ##### -->
|
||||
<para>
|
||||
|
|
|
|||
|
|
@ -63,10 +63,10 @@ typedef struct _cairo_perf_case {
|
|||
const cairo_perf_case_t perf_cases[];
|
||||
|
||||
/* Some targets just aren't that interesting for performance testing,
|
||||
* (not least because many of these surface types use a meta-surface
|
||||
* (not least because many of these surface types use a recording-surface
|
||||
* and as such defer the "real" rendering to later, so our timing
|
||||
* loops wouldn't count the real work, just the recording by the
|
||||
* meta-surface. */
|
||||
* recording-surface. */
|
||||
static cairo_bool_t
|
||||
target_is_measurable (const cairo_boilerplate_target_t *target)
|
||||
{
|
||||
|
|
|
|||
|
|
@ -61,10 +61,10 @@
|
|||
#define CAIRO_PERF_STABLE_STD_DEV_COUNT 3
|
||||
|
||||
/* Some targets just aren't that interesting for performance testing,
|
||||
* (not least because many of these surface types use a meta-surface
|
||||
* (not least because many of these surface types use a recording-surface
|
||||
* and as such defer the "real" rendering to later, so our timing
|
||||
* loops wouldn't count the real work, just the recording by the
|
||||
* meta-surface. */
|
||||
* recording-surface. */
|
||||
static cairo_bool_t
|
||||
target_is_measurable (const cairo_boilerplate_target_t *target)
|
||||
{
|
||||
|
|
|
|||
|
|
@ -67,7 +67,7 @@ cairo_private = \
|
|||
cairo-image-info-private.h \
|
||||
cairo-list-private.h \
|
||||
cairo-malloc-private.h \
|
||||
cairo-meta-surface-private.h \
|
||||
cairo-recording-surface-private.h \
|
||||
cairo-mutex-impl-private.h \
|
||||
cairo-mutex-list-private.h \
|
||||
cairo-mutex-private.h \
|
||||
|
|
@ -122,7 +122,7 @@ cairo_sources = \
|
|||
cairo-image-surface.c \
|
||||
cairo-lzw.c \
|
||||
cairo-matrix.c \
|
||||
cairo-meta-surface.c \
|
||||
cairo-recording-surface.c \
|
||||
cairo-misc.c \
|
||||
cairo-mutex.c \
|
||||
cairo-output-stream.c \
|
||||
|
|
|
|||
|
|
@ -428,13 +428,13 @@ enabled_cairo_headers += $(cairo_image_headers)
|
|||
enabled_cairo_private += $(cairo_image_private)
|
||||
enabled_cairo_sources += $(cairo_image_sources)
|
||||
|
||||
supported_cairo_headers += $(cairo_meta_headers)
|
||||
all_cairo_headers += $(cairo_meta_headers)
|
||||
all_cairo_private += $(cairo_meta_private)
|
||||
all_cairo_sources += $(cairo_meta_sources)
|
||||
enabled_cairo_headers += $(cairo_meta_headers)
|
||||
enabled_cairo_private += $(cairo_meta_private)
|
||||
enabled_cairo_sources += $(cairo_meta_sources)
|
||||
supported_cairo_headers += $(cairo_recording_headers)
|
||||
all_cairo_headers += $(cairo_recording_headers)
|
||||
all_cairo_private += $(cairo_recording_private)
|
||||
all_cairo_sources += $(cairo_recording_sources)
|
||||
enabled_cairo_headers += $(cairo_recording_headers)
|
||||
enabled_cairo_private += $(cairo_recording_private)
|
||||
enabled_cairo_sources += $(cairo_recording_sources)
|
||||
|
||||
supported_cairo_headers += $(cairo_tee_headers)
|
||||
all_cairo_headers += $(cairo_tee_headers)
|
||||
|
|
|
|||
|
|
@ -38,7 +38,7 @@
|
|||
|
||||
#include "cairo-analysis-surface-private.h"
|
||||
#include "cairo-paginated-private.h"
|
||||
#include "cairo-meta-surface-private.h"
|
||||
#include "cairo-recording-surface-private.h"
|
||||
#include "cairo-region-private.h"
|
||||
|
||||
typedef struct {
|
||||
|
|
@ -76,9 +76,9 @@ _cairo_analysis_surface_merge_status (cairo_int_status_t status_a,
|
|||
status_b == CAIRO_INT_STATUS_IMAGE_FALLBACK)
|
||||
return CAIRO_INT_STATUS_IMAGE_FALLBACK;
|
||||
|
||||
if (status_a == CAIRO_INT_STATUS_ANALYZE_META_SURFACE_PATTERN ||
|
||||
status_b == CAIRO_INT_STATUS_ANALYZE_META_SURFACE_PATTERN)
|
||||
return CAIRO_INT_STATUS_ANALYZE_META_SURFACE_PATTERN;
|
||||
if (status_a == CAIRO_INT_STATUS_ANALYZE_RECORDING_SURFACE_PATTERN ||
|
||||
status_b == CAIRO_INT_STATUS_ANALYZE_RECORDING_SURFACE_PATTERN)
|
||||
return CAIRO_INT_STATUS_ANALYZE_RECORDING_SURFACE_PATTERN;
|
||||
|
||||
if (status_a == CAIRO_INT_STATUS_FLATTEN_TRANSPARENCY ||
|
||||
status_b == CAIRO_INT_STATUS_FLATTEN_TRANSPARENCY)
|
||||
|
|
@ -92,8 +92,8 @@ _cairo_analysis_surface_merge_status (cairo_int_status_t status_a,
|
|||
}
|
||||
|
||||
static cairo_int_status_t
|
||||
_analyze_meta_surface_pattern (cairo_analysis_surface_t *surface,
|
||||
const cairo_pattern_t *pattern)
|
||||
_analyze_recording_surface_pattern (cairo_analysis_surface_t *surface,
|
||||
const cairo_pattern_t *pattern)
|
||||
{
|
||||
const cairo_surface_pattern_t *surface_pattern;
|
||||
cairo_bool_t old_has_ctm;
|
||||
|
|
@ -102,7 +102,7 @@ _analyze_meta_surface_pattern (cairo_analysis_surface_t *surface,
|
|||
|
||||
assert (pattern->type == CAIRO_PATTERN_TYPE_SURFACE);
|
||||
surface_pattern = (const cairo_surface_pattern_t *) pattern;
|
||||
assert (_cairo_surface_is_meta (surface_pattern->surface));
|
||||
assert (_cairo_surface_is_recording (surface_pattern->surface));
|
||||
|
||||
old_ctm = surface->ctm;
|
||||
old_has_ctm = surface->has_ctm;
|
||||
|
|
@ -114,7 +114,7 @@ _analyze_meta_surface_pattern (cairo_analysis_surface_t *surface,
|
|||
cairo_matrix_multiply (&surface->ctm, &p2d, &surface->ctm);
|
||||
surface->has_ctm = ! _cairo_matrix_is_identity (&surface->ctm);
|
||||
|
||||
status = _cairo_meta_surface_replay_and_create_regions (surface_pattern->surface,
|
||||
status = _cairo_recording_surface_replay_and_create_regions (surface_pattern->surface,
|
||||
&surface->base);
|
||||
|
||||
surface->ctm = old_ctm;
|
||||
|
|
@ -227,7 +227,7 @@ _add_operation (cairo_analysis_surface_t *surface,
|
|||
status = cairo_region_union_rectangle (&surface->fallback_region, rect);
|
||||
|
||||
/* The status CAIRO_INT_STATUS_IMAGE_FALLBACK is used to indicate
|
||||
* unsupported operations to the meta surface as using
|
||||
* unsupported operations to the recording surface as using
|
||||
* CAIRO_INT_STATUS_UNSUPPORTED would cause cairo-surface to
|
||||
* invoke the cairo-surface-fallback path then return
|
||||
* CAIRO_STATUS_SUCCESS.
|
||||
|
|
@ -315,8 +315,8 @@ _cairo_analysis_surface_paint (void *abstract_surface,
|
|||
return backend_status;
|
||||
}
|
||||
|
||||
if (backend_status == CAIRO_INT_STATUS_ANALYZE_META_SURFACE_PATTERN)
|
||||
backend_status = _analyze_meta_surface_pattern (surface, source);
|
||||
if (backend_status == CAIRO_INT_STATUS_ANALYZE_RECORDING_SURFACE_PATTERN)
|
||||
backend_status = _analyze_recording_surface_pattern (surface, source);
|
||||
|
||||
_cairo_analysis_surface_operation_extents (surface,
|
||||
op, source, clip,
|
||||
|
|
@ -347,15 +347,15 @@ _cairo_analysis_surface_mask (void *abstract_surface,
|
|||
return backend_status;
|
||||
}
|
||||
|
||||
if (backend_status == CAIRO_INT_STATUS_ANALYZE_META_SURFACE_PATTERN) {
|
||||
if (backend_status == CAIRO_INT_STATUS_ANALYZE_RECORDING_SURFACE_PATTERN) {
|
||||
cairo_int_status_t backend_source_status = CAIRO_STATUS_SUCCESS;
|
||||
cairo_int_status_t backend_mask_status = CAIRO_STATUS_SUCCESS;
|
||||
|
||||
if (source->type == CAIRO_PATTERN_TYPE_SURFACE) {
|
||||
const cairo_surface_pattern_t *surface_pattern = (const cairo_surface_pattern_t *) source;
|
||||
if (_cairo_surface_is_meta (surface_pattern->surface)) {
|
||||
if (_cairo_surface_is_recording (surface_pattern->surface)) {
|
||||
backend_source_status =
|
||||
_analyze_meta_surface_pattern (surface, source);
|
||||
_analyze_recording_surface_pattern (surface, source);
|
||||
if (_cairo_status_is_error (backend_source_status))
|
||||
return backend_source_status;
|
||||
}
|
||||
|
|
@ -363,9 +363,9 @@ _cairo_analysis_surface_mask (void *abstract_surface,
|
|||
|
||||
if (mask->type == CAIRO_PATTERN_TYPE_SURFACE) {
|
||||
cairo_surface_pattern_t *surface_pattern = (cairo_surface_pattern_t *) mask;
|
||||
if (_cairo_surface_is_meta (surface_pattern->surface)) {
|
||||
if (_cairo_surface_is_recording (surface_pattern->surface)) {
|
||||
backend_mask_status =
|
||||
_analyze_meta_surface_pattern (surface, mask);
|
||||
_analyze_recording_surface_pattern (surface, mask);
|
||||
if (_cairo_status_is_error (backend_mask_status))
|
||||
return backend_mask_status;
|
||||
}
|
||||
|
|
@ -421,8 +421,8 @@ _cairo_analysis_surface_stroke (void *abstract_surface,
|
|||
return backend_status;
|
||||
}
|
||||
|
||||
if (backend_status == CAIRO_INT_STATUS_ANALYZE_META_SURFACE_PATTERN)
|
||||
backend_status = _analyze_meta_surface_pattern (surface, source);
|
||||
if (backend_status == CAIRO_INT_STATUS_ANALYZE_RECORDING_SURFACE_PATTERN)
|
||||
backend_status = _analyze_recording_surface_pattern (surface, source);
|
||||
|
||||
_cairo_analysis_surface_operation_extents (surface,
|
||||
op, source, clip,
|
||||
|
|
@ -485,8 +485,8 @@ _cairo_analysis_surface_fill (void *abstract_surface,
|
|||
return backend_status;
|
||||
}
|
||||
|
||||
if (backend_status == CAIRO_INT_STATUS_ANALYZE_META_SURFACE_PATTERN)
|
||||
backend_status = _analyze_meta_surface_pattern (surface, source);
|
||||
if (backend_status == CAIRO_INT_STATUS_ANALYZE_RECORDING_SURFACE_PATTERN)
|
||||
backend_status = _analyze_recording_surface_pattern (surface, source);
|
||||
|
||||
_cairo_analysis_surface_operation_extents (surface,
|
||||
op, source, clip,
|
||||
|
|
@ -557,8 +557,8 @@ _cairo_analysis_surface_show_glyphs (void *abstract_surface,
|
|||
backend_status = CAIRO_INT_STATUS_UNSUPPORTED;
|
||||
}
|
||||
|
||||
if (backend_status == CAIRO_INT_STATUS_ANALYZE_META_SURFACE_PATTERN)
|
||||
backend_status = _analyze_meta_surface_pattern (surface, source);
|
||||
if (backend_status == CAIRO_INT_STATUS_ANALYZE_RECORDING_SURFACE_PATTERN)
|
||||
backend_status = _analyze_recording_surface_pattern (surface, source);
|
||||
|
||||
_cairo_analysis_surface_operation_extents (surface,
|
||||
op, source, clip,
|
||||
|
|
@ -641,8 +641,8 @@ _cairo_analysis_surface_show_text_glyphs (void *abstract_surface,
|
|||
backend_status = CAIRO_STATUS_SUCCESS;
|
||||
}
|
||||
|
||||
if (backend_status == CAIRO_INT_STATUS_ANALYZE_META_SURFACE_PATTERN)
|
||||
backend_status = _analyze_meta_surface_pattern (surface, source);
|
||||
if (backend_status == CAIRO_INT_STATUS_ANALYZE_RECORDING_SURFACE_PATTERN)
|
||||
backend_status = _analyze_recording_surface_pattern (surface, source);
|
||||
|
||||
_cairo_analysis_surface_operation_extents (surface,
|
||||
op, source, clip,
|
||||
|
|
|
|||
|
|
@ -98,7 +98,7 @@ struct _cairo_paginated_surface_backend {
|
|||
* to follow.
|
||||
*
|
||||
* What the paginated surface does is first save all drawing
|
||||
* operations for a page into a meta-surface. Then when the user calls
|
||||
* operations for a page into a recording-surface. Then when the user calls
|
||||
* cairo_show_page(), the paginated surface performs the following
|
||||
* sequence of operations (using the backend functions passed to
|
||||
* cairo_paginated_surface_create()):
|
||||
|
|
@ -109,7 +109,7 @@ struct _cairo_paginated_surface_backend {
|
|||
*
|
||||
* 2. Calls set_paginated_mode() with an argument of %CAIRO_PAGINATED_MODE_ANALYZE
|
||||
*
|
||||
* 3. Replays the meta-surface to the target surface, (with an
|
||||
* 3. Replays the recording-surface to the target surface, (with an
|
||||
* analysis surface inserted between which watches the return value
|
||||
* from each operation). This analysis stage is used to decide which
|
||||
* operations will require fallbacks.
|
||||
|
|
@ -119,7 +119,7 @@ struct _cairo_paginated_surface_backend {
|
|||
*
|
||||
* 5. Calls set_paginated_mode() with an argument of %CAIRO_PAGINATED_MODE_RENDER
|
||||
*
|
||||
* 6. Replays a subset of the meta-surface operations to the target surface
|
||||
* 6. Replays a subset of the recording-surface operations to the target surface
|
||||
*
|
||||
* 7. Calls set_paginated_mode() with an argument of %CAIRO_PAGINATED_MODE_FALLBACK
|
||||
*
|
||||
|
|
|
|||
|
|
@ -51,10 +51,10 @@ typedef struct _cairo_paginated_surface {
|
|||
/* Paginated-surface specific functions for the target */
|
||||
const cairo_paginated_surface_backend_t *backend;
|
||||
|
||||
/* A cairo_meta_surface to record all operations. To be replayed
|
||||
/* A cairo_recording_surface to record all operations. To be replayed
|
||||
* against target, and also against image surface as necessary for
|
||||
* fallbacks. */
|
||||
cairo_surface_t *meta;
|
||||
cairo_surface_t *recording_surface;
|
||||
|
||||
int page_num;
|
||||
cairo_bool_t page_is_blank;
|
||||
|
|
|
|||
|
|
@ -46,7 +46,7 @@
|
|||
|
||||
#include "cairo-paginated-private.h"
|
||||
#include "cairo-paginated-surface-private.h"
|
||||
#include "cairo-meta-surface-private.h"
|
||||
#include "cairo-recording-surface-private.h"
|
||||
#include "cairo-analysis-surface-private.h"
|
||||
|
||||
static const cairo_surface_backend_t cairo_paginated_surface_backend;
|
||||
|
|
@ -64,26 +64,26 @@ _cairo_paginated_surface_create_similar (void *abstract_surface,
|
|||
rect.x = rect.y = 0.;
|
||||
rect.width = width;
|
||||
rect.height = height;
|
||||
return cairo_meta_surface_create (content, &rect);
|
||||
return cairo_recording_surface_create (content, &rect);
|
||||
}
|
||||
|
||||
static cairo_surface_t *
|
||||
_create_meta_surface_for_target (cairo_surface_t *target,
|
||||
cairo_content_t content)
|
||||
_create_recording_surface_for_target (cairo_surface_t *target,
|
||||
cairo_content_t content)
|
||||
{
|
||||
cairo_rectangle_int_t rect;
|
||||
|
||||
if (_cairo_surface_get_extents (target, &rect)) {
|
||||
cairo_rectangle_t meta_extents;
|
||||
cairo_rectangle_t recording_extents;
|
||||
|
||||
meta_extents.x = rect.x;
|
||||
meta_extents.y = rect.y;
|
||||
meta_extents.width = rect.width;
|
||||
meta_extents.height = rect.height;
|
||||
recording_extents.x = rect.x;
|
||||
recording_extents.y = rect.y;
|
||||
recording_extents.width = rect.width;
|
||||
recording_extents.height = rect.height;
|
||||
|
||||
return cairo_meta_surface_create (content, &meta_extents);
|
||||
return cairo_recording_surface_create (content, &recording_extents);
|
||||
} else {
|
||||
return cairo_meta_surface_create (content, NULL);
|
||||
return cairo_recording_surface_create (content, NULL);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -113,8 +113,8 @@ _cairo_paginated_surface_create (cairo_surface_t *target,
|
|||
surface->content = content;
|
||||
surface->backend = backend;
|
||||
|
||||
surface->meta = _create_meta_surface_for_target (target, content);
|
||||
status = surface->meta->status;
|
||||
surface->recording_surface = _create_recording_surface_for_target (target, content);
|
||||
status = surface->recording_surface->status;
|
||||
if (unlikely (status))
|
||||
goto FAIL_CLEANUP_SURFACE;
|
||||
|
||||
|
|
@ -171,10 +171,10 @@ _cairo_paginated_surface_finish (void *abstract_surface)
|
|||
}
|
||||
cairo_surface_destroy (surface->target);
|
||||
|
||||
cairo_surface_finish (surface->meta);
|
||||
cairo_surface_finish (surface->recording_surface);
|
||||
if (status == CAIRO_STATUS_SUCCESS)
|
||||
status = cairo_surface_status (surface->meta);
|
||||
cairo_surface_destroy (surface->meta);
|
||||
status = cairo_surface_status (surface->recording_surface);
|
||||
cairo_surface_destroy (surface->recording_surface);
|
||||
|
||||
return status;
|
||||
}
|
||||
|
|
@ -217,7 +217,7 @@ _cairo_paginated_surface_acquire_source_image (void *abstract_surface,
|
|||
extents.width,
|
||||
extents.height);
|
||||
|
||||
status = _cairo_meta_surface_replay (surface->meta, image);
|
||||
status = _cairo_recording_surface_replay (surface->recording_surface, image);
|
||||
if (unlikely (status)) {
|
||||
cairo_surface_destroy (image);
|
||||
return status;
|
||||
|
|
@ -261,7 +261,7 @@ _paint_fallback_image (cairo_paginated_surface_t *surface,
|
|||
* so we have to do the scaling manually. */
|
||||
cairo_surface_set_device_offset (image, -x*x_scale, -y*y_scale);
|
||||
|
||||
status = _cairo_meta_surface_replay (surface->meta, image);
|
||||
status = _cairo_recording_surface_replay (surface->recording_surface, image);
|
||||
if (unlikely (status))
|
||||
goto CLEANUP_IMAGE;
|
||||
|
||||
|
|
@ -305,8 +305,8 @@ _paint_page (cairo_paginated_surface_t *surface)
|
|||
|
||||
surface->backend->set_paginated_mode (surface->target,
|
||||
CAIRO_PAGINATED_MODE_ANALYZE);
|
||||
status = _cairo_meta_surface_replay_and_create_regions (surface->meta,
|
||||
analysis);
|
||||
status = _cairo_recording_surface_replay_and_create_regions (surface->recording_surface,
|
||||
analysis);
|
||||
if (status || analysis->status) {
|
||||
if (status == CAIRO_STATUS_SUCCESS)
|
||||
status = analysis->status;
|
||||
|
|
@ -356,9 +356,9 @@ _paint_page (cairo_paginated_surface_t *surface)
|
|||
surface->backend->set_paginated_mode (surface->target,
|
||||
CAIRO_PAGINATED_MODE_RENDER);
|
||||
|
||||
status = _cairo_meta_surface_replay_region (surface->meta,
|
||||
surface->target,
|
||||
CAIRO_META_REGION_NATIVE);
|
||||
status = _cairo_recording_surface_replay_region (surface->recording_surface,
|
||||
surface->target,
|
||||
CAIRO_RECORDING_REGION_NATIVE);
|
||||
assert (status != CAIRO_INT_STATUS_UNSUPPORTED);
|
||||
if (unlikely (status))
|
||||
goto FAIL;
|
||||
|
|
@ -442,7 +442,7 @@ _cairo_paginated_surface_copy_page (void *abstract_surface)
|
|||
* optimization for the output, but the interaction with image
|
||||
* fallbacks gets tricky. For now, we just let the target see a
|
||||
* show_page and we implement the copying by simply not destroying
|
||||
* the meta-surface. */
|
||||
* the recording-surface. */
|
||||
|
||||
cairo_surface_show_page (surface->target);
|
||||
return cairo_surface_status (surface->target);
|
||||
|
|
@ -467,15 +467,15 @@ _cairo_paginated_surface_show_page (void *abstract_surface)
|
|||
if (unlikely (status))
|
||||
return status;
|
||||
|
||||
status = surface->meta->status;
|
||||
status = surface->recording_surface->status;
|
||||
if (unlikely (status))
|
||||
return status;
|
||||
|
||||
cairo_surface_destroy (surface->meta);
|
||||
cairo_surface_destroy (surface->recording_surface);
|
||||
|
||||
surface->meta = _create_meta_surface_for_target (surface->target,
|
||||
surface->content);
|
||||
status = surface->meta->status;
|
||||
surface->recording_surface = _create_recording_surface_for_target (surface->target,
|
||||
surface->content);
|
||||
status = surface->recording_surface->status;
|
||||
if (unlikely (status))
|
||||
return status;
|
||||
|
||||
|
|
@ -517,7 +517,7 @@ _cairo_paginated_surface_paint (void *abstract_surface,
|
|||
|
||||
surface->page_is_blank = FALSE;
|
||||
|
||||
return _cairo_surface_paint (surface->meta, op, source, clip);
|
||||
return _cairo_surface_paint (surface->recording_surface, op, source, clip);
|
||||
}
|
||||
|
||||
static cairo_int_status_t
|
||||
|
|
@ -535,7 +535,7 @@ _cairo_paginated_surface_mask (void *abstract_surface,
|
|||
|
||||
surface->page_is_blank = FALSE;
|
||||
|
||||
return _cairo_surface_mask (surface->meta, op, source, mask, clip);
|
||||
return _cairo_surface_mask (surface->recording_surface, op, source, mask, clip);
|
||||
}
|
||||
|
||||
static cairo_int_status_t
|
||||
|
|
@ -558,7 +558,7 @@ _cairo_paginated_surface_stroke (void *abstract_surface,
|
|||
|
||||
surface->page_is_blank = FALSE;
|
||||
|
||||
return _cairo_surface_stroke (surface->meta, op, source,
|
||||
return _cairo_surface_stroke (surface->recording_surface, op, source,
|
||||
path, style,
|
||||
ctm, ctm_inverse,
|
||||
tolerance, antialias,
|
||||
|
|
@ -583,7 +583,7 @@ _cairo_paginated_surface_fill (void *abstract_surface,
|
|||
|
||||
surface->page_is_blank = FALSE;
|
||||
|
||||
return _cairo_surface_fill (surface->meta, op, source,
|
||||
return _cairo_surface_fill (surface->recording_surface, op, source,
|
||||
path, fill_rule,
|
||||
tolerance, antialias,
|
||||
clip);
|
||||
|
|
@ -598,18 +598,18 @@ _cairo_paginated_surface_has_show_text_glyphs (void *abstract_surface)
|
|||
}
|
||||
|
||||
static cairo_int_status_t
|
||||
_cairo_paginated_surface_show_text_glyphs (void *abstract_surface,
|
||||
cairo_operator_t op,
|
||||
const cairo_pattern_t *source,
|
||||
const char *utf8,
|
||||
int utf8_len,
|
||||
cairo_glyph_t *glyphs,
|
||||
int num_glyphs,
|
||||
_cairo_paginated_surface_show_text_glyphs (void *abstract_surface,
|
||||
cairo_operator_t op,
|
||||
const cairo_pattern_t *source,
|
||||
const char *utf8,
|
||||
int utf8_len,
|
||||
cairo_glyph_t *glyphs,
|
||||
int num_glyphs,
|
||||
const cairo_text_cluster_t *clusters,
|
||||
int num_clusters,
|
||||
cairo_text_cluster_flags_t cluster_flags,
|
||||
cairo_scaled_font_t *scaled_font,
|
||||
cairo_clip_t *clip)
|
||||
int num_clusters,
|
||||
cairo_text_cluster_flags_t cluster_flags,
|
||||
cairo_scaled_font_t *scaled_font,
|
||||
cairo_clip_t *clip)
|
||||
{
|
||||
cairo_paginated_surface_t *surface = abstract_surface;
|
||||
|
||||
|
|
@ -619,7 +619,7 @@ _cairo_paginated_surface_show_text_glyphs (void *abstract_surface,
|
|||
|
||||
surface->page_is_blank = FALSE;
|
||||
|
||||
return _cairo_surface_show_text_glyphs (surface->meta, op, source,
|
||||
return _cairo_surface_show_text_glyphs (surface->recording_surface, op, source,
|
||||
utf8, utf8_len,
|
||||
glyphs, num_glyphs,
|
||||
clusters, num_clusters,
|
||||
|
|
@ -633,7 +633,7 @@ _cairo_paginated_surface_snapshot (void *abstract_other)
|
|||
{
|
||||
cairo_paginated_surface_t *other = abstract_other;
|
||||
|
||||
return _cairo_surface_snapshot (other->meta);
|
||||
return _cairo_surface_snapshot (other->recording_surface);
|
||||
}
|
||||
|
||||
static const cairo_surface_backend_t cairo_paginated_surface_backend = {
|
||||
|
|
|
|||
|
|
@ -333,7 +333,7 @@ void
|
|||
_cairo_pattern_fini_snapshot (cairo_pattern_t *pattern)
|
||||
{
|
||||
/* XXX this is quite ugly, but currently necessary to break the circular
|
||||
* references with snapshot-cow and the meta-surface.
|
||||
* references with snapshot-cow and the recording-surface.
|
||||
* This operation remains safe only whilst _cairo_surface_snapshot() is
|
||||
* not public...
|
||||
*/
|
||||
|
|
|
|||
|
|
@ -46,7 +46,7 @@
|
|||
#include "cairo-pdf-operators-private.h"
|
||||
#include "cairo-analysis-surface-private.h"
|
||||
#include "cairo-image-info-private.h"
|
||||
#include "cairo-meta-surface-private.h"
|
||||
#include "cairo-recording-surface-private.h"
|
||||
#include "cairo-output-stream-private.h"
|
||||
#include "cairo-paginated-private.h"
|
||||
#include "cairo-scaled-font-subsets-private.h"
|
||||
|
|
@ -1046,11 +1046,11 @@ _get_source_surface_size (cairo_surface_t *source,
|
|||
const unsigned char *mime_data;
|
||||
unsigned int mime_data_length;
|
||||
|
||||
if (_cairo_surface_is_meta (source)) {
|
||||
cairo_meta_surface_t *meta_surface = (cairo_meta_surface_t *) source;
|
||||
if (_cairo_surface_is_recording (source)) {
|
||||
cairo_recording_surface_t *recording_surface = (cairo_recording_surface_t *) source;
|
||||
cairo_box_t bbox;
|
||||
|
||||
status = _cairo_meta_surface_get_bbox (meta_surface, &bbox, NULL);
|
||||
status = _cairo_recording_surface_get_bbox (recording_surface, &bbox, NULL);
|
||||
if (unlikely (status))
|
||||
return status;
|
||||
|
||||
|
|
@ -2198,18 +2198,18 @@ BAIL:
|
|||
|
||||
|
||||
static cairo_status_t
|
||||
_cairo_pdf_surface_emit_meta_surface (cairo_pdf_surface_t *surface,
|
||||
cairo_surface_t *meta_surface,
|
||||
cairo_pdf_resource_t resource)
|
||||
_cairo_pdf_surface_emit_recording_surface (cairo_pdf_surface_t *surface,
|
||||
cairo_surface_t *recording_surface,
|
||||
cairo_pdf_resource_t resource)
|
||||
{
|
||||
double old_width, old_height;
|
||||
cairo_paginated_mode_t old_paginated_mode;
|
||||
cairo_rectangle_int_t meta_extents;
|
||||
cairo_rectangle_int_t recording_extents;
|
||||
cairo_bool_t is_bounded;
|
||||
cairo_status_t status;
|
||||
int alpha = 0;
|
||||
|
||||
is_bounded = _cairo_surface_get_extents (meta_surface, &meta_extents);
|
||||
is_bounded = _cairo_surface_get_extents (recording_surface, &recording_extents);
|
||||
assert (is_bounded);
|
||||
|
||||
old_width = surface->width;
|
||||
|
|
@ -2217,10 +2217,10 @@ _cairo_pdf_surface_emit_meta_surface (cairo_pdf_surface_t *surface,
|
|||
old_paginated_mode = surface->paginated_mode;
|
||||
|
||||
_cairo_pdf_surface_set_size_internal (surface,
|
||||
meta_extents.width,
|
||||
meta_extents.height);
|
||||
recording_extents.width,
|
||||
recording_extents.height);
|
||||
/* Patterns are emitted after fallback images. The paginated mode
|
||||
* needs to be set to _RENDER while the meta surface is replayed
|
||||
* needs to be set to _RENDER while the recording surface is replayed
|
||||
* back to this surface.
|
||||
*/
|
||||
surface->paginated_mode = CAIRO_PAGINATED_MODE_RENDER;
|
||||
|
|
@ -2229,7 +2229,7 @@ _cairo_pdf_surface_emit_meta_surface (cairo_pdf_surface_t *surface,
|
|||
if (unlikely (status))
|
||||
return status;
|
||||
|
||||
if (cairo_surface_get_content (meta_surface) == CAIRO_CONTENT_COLOR) {
|
||||
if (cairo_surface_get_content (recording_surface) == CAIRO_CONTENT_COLOR) {
|
||||
status = _cairo_pdf_surface_add_alpha (surface, 1.0, &alpha);
|
||||
if (unlikely (status))
|
||||
return status;
|
||||
|
|
@ -2241,8 +2241,8 @@ _cairo_pdf_surface_emit_meta_surface (cairo_pdf_surface_t *surface,
|
|||
surface->height);
|
||||
}
|
||||
|
||||
status = _cairo_meta_surface_replay_region (meta_surface, &surface->base,
|
||||
CAIRO_META_REGION_NATIVE);
|
||||
status = _cairo_recording_surface_replay_region (recording_surface, &surface->base,
|
||||
CAIRO_RECORDING_REGION_NATIVE);
|
||||
assert (status != CAIRO_INT_STATUS_UNSUPPORTED);
|
||||
if (unlikely (status))
|
||||
return status;
|
||||
|
|
@ -2261,8 +2261,8 @@ static cairo_status_t
|
|||
_cairo_pdf_surface_emit_surface (cairo_pdf_surface_t *surface,
|
||||
cairo_pdf_source_surface_t *src_surface)
|
||||
{
|
||||
if (_cairo_surface_is_meta (src_surface->surface)) {
|
||||
return _cairo_pdf_surface_emit_meta_surface (surface,
|
||||
if (_cairo_surface_is_recording (src_surface->surface)) {
|
||||
return _cairo_pdf_surface_emit_recording_surface (surface,
|
||||
src_surface->surface,
|
||||
src_surface->hash_entry->surface_res);
|
||||
} else {
|
||||
|
|
@ -2291,7 +2291,7 @@ _cairo_pdf_surface_emit_surface_pattern (cairo_pdf_surface_t *surface,
|
|||
char draw_surface[200];
|
||||
|
||||
if (pattern->base.extend == CAIRO_EXTEND_PAD &&
|
||||
! _cairo_surface_is_meta (pattern->surface))
|
||||
! _cairo_surface_is_recording (pattern->surface))
|
||||
{
|
||||
status = _cairo_pdf_surface_emit_padded_image_surface (surface,
|
||||
pdf_pattern,
|
||||
|
|
@ -2422,7 +2422,7 @@ _cairo_pdf_surface_emit_surface_pattern (cairo_pdf_surface_t *surface,
|
|||
if (unlikely (status))
|
||||
return status;
|
||||
|
||||
if (_cairo_surface_is_meta (pattern->surface)) {
|
||||
if (_cairo_surface_is_recording (pattern->surface)) {
|
||||
snprintf(draw_surface,
|
||||
sizeof (draw_surface),
|
||||
"/x%d Do\n",
|
||||
|
|
@ -3293,7 +3293,7 @@ _cairo_pdf_surface_paint_surface_pattern (cairo_pdf_surface_t *surface,
|
|||
cairo_matrix_multiply (&pdf_p2d, &cairo_p2d, &pdf_p2d);
|
||||
cairo_matrix_translate (&pdf_p2d, 0.0, height);
|
||||
cairo_matrix_scale (&pdf_p2d, 1.0, -1.0);
|
||||
if (! _cairo_surface_is_meta (source->surface))
|
||||
if (! _cairo_surface_is_recording (source->surface))
|
||||
cairo_matrix_scale (&pdf_p2d, width, height);
|
||||
|
||||
status = _cairo_pdf_operators_flush (&surface->pdf_operators);
|
||||
|
|
@ -4935,7 +4935,7 @@ _cairo_pdf_surface_write_patterns_and_smask_groups (cairo_pdf_surface_t *surface
|
|||
* to be appended to surface->smask_groups. Additional patterns
|
||||
* may also be appended to surface->patterns.
|
||||
*
|
||||
* Writing meta surface patterns will cause additional patterns
|
||||
* Writing recording surface patterns will cause additional patterns
|
||||
* and groups to be appended.
|
||||
*/
|
||||
pattern_index = 0;
|
||||
|
|
@ -5091,7 +5091,7 @@ _surface_pattern_supported (cairo_surface_pattern_t *pattern)
|
|||
{
|
||||
cairo_extend_t extend;
|
||||
|
||||
if (_cairo_surface_is_meta (pattern->surface))
|
||||
if (_cairo_surface_is_recording (pattern->surface))
|
||||
return TRUE;
|
||||
|
||||
if (pattern->surface->backend->acquire_source_image == NULL)
|
||||
|
|
@ -5230,11 +5230,11 @@ _cairo_pdf_surface_analyze_operation (cairo_pdf_surface_t *surface,
|
|||
if (pattern->type == CAIRO_PATTERN_TYPE_SURFACE) {
|
||||
cairo_surface_pattern_t *surface_pattern = (cairo_surface_pattern_t *) pattern;
|
||||
|
||||
if ( _cairo_surface_is_meta (surface_pattern->surface)) {
|
||||
if ( _cairo_surface_is_recording (surface_pattern->surface)) {
|
||||
if (pattern->extend == CAIRO_EXTEND_PAD)
|
||||
return CAIRO_INT_STATUS_UNSUPPORTED;
|
||||
else
|
||||
return CAIRO_INT_STATUS_ANALYZE_META_SURFACE_PATTERN;
|
||||
return CAIRO_INT_STATUS_ANALYZE_RECORDING_SURFACE_PATTERN;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -5248,14 +5248,14 @@ _cairo_pdf_surface_analyze_operation (cairo_pdf_surface_t *surface,
|
|||
if (pattern->type == CAIRO_PATTERN_TYPE_SURFACE) {
|
||||
cairo_surface_pattern_t *surface_pattern = (cairo_surface_pattern_t *) pattern;
|
||||
|
||||
if (_cairo_surface_is_meta (surface_pattern->surface)) {
|
||||
if (_cairo_surface_is_recording (surface_pattern->surface)) {
|
||||
if (_cairo_pattern_is_opaque (pattern)) {
|
||||
return CAIRO_INT_STATUS_ANALYZE_META_SURFACE_PATTERN;
|
||||
return CAIRO_INT_STATUS_ANALYZE_RECORDING_SURFACE_PATTERN;
|
||||
} else {
|
||||
/* FIXME: The analysis surface does not yet have
|
||||
* the capability to analyze a non opaque meta
|
||||
* the capability to analyze a non opaque recording
|
||||
* surface and mark it supported if there is
|
||||
* nothing underneath. For now meta surfaces of
|
||||
* nothing underneath. For now recording surfaces of
|
||||
* type CONTENT_COLOR_ALPHA painted with
|
||||
* OPERATOR_SOURCE will result in a fallback
|
||||
* image. */
|
||||
|
|
|
|||
|
|
@ -60,7 +60,7 @@
|
|||
#include "cairo-pdf-operators-private.h"
|
||||
#include "cairo-scaled-font-subsets-private.h"
|
||||
#include "cairo-paginated-private.h"
|
||||
#include "cairo-meta-surface-private.h"
|
||||
#include "cairo-recording-surface-private.h"
|
||||
#include "cairo-surface-clipper-private.h"
|
||||
#include "cairo-output-stream-private.h"
|
||||
#include "cairo-type3-glyph-surface-private.h"
|
||||
|
|
@ -1648,7 +1648,7 @@ _cairo_ps_surface_analyze_surface_pattern_transparency (cairo_ps_surface_t
|
|||
static cairo_bool_t
|
||||
surface_pattern_supported (const cairo_surface_pattern_t *pattern)
|
||||
{
|
||||
if (_cairo_surface_is_meta (pattern->surface))
|
||||
if (_cairo_surface_is_recording (pattern->surface))
|
||||
return TRUE;
|
||||
|
||||
if (pattern->surface->backend->acquire_source_image == NULL)
|
||||
|
|
@ -1758,11 +1758,11 @@ _cairo_ps_surface_analyze_operation (cairo_ps_surface_t *surface,
|
|||
if (pattern->type == CAIRO_PATTERN_TYPE_SURFACE) {
|
||||
cairo_surface_pattern_t *surface_pattern = (cairo_surface_pattern_t *) pattern;
|
||||
|
||||
if ( _cairo_surface_is_meta (surface_pattern->surface)) {
|
||||
if ( _cairo_surface_is_recording (surface_pattern->surface)) {
|
||||
if (pattern->extend == CAIRO_EXTEND_PAD)
|
||||
return CAIRO_INT_STATUS_UNSUPPORTED;
|
||||
else
|
||||
return CAIRO_INT_STATUS_ANALYZE_META_SURFACE_PATTERN;
|
||||
return CAIRO_INT_STATUS_ANALYZE_RECORDING_SURFACE_PATTERN;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -1963,7 +1963,7 @@ _base85_array_stream_create (cairo_output_stream_t *output)
|
|||
}
|
||||
|
||||
|
||||
/* PS Output - this section handles output of the parts of the meta
|
||||
/* PS Output - this section handles output of the parts of the recording
|
||||
* surface we can render natively in PS. */
|
||||
|
||||
static cairo_status_t
|
||||
|
|
@ -2402,8 +2402,8 @@ _cairo_ps_surface_emit_jpeg_image (cairo_ps_surface_t *surface,
|
|||
}
|
||||
|
||||
static cairo_status_t
|
||||
_cairo_ps_surface_emit_meta_surface (cairo_ps_surface_t *surface,
|
||||
cairo_surface_t *meta_surface)
|
||||
_cairo_ps_surface_emit_recording_surface (cairo_ps_surface_t *surface,
|
||||
cairo_surface_t *recording_surface)
|
||||
{
|
||||
double old_width, old_height;
|
||||
cairo_matrix_t old_cairo_to_ps;
|
||||
|
|
@ -2419,15 +2419,15 @@ _cairo_ps_surface_emit_meta_surface (cairo_ps_surface_t *surface,
|
|||
old_cairo_to_ps = surface->cairo_to_ps;
|
||||
|
||||
status =
|
||||
_cairo_meta_surface_get_bbox ((cairo_meta_surface_t *) meta_surface,
|
||||
&bbox,
|
||||
NULL);
|
||||
_cairo_recording_surface_get_bbox ((cairo_recording_surface_t *) recording_surface,
|
||||
&bbox,
|
||||
NULL);
|
||||
if (unlikely (status))
|
||||
return status;
|
||||
|
||||
#if DEBUG_PS
|
||||
_cairo_output_stream_printf (surface->stream,
|
||||
"%% _cairo_ps_surface_emit_meta_surface (%f, %f), (%f, %f)\n",
|
||||
"%% _cairo_ps_surface_emit_recording_surface (%f, %f), (%f, %f)\n",
|
||||
_cairo_fixed_to_double (bbox.p1.x),
|
||||
_cairo_fixed_to_double (bbox.p1.y),
|
||||
_cairo_fixed_to_double (bbox.p2.x),
|
||||
|
|
@ -2445,7 +2445,7 @@ _cairo_ps_surface_emit_meta_surface (cairo_ps_surface_t *surface,
|
|||
&surface->cairo_to_ps);
|
||||
_cairo_output_stream_printf (surface->stream, " q\n");
|
||||
|
||||
if (cairo_surface_get_content (meta_surface) == CAIRO_CONTENT_COLOR) {
|
||||
if (cairo_surface_get_content (recording_surface) == CAIRO_CONTENT_COLOR) {
|
||||
surface->content = CAIRO_CONTENT_COLOR;
|
||||
_cairo_output_stream_printf (surface->stream,
|
||||
" 0 g %d %d %d %d rectfill\n",
|
||||
|
|
@ -2455,8 +2455,8 @@ _cairo_ps_surface_emit_meta_surface (cairo_ps_surface_t *surface,
|
|||
surface->page_bbox.height);
|
||||
}
|
||||
|
||||
status = _cairo_meta_surface_replay_region (meta_surface, &surface->base,
|
||||
CAIRO_META_REGION_NATIVE);
|
||||
status = _cairo_recording_surface_replay_region (recording_surface, &surface->base,
|
||||
CAIRO_RECORDING_REGION_NATIVE);
|
||||
assert (status != CAIRO_INT_STATUS_UNSUPPORTED);
|
||||
if (unlikely (status))
|
||||
return status;
|
||||
|
|
@ -2539,12 +2539,12 @@ _cairo_ps_surface_acquire_surface (cairo_ps_surface_t *surface,
|
|||
surface->acquired_image = NULL;
|
||||
surface->image = NULL;
|
||||
|
||||
if (_cairo_surface_is_meta (pattern->surface)) {
|
||||
cairo_meta_surface_t *meta_surface = (cairo_meta_surface_t *) pattern->surface;
|
||||
if (_cairo_surface_is_recording (pattern->surface)) {
|
||||
cairo_recording_surface_t *recording_surface = (cairo_recording_surface_t *) pattern->surface;
|
||||
cairo_box_t bbox;
|
||||
cairo_rectangle_int_t extents;
|
||||
|
||||
status = _cairo_meta_surface_get_bbox (meta_surface, &bbox, NULL);
|
||||
status = _cairo_recording_surface_get_bbox (recording_surface, &bbox, NULL);
|
||||
if (unlikely (status))
|
||||
return status;
|
||||
|
||||
|
|
@ -2624,10 +2624,10 @@ _cairo_ps_surface_emit_surface (cairo_ps_surface_t *surface,
|
|||
{
|
||||
cairo_status_t status;
|
||||
|
||||
if (_cairo_surface_is_meta (pattern->surface)) {
|
||||
cairo_surface_t *meta_surface = pattern->surface;
|
||||
if (_cairo_surface_is_recording (pattern->surface)) {
|
||||
cairo_surface_t *recording_surface = pattern->surface;
|
||||
|
||||
status = _cairo_ps_surface_emit_meta_surface (surface, meta_surface);
|
||||
status = _cairo_ps_surface_emit_recording_surface (surface, recording_surface);
|
||||
} else {
|
||||
if (pattern->base.extend != CAIRO_EXTEND_PAD) {
|
||||
status = _cairo_ps_surface_emit_jpeg_image (surface, pattern->surface,
|
||||
|
|
@ -2650,7 +2650,7 @@ _cairo_ps_surface_release_surface (cairo_ps_surface_t *surface,
|
|||
if (surface->image != surface->acquired_image)
|
||||
cairo_surface_destroy (&surface->image->base);
|
||||
|
||||
if (! _cairo_surface_is_meta (pattern->surface)) {
|
||||
if (! _cairo_surface_is_recording (pattern->surface)) {
|
||||
_cairo_surface_release_source_image (pattern->surface,
|
||||
surface->acquired_image,
|
||||
surface->image_extra);
|
||||
|
|
|
|||
|
|
@ -34,8 +34,8 @@
|
|||
* Adrian Johnson <ajohnson@redneon.com>
|
||||
*/
|
||||
|
||||
#ifndef CAIRO_META_SURFACE_H
|
||||
#define CAIRO_META_SURFACE_H
|
||||
#ifndef CAIRO_RECORDING_SURFACE_H
|
||||
#define CAIRO_RECORDING_SURFACE_H
|
||||
|
||||
#include "cairoint.h"
|
||||
#include "cairo-path-fixed-private.h"
|
||||
|
|
@ -51,14 +51,14 @@ typedef enum {
|
|||
} cairo_command_type_t;
|
||||
|
||||
typedef enum {
|
||||
CAIRO_META_REGION_ALL,
|
||||
CAIRO_META_REGION_NATIVE,
|
||||
CAIRO_META_REGION_IMAGE_FALLBACK
|
||||
} cairo_meta_region_type_t;
|
||||
CAIRO_RECORDING_REGION_ALL,
|
||||
CAIRO_RECORDING_REGION_NATIVE,
|
||||
CAIRO_RECORDING_REGION_IMAGE_FALLBACK
|
||||
} cairo_recording_region_type_t;
|
||||
|
||||
typedef struct _cairo_command_header {
|
||||
cairo_command_type_t type;
|
||||
cairo_meta_region_type_t region;
|
||||
cairo_recording_region_type_t region;
|
||||
cairo_operator_t op;
|
||||
cairo_clip_t clip;
|
||||
} cairo_command_header_t;
|
||||
|
|
@ -117,12 +117,12 @@ typedef union _cairo_command {
|
|||
cairo_command_show_text_glyphs_t show_text_glyphs;
|
||||
} cairo_command_t;
|
||||
|
||||
typedef struct _cairo_meta_surface {
|
||||
typedef struct _cairo_recording_surface {
|
||||
cairo_surface_t base;
|
||||
|
||||
cairo_content_t content;
|
||||
|
||||
/* A meta-surface is logically unbounded, but when used as a
|
||||
/* A recording-surface is logically unbounded, but when used as a
|
||||
* source we need to render it to an image, so we need a size at
|
||||
* which to create that image. */
|
||||
cairo_rectangle_t extents_pixels;
|
||||
|
|
@ -135,37 +135,37 @@ typedef struct _cairo_meta_surface {
|
|||
cairo_surface_t *commands_owner;
|
||||
|
||||
int replay_start_idx;
|
||||
} cairo_meta_surface_t;
|
||||
} cairo_recording_surface_t;
|
||||
|
||||
slim_hidden_proto (cairo_meta_surface_create);
|
||||
slim_hidden_proto (cairo_recording_surface_create);
|
||||
|
||||
cairo_private cairo_int_status_t
|
||||
_cairo_meta_surface_get_path (cairo_surface_t *surface,
|
||||
cairo_path_fixed_t *path);
|
||||
_cairo_recording_surface_get_path (cairo_surface_t *surface,
|
||||
cairo_path_fixed_t *path);
|
||||
|
||||
cairo_private cairo_status_t
|
||||
_cairo_meta_surface_replay (cairo_surface_t *surface,
|
||||
cairo_surface_t *target);
|
||||
_cairo_recording_surface_replay (cairo_surface_t *surface,
|
||||
cairo_surface_t *target);
|
||||
|
||||
|
||||
cairo_private cairo_status_t
|
||||
_cairo_meta_surface_replay_analyze_meta_pattern (cairo_surface_t *surface,
|
||||
cairo_surface_t *target);
|
||||
_cairo_recording_surface_replay_analyze_recording_pattern (cairo_surface_t *surface,
|
||||
cairo_surface_t *target);
|
||||
|
||||
cairo_private cairo_status_t
|
||||
_cairo_meta_surface_replay_and_create_regions (cairo_surface_t *surface,
|
||||
cairo_surface_t *target);
|
||||
_cairo_recording_surface_replay_and_create_regions (cairo_surface_t *surface,
|
||||
cairo_surface_t *target);
|
||||
cairo_private cairo_status_t
|
||||
_cairo_meta_surface_replay_region (cairo_surface_t *surface,
|
||||
cairo_surface_t *target,
|
||||
cairo_meta_region_type_t region);
|
||||
_cairo_recording_surface_replay_region (cairo_surface_t *surface,
|
||||
cairo_surface_t *target,
|
||||
cairo_recording_region_type_t region);
|
||||
|
||||
cairo_private cairo_status_t
|
||||
_cairo_meta_surface_get_bbox (cairo_meta_surface_t *meta,
|
||||
cairo_box_t *bbox,
|
||||
const cairo_matrix_t *transform);
|
||||
_cairo_recording_surface_get_bbox (cairo_recording_surface_t *recording,
|
||||
cairo_box_t *bbox,
|
||||
const cairo_matrix_t *transform);
|
||||
|
||||
cairo_private cairo_bool_t
|
||||
_cairo_surface_is_meta (const cairo_surface_t *surface);
|
||||
_cairo_surface_is_recording (const cairo_surface_t *surface);
|
||||
|
||||
#endif /* CAIRO_META_SURFACE_H */
|
||||
#endif /* CAIRO_RECORDING_SURFACE_H */
|
||||
|
|
@ -37,34 +37,34 @@
|
|||
* Adrian Johnson <ajohnson@redneon.com>
|
||||
*/
|
||||
|
||||
/* A meta surface is a surface that records all drawing operations at
|
||||
/* A recording surface is a surface that records all drawing operations at
|
||||
* the highest level of the surface backend interface, (that is, the
|
||||
* level of paint, mask, stroke, fill, and show_text_glyphs). The meta
|
||||
* level of paint, mask, stroke, fill, and show_text_glyphs). The recording
|
||||
* surface can then be "replayed" against any target surface by using it
|
||||
* as a source surface.
|
||||
*
|
||||
* If you want to replay a surface so that the results in target will be
|
||||
* identical to the results that would have been obtained if the original
|
||||
* operations applied to the meta surface had instead been applied to the
|
||||
* operations applied to the recording surface had instead been applied to the
|
||||
* target surface, you can use code like this:
|
||||
* <informalexample><programlisting>
|
||||
* cairo_t *cr;
|
||||
*
|
||||
* cr = cairo_create (target);
|
||||
* cairo_set_source_surface (cr, meta, 0.0, 0.0);
|
||||
* cairo_set_source_surface (cr, recording_surface, 0.0, 0.0);
|
||||
* cairo_paint (cr);
|
||||
* cairo_destroy (cr);
|
||||
* </programlisting></informalexample>
|
||||
*
|
||||
* A meta surface is logically unbounded, i.e. it has no implicit constraint
|
||||
* A recording surface is logically unbounded, i.e. it has no implicit constraint
|
||||
* on the size of the drawing surface. However, in practice this is rarely
|
||||
* useful as you wish to replay against a particular target surface with
|
||||
* known bounds. For this case, it is more efficient to specify the target
|
||||
* extents to the meta surface upon creation.
|
||||
* extents to the recording surface upon creation.
|
||||
*
|
||||
* The recording phase of the meta surface is careful to snapshot all
|
||||
* The recording phase of the recording surface is careful to snapshot all
|
||||
* necessary objects (paths, patterns, etc.), in order to achieve
|
||||
* accurate replay. The efficiency of the meta surface could be
|
||||
* accurate replay. The efficiency of the recording surface could be
|
||||
* improved by improving the implementation of snapshot for the
|
||||
* various objects. For example, it would be nice to have a
|
||||
* copy-on-write implementation for _cairo_surface_snapshot.
|
||||
|
|
@ -74,20 +74,20 @@
|
|||
|
||||
#include "cairoint.h"
|
||||
#include "cairo-analysis-surface-private.h"
|
||||
#include "cairo-meta-surface-private.h"
|
||||
#include "cairo-recording-surface-private.h"
|
||||
#include "cairo-clip-private.h"
|
||||
#include "cairo-surface-wrapper-private.h"
|
||||
|
||||
typedef enum {
|
||||
CAIRO_META_REPLAY,
|
||||
CAIRO_META_CREATE_REGIONS
|
||||
} cairo_meta_replay_type_t;
|
||||
CAIRO_RECORDING_REPLAY,
|
||||
CAIRO_RECORDING_CREATE_REGIONS
|
||||
} cairo_recording_replay_type_t;
|
||||
|
||||
static const cairo_surface_backend_t cairo_meta_surface_backend;
|
||||
static const cairo_surface_backend_t cairo_recording_surface_backend;
|
||||
|
||||
/* Currently all meta surfaces do have a size which should be passed
|
||||
/* Currently all recording surfaces do have a size which should be passed
|
||||
* in as the maximum size of any target surface against which the
|
||||
* meta-surface will ever be replayed.
|
||||
* recording-surface will ever be replayed.
|
||||
*
|
||||
* XXX: The naming of "pixels" in the size here is a misnomer. It's
|
||||
* actually a size in whatever device-space units are desired (again,
|
||||
|
|
@ -95,95 +95,95 @@ static const cairo_surface_backend_t cairo_meta_surface_backend;
|
|||
*/
|
||||
|
||||
/**
|
||||
* cairo_meta_surface_create:
|
||||
* @content: the content of the meta surface
|
||||
* cairo_recording_surface_create:
|
||||
* @content: the content of the recording surface
|
||||
* @extents_pixels: the extents to record in pixels, can be %NULL to record
|
||||
* unbounded operations.
|
||||
*
|
||||
* Creates a meta-surface which can be used to record all drawing operations
|
||||
* Creates a recording-surface which can be used to record all drawing operations
|
||||
* at the highest level (that is, the level of paint, mask, stroke, fill
|
||||
* and show_text_glyphs). The meta surface can then be "replayed" against
|
||||
* and show_text_glyphs). The recording surface can then be "replayed" against
|
||||
* any target surface by using it as a source to drawing operations.
|
||||
*
|
||||
* The recording phase of the meta surface is careful to snapshot all
|
||||
* The recording phase of the recording surface is careful to snapshot all
|
||||
* necessary objects (paths, patterns, etc.), in order to achieve
|
||||
* accurate replay.
|
||||
*
|
||||
* Since 1.10
|
||||
**/
|
||||
cairo_surface_t *
|
||||
cairo_meta_surface_create (cairo_content_t content,
|
||||
const cairo_rectangle_t *extents)
|
||||
cairo_recording_surface_create (cairo_content_t content,
|
||||
const cairo_rectangle_t *extents)
|
||||
{
|
||||
cairo_meta_surface_t *meta;
|
||||
cairo_recording_surface_t *recording_surface;
|
||||
cairo_status_t status;
|
||||
|
||||
meta = malloc (sizeof (cairo_meta_surface_t));
|
||||
if (unlikely (meta == NULL))
|
||||
recording_surface = malloc (sizeof (cairo_recording_surface_t));
|
||||
if (unlikely (recording_surface == NULL))
|
||||
return _cairo_surface_create_in_error (_cairo_error (CAIRO_STATUS_NO_MEMORY));
|
||||
|
||||
_cairo_surface_init (&meta->base, &cairo_meta_surface_backend, content);
|
||||
_cairo_surface_init (&recording_surface->base, &cairo_recording_surface_backend, content);
|
||||
|
||||
meta->content = content;
|
||||
recording_surface->content = content;
|
||||
|
||||
/* unbounded -> 'infinite' extents */
|
||||
if (extents != NULL) {
|
||||
meta->extents_pixels = *extents;
|
||||
recording_surface->extents_pixels = *extents;
|
||||
|
||||
/* XXX check for overflow */
|
||||
meta->extents.x = floor (extents->x);
|
||||
meta->extents.y = floor (extents->y);
|
||||
meta->extents.width = ceil (extents->x + extents->width) - meta->extents.x;
|
||||
meta->extents.height = ceil (extents->y + extents->height) - meta->extents.y;
|
||||
recording_surface->extents.x = floor (extents->x);
|
||||
recording_surface->extents.y = floor (extents->y);
|
||||
recording_surface->extents.width = ceil (extents->x + extents->width) - recording_surface->extents.x;
|
||||
recording_surface->extents.height = ceil (extents->y + extents->height) - recording_surface->extents.y;
|
||||
|
||||
status = _cairo_clip_init_rectangle (&meta->clip, &meta->extents);
|
||||
status = _cairo_clip_init_rectangle (&recording_surface->clip, &recording_surface->extents);
|
||||
if (unlikely (status)) {
|
||||
free (meta);
|
||||
free (recording_surface);
|
||||
return _cairo_surface_create_in_error (status);
|
||||
}
|
||||
|
||||
meta->unbounded = FALSE;
|
||||
recording_surface->unbounded = FALSE;
|
||||
} else {
|
||||
meta->unbounded = TRUE;
|
||||
_cairo_clip_init (&meta->clip);
|
||||
recording_surface->unbounded = TRUE;
|
||||
_cairo_clip_init (&recording_surface->clip);
|
||||
}
|
||||
|
||||
_cairo_array_init (&meta->commands, sizeof (cairo_command_t *));
|
||||
meta->commands_owner = NULL;
|
||||
_cairo_array_init (&recording_surface->commands, sizeof (cairo_command_t *));
|
||||
recording_surface->commands_owner = NULL;
|
||||
|
||||
meta->replay_start_idx = 0;
|
||||
recording_surface->replay_start_idx = 0;
|
||||
|
||||
return &meta->base;
|
||||
return &recording_surface->base;
|
||||
}
|
||||
slim_hidden_def (cairo_meta_surface_create);
|
||||
slim_hidden_def (cairo_recording_surface_create);
|
||||
|
||||
static cairo_surface_t *
|
||||
_cairo_meta_surface_create_similar (void *abstract_surface,
|
||||
cairo_content_t content,
|
||||
int width,
|
||||
int height)
|
||||
_cairo_recording_surface_create_similar (void *abstract_surface,
|
||||
cairo_content_t content,
|
||||
int width,
|
||||
int height)
|
||||
{
|
||||
cairo_rectangle_t extents;
|
||||
extents.x = extents.y = 0;
|
||||
extents.width = width;
|
||||
extents.height = height;
|
||||
return cairo_meta_surface_create (content, &extents);
|
||||
return cairo_recording_surface_create (content, &extents);
|
||||
}
|
||||
|
||||
static cairo_status_t
|
||||
_cairo_meta_surface_finish (void *abstract_surface)
|
||||
_cairo_recording_surface_finish (void *abstract_surface)
|
||||
{
|
||||
cairo_meta_surface_t *meta = abstract_surface;
|
||||
cairo_recording_surface_t *recording_surface = abstract_surface;
|
||||
cairo_command_t **elements;
|
||||
int i, num_elements;
|
||||
|
||||
if (meta->commands_owner) {
|
||||
cairo_surface_destroy (meta->commands_owner);
|
||||
if (recording_surface->commands_owner) {
|
||||
cairo_surface_destroy (recording_surface->commands_owner);
|
||||
return CAIRO_STATUS_SUCCESS;
|
||||
}
|
||||
|
||||
num_elements = meta->commands.num_elements;
|
||||
elements = _cairo_array_index (&meta->commands, 0);
|
||||
num_elements = recording_surface->commands.num_elements;
|
||||
elements = _cairo_array_index (&recording_surface->commands, 0);
|
||||
for (i = 0; i < num_elements; i++) {
|
||||
cairo_command_t *command = elements[i];
|
||||
|
||||
|
|
@ -228,19 +228,19 @@ _cairo_meta_surface_finish (void *abstract_surface)
|
|||
}
|
||||
}
|
||||
|
||||
_cairo_array_fini (&meta->commands);
|
||||
_cairo_clip_reset (&meta->clip);
|
||||
_cairo_array_fini (&recording_surface->commands);
|
||||
_cairo_clip_reset (&recording_surface->clip);
|
||||
|
||||
return CAIRO_STATUS_SUCCESS;
|
||||
}
|
||||
|
||||
static cairo_status_t
|
||||
_cairo_meta_surface_acquire_source_image (void *abstract_surface,
|
||||
cairo_image_surface_t **image_out,
|
||||
void **image_extra)
|
||||
_cairo_recording_surface_acquire_source_image (void *abstract_surface,
|
||||
cairo_image_surface_t **image_out,
|
||||
void **image_extra)
|
||||
{
|
||||
cairo_status_t status;
|
||||
cairo_meta_surface_t *surface = abstract_surface;
|
||||
cairo_recording_surface_t *surface = abstract_surface;
|
||||
cairo_surface_t *image;
|
||||
|
||||
image = _cairo_surface_has_snapshot (&surface->base,
|
||||
|
|
@ -262,7 +262,7 @@ _cairo_meta_surface_acquire_source_image (void *abstract_surface,
|
|||
-surface->extents.x,
|
||||
-surface->extents.y);
|
||||
|
||||
status = _cairo_meta_surface_replay (&surface->base, image);
|
||||
status = _cairo_recording_surface_replay (&surface->base, image);
|
||||
if (unlikely (status)) {
|
||||
cairo_surface_destroy (image);
|
||||
return status;
|
||||
|
|
@ -280,15 +280,15 @@ _cairo_meta_surface_acquire_source_image (void *abstract_surface,
|
|||
}
|
||||
|
||||
static void
|
||||
_cairo_meta_surface_release_source_image (void *abstract_surface,
|
||||
cairo_image_surface_t *image,
|
||||
void *image_extra)
|
||||
_cairo_recording_surface_release_source_image (void *abstract_surface,
|
||||
cairo_image_surface_t *image,
|
||||
void *image_extra)
|
||||
{
|
||||
cairo_surface_destroy (&image->base);
|
||||
}
|
||||
|
||||
static cairo_status_t
|
||||
_command_init (cairo_meta_surface_t *meta,
|
||||
_command_init (cairo_recording_surface_t *recording_surface,
|
||||
cairo_command_header_t *command,
|
||||
cairo_command_type_t type,
|
||||
cairo_operator_t op,
|
||||
|
|
@ -298,29 +298,29 @@ _command_init (cairo_meta_surface_t *meta,
|
|||
|
||||
command->type = type;
|
||||
command->op = op;
|
||||
command->region = CAIRO_META_REGION_ALL;
|
||||
command->region = CAIRO_RECORDING_REGION_ALL;
|
||||
_cairo_clip_init_copy (&command->clip, clip);
|
||||
if (meta->clip.path != NULL)
|
||||
status = _cairo_clip_apply_clip (&command->clip, &meta->clip);
|
||||
if (recording_surface->clip.path != NULL)
|
||||
status = _cairo_clip_apply_clip (&command->clip, &recording_surface->clip);
|
||||
|
||||
return status;
|
||||
}
|
||||
|
||||
static cairo_int_status_t
|
||||
_cairo_meta_surface_paint (void *abstract_surface,
|
||||
cairo_operator_t op,
|
||||
const cairo_pattern_t *source,
|
||||
cairo_clip_t *clip)
|
||||
_cairo_recording_surface_paint (void *abstract_surface,
|
||||
cairo_operator_t op,
|
||||
const cairo_pattern_t *source,
|
||||
cairo_clip_t *clip)
|
||||
{
|
||||
cairo_status_t status;
|
||||
cairo_meta_surface_t *meta = abstract_surface;
|
||||
cairo_recording_surface_t *recording_surface = abstract_surface;
|
||||
cairo_command_paint_t *command;
|
||||
|
||||
command = malloc (sizeof (cairo_command_paint_t));
|
||||
if (unlikely (command == NULL))
|
||||
return _cairo_error (CAIRO_STATUS_NO_MEMORY);
|
||||
|
||||
status = _command_init (meta,
|
||||
status = _command_init (recording_surface,
|
||||
&command->header, CAIRO_COMMAND_PAINT, op, clip);
|
||||
if (unlikely (status))
|
||||
goto CLEANUP_COMMAND;
|
||||
|
|
@ -329,7 +329,7 @@ _cairo_meta_surface_paint (void *abstract_surface,
|
|||
if (unlikely (status))
|
||||
goto CLEANUP_COMMAND;
|
||||
|
||||
status = _cairo_array_append (&meta->commands, &command);
|
||||
status = _cairo_array_append (&recording_surface->commands, &command);
|
||||
if (unlikely (status))
|
||||
goto CLEANUP_SOURCE;
|
||||
|
||||
|
|
@ -337,7 +337,7 @@ _cairo_meta_surface_paint (void *abstract_surface,
|
|||
* before surface is cleared. We don't erase recorded commands
|
||||
* since we may have earlier snapshots of this surface. */
|
||||
if (op == CAIRO_OPERATOR_CLEAR && clip == NULL)
|
||||
meta->replay_start_idx = meta->commands.num_elements;
|
||||
recording_surface->replay_start_idx = recording_surface->commands.num_elements;
|
||||
|
||||
return CAIRO_STATUS_SUCCESS;
|
||||
|
||||
|
|
@ -349,21 +349,21 @@ _cairo_meta_surface_paint (void *abstract_surface,
|
|||
}
|
||||
|
||||
static cairo_int_status_t
|
||||
_cairo_meta_surface_mask (void *abstract_surface,
|
||||
cairo_operator_t op,
|
||||
const cairo_pattern_t *source,
|
||||
const cairo_pattern_t *mask,
|
||||
cairo_clip_t *clip)
|
||||
_cairo_recording_surface_mask (void *abstract_surface,
|
||||
cairo_operator_t op,
|
||||
const cairo_pattern_t *source,
|
||||
const cairo_pattern_t *mask,
|
||||
cairo_clip_t *clip)
|
||||
{
|
||||
cairo_status_t status;
|
||||
cairo_meta_surface_t *meta = abstract_surface;
|
||||
cairo_recording_surface_t *recording_surface = abstract_surface;
|
||||
cairo_command_mask_t *command;
|
||||
|
||||
command = malloc (sizeof (cairo_command_mask_t));
|
||||
if (unlikely (command == NULL))
|
||||
return _cairo_error (CAIRO_STATUS_NO_MEMORY);
|
||||
|
||||
status = _command_init (meta,
|
||||
status = _command_init (recording_surface,
|
||||
&command->header, CAIRO_COMMAND_MASK, op, clip);
|
||||
if (unlikely (status))
|
||||
goto CLEANUP_COMMAND;
|
||||
|
|
@ -376,7 +376,7 @@ _cairo_meta_surface_mask (void *abstract_surface,
|
|||
if (unlikely (status))
|
||||
goto CLEANUP_SOURCE;
|
||||
|
||||
status = _cairo_array_append (&meta->commands, &command);
|
||||
status = _cairo_array_append (&recording_surface->commands, &command);
|
||||
if (unlikely (status))
|
||||
goto CLEANUP_MASK;
|
||||
|
||||
|
|
@ -392,26 +392,26 @@ _cairo_meta_surface_mask (void *abstract_surface,
|
|||
}
|
||||
|
||||
static cairo_int_status_t
|
||||
_cairo_meta_surface_stroke (void *abstract_surface,
|
||||
cairo_operator_t op,
|
||||
const cairo_pattern_t *source,
|
||||
cairo_path_fixed_t *path,
|
||||
cairo_stroke_style_t *style,
|
||||
cairo_matrix_t *ctm,
|
||||
cairo_matrix_t *ctm_inverse,
|
||||
double tolerance,
|
||||
cairo_antialias_t antialias,
|
||||
cairo_clip_t *clip)
|
||||
_cairo_recording_surface_stroke (void *abstract_surface,
|
||||
cairo_operator_t op,
|
||||
const cairo_pattern_t *source,
|
||||
cairo_path_fixed_t *path,
|
||||
cairo_stroke_style_t *style,
|
||||
cairo_matrix_t *ctm,
|
||||
cairo_matrix_t *ctm_inverse,
|
||||
double tolerance,
|
||||
cairo_antialias_t antialias,
|
||||
cairo_clip_t *clip)
|
||||
{
|
||||
cairo_status_t status;
|
||||
cairo_meta_surface_t *meta = abstract_surface;
|
||||
cairo_recording_surface_t *recording_surface = abstract_surface;
|
||||
cairo_command_stroke_t *command;
|
||||
|
||||
command = malloc (sizeof (cairo_command_stroke_t));
|
||||
if (unlikely (command == NULL))
|
||||
return _cairo_error (CAIRO_STATUS_NO_MEMORY);
|
||||
|
||||
status = _command_init (meta,
|
||||
status = _command_init (recording_surface,
|
||||
&command->header, CAIRO_COMMAND_STROKE, op, clip);
|
||||
if (unlikely (status))
|
||||
goto CLEANUP_COMMAND;
|
||||
|
|
@ -433,7 +433,7 @@ _cairo_meta_surface_stroke (void *abstract_surface,
|
|||
command->tolerance = tolerance;
|
||||
command->antialias = antialias;
|
||||
|
||||
status = _cairo_array_append (&meta->commands, &command);
|
||||
status = _cairo_array_append (&recording_surface->commands, &command);
|
||||
if (unlikely (status))
|
||||
goto CLEANUP_STYLE;
|
||||
|
||||
|
|
@ -451,24 +451,24 @@ _cairo_meta_surface_stroke (void *abstract_surface,
|
|||
}
|
||||
|
||||
static cairo_int_status_t
|
||||
_cairo_meta_surface_fill (void *abstract_surface,
|
||||
cairo_operator_t op,
|
||||
const cairo_pattern_t *source,
|
||||
cairo_path_fixed_t *path,
|
||||
cairo_fill_rule_t fill_rule,
|
||||
double tolerance,
|
||||
cairo_antialias_t antialias,
|
||||
cairo_clip_t *clip)
|
||||
_cairo_recording_surface_fill (void *abstract_surface,
|
||||
cairo_operator_t op,
|
||||
const cairo_pattern_t *source,
|
||||
cairo_path_fixed_t *path,
|
||||
cairo_fill_rule_t fill_rule,
|
||||
double tolerance,
|
||||
cairo_antialias_t antialias,
|
||||
cairo_clip_t *clip)
|
||||
{
|
||||
cairo_status_t status;
|
||||
cairo_meta_surface_t *meta = abstract_surface;
|
||||
cairo_recording_surface_t *recording_surface = abstract_surface;
|
||||
cairo_command_fill_t *command;
|
||||
|
||||
command = malloc (sizeof (cairo_command_fill_t));
|
||||
if (unlikely (command == NULL))
|
||||
return _cairo_error (CAIRO_STATUS_NO_MEMORY);
|
||||
|
||||
status =_command_init (meta,
|
||||
status =_command_init (recording_surface,
|
||||
&command->header, CAIRO_COMMAND_FILL, op, clip);
|
||||
if (unlikely (status))
|
||||
goto CLEANUP_COMMAND;
|
||||
|
|
@ -485,7 +485,7 @@ _cairo_meta_surface_fill (void *abstract_surface,
|
|||
command->tolerance = tolerance;
|
||||
command->antialias = antialias;
|
||||
|
||||
status = _cairo_array_append (&meta->commands, &command);
|
||||
status = _cairo_array_append (&recording_surface->commands, &command);
|
||||
if (unlikely (status))
|
||||
goto CLEANUP_PATH;
|
||||
|
||||
|
|
@ -501,34 +501,34 @@ _cairo_meta_surface_fill (void *abstract_surface,
|
|||
}
|
||||
|
||||
static cairo_bool_t
|
||||
_cairo_meta_surface_has_show_text_glyphs (void *abstract_surface)
|
||||
_cairo_recording_surface_has_show_text_glyphs (void *abstract_surface)
|
||||
{
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
static cairo_int_status_t
|
||||
_cairo_meta_surface_show_text_glyphs (void *abstract_surface,
|
||||
cairo_operator_t op,
|
||||
const cairo_pattern_t *source,
|
||||
const char *utf8,
|
||||
int utf8_len,
|
||||
cairo_glyph_t *glyphs,
|
||||
int num_glyphs,
|
||||
const cairo_text_cluster_t *clusters,
|
||||
int num_clusters,
|
||||
cairo_text_cluster_flags_t cluster_flags,
|
||||
cairo_scaled_font_t *scaled_font,
|
||||
cairo_clip_t *clip)
|
||||
_cairo_recording_surface_show_text_glyphs (void *abstract_surface,
|
||||
cairo_operator_t op,
|
||||
const cairo_pattern_t *source,
|
||||
const char *utf8,
|
||||
int utf8_len,
|
||||
cairo_glyph_t *glyphs,
|
||||
int num_glyphs,
|
||||
const cairo_text_cluster_t *clusters,
|
||||
int num_clusters,
|
||||
cairo_text_cluster_flags_t cluster_flags,
|
||||
cairo_scaled_font_t *scaled_font,
|
||||
cairo_clip_t *clip)
|
||||
{
|
||||
cairo_status_t status;
|
||||
cairo_meta_surface_t *meta = abstract_surface;
|
||||
cairo_recording_surface_t *recording_surface = abstract_surface;
|
||||
cairo_command_show_text_glyphs_t *command;
|
||||
|
||||
command = malloc (sizeof (cairo_command_show_text_glyphs_t));
|
||||
if (unlikely (command == NULL))
|
||||
return _cairo_error (CAIRO_STATUS_NO_MEMORY);
|
||||
|
||||
status = _command_init (meta,
|
||||
status = _command_init (recording_surface,
|
||||
&command->header, CAIRO_COMMAND_SHOW_TEXT_GLYPHS,
|
||||
op, clip);
|
||||
if (unlikely (status))
|
||||
|
|
@ -574,7 +574,7 @@ _cairo_meta_surface_show_text_glyphs (void *abstract_surface,
|
|||
|
||||
command->scaled_font = cairo_scaled_font_reference (scaled_font);
|
||||
|
||||
status = _cairo_array_append (&meta->commands, &command);
|
||||
status = _cairo_array_append (&recording_surface->commands, &command);
|
||||
if (unlikely (status))
|
||||
goto CLEANUP_SCALED_FONT;
|
||||
|
||||
|
|
@ -594,8 +594,8 @@ _cairo_meta_surface_show_text_glyphs (void *abstract_surface,
|
|||
}
|
||||
|
||||
/**
|
||||
* _cairo_meta_surface_snapshot
|
||||
* @surface: a #cairo_surface_t which must be a meta surface
|
||||
* _cairo_recording_surface_snapshot
|
||||
* @surface: a #cairo_surface_t which must be a recording surface
|
||||
*
|
||||
* Make an immutable copy of @surface. It is an error to call a
|
||||
* surface-modifying function on the result of this function.
|
||||
|
|
@ -607,37 +607,37 @@ _cairo_meta_surface_show_text_glyphs (void *abstract_surface,
|
|||
* Return value: The snapshot surface.
|
||||
**/
|
||||
static cairo_surface_t *
|
||||
_cairo_meta_surface_snapshot (void *abstract_other)
|
||||
_cairo_recording_surface_snapshot (void *abstract_other)
|
||||
{
|
||||
cairo_meta_surface_t *other = abstract_other;
|
||||
cairo_meta_surface_t *meta;
|
||||
cairo_recording_surface_t *other = abstract_other;
|
||||
cairo_recording_surface_t *recording_surface;
|
||||
|
||||
meta = malloc (sizeof (cairo_meta_surface_t));
|
||||
if (unlikely (meta == NULL))
|
||||
recording_surface = malloc (sizeof (cairo_recording_surface_t));
|
||||
if (unlikely (recording_surface == NULL))
|
||||
return _cairo_surface_create_in_error (_cairo_error (CAIRO_STATUS_NO_MEMORY));
|
||||
|
||||
_cairo_surface_init (&meta->base, &cairo_meta_surface_backend,
|
||||
_cairo_surface_init (&recording_surface->base, &cairo_recording_surface_backend,
|
||||
other->base.content);
|
||||
|
||||
meta->extents_pixels = other->extents_pixels;
|
||||
meta->extents = other->extents;
|
||||
meta->unbounded = other->unbounded;
|
||||
meta->replay_start_idx = other->replay_start_idx;
|
||||
meta->content = other->content;
|
||||
recording_surface->extents_pixels = other->extents_pixels;
|
||||
recording_surface->extents = other->extents;
|
||||
recording_surface->unbounded = other->unbounded;
|
||||
recording_surface->replay_start_idx = other->replay_start_idx;
|
||||
recording_surface->content = other->content;
|
||||
|
||||
_cairo_array_init_snapshot (&meta->commands, &other->commands);
|
||||
meta->commands_owner = cairo_surface_reference (&other->base);
|
||||
_cairo_array_init_snapshot (&recording_surface->commands, &other->commands);
|
||||
recording_surface->commands_owner = cairo_surface_reference (&other->base);
|
||||
|
||||
_cairo_clip_init_copy (&meta->clip, &other->clip);
|
||||
_cairo_clip_init_copy (&recording_surface->clip, &other->clip);
|
||||
|
||||
return &meta->base;
|
||||
return &recording_surface->base;
|
||||
}
|
||||
|
||||
static cairo_bool_t
|
||||
_cairo_meta_surface_get_extents (void *abstract_surface,
|
||||
cairo_rectangle_int_t *rectangle)
|
||||
_cairo_recording_surface_get_extents (void *abstract_surface,
|
||||
cairo_rectangle_int_t *rectangle)
|
||||
{
|
||||
cairo_meta_surface_t *surface = abstract_surface;
|
||||
cairo_recording_surface_t *surface = abstract_surface;
|
||||
|
||||
if (surface->unbounded)
|
||||
return FALSE;
|
||||
|
|
@ -647,25 +647,25 @@ _cairo_meta_surface_get_extents (void *abstract_surface,
|
|||
}
|
||||
|
||||
/**
|
||||
* _cairo_surface_is_meta:
|
||||
* _cairo_surface_is_recording:
|
||||
* @surface: a #cairo_surface_t
|
||||
*
|
||||
* Checks if a surface is a #cairo_meta_surface_t
|
||||
* Checks if a surface is a #cairo_recording_surface_t
|
||||
*
|
||||
* Return value: %TRUE if the surface is a meta surface
|
||||
* Return value: %TRUE if the surface is a recording surface
|
||||
**/
|
||||
cairo_bool_t
|
||||
_cairo_surface_is_meta (const cairo_surface_t *surface)
|
||||
_cairo_surface_is_recording (const cairo_surface_t *surface)
|
||||
{
|
||||
return surface->backend == &cairo_meta_surface_backend;
|
||||
return surface->backend == &cairo_recording_surface_backend;
|
||||
}
|
||||
|
||||
static const cairo_surface_backend_t cairo_meta_surface_backend = {
|
||||
CAIRO_SURFACE_TYPE_META,
|
||||
_cairo_meta_surface_create_similar,
|
||||
_cairo_meta_surface_finish,
|
||||
_cairo_meta_surface_acquire_source_image,
|
||||
_cairo_meta_surface_release_source_image,
|
||||
static const cairo_surface_backend_t cairo_recording_surface_backend = {
|
||||
CAIRO_SURFACE_TYPE_RECORDING,
|
||||
_cairo_recording_surface_create_similar,
|
||||
_cairo_recording_surface_finish,
|
||||
_cairo_recording_surface_acquire_source_image,
|
||||
_cairo_recording_surface_release_source_image,
|
||||
NULL, /* acquire_dest_image */
|
||||
NULL, /* release_dest_image */
|
||||
NULL, /* clone_similar */
|
||||
|
|
@ -676,7 +676,7 @@ static const cairo_surface_backend_t cairo_meta_surface_backend = {
|
|||
NULL, /* check_span_renderer */
|
||||
NULL, /* copy_page */
|
||||
NULL, /* show_page */
|
||||
_cairo_meta_surface_get_extents,
|
||||
_cairo_recording_surface_get_extents,
|
||||
NULL, /* old_show_glyphs */
|
||||
NULL, /* get_font_options */
|
||||
NULL, /* flush */
|
||||
|
|
@ -685,32 +685,32 @@ static const cairo_surface_backend_t cairo_meta_surface_backend = {
|
|||
NULL, /* scaled_glyph_fini */
|
||||
|
||||
/* Here are the 5 basic drawing operations, (which are in some
|
||||
* sense the only things that cairo_meta_surface should need to
|
||||
* sense the only things that cairo_recording_surface should need to
|
||||
* implement). However, we implement the more generic show_text_glyphs
|
||||
* instead of show_glyphs. One or the other is eough. */
|
||||
|
||||
_cairo_meta_surface_paint,
|
||||
_cairo_meta_surface_mask,
|
||||
_cairo_meta_surface_stroke,
|
||||
_cairo_meta_surface_fill,
|
||||
_cairo_recording_surface_paint,
|
||||
_cairo_recording_surface_mask,
|
||||
_cairo_recording_surface_stroke,
|
||||
_cairo_recording_surface_fill,
|
||||
NULL,
|
||||
|
||||
_cairo_meta_surface_snapshot,
|
||||
_cairo_recording_surface_snapshot,
|
||||
|
||||
NULL, /* is_similar */
|
||||
NULL, /* fill_stroke */
|
||||
NULL, /* create_solid_pattern_surface */
|
||||
NULL, /* can_repaint_solid_pattern_surface */
|
||||
|
||||
_cairo_meta_surface_has_show_text_glyphs,
|
||||
_cairo_meta_surface_show_text_glyphs
|
||||
_cairo_recording_surface_has_show_text_glyphs,
|
||||
_cairo_recording_surface_show_text_glyphs
|
||||
};
|
||||
|
||||
cairo_int_status_t
|
||||
_cairo_meta_surface_get_path (cairo_surface_t *surface,
|
||||
cairo_path_fixed_t *path)
|
||||
_cairo_recording_surface_get_path (cairo_surface_t *surface,
|
||||
cairo_path_fixed_t *path)
|
||||
{
|
||||
cairo_meta_surface_t *meta;
|
||||
cairo_recording_surface_t *recording_surface;
|
||||
cairo_command_t **elements;
|
||||
int i, num_elements;
|
||||
cairo_int_status_t status;
|
||||
|
|
@ -718,12 +718,12 @@ _cairo_meta_surface_get_path (cairo_surface_t *surface,
|
|||
if (surface->status)
|
||||
return surface->status;
|
||||
|
||||
meta = (cairo_meta_surface_t *) surface;
|
||||
recording_surface = (cairo_recording_surface_t *) surface;
|
||||
status = CAIRO_STATUS_SUCCESS;
|
||||
|
||||
num_elements = meta->commands.num_elements;
|
||||
elements = _cairo_array_index (&meta->commands, 0);
|
||||
for (i = meta->replay_start_idx; i < num_elements; i++) {
|
||||
num_elements = recording_surface->commands.num_elements;
|
||||
elements = _cairo_array_index (&recording_surface->commands, 0);
|
||||
for (i = recording_surface->replay_start_idx; i < num_elements; i++) {
|
||||
cairo_command_t *command = elements[i];
|
||||
|
||||
switch (command->header.type) {
|
||||
|
|
@ -781,12 +781,12 @@ _cairo_meta_surface_get_path (cairo_surface_t *surface,
|
|||
|
||||
#define _clip(c) ((c)->header.clip.path ? &(c)->header.clip : NULL)
|
||||
static cairo_status_t
|
||||
_cairo_meta_surface_replay_internal (cairo_surface_t *surface,
|
||||
cairo_surface_t *target,
|
||||
cairo_meta_replay_type_t type,
|
||||
cairo_meta_region_type_t region)
|
||||
_cairo_recording_surface_replay_internal (cairo_surface_t *surface,
|
||||
cairo_surface_t *target,
|
||||
cairo_recording_replay_type_t type,
|
||||
cairo_recording_region_type_t region)
|
||||
{
|
||||
cairo_meta_surface_t *meta;
|
||||
cairo_recording_surface_t *recording_surface;
|
||||
cairo_command_t **elements;
|
||||
int i, num_elements;
|
||||
cairo_int_status_t status;
|
||||
|
|
@ -800,15 +800,15 @@ _cairo_meta_surface_replay_internal (cairo_surface_t *surface,
|
|||
|
||||
_cairo_surface_wrapper_init (&wrapper, target);
|
||||
|
||||
meta = (cairo_meta_surface_t *) surface;
|
||||
recording_surface = (cairo_recording_surface_t *) surface;
|
||||
status = CAIRO_STATUS_SUCCESS;
|
||||
|
||||
num_elements = meta->commands.num_elements;
|
||||
elements = _cairo_array_index (&meta->commands, 0);
|
||||
for (i = meta->replay_start_idx; i < num_elements; i++) {
|
||||
num_elements = recording_surface->commands.num_elements;
|
||||
elements = _cairo_array_index (&recording_surface->commands, 0);
|
||||
for (i = recording_surface->replay_start_idx; i < num_elements; i++) {
|
||||
cairo_command_t *command = elements[i];
|
||||
|
||||
if (type == CAIRO_META_REPLAY && region != CAIRO_META_REGION_ALL) {
|
||||
if (type == CAIRO_RECORDING_REPLAY && region != CAIRO_RECORDING_REGION_ALL) {
|
||||
if (command->header.region != region)
|
||||
continue;
|
||||
}
|
||||
|
|
@ -848,12 +848,12 @@ _cairo_meta_surface_replay_internal (cairo_surface_t *surface,
|
|||
cairo_command_t *stroke_command;
|
||||
|
||||
stroke_command = NULL;
|
||||
if (type != CAIRO_META_CREATE_REGIONS && i < num_elements - 1)
|
||||
if (type != CAIRO_RECORDING_CREATE_REGIONS && i < num_elements - 1)
|
||||
stroke_command = elements[i + 1];
|
||||
|
||||
if (stroke_command != NULL &&
|
||||
type == CAIRO_META_REPLAY &&
|
||||
region != CAIRO_META_REGION_ALL)
|
||||
type == CAIRO_RECORDING_REPLAY &&
|
||||
region != CAIRO_RECORDING_REGION_ALL)
|
||||
{
|
||||
if (stroke_command->header.region != region)
|
||||
stroke_command = NULL;
|
||||
|
|
@ -928,11 +928,11 @@ _cairo_meta_surface_replay_internal (cairo_surface_t *surface,
|
|||
ASSERT_NOT_REACHED;
|
||||
}
|
||||
|
||||
if (type == CAIRO_META_CREATE_REGIONS) {
|
||||
if (type == CAIRO_RECORDING_CREATE_REGIONS) {
|
||||
if (status == CAIRO_STATUS_SUCCESS) {
|
||||
command->header.region = CAIRO_META_REGION_NATIVE;
|
||||
command->header.region = CAIRO_RECORDING_REGION_NATIVE;
|
||||
} else if (status == CAIRO_INT_STATUS_IMAGE_FALLBACK) {
|
||||
command->header.region = CAIRO_META_REGION_IMAGE_FALLBACK;
|
||||
command->header.region = CAIRO_RECORDING_REGION_IMAGE_FALLBACK;
|
||||
status = CAIRO_STATUS_SUCCESS;
|
||||
} else {
|
||||
assert (_cairo_status_is_error (status));
|
||||
|
|
@ -944,7 +944,7 @@ _cairo_meta_surface_replay_internal (cairo_surface_t *surface,
|
|||
}
|
||||
|
||||
/* free up any caches */
|
||||
for (i = meta->replay_start_idx; i < num_elements; i++) {
|
||||
for (i = recording_surface->replay_start_idx; i < num_elements; i++) {
|
||||
cairo_command_t *command = elements[i];
|
||||
|
||||
_cairo_clip_drop_cache (&command->header.clip);
|
||||
|
|
@ -956,58 +956,58 @@ _cairo_meta_surface_replay_internal (cairo_surface_t *surface,
|
|||
}
|
||||
|
||||
/**
|
||||
* _cairo_meta_surface_replay:
|
||||
* @surface: the #cairo_meta_surface_t
|
||||
* _cairo_recording_surface_replay:
|
||||
* @surface: the #cairo_recording_surface_t
|
||||
* @target: a target #cairo_surface_t onto which to replay the operations
|
||||
* @width_pixels: width of the surface, in pixels
|
||||
* @height_pixels: height of the surface, in pixels
|
||||
*
|
||||
* A meta surface can be "replayed" against any target surface,
|
||||
* A recording surface can be "replayed" against any target surface,
|
||||
* after which the results in target will be identical to the results
|
||||
* that would have been obtained if the original operations applied to
|
||||
* the meta surface had instead been applied to the target surface.
|
||||
* the recording surface had instead been applied to the target surface.
|
||||
**/
|
||||
cairo_status_t
|
||||
_cairo_meta_surface_replay (cairo_surface_t *surface,
|
||||
cairo_surface_t *target)
|
||||
_cairo_recording_surface_replay (cairo_surface_t *surface,
|
||||
cairo_surface_t *target)
|
||||
{
|
||||
return _cairo_meta_surface_replay_internal (surface,
|
||||
target,
|
||||
CAIRO_META_REPLAY,
|
||||
CAIRO_META_REGION_ALL);
|
||||
return _cairo_recording_surface_replay_internal (surface,
|
||||
target,
|
||||
CAIRO_RECORDING_REPLAY,
|
||||
CAIRO_RECORDING_REGION_ALL);
|
||||
}
|
||||
|
||||
/* Replay meta to surface. When the return status of each operation is
|
||||
/* Replay recording to surface. When the return status of each operation is
|
||||
* one of %CAIRO_STATUS_SUCCESS, %CAIRO_INT_STATUS_UNSUPPORTED, or
|
||||
* %CAIRO_INT_STATUS_FLATTEN_TRANSPARENCY the status of each operation
|
||||
* will be stored in the meta surface. Any other status will abort the
|
||||
* will be stored in the recording surface. Any other status will abort the
|
||||
* replay and return the status.
|
||||
*/
|
||||
cairo_status_t
|
||||
_cairo_meta_surface_replay_and_create_regions (cairo_surface_t *surface,
|
||||
cairo_surface_t *target)
|
||||
_cairo_recording_surface_replay_and_create_regions (cairo_surface_t *surface,
|
||||
cairo_surface_t *target)
|
||||
{
|
||||
return _cairo_meta_surface_replay_internal (surface,
|
||||
target,
|
||||
CAIRO_META_CREATE_REGIONS,
|
||||
CAIRO_META_REGION_ALL);
|
||||
return _cairo_recording_surface_replay_internal (surface,
|
||||
target,
|
||||
CAIRO_RECORDING_CREATE_REGIONS,
|
||||
CAIRO_RECORDING_REGION_ALL);
|
||||
}
|
||||
|
||||
cairo_status_t
|
||||
_cairo_meta_surface_replay_region (cairo_surface_t *surface,
|
||||
cairo_surface_t *target,
|
||||
cairo_meta_region_type_t region)
|
||||
_cairo_recording_surface_replay_region (cairo_surface_t *surface,
|
||||
cairo_surface_t *target,
|
||||
cairo_recording_region_type_t region)
|
||||
{
|
||||
return _cairo_meta_surface_replay_internal (surface,
|
||||
target,
|
||||
CAIRO_META_REPLAY,
|
||||
region);
|
||||
return _cairo_recording_surface_replay_internal (surface,
|
||||
target,
|
||||
CAIRO_RECORDING_REPLAY,
|
||||
region);
|
||||
}
|
||||
|
||||
static cairo_status_t
|
||||
_meta_surface_get_ink_bbox (cairo_meta_surface_t *surface,
|
||||
cairo_box_t *bbox,
|
||||
const cairo_matrix_t *transform)
|
||||
_recording_surface_get_ink_bbox (cairo_recording_surface_t *surface,
|
||||
cairo_box_t *bbox,
|
||||
const cairo_matrix_t *transform)
|
||||
{
|
||||
cairo_surface_t *null_surface;
|
||||
cairo_surface_t *analysis_surface;
|
||||
|
|
@ -1024,7 +1024,7 @@ _meta_surface_get_ink_bbox (cairo_meta_surface_t *surface,
|
|||
if (transform != NULL)
|
||||
_cairo_analysis_surface_set_ctm (analysis_surface, transform);
|
||||
|
||||
status = _cairo_meta_surface_replay (&surface->base, analysis_surface);
|
||||
status = _cairo_recording_surface_replay (&surface->base, analysis_surface);
|
||||
_cairo_analysis_surface_get_bounding_box (analysis_surface, bbox);
|
||||
cairo_surface_destroy (analysis_surface);
|
||||
|
||||
|
|
@ -1032,37 +1032,37 @@ _meta_surface_get_ink_bbox (cairo_meta_surface_t *surface,
|
|||
}
|
||||
|
||||
/**
|
||||
* cairo_meta_surface_ink_extents:
|
||||
* @surface: a #cairo_meta_surface_t
|
||||
* cairo_recording_surface_ink_extents:
|
||||
* @surface: a #cairo_recording_surface_t
|
||||
* @x0: the x-coordinate of the top-left of the ink bounding box
|
||||
* @y0: the y-coordinate of the top-left of the ink bounding box
|
||||
* @width: the width of the ink bounding box
|
||||
* @height: the height of the ink bounding box
|
||||
*
|
||||
* Measures the extents of the operations stored within the meta-surface.
|
||||
* Measures the extents of the operations stored within the recording-surface.
|
||||
* This is useful to compute the required size of an image surface (or
|
||||
* equivalent) into which to replay the full sequence of drawing operations.
|
||||
*
|
||||
* Since: 1.10
|
||||
**/
|
||||
void
|
||||
cairo_meta_surface_ink_extents (cairo_surface_t *surface,
|
||||
double *x0,
|
||||
double *y0,
|
||||
double *width,
|
||||
double *height)
|
||||
cairo_recording_surface_ink_extents (cairo_surface_t *surface,
|
||||
double *x0,
|
||||
double *y0,
|
||||
double *width,
|
||||
double *height)
|
||||
{
|
||||
cairo_status_t status;
|
||||
cairo_box_t bbox;
|
||||
|
||||
memset (&bbox, 0, sizeof (bbox));
|
||||
|
||||
if (! _cairo_surface_is_meta (surface)) {
|
||||
if (! _cairo_surface_is_recording (surface)) {
|
||||
_cairo_error_throw (CAIRO_STATUS_SURFACE_TYPE_MISMATCH);
|
||||
goto DONE;
|
||||
}
|
||||
|
||||
status = _meta_surface_get_ink_bbox ((cairo_meta_surface_t *) surface,
|
||||
status = _recording_surface_get_ink_bbox ((cairo_recording_surface_t *) surface,
|
||||
&bbox,
|
||||
NULL);
|
||||
if (unlikely (status))
|
||||
|
|
@ -1080,9 +1080,9 @@ DONE:
|
|||
}
|
||||
|
||||
cairo_status_t
|
||||
_cairo_meta_surface_get_bbox (cairo_meta_surface_t *surface,
|
||||
cairo_box_t *bbox,
|
||||
const cairo_matrix_t *transform)
|
||||
_cairo_recording_surface_get_bbox (cairo_recording_surface_t *surface,
|
||||
cairo_box_t *bbox,
|
||||
const cairo_matrix_t *transform)
|
||||
{
|
||||
if (! surface->unbounded) {
|
||||
_cairo_box_from_rectangle (bbox, &surface->extents);
|
||||
|
|
@ -1092,5 +1092,5 @@ _cairo_meta_surface_get_bbox (cairo_meta_surface_t *surface,
|
|||
return CAIRO_STATUS_SUCCESS;
|
||||
}
|
||||
|
||||
return _meta_surface_get_ink_bbox (surface, bbox, transform);
|
||||
return _recording_surface_get_ink_bbox (surface, bbox, transform);
|
||||
}
|
||||
|
|
@ -199,8 +199,8 @@ _cairo_scaled_glyph_fini (cairo_scaled_font_t *scaled_font,
|
|||
if (scaled_glyph->path != NULL)
|
||||
_cairo_path_fixed_destroy (scaled_glyph->path);
|
||||
|
||||
if (scaled_glyph->meta_surface != NULL)
|
||||
cairo_surface_destroy (scaled_glyph->meta_surface);
|
||||
if (scaled_glyph->recording_surface != NULL)
|
||||
cairo_surface_destroy (scaled_glyph->recording_surface);
|
||||
}
|
||||
|
||||
#define ZOMBIE 0
|
||||
|
|
@ -2516,13 +2516,13 @@ _cairo_scaled_glyph_set_path (cairo_scaled_glyph_t *scaled_glyph,
|
|||
}
|
||||
|
||||
void
|
||||
_cairo_scaled_glyph_set_meta_surface (cairo_scaled_glyph_t *scaled_glyph,
|
||||
cairo_scaled_font_t *scaled_font,
|
||||
cairo_surface_t *meta_surface)
|
||||
_cairo_scaled_glyph_set_recording_surface (cairo_scaled_glyph_t *scaled_glyph,
|
||||
cairo_scaled_font_t *scaled_font,
|
||||
cairo_surface_t *recording_surface)
|
||||
{
|
||||
if (scaled_glyph->meta_surface != NULL)
|
||||
cairo_surface_destroy (meta_surface);
|
||||
scaled_glyph->meta_surface = meta_surface;
|
||||
if (scaled_glyph->recording_surface != NULL)
|
||||
cairo_surface_destroy (recording_surface);
|
||||
scaled_glyph->recording_surface = recording_surface;
|
||||
}
|
||||
|
||||
static cairo_bool_t
|
||||
|
|
@ -2703,10 +2703,10 @@ _cairo_scaled_glyph_lookup (cairo_scaled_font_t *scaled_font,
|
|||
need_info |= CAIRO_SCALED_GLYPH_INFO_PATH;
|
||||
}
|
||||
|
||||
if ((info & CAIRO_SCALED_GLYPH_INFO_META_SURFACE) != 0 &&
|
||||
scaled_glyph->meta_surface == NULL)
|
||||
if ((info & CAIRO_SCALED_GLYPH_INFO_RECORDING_SURFACE) != 0 &&
|
||||
scaled_glyph->recording_surface == NULL)
|
||||
{
|
||||
need_info |= CAIRO_SCALED_GLYPH_INFO_META_SURFACE;
|
||||
need_info |= CAIRO_SCALED_GLYPH_INFO_RECORDING_SURFACE;
|
||||
}
|
||||
|
||||
if (need_info) {
|
||||
|
|
@ -2718,7 +2718,7 @@ _cairo_scaled_glyph_lookup (cairo_scaled_font_t *scaled_font,
|
|||
|
||||
/* Don't trust the scaled_glyph_init() return value, the font
|
||||
* backend may not even know about some of the info. For example,
|
||||
* no backend other than the user-fonts knows about meta-surface
|
||||
* no backend other than the user-fonts knows about recording-surface
|
||||
* glyph info. */
|
||||
|
||||
if ((info & CAIRO_SCALED_GLYPH_INFO_SURFACE) != 0 &&
|
||||
|
|
@ -2735,8 +2735,8 @@ _cairo_scaled_glyph_lookup (cairo_scaled_font_t *scaled_font,
|
|||
goto CLEANUP;
|
||||
}
|
||||
|
||||
if ((info & CAIRO_SCALED_GLYPH_INFO_META_SURFACE) != 0 &&
|
||||
scaled_glyph->meta_surface == NULL)
|
||||
if ((info & CAIRO_SCALED_GLYPH_INFO_RECORDING_SURFACE) != 0 &&
|
||||
scaled_glyph->recording_surface == NULL)
|
||||
{
|
||||
status = CAIRO_INT_STATUS_UNSUPPORTED;
|
||||
goto CLEANUP;
|
||||
|
|
|
|||
|
|
@ -37,7 +37,7 @@
|
|||
/* The script surface is one that records all operations performed on
|
||||
* it in the form of a procedural script, similar in fashion to
|
||||
* PostScript but using Cairo's imaging model. In essence, this is
|
||||
* equivalent to the meta-surface, but as there is no impedance mismatch
|
||||
* equivalent to the recording-surface, but as there is no impedance mismatch
|
||||
* between Cairo and CairoScript, we can generate output immediately
|
||||
* without having to copy and hold the data in memory.
|
||||
*/
|
||||
|
|
@ -49,7 +49,7 @@
|
|||
#include "cairo-analysis-surface-private.h"
|
||||
#include "cairo-ft-private.h"
|
||||
#include "cairo-list-private.h"
|
||||
#include "cairo-meta-surface-private.h"
|
||||
#include "cairo-recording-surface-private.h"
|
||||
#include "cairo-output-stream-private.h"
|
||||
#include "cairo-scaled-font-private.h"
|
||||
#include "cairo-surface-clipper-private.h"
|
||||
|
|
@ -929,22 +929,22 @@ _emit_radial_pattern (cairo_script_surface_t *surface,
|
|||
}
|
||||
|
||||
static cairo_status_t
|
||||
_emit_meta_surface_pattern (cairo_script_surface_t *surface,
|
||||
const cairo_pattern_t *pattern)
|
||||
_emit_recording_surface_pattern (cairo_script_surface_t *surface,
|
||||
const cairo_pattern_t *pattern)
|
||||
{
|
||||
cairo_script_implicit_context_t old_cr;
|
||||
cairo_surface_pattern_t *surface_pattern;
|
||||
cairo_meta_surface_t *source;
|
||||
cairo_recording_surface_t *source;
|
||||
cairo_script_surface_t *similar;
|
||||
cairo_status_t status;
|
||||
cairo_box_t bbox;
|
||||
cairo_rectangle_int_t rect;
|
||||
|
||||
surface_pattern = (cairo_surface_pattern_t *) pattern;
|
||||
source = (cairo_meta_surface_t *) surface_pattern->surface;
|
||||
source = (cairo_recording_surface_t *) surface_pattern->surface;
|
||||
|
||||
/* first measure the extents */
|
||||
status = _cairo_meta_surface_get_bbox (source, &bbox, NULL);
|
||||
status = _cairo_recording_surface_get_bbox (source, &bbox, NULL);
|
||||
if (unlikely (status))
|
||||
return status;
|
||||
|
||||
|
|
@ -972,7 +972,7 @@ _emit_meta_surface_pattern (cairo_script_surface_t *surface,
|
|||
|
||||
old_cr = surface->cr;
|
||||
_cairo_script_implicit_context_init (&surface->cr);
|
||||
status = _cairo_meta_surface_replay (&source->base, &similar->base);
|
||||
status = _cairo_recording_surface_replay (&source->base, &similar->base);
|
||||
surface->cr = old_cr;
|
||||
|
||||
if (unlikely (status)) {
|
||||
|
|
@ -1346,8 +1346,8 @@ _emit_surface_pattern (cairo_script_surface_t *surface,
|
|||
source = surface_pattern->surface;
|
||||
|
||||
switch ((int) source->type) {
|
||||
case CAIRO_SURFACE_TYPE_META:
|
||||
return _emit_meta_surface_pattern (surface, pattern);
|
||||
case CAIRO_SURFACE_TYPE_RECORDING:
|
||||
return _emit_recording_surface_pattern (surface, pattern);
|
||||
case CAIRO_SURFACE_TYPE_SCRIPT:
|
||||
return _emit_script_surface_pattern (surface, pattern);
|
||||
default:
|
||||
|
|
@ -2655,8 +2655,8 @@ _emit_scaled_glyph_vector (cairo_script_surface_t *surface,
|
|||
|
||||
old_cr = surface->cr;
|
||||
_cairo_script_implicit_context_init (&surface->cr);
|
||||
status = _cairo_meta_surface_replay (scaled_glyph->meta_surface,
|
||||
&surface->base);
|
||||
status = _cairo_recording_surface_replay (scaled_glyph->recording_surface,
|
||||
&surface->base);
|
||||
surface->cr = old_cr;
|
||||
|
||||
_cairo_output_stream_puts (surface->ctx->stream, "} >> set\n");
|
||||
|
|
@ -2763,7 +2763,7 @@ _emit_scaled_glyphs (cairo_script_surface_t *surface,
|
|||
|
||||
status = _cairo_scaled_glyph_lookup (scaled_font,
|
||||
glyphs[n].index,
|
||||
CAIRO_SCALED_GLYPH_INFO_META_SURFACE,
|
||||
CAIRO_SCALED_GLYPH_INFO_RECORDING_SURFACE,
|
||||
&scaled_glyph);
|
||||
if (_cairo_status_is_error (status))
|
||||
break;
|
||||
|
|
@ -3397,8 +3397,8 @@ cairo_script_surface_create_for_target (cairo_script_context_t *context,
|
|||
}
|
||||
|
||||
cairo_status_t
|
||||
cairo_script_from_meta_surface (cairo_script_context_t *context,
|
||||
cairo_surface_t *meta)
|
||||
cairo_script_from_recording_surface (cairo_script_context_t *context,
|
||||
cairo_surface_t *recording_surface)
|
||||
{
|
||||
cairo_box_t bbox;
|
||||
cairo_rectangle_int_t extents;
|
||||
|
|
@ -3408,13 +3408,13 @@ cairo_script_from_meta_surface (cairo_script_context_t *context,
|
|||
if (unlikely (context->status))
|
||||
return context->status;
|
||||
|
||||
if (unlikely (meta->status))
|
||||
return meta->status;
|
||||
if (unlikely (recording_surface->status))
|
||||
return recording_surface->status;
|
||||
|
||||
if (unlikely (! _cairo_surface_is_meta (meta)))
|
||||
if (unlikely (! _cairo_surface_is_recording (recording_surface)))
|
||||
return _cairo_error (CAIRO_STATUS_SURFACE_TYPE_MISMATCH);
|
||||
|
||||
status = _cairo_meta_surface_get_bbox ((cairo_meta_surface_t *) meta,
|
||||
status = _cairo_recording_surface_get_bbox ((cairo_recording_surface_t *) recording_surface,
|
||||
&bbox, NULL);
|
||||
if (unlikely (status))
|
||||
return status;
|
||||
|
|
@ -3422,7 +3422,7 @@ cairo_script_from_meta_surface (cairo_script_context_t *context,
|
|||
_cairo_box_round_to_rectangle (&bbox, &extents);
|
||||
|
||||
surface = &_cairo_script_surface_create_internal (context,
|
||||
meta->content,
|
||||
recording_surface->content,
|
||||
extents.width,
|
||||
extents.height,
|
||||
NULL)->base;
|
||||
|
|
@ -3430,7 +3430,7 @@ cairo_script_from_meta_surface (cairo_script_context_t *context,
|
|||
return surface->status;
|
||||
|
||||
cairo_surface_set_device_offset (surface, -extents.x, -extents.y);
|
||||
status = _cairo_meta_surface_replay (meta, surface);
|
||||
status = _cairo_recording_surface_replay (recording_surface, surface);
|
||||
cairo_surface_destroy (surface);
|
||||
|
||||
return status;
|
||||
|
|
|
|||
|
|
@ -82,8 +82,8 @@ cairo_script_surface_create_for_target (cairo_script_context_t *context,
|
|||
cairo_surface_t *target);
|
||||
|
||||
cairo_public cairo_status_t
|
||||
cairo_script_from_meta_surface (cairo_script_context_t *context,
|
||||
cairo_surface_t *meta);
|
||||
cairo_script_from_recording_surface (cairo_script_context_t *context,
|
||||
cairo_surface_t *recording_surface);
|
||||
|
||||
CAIRO_END_DECLS
|
||||
|
||||
|
|
|
|||
|
|
@ -40,7 +40,7 @@
|
|||
|
||||
#include "cairo-surface-fallback-private.h"
|
||||
#include "cairo-clip-private.h"
|
||||
#include "cairo-meta-surface-private.h"
|
||||
#include "cairo-recording-surface-private.h"
|
||||
#include "cairo-region-private.h"
|
||||
#include "cairo-tee-surface-private.h"
|
||||
|
||||
|
|
@ -1059,8 +1059,8 @@ slim_hidden_def (cairo_surface_mark_dirty_rectangle);
|
|||
*
|
||||
* Private function for setting an extra scale factor to affect all
|
||||
* drawing to a surface. This is used, for example, when replaying a
|
||||
* meta surface to an image fallback intended for an eventual
|
||||
* vector-oriented backend. Since the meta surface will record
|
||||
* recording surface to an image fallback intended for an eventual
|
||||
* vector-oriented backend. Since the recording surface will record
|
||||
* coordinates in one backend space, but the image fallback uses a
|
||||
* different backend space, (differing by the fallback resolution
|
||||
* scale factors), we need a scale factor correction.
|
||||
|
|
@ -1410,17 +1410,17 @@ _cairo_surface_release_dest_image (cairo_surface_t *surface,
|
|||
}
|
||||
|
||||
static cairo_status_t
|
||||
_cairo_meta_surface_clone_similar (cairo_surface_t *surface,
|
||||
cairo_surface_t *src,
|
||||
int src_x,
|
||||
int src_y,
|
||||
int width,
|
||||
int height,
|
||||
int *clone_offset_x,
|
||||
int *clone_offset_y,
|
||||
cairo_surface_t **clone_out)
|
||||
_cairo_recording_surface_clone_similar (cairo_surface_t *surface,
|
||||
cairo_surface_t *src,
|
||||
int src_x,
|
||||
int src_y,
|
||||
int width,
|
||||
int height,
|
||||
int *clone_offset_x,
|
||||
int *clone_offset_y,
|
||||
cairo_surface_t **clone_out)
|
||||
{
|
||||
cairo_meta_surface_t *meta = (cairo_meta_surface_t *) src;
|
||||
cairo_recording_surface_t *recorder = (cairo_recording_surface_t *) src;
|
||||
cairo_surface_t *similar;
|
||||
cairo_status_t status;
|
||||
|
||||
|
|
@ -1434,8 +1434,8 @@ _cairo_meta_surface_clone_similar (cairo_surface_t *surface,
|
|||
return CAIRO_STATUS_SUCCESS;
|
||||
}
|
||||
|
||||
if (meta->unbounded ||
|
||||
width*height*8 < meta->extents.width*meta->extents.height)
|
||||
if (recorder->unbounded ||
|
||||
width*height*8 < recorder->extents.width*recorder->extents.height)
|
||||
{
|
||||
/* XXX use _solid to perform an initial CLEAR? */
|
||||
similar = _cairo_surface_create_similar_scratch (surface,
|
||||
|
|
@ -1448,7 +1448,7 @@ _cairo_meta_surface_clone_similar (cairo_surface_t *surface,
|
|||
|
||||
cairo_surface_set_device_offset (similar, -src_x, -src_y);
|
||||
|
||||
status = _cairo_meta_surface_replay (src, similar);
|
||||
status = _cairo_recording_surface_replay (src, similar);
|
||||
if (unlikely (status)) {
|
||||
cairo_surface_destroy (similar);
|
||||
return status;
|
||||
|
|
@ -1456,14 +1456,14 @@ _cairo_meta_surface_clone_similar (cairo_surface_t *surface,
|
|||
} else {
|
||||
similar = _cairo_surface_create_similar_scratch (surface,
|
||||
src->content,
|
||||
meta->extents.width,
|
||||
meta->extents.height);
|
||||
recorder->extents.width,
|
||||
recorder->extents.height);
|
||||
if (similar == NULL)
|
||||
return CAIRO_INT_STATUS_UNSUPPORTED;
|
||||
if (unlikely (similar->status))
|
||||
return similar->status;
|
||||
|
||||
status = _cairo_meta_surface_replay (src, similar);
|
||||
status = _cairo_recording_surface_replay (src, similar);
|
||||
if (unlikely (status)) {
|
||||
cairo_surface_destroy (similar);
|
||||
return status;
|
||||
|
|
@ -1548,13 +1548,13 @@ _cairo_surface_clone_similar (cairo_surface_t *surface,
|
|||
return CAIRO_INT_STATUS_UNSUPPORTED;
|
||||
|
||||
/* First check to see if we can replay to a similar surface */
|
||||
if (_cairo_surface_is_meta (src)) {
|
||||
return _cairo_meta_surface_clone_similar (surface, src,
|
||||
src_x, src_y,
|
||||
width, height,
|
||||
clone_offset_x,
|
||||
clone_offset_y,
|
||||
clone_out);
|
||||
if (_cairo_surface_is_recording (src)) {
|
||||
return _cairo_recording_surface_clone_similar (surface, src,
|
||||
src_x, src_y,
|
||||
width, height,
|
||||
clone_offset_x,
|
||||
clone_offset_y,
|
||||
clone_out);
|
||||
}
|
||||
|
||||
/* If we failed, try again with an image surface */
|
||||
|
|
@ -1598,7 +1598,7 @@ _cairo_surface_clone_similar (cairo_surface_t *surface,
|
|||
}
|
||||
|
||||
/* XXX: Shouldn't really need to do this here. */
|
||||
#include "cairo-meta-surface-private.h"
|
||||
#include "cairo-recording-surface-private.h"
|
||||
|
||||
/**
|
||||
* _cairo_surface_snapshot
|
||||
|
|
@ -2339,7 +2339,7 @@ slim_hidden_def (cairo_surface_show_page);
|
|||
* possibly be recorded, in other words, it is the maximum extent of
|
||||
* potentially usable coordinates.
|
||||
*
|
||||
* For vector surfaces, (PDF, PS, SVG and meta-surfaces), the surface
|
||||
* For vector surfaces, (PDF, PS, SVG and recording-surfaces), the surface
|
||||
* might be conceived as unbounded, but we force the user to provide a
|
||||
* maximum size at the time of surface_create. So get_extents uses
|
||||
* that size.
|
||||
|
|
|
|||
|
|
@ -44,7 +44,7 @@
|
|||
#include "cairo-svg.h"
|
||||
#include "cairo-analysis-surface-private.h"
|
||||
#include "cairo-image-info-private.h"
|
||||
#include "cairo-meta-surface-private.h"
|
||||
#include "cairo-recording-surface-private.h"
|
||||
#include "cairo-output-stream-private.h"
|
||||
#include "cairo-path-fixed-private.h"
|
||||
#include "cairo-paginated-private.h"
|
||||
|
|
@ -1268,8 +1268,8 @@ _cairo_svg_surface_emit_composite_surface_pattern (cairo_output_stream_t *outp
|
|||
}
|
||||
|
||||
static cairo_status_t
|
||||
_cairo_svg_surface_emit_meta_surface (cairo_svg_document_t *document,
|
||||
cairo_meta_surface_t *source)
|
||||
_cairo_svg_surface_emit_recording_surface (cairo_svg_document_t *document,
|
||||
cairo_recording_surface_t *source)
|
||||
{
|
||||
cairo_status_t status;
|
||||
cairo_surface_t *paginated_surface;
|
||||
|
|
@ -1300,7 +1300,7 @@ _cairo_svg_surface_emit_meta_surface (cairo_svg_document_t *document,
|
|||
-source->extents_pixels.x,
|
||||
-source->extents_pixels.y);
|
||||
|
||||
status = _cairo_meta_surface_replay (&source->base, paginated_surface);
|
||||
status = _cairo_recording_surface_replay (&source->base, paginated_surface);
|
||||
if (unlikely (status)) {
|
||||
cairo_surface_destroy (paginated_surface);
|
||||
return status;
|
||||
|
|
@ -1372,16 +1372,16 @@ _cairo_svg_surface_emit_meta_surface (cairo_svg_document_t *document,
|
|||
}
|
||||
|
||||
static cairo_status_t
|
||||
_cairo_svg_surface_emit_composite_meta_pattern (cairo_output_stream_t *output,
|
||||
cairo_svg_surface_t *surface,
|
||||
cairo_operator_t op,
|
||||
cairo_surface_pattern_t *pattern,
|
||||
int pattern_id,
|
||||
const cairo_matrix_t *parent_matrix,
|
||||
const char *extra_attributes)
|
||||
_cairo_svg_surface_emit_composite_recording_pattern (cairo_output_stream_t *output,
|
||||
cairo_svg_surface_t *surface,
|
||||
cairo_operator_t op,
|
||||
cairo_surface_pattern_t *pattern,
|
||||
int pattern_id,
|
||||
const cairo_matrix_t *parent_matrix,
|
||||
const char *extra_attributes)
|
||||
{
|
||||
cairo_svg_document_t *document = surface->document;
|
||||
cairo_meta_surface_t *meta_surface;
|
||||
cairo_recording_surface_t *recording_surface;
|
||||
cairo_matrix_t p2u;
|
||||
cairo_status_t status;
|
||||
|
||||
|
|
@ -1390,8 +1390,8 @@ _cairo_svg_surface_emit_composite_meta_pattern (cairo_output_stream_t *output,
|
|||
/* cairo_pattern_set_matrix ensures the matrix is invertible */
|
||||
assert (status == CAIRO_STATUS_SUCCESS);
|
||||
|
||||
meta_surface = (cairo_meta_surface_t *) pattern->surface;
|
||||
status = _cairo_svg_surface_emit_meta_surface (document, meta_surface);
|
||||
recording_surface = (cairo_recording_surface_t *) pattern->surface;
|
||||
status = _cairo_svg_surface_emit_recording_surface (document, recording_surface);
|
||||
if (unlikely (status))
|
||||
return status;
|
||||
|
||||
|
|
@ -1401,15 +1401,15 @@ _cairo_svg_surface_emit_composite_meta_pattern (cairo_output_stream_t *output,
|
|||
"patternUnits=\"userSpaceOnUse\" "
|
||||
"width=\"%d\" height=\"%d\"",
|
||||
pattern_id,
|
||||
meta_surface->extents.width,
|
||||
meta_surface->extents.height);
|
||||
recording_surface->extents.width,
|
||||
recording_surface->extents.height);
|
||||
_cairo_svg_surface_emit_transform (output, " patternTransform", &p2u, parent_matrix);
|
||||
_cairo_output_stream_printf (output, ">\n");
|
||||
}
|
||||
|
||||
_cairo_output_stream_printf (output,
|
||||
"<use xlink:href=\"#surface%d\"",
|
||||
meta_surface->base.unique_id);
|
||||
recording_surface->base.unique_id);
|
||||
|
||||
if (pattern_id == invalid_pattern_id) {
|
||||
_cairo_svg_surface_emit_operator (output, surface, op);
|
||||
|
|
@ -1437,12 +1437,12 @@ _cairo_svg_surface_emit_composite_pattern (cairo_output_stream_t *output,
|
|||
const char *extra_attributes)
|
||||
{
|
||||
|
||||
if (_cairo_surface_is_meta (pattern->surface)) {
|
||||
return _cairo_svg_surface_emit_composite_meta_pattern (output, surface,
|
||||
op, pattern,
|
||||
pattern_id,
|
||||
parent_matrix,
|
||||
extra_attributes);
|
||||
if (_cairo_surface_is_recording (pattern->surface)) {
|
||||
return _cairo_svg_surface_emit_composite_recording_pattern (output, surface,
|
||||
op, pattern,
|
||||
pattern_id,
|
||||
parent_matrix,
|
||||
extra_attributes);
|
||||
}
|
||||
|
||||
return _cairo_svg_surface_emit_composite_surface_pattern (output, surface,
|
||||
|
|
|
|||
|
|
@ -159,14 +159,14 @@ _cairo_tee_surface_snapshot (void *abstract_surface)
|
|||
cairo_surface_wrapper_t *slaves;
|
||||
int num_slaves, n;
|
||||
|
||||
/* we prefer to use a meta surface for our snapshots */
|
||||
if (_cairo_surface_is_meta (surface->master.target))
|
||||
/* we prefer to use a recording surface for our snapshots */
|
||||
if (_cairo_surface_is_recording (surface->master.target))
|
||||
return _cairo_surface_wrapper_snapshot (&surface->master);
|
||||
|
||||
num_slaves = _cairo_array_num_elements (&surface->slaves);
|
||||
slaves = _cairo_array_index (&surface->slaves, 0);
|
||||
for (n = 0; n < num_slaves; n++) {
|
||||
if (_cairo_surface_is_meta (slaves[n].target))
|
||||
if (_cairo_surface_is_recording (slaves[n].target))
|
||||
return _cairo_surface_wrapper_snapshot (&slaves[n]);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -40,7 +40,7 @@
|
|||
|
||||
#include "cairo-type3-glyph-surface-private.h"
|
||||
#include "cairo-output-stream-private.h"
|
||||
#include "cairo-meta-surface-private.h"
|
||||
#include "cairo-recording-surface-private.h"
|
||||
#include "cairo-analysis-surface-private.h"
|
||||
#include "cairo-surface-clipper-private.h"
|
||||
|
||||
|
|
@ -438,7 +438,7 @@ _cairo_type3_glyph_surface_analyze_glyph (void *abstract_surface,
|
|||
status = _cairo_scaled_glyph_lookup (surface->scaled_font,
|
||||
glyph_index,
|
||||
CAIRO_SCALED_GLYPH_INFO_METRICS |
|
||||
CAIRO_SCALED_GLYPH_INFO_META_SURFACE,
|
||||
CAIRO_SCALED_GLYPH_INFO_RECORDING_SURFACE,
|
||||
&scaled_glyph);
|
||||
|
||||
if (_cairo_status_is_error (status))
|
||||
|
|
@ -449,8 +449,8 @@ _cairo_type3_glyph_surface_analyze_glyph (void *abstract_surface,
|
|||
goto cleanup;
|
||||
}
|
||||
|
||||
status = _cairo_meta_surface_replay (scaled_glyph->meta_surface,
|
||||
&surface->base);
|
||||
status = _cairo_recording_surface_replay (scaled_glyph->recording_surface,
|
||||
&surface->base);
|
||||
if (unlikely (status))
|
||||
goto cleanup;
|
||||
|
||||
|
|
@ -493,7 +493,7 @@ _cairo_type3_glyph_surface_emit_glyph (void *abstract_surface,
|
|||
status = _cairo_scaled_glyph_lookup (surface->scaled_font,
|
||||
glyph_index,
|
||||
CAIRO_SCALED_GLYPH_INFO_METRICS |
|
||||
CAIRO_SCALED_GLYPH_INFO_META_SURFACE,
|
||||
CAIRO_SCALED_GLYPH_INFO_RECORDING_SURFACE,
|
||||
&scaled_glyph);
|
||||
if (status == CAIRO_INT_STATUS_UNSUPPORTED) {
|
||||
status = _cairo_scaled_glyph_lookup (surface->scaled_font,
|
||||
|
|
@ -544,8 +544,8 @@ _cairo_type3_glyph_surface_emit_glyph (void *abstract_surface,
|
|||
_cairo_type3_glyph_surface_set_stream (surface, mem_stream);
|
||||
|
||||
_cairo_output_stream_printf (surface->stream, "q\n");
|
||||
status = _cairo_meta_surface_replay (scaled_glyph->meta_surface,
|
||||
&surface->base);
|
||||
status = _cairo_recording_surface_replay (scaled_glyph->recording_surface,
|
||||
&surface->base);
|
||||
|
||||
status2 = _cairo_pdf_operators_flush (&surface->pdf_operators);
|
||||
if (status == CAIRO_STATUS_SUCCESS)
|
||||
|
|
|
|||
|
|
@ -158,7 +158,7 @@ typedef enum _cairo_int_status {
|
|||
CAIRO_INT_STATUS_NOTHING_TO_DO,
|
||||
CAIRO_INT_STATUS_FLATTEN_TRANSPARENCY,
|
||||
CAIRO_INT_STATUS_IMAGE_FALLBACK,
|
||||
CAIRO_INT_STATUS_ANALYZE_META_SURFACE_PATTERN,
|
||||
CAIRO_INT_STATUS_ANALYZE_RECORDING_SURFACE_PATTERN,
|
||||
|
||||
CAIRO_INT_STATUS_LAST_STATUS
|
||||
} cairo_int_status_t;
|
||||
|
|
|
|||
|
|
@ -36,7 +36,7 @@
|
|||
|
||||
#include "cairoint.h"
|
||||
#include "cairo-user-font-private.h"
|
||||
#include "cairo-meta-surface-private.h"
|
||||
#include "cairo-recording-surface-private.h"
|
||||
#include "cairo-analysis-surface-private.h"
|
||||
|
||||
typedef struct _cairo_user_scaled_font_methods {
|
||||
|
|
@ -75,19 +75,19 @@ typedef struct _cairo_user_scaled_font {
|
|||
/* #cairo_user_scaled_font_t */
|
||||
|
||||
static cairo_t *
|
||||
_cairo_user_scaled_font_create_meta_context (cairo_user_scaled_font_t *scaled_font)
|
||||
_cairo_user_scaled_font_create_recording_context (cairo_user_scaled_font_t *scaled_font)
|
||||
{
|
||||
cairo_content_t content;
|
||||
cairo_surface_t *meta_surface;
|
||||
cairo_surface_t *recording_surface;
|
||||
cairo_t *cr;
|
||||
|
||||
content = scaled_font->base.options.antialias == CAIRO_ANTIALIAS_SUBPIXEL ?
|
||||
CAIRO_CONTENT_COLOR_ALPHA :
|
||||
CAIRO_CONTENT_ALPHA;
|
||||
|
||||
meta_surface = cairo_meta_surface_create (content, NULL);
|
||||
cr = cairo_create (meta_surface);
|
||||
cairo_surface_destroy (meta_surface);
|
||||
recording_surface = cairo_recording_surface_create (content, NULL);
|
||||
cr = cairo_create (recording_surface);
|
||||
cairo_surface_destroy (recording_surface);
|
||||
|
||||
cairo_set_matrix (cr, &scaled_font->base.scale);
|
||||
cairo_set_font_size (cr, 1.0);
|
||||
|
|
@ -104,15 +104,15 @@ _cairo_user_scaled_glyph_init (void *abstract_font,
|
|||
{
|
||||
cairo_int_status_t status = CAIRO_STATUS_SUCCESS;
|
||||
cairo_user_scaled_font_t *scaled_font = abstract_font;
|
||||
cairo_surface_t *meta_surface = scaled_glyph->meta_surface;
|
||||
cairo_surface_t *recording_surface = scaled_glyph->recording_surface;
|
||||
|
||||
if (!scaled_glyph->meta_surface) {
|
||||
if (!scaled_glyph->recording_surface) {
|
||||
cairo_user_font_face_t *face =
|
||||
(cairo_user_font_face_t *) scaled_font->base.font_face;
|
||||
cairo_text_extents_t extents = scaled_font->default_glyph_extents;
|
||||
cairo_t *cr;
|
||||
|
||||
cr = _cairo_user_scaled_font_create_meta_context (scaled_font);
|
||||
cr = _cairo_user_scaled_font_create_recording_context (scaled_font);
|
||||
|
||||
if (face->scaled_font_methods.render_glyph) {
|
||||
status = face->scaled_font_methods.render_glyph ((cairo_scaled_font_t *)scaled_font,
|
||||
|
|
@ -124,18 +124,18 @@ _cairo_user_scaled_glyph_init (void *abstract_font,
|
|||
if (status == CAIRO_STATUS_SUCCESS)
|
||||
status = cairo_status (cr);
|
||||
|
||||
meta_surface = cairo_surface_reference (cairo_get_target (cr));
|
||||
recording_surface = cairo_surface_reference (cairo_get_target (cr));
|
||||
|
||||
cairo_destroy (cr);
|
||||
|
||||
if (unlikely (status)) {
|
||||
cairo_surface_destroy (meta_surface);
|
||||
cairo_surface_destroy (recording_surface);
|
||||
return status;
|
||||
}
|
||||
|
||||
_cairo_scaled_glyph_set_meta_surface (scaled_glyph,
|
||||
&scaled_font->base,
|
||||
meta_surface);
|
||||
_cairo_scaled_glyph_set_recording_surface (scaled_glyph,
|
||||
&scaled_font->base,
|
||||
recording_surface);
|
||||
|
||||
|
||||
/* set metrics */
|
||||
|
|
@ -145,12 +145,12 @@ _cairo_user_scaled_glyph_init (void *abstract_font,
|
|||
double x1, y1, x2, y2;
|
||||
double x_scale, y_scale;
|
||||
|
||||
/* Compute extents.x/y/width/height from meta_surface,
|
||||
/* Compute extents.x/y/width/height from recording_surface,
|
||||
* in font space.
|
||||
*/
|
||||
status = _cairo_meta_surface_get_bbox ((cairo_meta_surface_t *) meta_surface,
|
||||
&bbox,
|
||||
&scaled_font->extent_scale);
|
||||
status = _cairo_recording_surface_get_bbox ((cairo_recording_surface_t *) recording_surface,
|
||||
&bbox,
|
||||
&scaled_font->extent_scale);
|
||||
if (unlikely (status))
|
||||
return status;
|
||||
|
||||
|
|
@ -202,7 +202,7 @@ _cairo_user_scaled_glyph_init (void *abstract_font,
|
|||
cairo_surface_set_device_offset (surface,
|
||||
- _cairo_fixed_integer_floor (scaled_glyph->bbox.p1.x),
|
||||
- _cairo_fixed_integer_floor (scaled_glyph->bbox.p1.y));
|
||||
status = _cairo_meta_surface_replay (meta_surface, surface);
|
||||
status = _cairo_recording_surface_replay (recording_surface, surface);
|
||||
|
||||
if (unlikely (status)) {
|
||||
cairo_surface_destroy(surface);
|
||||
|
|
@ -219,7 +219,7 @@ _cairo_user_scaled_glyph_init (void *abstract_font,
|
|||
if (!path)
|
||||
return _cairo_error (CAIRO_STATUS_NO_MEMORY);
|
||||
|
||||
status = _cairo_meta_surface_get_path (meta_surface, path);
|
||||
status = _cairo_recording_surface_get_path (recording_surface, path);
|
||||
if (unlikely (status)) {
|
||||
_cairo_path_fixed_destroy (path);
|
||||
return status;
|
||||
|
|
@ -421,7 +421,7 @@ _cairo_user_font_face_scaled_font_create (void *abstract_
|
|||
if (status == CAIRO_STATUS_SUCCESS) {
|
||||
cairo_t *cr;
|
||||
|
||||
cr = _cairo_user_scaled_font_create_meta_context (user_scaled_font);
|
||||
cr = _cairo_user_scaled_font_create_recording_context (user_scaled_font);
|
||||
|
||||
status = font_face->scaled_font_methods.init (&user_scaled_font->base,
|
||||
cr,
|
||||
|
|
|
|||
|
|
@ -39,7 +39,7 @@
|
|||
#include "cairo-vg.h"
|
||||
|
||||
#include "cairo-path-fixed-private.h"
|
||||
#include "cairo-meta-surface-private.h"
|
||||
#include "cairo-recording-surface-private.h"
|
||||
#include "cairo-surface-clipper-private.h"
|
||||
#include "cairo-cache-private.h"
|
||||
|
||||
|
|
@ -840,7 +840,7 @@ _vg_setup_solid_source (cairo_vg_context_t *context,
|
|||
}
|
||||
|
||||
static cairo_vg_surface_t *
|
||||
_vg_clone_meta_surface (cairo_vg_context_t *context,
|
||||
_vg_clone_recording_surface (cairo_vg_context_t *context,
|
||||
cairo_surface_t *surface)
|
||||
{
|
||||
VGImage vg_image;
|
||||
|
|
@ -870,7 +870,7 @@ _vg_clone_meta_surface (cairo_vg_context_t *context,
|
|||
extents.width, extents.height);
|
||||
cairo_surface_set_device_offset (&clone->base, -extents.x, -extents.y);
|
||||
|
||||
status = _cairo_meta_surface_replay (surface, &clone->base);
|
||||
status = _cairo_recording_surface_replay (surface, &clone->base);
|
||||
if (unlikely (status)) {
|
||||
cairo_surface_destroy (&clone->base);
|
||||
return (cairo_vg_surface_t *) _cairo_surface_create_in_error (status);
|
||||
|
|
@ -965,8 +965,8 @@ _vg_setup_surface_source (cairo_vg_context_t *context,
|
|||
goto DONE;
|
||||
}
|
||||
|
||||
if (_cairo_surface_is_meta (spat->surface))
|
||||
clone = _vg_clone_meta_surface (context, spat->surface);
|
||||
if (_cairo_surface_is_recording (spat->surface))
|
||||
clone = _vg_clone_recording_surface (context, spat->surface);
|
||||
else
|
||||
clone = _vg_clone_image_surface (context, spat->surface);
|
||||
if (clone == NULL)
|
||||
|
|
|
|||
|
|
@ -50,7 +50,7 @@
|
|||
|
||||
#include "cairo-clip-private.h"
|
||||
#include "cairo-win32-private.h"
|
||||
#include "cairo-meta-surface-private.h"
|
||||
#include "cairo-recording-surface-private.h"
|
||||
#include "cairo-scaled-font-subsets-private.h"
|
||||
#include "cairo-image-info-private.h"
|
||||
#include "cairo-surface-clipper-private.h"
|
||||
|
|
@ -195,7 +195,7 @@ analyze_surface_pattern_transparency (cairo_surface_pattern_t *pattern)
|
|||
static cairo_bool_t
|
||||
surface_pattern_supported (const cairo_surface_pattern_t *pattern)
|
||||
{
|
||||
if (_cairo_surface_is_meta (pattern->surface))
|
||||
if (_cairo_surface_is_recording (pattern->surface))
|
||||
return TRUE;
|
||||
|
||||
if (cairo_surface_get_type (pattern->surface) != CAIRO_SURFACE_TYPE_WIN32 &&
|
||||
|
|
@ -238,8 +238,8 @@ _cairo_win32_printing_surface_analyze_operation (cairo_win32_surface_t *surface,
|
|||
if (pattern->type == CAIRO_PATTERN_TYPE_SURFACE) {
|
||||
cairo_surface_pattern_t *surface_pattern = (cairo_surface_pattern_t *) pattern;
|
||||
|
||||
if ( _cairo_surface_is_meta (surface_pattern->surface))
|
||||
return CAIRO_INT_STATUS_ANALYZE_META_SURFACE_PATTERN;
|
||||
if ( _cairo_surface_is_recording (surface_pattern->surface))
|
||||
return CAIRO_INT_STATUS_ANALYZE_RECORDING_SURFACE_PATTERN;
|
||||
}
|
||||
|
||||
if (op == CAIRO_OPERATOR_SOURCE ||
|
||||
|
|
@ -384,20 +384,20 @@ _cairo_win32_printing_surface_paint_solid_pattern (cairo_win32_surface_t *surfac
|
|||
}
|
||||
|
||||
static cairo_status_t
|
||||
_cairo_win32_printing_surface_paint_meta_pattern (cairo_win32_surface_t *surface,
|
||||
cairo_surface_pattern_t *pattern)
|
||||
_cairo_win32_printing_surface_paint_recording_pattern (cairo_win32_surface_t *surface,
|
||||
cairo_surface_pattern_t *pattern)
|
||||
{
|
||||
cairo_content_t old_content;
|
||||
cairo_matrix_t old_ctm;
|
||||
cairo_bool_t old_has_ctm;
|
||||
cairo_rectangle_int_t meta_extents;
|
||||
cairo_rectangle_int_t recording_extents;
|
||||
cairo_status_t status;
|
||||
cairo_extend_t extend;
|
||||
cairo_matrix_t p2d;
|
||||
XFORM xform;
|
||||
int x_tile, y_tile, left, right, top, bottom;
|
||||
RECT clip;
|
||||
cairo_meta_surface_t *meta_surface = (cairo_meta_surface_t *) pattern->surface;
|
||||
cairo_recording_surface_t *recording_surface = (cairo_recording_surface_t *) pattern->surface;
|
||||
cairo_box_t bbox;
|
||||
|
||||
extend = cairo_pattern_get_extend (&pattern->base);
|
||||
|
|
@ -414,11 +414,11 @@ _cairo_win32_printing_surface_paint_meta_pattern (cairo_win32_surface_t *surfa
|
|||
SaveDC (surface->dc);
|
||||
_cairo_matrix_to_win32_xform (&p2d, &xform);
|
||||
|
||||
status = _cairo_meta_surface_get_bbox (meta_surface, &bbox, NULL);
|
||||
status = _cairo_recording_surface_get_bbox (recording_surface, &bbox, NULL);
|
||||
if (status)
|
||||
return status;
|
||||
|
||||
_cairo_box_round_to_rectangle (&bbox, &meta_extents);
|
||||
_cairo_box_round_to_rectangle (&bbox, &recording_extents);
|
||||
|
||||
status = _cairo_win32_printing_surface_get_ctm_clip_box (surface, &clip);
|
||||
if (status)
|
||||
|
|
@ -437,7 +437,7 @@ _cairo_win32_printing_surface_paint_meta_pattern (cairo_win32_surface_t *surfa
|
|||
}
|
||||
|
||||
old_content = surface->content;
|
||||
if (meta_surface->base.content == CAIRO_CONTENT_COLOR) {
|
||||
if (recording_surface->base.content == CAIRO_CONTENT_COLOR) {
|
||||
cairo_pattern_t *source;
|
||||
cairo_solid_pattern_t black;
|
||||
|
||||
|
|
@ -457,15 +457,15 @@ _cairo_win32_printing_surface_paint_meta_pattern (cairo_win32_surface_t *surfa
|
|||
SaveDC (surface->dc);
|
||||
m = p2d;
|
||||
cairo_matrix_translate (&m,
|
||||
x_tile*meta_extents.width,
|
||||
y_tile*meta_extents.height);
|
||||
x_tile*recording_extents.width,
|
||||
y_tile*recording_extents.height);
|
||||
if (extend == CAIRO_EXTEND_REFLECT) {
|
||||
if (x_tile % 2) {
|
||||
cairo_matrix_translate (&m, meta_extents.width, 0);
|
||||
cairo_matrix_translate (&m, recording_extents.width, 0);
|
||||
cairo_matrix_scale (&m, -1, 1);
|
||||
}
|
||||
if (y_tile % 2) {
|
||||
cairo_matrix_translate (&m, 0, meta_extents.height);
|
||||
cairo_matrix_translate (&m, 0, recording_extents.height);
|
||||
cairo_matrix_scale (&m, 1, -1);
|
||||
}
|
||||
}
|
||||
|
|
@ -480,18 +480,18 @@ _cairo_win32_printing_surface_paint_meta_pattern (cairo_win32_surface_t *surfa
|
|||
cairo_matrix_transform_point (&surface->ctm, &x, &y);
|
||||
MoveToEx (surface->dc, (int) x, (int) y, NULL);
|
||||
|
||||
x = meta_extents.width;
|
||||
x = recording_extents.width;
|
||||
y = 0;
|
||||
cairo_matrix_transform_point (&surface->ctm, &x, &y);
|
||||
LineTo (surface->dc, (int) x, (int) y);
|
||||
|
||||
x = meta_extents.width;
|
||||
y = meta_extents.height;
|
||||
x = recording_extents.width;
|
||||
y = recording_extents.height;
|
||||
cairo_matrix_transform_point (&surface->ctm, &x, &y);
|
||||
LineTo (surface->dc, (int) x, (int) y);
|
||||
|
||||
x = 0;
|
||||
y = meta_extents.height;
|
||||
y = recording_extents.height;
|
||||
cairo_matrix_transform_point (&surface->ctm, &x, &y);
|
||||
LineTo (surface->dc, (int) x, (int) y);
|
||||
|
||||
|
|
@ -500,9 +500,9 @@ _cairo_win32_printing_surface_paint_meta_pattern (cairo_win32_surface_t *surfa
|
|||
SelectClipPath (surface->dc, RGN_AND);
|
||||
|
||||
SaveDC (surface->dc); /* Allow clip path to be reset during replay */
|
||||
status = _cairo_meta_surface_replay_region (&meta_surface->base,
|
||||
&surface->base,
|
||||
CAIRO_META_REGION_NATIVE);
|
||||
status = _cairo_recording_surface_replay_region (&recording_surface->base,
|
||||
&surface->base,
|
||||
CAIRO_RECORDING_REGION_NATIVE);
|
||||
assert (status != CAIRO_INT_STATUS_UNSUPPORTED);
|
||||
/* Restore both the clip save and our earlier path SaveDC */
|
||||
RestoreDC (surface->dc, -2);
|
||||
|
|
@ -781,9 +781,9 @@ static cairo_status_t
|
|||
_cairo_win32_printing_surface_paint_surface_pattern (cairo_win32_surface_t *surface,
|
||||
cairo_surface_pattern_t *pattern)
|
||||
{
|
||||
if (_cairo_surface_is_meta (pattern->surface)) {
|
||||
return _cairo_win32_printing_surface_paint_meta_pattern (surface,
|
||||
pattern);
|
||||
if (_cairo_surface_is_recording (pattern->surface)) {
|
||||
return _cairo_win32_printing_surface_paint_recording_pattern (surface,
|
||||
pattern);
|
||||
} else {
|
||||
return _cairo_win32_printing_surface_paint_image_pattern (surface,
|
||||
pattern);
|
||||
|
|
@ -1634,7 +1634,7 @@ _cairo_win32_printing_surface_create_similar (void *abstract_surface,
|
|||
extents.x = extents.y = 0;
|
||||
extents.width = width;
|
||||
extents.height = height;
|
||||
return cairo_meta_surface_create (content, &extents);
|
||||
return cairo_recording_surface_create (content, &extents);
|
||||
}
|
||||
|
||||
static cairo_int_status_t
|
||||
|
|
@ -1650,16 +1650,16 @@ _cairo_win32_printing_surface_start_page (void *abstract_surface)
|
|||
|
||||
/* As the logical coordinates used by GDI functions (eg LineTo)
|
||||
* are integers we need to do some additional work to prevent
|
||||
* rounding errors. For example the obvious way to paint a meta
|
||||
* rounding errors. For example the obvious way to paint a recording
|
||||
* pattern is to:
|
||||
*
|
||||
* SaveDC()
|
||||
* transform the device context DC by the pattern to device matrix
|
||||
* replay the meta surface
|
||||
* replay the recording surface
|
||||
* RestoreDC()
|
||||
*
|
||||
* The problem here is that if the pattern to device matrix is
|
||||
* [100 0 0 100 0 0], coordinates in the meta pattern such as
|
||||
* [100 0 0 100 0 0], coordinates in the recording pattern such as
|
||||
* (1.56, 2.23) which correspond to (156, 223) in device space
|
||||
* will be rounded to (100, 200) due to (1.56, 2.23) being
|
||||
* truncated to integers.
|
||||
|
|
@ -1667,7 +1667,7 @@ _cairo_win32_printing_surface_start_page (void *abstract_surface)
|
|||
* This is solved by saving the current GDI CTM in surface->ctm,
|
||||
* switch the GDI CTM to identity, and transforming all
|
||||
* coordinates by surface->ctm before passing them to GDI. When
|
||||
* painting a meta pattern, surface->ctm is transformed by the
|
||||
* painting a recording pattern, surface->ctm is transformed by the
|
||||
* pattern to device matrix.
|
||||
*
|
||||
* For printing device contexts where 1 unit is 1 dpi, switching
|
||||
|
|
|
|||
|
|
@ -46,7 +46,7 @@
|
|||
|
||||
#include "cairo-clip-private.h"
|
||||
#include "cairo-output-stream-private.h"
|
||||
#include "cairo-meta-surface-private.h"
|
||||
#include "cairo-recording-surface-private.h"
|
||||
|
||||
#define static cairo_warn static
|
||||
|
||||
|
|
@ -69,7 +69,7 @@ struct _cairo_xml_surface {
|
|||
double width, height;
|
||||
};
|
||||
|
||||
slim_hidden_proto (cairo_xml_for_meta_surface);
|
||||
slim_hidden_proto (cairo_xml_for_recording_surface);
|
||||
|
||||
static const cairo_xml_t _nil_xml = {
|
||||
CAIRO_STATUS_NO_MEMORY,
|
||||
|
|
@ -348,7 +348,7 @@ _cairo_xml_surface_create_similar (void *abstract_surface,
|
|||
extents.width = width;
|
||||
extents.height = height;
|
||||
|
||||
return cairo_meta_surface_create (content, &extents);
|
||||
return cairo_recording_surface_create (content, &extents);
|
||||
}
|
||||
|
||||
static cairo_status_t
|
||||
|
|
@ -623,8 +623,8 @@ _cairo_xml_emit_surface (cairo_xml_t *xml,
|
|||
cairo_surface_t *source = pattern->surface;
|
||||
cairo_status_t status;
|
||||
|
||||
if (_cairo_surface_is_meta (source)) {
|
||||
status = cairo_xml_for_meta_surface (xml, source);
|
||||
if (_cairo_surface_is_recording (source)) {
|
||||
status = cairo_xml_for_recording_surface (xml, source);
|
||||
} else {
|
||||
cairo_image_surface_t *image;
|
||||
void *image_extra;
|
||||
|
|
@ -1094,8 +1094,8 @@ cairo_xml_surface_create (cairo_xml_t *xml,
|
|||
}
|
||||
|
||||
cairo_status_t
|
||||
cairo_xml_for_meta_surface (cairo_xml_t *xml,
|
||||
cairo_surface_t *meta)
|
||||
cairo_xml_for_recording_surface (cairo_xml_t *xml,
|
||||
cairo_surface_t *recording_surface)
|
||||
{
|
||||
cairo_box_t bbox;
|
||||
cairo_rectangle_int_t extents;
|
||||
|
|
@ -1105,20 +1105,20 @@ cairo_xml_for_meta_surface (cairo_xml_t *xml,
|
|||
if (unlikely (xml->status))
|
||||
return xml->status;
|
||||
|
||||
if (unlikely (meta->status))
|
||||
return meta->status;
|
||||
if (unlikely (recording_surface->status))
|
||||
return recording_surface->status;
|
||||
|
||||
if (unlikely (! _cairo_surface_is_meta (meta)))
|
||||
if (unlikely (! _cairo_surface_is_recording (recording_surface)))
|
||||
return _cairo_error (CAIRO_STATUS_SURFACE_TYPE_MISMATCH);
|
||||
|
||||
status = _cairo_meta_surface_get_bbox ((cairo_meta_surface_t *) meta,
|
||||
&bbox, NULL);
|
||||
status = _cairo_recording_surface_get_bbox ((cairo_recording_surface_t *) recording_surface,
|
||||
&bbox, NULL);
|
||||
if (unlikely (status))
|
||||
return status;
|
||||
|
||||
_cairo_box_round_to_rectangle (&bbox, &extents);
|
||||
surface = _cairo_xml_surface_create_internal (xml,
|
||||
meta->content,
|
||||
recording_surface->content,
|
||||
extents.width,
|
||||
extents.height);
|
||||
if (unlikely (surface->status))
|
||||
|
|
@ -1126,12 +1126,12 @@ cairo_xml_for_meta_surface (cairo_xml_t *xml,
|
|||
|
||||
_cairo_xml_printf (xml,
|
||||
"<surface content='%s' width='%d' height='%d'>",
|
||||
_content_to_string (meta->content),
|
||||
_content_to_string (recording_surface->content),
|
||||
extents.width, extents.height);
|
||||
_cairo_xml_indent (xml, 2);
|
||||
|
||||
cairo_surface_set_device_offset (surface, -extents.x, -extents.y);
|
||||
status = _cairo_meta_surface_replay (meta, surface);
|
||||
status = _cairo_recording_surface_replay (recording_surface, surface);
|
||||
cairo_surface_destroy (surface);
|
||||
|
||||
_cairo_xml_indent (xml, -2);
|
||||
|
|
@ -1139,7 +1139,7 @@ cairo_xml_for_meta_surface (cairo_xml_t *xml,
|
|||
|
||||
return status;
|
||||
}
|
||||
slim_hidden_def (cairo_xml_for_meta_surface);
|
||||
slim_hidden_def (cairo_xml_for_recording_surface);
|
||||
|
||||
void
|
||||
cairo_xml_destroy (cairo_xml_t *xml)
|
||||
|
|
|
|||
|
|
@ -60,8 +60,8 @@ cairo_xml_surface_create (cairo_xml_t *xml,
|
|||
double width, double height);
|
||||
|
||||
cairo_public cairo_status_t
|
||||
cairo_xml_for_meta_surface (cairo_xml_t *context,
|
||||
cairo_surface_t *meta);
|
||||
cairo_xml_for_recording_surface (cairo_xml_t *context,
|
||||
cairo_surface_t *surface);
|
||||
|
||||
CAIRO_END_DECLS
|
||||
|
||||
|
|
|
|||
|
|
@ -1933,7 +1933,7 @@ cairo_stroke_to_path (cairo_t *cr)
|
|||
if (unlikely (cr->status))
|
||||
return;
|
||||
|
||||
/* The code in _cairo_meta_surface_get_path has a poorman's stroke_to_path */
|
||||
/* The code in _cairo_recording_surface_get_path has a poorman's stroke_to_path */
|
||||
|
||||
status = _cairo_gstate_stroke_path (cr->gstate);
|
||||
if (unlikely (status))
|
||||
|
|
|
|||
20
src/cairo.h
|
|
@ -1953,7 +1953,7 @@ cairo_surface_status (cairo_surface_t *surface);
|
|||
* @CAIRO_SURFACE_TYPE_QUARTZ_IMAGE: The surface is of type quartz_image
|
||||
* @CAIRO_SURFACE_TYPE_SCRIPT: The surface is of type script, since 1.10
|
||||
* @CAIRO_SURFACE_TYPE_QT: The surface is of type Qt, since 1.10
|
||||
* @CAIRO_SURFACE_TYPE_META: The surface is a meta-type, since 1.10
|
||||
* @CAIRO_SURFACE_TYPE_RECORDING: The surface is of type recording, since 1.10
|
||||
* @CAIRO_SURFACE_TYPE_VG: The surface is a OpenVG surface, since 1.10
|
||||
* @CAIRO_SURFACE_TYPE_GL: The surface is of type OpenGL, since 1.10
|
||||
* @CAIRO_SURFACE_TYPE_DRM: The surface is of type Direct Render Manager, since 1.10
|
||||
|
|
@ -2001,7 +2001,7 @@ typedef enum _cairo_surface_type {
|
|||
CAIRO_SURFACE_TYPE_QUARTZ_IMAGE,
|
||||
CAIRO_SURFACE_TYPE_SCRIPT,
|
||||
CAIRO_SURFACE_TYPE_QT,
|
||||
CAIRO_SURFACE_TYPE_META,
|
||||
CAIRO_SURFACE_TYPE_RECORDING,
|
||||
CAIRO_SURFACE_TYPE_VG,
|
||||
CAIRO_SURFACE_TYPE_GL,
|
||||
CAIRO_SURFACE_TYPE_DRM,
|
||||
|
|
@ -2185,18 +2185,18 @@ cairo_image_surface_create_from_png_stream (cairo_read_func_t read_func,
|
|||
|
||||
#endif
|
||||
|
||||
/* Meta-surface functions */
|
||||
/* Recording-surface functions */
|
||||
|
||||
cairo_public cairo_surface_t *
|
||||
cairo_meta_surface_create (cairo_content_t content,
|
||||
const cairo_rectangle_t *extents);
|
||||
cairo_recording_surface_create (cairo_content_t content,
|
||||
const cairo_rectangle_t *extents);
|
||||
|
||||
cairo_public void
|
||||
cairo_meta_surface_ink_extents (cairo_surface_t *surface,
|
||||
double *x0,
|
||||
double *y0,
|
||||
double *width,
|
||||
double *height);
|
||||
cairo_recording_surface_ink_extents (cairo_surface_t *surface,
|
||||
double *x0,
|
||||
double *y0,
|
||||
double *width,
|
||||
double *height);
|
||||
|
||||
/* Tee-surface functions */
|
||||
|
||||
|
|
|
|||
|
|
@ -392,7 +392,7 @@ typedef struct _cairo_scaled_glyph {
|
|||
|
||||
cairo_image_surface_t *surface; /* device-space image */
|
||||
cairo_path_fixed_t *path; /* device-space outline */
|
||||
cairo_surface_t *meta_surface; /* device-space meta-surface */
|
||||
cairo_surface_t *recording_surface; /* device-space recording-surface */
|
||||
|
||||
void *surface_private; /* for the surface backend */
|
||||
} cairo_scaled_glyph_t;
|
||||
|
|
@ -441,7 +441,7 @@ typedef enum _cairo_scaled_glyph_info {
|
|||
CAIRO_SCALED_GLYPH_INFO_METRICS = (1 << 0),
|
||||
CAIRO_SCALED_GLYPH_INFO_SURFACE = (1 << 1),
|
||||
CAIRO_SCALED_GLYPH_INFO_PATH = (1 << 2),
|
||||
CAIRO_SCALED_GLYPH_INFO_META_SURFACE = (1 << 3)
|
||||
CAIRO_SCALED_GLYPH_INFO_RECORDING_SURFACE = (1 << 3)
|
||||
} cairo_scaled_glyph_info_t;
|
||||
|
||||
typedef struct _cairo_scaled_font_subset {
|
||||
|
|
@ -1700,9 +1700,9 @@ _cairo_scaled_glyph_set_path (cairo_scaled_glyph_t *scaled_glyph,
|
|||
cairo_path_fixed_t *path);
|
||||
|
||||
cairo_private void
|
||||
_cairo_scaled_glyph_set_meta_surface (cairo_scaled_glyph_t *scaled_glyph,
|
||||
cairo_scaled_font_t *scaled_font,
|
||||
cairo_surface_t *meta_surface);
|
||||
_cairo_scaled_glyph_set_recording_surface (cairo_scaled_glyph_t *scaled_glyph,
|
||||
cairo_scaled_font_t *scaled_font,
|
||||
cairo_surface_t *recording_surface);
|
||||
|
||||
cairo_private cairo_int_status_t
|
||||
_cairo_scaled_glyph_lookup (cairo_scaled_font_t *scaled_font,
|
||||
|
|
@ -2210,7 +2210,7 @@ cairo_private cairo_bool_t
|
|||
_cairo_surface_is_image (const cairo_surface_t *surface) cairo_pure;
|
||||
|
||||
cairo_private cairo_bool_t
|
||||
_cairo_surface_is_meta (const cairo_surface_t *surface) cairo_pure;
|
||||
_cairo_surface_is_recording (const cairo_surface_t *surface) cairo_pure;
|
||||
|
||||
/* cairo-pen.c */
|
||||
cairo_private cairo_status_t
|
||||
|
|
|
|||
|
|
@ -634,19 +634,19 @@ REFERENCE_IMAGES = \
|
|||
mask.svg.rgb24.xfail.png \
|
||||
mask.xlib.ref.png \
|
||||
mask.xlib.rgb24.ref.png \
|
||||
meta-surface-pattern.gl.argb32.ref.png \
|
||||
meta-surface-pattern.pdf.argb32.ref.png \
|
||||
meta-surface-pattern.pdf.rgb24.ref.png \
|
||||
meta-surface-pattern.ps2.argb32.ref.png \
|
||||
meta-surface-pattern.ps2.rgb24.ref.png \
|
||||
meta-surface-pattern.ps3.argb32.ref.png \
|
||||
meta-surface-pattern.ps3.rgb24.ref.png \
|
||||
meta-surface-pattern.quartz.ref.png \
|
||||
meta-surface-pattern.quartz.rgb24.ref.png \
|
||||
meta-surface-pattern.ref.png \
|
||||
meta-surface-pattern.rgb24.ref.png \
|
||||
meta-surface-pattern.svg.argb32.ref.png \
|
||||
meta-surface-pattern.svg.rgb24.ref.png \
|
||||
recording-surface-pattern.gl.argb32.ref.png \
|
||||
recording-surface-pattern.pdf.argb32.ref.png \
|
||||
recording-surface-pattern.pdf.rgb24.ref.png \
|
||||
recording-surface-pattern.ps2.argb32.ref.png \
|
||||
recording-surface-pattern.ps2.rgb24.ref.png \
|
||||
recording-surface-pattern.ps3.argb32.ref.png \
|
||||
recording-surface-pattern.ps3.rgb24.ref.png \
|
||||
recording-surface-pattern.quartz.ref.png \
|
||||
recording-surface-pattern.quartz.rgb24.ref.png \
|
||||
recording-surface-pattern.ref.png \
|
||||
recording-surface-pattern.rgb24.ref.png \
|
||||
recording-surface-pattern.svg.argb32.ref.png \
|
||||
recording-surface-pattern.svg.rgb24.ref.png \
|
||||
mime-data.pdf.ref.png \
|
||||
mime-data.ps.ref.png \
|
||||
mime-data.ref.png \
|
||||
|
|
@ -839,7 +839,7 @@ REFERENCE_IMAGES = \
|
|||
scale-offset-similar.ps.ref.png \
|
||||
scale-offset-similar.ref.png \
|
||||
scale-offset-similar.xfail.png \
|
||||
scale-offset-similar.meta.xfail.png \
|
||||
scale-offset-similar.recording.xfail.png \
|
||||
scale-offset-similar.script.xfail.png \
|
||||
scale-offset-similar.xlib.xfail.png \
|
||||
scale-offset-similar.xlib-fallback.xfail.png \
|
||||
|
|
@ -1087,13 +1087,13 @@ $(REFERENCE_IMAGES)
|
|||
# manipulation for SVG
|
||||
# extend-pad - lacks implementation in pixman and consequently used
|
||||
# as an excuse for lack of support in other backends
|
||||
# fallback-resolution - The essential problem here is that the meta-surface
|
||||
# fallback-resolution - The essential problem here is that the recording-surface
|
||||
# has recorded a sequence of operations with one device
|
||||
# transformation, and we attempt to replay it with
|
||||
# another (basically a scale-factor for the falback
|
||||
# resolution). Carl begun to look at this with his
|
||||
# chain-of-bugs, but the can of worms is much bigger.
|
||||
# It appears to be a design flaw in the meta-surface
|
||||
# It appears to be a design flaw in the recording-surface
|
||||
# that may spread further...
|
||||
# My solution would be to lock Behad and Adrian in a
|
||||
# room, with Carl as a moderator and not let them out
|
||||
|
|
|
|||
|
|
@ -131,7 +131,7 @@ test_sources = \
|
|||
mask-surface-ctm.c \
|
||||
mask-transformed-image.c \
|
||||
mask-transformed-similar.c \
|
||||
meta-surface-pattern.c \
|
||||
recording-surface-pattern.c \
|
||||
mime-data.c \
|
||||
miter-precision.c \
|
||||
move-to-show-surface.c \
|
||||
|
|
|
|||
|
|
@ -116,7 +116,7 @@ typedef struct _test_runner {
|
|||
const char *trace;
|
||||
pid_t pid;
|
||||
int sk;
|
||||
cairo_bool_t is_meta;
|
||||
cairo_bool_t is_recording;
|
||||
|
||||
cairo_script_interpreter_t *csi;
|
||||
struct context_closure {
|
||||
|
|
@ -144,7 +144,7 @@ struct slave {
|
|||
buffer_diff_result_t result;
|
||||
const cairo_boilerplate_target_t *target;
|
||||
const struct slave *reference;
|
||||
cairo_bool_t is_meta;
|
||||
cairo_bool_t is_recording;
|
||||
};
|
||||
|
||||
struct request_image {
|
||||
|
|
@ -163,7 +163,7 @@ struct surface_tag {
|
|||
static const cairo_user_data_key_t surface_tag;
|
||||
|
||||
#if CAIRO_HAS_PTHREAD
|
||||
#define tr_die(t) t->is_meta ? pthread_exit(NULL) : exit(1)
|
||||
#define tr_die(t) t->is_recording ? pthread_exit(NULL) : exit(1)
|
||||
#else
|
||||
#define tr_die(t) exit(1)
|
||||
#endif
|
||||
|
|
@ -241,9 +241,9 @@ format_for_content (cairo_content_t content)
|
|||
}
|
||||
|
||||
static void
|
||||
send_meta_surface (test_runner_t *tr,
|
||||
int width, int height,
|
||||
struct context_closure *closure)
|
||||
send_recording_surface (test_runner_t *tr,
|
||||
int width, int height,
|
||||
struct context_closure *closure)
|
||||
{
|
||||
#if CAIRO_HAS_PTHREAD
|
||||
const struct request_image rq = {
|
||||
|
|
@ -258,7 +258,7 @@ send_meta_surface (test_runner_t *tr,
|
|||
unsigned long serial;
|
||||
|
||||
if (DEBUG > 1) {
|
||||
printf ("send-meta-surface: %lu [%lu, %lu]\n",
|
||||
printf ("send-recording-surface: %lu [%lu, %lu]\n",
|
||||
closure->id,
|
||||
closure->start_line,
|
||||
closure->end_line);
|
||||
|
|
@ -273,7 +273,7 @@ send_meta_surface (test_runner_t *tr,
|
|||
serial = 0;
|
||||
readn (tr->sk, &serial, sizeof (serial));
|
||||
if (DEBUG > 1) {
|
||||
printf ("send-meta-surface: serial: %lu\n", serial);
|
||||
printf ("send-recording-surface: serial: %lu\n", serial);
|
||||
}
|
||||
if (serial != closure->id)
|
||||
pthread_exit (NULL);
|
||||
|
|
@ -350,8 +350,8 @@ send_surface (test_runner_t *tr,
|
|||
}
|
||||
}
|
||||
|
||||
if (tr->is_meta) {
|
||||
send_meta_surface (tr, width, height, closure);
|
||||
if (tr->is_recording) {
|
||||
send_recording_surface (tr, width, height, closure);
|
||||
return;
|
||||
}
|
||||
|
||||
|
|
@ -542,7 +542,7 @@ spawn_target (const char *socket_path,
|
|||
if (pid != 0)
|
||||
return pid;
|
||||
|
||||
tr.is_meta = FALSE;
|
||||
tr.is_recording = FALSE;
|
||||
tr.pid = getpid ();
|
||||
|
||||
tr.sk = spawn_socket (socket_path, tr.pid);
|
||||
|
|
@ -636,7 +636,7 @@ spawn_recorder (const char *socket_path, const char *trace)
|
|||
if (tr == NULL)
|
||||
return -1;
|
||||
|
||||
tr->is_meta = TRUE;
|
||||
tr->is_recording = TRUE;
|
||||
tr->pid = pid;
|
||||
tr->sk = spawn_socket (socket_path, tr->pid);
|
||||
if (tr->sk == -1) {
|
||||
|
|
@ -650,7 +650,7 @@ spawn_recorder (const char *socket_path, const char *trace)
|
|||
tr->context_id = 0;
|
||||
tr->trace = trace;
|
||||
|
||||
tr->surface = cairo_meta_surface_create (CAIRO_CONTENT_COLOR_ALPHA,
|
||||
tr->surface = cairo_recording_surface_create (CAIRO_CONTENT_COLOR_ALPHA,
|
||||
0, 0);
|
||||
if (tr->surface == NULL) {
|
||||
cleanup_recorder (tr);
|
||||
|
|
@ -840,7 +840,7 @@ static void
|
|||
write_images (const char *trace, struct slave *slave, int num_slaves)
|
||||
{
|
||||
while (num_slaves--) {
|
||||
if (slave->image != NULL && ! slave->is_meta) {
|
||||
if (slave->image != NULL && ! slave->is_recording) {
|
||||
char *filename;
|
||||
|
||||
xasprintf (&filename, "%s-%s-fail.png",
|
||||
|
|
@ -916,8 +916,8 @@ allocate_image_for_slave (uint8_t *base,
|
|||
offset);
|
||||
}
|
||||
|
||||
if (slave->is_meta) {
|
||||
/* special communication with meta-surface thread */
|
||||
if (slave->is_recording) {
|
||||
/* special communication with recording-surface thread */
|
||||
slave->image = cairo_surface_reference ((cairo_surface_t *) rq.stride);
|
||||
} else {
|
||||
size = rq.height * rq.stride;
|
||||
|
|
@ -1045,7 +1045,7 @@ test_run (void *base,
|
|||
goto out;
|
||||
|
||||
/* Can anyone spell 'P·E·D·A·N·T'? */
|
||||
if (! slaves[i].is_meta)
|
||||
if (! slaves[i].is_recording)
|
||||
cairo_surface_mark_dirty (slaves[i].image);
|
||||
completion++;
|
||||
}
|
||||
|
|
@ -1075,7 +1075,7 @@ test_run (void *base,
|
|||
|
||||
write_images (trace, slaves, num_slaves);
|
||||
|
||||
if (slaves[0].is_meta)
|
||||
if (slaves[0].is_recording)
|
||||
write_trace (trace, &slaves[0]);
|
||||
|
||||
goto out;
|
||||
|
|
@ -1173,7 +1173,7 @@ target_is_measurable (const cairo_boilerplate_target_t *target)
|
|||
case CAIRO_SURFACE_TYPE_SCRIPT:
|
||||
case CAIRO_SURFACE_TYPE_SVG:
|
||||
case CAIRO_SURFACE_TYPE_WIN32_PRINTING:
|
||||
case CAIRO_SURFACE_TYPE_META:
|
||||
case CAIRO_SURFACE_TYPE_RECORDING:
|
||||
default:
|
||||
return FALSE;
|
||||
}
|
||||
|
|
@ -1275,15 +1275,15 @@ _test_trace (test_trace_t *test,
|
|||
s = slaves = xcalloc (2*test->num_targets + 1, sizeof (struct slave));
|
||||
|
||||
#if CAIRO_HAS_PTHREAD
|
||||
/* set-up a meta-surface to reconstruct errors */
|
||||
/* set-up a recording-surface to reconstruct errors */
|
||||
slave = spawn_recorder (socket_path, trace);
|
||||
if (slave < 0) {
|
||||
fprintf (stderr, "Unable to create meta surface\n");
|
||||
fprintf (stderr, "Unable to create recording surface\n");
|
||||
goto cleanup_sk;
|
||||
}
|
||||
|
||||
s->pid = slave;
|
||||
s->is_meta = TRUE;
|
||||
s->is_recording = TRUE;
|
||||
s->target = NULL;
|
||||
s->fd = -1;
|
||||
s->reference = NULL;
|
||||
|
|
@ -1355,7 +1355,7 @@ cleanup:
|
|||
while (s-- > slaves) {
|
||||
int status;
|
||||
|
||||
if (s->is_meta) /* in-process */
|
||||
if (s->is_recording) /* in-process */
|
||||
continue;
|
||||
|
||||
kill (s->pid, SIGKILL);
|
||||
|
|
@ -1568,7 +1568,7 @@ parse_options (test_trace_t *test, int argc, char *argv[])
|
|||
static void
|
||||
test_reset (test_trace_t *test)
|
||||
{
|
||||
/* XXX leaking fonts again via meta-surface? */
|
||||
/* XXX leaking fonts again via recording-surface? */
|
||||
#if 0
|
||||
cairo_debug_reset_static_data ();
|
||||
#if HAVE_FCFINI
|
||||
|
|
|
|||
|
|
@ -824,10 +824,10 @@ cairo_test_for_target (cairo_test_context_t *ctx,
|
|||
goto UNWIND_STRINGS;
|
||||
}
|
||||
|
||||
required = target->is_meta ? "target=!meta" : "target=meta";
|
||||
required = target->is_recording ? "target=!recording" : "target=recording";
|
||||
if (strstr (ctx->test->requirements, required) != NULL) {
|
||||
cairo_test_log (ctx, "Error: Skipping for %s target %s\n",
|
||||
target->is_meta ? "meta" : "non-meta",
|
||||
target->is_recording ? "recording" : "non-recording",
|
||||
target->name);
|
||||
ret = CAIRO_TEST_UNTESTED;
|
||||
goto UNWIND_STRINGS;
|
||||
|
|
@ -1016,7 +1016,7 @@ REPEAT:
|
|||
|
||||
if (target->finish_surface != NULL) {
|
||||
#if HAVE_MEMFAULT
|
||||
/* We need to re-enable faults as most meta-surface processing
|
||||
/* We need to re-enable faults as most recording-surface processing
|
||||
* is done during cairo_surface_finish().
|
||||
*/
|
||||
MEMFAULT_CLEAR_FAULTS ();
|
||||
|
|
|
|||
|
|
@ -34,7 +34,7 @@
|
|||
#define HEIGHT WIDTH
|
||||
|
||||
|
||||
/* This test is designed to test painting a meta surface pattern with
|
||||
/* This test is designed to test painting a recording surface pattern with
|
||||
* CAIRO_EXTEND_NONE and a non identity pattern matrix.
|
||||
*/
|
||||
|
||||
|
|
@ -113,9 +113,9 @@ draw (cairo_t *cr, int width, int height)
|
|||
return CAIRO_TEST_SUCCESS;
|
||||
}
|
||||
|
||||
CAIRO_TEST (meta_surface_pattern,
|
||||
"Paint meta surface pattern with non identity pattern matrix",
|
||||
"meta", /* keywords */
|
||||
CAIRO_TEST (recording_surface_pattern,
|
||||
"Paint recording surface pattern with non identity pattern matrix",
|
||||
"recording", /* keywords */
|
||||
NULL, /* requirements */
|
||||
WIDTH, HEIGHT,
|
||||
NULL, draw)
|
||||
|
Before Width: | Height: | Size: 3.1 KiB After Width: | Height: | Size: 3.1 KiB |
|
Before Width: | Height: | Size: 3.8 KiB After Width: | Height: | Size: 3.8 KiB |
|
Before Width: | Height: | Size: 3.7 KiB After Width: | Height: | Size: 3.7 KiB |
|
Before Width: | Height: | Size: 3.2 KiB After Width: | Height: | Size: 3.2 KiB |
|
Before Width: | Height: | Size: 3.8 KiB After Width: | Height: | Size: 3.8 KiB |
|
Before Width: | Height: | Size: 3.2 KiB After Width: | Height: | Size: 3.2 KiB |
|
Before Width: | Height: | Size: 3.8 KiB After Width: | Height: | Size: 3.8 KiB |
|
Before Width: | Height: | Size: 4.5 KiB After Width: | Height: | Size: 4.5 KiB |
|
Before Width: | Height: | Size: 4 KiB After Width: | Height: | Size: 4 KiB |
|
Before Width: | Height: | Size: 3 KiB After Width: | Height: | Size: 3 KiB |
|
Before Width: | Height: | Size: 3.1 KiB After Width: | Height: | Size: 3.1 KiB |
|
Before Width: | Height: | Size: 3.7 KiB After Width: | Height: | Size: 3.7 KiB |
|
Before Width: | Height: | Size: 3.7 KiB After Width: | Height: | Size: 3.7 KiB |
|
Before Width: | Height: | Size: 10 KiB After Width: | Height: | Size: 10 KiB |
|
|
@ -52,11 +52,11 @@ static int fdr_dump;
|
|||
static const cairo_user_data_key_t fdr_key;
|
||||
|
||||
static void
|
||||
fdr_replay_to_script (cairo_surface_t *meta, cairo_script_context_t *ctx)
|
||||
fdr_replay_to_script (cairo_surface_t *recording, cairo_script_context_t *ctx)
|
||||
{
|
||||
if (meta != NULL) {
|
||||
if (recording != NULL) {
|
||||
DLCALL (cairo_script_context_write_comment, ctx, "--- fdr ---", -1);
|
||||
DLCALL (cairo_script_from_meta_surface, ctx, meta);
|
||||
DLCALL (cairo_script_from_recording_surface, ctx, recording);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -163,7 +163,7 @@ cairo_create (cairo_surface_t *surface)
|
|||
content = DLCALL (cairo_surface_get_content, surface);
|
||||
|
||||
tee = DLCALL (cairo_tee_surface_create, surface);
|
||||
record = DLCALL (cairo_meta_surface_create, content, &extents);
|
||||
record = DLCALL (cairo_recording_surface_create, content, &extents);
|
||||
DLCALL (cairo_tee_surface_add, tee, record);
|
||||
|
||||
DLCALL (cairo_surface_set_user_data, surface,
|
||||
|
|
|
|||
|
|
@ -217,7 +217,7 @@ struct clients {
|
|||
int count, size;
|
||||
int complete;
|
||||
|
||||
cairo_surface_t *meta;
|
||||
cairo_surface_t *recording;
|
||||
unsigned long serial;
|
||||
|
||||
struct client_info {
|
||||
|
|
@ -274,7 +274,7 @@ clients_init (struct clients *clients)
|
|||
return -1;
|
||||
clients->offset = 0;
|
||||
|
||||
clients->meta = NULL;
|
||||
clients->recording = NULL;
|
||||
clients->serial = 0;
|
||||
|
||||
return 0;
|
||||
|
|
@ -675,7 +675,7 @@ write_trace (struct clients *clients)
|
|||
mkdir ("output", 0777);
|
||||
|
||||
ctx = cairo_script_context_create ("output/cairo-sphinx.trace");
|
||||
cairo_script_from_meta_surface (ctx, clients->meta);
|
||||
cairo_script_from_recording_surface (ctx, clients->recording);
|
||||
cairo_script_context_destroy (ctx);
|
||||
|
||||
csum = checksum ("output/cairo-sphinx.trace");
|
||||
|
|
@ -684,8 +684,8 @@ write_trace (struct clients *clients)
|
|||
if (! g_file_test (buf, G_FILE_TEST_EXISTS)) {
|
||||
rename ("output/cairo-sphinx.trace", buf);
|
||||
|
||||
sprintf (buf, "output/%s.meta.png", csum);
|
||||
cairo_surface_write_to_png (clients->meta, buf);
|
||||
sprintf (buf, "output/%s.recording.png", csum);
|
||||
cairo_surface_write_to_png (clients->recording, buf);
|
||||
|
||||
for (i = 0; i < clients->count; i++) {
|
||||
struct client_info *c = &clients->clients[i];
|
||||
|
|
@ -732,14 +732,14 @@ clients_complete (struct clients *clients, int fd)
|
|||
c->image_serial = 0;
|
||||
}
|
||||
|
||||
clients->meta = NULL;
|
||||
clients->recording = NULL;
|
||||
clients->serial = 0;
|
||||
}
|
||||
|
||||
static void
|
||||
clients_meta (struct clients *clients, int fd, char *info)
|
||||
clients_recording (struct clients *clients, int fd, char *info)
|
||||
{
|
||||
sscanf (info, "%p %lu", &clients->meta, &clients->serial);
|
||||
sscanf (info, "%p %lu", &clients->recording, &clients->serial);
|
||||
clients_complete (clients, fd);
|
||||
}
|
||||
|
||||
|
|
@ -940,16 +940,16 @@ send_surface (struct client *c,
|
|||
}
|
||||
|
||||
static void
|
||||
send_meta (struct client *c,
|
||||
struct context_closure *closure)
|
||||
send_recording (struct client *c,
|
||||
struct context_closure *closure)
|
||||
{
|
||||
cairo_surface_t *source = closure->surface;
|
||||
char buf[1024];
|
||||
int len;
|
||||
unsigned long serial;
|
||||
|
||||
assert (cairo_surface_get_type (source) == CAIRO_SURFACE_TYPE_META);
|
||||
len = sprintf (buf, ".meta %p %lu\n", source, closure->id);
|
||||
assert (cairo_surface_get_type (source) == CAIRO_SURFACE_TYPE_RECORDING);
|
||||
len = sprintf (buf, ".recording %p %lu\n", source, closure->id);
|
||||
writen (c->sk, buf, len);
|
||||
|
||||
/* wait for image check */
|
||||
|
|
@ -1001,7 +1001,7 @@ _context_create (void *closure, cairo_surface_t *surface)
|
|||
|
||||
/* record everything, including writes to images */
|
||||
if (c->target == NULL) {
|
||||
if (cairo_surface_get_type (surface) != CAIRO_SURFACE_TYPE_META) {
|
||||
if (cairo_surface_get_type (surface) != CAIRO_SURFACE_TYPE_RECORDING) {
|
||||
cairo_format_t format;
|
||||
int width, height;
|
||||
|
||||
|
|
@ -1032,7 +1032,7 @@ _context_destroy (void *closure, void *ptr)
|
|||
if (l->context == ptr) {
|
||||
if (cairo_surface_status (l->surface) == CAIRO_STATUS_SUCCESS) {
|
||||
if (c->target == NULL)
|
||||
send_meta (c, l);
|
||||
send_recording (c, l);
|
||||
else
|
||||
send_surface (c, l);
|
||||
} else {
|
||||
|
|
@ -1071,7 +1071,7 @@ recorder (void *arg)
|
|||
buf_size = 65536;
|
||||
buf = xmalloc (buf_size);
|
||||
|
||||
len = sprintf (buf, "client-command target=meta name=.recorder\n");
|
||||
len = sprintf (buf, "client-command target=recording name=.recorder\n");
|
||||
if (! writen (client.sk, buf, len))
|
||||
return NULL;
|
||||
|
||||
|
|
@ -1086,8 +1086,8 @@ recorder (void *arg)
|
|||
if (! writen (pfd.fd, buf, len))
|
||||
return NULL;
|
||||
|
||||
client.surface = cairo_meta_surface_create (CAIRO_CONTENT_COLOR_ALPHA,
|
||||
NULL);
|
||||
client.surface = cairo_recording_surface_create (CAIRO_CONTENT_COLOR_ALPHA,
|
||||
NULL);
|
||||
|
||||
client.context_id = 0;
|
||||
client.csi = cairo_script_interpreter_create ();
|
||||
|
|
@ -1261,8 +1261,8 @@ do_server (const char *path)
|
|||
}
|
||||
} else if (strncmp (line, ".complete", 9) == 0) {
|
||||
clients_complete (&clients, pfd[n].fd);
|
||||
} else if (strncmp (line, ".meta", 5) == 0) {
|
||||
clients_meta (&clients, pfd[n].fd, line + 6);
|
||||
} else if (strncmp (line, ".recording", 5) == 0) {
|
||||
clients_recording (&clients, pfd[n].fd, line + 6);
|
||||
} else {
|
||||
printf ("do_command (%s)\n", line);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -4714,22 +4714,22 @@ _cairo_test_null_surface_create (cairo_content_t content)
|
|||
#endif
|
||||
|
||||
cairo_surface_t *
|
||||
cairo_meta_surface_create (cairo_content_t content,
|
||||
const cairo_rectangle_t *extents)
|
||||
cairo_recording_surface_create (cairo_content_t content,
|
||||
const cairo_rectangle_t *extents)
|
||||
{
|
||||
cairo_surface_t *ret;
|
||||
long surface_id;
|
||||
|
||||
_enter_trace ();
|
||||
|
||||
ret = DLCALL (cairo_meta_surface_create, content, extents);
|
||||
ret = DLCALL (cairo_recording_surface_create, content, extents);
|
||||
surface_id = _create_surface_id (ret);
|
||||
|
||||
_emit_line_info ();
|
||||
if (_write_lock ()) {
|
||||
if (extents) {
|
||||
_trace_printf ("dict\n"
|
||||
" /type /meta set\n"
|
||||
" /type /recording set\n"
|
||||
" /content //%s set\n"
|
||||
" /extents [%f %f %f %f] set\n"
|
||||
" surface dup /s%ld exch def\n",
|
||||
|
|
@ -4740,7 +4740,7 @@ cairo_meta_surface_create (cairo_content_t content,
|
|||
_surface_object_set_size (ret, extents->width, extents->height);
|
||||
} else {
|
||||
_trace_printf ("dict\n"
|
||||
" /type /meta set\n"
|
||||
" /type /recording set\n"
|
||||
" /content //%s set\n"
|
||||
" surface dup /s%ld exch def\n",
|
||||
_content_to_string (content),
|
||||
|
|
|
|||
|
|
@ -20,7 +20,7 @@ _surface_create (void *_closure,
|
|||
extents.x = extents.y = 0;
|
||||
extents.width = width;
|
||||
extents.height = height;
|
||||
surface = cairo_meta_surface_create (content, &extents);
|
||||
surface = cairo_recording_surface_create (content, &extents);
|
||||
if (*closure == NULL)
|
||||
*closure = cairo_surface_reference (surface);
|
||||
|
||||
|
|
@ -62,7 +62,7 @@ main (int argc, char **argv)
|
|||
cairo_xml_t *xml;
|
||||
|
||||
xml = cairo_xml_create_for_stream (stdio_write, out);
|
||||
cairo_xml_for_meta_surface (xml, surface);
|
||||
cairo_xml_for_recording_surface (xml, surface);
|
||||
cairo_xml_destroy (xml);
|
||||
|
||||
cairo_surface_destroy (surface);
|
||||
|
|
|
|||