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 FLUTTER_SHELL_PLATFORM_OHOS_OHOS_SURFACE_H_ 8 #define FLUTTER_SHELL_PLATFORM_OHOS_OHOS_SURFACE_H_ 9 10 #include <memory> 11 12 #include "flutter/fml/macros.h" 13 #include "flutter/shell/common/surface.h" 14 #include "wm/window.h" 15 #include <ui/rs_surface_node.h> 16 17 namespace flutter { 18 19 class OhosSurface { 20 public: 21 OhosSurface() = default; 22 23 virtual ~OhosSurface() = default; 24 25 virtual bool IsValid() const = 0; 26 27 virtual std::unique_ptr<Surface> CreateGPUSurface() = 0; 28 29 virtual bool OnScreenSurfaceResize(const SkISize& size) = 0; 30 31 virtual void SetPlatformWindow(const ::OHOS::sptr<::OHOS::Rosen::Window> &window) = 0; 32 33 virtual bool ResourceContextMakeCurrent() = 0; 34 35 virtual bool ResourceContextClearCurrent() = 0; 36 37 virtual void TeardownOnScreenContext() = 0; 38 }; 39 40 } // namespace flutter 41 42 #endif // FLUTTER_SHELL_PLATFORM_OHOS_OHOS_SURFACE_H_ 43