Skip to content
This repository was archived by the owner on Feb 25, 2025. It is now read-only.

Commit 05d4f6a

Browse files
Remove migration flag and unused header files
1 parent ba3218b commit 05d4f6a

File tree

17 files changed

+13
-204
lines changed

17 files changed

+13
-204
lines changed

ci/licenses_golden/licenses_flutter

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5857,7 +5857,6 @@ ORIGIN: ../../../flutter/lib/ui/text/asset_manager_font_provider.cc + ../../../f
58575857
ORIGIN: ../../../flutter/lib/ui/text/asset_manager_font_provider.h + ../../../flutter/LICENSE
58585858
ORIGIN: ../../../flutter/lib/ui/text/font_collection.cc + ../../../flutter/LICENSE
58595859
ORIGIN: ../../../flutter/lib/ui/text/font_collection.h + ../../../flutter/LICENSE
5860-
ORIGIN: ../../../flutter/lib/ui/text/line_metrics.h + ../../../flutter/LICENSE
58615860
ORIGIN: ../../../flutter/lib/ui/text/paragraph.cc + ../../../flutter/LICENSE
58625861
ORIGIN: ../../../flutter/lib/ui/text/paragraph.h + ../../../flutter/LICENSE
58635862
ORIGIN: ../../../flutter/lib/ui/text/paragraph_builder.cc + ../../../flutter/LICENSE
@@ -8718,7 +8717,6 @@ FILE: ../../../flutter/lib/ui/text/asset_manager_font_provider.cc
87188717
FILE: ../../../flutter/lib/ui/text/asset_manager_font_provider.h
87198718
FILE: ../../../flutter/lib/ui/text/font_collection.cc
87208719
FILE: ../../../flutter/lib/ui/text/font_collection.h
8721-
FILE: ../../../flutter/lib/ui/text/line_metrics.h
87228720
FILE: ../../../flutter/lib/ui/text/paragraph.cc
87238721
FILE: ../../../flutter/lib/ui/text/paragraph.h
87248722
FILE: ../../../flutter/lib/ui/text/paragraph_builder.cc

lib/ui/BUILD.gn

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -123,7 +123,6 @@ source_set("ui") {
123123
"text/asset_manager_font_provider.h",
124124
"text/font_collection.cc",
125125
"text/font_collection.h",
126-
"text/line_metrics.h",
127126
"text/paragraph.cc",
128127
"text/paragraph.h",
129128
"text/paragraph_builder.cc",

lib/ui/text.dart

Lines changed: 2 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -3355,23 +3355,6 @@ abstract class ParagraphBuilder {
33553355
/// [Paragraph].
33563356
factory ParagraphBuilder(ParagraphStyle style) = _NativeParagraphBuilder;
33573357

3358-
/// Whether the rounding hack enabled by default in SkParagraph and TextPainter
3359-
/// is disabled.
3360-
///
3361-
/// Do not rely on this getter as it exists for migration purposes only and
3362-
/// will soon be removed.
3363-
@Deprecated('''
3364-
The shouldDisableRoundingHack flag is for internal migration purposes only and should not be used.
3365-
''')
3366-
static bool get shouldDisableRoundingHack => _shouldDisableRoundingHack;
3367-
static bool _shouldDisableRoundingHack = true;
3368-
/// Do not call this method as it is for migration purposes only and will soon
3369-
/// be removed.
3370-
// ignore: use_setters_to_change_properties
3371-
static void setDisableRoundingHack(bool disableRoundingHack) {
3372-
_shouldDisableRoundingHack = disableRoundingHack;
3373-
}
3374-
33753358
/// The number of placeholders currently in the paragraph.
33763359
int get placeholderCount;
33773360

@@ -3489,11 +3472,10 @@ base class _NativeParagraphBuilder extends NativeFieldWrapperClass1 implements P
34893472
style._height ?? 0,
34903473
style._ellipsis ?? '',
34913474
_encodeLocale(style._locale),
3492-
!ParagraphBuilder.shouldDisableRoundingHack,
34933475
);
34943476
}
34953477

3496-
@Native<Void Function(Handle, Handle, Handle, Handle, Handle, Double, Double, Handle, Handle, Bool)>(symbol: 'ParagraphBuilder::Create')
3478+
@Native<Void Function(Handle, Handle, Handle, Handle, Handle, Double, Double, Handle, Handle)>(symbol: 'ParagraphBuilder::Create')
34973479
external void _constructor(
34983480
Int32List encoded,
34993481
ByteData? strutData,
@@ -3503,7 +3485,7 @@ base class _NativeParagraphBuilder extends NativeFieldWrapperClass1 implements P
35033485
double height,
35043486
String ellipsis,
35053487
String locale,
3506-
bool applyRoundingHack);
3488+
);
35073489

35083490
@override
35093491
int get placeholderCount => _placeholderCount;

lib/ui/text/line_metrics.h

Lines changed: 0 additions & 62 deletions
This file was deleted.

lib/ui/text/paragraph.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@
88
#include "flutter/fml/message_loop.h"
99
#include "flutter/lib/ui/dart_wrapper.h"
1010
#include "flutter/lib/ui/painting/canvas.h"
11-
#include "flutter/lib/ui/text/line_metrics.h"
1211
#include "flutter/third_party/txt/src/txt/paragraph.h"
1312

1413
namespace flutter {

lib/ui/text/paragraph_builder.cc

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -151,12 +151,11 @@ void ParagraphBuilder::Create(Dart_Handle wrapper,
151151
double fontSize,
152152
double height,
153153
const std::u16string& ellipsis,
154-
const std::string& locale,
155-
bool applyRoundingHack) {
154+
const std::string& locale) {
156155
UIDartState::ThrowIfUIOperationsProhibited();
157156
auto res = fml::MakeRefCounted<ParagraphBuilder>(
158157
encoded_handle, strutData, fontFamily, strutFontFamilies, fontSize,
159-
height, ellipsis, locale, applyRoundingHack);
158+
height, ellipsis, locale);
160159
res->AssociateWithDartWrapper(wrapper);
161160
}
162161

@@ -231,8 +230,7 @@ ParagraphBuilder::ParagraphBuilder(
231230
double fontSize,
232231
double height,
233232
const std::u16string& ellipsis,
234-
const std::string& locale,
235-
bool applyRoundingHack) {
233+
const std::string& locale) {
236234
int32_t mask = 0;
237235
txt::ParagraphStyle style;
238236
{
@@ -293,7 +291,6 @@ ParagraphBuilder::ParagraphBuilder(
293291
if (mask & kPSLocaleMask) {
294292
style.locale = locale;
295293
}
296-
style.apply_rounding_hack = applyRoundingHack;
297294

298295
FontCollection& font_collection = UIDartState::Current()
299296
->platform_configuration()

lib/ui/text/paragraph_builder.h

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -30,8 +30,7 @@ class ParagraphBuilder : public RefCountedDartWrappable<ParagraphBuilder> {
3030
double fontSize,
3131
double height,
3232
const std::u16string& ellipsis,
33-
const std::string& locale,
34-
bool applyRoundingHack);
33+
const std::string& locale);
3534

3635
~ParagraphBuilder() override;
3736

@@ -77,8 +76,7 @@ class ParagraphBuilder : public RefCountedDartWrappable<ParagraphBuilder> {
7776
double fontSize,
7877
double height,
7978
const std::u16string& ellipsis,
80-
const std::string& locale,
81-
bool applyRoundingHack);
79+
const std::string& locale);
8280

8381
std::unique_ptr<txt::ParagraphBuilder> m_paragraph_builder_;
8482
};

lib/web_ui/lib/src/engine/canvaskit/renderer.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -374,7 +374,7 @@ class CanvasKitRenderer implements Renderer {
374374
strutStyle: strutStyle,
375375
ellipsis: ellipsis,
376376
locale: locale,
377-
applyRoundingHack: !ui.ParagraphBuilder.shouldDisableRoundingHack,
377+
applyRoundingHack: false,
378378
);
379379

380380
@override

lib/web_ui/lib/src/engine/canvaskit/text.dart

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,6 @@ class CkParagraphStyle implements ui.ParagraphStyle {
3333
ui.StrutStyle? strutStyle,
3434
String? ellipsis,
3535
ui.Locale? locale,
36-
bool applyRoundingHack = true,
3736
}) : skParagraphStyle = toSkParagraphStyle(
3837
textAlign,
3938
textDirection,
@@ -47,7 +46,6 @@ class CkParagraphStyle implements ui.ParagraphStyle {
4746
strutStyle,
4847
ellipsis,
4948
locale,
50-
applyRoundingHack,
5149
),
5250
_textAlign = textAlign,
5351
_textDirection = textDirection,
@@ -163,7 +161,6 @@ class CkParagraphStyle implements ui.ParagraphStyle {
163161
ui.StrutStyle? strutStyle,
164162
String? ellipsis,
165163
ui.Locale? locale,
166-
bool applyRoundingHack,
167164
) {
168165
final SkParagraphStyleProperties properties = SkParagraphStyleProperties();
169166

@@ -200,7 +197,7 @@ class CkParagraphStyle implements ui.ParagraphStyle {
200197
properties.replaceTabCharacters = true;
201198
properties.textStyle = toSkTextStyleProperties(
202199
fontFamily, fontSize, height, fontWeight, fontStyle);
203-
properties.applyRoundingHack = applyRoundingHack;
200+
properties.applyRoundingHack = false;
204201

205202
return canvasKit.ParagraphStyle(properties);
206203
}

lib/web_ui/lib/src/engine/text/canvas_paragraph.dart

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -94,10 +94,6 @@ class CanvasParagraph implements ui.Paragraph {
9494
// `30.5` then the TextPainter in the framework will ceil the `30.5` width
9595
// which will result in a width of `40.0` that's higher than the constraint
9696
// width.
97-
if (!ui.ParagraphBuilder.shouldDisableRoundingHack) {
98-
constraints = ui.ParagraphConstraints(width: constraints.width.floorToDouble());
99-
}
100-
10197
if (constraints == _lastUsedConstraints) {
10298
return;
10399
}

0 commit comments

Comments
 (0)