Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Drawing large images on iOS with colorspace transformations is slow. #16454

Closed
chinmaygarde opened this issue Apr 11, 2018 · 3 comments
Closed
Labels
dependency: skia Skia team may need to help us platform-android Android applications specifically platform-ios iOS applications specifically

Comments

@chinmaygarde
Copy link
Member

On iOS, attempting to draw a very large image using a SkCanvas::drawImageRect call is extremely slow (400ms as shown in this trace for this reduced test case). The same call on Android is adequately fast.

Investigation shows that an attempted colorspace conversion on iOS is extremely slow. This conversion happens as part of the SkColorSpaceXformCanvas::onDrawImageRect call. This call performs work to prepare an intermediate image which seems to incur a per frame texture copy initiated at this site. Preparing this new image is slow (taking 220ms of the 400ms slice) but is also followed by more writes to a buffer followed by a texture upload. This seems to happen per frame which exacerbates the issue.

Note: A possible complicating factor could be that the source image is from a GrContext that is not the same as the rendering GrContext (but it is in the same underlying sharegroup). It is possible that the intermediate preparatory step does not result in caching as expected on iOS.

screen shot 2018-04-10 at 5 35 53 pm

@chinmaygarde chinmaygarde added platform-ios iOS applications specifically dependency: skia Skia team may need to help us labels Apr 11, 2018
@eseidelGoogle eseidelGoogle added the c: regression It was better in the past than it is now label Apr 11, 2018
@chinmaygarde
Copy link
Member Author

The updated API has landed in https://skia-review.googlesource.com/#/c/121342/. Once this gets rolled in, we should clamp IO textures to max supported size.

@chinmaygarde
Copy link
Member Author

@eseidelGoogle I am removing the regression tag as we always had this issue.

@chinmaygarde chinmaygarde added platform-android Android applications specifically and removed c: regression It was better in the past than it is now labels Apr 13, 2018
@github-actions
Copy link

github-actions bot commented Sep 3, 2021

This thread has been automatically locked since there has not been any recent activity after it was closed. If you are still experiencing a similar issue, please open a new bug, including the output of flutter doctor -v and a minimal reproduction of the issue.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Sep 3, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
dependency: skia Skia team may need to help us platform-android Android applications specifically platform-ios iOS applications specifically
Projects
None yet
Development

No branches or pull requests

2 participants