Increased sharpness of non-sdf text.

This commit is contained in:
Daria Volvenkova 2017-01-10 13:37:00 +03:00
parent 600b2e68f1
commit 54df5fef0e

View file

@ -204,13 +204,17 @@ void TextShape::DrawSubStringPlain(StraightTextLayout const & layout, dp::FontDe
layout.Cache(glsl::vec4(pt, m_params.m_depth, -m_params.m_posZ),
baseOffset, color, staticBuffer, dynamicBuffer);
dp::GLState state(layout.GetFixedHeight() > 0 ? gpu::TEXT_FIXED_PROGRAM : gpu::TEXT_PROGRAM, dp::GLState::OverlayLayer);
state.SetProgram3dIndex(layout.GetFixedHeight() > 0 ? gpu::TEXT_FIXED_BILLBOARD_PROGRAM : gpu::TEXT_BILLBOARD_PROGRAM);
bool const isNonSdfText = layout.GetFixedHeight() > 0;
dp::GLState state(isNonSdfText ? gpu::TEXT_FIXED_PROGRAM : gpu::TEXT_PROGRAM, dp::GLState::OverlayLayer);
state.SetProgram3dIndex(isNonSdfText ? gpu::TEXT_FIXED_BILLBOARD_PROGRAM : gpu::TEXT_BILLBOARD_PROGRAM);
ASSERT(color.GetTexture() == outline.GetTexture(), ());
state.SetColorTexture(color.GetTexture());
state.SetMaskTexture(layout.GetMaskTexture());
if (isNonSdfText)
state.SetTextureFilter(gl_const::GLNearest);
gpu::TTextDynamicVertexBuffer initialDynBuffer(dynamicBuffer.size());
m2::PointU const & pixelSize = layout.GetPixelSize();