1# Copyright (c) 2021 Huawei Device Co., Ltd. 2# Licensed under the Apache License, Version 2.0 (the "License"); 3# you may not use this file except in compliance with the License. 4# You may obtain a copy of the License at 5# 6# http://www.apache.org/licenses/LICENSE-2.0 7# 8# Unless required by applicable law or agreed to in writing, software 9# distributed under the License is distributed on an "AS IS" BASIS, 10# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 11# See the License for the specific language governing permissions and 12# limitations under the License. 13 14import("//build/ohos.gni") 15import("//foundation/graphic/graphic_2d/graphic_config.gni") 16 17ohos_executable("drawing_engine_sample") { 18 install_enable = true 19 cflags = [ 20 "-Wall", 21 "-Werror", 22 "-Wno-unused-parameter", 23 "-Wno-missing-field-initializers", 24 "-Wno-unused-variable", 25 "-Werror,-Wreturn-type", 26 ] 27 28 sources = [ 29 "drawing_engine_sample.cpp", 30 "main.cpp", 31 ] 32 33 sources += [ 34 "drawing_engine/canvas_context.cpp", 35 "drawing_engine/drawing_proxy.cpp", 36 "drawing_engine/drawing_surface/surface_frame_ohos_raster.cpp", 37 "drawing_engine/drawing_surface/surface_ohos.cpp", 38 "drawing_engine/drawing_surface/surface_ohos_raster.cpp", 39 "drawing_engine/software_render_backend.cpp", 40 ] 41 42 if (ace_enable_gpu) { 43 sources += [ 44 "drawing_engine/drawing_surface/surface_frame_ohos_gl.cpp", 45 "drawing_engine/drawing_surface/surface_ohos_gl.cpp", 46 "drawing_engine/egl_manager.cpp", 47 "drawing_engine/gles_render_backend.cpp", 48 ] 49 } 50 51 configs = [] 52 53 include_dirs = [ 54 "include", 55 "drawing_engine", 56 "drawing_engine/drawing_surface", 57 "//foundation/graphic/graphic_2d/rosen/modules/composer/hdi_backend/include", 58 "//foundation/graphic/graphic_2d/utils/sync_fence/export", 59 "//foundation/graphic/graphic_2d/rosen/include/common", 60 "//foundation/communication/ipc/interfaces/innerkits/ipc_core/include", 61 ] 62 63 sources += [ 64 "benchmarks/benchmark_config.cpp", 65 "benchmarks/benchmark_multithread/drawing_mutilthread.cpp", 66 "benchmarks/benchmark_singlethread/drawing_singlethread.cpp", 67 ] 68 69 include_dirs += [ 70 "benchmarks", 71 "benchmarks/benchmark_singlethread", 72 "benchmarks/benchmark_multithread", 73 "benchmarks/benchmark_api", 74 ] 75 76 deps = [ 77 "//foundation/graphic/graphic_2d:libsurface", 78 "//foundation/graphic/graphic_2d/rosen/modules/composer:libcomposer", 79 "//foundation/graphic/graphic_2d/utils:sync_fence", 80 "//third_party/flutter/build/skia:ace_skia_ohos", 81 ] 82 public_deps = libgl 83 defines = gpu_defines 84 85 #defines = [ "USE_CANVASKIT0310_SKIA" ] 86 #defines += gpu_defines 87 deps += [ 88 #"//third_party/skia:skia", 89 ] 90 91 external_deps = [ 92 "c_utils:utils", 93 "eventhandler:libeventhandler", 94 "hilog_native:libhilog", 95 ] 96 97 subsystem_name = "graphic" 98 part_name = "graphic_standard" 99} 100 101ohos_executable("drawing_sample_rs") { 102 install_enable = true 103 104 sources = [ "drawing_c_sample.cpp" ] 105 106 include_dirs = [ 107 "//foundation/graphic/graphic_2d/rosen/modules/2d_graphics/include", 108 "//foundation/graphic/graphic_2d/rosen/modules/2d_graphics/src", 109 "//foundation/graphic/graphic_2d/rosen/modules/render_service_base/src", 110 "//foundation/graphic/graphic_2d/rosen/modules/render_service_base/include", 111 "//foundation/graphic/graphic_2d/rosen/modules/render_service_client", 112 "//foundation/graphic/graphic_2d/rosen/include/common", 113 "//foundation/window/window_manager/interfaces/innerkits/wm", 114 ] 115 116 deps = [ 117 "//foundation/graphic/graphic_2d/rosen/modules/2d_graphics:2d_graphics", 118 "//foundation/graphic/graphic_2d/rosen/modules/render_service_base:librender_service_base", 119 "//foundation/graphic/graphic_2d/rosen/modules/render_service_client:librender_service_client", 120 "//third_party/zlib:libz", 121 ] 122 123 external_deps = [ "hilog_native:libhilog" ] 124 125 part_name = "graphic_standard" 126 subsystem_name = "graphic" 127} 128 129ohos_executable("drawing_sample_canvaskit0310") { 130 install_enable = true 131 132 sources = [ "drawing_sample_canvaskit0310.cpp" ] 133 134 include_dirs = [ 135 "//foundation/graphic/graphic_2d/rosen/modules/composer/hdi_backend/include", 136 "//foundation/graphic/graphic_2d/rosen/include/common", 137 "//foundation/graphic/graphic_2d/interfaces/inner_api/common", 138 "//foundation/graphic/graphic_2d/rosen/modules/composer/vsync/include", 139 "//foundation/graphic/graphic_2d/rosen/modules/2d_graphics/include", 140 "//foundation/graphic/graphic_2d/rosen/modules/2d_graphics/src", 141 ] 142 143 deps = [ 144 "//foundation/graphic/graphic_2d:libsurface", 145 "//foundation/graphic/graphic_2d/rosen/modules/2d_graphics:2d_graphics_canvaskit0310", 146 "//foundation/graphic/graphic_2d/rosen/modules/composer:libcomposer", 147 "//foundation/graphic/graphic_2d/utils:libgraphic_utils", 148 "//foundation/graphic/graphic_2d/utils:sync_fence", 149 ] 150 151 external_deps = [ 152 "hilog_native:libhilog", 153 "ipc:ipc_core", 154 ] 155 156 part_name = "graphic_standard" 157 subsystem_name = "graphic" 158} 159