| 32 | } |
| 33 | |
| 34 | void FontTextureAtlas::Init(uint32 width, uint32 height) |
| 35 | { |
| 36 | // Setup |
| 37 | _width = width; |
| 38 | _height = height; |
| 39 | const uint32 padding = GetPaddingAmount() * 2; // Double the padding so each slot has own border around it |
| 40 | _atlas.Init(_width, _height, padding); |
| 41 | _isDirty = false; |
| 42 | |
| 43 | // Reserve upload data memory |
| 44 | _data.Resize(_width * _height * _bytesPerPixel, false); |
| 45 | Platform::MemoryClear(_data.Get(), _data.Capacity()); |
| 46 | } |
| 47 | |
| 48 | FontTextureAtlasSlot* FontTextureAtlas::AddEntry(uint32 width, uint32 height, const Array<byte>& data) |
| 49 | { |
no test coverage detected