X-Git-Url: https://git.pterodactylus.net/?a=blobdiff_plain;f=synfig-core%2Ftrunk%2Fsrc%2Fsynfig%2Ftarget_scanline.cpp;h=b4745fed127eb3dd7ae9d827aac12812254d4764;hb=ca157a87151421913925eaef67fdd402bbdc8c8f;hp=e8ea05bd6923dbd7ba161e8bd1d69d06f69cb3f8;hpb=756c0d29ac1742f231e6615f9a577e574e35a4af;p=synfig.git diff --git a/synfig-core/trunk/src/synfig/target_scanline.cpp b/synfig-core/trunk/src/synfig/target_scanline.cpp index e8ea05b..b4745fe 100644 --- a/synfig-core/trunk/src/synfig/target_scanline.cpp +++ b/synfig-core/trunk/src/synfig/target_scanline.cpp @@ -47,7 +47,13 @@ using namespace synfig; /* === M A C R O S ========================================================= */ -#define SYNFIG_OPTIMIZE_LAYER_TREE 1 +// note that if this isn't defined then the rendering is incorrect for +// the straight blend method since the optimize_layers() function in +// canvas.cpp which makes the straight blend method work correctly +// isn't called. ie. leave this defined. to see the problem, draw a +// small circle over a solid background. set circle to amount 0.99 +// and blend method 'straight'. the background should vanish but doesn't +#define SYNFIG_OPTIMIZE_LAYER_TREE #define PIXEL_RENDERING_LIMIT 1500000 @@ -172,14 +178,20 @@ synfig::Target_Scanline::render(ProgressCallback *cb) Context context; - #ifdef SYNFIG_OPTIMIZE_LAYER_TREE - Canvas::Handle op_canvas(Canvas::create()); - op_canvas->set_file_name(canvas->get_file_name()); - optimize_layers(canvas->get_time(), canvas->get_context(), op_canvas); - context=op_canvas->get_context(); - #else +#ifdef SYNFIG_OPTIMIZE_LAYER_TREE + Canvas::Handle op_canvas; + if (!getenv("SYNFIG_DISABLE_OPTIMIZE_LAYER_TREE")) + { + op_canvas = Canvas::create(); + op_canvas->set_file_name(canvas->get_file_name()); + optimize_layers(canvas->get_time(), canvas->get_context(), op_canvas); + context=op_canvas->get_context(); + } + else + context=canvas->get_context(); +#else context=canvas->get_context(); - #endif +#endif // If the quality is set to zero, then we // use the parametric scanline-renderer. @@ -307,14 +319,20 @@ synfig::Target_Scanline::render(ProgressCallback *cb) canvas->set_time(t); Context context; - #ifdef SYNFIG_OPTIMIZE_LAYER_TREE - Canvas::Handle op_canvas(Canvas::create()); - op_canvas->set_file_name(canvas->get_file_name()); - optimize_layers(canvas->get_time(), canvas->get_context(), op_canvas); - context=op_canvas->get_context(); - #else +#ifdef SYNFIG_OPTIMIZE_LAYER_TREE + Canvas::Handle op_canvas; + if (!getenv("SYNFIG_DISABLE_OPTIMIZE_LAYER_TREE")) + { + op_canvas = Canvas::create(); + op_canvas->set_file_name(canvas->get_file_name()); + optimize_layers(canvas->get_time(), canvas->get_context(), op_canvas); + context=op_canvas->get_context(); + } + else + context=canvas->get_context(); +#else context=canvas->get_context(); - #endif +#endif // If the quality is set to zero, then we // use the parametric scanline-renderer.