forked from organicmaps/organicmaps-tmp
switched back to 4bpp texture format on IPhone.
This commit is contained in:
parent
2c4ace897e
commit
db5b6c5882
3 changed files with 17 additions and 13 deletions
|
@ -76,8 +76,8 @@ namespace yg
|
|||
};
|
||||
}
|
||||
|
||||
/*#ifdef OMIM_GL_ES
|
||||
#ifdef OMIM_GL_ES
|
||||
#define DATA_TRAITS RGBA4Traits
|
||||
#else*/
|
||||
#else
|
||||
#define DATA_TRAITS RGBA8Traits
|
||||
//#endif
|
||||
#endif
|
||||
|
|
|
@ -157,7 +157,7 @@ namespace yg
|
|||
|
||||
if ((info->m_width != 0) && (info->m_height != 0))
|
||||
{
|
||||
info->m_bitmap.resize(info->m_width * info->m_height * 4);
|
||||
info->m_bitmap.resize(info->m_width * info->m_height * sizeof(DATA_TRAITS::pixel_t));
|
||||
|
||||
DATA_TRAITS::view_t dstView = gil::interleaved_view(
|
||||
info->m_width,
|
||||
|
@ -173,10 +173,12 @@ namespace yg
|
|||
bitmapGlyph->bitmap.pitch
|
||||
);
|
||||
|
||||
DATA_TRAITS::pixel_t c(key.m_isMask ? DATA_TRAITS::maxChannelVal : 0,
|
||||
key.m_isMask ? DATA_TRAITS::maxChannelVal : 0,
|
||||
key.m_isMask ? DATA_TRAITS::maxChannelVal : 0,
|
||||
0);
|
||||
DATA_TRAITS::pixel_t c;
|
||||
|
||||
gil::get_color(c, gil::red_t()) = key.m_isMask ? DATA_TRAITS::maxChannelVal : 0;
|
||||
gil::get_color(c, gil::green_t()) = key.m_isMask ? DATA_TRAITS::maxChannelVal : 0;
|
||||
gil::get_color(c, gil::blue_t()) = key.m_isMask ? DATA_TRAITS::maxChannelVal : 0;
|
||||
gil::get_color(c, gil::alpha_t()) = 0;
|
||||
|
||||
for (size_t y = 0; y < srcView.height(); ++y)
|
||||
for (size_t x = 0; x < srcView.width(); ++x)
|
||||
|
|
|
@ -407,10 +407,12 @@ namespace yg
|
|||
yg::Color c = m_colorUploadCommands[i].m_color;
|
||||
m2::RectU const & r = m_colorUploadCommands[i].m_rect;
|
||||
|
||||
c.r /= TDynamicTexture::channelScaleFactor;
|
||||
c.g /= TDynamicTexture::channelScaleFactor;
|
||||
c.b /= TDynamicTexture::channelScaleFactor;
|
||||
c.a /= TDynamicTexture::channelScaleFactor;
|
||||
TDynamicTexture::pixel_t px;
|
||||
|
||||
gil::get_color(px, gil::red_t()) = c.r / TDynamicTexture::channelScaleFactor;
|
||||
gil::get_color(px, gil::green_t()) = c.g / TDynamicTexture::channelScaleFactor;
|
||||
gil::get_color(px, gil::blue_t()) = c.b / TDynamicTexture::channelScaleFactor;
|
||||
gil::get_color(px, gil::alpha_t()) = c.a / TDynamicTexture::channelScaleFactor;
|
||||
|
||||
TDynamicTexture * dynTexture = static_cast<TDynamicTexture*>(m_texture.get());
|
||||
|
||||
|
@ -418,7 +420,7 @@ namespace yg
|
|||
|
||||
for (size_t y = 0; y < r.SizeY(); ++y)
|
||||
for (size_t x = 0; x < r.SizeX(); ++x)
|
||||
v(x, y) = TDynamicTexture::pixel_t(c.r, c.g, c.b, c.a);
|
||||
v(x, y) = px;
|
||||
|
||||
dynTexture->upload(&v(0, 0), r);
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue