CVSROOT: /cvsroot/gnash Module name: gnash Changes by: Udo Giacomozzi <udog> 07/06/26 15:33:44
Modified files: backend : render_handler_agg_style.h Log message: backend/render_handler_agg_style.h: always premultiply image accessors with alpha channel (partial fix for bug #20257) CVSWeb URLs: http://cvs.savannah.gnu.org/viewcvs/gnash/backend/render_handler_agg_style.h?cvsroot=gnash&r1=1.18&r2=1.19 Patches: Index: render_handler_agg_style.h =================================================================== RCS file: /cvsroot/gnash/gnash/backend/render_handler_agg_style.h,v retrieving revision 1.18 retrieving revision 1.19 diff -u -b -r1.18 -r1.19 --- render_handler_agg_style.h 14 Jun 2007 15:55:19 -0000 1.18 +++ render_handler_agg_style.h 26 Jun 2007 15:33:43 -0000 1.19 @@ -114,6 +114,8 @@ { public: + bool m_force_premultiply; + agg_style_bitmap(int width, int height, int rowlen, uint8_t* data, gnash::matrix mat, gnash::cxform cx) : @@ -122,7 +124,8 @@ m_img_src(m_pixf), m_tr(), // initialize later m_interpolator(m_tr), - m_sg(m_img_src, m_interpolator) + m_sg(m_img_src, m_interpolator), + m_force_premultiply(false) { m_is_solid = false; @@ -146,15 +149,21 @@ void generate_span(agg::rgba8* span, int x, int y, unsigned len) { m_sg.generate(span, x, y, len); - // Apply color transform // TODO: Check if this can be optimized - if (!m_cx.is_identity()) + if (!m_cx.is_identity()) { for (unsigned int i=0; i<len; i++) { m_cx.transform(span->r, span->g, span->b, span->a); span->premultiply(); ++span; } + } else + if (m_force_premultiply) { + for (unsigned int i=0; i<len; i++) { + span->premultiply(); + span++; + } + } } @@ -484,6 +493,8 @@ st_type* st = new st_type(bi->get_width(), bi->get_height(), bi->get_rowlen(), bi->get_data(), mat, cx); + st->m_force_premultiply = true; // important for alpha channel + m_styles.push_back(st); } @@ -506,6 +517,8 @@ st_type* st = new st_type(bi->get_width(), bi->get_height(), bi->get_rowlen(), bi->get_data(), mat, cx); + st->m_force_premultiply = true; // important for alpha channel + m_styles.push_back(st); } @@ -528,6 +541,8 @@ st_type* st = new st_type(bi->get_width(), bi->get_height(), bi->get_rowlen(), bi->get_data(), mat, cx); + st->m_force_premultiply = true; // important for alpha channel + m_styles.push_back(st); } @@ -548,6 +563,8 @@ st_type* st = new st_type(bi->get_width(), bi->get_height(), bi->get_rowlen(), bi->get_data(), mat, cx); + st->m_force_premultiply = true; // important for alpha channel + m_styles.push_back(st); } _______________________________________________ Gnash-commit mailing list Gnash-commit@gnu.org http://lists.gnu.org/mailman/listinfo/gnash-commit