• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
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_CLIP_RRECT_LAYER_H
9 #define FLUTTER_FLOW_OHOS_LAYERS_CLIP_RRECT_LAYER_H
10 
11 #include "third_party/skia/include/core/SkRRect.h"
12 
13 #include "flutter/flow/ohos_layers/container_layer.h"
14 #include "flutter/flow/ohos_layers/layer.h"
15 
16 namespace flutter::OHOS {
17 
18 class ClipRRectLayer : public ContainerLayer {
19 public:
ClipRRectLayer(const SkRRect & clipRrect,Clip clipBehavior)20     ClipRRectLayer(const SkRRect& clipRrect, Clip clipBehavior)
21         : clipRrect_(clipRrect), clipBehavior_(clipBehavior) {}
22     ~ClipRRectLayer() override = default;
23 
24     void Prepare(const SkMatrix& matrix) override;
25 
26     void Paint(const PaintContext& paintContext) const override;
27 
28 private:
29     SkRRect clipRrect_;
30     Clip clipBehavior_;
31 
32     FML_DISALLOW_COPY_AND_ASSIGN(ClipRRectLayer);
33 };
34 
35 }  // namespace flutter::OHOS
36 
37 #endif  // FLUTTER_FLOW_OHOS_LAYERS_CLIP_RRECT_LAYER_H