-** This software and associated documentation
-** are CONFIDENTIAL and PROPRIETARY property of
-** the above-mentioned copyright holder.
+** This package is free software; you can redistribute it and/or
+** modify it under the terms of the GNU General Public License as
+** published by the Free Software Foundation; either version 2 of
+** the License, or (at your option) any later version.
-** You may not copy, print, publish, or in any
-** other way distribute this software without
-** a prior written agreement with
-** the copyright holder.
+** This package is distributed in the hope that it will be useful,
+** but WITHOUT ANY WARRANTY; without even the implied warranty of
+** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+** General Public License for more details.
frame_end=desc.get_frame_end();
time_start=desc.get_time_start();
time_end=desc.get_time_end();
frame_end=desc.get_frame_end();
time_start=desc.get_time_start();
time_end=desc.get_time_end();
// Calculate the number of frames
total_frames=frame_end-frame_start;
if(total_frames<=0)total_frames=1;
// Calculate the number of frames
total_frames=frame_end-frame_start;
if(total_frames<=0)total_frames=1;
// Add the last tiles (which will be clipped)
if(rend_desc().get_w()%tile_w_!=0)tw++;
if(rend_desc().get_h()%tile_h_!=0)th++;
// Add the last tiles (which will be clipped)
if(rend_desc().get_w()%tile_w_!=0)tw++;
if(rend_desc().get_h()%tile_h_!=0)th++;
// If the quality is set to zero, then we
// use the parametric scanline-renderer.
if(get_quality()==0)
{
Surface surface;
// If the quality is set to zero, then we
// use the parametric scanline-renderer.
if(get_quality()==0)
{
Surface surface;
if(get_remove_alpha())
for(int i=0;i<surface.get_w()*surface.get_h();i++)
surface[0][i]=Color::blend(surface[0][i],desc.get_bg_color(),1.0f);
if(get_remove_alpha())
for(int i=0;i<surface.get_w()*surface.get_h();i++)
surface[0][i]=Color::blend(surface[0][i],desc.get_bg_color(),1.0f);
// Add the tile to the target
if(!add_tile(surface,x,y))
{
// Add the tile to the target
if(!add_tile(surface,x,y))
{
tile_desc=rend_desc;
tile_desc.set_subwindow(x,y,w,h);
tile_desc=rend_desc;
tile_desc.set_subwindow(x,y,w,h);
if(!context.accelerated_render(&surface,get_quality(),tile_desc,&super))
{
// For some reason, the accelerated renderer failed.
if(!context.accelerated_render(&surface,get_quality(),tile_desc,&super))
{
// For some reason, the accelerated renderer failed.
#if SYNFIG_DISPLAY_EFFICIENCY==1
synfig::info(">>>>>> Render Time: %fsec, Find Tile Time: %fsec, Add Tile Time: %fsec, Total Time: %fsec",work_time,find_tile_time,add_tile_time,total_time());
synfig::info(">>>>>> FRAME EFICIENCY: %f%%",(100.0f*work_time/total_time()));
#if SYNFIG_DISPLAY_EFFICIENCY==1
synfig::info(">>>>>> Render Time: %fsec, Find Tile Time: %fsec, Add Tile Time: %fsec, Total Time: %fsec",work_time,find_tile_time,add_tile_time,total_time());
synfig::info(">>>>>> FRAME EFICIENCY: %f%%",(100.0f*work_time/total_time()));
// If the description's end frame is equal to
// the start frame, then it is assumed that we
// are rendering only one frame. Correct it.
// If the description's end frame is equal to
// the start frame, then it is assumed that we
// are rendering only one frame. Correct it.
frame_end=desc.get_frame_end();
time_start=desc.get_time_start();
time_end=desc.get_time_end();
frame_end=desc.get_frame_end();
time_start=desc.get_time_start();
time_end=desc.get_time_end();
// If we have a callback, and it returns
// false, go ahead and bail. (maybe a use cancel)
if(cb && !cb->amount_complete(total_frames-(i-1),total_frames))
return false;
// If we have a callback, and it returns
// false, go ahead and bail. (maybe a use cancel)
if(cb && !cb->amount_complete(total_frames-(i-1),total_frames))
return false;
#ifdef SYNFIG_OPTIMIZE_LAYER_TREE
Canvas::Handle op_canvas(Canvas::create());
optimize_layers(canvas->get_context(), op_canvas);
#ifdef SYNFIG_OPTIMIZE_LAYER_TREE
Canvas::Handle op_canvas(Canvas::create());
optimize_layers(canvas->get_context(), op_canvas);
#ifdef SYNFIG_OPTIMIZE_LAYER_TREE
Canvas::Handle op_canvas(Canvas::create());
optimize_layers(canvas->get_context(), op_canvas);
#ifdef SYNFIG_OPTIMIZE_LAYER_TREE
Canvas::Handle op_canvas(Canvas::create());
optimize_layers(canvas->get_context(), op_canvas);