This repository was archived by the owner on Feb 25, 2025. It is now read-only.
Implement basic Picture.toImage via BitmapCanvas#13391
Merged
yjbanov merged 2 commits intoflutter:masterfrom Oct 28, 2019
Merged
Implement basic Picture.toImage via BitmapCanvas#13391yjbanov merged 2 commits intoflutter:masterfrom
yjbanov merged 2 commits intoflutter:masterfrom
Conversation
| /// rasterized the first time the image is drawn and then cached. | ||
| Future<Image> toImage(int width, int height) => null; | ||
| Future<Image> toImage(int width, int height) async { | ||
| final engine.BitmapCanvas canvas = engine.BitmapCanvas(Rect.fromLTRB(0, 0, width.toDouble(), height.toDouble())); |
Contributor
There was a problem hiding this comment.
Is this supposed to return the full contents of the canvas, resized to width x height? Or is it supposed to clip the canvas contents? It looks like this may clip the canvas contents since the BitmapCanvas you create may not be big enough to hold the contents of the recording canvas.
Contributor
There was a problem hiding this comment.
Spoke offline. It seems like width and height are supposed to be the bounds of the canvas that the picture is drawn into.
Contributor
Author
There was a problem hiding this comment.
It will clip. I updated the docs.
harryterkelsen
approved these changes
Oct 28, 2019
liyuqian
approved these changes
Oct 28, 2019
engine-flutter-autoroll
added a commit
to engine-flutter-autoroll/flutter
that referenced
this pull request
Oct 28, 2019
engine-flutter-autoroll
added a commit
to engine-flutter-autoroll/flutter
that referenced
this pull request
Oct 28, 2019
engine-flutter-autoroll
added a commit
to flutter/flutter
that referenced
this pull request
Oct 29, 2019
[email protected]:flutter/engine.git/compare/c3b63d610b07...49971e2 git log c3b63d6..49971e2 --no-merges --oneline 2019-10-28 [email protected] Implement basic Picture.toImage via BitmapCanvas (flutter/engine#13391) 2019-10-28 [email protected] Switch the MacOS Desktop embedder to using a thread configuration where the platform and render task runners are the same. (flutter/engine#13300) 2019-10-28 [email protected] Roll src/third_party/skia 18f5b1a6dd77..1beb8ae9a2f5 (9 commits) (flutter/engine#13392) If this roll has caused a breakage, revert this CL and stop the roller using the controls here: https://autoroll.skia.org/r/flutter-engine-flutter-autoroll Please CC [email protected] on the revert to ensure that a human is aware of the problem. To report a problem with the AutoRoller itself, please file a bug: https://bugs.chromium.org/p/skia/issues/entry?template=Autoroller+Bug Documentation for the AutoRoller is here: https://skia.googlesource.com/buildbot/+/master/autoroll/README.md
Inconnu08
pushed a commit
to Inconnu08/flutter
that referenced
this pull request
Nov 26, 2019
[email protected]:flutter/engine.git/compare/c3b63d610b07...49971e2 git log c3b63d6..49971e2 --no-merges --oneline 2019-10-28 [email protected] Implement basic Picture.toImage via BitmapCanvas (flutter/engine#13391) 2019-10-28 [email protected] Switch the MacOS Desktop embedder to using a thread configuration where the platform and render task runners are the same. (flutter/engine#13300) 2019-10-28 [email protected] Roll src/third_party/skia 18f5b1a6dd77..1beb8ae9a2f5 (9 commits) (flutter/engine#13392) If this roll has caused a breakage, revert this CL and stop the roller using the controls here: https://autoroll.skia.org/r/flutter-engine-flutter-autoroll Please CC [email protected] on the revert to ensure that a human is aware of the problem. To report a problem with the AutoRoller itself, please file a bug: https://bugs.chromium.org/p/skia/issues/entry?template=Autoroller+Bug Documentation for the AutoRoller is here: https://skia.googlesource.com/buildbot/+/master/autoroll/README.md
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Even though this may not be terribly useful in real apps (at least until we learn to render all text on
BitmapCanvas) it is useful in some framework unit-tests.