зеркало из https://github.com/mozilla/gecko-dev.git
Cairo push/pop group patch fixes; win32 alphablend fix; b=326333, fbcompose.c problem causing missing svg text patch; initial part of cairogfx transparency fix
This commit is contained in:
Родитель
f1141fd8e2
Коммит
4cb87bbda0
|
@ -20,6 +20,8 @@ if cairo is enabled. Please upgrade to VC7.1/8.
|
|||
|
||||
==== Patches ====
|
||||
|
||||
Last update: 07 Feb 2006
|
||||
|
||||
mozilla-misc.patch
|
||||
- Misc compilation fixes for pixman (submitted upstream)
|
||||
- temporary moz_cairo_set_target API (not for upstream)
|
||||
|
@ -36,16 +38,24 @@ mozilla-misc.patch
|
|||
cairo-debug-helpers.patch
|
||||
- some stuff for cairo-debug.[ch]
|
||||
|
||||
fbcompose-bandaid.patch (Updated 7 Feb 06)
|
||||
- Workaround for https://bugs.freedesktop.org/show_bug.cgi?id=5777
|
||||
|
||||
cairo-win32-clip.patch
|
||||
- Make mark_dirty() reset a surface's clip, so that we can call it
|
||||
when we RestoreDC() after native win32 drawing (submitted upstream)
|
||||
- Rework win32 surface clip and extents handling for correctness
|
||||
(submitted upstream)
|
||||
|
||||
device-offset-scale.path
|
||||
cairo-win32-alphablend.patch (Updated 7 Feb 06)
|
||||
- Use AlphaBlend if the dst surface is either RGB24 or ARGB32, not
|
||||
just RGB24
|
||||
- Add cairo_win32_surface_get_dc()
|
||||
|
||||
device-offset-scale.patch (Updated 7 Feb 06)
|
||||
- Move device offset/scale handling into surface layer; large rework
|
||||
of device offset/scale. (submitted upstream)
|
||||
|
||||
push-pop-group.patch
|
||||
push-pop-group.patch (Updated 7 Feb 06)
|
||||
- Implementation of push/pop group API; depends on device-offset-scale.
|
||||
(submitted upstream)
|
||||
|
|
|
@ -0,0 +1,75 @@
|
|||
Index: cairo/src/cairo-win32-surface.c
|
||||
===================================================================
|
||||
--- cairo.orig/src/cairo-win32-surface.c 2006-02-07 17:06:46.750000000 -0800
|
||||
+++ cairo/src/cairo-win32-surface.c 2006-02-07 17:07:03.312500000 -0800
|
||||
@@ -612,7 +612,7 @@
|
||||
src_x, src_y,
|
||||
width, height,
|
||||
blend_function))
|
||||
- return _cairo_win32_print_gdi_error ("_cairo_win32_surface_composite");
|
||||
+ return _cairo_win32_print_gdi_error ("_cairo_win32_surface_composite(AlphaBlend)");
|
||||
|
||||
return CAIRO_STATUS_SUCCESS;
|
||||
}
|
||||
@@ -675,13 +675,13 @@
|
||||
src->dc,
|
||||
src_x + itx, src_y + ity,
|
||||
SRCCOPY))
|
||||
- return _cairo_win32_print_gdi_error ("_cairo_win32_surface_composite");
|
||||
+ return _cairo_win32_print_gdi_error ("_cairo_win32_surface_composite(BitBlt)");
|
||||
|
||||
return CAIRO_STATUS_SUCCESS;
|
||||
|
||||
} else if (integer_transform &&
|
||||
(src->format == CAIRO_FORMAT_RGB24 || src->format == CAIRO_FORMAT_ARGB32) &&
|
||||
- dst->format == CAIRO_FORMAT_RGB24 &&
|
||||
+ (dst->format == CAIRO_FORMAT_RGB24 || dst->format == CAIRO_FORMAT_ARGB32) &&
|
||||
op == CAIRO_OPERATOR_OVER) {
|
||||
|
||||
return _composite_alpha_blend (dst, src, alpha,
|
||||
@@ -1007,6 +1007,31 @@
|
||||
return surface->backend == &cairo_win32_surface_backend;
|
||||
}
|
||||
|
||||
+/**
|
||||
+ * cairo_win32_surface_get_dc
|
||||
+ * @surface: a #cairo_surface_t
|
||||
+ *
|
||||
+ * Returns the HDC associated with this surface, or NULL if none.
|
||||
+ * Also returns NULL if the surface is not a win32 surface.
|
||||
+ *
|
||||
+ * Return value: HDC or NULL if no HDC available.
|
||||
+ **/
|
||||
+HDC
|
||||
+cairo_win32_surface_get_dc (cairo_surface_t *surface)
|
||||
+{
|
||||
+ cairo_win32_surface_t *winsurf;
|
||||
+
|
||||
+ if (surface == NULL)
|
||||
+ return NULL;
|
||||
+
|
||||
+ if (!_cairo_surface_is_win32(surface))
|
||||
+ return NULL;
|
||||
+
|
||||
+ winsurf = (cairo_win32_surface_t *) surface;
|
||||
+
|
||||
+ return winsurf->dc;
|
||||
+}
|
||||
+
|
||||
static const cairo_surface_backend_t cairo_win32_surface_backend = {
|
||||
_cairo_win32_surface_create_similar,
|
||||
_cairo_win32_surface_finish,
|
||||
Index: cairo/src/cairo-win32.h
|
||||
===================================================================
|
||||
--- cairo.orig/src/cairo-win32.h 2006-02-07 17:12:24.734375000 -0800
|
||||
+++ cairo/src/cairo-win32.h 2006-02-07 17:13:53.203125000 -0800
|
||||
@@ -60,6 +60,9 @@
|
||||
cairo_public double
|
||||
cairo_win32_scaled_font_get_metrics_factor (cairo_scaled_font_t *scaled_font);
|
||||
|
||||
+cairo_public HDC
|
||||
+cairo_win32_surface_get_dc (cairo_surface_t *surface);
|
||||
+
|
||||
CAIRO_END_DECLS
|
||||
|
||||
#else /* CAIRO_HAS_WIN32_SURFACE */
|
|
@ -1031,12 +1031,17 @@ _cairo_surface_fallback_composite (cairo_operator_t op,
|
|||
return status;
|
||||
}
|
||||
|
||||
status = state.image->base.backend->composite (op, src, mask,
|
||||
&state.image->base,
|
||||
src_x, src_y, mask_x, mask_y,
|
||||
dst_x - state.image_rect.x,
|
||||
dst_y - state.image_rect.y,
|
||||
width, height);
|
||||
/* We know this will never fail with the image backend; but
|
||||
* instead of calling into it directly, we call
|
||||
* _cairo_surface_composite so that we get the correct device
|
||||
* offset handling.
|
||||
*/
|
||||
status = _cairo_surface_composite (op, src, mask,
|
||||
&state.image->base,
|
||||
src_x, src_y, mask_x, mask_y,
|
||||
dst_x - state.image_rect.x,
|
||||
dst_y - state.image_rect.y,
|
||||
width, height);
|
||||
_fallback_fini (&state);
|
||||
|
||||
return status;
|
||||
|
@ -1106,9 +1111,9 @@ _cairo_surface_fallback_fill_rectangles (cairo_surface_t *surface,
|
|||
rects = offset_rects;
|
||||
}
|
||||
|
||||
status = state.image->base.backend->fill_rectangles (&state.image->base,
|
||||
op, color,
|
||||
rects, num_rects);
|
||||
status = _cairo_surface_fill_rectangles (&state.image->base,
|
||||
op, color,
|
||||
rects, num_rects);
|
||||
|
||||
free (offset_rects);
|
||||
|
||||
|
@ -1159,13 +1164,13 @@ _cairo_surface_fallback_composite_trapezoids (cairo_operator_t op,
|
|||
traps = offset_traps;
|
||||
}
|
||||
|
||||
state.image->base.backend->composite_trapezoids (op, pattern,
|
||||
&state.image->base,
|
||||
antialias,
|
||||
src_x, src_y,
|
||||
dst_x - state.image_rect.x,
|
||||
dst_y - state.image_rect.y,
|
||||
width, height, traps, num_traps);
|
||||
_cairo_surface_composite_trapezoids (op, pattern,
|
||||
&state.image->base,
|
||||
antialias,
|
||||
src_x, src_y,
|
||||
dst_x - state.image_rect.x,
|
||||
dst_y - state.image_rect.y,
|
||||
width, height, traps, num_traps);
|
||||
if (offset_traps)
|
||||
free (offset_traps);
|
||||
|
||||
|
|
|
@ -596,6 +596,25 @@ cairo_surface_set_device_offset (cairo_surface_t *surface,
|
|||
surface->device_y_offset = y_offset * surface->device_y_scale;
|
||||
}
|
||||
|
||||
/**
|
||||
* cairo_surface_get_device_offset:
|
||||
* @surface: a #cairo_surface_t
|
||||
* @x_offset: the offset in the X direction, in device units
|
||||
* @y_offset: the offset in the Y direction, in device units
|
||||
*
|
||||
* Returns a previous device offset set by
|
||||
* cairo_surface_set_device_offset().
|
||||
*
|
||||
**/
|
||||
void
|
||||
cairo_surface_get_device_offset (cairo_surface_t *surface,
|
||||
double *x_offset,
|
||||
double *y_offset)
|
||||
{
|
||||
*x_offset = surface->device_x_offset;
|
||||
*y_offset = surface->device_y_offset;
|
||||
}
|
||||
|
||||
/**
|
||||
* _cairo_surface_acquire_source_image:
|
||||
* @surface: a #cairo_surface_t
|
||||
|
@ -873,13 +892,13 @@ _cairo_surface_composite (cairo_operator_t op,
|
|||
if (src->type == CAIRO_PATTERN_SURFACE) {
|
||||
cairo_surface_t *src_surface = ((cairo_surface_pattern_t*)src)->surface;
|
||||
backend_src_x = BACKEND_X(src_surface, src_x);
|
||||
backend_src_y = BACKEND_X(src_surface, src_y);
|
||||
backend_src_y = BACKEND_Y(src_surface, src_y);
|
||||
}
|
||||
|
||||
if (mask && mask->type == CAIRO_PATTERN_SURFACE) {
|
||||
cairo_surface_t *mask_surface = ((cairo_surface_pattern_t*)mask)->surface;
|
||||
backend_mask_x = BACKEND_X(mask_surface, mask_x);
|
||||
backend_mask_y = BACKEND_X(mask_surface, mask_y);
|
||||
backend_mask_y = BACKEND_Y(mask_surface, mask_y);
|
||||
}
|
||||
|
||||
status = dst->backend->composite (op,
|
||||
|
|
|
@ -612,7 +612,7 @@ _composite_alpha_blend (cairo_win32_surface_t *dst,
|
|||
src_x, src_y,
|
||||
width, height,
|
||||
blend_function))
|
||||
return _cairo_win32_print_gdi_error ("_cairo_win32_surface_composite");
|
||||
return _cairo_win32_print_gdi_error ("_cairo_win32_surface_composite(AlphaBlend)");
|
||||
|
||||
return CAIRO_STATUS_SUCCESS;
|
||||
}
|
||||
|
@ -675,13 +675,13 @@ _cairo_win32_surface_composite (cairo_operator_t op,
|
|||
src->dc,
|
||||
src_x + itx, src_y + ity,
|
||||
SRCCOPY))
|
||||
return _cairo_win32_print_gdi_error ("_cairo_win32_surface_composite");
|
||||
return _cairo_win32_print_gdi_error ("_cairo_win32_surface_composite(BitBlt)");
|
||||
|
||||
return CAIRO_STATUS_SUCCESS;
|
||||
|
||||
} else if (integer_transform &&
|
||||
(src->format == CAIRO_FORMAT_RGB24 || src->format == CAIRO_FORMAT_ARGB32) &&
|
||||
dst->format == CAIRO_FORMAT_RGB24 &&
|
||||
(dst->format == CAIRO_FORMAT_RGB24 || dst->format == CAIRO_FORMAT_ARGB32) &&
|
||||
op == CAIRO_OPERATOR_OVER) {
|
||||
|
||||
return _composite_alpha_blend (dst, src, alpha,
|
||||
|
@ -1007,6 +1007,31 @@ _cairo_surface_is_win32 (cairo_surface_t *surface)
|
|||
return surface->backend == &cairo_win32_surface_backend;
|
||||
}
|
||||
|
||||
/**
|
||||
* cairo_win32_surface_get_dc
|
||||
* @surface: a #cairo_surface_t
|
||||
*
|
||||
* Returns the HDC associated with this surface, or NULL if none.
|
||||
* Also returns NULL if the surface is not a win32 surface.
|
||||
*
|
||||
* Return value: HDC or NULL if no HDC available.
|
||||
**/
|
||||
HDC
|
||||
cairo_win32_surface_get_dc (cairo_surface_t *surface)
|
||||
{
|
||||
cairo_win32_surface_t *winsurf;
|
||||
|
||||
if (surface == NULL)
|
||||
return NULL;
|
||||
|
||||
if (!_cairo_surface_is_win32(surface))
|
||||
return NULL;
|
||||
|
||||
winsurf = (cairo_win32_surface_t *) surface;
|
||||
|
||||
return winsurf->dc;
|
||||
}
|
||||
|
||||
static const cairo_surface_backend_t cairo_win32_surface_backend = {
|
||||
_cairo_win32_surface_create_similar,
|
||||
_cairo_win32_surface_finish,
|
||||
|
|
|
@ -60,6 +60,9 @@ cairo_win32_scaled_font_done_font (cairo_scaled_font_t *scaled_font);
|
|||
cairo_public double
|
||||
cairo_win32_scaled_font_get_metrics_factor (cairo_scaled_font_t *scaled_font);
|
||||
|
||||
cairo_public HDC
|
||||
cairo_win32_surface_get_dc (cairo_surface_t *surface);
|
||||
|
||||
CAIRO_END_DECLS
|
||||
|
||||
#else /* CAIRO_HAS_WIN32_SURFACE */
|
||||
|
|
|
@ -408,6 +408,7 @@ cairo_pop_group (cairo_t *cr)
|
|||
{
|
||||
cairo_surface_t *group_surface, *parent_target;
|
||||
cairo_pattern_t *group_pattern = NULL;
|
||||
cairo_matrix_t group_matrix;
|
||||
|
||||
/* Grab the active surfaces */
|
||||
group_surface = _cairo_gstate_get_target (cr->gstate);
|
||||
|
@ -429,18 +430,14 @@ cairo_pop_group (cairo_t *cr)
|
|||
if (cr->status)
|
||||
goto done;
|
||||
|
||||
/* Undo the device offset we used; we're back in a normal-sized
|
||||
* surface, so this pattern will be positioned at the right place.
|
||||
* XXXvlad - er, this doesn't make sense, why does it work?
|
||||
*/
|
||||
//cairo_surface_set_device_offset (group_surface, 0, 0);
|
||||
|
||||
group_pattern = cairo_pattern_create_for_surface (group_surface);
|
||||
if (!group_pattern) {
|
||||
cr->status = CAIRO_STATUS_NO_MEMORY;
|
||||
goto done;
|
||||
}
|
||||
|
||||
_cairo_gstate_get_matrix (cr->gstate, &group_matrix);
|
||||
cairo_pattern_set_matrix (cr->gstate, &group_matrix);
|
||||
done:
|
||||
cairo_surface_destroy (group_surface);
|
||||
|
||||
|
@ -2511,6 +2508,30 @@ cairo_get_target (cairo_t *cr)
|
|||
return _cairo_gstate_get_original_target (cr->gstate);
|
||||
}
|
||||
|
||||
/**
|
||||
* cairo_get_group_target:
|
||||
* @cr: a cairo context
|
||||
*
|
||||
* Gets the target surface for the current transparency group
|
||||
* started by the last cairo_push_group() call on the cairo
|
||||
* context.
|
||||
*
|
||||
* This function may return NULL if there is no transparency
|
||||
* group on the target.
|
||||
*
|
||||
* Return value: the target group surface, or NULL if none. This
|
||||
* object is owned by cairo. To keep a reference to it, you must call
|
||||
* cairo_surface_reference().
|
||||
**/
|
||||
cairo_surface_t *
|
||||
cairo_get_group_target (cairo_t *cr)
|
||||
{
|
||||
if (cr->status)
|
||||
return (cairo_surface_t*) &_cairo_surface_nil;
|
||||
|
||||
return _cairo_gstate_get_target (cr->gstate);
|
||||
}
|
||||
|
||||
/**
|
||||
* cairo_copy_path:
|
||||
* @cr: a cairo context
|
||||
|
|
|
@ -997,6 +997,9 @@ cairo_get_matrix (cairo_t *cr, cairo_matrix_t *matrix);
|
|||
cairo_public cairo_surface_t *
|
||||
cairo_get_target (cairo_t *cr);
|
||||
|
||||
cairo_public cairo_surface_t *
|
||||
cairo_get_group_target (cairo_t *cr);
|
||||
|
||||
typedef enum _cairo_path_data_type {
|
||||
CAIRO_PATH_MOVE_TO,
|
||||
CAIRO_PATH_LINE_TO,
|
||||
|
@ -1205,6 +1208,11 @@ cairo_surface_set_device_offset (cairo_surface_t *surface,
|
|||
double x_offset,
|
||||
double y_offset);
|
||||
|
||||
cairo_public void
|
||||
cairo_surface_get_device_offset (cairo_surface_t *surface,
|
||||
double *x_offset,
|
||||
double *y_offset);
|
||||
|
||||
/* Image-surface functions */
|
||||
|
||||
/**
|
||||
|
|
|
@ -1,8 +1,8 @@
|
|||
Index: src/cairo-gstate.c
|
||||
===================================================================
|
||||
--- src/cairo-gstate.c.orig
|
||||
+++ src/cairo-gstate.c
|
||||
@@ -508,37 +508,10 @@ _cairo_gstate_get_miter_limit (cairo_gst
|
||||
--- src/cairo-gstate.c.orig 2006-02-07 16:54:28.046875000 -0800
|
||||
+++ src/cairo-gstate.c 2006-02-07 16:55:54.671875000 -0800
|
||||
@@ -508,37 +508,10 @@
|
||||
return gstate->stroke_style.miter_limit;
|
||||
}
|
||||
|
||||
|
@ -40,7 +40,7 @@ Index: src/cairo-gstate.c
|
|||
}
|
||||
|
||||
cairo_status_t
|
||||
@@ -624,9 +597,6 @@ _cairo_gstate_set_matrix (cairo_gstate_t
|
||||
@@ -624,9 +597,6 @@
|
||||
if (status)
|
||||
return status;
|
||||
|
||||
|
@ -50,7 +50,7 @@ Index: src/cairo-gstate.c
|
|||
return CAIRO_STATUS_SUCCESS;
|
||||
}
|
||||
|
||||
@@ -638,9 +608,6 @@ _cairo_gstate_identity_matrix (cairo_gst
|
||||
@@ -638,9 +608,6 @@
|
||||
cairo_matrix_init_identity (&gstate->ctm);
|
||||
cairo_matrix_init_identity (&gstate->ctm_inverse);
|
||||
|
||||
|
@ -60,7 +60,7 @@ Index: src/cairo-gstate.c
|
|||
return CAIRO_STATUS_SUCCESS;
|
||||
}
|
||||
|
||||
@@ -682,15 +649,11 @@ void
|
||||
@@ -682,15 +649,11 @@
|
||||
_cairo_gstate_user_to_backend (cairo_gstate_t *gstate, double *x, double *y)
|
||||
{
|
||||
cairo_matrix_transform_point (&gstate->ctm, x, y);
|
||||
|
@ -76,7 +76,7 @@ Index: src/cairo-gstate.c
|
|||
cairo_matrix_transform_point (&gstate->ctm_inverse, x, y);
|
||||
}
|
||||
|
||||
@@ -711,16 +674,8 @@ _cairo_gstate_copy_transformed_pattern (
|
||||
@@ -711,16 +674,8 @@
|
||||
cairo_pattern_t *original,
|
||||
cairo_matrix_t *ctm_inverse)
|
||||
{
|
||||
|
@ -94,11 +94,31 @@ Index: src/cairo-gstate.c
|
|||
}
|
||||
|
||||
static void
|
||||
@@ -1401,9 +1356,6 @@
|
||||
if (status || !glyphs || !num_glyphs || !(*glyphs) || !(num_glyphs))
|
||||
return status;
|
||||
|
||||
- _cairo_gstate_apply_device_transform (gstate, &gstate->ctm);
|
||||
- _cairo_gstate_apply_device_inverse_transform (gstate, &gstate->ctm_inverse);
|
||||
-
|
||||
return CAIRO_STATUS_SUCCESS;
|
||||
}
|
||||
|
||||
@@ -1440,9 +1392,6 @@
|
||||
glyphs, num_glyphs,
|
||||
extents);
|
||||
|
||||
- _cairo_gstate_apply_device_transform (gstate, &gstate->ctm);
|
||||
- _cairo_gstate_apply_device_inverse_transform (gstate, &gstate->ctm_inverse);
|
||||
-
|
||||
return CAIRO_STATUS_SUCCESS;
|
||||
}
|
||||
|
||||
Index: src/cairo-path.c
|
||||
===================================================================
|
||||
--- src/cairo-path.c.orig
|
||||
+++ src/cairo-path.c
|
||||
@@ -548,3 +548,40 @@ _cairo_path_fixed_interpret (cairo_path_
|
||||
--- src/cairo-path.c.orig 2006-02-07 16:54:28.073875000 -0800
|
||||
+++ src/cairo-path.c 2006-02-07 16:55:54.671875000 -0800
|
||||
@@ -548,3 +548,40 @@
|
||||
|
||||
return CAIRO_STATUS_SUCCESS;
|
||||
}
|
||||
|
@ -141,9 +161,9 @@ Index: src/cairo-path.c
|
|||
+
|
||||
Index: src/cairo-surface-fallback.c
|
||||
===================================================================
|
||||
--- src/cairo-surface-fallback.c.orig
|
||||
+++ src/cairo-surface-fallback.c
|
||||
@@ -214,6 +214,21 @@ _clip_and_composite_combine (cairo_clip_
|
||||
--- src/cairo-surface-fallback.c.orig 2006-02-07 16:54:28.094875000 -0800
|
||||
+++ src/cairo-surface-fallback.c 2006-02-07 16:56:10.171875000 -0800
|
||||
@@ -214,6 +214,21 @@
|
||||
*/
|
||||
_cairo_pattern_init_for_surface (&dst_pattern, dst);
|
||||
|
||||
|
@ -165,7 +185,7 @@ Index: src/cairo-surface-fallback.c
|
|||
status = _cairo_surface_composite (CAIRO_OPERATOR_SOURCE,
|
||||
&dst_pattern.base, NULL, intermediate,
|
||||
extents->x, extents->y,
|
||||
@@ -982,6 +997,11 @@ _cairo_surface_fallback_snapshot (cairo_
|
||||
@@ -982,6 +997,11 @@
|
||||
_cairo_surface_release_source_image (surface,
|
||||
image, &image_extra);
|
||||
|
||||
|
@ -177,7 +197,44 @@ Index: src/cairo-surface-fallback.c
|
|||
snapshot->is_snapshot = TRUE;
|
||||
|
||||
return snapshot;
|
||||
@@ -1127,29 +1147,15 @@ _cairo_surface_fallback_composite_trapez
|
||||
@@ -1011,12 +1031,17 @@
|
||||
return status;
|
||||
}
|
||||
|
||||
- status = state.image->base.backend->composite (op, src, mask,
|
||||
- &state.image->base,
|
||||
- src_x, src_y, mask_x, mask_y,
|
||||
- dst_x - state.image_rect.x,
|
||||
- dst_y - state.image_rect.y,
|
||||
- width, height);
|
||||
+ /* We know this will never fail with the image backend; but
|
||||
+ * instead of calling into it directly, we call
|
||||
+ * _cairo_surface_composite so that we get the correct device
|
||||
+ * offset handling.
|
||||
+ */
|
||||
+ status = _cairo_surface_composite (op, src, mask,
|
||||
+ &state.image->base,
|
||||
+ src_x, src_y, mask_x, mask_y,
|
||||
+ dst_x - state.image_rect.x,
|
||||
+ dst_y - state.image_rect.y,
|
||||
+ width, height);
|
||||
_fallback_fini (&state);
|
||||
|
||||
return status;
|
||||
@@ -1086,9 +1111,9 @@
|
||||
rects = offset_rects;
|
||||
}
|
||||
|
||||
- status = state.image->base.backend->fill_rectangles (&state.image->base,
|
||||
- op, color,
|
||||
- rects, num_rects);
|
||||
+ status = _cairo_surface_fill_rectangles (&state.image->base,
|
||||
+ op, color,
|
||||
+ rects, num_rects);
|
||||
|
||||
free (offset_rects);
|
||||
|
||||
@@ -1127,39 +1152,25 @@
|
||||
/* If the destination image isn't at 0,0, we need to offset the trapezoids */
|
||||
|
||||
if (state.image_rect.x != 0 || state.image_rect.y != 0) {
|
||||
|
@ -210,11 +267,28 @@ Index: src/cairo-surface-fallback.c
|
|||
traps = offset_traps;
|
||||
}
|
||||
|
||||
- state.image->base.backend->composite_trapezoids (op, pattern,
|
||||
- &state.image->base,
|
||||
- antialias,
|
||||
- src_x, src_y,
|
||||
- dst_x - state.image_rect.x,
|
||||
- dst_y - state.image_rect.y,
|
||||
- width, height, traps, num_traps);
|
||||
+ _cairo_surface_composite_trapezoids (op, pattern,
|
||||
+ &state.image->base,
|
||||
+ antialias,
|
||||
+ src_x, src_y,
|
||||
+ dst_x - state.image_rect.x,
|
||||
+ dst_y - state.image_rect.y,
|
||||
+ width, height, traps, num_traps);
|
||||
if (offset_traps)
|
||||
free (offset_traps);
|
||||
|
||||
Index: src/cairo-surface.c
|
||||
===================================================================
|
||||
--- src/cairo-surface.c.orig
|
||||
+++ src/cairo-surface.c
|
||||
@@ -89,6 +89,22 @@ const cairo_surface_t _cairo_surface_nil
|
||||
--- src/cairo-surface.c.orig 2006-02-07 16:54:28.108875000 -0800
|
||||
+++ src/cairo-surface.c 2006-02-07 16:58:51.875000000 -0800
|
||||
@@ -89,6 +89,22 @@
|
||||
0 /* current_clip_serial */
|
||||
};
|
||||
|
||||
|
@ -237,7 +311,7 @@ Index: src/cairo-surface.c
|
|||
/**
|
||||
* _cairo_surface_set_error:
|
||||
* @surface: a surface
|
||||
@@ -533,7 +549,10 @@ cairo_surface_mark_dirty_rectangle (cair
|
||||
@@ -533,7 +549,10 @@
|
||||
if (surface->backend->mark_dirty_rectangle) {
|
||||
cairo_status_t status;
|
||||
|
||||
|
@ -249,7 +323,33 @@ Index: src/cairo-surface.c
|
|||
|
||||
if (status)
|
||||
_cairo_surface_set_error (surface, status);
|
||||
@@ -628,6 +647,7 @@ _cairo_surface_release_source_image (cai
|
||||
@@ -578,6 +597,25 @@
|
||||
}
|
||||
|
||||
/**
|
||||
+ * cairo_surface_get_device_offset:
|
||||
+ * @surface: a #cairo_surface_t
|
||||
+ * @x_offset: the offset in the X direction, in device units
|
||||
+ * @y_offset: the offset in the Y direction, in device units
|
||||
+ *
|
||||
+ * Returns a previous device offset set by
|
||||
+ * cairo_surface_set_device_offset().
|
||||
+ *
|
||||
+ **/
|
||||
+void
|
||||
+cairo_surface_get_device_offset (cairo_surface_t *surface,
|
||||
+ double *x_offset,
|
||||
+ double *y_offset)
|
||||
+{
|
||||
+ *x_offset = surface->device_x_offset;
|
||||
+ *y_offset = surface->device_y_offset;
|
||||
+}
|
||||
+
|
||||
+/**
|
||||
* _cairo_surface_acquire_source_image:
|
||||
* @surface: a #cairo_surface_t
|
||||
* @image_out: location to store a pointer to an image surface that
|
||||
@@ -628,6 +666,7 @@
|
||||
* @surface: a #cairo_surface_t
|
||||
* @interest_rect: area of @surface for which fallback drawing is being done.
|
||||
* A value of %NULL indicates that the entire surface is desired.
|
||||
|
@ -257,7 +357,7 @@ Index: src/cairo-surface.c
|
|||
* @image_out: location to store a pointer to an image surface that includes at least
|
||||
* the intersection of @interest_rect with the visible area of @surface.
|
||||
* This surface could be @surface itself, a surface held internal to @surface,
|
||||
@@ -660,10 +680,26 @@ _cairo_surface_acquire_dest_image (cairo
|
||||
@@ -660,10 +699,26 @@
|
||||
cairo_rectangle_t *image_rect,
|
||||
void **image_extra)
|
||||
{
|
||||
|
@ -286,7 +386,7 @@ Index: src/cairo-surface.c
|
|||
}
|
||||
|
||||
/**
|
||||
@@ -685,10 +721,22 @@ _cairo_surface_release_dest_image (cairo
|
||||
@@ -685,10 +740,22 @@
|
||||
cairo_rectangle_t *image_rect,
|
||||
void *image_extra)
|
||||
{
|
||||
|
@ -310,7 +410,7 @@ Index: src/cairo-surface.c
|
|||
image, image_rect, image_extra);
|
||||
}
|
||||
|
||||
@@ -724,6 +772,13 @@ _cairo_surface_clone_similar (cairo_surf
|
||||
@@ -724,6 +791,13 @@
|
||||
return CAIRO_INT_STATUS_UNSUPPORTED;
|
||||
|
||||
status = surface->backend->clone_similar (surface, src, clone_out);
|
||||
|
@ -324,7 +424,7 @@ Index: src/cairo-surface.c
|
|||
if (status != CAIRO_INT_STATUS_UNSUPPORTED)
|
||||
return status;
|
||||
|
||||
@@ -732,6 +787,12 @@ _cairo_surface_clone_similar (cairo_surf
|
||||
@@ -732,6 +806,12 @@
|
||||
return status;
|
||||
|
||||
status = surface->backend->clone_similar (surface, &image->base, clone_out);
|
||||
|
@ -337,7 +437,7 @@ Index: src/cairo-surface.c
|
|||
|
||||
/* If the above failed point, we could implement a full fallback
|
||||
* using acquire_dest_image, but that's going to be very
|
||||
@@ -804,11 +865,29 @@ _cairo_surface_composite (cairo_operator
|
||||
@@ -804,11 +884,29 @@
|
||||
return CAIRO_STATUS_SURFACE_FINISHED;
|
||||
|
||||
if (dst->backend->composite) {
|
||||
|
@ -349,13 +449,13 @@ Index: src/cairo-surface.c
|
|||
+ if (src->type == CAIRO_PATTERN_SURFACE) {
|
||||
+ cairo_surface_t *src_surface = ((cairo_surface_pattern_t*)src)->surface;
|
||||
+ backend_src_x = BACKEND_X(src_surface, src_x);
|
||||
+ backend_src_y = BACKEND_X(src_surface, src_y);
|
||||
+ backend_src_y = BACKEND_Y(src_surface, src_y);
|
||||
+ }
|
||||
+
|
||||
+ if (mask && mask->type == CAIRO_PATTERN_SURFACE) {
|
||||
+ cairo_surface_t *mask_surface = ((cairo_surface_pattern_t*)mask)->surface;
|
||||
+ backend_mask_x = BACKEND_X(mask_surface, mask_x);
|
||||
+ backend_mask_y = BACKEND_X(mask_surface, mask_y);
|
||||
+ backend_mask_y = BACKEND_Y(mask_surface, mask_y);
|
||||
+ }
|
||||
+
|
||||
status = dst->backend->composite (op,
|
||||
|
@ -370,7 +470,7 @@ Index: src/cairo-surface.c
|
|||
width, height);
|
||||
if (status != CAIRO_INT_STATUS_UNSUPPORTED)
|
||||
return status;
|
||||
@@ -937,6 +1016,8 @@ _cairo_surface_fill_rectangles (cairo_su
|
||||
@@ -937,6 +1035,8 @@
|
||||
int num_rects)
|
||||
{
|
||||
cairo_int_status_t status;
|
||||
|
@ -379,7 +479,7 @@ Index: src/cairo-surface.c
|
|||
|
||||
assert (! surface->is_snapshot);
|
||||
|
||||
@@ -950,8 +1031,26 @@ _cairo_surface_fill_rectangles (cairo_su
|
||||
@@ -950,8 +1050,26 @@
|
||||
return CAIRO_STATUS_SUCCESS;
|
||||
|
||||
if (surface->backend->fill_rectangles) {
|
||||
|
@ -408,7 +508,7 @@ Index: src/cairo-surface.c
|
|||
if (status != CAIRO_INT_STATUS_UNSUPPORTED)
|
||||
return status;
|
||||
}
|
||||
@@ -1012,10 +1111,31 @@ _cairo_surface_stroke (cairo_surface_t
|
||||
@@ -1012,10 +1130,31 @@
|
||||
|
||||
if (surface->backend->stroke) {
|
||||
cairo_status_t status;
|
||||
|
@ -441,7 +541,7 @@ Index: src/cairo-surface.c
|
|||
if (status != CAIRO_INT_STATUS_UNSUPPORTED)
|
||||
return status;
|
||||
}
|
||||
@@ -1036,13 +1156,33 @@ _cairo_surface_fill (cairo_surface_t *su
|
||||
@@ -1036,13 +1175,33 @@
|
||||
cairo_antialias_t antialias)
|
||||
{
|
||||
cairo_status_t status;
|
||||
|
@ -476,7 +576,7 @@ Index: src/cairo-surface.c
|
|||
if (status != CAIRO_INT_STATUS_UNSUPPORTED)
|
||||
return status;
|
||||
}
|
||||
@@ -1067,6 +1207,7 @@ _cairo_surface_composite_trapezoids (cai
|
||||
@@ -1067,6 +1226,7 @@
|
||||
int num_traps)
|
||||
{
|
||||
cairo_int_status_t status;
|
||||
|
@ -484,7 +584,7 @@ Index: src/cairo-surface.c
|
|||
|
||||
assert (! dst->is_snapshot);
|
||||
|
||||
@@ -1082,13 +1223,36 @@ _cairo_surface_composite_trapezoids (cai
|
||||
@@ -1082,13 +1242,36 @@
|
||||
return CAIRO_STATUS_SURFACE_FINISHED;
|
||||
|
||||
if (dst->backend->composite_trapezoids) {
|
||||
|
@ -523,7 +623,7 @@ Index: src/cairo-surface.c
|
|||
if (status != CAIRO_INT_STATUS_UNSUPPORTED)
|
||||
return status;
|
||||
}
|
||||
@@ -1235,6 +1399,9 @@ _cairo_surface_set_clip_region (cairo_su
|
||||
@@ -1235,6 +1418,9 @@
|
||||
pixman_region16_t *region,
|
||||
unsigned int serial)
|
||||
{
|
||||
|
@ -533,7 +633,7 @@ Index: src/cairo-surface.c
|
|||
if (surface->status)
|
||||
return surface->status;
|
||||
|
||||
@@ -1242,10 +1409,50 @@ _cairo_surface_set_clip_region (cairo_su
|
||||
@@ -1242,10 +1428,50 @@
|
||||
return CAIRO_STATUS_SURFACE_FINISHED;
|
||||
|
||||
assert (surface->backend->set_clip_region != NULL);
|
||||
|
@ -586,7 +686,7 @@ Index: src/cairo-surface.c
|
|||
}
|
||||
|
||||
cairo_int_status_t
|
||||
@@ -1255,6 +1462,10 @@ _cairo_surface_intersect_clip_path (cair
|
||||
@@ -1255,6 +1481,10 @@
|
||||
double tolerance,
|
||||
cairo_antialias_t antialias)
|
||||
{
|
||||
|
@ -597,7 +697,7 @@ Index: src/cairo-surface.c
|
|||
if (surface->status)
|
||||
return surface->status;
|
||||
|
||||
@@ -1263,11 +1474,30 @@ _cairo_surface_intersect_clip_path (cair
|
||||
@@ -1263,11 +1493,30 @@
|
||||
|
||||
assert (surface->backend->intersect_clip_path != NULL);
|
||||
|
||||
|
@ -633,7 +733,7 @@ Index: src/cairo-surface.c
|
|||
}
|
||||
|
||||
static cairo_status_t
|
||||
@@ -1283,11 +1513,11 @@ _cairo_surface_set_clip_path_recursive (
|
||||
@@ -1283,11 +1532,11 @@
|
||||
if (status)
|
||||
return status;
|
||||
|
||||
|
@ -650,7 +750,7 @@ Index: src/cairo-surface.c
|
|||
}
|
||||
|
||||
/**
|
||||
@@ -1390,13 +1620,20 @@ cairo_status_t
|
||||
@@ -1390,13 +1639,20 @@
|
||||
_cairo_surface_get_extents (cairo_surface_t *surface,
|
||||
cairo_rectangle_t *rectangle)
|
||||
{
|
||||
|
@ -672,7 +772,7 @@ Index: src/cairo-surface.c
|
|||
}
|
||||
|
||||
cairo_status_t
|
||||
@@ -1408,13 +1645,34 @@ _cairo_surface_show_glyphs (cairo_surfac
|
||||
@@ -1408,13 +1664,34 @@
|
||||
cairo_scaled_font_t *scaled_font)
|
||||
{
|
||||
cairo_status_t status;
|
||||
|
@ -709,7 +809,7 @@ Index: src/cairo-surface.c
|
|||
if (status != CAIRO_INT_STATUS_UNSUPPORTED)
|
||||
return status;
|
||||
}
|
||||
@@ -1444,6 +1702,7 @@ _cairo_surface_old_show_glyphs (cairo_sc
|
||||
@@ -1444,6 +1721,7 @@
|
||||
int num_glyphs)
|
||||
{
|
||||
cairo_status_t status;
|
||||
|
@ -717,7 +817,7 @@ Index: src/cairo-surface.c
|
|||
|
||||
assert (! dst->is_snapshot);
|
||||
|
||||
@@ -1453,14 +1712,35 @@ _cairo_surface_old_show_glyphs (cairo_sc
|
||||
@@ -1453,14 +1731,35 @@
|
||||
if (dst->finished)
|
||||
return CAIRO_STATUS_SURFACE_FINISHED;
|
||||
|
||||
|
@ -756,7 +856,7 @@ Index: src/cairo-surface.c
|
|||
status = CAIRO_INT_STATUS_UNSUPPORTED;
|
||||
|
||||
return status;
|
||||
@@ -1570,7 +1850,15 @@ _cairo_surface_composite_fixup_unbounded
|
||||
@@ -1570,7 +1869,15 @@
|
||||
cairo_rectangle_t *mask_rectangle = NULL;
|
||||
|
||||
assert (! dst->is_snapshot);
|
||||
|
@ -773,7 +873,7 @@ Index: src/cairo-surface.c
|
|||
/* The RENDER/libpixman operators are clipped to the bounds of the untransformed,
|
||||
* non-repeating sources and masks. Other sources and masks can be ignored.
|
||||
*/
|
||||
@@ -1645,6 +1933,10 @@ _cairo_surface_composite_shape_fixup_unb
|
||||
@@ -1645,6 +1952,10 @@
|
||||
cairo_rectangle_t *mask_rectangle = NULL;
|
||||
|
||||
assert (! dst->is_snapshot);
|
||||
|
@ -786,9 +886,9 @@ Index: src/cairo-surface.c
|
|||
* non-repeating sources and masks. Other sources and masks can be ignored.
|
||||
Index: src/cairo-traps.c
|
||||
===================================================================
|
||||
--- src/cairo-traps.c.orig
|
||||
+++ src/cairo-traps.c
|
||||
@@ -258,6 +258,54 @@ _cairo_traps_translate (cairo_traps_t *t
|
||||
--- src/cairo-traps.c.orig 2006-02-07 16:54:28.123875000 -0800
|
||||
+++ src/cairo-traps.c 2006-02-07 16:55:54.687500000 -0800
|
||||
@@ -258,6 +258,54 @@
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -843,16 +943,16 @@ Index: src/cairo-traps.c
|
|||
cairo_status_t
|
||||
_cairo_traps_tessellate_triangle (cairo_traps_t *traps, cairo_point_t t[3])
|
||||
{
|
||||
@@ -859,4 +907,3 @@ _cairo_traps_extract_region (cairo_traps
|
||||
@@ -859,4 +907,3 @@
|
||||
|
||||
return CAIRO_STATUS_SUCCESS;
|
||||
}
|
||||
-
|
||||
Index: src/cairoint.h
|
||||
===================================================================
|
||||
--- src/cairoint.h.orig
|
||||
+++ src/cairoint.h
|
||||
@@ -1466,6 +1466,13 @@ _cairo_path_fixed_bounds (cairo_path_fix
|
||||
--- src/cairoint.h.orig 2006-02-07 16:54:28.135875000 -0800
|
||||
+++ src/cairoint.h 2006-02-07 16:55:54.687500000 -0800
|
||||
@@ -1466,6 +1466,13 @@
|
||||
double *x1, double *y1,
|
||||
double *x2, double *y2);
|
||||
|
||||
|
@ -866,7 +966,7 @@ Index: src/cairoint.h
|
|||
/* cairo_path_fill.c */
|
||||
cairo_private cairo_status_t
|
||||
_cairo_path_fixed_fill_to_traps (cairo_path_fixed_t *path,
|
||||
@@ -1996,6 +2003,13 @@ cairo_private cairo_status_t
|
||||
@@ -1996,6 +2003,13 @@
|
||||
_cairo_traps_extract_region (cairo_traps_t *tr,
|
||||
pixman_region16_t **region);
|
||||
|
||||
|
@ -882,9 +982,9 @@ Index: src/cairoint.h
|
|||
_cairo_slope_init (cairo_slope_t *slope, cairo_point_t *a, cairo_point_t *b);
|
||||
Index: test/buffer-diff.c
|
||||
===================================================================
|
||||
--- test/buffer-diff.c.orig
|
||||
+++ test/buffer-diff.c
|
||||
@@ -62,7 +62,9 @@ buffer_diff_core (unsigned char *_buf_a,
|
||||
--- test/buffer-diff.c.orig 2006-02-07 16:54:28.141875000 -0800
|
||||
+++ test/buffer-diff.c 2006-02-07 16:55:54.703125000 -0800
|
||||
@@ -62,7 +62,9 @@
|
||||
unsigned char *_buf_diff,
|
||||
int width,
|
||||
int height,
|
||||
|
@ -895,7 +995,7 @@ Index: test/buffer-diff.c
|
|||
pixman_bits_t mask)
|
||||
{
|
||||
int x, y;
|
||||
@@ -72,12 +74,14 @@ buffer_diff_core (unsigned char *_buf_a,
|
||||
@@ -72,12 +74,14 @@
|
||||
pixman_bits_t *buf_b = (pixman_bits_t*)_buf_b;
|
||||
pixman_bits_t *buf_diff = (pixman_bits_t*)_buf_diff;
|
||||
|
||||
|
@ -914,7 +1014,7 @@ Index: test/buffer-diff.c
|
|||
for (x = 0; x < width; x++)
|
||||
{
|
||||
/* check if the pixels are the same */
|
||||
@@ -112,9 +116,12 @@ buffer_diff (unsigned char *buf_a,
|
||||
@@ -112,9 +116,12 @@
|
||||
unsigned char *buf_diff,
|
||||
int width,
|
||||
int height,
|
||||
|
@ -929,7 +1029,7 @@ Index: test/buffer-diff.c
|
|||
}
|
||||
|
||||
int
|
||||
@@ -123,9 +130,12 @@ buffer_diff_noalpha (unsigned char *buf_
|
||||
@@ -123,9 +130,12 @@
|
||||
unsigned char *buf_diff,
|
||||
int width,
|
||||
int height,
|
||||
|
@ -944,7 +1044,7 @@ Index: test/buffer-diff.c
|
|||
}
|
||||
|
||||
/* Image comparison code courtesy of Richard Worth <richard@theworths.org>
|
||||
@@ -136,11 +146,16 @@ buffer_diff_noalpha (unsigned char *buf_
|
||||
@@ -136,11 +146,16 @@
|
||||
int
|
||||
image_diff (const char *filename_a,
|
||||
const char *filename_b,
|
||||
|
@ -962,7 +1062,7 @@ Index: test/buffer-diff.c
|
|||
unsigned char *buf_a, *buf_b, *buf_diff;
|
||||
read_png_status_t status;
|
||||
|
||||
@@ -154,9 +169,13 @@ image_diff (const char *filename_a,
|
||||
@@ -154,9 +169,13 @@
|
||||
return -1;
|
||||
}
|
||||
|
||||
|
@ -978,7 +1078,7 @@ Index: test/buffer-diff.c
|
|||
{
|
||||
cairo_test_log ("Error: Image size mismatch: (%dx%d@%d) vs. (%dx%d@%d)\n"
|
||||
" for %s vs. %s\n",
|
||||
@@ -168,17 +187,27 @@ image_diff (const char *filename_a,
|
||||
@@ -168,17 +187,27 @@
|
||||
return -1;
|
||||
}
|
||||
|
||||
|
@ -1013,7 +1113,7 @@ Index: test/buffer-diff.c
|
|||
}
|
||||
|
||||
free (buf_a);
|
||||
@@ -204,7 +233,11 @@ image_diff (const char *filename_a,
|
||||
@@ -204,7 +233,11 @@
|
||||
int
|
||||
image_diff_flattened (const char *filename_a,
|
||||
const char *filename_b,
|
||||
|
@ -1026,7 +1126,7 @@ Index: test/buffer-diff.c
|
|||
{
|
||||
int pixels_changed;
|
||||
unsigned int width_a, height_a, stride_a;
|
||||
@@ -225,6 +258,11 @@ image_diff_flattened (const char *filena
|
||||
@@ -225,6 +258,11 @@
|
||||
return -1;
|
||||
}
|
||||
|
||||
|
@ -1038,7 +1138,7 @@ Index: test/buffer-diff.c
|
|||
if (width_a != width_b ||
|
||||
height_a != height_b ||
|
||||
stride_a != stride_b)
|
||||
@@ -252,6 +290,8 @@ image_diff_flattened (const char *filena
|
||||
@@ -252,6 +290,8 @@
|
||||
CAIRO_FORMAT_ARGB32,
|
||||
width_b, height_b,
|
||||
stride_b);
|
||||
|
@ -1047,7 +1147,7 @@ Index: test/buffer-diff.c
|
|||
cr = cairo_create (b_flat_surface);
|
||||
|
||||
cairo_set_source_rgb (cr, 1, 1, 1);
|
||||
@@ -263,8 +303,11 @@ image_diff_flattened (const char *filena
|
||||
@@ -263,8 +303,11 @@
|
||||
cairo_surface_destroy (b_flat_surface);
|
||||
cairo_surface_destroy (buf_b_surface);
|
||||
|
||||
|
@ -1063,9 +1163,9 @@ Index: test/buffer-diff.c
|
|||
FILE *png_file = fopen (filename_diff, "wb");
|
||||
Index: test/buffer-diff.h
|
||||
===================================================================
|
||||
--- test/buffer-diff.h.orig
|
||||
+++ test/buffer-diff.h
|
||||
@@ -36,7 +36,9 @@ buffer_diff (unsigned char *buf_a,
|
||||
--- test/buffer-diff.h.orig 2006-02-07 16:54:28.146875000 -0800
|
||||
+++ test/buffer-diff.h 2006-02-07 16:55:54.703125000 -0800
|
||||
@@ -36,7 +36,9 @@
|
||||
unsigned char *buf_diff,
|
||||
int width,
|
||||
int height,
|
||||
|
@ -1076,7 +1176,7 @@ Index: test/buffer-diff.h
|
|||
|
||||
/* Returns number of pixels changed ignoring the alpha channel.
|
||||
* Also fills in a "diff" buffer intended to visually show where the
|
||||
@@ -48,7 +50,10 @@ buffer_diff_noalpha (unsigned char *buf_
|
||||
@@ -48,7 +50,10 @@
|
||||
unsigned char *buf_diff,
|
||||
int width,
|
||||
int height,
|
||||
|
@ -1088,7 +1188,7 @@ Index: test/buffer-diff.h
|
|||
|
||||
/* Returns number of pixels changed, (or -1 on error).
|
||||
* Also saves a "diff" image intended to visually show where the
|
||||
@@ -57,13 +62,21 @@ buffer_diff_noalpha (unsigned char *buf_
|
||||
@@ -57,13 +62,21 @@
|
||||
int
|
||||
image_diff (const char *filename_a,
|
||||
const char *filename_b,
|
||||
|
@ -1114,9 +1214,9 @@ Index: test/buffer-diff.h
|
|||
#endif
|
||||
Index: test/cairo-test.c
|
||||
===================================================================
|
||||
--- test/cairo-test.c.orig
|
||||
+++ test/cairo-test.c
|
||||
@@ -61,6 +61,8 @@ xunlink (const char *pathname);
|
||||
--- test/cairo-test.c.orig 2006-02-07 16:54:28.151875000 -0800
|
||||
+++ test/cairo-test.c 2006-02-07 16:55:54.703125000 -0800
|
||||
@@ -61,6 +61,8 @@
|
||||
#define CAIRO_TEST_REF_SUFFIX "-ref.png"
|
||||
#define CAIRO_TEST_DIFF_SUFFIX "-diff.png"
|
||||
|
||||
|
@ -1125,7 +1225,7 @@ Index: test/cairo-test.c
|
|||
/* A fake format we use for the flattened ARGB output of the PS and
|
||||
* PDF surfaces. */
|
||||
#define CAIRO_TEST_CONTENT_COLOR_ALPHA_FLATTENED -1
|
||||
@@ -1345,12 +1347,13 @@ cleanup_svg (void *closure)
|
||||
@@ -1345,12 +1347,13 @@
|
||||
static cairo_test_status_t
|
||||
cairo_test_for_target (cairo_test_t *test,
|
||||
cairo_test_draw_function_t draw,
|
||||
|
@ -1141,7 +1241,7 @@ Index: test/cairo-test.c
|
|||
char *srcdir;
|
||||
char *format;
|
||||
cairo_test_status_t ret;
|
||||
@@ -1361,8 +1364,13 @@ cairo_test_for_target (cairo_test_t *tes
|
||||
@@ -1361,8 +1364,13 @@
|
||||
srcdir = ".";
|
||||
format = _cairo_test_content_name (target->content);
|
||||
|
||||
|
@ -1157,7 +1257,7 @@ Index: test/cairo-test.c
|
|||
xasprintf (&ref_name, "%s/%s-%s-%s%s", srcdir, test->name,
|
||||
target->name, format, CAIRO_TEST_REF_SUFFIX);
|
||||
if (access (ref_name, F_OK) != 0) {
|
||||
@@ -1376,17 +1384,30 @@ cairo_test_for_target (cairo_test_t *tes
|
||||
@@ -1376,17 +1384,30 @@
|
||||
xasprintf (&ref_name, "%s/%s-%s%s", srcdir, test->name,
|
||||
format,CAIRO_TEST_REF_SUFFIX);
|
||||
}
|
||||
|
@ -1190,7 +1290,7 @@ Index: test/cairo-test.c
|
|||
cr = cairo_create (surface);
|
||||
|
||||
/* Clear to transparent (or black) depending on whether the target
|
||||
@@ -1420,9 +1441,9 @@ cairo_test_for_target (cairo_test_t *tes
|
||||
@@ -1420,9 +1441,9 @@
|
||||
int pixels_changed;
|
||||
(target->write_to_png) (surface, png_name);
|
||||
if (target->content == CAIRO_TEST_CONTENT_COLOR_ALPHA_FLATTENED)
|
||||
|
@ -1202,7 +1302,7 @@ Index: test/cairo-test.c
|
|||
if (pixels_changed) {
|
||||
if (pixels_changed > 0)
|
||||
cairo_test_log ("Error: %d pixels differ from reference image %s\n",
|
||||
@@ -1447,6 +1468,7 @@ UNWIND_STRINGS:
|
||||
@@ -1447,6 +1468,7 @@
|
||||
free (png_name);
|
||||
free (ref_name);
|
||||
free (diff_name);
|
||||
|
@ -1210,7 +1310,7 @@ Index: test/cairo-test.c
|
|||
|
||||
return ret;
|
||||
}
|
||||
@@ -1455,7 +1477,7 @@ static cairo_test_status_t
|
||||
@@ -1455,7 +1477,7 @@
|
||||
cairo_test_expecting (cairo_test_t *test, cairo_test_draw_function_t draw,
|
||||
cairo_test_status_t expectation)
|
||||
{
|
||||
|
@ -1219,7 +1319,7 @@ Index: test/cairo-test.c
|
|||
const char *tname;
|
||||
cairo_test_status_t status, ret;
|
||||
cairo_test_target_t **targets_to_test;
|
||||
@@ -1599,39 +1621,45 @@ cairo_test_expecting (cairo_test_t *test
|
||||
@@ -1599,39 +1621,45 @@
|
||||
*/
|
||||
ret = CAIRO_TEST_UNTESTED;
|
||||
for (i = 0; i < num_targets; i++) {
|
||||
|
@ -1299,8 +1399,8 @@ Index: test/cairo-test.c
|
|||
if (ret == CAIRO_TEST_UNTESTED)
|
||||
Index: test/imagediff.c
|
||||
===================================================================
|
||||
--- test/imagediff.c.orig
|
||||
+++ test/imagediff.c
|
||||
--- test/imagediff.c.orig 2006-02-07 16:54:28.156875000 -0800
|
||||
+++ test/imagediff.c 2006-02-07 16:55:54.703125000 -0800
|
||||
@@ -34,48 +34,31 @@
|
||||
int
|
||||
main (int argc, char *argv[])
|
||||
|
@ -1364,9 +1464,9 @@ Index: test/imagediff.c
|
|||
}
|
||||
Index: test/xlib-surface.c
|
||||
===================================================================
|
||||
--- test/xlib-surface.c.orig
|
||||
+++ test/xlib-surface.c
|
||||
@@ -160,6 +160,8 @@ do_test (Display *dpy,
|
||||
--- test/xlib-surface.c.orig 2006-02-07 16:54:28.161875000 -0800
|
||||
+++ test/xlib-surface.c 2006-02-07 16:55:54.703125000 -0800
|
||||
@@ -160,6 +160,8 @@
|
||||
diff_data + offset,
|
||||
SIZE - OFFSCREEN_OFFSET,
|
||||
SIZE - OFFSCREEN_OFFSET,
|
||||
|
@ -1375,7 +1475,7 @@ Index: test/xlib-surface.c
|
|||
4 * SIZE);
|
||||
} else {
|
||||
result = !buffer_diff_noalpha (reference_data,
|
||||
@@ -167,6 +169,8 @@ do_test (Display *dpy,
|
||||
@@ -167,6 +169,8 @@
|
||||
diff_data,
|
||||
SIZE,
|
||||
SIZE,
|
||||
|
|
|
@ -0,0 +1,60 @@
|
|||
Index: fbcompose.c
|
||||
===================================================================
|
||||
RCS file: /cvsroot/mozilla/gfx/cairo/libpixman/src/fbcompose.c,v
|
||||
retrieving revision 1.6
|
||||
diff -u -8 -p -r1.6 fbcompose.c
|
||||
--- pixman/src/fbcompose.c 11 Jan 2006 00:48:57 -0000 1.6
|
||||
+++ pixman/src/fbcompose.c 8 Feb 2006 00:27:16 -0000
|
||||
@@ -23,16 +23,17 @@
|
||||
* OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
|
||||
* SOFTWARE.
|
||||
*/
|
||||
#ifdef HAVE_CONFIG_H
|
||||
#include <config.h>
|
||||
#endif
|
||||
#include "pixman-xserver-compat.h"
|
||||
#include "fbpict.h"
|
||||
+#include "fbmmx.h"
|
||||
|
||||
#ifdef RENDER
|
||||
|
||||
#include "pixregionint.h"
|
||||
|
||||
#ifdef _MSC_VER
|
||||
#define _USE_MATH_DEFINES
|
||||
#endif
|
||||
@@ -3756,16 +3757,34 @@ fbCompositeRect (const FbComposeData *da
|
||||
data->mask->componentAlpha &&
|
||||
PICT_FORMAT_RGB (data->mask->format_code))
|
||||
{
|
||||
CARD32 *mask_buffer = dest_buffer + data->width;
|
||||
CombineFuncC compose = composeFunctions.combineC[data->op];
|
||||
if (!compose)
|
||||
return;
|
||||
|
||||
+ /* XXX: The non-MMX version of some of the fbCompose functions
|
||||
+ * overwrite the source or mask data (ones that use
|
||||
+ * fbCombineMaskC, fbCombineMaskAlphaC, or fbCombineMaskValueC
|
||||
+ * as helpers). This causes problems with the optimization in
|
||||
+ * this function that only fetches the source or mask once if
|
||||
+ * possible. If we're on a non-MMX machine, disable this
|
||||
+ * optimization as a bandaid fix.
|
||||
+ *
|
||||
+ * https://bugs.freedesktop.org/show_bug.cgi?id=5777
|
||||
+ */
|
||||
+#ifdef USE_MMX
|
||||
+ if (!fbHaveMMX())
|
||||
+#endif
|
||||
+ {
|
||||
+ srcClass = SourcePictClassUnknown;
|
||||
+ maskClass = SourcePictClassUnknown;
|
||||
+ }
|
||||
+
|
||||
for (i = 0; i < data->height; ++i) {
|
||||
/* fill first half of scanline with source */
|
||||
if (fetchSrc)
|
||||
{
|
||||
if (fetchMask)
|
||||
{
|
||||
/* fetch mask before source so that fetching of
|
||||
source can be optimized */
|
|
@ -28,6 +28,7 @@
|
|||
#endif
|
||||
#include "pixman-xserver-compat.h"
|
||||
#include "fbpict.h"
|
||||
#include "fbmmx.h"
|
||||
|
||||
#ifdef RENDER
|
||||
|
||||
|
@ -3761,6 +3762,24 @@ fbCompositeRect (const FbComposeData *data, CARD32 *scanline_buffer)
|
|||
if (!compose)
|
||||
return;
|
||||
|
||||
/* XXX: The non-MMX version of some of the fbCompose functions
|
||||
* overwrite the source or mask data (ones that use
|
||||
* fbCombineMaskC, fbCombineMaskAlphaC, or fbCombineMaskValueC
|
||||
* as helpers). This causes problems with the optimization in
|
||||
* this function that only fetches the source or mask once if
|
||||
* possible. If we're on a non-MMX machine, disable this
|
||||
* optimization as a bandaid fix.
|
||||
*
|
||||
* https://bugs.freedesktop.org/show_bug.cgi?id=5777
|
||||
*/
|
||||
#ifdef USE_MMX
|
||||
if (!fbHaveMMX())
|
||||
#endif
|
||||
{
|
||||
srcClass = SourcePictClassUnknown;
|
||||
maskClass = SourcePictClassUnknown;
|
||||
}
|
||||
|
||||
for (i = 0; i < data->height; ++i) {
|
||||
/* fill first half of scanline with source */
|
||||
if (fetchSrc)
|
||||
|
|
|
@ -1,8 +1,8 @@
|
|||
Index: pixman/src/pixman-xserver-compat.h
|
||||
===================================================================
|
||||
--- pixman/src/pixman-xserver-compat.h.orig
|
||||
+++ pixman/src/pixman-xserver-compat.h
|
||||
@@ -72,8 +72,8 @@ typedef pixman_triangle_t xTriangle;
|
||||
--- pixman/src/pixman-xserver-compat.h.orig 2005-08-10 21:10:13.000000000 -0700
|
||||
+++ pixman/src/pixman-xserver-compat.h 2006-02-02 16:00:06.109375000 -0800
|
||||
@@ -72,8 +72,8 @@
|
||||
#define FB_SHIFT IC_SHIFT
|
||||
#define FB_MASK IC_MASK
|
||||
#define FB_ALLONES IC_ALLONES
|
||||
|
@ -14,9 +14,9 @@ Index: pixman/src/pixman-xserver-compat.h
|
|||
* ugly hacks... */
|
||||
Index: pixman/src/pixregion.c
|
||||
===================================================================
|
||||
--- pixman/src/pixregion.c.orig
|
||||
+++ pixman/src/pixregion.c
|
||||
@@ -60,7 +60,7 @@ SOFTWARE.
|
||||
--- pixman/src/pixregion.c.orig 2005-08-22 12:15:28.000000000 -0700
|
||||
+++ pixman/src/pixregion.c 2006-02-02 16:00:06.109375000 -0800
|
||||
@@ -60,7 +60,7 @@
|
||||
#endif
|
||||
|
||||
#undef assert
|
||||
|
@ -25,7 +25,7 @@ Index: pixman/src/pixregion.c
|
|||
#define assert(expr) {if (!(expr)) \
|
||||
FatalError("Assertion failed file %s, line %d: expr\n", \
|
||||
__FILE__, __LINE__); }
|
||||
@@ -208,7 +208,7 @@ if (((numRects) < ((reg)->data->size >>
|
||||
@@ -208,7 +208,7 @@
|
||||
}
|
||||
|
||||
|
||||
|
@ -34,7 +34,7 @@ Index: pixman/src/pixregion.c
|
|||
int
|
||||
pixman_region16_print(rgn)
|
||||
pixman_region16_t * rgn;
|
||||
@@ -302,7 +302,7 @@ pixman_region16_valid(reg)
|
||||
@@ -302,7 +302,7 @@
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -45,9 +45,9 @@ Index: pixman/src/pixregion.c
|
|||
/* Create a new empty region */
|
||||
Index: src/cairo-gstate.c
|
||||
===================================================================
|
||||
--- src/cairo-gstate.c.orig
|
||||
+++ src/cairo-gstate.c
|
||||
@@ -241,6 +241,13 @@ _cairo_gstate_clone (cairo_gstate_t *oth
|
||||
--- src/cairo-gstate.c.orig 2006-01-06 14:11:07.000000000 -0800
|
||||
+++ src/cairo-gstate.c 2006-02-02 16:00:06.125000000 -0800
|
||||
@@ -241,6 +241,13 @@
|
||||
return gstate;
|
||||
}
|
||||
|
||||
|
@ -63,9 +63,9 @@ Index: src/cairo-gstate.c
|
|||
cairo_status_t
|
||||
Index: src/cairo.c
|
||||
===================================================================
|
||||
--- src/cairo.c.orig
|
||||
+++ src/cairo.c
|
||||
@@ -324,6 +324,29 @@ cairo_restore (cairo_t *cr)
|
||||
--- src/cairo.c.orig 2006-01-18 09:46:42.000000000 -0800
|
||||
+++ src/cairo.c 2006-02-02 16:00:06.125000000 -0800
|
||||
@@ -324,6 +324,29 @@
|
||||
}
|
||||
slim_hidden_def(cairo_restore);
|
||||
|
||||
|
@ -97,9 +97,9 @@ Index: src/cairo.c
|
|||
cairo_push_group (cairo_t *cr)
|
||||
Index: src/cairo.h
|
||||
===================================================================
|
||||
--- src/cairo.h.orig
|
||||
+++ src/cairo.h
|
||||
@@ -252,6 +252,9 @@ cairo_save (cairo_t *cr);
|
||||
--- src/cairo.h.orig 2006-01-22 02:33:26.000000000 -0800
|
||||
+++ src/cairo.h 2006-02-02 16:00:06.125000000 -0800
|
||||
@@ -252,6 +252,9 @@
|
||||
cairo_public void
|
||||
cairo_restore (cairo_t *cr);
|
||||
|
||||
|
@ -111,8 +111,8 @@ Index: src/cairo.h
|
|||
cairo_push_group (cairo_t *cr);
|
||||
Index: src/cairoint.h
|
||||
===================================================================
|
||||
--- src/cairoint.h.orig
|
||||
+++ src/cairoint.h
|
||||
--- src/cairoint.h.orig 2006-01-17 17:01:40.000000000 -0800
|
||||
+++ src/cairoint.h 2006-02-02 16:00:06.125000000 -0800
|
||||
@@ -66,6 +66,10 @@
|
||||
#include "cairo-debug.h"
|
||||
#include <pixman.h>
|
||||
|
@ -124,7 +124,7 @@ Index: src/cairoint.h
|
|||
CAIRO_BEGIN_DECLS
|
||||
|
||||
#if __GNUC__ >= 3 && defined(__ELF__)
|
||||
@@ -132,6 +136,7 @@ CAIRO_BEGIN_DECLS
|
||||
@@ -132,6 +136,7 @@
|
||||
#define INLINE
|
||||
#endif
|
||||
|
||||
|
@ -132,7 +132,7 @@ Index: src/cairoint.h
|
|||
#if HAVE_PTHREAD_H
|
||||
# include <pthread.h>
|
||||
# define CAIRO_MUTEX_DECLARE(name) static pthread_mutex_t name = PTHREAD_MUTEX_INITIALIZER
|
||||
@@ -159,11 +164,9 @@ cairo_private void _cairo_beos_unlock(vo
|
||||
@@ -159,11 +164,9 @@
|
||||
# define CAIRO_MUTEX_LOCK(name) _cairo_beos_lock (&name)
|
||||
# define CAIRO_MUTEX_UNLOCK(name) _cairo_beos_unlock (&name)
|
||||
#endif
|
||||
|
@ -145,7 +145,7 @@ Index: src/cairoint.h
|
|||
# define CAIRO_MUTEX_DECLARE(name)
|
||||
# define CAIRO_MUTEX_DECLARE_GLOBAL(name)
|
||||
# define CAIRO_MUTEX_LOCK(name)
|
||||
@@ -1071,6 +1074,9 @@ _cairo_gstate_destroy (cairo_gstate_t *g
|
||||
@@ -1071,6 +1074,9 @@
|
||||
cairo_private cairo_gstate_t *
|
||||
_cairo_gstate_clone (cairo_gstate_t *gstate);
|
||||
|
||||
|
@ -155,7 +155,7 @@ Index: src/cairoint.h
|
|||
cairo_private cairo_surface_t *
|
||||
_cairo_gstate_get_target (cairo_gstate_t *gstate);
|
||||
|
||||
@@ -2169,6 +2175,7 @@ slim_hidden_proto(cairo_restore)
|
||||
@@ -2169,6 +2175,7 @@
|
||||
slim_hidden_proto(cairo_save)
|
||||
slim_hidden_proto(cairo_stroke_preserve)
|
||||
slim_hidden_proto(cairo_surface_destroy)
|
||||
|
@ -165,8 +165,8 @@ Index: src/cairoint.h
|
|||
|
||||
Index: pixman/src/fbcompose.c
|
||||
===================================================================
|
||||
--- pixman/src/fbcompose.c.orig
|
||||
+++ pixman/src/fbcompose.c
|
||||
--- pixman/src/fbcompose.c.orig 2006-01-04 16:39:23.000000000 -0800
|
||||
+++ pixman/src/fbcompose.c 2006-02-02 16:00:06.140625000 -0800
|
||||
@@ -33,8 +33,16 @@
|
||||
|
||||
#include "pixregionint.h"
|
||||
|
@ -186,8 +186,8 @@ Index: pixman/src/fbcompose.c
|
|||
|
||||
Index: src/cairo-atsui-font.c
|
||||
===================================================================
|
||||
--- src/cairo-atsui-font.c.orig
|
||||
+++ src/cairo-atsui-font.c
|
||||
--- src/cairo-atsui-font.c.orig 2006-01-10 07:54:17.000000000 -0800
|
||||
+++ src/cairo-atsui-font.c 2006-02-02 16:00:06.140625000 -0800
|
||||
@@ -40,6 +40,16 @@
|
||||
#include "cairo.h"
|
||||
#include "cairo-quartz-private.h"
|
||||
|
@ -207,8 +207,8 @@ Index: src/cairo-atsui-font.c
|
|||
|
||||
Index: src/cairo-features.h.in
|
||||
===================================================================
|
||||
--- src/cairo-features.h.in.orig
|
||||
+++ src/cairo-features.h.in
|
||||
--- src/cairo-features.h.in.orig 2005-12-29 07:17:01.000000000 -0800
|
||||
+++ src/cairo-features.h.in 2006-02-02 16:00:06.140625000 -0800
|
||||
@@ -37,6 +37,8 @@
|
||||
#ifndef CAIRO_FEATURES_H
|
||||
#define CAIRO_FEATURES_H
|
||||
|
@ -236,9 +236,9 @@ Index: src/cairo-features.h.in
|
|||
|
||||
Index: src/cairo-win32-surface.c
|
||||
===================================================================
|
||||
--- src/cairo-win32-surface.c.orig
|
||||
+++ src/cairo-win32-surface.c
|
||||
@@ -1062,6 +1062,9 @@ CRITICAL_SECTION cairo_toy_font_face_has
|
||||
--- src/cairo-win32-surface.c.orig 2005-12-16 03:02:35.000000000 -0800
|
||||
+++ src/cairo-win32-surface.c 2006-02-02 16:00:06.140625000 -0800
|
||||
@@ -1062,6 +1062,9 @@
|
||||
CRITICAL_SECTION cairo_scaled_font_map_mutex;
|
||||
CRITICAL_SECTION cairo_ft_unscaled_font_map_mutex;
|
||||
|
||||
|
@ -248,7 +248,7 @@ Index: src/cairo-win32-surface.c
|
|||
BOOL WINAPI
|
||||
DllMain (HINSTANCE hinstDLL,
|
||||
DWORD fdwReason,
|
||||
@@ -1083,4 +1086,6 @@ DllMain (HINSTANCE hinstDLL,
|
||||
@@ -1083,4 +1086,6 @@
|
||||
}
|
||||
return TRUE;
|
||||
}
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
Index: src/cairo-gstate-private.h
|
||||
===================================================================
|
||||
--- src/cairo-gstate-private.h.orig 2006-02-02 16:23:28.687500000 -0800
|
||||
+++ src/cairo-gstate-private.h 2006-02-02 16:23:52.218750000 -0800
|
||||
--- src/cairo-gstate-private.h.orig 2006-02-07 16:54:23.625000000 -0800
|
||||
+++ src/cairo-gstate-private.h 2006-02-07 16:59:51.171875000 -0800
|
||||
@@ -55,7 +55,9 @@
|
||||
|
||||
cairo_clip_t clip;
|
||||
|
@ -15,8 +15,8 @@ Index: src/cairo-gstate-private.h
|
|||
cairo_matrix_t ctm_inverse;
|
||||
Index: src/cairo-gstate.c
|
||||
===================================================================
|
||||
--- src/cairo-gstate.c.orig 2006-02-02 16:23:28.692500000 -0800
|
||||
+++ src/cairo-gstate.c 2006-02-02 16:23:52.234375000 -0800
|
||||
--- src/cairo-gstate.c.orig 2006-02-07 16:55:54.671875000 -0800
|
||||
+++ src/cairo-gstate.c 2006-02-07 16:59:51.171875000 -0800
|
||||
@@ -119,6 +119,8 @@
|
||||
_cairo_clip_init (&gstate->clip, target);
|
||||
|
||||
|
@ -277,9 +277,9 @@ Index: src/cairo-gstate.c
|
|||
cairo_pattern_t *source)
|
||||
Index: src/cairo.c
|
||||
===================================================================
|
||||
--- src/cairo.c.orig 2006-02-02 16:23:28.697500000 -0800
|
||||
+++ src/cairo.c 2006-02-02 16:24:08.984375000 -0800
|
||||
@@ -347,33 +347,120 @@
|
||||
--- src/cairo.c.orig 2006-02-07 16:54:23.652000000 -0800
|
||||
+++ src/cairo.c 2006-02-07 17:00:28.109375000 -0800
|
||||
@@ -347,33 +347,116 @@
|
||||
}
|
||||
slim_hidden_def(moz_cairo_set_target);
|
||||
|
||||
|
@ -307,10 +307,7 @@ Index: src/cairo.c
|
|||
+ cairo_status_t status;
|
||||
+ cairo_rectangle_t extents;
|
||||
+ cairo_surface_t *group_surface = NULL;
|
||||
|
||||
- cr->status = cairoPush (cr);
|
||||
- if (cr->status)
|
||||
- return;
|
||||
+
|
||||
+ /* Get the extents that we'll use in creating our new group surface */
|
||||
+ _cairo_surface_get_extents (_cairo_gstate_get_target (cr->gstate), &extents);
|
||||
+ status = _cairo_clip_intersect_to_rectangle (_cairo_gstate_get_clip (cr->gstate), &extents);
|
||||
|
@ -367,26 +364,24 @@ Index: src/cairo.c
|
|||
+ cairo_surface_reference (group_surface);
|
||||
+
|
||||
+ cairo_restore (cr);
|
||||
+
|
||||
+ if (cr->status)
|
||||
|
||||
- cr->status = cairoPush (cr);
|
||||
if (cr->status)
|
||||
- return;
|
||||
+ goto done;
|
||||
+
|
||||
+ /* Undo the device offset we used; we're back in a normal-sized
|
||||
+ * surface, so this pattern will be positioned at the right place.
|
||||
+ * XXXvlad - er, this doesn't make sense, why does it work?
|
||||
+ */
|
||||
+ //cairo_surface_set_device_offset (group_surface, 0, 0);
|
||||
+
|
||||
+ group_pattern = cairo_pattern_create_for_surface (group_surface);
|
||||
+ if (!group_pattern) {
|
||||
+ cr->status = CAIRO_STATUS_NO_MEMORY;
|
||||
+ goto done;
|
||||
+ }
|
||||
+
|
||||
+done:
|
||||
+ cairo_surface_destroy (group_surface);
|
||||
|
||||
- cr->status = _cairo_gstate_begin_group (cr->gstate);
|
||||
+ _cairo_gstate_get_matrix (cr->gstate, &group_matrix);
|
||||
+ cairo_pattern_set_matrix (cr->gstate, &group_matrix);
|
||||
+done:
|
||||
+ cairo_surface_destroy (group_surface);
|
||||
+
|
||||
+ return group_pattern;
|
||||
}
|
||||
+slim_hidden_def(cairo_pop_group);
|
||||
|
@ -415,19 +410,41 @@ Index: src/cairo.c
|
|||
|
||||
/**
|
||||
* cairo_set_operator:
|
||||
@@ -2421,7 +2508,7 @@
|
||||
@@ -2421,6 +2504,30 @@
|
||||
if (cr->status)
|
||||
return (cairo_surface_t*) &_cairo_surface_nil;
|
||||
|
||||
- return _cairo_gstate_get_target (cr->gstate);
|
||||
+ return _cairo_gstate_get_original_target (cr->gstate);
|
||||
+}
|
||||
+
|
||||
+/**
|
||||
+ * cairo_get_group_target:
|
||||
+ * @cr: a cairo context
|
||||
+ *
|
||||
+ * Gets the target surface for the current transparency group
|
||||
+ * started by the last cairo_push_group() call on the cairo
|
||||
+ * context.
|
||||
+ *
|
||||
+ * This function may return NULL if there is no transparency
|
||||
+ * group on the target.
|
||||
+ *
|
||||
+ * Return value: the target group surface, or NULL if none. This
|
||||
+ * object is owned by cairo. To keep a reference to it, you must call
|
||||
+ * cairo_surface_reference().
|
||||
+ **/
|
||||
+cairo_surface_t *
|
||||
+cairo_get_group_target (cairo_t *cr)
|
||||
+{
|
||||
+ if (cr->status)
|
||||
+ return (cairo_surface_t*) &_cairo_surface_nil;
|
||||
+
|
||||
return _cairo_gstate_get_target (cr->gstate);
|
||||
}
|
||||
|
||||
/**
|
||||
Index: src/cairo.h
|
||||
===================================================================
|
||||
--- src/cairo.h.orig 2006-02-02 16:23:28.701500000 -0800
|
||||
+++ src/cairo.h 2006-02-02 16:23:52.250000000 -0800
|
||||
--- src/cairo.h.orig 2006-02-07 16:57:25.890625000 -0800
|
||||
+++ src/cairo.h 2006-02-07 17:00:08.843750000 -0800
|
||||
@@ -255,13 +255,14 @@
|
||||
cairo_public void
|
||||
moz_cairo_set_target (cairo_t *cr, cairo_surface_t *target);
|
||||
|
@ -446,10 +463,20 @@ Index: src/cairo.h
|
|||
|
||||
/* Modify state */
|
||||
|
||||
@@ -996,6 +997,9 @@
|
||||
cairo_public cairo_surface_t *
|
||||
cairo_get_target (cairo_t *cr);
|
||||
|
||||
+cairo_public cairo_surface_t *
|
||||
+cairo_get_group_target (cairo_t *cr);
|
||||
+
|
||||
typedef enum _cairo_path_data_type {
|
||||
CAIRO_PATH_MOVE_TO,
|
||||
CAIRO_PATH_LINE_TO,
|
||||
Index: src/cairoint.h
|
||||
===================================================================
|
||||
--- src/cairoint.h.orig 2006-02-02 16:23:28.709500000 -0800
|
||||
+++ src/cairoint.h 2006-02-02 16:23:52.250000000 -0800
|
||||
--- src/cairoint.h.orig 2006-02-07 16:55:54.687500000 -0800
|
||||
+++ src/cairoint.h 2006-02-07 16:59:51.265625000 -0800
|
||||
@@ -1077,9 +1077,24 @@
|
||||
cairo_private void
|
||||
_moz_cairo_gstate_set_target (cairo_gstate_t *gstate, cairo_surface_t *target);
|
||||
|
@ -487,8 +514,8 @@ Index: src/cairoint.h
|
|||
CAIRO_END_DECLS
|
||||
Index: test/Makefile.am
|
||||
===================================================================
|
||||
--- test/Makefile.am.orig 2006-02-02 16:23:28.719500000 -0800
|
||||
+++ test/Makefile.am 2006-02-02 16:23:52.250000000 -0800
|
||||
--- test/Makefile.am.orig 2006-02-07 16:54:23.790000000 -0800
|
||||
+++ test/Makefile.am 2006-02-07 16:59:51.265625000 -0800
|
||||
@@ -59,7 +59,8 @@
|
||||
unantialiased-shapes \
|
||||
unbounded-operator \
|
||||
|
@ -510,7 +537,7 @@ Index: test/Makefile.am
|
|||
Index: test/push-group.c
|
||||
===================================================================
|
||||
--- /dev/null 1970-01-01 00:00:00.000000000 +0000
|
||||
+++ test/push-group.c 2006-02-02 16:23:52.265625000 -0800
|
||||
+++ test/push-group.c 2006-02-07 16:59:51.265625000 -0800
|
||||
@@ -0,0 +1,119 @@
|
||||
+/*
|
||||
+ * Copyright © 2005 Mozilla Corporation
|
||||
|
|
Загрузка…
Ссылка в новой задаче