[Bastiaan Jacques]
> So far as I can tell, all CachedBitmap objects are created by the
> renderer (in createCachedBitmap()), and because that function always
> returns a bitmap_info_cairo, a dynamic_cast does not seem to be
> required.  You can just replace it with a static_cast instead of
> checking the dynamic_cast.

Right.  I tried, and ran the test suite, and did not discover any new
failures.  But I am not sure if the test suite test the relevant code,
and dare not commit this myself, as I am unsure about the
consequences.

This is the patch I used.

diff --git a/librender/cairo/Renderer_cairo.cpp 
b/librender/cairo/Renderer_cairo.cpp
index c597dd4..846dc55 100644
--- a/librender/cairo/Renderer_cairo.cpp
+++ b/librender/cairo/Renderer_cairo.cpp
@@ -297,8 +297,7 @@ struct StyleHandler : 
boost::static_visitor<cairo_pattern_t*>
             return pattern;
         }
 
-        const bitmap_info_cairo* binfo =
-            dynamic_cast<const bitmap_info_cairo*>(bm);
+        const bitmap_info_cairo* binfo = static_cast<const 
bitmap_info_cairo*>(bm);
       
         cairo_matrix_t mat;
         init_cairo_matrix(&mat, m);       

-- 
Happy hacking
Petter Reinholdtsen

_______________________________________________
Gnash-dev mailing list
Gnash-dev@gnu.org
https://lists.gnu.org/mailman/listinfo/gnash-dev

Reply via email to