Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
qq_34031325
engine
提交
30870901
E
engine
项目概览
qq_34031325
/
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,发现更多精彩内容 >>
未验证
提交
30870901
编写于
8月 24, 2018
作者:
C
Chinmay Garde
提交者:
GitHub
8月 24, 2018
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Allow embedders to invalidate FBO bindings after present. (#6084)
上级
a52724fc
变更
6
隐藏空白更改
内联
并排
Showing
6 changed file
with
51 addition
and
6 deletion
+51
-6
shell/gpu/gpu_surface_gl.cc
shell/gpu/gpu_surface_gl.cc
+19
-1
shell/gpu/gpu_surface_gl.h
shell/gpu/gpu_surface_gl.h
+2
-0
shell/platform/embedder/embedder.cc
shell/platform/embedder/embedder.cc
+6
-2
shell/platform/embedder/embedder.h
shell/platform/embedder/embedder.h
+5
-0
shell/platform/embedder/platform_view_embedder.cc
shell/platform/embedder/platform_view_embedder.cc
+13
-2
shell/platform/embedder/platform_view_embedder.h
shell/platform/embedder/platform_view_embedder.h
+6
-1
未找到文件。
shell/gpu/gpu_surface_gl.cc
浏览文件 @
30870901
...
...
@@ -234,7 +234,25 @@ bool GPUSurfaceGL::PresentSurface(SkCanvas* canvas) {
onscreen_surface_
->
getCanvas
()
->
flush
();
}
delegate_
->
GLContextPresent
();
if
(
!
delegate_
->
GLContextPresent
())
{
return
false
;
}
if
(
delegate_
->
GLContextFBOResetAfterPresent
())
{
auto
current_size
=
SkISize
::
Make
(
onscreen_surface_
->
width
(),
onscreen_surface_
->
height
());
// The FBO has changed, ask the delegate for the new FBO and do a surface
// re-wrap.
auto
new_onscreen_surface
=
WrapOnscreenSurface
(
context_
.
get
(),
current_size
,
delegate_
->
GLContextFBO
());
if
(
!
new_onscreen_surface
)
{
return
false
;
}
onscreen_surface_
=
std
::
move
(
new_onscreen_surface
);
}
return
true
;
}
...
...
shell/gpu/gpu_surface_gl.h
浏览文件 @
30870901
...
...
@@ -22,6 +22,8 @@ class GPUSurfaceGLDelegate {
virtual
intptr_t
GLContextFBO
()
const
=
0
;
virtual
bool
GLContextFBOResetAfterPresent
()
const
{
return
false
;
}
virtual
bool
UseOffscreenSurface
()
const
{
return
false
;
}
};
...
...
shell/platform/embedder/embedder.cc
浏览文件 @
30870901
...
...
@@ -128,6 +128,9 @@ FlutterResult FlutterEngineRun(size_t version,
user_data
]()
{
return
ptr
(
user_data
);
};
}
bool
fbo_reset_after_present
=
SAFE_ACCESS
(
open_gl_config
,
fbo_reset_after_present
,
false
);
std
::
string
icu_data_path
;
if
(
SAFE_ACCESS
(
args
,
icu_data_path
,
nullptr
)
!=
nullptr
)
{
icu_data_path
=
SAFE_ACCESS
(
args
,
icu_data_path
,
nullptr
);
...
...
@@ -194,11 +197,12 @@ FlutterResult FlutterEngineRun(size_t version,
};
shell
::
Shell
::
CreateCallback
<
shell
::
PlatformView
>
on_create_platform_view
=
[
dispatch_table
](
shell
::
Shell
&
shell
)
{
[
dispatch_table
,
fbo_reset_after_present
](
shell
::
Shell
&
shell
)
{
return
std
::
make_unique
<
shell
::
PlatformViewEmbedder
>
(
shell
,
// delegate
shell
.
GetTaskRunners
(),
// task runners
dispatch_table
// embedder dispatch table
dispatch_table
,
// embedder dispatch table
fbo_reset_after_present
// fbo reset after present
);
};
...
...
shell/platform/embedder/embedder.h
浏览文件 @
30870901
...
...
@@ -42,6 +42,11 @@ typedef struct {
BoolCallback
present
;
UIntCallback
fbo_callback
;
BoolCallback
make_resource_current
;
// By default, the renderer config assumes that the FBO does not change for
// the duration of the engine run. If this argument is true, the
// engine will ask the embedder for an updated FBO target (via an fbo_callback
// invocation) after a present call.
bool
fbo_reset_after_present
;
}
FlutterOpenGLRendererConfig
;
typedef
struct
{
...
...
shell/platform/embedder/platform_view_embedder.cc
浏览文件 @
30870901
...
...
@@ -10,28 +10,39 @@ namespace shell {
PlatformViewEmbedder
::
PlatformViewEmbedder
(
PlatformView
::
Delegate
&
delegate
,
blink
::
TaskRunners
task_runners
,
DispatchTable
dispatch_table
)
DispatchTable
dispatch_table
,
bool
fbo_reset_after_present
)
:
PlatformView
(
delegate
,
std
::
move
(
task_runners
)),
dispatch_table_
(
dispatch_table
)
{}
dispatch_table_
(
dispatch_table
),
fbo_reset_after_present_
(
fbo_reset_after_present
)
{}
PlatformViewEmbedder
::~
PlatformViewEmbedder
()
=
default
;
// |shell::GPUSurfaceGLDelegate|
bool
PlatformViewEmbedder
::
GLContextMakeCurrent
()
{
return
dispatch_table_
.
gl_make_current_callback
();
}
// |shell::GPUSurfaceGLDelegate|
bool
PlatformViewEmbedder
::
GLContextClearCurrent
()
{
return
dispatch_table_
.
gl_clear_current_callback
();
}
// |shell::GPUSurfaceGLDelegate|
bool
PlatformViewEmbedder
::
GLContextPresent
()
{
return
dispatch_table_
.
gl_present_callback
();
}
// |shell::GPUSurfaceGLDelegate|
intptr_t
PlatformViewEmbedder
::
GLContextFBO
()
const
{
return
dispatch_table_
.
gl_fbo_callback
();
}
// |shell::GPUSurfaceGLDelegate|
bool
PlatformViewEmbedder
::
GLContextFBOResetAfterPresent
()
const
{
return
fbo_reset_after_present_
;
}
void
PlatformViewEmbedder
::
HandlePlatformMessage
(
fml
::
RefPtr
<
blink
::
PlatformMessage
>
message
)
{
if
(
!
message
)
{
...
...
shell/platform/embedder/platform_view_embedder.h
浏览文件 @
30870901
...
...
@@ -29,7 +29,8 @@ class PlatformViewEmbedder final : public PlatformView,
PlatformViewEmbedder
(
PlatformView
::
Delegate
&
delegate
,
blink
::
TaskRunners
task_runners
,
DispatchTable
dispatch_table
);
DispatchTable
dispatch_table
,
bool
fbo_reset_after_present
);
~
PlatformViewEmbedder
()
override
;
...
...
@@ -45,12 +46,16 @@ class PlatformViewEmbedder final : public PlatformView,
// |shell::GPUSurfaceGLDelegate|
intptr_t
GLContextFBO
()
const
override
;
// |shell::GPUSurfaceGLDelegate|
bool
GLContextFBOResetAfterPresent
()
const
override
;
// |shell::PlatformView|
void
HandlePlatformMessage
(
fml
::
RefPtr
<
blink
::
PlatformMessage
>
message
)
override
;
private:
DispatchTable
dispatch_table_
;
bool
fbo_reset_after_present_
;
// |shell::PlatformView|
std
::
unique_ptr
<
Surface
>
CreateRenderingSurface
()
override
;
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录