1 /* 2 * Copyright (c) 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_COMPONENTS_NG_MOCK_ROSEN_TEST_TESTING_DRAW_CMD_LIST_H 17 #define FOUNDATION_ACE_FRAMEWORKS_CORE_COMPONENTS_NG_MOCK_ROSEN_TEST_TESTING_DRAW_CMD_LIST_H 18 19 #include <cstdint> 20 21 #include "testing_canvas.h" 22 #include "testing_rect.h" 23 namespace OHOS::Ace::Testing { 24 enum class TestingHybridRenderType : uint32_t { 25 NONE, 26 TEXT, 27 SVG, 28 HMSYMBOL, 29 CANVAS, 30 TYPE_MAX 31 }; 32 33 class TestingDrawCmdList { 34 public: 35 TestingDrawCmdList() = default; 36 virtual ~TestingDrawCmdList() = default; 37 GetWidth()38 int32_t GetWidth() const 39 { 40 return width_; 41 } 42 GetHeight()43 int32_t GetHeight() const 44 { 45 return height_; 46 } 47 SetWidth(int32_t width)48 void SetWidth(int32_t width) 49 { 50 width_ = width; 51 } 52 SetHeight(int32_t height)53 void SetHeight(int32_t height) 54 { 55 height_ = height; 56 } 57 IsEmpty()58 bool IsEmpty() const 59 { 60 return false; 61 } 62 GetOpItemSize()63 size_t GetOpItemSize() const 64 { 65 return 0; 66 } 67 68 void Playback(TestingCanvas& canvas, const TestingRect* rect = nullptr) {} 69 SetHybridRenderType(Testing::TestingHybridRenderType HybridRenderType)70 void SetHybridRenderType(Testing::TestingHybridRenderType HybridRenderType) {} 71 72 private: 73 int32_t width_ = 0; 74 int32_t height_ = 0; 75 }; 76 } // namespace OHOS::Ace::Testing 77 #endif // FOUNDATION_ACE_FRAMEWORKS_CORE_COMPONENTS_NG_MOCK_ROSEN_TEST_TESTING_DRAW_CMD_LIST_H 78