New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Impeller] Color and monochrome glyphs should get their own atlases. #116818
Comments
We only conditionally use a full color atlas if there is at least one bitmap or colr font, but still there is a loss of efficiency if there is a single one. w.r.t. to this issue and issues for path based rendering, I think there is still a decision to make on how to split up a text run if there is a mix of monochrome glyphs, color/bitmap, or large (path based) glyphs |
Creates a separate atlas context and cache for color and alpha bitmap glyphs. Removes SDF shader and uses separate shader for full color glyphs. Requires #41754 Fixes flutter/flutter#116818 Fixes flutter/flutter#126101 This also fixes #39383 but for light text on a dark background. This problem crops up when we switch to a full color atlas. In this context, the chosen glyph color is important. But with the alpha channel only atlas, its irrelevant. See diff: ![image](https://user-images.githubusercontent.com/8975114/236598809-f4434764-cd16-4489-9644-4e9a370de7ee.png) Example app: ```dart // Copyright 2014 The Flutter Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. import 'package:flutter/material.dart'; import 'package:flutter/widgets.dart'; void main() => runApp( Container( alignment: Alignment.center, child: Text( ''' (Unicode Conference)Ø� اÙ�Ø°Ù� سÙ�عÙ�د Ù�Ù� 10-12 آذار 1997 بÙ�دÙ�Ù�Ø© Ù�Ù�اÙ�Ù�Ù�Ù�تÙ�سØ� Ø£Ù�Ù�اÙ�Ù�ا. Ù� سÙ�جÙ�ع اÙ�Ù�ؤتÙ�ر بÙ�Ù� خبراء Ù�Ù� Ù�اÙ�Ø© Ù�طاعات اÙ�صÙ�اعة عÙ�Ù� اÙ�شبÙ�Ø© اÙ�عاÙ�Ù�Ù�Ø© اÙ�ترÙ�Ù�ت Ù�Ù�Ù�Ù�Ù�Ù�Ù�دØ� ØÙ�Ø« ستتÙ�Ø� عÙ�Ù� اÙ�صعÙ�دÙ�Ù� اÙ�دÙ�Ù�Ù� Ù�اÙ�Ù�ØÙ�Ù� عÙ�Ù� Øد سÙ�اء Ù�Ù�اÙ�شة سبÙ� استخداÙ� Ù�Ù�Ù�Ù�Ù�د Ù�Ù� اÙ�Ù�ظÙ� اÙ�Ù�ائÙ�Ø© Ù�Ù�Ù�Ù�ا Ù�خص اÙ�تطبÙ�Ù�ات اÙ�ØاسÙ�بÙ�Ø©Ø� اÙ�خطÙ�Ø·Ø� تصÙ�Ù�Ù� اÙ�Ù�صÙ�ص Ù�اÙ�ØÙ�سبة Ù�تعددة اÙ�Ù�غات. Ù�Ù�Ù�Ù�Ù�Ù�Ù�Ù�Ù�Ù�Ù�Ù�ð��� ð��� ð��� ð��� ð���''', textDirection: TextDirection.rtl, style: TextStyle(fontSize: 24, color: Colors.white), ), ), ); ```
This thread has been automatically locked since there has not been any recent activity after it was closed. If you are still experiencing a similar issue, please open a new bug, including the output of |
We assume all glyphs are full color and allocate an 8888 atlas. This is unnecessary in most cases and causes a quadrupling of glyph atlas texture memory.
The text was updated successfully, but these errors were encountered: