/* * Copyright (c) 2022 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. */ #ifndef FRAMEWORKS_BOOTANIMATION_INCLUDE_BOOT_ANIMATION_H #define FRAMEWORKS_BOOTANIMATION_INCLUDE_BOOT_ANIMATION_H #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include "event_handler.h" #include "player.h" #include "vsync_receiver.h" #include "util.h" namespace OHOS { class BootAnimation { public: void Init(int32_t width, int32_t height); void Draw(); void CheckExitAnimation(); void PlaySound(); bool CheckFrameRateValid(int32_t ratevalue); void Run(std::vector>& displays); ~BootAnimation(); private: void OnVsync(); void OnDraw(SkCanvas* canvas, int32_t curNo); void InitBootWindow(); void InitRsSurface(); void InitPicCoordinates(); int32_t windowWidth_; int32_t windowHeight_; sptr window_; sptr scene_; std::unique_ptr framePtr_; std::shared_ptr rsSurface_; OHOS::Rosen::RenderContext* rc_; int32_t freq_ = 30; int32_t realHeight_ = 0; int32_t realWidth_ = 0; int32_t pointX_ = 0; int32_t pointY_ = 0; int32_t picCurNo_ = -1; int32_t imgVecSize_ = 0; std::shared_ptr receiver_ = nullptr; std::shared_ptr soundPlayer_ = nullptr; ImageStructVec imageVector_; std::shared_ptr mainHandler_ = nullptr; std::shared_ptr runner_ = nullptr; bool setBootEvent_ = false; }; } // namespace OHOS #endif // FRAMEWORKS_BOOTANIMATION_INCLUDE_BOOT_ANIMATION_H