本文整理汇总了C++中ref_ptr::InsertListOfStrip方法的典型用法代码示例。如果您正苦于以下问题:C++ ref_ptr::InsertListOfStrip方法的具体用法?C++ ref_ptr::InsertListOfStrip怎么用?C++ ref_ptr::InsertListOfStrip使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ref_ptr
的用法示例。
在下文中一共展示了ref_ptr::InsertListOfStrip方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: DrawSubStringOutlined
void TextShape::DrawSubStringOutlined(StraightTextLayout const & layout, dp::FontDecl const & font,
glm::vec2 const & baseOffset, ref_ptr<dp::Batcher> batcher,
ref_ptr<dp::TextureManager> textures, bool isPrimary, bool isOptional) const
{
gpu::TTextOutlinedStaticVertexBuffer staticBuffer;
gpu::TTextDynamicVertexBuffer dynamicBuffer;
dp::TextureManager::ColorRegion color, outline;
textures->GetColorRegion(font.m_color, color);
textures->GetColorRegion(font.m_outlineColor, outline);
layout.Cache(glsl::vec4(glsl::ToVec2(m_basePoint), m_params.m_depth, -m_params.m_posZ),
baseOffset, color, outline, staticBuffer, dynamicBuffer);
dp::GLState state(gpu::TEXT_OUTLINED_PROGRAM, dp::GLState::OverlayLayer);
state.SetProgram3dIndex(gpu::TEXT_OUTLINED_BILLBOARD_PROGRAM);
ASSERT(color.GetTexture() == outline.GetTexture(), ());
state.SetColorTexture(color.GetTexture());
state.SetMaskTexture(layout.GetMaskTexture());
gpu::TTextDynamicVertexBuffer initialDynBuffer(dynamicBuffer.size());
m2::PointU const & pixelSize = layout.GetPixelSize();
drape_ptr<dp::OverlayHandle> handle = make_unique_dp<StraightTextHandle>(m_params.m_featureID,
layout.GetText(),
m_params.m_anchor,
glsl::ToVec2(m_basePoint),
glsl::vec2(pixelSize.x, pixelSize.y),
baseOffset,
GetOverlayPriority(),
textures,
isOptional,
m_affectedByZoomPriority,
move(dynamicBuffer),
true);
handle->SetPivotZ(m_params.m_posZ);
handle->SetOverlayRank(m_hasPOI ? (isPrimary ? dp::OverlayRank1 : dp::OverlayRank2) : dp::OverlayRank0);
handle->SetExtendingSize(m_params.m_extendingSize);
dp::AttributeProvider provider(2, staticBuffer.size());
provider.InitStream(0, gpu::TextOutlinedStaticVertex::GetBindingInfo(), make_ref(staticBuffer.data()));
provider.InitStream(1, gpu::TextDynamicVertex::GetBindingInfo(), make_ref(initialDynBuffer.data()));
batcher->InsertListOfStrip(state, make_ref(&provider), move(handle), 4);
}
示例2: DrawSubStringOutlined
void TextShape::DrawSubStringOutlined(ref_ptr<dp::GraphicsContext> context,
StraightTextLayout const & layout, dp::FontDecl const & font,
glm::vec2 const & baseOffset, ref_ptr<dp::Batcher> batcher,
ref_ptr<dp::TextureManager> textures, bool isPrimary,
bool isOptional) const
{
gpu::TTextOutlinedStaticVertexBuffer staticBuffer;
gpu::TTextDynamicVertexBuffer dynamicBuffer;
dp::TextureManager::ColorRegion color, outline;
textures->GetColorRegion(font.m_color, color);
textures->GetColorRegion(font.m_outlineColor, outline);
auto const finalOffset = layout.GetTextOffset(m_symbolSizes.front(), m_params.m_titleDecl.m_anchor, m_symbolAnchor);
layout.CacheDynamicGeometry(finalOffset, dynamicBuffer);
layout.CacheStaticGeometry(color, outline, staticBuffer);
auto state = CreateRenderState(gpu::Program::TextOutlined, m_params.m_depthLayer);
state.SetProgram3d(gpu::Program::TextOutlinedBillboard);
state.SetDepthTestEnabled(m_params.m_depthTestEnabled);
ASSERT(color.GetTexture() == outline.GetTexture(), ());
state.SetColorTexture(color.GetTexture());
state.SetMaskTexture(layout.GetMaskTexture());
gpu::TTextDynamicVertexBuffer initialDynBuffer(dynamicBuffer.size());
m2::PointF const & pixelSize = layout.GetPixelSize();
auto overlayId = dp::OverlayID(m_params.m_featureID, m_tileCoords, m_textIndex);
drape_ptr<StraightTextHandle> handle = make_unique_dp<StraightTextHandle>(overlayId,
layout.GetText(),
m_params.m_titleDecl.m_anchor,
glsl::ToVec2(m_basePoint),
glsl::vec2(pixelSize.x, pixelSize.y),
finalOffset,
GetOverlayPriority(),
layout.GetFixedHeight(),
textures,
isOptional,
std::move(dynamicBuffer),
m_params.m_minVisibleScale,
true);
if (m_symbolSizes.size() > 1)
handle->SetDynamicSymbolSizes(layout, m_symbolSizes, m_symbolAnchor);
handle->SetPivotZ(m_params.m_posZ);
ASSERT_LESS(m_params.m_startOverlayRank + 1, dp::OverlayRanksCount, ());
handle->SetOverlayRank(isPrimary ? m_params.m_startOverlayRank : m_params.m_startOverlayRank + 1);
handle->SetExtendingSize(m_params.m_extendingSize);
if (m_params.m_specialDisplacement == SpecialDisplacement::UserMark ||
m_params.m_specialDisplacement == SpecialDisplacement::SpecialModeUserMark)
{
handle->SetSpecialLayerOverlay(true);
}
dp::AttributeProvider provider(2, static_cast<uint32_t>(staticBuffer.size()));
provider.InitStream(0, gpu::TextOutlinedStaticVertex::GetBindingInfo(), make_ref(staticBuffer.data()));
provider.InitStream(1, gpu::TextDynamicVertex::GetBindingInfo(), make_ref(initialDynBuffer.data()));
batcher->InsertListOfStrip(context, state, make_ref(&provider), std::move(handle), 4);
}