X-Git-Url: https://git.pterodactylus.net/?a=blobdiff_plain;f=synfig-core%2Ftrunk%2Fsrc%2Fsynfig%2Ftarget_scanline.cpp;h=e8ea05bd6923dbd7ba161e8bd1d69d06f69cb3f8;hb=756c0d29ac1742f231e6615f9a577e574e35a4af;hp=aeb28694672dd46cee79fc47bfe70cebbe36b850;hpb=cc54c38609ee9745ad678e5e9b9d7d2912be9c95;p=synfig.git diff --git a/synfig-core/trunk/src/synfig/target_scanline.cpp b/synfig-core/trunk/src/synfig/target_scanline.cpp index aeb2869..e8ea05b 100644 --- a/synfig-core/trunk/src/synfig/target_scanline.cpp +++ b/synfig-core/trunk/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 @@ -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; } @@ -173,7 +174,8 @@ synfig::Target_Scanline::render(ProgressCallback *cb) #ifdef SYNFIG_OPTIMIZE_LAYER_TREE Canvas::Handle op_canvas(Canvas::create()); - optimize_layers(canvas->get_context(), op_canvas); + 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(); @@ -199,16 +201,16 @@ 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? int rows = desc.get_h()/rowheight; int lastrowheight = desc.get_h() - rows*rowheight; 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()) @@ -222,7 +224,7 @@ synfig::Target_Scanline::render(ProgressCallback *cb) RendDesc blockrd = desc; //render the strip at the normal size unless it's the last one... - if(i == rows) + if(i == rows-1) { if(!lastrowheight) break; blockrd.set_subwindow(0,i*rowheight,desc.get_w(),lastrowheight); @@ -307,7 +309,8 @@ synfig::Target_Scanline::render(ProgressCallback *cb) #ifdef SYNFIG_OPTIMIZE_LAYER_TREE Canvas::Handle op_canvas(Canvas::create()); - optimize_layers(canvas->get_context(), op_canvas); + 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(); @@ -333,17 +336,17 @@ 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(); + if (!rowheight) rowheight = 1; // TODO: render partial lines to stay within the limit? int rows = desc.get_h()/rowheight; int lastrowheight = desc.get_h() - rows*rowheight; 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()) @@ -357,7 +360,7 @@ synfig::Target_Scanline::render(ProgressCallback *cb) RendDesc blockrd = desc; //render the strip at the normal size unless it's the last one... - if(i == rows) + if(i == rows-1) { if(!lastrowheight) break; blockrd.set_subwindow(0,i*rowheight,desc.get_w(),lastrowheight);