提交 b6b54fd6 编写于 作者: C Chinmay Garde 提交者: Chinmay Garde

PR

上级 ed30d77a
......@@ -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 in 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 is 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",
]
}
}
......@@ -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 wrote to the
// the most flexible access to the surface. They may read and write 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.
先完成此消息的编辑!
想要评论请 注册