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

Method CacheSymbol

libs/drape_frontend/my_position.cpp:219–234  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

217}
218
219void MyPosition::CacheSymbol(ref_ptr<dp::GraphicsContext> context, dp::TextureManager::SymbolRegion const & symbol,
220 dp::RenderState const & state, dp::Batcher & batcher, EMyPositionPart part)
221{
222 m2::RectF const & texRect = symbol.GetTexRect();
223 m2::PointF const halfSize = symbol.GetPixelSize() * 0.5f;
224
225 mp::MarkerVertex data[4] = {{glsl::vec2(-halfSize.x, halfSize.y), glsl::ToVec2(texRect.LeftTop())},
226 {glsl::vec2(-halfSize.x, -halfSize.y), glsl::ToVec2(texRect.LeftBottom())},
227 {glsl::vec2(halfSize.x, halfSize.y), glsl::ToVec2(texRect.RightTop())},
228 {glsl::vec2(halfSize.x, -halfSize.y), glsl::ToVec2(texRect.RightBottom())}};
229
230 dp::AttributeProvider provider(1 /* streamCount */, dp::Batcher::VertexPerQuad);
231 provider.InitStream(0 /* streamIndex */, mp::GetMarkerBindingInfo(), make_ref(data));
232 m_parts[part].first = batcher.InsertTriangleStrip(context, state, make_ref(&provider), nullptr);
233 ASSERT(m_parts[part].first.IsValid(), ());
234}
235
236void MyPosition::CachePointPosition(ref_ptr<dp::GraphicsContext> context, ref_ptr<dp::TextureManager> mng)
237{

Callers

nothing calls this directly

Calls 13

vec2Class · 0.85
ToVec2Function · 0.85
make_refFunction · 0.85
ASSERTFunction · 0.85
GetPixelSizeMethod · 0.80
LeftTopMethod · 0.80
LeftBottomMethod · 0.80
RightTopMethod · 0.80
RightBottomMethod · 0.80
InitStreamMethod · 0.80
InsertTriangleStripMethod · 0.80
GetMarkerBindingInfoFunction · 0.70

Tested by

no test coverage detected