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

Conversation

@cg021
Copy link
Contributor

@cg021 cg021 commented Jun 6, 2020

Description

Add JNI method createOverlaySurface for hybrid composition in the engine.

Related Issues

flutter/flutter#58288

Tests

I added the following tests:

createOverlaySurface__callsPlatformViewsController

Checklist

Before you create this PR confirm that it meets all requirements listed below by checking the relevant checkboxes ([x]). This will ensure a smooth and quick review process.

  • I read the contributor guide and followed the process outlined there for submitting PRs.
  • I signed the CLA.
  • I read and followed the C++, Objective-C, Java style guides for the engine.
  • I read the tree hygiene wiki page, which explains my responsibilities.
  • I updated/added relevant documentation.
  • All existing and new tests are passing.
  • I am willing to follow-up on review comments in a timely manner.

Breaking Change

Did any tests fail when you ran them? Please read handling breaking changes.

@auto-assign auto-assign bot requested a review from gw280 June 6, 2020 21:34
@cg021 cg021 removed the request for review from gw280 June 6, 2020 21:41
@cg021 cg021 force-pushed the jni_create branch 7 times, most recently from 7d7e795 to d95bb0e Compare June 7, 2020 04:36
@cg021 cg021 requested a review from blasten June 7, 2020 05:38
ORIGIN: ../../../flutter/LICENSE
TYPE: LicenseType.bsd
FILE: ../../../flutter/.clang-tidy
FILE: ../../../flutter/.gradle/6.5/fileChanges/last-build.bin
Copy link

Choose a reason for hiding this comment

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

why do we need these .gradle/** files? I think they can be reverted in case you didn't intend to commit them.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@blasten The format_and_dart_test failed and said that licenses_flutter needed that file added on line 14.

Collecting licenses for fuchsia
    Skipping this component - no change in signature
Collecting licenses for gpu
    Skipping this component - no change in signature
Collecting licenses for third_party
    Skipping this component - no change in signature
Collecting licenses for skia
    Skipping this component - no change in signature
============================= ERROR =============================
License script got different results than expected for out/license_script_output/licenses_flutter.
Please rerun the licenses script locally to verify that it is
correctly catching any new licenses for anything you may have
changed, and then update this file:
  flutter/sky/packages/sky_engine/LICENSE
For more information, see the script in:
  https://github.com/flutter/engine/tree/master/tools/licenses

Comment on lines 10 to 13
private final Surface surface;
private final long id;
Copy link

@blasten blasten Jun 11, 2020

Choose a reason for hiding this comment

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

surface needs the @NonNull annotation since it cannot be null.

private final Surface surface;
private final long id;

public FlutterOverlaySurface(long id, Surface surface) {
Copy link

Choose a reason for hiding this comment

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

Same comment about the annotation public FlutterOverlaySurface(long id, @NonNull Surface surface). id doesn't need one because it's a primitive type.


import android.view.Surface;

public class FlutterOverlaySurface {
Copy link

Choose a reason for hiding this comment

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

This class needs the @Keep annotation. This is because the C++ code will do lookup by method/class name. As a result, these names cannot change, but tools like Proguard or R8 make classes and methods names shorter to reduce code size.

@blasten
Copy link

blasten commented Jun 11, 2020

There's now a centralized interface called PlatformViewAndroidJNI. For example, it has the FlutterViewDisplayOverlaySurface you added:

virtual void FlutterViewDisplayOverlaySurface(int surface_id,
int x,
int y,
int width,
int height) = 0;

You would need to fix the conflicts and move the jni function to this interface.

@cg021 cg021 force-pushed the jni_create branch 4 times, most recently from 5da230b to fac302b Compare June 13, 2020 00:05
@googlebot
Copy link

All (the pull request submitter and all commit authors) CLAs are signed, but one or more commits were authored or co-authored by someone other than the pull request submitter.

We need to confirm that all authors are ok with their commits being contributed to this project. Please have them confirm that by leaving a comment that contains only @googlebot I consent. in this pull request.

Note to project maintainer: There may be cases where the author cannot leave a comment, or the comment is not properly detected as consent. In those cases, you can manually confirm consent of the commit author(s), and set the cla label to yes (if enabled on your project).

ℹ️ Googlers: Go here for more info.

1 similar comment
@googlebot
Copy link

All (the pull request submitter and all commit authors) CLAs are signed, but one or more commits were authored or co-authored by someone other than the pull request submitter.

We need to confirm that all authors are ok with their commits being contributed to this project. Please have them confirm that by leaving a comment that contains only @googlebot I consent. in this pull request.

Note to project maintainer: There may be cases where the author cannot leave a comment, or the comment is not properly detected as consent. In those cases, you can manually confirm consent of the commit author(s), and set the cla label to yes (if enabled on your project).

ℹ️ Googlers: Go here for more info.

@googlebot
Copy link

CLAs look good, thanks!

ℹ️ Googlers: Go here for more info.

1 similar comment
@googlebot
Copy link

CLAs look good, thanks!

ℹ️ Googlers: Go here for more info.

@googlebot googlebot removed the cla: no label Jun 15, 2020
@cg021
Copy link
Contributor Author

cg021 commented Jun 15, 2020

Moved to #19040

@cg021 cg021 closed this Jun 15, 2020
@cg021 cg021 deleted the jni_create branch June 16, 2020 02:53
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.

4 participants