diff --git a/engine/src/flutter/impeller/entity/shaders/glyph_atlas.frag b/engine/src/flutter/impeller/entity/shaders/glyph_atlas.frag index f07e591f19..f1dcc45686 100644 --- a/engine/src/flutter/impeller/entity/shaders/glyph_atlas.frag +++ b/engine/src/flutter/impeller/entity/shaders/glyph_atlas.frag @@ -19,5 +19,5 @@ void main() { frag_color = texture( glyph_atlas_sampler, v_unit_vertex * scale_perspective + offset - ) * v_text_color; + ).rrrr * v_text_color; } diff --git a/engine/src/flutter/impeller/typographer/backends/skia/text_render_context_skia.cc b/engine/src/flutter/impeller/typographer/backends/skia/text_render_context_skia.cc index 3c67bea261..94d686e0bd 100644 --- a/engine/src/flutter/impeller/typographer/backends/skia/text_render_context_skia.cc +++ b/engine/src/flutter/impeller/typographer/backends/skia/text_render_context_skia.cc @@ -105,7 +105,7 @@ static std::optional CreateAtlasBitmap(const GlyphAtlas& atlas, size_t atlas_size) { TRACE_EVENT0("impeller", __FUNCTION__); SkBitmap bitmap; - auto image_info = SkImageInfo::MakeN32Premul(atlas_size, atlas_size); + auto image_info = SkImageInfo::MakeA8(atlas_size, atlas_size); if (!bitmap.tryAllocPixels(image_info)) { return std::nullopt; } @@ -131,28 +131,6 @@ static std::optional CreateAtlasBitmap(const GlyphAtlas& atlas, auto glyph_color = SK_ColorWHITE; -#if 0 - { - glyph_color = SkColorSetARGB(255, // - std::rand() % 255, // - std::rand() % 255, // - std::rand() % 255 // - ); - SkPaint debug_paint; - debug_paint.setARGB(255 / 4, // - std::rand() % 255, // - std::rand() % 255, // - std::rand() % 255 // - ); - canvas->drawRect(SkRect::MakeXYWH(location.origin.x, // - location.origin.y, // - location.size.width, // - location.size.height // - ), - debug_paint); - } -#endif - SkPaint glyph_paint; glyph_paint.setColor(glyph_color); canvas->drawGlyphs(1u, // count @@ -181,7 +159,7 @@ static std::shared_ptr UploadGlyphTextureAtlas( const auto& pixmap = bitmap.pixmap(); TextureDescriptor texture_descriptor; - texture_descriptor.format = PixelFormat::kR8G8B8A8UNormInt; + texture_descriptor.format = PixelFormat::kR8UNormInt; texture_descriptor.size = ISize::MakeWH(atlas_size, atlas_size); if (pixmap.rowBytes() * pixmap.height() !=