Skip to content
This repository was archived by the owner on Feb 25, 2025. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 0 additions & 6 deletions lib/web_ui/lib/src/engine/dom_renderer.dart
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@ import 'keyboard_binding.dart';
import 'platform_dispatcher.dart';
import 'pointer_binding.dart';
import 'semantics.dart';
import 'text/measurement.dart';
import 'text_editing/text_editing.dart';
import 'util.dart';
import 'window.dart';
Expand All @@ -29,11 +28,6 @@ class DomRenderer {

reset();

TextMeasurementService.initialize(
rulerCacheCapacity: 10,
root: _glassPaneShadow!.node,
);

assert(() {
_setupHotRestart();
return true;
Expand Down
10 changes: 6 additions & 4 deletions lib/web_ui/lib/src/engine/text/canvas_paragraph.dart
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,13 @@ import 'paint_service.dart';
import 'paragraph.dart';
import 'word_breaker.dart';

const ui.Color _defaultTextColor = ui.Color(0xFFFF0000);

/// A paragraph made up of a flat list of text spans and placeholders.
///
/// As opposed to [DomParagraph], a [CanvasParagraph] doesn't use a DOM element
/// to represent the structure of its spans and styles. Instead it uses a flat
/// list of [ParagraphSpan] objects.
/// [CanvasParagraph] doesn't use a DOM element to represent the structure of
/// its spans and styles. Instead it uses a flat list of [ParagraphSpan]
/// objects.
class CanvasParagraph implements EngineParagraph {
/// This class is created by the engine, and should not be instantiated
/// or extended directly.
Expand Down Expand Up @@ -574,7 +576,7 @@ class RootStyleNode extends StyleNode {
final EngineParagraphStyle paragraphStyle;

@override
final ui.Color _color = defaultTextColor;
final ui.Color _color = _defaultTextColor;

@override
ui.TextDecoration? get _decoration => null;
Expand Down
2 changes: 0 additions & 2 deletions lib/web_ui/lib/src/engine/text/font_collection.dart
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ import '../assets.dart';
import '../browser_detection.dart';
import '../util.dart';
import 'layout_service.dart';
import 'measurement.dart';

const String ahemFontFamily = 'Ahem';
const String ahemFontUrl = 'packages/ui/assets/ahem.ttf';
Expand Down Expand Up @@ -215,7 +214,6 @@ class FontManager {
// There might be paragraph measurements for this new font before it is
// loaded. They were measured using fallback font, so we should clear the
// cache.
TextMeasurementService.clearCache();
Spanometer.clearRulersCache();
}, onError: (dynamic exception) {
// Failures here will throw an html.DomException which confusingly
Expand Down
Loading