Author: Carlos Lopez <[email protected]>
Date: Sun Sep 16 20:55:18 2012 +0200
CairoSurface: use CairoColorAccumulator instead of CairoColor to avoid overflow
when accumulating
---
synfig-core/src/synfig/surface.cpp | 2 +-
synfig-core/src/synfig/surface.h | 14 +++++++-------
2 files changed, 8 insertions(+), 8 deletions(-)
diff --git a/synfig-core/src/synfig/surface.cpp
b/synfig-core/src/synfig/surface.cpp
index 932e5c8..c92cb7c 100644
--- a/synfig-core/src/synfig/surface.cpp
+++ b/synfig-core/src/synfig/surface.cpp
@@ -282,7 +282,7 @@ synfig::CairoSurface::blit_to(alpha_pen& pen, int x, int y,
int w, int h)
return;
}
else
- etl::surface<CairoColor, CairoColor,
CairoColorPrep>::blit_to(pen,x,y,w,h);
+ etl::surface<CairoColor, CairoColorAccumulator,
CairoColorPrep>::blit_to(pen,x,y,w,h);
}
void
diff --git a/synfig-core/src/synfig/surface.h b/synfig-core/src/synfig/surface.h
index 5f24c2b..de14107 100644
--- a/synfig-core/src/synfig/surface.h
+++ b/synfig-core/src/synfig/surface.h
@@ -127,7 +127,7 @@ public:
** equivalent to the current backend for custom modifications purposes.
** \todo writeme
*/
-class CairoSurface : public etl::surface<CairoColor, CairoColor,
CairoColorPrep>
+class CairoSurface : public etl::surface<CairoColor, CairoColorAccumulator,
CairoColorPrep>
{
// This is the Cairo surface pointer
// It is NULL if the not initialized
@@ -154,7 +154,7 @@ public:
// Use whits version of set_wh to directly give to the etl::surface the
// pointer to data, the width, height and pitch (stride) between rows
void set_wh(int w, int h, unsigned char* data, int pitch)
- { etl::surface<CairoColor, CairoColor, CairoColorPrep>::set_wh(w, h,
data, pitch); }
+ { etl::surface<CairoColor, CairoColorAccumulator,
CairoColorPrep>::set_wh(w, h, data, pitch); }
// specialization of etl::surface::blit_to that considers the
possibility of
// don't blend colors when blend method is straight and alpha is 1.0
void blit_to(alpha_pen& DEST_PEN, int x, int y, int w, int h);
@@ -235,16 +235,16 @@ public:
** The default blending method is Color::BLEND_COMPOSITE.
** \see Color::BlendMethod
*/
-class CairoSurface::alpha_pen : public etl::alpha_pen<
etl::generic_pen<CairoColor, CairoColor>, float, _BlendFunc<CairoColor> >
+class CairoSurface::alpha_pen : public etl::alpha_pen<
etl::generic_pen<CairoColor, CairoColorAccumulator>, float,
_BlendFunc<CairoColor> >
{
public:
alpha_pen() { }
- alpha_pen(const etl::alpha_pen< etl::generic_pen<CairoColor,
CairoColor>, float, _BlendFunc<CairoColor> > &x):
- etl::alpha_pen< etl::generic_pen<CairoColor, CairoColor>, float,
_BlendFunc<CairoColor> >(x)
+ alpha_pen(const etl::alpha_pen< etl::generic_pen<CairoColor,
CairoColorAccumulator>, float, _BlendFunc<CairoColor> > &x):
+ etl::alpha_pen< etl::generic_pen<CairoColor, CairoColorAccumulator>,
float, _BlendFunc<CairoColor> >(x)
{ }
- alpha_pen(const etl::generic_pen<CairoColor, CairoColor>& pen, const
float &a = 1, const _BlendFunc<CairoColor> &func = _BlendFunc<CairoColor>()):
- etl::alpha_pen< etl::generic_pen<CairoColor, CairoColor>, float,
_BlendFunc<CairoColor> >(pen,a,func)
+ alpha_pen(const etl::generic_pen<CairoColor, CairoColorAccumulator>&
pen, const float &a = 1, const _BlendFunc<CairoColor> &func =
_BlendFunc<CairoColor>()):
+ etl::alpha_pen< etl::generic_pen<CairoColor, CairoColorAccumulator>,
float, _BlendFunc<CairoColor> >(pen,a,func)
{ }
//! Sets the blend method to that described by \a method
------------------------------------------------------------------------------
Everyone hates slow websites. So do we.
Make your web apps faster with AppDynamics
Download AppDynamics Lite for free today:
http://ad.doubleclick.net/clk;258768047;13503038;j?
http://info.appdynamics.com/FreeJavaPerformanceDownload.html
_______________________________________________
Synfig-devl mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/synfig-devl