• LongCatIsLooong's avatar
    Use a separate `TextPainter` for intrinsics calculation in `RenderEditable`... · cc017017
    LongCatIsLooong authored
    Use a separate `TextPainter` for intrinsics calculation in `RenderEditable` and `RenderParagraph` (#144577)
    
    Use a dedicated `TextPainter` for intrinsic size calculation in `RenderEditable` and `RenderParagraph`.
    
    This is an implementation detail so the change should be covered by existing tests.  Performance wise this shouldn't be significantly slower since SkParagraph [caches the result of slower operations across different paragraphs](https://github.com/google/skia/blob/9c62e7b382cf387195ef82895530c97ccceda690/modules/skparagraph/src/ParagraphCache.cpp#L254-L272). Existing benchmarks should be able to catch potential regressions (??).
    
    The reason for making this change is to make sure that intrinsic size computations don't destroy text layout artifacts, so I can expose the text layout as a stream of immutable `TextLayout` objects, to signify other render objects that text-layout-dependent-cache (such as caches for `getBoxesForRange` which can be relatively slow to compute) should be invalidated and  `markNeedsPaint` needs to be called if the painting logic depended on text layout.
    Without this change, the intrinsics/dry layout calculations will add additional events to the text layout stream, which violates the "dry"/non-destructive contract.
    cc017017
Name
Last commit
Last update
..
animated_size.dart Loading commit data...
binding.dart Loading commit data...
box.dart Loading commit data...
custom_layout.dart Loading commit data...
custom_paint.dart Loading commit data...
debug.dart Loading commit data...
debug_overflow_indicator.dart Loading commit data...
decorated_sliver.dart Loading commit data...
editable.dart Loading commit data...
error.dart Loading commit data...
flex.dart Loading commit data...
flow.dart Loading commit data...
image.dart Loading commit data...
layer.dart Loading commit data...
layout_helper.dart Loading commit data...
list_body.dart Loading commit data...
list_wheel_viewport.dart Loading commit data...
mouse_tracker.dart Loading commit data...
object.dart Loading commit data...
paragraph.dart Loading commit data...
performance_overlay.dart Loading commit data...
platform_view.dart Loading commit data...
proxy_box.dart Loading commit data...
proxy_sliver.dart Loading commit data...
rotated_box.dart Loading commit data...
selection.dart Loading commit data...
service_extensions.dart Loading commit data...
shifted_box.dart Loading commit data...
sliver.dart Loading commit data...
sliver_fill.dart Loading commit data...
sliver_fixed_extent_list.dart Loading commit data...
sliver_grid.dart Loading commit data...
sliver_group.dart Loading commit data...
sliver_list.dart Loading commit data...
sliver_multi_box_adaptor.dart Loading commit data...
sliver_padding.dart Loading commit data...
sliver_persistent_header.dart Loading commit data...
stack.dart Loading commit data...
table.dart Loading commit data...
table_border.dart Loading commit data...
texture.dart Loading commit data...
tweens.dart Loading commit data...
view.dart Loading commit data...
viewport.dart Loading commit data...
viewport_offset.dart Loading commit data...
wrap.dart Loading commit data...