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

display_list_cache.hpp « gui - github.com/mapsme/omim.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: a88f1137d6a787ff12f83b7e2e054e773c174146 (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
40
41
42
43
44
45
46
47
48
49
50
51
52
53
#pragma once


#include "graphics/glyph_cache.hpp"

#include "std/shared_ptr.hpp"


namespace graphics
{
  class Screen;
  class DisplayList;
}

namespace gui
{
  class DisplayListCache
  {
  private:

    /// Screen, which should be used for caching
    graphics::Screen * m_CacheScreen;
    /// GlyphCache, which should be used for caching
    graphics::GlyphCache * m_GlyphCache;
    /// Actual cache of glyphs as a display lists
    typedef map<graphics::GlyphKey, shared_ptr<graphics::DisplayList> > TGlyphs;
    TGlyphs m_Glyphs;

    typedef map<string, shared_ptr<graphics::DisplayList> > TSymbols;
    TSymbols m_Symbols;

  public:

    DisplayListCache(graphics::Screen * CacheScreen,
                     graphics::GlyphCache * GlyphCache);

    /// Add element to cache if needed
    void TouchGlyph(graphics::GlyphKey const & key);
    /// Find glyph in cache, caching if needed.
    shared_ptr<graphics::DisplayList> const & FindGlyph(graphics::GlyphKey const & key);
    /// Check, whether the glyph is present in cache.
    bool HasGlyph(graphics::GlyphKey const & key);

    /*
    /// Add symbol to cache if needed
    void TouchSymbol(char const * name);
    /// Find symbol in cache, caching if needed
    shared_ptr<graphics::DisplayList> const & FindSymbol(char const * name);
    /// Check, whether the display list for specified symbol is present in cache
    bool HasSymbol(char const * name);
    */
  };
}