1 // Copyright 2013 The Flutter Authors. All rights reserved. 2 // Copyright (c) Huawei Technologies Co., Ltd. 2021. All rights reserved. 3 // Use of this source code is governed by a BSD-style license that can be 4 // found in the LICENSE file. 5 // 2021.2.10 Increase the process used in native_view mode. 6 // Copyright (c) 2021 Huawei Device Co., Ltd. All rights reserved. 7 8 #ifndef FLUTTER_FLOW_OHOS_LAYERS_PAINT_CONTEXT_H 9 #define FLUTTER_FLOW_OHOS_LAYERS_PAINT_CONTEXT_H 10 11 #include "third_party/skia/include/core/SkCanvas.h" 12 #include "third_party/skia/include/core/SkPoint.h" 13 14 #include "flutter/flow/ohos_layers/texture_register.h" 15 16 namespace flutter::OHOS { 17 18 struct PaintContext { PaintContextPaintContext19 PaintContext(SkCanvas* skCvs, 20 const std::shared_ptr<flutter::OHOS::TextureRegistry>& texReg) 21 : textureRegistry(texReg), skCanvas(skCvs) {} 22 virtual ~PaintContext() = default; 23 virtual void Paint(int64_t textureId, const SkPoint& offset, uint8_t opacity) const = 0; 24 std::shared_ptr<flutter::OHOS::TextureRegistry> textureRegistry; 25 SkCanvas* skCanvas = nullptr; 26 }; 27 28 } // namespace flutter::OHOS 29 30 #endif // FOUNDATION_ACE_CORE_RENDERING_PAINT_CONTEXT_H 31