1e9297d28Sopenharmony_ci/* 2e9297d28Sopenharmony_ci * Copyright (c) 2022 Huawei Device Co., Ltd. 3e9297d28Sopenharmony_ci * Licensed under the Apache License, Version 2.0 (the "License"); 4e9297d28Sopenharmony_ci * you may not use this file except in compliance with the License. 5e9297d28Sopenharmony_ci * You may obtain a copy of the License at 6e9297d28Sopenharmony_ci * 7e9297d28Sopenharmony_ci * http://www.apache.org/licenses/LICENSE-2.0 8e9297d28Sopenharmony_ci * 9e9297d28Sopenharmony_ci * Unless required by applicable law or agreed to in writing, software 10e9297d28Sopenharmony_ci * distributed under the License is distributed on an "AS IS" BASIS, 11e9297d28Sopenharmony_ci * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12e9297d28Sopenharmony_ci * See the License for the specific language governing permissions and 13e9297d28Sopenharmony_ci * limitations under the License. 14e9297d28Sopenharmony_ci */ 15e9297d28Sopenharmony_ci 16e9297d28Sopenharmony_ci#include <iostream> 17e9297d28Sopenharmony_ci#include <string> 18e9297d28Sopenharmony_ci#include <unordered_map> 19e9297d28Sopenharmony_ci 20e9297d28Sopenharmony_ci#include "drawing_sample.h" 21e9297d28Sopenharmony_ci 22e9297d28Sopenharmony_ci#include "bitmap_test.h" 23e9297d28Sopenharmony_ci#include "camera_test.h" 24e9297d28Sopenharmony_ci#include "filter_test.h" 25e9297d28Sopenharmony_ci#include "image_test.h" 26e9297d28Sopenharmony_ci#include "matrix_test.h" 27e9297d28Sopenharmony_ci#include "path_effect_test.h" 28e9297d28Sopenharmony_ci#include "path_test.h" 29e9297d28Sopenharmony_ci#include "shader_test.h" 30e9297d28Sopenharmony_ci#include "shadow_test.h" 31e9297d28Sopenharmony_ci#include "pen_test.h" 32e9297d28Sopenharmony_ci 33e9297d28Sopenharmony_ciusing namespace OHOS; 34e9297d28Sopenharmony_ciusing namespace Rosen; 35e9297d28Sopenharmony_ciusing namespace Drawing; 36e9297d28Sopenharmony_ciusing namespace std; 37e9297d28Sopenharmony_ci 38e9297d28Sopenharmony_ciusing TestFunc = std::function<void(Canvas&, uint32_t, uint32_t)>; 39e9297d28Sopenharmony_ci 40e9297d28Sopenharmony_cistatic void TestHello() 41e9297d28Sopenharmony_ci{ 42e9297d28Sopenharmony_ci std::cout << "Drawing module test start.\n"; 43e9297d28Sopenharmony_ci std::cout << "If you want to get more information, \n"; 44e9297d28Sopenharmony_ci std::cout << "please type 'hilog | grep Drawing' in another hdc shell window\n"; 45e9297d28Sopenharmony_ci std::cout << "-------------------------------------------------------\n"; 46e9297d28Sopenharmony_ci} 47e9297d28Sopenharmony_ci 48e9297d28Sopenharmony_ciint main() 49e9297d28Sopenharmony_ci{ 50e9297d28Sopenharmony_ci TestHello(); 51e9297d28Sopenharmony_ci std::map<string, std::vector<TestFunc>> testFuncMap; 52e9297d28Sopenharmony_ci 53e9297d28Sopenharmony_ci testFuncMap.insert(pair<string, std::vector<TestFunc>>("BitmapTest", BitmapTest::GetInstance().BitmapTestCase())); 54e9297d28Sopenharmony_ci testFuncMap.insert(pair<string, std::vector<TestFunc>>("CameraTest", CameraTest::GetInstance().CameraTestCase())); 55e9297d28Sopenharmony_ci testFuncMap.insert(pair<string, std::vector<TestFunc>>("FilterTest", FilterTest::GetInstance().FilterTestCase())); 56e9297d28Sopenharmony_ci testFuncMap.insert(pair<string, std::vector<TestFunc>>("ImageTest", ImageTest::GetInstance().ImageTestCase())); 57e9297d28Sopenharmony_ci testFuncMap.insert(pair<string, std::vector<TestFunc>>("MatrixTest", MatrixTest::GetInstance().MatrixTestCase())); 58e9297d28Sopenharmony_ci testFuncMap.insert(pair<string, std::vector<TestFunc>>("PathTest", PathTest::GetInstance().PathTestCase())); 59e9297d28Sopenharmony_ci testFuncMap.insert(pair<string, std::vector<TestFunc>>("ShaderTest", ShaderTest::GetInstance().ShaderTestCase())); 60e9297d28Sopenharmony_ci testFuncMap.insert(pair<string, std::vector<TestFunc>>("ShadowTest", ShadowTest::GetInstance().ShadowTestCase())); 61e9297d28Sopenharmony_ci testFuncMap.insert(pair<string, std::vector<TestFunc>>("PenTest", PenTest::GetInstance().PenTestCase())); 62e9297d28Sopenharmony_ci 63e9297d28Sopenharmony_ci DrawingSample m; 64e9297d28Sopenharmony_ci m.SetDraw(testFuncMap).Run(); 65e9297d28Sopenharmony_ci std::cout << "Drawing module test end.\n"; 66e9297d28Sopenharmony_ci return 0; 67e9297d28Sopenharmony_ci}