[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Gnash-commit] /srv/bzr/gnash/trunk r12336: Add output operator for Shap
From: |
Benjamin Wolsey |
Subject: |
[Gnash-commit] /srv/bzr/gnash/trunk r12336: Add output operator for ShapeRecords, drop obsolete code, clean up |
Date: |
Mon, 26 Jul 2010 08:52:37 +0200 |
User-agent: |
Bazaar (2.0.3) |
------------------------------------------------------------
revno: 12336 [merge]
committer: Benjamin Wolsey <address@hidden>
branch nick: trunk
timestamp: Mon 2010-07-26 08:52:37 +0200
message:
Add output operator for ShapeRecords, drop obsolete code, clean up
includes.
removed:
librender/ProxyRenderer.cpp
librender/ProxyRenderer.h
modified:
libcore/parser/sprite_definition.cpp
libcore/parser/sprite_definition.h
libcore/swf/ShapeRecord.cpp
libcore/swf/ShapeRecord.h
libcore/swf/tag_loaders.cpp
=== modified file 'libcore/parser/sprite_definition.cpp'
--- a/libcore/parser/sprite_definition.cpp 2010-06-11 08:10:16 +0000
+++ b/libcore/parser/sprite_definition.cpp 2010-07-26 06:14:03 +0000
@@ -22,8 +22,8 @@
#include "MovieClip.h"
#include "sprite_definition.h"
#include "ControlTag.h" // for dtor visibility
-#include "as_function.h" // for dtor visibility
-#include "SWFStream.h" // for use
+#include "as_function.h"
+#include "SWFStream.h"
#include "GnashAlgorithm.h"
#include "SWFParser.h"
#include "namedStrings.h"
@@ -130,11 +130,6 @@
read(in, runResources);
}
-/*
- * This function is not inlined to avoid having to include as_function.h
- * from sprite_definition.h. We need as_function.h for visibility of
- * as_function destructor by boost::intrusive_ptr
- */
void
sprite_definition::registerClass(as_function* the_class)
{
=== modified file 'libcore/parser/sprite_definition.h'
--- a/libcore/parser/sprite_definition.h 2010-07-19 08:08:00 +0000
+++ b/libcore/parser/sprite_definition.h 2010-07-26 06:14:03 +0000
@@ -34,8 +34,9 @@
// Forward declarations
namespace gnash {
- class SWFStream; // for read signature
- class as_function; // for registerClass/getRegisteredClass
+ class SWFStream;
+ class as_function;
+ class RunResources;
}
namespace gnash
=== modified file 'libcore/swf/ShapeRecord.cpp'
--- a/libcore/swf/ShapeRecord.cpp 2010-03-12 15:42:07 +0000
+++ b/libcore/swf/ShapeRecord.cpp 2010-07-26 06:01:48 +0000
@@ -614,16 +614,17 @@
// the bounds as edges are parsed.
computeBounds(_bounds, _paths, _lineStyles, m.get_version());
}
+
#ifdef GNASH_DEBUG_SHAPE_BOUNDS
else
{
SWFRect computedBounds;
- computeBounds(computedBounds, _paths, _lineStyles, m->get_version());
- if ( computedBounds != m_bounds )
+ computeBounds(computedBounds, _paths, _lineStyles, m.get_version());
+ if ( computedBounds != _bounds )
{
log_debug("Shape object read for tag %d contained embedded "
"bounds %s, while we computed bounds %s",
- tag, m_bound, computedBounds);
+ tag, _bounds, computedBounds);
}
}
#endif
@@ -724,6 +725,13 @@
} // anonymous namespace
+std::ostream&
+operator<<(std::ostream& o, const ShapeRecord& sh)
+{
+ o << "Shape Record: bounds " << sh.getBounds();
+ return o;
+}
+
} // namespace SWF
} // namespace gnash
=== modified file 'libcore/swf/ShapeRecord.h'
--- a/libcore/swf/ShapeRecord.h 2010-01-14 12:03:17 +0000
+++ b/libcore/swf/ShapeRecord.h 2010-07-26 06:01:48 +0000
@@ -156,6 +156,8 @@
};
+std::ostream& operator<<(std::ostream& o, const ShapeRecord& sh);
+
} // namespace SWF
} // namespace gnash
=== modified file 'libcore/swf/tag_loaders.cpp'
--- a/libcore/swf/tag_loaders.cpp 2010-07-24 13:44:22 +0000
+++ b/libcore/swf/tag_loaders.cpp 2010-07-26 06:14:03 +0000
@@ -28,15 +28,11 @@
#include "action_buffer.h"
#include "Font.h"
#include "log.h"
-#include "Geometry.h"
#include "SWFStream.h"
-#include "LineStyle.h"
#include "GnashImage.h"
#include "zlib_adapter.h"
#include "sprite_definition.h"
#include "MovieClip.h"
-#include "Function.h"
-#include "as_function.h"
#include "SWFMovieDefinition.h"
#include "SWF.h"
#include "swf/TagLoadersTable.h"
=== removed file 'librender/ProxyRenderer.cpp'
--- a/librender/ProxyRenderer.cpp 2010-01-01 17:48:26 +0000
+++ b/librender/ProxyRenderer.cpp 1970-01-01 00:00:00 +0000
@@ -1,232 +0,0 @@
-// render.cpp Rendering interface for Gnash
-//
-// Copyright (C) 2008, 2009, 2010 Free Software Foundation, Inc.
-//
-// This program is free software; you can redistribute it and/or modify
-// it under the terms of the GNU General Public License as published by
-// the Free Software Foundation; either version 3 of the License, or
-// (at your option) any later version.
-//
-// This program is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-// GNU General Public License for more details.
-//
-// You should have received a copy of the GNU General Public License
-// along with this program; if not, write to the Free Software
-// Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
-
-// Based on original by Willem Kokke <address@hidden> 2003
-
-#include "GnashImage.h"
-#include "BitmapInfo.h"
-
-// Define this to have all renderer calls print a message (with -vv)
-#undef DEBUG_RENDER_CALLS
-
-#ifdef DEBUG_RENDER_CALLS
- #include "log.h"
-#endif
-
-#include <cassert>
-#include <memory>
-
-namespace gnash {
-static Renderer* s_Renderer = NULL;
-
-void set_Renderer(Renderer* r)
-{
- s_Renderer = r;
-}
-
-Renderer* get_Renderer()
-{
- return s_Renderer;
-}
-
-
-namespace render
-{
-
- /// A fake BitmapInfo created when no renderer
- /// is registered.
- ///
- /// Note that if you register a renderer *after* one of
- /// these bogus BitmapInfo has been created and attached
- /// as the cache of a movie element, things would likely
- /// screw up.
- ///
- class bogus_bi : public BitmapInfo
- {
- public:
- bogus_bi() {}
- };
-
- BitmapInfo* createBitmapInfo(std::auto_ptr<GnashImage> im)
- {
-
- if (!s_Renderer)
- {
- return new bogus_bi;
- }
-
- switch (im->type())
- {
- default:
- log_error ("Attempt to create a bitmap_info "
- "from unsupported image type");
- return NULL;
-
- case GNASH_IMAGE_RGB:
- case GNASH_IMAGE_RGBA:
- {
- return s_Renderer->createBitmapInfo(im);
- }
- }
-
- }
-
- // Draws the video frames
- void drawVideoFrame(GnashImage* frame, const SWFMatrix* mat,
- const SWFRect* bounds, bool smooth)
- {
- if (s_Renderer) {
- return s_Renderer->drawVideoFrame(frame, mat, bounds, smooth);
- }
- }
-
-
- // Bracket the displaying of a frame from a movie.
- // Fill the background color, and set up default
- // transforms, etc.
- void begin_display(
- const rgba& background_color,
- int viewport_x0, int viewport_y0,
- int viewport_width, int viewport_height,
- float x0, float x1, float y0, float y1)
- {
-#ifdef DEBUG_RENDER_CALLS
- GNASH_REPORT_FUNCTION;
-#endif
- if (s_Renderer)
- {
- s_Renderer->begin_display(
- background_color, viewport_x0, viewport_y0,
- viewport_width, viewport_height,
- x0, x1, y0, y1);
- }
-// else
-// {
-// log_error("begin_display called, but no
Renderer was registered by the app!\n");
-// }
- }
-
-
- void end_display()
- {
-#ifdef DEBUG_RENDER_CALLS
- GNASH_REPORT_FUNCTION;
-#endif
- if (s_Renderer) s_Renderer->end_display();
- }
-
-
- void drawLine(const std::vector<point>& coords, const rgba& color,
const SWFMatrix& mat)
- {
-#ifdef DEBUG_RENDER_CALLS
- GNASH_REPORT_FUNCTION;
-#endif
- if (s_Renderer) s_Renderer->drawLine(coords, color, mat);
-}
-
-
-void draw_poly(const point* corners, int corner_count, const rgba& fill,
- const rgba& outline, const SWFMatrix& mat, bool masked)
- {
-#ifdef DEBUG_RENDER_CALLS
- GNASH_REPORT_FUNCTION;
-#endif
- if (s_Renderer) s_Renderer->draw_poly(corners, corner_count,
- fill, outline, mat, masked);
-}
-
-
-void
-drawShape(const SWF::ShapeRecord& shape, const cxform& cx,
- const SWFMatrix& worldMat)
-{
-#ifdef DEBUG_RENDER_CALLS
- GNASH_REPORT_FUNCTION;
-#endif
- if (s_Renderer) s_Renderer->drawShape(shape, cx, worldMat);
-}
-
-void drawGlyph(const SWF::ShapeRecord& rec, const rgba& color,
- const SWFMatrix& mat)
-{
-#ifdef DEBUG_RENDER_CALLS
- GNASH_REPORT_FUNCTION;
-#endif
- if (s_Renderer) s_Renderer->drawGlyph(rec, color, mat);
-}
-
-bool bounds_in_clipping_area(const SWFRect& bounds) {
- return bounds_in_clipping_area(bounds.getRange());
- if (s_Renderer)
- return s_Renderer->bounds_in_clipping_area(bounds);
- else
- return true;
-}
-
-bool bounds_in_clipping_area(const InvalidatedRanges& ranges) {
- if (s_Renderer)
- return s_Renderer->bounds_in_clipping_area(ranges);
- else
- return true;
- }
-
-bool bounds_in_clipping_area(const geometry::Range2d<float>& bounds) {
- if (s_Renderer)
- return s_Renderer->bounds_in_clipping_area(bounds);
- else
- return true;
- }
-
-
-
-
- void begin_submit_mask()
- {
-#ifdef DEBUG_RENDER_CALLS
- GNASH_REPORT_FUNCTION;
-#endif
- if (s_Renderer) s_Renderer->begin_submit_mask();
- }
-
- void end_submit_mask()
- {
-#ifdef DEBUG_RENDER_CALLS
- GNASH_REPORT_FUNCTION;
-#endif
- if (s_Renderer) s_Renderer->end_submit_mask();
- }
-
- void disable_mask()
- {
-#ifdef DEBUG_RENDER_CALLS
- GNASH_REPORT_FUNCTION;
-#endif
- if (s_Renderer) s_Renderer->disable_mask();
- }
-}
-
-
-} // namespace gnash
-
-
-// Local Variables:
-// mode: C++
-// c-basic-offset: 8
-// tab-width: 8
-// indent-tabs-mode: t
-// End:
=== removed file 'librender/ProxyRenderer.h'
--- a/librender/ProxyRenderer.h 2010-07-19 07:43:01 +0000
+++ b/librender/ProxyRenderer.h 1970-01-01 00:00:00 +0000
@@ -1,118 +0,0 @@
-// render.h Rendering interface for Gnash
-//
-// Copyright (C) 2008, 2009, 2010 Free Software Foundation, Inc.
-//
-// This program is free software; you can redistribute it and/or modify
-// it under the terms of the GNU General Public License as published by
-// the Free Software Foundation; either version 3 of the License, or
-// (at your option) any later version.
-//
-// This program is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-// GNU General Public License for more details.
-//
-// You should have received a copy of the GNU General Public License
-// along with this program; if not, write to the Free Software
-// Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
-
-// Based on original by Willem Kokke <address@hidden> 2003
-
-
-#ifndef GNASH_RENDER_H
-#define GNASH_RENDER_H
-
-#include <vector>
-#include "gnash.h"
-#include "Renderer.h"
-#include "dsodefs.h"
-
-// Forward declarations
-namespace gnash {
- class rgba;
- class GnashImage;
- namespace SWF {
- class ShapeRecord;
- }
-}
-
-namespace gnash {
-
- /// Return currently registered render handler
- Renderer* get_Renderer();
-
- /// Rendering operations
- //
- /// Takes care of calling the currently registered
- /// gnash::Renderer or fallback on a default
- /// behaviour if no renderer is registered
- ///
- /// NOTE: A cleaner implementation would be implementing
- /// the default behaviour in the Renderer class
- /// itself, rather then making it an "abstract" class.
- /// Anyway, having proxy calls turned out to be somewhat
- /// useful while tracking rendering calls, to have a central
- /// place to add traces. We might change this in the future
- /// to improve performance (proxy calls are not inlined).
- ///
- namespace render
- {
- /// See Renderer::create_bitmap_info_rgb (in backend/Renderer.h)
- BitmapInfo* createBitmapInfo(std::auto_ptr<GnashImage> im);
-
- /// See Renderer::drawVideoFrame (in backend/Renderer.h)
- void drawVideoFrame(GnashImage* frame, const SWFMatrix* mat,
- const SWFRect* bounds, bool smooth);
-
- /// See Renderer::begin_display (in backend/Renderer.h)
- void begin_display(
- const rgba& background_color,
- int viewport_width, int viewport_height,
- float x0, float x1, float y0, float y1);
-
- /// See Renderer::end_display (in backend/Renderer.h)
- void end_display();
-
- /// See Renderer::draw_line_strip (in backend/Renderer.h)
- void drawLine(const std::vector<point>& coords, const rgba&
color,
- const SWFMatrix& mat);
-
- /// See Renderer::draw_poly (in backend/Renderer.h)
- DSOEXPORT void draw_poly(const point* corners, int
corner_count,
- const rgba& fill, const rgba& outline, const
SWFMatrix& mat,
- bool masked);
-
- void drawShape(const SWF::ShapeRecord& shape, const cxform& cx,
- const SWFMatrix& worldMat);
-
- /// See Renderer::draw_glyph (in backend/Renderer.h)
- void drawGlyph(const SWF::ShapeRecord& rec, const rgba& color,
- const SWFMatrix& mat);
-
- /// See Renderer::bounds_in_clipping_area (in
backend/Renderer.h)
- bool bounds_in_clipping_area(const SWFRect& bounds);
- bool bounds_in_clipping_area(const InvalidatedRanges& ranges);
- bool bounds_in_clipping_area(const
geometry::Range2d<boost::int32_t>& bounds);
-
- /// See Renderer::begin_submit_mask (in backend/Renderer.h)
- void begin_submit_mask();
-
- /// See Renderer::end_submit_mask (in backend/Renderer.h)
- void end_submit_mask();
-
- /// See Renderer::disable_mask (in backend/Renderer.h)
- void disable_mask();
-
- } // end namespace render
-
-} // end namespace gnash
-
-
-#endif // GNASH_RENDER_H
-
-// Local Variables:
-// mode: C++
-// c-basic-offset: 8
-// tab-width: 8
-// indent-tabs-mode: t
-// End:
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Gnash-commit] /srv/bzr/gnash/trunk r12336: Add output operator for ShapeRecords, drop obsolete code, clean up,
Benjamin Wolsey <=