Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
sxychenjing
engine
提交
fdc457d3
E
engine
项目概览
sxychenjing
/
engine
与 Fork 源项目一致
从无法访问的项目Fork
通知
3
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
E
engine
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
未验证
提交
fdc457d3
编写于
6月 04, 2020
作者:
E
Emmanuel Garcia
提交者:
GitHub
6月 04, 2020
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Revert "onDisplayPlatformView JNI (#18786)" (#18826)
This reverts commit
c8ab763f
.
上级
c8ab763f
变更
6
隐藏空白更改
内联
并排
Showing
6 changed file
with
0 addition
and
75 deletion
+0
-75
shell/platform/android/io/flutter/embedding/engine/FlutterEngine.java
...rm/android/io/flutter/embedding/engine/FlutterEngine.java
+0
-5
shell/platform/android/io/flutter/embedding/engine/FlutterJNI.java
...tform/android/io/flutter/embedding/engine/FlutterJNI.java
+0
-19
shell/platform/android/io/flutter/plugin/platform/PlatformViewsController.java
...d/io/flutter/plugin/platform/PlatformViewsController.java
+0
-4
shell/platform/android/platform_view_android_jni.cc
shell/platform/android/platform_view_android_jni.cc
+0
-21
shell/platform/android/platform_view_android_jni.h
shell/platform/android/platform_view_android_jni.h
+0
-8
shell/platform/android/test/io/flutter/embedding/engine/FlutterJNITest.java
...roid/test/io/flutter/embedding/engine/FlutterJNITest.java
+0
-18
未找到文件。
shell/platform/android/io/flutter/embedding/engine/FlutterEngine.java
浏览文件 @
fdc457d3
...
...
@@ -103,10 +103,6 @@ public class FlutterEngine {
platformViewsController
.
onPreEngineRestart
();
}
public
void
onDisplayPlatformView
(
int
viewId
,
int
x
,
int
y
,
int
width
,
int
height
)
{
platformViewsController
.
onDisplayPlatformView
(
viewId
,
x
,
y
,
width
,
height
);
}
};
/**
...
...
@@ -211,7 +207,6 @@ public class FlutterEngine {
flutterLoader
.
ensureInitializationComplete
(
context
,
dartVmArgs
);
flutterJNI
.
addEngineLifecycleListener
(
engineLifecycleListener
);
flutterJNI
.
setPlatformViewsController
(
platformViewsController
);
attachToJni
();
this
.
dartExecutor
=
new
DartExecutor
(
flutterJNI
,
context
.
getAssets
());
...
...
shell/platform/android/io/flutter/embedding/engine/FlutterJNI.java
浏览文件 @
fdc457d3
...
...
@@ -22,7 +22,6 @@ import io.flutter.embedding.engine.dart.PlatformMessageHandler;
import
io.flutter.embedding.engine.renderer.FlutterUiDisplayListener
;
import
io.flutter.embedding.engine.renderer.RenderSurface
;
import
io.flutter.plugin.common.StandardMessageCodec
;
import
io.flutter.plugin.platform.PlatformViewsController
;
import
io.flutter.view.AccessibilityBridge
;
import
io.flutter.view.FlutterCallbackInformation
;
import
java.nio.ByteBuffer
;
...
...
@@ -169,7 +168,6 @@ public class FlutterJNI {
@Nullable
private
Long
nativePlatformViewId
;
@Nullable
private
AccessibilityDelegate
accessibilityDelegate
;
@Nullable
private
PlatformMessageHandler
platformMessageHandler
;
@Nullable
private
PlatformViewsController
platformViewsController
;
@NonNull
private
final
Set
<
EngineLifecycleListener
>
engineLifecycleListeners
=
new
CopyOnWriteArraySet
<>();
...
...
@@ -417,12 +415,6 @@ public class FlutterJNI {
long
nativePlatformViewId
,
@NonNull
ByteBuffer
buffer
,
int
position
);
// ------ End Touch Interaction Support ---
@UiThread
public
void
setPlatformViewsController
(
@NonNull
PlatformViewsController
platformViewsController
)
{
ensureRunningOnMainThread
();
this
.
platformViewsController
=
platformViewsController
;
}
// ------ Start Accessibility Support -----
/**
* Sets the {@link AccessibilityDelegate} for the attached Flutter context.
...
...
@@ -790,17 +782,6 @@ public class FlutterJNI {
}
// ----- End Engine Lifecycle Support ----
// @SuppressWarnings("unused")
@UiThread
public
void
onDisplayPlatformView
(
int
viewId
,
int
x
,
int
y
,
int
width
,
int
height
)
{
ensureRunningOnMainThread
();
if
(
platformViewsController
==
null
)
{
throw
new
RuntimeException
(
"platformViewsController must be set before attempting to position a platform view"
);
}
platformViewsController
.
onDisplayPlatformView
(
viewId
,
x
,
y
,
width
,
height
);
}
// TODO(mattcarroll): determine if this is nonull or nullable
@UiThread
public
Bitmap
getBitmap
()
{
...
...
shell/platform/android/io/flutter/plugin/platform/PlatformViewsController.java
浏览文件 @
fdc457d3
...
...
@@ -533,8 +533,4 @@ public class PlatformViewsController implements PlatformViewsAccessibilityDelega
}
vdControllers
.
clear
();
}
public
void
onDisplayPlatformView
(
int
viewId
,
int
x
,
int
y
,
int
width
,
int
height
)
{
// TODO: Implement this method. https://github.com/flutter/flutter/issues/58288
}
}
shell/platform/android/platform_view_android_jni.cc
浏览文件 @
fdc457d3
...
...
@@ -118,19 +118,6 @@ void FlutterViewOnPreEngineRestart(JNIEnv* env, jobject obj) {
FML_CHECK
(
CheckException
(
env
));
}
static
jmethodID
g_on_display_platform_view_method
=
nullptr
;
void
FlutterViewOnDisplayPlatformView
(
JNIEnv
*
env
,
jobject
obj
,
jint
view_id
,
jint
x
,
jint
y
,
jint
width
,
jint
height
)
{
env
->
CallVoidMethod
(
obj
,
g_on_display_platform_view_method
,
view_id
,
x
,
y
,
width
,
height
);
FML_CHECK
(
CheckException
(
env
));
}
static
jmethodID
g_attach_to_gl_context_method
=
nullptr
;
void
SurfaceTextureAttachToGLContext
(
JNIEnv
*
env
,
jobject
obj
,
jint
textureId
)
{
env
->
CallVoidMethod
(
obj
,
g_attach_to_gl_context_method
,
textureId
);
...
...
@@ -763,14 +750,6 @@ bool PlatformViewAndroid::Register(JNIEnv* env) {
return
false
;
}
g_on_display_platform_view_method
=
env
->
GetMethodID
(
g_flutter_jni_class
->
obj
(),
"onDisplayPlatformView"
,
"(IIIII)V"
);
if
(
g_on_display_platform_view_method
==
nullptr
)
{
FML_LOG
(
ERROR
)
<<
"Could not locate onDisplayPlatformView method"
;
return
false
;
}
g_surface_texture_class
=
new
fml
::
jni
::
ScopedJavaGlobalRef
<
jclass
>
(
env
,
env
->
FindClass
(
"android/graphics/SurfaceTexture"
));
if
(
g_surface_texture_class
->
is_null
())
{
...
...
shell/platform/android/platform_view_android_jni.h
浏览文件 @
fdc457d3
...
...
@@ -36,14 +36,6 @@ void FlutterViewOnFirstFrame(JNIEnv* env, jobject obj);
void
FlutterViewOnPreEngineRestart
(
JNIEnv
*
env
,
jobject
obj
);
void
FlutterViewOnDisplayPlatformView
(
JNIEnv
*
env
,
jobject
obj
,
jint
view_id
,
jint
x
,
jint
y
,
jint
width
,
jint
height
);
void
SurfaceTextureAttachToGLContext
(
JNIEnv
*
env
,
jobject
obj
,
jint
textureId
);
void
SurfaceTextureUpdateTexImage
(
JNIEnv
*
env
,
jobject
obj
);
...
...
shell/platform/android/test/io/flutter/embedding/engine/FlutterJNITest.java
浏览文件 @
fdc457d3
package
io.flutter.embedding.engine
;
import
static
org
.
junit
.
Assert
.
assertEquals
;
import
static
org
.
mockito
.
Mockito
.
verify
;
import
io.flutter.embedding.engine.renderer.FlutterUiDisplayListener
;
import
java.util.concurrent.atomic.AtomicInteger
;
...
...
@@ -45,21 +44,4 @@ public class FlutterJNITest {
// --- Verify Results ---
assertEquals
(
1
,
callbackInvocationCount
.
get
());
}
@Test
public
void
onDisplayPlatformView__callsPlatformViewsController
()
{
PlatformViewsController
platformViewsController
=
mock
(
PlatformViewsController
.
class
);
FlutterJNI
flutterJNI
=
new
FlutterJNI
();
flutterJNI
.
setPlatformViewsController
(
platformViewsController
);
// --- Execute Test ---
flutterJNI
.
onDisplayPlatformView
(
/*viewId=*/
1
,
/*x=*/
10
,
/*y=*/
20
,
/*width=*/
100
,
/*height=*/
200
);
// --- Verify Results ---
verify
(
platformViewsController
,
times
(
1
))
.
onDisplayPlatformView
(
/*viewId=*/
1
,
/*x=*/
10
,
/*y=*/
20
,
/*width=*/
100
,
/*height=*/
200
);
}
}
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录