Add an enabler of gpu upload.

Signed-off-by: He Su <hesu1@huawei.com>
This commit is contained in:
何溯
2022-04-26 08:05:55 +00:00
committed by Gitee
parent 9840aea5de
commit e41d5540eb
4 changed files with 17 additions and 0 deletions
@@ -711,6 +711,9 @@ std::unique_ptr<PlatformWindow> FlutterAceView::GetPlatformWindow()
void FlutterAceView::InitIOManager(RefPtr<TaskExecutor> taskExecutor)
{
if (!SystemProperties::GetGpuUploadEnabled()) {
return;
}
#if defined(ENABLE_ROSEN_BACKEND) and !defined(UPLOAD_GPU_DISABLED)
ACE_SCOPED_TRACE("InitIOManager");
EGLContext shareContext = nullptr;
+7
View File
@@ -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()
{
@@ -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()
{
@@ -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