Author: Carlos Lopez <[email protected]>
Date:   Thu Sep  6 17:53:27 2012 +0200

Synfig::render: don't rely on get_cairocolor since it will be always slower 
than using get_color and convert to CairoColor later.

---

 synfig-core/src/synfig/render.cpp |    8 ++++----
 1 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/synfig-core/src/synfig/render.cpp 
b/synfig-core/src/synfig/render.cpp
index c0cf6ac..c04501e 100644
--- a/synfig-core/src/synfig/render.cpp
+++ b/synfig-core/src/synfig/render.cpp
@@ -389,18 +389,18 @@ synfig::cairorender(
                // Loop through every pixel in row
                for(x=0,u=su;x<w;x++,u+=du)
                {
-                       CairoColor c(Color::alpha());
-                       
+                       Color c(Color::alpha());
                        // Loop through all subpixels
                        for(y2=0,pool=0;y2<a;y2++)
                                for(x2=0;x2<a;x2++)
                                {
-                                       CairoColor color=context.get_cairocolor(
+                                       Color color=context.get_color(
                                                                                
                  Point(
                                                                                
                                u+(Point::value_type)(x2)*dsu,
                                                                                
                                v+(Point::value_type)(y2)*dsv
                                                                                
                                )
                                                                                
                  );
+                                       color=color.clamped();
                                        c+=color*color.get_a();
                                        pool+=color.get_a();
                                }
@@ -408,7 +408,7 @@ synfig::cairorender(
                                c/=pool;
                        // Once the pixel is subsampled then I premultiply by 
alpha and pass
                        // it to the CairoSurface
-                       csurface[y][x]=c.premult_alpha();
+                       csurface[y][x]=CairoColor(c).premult_alpha();
                }
        }
        // unmap the rendered surface to the cairo_surface_t


------------------------------------------------------------------------------
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and 
threat landscape has changed and how IT managers can respond. Discussions 
will include endpoint security, mobile security and the latest in malware 
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
_______________________________________________
Synfig-devl mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/synfig-devl

Reply via email to