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

support_manager.hpp « drape - github.com/mapsme/omim.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: f12a9978808000c7d8ea7f63f8df9d101cb10ec6 (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
#pragma once

#include "drape/graphics_context.hpp"
#include "drape/pointers.hpp"

#include "base/macros.hpp"

#include <cstdint>
#include <mutex>

namespace dp
{
extern char const * kSupportedAntialiasing;

class SupportManager
{
public:
  // This singleton must be available only from rendering threads.
  static SupportManager & Instance();

  // Initialization must be called only when graphics context is created.
  // Initialization happens once per application launch, so SupportManager
  // must not contain any properties which can be changed in the case of contexts
  // reinitialization.
  void Init(ref_ptr<GraphicsContext> context);

  bool IsSamsungGoogleNexus() const { return m_isSamsungGoogleNexus; }
  bool IsAdreno200Device() const { return m_isAdreno200; }
  bool IsTegraDevice() const { return m_isTegra; }
  bool IsAntialiasingEnabledByDefault() const { return m_isAntialiasingEnabledByDefault; }

  float GetMaxLineWidth() const { return m_maxLineWidth; }
  uint32_t GetMaxTextureSize() const { return m_maxTextureSize; }

private:
  SupportManager() = default;

  bool m_isSamsungGoogleNexus = false;
  bool m_isAdreno200 = false;
  bool m_isTegra = false;
  bool m_isAntialiasingEnabledByDefault = false;

  float m_maxLineWidth = 1;
  uint32_t m_maxTextureSize = 1024;

  bool m_isInitialized = false;
  std::mutex m_mutex;

  DISALLOW_COPY_AND_MOVE(SupportManager);
};
}  // namespace dp