diff options
author | r.kuznetsov <r.kuznetsov@corp.mail.ru> | 2015-06-29 16:21:49 +0300 |
---|---|---|
committer | r.kuznetsov <r.kuznetsov@corp.mail.ru> | 2015-11-30 16:09:27 +0300 |
commit | a2d480a4788176673f8fe828a8daf95ec874a003 (patch) | |
tree | 384afa3109cf9d4846fc8d4155074ddc0fe52b1e /drape_frontend/text_shape.cpp | |
parent | ca26334b301dd9db3aebbea8146cf2d4185562e0 (diff) |
Disabled IB mutation in text rendering
Diffstat (limited to 'drape_frontend/text_shape.cpp')
-rw-r--r-- | drape_frontend/text_shape.cpp | 23 |
1 files changed, 13 insertions, 10 deletions
diff --git a/drape_frontend/text_shape.cpp b/drape_frontend/text_shape.cpp index 199ab27158..0d2485eda6 100644 --- a/drape_frontend/text_shape.cpp +++ b/drape_frontend/text_shape.cpp @@ -1,4 +1,5 @@ #include "drape_frontend/text_shape.hpp" +#include "drape_frontend/text_handle.hpp" #include "drape_frontend/text_layout.hpp" #include "drape/utils/vertex_decl.hpp" @@ -18,20 +19,19 @@ namespace df namespace { -class StraightTextHandle : public dp::OverlayHandle +class StraightTextHandle : public TextHandle { public: StraightTextHandle(FeatureID const & id, dp::Anchor anchor, glsl::vec2 const & pivot, glsl::vec2 const & pxSize, glsl::vec2 const & offset, - double priority) - : OverlayHandle(id, anchor, priority) + double priority, gpu::TTextDynamicVertexBuffer && normals) + : TextHandle(id, anchor, priority, move(normals)) , m_pivot(glsl::ToPoint(pivot)) , m_offset(glsl::ToPoint(offset)) , m_size(glsl::ToPoint(pxSize)) - { - } + {} - m2::RectD GetPixelRect(ScreenBase const & screen) const + m2::RectD GetPixelRect(ScreenBase const & screen) const override { m2::PointD pivot = screen.GtoP(m_pivot) + m_offset; double x = pivot.x; @@ -62,7 +62,7 @@ public: max(x, pivot.x), max(y, pivot.y)); } - void GetPixelShape(ScreenBase const & screen, Rects & rects) const + void GetPixelShape(ScreenBase const & screen, Rects & rects) const override { rects.push_back(m2::RectF(GetPixelRect(screen))); } @@ -137,17 +137,20 @@ void TextShape::DrawSubString(StraightTextLayout const & layout, state.SetColorTexture(color.GetTexture()); state.SetMaskTexture(layout.GetMaskTexture()); + gpu::TTextDynamicVertexBuffer initialDynBuffer; + initialDynBuffer.resize(dynamicBuffer.size(), gpu::TextDynamicVertex(glsl::vec2(0.0, 0.0))); + m2::PointU const & pixelSize = layout.GetPixelSize(); drape_ptr<dp::OverlayHandle> handle = make_unique_dp<StraightTextHandle>(m_params.m_featureID, m_params.m_anchor, glsl::ToVec2(m_basePoint), glsl::vec2(pixelSize.x, pixelSize.y), - baseOffset, - m_params.m_depth); + baseOffset, m_params.m_depth, + move(dynamicBuffer)); dp::AttributeProvider provider(2, staticBuffer.size()); provider.InitStream(0, gpu::TextStaticVertex::GetBindingInfo(), make_ref(staticBuffer.data())); - provider.InitStream(1, gpu::TextDynamicVertex::GetBindingInfo(), make_ref(dynamicBuffer.data())); + provider.InitStream(1, gpu::TextDynamicVertex::GetBindingInfo(), make_ref(initialDynBuffer.data())); batcher->InsertListOfStrip(state, make_ref(&provider), move(handle), 4); } |