MCPcopy Create free account
hub / github.com/comaps/comaps / ColorTextureSize

Function ColorTextureSize

libs/drape/texture_manager.cpp:80–91  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

78}
79
80m2::PointU ColorTextureSize(size_t colorsCount, uint32_t maxTextureSize)
81{
82 uint32_t const sz = static_cast<uint32_t>(floor(sqrt(colorsCount + kReservedColors)));
83 /// @todo(pastk): do we need this assert at all?
84 // No problem if assert will fire here. Just color texture will be 2x bigger :)
85 // ASSERT_LESS_OR_EQUAL(sz, kMinColorTextureSize, (colorsCount));
86 uint32_t colorTextureSize = std::max(math::NextPowOf2(sz), kMinColorTextureSize);
87
88 colorTextureSize *= ColorTexture::GetColorSizeInPixels();
89 colorTextureSize = std::min(maxTextureSize, colorTextureSize);
90 return m2::PointU(colorTextureSize, colorTextureSize);
91}
92
93drape_ptr<Texture> CreateArrowTexture(ref_ptr<dp::GraphicsContext> context,
94 ref_ptr<HWTextureAllocator> textureAllocator, std::string const & texturePath,

Callers 1

InitMethod · 0.85

Calls 1

NextPowOf2Function · 0.85

Tested by

no test coverage detected