[Swfdec] 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
Benjamin Otte
company at kemper.freedesktop.org
Thu Jun 14 01:02:45 PDT 2007
libswfdec/swfdec_edittext_movie.c | 9 +++++++--
libswfdec/swfdec_movie.c | 10 ++++------
libswfdec/swfdec_movie.h | 2 ++
libswfdec/swfdec_sprite.c | 2 ++
libswfdec/swfdec_sprite_movie.c | 5 +++--
player/swfdec_debug_movies.c | 2 +-
6 files changed, 19 insertions(+), 11 deletions(-)
New commits:
diff-tree 0b73bfda7d0a1f59ecaa8f2f2e8e1519b4a2d668 (from e19bb05ecfe5bd2c134f1f1a21fb846179721d65)
Author: Benjamin Otte <otte at gnome.org>
Date: Thu Jun 14 10:02:00 2007 +0200
copy x0 and y0, too
diff --git a/libswfdec/swfdec_movie.c b/libswfdec/swfdec_movie.c
index 3bfd642..361f68d 100644
--- a/libswfdec/swfdec_movie.c
+++ b/libswfdec/swfdec_movie.c
@@ -138,10 +138,7 @@ swfdec_movie_update_matrix (SwfdecMovie
{
double d, e;
- movie->matrix.xx = movie->original_transform.xx;
- movie->matrix.xy = movie->original_transform.xy;
- movie->matrix.yx = movie->original_transform.yx;
- movie->matrix.yy = movie->original_transform.yy;
+ movie->matrix = movie->original_transform;
d = movie->xscale / swfdec_matrix_get_xscale (&movie->original_transform);
e = movie->yscale / swfdec_matrix_get_yscale (&movie->original_transform);
diff-tree e19bb05ecfe5bd2c134f1f1a21fb846179721d65 (from 76e741342c4dab3f7f40715b8018c1f5f8394ef9)
Author: Benjamin Otte <otte at gnome.org>
Date: Thu Jun 14 09:55:42 2007 +0200
add has_color_transform and has_transform field to SwfdecContent
SwfdecContent needs to die, but that's another big reorg patch I'm scared of atm.
As far as I see it, a SwfdecSprite should just save all displaylist tags (the
stuff that's called actions right now) verbatim in a long list of buffers and
whenever we execute these tags, we just iterate through this list and parse the
tags.
This makes startup extremely fast (no need to parse anything) and fits exactly
into the curent model. And we save quite some meory as we don't need to allocate
loads of SwfdecContent structures.
diff --git a/libswfdec/swfdec_movie.c b/libswfdec/swfdec_movie.c
index 53ca79e..3bfd642 100644
--- a/libswfdec/swfdec_movie.c
+++ b/libswfdec/swfdec_movie.c
@@ -991,8 +991,9 @@ swfdec_movie_new_for_content (SwfdecMovi
movie = swfdec_movie_new (player, content->depth, parent, content->graphic,
content->name ? swfdec_as_context_get_string (SWFDEC_AS_CONTEXT (player), content->name) : NULL);
- swfdec_movie_set_static_properties (movie, &content->transform,
- &content->color_transform, content->ratio, content->clip_depth, content->events);
+ swfdec_movie_set_static_properties (movie, content->has_transform ? &content->transform : NULL,
+ content->has_color_transform ? &content->color_transform : NULL,
+ content->ratio, content->clip_depth, content->events);
g_queue_push_tail (player->init_queue, movie);
g_queue_push_tail (player->construct_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/libswfdec/swfdec_sprite.c
index de4c741..cd678a9 100644
--- a/libswfdec/swfdec_sprite.c
+++ b/libswfdec/swfdec_sprite.c
@@ -309,6 +309,7 @@ swfdec_spriteseg_do_place_object (Swfdec
content->transform.xx, content->transform.yx,
content->transform.xy, content->transform.yy,
content->transform.x0, content->transform.y0);
+ content->has_transform = TRUE;
}
if (has_color_transform) {
swfdec_bits_get_color_transform (bits, &content->color_transform);
@@ -317,6 +318,7 @@ swfdec_spriteseg_do_place_object (Swfdec
content->color_transform.ga, content->color_transform.gb,
content->color_transform.ba, content->color_transform.bb,
content->color_transform.aa, content->color_transform.ab);
+ content->has_color_transform = TRUE;
}
swfdec_bits_syncbits (bits);
if (has_ratio) {
diff --git a/libswfdec/swfdec_sprite_movie.c b/libswfdec/swfdec_sprite_movie.c
index 3996095..14a307c 100644
--- a/libswfdec/swfdec_sprite_movie.c
+++ b/libswfdec/swfdec_sprite_movie.c
@@ -86,8 +86,9 @@ swfdec_sprite_movie_perform_one_action (
child = swfdec_movie_find (mov, content->depth);
if (child != NULL) {
/* FIXME: add ability to change characters - This needs lots of refactoring */
- swfdec_movie_set_static_properties (child, &content->transform,
- &content->color_transform, content->ratio, content->clip_depth, content->events);
+ swfdec_movie_set_static_properties (movie, content->has_transform ? &content->transform : NULL,
+ content->has_color_transform ? &content->color_transform : NULL,
+ content->ratio, content->clip_depth, content->events);
if (content->name && !g_str_equal (content->name, child->name)) {
/* test this more */
child->name = swfdec_as_context_get_string (SWFDEC_AS_CONTEXT (player), content->name);
diff-tree 76e741342c4dab3f7f40715b8018c1f5f8394ef9 (from e5c0ec6cf693d7ecd933b0f81b903ecbee748574)
Author: Benjamin Otte <otte at gnome.org>
Date: Thu Jun 14 09:31:05 2007 +0200
disable the movie list until the movie-added/removed signals get fixed
diff --git a/player/swfdec_debug_movies.c b/player/swfdec_debug_movies.c
index 6dfa3b4..d2049b6 100644
--- a/player/swfdec_debug_movies.c
+++ b/player/swfdec_debug_movies.c
@@ -359,7 +359,7 @@ swfdec_debug_movies_new (SwfdecPlayer *p
movies = g_object_new (SWFDEC_TYPE_DEBUG_MOVIES, NULL);
movies->player = player;
g_object_ref (player);
- if (SWFDEC_IS_DEBUGGER (player)) {
+ if (SWFDEC_IS_DEBUGGER (player) && FALSE) {
g_signal_connect (player, "movie-added", G_CALLBACK (swfdec_debug_movies_added), movies);
g_signal_connect (player, "movie-removed", G_CALLBACK (swfdec_debug_movies_removed), movies);
}
diff-tree e5c0ec6cf693d7ecd933b0f81b903ecbee748574 (from bc7113af3746577aab5a3fd69e30394070d3517c)
Author: Benjamin Otte <otte at gnome.org>
Date: Thu Jun 14 09:30:28 2007 +0200
don't invalidate the movie on dispose()
diff --git a/libswfdec/swfdec_edittext_movie.c b/libswfdec/swfdec_edittext_movie.c
index 8e9de1a..1243da8 100644
--- a/libswfdec/swfdec_edittext_movie.c
+++ b/libswfdec/swfdec_edittext_movie.c
@@ -56,9 +56,14 @@ swfdec_edit_text_movie_render (SwfdecMov
static void
swfdec_edit_text_movie_dispose (GObject *object)
{
- SwfdecEditTextMovie *text = SWFDEC_EDIT_TEXT_MOVIE (object);
+ SwfdecEditTextMovie *movie = SWFDEC_EDIT_TEXT_MOVIE (object);
- swfdec_edit_text_movie_set_text (text, NULL);
+ if (movie->paragraph) {
+ swfdec_paragraph_free (movie->paragraph);
+ movie->paragraph = NULL;
+ }
+ g_free (movie->str);
+ movie->str = NULL;
G_OBJECT_CLASS (swfdec_edit_text_movie_parent_class)->dispose (object);
}
More information about the Swfdec
mailing list