[core] Rationalize style property classes: <type>{Paint,Layout}Properties

This commit is contained in:
John Firebaugh
2015-10-19 13:19:52 -07:00
parent 83d39364f9
commit df89de5cc5
31 changed files with 279 additions and 352 deletions

View File

@@ -1,7 +1,7 @@
#include <mbgl/text/quads.hpp>
#include <mbgl/text/shaping.hpp>
#include <mbgl/geometry/anchor.hpp>
#include <mbgl/style/style_layout.hpp>
#include <mbgl/style/style_properties.hpp>
#include <mbgl/util/math.hpp>
#include <cassert>
@@ -9,8 +9,8 @@ namespace mbgl {
const float globalMinScale = 0.5f; // underscale by 1 zoom level
SymbolQuads getIconQuads(Anchor &anchor, const PositionedIcon &shapedIcon,
const std::vector<Coordinate> &line, const StyleLayoutSymbol &layout,
SymbolQuads getIconQuads(Anchor& anchor, const PositionedIcon& shapedIcon,
const std::vector<Coordinate>& line, const SymbolLayoutProperties& layout,
const bool alongLine) {
const float border = 1.0;
@@ -128,9 +128,9 @@ void getSegmentGlyphs(std::back_insert_iterator<GlyphInstances> glyphs, Anchor &
}
}
SymbolQuads getGlyphQuads(Anchor &anchor, const Shaping &shapedText,
const float boxScale, const std::vector<Coordinate> &line, const StyleLayoutSymbol &layout,
const bool alongLine, const GlyphPositions &face) {
SymbolQuads getGlyphQuads(Anchor& anchor, const Shaping& shapedText,
const float boxScale, const std::vector<Coordinate>& line, const SymbolLayoutProperties& layout,
const bool alongLine, const GlyphPositions& face) {
const float textRotate = layout.text.rotate * M_PI / 180;
const bool keepUpright = layout.text.keep_upright;

View File

@@ -33,16 +33,16 @@ namespace mbgl {
typedef std::vector<SymbolQuad> SymbolQuads;
struct Anchor;
class StyleLayoutSymbol;
class SymbolLayoutProperties;
class PositionedIcon;
SymbolQuads getIconQuads(Anchor &anchor, const PositionedIcon &shapedIcon,
const std::vector<Coordinate> &line, const StyleLayoutSymbol &layout,
SymbolQuads getIconQuads(Anchor& anchor, const PositionedIcon& shapedIcon,
const std::vector<Coordinate>& line, const SymbolLayoutProperties& layout,
const bool alongLine);
SymbolQuads getGlyphQuads(Anchor &anchor, const Shaping &shapedText,
const float boxScale, const std::vector<Coordinate> &line, const StyleLayoutSymbol &layout,
const bool alongLine, const GlyphPositions &face);
SymbolQuads getGlyphQuads(Anchor& anchor, const Shaping& shapedText,
const float boxScale, const std::vector<Coordinate>& line, const SymbolLayoutProperties& layout,
const bool alongLine, const GlyphPositions& face);
}
#endif

View File

@@ -1,9 +1,9 @@
#include <mbgl/text/shaping.hpp>
#include <mbgl/style/style_layout.hpp>
#include <mbgl/style/style_properties.hpp>
namespace mbgl {
PositionedIcon shapeIcon(const Rect<uint16_t> &image, const StyleLayoutSymbol &layout) {
PositionedIcon shapeIcon(const Rect<uint16_t>& image, const SymbolLayoutProperties& layout) {
float dx = layout.icon.offset[0];
float dy = layout.icon.offset[1];
float x1 = dx - image.originalW / 2.0f;

View File

@@ -22,9 +22,9 @@ namespace mbgl {
operator bool() const { return image.hasArea(); }
};
class StyleLayoutSymbol;
class SymbolLayoutProperties;
PositionedIcon shapeIcon(const Rect<uint16_t> &image, const StyleLayoutSymbol &layout);
PositionedIcon shapeIcon(const Rect<uint16_t>& image, const SymbolLayoutProperties&);
}