Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
sxychenjing
engine
提交
b537231b
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,发现更多精彩内容 >>
未验证
提交
b537231b
编写于
5月 25, 2018
作者:
C
Chinmay Garde
提交者:
GitHub
5月 25, 2018
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Fix build issues for the embedder on Windows. (#5386)
上级
8ebc81f4
变更
3
显示空白变更内容
内联
并排
Showing
3 changed file
with
34 addition
and
34 deletion
+34
-34
shell/gpu/gpu_surface_gl.cc
shell/gpu/gpu_surface_gl.cc
+3
-4
shell/platform/embedder/embedder.cc
shell/platform/embedder/embedder.cc
+15
-17
shell/platform/embedder/tests/embedder_unittests.cc
shell/platform/embedder/tests/embedder_unittests.cc
+16
-13
未找到文件。
shell/gpu/gpu_surface_gl.cc
浏览文件 @
b537231b
...
@@ -95,10 +95,9 @@ static sk_sp<SkSurface> WrapOnscreenSurface(GrContext* context,
...
@@ -95,10 +95,9 @@ static sk_sp<SkSurface> WrapOnscreenSurface(GrContext* context,
GrGLenum
format
;
GrGLenum
format
;
const
SkColorType
color_type
=
FirstSupportedColorType
(
context
,
&
format
);
const
SkColorType
color_type
=
FirstSupportedColorType
(
context
,
&
format
);
const
GrGLFramebufferInfo
framebuffer_info
=
{
GrGLFramebufferInfo
framebuffer_info
=
{};
.
fFBOID
=
static_cast
<
GrGLuint
>
(
fbo
),
framebuffer_info
.
fFBOID
=
static_cast
<
GrGLuint
>
(
fbo
);
.
fFormat
=
format
,
framebuffer_info
.
fFormat
=
format
;
};
GrBackendRenderTarget
render_target
(
size
.
fWidth
,
// width
GrBackendRenderTarget
render_target
(
size
.
fWidth
,
// width
size
.
fHeight
,
// height
size
.
fHeight
,
// height
...
...
shell/platform/embedder/embedder.cc
浏览文件 @
b537231b
...
@@ -31,16 +31,14 @@
...
@@ -31,16 +31,14 @@
#include "lib/fxl/functional/make_copyable.h"
#include "lib/fxl/functional/make_copyable.h"
#define SAFE_ACCESS(pointer, member, default_value) \
#define SAFE_ACCESS(pointer, member, default_value) \
({ \
([=]() { \
auto _return_value = \
static_cast<__typeof__(pointer->member)>((default_value)); \
if (offsetof(std::remove_pointer<decltype(pointer)>::type, member) + \
if (offsetof(std::remove_pointer<decltype(pointer)>::type, member) + \
sizeof(pointer->member) <= \
sizeof(pointer->member) <= \
pointer->struct_size) { \
pointer->struct_size) { \
_return_value = pointer->member;
\
return pointer->member;
\
} \
} \
_return_value;
\
return static_cast<decltype(pointer->member)>((default_value));
\
})
})
()
bool
IsRendererValid
(
const
FlutterRendererConfig
*
config
)
{
bool
IsRendererValid
(
const
FlutterRendererConfig
*
config
)
{
if
(
config
==
nullptr
||
config
->
type
!=
kOpenGL
)
{
if
(
config
==
nullptr
||
config
->
type
!=
kOpenGL
)
{
...
@@ -112,11 +110,11 @@ FlutterResult FlutterEngineRun(size_t version,
...
@@ -112,11 +110,11 @@ FlutterResult FlutterEngineRun(size_t version,
user_data
](
fxl
::
RefPtr
<
blink
::
PlatformMessage
>
message
)
{
user_data
](
fxl
::
RefPtr
<
blink
::
PlatformMessage
>
message
)
{
auto
handle
=
new
FlutterPlatformMessageResponseHandle
();
auto
handle
=
new
FlutterPlatformMessageResponseHandle
();
const
FlutterPlatformMessage
incoming_message
=
{
const
FlutterPlatformMessage
incoming_message
=
{
.
struct_size
=
sizeof
(
FlutterPlatformMessage
),
sizeof
(
FlutterPlatformMessage
),
// struct_size
.
channel
=
message
->
channel
().
c_str
(),
message
->
channel
().
c_str
(),
// channel
.
message
=
message
->
data
().
data
(),
message
->
data
().
data
(),
// message
.
message_size
=
message
->
data
().
size
(),
message
->
data
().
size
(),
// message_size
.
response_handle
=
handle
,
handle
,
// response_handle
};
};
handle
->
message
=
std
::
move
(
message
);
handle
->
message
=
std
::
move
(
message
);
return
ptr
(
&
incoming_message
,
user_data
);
return
ptr
(
&
incoming_message
,
user_data
);
...
@@ -188,12 +186,12 @@ FlutterResult FlutterEngineRun(size_t version,
...
@@ -188,12 +186,12 @@ FlutterResult FlutterEngineRun(size_t version,
);
);
shell
::
PlatformViewEmbedder
::
DispatchTable
dispatch_table
=
{
shell
::
PlatformViewEmbedder
::
DispatchTable
dispatch_table
=
{
.
gl_make_current_callback
=
make_current
,
make_current
,
// gl_make_current_callback
.
gl_clear_current_callback
=
clear_current
,
clear_current
,
// gl_clear_current_callback
.
gl_present_callback
=
present
,
present
,
// gl_present_callback
.
gl_fbo_callback
=
fbo_callback
,
fbo_callback
,
// gl_fbo_callback
.
platform_message_response_callback
=
platform_message_response_callback
,
platform_message_response_callback
,
// platform_message_response_callback
.
gl_make_resource_current_callback
=
make_resource_current_callback
,
make_resource_current_callback
,
// gl_make_resource_current_callback
};
};
shell
::
Shell
::
CreateCallback
<
shell
::
PlatformView
>
on_create_platform_view
=
shell
::
Shell
::
CreateCallback
<
shell
::
PlatformView
>
on_create_platform_view
=
...
...
shell/platform/embedder/tests/embedder_unittests.cc
浏览文件 @
b537231b
...
@@ -16,23 +16,26 @@ TEST(EmbedderTest, MustNotRunWithInvalidArgs) {
...
@@ -16,23 +16,26 @@ TEST(EmbedderTest, MustNotRunWithInvalidArgs) {
}
}
TEST
(
EmbedderTest
,
CanLaunchAndShutdownWithValidProjectArgs
)
{
TEST
(
EmbedderTest
,
CanLaunchAndShutdownWithValidProjectArgs
)
{
FlutterOpenGLRendererConfig
renderer
=
{
FlutterOpenGLRendererConfig
renderer
=
{};
.
struct_size
=
sizeof
(
FlutterOpenGLRendererConfig
),
renderer
.
struct_size
=
sizeof
(
FlutterOpenGLRendererConfig
);
.
make_current
=
[](
void
*
)
{
return
false
;
},
renderer
.
make_current
=
[](
void
*
)
{
return
false
;
};
.
clear_current
=
[](
void
*
)
{
return
false
;
},
renderer
.
clear_current
=
[](
void
*
)
{
return
false
;
};
.
present
=
[](
void
*
)
{
return
false
;
},
renderer
.
present
=
[](
void
*
)
{
return
false
;
};
.
fbo_callback
=
[](
void
*
)
->
uint32_t
{
return
0
;
},
renderer
.
fbo_callback
=
[](
void
*
)
->
uint32_t
{
return
0
;
};
};
std
::
string
main
=
std
::
string
main
=
std
::
string
(
testing
::
GetFixturesPath
())
+
"/simple_main.dart"
;
std
::
string
(
testing
::
GetFixturesPath
())
+
"/simple_main.dart"
;
FlutterRendererConfig
config
=
{.
type
=
FlutterRendererType
::
kOpenGL
,
FlutterRendererConfig
config
=
{};
.
open_gl
=
renderer
};
config
.
type
=
FlutterRendererType
::
kOpenGL
;
FlutterProjectArgs
args
=
{.
struct_size
=
sizeof
(
FlutterProjectArgs
),
config
.
open_gl
=
renderer
;
.
assets_path
=
""
,
.
main_path
=
main
.
c_str
(),
FlutterProjectArgs
args
=
{};
.
packages_path
=
""
};
args
.
struct_size
=
sizeof
(
FlutterProjectArgs
);
args
.
assets_path
=
""
;
args
.
main_path
=
main
.
c_str
();
args
.
packages_path
=
""
;
FlutterEngine
engine
=
nullptr
;
FlutterEngine
engine
=
nullptr
;
FlutterResult
result
=
FlutterEngineRun
(
FLUTTER_ENGINE_VERSION
,
&
config
,
FlutterResult
result
=
FlutterEngineRun
(
FLUTTER_ENGINE_VERSION
,
&
config
,
&
args
,
nullptr
,
&
engine
);
&
args
,
nullptr
,
&
engine
);
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录