Skip to content

Commit

Permalink
Layer_Translate: add support for Cairo render using cairo_t*.
Browse files Browse the repository at this point in the history
  • Loading branch information
genete committed Jun 13, 2013
1 parent d33a97a commit 75b9846
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 0 deletions.
15 changes: 15 additions & 0 deletions synfig-core/src/modules/lyr_std/translate.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -183,7 +183,22 @@ Translate::accelerated_cairorender(Context context,cairo_surface_t *surface,int
}

/////
/////
bool
Translate::accelerated_cairorender(Context context, cairo_t *cr, int quality, const RendDesc &renddesc, ProgressCallback *cb)const
{
cairo_translate(cr, origin[0], origin[1]);

if(!context.accelerated_cairorender(cr,quality,renddesc,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
Expand Down
1 change: 1 addition & 0 deletions synfig-core/src/modules/lyr_std/translate.h
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,7 @@ class Translate : public Layer
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 bool accelerated_cairorender(Context context, cairo_t *cr, 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;
Expand Down

0 comments on commit 75b9846

Please sign in to comment.