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

Remove unnecessary saveLayer - #5420

Merged
liyuqian merged 1 commit into
flutter-team-archive:masterfrom
liyuqian:nosavelayer
May 30, 2018
Merged

liyuqian merged 1 commit into
flutter-team-archive:masterfrom
liyuqian:nosavelayer

Conversation

@liyuqian

Copy link
Copy Markdown
Contributor

saveLayer is slow so we should avoid it as much as possible. If
there are artifacts without saveLayer, then we should report that
to Skia for the fix instead of slowing the performance with
saveLayer.

This PQ makes average rasterizer time drop from 25ms to 18ms in
flutter_gallery transitions perf test on a Nexus 5X.

This partially fixes flutter/flutter#13736 .
We probably still need some work in the opacity layer to squize
all the performance improvements.

saveLayer is slow so we should avoid it as much as possible. If
there are artifacts without saveLayer, then we should report that
to Skia for the fix instead of slowing the performance with
saveLayer.

This PQ makes average rasterizer time drop from 25ms to 18ms in
flutter_gallery transitions perf test on a Nexus 5X.
@liyuqian

Copy link
Copy Markdown
Contributor Author

CC @tvolkert @Hixie @xster

@chinmaygarde chinmaygarde left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Nit: Typo in commit message.

@liyuqian liyuqian changed the title Remov unnecessary saveLayer Remove unnecessary saveLayer May 30, 2018
@liyuqian
liyuqian merged commit d174c4f into flutter-team-archive:master May 30, 2018
@xster

xster commented May 30, 2018

Copy link
Copy Markdown
Contributor

Awesome! Looking forward to the benchmark of the next roll.

FXL_DCHECK(needs_painting());

Layer::AutoSaveLayer save(context, paint_bounds(), nullptr);
SkAutoCanvasRestore save(&context.canvas, true);

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

@Hixie

Hixie commented May 31, 2018

Copy link
Copy Markdown
Contributor

There will definitely be artifacts. For example, if a clip region contains a red rectangle with a white rectangle on top of it, then at the edge of the clip region, this will result in red-tinted pixels, but they should be white.

@Hixie

Hixie commented May 31, 2018

Copy link
Copy Markdown
Contributor

Interestingly, I just tried this on the beta channel and I get the red outlines already, so while I don't think this PR is correct, it seems something else had already broken this before.

@Hixie

Hixie commented May 31, 2018

Copy link
Copy Markdown
Contributor

Filed flutter/flutter#18057 to track this. I marked in "regression" because I'm sure this used to work.

najeira pushed a commit to najeira/flutter-engine that referenced this pull request Jun 5, 2018
saveLayer is slow so we should avoid it as much as possible. If
there are artifacts without saveLayer, then we should report that
to Skia for the fix instead of slowing the performance with
saveLayer.

This PQ makes average rasterizer time drop from 25ms to 18ms in
flutter_gallery transitions perf test on a Nexus 5X.

This partially fixes flutter/flutter#13736 .
We probably still need some work in the opacity layer to squize
all the performance improvements.
liyuqian added a commit to liyuqian/flutter that referenced this pull request Jun 20, 2018
This is a follow up on flutter-team-archive/engine#5420
and flutter#18057

As you can see from the diff, we also mistakenly saveLayer before
the clip at some places previously.
liyuqian added a commit to flutter/flutter that referenced this pull request Jun 21, 2018
This is a follow up on flutter-team-archive/engine#5420
and #18057

As you can see from the diff, we also mistakenly saveLayer before
the clip at some places previously.
najeira pushed a commit to najeira/flutter-engine that referenced this pull request Jul 19, 2018
saveLayer is slow so we should avoid it as much as possible. If
there are artifacts without saveLayer, then we should report that
to Skia for the fix instead of slowing the performance with
saveLayer.

This PQ makes average rasterizer time drop from 25ms to 18ms in
flutter_gallery transitions perf test on a Nexus 5X.

This partially fixes flutter/flutter#13736 .
We probably still need some work in the opacity layer to squize
all the performance improvements.
@liyuqian
liyuqian deleted the nosavelayer branch September 12, 2018 22:17
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

Development

Successfully merging this pull request may close these issues.

Material page transition is slow when we enable fade

5 participants