CVSROOT: /cvsroot/gnash Module name: gnash Changes by: Udo Giacomozzi <udog> 07/10/15 12:31:33
Modified files: . : ChangeLog backend : render_handler_agg.cpp render_handler_agg.h gui : fb.cpp fltk_glue_agg.cpp gtk_glue_agg.cpp kde_glue_agg.cpp riscos_glue_agg.cpp sdl_agg_glue.cpp Log message: Don't let the renderer choose the rowstride (bytes per line) as this depends on the GUI choose the rowstride (bytes per line) as this depends on the GUI calculating it. CVSWeb URLs: http://cvs.savannah.gnu.org/viewcvs/gnash/ChangeLog?cvsroot=gnash&r1=1.4611&r2=1.4612 http://cvs.savannah.gnu.org/viewcvs/gnash/backend/render_handler_agg.cpp?cvsroot=gnash&r1=1.109&r2=1.110 http://cvs.savannah.gnu.org/viewcvs/gnash/backend/render_handler_agg.h?cvsroot=gnash&r1=1.21&r2=1.22 http://cvs.savannah.gnu.org/viewcvs/gnash/gui/fb.cpp?cvsroot=gnash&r1=1.39&r2=1.40 http://cvs.savannah.gnu.org/viewcvs/gnash/gui/fltk_glue_agg.cpp?cvsroot=gnash&r1=1.8&r2=1.9 http://cvs.savannah.gnu.org/viewcvs/gnash/gui/gtk_glue_agg.cpp?cvsroot=gnash&r1=1.29&r2=1.30 http://cvs.savannah.gnu.org/viewcvs/gnash/gui/kde_glue_agg.cpp?cvsroot=gnash&r1=1.6&r2=1.7 http://cvs.savannah.gnu.org/viewcvs/gnash/gui/riscos_glue_agg.cpp?cvsroot=gnash&r1=1.5&r2=1.6 http://cvs.savannah.gnu.org/viewcvs/gnash/gui/sdl_agg_glue.cpp?cvsroot=gnash&r1=1.13&r2=1.14 Patches: Index: ChangeLog =================================================================== RCS file: /cvsroot/gnash/gnash/ChangeLog,v retrieving revision 1.4611 retrieving revision 1.4612 diff -u -b -r1.4611 -r1.4612 --- ChangeLog 15 Oct 2007 10:11:36 -0000 1.4611 +++ ChangeLog 15 Oct 2007 12:31:32 -0000 1.4612 @@ -1,3 +1,12 @@ +2007-10-15 Udo Giacomozzi <[EMAIL PROTECTED]> + + * backend/render_handler_agg.cpp, backend/render_handler_agg.h, gui/fb.cpp, + gui/fltk_glue_agg.cpp, gui/gtk_glue_agg.cpp, gui/kde_glue_agg.cpp, + gui/riscos_glue_agg.cpp, gui/sdl_agg_glue.cpp: Don't let the renderer + choose the rowstride (bytes per line) as this depends on the GUI + and use the rowstride reported by the MIT-SHM extension instead of + calculating it. + 2007-10-14 Sandro Santilli <[EMAIL PROTECTED]> * gui/fb.cpp: update use of agg_detect_pixel_format Index: backend/render_handler_agg.cpp =================================================================== RCS file: /cvsroot/gnash/gnash/backend/render_handler_agg.cpp,v retrieving revision 1.109 retrieving revision 1.110 diff -u -b -r1.109 -r1.110 --- backend/render_handler_agg.cpp 15 Oct 2007 09:06:59 -0000 1.109 +++ backend/render_handler_agg.cpp 15 Oct 2007 12:31:33 -0000 1.110 @@ -17,7 +17,7 @@ -/* $Id: render_handler_agg.cpp,v 1.109 2007/10/15 09:06:59 strk Exp $ */ +/* $Id: render_handler_agg.cpp,v 1.110 2007/10/15 12:31:33 udog Exp $ */ // Original version by Udo Giacomozzi and Hannes Mayr, // INDUNET GmbH (www.indunet.it) @@ -631,8 +631,9 @@ /// owned by the renderer and init_buffer() may be called multiple times /// when the buffer size changes, for example. However, bits_per_pixel must /// remain the same. + /// rowstride is the size, in bytes, of one row. /// This method *must* be called prior to any other method of the class! - void init_buffer(unsigned char *mem, int size, int x, int y) + void init_buffer(unsigned char *mem, int size, int x, int y, int rowstride) { assert(x > 0); assert(y > 0); @@ -642,14 +643,9 @@ xres = x; yres = y; - // don't need to check m_pixf != NULL - // as that check is already implemented - // in the 'delete' statement - //if (m_pixf != NULL) - delete m_pixf; // TODO: is this correct?? + delete m_pixf; - int row_size = xres*((bpp+7)/8); - m_rbuf.attach(memaddr, xres, yres, row_size); + m_rbuf.attach(memaddr, xres, yres, rowstride); // allocate pixel format accessor m_pixf = new PixelFormat(m_rbuf); @@ -659,7 +655,7 @@ set_invalidated_region_world(); log_msg("initialized AGG buffer <%p>, %d bytes, %dx%d, rowsize is %d bytes", - mem, size, x, y, row_size); + mem, size, x, y, rowstride); } Index: backend/render_handler_agg.h =================================================================== RCS file: /cvsroot/gnash/gnash/backend/render_handler_agg.h,v retrieving revision 1.21 retrieving revision 1.22 diff -u -b -r1.21 -r1.22 --- backend/render_handler_agg.h 15 Oct 2007 09:07:00 -0000 1.21 +++ backend/render_handler_agg.h 15 Oct 2007 12:31:33 -0000 1.22 @@ -40,7 +40,7 @@ virtual ~render_handler_agg_base() {} // these methods need to be accessed from outside: - virtual void init_buffer(unsigned char *mem, int size, int x, int y)=0; + virtual void init_buffer(unsigned char *mem, int size, int x, int y, int rowstride)=0; virtual unsigned int getBytesPerPixel() const=0; @@ -51,7 +51,7 @@ _testBuffer = static_cast<unsigned char *>( realloc(_testBuffer, size) ); - init_buffer(_testBuffer, size, width, height); + init_buffer(_testBuffer, size, width, height, width * getBytesPerPixel()); return true; } Index: gui/fb.cpp =================================================================== RCS file: /cvsroot/gnash/gnash/gui/fb.cpp,v retrieving revision 1.39 retrieving revision 1.40 diff -u -b -r1.39 -r1.40 --- gui/fb.cpp 15 Oct 2007 10:11:37 -0000 1.39 +++ gui/fb.cpp 15 Oct 2007 12:31:33 -0000 1.40 @@ -295,7 +295,7 @@ set_render_handler(agg_handler); - agg_handler->init_buffer(_mem, _size, _width, _height); + agg_handler->init_buffer(_mem, _size, _width, _height, _width*((_bpp+7)/8)); disable_terminal(); Index: gui/fltk_glue_agg.cpp =================================================================== RCS file: /cvsroot/gnash/gnash/gui/fltk_glue_agg.cpp,v retrieving revision 1.8 retrieving revision 1.9 diff -u -b -r1.8 -r1.9 --- gui/fltk_glue_agg.cpp 1 Jul 2007 10:54:00 -0000 1.8 +++ gui/fltk_glue_agg.cpp 15 Oct 2007 12:31:33 -0000 1.9 @@ -56,7 +56,7 @@ assert(_renderer); int _bpp = 24; - int depth_bytes = _bpp / 8; + int depth_bytes = _bpp / 8; // TODO: <Udo> is this correct? Gives 1 for 15 bit modes! assert(_bpp % 8 == 0); @@ -73,7 +73,8 @@ // address) during run-time. render_handler_agg_base * renderer = static_cast<render_handler_agg_base *>(_renderer); - renderer->init_buffer(_offscreenbuf, bufsize, width, height); + renderer->init_buffer(_offscreenbuf, bufsize, width, height, + width*((_bpp+7)/8)); _width = width; _height = height; Index: gui/gtk_glue_agg.cpp =================================================================== RCS file: /cvsroot/gnash/gnash/gui/gtk_glue_agg.cpp,v retrieving revision 1.29 retrieving revision 1.30 diff -u -b -r1.29 -r1.30 --- gui/gtk_glue_agg.cpp 15 Oct 2007 09:07:00 -0000 1.29 +++ gui/gtk_glue_agg.cpp 15 Oct 2007 12:31:33 -0000 1.30 @@ -18,7 +18,7 @@ // // -/* $Id: gtk_glue_agg.cpp,v 1.29 2007/10/15 09:07:00 strk Exp $ */ +/* $Id: gtk_glue_agg.cpp,v 1.30 2007/10/15 12:31:33 udog Exp $ */ /// \page gtk_shm_support GTK shared memory extension support @@ -395,7 +395,8 @@ (unsigned char*) _shm_info->shmaddr, _shm_image->bytes_per_line * _shm_image->height, _width, - _height + _height, + _shm_image->bytes_per_line ); } else { @@ -403,7 +404,7 @@ // ==> use standard pixmaps (slower, but should work in any case) - int new_bufsize = width*height*(_bpp/8); + int new_bufsize = width*height*((_bpp+7)/8); // TODO: At the moment we only increase the buffer and never decrease it. Should be // changed sometime. @@ -432,7 +433,8 @@ _offscreenbuf, _offscreenbuf_size, _width, - _height + _height, + _width*((_bpp+7)/8) ); Index: gui/kde_glue_agg.cpp =================================================================== RCS file: /cvsroot/gnash/gnash/gui/kde_glue_agg.cpp,v retrieving revision 1.6 retrieving revision 1.7 diff -u -b -r1.6 -r1.7 --- gui/kde_glue_agg.cpp 19 Sep 2007 06:38:04 -0000 1.6 +++ gui/kde_glue_agg.cpp 15 Oct 2007 12:31:33 -0000 1.7 @@ -15,7 +15,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: kde_glue_agg.cpp,v 1.6 2007/09/19 06:38:04 strk Exp $ */ +/* $Id: kde_glue_agg.cpp,v 1.7 2007/10/15 12:31:33 udog Exp $ */ #include "kde_glue_agg.h" #include "render_handler.h" @@ -61,7 +61,7 @@ if (!_renderer) return; int _bpp = 32; - int depth_bytes = _bpp / 8; + int depth_bytes = _bpp / 8; // TODO: <Udo> is this correct? Gives 1 for 15 bit modes! assert(_bpp % 8 == 0); @@ -76,7 +76,8 @@ // address) during run-time. render_handler_agg_base * renderer = static_cast<render_handler_agg_base *>(_renderer); - renderer->init_buffer(_offscreenbuf.get(), bufsize, width, height); + renderer->init_buffer(_offscreenbuf.get(), bufsize, width, height, + width*((_bpp+7)/8)); _width = width; _height = height; Index: gui/riscos_glue_agg.cpp =================================================================== RCS file: /cvsroot/gnash/gnash/gui/riscos_glue_agg.cpp,v retrieving revision 1.5 retrieving revision 1.6 diff -u -b -r1.5 -r1.6 --- gui/riscos_glue_agg.cpp 1 Jul 2007 10:54:04 -0000 1.5 +++ gui/riscos_glue_agg.cpp 15 Oct 2007 12:31:33 -0000 1.6 @@ -18,7 +18,7 @@ // // -/* $Id: riscos_glue_agg.cpp,v 1.5 2007/07/01 10:54:04 bjacques Exp $ */ +/* $Id: riscos_glue_agg.cpp,v 1.6 2007/10/15 12:31:33 udog Exp $ */ #include <cstdio> #include <cerrno> @@ -84,7 +84,7 @@ if (width == _width && height == _height) return; - int new_bufsize = width*height*(_bpp/8); + int new_bufsize = width*height*((_bpp+7)/8); // TODO: At the moment we only increase the buffer and never decrease it. // Should be changed sometime. @@ -115,7 +115,8 @@ _offscreenbuf, _offscreenbuf_size, _width, - _height); + _height, + _width*((_bpp+7)/8)); } void Index: gui/sdl_agg_glue.cpp =================================================================== RCS file: /cvsroot/gnash/gnash/gui/sdl_agg_glue.cpp,v retrieving revision 1.13 retrieving revision 1.14 diff -u -b -r1.13 -r1.14 --- gui/sdl_agg_glue.cpp 1 Jul 2007 10:54:04 -0000 1.13 +++ gui/sdl_agg_glue.cpp 15 Oct 2007 12:31:33 -0000 1.14 @@ -84,7 +84,7 @@ bool SdlAggGlue::prepDrawingArea(int width, int height, uint32_t sdl_flags) { - int depth_bytes = _bpp / 8; + int depth_bytes = _bpp / 8; // TODO: <Udo> is this correct? Gives 1 for 15 bit modes! assert(_bpp % 8 == 0); @@ -136,7 +136,8 @@ // address) during run-time. render_handler_agg_base * renderer = static_cast<render_handler_agg_base *>(_agg_renderer); - renderer->init_buffer(_offscreenbuf, bufsize, width, height); + renderer->init_buffer(_offscreenbuf, bufsize, width, height, + width*((_bpp+7)/8)); _sdl_surface = SDL_CreateRGBSurfaceFrom((void *) _offscreenbuf, width, height, _______________________________________________ Gnash-commit mailing list Gnash-commit@gnu.org http://lists.gnu.org/mailman/listinfo/gnash-commit