unique_ptr for font_face_set
This commit is contained in:
parent
e21e8b6696
commit
7b97e3ace8
3 changed files with 5 additions and 4 deletions
|
@ -47,7 +47,7 @@ namespace mapnik
|
|||
class stroker;
|
||||
using stroker_ptr = std::shared_ptr<stroker>;
|
||||
class font_face_set;
|
||||
using face_set_ptr = std::shared_ptr<font_face_set>;
|
||||
using face_set_ptr = std::unique_ptr<font_face_set>;
|
||||
class font_face;
|
||||
using face_ptr = std::shared_ptr<font_face>;
|
||||
|
||||
|
|
|
@ -98,7 +98,7 @@ public:
|
|||
private:
|
||||
std::vector<face_ptr> faces_;
|
||||
};
|
||||
using face_set_ptr = std::shared_ptr<font_face_set>;
|
||||
using face_set_ptr = std::unique_ptr<font_face_set>;
|
||||
|
||||
|
||||
// FT_Stroker wrapper
|
||||
|
|
|
@ -28,6 +28,7 @@
|
|||
#include <mapnik/util/fs.hpp>
|
||||
#include <mapnik/util/file_io.hpp>
|
||||
#include <mapnik/utils.hpp>
|
||||
#include <mapnik/make_unique.hpp>
|
||||
|
||||
// boost
|
||||
#include <boost/algorithm/string/predicate.hpp>
|
||||
|
@ -353,7 +354,7 @@ face_ptr face_manager::get_face(std::string const& name)
|
|||
|
||||
face_set_ptr face_manager::get_face_set(std::string const& name)
|
||||
{
|
||||
face_set_ptr face_set = std::make_shared<font_face_set>();
|
||||
face_set_ptr face_set = std::make_unique<font_face_set>();
|
||||
if (face_ptr face = get_face(name))
|
||||
{
|
||||
face_set->add(face);
|
||||
|
@ -364,7 +365,7 @@ face_set_ptr face_manager::get_face_set(std::string const& name)
|
|||
face_set_ptr face_manager::get_face_set(font_set const& fset)
|
||||
{
|
||||
std::vector<std::string> const& names = fset.get_face_names();
|
||||
face_set_ptr face_set = std::make_shared<font_face_set>();
|
||||
face_set_ptr face_set = std::make_unique<font_face_set>();
|
||||
for (auto const& name : names)
|
||||
{
|
||||
face_ptr face = get_face(name);
|
||||
|
|
Loading…
Reference in a new issue