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

[CP] Use PorterDuff blend mode when below Android 29 #108136

Closed
bparrishMines opened this issue Jul 21, 2022 · 8 comments
Closed

[CP] Use PorterDuff blend mode when below Android 29 #108136

bparrishMines opened this issue Jul 21, 2022 · 8 comments
Labels
cp: approved Approved cherry-pick request

Comments

@bparrishMines
Copy link
Contributor

issue_link

#104686

Commit Hash

092481d

Target

beta

pr_link

#108135

Impacted Users

Customers and plugins using Android Platform Views

Impact Description

On Android versions below 29, platform views struggle to render when the background is transparent:
something

Workaround

Any plugin or app that uses platform views could switch to Hybrid Composition when the background is made transparent.

Risk

low

Test Coverage

yes

Validation Steps

  1. Build a custom engine that changes:

https://github.com/flutter/engine/blob/main/shell/platform/android/io/flutter/plugin/platform/PlatformViewWrapper.java#L172

canvas.drawColor(Color.TRANSPARENT, PorterDuff.Mode.CLEAR);

to

canvas.drawColor(Color.TRANSPARENT);
  1. Create a Flutter app with webview_flutter. The example app from the plugin also works: webview_flutter example app

  2. Set the background to transparent: https://github.com/flutter/plugins/blob/main/packages/webview_flutter/webview_flutter_android/example/lib/main.dart#L137

  3. Create and start an Android emulator as Nexus 4 API 28.

  4. Run the app and navigate through any webpage.

  5. Compare the result to adding the PorterDuff.Mode.CLEAR parameter in step 1.

@bparrishMines bparrishMines added the cp: review Cherry-picks in the review queue label Jul 21, 2022
@bparrishMines
Copy link
Contributor Author

cc @stuartmorgan

@itsjustkevin
Copy link
Contributor

Thanks @bparrishMines! As soon as approval from @stuartmorgan comes in, I will push this to the release queue for the next beta hotfix.

@stuartmorgan
Copy link
Contributor

I approve flutter/engine#34800 for cherry picking to the beta branch!

I'm assuming we do that by cherry-picking that PR's engine commit and then rolling the beta branch's engine to that new engine commit though. The links above are to the master engine roll, which would give us not the specific engine PR, but everything that's landed in the engine's main since the branch point.

@itsjustkevin
Copy link
Contributor

Correct @stuartmorgan, I think the commit @bparrishMines was looking for is 7025645 at flutter/engine#34800.

Is this the correct commit you'd like to cherry-pick into the next beta hotfix?

@itsjustkevin itsjustkevin added cp: approved Approved cherry-pick request and removed cp: review Cherry-picks in the review queue labels Jul 25, 2022
@bparrishMines
Copy link
Contributor Author

@itsjustkevin Yes, that's the commit. I created: #108338. Let me know if this is what you were looking for.

@itsjustkevin
Copy link
Contributor

Thanks @bparrishMines, monitoring the cherry-pick.

@godofredoc
Copy link
Contributor

CP has landed in the release candidate branch.

@github-actions
Copy link

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 Aug 16, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
cp: approved Approved cherry-pick request
Projects
None yet
Development

No branches or pull requests

4 participants