1 /*
2  * Copyright (c) 2022-2023 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 FOUNDATION_ACE_FRAMEWORKS_CORE_PAINTER_ROSEN_DEBUG_BOUNDARY_PAINTER_H
17 #define FOUNDATION_ACE_FRAMEWORKS_CORE_PAINTER_ROSEN_DEBUG_BOUNDARY_PAINTER_H
18 
19 #include <cmath>
20 
21 #ifndef USE_ROSEN_DRAWING
22 #include "include/core/SkCanvas.h"
23 #include "include/core/SkPaint.h"
24 #endif
25 
26 #include "base/memory/ace_type.h"
27 #include "base/utils/utils.h"
28 #include "core/components/common/layout/constants.h"
29 #include "core/components/common/properties/decoration.h"
30 #include "core/components/common/properties/edge.h"
31 
32 namespace OHOS::Ace {
33 class DebugBoundaryPainter : public virtual AceType {
34     DECLARE_ACE_TYPE(DebugBoundaryPainter, AceType);
35 public:
36 #ifndef USE_ROSEN_DRAWING
37     static void PaintDebugBoundary(SkCanvas* canvas, const Offset& offset, const Size& layoutSize);
38     static void PaintDebugMargin(SkCanvas* canvas, const Offset& offset, const Size& layoutSize, const EdgePx& margin);
39     static void PaintDebugCorner(SkCanvas* canvas, const Offset& offset, const Size& layoutSize);
40 #else
41     static void PaintDebugBoundary(RSCanvas* canvas, const Offset& offset, const Size& layoutSize);
42     static void PaintDebugMargin(RSCanvas* canvas, const Offset& offset,
43         const Size& layoutSize, const EdgePx& margin);
44     static void PaintDebugCorner(RSCanvas* canvas, const Offset& offset, const Size& layoutSize);
45 #endif
46 };
47 }
48 
49 #endif // FOUNDATION_ACE_FRAMEWORKS_CORE_PAINTER_ROSEN_DEBUG_BOUNDARY_PAINTER_H