1 // Copyright 2013 The Flutter Authors. All rights reserved. 2 // Use of this source code is governed by a BSD-style license that can be 3 // found in the LICENSE file. 4 // 2021.4.30 platform view adapt ohos. 5 // Copyright (c) 2021 Huawei Device Co., Ltd. All rights reserved. 6 7 #ifndef SHELL_PLATFORM_OHOS_PLATFORM_VIEW_OHOS_H_ 8 #define SHELL_PLATFORM_OHOS_PLATFORM_VIEW_OHOS_H_ 9 10 #include "flutter/shell/common/platform_view.h" 11 #include "flutter/shell/platform/ohos/ohos_surface.h" 12 13 namespace flutter { 14 15 class PlatformViewOhos final : public PlatformView { 16 public: 17 PlatformViewOhos(PlatformView::Delegate& delegate, flutter::TaskRunners task_runners, bool use_software_rendering); 18 19 void NotifyCreated(const ::OHOS::sptr<::OHOS::Rosen::Window> &window); 20 void NotifyChanged(const SkISize& size); 21 std::unique_ptr<Surface> CreateRenderingSurface(); 22 std::unique_ptr<VsyncWaiter> CreateVSyncWaiter(int32_t platform); 23 24 private: 25 std::shared_ptr<OhosSurface> surface_; 26 FML_DISALLOW_COPY_AND_ASSIGN(PlatformViewOhos); 27 }; 28 29 } // namespace flutter 30 31 #endif // SHELL_PLATFORM_OHOS_PLATFORM_VIEW_OHOS_H_ 32