[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Gnash-commit] gnash ChangeLog server/font.cpp server/font.h s...
From: |
Sandro Santilli |
Subject: |
[Gnash-commit] gnash ChangeLog server/font.cpp server/font.h s... |
Date: |
Sat, 01 Dec 2007 01:08:10 +0000 |
CVSROOT: /sources/gnash
Module name: gnash
Changes by: Sandro Santilli <strk> 07/12/01 01:08:10
Modified files:
. : ChangeLog
server : font.cpp font.h fontlib.cpp fontlib.h impl.cpp
shape.cpp shape.h
server/parser : character_def.h movie_def_impl.cpp
movie_def_impl.h movie_definition.h
shape_character_def.cpp shape_character_def.h
utilities : processor.cpp
Log message:
drop deprecated cache data management and generate_font_bitmaps
interface.
CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/gnash/ChangeLog?cvsroot=gnash&r1=1.5038&r2=1.5039
http://cvs.savannah.gnu.org/viewcvs/gnash/server/font.cpp?cvsroot=gnash&r1=1.49&r2=1.50
http://cvs.savannah.gnu.org/viewcvs/gnash/server/font.h?cvsroot=gnash&r1=1.31&r2=1.32
http://cvs.savannah.gnu.org/viewcvs/gnash/server/fontlib.cpp?cvsroot=gnash&r1=1.37&r2=1.38
http://cvs.savannah.gnu.org/viewcvs/gnash/server/fontlib.h?cvsroot=gnash&r1=1.11&r2=1.12
http://cvs.savannah.gnu.org/viewcvs/gnash/server/impl.cpp?cvsroot=gnash&r1=1.127&r2=1.128
http://cvs.savannah.gnu.org/viewcvs/gnash/server/shape.cpp?cvsroot=gnash&r1=1.50&r2=1.51
http://cvs.savannah.gnu.org/viewcvs/gnash/server/shape.h?cvsroot=gnash&r1=1.34&r2=1.35
http://cvs.savannah.gnu.org/viewcvs/gnash/server/parser/character_def.h?cvsroot=gnash&r1=1.15&r2=1.16
http://cvs.savannah.gnu.org/viewcvs/gnash/server/parser/movie_def_impl.cpp?cvsroot=gnash&r1=1.90&r2=1.91
http://cvs.savannah.gnu.org/viewcvs/gnash/server/parser/movie_def_impl.h?cvsroot=gnash&r1=1.61&r2=1.62
http://cvs.savannah.gnu.org/viewcvs/gnash/server/parser/movie_definition.h?cvsroot=gnash&r1=1.37&r2=1.38
http://cvs.savannah.gnu.org/viewcvs/gnash/server/parser/shape_character_def.cpp?cvsroot=gnash&r1=1.52&r2=1.53
http://cvs.savannah.gnu.org/viewcvs/gnash/server/parser/shape_character_def.h?cvsroot=gnash&r1=1.18&r2=1.19
http://cvs.savannah.gnu.org/viewcvs/gnash/utilities/processor.cpp?cvsroot=gnash&r1=1.70&r2=1.71
Patches:
Index: ChangeLog
===================================================================
RCS file: /sources/gnash/gnash/ChangeLog,v
retrieving revision 1.5038
retrieving revision 1.5039
diff -u -b -r1.5038 -r1.5039
--- ChangeLog 1 Dec 2007 00:30:35 -0000 1.5038
+++ ChangeLog 1 Dec 2007 01:08:08 -0000 1.5039
@@ -1,5 +1,10 @@
2007-11-30 Sandro Santilli <address@hidden>
+ * another bunch of files: drop deprecated cache data management
+ and generate_font_bitmaps interface.
+
+2007-11-30 Sandro Santilli <address@hidden>
+
* server/batch_test.py => testsuite/samples/batch_test.py:
moved what looks like a tester for movies in testsuite/samples
in a more likely place.
Index: server/font.cpp
===================================================================
RCS file: /sources/gnash/gnash/server/font.cpp,v
retrieving revision 1.49
retrieving revision 1.50
diff -u -b -r1.49 -r1.50
--- server/font.cpp 30 Oct 2007 18:55:42 -0000 1.49
+++ server/font.cpp 1 Dec 2007 01:08:08 -0000 1.50
@@ -17,7 +17,7 @@
// Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
//
-/* $Id: font.cpp,v 1.49 2007/10/30 18:55:42 strk Exp $ */
+/* $Id: font.cpp,v 1.50 2007/12/01 01:08:08 strk Exp $ */
// Based on the public domain work of Thatcher Ulrich <address@hidden> 2003
@@ -593,50 +593,6 @@
}
- void font::output_cached_data(tu_file* /* out */, const
cache_options& /* options */)
- // Dump our cached data into the given stream.
- {
-// @@ Disabled. Need to fix input_cached_data, so that it has a
-// reliable and cheap way to skip over data for NULL glyphs.
-#if 0
- // Dump cached shape data for glyphs (i.e. this will
- // be tesselations used to render larger glyph sizes).
- int n = m_glyphs.size();
- out->write_le32(n);
- for (int i = 0; i < n; i++)
- {
- shape_character_def* s = m_glyphs[i].get();
- if (s)
- {
- s->output_cached_data(out, options);
- }
- }
-#endif // 0
- }
-
-
- void font::input_cached_data(tu_file* /* in */)
- // Read our cached data from the given stream.
- {
-// @@ Disable. See comment in output_cached_data().
-#if 0
- // Read cached shape data for glyphs.
- int n = in->read_le32();
- if (n != m_glyphs.size())
- {
- log_error(_("error reading cache file in
font::input_cached_data(): "
- "glyph count mismatch"));
- in->go_to_end(); // ensure that no more data
will be read from this stream.
- return;
- }
-
- for (int i = 0; i < n; i++)
- {
- m_glyphs[i]->input_cached_data(in);
- }
-#endif // 0
- }
-
int
font::add_os_glyph(uint16_t code)
{
Index: server/font.h
===================================================================
RCS file: /sources/gnash/gnash/server/font.h,v
retrieving revision 1.31
retrieving revision 1.32
diff -u -b -r1.31 -r1.32
--- server/font.h 1 Dec 2007 00:14:59 -0000 1.31
+++ server/font.h 1 Dec 2007 01:08:08 -0000 1.32
@@ -241,12 +241,6 @@
///
void read_font_name(stream* in, SWF::tag_type tag, movie_definition*
m);
- /// Dump our cached data into the given stream.
- void output_cached_data(tu_file* out, const cache_options& options);
-
- /// Read our cached data from the given stream.
- void input_cached_data(tu_file* in);
-
/// Delete all our texture glyph info (both embedded and device)
void wipe_texture_glyphs();
Index: server/fontlib.cpp
===================================================================
RCS file: /sources/gnash/gnash/server/fontlib.cpp,v
retrieving revision 1.37
retrieving revision 1.38
diff -u -b -r1.37 -r1.38
--- server/fontlib.cpp 1 Dec 2007 00:14:59 -0000 1.37
+++ server/fontlib.cpp 1 Dec 2007 01:08:09 -0000 1.38
@@ -5,7 +5,7 @@
// A module to take care of all of gnash's loaded fonts.
-/* $Id: fontlib.cpp,v 1.37 2007/12/01 00:14:59 strk Exp $ */
+/* $Id: fontlib.cpp,v 1.38 2007/12/01 01:08:09 strk Exp $ */
#include "tu_file.h"
#include "gnash.h"
@@ -900,50 +900,6 @@
}
-static void generate_font_bitmaps(std::vector<rendered_glyph_info>&
glyph_info, font* f, movie_definition* /* owner */)
- // Render images for each of the font's glyphs, and put the
- // info about them in the given array.
- {
- assert(f);
-
- bool embed=true; // use embedded fonts
-
- f->set_texture_glyph_nominal_size(s_glyph_nominal_size);
-
- for (int i = 0, n = f->getEmbedGlyphCount(); i < n; i++)
- {
- if (f->get_texture_glyph(i, embed).is_renderable() ==
false)
- {
- shape_character_def* sh = f->get_glyph(i,
embed);
- if (sh)
- {
- rect glyph_bounds;
- sh->compute_bound(&glyph_bounds);
-
- if (glyph_bounds.width() < 0)
- {
- // Invalid width; this must be
an empty glyph.
- // Don't bother generating a
texture for it.
- }
- else
- {
- // Add a glyph.
- rendered_glyph_info rgi;
- rgi.m_source_font = f;
- rgi.m_glyph_index = i;
-
- if (render_glyph(rgi, sh) ==
true)
- {
-
glyph_info.push_back(rgi);
- }
- // else glyph is empty
- }
- }
- }
- }
- }
-
-
float get_texture_glyph_max_height(const font* f)
{
return 1024.0f / s_rendering_box *
f->get_texture_glyph_nominal_size(); // s_glyph_nominal_size;
@@ -965,293 +921,6 @@
//
- void generate_font_bitmaps(const std::vector<font*>& fonts,
movie_definition* owner)
- // Build cached textures from glyph outlines.
- {
- assert(s_render_buffer == NULL);
- s_render_buffer = new uint8_t[s_glyph_render_size *
s_glyph_render_size];
-
- // Build the glyph images.
- std::vector<rendered_glyph_info> glyph_info;
- for (unsigned int i = 0; i < fonts.size(); i++)
- {
- generate_font_bitmaps(glyph_info, fonts[i], owner);
- }
-
- // Pack all the rendered glyphs and push the info into their
fonts.
- pack_and_assign_glyphs(glyph_info, owner);
-
- // Delete glyph images.
- {for (int i = 0, n = glyph_info.size(); i < n; i++)
- {
- delete glyph_info[i].m_image;
- }}
- glyph_info.clear();
-
- // Finish off any pending cache texture.
- finish_current_texture(owner);
-
- // Clean up our buffers.
- if (s_current_cache_image)
- {
- delete [] s_current_cache_image;
- s_current_cache_image = NULL;
-
- s_covered_rects.resize(0);
- s_anchor_points.resize(0);
- }
-
- // Clean up the render buffer that we just used.
- assert(s_render_buffer);
- delete [] s_render_buffer;
- s_render_buffer = NULL;
- }
-
-
- void output_cached_data(
- tu_file* out,
- const std::vector<font*>& fonts,
- movie_definition* owner,
- const cache_options& options)
- // Save cached font data, including glyph textures, to a
- // stream. This is used by the movie caching code.
- {
- assert(out);
-
- bool embed=true; // use embedded glyphs
-
- // skip number of bitmaps.
- int bitmaps_used_base = owner->get_bitmap_info_count();
- int size_pos = out->get_position();
- out->write_le16(0);
-
- // save bitmaps
- s_save_dummy_bitmaps = false;
- if (options.m_include_font_bitmaps == false)
- {
- s_save_dummy_bitmaps = true; // HACK!!!
- }
- s_file = out; // HACK!!!
- s_saving = true; // HACK!!!
- wipe_font_textures(fonts); // HACK -- eliminate the font
textures, so generate_font_bitmaps() regen's them.
- generate_font_bitmaps(fonts, owner);
- s_saving = false;
- s_file = NULL;
-
- // save number of bitmaps.
- out->set_position(size_pos);
- out->write_le16(owner->get_bitmap_info_count() -
bitmaps_used_base);
- out->go_to_end();
-
- // save number of fonts.
- out->write_le16(fonts.size());
-
- // for each font:
- for (unsigned int f = 0; f < fonts.size(); f++)
- {
- font* fnt = fonts[f];
-
- // Write out the nominal glyph size for this font (for
calibrating scaling).
- int nominal_glyph_size =
fnt->get_texture_glyph_nominal_size();
- out->write_le16(nominal_glyph_size);
-
- // skip number of glyphs.
- int ng = fonts[f]->getEmbedGlyphCount();
- int ng_position = out->get_position();
- out->write_le32(0);
-
- int n = 0;
-
- // save texture glyphs:
- for (int g = 0; g < ng; g++)
- {
- const texture_glyph& tg =
fonts[f]->get_texture_glyph(g, embed);
- if (tg.is_renderable())
- {
- // save glyph index.
- out->write_le32(g);
-
- // save bitmap index.
- // @@ blech, linear search
- int bi;
- for (bi = bitmaps_used_base; bi <
owner->get_bitmap_info_count(); bi++)
- {
- if (tg.m_bitmap_info ==
owner->get_bitmap_info(bi))
- {
- break;
- }
- }
- assert(bi >= bitmaps_used_base
- && bi <
owner->get_bitmap_info_count());
-
- out->write_le16((uint16_t) (bi -
bitmaps_used_base));
-
- // save rect, position.
-
out->write_float32(tg.m_uv_bounds.get_x_min());
-
out->write_float32(tg.m_uv_bounds.get_y_min());
-
out->write_float32(tg.m_uv_bounds.get_x_max());
-
out->write_float32(tg.m_uv_bounds.get_y_max());
- out->write_float32(tg.m_uv_origin.x);
- out->write_float32(tg.m_uv_origin.y);
- n++;
- }
- }
-
- out->set_position(ng_position);
- out->write_le32(n);
- out->go_to_end();
-
- // Output cached shape data.
- fonts[f]->output_cached_data(out, options);
- }
-
- if (out->get_error() != TU_FILE_NO_ERROR)
- {
- log_error("gnash::fontlib::save_cached_font_data():
problem writing to output stream!");
- }
-
- // @@ NOTE: should drop any bitmap_info's in owner
- // that have a ref count == 1, since they're orphaned
- // now... or else use weak_ptr's in owner?
- }
-
-
- void input_cached_data(tu_file* in, const std::vector<font*>& fonts,
movie_definition* owner)
- // Load a stream containing previously-saved font glyph textures.
- {
- bool embed=true; // use embedded glyphs
-
- // load number of bitmaps.
- int nb = in->read_le16();
-
- int pw = 0, ph = 0;
-
- // load bitmaps.
- int bitmaps_used_base = owner->get_bitmap_info_count();
- for (int b = 0; b < nb; b++)
- {
- // load bitmap size
- int w = in->read_le16();
- int h = in->read_le16();
-
- if (owner->get_create_bitmaps() == DO_LOAD_BITMAPS)
- {
- boost::intrusive_ptr<bitmap_info> bi;
- // load bitmap contents
- if (s_current_cache_image == NULL || w != pw ||
h != ph)
- {
- delete [] s_current_cache_image;
- s_current_cache_image = new
uint8_t[w*h];
- pw = w;
- ph = h;
- }
-
- in->read_bytes(s_current_cache_image, w * h);
-
- bi = render::create_bitmap_info_alpha(
- w,
- h,
- s_current_cache_image);
- owner->add_bitmap_info(bi.get());
-#ifndef GNASH_USE_GC
- assert(bi->get_ref_count() == 2); // one ref for
bi, one for the owner.
-#endif // ndef GNASH_USE_GC
- }
- else { // Skip image data bytes.
- in->set_position(in->get_position() + w * h);
- }
- }
-
- delete [] s_current_cache_image;
- s_current_cache_image = NULL;
-
- // load number of fonts.
- int nf = in->read_le16();
- if (nf != (int) fonts.size())
- {
- // Font counts must match!
- log_error("mismatched font count (read %d, expected "
SIZET_FMT ") in cached font data\n", nf, fonts.size());
- in->go_to_end();
- goto error_exit;
- }
-
- // for each font:
- {for (int f = 0; f < nf; f++)
- {
- font* fnt = fonts[f];
-
- if (in->get_error() != TU_FILE_NO_ERROR)
- {
- log_error("error reading cache file (fonts);
skipping\n");
- return;
- }
- if (in->get_eof())
- {
- log_error("unexpected eof reading cache file
(fonts); skipping\n");
- return;
- }
-
- // Get nominal glyph size for this font (for
calibrating scaling).
- int nominal_glyph_size = in->read_le16();
- fnt->set_texture_glyph_nominal_size(nominal_glyph_size);
-
- // load number of texture glyphs.
- int ng = in->read_le32();
-
- // load glyphs:
- for (int g=0; g<ng; g++)
- {
- // load glyph index.
- int glyph_index = in->read_le32();
-
- texture_glyph tg;
-
- // load bitmap index
- int bi = in->read_le16();
- if (bi + bitmaps_used_base >=
owner->get_bitmap_info_count())
- {
- // Bad data; give up.
- log_error("invalid bitmap index %d in
cached font data\n", bi);
- in->go_to_end();
- goto error_exit;
- }
-
- tg.set_bitmap_info(owner->get_bitmap_info(bi +
bitmaps_used_base));
-
- // load glyph bounds and origin.
- float xmin = in->read_float32();
- float ymin = in->read_float32();
- float xmax = in->read_float32();
- float ymax = in->read_float32();
- tg.m_uv_bounds.enclose_point(xmin, ymin);
- tg.m_uv_bounds.expand_to_point(xmax, ymax);
- tg.m_uv_origin.x = in->read_float32();
- tg.m_uv_origin.y = in->read_float32();
-
- if (glyph_index < 0 || glyph_index >=
fnt->getEmbedGlyphCount())
- {
- // Cached data doesn't match this font!
- log_error("invalid glyph index %d in
cached font data, limit is %d, font is '%s'\n",
- glyph_index,
- fnt->getEmbedGlyphCount(),
- fnt->get_name().c_str());
- }
- else
- {
- fnt->add_texture_glyph(glyph_index, tg,
embed);
- }
- }
-
- // Load cached shape data.
- fnt->input_cached_data(in);
- }}
-
- error_exit:
- ;
-
- }
-
-
void clear()
// Release all the fonts we know about.
{
Index: server/fontlib.h
===================================================================
RCS file: /sources/gnash/gnash/server/fontlib.h,v
retrieving revision 1.11
retrieving revision 1.12
diff -u -b -r1.11 -r1.12
--- server/fontlib.h 1 Dec 2007 00:14:59 -0000 1.11
+++ server/fontlib.h 1 Dec 2007 01:08:09 -0000 1.12
@@ -23,8 +23,6 @@
#include "types.h"
-#include <vector> // for generate_font_bitmaps and {input,output}_cached_data
-
// Forward declarations
class tu_file;
namespace gnash {
@@ -46,19 +44,6 @@
/// provide glyphs for it, and then the OS is expected to
/// provide the font or a suitable replacement.
///
-/// gnash does not try to handle this automatically; if your
-/// host program wants to emulate this behavior, it needs to
-/// load a movie that includes glyph info for the standard
-/// fonts you want, and then explicitly pull those fonts out of
-/// the movie_def and add them to fontlib.
-///
-/// @@ TODO: not all public APIs to enable this are in place
-/// yet! Need md::get_font_count()/get_font(), and
-/// fontlib::add_font().
-///
-/// Otherwise, text written in a font with no glyphs just
-/// doesn't render at all. (@@ Hm, should probably render it
-/// as boxes or something?)
///
namespace fontlib {
@@ -73,21 +58,6 @@
// I.e. the height of the glyph box, in texels.
float get_texture_glyph_max_height(const font* f);
- // Builds cached glyph textures from shape info.
- void generate_font_bitmaps(const std::vector<font*>& fonts,
movie_definition* owner);
-
- // Save cached font data, including glyph textures, to a
- // stream.
- void output_cached_data(
- tu_file* out,
- const std::vector<font*>& fonts,
- movie_definition* owner,
- const cache_options& options);
-
- // Load a stream containing previously-saved cachded font
- // data, including glyph texture info.
- void input_cached_data(tu_file* in, const std::vector<font*>& fonts,
movie_definition* owner);
-
// Controls how large to render textured glyphs.
// Applies to fonts processed *after* this call only.
// The "nominal" size is perhaps around twice the
Index: server/impl.cpp
===================================================================
RCS file: /sources/gnash/gnash/server/impl.cpp,v
retrieving revision 1.127
retrieving revision 1.128
diff -u -b -r1.127 -r1.128
--- server/impl.cpp 28 Nov 2007 15:38:52 -0000 1.127
+++ server/impl.cpp 1 Dec 2007 01:08:09 -0000 1.128
@@ -17,7 +17,7 @@
// Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
//
-/* $Id: impl.cpp,v 1.127 2007/11/28 15:38:52 strk Exp $ */
+/* $Id: impl.cpp,v 1.128 2007/12/01 01:08:09 strk Exp $ */
#ifdef HAVE_CONFIG_H
#include "config.h"
@@ -577,35 +577,6 @@
const char* movie_url = reset_url ? reset_url : c_url;
movie_definition* ret = create_movie(in, movie_url, startLoaderThread);
- if (s_use_cache_files)
- {
- // Try to load a .gsc file.
- // WILL NOT WORK FOR NETWORK URLS, would need an hash
- std::string cache_filename(movie_url);
- cache_filename += ".gsc";
- std::auto_ptr<tu_file> cache_in ( new
tu_file(cache_filename.c_str(), "rb") );
- if (cache_in.get() == NULL
- || cache_in->get_error() != TU_FILE_NO_ERROR)
- {
- // Can't open cache file; don't sweat it.
- IF_VERBOSE_PARSE (
- log_parse(_("note: couldn't open cache file '%s'"),
- cache_filename.c_str());
- )
-
- // can't read cache, so generate font texture data.
- ret->generate_font_bitmaps();
- }
- else
- {
- log_msg(_("Loading cache file %s"),
- cache_filename.c_str());
- // Load the cached data.
- ret->input_cached_data(cache_in.get());
- }
-
- }
-
return ret;
@@ -615,31 +586,6 @@
bool s_no_recurse_while_loading = false; // @@ TODO get rid of this;
make it the normal mode.
-#if 0 // This function seems unused
-movie_definition* create_movie_no_recurse(
- tu_file* in,
- create_bitmaps_flag cbf,
- create_font_shapes_flag cfs)
-{
- ensure_loaders_registered();
-
- // @@ TODO make no_recurse the standard way to load.
- // In create_movie(), use the visit_ API to keep
- // visiting dependent movies, until everything is
- // loaded. That way we only have one code path and
- // the resource_proxy stuff gets tested.
- s_no_recurse_while_loading = true;
-
- movie_def_impl* m = new movie_def_impl(cbf, cfs);
- if ( ! m->read(in) ) return NULL;
-
- s_no_recurse_while_loading = false;
-
- return m;
-}
-#endif
-
-
//
// global gnash management
//
Index: server/shape.cpp
===================================================================
RCS file: /sources/gnash/gnash/server/shape.cpp,v
retrieving revision 1.50
retrieving revision 1.51
diff -u -b -r1.50 -r1.51
--- server/shape.cpp 24 Nov 2007 04:58:13 -0000 1.50
+++ server/shape.cpp 1 Dec 2007 01:08:09 -0000 1.51
@@ -449,33 +449,6 @@
bind(&edge::transform, _1, ref(mat)));
}
-// Utility.
-
-
-void write_coord_array(tu_file* out, const std::vector<int16_t>& pt_array)
- // Dump the given coordinate array into the given stream.
-{
- int n = pt_array.size();
-
- out->write_le32(n);
- for (int i = 0; i < n; i++) {
- out->write_le16((uint16_t) pt_array[i]);
- }
-}
-
-
-void read_coord_array(tu_file* in, std::vector<int16_t>* pt_array)
- // Read the coordinate array data from the stream into *pt_array.
-{
- int n = in->read_le32();
-
- pt_array->resize(n);
- for (int i = 0; i < n; i ++) {
- (*pt_array)[i] = (int16_t) in->read_le16();
- }
-}
-
-
//
// mesh
//
@@ -503,20 +476,6 @@
-void mesh::output_cached_data(tu_file* out)
- // Dump our data to *out.
-{
- write_coord_array(out, m_triangle_strip);
-}
-
-
-void mesh::input_cached_data(tu_file* in)
- // Slurp our data from *out.
-{
- read_coord_array(in, &m_triangle_strip);
-}
-
-
//
// line_strip
//
@@ -553,22 +512,6 @@
-void line_strip::output_cached_data(tu_file* out)
- // Dump our data to *out.
-{
- out->write_le32(m_style);
- write_coord_array(out, m_coords);
-}
-
-
-void line_strip::input_cached_data(tu_file* in)
- // Slurp our data from *out.
-{
- m_style = in->read_le32();
- read_coord_array(in, &m_coords);
-}
-
-
// Utility: very simple greedy tri-stripper. Useful for
// stripping the stacks of trapezoids that come out of our
// tesselator.
@@ -808,45 +751,6 @@
}
-void mesh_set::output_cached_data(tu_file* out)
- // Dump our data to the output stream.
-{
- out->write_float32(m_error_tolerance);
-
- int mesh_n = m_meshes.size();
- out->write_le32(mesh_n);
- for (int i = 0; i < mesh_n; i++) {
- m_meshes[i].output_cached_data(out);
- }
-
- int lines_n = m_line_strips.size();
- out->write_le32(lines_n);
- {for (int i = 0; i < lines_n; i++)
- {
- m_line_strips[i].output_cached_data(out);
- }}
-}
-
-
-void mesh_set::input_cached_data(tu_file* in)
- // Grab our data from the input stream.
-{
- m_error_tolerance = in->read_float32();
-
- int mesh_n = in->read_le32();
- m_meshes.resize(mesh_n);
- for (int i = 0; i < mesh_n; i++) {
- m_meshes[i].input_cached_data(in);
- }
-
- int lines_n = in->read_le32();
- m_line_strips.resize(lines_n);
- {for (int i = 0; i < lines_n; i++)
- {
- m_line_strips[i].input_cached_data(in);
- }}
-}
-
} // end namespace gnash
Index: server/shape.h
===================================================================
RCS file: /sources/gnash/gnash/server/shape.h,v
retrieving revision 1.34
retrieving revision 1.35
diff -u -b -r1.34 -r1.35
--- server/shape.h 1 Dec 2007 00:15:00 -0000 1.34
+++ server/shape.h 1 Dec 2007 01:08:09 -0000 1.35
@@ -5,7 +5,7 @@
// Quadratic bezier outline shapes, the basis for most SWF rendering.
-/* $Id: shape.h,v 1.34 2007/12/01 00:15:00 strk Exp $ */
+/* $Id: shape.h,v 1.35 2007/12/01 01:08:09 strk Exp $ */
#ifndef GNASH_SHAPE_H
#define GNASH_SHAPE_H
@@ -381,8 +381,6 @@
void set_tri_strip(const point pts[], int count);
- void output_cached_data(tu_file* out);
- void input_cached_data(tu_file* in);
private:
friend class triangulating_render_handler;
std::vector<int16_t> m_triangle_strip;
@@ -397,8 +395,6 @@
line_strip(int style, const point coords[], int coord_count);
int get_style() const { return m_style; }
- void output_cached_data(tu_file* out);
- void input_cached_data(tu_file* in);
private:
friend class triangulating_render_handler;
int m_style;
@@ -421,9 +417,6 @@
void set_tri_strip(int style, const point pts[], int count);
void add_line_strip(int style, const point coords[], int
coord_count);
- void output_cached_data(tu_file* out);
- void input_cached_data(tu_file* in);
-
private:
friend class triangulating_render_handler;
// int m_last_frame_rendered; // @@ Hm, we shouldn't
spontaneously drop cached data I don't think...
Index: server/parser/character_def.h
===================================================================
RCS file: /sources/gnash/gnash/server/parser/character_def.h,v
retrieving revision 1.15
retrieving revision 1.16
diff -u -b -r1.15 -r1.16
--- server/parser/character_def.h 6 Aug 2007 03:30:19 -0000 1.15
+++ server/parser/character_def.h 1 Dec 2007 01:08:09 -0000 1.16
@@ -105,19 +105,6 @@
// Declared as virtual here because generic_character needs access to it
virtual const rect& get_bound() const = 0;
- //
- // Caching.
- //
-
- virtual void output_cached_data(tu_file* /*out*/,
- const cache_options& /*options*/)
- {
- }
-
- virtual void input_cached_data(tu_file* /*in*/)
- {
- }
-
public:
/// Cache holder for renderer (contents depend on renderer handler)
Index: server/parser/movie_def_impl.cpp
===================================================================
RCS file: /sources/gnash/gnash/server/parser/movie_def_impl.cpp,v
retrieving revision 1.90
retrieving revision 1.91
diff -u -b -r1.90 -r1.91
--- server/parser/movie_def_impl.cpp 26 Nov 2007 12:56:34 -0000 1.90
+++ server/parser/movie_def_impl.cpp 1 Dec 2007 01:08:09 -0000 1.91
@@ -604,115 +604,6 @@
}
-/* movie_def_impl */
-void movie_def_impl::generate_font_bitmaps()
- // Generate bitmaps for our fonts, if necessary.
-{
- // Collect list of fonts.
- std::vector<font*> fonts;
- get_owned_fonts(&fonts);
- fontlib::generate_font_bitmaps(fonts, this);
-}
-
-void
-movie_def_impl::output_cached_data(tu_file* out, const cache_options& options)
-{
- // Write a little header.
- char header[5];
- strcpy(header, "gscX");
- header[3] = CACHE_FILE_VERSION;
- compiler_assert(CACHE_FILE_VERSION < 256);
-
- out->write_bytes(header, 4);
-
- // Write font data.
- std::vector<font*> fonts;
- get_owned_fonts(&fonts);
- fontlib::output_cached_data(out, fonts, this, options);
-
- // Write character data.
- {
-
- for ( CharacterDictionary::iterator
- it = _dictionary.begin(), itEnd = _dictionary.end();
- it != itEnd;
- ++it )
- {
- out->write_le16(it->first);
- it->second->output_cached_data(out, options);
- }
-
-#if 0
- for (hash<int, boost::intrusive_ptr<character_def> >::iterator it =
m_characters.begin();
- it != m_characters.end();
- ++it)
- {
- out->write_le16(it->first);
- it->second->output_cached_data(out, options);
- }
-#endif
- }
-
- out->write_le16((int16_t) -1); // end of characters marker
-}
-
-
-void
-movie_def_impl::input_cached_data(tu_file* in)
-{
- // Read the header & check version.
- unsigned char header[4];
- in->read_bytes(header, 4);
- if (header[0] != 'g' || header[1] != 's' || header[2] != 'c')
- {
- log_error(_("cache file does not have the correct format;
skipping"));
- return;
- }
- else if (header[3] != CACHE_FILE_VERSION)
- {
- log_error(
- _("cached data is version %d, but we require version %d;
skipping"),
- int(header[3]), CACHE_FILE_VERSION);
- return;
- }
-
- // Read the cached font data.
- std::vector<font*> fonts;
- get_owned_fonts(&fonts);
- fontlib::input_cached_data(in, fonts, this);
-
- // Read the cached character data.
- for (;;)
- {
- if (in->get_error() != TU_FILE_NO_ERROR)
- {
- log_error(_("error reading cache file (characters);
skipping"));
- return;
- }
- if (in->get_eof())
- {
- log_error(_("unexpected eof reading cache file
(characters); skipping"));
- return;
- }
-
- int16_t id = in->read_le16();
- if (id == (int16_t) -1) { break; } // done
-
- boost::intrusive_ptr<character_def> ch =
_dictionary.get_character(id);
- //m_characters.get(id, &ch);
- if (ch != NULL)
- {
- ch->input_cached_data(in);
- }
- else
- {
- log_error(_("sync error in cache file (reading
characters). "
- "Skipping rest of cache data."));
- return;
- }
- }
-}
-
sprite_instance*
movie_def_impl::create_instance()
{
Index: server/parser/movie_def_impl.h
===================================================================
RCS file: /sources/gnash/gnash/server/parser/movie_def_impl.h,v
retrieving revision 1.61
retrieving revision 1.62
diff -u -b -r1.61 -r1.62
--- server/parser/movie_def_impl.h 1 Dec 2007 00:15:00 -0000 1.61
+++ server/parser/movie_def_impl.h 1 Dec 2007 01:08:09 -0000 1.62
@@ -577,18 +577,6 @@
/// Fill up *fonts with fonts that we own.
void get_owned_fonts(std::vector<font*>* fonts);
- /// Generate bitmaps for our fonts, if necessary.
- void generate_font_bitmaps();
-
- /// Dump our cached data into the given stream.
- void output_cached_data(tu_file* out,
- const cache_options& options);
-
- /// \brief
- /// Read in cached data and use it to prime our
- /// loaded characters.
- void input_cached_data(tu_file* in);
-
/// \brief
/// Create a playable movie_root instance from a def.
//
Index: server/parser/movie_definition.h
===================================================================
RCS file: /sources/gnash/gnash/server/parser/movie_definition.h,v
retrieving revision 1.37
retrieving revision 1.38
diff -u -b -r1.37 -r1.38
--- server/parser/movie_definition.h 1 Dec 2007 00:15:00 -0000 1.37
+++ server/parser/movie_definition.h 1 Dec 2007 01:08:09 -0000 1.38
@@ -61,6 +61,7 @@
#include <string>
#include <memory> // for auto_ptr
+#include <vector> // for PlayList typedef
#include <set>
// Forward declarations
@@ -145,21 +146,6 @@
return NULL;
}
- virtual void output_cached_data(tu_file* /*out*/, const
cache_options& /*options*/) {}
- virtual void input_cached_data(tu_file* /*in*/) {}
-
- /// \brief
- /// Causes this movie def to generate texture-mapped
- /// versions of all the fonts it owns.
- //
- /// This improves
- /// speed and quality of text rendering. The
- /// texture-map data is serialized in the
- /// output/input_cached_data() calls, so you can
- /// preprocess this if you load cached data.
- ///
- virtual void generate_font_bitmaps() {}
-
//
// (optional) API to support gnash::create_movie_no_recurse().
//
Index: server/parser/shape_character_def.cpp
===================================================================
RCS file: /sources/gnash/gnash/server/parser/shape_character_def.cpp,v
retrieving revision 1.52
retrieving revision 1.53
diff -u -b -r1.52 -r1.53
--- server/parser/shape_character_def.cpp 30 Nov 2007 11:13:32 -0000
1.52
+++ server/parser/shape_character_def.cpp 1 Dec 2007 01:08:09 -0000
1.53
@@ -17,7 +17,7 @@
// Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
//
-/* $Id: shape_character_def.cpp,v 1.52 2007/11/30 11:13:32 strk Exp $ */
+/* $Id: shape_character_def.cpp,v 1.53 2007/12/01 01:08:09 strk Exp $ */
// Based on the public domain shape.cpp of Thatcher Ulrich <address@hidden>
2003
@@ -1105,45 +1105,6 @@
}
-#if 0 // deprecated
-
-void
-shape_character_def::clear_meshes()
-{
- // Free our mesh_sets.
- for (unsigned int i = 0; i < m_cached_meshes.size(); i++) {
- delete m_cached_meshes[i];
- }
-}
-
-void shape_character_def::output_cached_data(tu_file* out, const
cache_options& /* options */)
- // Dump our precomputed mesh data to the given stream.
-{
- int n = m_cached_meshes.size();
- out->write_le32(n);
-
- for (int i = 0; i < n; i++) {
- m_cached_meshes[i]->output_cached_data(out);
- }
-}
-
-
-void shape_character_def::input_cached_data(tu_file* in)
- // Initialize our mesh data from the given stream.
-{
- int n = in->read_le32();
-
- m_cached_meshes.resize(n);
-
- for (int i = 0; i < n; i++) {
- mesh_set* ms = new mesh_set();
- ms->input_cached_data(in);
- m_cached_meshes[i] = ms;
- }
-}
-
-#endif // deprecated cached data
-
#ifdef GNASH_USE_GC
void
shape_character_def::markReachableResources() const
Index: server/parser/shape_character_def.h
===================================================================
RCS file: /sources/gnash/gnash/server/parser/shape_character_def.h,v
retrieving revision 1.18
retrieving revision 1.19
diff -u -b -r1.18 -r1.19
--- server/parser/shape_character_def.h 1 Dec 2007 00:15:00 -0000 1.18
+++ server/parser/shape_character_def.h 1 Dec 2007 01:08:10 -0000 1.19
@@ -5,7 +5,7 @@
// Quadratic bezier outline shapes, the basis for most SWF rendering.
-/* $Id: shape_character_def.h,v 1.18 2007/12/01 00:15:00 strk Exp $ */
+/* $Id: shape_character_def.h,v 1.19 2007/12/01 01:08:10 strk Exp $ */
#ifndef GNASH_SHAPE_CHARACTER_DEF_H
#define GNASH_SHAPE_CHARACTER_DEF_H
@@ -89,10 +89,6 @@
/// Compute bounds by looking at the component paths
void compute_bound(rect* r) const;
- // deprecated
- //void output_cached_data(tu_file* out, const cache_options&
options);
- //void input_cached_data(tu_file* in);
-
const FillStyleVect& get_fill_styles() const { return
m_fill_styles; }
const LineStyleVect& get_line_styles() const { return
m_line_styles; }
Index: utilities/processor.cpp
===================================================================
RCS file: /sources/gnash/gnash/utilities/processor.cpp,v
retrieving revision 1.70
retrieving revision 1.71
diff -u -b -r1.70 -r1.71
--- utilities/processor.cpp 1 Dec 2007 00:15:03 -0000 1.70
+++ utilities/processor.cpp 1 Dec 2007 01:08:10 -0000 1.71
@@ -16,7 +16,7 @@
// along with this program; if not, write to the Free Software
// Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
-/* $Id: processor.cpp,v 1.70 2007/12/01 00:15:03 strk Exp $ */
+/* $Id: processor.cpp,v 1.71 2007/12/01 01:08:10 strk Exp $ */
#ifdef HAVE_CONFIG_H
#include "config.h"
@@ -96,7 +96,6 @@
};
static gnash::movie_definition* play_movie(const char* filename);
-static int write_cache_file(const movie_data& md);
static bool s_do_output = false;
static bool s_stop_on_errors = true;
@@ -289,20 +288,6 @@
data.push_back(md);
}
- // Now append processed data.
- if (s_do_output) {
- for (int i = 0, n = data.size(); i < n; i++) {
- int error = write_cache_file(data[i]);
- if (error) {
- if (s_stop_on_errors) {
- // Fail.
- fprintf(stderr, "error processing movie '%s', quitting\n",
data[i].m_filename.c_str());
- exit(1);
- }
- }
- }
- }
-
// Signal core lib we're willing to quit.
gnash::clear();
@@ -450,38 +435,6 @@
return md;
}
-int
-// Write a cache file for the given movie.
-write_cache_file(const movie_data& md)
-{
- // Open cache file.
- std::string cache_filename(md.m_filename);
- cache_filename += ".gsc";
- tu_file out(cache_filename.c_str(), "wb"); // "gsc" == "gnash
cache"
- if (out.get_error() == TU_FILE_NO_ERROR) {
- // Write out the data.
- gnash::cache_options opt;
- md.m_movie->output_cached_data(&out, opt);
- if (out.get_error() == TU_FILE_NO_ERROR) {
- printf(
- "wrote '%s'\n",
- cache_filename.c_str());
- } else {
- fprintf(stderr, "error: write failure to '%s'\n",
cache_filename.c_str());
- }
- } else {
- fprintf(stderr, "error: can't open '%s' for cache file output\n",
cache_filename.c_str());
- return 1;
- }
-
- // // xxx temp debug code: dump cached data to stdout
- // tu_file tu_stdout(stdout, false);
- // tu_stdout.copy_from(&cached_data);
-
- return 0;
-}
-
-
static void
usage (const char *name)
{
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Gnash-commit] gnash ChangeLog server/font.cpp server/font.h s...,
Sandro Santilli <=