[Synfig-devl] Carlos Lopez : Fix bug #399: Cairo render crashes with several blend modes in non debug.

2013-04-23 Thread root
Author: Carlos Lopez 
Date:   Tue Apr 23 20:15:36 2013 +0200

Fix bug #399: Cairo render crashes with several blend modes in non debug.

---

 synfig-core/src/synfig/cairo_operators.cpp |   63 
 1 files changed, 55 insertions(+), 8 deletions(-)

diff --git a/synfig-core/src/synfig/cairo_operators.cpp 
b/synfig-core/src/synfig/cairo_operators.cpp
index 0c5f535..b8259b0 100644
--- a/synfig-core/src/synfig/cairo_operators.cpp
+++ b/synfig-core/src/synfig/cairo_operators.cpp
@@ -202,11 +202,28 @@ void cairo_paint_with_alpha_operator(cairo_t* acr, float 
alpha, Color::BlendMeth
cairo_status_t status;
status=cairo_pattern_get_surface(pattern, &source);
if(status)
+   {
+   // return gracefully
+   synfig::error("%s", 
cairo_status_to_string(status));
+   cairo_pattern_destroy(pattern);
return;
+   }
CairoSurface csource(source);
CairoSurface cdest(cairo_get_target(cr));
-   assert(cdest.map_cairo_image());
-   assert(csource.map_cairo_image());
+
+   if(!cdest.map_cairo_image())
+   {
+   // return gracefully
+   cairo_pattern_destroy(pattern);
+   return;
+   }
+   if(!csource.map_cairo_image())
+  {
+  // return gracefully
+  cairo_pattern_destroy(pattern);
+  cdest.unmap_cairo_image();
+  return;
+  }

double x1, y1, x2, y2, x0, y0;
cairo_clip_extents(cr, &x1, &y1, &x2, &y2);
@@ -219,7 +236,6 @@ void cairo_paint_with_alpha_operator(cairo_t* acr, float 
alpha, Color::BlendMeth
int h=csource.get_h();
int h0=(int)y0;
int w0=(int)x0;
-   
for(int y=0;yhttp://p.sf.net/sfu/newrelic_d2d_apr
___
Synfig-devl mailing list
Synfig-devl@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/synfig-devl


[Synfig-devl] Carlos Lopez : Apply Enhancement #18: CLI revamp. Author Diego Barrios ( eldruin)

2013-04-21 Thread root
Author: Carlos Lopez 
Date:   Sun Apr 21 20:32:43 2013 +0200

Apply Enhancement #18: CLI revamp. Author Diego Barrios (eldruin)

---




--
Precog is a next-generation analytics platform capable of advanced
analytics on semi-structured data. The platform includes APIs for building
apps and a phenomenal toolset for data science. Developers can use
our toolset for easy data analysis & visualization. Get a free account!
http://www2.precog.com/precogplatform/slashdotnewsletter
___
Synfig-devl mailing list
Synfig-devl@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/synfig-devl


[Synfig-devl] Diego Barrios Romero : Fixed span option value retrieval

2013-04-21 Thread root
Author: Diego Barrios Romero 
Date:   Sun Apr 21 19:46:29 2013 +0200

Fixed span option value retrieval

---

 synfig-core/src/tool/optionsprocessor.cpp |2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/synfig-core/src/tool/optionsprocessor.cpp 
b/synfig-core/src/tool/optionsprocessor.cpp
index 6e40714..fbaca33 100644
--- a/synfig-core/src/tool/optionsprocessor.cpp
+++ b/synfig-core/src/tool/optionsprocessor.cpp
@@ -312,7 +312,7 @@ RendDesc OptionsProcessor::extract_renddesc(const RendDesc& 
renddesc)
}
if (_vm.count("span"))
{
-   span = _vm["antialias"].as();
+   span = _vm["span"].as();
VERBOSE_OUT(1) << strprintf(_("Span set to %d units"), span)
   << endl;
}


--
Precog is a next-generation analytics platform capable of advanced
analytics on semi-structured data. The platform includes APIs for building
apps and a phenomenal toolset for data science. Developers can use
our toolset for easy data analysis & visualization. Get a free account!
http://www2.precog.com/precogplatform/slashdotnewsletter
___
Synfig-devl mailing list
Synfig-devl@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/synfig-devl


[Synfig-devl] Diego Barrios Romero : Changed type of values for time-related options to string

2013-04-21 Thread root
Author: Diego Barrios Romero 
Date:   Sun Apr 21 19:43:22 2013 +0200

Changed type of values for time-related options to string

In order to support unities together with the numbers, e.g. 1f and decimal 
values.

---

 synfig-core/src/tool/main.cpp |   10 
 synfig-core/src/tool/optionsprocessor.cpp |   32 ++--
 2 files changed, 17 insertions(+), 25 deletions(-)

diff --git a/synfig-core/src/tool/main.cpp b/synfig-core/src/tool/main.cpp
index 7cd9720..40387bc 100644
--- a/synfig-core/src/tool/main.cpp
+++ b/synfig-core/src/tool/main.cpp
@@ -150,11 +150,11 @@ int main(int ac, char* av[])
named_type* canvas_arg_desc = new 
named_type("canvas-id");
named_type* output_file_arg_desc = new 
named_type("filename");
named_type* input_file_arg_desc = new 
named_type("filename");
-   named_type* fps_arg_desc = new named_type("NUM");
-   named_type* time_arg_desc = new named_type("seconds");
-   named_type* begin_time_arg_desc = new 
named_type("seconds");
-   named_type* start_time_arg_desc = new 
named_type("seconds");
-   named_type* end_time_arg_desc = new 
named_type("seconds");
+   named_type* fps_arg_desc = new named_type("NUM");
+   named_type* time_arg_desc = new 
named_type("seconds");
+   named_type* begin_time_arg_desc = new 
named_type("seconds");
+   named_type* start_time_arg_desc = new 
named_type("seconds");
+   named_type* end_time_arg_desc = new 
named_type("seconds");
named_type* dpi_arg_desc = new named_type("NUM");
named_type* dpi_x_arg_desc = new named_type("NUM");
named_type* dpi_y_arg_desc = new named_type("NUM");
diff --git a/synfig-core/src/tool/optionsprocessor.cpp 
b/synfig-core/src/tool/optionsprocessor.cpp
index a238575..6e40714 100644
--- a/synfig-core/src/tool/optionsprocessor.cpp
+++ b/synfig-core/src/tool/optionsprocessor.cpp
@@ -354,35 +354,27 @@ RendDesc OptionsProcessor::extract_renddesc(const 
RendDesc& renddesc)
}
if (_vm.count("start-time"))
{
-   int seconds;
-   stringstream ss;
-   seconds = _vm["start-time"].as();
-   ss << seconds;
-   desc.set_time_start(Time(ss.str().c_str(), 
desc.get_frame_rate()));
+   string seconds;
+   seconds = _vm["start-time"].as();
+   desc.set_time_start(Time(seconds.c_str(), 
desc.get_frame_rate()));
}
if (_vm.count("begin-time"))
{
-   int seconds;
-   stringstream ss;
-   seconds = _vm["begin-time"].as();
-   ss << seconds;
-   desc.set_time_start(Time(ss.str().c_str(), 
desc.get_frame_rate()));
+   string seconds;
+   seconds = _vm["begin-time"].as();
+   desc.set_time_start(Time(seconds.c_str(), 
desc.get_frame_rate()));
}
if (_vm.count("end-time"))
{
-   int seconds;
-   stringstream ss;
-   seconds = _vm["end-time"].as();
-   ss << seconds;
-   desc.set_time_end(Time(ss.str().c_str(), 
desc.get_frame_rate()));
+   string seconds;
+   seconds = _vm["end-time"].as();
+   desc.set_time_end(Time(seconds.c_str(), desc.get_frame_rate()));
}
if (_vm.count("time"))
{
-   int seconds;
-   stringstream ss;
-   seconds = _vm["time"].as();
-   ss << seconds;
-   desc.set_time(Time(ss.str().c_str(), desc.get_frame_rate()));
+   string seconds;
+   seconds = _vm["time"].as();
+   desc.set_time(Time(seconds.c_str(), desc.get_frame_rate()));
 
VERBOSE_OUT(1) << _("Rendering frame at ")
   << 
desc.get_time_start().get_string(desc.get_frame_rate())


--
Precog is a next-generation analytics platform capable of advanced
analytics on semi-structured data. The platform includes APIs for building
apps and a phenomenal toolset for data science. Developers can use
our toolset for easy data analysis & visualization. Get a free account!
http://www2.precog.com/precogplatform/slashdotnewsletter
___
Synfig-devl mailing list
Synfig-devl@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/synfig-devl


[Synfig-devl] Diego Barrios Romero : Fixed assign RendDesc to job

2013-04-21 Thread root
Author: Diego Barrios Romero 
Date:   Sun Apr 21 19:42:03 2013 +0200

Fixed assign RendDesc to job

---

 synfig-core/src/tool/main.cpp |2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/synfig-core/src/tool/main.cpp b/synfig-core/src/tool/main.cpp
index e26b061..7cd9720 100644
--- a/synfig-core/src/tool/main.cpp
+++ b/synfig-core/src/tool/main.cpp
@@ -289,7 +289,7 @@ int main(int ac, char* av[])
// Processing --
Job job;
job = op.extract_job();
-   job.desc = op.extract_renddesc(job.canvas->rend_desc());
+   job.desc = job.canvas->rend_desc() = 
op.extract_renddesc(job.canvas->rend_desc());
 
job_list.push_front(job);
 


--
Precog is a next-generation analytics platform capable of advanced
analytics on semi-structured data. The platform includes APIs for building
apps and a phenomenal toolset for data science. Developers can use
our toolset for easy data analysis & visualization. Get a free account!
http://www2.precog.com/precogplatform/slashdotnewsletter
___
Synfig-devl mailing list
Synfig-devl@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/synfig-devl


[Synfig-devl] Diego Barrios Romero : Corrected value retrieval on FPS option

2013-04-21 Thread root
Author: Diego Barrios Romero 
Date:   Sun Apr 21 19:41:32 2013 +0200

Corrected value retrieval on FPS option

---

 synfig-core/src/tool/optionsprocessor.cpp |2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/synfig-core/src/tool/optionsprocessor.cpp 
b/synfig-core/src/tool/optionsprocessor.cpp
index e83a133..a238575 100644
--- a/synfig-core/src/tool/optionsprocessor.cpp
+++ b/synfig-core/src/tool/optionsprocessor.cpp
@@ -319,7 +319,7 @@ RendDesc OptionsProcessor::extract_renddesc(const RendDesc& 
renddesc)
if (_vm.count("fps"))
{
float fps;
-   fps = _vm["antialias"].as();
+   fps = _vm["fps"].as();
desc.set_frame_rate(fps);
VERBOSE_OUT(1) << strprintf(_("Frame rate set to %d frames per "
  
"second"), fps) << endl;


--
Precog is a next-generation analytics platform capable of advanced
analytics on semi-structured data. The platform includes APIs for building
apps and a phenomenal toolset for data science. Developers can use
our toolset for easy data analysis & visualization. Get a free account!
http://www2.precog.com/precogplatform/slashdotnewsletter
___
Synfig-devl mailing list
Synfig-devl@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/synfig-devl


[Synfig-devl] Diego Barrios Romero : Remove Boost:: Program Options dependency for synfig library

2013-04-21 Thread root
Author: Diego Barrios Romero 
Date:   Sat Apr 13 12:40:41 2013 +0200

Remove Boost::Program Options dependency for synfig library

Boost Program Options is just a dependency of the synfig cli and so,
it is not required when linking against the synfig library.

---

 synfig-core/configure.ac |4 +++-
 1 files changed, 3 insertions(+), 1 deletions(-)

diff --git a/synfig-core/configure.ac b/synfig-core/configure.ac
index 3696d95..2229990 100644
--- a/synfig-core/configure.ac
+++ b/synfig-core/configure.ac
@@ -432,7 +432,9 @@ AX_BOOST_PROGRAM_OPTIONS
 if test "x$ax_cv_boost_program_options" = "xno" ; then
AC_MSG_ERROR([ ** You need to install Boost program-options library])
 fi
-CONFIG_DEPS="$CONFIG_DEPS boost_program_options"
+# Boost Program Options is just a dependency of the synfig cli and so,
+# not required to link against the synfig library.
+#CONFIG_DEPS="$CONFIG_DEPS boost_program_options"
 
 
 


--
Precog is a next-generation analytics platform capable of advanced
analytics on semi-structured data. The platform includes APIs for building
apps and a phenomenal toolset for data science. Developers can use
our toolset for easy data analysis & visualization. Get a free account!
http://www2.precog.com/precogplatform/slashdotnewsletter
___
Synfig-devl mailing list
Synfig-devl@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/synfig-devl


[Synfig-devl] Diego Barrios Romero : Merge branch 'eldruin_tool_boost2' into eldruin_tool_boost

2013-04-21 Thread root
Author: Diego Barrios Romero 
Date:   Sat Apr 13 12:39:02 2013 +0200

Merge branch 'eldruin_tool_boost2' into eldruin_tool_boost

Conflicts:
synfig-core/m4/ax_boost_base.m4
synfig-core/m4/ax_boost_program_options.m4

---




--
Precog is a next-generation analytics platform capable of advanced
analytics on semi-structured data. The platform includes APIs for building
apps and a phenomenal toolset for data science. Developers can use
our toolset for easy data analysis & visualization. Get a free account!
http://www2.precog.com/precogplatform/slashdotnewsletter
___
Synfig-devl mailing list
Synfig-devl@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/synfig-devl


[Synfig-devl] Carlos Lopez : Replace macros for Boost libraries by newer versions from http://www.gnu. org/software/autoconf-archive/index.html.

2013-04-21 Thread root
Author: Carlos Lopez 
Date:   Tue Feb  5 19:22:00 2013 +0100

Replace macros for Boost libraries by newer versions from 
http://www.gnu.org/software/autoconf-archive/index.html.
Fixes configuration on OSX

---

 synfig-core/m4/ax_boost_base.m4|  382 
 synfig-core/m4/ax_boost_program_options.m4 |   68 +++--
 2 files changed, 260 insertions(+), 190 deletions(-)

Diff:   
http://synfig.git.sourceforge.net/git/gitweb.cgi?p=synfig/synfig;a=commitdiff;h=aebe0ef966b1c9b54ab72aba9be2fb8ae4f6399d

--
Precog is a next-generation analytics platform capable of advanced
analytics on semi-structured data. The platform includes APIs for building
apps and a phenomenal toolset for data science. Developers can use
our toolset for easy data analysis & visualization. Get a free account!
http://www2.precog.com/precogplatform/slashdotnewsletter
___
Synfig-devl mailing list
Synfig-devl@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/synfig-devl


[Synfig-devl] Diego Barrios Romero : Boost: add boost configuration files

2013-04-21 Thread root
Author: Diego Barrios Romero 
Date:   Sun Sep 23 11:52:23 2012 +0200

Boost: add boost configuration files

---

 synfig-core/configure.ac   |   10 ++-
 synfig-core/m4/ax_boost_base.m4|  198 
 synfig-core/m4/ax_boost_program_options.m4 |   98 ++
 synfig-core/src/tool/Makefile.am   |7 +-
 4 files changed, 310 insertions(+), 3 deletions(-)

Diff:   
http://synfig.git.sourceforge.net/git/gitweb.cgi?p=synfig/synfig;a=commitdiff;h=a8fd5f6f7e1edccae860de037fe96588659b685b

--
Precog is a next-generation analytics platform capable of advanced
analytics on semi-structured data. The platform includes APIs for building
apps and a phenomenal toolset for data science. Developers can use
our toolset for easy data analysis & visualization. Get a free account!
http://www2.precog.com/precogplatform/slashdotnewsletter
___
Synfig-devl mailing list
Synfig-devl@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/synfig-devl


[Synfig-devl] Carlos Lopez : Warp layer (Cairo): simplify code.

2013-04-21 Thread root
Author: Carlos Lopez 
Date:   Sun Apr 21 20:07:11 2013 +0200

Warp layer (Cairo): simplify code.

---

 synfig-core/src/modules/lyr_std/warp.cpp |   82 -
 1 files changed, 12 insertions(+), 70 deletions(-)

diff --git a/synfig-core/src/modules/lyr_std/warp.cpp 
b/synfig-core/src/modules/lyr_std/warp.cpp
index fb048f7..3aa9d00 100644
--- a/synfig-core/src/modules/lyr_std/warp.cpp
+++ b/synfig-core/src/modules/lyr_std/warp.cpp
@@ -1029,9 +1029,8 @@ Warp::accelerated_cairorender(Context 
context,cairo_surface_t *surface,int quali
 
CairoSurface::pen pen(csurface.begin());

-   if(quality<=4)
+   // Do the warp
{
-   // CUBIC
int x,y;
float u,v;
Point point,tmp;
@@ -1053,7 +1052,17 @@ Warp::accelerated_cairorender(Context 
context,cairo_surface_t *surface,int quali
if(u<0 || v<0 || u>=sourcew || v>=sourceh || 
isnan(u) || isnan(v))

csurface[y][x]=context.get_cairocolor(tmp);
else
-   
csurface[y][x]=csource.cubic_sample(u,v);
+   {
+   // CUBIC
+   if(quality<=4)
+   
csurface[y][x]=csource.cubic_sample(u,v);
+   // INTEPOLATION_LINEAR
+   else if(quality<=6)
+   
csurface[y][x]=csource.linear_sample(u,v);
+   else
+   // NEAREST_NEIGHBOR
+   
csurface[y][x]=csource[floor_to_int(v)][floor_to_int(u)];
+   }
}
if((y&31)==0 && cb)
{
@@ -1062,73 +1071,6 @@ Warp::accelerated_cairorender(Context 
context,cairo_surface_t *surface,int quali
}
}
}
-   else
-   if(quality<=6)
-   {
-   // INTERPOLATION_LINEAR
-   int x,y;
-   float u,v;
-   Point point,tmp;
-   
for(y=0,point[1]=renddesc.get_tl()[1];y0 
&& z=sourcew || 
v>=sourceh || isnan(u) || isnan(v))
-   
csurface[y][x]=context.get_cairocolor(tmp);
-   else
-   
csurface[y][x]=csource.linear_sample(u,v);
-   }
-   if((y&31)==0 && cb)
-   {
-   
if(!stagetwo.amount_complete(y,surfaceh))
-   return false;
-   }
-   }
-   }
-   else
-   {
-   // NEAREST_NEIGHBOR
-   int x,y;
-   float u,v;
-   Point point,tmp;
-   
for(y=0,point[1]=renddesc.get_tl()[1];y0 
&& z=sourcew || 
v>=sourceh || isnan(u) || isnan(v))
-   
csurface[y][x]=context.get_cairocolor(tmp);
-   else
-   
csurface[y][x]=csource[floor_to_int(v)][floor_to_int(u)];
-   }
-   if((y&31)==0 && cb)
-   {
-   
if(!stagetwo.amount_complete(y,surfaceh))
-   return false;
-   }
-   }
-   }

 #endif



--
Precog is a next-generation analytics platform capable of advanced
analytics on semi-structured data. The platform includes APIs for building
apps and a phenomenal toolset for data science. Developers can use
our toolset for easy data analysis & visualization. Get a free account!
http://www2.precog.com/precogplatform/slashdotnewsletter
___
Synfig-devl mailing list
Synfig-devl@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/synfig-devl


[Synfig-devl] Carlos Lopez : Fix bug #372: Warp Layer not implemented in Cairo

2013-04-21 Thread root
Author: Carlos Lopez 
Date:   Sun Apr 21 19:35:13 2013 +0200

Fix bug #372: Warp Layer not implemented in Cairo

---

 synfig-core/src/modules/lyr_std/warp.cpp |  342 ++
 synfig-core/src/modules/lyr_std/warp.h   |1 +
 2 files changed, 343 insertions(+), 0 deletions(-)

Diff:   
http://synfig.git.sourceforge.net/git/gitweb.cgi?p=synfig/synfig;a=commitdiff;h=feb495b592fee891a58a065a2b20fa07f1c3

--
Precog is a next-generation analytics platform capable of advanced
analytics on semi-structured data. The platform includes APIs for building
apps and a phenomenal toolset for data science. Developers can use
our toolset for easy data analysis & visualization. Get a free account!
http://www2.precog.com/precogplatform/slashdotnewsletter
___
Synfig-devl mailing list
Synfig-devl@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/synfig-devl


[Synfig-devl] Carlos Lopez : Dock Navigator: Before start painting, clear the surface.

2013-04-21 Thread root
Author: Carlos Lopez 
Date:   Sun Apr 21 18:12:40 2013 +0200

Dock Navigator: Before start painting, clear the surface.

---

 synfig-studio/src/gui/docks/dock_navigator.cpp |5 +
 1 files changed, 5 insertions(+), 0 deletions(-)

diff --git a/synfig-studio/src/gui/docks/dock_navigator.cpp 
b/synfig-studio/src/gui/docks/dock_navigator.cpp
index 4dda522..99a35a5 100644
--- a/synfig-studio/src/gui/docks/dock_navigator.cpp
+++ b/synfig-studio/src/gui/docks/dock_navigator.cpp
@@ -148,6 +148,11 @@ void studio::Widget_NavView::on_start_render()
 
if(studio::App::navigator_uses_cairo)
{
+   // First clear the surface
+   cairo_t* cr = cairo_create(cairo_surface);
+   cairo_set_operator(cr, CAIRO_OPERATOR_CLEAR);
+   cairo_paint(cr);
+   cairo_destroy(cr);
// Create a cairo_image_target
etl::handle targ = 
cairo_image_target(&cairo_surface);
// Fill the target with the proper information


--
Precog is a next-generation analytics platform capable of advanced
analytics on semi-structured data. The platform includes APIs for building
apps and a phenomenal toolset for data science. Developers can use
our toolset for easy data analysis & visualization. Get a free account!
http://www2.precog.com/precogplatform/slashdotnewsletter
___
Synfig-devl mailing list
Synfig-devl@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/synfig-devl


[Synfig-devl] Carlos Lopez : Apply same fix than previous commit in several places.

2013-04-20 Thread root
Author: Carlos Lopez 
Date:   Sat Apr 20 18:16:17 2013 +0200

Apply same fix than previous commit in several places.

---

 synfig-core/src/modules/lyr_std/bevel.cpp  |5 +++--
 synfig-core/src/modules/lyr_std/shade.cpp  |3 ++-
 .../src/modules/mod_geometry/advanced_outline.cpp  |3 ++-
 synfig-core/src/modules/mod_geometry/region.cpp|3 ++-
 synfig-core/src/synfig/color.cpp   |9 +
 synfig-core/src/synfig/layer_polygon.cpp   |3 ++-
 6 files changed, 16 insertions(+), 10 deletions(-)

diff --git a/synfig-core/src/modules/lyr_std/bevel.cpp 
b/synfig-core/src/modules/lyr_std/bevel.cpp
index 060b8d2..a7407d3 100644
--- a/synfig-core/src/modules/lyr_std/bevel.cpp
+++ b/synfig-core/src/modules/lyr_std/bevel.cpp
@@ -466,12 +466,13 @@ Layer_Bevel::accelerated_cairorender(Context 
context,cairo_surface_t *surface,in
 
// Copy over the alpha
blurred.set_wh(workdesc.get_w(),workdesc.get_h());
+   float div=1.0/((float)(CairoColor::ceil));
if(!use_luma)
{
for(int j=0;jhttp://www2.precog.com/precogplatform/slashdotnewsletter
___
Synfig-devl mailing list
Synfig-devl@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/synfig-devl


[Synfig-devl] Carlos Lopez : Fix bug #388: Feathered outlines doesn' t show in Navigator and Cairo render

2013-04-20 Thread root
Author: Carlos Lopez 
Date:   Sat Apr 20 18:09:44 2013 +0200

Fix bug #388: Feathered outlines doesn't show in Navigator and Cairo render

---

 synfig-core/src/modules/mod_geometry/outline.cpp |3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)

diff --git a/synfig-core/src/modules/mod_geometry/outline.cpp 
b/synfig-core/src/modules/mod_geometry/outline.cpp
index 630cd90..1ca38c4 100644
--- a/synfig-core/src/modules/mod_geometry/outline.cpp
+++ b/synfig-core/src/modules/mod_geometry/outline.cpp
@@ -1063,9 +1063,10 @@ Outline::accelerated_cairorender(Context 
context,cairo_surface_t *surface,int qu
// Extract the alpha values:
int x, y;
int wh(workdesc.get_h()), ww(workdesc.get_w());
+   float div=1.0/((float)(CairoColor::ceil));
for(y=0; yhttp://www2.precog.com/precogplatform/slashdotnewsletter
___
Synfig-devl mailing list
Synfig-devl@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/synfig-devl


[Synfig-devl] Carlos Lopez : Fix bug #387: (Cairo) Zooming in with Low-Res on causes crash.

2013-04-20 Thread root
Author: Carlos Lopez 
Date:   Sat Apr 20 09:27:33 2013 +0200

Fix bug #387: (Cairo) Zooming in with Low-Res on causes crash.
A non initialized variable that was used later was causing a floating point 
exception.

---

 .../src/gui/workarearenderer/renderer_canvas.cpp   |2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/synfig-studio/src/gui/workarearenderer/renderer_canvas.cpp 
b/synfig-studio/src/gui/workarearenderer/renderer_canvas.cpp
index ce29bb2..cad56bb 100644
--- a/synfig-studio/src/gui/workarearenderer/renderer_canvas.cpp
+++ b/synfig-studio/src/gui/workarearenderer/renderer_canvas.cpp
@@ -168,7 +168,7 @@ Renderer_Canvas::render_vfunc(
}
else // tiled frame
{
-   int div;
+   int div= 
get_work_area()->get_low_res_pixel_size();;
 
const int 
width_in_tiles(w/tile_w+(((get_work_area()->get_low_resolution_flag())?((w/div)%(tile_w/div)):(w%tile_w))?1:0));
const int 
height_in_tiles(h/tile_h+(h%tile_h?1:0));


--
Precog is a next-generation analytics platform capable of advanced
analytics on semi-structured data. The platform includes APIs for building
apps and a phenomenal toolset for data science. Developers can use
our toolset for easy data analysis & visualization. Get a free account!
http://www2.precog.com/precogplatform/slashdotnewsletter
___
Synfig-devl mailing list
Synfig-devl@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/synfig-devl


[Synfig-devl] Carlos Lopez : Fix bug #384: Blur layer is broken in tile mode and Cairo.

2013-04-19 Thread root
Author: Carlos Lopez 
Date:   Fri Apr 19 20:53:11 2013 +0200

Fix bug #384: Blur layer is broken in tile mode and Cairo.
the horizontal and vertical box blurs, used in Fast Gaussian, Box, and Cross 
blurs, didn't take in consideration to convert the value types to accumulator 
types when doing the operations for blur.

---

 ETL/ETL/_boxblur.h |   28 ++--
 1 files changed, 18 insertions(+), 10 deletions(-)

diff --git a/ETL/ETL/_boxblur.h b/ETL/ETL/_boxblur.h
index c043dc3..7a713b4 100644
--- a/ETL/ETL/_boxblur.h
+++ b/ETL/ETL/_boxblur.h
@@ -51,17 +51,21 @@ hbox_blur(T1 pen,int w, int h, int length, T2 outpen)
iter=pen.x();
end=pen.end_x();
 
-   typename T1::accumulator_type tot(*iter*(length+1));
+   typename T1::accumulator_type tot((typename 
T1::accumulator_type)(*iter)*(length+1));
 
for (x=0;xlength) ? iter[-length-1] : *pen.x();
-   tot += ((x+length)length) ?
+   (typename 
T1::accumulator_type)(iter[-length-1]) :
+   (typename T1::accumulator_type)(*pen.x());
+   tot += ((x+length)length) ? iter[-length-1] : *pen.y();
-   tot += ((y+length)length) ?
+   (typename T1::accumulator_type)(iter[-length-1]) :
+   (typename T1::accumulator_type)(*pen.y());
+   tot += ((y+length)http://www2.precog.com/precogplatform/slashdotnewsletter
___
Synfig-devl mailing list
Synfig-devl@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/synfig-devl


[Synfig-devl] Carlos Lopez : Fix bug 385: Feathered shapes render is affected by render tile mode in Cairo

2013-04-19 Thread root
Author: Carlos Lopez 
Date:   Fri Apr 19 14:40:17 2013 +0200

Fix bug 385: Feathered shapes render is affected by render tile mode in Cairo

---

 .../src/modules/mod_geometry/advanced_outline.cpp  |   12 
 synfig-core/src/modules/mod_geometry/outline.cpp   |   12 
 synfig-core/src/modules/mod_geometry/region.cpp|   14 +-
 synfig-core/src/synfig/layer_polygon.cpp   |   12 
 4 files changed, 33 insertions(+), 17 deletions(-)

diff --git a/synfig-core/src/modules/mod_geometry/advanced_outline.cpp 
b/synfig-core/src/modules/mod_geometry/advanced_outline.cpp
index 22a1cd5..f4344ec 100644
--- a/synfig-core/src/modules/mod_geometry/advanced_outline.cpp
+++ b/synfig-core/src/modules/mod_geometry/advanced_outline.cpp
@@ -1590,7 +1590,11 @@ Advanced_Outline::accelerated_cairorender(Context 
context,cairo_surface_t *surfa
cairo_paint(subcr);
}
// Draw the outline
-   cairo_translate(subcr, tx , ty);
+   // Calculate new translations after expand the tile
+   const double extx((-workdesc.get_tl()[0]+origin[0])*sx);
+   const double exty((-workdesc.get_tl()[1]+origin[1])*sy);
+   
+   cairo_translate(subcr, extx , exty);
cairo_scale(subcr, sx, sy);
switch(winding_style)
{
@@ -1659,10 +1663,10 @@ Advanced_Outline::accelerated_cairorender(Context 
context,cairo_surface_t *surfa
cairo_surface_destroy(subimage);
return false;
}
-   double px(tl[0]-workdesc.get_tl()[0]);
-   double py(tl[1]-workdesc.get_tl()[1]);
cairo_save(cr);
-   cairo_set_source_surface(cr, subimage, px, py );
+   const double px(tl[0]-workdesc.get_tl()[0]);
+   const double py(tl[1]-workdesc.get_tl()[1]);
+   cairo_set_source_surface(cr, subimage, -px*sx, -py*sy);
cairo_paint_with_alpha_operator(cr, get_amount(), get_blend_method());
cairo_restore(cr);
cairo_surface_destroy(subimage);
diff --git a/synfig-core/src/modules/mod_geometry/outline.cpp 
b/synfig-core/src/modules/mod_geometry/outline.cpp
index 74f29b4..630cd90 100644
--- a/synfig-core/src/modules/mod_geometry/outline.cpp
+++ b/synfig-core/src/modules/mod_geometry/outline.cpp
@@ -980,7 +980,11 @@ Outline::accelerated_cairorender(Context 
context,cairo_surface_t *surface,int qu
cairo_paint(subcr);
}
// Draw the outline
-   cairo_translate(subcr, tx , ty);
+   // Calculate new translations after expand the tile
+   const double extx((-workdesc.get_tl()[0]+origin[0])*sx);
+   const double exty((-workdesc.get_tl()[1]+origin[1])*sy);
+   
+   cairo_translate(subcr, extx , exty);
cairo_scale(subcr, sx, sy);
switch(winding_style)
{
@@ -1089,10 +1093,10 @@ Outline::accelerated_cairorender(Context 
context,cairo_surface_t *surface,int qu
cairo_surface_destroy(subimage);
return false;
}
-   double px(tl[0]-workdesc.get_tl()[0]);
-   double py(tl[1]-workdesc.get_tl()[1]);
cairo_save(cr);
-   cairo_set_source_surface(cr, subimage, px, py );
+   const double px(tl[0]-workdesc.get_tl()[0]);
+   const double py(tl[1]-workdesc.get_tl()[1]);
+   cairo_set_source_surface(cr, subimage, -px*sx, -py*sy);
cairo_paint_with_alpha_operator(cr, get_amount(), get_blend_method());
cairo_restore(cr);
cairo_surface_destroy(subimage);
diff --git a/synfig-core/src/modules/mod_geometry/region.cpp 
b/synfig-core/src/modules/mod_geometry/region.cpp
index 1f84cf2..b09cdcb 100644
--- a/synfig-core/src/modules/mod_geometry/region.cpp
+++ b/synfig-core/src/modules/mod_geometry/region.cpp
@@ -360,8 +360,12 @@ Region::accelerated_cairorender(Context 
context,cairo_surface_t *surface,int qua
{
cairo_paint(subcr);
}
-   // Draw the region
-   cairo_translate(subcr, tx , ty);
+   // Draw the region  
+   // Calculate new translations after expand the tile
+   const double extx((-workdesc.get_tl()[0]+origin[0])*sx);
+   const double exty((-workdesc.get_tl()[1]+origin[1])*sy);
+
+   cairo_translate(subcr, extx , exty);
cairo_scale(subcr, sx, sy);
 
vector::const_iterator iter=segments.begin();
@@ -451,10 +455,10 @@ Region::accelerated_cairorender(Context 
context,cairo_surface_t *surface,int qua
cairo_surface_destroy(subimage);
return false;
}
-   double px(tl[0]-workdesc.get_tl()[0]);
-   double py(tl[1]-workdesc.get_tl()[1]);
cairo_save(cr);
-   cairo_set_source_surface(cr, subimage, px, py );
+   const double px(tl[0]-workdesc.get_tl()[0]);
+   const double py(tl[1]-workdesc.get_tl()[1]);
+   cairo_set_source_surface(cr, subimage, -px*sx, -py*sy);
cairo_paint_with_alpha_operator(cr, get_amount(), get_ble

[Synfig-devl] Carlos Lopez : CairoColor: add specialization for Blend mode ALPHA_OVER and HARD_LIGHT

2013-04-18 Thread root
Author: Carlos Lopez 
Date:   Thu Apr 18 18:56:27 2013 +0200

CairoColor: add specialization for Blend mode ALPHA_OVER and HARD_LIGHT

---

 synfig-core/src/synfig/color.cpp |   51 ++
 1 files changed, 51 insertions(+), 0 deletions(-)

diff --git a/synfig-core/src/synfig/color.cpp b/synfig-core/src/synfig/color.cpp
index c7aecef..ae53747 100644
--- a/synfig-core/src/synfig/color.cpp
+++ b/synfig-core/src/synfig/color.cpp
@@ -1058,6 +1058,45 @@ blendfunc_HARD_LIGHT(C &a,C &b,float amount)
return blendfunc_ONTO(a,b,amount);
 }
 
+template <>
+CairoColor
+blendfunc_HARD_LIGHT(CairoColor &a, CairoColor &b, float amount)
+{
+   if(amount<0) a=~a, amount=-amount;
+   
+   int ra, ga, ba, aa;
+   int rb, gb, bb, ab;
+   int rc, gc, bc, ac;
+   
+   ra=a.get_r();
+   ga=a.get_g();
+   ba=a.get_b();
+   aa=a.get_a();
+   
+   rb=b.get_r();
+   gb=b.get_g();
+   bb=b.get_b();
+   ab=b.get_a();
+   
+   if(ra>127)  rc =255 -  (255-(ra*2-255))  *  (255-rb)/255.0;
+   elserc= rb*(ra*2)/255.0;
+   if(ga>127)  gc =255 -  (255-(ga*2-255))  *  (255-gb)/255.0;
+   elsegc= gb*(ga*2)/255.0;
+   if(ba>127)  bc =255 -  (255-(ba*2-255))  *  (255-bb)/255.0;
+   elsebc= bb*(ba*2)/255.0;
+
+   return CairoColor::blend(CairoColor(rc, gc, bc, aa),b,amount, 
Color::BLEND_ONTO);
+//
+// if(a.get_r()>half)  
a.set_r(one-(one-(a.get_r()*2*one-one))*(one-b.get_r()));
+// elsea.set_r(b.get_r()*(a.get_r()*2*one));
+// if(a.get_g()>half)  
a.set_g(one-(one-(a.get_g()*2*one-one))*(one-b.get_g()));
+// elsea.set_g(b.get_g()*(a.get_g()*2*one));
+// if(a.get_b()>half)  
a.set_b(one-(one-(a.get_b()*2*one-one))*(one-b.get_b()));
+// elsea.set_b(b.get_b()*(a.get_b()*2*one));
+// 
+// return blendfunc_ONTO(a,b,amount);
+}
+
 template 
 static C
 blendfunc_ALPHA_OVER(C &a,C &b,float amount)
@@ -1071,6 +1110,18 @@ blendfunc_ALPHA_OVER(C &a,C &b,float amount)
return blendfunc_STRAIGHT(rm,b,amount);
 }
 
+template <>
+CairoColor
+blendfunc_ALPHA_OVER(CairoColor &a, CairoColor &b, float amount)
+{
+   CairoColor rm(b);
+   
+   //multiply the inverse alpha channel with the one below us
+   rm.set_a((255-a.get_a())*b.get_a()/255.0);
+   
+   return CairoColor::blend(rm,b,amount, Color::BLEND_STRAIGHT);
+}
+
 
 Color
 Color::blend(Color a, Color b,float amount, Color::BlendMethod type)


--
Precog is a next-generation analytics platform capable of advanced
analytics on semi-structured data. The platform includes APIs for building
apps and a phenomenal toolset for data science. Developers can use
our toolset for easy data analysis & visualization. Get a free account!
http://www2.precog.com/precogplatform/slashdotnewsletter
___
Synfig-devl mailing list
Synfig-devl@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/synfig-devl


[Synfig-devl] Carlos Lopez : CairoColor: add specialization for Blend mode COLOR, HUE, SATURATION, LUMINANCE and BEHIND

2013-04-18 Thread root
Author: Carlos Lopez 
Date:   Thu Apr 18 18:37:54 2013 +0200

CairoColor: add specialization for Blend mode COLOR, HUE, SATURATION, LUMINANCE 
and BEHIND

---

 synfig-core/src/synfig/color.cpp |   39 ++
 1 files changed, 39 insertions(+), 0 deletions(-)

diff --git a/synfig-core/src/synfig/color.cpp b/synfig-core/src/synfig/color.cpp
index 8e47c98..c7aecef 100644
--- a/synfig-core/src/synfig/color.cpp
+++ b/synfig-core/src/synfig/color.cpp
@@ -779,6 +779,15 @@ blendfunc_COLOR(C &a,C &b,float amount)
return (temp-b)*amount*a.get_a()+b;
 }
 
+
+template <>
+CairoColor
+blendfunc_COLOR(CairoColor &a, CairoColor &b, float amount)
+{
+   return CairoColor(Color::blend(Color(a), Color(b), amount, 
Color::BLEND_COLOR));
+}
+
+
 template 
 static C
 blendfunc_HUE(C &a,C &b,float amount)
@@ -788,6 +797,13 @@ blendfunc_HUE(C &a,C &b,float amount)
return (temp-b)*amount*a.get_a()+b;
 }
 
+template <>
+CairoColor
+blendfunc_HUE(CairoColor &a, CairoColor &b, float amount)
+{
+   return CairoColor(Color::blend(Color(a), Color(b), amount, 
Color::BLEND_HUE));
+}
+
 template 
 static C
 blendfunc_SATURATION(C &a,C &b,float amount)
@@ -797,6 +813,13 @@ blendfunc_SATURATION(C &a,C &b,float amount)
return (temp-b)*amount*a.get_a()+b;
 }
 
+template <>
+CairoColor
+blendfunc_SATURATION(CairoColor &a, CairoColor &b, float amount)
+{
+   return CairoColor(Color::blend(Color(a), Color(b), amount, 
Color::BLEND_SATURATION));
+}
+
 template 
 static C
 blendfunc_LUMINANCE(C &a,C &b,float amount)
@@ -806,6 +829,13 @@ blendfunc_LUMINANCE(C &a,C &b,float amount)
return (temp-b)*amount*a.get_a()+b;
 }
 
+template <>
+CairoColor
+blendfunc_LUMINANCE(CairoColor &a, CairoColor &b, float amount)
+{
+   return CairoColor(Color::blend(Color(a), Color(b), amount, 
Color::BLEND_LUMINANCE));
+}
+
 template 
 static C
 blendfunc_BEHIND(C &a,C &b,float amount)
@@ -817,6 +847,15 @@ blendfunc_BEHIND(C &a,C &b,float amount)
return blendfunc_COMPOSITE(b,a,1.0);
 }
 
+template <>
+CairoColor
+blendfunc_BEHIND(CairoColor &a, CairoColor &b, float amount)
+{
+   a.set_a(a.get_a()*amount);
+   return CairoColor::blend(b, a, 1.0, Color::BLEND_COMPOSITE);
+}
+
+
 template 
 static C
 blendfunc_ALPHA_BRIGHTEN(C &a,C &b,float amount)


--
Precog is a next-generation analytics platform capable of advanced
analytics on semi-structured data. The platform includes APIs for building
apps and a phenomenal toolset for data science. Developers can use
our toolset for easy data analysis & visualization. Get a free account!
http://www2.precog.com/precogplatform/slashdotnewsletter
___
Synfig-devl mailing list
Synfig-devl@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/synfig-devl


[Synfig-devl] Carlos Lopez : Fix blend method DIVIDE for CairoColor.

2013-04-16 Thread root
Author: Carlos Lopez 
Date:   Wed Apr 17 07:05:04 2013 +0200

Fix blend method DIVIDE for CairoColor.

---

 synfig-core/src/synfig/color.cpp |   28 
 1 files changed, 12 insertions(+), 16 deletions(-)

diff --git a/synfig-core/src/synfig/color.cpp b/synfig-core/src/synfig/color.cpp
index 086901e..8e47c98 100644
--- a/synfig-core/src/synfig/color.cpp
+++ b/synfig-core/src/synfig/color.cpp
@@ -672,9 +672,6 @@ blendfunc_DIFFERENCE(CairoColor &a, CairoColor &b, float 
amount)
return CairoColor(rc, gc, bc, ac);
 }
 
-
-
-
 template 
 static C
 blendfunc_MULTIPLY(C &a,C &b,float amount)
@@ -748,28 +745,27 @@ blendfunc_DIVIDE(CairoColor &a, CairoColor &b, float 
amount)
bb=b.get_b();
ab=b.get_a();

-   float alpha=amount*aa/255.0;
-   float ahpla=1.0-alpha;
+   const float alpha=amount*aa/255.0;
+   const float ahpla=1.0-alpha;

-   if(ab==0)
-   return CairoColor();
+   if(alphahttp://www2.precog.com/precogplatform/slashdotnewsletter
___
Synfig-devl mailing list
Synfig-devl@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/synfig-devl


[Synfig-devl] Carlos Lopez : Fix blend method DIFFERENCE for CairoColor.

2013-04-16 Thread root
Author: Carlos Lopez 
Date:   Tue Apr 16 20:39:41 2013 +0200

Fix blend method DIFFERENCE for CairoColor.

---

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

diff --git a/synfig-core/src/synfig/color.cpp b/synfig-core/src/synfig/color.cpp
index 7d330d1..086901e 100644
--- a/synfig-core/src/synfig/color.cpp
+++ b/synfig-core/src/synfig/color.cpp
@@ -662,11 +662,11 @@ blendfunc_DIFFERENCE(CairoColor &a, CairoColor &b, float 
amount)
bb=b.get_b();
ab=b.get_a();

-   int aba=ab*amount;
+   const float aaa=aa*amount/255.0;

-   rc=abs(rb-(ra*aba)/255);
-   gc=abs(gb-(ga*aba)/255);
-   bc=abs(bb-(ba*aba)/255);
+   rc=abs(rb-ra*aaa);
+   gc=abs(gb-ga*aaa);
+   bc=abs(bb-ba*aaa);
ac=ab;

return CairoColor(rc, gc, bc, ac);


--
Precog is a next-generation analytics platform capable of advanced
analytics on semi-structured data. The platform includes APIs for building
apps and a phenomenal toolset for data science. Developers can use
our toolset for easy data analysis & visualization. Get a free account!
http://www2.precog.com/precogplatform/slashdotnewsletter
___
Synfig-devl mailing list
Synfig-devl@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/synfig-devl


[Synfig-devl] Carlos Lopez : Fix blend method SUBTRACT for CairoColor.

2013-04-16 Thread root
Author: Carlos Lopez 
Date:   Tue Apr 16 20:36:33 2013 +0200

Fix blend method SUBTRACT for CairoColor.

---

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

diff --git a/synfig-core/src/synfig/color.cpp b/synfig-core/src/synfig/color.cpp
index ab3edba..7d330d1 100644
--- a/synfig-core/src/synfig/color.cpp
+++ b/synfig-core/src/synfig/color.cpp
@@ -620,11 +620,11 @@ blendfunc_SUBTRACT(CairoColor &a, CairoColor &b, float 
amount)
bb=b.get_b();
ab=b.get_a();

-   int aba=ab*amount;
+   const float aaa=aa*amount/255.0;

-   rc=rb-(ra*aba)/255;
-   gc=gb-(ga*aba)/255;
-   bc=bb-(ba*aba)/255;
+   rc=rb-ra*aaa;
+   gc=gb-ga*aaa;
+   bc=bb-ba*aaa;
ac=ab;

return CairoColor(rc, gc, bc, ac);


--
Precog is a next-generation analytics platform capable of advanced
analytics on semi-structured data. The platform includes APIs for building
apps and a phenomenal toolset for data science. Developers can use
our toolset for easy data analysis & visualization. Get a free account!
http://www2.precog.com/precogplatform/slashdotnewsletter
___
Synfig-devl mailing list
Synfig-devl@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/synfig-devl


[Synfig-devl] Carlos Lopez : Fix blend method ADD for CairoColor.

2013-04-16 Thread root
Author: Carlos Lopez 
Date:   Tue Apr 16 20:31:53 2013 +0200

Fix blend method ADD for CairoColor.

---

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

diff --git a/synfig-core/src/synfig/color.cpp b/synfig-core/src/synfig/color.cpp
index b88dad5..ab3edba 100644
--- a/synfig-core/src/synfig/color.cpp
+++ b/synfig-core/src/synfig/color.cpp
@@ -578,11 +578,11 @@ blendfunc_ADD(CairoColor &a, CairoColor &b, float amount)
bb=b.get_b();
ab=b.get_a();

-   int aba=ab*amount;
+   const float aaa=aa*amount/255.0;

-   rc=rb+(ra*aba)/255;
-   gc=gb+(ga*aba)/255;
-   bc=bb+(ba*aba)/255;
+   rc=rb+ra*aaa;
+   gc=gb+ga*aaa;
+   bc=bb+ba*aaa;
ac=ab;
 
return CairoColor(rc, gc, bc, ac);


--
Precog is a next-generation analytics platform capable of advanced
analytics on semi-structured data. The platform includes APIs for building
apps and a phenomenal toolset for data science. Developers can use
our toolset for easy data analysis & visualization. Get a free account!
http://www2.precog.com/precogplatform/slashdotnewsletter
___
Synfig-devl mailing list
Synfig-devl@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/synfig-devl


[Synfig-devl] Carlos Lopez : Fix blend method DARKEN for CairoColor.

2013-04-16 Thread root
Author: Carlos Lopez 
Date:   Tue Apr 16 20:26:19 2013 +0200

Fix blend method DARKEN for CairoColor.

---

 synfig-core/src/synfig/cairo_operators.cpp |3 ++-
 synfig-core/src/synfig/color.cpp   |   20 ++--
 2 files changed, 12 insertions(+), 11 deletions(-)

diff --git a/synfig-core/src/synfig/cairo_operators.cpp 
b/synfig-core/src/synfig/cairo_operators.cpp
index f777e40..0c5f535 100644
--- a/synfig-core/src/synfig/cairo_operators.cpp
+++ b/synfig-core/src/synfig/cairo_operators.cpp
@@ -279,7 +279,8 @@ void cairo_paint_with_alpha_operator(cairo_t* acr, float 
alpha, Color::BlendMeth
for(int y=0;y rcompare)
rc=rcompare;
else
rc=rb;

-   int gcompare=(amount*(ga*ab-abaa)+ab255)/255;
+   int gcompare=(ga-255)*alpha+255;
if(gb > gcompare)
gc=gcompare;
else
gc=gb;
 
-   int bcompare=(amount*(ba*ab-abaa)+ab255)/255;
+   int bcompare=(ba-255)*alpha+255;
if(bb > bcompare)
bc=bcompare;
else


--
Precog is a next-generation analytics platform capable of advanced
analytics on semi-structured data. The platform includes APIs for building
apps and a phenomenal toolset for data science. Developers can use
our toolset for easy data analysis & visualization. Get a free account!
http://www2.precog.com/precogplatform/slashdotnewsletter
___
Synfig-devl mailing list
Synfig-devl@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/synfig-devl


[Synfig-devl] Carlos Lopez : Fix blend method BRIGHTEN for CairoColor.

2013-04-16 Thread root
Author: Carlos Lopez 
Date:   Tue Apr 16 20:08:41 2013 +0200

Fix blend method BRIGHTEN for CairoColor.

---

 synfig-core/src/synfig/color.cpp |6 +++---
 1 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/synfig-core/src/synfig/color.cpp b/synfig-core/src/synfig/color.cpp
index 24ca765..2323c9e 100644
--- a/synfig-core/src/synfig/color.cpp
+++ b/synfig-core/src/synfig/color.cpp
@@ -457,9 +457,9 @@ blendfunc_BRIGHTEN(CairoColor &a, CairoColor &b, float 
amount)
bb=b.get_b();
ab=b.get_a();
 
-   const int raab(ra*ab*amount/255.0);
-   const int gaab(ga*ab*amount/255.0);
-   const int baab(ba*ab*amount/255.0);
+   const int raab(ra*aa*amount/255.0);
+   const int gaab(ga*aa*amount/255.0);
+   const int baab(ba*aa*amount/255.0);

if(rbhttp://www2.precog.com/precogplatform/slashdotnewsletter
___
Synfig-devl mailing list
Synfig-devl@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/synfig-devl


[Synfig-devl] Carlos Lopez : CairoColor: add specialization for Blend mode STRAIGHT ONTO

2013-04-16 Thread root
Author: Carlos Lopez 
Date:   Tue Apr 16 19:57:44 2013 +0200

CairoColor: add specialization for Blend mode STRAIGHT ONTO

---

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

diff --git a/synfig-core/src/synfig/color.cpp b/synfig-core/src/synfig/color.cpp
index d99b5b1..24ca765 100644
--- a/synfig-core/src/synfig/color.cpp
+++ b/synfig-core/src/synfig/color.cpp
@@ -412,6 +412,14 @@ blendfunc_STRAIGHT_ONTO(C &a,C &b,float amount)
return blendfunc_STRAIGHT(a,b,amount);
 }
 
+template <>
+CairoColor
+blendfunc_STRAIGHT_ONTO(CairoColor &a, CairoColor &b, float amount)
+{
+   a.set_a(a.get_a()*b.get_a()/255.0);
+   return CairoColor::blend(a, b, amount, Color::BLEND_STRAIGHT);
+}
+
 template 
 static C
 blendfunc_BRIGHTEN(C &a,C &b,float amount)


--
Precog is a next-generation analytics platform capable of advanced
analytics on semi-structured data. The platform includes APIs for building
apps and a phenomenal toolset for data science. Developers can use
our toolset for easy data analysis & visualization. Get a free account!
http://www2.precog.com/precogplatform/slashdotnewsletter
___
Synfig-devl mailing list
Synfig-devl@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/synfig-devl


[Synfig-devl] Carlos Lopez : Fix blend method OVERLAY for CairoColor. Add methods for ONTO and SCREEN fro CairoColor

2013-04-14 Thread root
Author: Carlos Lopez 
Date:   Sun Apr 14 21:50:25 2013 +0200

Fix blend method OVERLAY for CairoColor. Add methods for ONTO and SCREEN fro 
CairoColor

---

 synfig-core/src/synfig/cairo_operators.cpp |7 +++--
 synfig-core/src/synfig/color.cpp   |   36 +---
 2 files changed, 31 insertions(+), 12 deletions(-)

diff --git a/synfig-core/src/synfig/cairo_operators.cpp 
b/synfig-core/src/synfig/cairo_operators.cpp
index 9840417..f777e40 100644
--- a/synfig-core/src/synfig/cairo_operators.cpp
+++ b/synfig-core/src/synfig/cairo_operators.cpp
@@ -223,17 +223,18 @@ void cairo_paint_with_alpha_operator(cairo_t* acr, float 
alpha, Color::BlendMeth
for(int y=0;y
+CairoColor
+blendfunc_ONTO(CairoColor &a, CairoColor &b, float amount)
+{
+   unsigned char alpha(b.get_a());
+   return blendfunc_COMPOSITE(a,b.set_a(255),amount).set_a(alpha);
+}
+
+
 template 
 static C
 blendfunc_STRAIGHT_ONTO(C &a,C &b,float amount)
@@ -910,6 +919,20 @@ blendfunc_SCREEN(C &a,C &b,float amount)
return blendfunc_ONTO(a,b,amount);
 }
 
+template <>
+CairoColor
+blendfunc_SCREEN(CairoColor &a, CairoColor &b, float amount)
+{
+   if(amount<0) a=~a, amount=-amount;
+   
+   a.set_r(255-(255-a.get_r())*(1.0-b.get_r()/255.0));
+   a.set_g(255-(255-a.get_g())*(1.0-b.get_g()/255.0));
+   a.set_b(255-(255-a.get_b())*(1.0-b.get_b()/255.0));
+
+   return blendfunc_ONTO(a,b,amount);
+}
+
+
 template 
 static C
 blendfunc_OVERLAY(C &a,C &b,float amount)
@@ -937,17 +960,14 @@ blendfunc_OVERLAY(C &a,C &b,float amount)
 }
 
 //Specialization for CairoColors
-// OVERLAY needs a further compositon with ONTO
 template <>
 CairoColor
 blendfunc_OVERLAY(CairoColor &a,CairoColor &b,float amount)
 {
-   //const float one(C::ceil);
if(amount<0) a=~a, amount=-amount;

int ra, ga, ba, aa, ras, gas, bas;
int rb, gb, bb, ab;
-   int aaab;
 
ra=a.get_r();
ras=ra*ra;
@@ -967,14 +987,12 @@ blendfunc_OVERLAY(CairoColor &a,CairoColor 
&b,float amount)

if(aa==0 || ab==0) return CairoColor();

-   aaab=aa*ab;
-   
-   rc=(2*aa*rb*ra+ras*ab-2*rb*ras)/aaab;
-   gc=(2*aa*gb*ga+gas*ab-2*gb*gas)/aaab;
-   bc=(2*aa*bb*ba+bas*ab-2*bb*bas)/aaab;
+   rc=(2*rb*ra+ras-2*rb*ras/255.0)/255.0;
+   gc=(2*gb*ga+gas-2*gb*gas/255.0)/255.0;
+   bc=(2*bb*ba+bas-2*bb*bas/255.0)/255.0;
ac=aa;

-   return CairoColor(rc, gc, bc, ac);
+   return CairoColor::blend(CairoColor(rc, gc, bc, ac), b, amount, 
Color::BLEND_ONTO);
 }
 
 


--
Precog is a next-generation analytics platform capable of advanced
analytics on semi-structured data. The platform includes APIs for building
apps and a phenomenal toolset for data science. Developers can use
our toolset for easy data analysis & visualization. Get a free account!
http://www2.precog.com/precogplatform/slashdotnewsletter
___
Synfig-devl mailing list
Synfig-devl@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/synfig-devl


[Synfig-devl] Carlos Lopez : CairoColor: add specialization for Blend mode STRAIGHT

2013-04-14 Thread root
Author: Carlos Lopez 
Date:   Sun Apr 14 20:30:36 2013 +0200

CairoColor: add specialization for Blend mode STRAIGHT

---

 synfig-core/src/synfig/color.cpp |   35 +++
 1 files changed, 35 insertions(+), 0 deletions(-)

diff --git a/synfig-core/src/synfig/color.cpp b/synfig-core/src/synfig/color.cpp
index 0b14090..249ab19 100644
--- a/synfig-core/src/synfig/color.cpp
+++ b/synfig-core/src/synfig/color.cpp
@@ -351,6 +351,41 @@ blendfunc_STRAIGHT(C &src,C &bg,float amount)
return out;
 }
 
+//Specialization for CairoColor
+template <>
+CairoColor
+blendfunc_STRAIGHT(CairoColor &a, CairoColor &b, float amount)
+{  
+   int ra, ga, ba, aa; //src
+   int rb, gb, bb, ab; //bg
+   int rc, gc, bc;
+   float ac; //out
+   
+   ra=a.get_r();
+   ga=a.get_g();
+   ba=a.get_b();
+   aa=a.get_a();
+   
+   rb=b.get_r();
+   gb=b.get_g();
+   bb=b.get_b();
+   ab=b.get_a();
+   
+   ac=(aa-ab)*amount+ab;
+   
+   // if ac!=0.0
+   if(fabsf(ac)>COLOR_EPSILON)
+   {
+   rc= ((ra*aa-rb*ab)*amount + rb*ab)/ac;
+   gc= ((ga*aa-gb*ab)*amount + gb*ab)/ac;
+   bc= ((ba*aa-bb*ab)*amount + bb*ab)/ac;
+   return CairoColor(rc, gc, bc, ac);
+   }
+   else
+   return CairoColor::alpha();
+}
+
+
 template 
 static C
 blendfunc_ONTO(C &a,C &b,float amount)


--
Precog is a next-generation analytics platform capable of advanced
analytics on semi-structured data. The platform includes APIs for building
apps and a phenomenal toolset for data science. Developers can use
our toolset for easy data analysis & visualization. Get a free account!
http://www2.precog.com/precogplatform/slashdotnewsletter
___
Synfig-devl mailing list
Synfig-devl@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/synfig-devl


[Synfig-devl] Carlos Lopez : Fix blend method COMPOSITE for CairoColor.

2013-04-14 Thread root
Author: Carlos Lopez 
Date:   Sun Apr 14 20:30:18 2013 +0200

Fix blend method COMPOSITE for CairoColor.

---

 synfig-core/src/synfig/color.cpp |   28 +++-
 1 files changed, 19 insertions(+), 9 deletions(-)

diff --git a/synfig-core/src/synfig/color.cpp b/synfig-core/src/synfig/color.cpp
index e08f322..0b14090 100644
--- a/synfig-core/src/synfig/color.cpp
+++ b/synfig-core/src/synfig/color.cpp
@@ -289,24 +289,34 @@ blendfunc_COMPOSITE(CairoColor &a, CairoColor &b, float 
amount)
 {
int ra, ga, ba, aa;
int rb, gb, bb, ab;
-   int rc, gc, bc, ac;
+   int rc, gc, bc;
+   float ac;
+   
+   float faa, fab, A, AA;

ra=a.get_r();
ga=a.get_g();
ba=a.get_b();
-   aa=a.get_a()*amount;
+   aa=a.get_a();
+   aa=aa*amount;
+   A=aa/255.0;
+   AA=1.0-A;

rb=b.get_r();
gb=b.get_g();
bb=b.get_b();
ab=b.get_a();
-   
-   ac=aa+(ab*(255-aa))/255;
-   if(ac==0) return CairoColor::alpha();
-   
-   rc=(ra*aa+rb*ab*(255-aa)/255)/255;
-   gc=(ga*aa+gb*ab*(255-aa)/255)/255;
-   bc=(ba*aa+bb*ab*(255-aa)/255)/255;
+
+   ac=aa+ab*AA;
+   if(fabsf(ac)http://www2.precog.com/precogplatform/slashdotnewsletter
___
Synfig-devl mailing list
Synfig-devl@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/synfig-devl


[Synfig-devl] Carlos Lopez : Fix blend method MULTIPLY for CairoColor.

2013-04-14 Thread root
Author: Carlos Lopez 
Date:   Sun Apr 14 18:05:26 2013 +0200

Fix blend method MULTIPLY for CairoColor.

---

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

diff --git a/synfig-core/src/synfig/color.cpp b/synfig-core/src/synfig/color.cpp
index bad7724..e08f322 100644
--- a/synfig-core/src/synfig/color.cpp
+++ b/synfig-core/src/synfig/color.cpp
@@ -631,7 +631,7 @@ CairoColor
 blendfunc_MULTIPLY(CairoColor &a,CairoColor &b, float amount)
 {
if(amount<0) a=~a, amount=-amount;
-   amount*=a.get_a()/255;
+   amount*=a.get_a()/255.0;
int ra, ga, ba;
int rb, gb, bb;
 
@@ -643,9 +643,9 @@ blendfunc_MULTIPLY(CairoColor &a,CairoColor &b, float 
amount)
gb=b.get_g();
bb=b.get_b();

-   b.set_r((rb*ra/255-rb)*(amount)+rb);
-   b.set_g((gb*ga/255-gb)*(amount)+gb);
-   b.set_b((bb*ba/255-bb)*(amount)+bb);
+   b.set_r((rb*ra*amount/255.0)+rb*(1.0-amount));
+   b.set_g((gb*ga*amount/255.0)+gb*(1.0-amount));
+   b.set_b((bb*ba*amount/255.0)+bb*(1.0-amount));
return b;
 }
 


--
Precog is a next-generation analytics platform capable of advanced
analytics on semi-structured data. The platform includes APIs for building
apps and a phenomenal toolset for data science. Developers can use
our toolset for easy data analysis & visualization. Get a free account!
http://www2.precog.com/precogplatform/slashdotnewsletter
___
Synfig-devl mailing list
Synfig-devl@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/synfig-devl


[Synfig-devl] Carlos Lopez : Remove unused variables

2013-04-14 Thread root
Author: Carlos Lopez 
Date:   Sun Apr 14 17:45:31 2013 +0200

Remove unused variables

---

 synfig-core/src/synfig/color.cpp |5 ++---
 1 files changed, 2 insertions(+), 3 deletions(-)

diff --git a/synfig-core/src/synfig/color.cpp b/synfig-core/src/synfig/color.cpp
index d5ed717..bad7724 100644
--- a/synfig-core/src/synfig/color.cpp
+++ b/synfig-core/src/synfig/color.cpp
@@ -632,9 +632,8 @@ blendfunc_MULTIPLY(CairoColor &a,CairoColor &b, float 
amount)
 {
if(amount<0) a=~a, amount=-amount;
amount*=a.get_a()/255;
-   int ra, ga, ba, aa;
-   int rb, gb, bb, ab;
-   int rc, gc, bc, ac;
+   int ra, ga, ba;
+   int rb, gb, bb;
 
ra=a.get_r();
ga=a.get_g();


--
Precog is a next-generation analytics platform capable of advanced
analytics on semi-structured data. The platform includes APIs for building
apps and a phenomenal toolset for data science. Developers can use
our toolset for easy data analysis & visualization. Get a free account!
http://www2.precog.com/precogplatform/slashdotnewsletter
___
Synfig-devl mailing list
Synfig-devl@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/synfig-devl


[Synfig-devl] Carlos Lopez : CairoColor: add specialisation for blend method MULTIPLY

2013-04-11 Thread root
Author: Carlos Lopez 
Date:   Thu Apr 11 18:31:18 2013 +0200

CairoColor: add specialisation for blend method MULTIPLY

---

 synfig-core/src/synfig/color.cpp |   24 
 1 files changed, 24 insertions(+), 0 deletions(-)

diff --git a/synfig-core/src/synfig/color.cpp b/synfig-core/src/synfig/color.cpp
index 68b3f33..d5ed717 100644
--- a/synfig-core/src/synfig/color.cpp
+++ b/synfig-core/src/synfig/color.cpp
@@ -626,6 +626,30 @@ blendfunc_MULTIPLY(C &a,C &b,float amount)
return b;
 }
 
+template <>
+CairoColor
+blendfunc_MULTIPLY(CairoColor &a,CairoColor &b, float amount)
+{
+   if(amount<0) a=~a, amount=-amount;
+   amount*=a.get_a()/255;
+   int ra, ga, ba, aa;
+   int rb, gb, bb, ab;
+   int rc, gc, bc, ac;
+
+   ra=a.get_r();
+   ga=a.get_g();
+   ba=a.get_b();
+   
+   rb=b.get_r();
+   gb=b.get_g();
+   bb=b.get_b();
+   
+   b.set_r((rb*ra/255-rb)*(amount)+rb);
+   b.set_g((gb*ga/255-gb)*(amount)+gb);
+   b.set_b((bb*ba/255-bb)*(amount)+bb);
+   return b;
+}
+
 template 
 static C
 blendfunc_DIVIDE(C &a,C &b,float amount)


--
Precog is a next-generation analytics platform capable of advanced
analytics on semi-structured data. The platform includes APIs for building
apps and a phenomenal toolset for data science. Developers can use
our toolset for easy data analysis & visualization. Get a free account!
http://www2.precog.com/precogplatform/slashdotnewsletter
___
Synfig-devl mailing list
Synfig-devl@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/synfig-devl


[Synfig-devl] Carlos Lopez : New member get_cairo_color for NoiseDistort

2013-04-08 Thread root
Author: Carlos Lopez 
Date:   Mon Apr  8 22:20:37 2013 +0200

New member get_cairo_color for NoiseDistort

---

 synfig-core/src/modules/mod_noise/distort.cpp |   86 -
 synfig-core/src/modules/mod_noise/distort.h   |3 +
 2 files changed, 58 insertions(+), 31 deletions(-)

diff --git a/synfig-core/src/modules/mod_noise/distort.cpp 
b/synfig-core/src/modules/mod_noise/distort.cpp
index a2642fe..2dfbde1 100644
--- a/synfig-core/src/modules/mod_noise/distort.cpp
+++ b/synfig-core/src/modules/mod_noise/distort.cpp
@@ -77,53 +77,65 @@ NoiseDistort::NoiseDistort():
Layer::fill_static(voc);
 }
 
-inline Color
-NoiseDistort::color_func(const Point &point, float /*supersample*/,Context 
context)const
+inline Point
+NoiseDistort::point_func(const Point &point)const
 {
-   Color ret(0,0,0,0);
-
float x(point[0]/size[0]*(1<1)vect[0]=1;
+   if(vect[1]<-1)vect[1]=-1;if(vect[1]>1)vect[1]=1;
+   
+   if(turbulent)
{
-   
vect[0]=random(smooth,0+(detail-i)*5,x,y,time)+vect[0]*0.5;
-   
vect[1]=random(smooth,1+(detail-i)*5,x,y,time)+vect[1]*0.5;
-
-   if(vect[0]<-1)vect[0]=-1;if(vect[0]>1)vect[0]=1;
-   if(vect[1]<-1)vect[1]=-1;if(vect[1]>1)vect[1]=1;
-
-   if(turbulent)
-   {
-   vect[0]=abs(vect[0]);
-   vect[1]=abs(vect[1]);
-   }
-
-   x/=2.0f;
-   y/=2.0f;
+   vect[0]=abs(vect[0]);
+   vect[1]=abs(vect[1]);
}
+   
+   x/=2.0f;
+   y/=2.0f;
+   }
+   
+   if(!turbulent)
+   {
+   vect[0]=vect[0]/2.0f+0.5f;
+   vect[1]=vect[1]/2.0f+0.5f;
+   }
+   vect[0]=(vect[0]-0.5f)*displacement[0];
+   vect[1]=(vect[1]-0.5f)*displacement[1];
+   
+   return point+vect;
+}
 
-   if(!turbulent)
-   {
-   vect[0]=vect[0]/2.0f+0.5f;
-   vect[1]=vect[1]/2.0f+0.5f;
-   }
-   vect[0]=(vect[0]-0.5f)*displacement[0];
-   vect[1]=(vect[1]-0.5f)*displacement[1];
+inline Color
+NoiseDistort::color_func(const Point &point, float /*supersample*/,Context 
context)const
+{
+   Color ret(0,0,0,0);
+   ret=context.get_color(point_func(point));
+   return ret;
+}
 
-   ret=context.get_color(point+vect);
-   }
+inline CairoColor
+NoiseDistort::cairocolor_func(const Point &point, float 
/*supersample*/,Context context)const
+{
+   CairoColor ret(0,0,0,0);
+   ret=context.get_cairocolor(point_func(point));
return ret;
 }
 
+
 inline float
 NoiseDistort::calc_supersample(const synfig::Point &/*x*/, float /*pw*/,float 
/*ph*/)const
 {
@@ -251,6 +263,17 @@ NoiseDistort::get_color(Context context, const Point 
&point)const
return 
Color::blend(color,context.get_color(point),get_amount(),get_blend_method());
 }
 
+CairoColor
+NoiseDistort::get_cairocolor(Context context, const Point &point)const
+{
+   const CairoColor color(cairocolor_func(point,0,context));
+   
+   if(get_amount()==1.0 && get_blend_method()==Color::BLEND_STRAIGHT)
+   return color;
+   else
+   return 
CairoColor::blend(color,context.get_cairocolor(point),get_amount(),get_blend_method());
+}
+
 Rect
 NoiseDistort::get_bounding_rect(Context context)const
 {
@@ -265,6 +288,7 @@ NoiseDistort::get_bounding_rect(Context context)const
return bounds;
 }
 
+
 /*
 bool
 NoiseDistort::accelerated_render(Context context,Surface *surface,int quality, 
const RendDesc &renddesc, ProgressCallback *cb)const
diff --git a/synfig-core/src/modules/mod_noise/distort.h 
b/synfig-core/src/modules/mod_noise/distort.h
index cecb157..62e9d7f 100644
--- a/synfig-core/src/modules/mod_noise/distort.h
+++ b/synfig-core/src/modules/mod_noise/distort.h
@@ -60,6 +60,8 @@ private:
mutable synfig::Time curr_time;
 
synfig::Color color_func(const synfig::Point &x, float 
supersample,synfig::Context context)const;
+   synfig::CairoColor cairocolor_func(const synfig::Point &x, float 
supersample,synfig::Context context)const;
+   synfig::Point point_func(const synfig::Point &point)const;
 
float calc_supersample(const synfig::Point &x, float pw,float ph)const;
 
@@ -69,6 +71,7 @@ public:
virtual bool set_param(const synfig::String ¶m, const 
synfig::ValueBase &value);
virtual synfig::ValueBase get_param(const synfig::String ¶m)const;
virtual synfig::Color get_color(synfig::Context context, const 
synfig::Point &pos)const;
+   virtual synfig::CairoColor get_cairocolor(synfig::Context context, 
const synfig::Point &pos)const;
//virtual bool accelerated_render(synfig::Context 
cont

[Synfig-devl] Carlos Lopez : New member get_cairocolor for Metaballs

2013-04-08 Thread root
Author: Carlos Lopez 
Date:   Mon Apr  8 22:19:55 2013 +0200

New member get_cairocolor for Metaballs

---

 synfig-core/src/modules/mod_example/metaballs.cpp |   10 ++
 synfig-core/src/modules/mod_example/metaballs.h   |1 +
 2 files changed, 11 insertions(+), 0 deletions(-)

diff --git a/synfig-core/src/modules/mod_example/metaballs.cpp 
b/synfig-core/src/modules/mod_example/metaballs.cpp
index 44ef9ec..ca3913d 100644
--- a/synfig-core/src/modules/mod_example/metaballs.cpp
+++ b/synfig-core/src/modules/mod_example/metaballs.cpp
@@ -221,6 +221,16 @@ Metaballs::get_color(Context context, const Point 
&pos)const
return 
Color::blend(gradient(totaldensity(pos)),context.get_color(pos),get_amount(),get_blend_method());
 }
 
+CairoColor
+Metaballs::get_cairocolor(Context context, const Point &pos)const
+{
+   if(get_amount()==1.0 && get_blend_method()==Color::BLEND_STRAIGHT)
+   return CairoColor(gradient(totaldensity(pos)));
+   else
+   return 
CairoColor::blend(CairoColor(gradient(totaldensity(pos))),context.get_cairocolor(pos),get_amount(),get_blend_method());
+}
+
+
 bool
 Metaballs::accelerated_render(Context context,Surface *surface,int quality, 
const RendDesc &renddesc, ProgressCallback *cb)const
 {
diff --git a/synfig-core/src/modules/mod_example/metaballs.h 
b/synfig-core/src/modules/mod_example/metaballs.h
index de6e95f..1c0a5da 100644
--- a/synfig-core/src/modules/mod_example/metaballs.h
+++ b/synfig-core/src/modules/mod_example/metaballs.h
@@ -68,6 +68,7 @@ public:
virtual synfig::ValueBase get_param(const synfig::String & param)const;
 
virtual synfig::Color get_color(synfig::Context context, const 
synfig::Point &pos)const;
+   virtual synfig::CairoColor get_cairocolor(synfig::Context context, 
const synfig::Point &pos)const;
 
virtual bool accelerated_render(synfig::Context context,synfig::Surface 
*surface,int quality, const synfig::RendDesc &renddesc, 
synfig::ProgressCallback *cb)const;
 


--
Minimize network downtime and maximize team effectiveness.
Reduce network management and security costs.Learn how to hire 
the most talented Cisco Certified professionals. Visit the 
Employer Resources Portal
http://www.cisco.com/web/learning/employer_resources/index.html
___
Synfig-devl mailing list
Synfig-devl@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/synfig-devl


[Synfig-devl] Carlos Lopez : Noise: add new member get_cairocolor to make possible render it in Cairo.

2013-04-08 Thread root
Author: Carlos Lopez 
Date:   Mon Apr  8 21:19:43 2013 +0200

Noise: add new member get_cairocolor to make possible render it in Cairo.

---

 synfig-core/src/modules/mod_noise/noise.cpp |   11 +++
 synfig-core/src/modules/mod_noise/noise.h   |1 +
 2 files changed, 12 insertions(+), 0 deletions(-)

diff --git a/synfig-core/src/modules/mod_noise/noise.cpp 
b/synfig-core/src/modules/mod_noise/noise.cpp
index 0ad5648..5985c04 100644
--- a/synfig-core/src/modules/mod_noise/noise.cpp
+++ b/synfig-core/src/modules/mod_noise/noise.cpp
@@ -312,6 +312,17 @@ Noise::get_color(Context context, const Point &point)const
return 
Color::blend(color,context.get_color(point),get_amount(),get_blend_method());
 }
 
+CairoColor
+Noise::get_cairocolor(Context context, const Point &point)const
+{
+   const CairoColor color(color_func(point,0,context));
+   
+   if(get_amount()==1.0 && get_blend_method()==Color::BLEND_STRAIGHT)
+   return color;
+   else
+   return 
CairoColor::blend(color,context.get_cairocolor(point),get_amount(),get_blend_method());
+}
+
 bool
 Noise::accelerated_render(Context context,Surface *surface,int quality, const 
RendDesc &renddesc, ProgressCallback *cb)const
 {
diff --git a/synfig-core/src/modules/mod_noise/noise.h 
b/synfig-core/src/modules/mod_noise/noise.h
index 1ea78d6..070c4a0 100644
--- a/synfig-core/src/modules/mod_noise/noise.h
+++ b/synfig-core/src/modules/mod_noise/noise.h
@@ -75,6 +75,7 @@ public:
virtual bool set_param(const synfig::String ¶m, const 
synfig::ValueBase &value);
virtual synfig::ValueBase get_param(const synfig::String ¶m)const;
virtual synfig::Color get_color(synfig::Context context, const 
synfig::Point &pos)const;
+   virtual synfig::CairoColor get_cairocolor(synfig::Context context, 
const synfig::Point &pos)const;
virtual bool accelerated_render(synfig::Context context,synfig::Surface 
*surface,int quality, const synfig::RendDesc &renddesc, 
synfig::ProgressCallback *cb)const;
synfig::Layer::Handle hit_check(synfig::Context context, const 
synfig::Point &point)const;
virtual void set_time(synfig::Context context, synfig::Time time)const;


--
Minimize network downtime and maximize team effectiveness.
Reduce network management and security costs.Learn how to hire 
the most talented Cisco Certified professionals. Visit the 
Employer Resources Portal
http://www.cisco.com/web/learning/employer_resources/index.html
___
Synfig-devl mailing list
Synfig-devl@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/synfig-devl


[Synfig-devl] Carlos Lopez : CairoColor: add specialization for Blend mode COMPOSITE

2013-04-08 Thread root
Author: Carlos Lopez 
Date:   Mon Apr  8 21:02:56 2013 +0200

CairoColor: add specialization for Blend mode COMPOSITE

---

 synfig-core/src/synfig/color.cpp |   31 +++
 1 files changed, 31 insertions(+), 0 deletions(-)

diff --git a/synfig-core/src/synfig/color.cpp b/synfig-core/src/synfig/color.cpp
index 6f4d9c2..68b3f33 100644
--- a/synfig-core/src/synfig/color.cpp
+++ b/synfig-core/src/synfig/color.cpp
@@ -282,6 +282,37 @@ blendfunc_COMPOSITE(C &src,C &dest,float amount)
return dest;
 }
 
+//Specialization for CairoColor
+template <>
+CairoColor
+blendfunc_COMPOSITE(CairoColor &a, CairoColor &b, float amount)
+{
+   int ra, ga, ba, aa;
+   int rb, gb, bb, ab;
+   int rc, gc, bc, ac;
+   
+   ra=a.get_r();
+   ga=a.get_g();
+   ba=a.get_b();
+   aa=a.get_a()*amount;
+   
+   rb=b.get_r();
+   gb=b.get_g();
+   bb=b.get_b();
+   ab=b.get_a();
+   
+   ac=aa+(ab*(255-aa))/255;
+   if(ac==0) return CairoColor::alpha();
+   
+   rc=(ra*aa+rb*ab*(255-aa)/255)/255;
+   gc=(ga*aa+gb*ab*(255-aa)/255)/255;
+   bc=(ba*aa+bb*ab*(255-aa)/255)/255;
+   
+   return CairoColor(rc, gc, bc, ac);
+
+}
+
+
 template 
 static C
 blendfunc_STRAIGHT(C &src,C &bg,float amount)


--
Minimize network downtime and maximize team effectiveness.
Reduce network management and security costs.Learn how to hire 
the most talented Cisco Certified professionals. Visit the 
Employer Resources Portal
http://www.cisco.com/web/learning/employer_resources/index.html
___
Synfig-devl mailing list
Synfig-devl@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/synfig-devl


[Synfig-devl] Carlos Lopez : Fix bug #371 - Checkerboard layer renders darker with alpha < 0 in Cairo

2013-04-08 Thread root
Author: Carlos Lopez 
Date:   Mon Apr  8 17:46:33 2013 +0200

Fix bug #371  -  Checkerboard layer renders darker with alpha < 0 in Cairo

---

 .../src/modules/mod_geometry/checkerboard.cpp  |8 ++--
 1 files changed, 2 insertions(+), 6 deletions(-)

diff --git a/synfig-core/src/modules/mod_geometry/checkerboard.cpp 
b/synfig-core/src/modules/mod_geometry/checkerboard.cpp
index cd304d1..59c74b4 100644
--- a/synfig-core/src/modules/mod_geometry/checkerboard.cpp
+++ b/synfig-core/src/modules/mod_geometry/checkerboard.cpp
@@ -252,23 +252,19 @@ CheckerBoard::accelerated_cairorender(Context 
context,cairo_surface_t *surface,i
// this will modify the w and h values in pixels.
desc.set_flags(RendDesc::PX_ASPECT|RendDesc::IM_SPAN);
desc.set_tl_br(Point(-newsize[0], +newsize[1]), Point(+newsize[0], 
-newsize[1]));
-   double subsx(1/desc.get_pw());
-   double subsy(1/desc.get_ph());
-   double subtx(-desc.get_tl()[0]*subsx);
-   double subty(-desc.get_tl()[1]*subsy);
cairo_surface_t* subimage=cairo_surface_create_similar(surface, 
CAIRO_CONTENT_COLOR_ALPHA, desc.get_w(), desc.get_h());
cairo_t* subcr=cairo_create(subimage);
cairo_save(subcr);
cairo_set_source_rgba(subcr, r, g, b, a);
cairo_rectangle(subcr, 0, 0, desc.get_w()/2, desc.get_h()/2);
cairo_clip(subcr);
-   cairo_paint_with_alpha(subcr, get_amount());
+   cairo_paint(subcr);
cairo_restore(subcr);
cairo_save(subcr);
cairo_set_source_rgba(subcr, r, g, b, a);
cairo_rectangle(subcr, desc.get_w()/2, desc.get_h()/2, desc.get_w()/2, 
desc.get_h()/2);
cairo_clip(subcr);
-   cairo_paint_with_alpha(subcr, get_amount());
+   cairo_paint(subcr);
cairo_restore(subcr);

cairo_t* cr=cairo_create(surface);


--
Minimize network downtime and maximize team effectiveness.
Reduce network management and security costs.Learn how to hire 
the most talented Cisco Certified professionals. Visit the 
Employer Resources Portal
http://www.cisco.com/web/learning/employer_resources/index.html
___
Synfig-devl mailing list
Synfig-devl@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/synfig-devl


[Synfig-devl] Carlos Lopez : Fix bug #366: Cairo render: Group layer doesn' t render its context when its content doesn't overlap.

2013-04-08 Thread root
Author: Carlos Lopez 
Date:   Sun Apr  7 18:19:36 2013 +0200

Fix bug #366: Cairo render: Group layer doesn't render its context when its 
content doesn't overlap.

---

 synfig-core/src/synfig/layer_pastecanvas.cpp |5 -
 1 files changed, 0 insertions(+), 5 deletions(-)

diff --git a/synfig-core/src/synfig/layer_pastecanvas.cpp 
b/synfig-core/src/synfig/layer_pastecanvas.cpp
index 50a6209..ddc4f4b 100644
--- a/synfig-core/src/synfig/layer_pastecanvas.cpp
+++ b/synfig-core/src/synfig/layer_pastecanvas.cpp
@@ -668,11 +668,6 @@ Layer_PasteCanvas::accelerated_cairorender(Context 
context,cairo_surface_t *surf
// surface, and we're rendering 'onto', then we're done
if (Color::is_onto(blend_method) && 
!Color::is_straight(blend_method))
return true;
-   
-   /* 'straight' is faster than 'composite' and has the same
-* effect if the affected area of the lower layer is
-* transparent.*/
-   if (blend_method==Color::BLEND_COMPOSITE) blend_using_straight 
= true;
}

// render the canvas to be pasted onto pastesurface


--
Minimize network downtime and maximize team effectiveness.
Reduce network management and security costs.Learn how to hire 
the most talented Cisco Certified professionals. Visit the 
Employer Resources Portal
http://www.cisco.com/web/learning/employer_resources/index.html
___
Synfig-devl mailing list
Synfig-devl@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/synfig-devl


[Synfig-devl] Carlos Lopez : Synfig core doesn't depend on Cairomm

2013-04-06 Thread root
Author: Carlos Lopez 
Date:   Sat Apr  6 17:35:32 2013 +0200

Synfig core doesn't depend on Cairomm

---

 synfig-core/configure.ac |5 -
 synfig-core/src/modules/mod_png/mptr_cairo_png.h |1 -
 synfig-core/src/synfig/cairo_operators.h |1 -
 synfig-core/src/synfig/cairoimporter.h   |1 -
 synfig-core/src/synfig/layer.h   |1 -
 synfig-core/src/synfig/layer_composite.h |2 --
 synfig-core/src/synfig/render.h  |1 -
 synfig-core/src/synfig/surface.h |1 -
 synfig-core/src/synfig/target_cairo.h|1 -
 synfig-core/src/synfig/target_cairo_tile.h   |1 -
 10 files changed, 0 insertions(+), 15 deletions(-)

diff --git a/synfig-core/configure.ac b/synfig-core/configure.ac
index 597c0f5..a1a24b6 100644
--- a/synfig-core/configure.ac
+++ b/synfig-core/configure.ac
@@ -433,11 +433,6 @@ PKG_CHECK_MODULES(LIBCAIRO, [cairo >= 1.12.0],[
AC_MSG_ERROR([ ** You need to install cairo verison 1.12.0 or higher.])
 ])
 
-PKG_CHECK_MODULES(LIBCAIROMM, cairomm-1.0,[
-   CONFIG_DEPS="$CONFIG_DEPS cairomm-1.0"
-],[
-   AC_MSG_ERROR([ ** You need to install cairomm-1.0, verison 1.0.])
-])
 
 PKG_CHECK_MODULES(LIBPANGO, pango pangocairo,[
CONFIG_DEPS="$CONFIG_DEPS pango pangocairo"
diff --git a/synfig-core/src/modules/mod_png/mptr_cairo_png.h 
b/synfig-core/src/modules/mod_png/mptr_cairo_png.h
index 7b4845b..570ce8d 100644
--- a/synfig-core/src/modules/mod_png/mptr_cairo_png.h
+++ b/synfig-core/src/modules/mod_png/mptr_cairo_png.h
@@ -31,7 +31,6 @@
 /* === H E A D E R S === */
 
 #include "cairo.h"
-#include "cairomm/cairomm.h"
 
 #include 
 #include 
diff --git a/synfig-core/src/synfig/cairo_operators.h 
b/synfig-core/src/synfig/cairo_operators.h
index 43fcdce..8395dc3 100644
--- a/synfig-core/src/synfig/cairo_operators.h
+++ b/synfig-core/src/synfig/cairo_operators.h
@@ -28,7 +28,6 @@
 /* === H E A D E R S === */
 #include "color.h"
 #include "cairo.h"
-#include "cairomm/cairomm.h"
 
 /* === M A C R O S = */
 
diff --git a/synfig-core/src/synfig/cairoimporter.h 
b/synfig-core/src/synfig/cairoimporter.h
index c123c99..eb81302 100644
--- a/synfig-core/src/synfig/cairoimporter.h
+++ b/synfig-core/src/synfig/cairoimporter.h
@@ -37,7 +37,6 @@
 #include "renddesc.h"
 
 #include "cairo.h"
-#include "cairomm/cairomm.h"
 
 /* === M A C R O S = */
 
diff --git a/synfig-core/src/synfig/layer.h b/synfig-core/src/synfig/layer.h
index 87ff267..7e21f37 100644
--- a/synfig-core/src/synfig/layer.h
+++ b/synfig-core/src/synfig/layer.h
@@ -42,7 +42,6 @@
 #include "target.h" // for RenderMethod. TODO: put RenderMethod apart
 
 #include "cairo.h"
-#include "cairomm/cairomm.h"
 #include "rendermethod.h"
 
 /* === M A C R O S = */
diff --git a/synfig-core/src/synfig/layer_composite.h 
b/synfig-core/src/synfig/layer_composite.h
index 226ea4a..52ab9eb 100644
--- a/synfig-core/src/synfig/layer_composite.h
+++ b/synfig-core/src/synfig/layer_composite.h
@@ -30,8 +30,6 @@
 
 #include "layer.h"
 #include "color.h"
-#include "cairo.h"
-#include "cairomm/cairomm.h"
 #include "cairo_operators.h"
 
 /* === M A C R O S = */
diff --git a/synfig-core/src/synfig/render.h b/synfig-core/src/synfig/render.h
index faab7d3..6931019 100644
--- a/synfig-core/src/synfig/render.h
+++ b/synfig-core/src/synfig/render.h
@@ -38,7 +38,6 @@
 #include 
 
 #include "cairo.h"
-#include "cairomm/cairomm.h"
 
 /* === M A C R O S = */
 
diff --git a/synfig-core/src/synfig/surface.h b/synfig-core/src/synfig/surface.h
index 66800f0..40dd3f9 100644
--- a/synfig-core/src/synfig/surface.h
+++ b/synfig-core/src/synfig/surface.h
@@ -34,7 +34,6 @@
 #include 
 
 #include "cairo.h"
-#include "cairomm/cairomm.h"
 
 /* === M A C R O S = */
 
diff --git a/synfig-core/src/synfig/target_cairo.h 
b/synfig-core/src/synfig/target_cairo.h
index a6f95e6..13ed4ff 100644
--- a/synfig-core/src/synfig/target_cairo.h
+++ b/synfig-core/src/synfig/target_cairo.h
@@ -29,7 +29,6 @@
 
 #include "target.h"
 #include "cairo.h"
-#include "cairomm/cairomm.h"
 
 
 /* === M A C R O S = */
diff --git a/synfig-core/src/synfig/target_cairo_tile.h 
b/synfig-core/src/synfig/target_cairo_tile.h
index 0fd059e..fe2c4bf 100644
--- a/synfig-core/src/synfig/target_cairo_tile.h
+++ b/synfig-core/src/synfig/target_cairo_tile.h
@@ -30,7 +30,6 @@
 
 #include "target.h"
 #include "cairo.h"
-#include "cairomm/cairomm.h"
 
 
 /* === M A C R O S =

[Synfig-devl] Carlos Lopez : Fix bug #359: walk example compatibility issues.

2013-04-06 Thread root
Author: Carlos Lopez 
Date:   Mon Apr  1 19:25:49 2013 +0200

Fix bug #359: walk example compatibility issues.
The last terminology change made a rename from BLine to Spline. It cannot be 
done for the alias of old layers. I've restored the Layer alias.

---

 synfig-core/src/modules/mod_geometry/main.cpp |1 +
 1 files changed, 1 insertions(+), 0 deletions(-)

diff --git a/synfig-core/src/modules/mod_geometry/main.cpp 
b/synfig-core/src/modules/mod_geometry/main.cpp
index 8c25306..9154887 100644
--- a/synfig-core/src/modules/mod_geometry/main.cpp
+++ b/synfig-core/src/modules/mod_geometry/main.cpp
@@ -67,6 +67,7 @@ MODULE_INVENTORY_BEGIN(libmod_geometry)
LAYER(Star)
LAYER(Rectangle)
 
+   LAYER_ALIAS(Outline,"BLine")
LAYER_ALIAS(Outline,"Spline")
LAYER_ALIAS(Outline,"Bezier")
LAYER_ALIAS(Region,"Region")


--
Minimize network downtime and maximize team effectiveness.
Reduce network management and security costs.Learn how to hire 
the most talented Cisco Certified professionals. Visit the 
Employer Resources Portal
http://www.cisco.com/web/learning/employer_resources/index.html
___
Synfig-devl mailing list
Synfig-devl@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/synfig-devl


[Synfig-devl] Carlos Lopez : Merge branch 'master' into genete_new_cairo_core_2

2013-03-23 Thread root
Author: Carlos Lopez 
Date:   Thu Mar 14 18:47:33 2013 +0100

Merge branch 'master' into genete_new_cairo_core_2

---




--
Everyone hates slow websites. So do we.
Make your web apps faster with AppDynamics
Download AppDynamics Lite for free today:
http://p.sf.net/sfu/appdyn_d2d_mar
___
Synfig-devl mailing list
Synfig-devl@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/synfig-devl


[Synfig-devl] Carlos López : Merge pull request #6 from morevnaproject/new_cairo_core_2

2013-03-14 Thread root
Author: Carlos López 
Date:   Wed Mar 13 03:18:55 2013 -0700

Merge pull request #6 from morevnaproject/new_cairo_core_2

Apply some fixes from Carlos

---




--
Everyone hates slow websites. So do we.
Make your web apps faster with AppDynamics
Download AppDynamics Lite for free today:
http://p.sf.net/sfu/appdyn_d2d_mar
___
Synfig-devl mailing list
Synfig-devl@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/synfig-devl


[Synfig-devl] Konstantin Dmitriev : Apply some fixes from Carlos

2013-03-14 Thread root
Author: Konstantin Dmitriev 
Date:   Wed Mar 13 16:37:42 2013 +0700

Apply some fixes from Carlos

---

 synfig-core/src/synfig/color.cpp |   18 +-
 synfig-core/src/synfig/color.h   |2 ++
 2 files changed, 11 insertions(+), 9 deletions(-)

diff --git a/synfig-core/src/synfig/color.cpp b/synfig-core/src/synfig/color.cpp
index 2735f9b..6f4d9c2 100644
--- a/synfig-core/src/synfig/color.cpp
+++ b/synfig-core/src/synfig/color.cpp
@@ -347,7 +347,7 @@ blendfunc_BRIGHTEN(C &a,C &b,float amount)
 
 //Specialization for CairoColor
 template <>
-static CairoColor
+CairoColor
 blendfunc_BRIGHTEN(CairoColor &a, CairoColor &b, float amount)
 {
int ra, ga, ba, aa;
@@ -410,7 +410,7 @@ blendfunc_DARKEN(C &a,C &b,float amount)
 
 //Specialization for CairoColor
 template <>
-static CairoColor
+CairoColor
 blendfunc_DARKEN(CairoColor &a, CairoColor &b, float amount)
 {
int ra, ga, ba, aa;
@@ -468,7 +468,7 @@ blendfunc_ADD(C &a,C &b,float amount)
 
 //Specialization for CairoColor
 template <>
-static CairoColor
+CairoColor
 blendfunc_ADD(CairoColor &a, CairoColor &b, float amount)
 {
int ra, ga, ba, aa;
@@ -510,7 +510,7 @@ blendfunc_SUBTRACT(C &a,C &b,float amount)
 
 //Specialization for CairoColor
 template <>
-static CairoColor
+CairoColor
 blendfunc_SUBTRACT(CairoColor &a, CairoColor &b, float amount)
 {
int ra, ga, ba, aa;
@@ -552,7 +552,7 @@ blendfunc_DIFFERENCE(C &a,C &b,float amount)
 
 //Specialization for CairoColor
 template <>
-static CairoColor
+CairoColor
 blendfunc_DIFFERENCE(CairoColor &a, CairoColor &b, float amount)
 {
int ra, ga, ba, aa;
@@ -615,7 +615,7 @@ blendfunc_DIVIDE(C &a,C &b,float amount)
 
 // Specialization for CairoColor
 template <>
-static CairoColor
+CairoColor
 blendfunc_DIVIDE(CairoColor &a, CairoColor &b, float amount)
 {
int ra, ga, ba, aa;
@@ -718,7 +718,7 @@ blendfunc_ALPHA_BRIGHTEN(C &a,C &b,float amount)
 
 //Specialization for CairoColor
 template <>
-static CairoColor
+CairoColor
 blendfunc_ALPHA_BRIGHTEN(CairoColor &a, CairoColor &b, float amount)
 {
// \todo can this be right, multiplying amount by *b*'s alpha?
@@ -766,7 +766,7 @@ blendfunc_ALPHA_DARKEN(C &a,C &b,float amount)
 
 //Specialization for CairoColor
 template <>
-static CairoColor
+CairoColor
 blendfunc_ALPHA_DARKEN(CairoColor &a, CairoColor &b, float amount)
 {
unsigned char ra, ga, ba, aa;
@@ -840,7 +840,7 @@ blendfunc_OVERLAY(C &a,C &b,float amount)
 //Specialization for CairoColors
 // OVERLAY needs a further compositon with ONTO
 template <>
-static CairoColor
+CairoColor
 blendfunc_OVERLAY(CairoColor &a,CairoColor &b,float amount)
 {
//const float one(C::ceil);
diff --git a/synfig-core/src/synfig/color.h b/synfig-core/src/synfig/color.h
index 15dd1db..b8fc463 100644
--- a/synfig-core/src/synfig/color.h
+++ b/synfig-core/src/synfig/color.h
@@ -35,6 +35,8 @@
 #include 
 # include "angle.h"
 
+#include 
+
 #ifdef USE_HALF_TYPE
 #include 
 #endif


--
Everyone hates slow websites. So do we.
Make your web apps faster with AppDynamics
Download AppDynamics Lite for free today:
http://p.sf.net/sfu/appdyn_d2d_mar
___
Synfig-devl mailing list
Synfig-devl@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/synfig-devl


[Synfig-devl] Carlos Lopez : Replace macros for Boost libraries by newer versions from http://www.gnu. org/software/autoconf-archive/index.html.

2013-03-14 Thread root
Author: Carlos Lopez 
Date:   Tue Feb  5 19:22:00 2013 +0100

Replace macros for Boost libraries by newer versions from 
http://www.gnu.org/software/autoconf-archive/index.html.
Fixes configuration on OSX

---

 synfig-core/m4/ax_boost_base.m4|  382 
 synfig-core/m4/ax_boost_program_options.m4 |   68 +++--
 2 files changed, 260 insertions(+), 190 deletions(-)

Diff:   
http://synfig.git.sourceforge.net/git/gitweb.cgi?p=synfig/synfig;a=commitdiff;h=8ebd9ff2fa1ff9766102e9adaea8a17357135915

--
Everyone hates slow websites. So do we.
Make your web apps faster with AppDynamics
Download AppDynamics Lite for free today:
http://p.sf.net/sfu/appdyn_d2d_mar
___
Synfig-devl mailing list
Synfig-devl@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/synfig-devl


[Synfig-devl] Carlos Lopez : New class AsyncTarget_Cairo_Tile to render the tiles asynchronously .

2013-03-12 Thread root
Author: Carlos Lopez 
Date:   Tue Mar 12 20:10:56 2013 +0100

New class AsyncTarget_Cairo_Tile to render the tiles asynchronously .

---

 synfig-studio/src/gui/asyncrenderer.cpp |  199 +++
 synfig-studio/src/gui/asyncrenderer.h   |1 +
 2 files changed, 200 insertions(+), 0 deletions(-)

diff --git a/synfig-studio/src/gui/asyncrenderer.cpp 
b/synfig-studio/src/gui/asyncrenderer.cpp
index 7edb5b0..331b294 100644
--- a/synfig-studio/src/gui/asyncrenderer.cpp
+++ b/synfig-studio/src/gui/asyncrenderer.cpp
@@ -241,6 +241,192 @@ public:
}
 };
 
+class AsyncTarget_Cairo_Tile : public synfig::Target_Cairo_Tile
+{
+public:
+   etl::handle warm_target;
+   
+   class tile_t
+   {
+   public:
+   cairo_surface_t* surface;
+   int x,y;
+   tile_t(): surface(NULL), x(0), y(0)
+   {
+   }
+   tile_t(cairo_surface_t*& surface_,int x_, int y_)
+   {
+   if(surface_)
+   surface=cairo_surface_reference(surface_);
+   else
+   surface=surface_;
+   x=x_;
+   y=y_;
+   }
+   tile_t(const tile_t &other):
+   surface(cairo_surface_reference(other.surface)),
+   x(other.x),
+   y(other.y)
+   {
+   }
+   ~tile_t()
+   {
+   if(surface)
+   cairo_surface_destroy(surface);
+   }
+   };
+   std::list tile_queue;
+   Glib::Mutex mutex;
+   
+#ifndef GLIB_DISPATCHER_BROKEN
+   Glib::Dispatcher tile_ready_signal;
+#endif
+   Glib::Cond cond_tile_queue_empty;
+   bool alive_flag;
+   
+   sigc::connection ready_connection;
+   
+public:
+   AsyncTarget_Cairo_Tile(etl::handle 
warm_target):
+   warm_target(warm_target)
+   {
+   set_avoid_time_sync(warm_target->get_avoid_time_sync());
+   set_tile_w(warm_target->get_tile_w());
+   set_tile_h(warm_target->get_tile_h());
+   set_canvas(warm_target->get_canvas());
+   set_quality(warm_target->get_quality());
+   set_remove_alpha(warm_target->get_remove_alpha());
+   set_threads(warm_target->get_threads());
+   set_clipping(warm_target->get_clipping());
+   set_rend_desc(&warm_target->rend_desc());
+   alive_flag=true;
+#ifndef GLIB_DISPATCHER_BROKEN
+   
ready_connection=tile_ready_signal.connect(sigc::mem_fun(*this,&AsyncTarget_Cairo_Tile::tile_ready));
+#endif
+   }
+   
+   ~AsyncTarget_Cairo_Tile()
+   {
+   ready_connection.disconnect();
+   }
+   void set_dead()
+   {
+   Glib::Mutex::Lock lock(mutex);
+   alive_flag=false;
+   }
+   
+   virtual int total_tiles()const
+   {
+   return warm_target->total_tiles();
+   }
+   
+   virtual int next_tile(int& x, int& y)
+   {
+   if(!alive_flag)
+   return 0;
+   
+   return warm_target->next_tile(x,y);
+   }
+   
+   virtual int next_frame(Time& time)
+   {
+   if(!alive_flag)
+   return 0;
+   return warm_target->next_frame(time);
+   }
+   
+   virtual bool start_frame(synfig::ProgressCallback *cb=0)
+   {
+   if(!alive_flag)
+   return false;
+   return warm_target->start_frame(cb);
+   }
+   
+   virtual bool add_tile(cairo_surface_t*& surface, int gx, int gy)
+   {
+   if(cairo_surface_status(surface))
+   return false;
+   if(!alive_flag)
+   return false;
+   Glib::Mutex::Lock lock(mutex);
+   tile_queue.push_back(tile_t(surface,gx,gy));
+   if(tile_queue.size()==1)
+   {
+#ifdef GLIB_DISPATCHER_BROKEN
+   ready_connection=Glib::signal_timeout().connect(
+   sigc::bind_return(
+   
sigc::mem_fun(*this,&AsyncTarget_Cairo_Tile::tile_ready),
+   false
+   )
+   ,0
+   );
+#else
+   tile_ready_signal();
+#endif
+   }
+   //cairo_surface_destroy(surface);
+   return alive_flag;
+   }
+   
+   void tile_ready()
+   {
+   Glib::Mutex::Lock lock(mutex);
+   if(!alive_flag)
+   {
+   til

[Synfig-devl] Carlos Lopez : Gamma filter the surface tile before store it at cairo_book

2013-03-12 Thread root
Author: Carlos Lopez 
Date:   Tue Mar 12 20:09:27 2013 +0100

Gamma filter the surface tile before store it at cairo_book

---

 synfig-studio/src/gui/workarea.cpp |3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)

diff --git a/synfig-studio/src/gui/workarea.cpp 
b/synfig-studio/src/gui/workarea.cpp
index ab19746..37254d6 100644
--- a/synfig-studio/src/gui/workarea.cpp
+++ b/synfig-studio/src/gui/workarea.cpp
@@ -277,7 +277,8 @@ public:
synfig::Mutex::Lock lock(mutex);
if(cairo_surface_status(tile_surface))
return false;
-   
+
+   gamma_filter(tile_surface);
x/=get_tile_w();
y/=get_tile_h();
int tw(rend_desc().get_w()/get_tile_w());


--
Everyone hates slow websites. So do we.
Make your web apps faster with AppDynamics
Download AppDynamics Lite for free today:
http://p.sf.net/sfu/appdyn_d2d_mar
___
Synfig-devl mailing list
Synfig-devl@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/synfig-devl


[Synfig-devl] Carlos Lopez : add_tile now receives a reference to a cairo_surface_t pointer

2013-03-12 Thread root
Author: Carlos Lopez 
Date:   Tue Mar 12 20:08:19 2013 +0100

add_tile now receives a reference to a cairo_surface_t pointer

---

 synfig-core/src/synfig/target_cairo_tile.h |2 +-
 synfig-studio/src/gui/workarea.cpp |2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/synfig-core/src/synfig/target_cairo_tile.h 
b/synfig-core/src/synfig/target_cairo_tile.h
index 0fd059e..2aeeae9 100644
--- a/synfig-core/src/synfig/target_cairo_tile.h
+++ b/synfig-core/src/synfig/target_cairo_tile.h
@@ -87,7 +87,7 @@ public:
virtual int next_frame(Time& time);

//! Adds the tile at \a x , \a y contained in \a surface
-   virtual bool add_tile(cairo_surface_t* surface, int x, int y)=0;
+   virtual bool add_tile(cairo_surface_t*& surface, int x, int y)=0;
//! Returns the total tiles of the imaged rounded to integer number of 
tiles
virtual int total_tiles()const
{
diff --git a/synfig-studio/src/gui/workarea.cpp 
b/synfig-studio/src/gui/workarea.cpp
index 6e4e4f6..ab19746 100644
--- a/synfig-studio/src/gui/workarea.cpp
+++ b/synfig-studio/src/gui/workarea.cpp
@@ -272,7 +272,7 @@ public:
return true;
}

-   virtual bool add_tile(cairo_surface_t* tile_surface, int x, int y)
+   virtual bool add_tile(cairo_surface_t*& tile_surface, int x, int y)
{
synfig::Mutex::Lock lock(mutex);
if(cairo_surface_status(tile_surface))


--
Everyone hates slow websites. So do we.
Make your web apps faster with AppDynamics
Download AppDynamics Lite for free today:
http://p.sf.net/sfu/appdyn_d2d_mar
___
Synfig-devl mailing list
Synfig-devl@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/synfig-devl


[Synfig-devl] Carlos Lopez : When calculating the next unrendered tile consider if uses Cairo render

2013-03-12 Thread root
Author: Carlos Lopez 
Date:   Tue Mar 12 20:07:09 2013 +0100

When calculating the next unrendered tile consider if uses Cairo render

---

 synfig-studio/src/gui/workarea.cpp |   28 ++--
 1 files changed, 22 insertions(+), 6 deletions(-)

diff --git a/synfig-studio/src/gui/workarea.cpp 
b/synfig-studio/src/gui/workarea.cpp
index c07f836..6e4e4f6 100644
--- a/synfig-studio/src/gui/workarea.cpp
+++ b/synfig-studio/src/gui/workarea.cpp
@@ -2496,8 +2496,10 @@ WorkArea::comp_to_screen_coords(synfig::Point 
/*pos*/)const
 int
 WorkArea::next_unrendered_tile(int refreshes)const
 {
-   //assert(!tile_book.empty());
-   if(tile_book.empty())
+   bool uses_cairo=studio::App::workarea_uses_cairo;
+   if(tile_book.empty() && !uses_cairo)
+   return -1;
+   else if (cairo_book.empty() && uses_cairo)
return -1;
 
//const synfig::RendDesc &rend_desc(get_canvas()->rend_desc());
@@ -2532,12 +2534,26 @@ WorkArea::next_unrendered_tile(int refreshes)const
for(u=u1;uhttp://p.sf.net/sfu/appdyn_d2d_mar
___
Synfig-devl mailing list
Synfig-devl@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/synfig-devl


[Synfig-devl] Carlos Lopez : Initialize refreshes to zero at creation

2013-03-12 Thread root
Author: Carlos Lopez 
Date:   Tue Mar 12 20:05:48 2013 +0100

Initialize refreshes to zero at creation

---

 synfig-studio/src/gui/workarea.h |1 +
 1 files changed, 1 insertions(+), 0 deletions(-)

diff --git a/synfig-studio/src/gui/workarea.h b/synfig-studio/src/gui/workarea.h
index 0510837..dbfcd64 100644
--- a/synfig-studio/src/gui/workarea.h
+++ b/synfig-studio/src/gui/workarea.h
@@ -145,6 +145,7 @@ public:
SurfaceElement()
{
surface=NULL;
+   refreshes=0;
}
//Copy constructor
SurfaceElement(const SurfaceElement& other): 
surface(cairo_surface_reference(other.surface)), refreshes(other.refreshes)


--
Everyone hates slow websites. So do we.
Make your web apps faster with AppDynamics
Download AppDynamics Lite for free today:
http://p.sf.net/sfu/appdyn_d2d_mar
___
Synfig-devl mailing list
Synfig-devl@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/synfig-devl


[Synfig-devl] Carlos Lopez : When resize the work area clear the cairo book too.

2013-03-12 Thread root
Author: Carlos Lopez 
Date:   Tue Mar 12 20:04:35 2013 +0100

When resize the work area clear the cairo book too.

---

 synfig-studio/src/gui/workarea.cpp |1 +
 1 files changed, 1 insertions(+), 0 deletions(-)

diff --git a/synfig-studio/src/gui/workarea.cpp 
b/synfig-studio/src/gui/workarea.cpp
index d82e21b..c07f836 100644
--- a/synfig-studio/src/gui/workarea.cpp
+++ b/synfig-studio/src/gui/workarea.cpp
@@ -1492,6 +1492,7 @@ WorkArea::set_wh(int W, int H,int CHAN)
refresh_dimension_info();
 
tile_book.clear();
+   cairo_book.clear();
 
return true;
 }


--
Everyone hates slow websites. So do we.
Make your web apps faster with AppDynamics
Download AppDynamics Lite for free today:
http://p.sf.net/sfu/appdyn_d2d_mar
___
Synfig-devl mailing list
Synfig-devl@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/synfig-devl


[Synfig-devl] Carlos Lopez : WorkAreaTarget_Cairo_Tile: when the tile is added destroy the Cairo context

2013-03-12 Thread root
Author: Carlos Lopez 
Date:   Tue Mar 12 20:02:58 2013 +0100

WorkAreaTarget_Cairo_Tile: when the tile is added destroy the Cairo context

---

 synfig-studio/src/gui/workarea.cpp |1 +
 1 files changed, 1 insertions(+), 0 deletions(-)

diff --git a/synfig-studio/src/gui/workarea.cpp 
b/synfig-studio/src/gui/workarea.cpp
index 1db9fb5..d82e21b 100644
--- a/synfig-studio/src/gui/workarea.cpp
+++ b/synfig-studio/src/gui/workarea.cpp
@@ -299,6 +299,7 @@ public:
cairo_t* 
cr=cairo_create(workarea->cairo_book[index].surface);
cairo_set_source_surface(cr, tile_surface, 0, 0);
cairo_paint_with_alpha(cr, 
255/(onion_layers-onion_skin_queue.size()+1));
+   cairo_destroy(cr);
}

workarea->queue_draw();


--
Everyone hates slow websites. So do we.
Make your web apps faster with AppDynamics
Download AppDynamics Lite for free today:
http://p.sf.net/sfu/appdyn_d2d_mar
___
Synfig-devl mailing list
Synfig-devl@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/synfig-devl


[Synfig-devl] Carlos Lopez : When rendering the frame on drawing area, use the tiled Cairo surfaces on the canvas renderer.

2013-03-10 Thread root
Author: Carlos Lopez 
Date:   Sun Mar 10 19:45:16 2013 +0100

When rendering the frame on drawing area, use the tiled Cairo surfaces on the 
canvas renderer.

---

 synfig-studio/src/gui/workarea.cpp |3 +-
 .../src/gui/workarearenderer/renderer_canvas.cpp   |   88 
 2 files changed, 74 insertions(+), 17 deletions(-)

diff --git a/synfig-studio/src/gui/workarea.cpp 
b/synfig-studio/src/gui/workarea.cpp
index 52e066e..1db9fb5 100644
--- a/synfig-studio/src/gui/workarea.cpp
+++ b/synfig-studio/src/gui/workarea.cpp
@@ -269,7 +269,6 @@ public:
{
synfig::Mutex::Lock lock(mutex);
workarea->cairo_book.resize(total_tiles());
-   synfig::info("total_tiles()=%d", total_tiles());
return true;
}

@@ -303,7 +302,7 @@ public:
}

workarea->queue_draw();
-   assert(workarea->tile_book[index].first);
+   assert(workarea->cairo_book[index].surface);
 
cairo_surface_destroy(tile_surface);
return true;
diff --git a/synfig-studio/src/gui/workarearenderer/renderer_canvas.cpp 
b/synfig-studio/src/gui/workarearenderer/renderer_canvas.cpp
index 90d9880..ce29bb2 100644
--- a/synfig-studio/src/gui/workarearenderer/renderer_canvas.cpp
+++ b/synfig-studio/src/gui/workarearenderer/renderer_canvas.cpp
@@ -144,28 +144,86 @@ Renderer_Canvas::render_vfunc(
{
if(!cairo_book.empty())
{
-   if(cairo_book[0].surface)
+   if(get_full_frame())
+   {
+   if(cairo_book[0].surface)
+   {
+   int div;
+   cr->save();
+   
if(get_work_area()->get_low_resolution_flag())
+   {
+   div = 
get_work_area()->get_low_res_pixel_size();
+   cr->scale(div, div);
+   }
+   else
+   div=1;
+   
cairo_set_source_surface(cr->cobj(), cairo_book[0].surface, 
round_to_int(x)/div, round_to_int(y)/div);
+   
cairo_pattern_set_filter(cairo_get_source(cr->cobj()), CAIRO_FILTER_NEAREST);
+   cr->paint();
+   cr->restore();
+   }
+   
+   if(cairo_book[0].refreshes!=get_refreshes() && 
get_canceled()==false && get_rendering()==false && get_queued()==false)
+  get_work_area()->async_update_preview();
+   }
+   else // tiled frame
{
int div;
-   cr->save();
-   if(get_work_area()->get_low_resolution_flag())
+
+   const int 
width_in_tiles(w/tile_w+(((get_work_area()->get_low_resolution_flag())?((w/div)%(tile_w/div)):(w%tile_w))?1:0));
+   const int 
height_in_tiles(h/tile_h+(h%tile_h?1:0));
+   
+   int u(0),v(0),tx,ty;
+   int u1(0),v1(0),u2(width_in_tiles), 
v2(height_in_tiles);
+   
+   bool needs_refresh(false);
+   
+   u1=int(-x/tile_w);
+   v1=int(-y/tile_h);
+   u2=int((-x+drawable_w)/tile_w+1);
+   v2=int((-y+drawable_h)/tile_h+1);
+   if(u2>width_in_tiles)u2=width_in_tiles;
+   if(v2>height_in_tiles)v2=height_in_tiles;
+   if(u1<0)u1=0;
+   if(v1<0)v1=0;
+   
+   for(v=v1;vget_low_res_pixel_size();
-   cr->scale(div, div);
+   for(u=u1;uindex 
&& cairo_book[index].surface)
+   {
+   cr->save();
+   
if(get_work_area()->get_low_resolution_flag())
+   {
+   div = 
get_work_area()->get_low_res_pixel_si

[Synfig-devl] Carlos Lopez : New class WorkAreaTarget_Cairo_Tile to render on work area using Cairo tile render .

2013-03-10 Thread root
Author: Carlos Lopez 
Date:   Sun Mar 10 18:01:48 2013 +0100

New class WorkAreaTarget_Cairo_Tile to render on work area using Cairo tile 
render.
Fix compile error from previous commit.

---

 synfig-core/src/synfig/Makefile.am   |2 +-
 synfig-core/src/synfig/target_cairo_tile.cpp |2 +-
 synfig-studio/src/gui/workarea.cpp   |  237 +-
 synfig-studio/src/gui/workarea.h |2 +
 4 files changed, 235 insertions(+), 8 deletions(-)

diff --git a/synfig-core/src/synfig/Makefile.am 
b/synfig-core/src/synfig/Makefile.am
index 78bfb32..dc76a88 100644
--- a/synfig-core/src/synfig/Makefile.am
+++ b/synfig-core/src/synfig/Makefile.am
@@ -56,7 +56,7 @@ TARGETSOURCES = \
target_scanline.cpp \
target_cairo.cpp \
target_tile.cpp \
-   target_cairo_tile.h
+   target_cairo_tile.cpp
 
 
 IMPORTERHEADERS = \
diff --git a/synfig-core/src/synfig/target_cairo_tile.cpp 
b/synfig-core/src/synfig/target_cairo_tile.cpp
index fc2bf7f..c451740 100644
--- a/synfig-core/src/synfig/target_cairo_tile.cpp
+++ b/synfig-core/src/synfig/target_cairo_tile.cpp
@@ -147,7 +147,7 @@ synfig::Target_Cairo_Tile::render_frame_(Context 
context,ProgressCallback *cb)
cairo_status_t status = cairo_surface_status(surface);
if(status)
{
-   if(cb) cb->error(_("Bad surface: %s", 
cairo_status_to_string(status)));
+   if(cb) cb->error(strprintf(_("Bad surface: 
%s"), cairo_status_to_string(status)));
return false;
}
// Add the tile to the target
diff --git a/synfig-studio/src/gui/workarea.cpp 
b/synfig-studio/src/gui/workarea.cpp
index 36b889e..52e066e 100644
--- a/synfig-studio/src/gui/workarea.cpp
+++ b/synfig-studio/src/gui/workarea.cpp
@@ -52,6 +52,8 @@
 
 #include 
 #include 
+#include 
+#include 
 #include 
 #include 
 #include 
@@ -97,6 +99,221 @@ using namespace studio;
 
 /* === C L A S S E S === */
 
+class studio::WorkAreaTarget_Cairo_Tile : public synfig::Target_Cairo_Tile
+{
+public:
+   WorkArea *workarea;
+   bool low_res;
+   int w,h;
+   int real_tile_w,real_tile_h;
+   int refresh_id;
+   
+   bool onionskin;
+   bool onion_first_tile;
+   int onion_layers;
+   
+   std::list onion_skin_queue;
+   
+   synfig::Mutex mutex;
+   
+   void set_onion_skin(bool x, int *onions)
+   {
+   onionskin=x;
+   
+   Time time(rend_desc().get_time_start());
+   
+   if(!onionskin)
+   return;
+   onion_skin_queue.push_back(time);
+   
+   try
+   {
+   Time thistime=time;
+   for(int i=0; ikeyframe_list().find_prev(thistime)->get_time();
+   onion_skin_queue.push_back(keytime);
+   thistime=keytime;
+   }
+   }
+   catch(...)
+   {  }
+   
+   try
+   {
+   Time thistime=time;
+   for(int i=0; ikeyframe_list().find_next(thistime)->get_time();
+   onion_skin_queue.push_back(keytime);
+   thistime=keytime;
+   }
+   }
+   catch(...)
+   {  }
+   
+   onion_layers=onion_skin_queue.size();
+   
+   onion_first_tile=false;
+   }
+public:
+   
+   WorkAreaTarget_Cairo_Tile(WorkArea *workarea,int w, int h):
+   workarea(workarea),
+   low_res(workarea->get_low_resolution_flag()),
+   w(w),
+   h(h),
+   real_tile_w(workarea->tile_w),
+   real_tile_h(workarea->tile_h),
+   refresh_id(workarea->refreshes),
+   onionskin(false),
+   onion_layers(0)
+   {
+   set_clipping(true);
+   if(low_res)
+   {
+   int div = workarea->get_low_res_pixel_size();
+   set_tile_w(workarea->tile_w/div);
+   set_tile_h(workarea->tile_h/div);
+   }
+   else
+   {
+   set_tile_w(workarea->tile_w);
+   set_tile_h(workarea->tile_h);
+   }
+   set_canvas(workarea->get_canvas());
+   set_quality(workarea->get_quality());
+   }
+   
+   ~WorkAreaTarget_Cairo_Tile()
+   {
+   workarea->queue_draw();
+   }
+   
+   virtual bool set_rend_desc(synfig::RendDesc *newdesc)
+   {
+   assert(workarea);
+   newdesc->set_flags(RendDesc::PX_ASPECT|RendDesc::IM_SPAN

[Synfig-devl] Carlos Lopez : Use start_frame and end_frame for the Target_Cairo_Tile class instead of the obtain surface and put surface . The pure virtual member add_tile would take care of each rend

2013-03-10 Thread root
Author: Carlos Lopez 
Date:   Sun Mar 10 17:35:23 2013 +0100

Use start_frame and end_frame for the Target_Cairo_Tile class instead of the 
obtain surface and put surface. The pure virtual member add_tile would take 
care of each rendered tile instead of put surface.

---

 synfig-core/src/synfig/target_cairo.cpp  |2 +-
 synfig-core/src/synfig/target_cairo_tile.cpp |   52 ++---
 synfig-core/src/synfig/target_cairo_tile.h   |   14 ---
 3 files changed, 22 insertions(+), 46 deletions(-)

diff --git a/synfig-core/src/synfig/target_cairo.cpp 
b/synfig-core/src/synfig/target_cairo.cpp
index 4dae633..b7e2a38 100644
--- a/synfig-core/src/synfig/target_cairo.cpp
+++ b/synfig-core/src/synfig/target_cairo.cpp
@@ -142,7 +142,7 @@ synfig::Target_Cairo::render(ProgressCallback *cb)

if(!context.accelerated_cairorender(surface,quality,desc,cb))
{
// For some reason, the accelerated 
renderer failed.
-   if(cb)cb->error(_("Accelerated Renderer 
Failure"));
+   if(cb)cb->error(_("Frame Renderer 
Failure"));
return false;
}
else
diff --git a/synfig-core/src/synfig/target_cairo_tile.cpp 
b/synfig-core/src/synfig/target_cairo_tile.cpp
index a120d2b..fc2bf7f 100644
--- a/synfig-core/src/synfig/target_cairo_tile.cpp
+++ b/synfig-core/src/synfig/target_cairo_tile.cpp
@@ -97,7 +97,7 @@ Target_Cairo_Tile::next_tile(int& x, int& y)
 }
 
 bool
-synfig::Target_Cairo_Tile::render_frame_(cairo_surface_t* target_surface, 
Context context,ProgressCallback *cb)
+synfig::Target_Cairo_Tile::render_frame_(Context context,ProgressCallback *cb)
 {
if(tile_w_<=0||tile_h_<=0)
{
@@ -151,7 +151,7 @@ synfig::Target_Cairo_Tile::render_frame_(cairo_surface_t* 
target_surface, Contex
return false;
}
// Add the tile to the target
-   if(!add_tile(surface, target_surface, x,y))
+   if(!add_tile(surface, x,y))
{
if(cb)cb->error(_("add_tile():Unable to put 
surface on target"));
return false;
@@ -206,6 +206,12 @@ synfig::Target_Cairo_Tile::render(ProgressCallback *cb)
if(cb && 
!cb->amount_complete(total_frames-frames,total_frames))
return false;
 
+   if(!start_frame(cb))
+   {
+   if(cb)cb->error(_("Can't start frame"));
+   return false;
+   }
+
// Set the time that we wish to render
if(!get_avoid_time_sync() || canvas->get_time()!=t)
canvas->set_time(t);
@@ -226,32 +232,13 @@ synfig::Target_Cairo_Tile::render(ProgressCallback *cb)
#else
context=canvas->get_context();
#endif
-   // Obtain a pointer to the cairo_surface_t given by the 
Target instance.
-   cairo_surface_t* surface;
-   if(obtain_surface(surface))
+   if(!render_frame_(context,cb))
{
-   if(!render_frame_(surface,context,cb))
-   {
-   // For some reason, the accelerated 
renderer failed.
-   if(cb)cb->error(_("Accelerated Renderer 
Failure"));
-   return false;
-   }
-   else
-   {
-   // Put the surface we renderer onto the 
target's device.
-   // and destrois cairo_surface_t
-   if(!put_surface(surface, cb))
-   {
-   if(cb)cb->error(_("Unable to 
put surface on target"));
-   return false;
-   }
-   }
-   }
-   else
-   {
-   if(cb)cb->error(_("Can't obtain a valid 
surface"));
-   return false;   

+   // For some reason, the accelerated renderer 
failed.
+   if(cb)cb->error(_("Accelerated Renderer 
Failure"));
+   return false;
}
+   end_frame();
   

[Synfig-devl] Carlos Lopez : Remove unused variables

2013-03-10 Thread root
Author: Carlos Lopez 
Date:   Sun Mar 10 16:56:54 2013 +0100

Remove unused variables

---

 synfig-studio/src/gui/workarea.cpp |   16 
 1 files changed, 0 insertions(+), 16 deletions(-)

diff --git a/synfig-studio/src/gui/workarea.cpp 
b/synfig-studio/src/gui/workarea.cpp
index f034288..36b889e 100644
--- a/synfig-studio/src/gui/workarea.cpp
+++ b/synfig-studio/src/gui/workarea.cpp
@@ -104,9 +104,7 @@ public:
bool low_res;
int w,h;
int real_tile_w,real_tile_h;
-   //std::vector >::iterator tile_iter;
 
-   int twindow_start, twindow_width, twindow_height, twindow_pad;
int refresh_id;
 
bool onionskin;
@@ -275,19 +273,7 @@ public:
virtual bool start_frame(synfig::ProgressCallback */*cb*/)
{
synfig::Mutex::Lock lock(mutex);
-
-   int tw(rend_desc().get_w()/get_tile_w());
-   if(rend_desc().get_w()%get_tile_w()!=0)tw++;
-   int th(rend_desc().get_h()/get_tile_h());
-   if(rend_desc().get_h()%get_tile_h()!=0)th++;
-
-   twindow_start=0;
-   twindow_width=tw;
-   twindow_height=th;
-   twindow_pad=0;
-
workarea->tile_book.resize(total_tiles());
-   //tile_iter=workarea->tile_book.begin()+twindow_start;
return true;
}
 
@@ -548,9 +534,7 @@ public:
bool low_res;
int w,h;
int real_tile_w,real_tile_h;
-   //std::vector >::iterator tile_iter;
 
-   int twindow_start, twindow_width, twindow_height, twindow_pad;
int refresh_id;
 
bool onionskin;


--
Symantec Endpoint Protection 12 positioned as A LEADER in The Forrester  
Wave(TM): Endpoint Security, Q1 2013 and "remains a good choice" in the  
endpoint security space. For insight on selecting the right partner to 
tackle endpoint security challenges, access the full report. 
http://p.sf.net/sfu/symantec-dev2dev
___
Synfig-devl mailing list
Synfig-devl@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/synfig-devl


[Synfig-devl] Carlos Lopez : New class Target_Cairo_Tile to render using Cairo and tile mode.

2013-03-10 Thread root
Author: Carlos Lopez 
Date:   Sun Mar 10 12:38:01 2013 +0100

New class Target_Cairo_Tile to render using Cairo and tile mode.

---

 synfig-core/src/synfig/Makefile.am   |4 +-
 synfig-core/src/synfig/target_cairo_tile.cpp |  309 ++
 synfig-core/src/synfig/target_cairo_tile.h   |  138 
 3 files changed, 450 insertions(+), 1 deletions(-)

Diff:   
http://synfig.git.sourceforge.net/git/gitweb.cgi?p=synfig/synfig;a=commitdiff;h=940dd238249c3d4f20210a00e4b69056c149cd64

--
Symantec Endpoint Protection 12 positioned as A LEADER in The Forrester  
Wave(TM): Endpoint Security, Q1 2013 and "remains a good choice" in the  
endpoint security space. For insight on selecting the right partner to 
tackle endpoint security challenges, access the full report. 
http://p.sf.net/sfu/symantec-dev2dev
___
Synfig-devl mailing list
Synfig-devl@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/synfig-devl


[Synfig-devl] Carlos Lopez : Minor comments

2013-03-10 Thread root
Author: Carlos Lopez 
Date:   Sun Mar 10 12:26:50 2013 +0100

Minor comments

---

 synfig-core/src/synfig/target_tile.cpp |1 +
 synfig-studio/src/gui/workarea.h   |   10 +-
 2 files changed, 6 insertions(+), 5 deletions(-)

diff --git a/synfig-core/src/synfig/target_tile.cpp 
b/synfig-core/src/synfig/target_tile.cpp
index 18f44a9..0a7afb5 100644
--- a/synfig-core/src/synfig/target_tile.cpp
+++ b/synfig-core/src/synfig/target_tile.cpp
@@ -309,6 +309,7 @@ synfig::Target_Tile::render(ProgressCallback *cb)
 
// Set the time that we wish to render
//if(!get_avoid_time_sync() || 
canvas->get_time()!=t)
+   // Why the above line is commented here and not 
in TargetScaline?
canvas->set_time(t);
 
Context context;
diff --git a/synfig-studio/src/gui/workarea.h b/synfig-studio/src/gui/workarea.h
index 667fe2f..4016648 100644
--- a/synfig-studio/src/gui/workarea.h
+++ b/synfig-studio/src/gui/workarea.h
@@ -191,7 +191,7 @@ private:
synfig::Realcanvasheight;   //!< Height of the canvas
synfig::Realpw; //!< The width of a 
pixel
synfig::Realph; //!< The height of a 
pixel
-   // float zoom, prev_zoom are declared in Duckmatic
+   // float zoom and prev_zoom are declared in Duckmatic
synfig::Point window_tl;//!< The (theoretical) top-left 
corner of the view window
synfig::Point window_br;//!< The (theoretical) 
bottom-right corner of the view window
 
@@ -236,12 +236,12 @@ private:
 
//Glib::RefPtr pix_buf;
 
-   //! This vector holds all of the tiles for this image
+   //! This vector holds all of the tiles for this frame
std::vector< std::pair,int> > tile_book;
// This vector holds all the cairo surfaces for the frame 
SurfaceBook cairo_book;
 
-   //! This integer describes the total times that the work are has been 
refreshed
+   //! This integer describes the total times that the work area has been 
refreshed
int refreshes;
 
//! This list holds the queue of tiles that need to be rendered
@@ -263,7 +263,7 @@ private:
 
int dirty_trap_queued;
 
-
+   // This flag is set if onion skin is visible
bool onion_skin;
//! stores the future [1] and past [0] onion skins based on keyframes
int onion_skins[2];
@@ -497,7 +497,7 @@ public:
void zoom_out();
void zoom_fit();
void zoom_norm();
-   float get_zoom()const { return zoom; }
+   float get_zoom()const { return zoom; } // zoom is declared in Duckmatic
 
void set_zoom(float z);
 


--
Symantec Endpoint Protection 12 positioned as A LEADER in The Forrester  
Wave(TM): Endpoint Security, Q1 2013 and "remains a good choice" in the  
endpoint security space. For insight on selecting the right partner to 
tackle endpoint security challenges, access the full report. 
http://p.sf.net/sfu/symantec-dev2dev
___
Synfig-devl mailing list
Synfig-devl@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/synfig-devl


[Synfig-devl] Carlos Lopez : When playing, use Cairo if applicable

2013-03-09 Thread root
Author: Carlos Lopez 
Date:   Sat Mar  9 11:57:04 2013 +0100

When playing, use Cairo if applicable

---

 synfig-studio/src/gui/workarea.cpp |6 +-
 1 files changed, 5 insertions(+), 1 deletions(-)

diff --git a/synfig-studio/src/gui/workarea.cpp 
b/synfig-studio/src/gui/workarea.cpp
index 81f91ca..f034288 100644
--- a/synfig-studio/src/gui/workarea.cpp
+++ b/synfig-studio/src/gui/workarea.cpp
@@ -2729,7 +2729,11 @@ again:
set_rend_desc(desc);
 
// Create the render target
-   handle target(new class WorkAreaTarget(this,w,h));
+   handle target;
+   if(studio::App::workarea_uses_cairo)
+   target=new class WorkAreaTarget_Cairo(this,w,h);
+   else
+   target=new class WorkAreaTarget(this, w, h);
 
target->set_rend_desc(&desc);
 


--
Symantec Endpoint Protection 12 positioned as A LEADER in The Forrester  
Wave(TM): Endpoint Security, Q1 2013 and "remains a good choice" in the  
endpoint security space. For insight on selecting the right partner to 
tackle endpoint security challenges, access the full report. 
http://p.sf.net/sfu/symantec-dev2dev
___
Synfig-devl mailing list
Synfig-devl@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/synfig-devl


[Synfig-devl] Carlos Lopez : Effectively use the Cairo render on work area.

2013-03-09 Thread root
Author: Carlos Lopez 
Date:   Sat Mar  9 10:23:22 2013 +0100

Effectively use the Cairo render on work area.

---

 synfig-studio/src/gui/workarea.cpp |   12 ++-
 synfig-studio/src/gui/workarea.h   |1 +
 .../src/gui/workarearenderer/renderer_canvas.cpp   |   36 ++-
 .../src/gui/workarearenderer/renderer_canvas.h |2 +
 4 files changed, 48 insertions(+), 3 deletions(-)

diff --git a/synfig-studio/src/gui/workarea.cpp 
b/synfig-studio/src/gui/workarea.cpp
index 5dde3de..81f91ca 100644
--- a/synfig-studio/src/gui/workarea.cpp
+++ b/synfig-studio/src/gui/workarea.cpp
@@ -2592,7 +2592,17 @@ studio::WorkArea::async_update_preview()
// if we have lots of pixels to render and the tile renderer isn't 
disabled, use it
int div;
div = low_resolution ? low_res_pixel_size : 1;
-   if ((w*h > 240*div*135*div && !getenv("SYNFIG_DISABLE_TILE_RENDER")) || 
getenv("SYNFIG_FORCE_TILE_RENDER"))
+   if(studio::App::workarea_uses_cairo)
+   {
+   // do a Cairo render
+   handle trgt(new class 
WorkAreaTarget_Cairo(this,w,h));
+   
+   trgt->set_rend_desc(&desc);
+   trgt->set_onion_skin(get_onion_skin(), onion_skins);
+   target=trgt;
+
+   }
+   else if ((w*h > 240*div*135*div && 
!getenv("SYNFIG_DISABLE_TILE_RENDER")) || getenv("SYNFIG_FORCE_TILE_RENDER"))
{
// do a tile render
handle trgt(new class WorkAreaTarget(this,w,h));
diff --git a/synfig-studio/src/gui/workarea.h b/synfig-studio/src/gui/workarea.h
index 313a6d0..667fe2f 100644
--- a/synfig-studio/src/gui/workarea.h
+++ b/synfig-studio/src/gui/workarea.h
@@ -288,6 +288,7 @@ public:
const etl::loose_handle& get_selected_value_node() { 
return  selected_value_node_; }
const synfig::Point& get_drag_point()const { return drag_point; }
std::vector< std::pair,int> >& 
get_tile_book(){ return tile_book; }
+   SurfaceBook& get_cairo_book() { return cairo_book; }
int get_refreshes()const { return refreshes; }
bool get_canceled()const { return canceled_; }
bool get_queued()const { return queued; }
diff --git a/synfig-studio/src/gui/workarearenderer/renderer_canvas.cpp 
b/synfig-studio/src/gui/workarearenderer/renderer_canvas.cpp
index 0477f7d..90d9880 100644
--- a/synfig-studio/src/gui/workarearenderer/renderer_canvas.cpp
+++ b/synfig-studio/src/gui/workarearenderer/renderer_canvas.cpp
@@ -32,11 +32,11 @@
 #endif
 
 #include "renderer_canvas.h"
-#include "workarea.h"
 #include 
 #include 
 
 #include "general.h"
+#include "app.h"
 
 #endif
 
@@ -64,6 +64,12 @@ Renderer_Canvas::get_tile_book()
return get_work_area()->get_tile_book();
 }
 
+studio::WorkArea::SurfaceBook&
+Renderer_Canvas::get_cairo_book()
+{
+   return get_work_area()->get_cairo_book();
+}
+
 bool
 Renderer_Canvas::get_full_frame()const
 {
@@ -108,6 +114,7 @@ Renderer_Canvas::render_vfunc(
const synfig::Vector focus_point(get_work_area()->get_focus_point());
 
std::vector< std::pair,int> >& 
tile_book(get_tile_book());
+   WorkArea::SurfaceBook& cairo_book(get_cairo_book());
 
int drawable_w,drawable_h;
drawable->get_size(drawable_w,drawable_h);
@@ -133,8 +140,33 @@ Renderer_Canvas::render_vfunc(
 
Glib::RefPtr gc(Gdk::GC::create(drawable));
Cairo::RefPtr cr = drawable->create_cairo_context();
+   if(studio::App::workarea_uses_cairo)
+   {
+   if(!cairo_book.empty())
+   {
+   if(cairo_book[0].surface)
+   {
+   int div;
+   cr->save();
+   if(get_work_area()->get_low_resolution_flag())
+   {
+   div = 
get_work_area()->get_low_res_pixel_size();
+   cr->scale(div, div);
+   }
+   else
+   div=1;
+   cairo_set_source_surface(cr->cobj(), 
cairo_book[0].surface, round_to_int(x)/div, round_to_int(y)/div);
+   
cairo_pattern_set_filter(cairo_get_source(cr->cobj()), CAIRO_FILTER_NEAREST);
+   cr->paint();
+   cr->restore();
+   }
+   }
+   if(cairo_book[0].refreshes!=get_refreshes() && 
get_canceled()==false && get_rendering()==false && get_queued()==false)
+  get_work_area()->async_update_preview();
 
-   if(!tile_book.empty())
+  
+   }
+   else if(!tile_book.empty())
{
if(get_full_frame())
{
diff --git a/synfig-studio/src/gui/workarearenderer/renderer_canvas.h 
b/synfig-studio/src/gui/workarearenderer/renderer_c

[Synfig-devl] Carlos Lopez : Add option to use Cairo render on Work Area

2013-03-08 Thread root
Author: Carlos Lopez 
Date:   Sat Mar  9 08:22:13 2013 +0100

Add option to use Cairo render on Work Area

---

 synfig-studio/src/gui/app.cpp  |   14 ++
 synfig-studio/src/gui/app.h|1 +
 synfig-studio/src/gui/dialogs/dialog_setup.cpp |9 +
 synfig-studio/src/gui/dialogs/dialog_setup.h   |1 +
 4 files changed, 25 insertions(+), 0 deletions(-)

diff --git a/synfig-studio/src/gui/app.cpp b/synfig-studio/src/gui/app.cpp
index 84ec05a..149f1d8 100644
--- a/synfig-studio/src/gui/app.cpp
+++ b/synfig-studio/src/gui/app.cpp
@@ -292,6 +292,7 @@ String studio::App::browser_command("xdg-open"); // Linux 
XDG standard
 #endif
 String studio::App::sequence_separator(".");
 bool studio::App::navigator_uses_cairo=false;
+bool studio::App::workarea_uses_cairo=false;
 
 static int max_recent_files_=25;
 int studio::App::get_max_recent_files() { return max_recent_files_; }
@@ -600,6 +601,11 @@ public:

value=strprintf("%i",(int)App::navigator_uses_cairo);
return true;
}
+   if(key=="workarea_uses_cairo")
+   {
+   
value=strprintf("%i",(int)App::workarea_uses_cairo);
+   return true;
+   }
}
catch(...)
{
@@ -726,6 +732,12 @@ public:
App::navigator_uses_cairo=i;
return true;
}
+   if(key=="workarea_uses_cairo")
+   {
+   int i(atoi(value.c_str()));
+   App::workarea_uses_cairo=i;
+   return true;
+   }
}
catch(...)
{
@@ -757,6 +769,7 @@ public:
ret.push_back("predefined_fps");
ret.push_back("sequence_separator");
ret.push_back("navigator_uses_cairo");
+   ret.push_back("workarea_uses_cairo");
return ret;
}
 };
@@ -1876,6 +1889,7 @@ App::reset_initial_preferences()

synfigapp::Main::settings().set_value("pref.predefined_fps",DEFAULT_PREDEFINED_FPS);
synfigapp::Main::settings().set_value("sequence_separator", ".");
synfigapp::Main::settings().set_value("navigator_uses_cairo", "0");
+   synfigapp::Main::settings().set_value("workarea_uses_cairo", "0");
 }
 
 bool
diff --git a/synfig-studio/src/gui/app.h b/synfig-studio/src/gui/app.h
index a41dd1f..67409cc 100644
--- a/synfig-studio/src/gui/app.h
+++ b/synfig-studio/src/gui/app.h
@@ -208,6 +208,7 @@ public:
static float preferred_fps;
static synfig::String sequence_separator;
static bool navigator_uses_cairo;
+   static bool workarea_uses_cairo;
/*
  -- ** -- S I G N A L S ---
*/
diff --git a/synfig-studio/src/gui/dialogs/dialog_setup.cpp 
b/synfig-studio/src/gui/dialogs/dialog_setup.cpp
index 5e92e1a..998ecc1 100644
--- a/synfig-studio/src/gui/dialogs/dialog_setup.cpp
+++ b/synfig-studio/src/gui/dialogs/dialog_setup.cpp
@@ -301,6 +301,9 @@ Dialog_Setup::Dialog_Setup():
// Render - Use Cairo on Navigator
attach_label(render_table, _("Use Cairo render on Navigator"), 1, 
xpadding, ypadding);
render_table->attach(toggle_navigator_uses_cairo, 1, 2, 1, 2, 
Gtk::EXPAND|Gtk::FILL, Gtk::SHRINK|Gtk::FILL, xpadding, ypadding);
+   // Render - Use Cairo on WorkArea
+   attach_label(render_table, _("Use Cairo render on WorkArea"), 2, 
xpadding, ypadding);
+   render_table->attach(toggle_workarea_uses_cairo, 1, 2, 2, 3, 
Gtk::EXPAND|Gtk::FILL, Gtk::SHRINK|Gtk::FILL, xpadding, ypadding);
 
show_all_children();
 }
@@ -372,6 +375,9 @@ Dialog_Setup::on_apply_pressed()
// Set the navigator uses cairo flag
App::navigator_uses_cairo=toggle_navigator_uses_cairo.get_active();
 
+   // Set the workarea uses cairo flag
+   App::workarea_uses_cairo=toggle_workarea_uses_cairo.get_active();
+
App::save_settings();
 
App::setup_changed();
@@ -525,6 +531,9 @@ Dialog_Setup::refresh()
 
// Refresh the status of the navigator_uses_cairo flag
toggle_navigator_uses_cairo.set_active(App::navigator_uses_cairo);
+
+   // Refresh the status of the workarea_uses_cairo flag
+   toggle_workarea_uses_cairo.set_active(App::workarea_uses_cairo);
 }
 
 GammaPattern::GammaPattern():
diff --git a/synfig-studio/src/gui/dialogs/dialog_setup.h 
b/synfig-studio/src/gui/dialogs/dialog_setup.h
index b4af059..3bded00 100644
--- a/synfig-studio/src/gui/dialogs/dialog_setup.h
+++ b/synfig-studio/src/gui/dialogs/dialog_setup.h
@@ -204,6 +204,7 @@ class Dialog_Setup : public Gtk::Dialog
 
Gtk::Entry image_sequence_separator;
   

[Synfig-devl] Carlos Lopez : Missing line from earlier commit

2013-03-08 Thread root
Author: Carlos Lopez 
Date:   Sat Mar  9 08:07:41 2013 +0100

Missing line from earlier commit

---

 synfig-studio/src/gui/dialogs/dialog_preview.h |1 +
 1 files changed, 1 insertions(+), 0 deletions(-)

diff --git a/synfig-studio/src/gui/dialogs/dialog_preview.h 
b/synfig-studio/src/gui/dialogs/dialog_preview.h
index 61120c2..17323a8 100644
--- a/synfig-studio/src/gui/dialogs/dialog_preview.h
+++ b/synfig-studio/src/gui/dialogs/dialog_preview.h
@@ -136,6 +136,7 @@ public:
void set_end_override(bool o) { check_overend.set_active(o); }

bool get_use_cairo() const { return check_use_cairo.get_active(); }
+   void set_use_cairo(bool u) { check_use_cairo.set_active(u); }
 
sigc::signal  &signal_finish() {return 
signal_finish_;}
 };


--
Symantec Endpoint Protection 12 positioned as A LEADER in The Forrester  
Wave(TM): Endpoint Security, Q1 2013 and "remains a good choice" in the  
endpoint security space. For insight on selecting the right partner to 
tackle endpoint security challenges, access the full report. 
http://p.sf.net/sfu/symantec-dev2dev
___
Synfig-devl mailing list
Synfig-devl@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/synfig-devl


[Synfig-devl] Carlos Lopez : New class WorkAreaTarget_Cairo to render with Cairo on Work Area.

2013-03-08 Thread root
Author: Carlos Lopez 
Date:   Fri Mar  8 20:11:57 2013 +0100

New class WorkAreaTarget_Cairo to render with Cairo on Work Area.

---

 synfig-studio/src/gui/workarea.cpp |  153 
 synfig-studio/src/gui/workarea.h   |   26 ++
 2 files changed, 179 insertions(+), 0 deletions(-)

diff --git a/synfig-studio/src/gui/workarea.cpp 
b/synfig-studio/src/gui/workarea.cpp
index d890a37..5dde3de 100644
--- a/synfig-studio/src/gui/workarea.cpp
+++ b/synfig-studio/src/gui/workarea.cpp
@@ -388,6 +388,159 @@ public:
 };
 
 
+class studio::WorkAreaTarget_Cairo: public synfig::Target_Cairo
+{
+public:
+   WorkArea *workarea;
+   bool low_res;
+   int w,h;
+   int refresh_id;
+   bool onionskin;
+   bool onion_first_tile;
+   int onion_layers;
+
+   std::list onion_skin_queue;
+
+   void set_onion_skin(bool status, int *onions)
+   {
+   onionskin=status;
+   
+   Time time(rend_desc().get_time_start());
+   
+   if(!onionskin)
+   return;
+   onion_skin_queue.push_back(time);
+   try
+   {
+   Time thistime=time;
+   for(int i=0; ikeyframe_list().find_prev(thistime)->get_time();
+   onion_skin_queue.push_back(keytime);
+   thistime=keytime;
+   }
+   }
+   catch(...)
+   {  }
+   
+   try
+   {
+   Time thistime=time;
+   for(int i=0; ikeyframe_list().find_next(thistime)->get_time();
+   onion_skin_queue.push_back(keytime);
+   thistime=keytime;
+   }
+   }
+   catch(...)
+   {  }
+   
+   onion_layers=onion_skin_queue.size();
+   
+   onion_first_tile=false;
+   }
+public:
+   
+   WorkAreaTarget_Cairo(WorkArea *workarea,int w, int h):
+   workarea(workarea),
+   low_res(workarea->get_low_resolution_flag()),
+   w(w),
+   h(h),
+   refresh_id(workarea->refreshes),
+   onionskin(false),
+   onion_layers(0)
+   {
+   set_canvas(workarea->get_canvas());
+   set_quality(workarea->get_quality());
+   }
+   ~WorkAreaTarget_Cairo()
+   {
+   }
+   virtual bool set_rend_desc(synfig::RendDesc *newdesc)
+   {
+   assert(workarea);
+   newdesc->set_flags(RendDesc::PX_ASPECT|RendDesc::IM_SPAN);
+   if(low_res)
+   {
+   int div = workarea->get_low_res_pixel_size();
+   newdesc->set_wh(w/div,h/div);
+   }
+   else
+   newdesc->set_wh(w,h);
+   
+   if(
+  workarea->get_w()!=w
+  ||   workarea->get_h()!=h
+  ) workarea->set_wh(w,h,4);
+   
+   desc=*newdesc;
+   workarea->full_frame=true;
+   workarea->cairo_book.resize(1);
+   return true;
+   }
+
+   virtual int next_frame(Time& time)
+   {
+   // Mark this tile as "up-to-date"
+   if(onionskin)
+   
workarea->cairo_book[0].refreshes=refresh_id-onion_skin_queue.size();
+   else
+   workarea->cairo_book[0].refreshes=refresh_id;
+   
+   if(!onionskin)
+   return synfig::Target_Cairo::next_frame(time);
+   
+   
onion_first_tile=(onion_layers==(signed)onion_skin_queue.size());
+   
+   if(!onion_skin_queue.empty())
+   {
+   time=onion_skin_queue.front();
+   onion_skin_queue.pop_front();
+   }
+   else
+   return 0;
+   return onion_skin_queue.size()+1;
+   }
+
+   virtual bool obtain_surface(cairo_surface_t*& surface)
+   {
+   int localw=desc.get_w(), localh=desc.get_h();
+   surface = cairo_image_surface_create(CAIRO_FORMAT_ARGB32, 
localw, localh);
+   return true;
+   }
+
+   bool put_surface(cairo_surface_t *surf, synfig::ProgressCallback *cb)
+   {
+   if(!workarea)
+   return false;
+   gamma_filter(surf);
+   if(cairo_surface_status(surf))
+   {
+   if(cb) cb->error(_("Cairo Surface bad status"));
+   return false;
+   }
+   
+   if(!onionskin || onion_first_tile || 
!workarea->cairo_book[0].surface)
+   {
+   
workarea->cairo

[Synfig-devl] Carlos Lopez : Center and scale properly the rendered image when displayed on Preview Window

2013-03-08 Thread root
Author: Carlos Lopez 
Date:   Fri Mar  8 18:15:49 2013 +0100

Center and scale properly the rendered image when displayed on Preview Window

---

 synfig-studio/src/gui/preview.cpp |8 ++--
 1 files changed, 6 insertions(+), 2 deletions(-)

diff --git a/synfig-studio/src/gui/preview.cpp 
b/synfig-studio/src/gui/preview.cpp
index 5b110f3..1d16ce5 100644
--- a/synfig-studio/src/gui/preview.cpp
+++ b/synfig-studio/src/gui/preview.cpp
@@ -763,6 +763,8 @@ bool studio::Widget_Preview::redraw(GdkEventExpose */*heh*/)
if (text != _("Fit") & text != "fit")
{
draw_area.set_size_request(nw, nh);
+   dw = draw_area.get_width();
+   dh = draw_area.get_height();
}
 
//synfig::info("Now to draw to the window...");
@@ -790,7 +792,7 @@ bool studio::Widget_Preview::redraw(GdkEventExpose */*heh*/)
cr, //cairo context
pxnew, //pixbuf
//coordinates to place center of the preview window
-   (draw_area.get_width() - nw) / 2, 
(draw_area.get_height() - nh) / 2
+   (dw - nw) / 2, (dh - nh) / 2
);
cr->paint();
cr->restore();
@@ -798,7 +800,9 @@ bool studio::Widget_Preview::redraw(GdkEventExpose */*heh*/)
else
{
cr->save();
-   cairo_set_source_surface(cr->cobj(), cs, 0, 0);
+   cr->scale(sx, sx);
+   cairo_set_source_surface(cr->cobj(), cs, (dw - nw)/(2*sx), (dh 
- nh)/(2*sx));
+   cairo_pattern_set_filter(cairo_get_source(cr->cobj()), 
CAIRO_FILTER_NEAREST);
cairo_surface_destroy(cs);
cr->paint();
cr->restore();


--
Symantec Endpoint Protection 12 positioned as A LEADER in The Forrester  
Wave(TM): Endpoint Security, Q1 2013 and "remains a good choice" in the  
endpoint security space. For insight on selecting the right partner to 
tackle endpoint security challenges, access the full report. 
http://p.sf.net/sfu/symantec-dev2dev
___
Synfig-devl mailing list
Synfig-devl@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/synfig-devl


[Synfig-devl] Carlos Lopez : When there aren't preview options set use Cairo as false.

2013-03-08 Thread root
Author: Carlos Lopez 
Date:   Fri Mar  8 18:15:03 2013 +0100

When there aren't preview options set use Cairo as false.

---

 synfig-studio/src/gui/canvasview.cpp |1 +
 1 files changed, 1 insertions(+), 0 deletions(-)

diff --git a/synfig-studio/src/gui/canvasview.cpp 
b/synfig-studio/src/gui/canvasview.cpp
index cf3d447..9ae1697 100644
--- a/synfig-studio/src/gui/canvasview.cpp
+++ b/synfig-studio/src/gui/canvasview.cpp
@@ -3884,6 +3884,7 @@ CanvasView::on_preview_option()
po->set_begin_override(false);
po->set_endtime(end);
po->set_end_override(false);
+   po->set_use_cairo(false);
 
set_ext_widget("prevoptions",po);
}


--
Symantec Endpoint Protection 12 positioned as A LEADER in The Forrester  
Wave(TM): Endpoint Security, Q1 2013 and "remains a good choice" in the  
endpoint security space. For insight on selecting the right partner to 
tackle endpoint security challenges, access the full report. 
http://p.sf.net/sfu/symantec-dev2dev
___
Synfig-devl mailing list
Synfig-devl@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/synfig-devl


[Synfig-devl] Carlos Lopez : Effectively use the Cairo render on the Preview when the Use Cairo render option is checked . It doesn't scale up or centers the rendered image yet.

2013-03-05 Thread root
Author: Carlos Lopez 
Date:   Tue Mar  5 20:31:36 2013 +0100

Effectively use the Cairo render on the Preview when the Use Cairo render 
option is checked. It doesn't scale up or centers the rendered image yet.

---

 synfig-studio/src/gui/preview.cpp |   95 
 synfig-studio/src/gui/preview.h   |5 ++
 2 files changed, 79 insertions(+), 21 deletions(-)

diff --git a/synfig-studio/src/gui/preview.cpp 
b/synfig-studio/src/gui/preview.cpp
index a171ff9..5b110f3 100644
--- a/synfig-studio/src/gui/preview.cpp
+++ b/synfig-studio/src/gui/preview.cpp
@@ -230,17 +230,6 @@ void studio::Preview::render()
 {
if(canvasview)
{
-   //render using the preview target
-   etl::handle target = new Preview_Target;
-
-   //connect our information to his...
-   //synfig::warning("Connecting to the end frame function...");
-   
target->signal_frame_done().connect(sigc::mem_fun(*this,&Preview::frame_finish));
-
-   //set the options
-   //synfig::warning("Setting Canvas");
-   target->set_canvas(get_canvas());
-   target->set_quality(quality);
 
//render description
RendDesc desc = get_canvas()->rend_desc();
@@ -257,7 +246,6 @@ void studio::Preview::render()
/*synfig::warning("Setting the render description: %d x %d, %f 
fps, [%f,%f]",
neww,newh,newfps, 
overbegin?begintime:(float)desc.get_time_start(),

overend?endtime:(float)desc.get_time_end());*/
-
desc.set_w(neww);
desc.set_h(newh);
desc.set_frame_rate(newfps);
@@ -276,15 +264,33 @@ void studio::Preview::render()
//setting the description
 
//HACK - add on one extra frame because the renderer can't 
render the last frame
+   // Maybe this can be removed now because the next_time(&t) was 
refacgorized to consider the last frame too
+   //TODO: do not use get_time on Preview_Target
desc.set_time_end(desc.get_time_end() + 1.01/fps);
 
+   // Render using a Preview target (cairo or not)
+   etl::handle target;
+   if(use_cairo)
+   {
+   target = etl::handle::cast_dynamic(new 
Preview_Target_Cairo(this));
+   }
+   else
+   {
+   etl::handle t_target = new 
Preview_Target;
+   //connect our information to his...
+   
t_target->signal_frame_done().connect(sigc::mem_fun(*this,&Preview::frame_finish));
+   target =etl::handle::cast_dynamic(t_target);
+   }
+   //set the options
+   target->set_canvas(get_canvas());
+   target->set_quality(quality);
+   // Set the render description
target->set_rend_desc(&desc);
 
//... first we must clear our current selves of space
frames.resize(0);
 
//now tell it to go... with inherited prog. reporting...
-   //synfig::info("Rendering Asynchronously...");
if(renderer) renderer->stop();
renderer = new AsyncRenderer(target);
renderer->start();
@@ -363,6 +369,7 @@ Widget_Preview::Widget_Preview():
adj_time_scrub(0, 0, 1000, 0, 10, 0),
scr_time_scrub(adj_time_scrub),
b_loop(/*_("Loop")*/),
+   current_surface(NULL),
currentindex(-10),//TODO get the value from canvas setting or 
preview option
audiotime(0),
adj_sound(0, 0, 4),
@@ -624,12 +631,16 @@ void studio::Widget_Preview::update()
synfig::error("i == end");
//assert(0);
currentbuf.clear();
+   current_surface=NULL;
currentindex = 0;
timedisp = -1;
}else
{
currentbuf = i->buf;
currentindex = i-beg;
+   if(current_surface)
+   cairo_surface_destroy(current_surface);
+   current_surface= 
cairo_surface_reference(i->surface);
if(timedisp != i->t)
{
timedisp = i->t;
@@ -666,15 +677,44 @@ bool studio::Widget_Preview::redraw(GdkEventExpose 
*/*heh*/)
 {
//And render the drawing area
Glib::RefPtr pxnew, px = currentbuf;
-
-   if(!px || draw_area.get_height() == 0
-   || px->get_height() == 0 || px->get_width() == 0 /*|| 
is_visible()*/) //

[Synfig-devl] Carlos Lopez : Turn FlipBookElem into a class to allow control on constructor and destructor

2013-03-05 Thread root
Author: Carlos Lopez 
Date:   Mon Mar  4 20:02:48 2013 +0100

Turn FlipBookElem into a class to allow control on constructor and destructor

---

 synfig-studio/src/gui/preview.cpp |7 ---
 synfig-studio/src/gui/preview.h   |   16 +---
 2 files changed, 13 insertions(+), 10 deletions(-)

diff --git a/synfig-studio/src/gui/preview.cpp 
b/synfig-studio/src/gui/preview.cpp
index 7096c44..a171ff9 100644
--- a/synfig-studio/src/gui/preview.cpp
+++ b/synfig-studio/src/gui/preview.cpp
@@ -223,7 +223,6 @@ void studio::Preview::set_canvasview(const 
studio::CanvasView::LooseHandle &h)
 
 studio::Preview::~Preview()
 {
-   clear(); // we need this to remove the cairo_surface references
signal_destroyed_(this); //tell anything that attached to us, we're 
dying
 }
 
@@ -282,7 +281,6 @@ void studio::Preview::render()
target->set_rend_desc(&desc);
 
//... first we must clear our current selves of space
-   clear();
frames.resize(0);
 
//now tell it to go... with inherited prog. reporting...
@@ -295,10 +293,6 @@ void studio::Preview::render()
 
 void studio::Preview::clear()
 {
-   FlipBook::iterator it;
-   for(it=frames.begin(); it!=frames.end(); it++)
-   if(it->surface)
-   cairo_surface_destroy(it->surface);
frames.clear();
 }
 
@@ -334,7 +328,6 @@ void studio::Preview::frame_finish(const Preview_Target 
*targ)
 
//load time
fe.t = time;
-   fe.surface=NULL;
//uses and manages the memory for the buffer...
//synfig::warning("Create a pixmap...");
fe.buf =
diff --git a/synfig-studio/src/gui/preview.h b/synfig-studio/src/gui/preview.h
index 436c47a..e834eaa 100644
--- a/synfig-studio/src/gui/preview.h
+++ b/synfig-studio/src/gui/preview.h
@@ -64,11 +64,21 @@ class AsyncRenderer;
 class Preview : public sigc::trackable, public etl::shared_object
 {
 public:
-   struct FlipbookElem
+   class FlipbookElem
{
-   float   t;
-   Glib::RefPtr   buf; //at whatever resolution 
they are rendered at (resized at run time)
+   public:
+   float t;
+   Glib::RefPtr buf; //at whatever resolution they 
are rendered at (resized at run time)
cairo_surface_t* surface;
+   FlipbookElem()
+   {
+   surface=NULL;
+   }
+   ~FlipbookElem()
+   {
+   if(surface)
+   cairo_surface_destroy(surface);
+   }
};
 
etl::handle  renderer;


--
Everyone hates slow websites. So do we.
Make your web apps faster with AppDynamics
Download AppDynamics Lite for free today:
http://p.sf.net/sfu/appdyn_d2d_feb
___
Synfig-devl mailing list
Synfig-devl@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/synfig-devl


[Synfig-devl] Carlos Lopez : When destroying Preview, remove the references of the surfaces first.

2013-03-05 Thread root
Author: Carlos Lopez 
Date:   Mon Mar  4 19:54:03 2013 +0100

When destroying Preview, remove the references of the surfaces first.
When removing the surface references check if the pointer has been initialized 
to NULL first.
Initialize the cairo surface pointer to NULL when working with normal render.

---

 synfig-studio/src/gui/preview.cpp |5 -
 1 files changed, 4 insertions(+), 1 deletions(-)

diff --git a/synfig-studio/src/gui/preview.cpp 
b/synfig-studio/src/gui/preview.cpp
index 7205711..7096c44 100644
--- a/synfig-studio/src/gui/preview.cpp
+++ b/synfig-studio/src/gui/preview.cpp
@@ -223,6 +223,7 @@ void studio::Preview::set_canvasview(const 
studio::CanvasView::LooseHandle &h)
 
 studio::Preview::~Preview()
 {
+   clear(); // we need this to remove the cairo_surface references
signal_destroyed_(this); //tell anything that attached to us, we're 
dying
 }
 
@@ -296,7 +297,8 @@ void studio::Preview::clear()
 {
FlipBook::iterator it;
for(it=frames.begin(); it!=frames.end(); it++)
-   cairo_surface_destroy(it->surface);
+   if(it->surface)
+   cairo_surface_destroy(it->surface);
frames.clear();
 }
 
@@ -332,6 +334,7 @@ void studio::Preview::frame_finish(const Preview_Target 
*targ)
 
//load time
fe.t = time;
+   fe.surface=NULL;
//uses and manages the memory for the buffer...
//synfig::warning("Create a pixmap...");
fe.buf =


--
Everyone hates slow websites. So do we.
Make your web apps faster with AppDynamics
Download AppDynamics Lite for free today:
http://p.sf.net/sfu/appdyn_d2d_feb
___
Synfig-devl mailing list
Synfig-devl@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/synfig-devl


[Synfig-devl] Carlos Lopez : Dialog Preview can pass down the use_cairo option

2013-03-05 Thread root
Author: Carlos Lopez 
Date:   Mon Mar  4 19:41:44 2013 +0100

Dialog Preview can pass down the use_cairo option

---

 synfig-studio/src/gui/canvasview.cpp |1 +
 synfig-studio/src/gui/dialogs/dialog_preview.cpp |1 +
 synfig-studio/src/gui/dialogs/dialog_preview.h   |3 +++
 synfig-studio/src/gui/preview.h  |4 
 4 files changed, 9 insertions(+), 0 deletions(-)

diff --git a/synfig-studio/src/gui/canvasview.cpp 
b/synfig-studio/src/gui/canvasview.cpp
index 4050c59..cf3d447 100644
--- a/synfig-studio/src/gui/canvasview.cpp
+++ b/synfig-studio/src/gui/canvasview.cpp
@@ -3915,6 +3915,7 @@ CanvasView::on_preview_create(const PreviewInfo &info)
prev->set_overend(info.overend);
prev->set_endtime(info.endtime);
prev->set_quality(work_area->get_quality());
+   prev->set_use_cairo(info.use_cairo);
 
//render it out...
prev->render();
diff --git a/synfig-studio/src/gui/dialogs/dialog_preview.cpp 
b/synfig-studio/src/gui/dialogs/dialog_preview.cpp
index f6ecac1..1d34906 100644
--- a/synfig-studio/src/gui/dialogs/dialog_preview.cpp
+++ b/synfig-studio/src/gui/dialogs/dialog_preview.cpp
@@ -222,6 +222,7 @@ void Dialog_PreviewOptions::on_ok_pressed()
i.fps = get_fps();
i.overbegin = get_begin_override();
i.overend = get_end_override();
+   i.use_cairo = get_use_cairo();
if(i.overbegin) i.begintime = (float)get_begintime();
if(i.overend)   i.endtime = (float)get_endtime();
 
diff --git a/synfig-studio/src/gui/dialogs/dialog_preview.h 
b/synfig-studio/src/gui/dialogs/dialog_preview.h
index 6f6c8ef..61120c2 100644
--- a/synfig-studio/src/gui/dialogs/dialog_preview.h
+++ b/synfig-studio/src/gui/dialogs/dialog_preview.h
@@ -49,6 +49,7 @@ struct PreviewInfo
 {
float zoom,fps,begintime,endtime;
bool overbegin,overend;
+   bool use_cairo;
 };
 
 class Dialog_Preview : public Gtk::Window
@@ -133,6 +134,8 @@ public:
 
bool get_end_override() const { return check_overend.get_active(); }
void set_end_override(bool o) { check_overend.set_active(o); }
+   
+   bool get_use_cairo() const { return check_use_cairo.get_active(); }
 
sigc::signal  &signal_finish() {return 
signal_finish_;}
 };
diff --git a/synfig-studio/src/gui/preview.h b/synfig-studio/src/gui/preview.h
index 23be447..436c47a 100644
--- a/synfig-studio/src/gui/preview.h
+++ b/synfig-studio/src/gui/preview.h
@@ -86,6 +86,7 @@ private:
float   zoom,fps;
float   begintime,endtime;
booloverbegin,overend;
+   booluse_cairo;
int quality;
 
float   global_fps;
@@ -139,6 +140,9 @@ public:
bool get_overend() const {return overend;}
void set_overend(bool b) {overend = b;}
 
+   bool get_use_cairo() const {return use_cairo;}
+   void set_use_cairo(bool b) {use_cairo = b;}
+
int get_quality() const {return quality;}
voidset_quality(int i)  {quality = i;}
 


--
Everyone hates slow websites. So do we.
Make your web apps faster with AppDynamics
Download AppDynamics Lite for free today:
http://p.sf.net/sfu/appdyn_d2d_feb
___
Synfig-devl mailing list
Synfig-devl@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/synfig-devl


[Synfig-devl] Carlos Lopez : Notify subscribers that the frame has been finished and placed on the FlipBook

2013-03-05 Thread root
Author: Carlos Lopez 
Date:   Mon Mar  4 17:44:01 2013 +0100

Notify subscribers that the frame has been finished and placed on the FlipBook

---

 synfig-studio/src/gui/preview.cpp |1 +
 1 files changed, 1 insertions(+), 0 deletions(-)

diff --git a/synfig-studio/src/gui/preview.cpp 
b/synfig-studio/src/gui/preview.cpp
index 060b1b2..7205711 100644
--- a/synfig-studio/src/gui/preview.cpp
+++ b/synfig-studio/src/gui/preview.cpp
@@ -113,6 +113,7 @@ public:
fe.t = time;
fe.surface=cairo_surface_reference(surf);
prev->push_back(fe);
+   prev->signal_changed()();

cairo_surface_destroy(surf);
return true;


--
Everyone hates slow websites. So do we.
Make your web apps faster with AppDynamics
Download AppDynamics Lite for free today:
http://p.sf.net/sfu/appdyn_d2d_feb
___
Synfig-devl mailing list
Synfig-devl@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/synfig-devl


[Synfig-devl] Carlos Lopez : Redefine clear() member to take care on destroy the references to the cairo surfaces. Don' t directly call the resize member without have cleared it before

2013-03-05 Thread root
Author: Carlos Lopez 
Date:   Mon Mar  4 17:41:59 2013 +0100

Redefine clear() member to take care on destroy the references to the cairo 
surfaces. Don't directly call the resize member without have cleared it before

---

 synfig-studio/src/gui/preview.cpp |   10 ++
 synfig-studio/src/gui/preview.h   |7 ---
 2 files changed, 14 insertions(+), 3 deletions(-)

diff --git a/synfig-studio/src/gui/preview.cpp 
b/synfig-studio/src/gui/preview.cpp
index f641757..060b1b2 100644
--- a/synfig-studio/src/gui/preview.cpp
+++ b/synfig-studio/src/gui/preview.cpp
@@ -280,6 +280,7 @@ void studio::Preview::render()
target->set_rend_desc(&desc);
 
//... first we must clear our current selves of space
+   clear();
frames.resize(0);
 
//now tell it to go... with inherited prog. reporting...
@@ -290,6 +291,15 @@ void studio::Preview::render()
}
 }
 
+void studio::Preview::clear()
+{
+   FlipBook::iterator it;
+   for(it=frames.begin(); it!=frames.end(); it++)
+   cairo_surface_destroy(it->surface);
+   frames.clear();
+}
+
+
 static void free_guint8(const guint8 *mem)
 {
free((void*)mem);
diff --git a/synfig-studio/src/gui/preview.h b/synfig-studio/src/gui/preview.h
index 6484b5a..23be447 100644
--- a/synfig-studio/src/gui/preview.h
+++ b/synfig-studio/src/gui/preview.h
@@ -158,9 +158,10 @@ public:
FlipBook::const_iteratorbegin() const {return frames.begin();}
FlipBook::const_iteratorend() const   {return frames.end();}
void push_back(FlipbookElem fe) { frames.push_back(fe); }
-
-   void clear() {frames.clear();}
-
+   // Used to clear the FlipBook. Do not use directly the 
std::vector<>::clear member
+   // because the cairo_surface_t* wouldn't be destroyed.
+   void clear();
+   
unsigned intnumframes() const  {return 
frames.size();}
 
void render();


--
Everyone hates slow websites. So do we.
Make your web apps faster with AppDynamics
Download AppDynamics Lite for free today:
http://p.sf.net/sfu/appdyn_d2d_feb
___
Synfig-devl mailing list
Synfig-devl@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/synfig-devl


[Synfig-devl] Carlos Lopez : New class Preview Target Cairo

2013-03-05 Thread root
Author: Carlos Lopez 
Date:   Mon Mar  4 17:14:23 2013 +0100

New class Preview Target Cairo

---

 synfig-studio/src/gui/preview.cpp |   43 +
 synfig-studio/src/gui/preview.h   |3 ++
 2 files changed, 46 insertions(+), 0 deletions(-)

diff --git a/synfig-studio/src/gui/preview.cpp 
b/synfig-studio/src/gui/preview.cpp
index fe48f69..f641757 100644
--- a/synfig-studio/src/gui/preview.cpp
+++ b/synfig-studio/src/gui/preview.cpp
@@ -40,6 +40,7 @@
 #include 
 
 #include 
+#include 
 #include 
 
 #include 
@@ -76,6 +77,48 @@ using namespace studio;
 
 /* === E N T R Y P O I N T = */
 
+class studio::Preview::Preview_Target_Cairo : public Target_Cairo
+{
+   Preview *prev;
+public:
+   Preview_Target_Cairo(Preview *prev_): prev(prev_)
+   {
+   }
+   
+   virtual bool set_rend_desc(RendDesc *r)
+   {
+   return Target_Cairo::set_rend_desc(r);
+   }
+   
+   virtual bool obtain_surface(cairo_surface_t*& surface)
+   {
+   int w=desc.get_w(), h=desc.get_h();
+   surface = cairo_image_surface_create(CAIRO_FORMAT_ARGB32, w, h);
+   return true;
+   }
+
+   bool put_surface(cairo_surface_t *surf, synfig::ProgressCallback *cb)
+   {
+   if(!prev)
+   return false;
+   gamma_filter(surf);
+   if(cairo_surface_status(surf))
+   {
+   if(cb) cb->error(_("Cairo Surface bad status"));
+   return false;
+   }
+   FlipbookElemfe;
+   Preview pr = *prev;
+   float time = get_canvas()->get_time();
+   fe.t = time;
+   fe.surface=cairo_surface_reference(surf);
+   prev->push_back(fe);
+   
+   cairo_surface_destroy(surf);
+   return true;
+   }
+};
+
 class studio::Preview::Preview_Target : public Target_Scanline
 {
Surface surface;
diff --git a/synfig-studio/src/gui/preview.h b/synfig-studio/src/gui/preview.h
index f885d4f..6484b5a 100644
--- a/synfig-studio/src/gui/preview.h
+++ b/synfig-studio/src/gui/preview.h
@@ -68,6 +68,7 @@ public:
{
float   t;
Glib::RefPtr   buf; //at whatever resolution 
they are rendered at (resized at run time)
+   cairo_surface_t* surface;
};
 
etl::handle  renderer;
@@ -91,6 +92,7 @@ private:
 
//expose the frame information etc.
class Preview_Target;
+   class Preview_Target_Cairo;
void frame_finish(const Preview_Target *);
 
sigc::signal0 sig_changed;
@@ -155,6 +157,7 @@ public:
 
FlipBook::const_iteratorbegin() const {return frames.begin();}
FlipBook::const_iteratorend() const   {return frames.end();}
+   void push_back(FlipbookElem fe) { frames.push_back(fe); }
 
void clear() {frames.clear();}
 


--
Everyone hates slow websites. So do we.
Make your web apps faster with AppDynamics
Download AppDynamics Lite for free today:
http://p.sf.net/sfu/appdyn_d2d_feb
___
Synfig-devl mailing list
Synfig-devl@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/synfig-devl


[Synfig-devl] Carlos Lopez : Add a checkbox to use Cairo render a the Preview dialog.

2013-03-05 Thread root
Author: Carlos Lopez 
Date:   Mon Mar  4 17:13:25 2013 +0100

Add a checkbox to use Cairo render a the Preview dialog.

---

 synfig-studio/src/gui/dialogs/dialog_preview.cpp |5 +
 synfig-studio/src/gui/dialogs/dialog_preview.h   |2 ++
 2 files changed, 7 insertions(+), 0 deletions(-)

diff --git a/synfig-studio/src/gui/dialogs/dialog_preview.cpp 
b/synfig-studio/src/gui/dialogs/dialog_preview.cpp
index 3764460..f6ecac1 100644
--- a/synfig-studio/src/gui/dialogs/dialog_preview.cpp
+++ b/synfig-studio/src/gui/dialogs/dialog_preview.cpp
@@ -117,6 +117,7 @@ Dialog_PreviewOptions::Dialog_PreviewOptions()
 :Dialog(_("Preview Options"),false,true),
 adj_zoom(0.5,0.1,5.0,0.1,0.2),
 adj_fps(15,1,120,1,5),
+check_use_cairo(_("Use _Cairo render"), false),
 check_overbegin(_("_Begin time"),false),
 check_overend(_("_End time"),false),
 settings(this,"prevoptions")
@@ -164,6 +165,10 @@ settings(this,"prevoptions")
generalTable->attach(*fpsLabel, 0, 1, 1, 2, Gtk::SHRINK | Gtk::FILL, 
Gtk::EXPAND | Gtk::FILL, 0, 0);
generalTable->attach(*fpsSpinner, 1, 2, 1, 2, Gtk::EXPAND | Gtk::FILL, 
Gtk::EXPAND | Gtk::FILL, 0, 0);
 
+   check_use_cairo.set_alignment(0, 0.5);
+   check_use_cairo.set_use_underline(TRUE);
+   generalTable->attach(check_use_cairo, 0, 1, 2, 3, Gtk::SHRINK | 
Gtk::FILL, Gtk::EXPAND | Gtk::FILL, 0, 0);
+
Gtk::Frame *timeFrame = manage(new Gtk::Frame(_("Time settings")));
timeFrame->set_shadow_type(Gtk::SHADOW_NONE);
((Gtk::Label *) timeFrame->get_label_widget())->set_markup(_("Time 
settings"));
diff --git a/synfig-studio/src/gui/dialogs/dialog_preview.h 
b/synfig-studio/src/gui/dialogs/dialog_preview.h
index d0db519..6f6c8ef 100644
--- a/synfig-studio/src/gui/dialogs/dialog_preview.h
+++ b/synfig-studio/src/gui/dialogs/dialog_preview.h
@@ -87,6 +87,8 @@ class Dialog_PreviewOptions : public Gtk::Dialog
Gtk::Adjustment adj_zoom;   // factor at which to resize the 
window...
 
Gtk::Adjustment adj_fps;// how often to take samples of the 
animation
+   
+   Gtk::CheckButton check_use_cairo;
 
studio::Widget_Time time_begin;
studio::Widget_Time time_end;


--
Everyone hates slow websites. So do we.
Make your web apps faster with AppDynamics
Download AppDynamics Lite for free today:
http://p.sf.net/sfu/appdyn_d2d_feb
___
Synfig-devl mailing list
Synfig-devl@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/synfig-devl


[Synfig-devl] Carlos Lopez : When passing the checkerboard sizes use it as the dark or clear square sizes

2013-03-03 Thread root
Author: Carlos Lopez 
Date:   Sun Mar  3 13:57:04 2013 +0100

When passing the checkerboard sizes use it as the dark or clear square sizes

---

 .../gui/workarearenderer/renderer_background.cpp   |   13 +
 1 files changed, 5 insertions(+), 8 deletions(-)

diff --git a/synfig-studio/src/gui/workarearenderer/renderer_background.cpp 
b/synfig-studio/src/gui/workarearenderer/renderer_background.cpp
index efdfd9b..49df054 100644
--- a/synfig-studio/src/gui/workarearenderer/renderer_background.cpp
+++ b/synfig-studio/src/gui/workarearenderer/renderer_background.cpp
@@ -91,7 +91,7 @@ Renderer_Background::render_vfunc(

 cairo_surface_t *check;

-check=draw_check(16, 16);
+check=draw_check(15, 15);

 cairo_save(cr);
 
@@ -113,11 +113,8 @@ Renderer_Background::draw_check(int width, int height)
 {
 cairo_surface_t *surface;
 cairo_t *cr;
-   
-   width*=2;
-   height*=2;
-   
-surface = cairo_image_surface_create (CAIRO_FORMAT_RGB24, width, height);
+   
+surface = cairo_image_surface_create (CAIRO_FORMAT_RGB24, width*2, 
height*2);
 cr = cairo_create (surface);
 cairo_surface_destroy (surface);

@@ -126,8 +123,8 @@ Renderer_Background::draw_check(int width, int height)
 cairo_paint (cr);

 cairo_set_source_rgb (cr, 0.65, 0.65, 0.65); /* dark gray */
-cairo_rectangle (cr, int(width / 2), 0 , width / 2, height / 2);
-cairo_rectangle (cr, 0, int(height / 2), width / 2, height / 2);
+cairo_rectangle (cr, int(width), 0 , width, height);
+cairo_rectangle (cr, 0, int(height), width , height);
 cairo_fill (cr);

 surface = cairo_surface_reference (cairo_get_target (cr));


--
Everyone hates slow websites. So do we.
Make your web apps faster with AppDynamics
Download AppDynamics Lite for free today:
http://p.sf.net/sfu/appdyn_d2d_feb
___
Synfig-devl mailing list
Synfig-devl@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/synfig-devl


[Synfig-devl] Carlos Lopez : Center the checkerboard with the focus of the canvas and draw always pixel aligned rectangles on the checkerboard .

2013-03-03 Thread root
Author: Carlos Lopez 
Date:   Sun Mar  3 13:35:02 2013 +0100

Center the checkerboard with the focus of the canvas and draw always pixel 
aligned rectangles on the checkerboard.

---

 .../gui/workarearenderer/renderer_background.cpp   |   11 +++
 1 files changed, 7 insertions(+), 4 deletions(-)

diff --git a/synfig-studio/src/gui/workarearenderer/renderer_background.cpp 
b/synfig-studio/src/gui/workarearenderer/renderer_background.cpp
index 5d643ed..efdfd9b 100644
--- a/synfig-studio/src/gui/workarearenderer/renderer_background.cpp
+++ b/synfig-studio/src/gui/workarearenderer/renderer_background.cpp
@@ -91,11 +91,11 @@ Renderer_Background::render_vfunc(

 cairo_surface_t *check;

-check=draw_check(32, 32);
+check=draw_check(16, 16);

 cairo_save(cr);
 
-cairo_set_source_surface(cr, check, 0, 0);
+cairo_set_source_surface(cr, check, focus_point[0]/get_pw()+drawable_w/2, 
focus_point[1]/get_ph()+drawable_h/2);
 cairo_surface_destroy(check);

 cairo_pattern_set_filter(cairo_get_source(cr), CAIRO_FILTER_NEAREST);
@@ -114,6 +114,9 @@ Renderer_Background::draw_check(int width, int height)
 cairo_surface_t *surface;
 cairo_t *cr;

+   width*=2;
+   height*=2;
+   
 surface = cairo_image_surface_create (CAIRO_FORMAT_RGB24, width, height);
 cr = cairo_create (surface);
 cairo_surface_destroy (surface);
@@ -123,8 +126,8 @@ Renderer_Background::draw_check(int width, int height)
 cairo_paint (cr);

 cairo_set_source_rgb (cr, 0.65, 0.65, 0.65); /* dark gray */
-cairo_rectangle (cr, width / 2,  0, width / 2, height / 2);
-cairo_rectangle (cr, 0, height / 2, width / 2, height / 2);
+cairo_rectangle (cr, int(width / 2), 0 , width / 2, height / 2);
+cairo_rectangle (cr, 0, int(height / 2), width / 2, height / 2);
 cairo_fill (cr);

 surface = cairo_surface_reference (cairo_get_target (cr));


--
Everyone hates slow websites. So do we.
Make your web apps faster with AppDynamics
Download AppDynamics Lite for free today:
http://p.sf.net/sfu/appdyn_d2d_feb
___
Synfig-devl mailing list
Synfig-devl@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/synfig-devl


[Synfig-devl] Carlos Lopez : Draw sharp one pixel bounding box in all cases.

2013-03-03 Thread root
Author: Carlos Lopez 
Date:   Sun Mar  3 12:39:09 2013 +0100

Draw sharp one pixel bounding box in all cases.

---

 .../src/gui/workarearenderer/renderer_bbox.cpp |   10 +-
 1 files changed, 5 insertions(+), 5 deletions(-)

diff --git a/synfig-studio/src/gui/workarearenderer/renderer_bbox.cpp 
b/synfig-studio/src/gui/workarearenderer/renderer_bbox.cpp
index 0d24a96..0dad9d4 100644
--- a/synfig-studio/src/gui/workarearenderer/renderer_bbox.cpp
+++ b/synfig-studio/src/gui/workarearenderer/renderer_bbox.cpp
@@ -84,7 +84,7 @@ Renderer_BBox::render_vfunc(
 
const synfig::Point curr_point(get_bbox().get_min());
const synfig::Point drag_point(get_bbox().get_max());
-   if(get_bbox().area()<1.0)
+   if(get_bbox().area()<1.0 && 
get_bbox().area()>0.1)
{
Point 
tl(std::min(drag_point[0],curr_point[0]),std::min(drag_point[1],curr_point[1]));
Point 
br(std::max(drag_point[0],curr_point[0]),std::max(drag_point[1],curr_point[1]));
@@ -115,10 +115,10 @@ Renderer_BBox::render_vfunc(
 #endif
 
cr->rectangle(
-   tl[0],
-   tl[1],
-   br[0]-tl[0],
-   br[1]-tl[1]
+   int(tl[0])+0.5,
+   int(tl[1])+0.5,
+   int(br[0]-tl[0]+1),
+   int(br[1]-tl[1]+1)
);
cr->stroke();
 


--
Everyone hates slow websites. So do we.
Make your web apps faster with AppDynamics
Download AppDynamics Lite for free today:
http://p.sf.net/sfu/appdyn_d2d_feb
___
Synfig-devl mailing list
Synfig-devl@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/synfig-devl


[Synfig-devl] Carlos Lopez : Add background renderer (checkerboard) using Cairo render.

2013-03-03 Thread root
Author: Carlos Lopez 
Date:   Sun Mar  3 12:04:01 2013 +0100

Add background renderer (checkerboard) using Cairo render.

---

 synfig-studio/src/gui/workarea.cpp |   63 +++---
 .../src/gui/workarearenderer/Makefile_insert   |2 +
 .../gui/workarearenderer/renderer_background.cpp   |  134 
 .../src/gui/workarearenderer/renderer_background.h |   59 +
 4 files changed, 214 insertions(+), 44 deletions(-)

Diff:   
http://synfig.git.sourceforge.net/git/gitweb.cgi?p=synfig/synfig;a=commitdiff;h=55e3ac8329448635930fe5d1ce7af208c4c2dc3b

--
Everyone hates slow websites. So do we.
Make your web apps faster with AppDynamics
Download AppDynamics Lite for free today:
http://p.sf.net/sfu/appdyn_d2d_feb
___
Synfig-devl mailing list
Synfig-devl@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/synfig-devl


[Synfig-devl] Carlos Lopez : Fix bug: mouse pan on navigator doesn' t work if the cairo render is enabled for navigator at synfig studio start. This fixes that behavior and makes the mouse pan works f

2013-03-01 Thread root
Author: Carlos Lopez 
Date:   Fri Mar  1 18:24:53 2013 +0100

Fix bug: mouse pan on navigator doesn't work if the cairo render is enabled for 
navigator at synfig studio start. This fixes that behavior and makes the mouse 
pan works fine.

---

 synfig-studio/src/gui/docks/dock_navigator.cpp |   16 +---
 1 files changed, 13 insertions(+), 3 deletions(-)

diff --git a/synfig-studio/src/gui/docks/dock_navigator.cpp 
b/synfig-studio/src/gui/docks/dock_navigator.cpp
index ddb635f..41d03a6 100644
--- a/synfig-studio/src/gui/docks/dock_navigator.cpp
+++ b/synfig-studio/src/gui/docks/dock_navigator.cpp
@@ -491,14 +491,24 @@ bool studio::Widget_NavView::on_mouse_event(GdkEvent * e)
setpos = true;
}
 
-   if(setpos && prev && get_canvas_view())
+   if(setpos && (prev||studio::App::navigator_uses_cairo) && 
get_canvas_view())
{
const Point &tl = 
get_canvas_view()->get_canvas()->rend_desc().get_tl();
const Point &br = 
get_canvas_view()->get_canvas()->rend_desc().get_br();
-
+   int w,h;
+   if(prev && !studio::App::navigator_uses_cairo)
+   {
+   w = prev->get_width();
+   h = prev->get_height();
+   }
+   if(studio::App::navigator_uses_cairo)
+   {
+   w=cairo_image_surface_get_width(*cairo_surface.get());
+   h=cairo_image_surface_get_height(*cairo_surface.get());
+   }
float max = abs((br[0]-tl[0]) / drawto.get_width());
 
-   if((float(prev->get_width()) / drawto.get_width()) < 
(float(prev->get_height()) / drawto.get_height()))
+   if((float(w) / drawto.get_width()) < (float(h) / 
drawto.get_height()))
max = abs((br[1]-tl[1]) / drawto.get_height());
 
float signx = (br[0]-tl[0]) < 0 ? -1 : 1;


--
Everyone hates slow websites. So do we.
Make your web apps faster with AppDynamics
Download AppDynamics Lite for free today:
http://p.sf.net/sfu/appdyn_d2d_feb
___
Synfig-devl mailing list
Synfig-devl@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/synfig-devl


[Synfig-devl] Carlos Lopez : Enclose statements inside if-else sections for better readability.

2013-03-01 Thread root
Author: Carlos Lopez 
Date:   Fri Mar  1 18:22:39 2013 +0100

Enclose statements inside if-else sections for better readability.

---

 synfig-studio/src/gui/docks/dock_navigator.cpp |   95 
 1 files changed, 48 insertions(+), 47 deletions(-)

diff --git a/synfig-studio/src/gui/docks/dock_navigator.cpp 
b/synfig-studio/src/gui/docks/dock_navigator.cpp
index 5c1975a..ddb635f 100644
--- a/synfig-studio/src/gui/docks/dock_navigator.cpp
+++ b/synfig-studio/src/gui/docks/dock_navigator.cpp
@@ -189,58 +189,59 @@ void studio::Widget_NavView::on_finish_render()
if(cairo_surface_status(surf))
return;
Target_Cairo::gamma_filter(surf);
-   queue_draw();
-   return;
}
-   //convert it into our pixmap
-   PixelFormat pf(PF_RGB);
-
-   if(!*surface)
+   else
{
-   synfig::warning("dock_navigator: Bad surface");
-   return;
-   }
+   //convert it into our pixmap
+   PixelFormat pf(PF_RGB);
 
-   int w = 0, h = 0;
-   int dw = surface->get_w();
-   int dh = surface->get_h();
+   if(!*surface)
+   {
+   synfig::warning("dock_navigator: Bad surface");
+   return;
+   }
 
-   if(prev)
-   {
-   w = prev->get_width();
-   h = prev->get_height();
-   }
+   int w = 0, h = 0;
+   int dw = surface->get_w();
+   int dh = surface->get_h();
 
-   if(w != dw || h != dh || !prev)
-   {
-   const int total_bytes(dw*dh*synfig::channels(pf));
-
-   //synfig::warning("Nav: Updating the pixbuf to be the right 
size, etc. (%d bytes)", total_bytes);
-
-   prev.clear();
-   guint8 *bytes = new guint8[total_bytes]; //24 bits per pixel
-
-   //convert into our buffered dataS
-   //synfig::warning("Nav: converting color format into buffer");
-   convert_color_format((unsigned char *)bytes, (*surface)[0], 
dw*dh, pf, App::gamma);
-
-   prev =
-   Gdk::Pixbuf::create_from_data(
-   bytes,  // pointer to the data
-   Gdk::COLORSPACE_RGB, // the colorspace
-   ((pf&PF_A)==PF_A), // has alpha?
-   8, // bits per sample
-   dw, // width
-   dh, // height
-   dw*synfig::channels(pf), // stride (pitch)
-   sigc::ptr_fun(freegu8)
-   );
-   }
-   else
-   {
-   if(prev) //just in case we're stupid
+   if(prev)
{
-   convert_color_format((unsigned char 
*)prev->get_pixels(), (*surface)[0], dw*dh, pf, App::gamma);
+   w = prev->get_width();
+   h = prev->get_height();
+   }
+
+   if(w != dw || h != dh || !prev)
+   {
+   const int total_bytes(dw*dh*synfig::channels(pf));
+
+   //synfig::warning("Nav: Updating the pixbuf to be the 
right size, etc. (%d bytes)", total_bytes);
+
+   prev.clear();
+   guint8 *bytes = new guint8[total_bytes]; //24 bits per 
pixel
+
+   //convert into our buffered dataS
+   //synfig::warning("Nav: converting color format into 
buffer");
+   convert_color_format((unsigned char *)bytes, 
(*surface)[0], dw*dh, pf, App::gamma);
+
+   prev =
+   Gdk::Pixbuf::create_from_data(
+   bytes,  // pointer to the data
+   Gdk::COLORSPACE_RGB, // the colorspace
+   ((pf&PF_A)==PF_A), // has alpha?
+   8, // bits per sample
+   dw, // width
+   dh, // height
+   dw*synfig::channels(pf), // stride (pitch)
+   sigc::ptr_fun(freegu8)
+   );
+   }
+   else
+   {
+   if(prev) //just in case we're stupid
+   {
+   convert_color_format((unsigned char 
*)prev->get_pixels(), (*surface)[0], dw*dh, pf, App::gamma);
+   }
}
}
queue_draw();
@@ -294,7 +295,7 @@ bool studio::Widget_NavView::on_expose_draw(GdkEventExpose 
*/*exp*/)
w = prev->get_width();
h = prev->get_height();
}
-   else
+   if(studio::App::navigator_uses_cairo)
{
w=cairo_image_surface_get_width(*cairo_surface.ge

[Synfig-devl] Carlos Lopez : Fix bug: when requested to render only one frame it wrongly renders the frame at time t =0. With the fix it renders the correct requested frame.

2013-03-01 Thread root
Author: Carlos Lopez 
Date:   Fri Mar  1 18:17:35 2013 +0100

Fix bug: when requested to render only one frame it wrongly renders the frame 
at time t=0. With the fix it renders the correct requested frame.

---

 synfig-core/src/synfig/target_cairo.cpp |2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/synfig-core/src/synfig/target_cairo.cpp 
b/synfig-core/src/synfig/target_cairo.cpp
index f247831..4dae633 100644
--- a/synfig-core/src/synfig/target_cairo.cpp
+++ b/synfig-core/src/synfig/target_cairo.cpp
@@ -103,7 +103,7 @@ synfig::Target_Cairo::render(ProgressCallback *cb)
try {
do{
// Grab the time
-   if(total_frames>1)
+   if(total_frames>=1)
frames=next_frame(t);
else
frames=0;


--
Everyone hates slow websites. So do we.
Make your web apps faster with AppDynamics
Download AppDynamics Lite for free today:
http://p.sf.net/sfu/appdyn_d2d_feb
___
Synfig-devl mailing list
Synfig-devl@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/synfig-devl


[Synfig-devl] Carlos Lopez : Use nearest filter when scaling the cairo surface to fit the navigator drawing area

2013-02-28 Thread root
Author: Carlos Lopez 
Date:   Thu Feb 28 16:24:48 2013 +0100

Use nearest filter when scaling the cairo surface to fit the navigator drawing 
area

---

 synfig-studio/src/gui/docks/dock_navigator.cpp |1 +
 1 files changed, 1 insertions(+), 0 deletions(-)

diff --git a/synfig-studio/src/gui/docks/dock_navigator.cpp 
b/synfig-studio/src/gui/docks/dock_navigator.cpp
index 97de96a..5c1975a 100644
--- a/synfig-studio/src/gui/docks/dock_navigator.cpp
+++ b/synfig-studio/src/gui/docks/dock_navigator.cpp
@@ -355,6 +355,7 @@ bool studio::Widget_NavView::on_expose_draw(GdkEventExpose 
*/*exp*/)
cr->save();
cr->scale(sx, sx);
cairo_set_source_surface(cr->cobj(), 
*cairo_surface.get(), offx/sx, offy/sx);
+   cairo_pattern_set_filter(cairo_get_source(cr->cobj()), 
CAIRO_FILTER_NEAREST);
cr->paint();
cr->restore();  
}


--
Everyone hates slow websites. So do we.
Make your web apps faster with AppDynamics
Download AppDynamics Lite for free today:
http://p.sf.net/sfu/appdyn_d2d_feb
___
Synfig-devl mailing list
Synfig-devl@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/synfig-devl


[Synfig-devl] Carlos Lopez : Gamma filter cairo_surface right after finish render on Navigator

2013-02-28 Thread root
Author: Carlos Lopez 
Date:   Thu Feb 28 15:14:11 2013 +0100

Gamma filter cairo_surface right after finish render on Navigator

---

 synfig-studio/src/gui/docks/dock_navigator.cpp |1 +
 1 files changed, 1 insertions(+), 0 deletions(-)

diff --git a/synfig-studio/src/gui/docks/dock_navigator.cpp 
b/synfig-studio/src/gui/docks/dock_navigator.cpp
index 99ef0de..97de96a 100644
--- a/synfig-studio/src/gui/docks/dock_navigator.cpp
+++ b/synfig-studio/src/gui/docks/dock_navigator.cpp
@@ -188,6 +188,7 @@ void studio::Widget_NavView::on_finish_render()
cairo_surface_t* surf=*cairo_surface.get();
if(cairo_surface_status(surf))
return;
+   Target_Cairo::gamma_filter(surf);
queue_draw();
return;
}


--
Everyone hates slow websites. So do we.
Make your web apps faster with AppDynamics
Download AppDynamics Lite for free today:
http://p.sf.net/sfu/appdyn_d2d_feb
___
Synfig-devl mailing list
Synfig-devl@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/synfig-devl


[Synfig-devl] Carlos Lopez : Make Target_Cairo:: gamma_filter static to be used without instance.

2013-02-28 Thread root
Author: Carlos Lopez 
Date:   Thu Feb 28 15:12:52 2013 +0100

Make Target_Cairo::gamma_filter static to be used without instance.

---

 synfig-core/src/synfig/target_cairo.h |2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/synfig-core/src/synfig/target_cairo.h 
b/synfig-core/src/synfig/target_cairo.h
index 1bafbf3..a6f95e6 100644
--- a/synfig-core/src/synfig/target_cairo.h
+++ b/synfig-core/src/synfig/target_cairo.h
@@ -73,7 +73,7 @@ public:
//! Puts the rendered surface onto the target.
virtual bool put_surface(cairo_surface_t *surface, ProgressCallback 
*cb=NULL);
//! Filters the cairo surface based on gamma (hardcored for the moment 
to 2.2)
-   void gamma_filter(cairo_surface_t* surface);
+   static void gamma_filter(cairo_surface_t* surface);
 
 private:
 }; // END of class Target_Cairo


--
Everyone hates slow websites. So do we.
Make your web apps faster with AppDynamics
Download AppDynamics Lite for free today:
http://p.sf.net/sfu/appdyn_d2d_feb
___
Synfig-devl mailing list
Synfig-devl@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/synfig-devl


[Synfig-devl] Carlos Lopez : Moves gamma filter to Target_Cairo for reusability

2013-02-28 Thread root
Author: Carlos Lopez 
Date:   Thu Feb 28 13:08:39 2013 +0100

Moves gamma filter to Target_Cairo for reusability

---

 synfig-core/src/modules/mod_png/trgt_cairo_png.cpp |   22 ---
 synfig-core/src/modules/mod_png/trgt_cairo_png.h   |1 -
 synfig-core/src/synfig/target_cairo.cpp|   23 
 synfig-core/src/synfig/target_cairo.h  |3 ++
 4 files changed, 26 insertions(+), 23 deletions(-)

diff --git a/synfig-core/src/modules/mod_png/trgt_cairo_png.cpp 
b/synfig-core/src/modules/mod_png/trgt_cairo_png.cpp
index e44d22f..d9d3be2 100644
--- a/synfig-core/src/modules/mod_png/trgt_cairo_png.cpp
+++ b/synfig-core/src/modules/mod_png/trgt_cairo_png.cpp
@@ -125,25 +125,3 @@ cairo_png_trgt::put_surface(cairo_surface_t *surface, 
synfig::ProgressCallback *
return true;
 }
 
-void
-cairo_png_trgt::gamma_filter(cairo_surface_t *surface)
-{
-   CairoSurface temp(surface);
-   temp.map_cairo_image();
-   int x, y, w, h;
-   float range(CairoColor::range);
-   w=temp.get_w();
-   h=temp.get_h();
-   for(y=0;yhttp://p.sf.net/sfu/appdyn_d2d_feb
___
Synfig-devl mailing list
Synfig-devl@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/synfig-devl


[Synfig-devl] Carlos Lopez : Navigator now uses Cairo render based on user preference.

2013-02-28 Thread root
Author: Carlos Lopez 
Date:   Thu Feb 28 12:57:34 2013 +0100

Navigator now uses Cairo render based on user preference.
Gamma is wrong and pending to fix.

---

 synfig-studio/src/gui/docks/dock_navigator.cpp |  153 +---
 synfig-studio/src/gui/docks/dock_navigator.h   |   13 +-
 2 files changed, 92 insertions(+), 74 deletions(-)

diff --git a/synfig-studio/src/gui/docks/dock_navigator.cpp 
b/synfig-studio/src/gui/docks/dock_navigator.cpp
index e066b5c..99ef0de 100644
--- a/synfig-studio/src/gui/docks/dock_navigator.cpp
+++ b/synfig-studio/src/gui/docks/dock_navigator.cpp
@@ -71,7 +71,8 @@ 
studio::Widget_NavView::Widget_NavView(CanvasView::LooseHandle cv)
 :canvview(cv),
 adj_zoom(0,-4,4,1,2),
 scrolling(false),
-surface(new synfig::Surface)
+surface(new synfig::Surface),
+cairo_surface(cairo_image_surface_create(CAIRO_FORMAT_ARGB32, 2, 2))
 {
attach(drawto,0,4,0,1);
 
@@ -118,6 +119,7 @@ surface(new synfig::Surface)
 
 studio::Widget_NavView::~Widget_NavView()
 {
+   cairo_surface_destroy(*(cairo_surface.get()));
 }
 
 
@@ -130,60 +132,68 @@ void studio::Widget_NavView::on_start_render()
 {
if(dirty)
{
-   //synfig::warning("Nav: Starting render");
-   //synfig::warning("Nav: Rendering canvas");
-   etl::handletarg = 
surface_target(surface.get());
-
-   targ->set_canvas(get_canvas_view()->get_canvas());
-   targ->set_remove_alpha();
-   targ->set_avoid_time_sync();
-   
targ->set_quality(get_canvas_view()->get_work_area()->get_quality());
-   //synfig::info("Set the quality level to: %d", 
get_canvas_view()->get_work_area()->get_quality());
-
//this should set it to render a single frame
RendDescr = 
get_canvas_view()->get_canvas()->rend_desc();
r.set_time(get_canvas_view()->canvas_interface()->get_time());
 
//this changes the size of the canvas to the closest thing we 
can find
int sw = r.get_w(), sh = r.get_h();
-
-   //synfig::warning("Nav: source image is %d x %d", sw,sh);
-
+   
//resize so largest dimension is 128
int dw = sw > sh ? 128 : sw*128/sh,
-   dh = sh > sw ? 128 : sh*128/sw;
-
-   //synfig::warning("Nav: dest image is %d x %d", dw,dh);
-
+   dh = sh > sw ? 128 : sh*128/sw;
+   
r.set_w(dw);
r.set_h(dh);
 
-   //get the pw and ph
-   //float pw = r.get_pw();
-   //float ph = r.get_ph();
-   //synfig::warning("Nav: pixel size is %f x %f", pw,ph);
-
-   //this renders that single frame
-   targ->set_rend_desc(&r);
-
-   //synfig::warning("Nav: Building async renderer and starting 
it...");
-
-   renderer = new AsyncRenderer(targ);
+   if(studio::App::navigator_uses_cairo)
+   {
+   // Create a cairo_image_target
+   etl::handle targ = 
cairo_image_target(cairo_surface.get());
+   // Fill the target with the proper information
+   targ->set_canvas(get_canvas_view()->get_canvas());
+   targ->set_remove_alpha();
+   targ->set_avoid_time_sync();
+   
targ->set_quality(get_canvas_view()->get_work_area()->get_quality());
+   targ->set_rend_desc(&r);
+   // Sets up a Asynchronous renderer
+   renderer = new AsyncRenderer(targ);
+   }
+   else
+   {
+   // Create a surface_target
+   etl::handletarg = 
surface_target(surface.get());
+   // Fill the target with the proper information
+   targ->set_canvas(get_canvas_view()->get_canvas());
+   targ->set_remove_alpha();
+   targ->set_avoid_time_sync();
+   
targ->set_quality(get_canvas_view()->get_work_area()->get_quality());
+   targ->set_rend_desc(&r);
+   // Sets up a Asynchronous renderer
+   renderer = new AsyncRenderer(targ);
+   }
+   // connnect the renderer success to the finish render handler

renderer->signal_success().connect(sigc::mem_fun(*this,&Widget_NavView::on_finish_render));
+   // Mark it as clean since we are to start to render
dirty = false;
+   // start the asynchronous rendering
renderer->start();
}
 }
 
 void studio::Widget_NavView::on_finish_render()
 {
+   if(studio::App::navigator_uses_cairo)
+   {
+   cairo_surface_t* surf=*cairo_surface.get();
+   if(cairo_surface_sta

[Synfig-devl] Carlos Lopez : Correctly write the navigator uses cairo preference on the settings file.

2013-02-28 Thread root
Author: Carlos Lopez 
Date:   Thu Feb 28 11:04:38 2013 +0100

Correctly write the navigator uses cairo preference on the settings file.

---

 synfig-studio/src/gui/app.cpp  |4 ++--
 synfig-studio/src/gui/dialogs/dialog_setup.cpp |1 +
 2 files changed, 3 insertions(+), 2 deletions(-)

diff --git a/synfig-studio/src/gui/app.cpp b/synfig-studio/src/gui/app.cpp
index 27a94dc..84ec05a 100644
--- a/synfig-studio/src/gui/app.cpp
+++ b/synfig-studio/src/gui/app.cpp
@@ -291,7 +291,7 @@ String studio::App::browser_command("open"); // MacOS only
 String studio::App::browser_command("xdg-open"); // Linux XDG standard
 #endif
 String studio::App::sequence_separator(".");
-bool studio::App::navigator_uses_cairo(false);
+bool studio::App::navigator_uses_cairo=false;
 
 static int max_recent_files_=25;
 int studio::App::get_max_recent_files() { return max_recent_files_; }
@@ -597,7 +597,7 @@ public:
}
if(key=="navigator_uses_cairo")
{
-   value=App::navigator_uses_cairo;
+   
value=strprintf("%i",(int)App::navigator_uses_cairo);
return true;
}
}
diff --git a/synfig-studio/src/gui/dialogs/dialog_setup.cpp 
b/synfig-studio/src/gui/dialogs/dialog_setup.cpp
index 476534e..5e92e1a 100644
--- a/synfig-studio/src/gui/dialogs/dialog_setup.cpp
+++ b/synfig-studio/src/gui/dialogs/dialog_setup.cpp
@@ -298,6 +298,7 @@ Dialog_Setup::Dialog_Setup():
// Render - Image sequence separator
attach_label(render_table, _("Image Sequence Separator String"), 0, 
xpadding, ypadding);
render_table->attach(image_sequence_separator, 1, 2, 0, 1, 
Gtk::EXPAND|Gtk::FILL, Gtk::SHRINK|Gtk::FILL, xpadding, ypadding);
+   // Render - Use Cairo on Navigator
attach_label(render_table, _("Use Cairo render on Navigator"), 1, 
xpadding, ypadding);
render_table->attach(toggle_navigator_uses_cairo, 1, 2, 1, 2, 
Gtk::EXPAND|Gtk::FILL, Gtk::SHRINK|Gtk::FILL, xpadding, ypadding);
 


--
Everyone hates slow websites. So do we.
Make your web apps faster with AppDynamics
Download AppDynamics Lite for free today:
http://p.sf.net/sfu/appdyn_d2d_feb
___
Synfig-devl mailing list
Synfig-devl@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/synfig-devl


[Synfig-devl] Carlos Lopez : New target2cairo_image class to render to render to image buffer (ARGB32)

2013-02-28 Thread root
Author: Carlos Lopez 
Date:   Wed Feb 27 18:32:27 2013 +0100

New target2cairo_image class to render to render to image buffer (ARGB32)

---

 synfig-core/src/synfig/surface.cpp |   50 
 synfig-core/src/synfig/surface.h   |2 +
 2 files changed, 52 insertions(+), 0 deletions(-)

diff --git a/synfig-core/src/synfig/surface.cpp 
b/synfig-core/src/synfig/surface.cpp
index b24fc96..9d1ff92 100644
--- a/synfig-core/src/synfig/surface.cpp
+++ b/synfig-core/src/synfig/surface.cpp
@@ -50,7 +50,49 @@ using namespace etl;
 /* === M A C R O S = */
 
 /* === G L O B A L S === */
+class target2cairo_image: public synfig::Target_Cairo
+{
+public:
+   cairo_surface_t** image;
+   target2cairo_image(cairo_surface_t ** s);
+   virtual ~target2cairo_image();
+   virtual bool set_rend_desc(synfig::RendDesc *newdesc);
+   virtual bool obtain_surface(cairo_surface_t*& s);
+};
+
+target2cairo_image::target2cairo_image(cairo_surface_t ** s):image(s)
+{
+}
+
+target2cairo_image::~target2cairo_image()
+{
+}
+
+bool
+target2cairo_image::set_rend_desc(synfig::RendDesc *newdesc)
+{
+   assert(newdesc);
+   desc=*newdesc;
+   return synfig::Target_Cairo::set_rend_desc(newdesc);
+}
+
+bool
+target2cairo_image::obtain_surface(cairo_surface_t*& s)
+{
+   int sw=cairo_image_surface_get_width(*image);
+   int sh=cairo_image_surface_get_height(*image);
+   int w=desc.get_w(), h=desc.get_h();
+   
+   if(sw!=w || sh!=w)
+   {
+   cairo_surface_destroy(*image);
+   *image = cairo_image_surface_create(CAIRO_FORMAT_ARGB32, w, h);
+   }
+   s=cairo_surface_reference(*image);
+   return true;
+}
 
+
 class target2surface : public synfig::Target_Scanline
 {
 public:
@@ -126,6 +168,14 @@ synfig::surface_target(Surface *surface)
return Target_Scanline::Handle(new target2surface(surface));
 }
 
+
+Target_Cairo::Handle
+synfig::cairo_image_target(cairo_surface_t **surface)
+{
+   return Target_Cairo::Handle(new target2cairo_image(surface));
+}
+
+
 void
 synfig::Surface::clear()
 {
diff --git a/synfig-core/src/synfig/surface.h b/synfig-core/src/synfig/surface.h
index 70b38a0..66800f0 100644
--- a/synfig-core/src/synfig/surface.h
+++ b/synfig-core/src/synfig/surface.h
@@ -266,6 +266,8 @@ public:
 
 //! Creates a target that will render to \a surface
 etl::handle surface_target(Surface *surface);
+//!Creates a target that will render to a cairo_surface_t image surface
+etl::handle cairo_image_target(cairo_surface_t** surface);
 
 }; // END of namespace synfig
 


--
Everyone hates slow websites. So do we.
Make your web apps faster with AppDynamics
Download AppDynamics Lite for free today:
http://p.sf.net/sfu/appdyn_d2d_feb
___
Synfig-devl mailing list
Synfig-devl@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/synfig-devl


[Synfig-devl] Carlos Lopez : Typo

2013-02-17 Thread root
Author: Carlos Lopez 
Date:   Sun Feb 17 13:55:54 2013 +0100

Typo

---

 synfig-studio/src/gui/dialogs/dialog_setup.cpp |2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/synfig-studio/src/gui/dialogs/dialog_setup.cpp 
b/synfig-studio/src/gui/dialogs/dialog_setup.cpp
index 5be5a6c..476534e 100644
--- a/synfig-studio/src/gui/dialogs/dialog_setup.cpp
+++ b/synfig-studio/src/gui/dialogs/dialog_setup.cpp
@@ -298,7 +298,7 @@ Dialog_Setup::Dialog_Setup():
// Render - Image sequence separator
attach_label(render_table, _("Image Sequence Separator String"), 0, 
xpadding, ypadding);
render_table->attach(image_sequence_separator, 1, 2, 0, 1, 
Gtk::EXPAND|Gtk::FILL, Gtk::SHRINK|Gtk::FILL, xpadding, ypadding);
-   attach_label(render_table, _("Use Cairo render on NAvigator"), 1, 
xpadding, ypadding);
+   attach_label(render_table, _("Use Cairo render on Navigator"), 1, 
xpadding, ypadding);
render_table->attach(toggle_navigator_uses_cairo, 1, 2, 1, 2, 
Gtk::EXPAND|Gtk::FILL, Gtk::SHRINK|Gtk::FILL, xpadding, ypadding);
 
show_all_children();


--
The Go Parallel Website, sponsored by Intel - in partnership with Geeknet, 
is your hub for all things parallel software development, from weekly thought 
leadership blogs to news, videos, case studies, tutorials, tech docs, 
whitepapers, evaluation guides, and opinion stories. Check out the most 
recent posts - join the conversation now. http://goparallel.sourceforge.net/
___
Synfig-devl mailing list
Synfig-devl@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/synfig-devl


[Synfig-devl] Carlos Lopez : Add option at Setup dialog to choose Cairo render on Navigator

2013-02-17 Thread root
Author: Carlos Lopez 
Date:   Sun Feb 17 13:41:38 2013 +0100

Add option at Setup dialog to choose Cairo render on Navigator

---

 synfig-studio/src/gui/app.cpp  |   15 +++
 synfig-studio/src/gui/app.h|1 +
 synfig-studio/src/gui/dialogs/dialog_setup.cpp |8 
 synfig-studio/src/gui/dialogs/dialog_setup.h   |1 +
 4 files changed, 25 insertions(+), 0 deletions(-)

diff --git a/synfig-studio/src/gui/app.cpp b/synfig-studio/src/gui/app.cpp
index 4de6c99..27a94dc 100644
--- a/synfig-studio/src/gui/app.cpp
+++ b/synfig-studio/src/gui/app.cpp
@@ -291,6 +291,7 @@ String studio::App::browser_command("open"); // MacOS only
 String studio::App::browser_command("xdg-open"); // Linux XDG standard
 #endif
 String studio::App::sequence_separator(".");
+bool studio::App::navigator_uses_cairo(false);
 
 static int max_recent_files_=25;
 int studio::App::get_max_recent_files() { return max_recent_files_; }
@@ -594,6 +595,11 @@ public:
value=App::sequence_separator;
return true;
}
+   if(key=="navigator_uses_cairo")
+   {
+   value=App::navigator_uses_cairo;
+   return true;
+   }
}
catch(...)
{
@@ -712,6 +718,13 @@ public:
if(key=="sequence_separator")
{
App::sequence_separator=value;
+   return true;
+   }
+   if(key=="navigator_uses_cairo")
+   {
+   int i(atoi(value.c_str()));
+   App::navigator_uses_cairo=i;
+   return true;
}
}
catch(...)
@@ -743,6 +756,7 @@ public:
ret.push_back("preferred_fps");
ret.push_back("predefined_fps");
ret.push_back("sequence_separator");
+   ret.push_back("navigator_uses_cairo");
return ret;
}
 };
@@ -1861,6 +1875,7 @@ App::reset_initial_preferences()
synfigapp::Main::settings().set_value("pref.preferred_fps","24.0");

synfigapp::Main::settings().set_value("pref.predefined_fps",DEFAULT_PREDEFINED_FPS);
synfigapp::Main::settings().set_value("sequence_separator", ".");
+   synfigapp::Main::settings().set_value("navigator_uses_cairo", "0");
 }
 
 bool
diff --git a/synfig-studio/src/gui/app.h b/synfig-studio/src/gui/app.h
index 8261808..a41dd1f 100644
--- a/synfig-studio/src/gui/app.h
+++ b/synfig-studio/src/gui/app.h
@@ -207,6 +207,7 @@ public:
static synfig::String predefined_fps;
static float preferred_fps;
static synfig::String sequence_separator;
+   static bool navigator_uses_cairo;
/*
  -- ** -- S I G N A L S ---
*/
diff --git a/synfig-studio/src/gui/dialogs/dialog_setup.cpp 
b/synfig-studio/src/gui/dialogs/dialog_setup.cpp
index c3f346a..5be5a6c 100644
--- a/synfig-studio/src/gui/dialogs/dialog_setup.cpp
+++ b/synfig-studio/src/gui/dialogs/dialog_setup.cpp
@@ -298,6 +298,8 @@ Dialog_Setup::Dialog_Setup():
// Render - Image sequence separator
attach_label(render_table, _("Image Sequence Separator String"), 0, 
xpadding, ypadding);
render_table->attach(image_sequence_separator, 1, 2, 0, 1, 
Gtk::EXPAND|Gtk::FILL, Gtk::SHRINK|Gtk::FILL, xpadding, ypadding);
+   attach_label(render_table, _("Use Cairo render on NAvigator"), 1, 
xpadding, ypadding);
+   render_table->attach(toggle_navigator_uses_cairo, 1, 2, 1, 2, 
Gtk::EXPAND|Gtk::FILL, Gtk::SHRINK|Gtk::FILL, xpadding, ypadding);
 
show_all_children();
 }
@@ -366,6 +368,9 @@ Dialog_Setup::on_apply_pressed()
// Set the preferred image sequence separator
App::sequence_separator=image_sequence_separator.get_text();
 
+   // Set the navigator uses cairo flag
+   App::navigator_uses_cairo=toggle_navigator_uses_cairo.get_active();
+
App::save_settings();
 
App::setup_changed();
@@ -516,6 +521,9 @@ Dialog_Setup::refresh()
 
//Refresh the sequence separator
image_sequence_separator.set_text(App::sequence_separator);
+
+   // Refresh the status of the navigator_uses_cairo flag
+   toggle_navigator_uses_cairo.set_active(App::navigator_uses_cairo);
 }
 
 GammaPattern::GammaPattern():
diff --git a/synfig-studio/src/gui/dialogs/dialog_setup.h 
b/synfig-studio/src/gui/dialogs/dialog_setup.h
index 519ec38..b4af059 100644
--- a/synfig-studio/src/gui/dialogs/dialog_setup.h
+++ b/synfig-studio/src/gui/dialogs/dialog_setup.h
@@ -203,6 +203,7 @@ class Dialog_Setup : public Gtk::Dialog
Gtk::SpinButton* pref_x_size_spinbutton;
 

[Synfig-devl] Carlos Lopez : Check if passed target to AsyncRenderer is a Cairo target and store it.

2013-02-17 Thread root
Author: Carlos Lopez 
Date:   Sun Feb 17 12:46:51 2013 +0100

Check if passed target to AsyncRenderer is a Cairo target and store it.
This commit allows to use cairo_png as target to write to file on the render 
dialog

---

 synfig-studio/src/gui/asyncrenderer.cpp |   13 +
 1 files changed, 13 insertions(+), 0 deletions(-)

diff --git a/synfig-studio/src/gui/asyncrenderer.cpp 
b/synfig-studio/src/gui/asyncrenderer.cpp
index 0c5733a..7edb5b0 100644
--- a/synfig-studio/src/gui/asyncrenderer.cpp
+++ b/synfig-studio/src/gui/asyncrenderer.cpp
@@ -528,6 +528,19 @@ AsyncRenderer::AsyncRenderer(etl::handle 
target_,synfig::Progres
 
target=wrap_target;
}
+   else if(etl::handle::cast_dynamic(target_))
+   {
+   etl::handle wrap_target(
+   new AsyncTarget_Cairo(
+   
etl::handle::cast_dynamic(target_)
+   )
+   );
+   
+   
signal_stop_.connect(sigc::mem_fun(*wrap_target,&AsyncTarget_Cairo::set_dead));
+   
+   target=wrap_target;
+   }
+
 }
 
 AsyncRenderer::~AsyncRenderer()


--
The Go Parallel Website, sponsored by Intel - in partnership with Geeknet, 
is your hub for all things parallel software development, from weekly thought 
leadership blogs to news, videos, case studies, tutorials, tech docs, 
whitepapers, evaluation guides, and opinion stories. Check out the most 
recent posts - join the conversation now. http://goparallel.sourceforge.net/
___
Synfig-devl mailing list
Synfig-devl@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/synfig-devl


[Synfig-devl] Carlos Lopez : Initial framework for the Cairo async renderer.

2013-02-17 Thread root
Author: Carlos Lopez 
Date:   Sun Feb 17 12:24:52 2013 +0100

Initial framework for the Cairo async renderer.

---

 synfig-studio/src/gui/asyncrenderer.cpp |  119 +++
 synfig-studio/src/gui/asyncrenderer.h   |1 +
 2 files changed, 120 insertions(+), 0 deletions(-)

diff --git a/synfig-studio/src/gui/asyncrenderer.cpp 
b/synfig-studio/src/gui/asyncrenderer.cpp
index 4deb2fe..0c5733a 100644
--- a/synfig-studio/src/gui/asyncrenderer.cpp
+++ b/synfig-studio/src/gui/asyncrenderer.cpp
@@ -372,6 +372,125 @@ public:
}
 };
 
+class AsyncTarget_Cairo : public synfig::Target_Cairo
+{
+public:
+   etl::handle warm_target;
+   
+   cairo_surface_t* surface;
+   ProgressCallback *callback;
+   
+   Glib::Mutex mutex;
+   
+#ifndef GLIB_DISPATCHER_BROKEN
+   Glib::Dispatcher frame_ready_signal;
+#endif
+   Glib::Cond cond_frame_queue_empty;
+   bool alive_flag;
+   bool ready_next;
+   sigc::connection ready_connection;
+   
+   
+public:
+   AsyncTarget_Cairo(etl::handle warm_target):
+   warm_target(warm_target)
+   {
+   set_avoid_time_sync(warm_target->get_avoid_time_sync());
+   set_canvas(warm_target->get_canvas());
+   set_quality(warm_target->get_quality());
+   set_remove_alpha(warm_target->get_remove_alpha());
+   set_rend_desc(&warm_target->rend_desc());
+   alive_flag=true;
+#ifndef GLIB_DISPATCHER_BROKEN
+   
ready_connection=frame_ready_signal.connect(sigc::mem_fun(*this,&AsyncTarget_Cairo::frame_ready));
+#endif
+   }
+   
+   ~AsyncTarget_Cairo()
+   {
+   ready_connection.disconnect();
+   }
+   
+   virtual int next_frame(Time& time)
+   {
+   Glib::Mutex::Lock lock(mutex);
+   if(!alive_flag)
+   return 0;
+   return warm_target->next_frame(time);
+   
+   }
+   
+   void set_dead()
+   {
+   Glib::Mutex::Lock lock(mutex);
+   alive_flag=false;
+   }
+   
+   virtual bool put_surface(cairo_surface_t* s, ProgressCallback *cb)
+   {
+   {
+   Glib::Mutex::Lock lock(mutex);
+   surface=s;
+   callback=cb;
+   if(!alive_flag)
+   return false;
+   ready_next=false;
+   
+#ifdef GLIB_DISPATCHER_BROKEN
+   ready_connection=Glib::signal_timeout().connect(
+   
sigc::bind_return(sigc::mem_fun(*this,&AsyncTarget_Cairo::frame_ready),false)
+   
,0
+   
);
+#else
+   frame_ready_signal();
+#endif
+   }
+   
+#ifdef SINGLE_THREADED
+   if (single_threaded())
+   signal_progress()();
+   else
+#endif
+   {
+   
+   Glib::TimeVal end_time;
+   
+   end_time.assign_current_time();
+   end_time.add_microseconds(BOREDOM_TIMEOUT);
+   
+   while(alive_flag && !ready_next)
+   {
+   Glib::Mutex::Lock lock(mutex);
+   if(cond_frame_queue_empty.timed_wait(mutex, 
end_time))
+   break;
+   }
+   }
+   return true;
+   }
+   
+   void frame_ready()
+   {
+   Glib::Mutex::Lock lock(mutex);
+   if(alive_flag)
+   alive_flag=warm_target->put_surface(surface, callback);
+#ifdef SINGLE_THREADED
+   if (!single_threaded())
+#endif
+   cond_frame_queue_empty.signal();
+   ready_next=true;
+   }
+
+   virtual bool obtain_surface(cairo_surface_t*& s)
+   {
+   Glib::Mutex::Lock lock(mutex);
+   if(!alive_flag)
+   return false;
+   return warm_target->obtain_surface(s);
+   }
+
+};
+
+
 /* === G L O B A L S === */
 
 /* === P R O C E D U R E S = */
diff --git a/synfig-studio/src/gui/asyncrenderer.h 
b/synfig-studio/src/gui/asyncrenderer.h
index 15b4f85..a7bf5b3 100644
--- a/synfig-studio/src/gui/asyncrenderer.h
+++ b/synfig-studio/src/gui/asyncrenderer.h
@@ -35,6 +35,7 @@
 
 #include 
 #include 
+#include 
 #include 
 #include 
 #include 


--
Th

[Synfig-devl] Carlos Lopez : Documentation

2013-02-17 Thread root
Author: Carlos Lopez 
Date:   Sun Feb 17 11:28:17 2013 +0100

Documentation

---

 synfig-studio/src/gui/asyncrenderer.h |   11 ---
 1 files changed, 8 insertions(+), 3 deletions(-)

diff --git a/synfig-studio/src/gui/asyncrenderer.h 
b/synfig-studio/src/gui/asyncrenderer.h
index 7d865fd..15b4f85 100644
--- a/synfig-studio/src/gui/asyncrenderer.h
+++ b/synfig-studio/src/gui/asyncrenderer.h
@@ -59,20 +59,25 @@ namespace studio {
 
 class AsyncRenderer : public etl::shared_object, public sigc::trackable
 {
+   //! Signal emmited when target has been stopped or has finished
sigc::signal signal_finished_;
+   //! Signal emmited when target has succedded
sigc::signal signal_success_;
 
+   //! Seems to be unused
std::list activity_connection_list;
-
-   //etl::handle target_scanline;
-   //etl::handle target_tile;
+   
+   //! The target that is going to be asynchronously rendered.
etl::handle target;
 
+   //! Set to true when target render fails.
bool error;
+   //! Set to true when target render succedded
bool success;
 
synfig::ProgressCallback *cb;
 
+   //! Signal to be emmited when the target is requested to stop
sigc::signal signal_stop_;
 
Glib::Thread* render_thread;


--
The Go Parallel Website, sponsored by Intel - in partnership with Geeknet, 
is your hub for all things parallel software development, from weekly thought 
leadership blogs to news, videos, case studies, tutorials, tech docs, 
whitepapers, evaluation guides, and opinion stories. Check out the most 
recent posts - join the conversation now. http://goparallel.sourceforge.net/
___
Synfig-devl mailing list
Synfig-devl@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/synfig-devl


[Synfig-devl] Carlos Lopez : Replace Group by Set in more places.

2013-02-17 Thread root
Author: Carlos Lopez 
Date:   Sun Feb 17 11:06:56 2013 +0100

Replace Group by Set in more places.

---

 .../src/gui/actionmanagers/groupactionmanager.cpp  |2 +-
 .../src/synfigapp/actions/groupremove.cpp  |4 ++--
 .../src/synfigapp/actions/groupremovelayers.cpp|2 +-
 .../src/synfigapp/actions/grouprename.cpp  |   10 +-
 4 files changed, 9 insertions(+), 9 deletions(-)

diff --git a/synfig-studio/src/gui/actionmanagers/groupactionmanager.cpp 
b/synfig-studio/src/gui/actionmanagers/groupactionmanager.cpp
index e68f880..ab8cd0d 100644
--- a/synfig-studio/src/gui/actionmanagers/groupactionmanager.cpp
+++ b/synfig-studio/src/gui/actionmanagers/groupactionmanager.cpp
@@ -263,7 +263,7 @@ GroupActionManager::on_action_add()

group_name=(Glib::ustring)(*selected_iter->parent())[model.group_name]+'.';
}
 
-   group_name+=_("UnnamedGroup");
+   group_name+=_("UnnamedSet");
 
Gtk::TreePath 
path(group_tree_->get_model()->on_group_added(group_name));
 
diff --git a/synfig-studio/src/synfigapp/actions/groupremove.cpp 
b/synfig-studio/src/synfigapp/actions/groupremove.cpp
index 8412544..7684b4e 100644
--- a/synfig-studio/src/synfigapp/actions/groupremove.cpp
+++ b/synfig-studio/src/synfigapp/actions/groupremove.cpp
@@ -69,8 +69,8 @@ Action::GroupRemove::get_param_vocab()
ParamVocab ret(Action::CanvasSpecific::get_param_vocab());
 
ret.push_back(ParamDesc("group",Param::TYPE_STRING)
-   .set_local_name(_("Group"))
-   .set_desc(_("Name of the Group to remove"))
+   .set_local_name(_("Set"))
+   .set_desc(_("Name of the Set to remove"))
);
 
return ret;
diff --git a/synfig-studio/src/synfigapp/actions/groupremovelayers.cpp 
b/synfig-studio/src/synfigapp/actions/groupremovelayers.cpp
index d18b8b5..56e7a9b 100644
--- a/synfig-studio/src/synfigapp/actions/groupremovelayers.cpp
+++ b/synfig-studio/src/synfigapp/actions/groupremovelayers.cpp
@@ -71,7 +71,7 @@ Action::GroupRemoveLayers::get_param_vocab()
 
ret.push_back(ParamDesc("layer",Param::TYPE_LAYER)
.set_local_name(_("Layer"))
-   .set_desc(_("Layer to be removed from set"))
+   .set_desc(_("Layer to be removed from Set"))
.set_supports_multiple()
);
 
diff --git a/synfig-studio/src/synfigapp/actions/grouprename.cpp 
b/synfig-studio/src/synfigapp/actions/grouprename.cpp
index faf9cb7..af0f9aa 100644
--- a/synfig-studio/src/synfigapp/actions/grouprename.cpp
+++ b/synfig-studio/src/synfigapp/actions/grouprename.cpp
@@ -46,7 +46,7 @@ using namespace Action;
 
 ACTION_INIT(Action::GroupRename);
 ACTION_SET_NAME(Action::GroupRename,"GroupRename");
-ACTION_SET_LOCAL_NAME(Action::GroupRename,N_("Rename Group"));
+ACTION_SET_LOCAL_NAME(Action::GroupRename,N_("Rename Set"));
 ACTION_SET_TASK(Action::GroupRename,"rename");
 ACTION_SET_CATEGORY(Action::GroupRename,Action::CATEGORY_GROUP);
 ACTION_SET_PRIORITY(Action::GroupRename,0);
@@ -69,13 +69,13 @@ Action::GroupRename::get_param_vocab()
ParamVocab ret(Action::CanvasSpecific::get_param_vocab());
 
ret.push_back(ParamDesc("group",Param::TYPE_STRING)
-   .set_local_name(_("Old Group"))
-   .set_desc(_("Name of the Group to rename"))
+   .set_local_name(_("Old Set"))
+   .set_desc(_("Name of the Set to rename"))
);
 
ret.push_back(ParamDesc("new_group",Param::TYPE_STRING)
-   .set_local_name(_("New Group"))
-   .set_desc(_("New name for group"))
+   .set_local_name(_("New Set"))
+   .set_desc(_("New name for Set"))
);
 
return ret;


--
The Go Parallel Website, sponsored by Intel - in partnership with Geeknet, 
is your hub for all things parallel software development, from weekly thought 
leadership blogs to news, videos, case studies, tutorials, tech docs, 
whitepapers, evaluation guides, and opinion stories. Check out the most 
recent posts - join the conversation now. http://goparallel.sourceforge.net/
___
Synfig-devl mailing list
Synfig-devl@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/synfig-devl


[Synfig-devl] Carlos Lopez : Replace Duck by Handle in more places

2013-02-17 Thread root
Author: Carlos Lopez 
Date:   Sun Feb 17 11:06:21 2013 +0100

Replace Duck by Handle in more places

---

 synfig-studio/src/gui/states/state_rotate.cpp |4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/synfig-studio/src/gui/states/state_rotate.cpp 
b/synfig-studio/src/gui/states/state_rotate.cpp
index 1e76b49..5d73e92 100644
--- a/synfig-studio/src/gui/states/state_rotate.cpp
+++ b/synfig-studio/src/gui/states/state_rotate.cpp
@@ -395,12 +395,12 @@ DuckDrag_Rotate::end_duck_drag(Duckmatic* duckmatic)
if(bad_drag)return false;
if(move_only)
{
-   synfigapp::Action::PassiveGrouper 
group(get_canvas_interface()->get_instance().get(),_("Move Duck"));
+   synfigapp::Action::PassiveGrouper 
group(get_canvas_interface()->get_instance().get(),_("Move Handle"));
duckmatic->signal_edited_selected_ducks();
return true;
}
 
-   synfigapp::Action::PassiveGrouper 
group(get_canvas_interface()->get_instance().get(),_("Rotate Ducks"));
+   synfigapp::Action::PassiveGrouper 
group(get_canvas_interface()->get_instance().get(),_("Rotate Handle"));
 
if((last_rotate-Vector(1,1)).mag()>0.0001)
{


--
The Go Parallel Website, sponsored by Intel - in partnership with Geeknet, 
is your hub for all things parallel software development, from weekly thought 
leadership blogs to news, videos, case studies, tutorials, tech docs, 
whitepapers, evaluation guides, and opinion stories. Check out the most 
recent posts - join the conversation now. http://goparallel.sourceforge.net/
___
Synfig-devl mailing list
Synfig-devl@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/synfig-devl


[Synfig-devl] Carlos Lopez : Replace BLine by Spline in more places. Make "NewSpline" translatable.

2013-02-17 Thread root
Author: Carlos Lopez 
Date:   Sun Feb 17 10:31:15 2013 +0100

Replace BLine by Spline in more places. Make "NewSpline" translatable.

---

 synfig-core/src/modules/lyr_std/curvewarp.cpp  |2 +-
 .../src/synfig/valuenode_blinecalctangent.cpp  |6 +++---
 .../src/synfig/valuenode_blinecalcvertex.cpp   |4 ++--
 synfig-core/src/synfig/valuenode_composite.cpp |8 
 synfig-studio/src/gui/states/state_bline.cpp   |6 +++---
 .../src/synfigapp/actions/valuedescblinelink.cpp   |2 +-
 6 files changed, 14 insertions(+), 14 deletions(-)

diff --git a/synfig-core/src/modules/lyr_std/curvewarp.cpp 
b/synfig-core/src/modules/lyr_std/curvewarp.cpp
index 3df5b39..135f0a9 100644
--- a/synfig-core/src/modules/lyr_std/curvewarp.cpp
+++ b/synfig-core/src/modules/lyr_std/curvewarp.cpp
@@ -407,7 +407,7 @@ CurveWarp::get_param_vocab()const
  .set_local_name(_("Vertices"))
  .set_origin("origin")
  .set_hint("width")
- .set_description(_("List of BLine Points 
where the source line is curved to"))
+ .set_description(_("List of Spline Points 
where the source line is curved to"))
);
ret.push_back(ParamDesc("fast")
  .set_local_name(_("Fast"))
diff --git a/synfig-core/src/synfig/valuenode_blinecalctangent.cpp 
b/synfig-core/src/synfig/valuenode_blinecalctangent.cpp
index 4ede70e..706cc66 100644
--- a/synfig-core/src/synfig/valuenode_blinecalctangent.cpp
+++ b/synfig-core/src/synfig/valuenode_blinecalctangent.cpp
@@ -239,7 +239,7 @@ ValueNode_BLineCalcTangent::get_children_vocab_vfunc()const
 
ret.push_back(ParamDesc(ValueBase(),"bline")
.set_local_name(_("Spline"))
-   .set_description(_("The BLine where the tangent is linked to"))
+   .set_description(_("The Spline where the tangent is linked to"))
);
 
ret.push_back(ParamDesc(ValueBase(),"loop")
@@ -249,7 +249,7 @@ ValueNode_BLineCalcTangent::get_children_vocab_vfunc()const
 
ret.push_back(ParamDesc(ValueBase(),"amount")
.set_local_name(_("Amount"))
-   .set_description(_("The position of the linked tangent on the 
BLine (0,1]"))
+   .set_description(_("The position of the linked tangent on the 
Spline (0,1]"))
);
 
ret.push_back(ParamDesc(ValueBase(),"offset")
@@ -269,7 +269,7 @@ ValueNode_BLineCalcTangent::get_children_vocab_vfunc()const
 
ret.push_back(ParamDesc(ValueBase(),"homogeneous")
.set_local_name(_("Homogeneous"))
-   .set_description(_("When checked, the tangent is BLine length 
based"))
+   .set_description(_("When checked, the tangent is Spline length 
based"))
);
return ret;
 }
diff --git a/synfig-core/src/synfig/valuenode_blinecalcvertex.cpp 
b/synfig-core/src/synfig/valuenode_blinecalcvertex.cpp
index 2698d8d..7ec8b75 100644
--- a/synfig-core/src/synfig/valuenode_blinecalcvertex.cpp
+++ b/synfig-core/src/synfig/valuenode_blinecalcvertex.cpp
@@ -209,12 +209,12 @@ ValueNode_BLineCalcVertex::get_children_vocab_vfunc()const
 
ret.push_back(ParamDesc(ValueBase(),"amount")
.set_local_name(_("Amount"))
-   .set_description(_("The position of the linked vertex on the 
BLine (0,1]"))
+   .set_description(_("The position of the linked vertex on the 
Spline (0,1]"))
);
 
ret.push_back(ParamDesc(ValueBase(),"homogeneous")
.set_local_name(_("Homogeneous"))
-   .set_description(_("When checked, the position is BLine length 
based"))
+   .set_description(_("When checked, the position is Spline length 
based"))
);
return ret;
 }
diff --git a/synfig-core/src/synfig/valuenode_composite.cpp 
b/synfig-core/src/synfig/valuenode_composite.cpp
index 06668f8..e207f9b 100644
--- a/synfig-core/src/synfig/valuenode_composite.cpp
+++ b/synfig-core/src/synfig/valuenode_composite.cpp
@@ -508,11 +508,11 @@ ValueNode_Composite::get_children_vocab_vfunc()const
case ValueBase::TYPE_BLINEPOINT:
ret.push_back(ParamDesc(ValueBase(),"point")
.set_local_name(_("Vertex"))
-   .set_description(_("The vertex of the BLine Point"))
+   .set_description(_("The vertex of the Spline Point"))
);
ret.push_back(ParamDesc(ValueBase(),"width")
.set_local_name(_("Width"))
-   .set_description(_("The width of the BLine Point"))
+   .set_description(_("The width of the Spline Point"))
);
ret.push_back(ParamDesc(ValueBase(),"origin")
.set_local_name(_("Origin"))
@@ -524,11 +524,11 @@ ValueNode_Composite::get_children_vocab_vfu

[Synfig-devl] Carlos Lopez : Ignore autoreconf generated script

2013-02-16 Thread root
Author: Carlos Lopez 
Date:   Sat Feb 16 10:54:39 2013 +0100

Ignore autoreconf generated script

---

 .gitignore |2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/.gitignore b/.gitignore
index afb4e42..dae77e1 100644
--- a/.gitignore
+++ b/.gitignore
@@ -40,6 +40,7 @@ remove-potcdate.sed
 remove-potcdate.sin
 stamp-h1
 stamp-po
+test-driver
 
 # 
 
@@ -196,4 +197,3 @@ ETL/test/smach
 ETL/test/smart_ptr
 ETL/test/stringf
 ETL/test/surface
-


--
The Go Parallel Website, sponsored by Intel - in partnership with Geeknet, 
is your hub for all things parallel software development, from weekly thought 
leadership blogs to news, videos, case studies, tutorials, tech docs, 
whitepapers, evaluation guides, and opinion stories. Check out the most 
recent posts - join the conversation now. http://goparallel.sourceforge.net/
___
Synfig-devl mailing list
Synfig-devl@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/synfig-devl


[Synfig-devl] Carlos López : Merge pull request #5 from morevnaproject/master

2013-02-16 Thread root
Author: Carlos López 
Date:   Sat Feb 16 01:15:49 2013 -0800

Merge pull request #5 from morevnaproject/master

Replace few more terminology items

---




--
The Go Parallel Website, sponsored by Intel - in partnership with Geeknet, 
is your hub for all things parallel software development, from weekly thought 
leadership blogs to news, videos, case studies, tutorials, tech docs, 
whitepapers, evaluation guides, and opinion stories. Check out the most 
recent posts - join the conversation now. http://goparallel.sourceforge.net/
___
Synfig-devl mailing list
Synfig-devl@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/synfig-devl


[Synfig-devl] Konstantin Dmitriev : "Make Spline and/or Region" -> "Make Spline"

2013-02-16 Thread root
Author: Konstantin Dmitriev 
Date:   Tue Feb  5 22:49:46 2013 +0700

"Make Spline and/or Region" -> "Make Spline"

---

 synfig-studio/src/gui/states/state_bline.cpp |2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/synfig-studio/src/gui/states/state_bline.cpp 
b/synfig-studio/src/gui/states/state_bline.cpp
index ce24c0c..9c44f07 100644
--- a/synfig-studio/src/gui/states/state_bline.cpp
+++ b/synfig-studio/src/gui/states/state_bline.cpp
@@ -446,7 +446,7 @@ StateBLine_Context::refresh_tool_options()
 
App::dialog_tool_options->add_button(
Gtk::StockID("gtk-execute"),
-   _("Make Spline and/or Region")
+   _("Make Spline")
)->signal_clicked().connect(
sigc::hide_return(sigc::mem_fun(
*this,


--
The Go Parallel Website, sponsored by Intel - in partnership with Geeknet, 
is your hub for all things parallel software development, from weekly thought 
leadership blogs to news, videos, case studies, tutorials, tech docs, 
whitepapers, evaluation guides, and opinion stories. Check out the most 
recent posts - join the conversation now. http://goparallel.sourceforge.net/
___
Synfig-devl mailing list
Synfig-devl@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/synfig-devl


[Synfig-devl] Konstantin Dmitriev : Link to Bline -> Link to Spline

2013-02-16 Thread root
Author: Konstantin Dmitriev 
Date:   Tue Feb  5 22:40:16 2013 +0700

Link to Bline -> Link to Spline

---

 .../src/synfigapp/actions/valuedescblinelink.cpp   |2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/synfig-studio/src/synfigapp/actions/valuedescblinelink.cpp 
b/synfig-studio/src/synfigapp/actions/valuedescblinelink.cpp
index e9b478d..24273cd 100644
--- a/synfig-studio/src/synfigapp/actions/valuedescblinelink.cpp
+++ b/synfig-studio/src/synfigapp/actions/valuedescblinelink.cpp
@@ -57,7 +57,7 @@ using namespace Action;
 
 ACTION_INIT(Action::ValueDescBLineLink);
 ACTION_SET_NAME(Action::ValueDescBLineLink,"ValueDescBLineLink");
-ACTION_SET_LOCAL_NAME(Action::ValueDescBLineLink,N_("Link to BLine"));
+ACTION_SET_LOCAL_NAME(Action::ValueDescBLineLink,N_("Link to Spline"));
 ACTION_SET_TASK(Action::ValueDescBLineLink,"connect");
 ACTION_SET_CATEGORY(Action::ValueDescBLineLink,Action::CATEGORY_BEZIER);
 ACTION_SET_PRIORITY(Action::ValueDescBLineLink,0);


--
The Go Parallel Website, sponsored by Intel - in partnership with Geeknet, 
is your hub for all things parallel software development, from weekly thought 
leadership blogs to news, videos, case studies, tutorials, tech docs, 
whitepapers, evaluation guides, and opinion stories. Check out the most 
recent posts - join the conversation now. http://goparallel.sourceforge.net/
___
Synfig-devl mailing list
Synfig-devl@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/synfig-devl


[Synfig-devl] Konstantin Dmitriev : Replace Control Point with Handle in one more place.

2013-02-16 Thread root
Author: Konstantin Dmitriev 
Date:   Mon Feb  4 18:23:18 2013 +0700

Replace Control Point with Handle in one more place.

---

 synfig-studio/src/gui/dials/toggleducksdial.cpp |   12 ++--
 1 files changed, 6 insertions(+), 6 deletions(-)

diff --git a/synfig-studio/src/gui/dials/toggleducksdial.cpp 
b/synfig-studio/src/gui/dials/toggleducksdial.cpp
index 0159940..443ce54 100644
--- a/synfig-studio/src/gui/dials/toggleducksdial.cpp
+++ b/synfig-studio/src/gui/dials/toggleducksdial.cpp
@@ -52,12 +52,12 @@ using namespace studio;
 
 ToggleDucksDial::ToggleDucksDial(Gtk::IconSize & size): Gtk::Table(1, 6, false)
 {
-   ducks_position = create_label_button(size, 
"synfig-toggle_duck_position", _("Toggle position control points"));
-   ducks_vertex = create_label_button(size, "synfig-toggle_duck_vertex", 
_("Toggle vertex control points"));
-   ducks_tangent = create_label_button(size, "synfig-toggle_duck_tangent", 
_("Toggle tangent control points"));
-   ducks_radius = create_label_button(size, "synfig-toggle_duck_radius", 
_("Toggle radius control points"));
-   ducks_width = create_label_button(size, "synfig-toggle_duck_width", 
_("Toggle width control points"));
-   ducks_angle = create_label_button(size, "synfig-toggle_duck_angle", 
_("Toggle angle control points"));
+   ducks_position = create_label_button(size, 
"synfig-toggle_duck_position", _("Toggle position handles"));
+   ducks_vertex = create_label_button(size, "synfig-toggle_duck_vertex", 
_("Toggle vertex handles"));
+   ducks_tangent = create_label_button(size, "synfig-toggle_duck_tangent", 
_("Toggle tangent handles"));
+   ducks_radius = create_label_button(size, "synfig-toggle_duck_radius", 
_("Toggle radius handles"));
+   ducks_width = create_label_button(size, "synfig-toggle_duck_width", 
_("Toggle width handles"));
+   ducks_angle = create_label_button(size, "synfig-toggle_duck_angle", 
_("Toggle angle handles"));
 
attach(*ducks_position, 0, 1, 0, 1, Gtk::SHRINK, Gtk::SHRINK, 0, 0);
attach(*ducks_vertex, 1, 2, 0, 1, Gtk::SHRINK, Gtk::SHRINK, 0, 0);


--
The Go Parallel Website, sponsored by Intel - in partnership with Geeknet, 
is your hub for all things parallel software development, from weekly thought 
leadership blogs to news, videos, case studies, tutorials, tech docs, 
whitepapers, evaluation guides, and opinion stories. Check out the most 
recent posts - join the conversation now. http://goparallel.sourceforge.net/
___
Synfig-devl mailing list
Synfig-devl@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/synfig-devl


  1   2   3   4   5   6   7   8   9   10   >