diff --git a/BUILD.gn b/BUILD.gn index 773b42acf8dd66a64a0e13750f4f2d366d6aaf26..3bed74db9996d81b751c5cbebe3333ce1252ea2b 100644 --- a/BUILD.gn +++ b/BUILD.gn @@ -152,9 +152,6 @@ group("unittests") { "//flutter/runtime:no_dart_plugin_registrant_unittests", "//flutter/runtime:runtime_unittests", "//flutter/shell/common:shell_unittests", - "//flutter/shell/platform/embedder:embedder_a11y_unittests", - "//flutter/shell/platform/embedder:embedder_proctable_unittests", - "//flutter/shell/platform/embedder:embedder_unittests", "//flutter/testing:testing_unittests", "//flutter/testing/dart", "//flutter/testing/smoke_test_failure", @@ -162,8 +159,18 @@ group("unittests") { "//flutter/third_party/txt:txt_unittests", ] + # ohos does not support vulkan + if (!is_ohos) { + public_deps += [ + "//flutter/shell/platform/embedder:embedder_a11y_unittests", + "//flutter/shell/platform/embedder:embedder_proctable_unittests", + "//flutter/shell/platform/embedder:embedder_unittests", + ] + } + if (is_ohos) { public_deps += [ + "//flutter/fml/:fml_unittests", "//flutter/shell/platform/ohos:flutter_ohos_unittests", ] } @@ -187,7 +194,7 @@ group("unittests") { [ "//flutter/shell/platform/darwin:flutter_channels_unittests" ] } - if (!is_win && !is_fuchsia) { + if (!is_win && !is_fuchsia && !is_ohos) { public_deps += [ "//flutter/shell/platform/android/external_view_embedder:android_external_view_embedder_unittests", "//flutter/shell/platform/android/jni:jni_unittests", diff --git a/attachment/repos/angle.patch b/attachment/repos/angle.patch index e4a0952dd4dce8a288dd5aaead27e49bc803628b..837d591f23ed85f2ab797186e1ea5ba54b4f9b58 100644 --- a/attachment/repos/angle.patch +++ b/attachment/repos/angle.patch @@ -1,8 +1,19 @@ diff --git a/BUILD.gn b/BUILD.gn -index efaf09033..73af49870 100644 +index efaf090339..cc0398c0e4 100644 --- a/BUILD.gn +++ b/BUILD.gn -@@ -83,7 +83,7 @@ if (angle_build_all) { +@@ -11,7 +11,9 @@ if (angle_use_wayland) { + import("//build_overrides/wayland.gni") + } + if (angle_has_build) { +- import("//build/config/linux/pkg_config.gni") ++ if (!is_ohos) { ++ import("//build/config/linux/pkg_config.gni") ++ } + import("//build/config/sanitizers/sanitizers.gni") + import("//build/config/ui.gni") + import("//testing/libfuzzer/fuzzer_test.gni") +@@ -83,7 +85,7 @@ if (angle_build_all) { ":translator_fuzzer", ":xxhash_fuzzer", "$angle_root/samples:angle_samples", @@ -11,18 +22,43 @@ index efaf09033..73af49870 100644 ] if (angle_enable_cl) { deps += [ "$angle_root/src/libOpenCL:angle_cl" ] -@@ -486,7 +486,8 @@ angle_static_library("angle_image_util") { - sources = libangle_image_util_sources +@@ -141,7 +143,7 @@ config("internal_config") { + if (angle_is_winuwp) { + defines += [ "ANGLE_IS_WINUWP" ] + } +- } else if (is_linux || is_chromeos) { ++ } else if (is_linux || is_chromeos || is_ohos) { + defines += [ "ANGLE_IS_LINUX" ] + } + +@@ -443,7 +445,7 @@ angle_static_library("angle_common") { + all_dependent_configs = [ ":angle_disable_pool_alloc" ] + } + +- if (is_linux || is_chromeos) { ++ if (is_linux || is_chromeos || is_ohos) { + libs = [ "dl" ] + } + +@@ -487,6 +489,7 @@ angle_static_library("angle_image_util") { public_configs += [ ":angle_image_util_config" ] public_deps = [ ":angle_image_util_headers" ] -- -+ + + angle_has_astc_encoder = false if (angle_has_astc_encoder) { public_deps += [ "third_party/astc-encoder:astcenc" ] include_dirs = [ "third_party/astc-encoder/src/Source/" ] +@@ -561,7 +564,7 @@ angle_static_library("angle_gpu_info_util") { + libs += [ "dxgi.lib" ] + } + +- if (is_linux || is_chromeos) { ++ if (is_linux || is_chromeos || is_ohos) { + sources += libangle_gpu_info_util_linux_sources + + if (angle_use_x11 && angle_has_build) { diff --git a/gni/angle.gni b/gni/angle.gni -index b8086660a..d82d056d6 100644 +index b8086660a1..d82d056d65 100644 --- a/gni/angle.gni +++ b/gni/angle.gni @@ -60,8 +60,7 @@ if (angle_has_build) { @@ -65,7 +101,7 @@ index b8086660a..d82d056d6 100644 angle_build_vulkan_system_info = angle_has_build && !angle_is_winuwp diff --git a/include/EGL/eglplatform.h b/include/EGL/eglplatform.h -index 9ebaf00a9..fe111d115 100644 +index 9ebaf00a9b..fe111d115d 100644 --- a/include/EGL/eglplatform.h +++ b/include/EGL/eglplatform.h @@ -117,13 +117,19 @@ typedef khronos_uintptr_t EGLNativeWindowType; @@ -95,7 +131,7 @@ index 9ebaf00a9..fe111d115 100644 #elif defined(__APPLE__) diff --git a/src/common/angle_version.h b/src/common/angle_version.h -index d9d7e8929..a97e3844b 100644 +index d9d7e8929d..a97e3844ba 100644 --- a/src/common/angle_version.h +++ b/src/common/angle_version.h @@ -14,8 +14,12 @@ @@ -112,7 +148,7 @@ index d9d7e8929..a97e3844b 100644 #define ANGLE_STRINGIFY(x) #x #define ANGLE_MACRO_STRINGIFY(x) ANGLE_STRINGIFY(x) diff --git a/src/compiler/translator/BuildSPIRV.h b/src/compiler/translator/BuildSPIRV.h -index d67bd812b..00d22d025 100644 +index d67bd812ba..00d22d025d 100644 --- a/src/compiler/translator/BuildSPIRV.h +++ b/src/compiler/translator/BuildSPIRV.h @@ -110,6 +110,8 @@ struct SpirvType @@ -124,3 +160,38 @@ index d67bd812b..00d22d025 100644 struct SpirvIdAndIdList { spirv::IdRef id; +diff --git a/src/libANGLE/renderer/gl/BUILD.gn b/src/libANGLE/renderer/gl/BUILD.gn +index c675c26074..6cba114ef8 100644 +--- a/src/libANGLE/renderer/gl/BUILD.gn ++++ b/src/libANGLE/renderer/gl/BUILD.gn +@@ -125,7 +125,7 @@ if (angle_use_x11) { + ] + } + +-if (is_android || is_linux || is_chromeos) { ++if (is_android || is_linux || is_chromeos || is_ohos) { + _gl_backend_sources += [ + "egl/ContextEGL.cpp", + "egl/ContextEGL.h", +@@ -264,7 +264,7 @@ angle_source_set("angle_gl_backend") { + "Xext", + ] + } +- if (is_android || is_linux || is_chromeos) { ++ if (is_android || is_linux || is_chromeos || is_ohos) { + deps += [ "$angle_root/src/common/linux:angle_dma_buf" ] + } + if (is_apple) { +diff --git a/src/libGLESv2.gni b/src/libGLESv2.gni +index 723d7f99f2..dab8b887ce 100644 +--- a/src/libGLESv2.gni ++++ b/src/libGLESv2.gni +@@ -87,7 +87,7 @@ xxhash_sources = [ + "src/common/third_party/xxhash/xxhash.h", + ] + +-if (is_linux || is_chromeos || is_android || is_fuchsia) { ++if (is_linux || is_chromeos || is_android || is_fuchsia || is_ohos) { + libangle_common_sources += [ + "src/common/system_utils_linux.cpp", + "src/common/system_utils_posix.cpp", diff --git a/attachment/repos/swiftshader.patch b/attachment/repos/swiftshader.patch new file mode 100644 index 0000000000000000000000000000000000000000..e1606d8da2a3c62daebaaf367ce059dc327f7fb4 --- /dev/null +++ b/attachment/repos/swiftshader.patch @@ -0,0 +1,98 @@ +diff --git a/src/Reactor/BUILD.gn b/src/Reactor/BUILD.gn +index 676f99f1a..36a581f10 100644 +--- a/src/Reactor/BUILD.gn ++++ b/src/Reactor/BUILD.gn +@@ -95,7 +95,7 @@ if (supports_subzero) { + if (is_win) { + include_dirs += + [ "../../third_party/llvm-subzero/build/Windows/include/" ] +- } else if (is_linux || is_chromeos) { ++ } else if (is_linux || is_chromeos || is_ohos) { + include_dirs += [ "../../third_party/llvm-subzero/build/Linux/include/" ] + } else if (is_fuchsia) { + include_dirs += +@@ -328,7 +328,7 @@ if (supports_llvm) { + "$llvm_dir/configs/common/include/", + ] + +- if (is_linux || is_chromeos) { ++ if (is_linux || is_chromeos || is_ohos) { + include_dirs += [ "$llvm_dir/configs/linux/include/" ] + } else if (is_fuchsia) { + include_dirs += [ "$llvm_dir/configs/fuchsia/include/" ] +diff --git a/src/Reactor/reactor.gni b/src/Reactor/reactor.gni +index 04fad6f81..324003e35 100644 +--- a/src/Reactor/reactor.gni ++++ b/src/Reactor/reactor.gni +@@ -14,7 +14,7 @@ declare_args() { + } + + declare_args() { +- supports_llvm = is_linux || is_chromeos || is_fuchsia || is_win || is_android ++ supports_llvm = is_linux || is_chromeos || is_fuchsia || is_win || is_android || is_ohos + # LLVM uses C++17 features which require macOS 10.12, while Chrome's minimum platform for x86 is 10.11. + # Don't build LLVM on Mac, unless we have to. This only happens on ARM64 devices, which launched with 11.0. + # TODO(b/174843857): Remove check for !supports_subzero once Chrome supports macOS 10.12 +diff --git a/src/System/BUILD.gn b/src/System/BUILD.gn +index 6f61d9f76..bed58a57b 100644 +--- a/src/System/BUILD.gn ++++ b/src/System/BUILD.gn +@@ -29,7 +29,7 @@ swiftshader_source_set("System_headers") { + "SwiftConfig.hpp", + "Timer.hpp", + ] +- if (is_linux || is_chromeos || is_android) { ++ if (is_linux || is_chromeos || is_android || is_ohos) { + sources += [ + "Linux/MemFd.hpp", + ] +@@ -48,7 +48,7 @@ swiftshader_source_set("System") { + "SwiftConfig.cpp", + "Timer.cpp", + ] +- if (is_linux || is_chromeos || is_android) { ++ if (is_linux || is_chromeos || is_android || is_ohos) { + sources += [ + "Linux/MemFd.cpp", + ] +diff --git a/third_party/llvm-10.0/BUILD.gn b/third_party/llvm-10.0/BUILD.gn +index 6c40b2c00..6076f2bea 100644 +--- a/third_party/llvm-10.0/BUILD.gn ++++ b/third_party/llvm-10.0/BUILD.gn +@@ -100,7 +100,7 @@ llvm_include_dirs = [ + "configs/common/lib/Transforms/InstCombine/", + ] + +-if (is_linux || is_chromeos) { ++if (is_linux || is_chromeos || is_ohos) { + llvm_include_dirs += [ "configs/linux/include/" ] + } else if (is_fuchsia) { + llvm_include_dirs += [ "configs/fuchsia/include/" ] +diff --git a/third_party/marl/src/thread.cpp b/third_party/marl/src/thread.cpp +index 30897f020..a6c3031c2 100644 +--- a/third_party/marl/src/thread.cpp ++++ b/third_party/marl/src/thread.cpp +@@ -154,14 +154,6 @@ Thread::Affinity Thread::Affinity::all( + auto thread = pthread_self(); + cpu_set_t cpuset; + CPU_ZERO(&cpuset); +- if (pthread_getaffinity_np(thread, sizeof(cpu_set_t), &cpuset) == 0) { +- int count = CPU_COUNT(&cpuset); +- for (int i = 0; i < count; i++) { +- Core core; +- core.pthread.index = static_cast(i); +- affinity.cores.emplace_back(std::move(core)); +- } +- } + #elif defined(__FreeBSD__) + auto thread = pthread_self(); + cpuset_t cpuset; +@@ -385,8 +377,6 @@ class Thread::Impl { + for (size_t i = 0; i < count; i++) { + CPU_SET(affinity[i].pthread.index, &cpuset); + } +- auto thread = pthread_self(); +- pthread_setaffinity_np(thread, sizeof(cpu_set_t), &cpuset); + #elif defined(__FreeBSD__) + cpuset_t cpuset; + CPU_ZERO(&cpuset); \ No newline at end of file diff --git a/attachment/scripts/config.json b/attachment/scripts/config.json index 9092b1a9391fc583a49e8d2837226597c069ae72..0e768859f244293544ba729a1ba5330886da6cfd 100644 --- a/attachment/scripts/config.json +++ b/attachment/scripts/config.json @@ -70,5 +70,11 @@ "target": "third_party/boringssl", "type": "patch", "file_path": "flutter/attachment/repos/boringssl.patch" + }, + { + "name": "swiftshader", + "target": "./src/third_party/swiftshader", + "type": "patch", + "file_path": "../../flutter/attachment/repos/swiftshader.patch" } ] diff --git a/attachment/scripts/config_pre.json b/attachment/scripts/config_pre.json index 9092b1a9391fc583a49e8d2837226597c069ae72..0e768859f244293544ba729a1ba5330886da6cfd 100644 --- a/attachment/scripts/config_pre.json +++ b/attachment/scripts/config_pre.json @@ -70,5 +70,11 @@ "target": "third_party/boringssl", "type": "patch", "file_path": "flutter/attachment/repos/boringssl.patch" + }, + { + "name": "swiftshader", + "target": "./src/third_party/swiftshader", + "type": "patch", + "file_path": "../../flutter/attachment/repos/swiftshader.patch" } ] diff --git a/fml/BUILD.gn b/fml/BUILD.gn index 03d286857c2d7308c91dca9f445e59e484069b50..bc70dd0f79a47a5b4df373ce29a00f62158a833d 100644 --- a/fml/BUILD.gn +++ b/fml/BUILD.gn @@ -364,6 +364,9 @@ if (enable_unittests) { "time/time_delta_unittest.cc", "time/time_point_unittest.cc", "time/time_unittest.cc", + "platform/ohos/timerfd_unittests.cpp", + "platform/ohos/paths_ohos_unittests.cpp", + "platform/ohos/napi_util_unittests.cpp", ] if (is_mac) { diff --git a/fml/platform/ohos/napi_util_unittests.cpp b/fml/platform/ohos/napi_util_unittests.cpp new file mode 100644 index 0000000000000000000000000000000000000000..a5e67eb19f777e1800dc2b32cacbc27256398165 --- /dev/null +++ b/fml/platform/ohos/napi_util_unittests.cpp @@ -0,0 +1,62 @@ +/* + * Copyright (c) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#include "flutter/fml/platform/ohos/napi_util.h" +#include "gtest/gtest.h" + +namespace fml { +namespace { +TEST(NapiUtilTest, NapiUtil01) { + napi_env env = nullptr; + napi_value value = nullptr; + EXPECT_EQ(napi::NapiIsNull(env, value), true); +} + +TEST(NapiUtilTest, NapiUtil02) { + napi_env env = nullptr; + napi_value value = nullptr; + std::string str = "test"; + EXPECT_EQ(napi::GetString(env, value, str), napi::ERROR_TYPE); +} + +TEST(NapiUtilTest, NapiUtil03) { + napi_env env = nullptr; + napi_value value = nullptr; + std::vector vectorStr = {}; + EXPECT_NE(napi::GetArrayString(env, value, vectorStr), napi::SUCCESS); +} + +TEST(NapiUtilTest, NapiUtil04) { + napi_env env = nullptr; + napi_value value = nullptr; + void** message = nullptr; + size_t lenth = 0; + EXPECT_NE(napi::GetArrayBuffer(env, value, message, &lenth), napi::SUCCESS); +} + +TEST(NapiUtilTest, NapiUtil05) { + napi_env env = nullptr; + napi_value value = nullptr; + EXPECT_EQ(napi::NapiIsType(env, value, napi_number), false); +} + +TEST(NapiUtilTest, NapiUtil06) { + napi_env env = nullptr; + napi_ref ref_napi_obj = nullptr; + EXPECT_GT(napi::InvokeJsMethod(env, ref_napi_obj, nullptr, 0, nullptr), 0); +} + +} // namespace +} // namespace fml \ No newline at end of file diff --git a/fml/platform/ohos/paths_ohos_unittests.cpp b/fml/platform/ohos/paths_ohos_unittests.cpp new file mode 100644 index 0000000000000000000000000000000000000000..2267050aad4fcb5ece960c3593c2a31457bedec8 --- /dev/null +++ b/fml/platform/ohos/paths_ohos_unittests.cpp @@ -0,0 +1,29 @@ +/* + * Copyright (c) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#include "flutter/fml/platform/ohos/paths_ohos.h" +#include "gtest/gtest.h" + +namespace fml { +namespace { +TEST(PathsTest, PathsOhosTest01) { + fml::paths::InitializeOhosCachesPath("test"); + fml::UniqueFD resultFD = fml::paths::GetCachesDirectory(); + EXPECT_FALSE(resultFD.is_valid()); +} + + +} // namespace +} // namespace fml \ No newline at end of file diff --git a/fml/platform/ohos/timerfd_unittests.cpp b/fml/platform/ohos/timerfd_unittests.cpp new file mode 100644 index 0000000000000000000000000000000000000000..6da8a3f2f74cda75708b49593684aa15bb501dba --- /dev/null +++ b/fml/platform/ohos/timerfd_unittests.cpp @@ -0,0 +1,72 @@ +/* + * Copyright (c) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +#include +#include +#include +#include +#include "flutter/fml/platform/ohos/timerfd.h" + +#include "gtest/gtest.h" + +using fml::TimePoint; +namespace fml { +namespace { + +class MockFileDescriptor { +public: + MockFileDescriptor() + { + pipe(mFdArray); + } + + ~MockFileDescriptor() + { + close(mFdArray[0]); + close(mFdArray[1]); + } + + int GetReadFd() const { return mFdArray[0]; } + int GetWriteFd() const { return mFdArray[1]; } + + void WriteFireCount(uint64_t count) + { + write(mFdArray[1], &count, sizeof(count)); + } + +private: + int mFdArray[2]; +}; +TEST(TimerfdTest, TimerRearmTest) { + TimePoint timeP; + EXPECT_EQ(TimerRearm(0, timeP), false); +} + +TEST(TimerDrainTest, ReadsFireCountSuccessfully) { + MockFileDescriptor mockFd; + uint64_t expected_count = 1; + mockFd.WriteFireCount(expected_count); + EXPECT_TRUE(TimerDrain(mockFd.GetReadFd())); +} + +TEST(TimerfdTest, TimerFdCreateTest) { + EXPECT_TRUE(timerfd_create(0, 0)); +} + +TEST(TimerfdTest, TimerFdSettimeTest) { + EXPECT_EQ(timerfd_settime(0, 0, nullptr, nullptr), -1); +} + +} // namespace +} // namespace fml \ No newline at end of file diff --git a/shell/common/BUILD.gn b/shell/common/BUILD.gn index 7fa0c1b23ae702ec61d968210891c412fdc6f482..2f8b67095e0e5ba42ac68e68c4f625f00f6b1b01 100644 --- a/shell/common/BUILD.gn +++ b/shell/common/BUILD.gn @@ -185,6 +185,10 @@ if (enable_unittests) { "fixtures/shelltest_screenshot.png", "fixtures/hello_loop_2.gif", ] + + if (is_ohos) { + dest = "/data/flutter_unittests/common" + } } shell_host_executable("shell_benchmarks") { @@ -284,16 +288,12 @@ if (enable_unittests) { testonly = true sources = [ - "animator_unittests.cc", "canvas_spy_unittests.cc", "context_options_unittests.cc", "engine_unittests.cc", - "input_events_unittests.cc", - "persistent_cache_unittests.cc", "pipeline_unittests.cc", "rasterizer_unittests.cc", "resource_cache_limit_calculator_unittests.cc", - "shell_unittests.cc", "switches_unittests.cc", "variable_refresh_rate_display_unittests.cc", "vsync_waiter_unittests.cc", @@ -310,6 +310,15 @@ if (enable_unittests) { "//third_party/googletest:gmock", ] + if (!is_ohos) { + sources += [ + "animator_unittests.cc", + "input_events_unittests.cc", + "persistent_cache_unittests.cc", + "shell_unittests.cc", + ] + } + if (is_fuchsia) { sources += [ "shell_fuchsia_unittests.cc" ] @@ -319,7 +328,7 @@ if (enable_unittests) { "$fuchsia_sdk_root/pkg:fidl_cpp", "$fuchsia_sdk_root/pkg:sys_cpp", ] - } else { + } else if (!is_ohos) { # TODO(63837): This test is hard-coded to use a TestGLSurface so it cannot run on fuchsia. sources += [ "shell_io_manager_unittests.cc" ] diff --git a/shell/config.gni b/shell/config.gni index 85dd360cbc036d5c4276303906ecb56fbcab19ac..4db04f8b5c834f51ceed3be23d295e548416cde7 100644 --- a/shell/config.gni +++ b/shell/config.gni @@ -17,6 +17,6 @@ declare_args() { test_enable_metal = shell_enable_metal # The Vulkan unittests are combined with the GL unittests. - test_enable_vulkan = is_fuchsia || shell_enable_gl + test_enable_vulkan = (is_fuchsia || shell_enable_gl) && !is_ohos test_enable_software = shell_enable_software } diff --git a/shell/gpu/gpu_surface_vulkan.cc b/shell/gpu/gpu_surface_vulkan.cc index ba8383c1343cf63020cb05440406d3b285fe206a..7743289f593248bb944aa77fbe40634c7ea11f1d 100644 --- a/shell/gpu/gpu_surface_vulkan.cc +++ b/shell/gpu/gpu_surface_vulkan.cc @@ -98,6 +98,7 @@ sk_sp GPUSurfaceVulkan::CreateSurfaceFromVulkanImage( const VkImage image, const VkFormat format, const SkISize& size) { +#ifdef SK_VULKAN GrVkImageInfo image_info = { .fImage = image, .fImageTiling = VK_IMAGE_TILING_OPTIMAL, @@ -126,6 +127,9 @@ sk_sp GPUSurfaceVulkan::CreateSurfaceFromVulkanImage( SkColorSpace::MakeSRGB(), // color space &surface_properties // surface properties ); +#else + return nullptr; +#endif // SK_VULKAN } SkColorType GPUSurfaceVulkan::ColorTypeFromFormat(const VkFormat format) { diff --git a/shell/platform/embedder/BUILD.gn b/shell/platform/embedder/BUILD.gn index 56335f45afd715add78c6f571d03c3d1239f4886..055c53ca56f0628f52190df2b91a0f4885a29cc8 100644 --- a/shell/platform/embedder/BUILD.gn +++ b/shell/platform/embedder/BUILD.gn @@ -217,7 +217,7 @@ test_fixtures("fixtures") { ] } -if (enable_unittests) { +if (enable_unittests && !is_ohos) { source_set("embedder_unittests_library") { testonly = true diff --git a/testing/testing.gni b/testing/testing.gni index 3fadcbbc71e16935c24d2c6de108479ad09902e2..e2016e48fc466ca4768f790952b32525f84c8eab 100644 --- a/testing/testing.gni +++ b/testing/testing.gni @@ -331,7 +331,11 @@ template("test_fixtures") { copy_fixtures_target_name = "_cf_$target_name" copy_fixtures(copy_fixtures_target_name) { fixtures = invoker.fixtures - dest = dest + if (is_ohos) { + dest = target_gen_dir + } else { + dest = dest + } forward_variables_from(invoker, [ "deps" ]) } test_public_deps += [ ":$copy_fixtures_target_name" ] diff --git a/vulkan/vulkan_window.cc b/vulkan/vulkan_window.cc index a7067fff3f907a68bd8ac570e6fe2328fe79c0bc..25608f54afff6e503044a2deff3293ded7d1d3c5 100644 --- a/vulkan/vulkan_window.cc +++ b/vulkan/vulkan_window.cc @@ -116,6 +116,7 @@ GrDirectContext* VulkanWindow::GetSkiaGrContext() { } bool VulkanWindow::CreateSkiaGrContext() { +#ifdef SK_VULKAN GrVkBackendContext backend_context; if (!CreateSkiaBackendContext(&backend_context)) { @@ -136,6 +137,9 @@ bool VulkanWindow::CreateSkiaGrContext() { skia_gr_context_ = context; return true; +#else + return false; +#endif } bool VulkanWindow::CreateSkiaBackendContext(GrVkBackendContext* context) {