Author: Carlos Lopez <[email protected]>
Date:   Sat Jul 14 13:17:00 2012 +0200

Suit a class member to set the render method to the layers. Only the layers 
that define the virtual member uses it.

---

 synfig-core/src/synfig/context.cpp |    8 ++++++++
 synfig-core/src/synfig/context.h   |    3 +++
 synfig-core/src/synfig/layer.cpp   |    6 ++++++
 synfig-core/src/synfig/layer.h     |    4 ++++
 4 files changed, 21 insertions(+), 0 deletions(-)

diff --git a/synfig-core/src/synfig/context.cpp 
b/synfig-core/src/synfig/context.cpp
index ef92add..b795567 100644
--- a/synfig-core/src/synfig/context.cpp
+++ b/synfig-core/src/synfig/context.cpp
@@ -258,7 +258,15 @@ Context::set_dirty_outlines()
        }
 }
 
+void
+Context::set_render_method(RenderMethod x)
+{
+       Context context(*this);
 
+       if((context)->empty()) return;
+       
+       (*context)->set_render_method(context+1, x);
+}
 void
 Context::set_time(Time time,const Vector &/*pos*/)const
 {
diff --git a/synfig-core/src/synfig/context.h b/synfig-core/src/synfig/context.h
index 11e5a1e..0cde8b1 100644
--- a/synfig-core/src/synfig/context.h
+++ b/synfig-core/src/synfig/context.h
@@ -94,6 +94,9 @@ public:
 
        //! Sets dirty (dirty_time_= Time::end()) to all Outline type layers
        void set_dirty_outlines();
+       
+       // Set Render Method. Passes the information of the render method to 
use to the layers
+       void set_render_method(RenderMethod x);
 
 }; // END of class Context
 
diff --git a/synfig-core/src/synfig/layer.cpp b/synfig-core/src/synfig/layer.cpp
index 1329ac3..541d7a8 100644
--- a/synfig-core/src/synfig/layer.cpp
+++ b/synfig-core/src/synfig/layer.cpp
@@ -525,6 +525,12 @@ Layer::set_time(Context context, Time time, const Point 
&pos)const
        dirty_time_=time;
 }
 
+void
+Layer::set_render_method(Context context, RenderMethod x)
+{
+       context.set_render_method(x);
+}
+
 Color
 Layer::get_color(Context context, const Point &pos)const
 {
diff --git a/synfig-core/src/synfig/layer.h b/synfig-core/src/synfig/layer.h
index 78fe799..6072816 100644
--- a/synfig-core/src/synfig/layer.h
+++ b/synfig-core/src/synfig/layer.h
@@ -39,6 +39,7 @@
 #include "node.h"
 #include "time.h"
 #include "guid.h"
+#include "target.h" // for RenderMethod. TODO: put RenderMethod apart
 
 #include "cairo.h"
 #include "cairomm/cairomm.h"
@@ -509,6 +510,9 @@ public:
        virtual Color get_color(Context context, const Point &pos)const;
        virtual CairoColor get_cairocolor(Context context, const Point 
&pos)const;
 
+       //! Sets the render method to the layer. Not all layers uses this 
virtual member
+       virtual void set_render_method(Context context, RenderMethod x);
+       
        //! Renders the Canvas to the given Surface in an accelerated manner
        /*!     \param context          Context iterator referring to next 
Layer.
        **      \param surface          Pointer to Surface to render to.


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

Reply via email to