X-Git-Url: https://git.pterodactylus.net/?a=blobdiff_plain;f=synfig-core%2Ftags%2Fstable%2Fsrc%2Fsynfig%2Ftarget_scanline.cpp;h=49cff08ce14d4f0b54f0bedb158cef0c86180a98;hb=391f6a3be479646721d8cc78b5ee673db17bd540;hp=19f38f21a010eb401d57f861f17a3aa784809e27;hpb=d3408370fc3297609b3aa8d4ff7edf1f238df251;p=synfig.git diff --git a/synfig-core/tags/stable/src/synfig/target_scanline.cpp b/synfig-core/tags/stable/src/synfig/target_scanline.cpp index 19f38f2..49cff08 100644 --- a/synfig-core/tags/stable/src/synfig/target_scanline.cpp +++ b/synfig-core/tags/stable/src/synfig/target_scanline.cpp @@ -6,6 +6,7 @@ ** ** \legal ** Copyright (c) 2002-2005 Robert B. Quattlebaum Jr., Adrian Bentley +** Copyright (c) 2008 Chris Moore ** ** This package is free software; you can redistribute it and/or ** modify it under the terms of the GNU General Public License as @@ -46,7 +47,7 @@ using namespace synfig; /* === M A C R O S ========================================================= */ -#define SYNFIG_OPTIMIZE_LAYER_TREE 1 +#define SYNFIG_OPTIMIZE_LAYER_TREE #define PIXEL_RENDERING_LIMIT 1500000 @@ -125,7 +126,7 @@ synfig::Target_Scanline::render(ProgressCallback *cb) curr_frame_=0; if( !init() ){ - if(cb) cb->error(_("Target initialisation failure")); + if(cb) cb->error(_("Target initialization failure")); return false; } @@ -171,13 +172,20 @@ synfig::Target_Scanline::render(ProgressCallback *cb) Context context; - #ifdef SYNFIG_OPTIMIZE_LAYER_TREE - Canvas::Handle op_canvas(Canvas::create()); - optimize_layers(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. @@ -199,8 +207,6 @@ synfig::Target_Scanline::render(ProgressCallback *cb) #if USE_PIXELRENDERING_LIMIT if(desc.get_w()*desc.get_h() > PIXEL_RENDERING_LIMIT) { - synfig::info("Render BROKEN UP! (%d pixels)", desc.get_w()*desc.get_h()); - Surface surface; int rowheight = PIXEL_RENDERING_LIMIT/desc.get_w(); if (!rowheight) rowheight = 1; // TODO: render partial lines to stay within the limit? @@ -209,7 +215,8 @@ synfig::Target_Scanline::render(ProgressCallback *cb) rows++; - synfig::info("\t blockh=%d,remh=%d,totrows=%d", rowheight,lastrowheight,rows); + synfig::info("Render broken up into %d block%s %d pixels tall, and a final block %d pixels tall", + rows-1, rows==2?"":"s", rowheight, lastrowheight); // loop through all the full rows if(!start_frame()) @@ -306,13 +313,20 @@ synfig::Target_Scanline::render(ProgressCallback *cb) canvas->set_time(t); Context context; - #ifdef SYNFIG_OPTIMIZE_LAYER_TREE - Canvas::Handle op_canvas(Canvas::create()); - optimize_layers(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. @@ -334,8 +348,6 @@ synfig::Target_Scanline::render(ProgressCallback *cb) #if USE_PIXELRENDERING_LIMIT if(desc.get_w()*desc.get_h() > PIXEL_RENDERING_LIMIT) { - synfig::info("Render BROKEN UP! (%d pixels)", desc.get_w()*desc.get_h()); - Surface surface; int totalheight = desc.get_h(); int rowheight = PIXEL_RENDERING_LIMIT/desc.get_w(); @@ -345,7 +357,8 @@ synfig::Target_Scanline::render(ProgressCallback *cb) rows++; - synfig::info("\t blockh=%d,remh=%d,totrows=%d", rowheight,lastrowheight,rows); + synfig::info("Render broken up into %d block%s %d pixels tall, and a final block %d pixels tall", + rows-1, rows==2?"":"s", rowheight, lastrowheight); // loop through all the full rows if(!start_frame())