Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
liujiuri
engine
提交
d9d23336
E
engine
项目概览
liujiuri
/
engine
与 Fork 源项目一致
从无法访问的项目Fork
通知
1
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,发现更多精彩内容 >>
提交
d9d23336
编写于
10月 11, 2016
作者:
J
Jason Simmons
提交者:
GitHub
10月 11, 2016
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Do not attach and detach the EGL context on each frame in the rasterizer thread (#3110)
上级
2dc88cc6
变更
5
隐藏空白更改
内联
并排
Showing
5 changed file
with
25 addition
and
24 deletion
+25
-24
shell/gpu/gpu_surface_gl.cc
shell/gpu/gpu_surface_gl.cc
+0
-11
shell/platform/android/android_context_gl.cc
shell/platform/android/android_context_gl.cc
+2
-0
shell/platform/android/io/flutter/view/FlutterView.java
shell/platform/android/io/flutter/view/FlutterView.java
+7
-4
shell/platform/android/platform_view_android.cc
shell/platform/android/platform_view_android.cc
+14
-7
shell/platform/android/platform_view_android.h
shell/platform/android/platform_view_android.h
+2
-2
未找到文件。
shell/gpu/gpu_surface_gl.cc
浏览文件 @
d9d23336
...
@@ -90,9 +90,6 @@ bool GPUSurfaceGL::Setup() {
...
@@ -90,9 +90,6 @@ bool GPUSurfaceGL::Setup() {
context_
->
setResourceCacheLimits
(
kMaxGaneshResourceCacheCount
,
context_
->
setResourceCacheLimits
(
kMaxGaneshResourceCacheCount
,
kMaxGaneshResourceCacheBytes
);
kMaxGaneshResourceCacheBytes
);
// Clean up the current context.
delegate_
->
GLContextClearCurrent
();
return
true
;
return
true
;
}
}
...
@@ -111,10 +108,6 @@ std::unique_ptr<SurfaceFrame> GPUSurfaceGL::AcquireFrame(const SkISize& size) {
...
@@ -111,10 +108,6 @@ std::unique_ptr<SurfaceFrame> GPUSurfaceGL::AcquireFrame(const SkISize& size) {
return
nullptr
;
return
nullptr
;
}
}
if
(
!
delegate_
->
GLContextMakeCurrent
())
{
return
nullptr
;
}
auto
weak_this
=
weak_factory_
.
GetWeakPtr
();
auto
weak_this
=
weak_factory_
.
GetWeakPtr
();
GPUSurfaceFrameGL
::
SubmitCallback
submit_callback
=
GPUSurfaceFrameGL
::
SubmitCallback
submit_callback
=
...
@@ -128,8 +121,6 @@ std::unique_ptr<SurfaceFrame> GPUSurfaceGL::AcquireFrame(const SkISize& size) {
...
@@ -128,8 +121,6 @@ std::unique_ptr<SurfaceFrame> GPUSurfaceGL::AcquireFrame(const SkISize& size) {
bool
GPUSurfaceGL
::
PresentSurface
(
SkCanvas
*
canvas
)
{
bool
GPUSurfaceGL
::
PresentSurface
(
SkCanvas
*
canvas
)
{
if
(
delegate_
==
nullptr
||
canvas
==
nullptr
)
{
if
(
delegate_
==
nullptr
||
canvas
==
nullptr
)
{
delegate_
->
GLContextClearCurrent
();
return
false
;
return
false
;
}
}
...
@@ -140,8 +131,6 @@ bool GPUSurfaceGL::PresentSurface(SkCanvas* canvas) {
...
@@ -140,8 +131,6 @@ bool GPUSurfaceGL::PresentSurface(SkCanvas* canvas) {
delegate_
->
GLContextPresent
();
delegate_
->
GLContextPresent
();
delegate_
->
GLContextClearCurrent
();
return
true
;
return
true
;
}
}
...
...
shell/platform/android/android_context_gl.cc
浏览文件 @
d9d23336
...
@@ -276,6 +276,8 @@ bool AndroidContextGL::Resize(const SkISize& size) {
...
@@ -276,6 +276,8 @@ bool AndroidContextGL::Resize(const SkISize& size) {
std
::
tie
(
success
,
surface_
)
=
std
::
tie
(
success
,
surface_
)
=
CreateSurface
(
environment_
->
Display
(),
config_
,
window_
);
CreateSurface
(
environment_
->
Display
(),
config_
,
window_
);
MakeCurrent
();
if
(
!
success
)
{
if
(
!
success
)
{
LOG
(
ERROR
)
<<
"Unable to create EGL window surface on resize."
;
LOG
(
ERROR
)
<<
"Unable to create EGL window surface on resize."
;
return
false
;
return
false
;
...
...
shell/platform/android/io/flutter/view/FlutterView.java
浏览文件 @
d9d23336
...
@@ -127,13 +127,13 @@ public class FlutterView extends SurfaceView
...
@@ -127,13 +127,13 @@ public class FlutterView extends SurfaceView
@Override
@Override
public
void
surfaceCreated
(
SurfaceHolder
holder
)
{
public
void
surfaceCreated
(
SurfaceHolder
holder
)
{
assert
mNativePlatformView
!=
0
;
assert
mNativePlatformView
!=
0
;
nativeSurfaceCreated
(
mNativePlatformView
,
holder
.
getSurface
());
nativeSurfaceCreated
(
mNativePlatformView
,
holder
.
getSurface
()
,
backgroundColor
);
}
}
@Override
@Override
public
void
surfaceChanged
(
SurfaceHolder
holder
,
int
format
,
int
width
,
int
height
)
{
public
void
surfaceChanged
(
SurfaceHolder
holder
,
int
format
,
int
width
,
int
height
)
{
assert
mNativePlatformView
!=
0
;
assert
mNativePlatformView
!=
0
;
nativeSurfaceChanged
(
mNativePlatformView
,
backgroundColor
);
nativeSurfaceChanged
(
mNativePlatformView
,
width
,
height
);
}
}
@Override
@Override
...
@@ -571,8 +571,11 @@ public class FlutterView extends SurfaceView
...
@@ -571,8 +571,11 @@ public class FlutterView extends SurfaceView
private
static
native
int
nativeGetObservatoryPort
();
private
static
native
int
nativeGetObservatoryPort
();
private
static
native
void
nativeDetach
(
long
nativePlatformViewAndroid
);
private
static
native
void
nativeDetach
(
long
nativePlatformViewAndroid
);
private
static
native
void
nativeSurfaceCreated
(
long
nativePlatformViewAndroid
,
private
static
native
void
nativeSurfaceCreated
(
long
nativePlatformViewAndroid
,
Surface
surface
);
Surface
surface
,
private
static
native
void
nativeSurfaceChanged
(
long
nativePlatformViewAndroid
,
int
backgroundColor
);
int
backgroundColor
);
private
static
native
void
nativeSurfaceChanged
(
long
nativePlatformViewAndroid
,
int
width
,
int
height
);
private
static
native
void
nativeSurfaceDestroyed
(
long
nativePlatformViewAndroid
);
private
static
native
void
nativeSurfaceDestroyed
(
long
nativePlatformViewAndroid
);
private
static
native
Bitmap
nativeGetBitmap
(
long
nativePlatformViewAndroid
);
private
static
native
Bitmap
nativeGetBitmap
(
long
nativePlatformViewAndroid
);
...
...
shell/platform/android/platform_view_android.cc
浏览文件 @
d9d23336
...
@@ -43,7 +43,8 @@ void PlatformViewAndroid::Detach(JNIEnv* env, jobject obj) {
...
@@ -43,7 +43,8 @@ void PlatformViewAndroid::Detach(JNIEnv* env, jobject obj) {
void
PlatformViewAndroid
::
SurfaceCreated
(
JNIEnv
*
env
,
void
PlatformViewAndroid
::
SurfaceCreated
(
JNIEnv
*
env
,
jobject
obj
,
jobject
obj
,
jobject
jsurface
)
{
jobject
jsurface
,
jint
backgroundColor
)
{
// Note: This frame ensures that any local references used by
// Note: This frame ensures that any local references used by
// ANativeWindow_fromSurface are released immediately. This is needed as a
// ANativeWindow_fromSurface are released immediately. This is needed as a
// workaround for https://code.google.com/p/android/issues/detail?id=68174
// workaround for https://code.google.com/p/android/issues/detail?id=68174
...
@@ -68,21 +69,27 @@ void PlatformViewAndroid::SurfaceCreated(JNIEnv* env,
...
@@ -68,21 +69,27 @@ void PlatformViewAndroid::SurfaceCreated(JNIEnv* env,
}
}
ANativeWindow_release
(
window
);
ANativeWindow_release
(
window
);
auto
gl_surface
=
std
::
make_unique
<
GPUSurfaceGL
>
(
surface_gl_
.
get
());
NotifyCreated
(
std
::
move
(
gl_surface
),
[
this
,
backgroundColor
]
{
rasterizer
().
Clear
(
backgroundColor
,
GetSize
());
});
SetupResourceContextOnIOThread
();
UpdateThreadPriorities
();
}
}
void
PlatformViewAndroid
::
SurfaceChanged
(
JNIEnv
*
env
,
void
PlatformViewAndroid
::
SurfaceChanged
(
JNIEnv
*
env
,
jobject
obj
,
jobject
obj
,
jint
backgroundColor
)
{
jint
width
,
jint
height
)
{
if
(
!
surface_gl_
)
{
if
(
!
surface_gl_
)
{
return
;
return
;
}
}
auto
surface
=
std
::
make_unique
<
GPUSurfaceGL
>
(
surface_gl_
.
get
());
blink
::
Threads
::
Gpu
()
->
PostTask
([
this
,
width
,
height
]()
{
NotifyCreated
(
std
::
move
(
surface
),
[
this
,
backgroundColor
]
{
surface_gl_
->
OnScreenSurfaceResize
(
SkISize
::
Make
(
width
,
height
));
rasterizer
().
Clear
(
backgroundColor
,
GetSize
());
});
});
SetupResourceContextOnIOThread
();
UpdateThreadPriorities
();
}
}
void
PlatformViewAndroid
::
UpdateThreadPriorities
()
{
void
PlatformViewAndroid
::
UpdateThreadPriorities
()
{
...
...
shell/platform/android/platform_view_android.h
浏览文件 @
d9d23336
...
@@ -28,9 +28,9 @@ class PlatformViewAndroid : public PlatformView {
...
@@ -28,9 +28,9 @@ class PlatformViewAndroid : public PlatformView {
void
Detach
(
JNIEnv
*
env
,
jobject
obj
);
void
Detach
(
JNIEnv
*
env
,
jobject
obj
);
void
SurfaceCreated
(
JNIEnv
*
env
,
jobject
obj
,
jobject
jsurface
);
void
SurfaceCreated
(
JNIEnv
*
env
,
jobject
obj
,
jobject
jsurface
,
jint
backgroundColor
);
void
SurfaceChanged
(
JNIEnv
*
env
,
jobject
obj
,
jint
backgroundColor
);
void
SurfaceChanged
(
JNIEnv
*
env
,
jobject
obj
,
jint
width
,
jint
height
);
void
SurfaceDestroyed
(
JNIEnv
*
env
,
jobject
obj
);
void
SurfaceDestroyed
(
JNIEnv
*
env
,
jobject
obj
);
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录