-/* === S I N F G =========================================================== */
+/* === S Y N F I G ========================================================= */
/*! \file template.cpp
** \brief Template File
**
** $Id: context.cpp,v 1.4 2005/01/24 05:00:18 darco Exp $
**
** \legal
-** Copyright (c) 2002 Robert B. Quattlebaum Jr.
+** Copyright (c) 2002-2005 Robert B. Quattlebaum Jr., Adrian Bentley
**
-** 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.
** \endlegal
*/
/* ========================================================================= */
using namespace std;
using namespace etl;
-using namespace sinfg;
+using namespace synfig;
/* === M A C R O S ========================================================= */
-//#define SINFG_PROFILE_LAYERS
-//#define SINFG_DEBUG_LAYERS
+//#define SYNFIG_PROFILE_LAYERS
+//#define SYNFIG_DEBUG_LAYERS
/* === G L O B A L S ======================================================= */
-#ifdef SINFG_PROFILE_LAYERS
+#ifdef SYNFIG_PROFILE_LAYERS
#include <ETL/clock>
static int depth(0);
static std::map<String,float> time_table;
static void
_print_profile_report()
{
- sinfg::info(">>>> Profile Report: (Times are in msecs)");
+ synfig::info(">>>> Profile Report: (Times are in msecs)");
std::map<String,float>::iterator iter;
float total_time(0);
for(iter=time_table.begin();iter!=time_table.end();++iter)
float time(iter->second);
int runs(run_table[layer]);
total_time+=time;
- sinfg::info(" Layer \"%s\",\tExecs: %03d, Avg Time: %05.1f, Total Time: %05.1f",layer.c_str(),runs,time/runs*1000,time*1000);
+ synfig::info(" Layer \"%s\",\tExecs: %03d, Avg Time: %05.1f, Total Time: %05.1f",layer.c_str(),runs,time/runs*1000,time*1000);
}
- sinfg::info("Total Time: %f seconds", total_time);
- sinfg::info("<<<< End of Profile Report");
+ synfig::info("Total Time: %f seconds", total_time);
+ synfig::info("<<<< End of Profile Report");
}
#endif
bool
Context::accelerated_render(Surface *surface,int quality, const RendDesc &renddesc, ProgressCallback *cb) const
{
- #ifdef SINFG_PROFILE_LAYERS
+ #ifdef SYNFIG_PROFILE_LAYERS
String layer_name(curr_layer);
//sum the pre-work done by layer above us... (curr_layer is layer above us...)
// If this layer isn't defined, return alpha
if((context)->empty())
{
-#ifdef SINFG_DEBUG_LAYERS
- sinfg::info("Context::accelerated_render(): Hit end of list");
+#ifdef SYNFIG_DEBUG_LAYERS
+ synfig::info("Context::accelerated_render(): Hit end of list");
#endif
surface->set_wh(renddesc.get_w(),renddesc.get_h());
surface->clear();
- #ifdef SINFG_PROFILE_LAYERS
+ #ifdef SYNFIG_PROFILE_LAYERS
profile_timer.reset();
#endif
return true;
}
-#ifdef SINFG_DEBUG_LAYERS
- sinfg::info("Context::accelerated_render(): Descending into %s",(*context)->get_name().c_str());
+#ifdef SYNFIG_DEBUG_LAYERS
+ synfig::info("Context::accelerated_render(): Descending into %s",(*context)->get_name().c_str());
#endif
try {
RWLock::ReaderLock lock((*context)->get_rw_lock());
- #ifdef SINFG_PROFILE_LAYERS
+ #ifdef SYNFIG_PROFILE_LAYERS
//go down one layer :P
depth++;
}
catch(std::bad_alloc)
{
- sinfg::error("Context::accelerated_render(): Layer \"%s\" threw a bad_alloc exception!",(*context)->get_name().c_str());
+ synfig::error("Context::accelerated_render(): Layer \"%s\" threw a bad_alloc exception!",(*context)->get_name().c_str());
#ifdef _DEBUG
return false;
#else
}
catch(...)
{
- sinfg::error("Context::accelerated_render(): Layer \"%s\" threw an exception, rethrowing...",(*context)->get_name().c_str());
+ synfig::error("Context::accelerated_render(): Layer \"%s\" threw an exception, rethrowing...",(*context)->get_name().c_str());
throw;
}
}
// Set up a wrter lock
RWLock::WriterLock lock((*context)->get_rw_lock());
- //sinfg::info("%s: dirty_time=%f",(*context)->get_name().c_str(),(float)(*context)->dirty_time_);
- //sinfg::info("%s: time=%f",(*context)->get_name().c_str(),(float)time);
+ //synfig::info("%s: dirty_time=%f",(*context)->get_name().c_str(),(float)(*context)->dirty_time_);
+ //synfig::info("%s: time=%f",(*context)->get_name().c_str(),(float)time);
{
Layer::ParamList params;