From 6bbbe155fee3080aac0265b0f40805f2c2a4edde Mon Sep 17 00:00:00 2001 From: Dane Springmeyer Date: Fri, 19 Jul 2013 15:09:59 -0400 Subject: [PATCH] remove RENDERING_STATS compile time option - refs #1956 --- SConstruct | 2 - include/mapnik/feature_style_processor.hpp | 3 +- .../mapnik/feature_style_processor_impl.hpp | 100 +----------------- src/build.py | 13 +-- 4 files changed, 6 insertions(+), 112 deletions(-) diff --git a/SConstruct b/SConstruct index dab5372e0..cf8904425 100644 --- a/SConstruct +++ b/SConstruct @@ -336,8 +336,6 @@ opts.AddVariables( # Variables affecting rendering back-ends - BoolVariable('RENDERING_STATS', 'Output rendering statistics during style processing', 'False'), - BoolVariable('SVG_RENDERER', 'build support for native svg renderer', 'False'), BoolVariable('CPP_TESTS', 'Compile the C++ tests', 'True'), BoolVariable('BENCHMARK', 'Compile the C++ benchmark scripts', 'False'), diff --git a/include/mapnik/feature_style_processor.hpp b/include/mapnik/feature_style_processor.hpp index e880c3461..f426a7314 100644 --- a/include/mapnik/feature_style_processor.hpp +++ b/include/mapnik/feature_style_processor.hpp @@ -85,8 +85,7 @@ private: /*! * \brief renders a featureset with the given styles. */ - void render_style(layer const& lay, - Processor & p, + void render_style(Processor & p, feature_type_style const* style, rule_cache const& rules, std::string const& style_name, diff --git a/include/mapnik/feature_style_processor_impl.hpp b/include/mapnik/feature_style_processor_impl.hpp index b03b8732b..5ea659b38 100644 --- a/include/mapnik/feature_style_processor_impl.hpp +++ b/include/mapnik/feature_style_processor_impl.hpp @@ -56,12 +56,6 @@ #include #include -#if defined(RENDERING_STATS) -#include -#include -#include -#endif - namespace mapnik { @@ -152,11 +146,6 @@ feature_style_processor::feature_style_processor(Map const& m, double template void feature_style_processor::apply(double scale_denom) { -#if defined(RENDERING_STATS) - std::clog << "\n//-- starting rendering timer...\n"; - mapnik::progress_timer t(std::clog, "total map rendering"); -#endif - Processor & p = static_cast(*this); p.start_map_processing(m_); @@ -186,11 +175,6 @@ void feature_style_processor::apply(double scale_denom) p.end_map_processing(m_); -#if defined(RENDERING_STATS) - t.stop(); - std::clog << "//-- rendering timer stopped...\n\n"; -#endif - } template @@ -250,23 +234,9 @@ void feature_style_processor::apply_to_layer(layer const& lay, Proces return; } -#if defined(RENDERING_STATS) - progress_timer layer_timer(std::clog, "rendering total for layer: '" + lay.name() + "'"); -#endif - projection proj1(lay.srs(),true); proj_transform prj_trans(proj0,proj1); -#if defined(RENDERING_STATS) - if (! prj_trans.equal()) - { - std::clog << "notice: reprojecting layer: '" << lay.name() << "' from/to:\n\t'" - << lay.srs() << "'\n\t'" - << m_.srs() << "'\n"; - } -#endif - - box2d query_ext = extent; // unbuffered box2d buffered_query_ext(query_ext); // buffered @@ -344,9 +314,6 @@ void feature_style_processor::apply_to_layer(layer const& lay, Proces } } } -#if defined(RENDERING_STATS) - layer_timer.discard(); -#endif return; } @@ -491,7 +458,7 @@ void feature_style_processor::apply_to_layer(layer const& lay, Proces int i = 0; BOOST_FOREACH (feature_type_style const* style, active_styles) { - render_style(lay, p, style, rule_caches[i], style_names[i], + render_style(p, style, rule_caches[i], style_names[i], cache.features(q), prj_trans); i++; } @@ -504,7 +471,7 @@ void feature_style_processor::apply_to_layer(layer const& lay, Proces int i = 0; BOOST_FOREACH (feature_type_style const* style, active_styles) { - render_style(lay, p, style, rule_caches[i], style_names[i], + render_style(p, style, rule_caches[i], style_names[i], cache.features(q), prj_trans); i++; } @@ -525,7 +492,7 @@ void feature_style_processor::apply_to_layer(layer const& lay, Proces int i = 0; BOOST_FOREACH (feature_type_style const* style, active_styles) { - render_style(lay, p, style, rule_caches[i], style_names[i], + render_style(p, style, rule_caches[i], style_names[i], cache.features(q), prj_trans); i++; } @@ -536,24 +503,18 @@ void feature_style_processor::apply_to_layer(layer const& lay, Proces int i = 0; BOOST_FOREACH (feature_type_style const* style, active_styles) { - render_style(lay, p, style, rule_caches[i], style_names[i], + render_style(p, style, rule_caches[i], style_names[i], ds->features(q), prj_trans); i++; } } } - -#if defined(RENDERING_STATS) - layer_timer.stop(); -#endif - p.end_layer_processing(lay); } template void feature_style_processor::render_style( - layer const& lay, Processor & p, feature_type_style const* style, rule_cache const& rc, @@ -567,25 +528,9 @@ void feature_style_processor::render_style( p.end_style_processing(*style); return; } - -#if defined(RENDERING_STATS) - std::ostringstream s1; - s1 << "rendering style for layer: '" << lay.name() - << "' and style '" << style_name << "'"; - mapnik::progress_timer style_timer(std::clog, s1.str()); - - int feature_processed_count = 0; - int feature_count = 0; -#endif - feature_ptr feature; while ((feature = features->next())) { -#if defined(RENDERING_STATS) - feature_count++; - bool feat_processed = false; -#endif - bool do_else = true; bool do_also = false; @@ -595,10 +540,6 @@ void feature_style_processor::render_style( value_type result = boost::apply_visitor(evaluate(*feature),*expr); if (result.to_bool()) { -#if defined(RENDERING_STATS) - feat_processed = true; -#endif - p.painted(true); do_else=false; @@ -627,10 +568,6 @@ void feature_style_processor::render_style( { BOOST_FOREACH( rule const* r, rc.get_else_rules() ) { -#if defined(RENDERING_STATS) - feat_processed = true; -#endif - p.painted(true); rule::symbolizers const& symbols = r->get_symbolizers(); @@ -649,10 +586,6 @@ void feature_style_processor::render_style( { BOOST_FOREACH( rule const* r, rc.get_also_rules() ) { -#if defined(RENDERING_STATS) - feat_processed = true; -#endif - p.painted(true); rule::symbolizers const& symbols = r->get_symbolizers(); @@ -667,32 +600,7 @@ void feature_style_processor::render_style( } } } -#if defined(RENDERING_STATS) - if (feat_processed) - feature_processed_count++; -#endif } - -#if defined(RENDERING_STATS) - style_timer.stop(); - - // done with style - std::ostringstream s; - if (feature_count > 0) - { - double perc_processed = ((double)feature_processed_count/(double)feature_count)*100.0; - - s << "percent rendered: " << perc_processed << "% - " << feature_processed_count - << " rendered for " << feature_count << " queried for "; - s << std::setw(15 - (int)s.tellp()) << " layer '" << lay.name() << "' and style '" << style_name << "'\n"; - } - else - { - s << "" << std::setw(15) << "- no features returned from query for layer '" << lay.name() << "' and style '" << style_name << "'\n"; - } - std::clog << s.str(); - style_timer.discard(); -#endif p.end_style_processing(*style); } diff --git a/src/build.py b/src/build.py index 91b2bb385..7ffa2df54 100644 --- a/src/build.py +++ b/src/build.py @@ -145,6 +145,7 @@ source = Split( transform_expression_grammar.cpp transform_expression.cpp feature_kv_iterator.cpp + feature_style_processor.cpp feature_type_style.cpp font_engine_freetype.cpp font_set.cpp @@ -367,18 +368,6 @@ else: """ ) -processor_cpp = 'feature_style_processor.cpp' - -if env['RENDERING_STATS']: - env3 = lib_env.Clone() - env3.Append(CPPDEFINES='-DRENDERING_STATS') - if env['LINKING'] == 'static': - source.insert(0,env3.StaticObject(processor_cpp)) - else: - source.insert(0,env3.SharedObject(processor_cpp)) -else: - source.insert(0,processor_cpp); - # clone the env one more time to isolate mapnik_lib_link_flag lib_env_final = lib_env.Clone()