Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
weixin_43355755
engine
提交
b6b54fd6
E
engine
项目概览
weixin_43355755
/
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,发现更多精彩内容 >>
提交
b6b54fd6
编写于
11月 22, 2019
作者:
C
Chinmay Garde
提交者:
Chinmay Garde
11月 22, 2019
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
PR
上级
ed30d77a
变更
2
隐藏空白更改
内联
并排
Showing
2 changed file
with
33 addition
and
33 deletion
+33
-33
testing/BUILD.gn
testing/BUILD.gn
+23
-23
testing/test_metal_surface_impl.mm
testing/test_metal_surface_impl.mm
+10
-10
未找到文件。
testing/BUILD.gn
浏览文件 @
b6b54fd6
...
...
@@ -81,12 +81,12 @@ if (current_toolchain == host_toolchain) {
]
}
# All targets on all platforms should be able to the Metal utilities. On
# platforms where Metal i
n
not available, the tests must be skipped or
# All targets on all platforms should be able to
use
the Metal utilities. On
# platforms where Metal i
s
not available, the tests must be skipped or
# implemented to use another available client rendering API. This is usually
# either OpenGL which is portably implemented via SwiftShader or the software
# backend. This way, all tests compile on all platforms but the Metal backend
# exercised on platforms where Metal itself is available.
#
is
exercised on platforms where Metal itself is available.
source_set("metal") {
testonly = true
...
...
@@ -107,28 +107,28 @@ if (current_toolchain == host_toolchain) {
"$flutter_root/fml",
]
}
}
test_fixtures("testing_fixtures") {
fixtures = []
}
test_fixtures("testing_fixtures") {
fixtures = []
}
# The //flutter/testing library provides utility methods to other test targets.
# This test target tests the testing utilities.
executable("testing_unittests") {
testonly = true
# The //flutter/testing library provides utility methods to other test targets.
# This test target tests the testing utilities.
executable("testing_unittests") {
testonly = true
sources = [
"$flutter_root/testing/test_metal_surface_unittests.cc",
]
sources = [
"$flutter_root/testing/test_metal_surface_unittests.cc",
]
deps = [
":dart",
":metal",
":opengl",
":skia",
":testing",
":testing_fixtures",
":testing_lib",
]
deps = [
":dart",
":metal",
":opengl",
":skia",
":testing",
":testing_fixtures",
":testing_lib",
]
}
}
testing/test_metal_surface_impl.mm
浏览文件 @
b6b54fd6
...
...
@@ -30,14 +30,14 @@ TestMetalSurfaceImpl::TestMetalSurfaceImpl(SkISize surface_size) {
return
;
}
auto
texture_descriptor
=
fml
::
scoped_nsobject
{
[[
MTLTextureDescriptor
texture2DDescriptorWithPixelFormat:
MTLPixelFormatBGRA8Unorm
width:
surface_size
.
width
()
height:
surface_size
.
height
()
mipmapped:
NO
]
retain
]};
auto
texture_descriptor
=
fml
::
scoped_nsobject
{
[[
MTLTextureDescriptor
texture2DDescriptorWithPixelFormat
:
MTLPixelFormatBGRA8Unorm
width:
surface_size
.
width
()
height:
surface_size
.
height
()
mipmapped:
NO
]
retain
]};
// The most pessimistic option and disables all optimizations but allows tests
// the most flexible access to the surface. They may read and wr
o
te to the
// the most flexible access to the surface. They may read and wr
i
te to the
// surface from shaders or use as a pixel view.
texture_descriptor
.
get
().
usage
=
MTLTextureUsageUnknown
;
...
...
@@ -46,8 +46,8 @@ TestMetalSurfaceImpl::TestMetalSurfaceImpl(SkISize surface_size) {
return
;
}
auto
texture
=
fml
::
scoped_nsobject
{
[
device
.
get
()
newTextureWithDescriptor
:
texture_descriptor
.
get
()]};
auto
texture
=
fml
::
scoped_nsobject
{
[
device
.
get
()
newTextureWithDescriptor
:
texture_descriptor
.
get
()]};
if
(
!
texture
)
{
FML_LOG
(
ERROR
)
<<
"Could not create texture from texture descriptor."
;
...
...
@@ -85,8 +85,8 @@ TestMetalSurfaceImpl::TestMetalSurfaceImpl(SkISize surface_size) {
kBGRA_8888_SkColorType
,
// color type
nullptr
,
// color space
nullptr
,
// surface properties
nullptr
,
// release proc (texture is already ref counted in sk_cf_obj)
nullptr
// release context
nullptr
,
// release proc (texture is already ref counted in sk_cf_obj)
nullptr
// release context
);
if
(
!
surface
)
{
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录