Browse Source

Text: query the actual format in GlyphCacheGL::processedImage().

Right now it didn't really matter as the only subclass making use of
this was DistanceFieldGlyphCacheGL in which the processed format was
always R8Unorm, nevertheless it's better this way, and makes it work
with 16-bit output and such that might get added in the future.
pull/674/head
Vladimír Vondruš 1 year ago
parent
commit
ef17266906
  1. 2
      src/Magnum/Text/GlyphCacheGL.cpp

2
src/Magnum/Text/GlyphCacheGL.cpp

@ -192,7 +192,7 @@ void GlyphCacheGL::doSetProcessedImage(const Vector2i& offset, const ImageView2D
#ifndef MAGNUM_TARGET_GLES #ifndef MAGNUM_TARGET_GLES
Image3D GlyphCacheGL::doProcessedImage() { Image3D GlyphCacheGL::doProcessedImage() {
Image2D out = static_cast<State&>(*_state).texture.image(0, PixelFormat::R8Unorm); Image2D out = static_cast<State&>(*_state).texture.image(0, processedFormat());
return Image3D{out.format(), {out.size(), 1}, out.release()}; return Image3D{out.format(), {out.size(), 1}, out.release()};
} }
#endif #endif

Loading…
Cancel
Save