mirror of
https://gitlab.freedesktop.org/cairo/cairo.git
synced 2026-05-09 06:08:02 +02:00
Update API shakeup chart.
Add a standin for the function that should be cairo_set_target_image which should then have some other name. We can straighten that mess out when we eliminate the set_target functions. Add deprecation alias for cairo_current_pattern. Deprecate cairo_surface_create_for_image in favor of cairo_image_surface_create_for_data.
This commit is contained in:
parent
5abf7786c0
commit
7636e90184
7 changed files with 78 additions and 28 deletions
16
ChangeLog
16
ChangeLog
|
|
@ -1,3 +1,19 @@
|
|||
2005-04-01 Carl Worth <cworth@cworth.org>
|
||||
|
||||
* TODO: Update API shakeup chart.
|
||||
|
||||
* src/cairo.h:
|
||||
* src/cairo.c: (cairo_set_target_image_no_data): Add a standin for
|
||||
the function that should be cairo_set_target_image which should
|
||||
then have some other name. We can straighten that mess out when we
|
||||
eliminate the set_target functions. Add deprecation alias for
|
||||
cairo_current_pattern.
|
||||
|
||||
* src/cairoint.h:
|
||||
* src/cairo-image-surface.c:
|
||||
* src/cairo-surface.c: Deprecate cairo_surface_create_for_image in
|
||||
favor of cairo_image_surface_create_for_data.
|
||||
|
||||
2005-03-31 Kristian Høgsberg <krh@redhat.com>
|
||||
|
||||
* src/cairo.c (cairo_set_target_png): Remove this function now
|
||||
|
|
|
|||
6
TODO
6
TODO
|
|
@ -15,11 +15,11 @@ PDRTC cairo_current_path -> cairo_copy_path_data
|
|||
PDR C cairo_surface_finish, cairo_surface_flush
|
||||
PD C Abbreviation hunt: cairo_init_clip and cairo_concat_matrix
|
||||
----- Renaming the terms of the rendering equation
|
||||
Making set_source consistent
|
||||
PD default matrix
|
||||
cairo_paint
|
||||
cairo_begin_group, cairo_end_group, cairo_get_group
|
||||
cairo_stroke_path -> cairo_stroke_to_path
|
||||
default matrix
|
||||
Making set_source consistent
|
||||
----- cairo_stroke_path -> cairo_stroke_to_path
|
||||
cairo_current_matrix
|
||||
cairo_mask
|
||||
cairo_create and eliminating cairo_set_target_surface
|
||||
|
|
|
|||
|
|
@ -223,6 +223,7 @@ cairo_image_surface_create_for_data (char *data,
|
|||
|
||||
return &surface->base;
|
||||
}
|
||||
DEPRECATE(cairo_surface_create_for_image, cairo_image_surface_create_for_data);
|
||||
|
||||
static cairo_surface_t *
|
||||
_cairo_image_surface_create_similar (void *abstract_src,
|
||||
|
|
|
|||
|
|
@ -64,17 +64,6 @@ _cairo_surface_init (cairo_surface_t *surface,
|
|||
surface->device_y_offset = 0;
|
||||
}
|
||||
|
||||
cairo_surface_t *
|
||||
cairo_surface_create_for_image (char *data,
|
||||
cairo_format_t format,
|
||||
int width,
|
||||
int height,
|
||||
int stride)
|
||||
{
|
||||
return cairo_image_surface_create_for_data (data, format, width, height, stride);
|
||||
}
|
||||
slim_hidden_def(cairo_surface_create_for_image);
|
||||
|
||||
cairo_surface_t *
|
||||
_cairo_surface_create_similar_scratch (cairo_surface_t *other,
|
||||
cairo_format_t format,
|
||||
|
|
|
|||
50
src/cairo.c
50
src/cairo.c
|
|
@ -324,7 +324,7 @@ slim_hidden_def(cairo_set_target_surface);
|
|||
* Directs output for a #cairo_t to an in-memory image. The output
|
||||
* buffer must be kept around until the #cairo_t is destroyed or set
|
||||
* to to have a different target. The initial contents of @buffer
|
||||
* will be used as the inital image contents; you must explicitely
|
||||
* will be used as the inital image contents; you must explicitly
|
||||
* clear the buffer, using, for example, cairo_rectangle() and
|
||||
* cairo_fill() if you want it cleared.
|
||||
**/
|
||||
|
|
@ -342,9 +342,50 @@ cairo_set_target_image (cairo_t *cr,
|
|||
if (cr->status)
|
||||
return;
|
||||
|
||||
surface = cairo_surface_create_for_image (data,
|
||||
format,
|
||||
width, height, stride);
|
||||
surface = cairo_image_surface_create_for_data (data,
|
||||
format,
|
||||
width, height, stride);
|
||||
if (surface == NULL) {
|
||||
cr->status = CAIRO_STATUS_NO_MEMORY;
|
||||
CAIRO_CHECK_SANITY (cr);
|
||||
return;
|
||||
}
|
||||
|
||||
cairo_set_target_surface (cr, surface);
|
||||
|
||||
cairo_surface_destroy (surface);
|
||||
CAIRO_CHECK_SANITY (cr);
|
||||
}
|
||||
|
||||
/**
|
||||
* cairo_set_target_image_no_data:
|
||||
* @cr: a #cairo_t
|
||||
* @format: the format of pixels in the buffer
|
||||
* @width: the width of the image to be stored in the buffer
|
||||
* @height: the eight of the image to be stored in the buffer
|
||||
*
|
||||
* Directs output for a #cairo_t to an implicit image surface of the
|
||||
* given format that will be created and owned by the cairo
|
||||
* context. The initial contents of the target surface will be
|
||||
* cleared to 0 in all channels, (ie. transparent black).
|
||||
*
|
||||
* NOTE: This function has an unconventional name, but that will be
|
||||
* straightened out in a future change in which all set_target
|
||||
* functions will be renamed.
|
||||
**/
|
||||
void
|
||||
cairo_set_target_image_no_data (cairo_t *cr,
|
||||
cairo_format_t format,
|
||||
int width,
|
||||
int height)
|
||||
{
|
||||
cairo_surface_t *surface;
|
||||
|
||||
CAIRO_CHECK_SANITY (cr);
|
||||
if (cr->status)
|
||||
return;
|
||||
|
||||
surface = cairo_image_surface_create (format, width, height);
|
||||
if (surface == NULL) {
|
||||
cr->status = CAIRO_STATUS_NO_MEMORY;
|
||||
CAIRO_CHECK_SANITY (cr);
|
||||
|
|
@ -687,6 +728,7 @@ cairo_get_pattern (cairo_t *cr)
|
|||
CAIRO_CHECK_SANITY (cr);
|
||||
return _cairo_gstate_get_pattern (cr->gstate);
|
||||
}
|
||||
DEPRECATE(cairo_current_pattern, cairo_get_pattern);
|
||||
|
||||
/**
|
||||
* cairo_set_tolerance:
|
||||
|
|
|
|||
21
src/cairo.h
21
src/cairo.h
|
|
@ -173,7 +173,10 @@ typedef enum cairo_format {
|
|||
CAIRO_FORMAT_A1
|
||||
} cairo_format_t;
|
||||
|
||||
/* XXX: Need to add cairo_set_target_image_data */
|
||||
/* XXX: The naming of these two functions is reversed from their
|
||||
* cairo_image_surface_create counterparts. We'll fix this when
|
||||
* we eliminate all the cairo_set_target functions.
|
||||
*/
|
||||
void
|
||||
cairo_set_target_image (cairo_t *cr,
|
||||
char *data,
|
||||
|
|
@ -182,6 +185,12 @@ cairo_set_target_image (cairo_t *cr,
|
|||
int height,
|
||||
int stride);
|
||||
|
||||
void
|
||||
cairo_set_target_image_no_data (cairo_t *cr,
|
||||
cairo_format_t format,
|
||||
int width,
|
||||
int height);
|
||||
|
||||
typedef enum cairo_operator {
|
||||
CAIRO_OPERATOR_CLEAR,
|
||||
CAIRO_OPERATOR_SRC,
|
||||
|
|
@ -825,14 +834,6 @@ cairo_status_string (cairo_t *cr);
|
|||
typedef void (*cairo_destroy_func_t) (void *data);
|
||||
|
||||
/* Surface manipulation */
|
||||
/* XXX: We may want to rename this function in light of the new
|
||||
virtualized surface backends... */
|
||||
cairo_surface_t *
|
||||
cairo_surface_create_for_image (char *data,
|
||||
cairo_format_t format,
|
||||
int width,
|
||||
int height,
|
||||
int stride);
|
||||
|
||||
/* XXX: I want to remove this function, (replace with
|
||||
cairo_set_target_scratch or similar). */
|
||||
|
|
@ -1070,6 +1071,7 @@ typedef cairo_status_t (*cairo_write_func_t) (void *closure,
|
|||
#define cairo_inverse_transform_point cairo_inverse_transform_point_DEPRECATED_BY_cairo_device_to_user
|
||||
#define cairo_inverse_transform_distance cairo_inverse_transform_distance_DEPRECATED_BY_cairo_device_to_user_distance
|
||||
#define cairo_init_clip cairo_init_clip_DEPRECATED_BY_cairo_reset_clip
|
||||
#define cairo_surface_create_for_image cairo_surface_create_for_image_DEPRECATED_BY_cairo_image_surface_create_for_data
|
||||
|
||||
#else /* CAIRO_API_SHAKEUP_FLAG_DAY */
|
||||
|
||||
|
|
@ -1097,6 +1099,7 @@ typedef cairo_status_t (*cairo_write_func_t) (void *closure,
|
|||
#define cairo_inverse_transform_point cairo_device_to_user
|
||||
#define cairo_inverse_transform_distance cairo_device_to_user_distance
|
||||
#define cairo_init_clip cairo_reset_clip
|
||||
#define cairo_surface_create_for_image cairo_image_surface_create_for_data
|
||||
|
||||
#endif /* CAIRO_API_SHAKEUP_FLAG_DAY */
|
||||
|
||||
|
|
|
|||
|
|
@ -1777,7 +1777,6 @@ slim_hidden_proto(cairo_rel_line_to)
|
|||
slim_hidden_proto(cairo_restore)
|
||||
slim_hidden_proto(cairo_save)
|
||||
slim_hidden_proto(cairo_set_target_surface)
|
||||
slim_hidden_proto(cairo_surface_create_for_image)
|
||||
slim_hidden_proto(cairo_surface_destroy)
|
||||
slim_hidden_proto(cairo_surface_get_matrix)
|
||||
slim_hidden_proto(cairo_surface_set_matrix)
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue