diff --git a/adapter/ohos/entrance/flutter_ace_view.cpp b/adapter/ohos/entrance/flutter_ace_view.cpp index 5dc9f6f1..503cc48c 100644 --- a/adapter/ohos/entrance/flutter_ace_view.cpp +++ b/adapter/ohos/entrance/flutter_ace_view.cpp @@ -711,6 +711,9 @@ std::unique_ptr FlutterAceView::GetPlatformWindow() void FlutterAceView::InitIOManager(RefPtr taskExecutor) { + if (!SystemProperties::GetGpuUploadEnabled()) { + return; + } #if defined(ENABLE_ROSEN_BACKEND) and !defined(UPLOAD_GPU_DISABLED) ACE_SCOPED_TRACE("InitIOManager"); EGLContext shareContext = nullptr; diff --git a/adapter/ohos/osal/system_properties.cpp b/adapter/ohos/osal/system_properties.cpp index 972204ae..5ce8d563 100644 --- a/adapter/ohos/osal/system_properties.cpp +++ b/adapter/ohos/osal/system_properties.cpp @@ -111,6 +111,12 @@ bool IsDebugEnabled() { return (system::GetParameter("persist.ace.debug.enabled", "0") == "1"); } + +bool IsGpuUploadEnabled() +{ + return (system::GetParameter("persist.ace.gpuupload.enabled", "0") == "1" || + system::GetParameter("debug.ace.gpuupload.enabled", "0") == "1"); +} } // namespace bool SystemProperties::IsSyscapExist(const char* cap) @@ -176,6 +182,7 @@ bool SystemProperties::windowAnimationEnabled_ = IsWindowAnimationEnabled(); bool SystemProperties::debugEnabled_ = IsDebugEnabled(); int32_t SystemProperties::windowPosX_ = 0; int32_t SystemProperties::windowPosY_ = 0; +bool SystemProperties::gpuUploadEnabled_ = IsGpuUploadEnabled(); DeviceType SystemProperties::GetDeviceType() { diff --git a/adapter/preview/osal/system_properties.cpp b/adapter/preview/osal/system_properties.cpp index 11773c60..59200153 100644 --- a/adapter/preview/osal/system_properties.cpp +++ b/adapter/preview/osal/system_properties.cpp @@ -85,6 +85,7 @@ bool SystemProperties::windowAnimationEnabled_ = false; int32_t SystemProperties::windowPosX_ = 0; int32_t SystemProperties::windowPosY_ = 0; bool SystemProperties::debugBoundaryEnabled_ = false; +bool SystemProperties::gpuUploadEnabled_ = false; DeviceType SystemProperties::GetDeviceType() { diff --git a/frameworks/base/utils/system_properties.h b/frameworks/base/utils/system_properties.h index c4ea2aa0..f12a0814 100644 --- a/frameworks/base/utils/system_properties.h +++ b/frameworks/base/utils/system_properties.h @@ -197,6 +197,11 @@ public: } static bool GetDebugEnabled(); + + static bool GetGpuUploadEnabled() + { + return gpuUploadEnabled_; + } /* * Set device orientation. @@ -301,6 +306,7 @@ private: static int32_t windowPosX_; static int32_t windowPosY_; static bool debugBoundaryEnabled_; + static bool gpuUploadEnabled_; }; } // namespace OHOS::Ace