search for: cairo_matrix_t

Displaying 20 results from an estimated 30 matches for "cairo_matrix_t".

2007 Apr 13
0
5 commits - libswfdec/Makefile.am libswfdec/swfdec_color.c libswfdec/swfdec_color.h libswfdec/swfdec_font.c libswfdec/swfdec_loadertarget.c libswfdec/swfdec_movie.h libswfdec/swfdec_pattern.c libswfdec/swfdec_pattern.h libswfdec/swfdec_player.c
...libswfdec/swfdec_color.c b/libswfdec/swfdec_color.c index 23fda5a..83be167 100644 --- a/libswfdec/swfdec_color.c +++ b/libswfdec/swfdec_color.c @@ -250,3 +250,26 @@ swfdec_matrix_get_rotation (const cairo_ return atan2 (matrix->yx, matrix->xx) * 180 / G_PI; } +void +swfdec_matrix_morph (cairo_matrix_t *dest, const cairo_matrix_t *start, + const cairo_matrix_t *end, guint ratio) +{ + guint inv_ratio = 65535 - ratio; + g_assert (ratio < 65536); + + if (ratio == 0) { + *dest = *start; + return; + } + if (ratio == 65535) { + *dest = *end; + return; + } + dest->xx = (start...
2007 Dec 10
0
6 commits - libswfdec/Makefile.am libswfdec/swfdec_as_interpret.c libswfdec/swfdec_color_as.c libswfdec/swfdec_graphic_movie.c libswfdec/swfdec_image_decoder.c libswfdec/swfdec_morph_movie.c libswfdec/swfdec_movie_as_drawing.c
..._DEFINE_TYPE (SwfdecGraphicMovie, swfdec_graphic_movie, SWFDEC_TYPE_MOVIE) @@ -49,6 +50,15 @@ swfdec_graphic_movie_render (SwfdecMovie *movie, cairo_t *cr, swfdec_graphic_render (movie->graphic, cr, trans, inval); } +static void +swfdec_graphic_movie_invalidate (SwfdecMovie *movie, const cairo_matrix_t *matrix, gboolean last) +{ + SwfdecRect rect; + + swfdec_rect_transform (&rect, &movie->graphic->extents, matrix); + swfdec_player_invalidate (SWFDEC_PLAYER (SWFDEC_AS_OBJECT (movie)->context), &rect); +} + static SwfdecMovie * swfdec_graphic_movie_contains (SwfdecMovie *m...
2007 Nov 20
0
4 commits - libswfdec/swfdec_movie.c libswfdec/swfdec_movie.h libswfdec/swfdec_resource.c test/image test/trace
...ec/swfdec_movie.c b/libswfdec/swfdec_movie.c index 2325138..a3772c8 100644 --- a/libswfdec/swfdec_movie.c +++ b/libswfdec/swfdec_movie.c @@ -564,6 +564,32 @@ swfdec_movie_rect_local_to_global (SwfdecMovie *movie, SwfdecRect *rect) } void +swfdec_movie_global_to_local_matrix (SwfdecMovie *movie, cairo_matrix_t *matrix) +{ + g_return_if_fail (SWFDEC_IS_MOVIE (movie)); + g_return_if_fail (matrix != NULL); + + cairo_matrix_init_identity (matrix); + while (movie) { + cairo_matrix_multiply (matrix, &movie->inverse_matrix, matrix); + movie = movie->parent; + } +} + +void +swfdec_movie_loca...
2008 Jan 02
0
3 commits - libswfdec/swfdec_movie.c test/trace
...++ b/libswfdec/swfdec_movie.c @@ -950,12 +950,20 @@ swfdec_movie_render (SwfdecMovie *movie, cairo_t *cr, cairo_pattern_t *mask; if (movie->parent == movie->masked_by->parent) { cairo_transform (cr, &movie->inverse_matrix); + rect = *inval; } else { - cairo_matrix_t mat; + cairo_matrix_t mat, mat2; swfdec_movie_local_to_global_matrix (movie, &mat); + swfdec_movie_global_to_local_matrix (movie->masked_by, &mat2); + cairo_matrix_multiply (&mat, &mat2, &mat); cairo_transform (cr, &mat); - swfdec_movie_g...
2007 Jun 28
0
Branch 'as' - 4 commits - libswfdec/swfdec_debugger.c libswfdec/swfdec_movie.c libswfdec/swfdec_movie.h libswfdec/swfdec_sprite_movie.c test/image
...API) diff --git a/libswfdec/swfdec_movie.c b/libswfdec/swfdec_movie.c index e157437..d7403c5 100644 --- a/libswfdec/swfdec_movie.c +++ b/libswfdec/swfdec_movie.c @@ -943,10 +943,11 @@ swfdec_movie_new (SwfdecPlayer *player, */ void swfdec_movie_set_static_properties (SwfdecMovie *movie, const cairo_matrix_t *transform, - const SwfdecColorTransform *ctrans, guint ratio, int clip_depth, SwfdecEventList *events) + const SwfdecColorTransform *ctrans, int ratio, int clip_depth, SwfdecEventList *events) { g_return_if_fail (SWFDEC_IS_MOVIE (movie)); g_return_if_fail (clip_depth >= -16384 || c...
2007 Feb 13
0
9 commits - libswfdec/js libswfdec/swfdec_bits.c libswfdec/swfdec_bits.h libswfdec/swfdec_codec_screen.c libswfdec/swfdec_image.c libswfdec/swfdec_script.c test/Makefile.am test/swfdec_out.c test/swfdec_out.h test/swfedit.c test/swfedit_file.c
...dit_matrix_write (SwfeditToken *token, gpointer data, SwfdecOut *out, gconstpointer hint) { swfdec_out_put_matrix (out, data); } static gpointer -swfedit_matrix_read (SwfdecBits *bits, gconstpointer hint) +swfedit_matrix_read (SwfeditToken *token, SwfdecBits *bits, gconstpointer hint) { cairo_matrix_t *matrix = g_new (cairo_matrix_t, 1); @@ -186,13 +187,13 @@ swfedit_matrix_read (SwfdecBits *bits, g } static void -swfedit_ctrans_write (gpointer data, SwfdecOut *out, gconstpointer hint) +swfedit_ctrans_write (SwfeditToken *token, gpointer data, SwfdecOut *out, gconstpointer hint) { swfd...
2007 Dec 03
0
12 commits - libswfdec/Makefile.am libswfdec/swfdec_as_strings.c libswfdec/swfdec_as_types.c libswfdec/swfdec_as_types.h libswfdec/swfdec_gradient_pattern.c libswfdec/swfdec_gradient_pattern.h libswfdec/swfdec_movie_as_drawing.c libswfdec/swfdec_pattern.c
...sprite_movie_gradient_fill_get_length (colors); + a = swfdec_sprite_movie_gradient_fill_get_length (alphas); + r = swfdec_sprite_movie_gradient_fill_get_length (ratios); + if (c != a || a != r) + return -1; + return c; +} + +static void +swfdec_sprite_movie_extract_matrix (SwfdecAsObject *o, cairo_matrix_t *mat) +{ + SwfdecAsContext *cx = o->context; + SwfdecAsValue val; + + /* FIXME: This function does not call valueOf in the right order */ + if (swfdec_as_object_get_variable (o, SWFDEC_AS_STR_matrixType, &val)) { + const char *s = swfdec_as_value_to_string (cx, &val); + cairo_m...
2007 Feb 06
0
Branch 'interpreter' - 15 commits - configure.ac libswfdec/swfdec_audio_event.c libswfdec/swfdec_button_movie.c libswfdec/swfdec_color.c libswfdec/swfdec_color.h libswfdec/swfdec_compiler.c libswfdec/swfdec_image.c libswfdec/swfdec_sprite_movie.c
...st, const SwfdecColorTransform *first); unsigned int swfdec_color_apply_transform (unsigned int in, const SwfdecColorTransform * trans); +SwfdecColor swfdec_color_apply_transform_premultiplied (SwfdecColor in, + const SwfdecColorTransform * trans); void swfdec_matrix_ensure_invertible (cairo_matrix_t *matrix, cairo_matrix_t *inverse); double swfdec_matrix_get_xscale (const cairo_matrix_t *matrix); diff-tree 4f17e493901cc45e47302c4fc74e1f685a32755e (from 469f29442894cdea2116ac801501057266f28727) Author: Benjamin Otte <otte@gnome.org> Date: Tue Feb 6 09:50:11 2007 +0100 Check action...
2007 Jan 26
0
libswfdec/swfdec_image.c libswfdec/swfdec_image.h libswfdec/swfdec_pattern.c
...wfDecoder * s); int tag_func_define_bits_jpeg (SwfdecSwfDecoder * s); diff --git a/libswfdec/swfdec_pattern.c b/libswfdec/swfdec_pattern.c index 312118f..f8902ef 100644 --- a/libswfdec/swfdec_pattern.c +++ b/libswfdec/swfdec_pattern.c @@ -267,7 +267,8 @@ swfdec_image_pattern_paint (SwfdecPatter cairo_matrix_t mat; cairo_surface_t *surface; - surface = swfdec_image_get_surface (image->image); + surface = swfdec_image_get_surface_for_target (image->image, + cairo_get_target (cr)); cairo_append_path (cr, (cairo_path_t *) path); color = swfdec_color_apply_transform (0xFFFFFFFF, tr...
2007 Feb 06
0
21 commits - configure.ac libswfdec/swfdec_audio_event.c libswfdec/swfdec_bits.c libswfdec/swfdec_button_movie.c libswfdec/swfdec_color.c libswfdec/swfdec_color.h libswfdec/swfdec_compiler.c libswfdec/swfdec_edittext.c libswfdec/swfdec_image.c
...st, const SwfdecColorTransform *first); unsigned int swfdec_color_apply_transform (unsigned int in, const SwfdecColorTransform * trans); +SwfdecColor swfdec_color_apply_transform_premultiplied (SwfdecColor in, + const SwfdecColorTransform * trans); void swfdec_matrix_ensure_invertible (cairo_matrix_t *matrix, cairo_matrix_t *inverse); double swfdec_matrix_get_xscale (const cairo_matrix_t *matrix); diff-tree 4f17e493901cc45e47302c4fc74e1f685a32755e (from 469f29442894cdea2116ac801501057266f28727) Author: Benjamin Otte <otte@gnome.org> Date: Tue Feb 6 09:50:11 2007 +0100 Check action...
2007 Nov 22
0
5 commits - libswfdec/swfdec_as_interpret.c libswfdec/swfdec_bits.c libswfdec/swfdec_bits.h libswfdec/swfdec_debugger.c libswfdec/swfdec_movie.c libswfdec/swfdec_script.c libswfdec/swfdec_sprite_movie.c libswfdec/swfdec_tag.c libswfdec/swfdec_text_field.c
...* @bits: a #SwfdecBits diff --git a/libswfdec/swfdec_bits.h b/libswfdec/swfdec_bits.h index defa165..29e9cce 100644 --- a/libswfdec/swfdec_bits.h +++ b/libswfdec/swfdec_bits.h @@ -62,9 +62,8 @@ void swfdec_bits_get_color_transform (SwfdecBits * bits, void swfdec_bits_get_matrix (SwfdecBits * bits, cairo_matrix_t *matrix, cairo_matrix_t *inverse); guint swfdec_bits_skip_bytes (SwfdecBits *bits, guint bytes); -char *swfdec_bits_get_string (SwfdecBits * bits); char *swfdec_bits_get_string_length (SwfdecBits * bits, guint len); -char *swfdec_bits_get_string_with_version (SwfdecBits *bits, guint version...
2007 Mar 29
0
libswfdec-gtk/swfdec_playback_alsa.c libswfdec/swfdec_audio_event.h libswfdec/swfdec_audio_flv.h libswfdec/swfdec_audio_stream.h libswfdec/swfdec_bits.c libswfdec/swfdec_bits.h libswfdec/swfdec_buffer.c libswfdec/swfdec_buffer.h libswfdec/swfdec_cache.c
...ec/swfdec_movie.h +++ b/libswfdec/swfdec_movie.h @@ -45,7 +45,7 @@ struct _SwfdecContent { SwfdecGraphic * graphic; /* object to display or NULL */ int depth; /* at which depth to display */ int clip_depth; /* clip depth of object */ - unsigned int ratio; + guint ratio; cairo_matrix_t transform; SwfdecColorTransform color_transform; char * name; diff --git a/libswfdec/swfdec_pattern.c b/libswfdec/swfdec_pattern.c index f2d665a..4e32436 100644 --- a/libswfdec/swfdec_pattern.c +++ b/libswfdec/swfdec_pattern.c @@ -15,9 +15,9 @@ static void swfdec_matrix_morph (cairo_matr...
2007 Jun 14
0
Branch 'as' - 4 commits - libswfdec/swfdec_edittext_movie.c libswfdec/swfdec_movie.c libswfdec/swfdec_movie.h libswfdec/swfdec_sprite.c libswfdec/swfdec_sprite_movie.c player/swfdec_debug_movies.c
...nstruct_queue, movie); swfdec_movie_queue_script (movie, SWFDEC_EVENT_LOAD); diff --git a/libswfdec/swfdec_movie.h b/libswfdec/swfdec_movie.h index 0b89f52..418236a 100644 --- a/libswfdec/swfdec_movie.h +++ b/libswfdec/swfdec_movie.h @@ -54,6 +54,8 @@ struct _SwfdecContent { guint ratio; cairo_matrix_t transform; SwfdecColorTransform color_transform; + gboolean has_transform : 1; + gboolean has_color_transform : 1; char * name; SwfdecEventList * events; cairo_operator_t operator; /* operator to use when painting (aka blend mode) */ diff --git a/libswfdec/swfdec_sprite.c b/libs...
2007 Nov 28
0
59 commits - libswfdec-gtk/swfdec_gtk_widget.c libswfdec/swfdec_as_object.c libswfdec/swfdec_as_object.h libswfdec/swfdec_button.c libswfdec/swfdec_button.h libswfdec/swfdec_button_movie.c libswfdec/swfdec_button_movie.h libswfdec/swfdec_event.c
...xtents.y1); if (button->events) SWFDEC_MOVIE (movie)->events = swfdec_event_list_copy (button->events); @@ -141,7 +143,7 @@ tag_func_define_button_2 (SwfdecSwfDecoder * s, guint tag) while (swfdec_bits_peek_u8 (&bits)) { SwfdecBits tmp; SwfdecBuffer *buffer; - cairo_matrix_t trans, inverse; + cairo_matrix_t trans; SwfdecColorTransform ctrans; guint states, gid; gboolean has_blend_mode, has_filters; @@ -172,7 +174,7 @@ tag_func_define_button_2 (SwfdecSwfDecoder * s, guint tag) states & (1 << SWFDEC_BUTTON_OVER) ? "OVER " :...
2007 Mar 29
0
Branch 'as' - 9 commits - libswfdec-gtk/swfdec_playback_alsa.c libswfdec/js libswfdec/Makefile.am libswfdec/swfdec_as_context.c libswfdec/swfdec_as_context.h libswfdec/swfdec_as_frame.c libswfdec/swfdec_as_frame.h libswfdec/swfdec_as_function.c
...ec/swfdec_movie.h +++ b/libswfdec/swfdec_movie.h @@ -45,7 +45,7 @@ struct _SwfdecContent { SwfdecGraphic * graphic; /* object to display or NULL */ int depth; /* at which depth to display */ int clip_depth; /* clip depth of object */ - unsigned int ratio; + guint ratio; cairo_matrix_t transform; SwfdecColorTransform color_transform; char * name; diff --git a/libswfdec/swfdec_pattern.c b/libswfdec/swfdec_pattern.c index f2d665a..4e32436 100644 --- a/libswfdec/swfdec_pattern.c +++ b/libswfdec/swfdec_pattern.c @@ -15,9 +15,9 @@ static void swfdec_matrix_morph (cairo_matr...
2007 Dec 11
0
3 commits - libswfdec/swfdec_as_context.c libswfdec/swfdec_movie.c test/trace
...e Dec 11 09:53:30 2007 +0100 add testcase for #13529 diff --git a/libswfdec/swfdec_movie.c b/libswfdec/swfdec_movie.c index cf6786a..92a0edb 100644 --- a/libswfdec/swfdec_movie.c +++ b/libswfdec/swfdec_movie.c @@ -1604,8 +1604,8 @@ swfdec_movie_set_static_properties (SwfdecMovie *movie, const cairo_matrix_t *tr movie->rotation = swfdec_matrix_get_rotation (&movie->original_transform); } if (ctrans) { - movie->original_ctrans = *ctrans; swfdec_movie_invalidate_last (movie); + movie->original_ctrans = *ctrans; } if (ratio >= 0 && (guint) ratio != mo...
2008 Jan 07
0
12 commits - configure.ac doc/swfdec.types Makefile.am test/crashfinder.c test/dump.c test/Makefile.am test/swfdec-extract.c test/swfdec_out.c test/swfdec_out.h test/swfedit.c test/swfedit_file.c test/swfedit_file.h test/swfedit_list.c test/swfedit_list.h
...yncbits (out); - swfdec_out_put_bits (out, req, 5); - swfdec_out_put_sbits (out, x0, req); - swfdec_out_put_sbits (out, x1, req); - swfdec_out_put_sbits (out, y0, req); - swfdec_out_put_sbits (out, y1, req); - swfdec_out_syncbits (out); -} - -void -swfdec_out_put_matrix (SwfdecOut *out, const cairo_matrix_t *matrix) -{ - int x, y; - unsigned int xbits, ybits; - - if (matrix->xx != 1.0 || matrix->yy != 1.0) { - swfdec_out_put_bit (out, 1); - x = SWFDEC_DOUBLE_TO_FIXED (matrix->xx); - y = SWFDEC_DOUBLE_TO_FIXED (matrix->yy); - xbits = swfdec_out_sbits_required (x); - ybits...
2007 Aug 29
0
15 commits - libswfdec/swfdec_as_strings.c libswfdec/swfdec_initialize.as libswfdec/swfdec_initialize.h libswfdec/swfdec_movie.c libswfdec/swfdec_movie.h libswfdec/swfdec_sprite.c libswfdec/swfdec_sprite_movie.c libswfdec/swfdec_system_as.c
...able diff --git a/libswfdec/swfdec_movie.c b/libswfdec/swfdec_movie.c index 02904d0..f6b8f55 100644 --- a/libswfdec/swfdec_movie.c +++ b/libswfdec/swfdec_movie.c @@ -1098,7 +1098,8 @@ swfdec_movie_new (SwfdecPlayer *player, */ void swfdec_movie_set_static_properties (SwfdecMovie *movie, const cairo_matrix_t *transform, - const SwfdecColorTransform *ctrans, int ratio, int clip_depth, SwfdecEventList *events) + const SwfdecColorTransform *ctrans, int ratio, int clip_depth, guint blend_mode, + SwfdecEventList *events) { g_return_if_fail (SWFDEC_IS_MOVIE (movie)); g_return_if_fail (clip_de...
2007 Jun 13
0
Branch 'as' - 6 commits - libswfdec/swfdec_as_array.c libswfdec/swfdec_button_movie.c libswfdec/swfdec_morph_movie.c libswfdec/swfdec_movie_asprops.c libswfdec/swfdec_movie.c libswfdec/swfdec_movie.h libswfdec/swfdec_player.c libswfdec/swfdec_sprite.c
...8 @@ swfdec_movie_get_movie_at (SwfdecMovie * clip_depth = 0; for (clip_walk = clip_walk->prev; clip_walk; clip_walk = clip_walk->prev) { SwfdecMovie *clip = walk->data; - if (clip->content->clip_depth) { + if (clip->clip_depth) { double tmpx = x, tmpy = y; cairo_matrix_transform_point (&clip->inverse_matrix, &tmpx, &tmpy); if (!swfdec_movie_mouse_in (clip, tmpx, tmpy)) { - SWFDEC_LOG ("skipping depth %d to %d due to clipping", clip->content->depth, clip->content->clip_depth); - clip_depth = child->content->clip...
2007 Nov 20
0
7 commits - libswfdec/swfdec_movie.c libswfdec/swfdec_sprite_movie_as.c test/image
...he movie's matrix before computing the to/from-global matrix diff --git a/libswfdec/swfdec_movie.c b/libswfdec/swfdec_movie.c index a3772c8..0fbf8a2 100644 --- a/libswfdec/swfdec_movie.c +++ b/libswfdec/swfdec_movie.c @@ -571,6 +571,8 @@ swfdec_movie_global_to_local_matrix (SwfdecMovie *movie, cairo_matrix_t *matrix) cairo_matrix_init_identity (matrix); while (movie) { + if (movie->cache_state >= SWFDEC_MOVIE_INVALID_MATRIX) + swfdec_movie_update (movie); cairo_matrix_multiply (matrix, &movie->inverse_matrix, matrix); movie = movie->parent; } @@ -584,6 +586,...