Data:clone ported to minor

minor tweaks

--HG--
branch : minor
This commit is contained in:
Raidho
2017-02-10 06:19:53 +03:00
parent bc6a2db22f
commit 6ea1ebde9c
22 changed files with 203 additions and 0 deletions
+18
View File
@@ -48,11 +48,29 @@ GlyphData::GlyphData(uint32 glyph, GlyphMetrics glyphMetrics, PixelFormat f)
data = new uint8[metrics.width * metrics.height * getPixelSize()];
}
GlyphData::GlyphData(const GlyphData &c)
: glyph(c.glyph)
, metrics(c.metrics)
, data(nullptr)
, format(c.format)
{
if (metrics.width > 0 && metrics.height > 0)
{
data = new uint8[metrics.width * metrics.height * getPixelSize()];
memcpy(data, c.data, c.getSize());
}
}
GlyphData::~GlyphData()
{
delete[] data;
}
Data *GlyphData::clone() const
{
return new GlyphData(*this);
}
void *GlyphData::getData() const
{
return data;