| 25 | namespace |
| 26 | { |
| 27 | glsl::vec2 GetNormalsAndMask(dp::TextureManager::GlyphRegion const & glyph, float xOffset, float yOffset, |
| 28 | float textRatio, std::array<glsl::vec2, 4> & normals, |
| 29 | std::array<glsl::vec2, 4> & maskTexCoord) |
| 30 | { |
| 31 | m2::PointF const pixelSize = glyph.GetPixelSize() * textRatio; |
| 32 | m2::RectF const & r = glyph.GetTexRect(); |
| 33 | |
| 34 | xOffset *= textRatio; |
| 35 | yOffset *= textRatio; |
| 36 | |
| 37 | float const upVector = -pixelSize.y - yOffset; |
| 38 | float const bottomVector = -yOffset; |
| 39 | |
| 40 | normals[0] = glsl::vec2(xOffset, bottomVector); |
| 41 | normals[1] = glsl::vec2(xOffset, upVector); |
| 42 | normals[2] = glsl::vec2(pixelSize.x + xOffset, bottomVector); |
| 43 | normals[3] = glsl::vec2(pixelSize.x + xOffset, upVector); |
| 44 | |
| 45 | maskTexCoord[0] = glsl::ToVec2(r.LeftTop()); |
| 46 | maskTexCoord[1] = glsl::ToVec2(r.LeftBottom()); |
| 47 | maskTexCoord[2] = glsl::ToVec2(r.RightTop()); |
| 48 | maskTexCoord[3] = glsl::ToVec2(r.RightBottom()); |
| 49 | |
| 50 | return {xOffset, yOffset}; |
| 51 | } |
| 52 | |
| 53 | void FillCommonDecl(dp::BindingDecl & decl, std::string const & name, uint8_t compCount, uint8_t stride, uint8_t offset) |
| 54 | { |
no test coverage detected