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

Conversation

@mdebbar
Copy link
Contributor

@mdebbar mdebbar commented Oct 30, 2020

Description

Move the painting logic to the Paragraph class since it knows best about its internal structure and how to use that to paint on a canvas. This also opens up the way for having multiple Paragraph implementations that paint themselves differently without requiring BitmapCanvas to know anything about them.

The same idea is applied to the generation of the DOM paragraph element. New Paragraph implementations won't construct the DOM element eagerly, but lazily on demand.

Related Issues

flutter/flutter#55587

Tests

This change is a pure refactoring that shouldn't affect anything. Relying on existing tests to make sure there's no regressions.

@mdebbar mdebbar added the platform-web Code specifically for the web engine label Oct 30, 2020
@mdebbar mdebbar requested a review from ferhatb October 30, 2020 22:50
@flutter-dashboard
Copy link

It looks like this pull request may not have tests. Please make sure to add tests before merging. If you need an exemption to this rule, contact Hixie on the #hackers channel in Chat.

Reviewers: Read the Tree Hygiene page and make sure this patch meets those guidelines before LGTMing.


final _CanvasPool _canvasPool;

html.CanvasRenderingContext2D get context => _canvasPool.context;
Copy link
Contributor

@ferhatb ferhatb Nov 3, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you please expose a fillText() api instead. I want to make sure Context2D doesn't leak out and gets extra uses.

@mdebbar mdebbar requested a review from ferhatb November 3, 2020 23:00
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

cla: yes platform-web Code specifically for the web engine

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants