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

[Proposal] Improve Canvas Documentation#30069

Merged
chinmaygarde merged 3 commits intoflutter:mainfrom
MasahideMori-SimpleAppli:proposal-93190
Dec 2, 2021
Merged

[Proposal] Improve Canvas Documentation#30069
chinmaygarde merged 3 commits intoflutter:mainfrom
MasahideMori-SimpleAppli:proposal-93190

Conversation

@MasahideMori-SimpleAppli
Copy link
Contributor

The following suggestions. For clarity, the text has been improved over when it was suggested.
flutter/flutter#93190

  • Added description about paint parameter of Canvas.drawVertice method.
  • Added description of Vertices-class constructor parameters.

I'm not a native English speaker, so I'm sorry if it's strange English.
If there is a mistake in the English grammar I wrote, it is difficult for me to correct it.

Pre-launch Checklist

  • I read the Contributor Guide and followed the process outlined there for submitting PRs.
  • I read the Tree Hygiene wiki page, which explains my responsibilities.
  • I read and followed the Flutter Style Guide and the C++, Objective-C, Java style guides.
  • I listed at least one issue that this PR fixes in the description above.
  • I added new tests to check the change I am making or feature I am adding, or Hixie said the PR is test-exempt. See testing the engine for instructions on
    writing and running engine tests.
  • I updated/added relevant documentation (doc comments with ///).
  • I signed the CLA.
  • All existing and new tests are passing.

If you need help, consider asking for advice on the #hackers-new channel on Discord.

The following suggestions.
flutter/flutter#93190
For clarity, the text has been improved over when it was suggested.
@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.

If you are not sure if you need tests, consider this rule of thumb: the purpose of a test is to make sure someone doesn't accidentally revert the fix. Ask yourself, is there anything in your PR that you feel it is important we not accidentally revert back to how it was before your fix?

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

@flar
Copy link
Contributor

flar commented Jan 25, 2022

There are 2 constructors for Vertices, the second one Vertices.raw was left unmodified leading to similar issues as before if developers are targeting the typed list version of the constructor. @MasahideMori-SimpleAppli

@MasahideMori-SimpleAppli
Copy link
Contributor Author

Hi @flar,
I just checked about Vertices.raw documentation. Indeed, the documentation seems to have room for improvement.
However, I've never used that constructor, so I don't know how it works. If I have time, I'll dig into it and make new fixes.
Thank you.

@flar
Copy link
Contributor

flar commented Jan 26, 2022

@MasahideMori-SimpleAppli it's the same data, just packed into a few raw typed data lists that can be shared directly with the native implementation. the constructor you documented simply converts its Dart lists into typed arrays before it calls to the native init method whereas the raw constructor can dive directly into the native init.

It's easier for developers to work with dart List objects of flutter classes then the typed lists of basic numerical values, but the latter is faster for getting the data down to C++ for handing off to Skia.

@MasahideMori-SimpleAppli
Copy link
Contributor Author

Hi @flar,
Thank you for the detailed information on the constructor.
I understand. Thank you for teaching me!

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants