Welcome to mirror list, hosted at ThFree Co, Russian Federation.

glyph.hpp « graphics - github.com/mapsme/omim.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: 68887b3ec5eb7090960deb5e04be0d6e0ede1f22 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
#pragma once

#include "graphics/resource.hpp"
#include "graphics/glyph_cache.hpp"

namespace graphics
{
  struct Glyph : public Resource
  {
    struct Info : public Resource::Info
    {
      GlyphKey m_key;
      GlyphMetrics m_metrics;
      GlyphCache * m_cache;

      Info();
      Info(GlyphKey const & key,
           GlyphCache * cache);

      Resource::Info const & cacheKey() const;
      m2::PointU const resourceSize() const;
      Resource * createResource(m2::RectU const & texRect,
                                uint8_t pipelineID) const;

      bool lessThan(Resource::Info const * r) const;
    };

    Info m_info;

    shared_ptr<GlyphBitmap> m_bitmap;

    Glyph(Info const & info,
          m2::RectU const & texRect,
          int pipelineID);

    void render(void * dst);
    Resource::Info const * info() const;
  };
}