1 /* 2 * Copyright (c) 2022 Huawei Device Co., Ltd. 3 * Licensed under the Apache License, Version 2.0 (the "License"); 4 * you may not use this file except in compliance with the License. 5 * You may obtain a copy of the License at 6 * 7 * http://www.apache.org/licenses/LICENSE-2.0 8 * 9 * Unless required by applicable law or agreed to in writing, software 10 * distributed under the License is distributed on an "AS IS" BASIS, 11 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 * See the License for the specific language governing permissions and 13 * limitations under the License. 14 */ 15 16 #ifndef OHOS_ROSEN_STARTING_WINDOW_H 17 #define OHOS_ROSEN_STARTING_WINDOW_H 18 19 #include <refbase.h> 20 #include "pixel_map.h" 21 #include "animation_config.h" 22 #include "surface_draw.h" 23 #include "wm_common.h" 24 #include "window_node.h" 25 #include "window_transition_info.h" 26 27 namespace OHOS { 28 namespace Rosen { 29 class StartingWindow : public RefBase { 30 public: 31 StartingWindow() = delete; 32 ~StartingWindow() = default; 33 34 static sptr<WindowNode> CreateWindowNode(const sptr<WindowTransitionInfo>& info, uint32_t winId); 35 static void HandleClientWindowCreate(sptr<WindowNode>& node, sptr<IWindow>& window, 36 uint32_t& windowId, const std::shared_ptr<RSSurfaceNode>& surfaceNode, sptr<WindowProperty>& property, 37 int32_t pid, int32_t uid); 38 static WMError DrawStartingWindow(sptr<WindowNode>& node, std::shared_ptr<Media::PixelMap> pixelMap, 39 uint32_t bkgColor, bool isColdStart); 40 static void AddNodeOnRSTree(sptr<WindowNode>& node, const AnimationConfig& animationConfig, bool isMultiDisplay); 41 static void ReleaseStartWinSurfaceNode(sptr<WindowNode>& node); 42 static void SetDefaultWindowMode(WindowMode defaultMode); 43 44 private: 45 static WMError CreateLeashAndStartingSurfaceNode(sptr<WindowNode>& node); 46 static SurfaceDraw surfaceDraw_; 47 static std::recursive_mutex mutex_; 48 static WindowMode defaultMode_; 49 }; 50 } // Rosen 51 } // OHOS 52 #endif // OHOS_ROSEN_STARTING_WINDOW_H 53