Author: Carlos Lopez <[email protected]>
Date: Mon Aug 20 20:18:23 2012 +0200
Translate layer: add support for Cairo render
---
synfig-core/src/modules/lyr_std/translate.cpp | 23 +++++++++++++++++++++++
synfig-core/src/modules/lyr_std/translate.h | 1 +
2 files changed, 24 insertions(+), 0 deletions(-)
diff --git a/synfig-core/src/modules/lyr_std/translate.cpp
b/synfig-core/src/modules/lyr_std/translate.cpp
index 68f5d5f..4a4654a 100644
--- a/synfig-core/src/modules/lyr_std/translate.cpp
+++ b/synfig-core/src/modules/lyr_std/translate.cpp
@@ -156,6 +156,29 @@ Translate::accelerated_render(Context context,Surface
*surface,int quality, cons
return true;
}
+/////
+bool
+Translate::accelerated_cairorender(Context context,cairo_surface_t
*surface,int quality, const RendDesc &renddesc, ProgressCallback *cb)const
+{
+ RendDesc desc(renddesc);
+
+ desc.clear_flags();
+ desc.set_tl(desc.get_tl()-origin);
+ desc.set_br(desc.get_br()-origin);
+
+ // Render the scene
+ if(!context.accelerated_cairorender(surface,quality,desc,cb))
+ {
+ if(cb)cb->error(strprintf(__FILE__"%d: Accelerated Cairo
Renderer Failure",__LINE__));
+ return false;
+ }
+
+ return true;
+}
+
+/////
+
+
Rect
Translate::get_full_bounding_rect(Context context)const
{
diff --git a/synfig-core/src/modules/lyr_std/translate.h
b/synfig-core/src/modules/lyr_std/translate.h
index ce1b6a9..e4a39e5 100644
--- a/synfig-core/src/modules/lyr_std/translate.h
+++ b/synfig-core/src/modules/lyr_std/translate.h
@@ -59,6 +59,7 @@ public:
virtual ValueBase get_param(const String & param)const;
virtual Color get_color(Context context, const Point &pos)const;
virtual bool accelerated_render(Context context,Surface *surface,int
quality, const RendDesc &renddesc, ProgressCallback *cb)const;
+ virtual bool accelerated_cairorender(Context context,cairo_surface_t
*surface,int quality, const RendDesc &renddesc, ProgressCallback *cb)const;
virtual Vocab get_param_vocab()const;
virtual synfig::Rect get_full_bounding_rect(Context context)const;
synfig::Layer::Handle hit_check(synfig::Context context, const
synfig::Point &point)const;
------------------------------------------------------------------------------
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