+ pass by reference when possible (c++)

This commit is contained in:
artemp 2013-02-26 11:58:07 -05:00
parent 3b5707848e
commit be61bf6fef
4 changed files with 9 additions and 9 deletions

View file

@ -140,12 +140,12 @@ class text_path : mapnik::noncopyable
~character_node() {} ~character_node() {}
void vertex(char_info_ptr *c_, double *x_, double *y_, double *angle_) const void vertex(char_info_ptr & c_, double & x_, double & y_, double & angle_) const
{ {
*c_ = c; c_ = c;
*x_ = pos.x; x_ = pos.x;
*y_ = pos.y; y_ = pos.y;
*angle_ = angle; angle_ = angle;
} }
}; };
@ -172,7 +172,7 @@ public:
} }
/** Return node. Always returns a new node. Has no way to report that there are no more nodes. */ /** Return node. Always returns a new node. Has no way to report that there are no more nodes. */
void vertex(char_info_ptr *c, double *x, double *y, double *angle) const void vertex(char_info_ptr & c, double & x, double & y, double & angle) const
{ {
nodes_[itr_++].vertex(c, x, y, angle); nodes_[itr_++].vertex(c, x, y, angle);
} }

View file

@ -417,7 +417,7 @@ void cairo_context::add_text(text_path const& path,
char_info_ptr c; char_info_ptr c;
double x, y, angle; double x, y, angle;
path.vertex(&c, &x, &y, &angle); path.vertex(c, x, y, angle);
face_set_ptr faces = font_manager.get_face_set(c->format->face_name, c->format->fontset); face_set_ptr faces = font_manager.get_face_set(c->format->face_name, c->format->fontset);
double text_size = c->format->text_size * scale_factor; double text_size = c->format->text_size * scale_factor;

View file

@ -357,7 +357,7 @@ box2d<double> text_renderer<T>::prepare_glyphs(text_path const& path)
char_info_ptr c; char_info_ptr c;
double x, y, angle; double x, y, angle;
path.vertex(&c, &x, &y, &angle); path.vertex(c, x, y, angle);
// TODO Enable when we have support for setting verbosity // TODO Enable when we have support for setting verbosity
// MAPNIK_LOG_DEBUG(font_engine_freetype) << "text_renderer: prepare_glyphs=" // MAPNIK_LOG_DEBUG(font_engine_freetype) << "text_renderer: prepare_glyphs="

View file

@ -919,7 +919,7 @@ bool placement_finder<DetectorT>::test_placement(std::auto_ptr<text_path> const&
double cwidth = ci.width + ci.format->character_spacing; double cwidth = ci.width + ci.format->character_spacing;
char_info_ptr c; char_info_ptr c;
double x, y, angle; double x, y, angle;
current_placement->vertex(&c, &x, &y, &angle); current_placement->vertex(c, x, y, angle);
x = current_placement->center.x + x; x = current_placement->center.x + x;
y = current_placement->center.y - y; y = current_placement->center.y - y;