移植不同产品开机动画
authorCaisking <Casiking@zhihuishixun.com>
Tue, 26 Aug 2025 10:12:59 +0000 (18:12 +0800)
committerCaisking <Casiking@zhihuishixun.com>
Tue, 26 Aug 2025 10:12:59 +0000 (18:12 +0800)
code/sdk/middleware/services/gui/uikit/proprietary/src/service/src/graphic_service_wrapper.cpp

index 766cdbf..caa3a9a 100644 (file)
@@ -49,15 +49,20 @@ static OHOS::ImageInfo* g_imgInfo = nullptr;
 static bool g_showOtaLogo = false;
 static OHOS::UIImageView* g_ota_logo = nullptr;
 static OHOS::ImageInfo* g_ota_imgInfo = nullptr;
+
 static uint32_t *g_boot_animation_task_handle = NULL;
+
 static OHOS::UIViewGroup* group=nullptr;
 static OHOS::UIViewGroup* boot_group=nullptr;
 static OHOS::UIImageAnimatorView* ReBootImageAnimatorView=nullptr;
 #ifdef CUSTOM_Z1
-static const char *ReBootPaths = "/user/res/RebootAndShutDown/ReBoot/"; //开机图片路径
+static constexpr const char *ReBootPaths = "/user/res/RebootAndShutDown/ReBoot/"; //开机图片路径
+static constexpr int16_t REBOOT_IMAGE_ANIMATOR_VIEW_NUM_FRAMES = 30; // 图片帧数
+#elif defined(BOARD_W9) || defined(BOARD_N9)
+static constexpr const char *ReBootPaths = "/user/res/RebootAndShutDown/ReBoot/"; //开机图片路径
 static constexpr int16_t REBOOT_IMAGE_ANIMATOR_VIEW_NUM_FRAMES = 30; // 图片帧数
 #else
-static const char *ReBootPaths = "/user/res/RebootAndShutDown/ReBoot/"; //开机图片路径
+static constexpr const char *ReBootPaths = "/user/res/RebootAndShutDown/ReBoot/"; //开机图片路径
 static constexpr int16_t REBOOT_IMAGE_ANIMATOR_VIEW_NUM_FRAMES = 36; // 图片帧数
 #endif
 static constexpr int16_t REBOOT_IMAGE_ANIMATOR_TIME = 150;           // 图片更新间隔
@@ -74,7 +79,6 @@ static app_task_definition_t taskcfg={0};
 #ifdef QSPI_DISPLAY
 #define IMAGE_OPEN_LOGO_PATH "/user/res/OPEN_LOGO_QSPI.bin"
 #else
-//#define IMAGE_OPEN_LOGO_PATH "/user/res/OPEN_LOGO.bin"
 #ifdef  SINGLE_USER_PARTITION
 #define IMAGE_OPEN_LOGO_PATH "/user/system/KUMI_LOGO.bin"
 #define IMAGE_OTA_LOGO_PATH "/user/system/OTAUpdata.bin"
@@ -95,6 +99,17 @@ static app_task_definition_t taskcfg={0};
 #endif
 #endif
 
+#if defined(BOARD_W9) || defined(BOARD_N9) || defined(BOARD_LEINIAO)
+#ifdef IMAGE_OPEN_LOGO_PATH
+#undef IMAGE_OPEN_LOGO_PATH
+#endif
+#ifdef  SINGLE_USER_PARTITION
+#define IMAGE_OPEN_LOGO_PATH "/user/system/N9_TEST_LOGO.bin"
+#else
+#define IMAGE_OPEN_LOGO_PATH "/system/N9_TEST_LOGO.bin"
+#endif
+#endif
+
 
 static void FreeImagePathsArray(const char **imagePaths, const int numImages)
 {
@@ -183,6 +198,19 @@ bool ShowReBootAnimatorView()
             WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "new ReBootImageAnimatorView fail");
             return false;
         }
+#if defined(BOARD_W9) || defined(BOARD_N9)
+        for (int j = 0, i = REBOOT_IMAGE_ANIMATOR_VIEW_NUM_FRAMES - 1; 
+            i > 0 && j < REBOOT_IMAGE_ANIMATOR_VIEW_NUM_FRAMES; 
+            i--, j++) 
+        {
+            ReBootImageInfo[j].imageInfo = ReBootPathsArray[i];
+            ReBootImageInfo[j].imageType = OHOS::IMG_SRC_IMAGE_INFO;
+            ReBootImageInfo[j].pos.x = REBOOT_IMAGE_ANIMATOR_VIEW_X;
+            ReBootImageInfo[j].pos.y = REBOOT_IMAGE_ANIMATOR_VIEW_Y;
+            ReBootImageInfo[j].width = REBOOT_IMAGE_ANIMATOR_VIEW_W;
+            ReBootImageInfo[j].height = REBOOT_IMAGE_ANIMATOR_VIEW_H;
+        }
+#else
         for (uint8_t i = 0; i < REBOOT_IMAGE_ANIMATOR_VIEW_NUM_FRAMES; i++)
         {
             ReBootImageInfo[i].imageInfo = (ReBootPathsArray[i]);
@@ -192,6 +220,7 @@ bool ShowReBootAnimatorView()
             ReBootImageInfo[i].width = REBOOT_IMAGE_ANIMATOR_VIEW_W;
             ReBootImageInfo[i].height = REBOOT_IMAGE_ANIMATOR_VIEW_H;
         }
+#endif
         ReBootImageAnimatorView->SetPosition(REBOOT_IMAGE_ANIMATOR_VIEW_X, REBOOT_IMAGE_ANIMATOR_VIEW_Y, REBOOT_IMAGE_ANIMATOR_VIEW_W, REBOOT_IMAGE_ANIMATOR_VIEW_H);
         ReBootImageAnimatorView->SetStyle(OHOS::STYLE_BACKGROUND_COLOR, 0xffffffff);
         ReBootImageAnimatorView->SetStyle(OHOS::STYLE_BACKGROUND_OPA, 0xff);
@@ -454,9 +483,6 @@ void ShowGraphicOTALogo(void)
 
 void boot_animation_init_deinit(void)
 {
-    if(taskcfg.task_handle == NULL)
-        return;
-
     errcode_t ret = uapi_terminate_thread(taskcfg.task_handle);
 
     if(ret != ERRCODE_SUCC)
@@ -496,17 +522,6 @@ void PostGraphicEvent(GraphicEventCb eventCb, void* userData)
             eventCb(userData);
             });
 }
-
-void GpuResetStart(void)
-{
-    GraphicService::GetInstance()->GpuResetStart();
-}
-
-void GpuResetEnd(void)
-{
-    GraphicService::GetInstance()->GpuResetEnd();
-}
-
 #ifdef __cplusplus
 };
 #endif