This repository was archived by the owner on Feb 25, 2025. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 6k
createOverlaySurface JNI #18870
Closed
Closed
createOverlaySurface JNI #18870
Changes from all commits
Commits
Show all changes
3 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
Binary file not shown.
Empty file.
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,2 @@ | ||
| #Fri Jun 05 11:53:05 CDT 2020 | ||
| gradle.version=6.5 |
Empty file.
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
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
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
28 changes: 28 additions & 0 deletions
28
shell/platform/android/io/flutter/embedding/engine/FlutterOverlaySurface.java
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,28 @@ | ||
| // Copyright 2013 The Flutter Authors. All rights reserved. | ||
| // Use of this source code is governed by a BSD-style license that can be | ||
| // found in the LICENSE file. | ||
|
|
||
| package io.flutter.embedding.engine; | ||
|
|
||
| import android.view.Surface; | ||
|
|
||
| public class FlutterOverlaySurface { | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This class needs the |
||
| // @NonNull | ||
| private final Surface surface; | ||
|
|
||
| private final long id; | ||
|
|
||
| // @Keep | ||
| public FlutterOverlaySurface(long id, Surface surface) { | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Same comment about the annotation |
||
| this.id = id; | ||
| this.surface = surface; | ||
| } | ||
|
|
||
| public long getId() { | ||
| return id; | ||
| } | ||
|
|
||
| public Surface getSurface() { | ||
| return surface; | ||
| } | ||
| } | ||
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
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
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,69 @@ | ||
| // Copyright 2013 The Flutter Authors. All rights reserved. | ||
| // Use of this source code is governed by a BSD-style license that can be | ||
| // found in the LICENSE file. | ||
|
|
||
| #ifndef FLUTTER_SHELL_PLATFORM_ANDROID_PLATFORM_VIEW_ANDROID_JNI_H_ | ||
| #define FLUTTER_SHELL_PLATFORM_ANDROID_PLATFORM_VIEW_ANDROID_JNI_H_ | ||
|
|
||
| #include <jni.h> | ||
| #include "flutter/fml/macros.h" | ||
| #include "flutter/shell/platform/android/platform_view_android.h" | ||
|
|
||
| namespace flutter { | ||
|
|
||
| void FlutterViewHandlePlatformMessage(JNIEnv* env, | ||
| jobject obj, | ||
| jstring channel, | ||
| jobject message, | ||
| jint responseId); | ||
|
|
||
| void FlutterViewHandlePlatformMessageResponse(JNIEnv* env, | ||
| jobject obj, | ||
| jint responseId, | ||
| jobject response); | ||
|
|
||
| void FlutterViewUpdateSemantics(JNIEnv* env, | ||
| jobject obj, | ||
| jobject buffer, | ||
| jobjectArray strings); | ||
|
|
||
| void FlutterViewUpdateCustomAccessibilityActions(JNIEnv* env, | ||
| jobject obj, | ||
| jobject buffer, | ||
| jobjectArray strings); | ||
|
|
||
| void FlutterViewOnFirstFrame(JNIEnv* env, jobject obj); | ||
|
|
||
| void FlutterViewOnPreEngineRestart(JNIEnv* env, jobject obj); | ||
|
|
||
| class AndroidFlutterOverlaySurface { | ||
| public: | ||
| AndroidFlutterOverlaySurface(long id, fml::RefPtr<AndroidNativeWindow> window) | ||
| : id_(id), window_(std::move(window)){}; | ||
|
|
||
| long GetId() { return id_; } | ||
|
|
||
| fml::RefPtr<AndroidNativeWindow> GetWindow() { return window_; } | ||
|
|
||
| private: | ||
| long id_; | ||
| fml::RefPtr<AndroidNativeWindow> window_; | ||
| }; | ||
|
|
||
| std::unique_ptr<AndroidFlutterOverlaySurface> FlutterViewCreateOverlaySurface( | ||
| JNIEnv* env, | ||
| jobject obj); | ||
|
|
||
| void SurfaceTextureAttachToGLContext(JNIEnv* env, jobject obj, jint textureId); | ||
|
|
||
| void SurfaceTextureUpdateTexImage(JNIEnv* env, jobject obj); | ||
|
|
||
| void SurfaceTextureGetTransformMatrix(JNIEnv* env, | ||
| jobject obj, | ||
| jfloatArray result); | ||
|
|
||
| void SurfaceTextureDetachFromGLContext(JNIEnv* env, jobject obj); | ||
|
|
||
| } // namespace flutter | ||
|
|
||
| #endif // FLUTTER_SHELL_PLATFORM_ANDROID_PLATFORM_VIEW_ANDROID_JNI_H_ |
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
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
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
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.
There was a problem hiding this comment.
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.There was a problem hiding this comment.
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_testfailed and said thatlicenses_flutterneeded that file added on line 14.