pack mapnik::gradient to save 8 bytes (128 -> 120) - refs #2631

This commit is contained in:
Dane Springmeyer 2015-01-09 11:42:57 -08:00
parent bfb0878147
commit 2a5dd5e924
2 changed files with 16 additions and 18 deletions

View file

@ -61,8 +61,8 @@ DEFINE_ENUM( gradient_unit_e, gradient_unit_enum );
class MAPNIK_DECL gradient
{
gradient_e gradient_type_;
stop_array stops_;
// transform
agg::trans_affine transform_;
// control points for the gradient, x1/y1 is the start point, x2/y2 the stop point.
double x1_;
double y1_;
@ -71,11 +71,11 @@ class MAPNIK_DECL gradient
// for radial gradients r specifies the radius of the stop circle centered on x2/y2
double r_;
stop_array stops_;
// units for the coordinates
gradient_unit_e units_;
gradient_e gradient_type_;
// transform
agg::trans_affine transform_;
public:
gradient();
gradient(gradient const& other);

View file

@ -45,28 +45,26 @@ static const char * gradient_unit_strings[] = {
IMPLEMENT_ENUM( gradient_unit_e, gradient_unit_strings )
gradient::gradient()
: gradient_type_(NO_GRADIENT),
stops_(),
x1_(0),
y1_(0),
x2_(0),
y2_(0),
r_(0),
units_(OBJECT_BOUNDING_BOX),
transform_()
{}
: transform_(),
x1_(0),
y1_(0),
x2_(0),
y2_(0),
r_(0),
stops_(),
units_(OBJECT_BOUNDING_BOX),
gradient_type_(NO_GRADIENT) {}
gradient::gradient(gradient const& other)
: gradient_type_(other.gradient_type_),
stops_(other.stops_),
: transform_(other.transform_),
x1_(other.x1_),
y1_(other.y1_),
x2_(other.x2_),
y2_(other.y2_),
r_(other.r_),
stops_(other.stops_),
units_(other.units_),
transform_(other.transform_)
{}
gradient_type_(other.gradient_type_) {}
gradient & gradient::operator=(const gradient& rhs)
{