14 Star 8 Fork 215

OpenHarmony / third_party_skia

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
克隆/下载
BUILD.gn 106.51 KB
一键复制 编辑 原始数据 按行查看 历史
zjy 提交于 2024-05-16 19:14 . 修复arkui-x编译问题
1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852185318541855185618571858185918601861186218631864186518661867186818691870187118721873187418751876187718781879188018811882188318841885188618871888188918901891189218931894189518961897189818991900190119021903190419051906190719081909191019111912191319141915191619171918191919201921192219231924192519261927192819291930193119321933193419351936193719381939194019411942194319441945194619471948194919501951195219531954195519561957195819591960196119621963196419651966196719681969197019711972197319741975197619771978197919801981198219831984198519861987198819891990199119921993199419951996199719981999200020012002200320042005200620072008200920102011201220132014201520162017201820192020202120222023202420252026202720282029203020312032203320342035203620372038203920402041204220432044204520462047204820492050205120522053205420552056205720582059206020612062206320642065206620672068206920702071207220732074207520762077207820792080208120822083208420852086208720882089209020912092209320942095209620972098209921002101210221032104210521062107210821092110211121122113211421152116211721182119212021212122212321242125212621272128212921302131213221332134213521362137213821392140214121422143214421452146214721482149215021512152215321542155215621572158215921602161216221632164216521662167216821692170217121722173217421752176217721782179218021812182218321842185218621872188218921902191219221932194219521962197219821992200220122022203220422052206220722082209221022112212221322142215221622172218221922202221222222232224222522262227222822292230223122322233223422352236223722382239224022412242224322442245224622472248224922502251225222532254225522562257225822592260226122622263226422652266226722682269227022712272227322742275227622772278227922802281228222832284228522862287228822892290229122922293229422952296229722982299230023012302230323042305230623072308230923102311231223132314231523162317231823192320232123222323232423252326232723282329233023312332233323342335233623372338233923402341234223432344234523462347234823492350235123522353235423552356235723582359236023612362236323642365236623672368236923702371237223732374237523762377237823792380238123822383238423852386238723882389239023912392239323942395239623972398239924002401240224032404240524062407240824092410241124122413241424152416241724182419242024212422242324242425242624272428242924302431243224332434243524362437243824392440244124422443244424452446244724482449245024512452245324542455245624572458245924602461246224632464246524662467246824692470247124722473247424752476247724782479248024812482248324842485248624872488248924902491249224932494249524962497249824992500250125022503250425052506250725082509251025112512251325142515251625172518251925202521252225232524252525262527252825292530253125322533253425352536253725382539254025412542254325442545254625472548254925502551255225532554255525562557255825592560256125622563256425652566256725682569257025712572257325742575257625772578257925802581258225832584258525862587258825892590259125922593259425952596259725982599260026012602260326042605260626072608260926102611261226132614261526162617261826192620262126222623262426252626262726282629263026312632263326342635263626372638263926402641264226432644264526462647264826492650265126522653265426552656265726582659266026612662266326642665266626672668266926702671267226732674267526762677267826792680268126822683268426852686268726882689269026912692269326942695269626972698269927002701270227032704270527062707270827092710271127122713271427152716271727182719272027212722272327242725272627272728272927302731273227332734273527362737273827392740274127422743274427452746274727482749275027512752275327542755275627572758275927602761276227632764276527662767276827692770277127722773277427752776277727782779278027812782278327842785278627872788278927902791279227932794279527962797279827992800280128022803280428052806280728082809281028112812281328142815281628172818281928202821282228232824282528262827282828292830283128322833283428352836283728382839284028412842284328442845284628472848284928502851285228532854285528562857285828592860286128622863286428652866286728682869287028712872287328742875287628772878287928802881288228832884288528862887288828892890289128922893289428952896289728982899290029012902290329042905290629072908290929102911291229132914291529162917291829192920292129222923292429252926292729282929293029312932293329342935293629372938293929402941294229432944294529462947294829492950295129522953295429552956295729582959296029612962296329642965296629672968296929702971297229732974297529762977297829792980298129822983298429852986298729882989299029912992299329942995299629972998299930003001300230033004300530063007300830093010301130123013301430153016301730183019302030213022302330243025302630273028302930303031303230333034303530363037303830393040304130423043304430453046304730483049305030513052305330543055305630573058305930603061306230633064306530663067306830693070307130723073307430753076307730783079308030813082308330843085308630873088308930903091309230933094309530963097309830993100310131023103310431053106310731083109311031113112311331143115311631173118311931203121312231233124312531263127312831293130313131323133313431353136313731383139314031413142314331443145314631473148314931503151315231533154315531563157315831593160316131623163316431653166316731683169317031713172317331743175317631773178317931803181318231833184318531863187318831893190319131923193319431953196319731983199320032013202320332043205320632073208320932103211321232133214321532163217321832193220322132223223322432253226322732283229323032313232323332343235323632373238323932403241324232433244324532463247324832493250325132523253325432553256325732583259326032613262326332643265326632673268326932703271327232733274327532763277327832793280328132823283328432853286328732883289329032913292329332943295329632973298329933003301330233033304330533063307330833093310331133123313331433153316331733183319332033213322332333243325332633273328332933303331333233333334333533363337333833393340334133423343334433453346334733483349335033513352335333543355335633573358335933603361336233633364336533663367336833693370337133723373337433753376337733783379338033813382338333843385338633873388338933903391339233933394339533963397339833993400340134023403340434053406340734083409341034113412341334143415341634173418341934203421342234233424342534263427342834293430343134323433343434353436343734383439344034413442344334443445344634473448344934503451345234533454345534563457345834593460346134623463346434653466346734683469347034713472347334743475347634773478347934803481348234833484348534863487348834893490349134923493349434953496349734983499350035013502350335043505350635073508350935103511351235133514351535163517351835193520352135223523352435253526352735283529353035313532353335343535353635373538353935403541354235433544354535463547354835493550355135523553355435553556355735583559356035613562356335643565356635673568356935703571357235733574357535763577357835793580358135823583358435853586358735883589359035913592359335943595359635973598359936003601360236033604360536063607360836093610361136123613361436153616361736183619362036213622362336243625362636273628362936303631363236333634363536363637363836393640364136423643364436453646364736483649365036513652365336543655365636573658365936603661366236633664366536663667366836693670367136723673367436753676367736783679368036813682368336843685368636873688368936903691369236933694369536963697369836993700370137023703370437053706370737083709371037113712371337143715371637173718371937203721372237233724372537263727372837293730373137323733373437353736373737383739374037413742374337443745374637473748374937503751375237533754375537563757375837593760376137623763376437653766376737683769377037713772377337743775377637773778377937803781378237833784378537863787378837893790379137923793379437953796379737983799380038013802380338043805380638073808380938103811381238133814381538163817381838193820382138223823382438253826382738283829383038313832383338343835383638373838383938403841384238433844384538463847384838493850385138523853385438553856385738583859386038613862386338643865386638673868386938703871387238733874387538763877387838793880388138823883388438853886388738883889389038913892389338943895389638973898389939003901390239033904390539063907390839093910391139123913391439153916391739183919392039213922392339243925392639273928392939303931393239333934393539363937393839393940394139423943394439453946394739483949395039513952395339543955395639573958395939603961396239633964396539663967396839693970397139723973397439753976397739783979398039813982398339843985398639873988398939903991399239933994399539963997399839994000400140024003400440054006400740084009401040114012401340144015401640174018401940204021402240234024402540264027
# Copyright 2016 Google Inc.
#
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
import("//build/ohos.gni")
import("//foundation/arkui/ace_engine/ace_config.gni")
import("//foundation/graphic/graphic_2d/graphic_config.gni")
import("gn/flutter_defines.gni")
import("gn/fuchsia_defines.gni")
import("gn/shared_sources.gni")
import("gn/skia.gni")
if (defined(is_mingw) && is_mingw == true) {
is_win = true
}
if (is_fuchsia) {
import("${skia_root_dir}/build/fuchsia/sdk.gni")
import("build/fuchsia/fuchsia_download_sdk.gni")
}
if (skia_use_dawn) {
import("${skia_third_party_dir}/externals/dawn/scripts/dawn_features.gni")
}
if (defined(skia_settings)) {
import(skia_settings)
}
import("gn/ios.gni")
config("skia_wno") {
cflags = [
"-Wno-deprecated-declarations",
"-Wno-pessimizing-move",
"-Wno-return-type",
"-Wno-sign-compare",
"-Wno-sometimes-uninitialized",
"-Wno-unknown-pragmas",
"-Wno-unused-function",
"-Wno-unused-private-field",
"-Wno-unused-variable",
"-Wno-c++17-extensions",
]
if (is_ohos && is_clang && (target_cpu == "arm" || target_cpu == "arm64")) {
cflags += [ "-flto=thin" ]
if (enhanced_opt) {
cflags += [ "-fwhole-program-vtables" ]
if (graphic_2d_feature_enable_pgo &&
graphic_2d_feature_product != "default") {
cflags += [
"-fprofile-use=" + rebase_path(
"${graphic_2d_feature_pgo_path}/libskia_canvaskit.profdata",
root_build_dir),
"-Wno-error=backend-plugin",
"-Wno-profile-instr-out-of-date",
"-Wno-profile-instr-unprofiled",
]
}
if (graphic_2d_feature_product == "pc" && target_cpu == "arm64" &&
current_cpu == "arm64") {
cflags += [ "-moutline-atomics" ]
}
}
}
ldflags = [
"--stdlib=libc++",
"-lc++",
"-lc++abi",
]
}
# Skia public API, generally provided by :skia.
config("skia_public") {
include_dirs = [ "." ]
defines = [ "NEW_SKIA" ]
include_dirs += [ "//base/hiviewdfx/hitrace/interfaces/native/innerkits/include/hitrace_meter" ]
if (defined(skia_ohos_debug) && skia_ohos_debug) {
defines += [ "SKIA_OHOS_DEBUG" ]
}
if (defined(skia_use_xeg) && skia_use_xeg) {
defines += [ "SKIA_USE_XEG" ]
}
if (is_ohos && (target_cpu == "arm" || target_cpu == "arm64")) {
defines += [ "SKIA_OHOS_FOR_OHOS_TRACE" ]
}
cflags_objcc = []
if (is_skia_dev_build) {
defines += [ "GR_TEST_UTILS=1" ]
}
if (is_skia_component_build) {
defines += [ "SKIA_DLL" ]
}
if (is_arkui_x && defined(is_android) && is_android) {
defines += [ "SK_BUILD_FOR_ANDROID" ]
}
defines += [ "SK_BUILD_FOR_OHOS" ]
if (is_fuchsia || is_linux) {
defines += [ "SK_R32_SHIFT=16" ]
}
if (skia_enable_flutter_defines) {
defines += flutter_defines
}
if (!skia_enable_gpu) {
defines += [ "SK_SUPPORT_GPU=0" ]
}
if (skia_enable_sksl) {
defines += [ "SK_ENABLE_SKSL" ]
}
if (is_fuchsia) {
defines += fuchsia_defines
}
if (skia_gl_standard == "gles") {
defines += [ "SK_ASSUME_GL_ES=1" ]
} else if (skia_gl_standard == "gl") {
defines += [ "SK_ASSUME_GL=1" ]
} else if (skia_gl_standard == "webgl") {
defines += [
"SK_ASSUME_WEBGL=1",
"SK_USE_WEBGL",
]
}
if (!skia_enable_skgpu_v1) {
defines += [ "SK_GPU_V1=0" ]
}
if (ace_enable_skia_small_page_texture && is_ohos) {
defines += [ "SK_ENABLE_SMALL_PAGE" ]
}
# Some older versions of the Clang toolchain change the visibility of
# symbols decorated with API_AVAILABLE macro to be visible. Users of such
# toolchains suppress the use of this macro till toolchain updates are made.
if (is_mac) {
defines += [ "SK_GL_ENABLE_330_MAC" ]
}
if (is_mac || is_ios) {
if (skia_enable_api_available_macro) {
defines += [ "SK_ENABLE_API_AVAILABLE" ]
} else {
cflags_objcc += [ "-Wno-unguarded-availability" ]
}
}
if (is_win) {
defines += [ "SK_BUILD_FOR_WIN" ]
}
}
# Skia internal APIs, used by Skia itself and a few test tools.
config("skia_private") {
visibility = [ "./*" ]
cflags = [
"-Wno-format",
"-fvisibility=hidden",
]
cflags_cc = [
"-Wno-array-parameter",
"-fvisibility-inlines-hidden",
]
defines = [ "SK_GAMMA_APPLY_TO_A8" ]
if (target_cpu == "x86_64" || current_os == "windows" ||
current_os == "mac" || current_os == "linux" || current_os == "ios") {
cflags_cc += [ "-Wno-psabi" ]
}
if (skia_use_fixed_gamma_text) {
defines += [
"SK_GAMMA_EXPONENT=1.0",
"SK_GAMMA_CONTRAST=0.0",
]
}
if (is_skia_dev_build) {
defines += [ "SK_ALLOW_STATIC_GLOBAL_INITIALIZERS=1" ]
if (skia_enable_graphite) {
defines += [ "GRAPHITE_TEST_UTILS=1" ]
}
}
libs = []
lib_dirs = []
if (skia_use_gl && skia_use_angle) {
defines += [ "SK_ANGLE" ]
}
if (skia_use_vma) {
defines += [ "SK_USE_VMA" ]
}
if (skia_enable_winuwp) {
defines += [ "SK_WINUWP" ]
}
}
# Any code that's linked into Skia-the-library should use this config via += skia_library_configs.
config("skia_library") {
visibility = [ "./*" ]
defines = [ "SKIA_IMPLEMENTATION=1" ]
}
skia_library_configs = [
":skia_public",
":skia_private",
":skia_library",
]
# Use for CPU-specific Skia code that needs particular compiler flags.
template("opts") {
if (invoker.enabled) {
skia_source_set(target_name) {
visibility = [ ":*" ]
check_includes = false
configs = skia_library_configs
forward_variables_from(invoker, "*")
if (defined(invoker.configs)) {
configs += invoker.configs
}
}
} else {
# If not enabled, a phony empty target that swallows all otherwise unused variables.
skia_source_set(target_name) {
visibility = [ ":*" ]
check_includes = false
forward_variables_from(invoker,
"*",
[
"sources",
"cflags",
])
}
}
}
is_x86 = current_cpu == "x64" || current_cpu == "x86"
opts("none") {
enabled = !is_x86 && current_cpu != "arm" && current_cpu != "arm64"
sources = skia_opts.none_sources
cflags = []
}
opts("armv7") {
enabled = current_cpu == "arm"
sources = skia_opts.armv7_sources + skia_opts.neon_sources
cflags = []
}
opts("arm64") {
enabled = current_cpu == "arm64"
sources = skia_opts.arm64_sources
cflags = []
}
opts("crc32") {
enabled = current_cpu == "arm64"
sources = skia_opts.crc32_sources
cflags = [ "-march=armv8-a+crc" ]
}
opts("sse2") {
enabled = is_x86
sources = skia_opts.sse2_sources
if (!is_clang && is_win) {
defines = [ "SK_CPU_SSE_LEVEL=SK_CPU_SSE_LEVEL_SSE2" ]
} else {
cflags = [ "-msse2" ]
}
}
opts("ssse3") {
enabled = is_x86
sources = skia_opts.ssse3_sources
if (!is_clang && is_win) {
defines = [ "SK_CPU_SSE_LEVEL=SK_CPU_SSE_LEVEL_SSSE3" ]
} else {
cflags = [ "-mssse3" ]
}
}
opts("sse41") {
enabled = is_x86
sources = skia_opts.sse41_sources
if (!is_clang && is_win) {
defines = [ "SK_CPU_SSE_LEVEL=SK_CPU_SSE_LEVEL_SSE41" ]
} else {
cflags = [ "-msse4.1" ]
}
}
opts("sse42") {
enabled = is_x86
sources = skia_opts.sse42_sources
if (!is_clang && is_win) {
defines = [ "SK_CPU_SSE_LEVEL=SK_CPU_SSE_LEVEL_SSE42" ]
} else {
cflags = [ "-msse4.2" ]
}
}
opts("avx") {
enabled = is_x86
sources = skia_opts.avx_sources
if (is_win && !is_mingw) {
cflags = [ "/arch:AVX" ]
} else {
cflags = [ "-mavx" ]
if (is_mac && is_debug) {
cflags += [ "-fno-stack-check" ] # Work around skia:9709
}
}
}
opts("hsw") {
enabled = is_x86
sources = skia_opts.hsw_sources
if (is_win && !is_mingw) {
cflags = [ "/arch:AVX2" ]
} else {
cflags = [ "-march=haswell" ]
if (is_mac && is_debug) {
cflags += [ "-fno-stack-check" ] # Work around skia:9709
}
}
}
opts("skx") {
enabled = is_x86
sources = skia_opts.skx_sources
if (is_win && !is_mingw) {
cflags = [ "/arch:AVX512" ]
} else {
cflags = [ "-march=skylake-avx512" ]
if (is_mac && is_debug) {
cflags += [ "-fno-stack-check" ] # Work around skia:9709
}
}
}
# Any feature of Skia that requires third-party code should be optional and use this template.
template("optional") {
if (invoker.enabled) {
config(target_name + "_public") {
if (defined(invoker.public_defines)) {
defines = invoker.public_defines
}
if (defined(invoker.public_configs)) {
configs = invoker.public_configs
}
if (defined(invoker.public_include_dirs)) {
include_dirs = invoker.public_include_dirs
}
}
skia_source_set(target_name) {
visibility = [ ":*" ]
check_includes = false
configs = skia_library_configs
configs += [ ":skia_wno" ]
# "*" clobbers the current scope; append to existing configs
forward_variables_from(invoker,
"*",
[
"configs",
"public_defines",
"sources_for_tests",
"sources_when_disabled",
])
if (defined(invoker.configs)) {
configs += invoker.configs
}
all_dependent_configs = [ ":" + target_name + "_public" ]
}
if (defined(invoker.sources_for_tests) && skia_enable_tools) {
skia_source_set(target_name + "_tests") {
visibility = [ ":*" ]
check_includes = false
configs = skia_library_configs
# "*" clobbers the current scope; append to existing configs
forward_variables_from(invoker,
"*",
[
"configs",
"public_defines",
"sources",
"sources_for_tests",
"sources_when_disabled",
])
if (defined(invoker.configs)) {
configs += invoker.configs
}
testonly = true
sources = invoker.sources_for_tests
if (!defined(deps)) {
deps = []
}
deps += [ ":test" ]
all_dependent_configs = [ ":" + target_name + "_public" ]
}
}
} else {
skia_source_set(target_name) {
visibility = [ ":*" ]
configs = skia_library_configs
# "*" clobbers the current scope; append to existing configs
forward_variables_from(invoker,
"*",
[
"configs",
"public",
"public_defines",
"public_deps",
"deps",
"libs",
"frameworks",
"sources",
"sources_for_tests",
"sources_when_disabled",
])
if (defined(invoker.configs)) {
configs += invoker.configs
}
if (defined(invoker.sources_when_disabled)) {
sources = invoker.sources_when_disabled
}
}
if (defined(invoker.sources_for_tests)) {
skia_source_set(target_name + "_tests") {
visibility = [ ":*" ]
}
}
}
}
optional("android_utils") {
enabled = skia_enable_android_utils
public = [
"client_utils/android/BRDAllocator.h",
"client_utils/android/BitmapRegionDecoder.h",
"client_utils/android/FrontBufferedStream.h",
]
public_defines = [ "SK_ENABLE_ANDROID_UTILS" ]
sources = [
"client_utils/android/BitmapRegionDecoder.cpp",
"client_utils/android/FrontBufferedStream.cpp",
]
}
group("fontmgr_factory") {
public_deps = [ skia_fontmgr_factory ]
}
optional("fontmgr_empty_factory") {
if (use_oh_skia) {
enabled = false
} else {
enabled = true
}
sources = [ "src/ports/SkFontMgr_empty_factory.cpp" ]
}
optional("fontmgr_android") {
enabled = skia_enable_fontmgr_android
deps = [
":typeface_freetype",
"${skia_third_party_dir}/expat",
]
public = [ "include/ports/SkFontMgr_android.h" ]
sources = [
"src/ports/SkFontMgr_android.cpp",
"src/ports/SkFontMgr_android_parser.cpp",
"src/ports/SkFontMgr_android_parser.h",
]
sources_for_tests = [ "tests/FontMgrAndroidParserTest.cpp" ]
}
optional("fontmgr_android_factory") {
enabled = skia_enable_fontmgr_android
deps = [ ":fontmgr_android" ]
sources = [ "src/ports/SkFontMgr_android_factory.cpp" ]
}
optional("fontmgr_custom") {
enabled =
skia_enable_fontmgr_custom_directory ||
skia_enable_fontmgr_custom_embedded || skia_enable_fontmgr_custom_empty
deps = [ ":typeface_freetype" ]
public = [ "src/ports/SkFontMgr_custom.h" ]
sources = [ "src/ports/SkFontMgr_custom.cpp" ]
}
optional("fontmgr_symbol_load") {
enabled = skia_enable_fontmgr_ohos || skia_enable_fontmgr_win ||
skia_use_fonthost_mac
include_dirs = [
"//third_party/skia/include/private",
"//third_party/skia/include/core",
"//third_party/skia/src/core",
"//third_party/skia/src/ports",
"//third_party/skia/src/ports/skia_ohos",
]
deps = [
":typeface_freetype",
"${skia_third_party_dir}/expat",
"//third_party/jsoncpp:jsoncpp_static",
]
if (is_component_build) {
deps += [ "//third_party/bounds_checking_function:libsec_shared" ]
} else {
deps += [ "//third_party/bounds_checking_function:libsec_static" ]
}
deps += [ ":ohos_fontconfig.json" ]
public = [ "src/ports/skia_ohos/HmSymbolConfig_ohos.h" ]
sources = [ "src/ports/skia_ohos/HmSymbolConfig_ohos.cpp" ]
}
optional("fontmgr_custom_directory") {
enabled = skia_enable_fontmgr_custom_directory
deps = [
":fontmgr_custom",
":typeface_freetype",
]
public = [ "include/ports/SkFontMgr_directory.h" ]
sources = [ "src/ports/SkFontMgr_custom_directory.cpp" ]
}
optional("fontmgr_custom_directory_factory") {
enabled = skia_enable_fontmgr_custom_directory
deps = [ ":fontmgr_custom_directory" ]
sources = [ "src/ports/SkFontMgr_custom_directory_factory.cpp" ]
if (use_linux) {
defines = [ "SK_BUILD_FONT_MGR_FOR_PREVIEW_LINUX" ]
}
if (is_arkui_x) {
sources -= [ "src/ports/SkFontMgr_custom_directory_factory.cpp" ]
}
}
optional("fontmgr_custom_embedded") {
enabled = skia_enable_fontmgr_custom_embedded
deps = [
":fontmgr_custom",
":typeface_freetype",
]
sources = [ "src/ports/SkFontMgr_custom_embedded.cpp" ]
}
optional("fontmgr_custom_embedded_factory") {
enabled = skia_enable_fontmgr_custom_embedded
deps = [ ":fontmgr_custom_embedded" ]
sources = [ "src/ports/SkFontMgr_custom_embedded_factory.cpp" ]
}
optional("fontmgr_custom_empty") {
enabled = skia_enable_fontmgr_custom_empty
deps = [
":fontmgr_custom",
":typeface_freetype",
]
public = [ "include/ports/SkFontMgr_empty.h" ]
sources = [ "src/ports/SkFontMgr_custom_empty.cpp" ]
}
optional("fontmgr_custom_empty_factory") {
enabled = skia_enable_fontmgr_custom_empty
deps = [ ":fontmgr_custom_empty" ]
sources = [ "src/ports/SkFontMgr_custom_empty_factory.cpp" ]
}
optional("fontmgr_fontconfig") {
if (use_oh_skia) {
enabled = false
} else {
enabled = skia_enable_fontmgr_fontconfig
}
# The public header includes fontconfig.h and uses FcConfig*
public_deps = [ "${skia_third_party_dir}:fontconfig" ]
public = [ "include/ports/SkFontMgr_fontconfig.h" ]
deps = [ ":typeface_freetype" ]
sources = [ "src/ports/SkFontMgr_fontconfig.cpp" ]
sources_for_tests = [ "tests/FontMgrFontConfigTest.cpp" ]
}
optional("fontmgr_fontconfig_factory") {
if (use_oh_skia) {
enabled = false
} else {
enabled = skia_enable_fontmgr_fontconfig
}
deps = [ ":fontmgr_fontconfig" ]
sources = [ "src/ports/SkFontMgr_fontconfig_factory.cpp" ]
}
optional("fontmgr_FontConfigInterface") {
if (use_oh_skia) {
enabled = false
} else {
enabled = skia_enable_fontmgr_FontConfigInterface
}
deps = [
":typeface_freetype",
"${skia_third_party_dir}:fontconfig",
]
public = [
"include/ports/SkFontConfigInterface.h",
"include/ports/SkFontMgr_FontConfigInterface.h",
]
sources = [
"src/ports/SkFontConfigInterface.cpp",
"src/ports/SkFontConfigInterface_direct.cpp",
"src/ports/SkFontConfigInterface_direct_factory.cpp",
"src/ports/SkFontConfigTypeface.h",
"src/ports/SkFontMgr_FontConfigInterface.cpp",
]
}
optional("fontmgr_FontConfigInterface_factory") {
enabled = skia_enable_fontmgr_FontConfigInterface
deps = [ ":fontmgr_FontConfigInterface" ]
sources = [ "src/ports/SkFontMgr_FontConfigInterface_factory.cpp" ]
}
optional("fontmgr_fuchsia") {
enabled = skia_enable_fontmgr_fuchsia
deps = []
if (is_fuchsia && using_fuchsia_sdk) {
deps += [ "${skia_root_dir}/build/fuchsia/fidl:fuchsia.fonts" ]
} else {
deps = [ "${skia_root_dir}/sdk/fidl/fuchsia.fonts" ]
}
public = [ "src/ports/SkFontMgr_fuchsia.h" ]
sources = [ "src/ports/SkFontMgr_fuchsia.cpp" ]
}
optional("fontmgr_mac_ct") {
enabled = skia_use_fonthost_mac
public = [
"include/ports/SkFontMgr_mac_ct.h",
"include/ports/SkTypeface_mac.h",
]
sources = [
"src/ports/SkFontMgr_mac_ct.cpp",
"src/ports/SkScalerContext_mac_ct.cpp",
"src/ports/SkScalerContext_mac_ct.h",
"src/ports/SkTypeface_mac_ct.cpp",
"src/ports/SkTypeface_mac_ct.h",
]
if (use_oh_skia && !is_arkui_x) {
# Use hos font
sources += [
"//third_party/skia/src/ports/SkFontMgr_config_parser.cpp",
"//third_party/skia/src/ports/SkFontMgr_config_parser.h",
"//third_party/skia/src/ports/SkFontMgr_preview.cpp",
"//third_party/skia/src/ports/SkFontMgr_preview.h",
]
include_dirs = [
"//third_party/skia/include/core",
"//third_party/skia/include/private",
"//third_party/skia/src/core",
"//third_party/skia/src/ports",
"//third_party/skia/src/ports/skia_ohos",
]
defines = [ "SK_BUILD_FONT_MGR_FOR_PREVIEW_MAC" ]
deps = [
":fontmgr_symbol_load",
"${skia_third_party_dir}/expat",
"//third_party/jsoncpp:jsoncpp_static",
]
}
sources_for_tests = [ "tests/TypefaceMacTest.cpp" ]
if (is_mac) {
frameworks = [
# AppKit symbols NSFontWeightXXX may be dlsym'ed.
"AppKit.framework",
"ApplicationServices.framework",
]
}
if (is_ios) {
frameworks = [
"CoreFoundation.framework",
"CoreGraphics.framework",
"CoreText.framework",
# UIKit symbols UIFontWeightXXX may be dlsym'ed.
"UIKit.framework",
]
}
}
optional("fontmgr_mac_ct_factory") {
enabled = skia_use_fonthost_mac
deps = [ ":fontmgr_mac_ct" ]
sources = [ "src/ports/SkFontMgr_mac_ct_factory.cpp" ]
defines = [ "SK_BUILD_FONT_MGR_FOR_PREVIEW_MAC" ]
if (is_arkui_x) {
defines += [ "USE_DEFAULT_FONT" ]
}
}
optional("fontmgr_win") {
enabled = skia_enable_fontmgr_win
public = [ "include/ports/SkTypeface_win.h" ]
sources = [
"src/fonts/SkFontMgr_indirect.cpp",
"src/ports/SkFontMgr_win_dw.cpp",
"src/ports/SkScalerContext_win_dw.cpp",
"src/ports/SkScalerContext_win_dw.h",
"src/ports/SkTypeface_win_dw.cpp",
"src/ports/SkTypeface_win_dw.h",
]
if (use_oh_skia) {
# Use hos font
sources += [
"//third_party/skia/src/ports/SkFontMgr_config_parser.cpp",
"//third_party/skia/src/ports/SkFontMgr_config_parser.h",
"//third_party/skia/src/ports/SkFontMgr_preview.cpp",
"//third_party/skia/src/ports/SkFontMgr_preview.h",
]
include_dirs = [
"//third_party/skia/include/core",
"//third_party/skia/include/private",
"//third_party/skia/src/core",
"//third_party/skia/src/ports",
"//third_party/skia/src/ports/skia_ohos",
]
defines = [ "SK_BUILD_FONT_MGR_FOR_PREVIEW_WIN" ]
deps = [
":fontmgr_symbol_load",
"${skia_third_party_dir}/expat",
"//third_party/jsoncpp:jsoncpp_static",
]
}
}
if (use_oh_skia && !is_arkui_x) {
ohos_prebuilt_etc("ohos_fontconfig.json") {
source = "//third_party/skia/src/ports/skia_ohos/config/fontconfig.json"
part_name = "skia"
subsystem_name = "thirdparty"
}
optional("fontmgr_ohos") {
enabled = skia_enable_fontmgr_ohos
public = [
"src/ports/skia_ohos/FontConfig_ohos.h",
"src/ports/skia_ohos/FontInfo_ohos.h",
"src/ports/skia_ohos/SkFontMgr_ohos.h",
"src/ports/skia_ohos/SkFontStyleSet_ohos.h",
"src/ports/skia_ohos/SkTypeface_ohos.h",
]
sources = [
"src/ports/skia_ohos/FontConfig_ohos.cpp",
"src/ports/skia_ohos/SkFontMgr_ohos.cpp",
"src/ports/skia_ohos/SkFontMgr_ohos_factory.cpp",
"src/ports/skia_ohos/SkFontStyleSet_ohos.cpp",
"src/ports/skia_ohos/SkTypeface_ohos.cpp",
]
include_dirs = [
"//third_party/skia/include/private",
"//third_party/skia/include/core",
"//third_party/skia/src/core",
"//third_party/skia/src/ports",
"//third_party/skia/src/ports/skia_ohos",
]
deps = [
":fontmgr_symbol_load",
":typeface_freetype",
"${skia_third_party_dir}/expat",
"//third_party/jsoncpp:jsoncpp_static",
]
if (is_component_build) {
deps += [ "//third_party/bounds_checking_function:libsec_shared" ]
} else {
deps += [ "//third_party/bounds_checking_function:libsec_static" ]
}
deps += [ ":ohos_fontconfig.json" ]
if (graphic_2d_feature_wuji_enable) {
deps += [ "$ace_graphic_ext:ohos_fonts_wuji" ]
} else if (ace_engine_standard_fonts_enable) {
deps += [
"//base/global/system_resources:ohos_fonts",
"//third_party/noto-cjk:fonts_notocjk",
"//third_party/notofonts:fonts_notofonts",
]
}
if (use_mingw_win) {
defines = [ "SK_BUILD_FONT_MGR_FOR_PREVIEW_WIN" ]
} else if (use_mac) {
defines = [ "SK_BUILD_FONT_MGR_FOR_PREVIEW_MAC" ]
} else if (use_linux) {
defines = [ "SK_BUILD_FONT_MGR_FOR_PREVIEW_LINUX" ]
} else if (is_ohos) {
deps += [ "//base/startup/init/interfaces/innerkits:libbegetutil" ]
defines = [ "SK_BUILD_FONT_MGR_FOR_OHOS" ]
}
}
}
optional("fontmgr_win_factory") {
enabled = skia_enable_fontmgr_win
deps = [ ":fontmgr_win" ]
sources = [ "src/ports/SkFontMgr_win_dw_factory.cpp" ]
defines = [ "SK_BUILD_FONT_MGR_FOR_PREVIEW_WIN" ]
}
optional("fontmgr_win_gdi") {
enabled = skia_enable_fontmgr_win_gdi
public = [ "include/ports/SkTypeface_win.h" ]
sources = [ "src/ports/SkFontHost_win.cpp" ]
# libs = [ "Gdi32.lib" ]
libs = [ "gdi32" ]
}
if (skia_lex) {
skia_executable("sksllex") {
sources = [
"src/sksl/lex/DFA.h",
"src/sksl/lex/DFAState.h",
"src/sksl/lex/LexUtil.h",
"src/sksl/lex/Main.cpp",
"src/sksl/lex/NFA.cpp",
"src/sksl/lex/NFA.h",
"src/sksl/lex/NFAState.h",
"src/sksl/lex/NFAtoDFA.h",
"src/sksl/lex/RegexNode.cpp",
"src/sksl/lex/RegexNode.h",
"src/sksl/lex/RegexParser.cpp",
"src/sksl/lex/RegexParser.h",
"src/sksl/lex/TransitionTable.cpp",
"src/sksl/lex/TransitionTable.h",
]
include_dirs = [ "." ]
}
action("run_sksllex") {
script = "gn/run_sksllex.py"
deps = [ ":sksllex(//gn/toolchain:$host_toolchain)" ]
sources = [ "src/sksl/lex/sksl.lex" ]
# GN insists its outputs should go somewhere underneath target_out_dir, so we trick it with a
# path that starts with target_out_dir and then uses ".." to back up into the src dir.
outputs = [
"$target_out_dir/" + rebase_path("src/sksl/SkSLLexer.h", target_out_dir),
# the script also modifies the corresponding .cpp file, but if we tell GN that it gets
# confused due to the same file being named by two different paths
]
sksllex_path = "$root_out_dir/"
sksllex_path += "sksllex"
if (host_os == "win") {
sksllex_path += ".exe"
}
args = [
rebase_path(sksllex_path),
rebase_path("bin/clang-format"),
rebase_path("bin/fetch-clang-format"),
rebase_path("src"),
]
}
} else {
group("run_sksllex") {
}
}
# `Compile SkSL Tests` relies on skslc.
if (skia_compile_sksl_tests) {
skia_executable("skslc") {
defines = [
"SKSL_STANDALONE",
"SK_DISABLE_TRACING",
"SK_ENABLE_SPIRV_CROSS",
"SK_ENABLE_SPIRV_VALIDATION",
]
sources = [
"src/core/SkArenaAlloc.cpp",
"src/core/SkBlockAllocator.cpp",
"src/core/SkCpu.cpp",
"src/core/SkData.cpp",
"src/core/SkHalf.cpp",
"src/core/SkMalloc.cpp",
"src/core/SkMath.cpp",
"src/core/SkMatrixInvert.cpp",
"src/core/SkSemaphore.cpp",
"src/core/SkStream.cpp",
"src/core/SkString.cpp",
"src/core/SkStringUtils.cpp",
"src/core/SkStringView.cpp",
"src/core/SkThreadID.cpp",
"src/core/SkUtils.cpp",
"src/core/SkVM.cpp",
"src/gpu/GrMemoryPool.cpp",
"src/gpu/GrShaderUtils.cpp",
"src/ports/SkMemory_malloc.cpp",
"src/ports/SkOSFile_stdio.cpp",
"src/sksl/SkSLMain.cpp",
"src/utils/SkJSON.cpp",
"src/utils/SkJSONWriter.cpp",
"src/utils/SkParse.cpp",
"src/utils/SkUTF.cpp",
]
if (is_win) {
sources += [ "src/ports/SkOSFile_win.cpp" ]
} else {
sources += [ "src/ports/SkOSFile_posix.cpp" ]
}
sources += skia_sksl_sources
sources += skia_sksl_gpu_sources
include_dirs = [ "." ]
deps = [
":run_sksllex",
"${skia_third_party_dir}/externals/spirv-tools:spvtools",
"${skia_third_party_dir}/externals/spirv-tools:spvtools_val",
"${skia_third_party_dir}/spirv-cross:spirv_cross",
]
}
skslc_path = "$root_out_dir/"
if (host_toolchain != default_toolchain_name) {
skslc_path += "$host_toolchain/"
}
skslc_path += "skslc"
if (host_os == "win") {
skslc_path += ".exe"
}
copy("sksl_pre_includes") {
sources = [
"src/sksl/sksl_frag.sksl",
"src/sksl/sksl_gpu.sksl",
"src/sksl/sksl_public.sksl",
"src/sksl/sksl_rt_shader.sksl",
"src/sksl/sksl_vert.sksl",
]
outputs = [ "$root_out_dir/{{source_file_part}}" ]
}
dehydrate_sksl_sources = get_target_outputs(":sksl_pre_includes")
dehydrate_sksl_outputs = []
foreach(src, dehydrate_sksl_sources) {
name = get_path_info(src, "name")
# GN insists its outputs should go somewhere underneath target_out_dir, so we trick it with a
# path that starts with target_out_dir and then uses ".." to back up into the src dir.
dehydrate_sksl_outputs += [ "$target_out_dir/" + rebase_path(
"src/sksl/generated/$name.dehydrated.sksl",
target_out_dir) ]
}
action("dehydrate_sksl") {
script = "gn/dehydrate_sksl.py"
deps = [
":sksl_pre_includes",
":skslc(//gn/toolchain:$host_toolchain)",
]
sources = dehydrate_sksl_sources
outputs = dehydrate_sksl_outputs
args = [
rebase_path(skslc_path),
rebase_path("src/sksl/generated"),
]
args += rebase_path(dehydrate_sksl_sources)
}
} else {
group("dehydrate_sksl") {
}
}
if (skia_compile_sksl_tests) {
import("gn/sksl_tests.gni")
template("compile_sksl") {
# Compile the passed-in `sources` into `outputs` using skslc, with the given language/settings.
action("compile_sksl_${target_name}") {
script = "gn/compile_sksl_tests.py"
deps = [
":sksl_pre_includes",
":skslc(//gn/toolchain:$host_toolchain)",
]
sources = []
outputs = []
response_file_contents = []
args = [
rebase_path(skslc_path),
invoker.lang,
invoker.settings,
"{{response_file_name}}",
]
testsDir = get_path_info("tests", "abspath")
resourcesDir = get_path_info("resources", "abspath")
foreach(partialPath, invoker.sources) {
dst = testsDir + partialPath
src = resourcesDir + partialPath
dir = get_path_info(dst, "dir")
# We want to support double-extensions (for '.dsl.cpp') but GN doesn't natively handle this.
# Workaround: http://go/ggroup/a/chromium.org/g/gn-dev/c/RdEpjeYtb-4
# For input path "file.aa.bb", name will contain "file" and ext will contain ".aa.bb".
# For input path "file.cc", name will contain "file" and ext will contain ".cc".
nameTmp = get_path_info(dst, "name")
name = get_path_info(nameTmp, "name")
ext = get_path_info(nameTmp, "extension")
ext += get_path_info(dst, "extension")
response_file_contents += rebase_path([
src,
dir,
])
sources += [ src ]
foreach(outExtension, invoker.outExtensions) {
# SPIR-V uses separate extensions for .vert shaders.
if (ext == "vert" && outExtension == ".asm.frag") {
outExtension = ".asm.vert"
}
outputs +=
[ target_out_dir + "/" +
rebase_path(dir + "/" + name + outExtension, target_out_dir) ]
}
}
}
}
compile_sksl("glsl_tests") {
sources = sksl_glsl_tests_sources + sksl_glsl_settings_tests_sources
outExtensions = [ ".glsl" ]
lang = "--glsl"
settings = "--settings"
}
compile_sksl("glsl_nosettings_tests") {
sources = sksl_glsl_settings_tests_sources
outExtensions = [ "StandaloneSettings.glsl" ]
lang = "--glsl"
settings = "--nosettings"
}
compile_sksl("metal_tests") {
sources = sksl_metal_tests_sources
outExtensions = [ ".metal" ]
lang = "--metal"
settings = "--settings"
}
compile_sksl("skvm_tests") {
sources = sksl_skvm_tests_sources
outExtensions = [ ".skvm" ]
lang = "--skvm"
settings = "--settings"
}
compile_sksl("stage_tests") {
sources = sksl_stage_tests_sources
outExtensions = [ ".stage" ]
lang = "--stage"
settings = "--settings"
}
compile_sksl("spirv_tests") {
sources = sksl_spirv_tests_sources
outExtensions = [ ".asm.frag" ]
lang = "--spirv"
settings = "--settings"
}
} else {
group("compile_sksl_glsl_tests") {
}
group("compile_sksl_glsl_nosettings_tests") {
}
group("compile_sksl_metal_tests") {
}
group("compile_sksl_skvm_tests") {
}
group("compile_sksl_spirv_tests") {
}
}
optional("gpu_shared") {
enabled = skia_enable_gpu || skia_enable_graphite
sources = skia_shared_gpu_sources
}
optional("gpu") {
enabled = skia_enable_gpu
deps = [
":compile_sksl_glsl_nosettings_tests",
":compile_sksl_glsl_tests",
":compile_sksl_metal_tests",
":compile_sksl_skvm_tests",
":compile_sksl_spirv_tests",
":dehydrate_sksl",
":gpu_shared",
":run_sksllex",
]
if (skia_generate_workarounds) {
deps += [ ":workaround_list" ]
}
public_defines = []
public_configs = []
public_deps = []
sources = skia_gpu_sources + skia_sksl_gpu_sources
if (!skia_enable_skgpu_v1) {
sources -= skia_skgpu_v1_sources
}
libs = []
frameworks = []
if (skia_use_gl) {
public_defines += [ "SK_GL" ]
if (is_android) {
sources += [
"src/gpu/gl/egl/GrGLMakeEGLInterface.cpp",
"src/gpu/gl/egl/GrGLMakeNativeInterface_egl.cpp",
]
# this lib is required to link against AHardwareBuffer
libs += [ "android" ]
} else if (skia_use_egl || is_ohos) {
sources += [
"src/gpu/gl/egl/GrGLMakeEGLInterface.cpp",
"src/gpu/gl/egl/GrGLMakeNativeInterface_egl.cpp",
]
if (use_oh_skia) {
include_dirs = [
"//third_party/EGL/api",
"//third_party/openGLES/api",
]
deps += [ "//foundation/graphic/graphic_2d:libgl" ]
} else {
libs += [ "EGL" ]
}
} else if (skia_use_webgl) {
sources += [ "src/gpu/gl/webgl/GrGLMakeNativeInterface_webgl.cpp" ]
} else if (is_linux && skia_use_x11) {
sources += [
"src/gpu/gl/glx/GrGLMakeGLXInterface.cpp",
"src/gpu/gl/glx/GrGLMakeNativeInterface_glx.cpp",
]
libs += [ "GL" ]
} else if (is_mac) {
sources += [ "src/gpu/gl/mac/GrGLMakeNativeInterface_mac.cpp" ]
} else if (is_ios) {
sources += [ "src/gpu/gl/iOS/GrGLMakeNativeInterface_iOS.cpp" ]
} else if (is_win && !skia_enable_winuwp) {
sources += [ "src/gpu/gl/win/GrGLMakeNativeInterface_win.cpp" ]
libs += [ "opengl32" ]
} else {
sources += [ "src/gpu/gl/GrGLMakeNativeInterface_none.cpp" ]
}
sources += skia_gl_gpu_sources
}
if (skia_use_vulkan) {
public_defines += [ "SK_VULKAN" ]
if (skia_use_vma) {
deps += [ "third_party/vulkanmemoryallocator" ]
}
public_deps += [ "//third_party/vulkan-headers:vulkan_headers" ]
sources += skia_vk_sources
if (skia_enable_vulkan_debug_layers) {
public_defines += [ "SK_ENABLE_VK_LAYERS" ]
}
if (is_fuchsia) {
if (using_fuchsia_sdk) {
public_deps += [ "$fuchsia_sdk_root/pkg:vulkan" ]
} else {
public_deps += [ "${skia_root_dir}/src/graphics/lib/vulkan" ]
}
}
if (skia_vk_enable_partialrender) {
public_defines += [ "SK_VK_PARTIALRENDER" ]
}
}
if (is_android && (skia_use_gl || skia_use_vulkan)) {
# this lib is required to link against AHardwareBuffer
if (defined(ndk_api) && ndk_api >= 26) {
libs += [ "android" ]
}
}
if (skia_use_dawn) {
public_defines += [ "SK_DAWN" ]
sources += skia_dawn_sources
public_deps +=
[ "${skia_third_party_dir}/externals/dawn/src/dawn:dawn_headers" ]
deps += [
"${skia_third_party_dir}/externals/dawn/src/dawn:dawn_proc",
"${skia_third_party_dir}/externals/dawn/src/dawn:dawncpp",
]
if (dawn_enable_d3d12 || dawn_enable_desktop_gl || dawn_enable_metal ||
dawn_enable_opengles || dawn_enable_vulkan) {
deps += [ "${skia_third_party_dir}/externals/dawn/src/dawn_native" ]
}
if (dawn_enable_d3d12) {
libs += [
"d3d12.lib",
"dxgi.lib",
"d3dcompiler.lib",
]
} else if (dawn_enable_metal) {
frameworks += [ "Metal.framework" ]
}
}
if (skia_use_direct3d) {
public_defines += [
"SK_DIRECT3D",
"SK_ENABLE_SPIRV_CROSS",
]
deps += [
"${skia_third_party_dir}/d3d12allocator",
"${skia_third_party_dir}/spirv-cross:spirv_cross",
]
sources += skia_direct3d_sources
if (skia_enable_direct3d_debug_layer) {
public_defines += [ "SK_ENABLE_D3D_DEBUG_LAYER" ]
}
libs += [
"d3d12.lib",
"dxgi.lib",
"d3dcompiler.lib",
]
}
cflags_objcc = []
if (skia_use_metal) {
public_defines += [ "SK_METAL" ]
sources += skia_metal_sources
if (skia_enable_metal_debug_info) {
public_defines += [ "SK_ENABLE_MTL_DEBUG_INFO" ]
}
frameworks += [ "Metal.framework" ]
frameworks += [ "Foundation.framework" ]
if (is_ios) {
frameworks += [ "UIKit.framework" ]
}
cflags_objcc += [ "-fobjc-arc" ]
}
if (is_debug) {
public_defines += [ "SK_ENABLE_DUMP_GPU" ]
}
}
optional("gif") {
enabled = !skia_use_wuffs && skia_use_libgifcodec
_libgifcodec_gni_path = "third_party/externals/libgifcodec/libgifcodec.gni"
if ("True" ==
exec_script("gn/checkpath.py",
[ rebase_path(_libgifcodec_gni_path, root_build_dir) ],
"trim string")) {
public_defines = [ "SK_USE_LIBGIFCODEC" ]
public_include_dirs = [
".",
skia_libgifcodec_path,
]
include_dirs = public_include_dirs
import(_libgifcodec_gni_path)
sources = rebase_path(libgifcodec_sources + libgifcodec_public,
".",
skia_libgifcodec_path)
}
}
optional("heif") {
enabled = skia_use_libheif
public_defines = [ "SK_HAS_HEIF_LIBRARY" ]
# This HEIF decoding functionality is a part of the Android Framework.
# https://android.googlesource.com/platform/frameworks/av/+/master/media/libheif/include/HeifDecoderAPI.h
# There isn't a way to compile that library outside of it, so we just link against
# the library. This feature is not supported on other platforms (and we haven't
# yet tried something like https://github.com/strukturag/libheif/tree/master/libheif).
# The dependency for Android is set in gn_to_bp.py.
deps = []
sources = [ "src/codec/SkHeifCodec.cpp" ]
}
optional("jpeg_decode") {
enabled = skia_use_libjpeg_turbo_decode
public_defines = [ "SK_CODEC_DECODES_JPEG" ]
deps = [ "${skia_third_party_dir}/libjpeg-turbo:libjpeg" ]
sources = [
"src/codec/SkJpegCodec.cpp",
"src/codec/SkJpegDecoderMgr.cpp",
"src/codec/SkJpegUtility.cpp",
]
}
optional("jpeg_encode") {
enabled = skia_use_libjpeg_turbo_encode
public_defines = [ "SK_ENCODE_JPEG" ]
deps = [ "${skia_third_party_dir}/libjpeg-turbo:libjpeg" ]
public = [ "include/encode/SkJpegEncoder.h" ]
sources = [
"src/images/SkJPEGWriteUtility.cpp",
"src/images/SkJpegEncoder.cpp",
]
}
optional("ndk_images") {
enabled = skia_use_ndk_images
public_defines = [ "SK_ENABLE_NDK_IMAGES" ]
sources = [
"src/ports/SkImageEncoder_NDK.cpp",
"src/ports/SkImageGeneratorNDK.cpp",
"src/ports/SkNDKConversions.cpp",
]
libs = [ "jnigraphics" ]
}
optional("graphite") {
libs = []
frameworks = []
enabled = skia_enable_graphite
deps = [ ":gpu_shared" ]
public_defines = [ "SK_GRAPHITE_ENABLED" ]
public = skia_graphite_public
sources = skia_graphite_sources
if (skia_use_metal) {
public_defines += [ "SK_METAL" ]
sources += skia_graphite_mtl_sources
if (skia_enable_metal_debug_info) {
public_defines += [ "SK_ENABLE_MTL_DEBUG_INFO" ]
}
frameworks += [ "Metal.framework" ]
frameworks += [ "Foundation.framework" ]
}
}
optional("pdf") {
enabled = skia_use_zlib && skia_enable_pdf
public_defines = [ "SK_SUPPORT_PDF" ]
if (use_oh_skia) {
deps = [ "//third_party/zlib:libz" ]
} else {
deps = [ "${skia_third_party_dir}/zlib" ]
}
if (skia_use_libjpeg_turbo_decode) {
deps += [ ":jpeg_decode" ]
}
if (skia_use_libjpeg_turbo_encode) {
deps += [ ":jpeg_encode" ]
}
public = skia_pdf_public
sources = skia_pdf_sources
sources_when_disabled = [ "src/pdf/SkDocument_PDF_None.cpp" ]
if (skia_use_icu && skia_use_harfbuzz && skia_pdf_subset_harfbuzz) {
deps += [ "${skia_third_party_dir}/harfbuzz" ]
defines = [ "SK_PDF_USE_HARFBUZZ_SUBSET" ]
} else if (skia_use_icu && skia_use_sfntly) {
deps += [ "${skia_third_party_dir}/sfntly" ]
defines = [ "SK_PDF_USE_SFNTLY" ]
}
}
optional("xps") {
enabled = skia_use_xps && is_win && !is_mingw
public_defines = [ "SK_SUPPORT_XPS" ]
public = skia_xps_public
sources = skia_xps_sources
}
optional("png_decode") {
enabled = skia_use_libpng_decode
public_defines = [ "SK_CODEC_DECODES_PNG" ]
deps = [ "${skia_third_party_dir}/libpng" ]
sources = [
"src/codec/SkIcoCodec.cpp",
"src/codec/SkPngCodec.cpp",
]
defines = [ "ICO_CODEC_HW_HIGH_QUALITY_DECODE" ]
}
optional("png_encode") {
enabled = skia_use_libpng_encode
public_defines = [ "SK_ENCODE_PNG" ]
deps = [ "${skia_third_party_dir}/libpng" ]
sources = [ "src/images/SkPngEncoder.cpp" ]
}
optional("raw") {
enabled = skia_use_dng_sdk && skia_use_libjpeg_turbo_decode && skia_use_piex
public_defines = [ "SK_CODEC_DECODES_RAW" ]
deps = [
"${skia_third_party_dir}/dng_sdk",
"${skia_third_party_dir}/libjpeg-turbo:libjpeg",
"${skia_third_party_dir}/piex",
]
# SkRawCodec catches any exceptions thrown by dng_sdk, insulating the rest of
# Skia.
configs = [ "gn/portable:add_exceptions" ]
sources = [ "src/codec/SkRawCodec.cpp" ]
}
import("third_party/skcms/skcms.gni")
skia_source_set("skcms") {
cflags = []
if (!is_win || is_clang) {
cflags += [
"-w",
"-std=c++11",
]
}
public = [ "include/third_party/skcms/skcms.h" ]
include_dirs = [ "include/third_party/skcms" ]
sources = rebase_path(skcms_sources, ".", "third_party/skcms")
}
optional("typeface_freetype") {
if (use_oh_skia) {
enabled = skia_use_freetype2
} else {
enabled = skia_use_freetype
}
deps = [ "${skia_third_party_dir}/freetype2" ]
sources = [
"src/ports/SkFontHost_FreeType.cpp",
"src/ports/SkFontHost_FreeType_common.cpp",
"src/ports/SkFontHost_FreeType_common.h",
]
}
optional("webp_decode") {
enabled = skia_use_libwebp_decode
public_defines = [ "SK_CODEC_DECODES_WEBP" ]
deps = [ "${skia_third_party_dir}/libwebp" ]
sources = [ "src/codec/SkWebpCodec.cpp" ]
}
optional("webp_encode") {
enabled = skia_use_libwebp_encode
public_defines = [ "SK_ENCODE_WEBP" ]
deps = [ "${skia_third_party_dir}/libwebp" ]
sources = [ "src/images/SkWebpEncoder.cpp" ]
}
optional("wuffs") {
enabled = skia_use_wuffs
public_defines = [ "SK_HAS_WUFFS_LIBRARY" ]
deps = [ "${skia_third_party_dir}/wuffs" ]
sources = [ "src/codec/SkWuffsCodec.cpp" ]
}
optional("xml") {
enabled = skia_use_expat
public_defines = [ "SK_XML" ]
deps = [ "${skia_third_party_dir}/expat" ]
sources = [
"src/svg/SkSVGCanvas.cpp",
"src/svg/SkSVGDevice.cpp",
"src/xml/SkDOM.cpp",
"src/xml/SkDOMParser.cpp",
"src/xml/SkXMLParser.cpp",
"src/xml/SkXMLWriter.cpp",
]
}
optional("skvm_jit") {
enabled = skia_enable_skvm_jit_when_possible
public_defines = [ "SKVM_JIT_WHEN_POSSIBLE" ]
if (skia_vtune_path != "") {
public_defines += [ "SKVM_JIT_VTUNE" ]
public_include_dirs = [ "$skia_vtune_path/include" ]
libs = [ "$skia_vtune_path/lib64/jitprofiling.lib" ]
}
}
if (skia_enable_gpu && skia_generate_workarounds) {
action("workaround_list") {
script = "tools/build_workaround_header.py"
inputs = [ "src/gpu/gpu_workaround_list.txt" ]
# GN insists its outputs should go somewhere underneath root_out_dir, so we trick it with a
# path that starts with root_out_dir and then uses ".." to back up into the src dir.
output_file =
rebase_path("include/gpu/GrDriverBugWorkaroundsAutogen.h", root_out_dir)
outputs = [ "$root_out_dir/$output_file" ]
args = [
"--output-file",
"$output_file",
]
foreach(file, inputs) {
args += [ rebase_path(file, root_build_dir) ]
}
}
}
skia_component("skia") {
}
if (use_oh_skia) {
config("skia_config") {
include_dirs = [ "//third_party/skia" ]
defines = skia_common_defines
}
config("harfbuzz_config") {
include_dirs = [ "//third_party/skia/third_party/externals/harfbuzz/src" ]
defines = [
"HAVE_ICU",
"HAVE_ICU_BUILTIN",
"HAVE_OT",
"HAVE_CONFIG_OVERRIDE_H",
"HB_NO_FALLBACK_SHAPE",
"HB_NO_WIN1256",
]
}
config("icu_config") {
include_dirs = [ "${skia_third_party_dir}/externals/icu/source/common" ]
if (is_arkui_x) {
include_dirs = []
include_dirs = [ "//third_party/icu/icu4c/source/common" ]
}
}
template("make_skia_deps") {
forward_variables_from(invoker, "*")
ohos_source_set("skia_$platform") {
part_name = "skia"
subsystem_name = "thirdparty"
license_file = "//third_party/skia/LICENSE"
public_configs = [
":skia_config",
":harfbuzz_config",
":icu_config",
]
if (is_arkui_x) {
public_deps = [ ":skia_canvaskit_static" ]
} else {
public_deps = [ ":skia_canvaskit" ]
}
}
}
ohos_source_set("skia_canvaskit_static") {
part_name = "skia"
subsystem_name = "thirdparty"
include_dirs = [ "${skia_third_party_dir}/externals/libgifcodec" ]
public_configs = [ ":skia_public" ]
configs = skia_library_configs
public_deps = [
":fontmgr_FontConfigInterface",
":fontmgr_android",
":fontmgr_custom_directory",
":fontmgr_custom_directory_factory",
":fontmgr_custom_embedded",
":fontmgr_fontconfig",
":skcms",
":xps",
]
if (is_ios) {
public_deps += [ ":gpu" ]
} else {
if (defined(ace_enable_gpu) && ace_enable_gpu) {
public_deps += [ ":gpu" ]
}
}
deps = [
":android_utils",
":arm64",
":armv7",
":avx",
":crc32",
":fontmgr_factory",
":gif",
":heif",
":hsw",
":jpeg_decode",
":jpeg_encode",
":none",
":png_decode",
":png_encode",
":raw",
":skvm_jit",
":skx",
":sse2",
":sse41",
":sse42",
":ssse3",
":webp_decode",
":webp_encode",
":xml",
"modules/skresources",
"modules/skshaper",
"modules/skunicode",
"modules/svg",
]
if (is_arkui_x) {
deps += [ "//third_party/bounds_checking_function:libsec_static" ]
}
public = skia_core_public
public += skia_utils_public
public += skia_effects_public
public += skia_effects_imagefilter_public
sources = []
sources += skia_core_sources
sources += skia_utils_sources
sources += skia_effects_sources
sources += skia_effects_imagefilter_sources
sources += [
"src/android/SkAndroidFrameworkUtils.cpp",
"src/android/SkAnimatedImage.cpp",
"src/codec/SkAndroidCodec.cpp",
"src/codec/SkAndroidCodecAdapter.cpp",
"src/codec/SkBmpBaseCodec.cpp",
"src/codec/SkBmpCodec.cpp",
"src/codec/SkBmpMaskCodec.cpp",
"src/codec/SkBmpRLECodec.cpp",
"src/codec/SkBmpStandardCodec.cpp",
"src/codec/SkCodec.cpp",
"src/codec/SkCodecImageGenerator.cpp",
"src/codec/SkColorTable.cpp",
"src/codec/SkEncodedInfo.cpp",
"src/codec/SkMaskSwizzler.cpp",
"src/codec/SkMasks.cpp",
"src/codec/SkParseEncodedOrigin.cpp",
"src/codec/SkSampledCodec.cpp",
"src/codec/SkSampler.cpp",
"src/codec/SkStreamBuffer.cpp",
"src/codec/SkSwizzler.cpp",
"src/codec/SkWbmpCodec.cpp",
"src/images/SkImageEncoder.cpp",
"src/ports/SkDiscardableMemory_none.cpp",
"src/ports/SkGlobalInitialization_default.cpp",
"src/ports/SkImageGenerator_skia.cpp",
"src/ports/SkMemory_malloc.cpp",
"src/ports/SkOSFile_stdio.cpp",
"src/sfnt/SkOTTable_name.cpp",
"src/sfnt/SkOTUtils.cpp",
]
defines = skia_common_defines
cflags = skia_common_cflags
if (!defined(ace_enable_gpu) || !ace_enable_gpu) {
defines += [
"SK_BUILD_FOR_UNIX",
"SK_SUPPORT_GPU=0",
]
defines -= [ "SK_GL" ]
}
cflags_cc = [ "-Wno-unknown-pragmas" ]
libs = []
if (skia_enable_sksl) {
deps += [ ":dehydrate_sksl" ]
sources += skia_sksl_sources
}
if (is_android) {
deps += [ "${skia_third_party_dir}/expat" ]
if (defined(ndk) && ndk != "") {
deps += [ "${skia_third_party_dir}/cpu-features" ]
}
sources += [ "src/ports/SkDebug_android.cpp" ]
libs += [
"EGL",
"GLESv2",
"log",
]
}
if (is_mac) {
public += [ "include/ports/SkCFObject.h" ]
sources += [
"src/ports/SkDebug_stdio.cpp",
"src/ports/SkImageEncoder_CG.cpp",
"src/ports/SkImageGeneratorCG.cpp",
]
frameworks = [
"ApplicationServices.framework",
"OpenGL.framework",
]
}
if (is_ios) {
public += [ "include/ports/SkCFObject.h" ]
sources += [
"src/ports/SkDebug_stdio.cpp",
"src/ports/SkImageEncoder_CG.cpp",
"src/ports/SkImageGeneratorCG.cpp",
]
frameworks = [
"CoreFoundation.framework",
"ImageIO.framework",
"MobileCoreServices.framework",
]
}
if (is_win) {
sources += [ "src/ports/SkOSFile_win.cpp" ]
} else {
sources += [ "src/ports/SkOSFile_posix.cpp" ]
}
if (skia_include_multiframe_procs) {
sources += [ "tools/SkSharingProc.cpp" ]
}
}
config("skia_canvaskit_link_config") {
if (is_ohos && is_clang && (target_cpu == "arm" || target_cpu == "arm64")) {
ldflags = [
"-Wl,--lto-O2",
"-Wl,-mllvm",
"-Wl,-wholeprogramdevirt-check=fallback",
"-Wl,-Bsymbolic",
]
}
}
ohos_shared_library("skia_canvaskit") {
part_name = "skia"
innerapi_tags = [ "platformsdk" ]
subsystem_name = "thirdparty"
include_dirs = [ "${skia_third_party_dir}/externals/libgifcodec" ]
public_configs = [ ":skia_public" ]
configs = skia_library_configs
if (enhanced_opt) {
configs += [ ":skia_canvaskit_link_config" ]
}
public_deps = [
":fontmgr_FontConfigInterface",
":fontmgr_android",
":fontmgr_custom_directory",
":fontmgr_custom_directory_factory",
":fontmgr_custom_embedded",
":fontmgr_fontconfig",
":fontmgr_mac_ct",
":fontmgr_ohos",
":fontmgr_win",
":fontmgr_win_gdi",
":pdf",
":skcms",
":xps",
]
if (is_arkui_x) {
public_deps -= [ ":fontmgr_ohos" ]
}
if (is_ios) {
public_deps += [ ":gpu" ]
} else {
if (defined(ace_enable_gpu) && ace_enable_gpu) {
public_deps += [ ":gpu" ]
}
}
deps = [
":android_utils",
":arm64",
":armv7",
":avx",
":crc32",
":fontmgr_factory",
":gif",
":heif",
":hsw",
":jpeg_decode",
":jpeg_encode",
":none",
":png_decode",
":png_encode",
":raw",
":skvm_jit",
":skx",
":sse2",
":sse41",
":sse42",
":ssse3",
":webp_decode",
":webp_encode",
":xml",
"modules/skresources",
"modules/skshaper",
"modules/skunicode",
"modules/svg",
]
public = skia_core_public
public += skia_utils_public
public += skia_effects_public
public += skia_effects_imagefilter_public
sources = []
sources += skia_core_sources
sources += skia_utils_sources
sources += skia_effects_sources
sources += skia_effects_imagefilter_sources
sources += [
"src/android/SkAndroidFrameworkUtils.cpp",
"src/android/SkAnimatedImage.cpp",
"src/codec/SkAndroidCodec.cpp",
"src/codec/SkAndroidCodecAdapter.cpp",
"src/codec/SkBmpBaseCodec.cpp",
"src/codec/SkBmpCodec.cpp",
"src/codec/SkBmpMaskCodec.cpp",
"src/codec/SkBmpRLECodec.cpp",
"src/codec/SkBmpStandardCodec.cpp",
"src/codec/SkCodec.cpp",
"src/codec/SkCodecImageGenerator.cpp",
"src/codec/SkColorTable.cpp",
"src/codec/SkEncodedInfo.cpp",
"src/codec/SkMaskSwizzler.cpp",
"src/codec/SkMasks.cpp",
"src/codec/SkParseEncodedOrigin.cpp",
"src/codec/SkSampledCodec.cpp",
"src/codec/SkSampler.cpp",
"src/codec/SkStreamBuffer.cpp",
"src/codec/SkSwizzler.cpp",
"src/codec/SkWbmpCodec.cpp",
"src/images/SkImageEncoder.cpp",
"src/ports/SkDiscardableMemory_none.cpp",
"src/ports/SkGlobalInitialization_default.cpp",
"src/ports/SkImageGenerator_skia.cpp",
"src/ports/SkMemory_malloc.cpp",
"src/ports/SkOSFile_stdio.cpp",
"src/sfnt/SkOTTable_name.cpp",
"src/sfnt/SkOTUtils.cpp",
]
defines = skia_common_defines
cflags = skia_common_cflags
if (!defined(ace_enable_gpu) || !ace_enable_gpu) {
defines += [
"SK_BUILD_FOR_UNIX",
"SK_SUPPORT_GPU=0",
]
defines -= [ "SK_GL" ]
}
cflags_cc = [ "-Wno-unknown-pragmas" ]
libs = []
if (skia_enable_sksl) {
deps += [ ":dehydrate_sksl" ]
sources += skia_sksl_sources
}
if (is_win) {
sources += [
"src/ports/SkDebug_win.cpp",
"src/ports/SkImageEncoder_WIC.cpp",
"src/ports/SkImageGeneratorWIC.cpp",
"src/ports/SkOSFile_win.cpp",
"src/ports/SkOSLibrary_win.cpp",
]
libs += [
# "Ole32.lib",
# "OleAut32.lib",
]
if (!skia_enable_winuwp) {
libs += [
# "FontSub.lib",
# "User32.lib",
# "Usp10.lib",
]
}
libs += [
"kernel32",
"gdi32",
"fontsub",
"ole32",
"oleaut32",
"psapi",
"user32",
"usp10",
"uuid",
"windowscodecs",
]
} else {
sources += [
"src/ports/SkOSFile_posix.cpp",
"src/ports/SkOSLibrary_posix.cpp",
]
libs += [ "dl" ]
}
if (is_ohos) {
sources += [ "//third_party/skia/src/ports/SkDebug_ohos.cpp" ]
external_deps = [
"hilog:libhilog",
"hitrace:hitrace_meter",
]
}
if (is_android) {
deps += [ "${skia_third_party_dir}/expat" ]
if (defined(ndk) && ndk != "") {
deps += [ "${skia_third_party_dir}/cpu-features" ]
}
sources += [ "src/ports/SkDebug_android.cpp" ]
libs += [
"EGL",
"GLESv2",
"log",
]
}
if (is_linux || target_cpu == "wasm") {
sources += [ "src/ports/SkDebug_stdio.cpp" ]
if (skia_use_egl) {
libs += [ "GLESv2" ]
}
}
if (is_mac) {
public += [ "include/ports/SkCFObject.h" ]
sources += [
"src/ports/SkDebug_stdio.cpp",
"src/ports/SkImageEncoder_CG.cpp",
"src/ports/SkImageGeneratorCG.cpp",
]
frameworks = [
"ApplicationServices.framework",
"OpenGL.framework",
]
}
if (is_ios) {
public += [ "include/ports/SkCFObject.h" ]
sources += [
"src/ports/SkDebug_stdio.cpp",
"src/ports/SkImageEncoder_CG.cpp",
"src/ports/SkImageGeneratorCG.cpp",
]
frameworks = [
"CoreFoundation.framework",
"ImageIO.framework",
"MobileCoreServices.framework",
]
}
if (is_fuchsia) {
sources += [ "src/ports/SkDebug_stdio.cpp" ]
}
#if (skia_enable_spirv_validation) {
# deps += [ "${skia_third_party_dir}/externals/spirv-tools:spvtools_val" ]
# defines += [ "SK_ENABLE_SPIRV_VALIDATION" ]
#}
if (skia_include_multiframe_procs) {
sources += [ "tools/SkSharingProc.cpp" ]
}
if (defined(ddgr_ext_configs)) {
defines += ddgr_ext_configs.ddgr_defines
}
}
foreach(item, ace_platforms) {
make_skia_deps(item.name) {
platform = item.name
config = {
}
if (defined(item.config)) {
config = item.config
}
}
}
}
# DebugCanvas used in experimental/wasm-skp-debugger
if (target_cpu == "wasm") {
skia_static_library("debugcanvas") {
public_configs = [ ":skia_public" ]
sources = [
"tools/SkSharingProc.cpp",
"tools/UrlDataManager.cpp",
"tools/debugger/DebugCanvas.cpp",
"tools/debugger/DebugLayerManager.cpp",
"tools/debugger/DrawCommand.cpp",
"tools/debugger/JsonWriteBuffer.cpp",
]
}
}
skia_static_library("pathkit") {
check_includes = false
public_configs = [ ":skia_public" ]
configs = skia_library_configs
deps = [
":arm64",
":armv7",
":avx",
":crc32",
":hsw",
":none",
":sse2",
":sse41",
":sse42",
":ssse3",
]
sources = []
sources += skia_pathops_sources
sources += skia_pathops_public
sources += [
"src/core/SkAnalyticEdge.cpp",
"src/core/SkArenaAlloc.cpp",
"src/core/SkContourMeasure.cpp",
"src/core/SkCubicMap.cpp",
"src/core/SkEdge.cpp",
"src/core/SkEdgeBuilder.cpp",
"src/core/SkEdgeClipper.cpp",
"src/core/SkGeometry.cpp",
"src/core/SkIDChangeListener.cpp",
"src/core/SkLineClipper.cpp",
"src/core/SkMalloc.cpp",
"src/core/SkMallocPixelRef.cpp",
"src/core/SkMath.cpp",
"src/core/SkMatrix.cpp",
"src/core/SkOpts.cpp",
"src/core/SkPaint.cpp",
"src/core/SkPaintPriv.cpp",
"src/core/SkPath.cpp",
"src/core/SkPathBuilder.cpp",
"src/core/SkPathEffect.cpp",
"src/core/SkPathMeasure.cpp",
"src/core/SkPathRef.cpp",
"src/core/SkPoint.cpp",
"src/core/SkRRect.cpp",
"src/core/SkReadBuffer.cpp",
"src/core/SkRect.cpp",
"src/core/SkSemaphore.cpp",
"src/core/SkStream.cpp",
"src/core/SkString.cpp",
"src/core/SkStringUtils.cpp",
"src/core/SkStroke.cpp",
"src/core/SkStrokeRec.cpp",
"src/core/SkStrokerPriv.cpp",
"src/core/SkThreadID.cpp",
"src/core/SkUtils.cpp",
"src/effects/SkDashPathEffect.cpp",
"src/effects/SkTrimPathEffect.cpp",
"src/ports/SkDebug_stdio.cpp",
"src/ports/SkMemory_malloc.cpp",
"src/utils/SkDashPath.cpp",
"src/utils/SkParse.cpp",
"src/utils/SkParsePath.cpp",
"src/utils/SkUTF.cpp",
]
}
group("modules") {
deps = [
"modules/particles",
"modules/skottie",
"modules/skparagraph",
"modules/skshaper",
"modules/svg",
]
}
group("experimental") {
deps = [ "experimental/sktext" ]
}
config("our_vulkan_headers") {
include_dirs = [ "//third_party/vulkan_headers/include" ]
}
# Targets guarded by skia_enable_tools may use //third_party freely.
if (skia_enable_tools) {
skia_public_includes = [
"client_utils/android",
"include/android",
"include/c",
"include/codec",
"include/config",
"include/core",
"include/docs",
"include/effects",
"include/encode",
"include/gpu",
"include/pathops",
"include/ports",
"include/svg",
"include/utils",
"include/utils/mac",
"modules/particles/include",
"modules/skottie/include",
"modules/skparagraph/include",
"modules/skshaper/include",
"modules/svg/include",
]
# Used by gn_to_bp.py to list our public include dirs.
skia_source_set("public") {
configs = [ ":skia_public" ]
include_dirs = skia_public_includes
}
config("skia.h_config") {
include_dirs = [ "$target_gen_dir" ]
}
action("skia.h") {
public_configs = [ ":skia.h_config" ]
skia_h = "$target_gen_dir/skia.h"
script = "gn/find_headers.py"
args = [ rebase_path("${skia_root_dir}/bin/gn") ] + [ rebase_path("//") ] +
[ rebase_path(skia_h, root_build_dir) ] +
rebase_path(skia_public_includes)
depfile = "$skia_h.deps"
outputs = [ skia_h ]
}
if (target_cpu == "x64") {
skia_executable("fiddle") {
check_includes = false
libs = []
sources = [
"tools/fiddle/draw.cpp",
"tools/fiddle/fiddle_main.cpp",
]
if (skia_use_egl) {
sources += [ "tools/fiddle/egl_context.cpp" ]
} else {
sources += [ "tools/fiddle/null_context.cpp" ]
}
testonly = true
deps = [
":flags",
":gpu_tool_utils",
":skia",
":skia.h",
"modules/particles",
"modules/skottie",
"modules/skparagraph",
"modules/skshaper",
"modules/svg",
]
}
}
config("cpp14") {
if (is_win && !is_mingw) {
cflags_cc = [ "/std:c++14" ]
} else {
cflags_cc = [ "-std=c++14" ]
}
}
skia_source_set("public_headers_warnings_check") {
sources = [ "tools/public_headers_warnings_check.cpp" ]
configs = [
":our_vulkan_headers",
":cpp14",
]
if (defined(skia_header_target_default_configs)) {
configs += skia_header_target_default_configs
}
deps = [
":skia",
":skia.h",
"modules/skottie",
"modules/skshaper",
]
if (skia_use_dawn) {
deps += [ "${skia_third_party_dir}/externals/dawn/src/dawn:dawn_headers" ]
}
}
template("test_lib") {
config(target_name + "_config") {
if (defined(invoker.public_defines)) {
defines = invoker.public_defines
}
}
skia_source_set(target_name) {
forward_variables_from(invoker, "*", [])
check_includes = false
public_configs = [
":" + target_name + "_config",
":skia_private",
":skia_wno",
]
if (!defined(deps)) {
deps = []
}
deps += [ ":skia" ]
if (use_oh_skia) {
deps -= [ ":skia" ]
deps += [ ":skia_canvaskit" ]
}
testonly = true
}
}
template("test_app") {
if (is_ios) {
ios_app_bundle(target_name) {
forward_variables_from(invoker,
"*",
[
"output_name",
"visibility",
"is_shared_library",
])
testonly = true
extra_configs = [ ":skia_private" ]
launchscreen = "platform_tools/ios/app/LaunchScreen.storyboard"
data_sources = [ "resources" ]
if ("True" == exec_script("${skia_root_dir}/gn/checkdir.py",
[ rebase_path("skps", root_build_dir) ],
"trim string")) {
data_sources += [ "skps" ]
}
if ("True" == exec_script("${skia_root_dir}/gn/checkdir.py",
[ rebase_path("mskps", root_build_dir) ],
"trim string")) {
data_sources += [ "mskps" ]
}
}
} else {
# !is_ios
if (defined(invoker.is_shared_library) && invoker.is_shared_library) {
skia_shared_library("lib" + target_name) {
output_dir = root_build_dir
forward_variables_from(invoker, "*", [ "is_shared_library" ])
if (!defined(configs)) {
configs = []
}
configs += [
":skia_private",
":skia_wno",
]
testonly = true
}
} else {
_executable = target_name
skia_executable(_executable) {
check_includes = false
output_dir = root_build_dir
forward_variables_from(invoker, "*", [ "is_shared_library" ])
if (!defined(configs)) {
configs = []
}
configs += [
":skia_private",
":skia_wno",
]
testonly = true
}
}
if (is_android && skia_android_serial != "" && defined(_executable)) {
action("push_" + target_name) {
output_dir = root_build_dir
script = "gn/push_to_android.py"
deps = [ ":" + _executable ]
_stamp = "$target_gen_dir/$_executable.pushed_$skia_android_serial"
outputs = [ _stamp ]
args = [
rebase_path("$root_build_dir/$_executable"),
skia_android_serial,
rebase_path(_stamp),
]
testonly = true
}
}
}
}
test_lib("gpu_tool_utils") {
public_defines = []
# Bots and even devs may not have Vulkan headers, so put
# include/third_party/vulkan on our path so they're always available.
all_dependent_configs = [ ":our_vulkan_headers" ]
defines = []
if (skia_enable_discrete_gpu) {
defines += [ "SK_ENABLE_DISCRETE_GPU" ]
}
deps = []
public_deps = []
sources = [
"tools/gpu/BackendSurfaceFactory.cpp",
"tools/gpu/BackendSurfaceFactory.h",
"tools/gpu/BackendTextureImageFactory.cpp",
"tools/gpu/BackendTextureImageFactory.h",
"tools/gpu/FlushFinishTracker.cpp",
"tools/gpu/FlushFinishTracker.h",
"tools/gpu/GrContextFactory.cpp",
"tools/gpu/GrTest.cpp",
"tools/gpu/ManagedBackendTexture.cpp",
"tools/gpu/ManagedBackendTexture.h",
"tools/gpu/MemoryCache.cpp",
"tools/gpu/MemoryCache.h",
"tools/gpu/ProxyUtils.cpp",
"tools/gpu/TestContext.cpp",
"tools/gpu/TestOps.cpp",
"tools/gpu/TestOps.h",
"tools/gpu/YUVUtils.cpp",
"tools/gpu/YUVUtils.h",
"tools/gpu/gl/GLTestContext.cpp", # See comment below about
# GrContextFactory workaround.
"tools/gpu/mock/MockTestContext.cpp",
]
libs = []
frameworks = []
if (skia_use_gl) {
sources +=
[ "tools/gpu/gl/command_buffer/GLTestContext_command_buffer.cpp" ]
if (is_ios) {
sources += [ "tools/gpu/gl/iOS/CreatePlatformGLTestContext_iOS.mm" ]
frameworks += [ "OpenGLES.framework" ]
} else if (is_mac) {
sources += [ "tools/gpu/gl/mac/CreatePlatformGLTestContext_mac.cpp" ]
}
if (skia_use_angle) {
deps += [ "${skia_third_party_dir}/angle2" ]
sources += [ "tools/gpu/gl/angle/GLTestContext_angle.cpp" ]
}
}
# We need the GLTestContext on Vulkan-only builds for the persistent GL context workaround in
# in GrContextFactory. This only matters for OSes that can run Vulkan.
if ((skia_use_gl || skia_use_vulkan) && target_cpu != "wasm") {
if (is_android || skia_use_egl || is_ohos) {
sources += [ "tools/gpu/gl/egl/CreatePlatformGLTestContext_egl.cpp" ]
if (is_ohos) {
include_dirs = [ "//third_party/EGL/api" ]
deps += [ "//foundation/graphic/graphic_2d:libgl" ]
} else {
libs += [ "EGL" ]
}
} else if (is_linux) {
sources += [ "tools/gpu/gl/glx/CreatePlatformGLTestContext_glx.cpp" ]
libs += [
"GLU",
"GL",
"X11",
]
} else if (is_win) {
sources += [ "tools/gpu/gl/win/CreatePlatformGLTestContext_win.cpp" ]
# libs += [ "Gdi32.lib" ]
libs += [ "gdi32" ]
if (target_cpu != "arm64") {
# libs += [ "OpenGL32.lib" ]
libs += [ "opengl32" ]
}
}
}
if (skia_use_vulkan) {
sources += [ "tools/gpu/vk/VkTestContext.h" ]
sources += [ "tools/gpu/vk/VkTestContext.cpp" ]
sources += [ "tools/gpu/vk/VkTestHelper.h" ]
sources += [ "tools/gpu/vk/VkTestHelper.cpp" ]
sources += [ "tools/gpu/vk/VkTestUtils.h" ]
sources += [ "tools/gpu/vk/VkTestUtils.cpp" ]
sources += [ "tools/gpu/vk/VkYcbcrSamplerHelper.h" ]
sources += [ "tools/gpu/vk/VkYcbcrSamplerHelper.cpp" ]
}
if (skia_use_metal) {
sources += [ "tools/gpu/mtl/MtlTestContext.mm" ]
}
if (skia_use_direct3d) {
sources += [ "tools/gpu/d3d/D3DTestContext.cpp" ]
sources += [ "tools/gpu/d3d/D3DTestUtils.cpp" ]
}
if (skia_use_dawn) {
public_deps +=
[ "${skia_third_party_dir}/externals/dawn/src/dawn:dawn_headers" ]
sources += [ "tools/gpu/dawn/DawnTestContext.cpp" ]
if (is_clang) {
cflags_cc = [ "-Wno-microsoft-cast" ]
}
}
if (!skia_enable_skgpu_v1) {
sources -= [ "tools/gpu/GrTest.cpp" ]
sources -= [ "tools/gpu/TestOps.cpp" ]
sources -= [ "tools/gpu/TestOps.h" ]
}
if (skia_enable_graphite) {
sources += [ "tools/graphite/ContextFactory.h" ]
sources += [ "tools/graphite/ContextFactory.cpp" ]
sources += [ "tools/graphite/GraphiteTestContext.h" ]
sources += [ "tools/graphite/GraphiteTestContext.cpp" ]
if (skia_use_metal) {
sources += [ "tools/graphite/mtl/GraphiteMtlTestContext.h" ]
sources += [ "tools/graphite/mtl/MtlTestContext.mm" ]
}
}
if (is_fuchsia && using_fuchsia_sdk) {
libs +=
[ "${fuchsia_sdk_path}/arch/${target_cpu}/sysroot/lib/libzircon.so" ]
}
} # test_lib("gpu_tool_utils")
test_lib("flags") {
sources = [ "tools/flags/CommandLineFlags.cpp" ]
}
test_lib("common_flags_config") {
sources = [ "tools/flags/CommonFlagsConfig.cpp" ]
deps = [ ":flags" ]
public_deps = [ ":gpu_tool_utils" ]
}
test_lib("common_flags_gpu") {
sources = [ "tools/flags/CommonFlagsGpu.cpp" ]
deps = [ ":flags" ]
public_deps = [ ":gpu_tool_utils" ]
}
test_lib("common_flags_images") {
sources = [ "tools/flags/CommonFlagsImages.cpp" ]
deps = [ ":flags" ]
}
test_lib("common_flags_fontmgr") {
sources = [ "tools/flags/CommonFlagsFontMgr.cpp" ]
deps = [ ":flags" ]
}
test_lib("common_flags_aa") {
sources = [ "tools/flags/CommonFlagsAA.cpp" ]
deps = [ ":flags" ]
}
test_lib("trace") {
deps = [ ":flags" ]
sources = [
"tools/trace/ChromeTracingTracer.cpp",
"tools/trace/ChromeTracingTracer.h",
"tools/trace/EventTracingPriv.cpp",
"tools/trace/EventTracingPriv.h",
"tools/trace/SkDebugfTracer.cpp",
"tools/trace/SkDebugfTracer.h",
]
}
test_lib("tool_utils") {
sources = [
"tools/AndroidSkDebugToStdOut.cpp",
"tools/AutoreleasePool.h",
"tools/DDLPromiseImageHelper.cpp",
"tools/DDLPromiseImageHelper.h",
"tools/DDLTileHelper.cpp",
"tools/DDLTileHelper.h",
"tools/LsanSuppressions.cpp",
"tools/MSKPPlayer.cpp",
"tools/MSKPPlayer.h",
"tools/ProcStats.cpp",
"tools/ProcStats.h",
"tools/Resources.cpp",
"tools/Resources.h",
"tools/RuntimeBlendUtils.cpp",
"tools/RuntimeBlendUtils.h",
"tools/SkMetaData.cpp",
"tools/SkMetaData.h",
"tools/SkSharingProc.cpp",
"tools/SkSharingProc.h",
"tools/Stats.h",
"tools/ToolUtils.cpp",
"tools/ToolUtils.h",
"tools/UrlDataManager.cpp",
"tools/UrlDataManager.h",
"tools/debugger/DebugCanvas.cpp",
"tools/debugger/DebugCanvas.h",
"tools/debugger/DebugLayerManager.cpp",
"tools/debugger/DebugLayerManager.h",
"tools/debugger/DrawCommand.cpp",
"tools/debugger/DrawCommand.h",
"tools/debugger/JsonWriteBuffer.cpp",
"tools/debugger/JsonWriteBuffer.h",
"tools/fonts/RandomScalerContext.cpp",
"tools/fonts/RandomScalerContext.h",
"tools/fonts/TestEmptyTypeface.h",
"tools/fonts/TestFontMgr.cpp",
"tools/fonts/TestFontMgr.h",
"tools/fonts/TestSVGTypeface.cpp",
"tools/fonts/TestSVGTypeface.h",
"tools/fonts/TestTypeface.cpp",
"tools/fonts/TestTypeface.h",
"tools/fonts/ToolUtilsFont.cpp",
"tools/random_parse_path.cpp",
"tools/random_parse_path.h",
"tools/timer/TimeUtils.h",
"tools/timer/Timer.cpp",
"tools/timer/Timer.h",
]
if (target_cpu != "wasm") {
sources += [ "tools/CrashHandler.cpp" ]
}
libs = []
frameworks = []
if (is_ios) {
sources += [ "tools/ios_utils.m" ]
sources += [ "tools/ios_utils.h" ]
if (skia_use_metal) {
sources += [ "tools/AutoreleasePool.mm" ]
}
frameworks += [ "Foundation.framework" ]
} else if (is_mac) {
if (skia_use_metal) {
sources += [ "tools/AutoreleasePool.mm" ]
frameworks += [ "Foundation.framework" ]
}
} else if (is_win && !is_mingw && !skia_enable_winuwp) {
libs += [ "DbgHelp.lib" ]
}
defines = []
if (skia_tools_require_resources) {
defines += [ "SK_TOOLS_REQUIRE_RESOURCES" ]
}
deps = [
":flags",
"modules/svg",
]
public_deps = [ ":gpu_tool_utils" ]
}
test_lib("etc1") {
sources = [ "third_party/etc1/etc1.cpp" ]
}
import("gn/gm.gni")
test_lib("gm") {
sources = gm_sources
if (skia_use_gl) {
sources += gl_gm_sources
}
if (!skia_enable_skgpu_v1) {
sources -= skgpu_v1_gm_sources
}
deps = [
":etc1",
":flags",
":skia",
":tool_utils",
"modules/particles",
"modules/skottie",
"modules/skottie:gm",
"modules/skparagraph",
"modules/skparagraph:gm",
"modules/skshaper",
]
if (is_ohos) {
deps += [
"//base/hiviewdfx/hitrace/interfaces/native/innerkits:hitrace_meter",
]
}
if (use_oh_skia) {
deps -= [
":skia",
"modules/skshaper",
]
deps += [ ":skia_canvaskit" ]
}
if (is_skia_dev_build) {
sources += [ "gm/fiddle.cpp" ]
deps += [ ":skia.h" ]
}
public_deps = [ ":gpu_tool_utils" ]
if (skia_use_ffmpeg) {
deps += [ "experimental/ffmpeg:video_decoder" ]
sources += [ "gm/video_decoder.cpp" ]
}
}
test_lib("test") {
sources = [
"tests/Test.cpp",
"tests/Test.h",
"tests/TestUtils.cpp",
"tests/TestUtils.h",
]
deps = [
":flags",
":skia",
":tool_utils",
]
if (use_oh_skia) {
deps -= [ ":skia" ]
deps += [ ":skia_canvaskit" ]
}
public_deps = [
":gpu_tool_utils", # Test.h #includes headers from this target.
]
}
import("gn/tests.gni")
test_lib("tests") {
sources = tests_sources + pathops_tests_sources
frameworks = []
if (skia_use_metal) {
sources += metal_tests_sources
cflags_objcc = [ "-fobjc-arc" ]
frameworks += [ "MetalKit.framework" ]
}
if (skia_use_gl) {
sources += gl_tests_sources
}
if (skia_enable_graphite) {
sources += graphite_tests_sources
if (skia_use_metal) {
sources += graphite_metal_tests_sources
}
}
if (!skia_enable_skgpu_v1) {
sources -= skgpu_v1_tests_sources
}
deps = [
":flags",
":fontmgr_android_tests",
":fontmgr_fontconfig_tests",
":fontmgr_mac_ct_tests",
":skia",
":test",
":tool_utils",
"${skia_third_party_dir}/libpng",
"${skia_third_party_dir}/libwebp",
"${skia_third_party_dir}/zlib",
"experimental/skrive:tests",
"experimental/sktext:tests",
"modules/skottie:tests",
"modules/skparagraph:tests",
"modules/sksg:tests",
"modules/skshaper",
"modules/svg:tests",
]
if (use_oh_skia) {
deps -= [
":skia",
"modules/skshaper",
]
deps += [ ":skia_canvaskit" ]
}
}
import("gn/bench.gni")
test_lib("bench") {
sources = bench_sources
if (skia_enable_graphite) {
sources += graphite_bench_sources
}
if (!skia_enable_skgpu_v1) {
sources -= skgpu_v1_bench_sources
}
deps = [
":flags",
":gm",
":gpu_tool_utils",
":skia",
":tool_utils",
"modules/skparagraph:bench",
"modules/skshaper",
]
}
test_lib("experimental_xform") {
sources = [
"experimental/xform/SkShape.cpp",
"experimental/xform/SkXform.cpp",
"experimental/xform/XContext.cpp",
]
deps = [ ":skia" ]
}
if (is_linux || is_mac) {
if (skia_enable_skottie) {
test_app("skottie_tool") {
deps = [ "modules/skottie:tool" ]
}
}
test_app("svg_tool") {
deps = [ "modules/svg:tool" ]
}
}
test_app("make_skqp_model") {
sources = [ "tools/skqp/make_skqp_model.cpp" ]
deps = [ ":skia" ]
}
import("gn/samples.gni")
test_lib("samples") {
sources = samples_sources
if (!skia_enable_skgpu_v1) {
sources -= skgpu_v1_samples_sources
}
public_deps = [ ":tool_utils" ]
deps = [
":flags",
":gpu_tool_utils",
":xml",
"${skia_third_party_dir}/imgui",
"experimental/sktext:samples",
"modules/audioplayer",
"modules/skparagraph:samples",
"modules/skshaper",
"modules/svg",
]
}
test_lib("hash_and_encode") {
sources = [
"tools/HashAndEncode.cpp",
"tools/HashAndEncode.h",
]
deps = [
":flags",
":skia",
"${skia_third_party_dir}/libpng",
]
if (use_oh_skia) {
deps -= [ ":skia" ]
deps += [ ":skia_canvaskit" ]
}
}
if (target_cpu != "wasm") {
test_app("convert-to-nia") {
sources = [ "tools/convert-to-nia.cpp" ]
deps = [ ":skia" ]
}
test_app("imgcvt") {
sources = [ "tools/imgcvt.cpp" ]
deps = [
":skcms",
":skia",
]
}
test_app("fm") {
sources = [
"dm/DMGpuTestProcs.cpp", # blech
"tools/fm/fm.cpp",
]
deps = [
":common_flags_aa",
":common_flags_fontmgr",
":common_flags_gpu",
":flags",
":gm",
":gpu_tool_utils",
":hash_and_encode",
":skia",
":tests",
":tool_utils",
":trace",
"modules/skottie",
"modules/skottie:utils",
"modules/svg",
]
}
test_app("dm") {
sources = [
"dm/DM.cpp",
"dm/DMGpuTestProcs.cpp",
"dm/DMJsonWriter.cpp",
"dm/DMJsonWriter.h",
"dm/DMSrcSink.cpp",
"dm/DMSrcSink.h",
]
deps = [
":common_flags_aa",
":common_flags_config",
":common_flags_fontmgr",
":common_flags_gpu",
":common_flags_images",
":flags",
":gm",
":gpu_tool_utils",
":hash_and_encode",
":skia",
":tests",
":tool_utils",
":trace",
"experimental/skrive",
"modules/skottie",
"modules/skottie:utils",
"modules/svg",
]
if (use_oh_skia) {
deps -= [
":skia",
"modules/svg",
]
deps += [ ":skia_canvaskit" ]
}
ldflags = [
"--stdlib=libc++",
"-lc++",
"-lc++abi",
]
}
test_app("sorttoy") {
sources = [
"experimental/sorttoy/Cmds.cpp",
"experimental/sorttoy/Cmds.h",
"experimental/sorttoy/Fake.cpp",
"experimental/sorttoy/Fake.h",
"experimental/sorttoy/SortKey.h",
"experimental/sorttoy/sorttoy.cpp",
"experimental/sorttoy/sorttypes.h",
]
deps = [
":flags",
":skia",
":tool_utils",
]
}
# optional separate library to dlopen when running CanvasStateTests.
skia_shared_library("canvas_state_lib") {
sources = [
"tests/CanvasStateHelpers.cpp",
"tests/CanvasStateHelpers.h",
]
deps = [ ":skia" ]
}
}
if (!is_win) {
test_app("remote_demo") {
sources = [ "tools/remote_demo.cpp" ]
deps = [ ":skia" ]
}
}
if (!is_win) {
test_app("blob_cache_sim") {
sources = [ "tools/blob_cache_sim.cpp" ]
deps = [ ":skia" ]
}
}
test_app("nanobench") {
sources = [ "bench/nanobench.cpp" ]
deps = [
":bench",
":common_flags_aa",
":common_flags_config",
":common_flags_gpu",
":common_flags_images",
":flags",
":gm",
":gpu_tool_utils",
":skia",
":tool_utils",
":trace",
"modules/skparagraph",
"modules/skshaper",
"modules/svg",
]
}
test_app("skpinfo") {
sources = [ "tools/skpinfo.cpp" ]
configs = [ ":our_vulkan_headers" ]
deps = [
":flags",
":skia",
]
}
if (skia_use_ffmpeg) {
test_app("skottie2movie") {
sources = [ "tools/skottie2movie.cpp" ]
deps = [
":flags",
":gpu_tool_utils",
":skia",
"experimental/ffmpeg:video_encoder",
"modules/skottie",
"modules/skottie:utils",
]
}
}
test_app("skpbench") {
sources = [
"bench/BigPath.cpp",
"tools/skpbench/skpbench.cpp",
]
deps = [
":common_flags_config",
":common_flags_gpu",
":flags",
":gpu_tool_utils",
":skia",
":tool_utils",
]
}
test_app("sktexttopdf") {
sources = [ "tools/using_skia_and_harfbuzz.cpp" ]
deps = [
":skia",
"modules/skshaper",
]
}
test_app("create_test_font") {
sources = [ "tools/fonts/create_test_font.cpp" ]
deps = [ ":skia" ]
assert_no_deps = [
# tool_utils requires the output of this app.
":tool_utils",
]
}
if (skia_use_expat) {
test_app("create_test_font_color") {
sources = [ "tools/fonts/create_test_font_color.cpp" ]
deps = [
":flags",
":skia",
":tool_utils",
]
}
}
test_app("get_images_from_skps") {
sources = [ "tools/get_images_from_skps.cpp" ]
deps = [
":flags",
":skia",
]
}
if (!is_ios && target_cpu != "wasm" && !(is_win && target_cpu == "arm64")) {
test_app("skiaserve") {
sources = [
"tools/skiaserve/Request.cpp",
"tools/skiaserve/Response.cpp",
"tools/skiaserve/skiaserve.cpp",
"tools/skiaserve/urlhandlers/BreakHandler.cpp",
"tools/skiaserve/urlhandlers/ClipAlphaHandler.cpp",
"tools/skiaserve/urlhandlers/CmdHandler.cpp",
"tools/skiaserve/urlhandlers/ColorModeHandler.cpp",
"tools/skiaserve/urlhandlers/DataHandler.cpp",
"tools/skiaserve/urlhandlers/DownloadHandler.cpp",
"tools/skiaserve/urlhandlers/EnableGPUHandler.cpp",
"tools/skiaserve/urlhandlers/ImgHandler.cpp",
"tools/skiaserve/urlhandlers/InfoHandler.cpp",
"tools/skiaserve/urlhandlers/OpBoundsHandler.cpp",
"tools/skiaserve/urlhandlers/OpsHandler.cpp",
"tools/skiaserve/urlhandlers/OverdrawHandler.cpp",
"tools/skiaserve/urlhandlers/PostHandler.cpp",
"tools/skiaserve/urlhandlers/QuitHandler.cpp",
"tools/skiaserve/urlhandlers/RootHandler.cpp",
]
deps = [
":flags",
":gpu_tool_utils",
":skia",
":tool_utils",
"${skia_third_party_dir}/libmicrohttpd",
]
}
}
test_app("fuzz") {
sources = [
"fuzz/Fuzz.cpp",
"fuzz/Fuzz.h",
"fuzz/FuzzCanvas.cpp",
"fuzz/FuzzCommon.cpp",
"fuzz/FuzzCommon.h",
"fuzz/FuzzCreateDDL.cpp",
"fuzz/FuzzDDLThreading.cpp",
"fuzz/FuzzDrawFunctions.cpp",
"fuzz/FuzzEncoders.cpp",
"fuzz/FuzzGradients.cpp",
"fuzz/FuzzMain.cpp",
"fuzz/FuzzParsePath.cpp",
"fuzz/FuzzPathMeasure.cpp",
"fuzz/FuzzPathop.cpp",
"fuzz/FuzzPolyUtils.cpp",
"fuzz/FuzzRegionOp.cpp",
"fuzz/FuzzSkParagraph.cpp",
"fuzz/FuzzTriangulation.cpp",
"fuzz/oss_fuzz/FuzzAndroidCodec.cpp",
"fuzz/oss_fuzz/FuzzAnimatedImage.cpp",
"fuzz/oss_fuzz/FuzzImage.cpp",
"fuzz/oss_fuzz/FuzzImageFilterDeserialize.cpp",
"fuzz/oss_fuzz/FuzzIncrementalImage.cpp",
"fuzz/oss_fuzz/FuzzJSON.cpp",
"fuzz/oss_fuzz/FuzzPathDeserialize.cpp",
"fuzz/oss_fuzz/FuzzRegionDeserialize.cpp",
"fuzz/oss_fuzz/FuzzRegionSetPath.cpp",
"fuzz/oss_fuzz/FuzzSKP.cpp",
"fuzz/oss_fuzz/FuzzSKSL2GLSL.cpp",
"fuzz/oss_fuzz/FuzzSKSL2Metal.cpp",
"fuzz/oss_fuzz/FuzzSKSL2Pipeline.cpp",
"fuzz/oss_fuzz/FuzzSKSL2SPIRV.cpp",
"fuzz/oss_fuzz/FuzzSVG.cpp",
"fuzz/oss_fuzz/FuzzSkDescriptorDeserialize.cpp",
"fuzz/oss_fuzz/FuzzSkParagraph.cpp",
"fuzz/oss_fuzz/FuzzSkRuntimeEffect.cpp",
"fuzz/oss_fuzz/FuzzTextBlobDeserialize.cpp",
"tools/UrlDataManager.cpp",
"tools/debugger/DebugCanvas.cpp",
"tools/debugger/DebugLayerManager.cpp",
"tools/debugger/DrawCommand.cpp",
"tools/debugger/JsonWriteBuffer.cpp",
]
deps = [
":flags",
":gpu_tool_utils",
":skia",
"modules/skottie:fuzz",
"modules/skparagraph",
]
}
test_app("pathops_unittest") {
sources = pathops_tests_sources + [
rebase_path("tests/skia_test.cpp"),
rebase_path("tests/Test.cpp"),
]
deps = [
":flags",
":gpu_tool_utils",
":skia",
":tool_utils",
]
}
test_app("dump_record") {
sources = [ "tools/dump_record.cpp" ]
deps = [
":flags",
":skia",
]
}
test_app("skdiff") {
sources = [
"tools/skdiff/skdiff.cpp",
"tools/skdiff/skdiff_html.cpp",
"tools/skdiff/skdiff_main.cpp",
"tools/skdiff/skdiff_utils.cpp",
]
deps = [
":skia",
":tool_utils",
]
}
test_app("skp_parser") {
sources = [ "tools/skp_parser.cpp" ]
deps = [
":skia",
":tool_utils",
]
}
if (!is_win) {
source_set("skqp_lib") { # Not a skia_source_set
check_includes = false
testonly = true
public_configs = [ ":skia_private" ]
defines =
[ "SK_SKQP_GLOBAL_ERROR_TOLERANCE=$skia_skqp_global_error_tolerance" ]
sources = [
"dm/DMGpuTestProcs.cpp",
"tools/skqp/src/skqp.cpp",
"tools/skqp/src/skqp_model.cpp",
]
deps = [
":gm",
":skia",
":tests",
":tool_utils",
]
}
test_app("skqp") {
sources = [ "tools/skqp/src/skqp_main.cpp" ]
include_dirs = [ "${skia_root_dir}/" ]
lib_dirs = []
deps = [ ":skqp_lib" ]
}
test_app("jitter_gms") {
sources = [ "tools/skqp/jitter_gms.cpp" ]
deps = [
":gm",
":skia",
":skqp_lib",
]
}
}
if (is_fuchsia) {
# Build a package repository for skqp on Fuchsia.
group("skqp_repo") {
testonly = true
deps = [ "${skia_root_dir}/build/fuchsia/skqp:skqp_repo" ]
}
}
if (is_android) {
shared_library("libskqp_app") { # Not a skia_shared_library
configs += [ ":skia_private" ]
testonly = true
sources = [ "tools/skqp/src/jni_skqp.cpp" ]
deps = [
":skia",
":skqp_lib",
":tool_utils",
]
libs = [ "android" ]
}
}
if (is_android && skia_use_gl) {
test_app("skottie_android") {
is_shared_library = true
sources = [ "platform_tools/android/apps/skottie/skottielib/src/main/cpp/native-lib.cpp" ]
libs = []
deps = [
":skia",
"modules/skottie",
]
}
test_app("androidkit") {
is_shared_library = true
sources = [
"modules/androidkit/src/AndroidKit.cpp",
"modules/androidkit/src/Canvas.cpp",
"modules/androidkit/src/ColorFilters.cpp",
"modules/androidkit/src/Font.cpp",
"modules/androidkit/src/FontChainAdapter.cpp",
"modules/androidkit/src/Gradients.cpp",
"modules/androidkit/src/Image.cpp",
"modules/androidkit/src/ImageFilter.cpp",
"modules/androidkit/src/Matrix.cpp",
"modules/androidkit/src/Paint.cpp",
"modules/androidkit/src/Path.cpp",
"modules/androidkit/src/PathBuilder.cpp",
"modules/androidkit/src/RuntimeShaderBuilder.cpp",
"modules/androidkit/src/Shader.cpp",
"modules/androidkit/src/SkottieAnimation.cpp",
"modules/androidkit/src/Surface.cpp",
"modules/androidkit/src/Surface.h",
"modules/androidkit/src/SurfaceThread.cpp",
"modules/androidkit/src/SurfaceThread.h",
"modules/androidkit/src/Text.cpp",
"modules/androidkit/src/Utils.cpp",
]
libs = [
"android",
"jnigraphics",
]
deps = [
":sk_app",
":skia",
"experimental/sktext:sktext",
"modules/skottie:skottie",
]
}
}
test_app("list_gms") {
sources = [ "tools/list_gms.cpp" ]
deps = [
":gm",
":skia",
]
}
test_app("list_gpu_unit_tests") {
sources = [
"dm/DMGpuTestProcs.cpp",
"tools/list_gpu_unit_tests.cpp",
]
deps = [
":skia",
":tests",
]
}
test_lib("sk_app") {
public_deps = [
":gpu_tool_utils",
":skia",
]
sources = [
"tools/sk_app/Application.h",
"tools/sk_app/CommandSet.cpp",
"tools/sk_app/CommandSet.h",
"tools/sk_app/DisplayParams.h",
"tools/sk_app/RasterWindowContext.h",
"tools/sk_app/Window.cpp",
"tools/sk_app/Window.h",
"tools/sk_app/WindowContext.cpp",
"tools/sk_app/WindowContext.h",
]
libs = []
frameworks = []
if (is_android) {
sources += [
"tools/sk_app/android/RasterWindowContext_android.cpp",
"tools/sk_app/android/WindowContextFactory_android.h",
"tools/sk_app/android/Window_android.cpp",
"tools/sk_app/android/Window_android.h",
"tools/sk_app/android/main_android.cpp",
"tools/sk_app/android/surface_glue_android.cpp",
"tools/sk_app/android/surface_glue_android.h",
]
libs += [ "android" ]
} else if (is_linux) {
sources += [
"tools/sk_app/unix/RasterWindowContext_unix.cpp",
"tools/sk_app/unix/WindowContextFactory_unix.h",
"tools/sk_app/unix/Window_unix.cpp",
"tools/sk_app/unix/Window_unix.h",
"tools/sk_app/unix/keysym2ucs.c",
"tools/sk_app/unix/keysym2ucs.h",
"tools/sk_app/unix/main_unix.cpp",
]
libs += [
"GL", # Used by raster window context, so cannot be behind skia_use_gl.
"X11",
]
} else if (is_win) {
sources += [
"tools/sk_app/win/RasterWindowContext_win.cpp",
"tools/sk_app/win/WindowContextFactory_win.h",
"tools/sk_app/win/Window_win.cpp",
"tools/sk_app/win/Window_win.h",
"tools/sk_app/win/main_win.cpp",
]
} else if (is_mac) {
sources += [
"tools/sk_app/mac/WindowContextFactory_mac.h",
"tools/sk_app/mac/Window_mac.h",
"tools/sk_app/mac/Window_mac.mm",
"tools/sk_app/mac/main_mac.mm",
]
frameworks += [
"QuartzCore.framework",
"Cocoa.framework",
"Foundation.framework",
]
} else if (is_ios) {
sources += [
"tools/sk_app/ios/WindowContextFactory_ios.h",
"tools/sk_app/ios/Window_ios.h",
"tools/sk_app/ios/Window_ios.mm",
"tools/sk_app/ios/main_ios.mm",
]
frameworks += [ "QuartzCore.framework" ]
}
if (skia_use_gl) {
sources += [ "tools/sk_app/GLWindowContext.cpp" ]
sources += [ "tools/sk_app/GLWindowContext.h" ]
if (is_android) {
sources += [ "tools/sk_app/android/GLWindowContext_android.cpp" ]
} else if (is_linux) {
sources += [ "tools/sk_app/unix/GLWindowContext_unix.cpp" ]
} else if (is_win) {
sources += [ "tools/sk_app/win/GLWindowContext_win.cpp" ]
if (skia_use_angle) {
sources += [ "tools/sk_app/win/ANGLEWindowContext_win.cpp" ]
}
} else if (is_mac) {
sources += [
"tools/sk_app/mac/GLWindowContext_mac.mm",
"tools/sk_app/mac/RasterWindowContext_mac.mm",
]
} else if (is_ios) {
sources += [
"tools/sk_app/ios/GLWindowContext_ios.mm",
"tools/sk_app/ios/RasterWindowContext_ios.mm",
]
}
}
if (skia_use_vulkan) {
sources += [ "tools/sk_app/VulkanWindowContext.cpp" ]
sources += [ "tools/sk_app/VulkanWindowContext.h" ]
if (is_android) {
sources += [ "tools/sk_app/android/VulkanWindowContext_android.cpp" ]
} else if (is_linux) {
sources += [ "tools/sk_app/unix/VulkanWindowContext_unix.cpp" ]
libs += [ "X11-xcb" ]
} else if (is_win) {
sources += [ "tools/sk_app/win/VulkanWindowContext_win.cpp" ]
}
}
if (skia_use_metal) {
sources += [ "tools/sk_app/MetalWindowContext.mm" ]
sources += [ "tools/sk_app/MetalWindowContext.h" ]
if (skia_enable_graphite) {
sources += [ "tools/sk_app/GraphiteMetalWindowContext.mm" ]
sources += [ "tools/sk_app/GraphiteMetalWindowContext.h" ]
}
if (is_mac) {
sources += [ "tools/sk_app/mac/MetalWindowContext_mac.mm" ]
if (skia_enable_graphite) {
sources += [ "tools/sk_app/mac/GraphiteMetalWindowContext_mac.mm" ]
}
} else if (is_ios) {
sources += [ "tools/sk_app/ios/MetalWindowContext_ios.mm" ]
}
}
if (skia_use_direct3d) {
sources += [ "tools/sk_app/win/D3D12WindowContext_win.cpp" ]
}
if (skia_use_dawn) {
sources += [ "tools/sk_app/DawnWindowContext.cpp" ]
sources += [ "tools/sk_app/DawnWindowContext.h" ]
if (is_linux) {
if (dawn_enable_vulkan) {
sources += [ "tools/sk_app/unix/DawnVulkanWindowContext_unix.cpp" ]
defines = [ "VK_USE_PLATFORM_XCB_KHR" ]
libs += [ "X11-xcb" ]
}
} else if (is_win) {
if (dawn_enable_d3d12) {
sources += [ "tools/sk_app/win/DawnD3D12WindowContext_win.cpp" ]
}
} else if (is_mac) {
if (dawn_enable_metal) {
sources += [ "tools/sk_app/mac/DawnMTLWindowContext_mac.mm" ]
}
}
}
deps = [ ":tool_utils" ]
if (is_android) {
deps += [ "${skia_third_party_dir}/native_app_glue" ]
}
if (skia_use_gl && skia_use_angle) {
deps += [ "${skia_third_party_dir}/angle2" ]
}
}
if (!skia_use_vulkan && (is_mac || is_linux || is_win)) {
test_app("fiddle_examples") {
sources = [
"tools/fiddle/all_examples.cpp",
"tools/fiddle/examples.cpp",
"tools/fiddle/examples.h",
]
if (is_win && !is_mingw) {
cflags = [
"/wd4756", # Overflow in constant arithmetic
"/wd4305", # truncation from 'double' to 'float'
]
}
deps = [
":skia",
":skia.h",
"modules/particles",
"modules/skottie",
"modules/skparagraph",
"modules/skshaper",
"modules/svg",
]
}
}
# sk_app can work without GL but viewer always runs raster through a GL window context.
if (skia_use_gl) {
test_app("viewer") {
is_shared_library = is_android
sources = [
"tools/viewer/AnimTimer.h",
"tools/viewer/BisectSlide.cpp",
"tools/viewer/BisectSlide.h",
"tools/viewer/GMSlide.cpp",
"tools/viewer/GMSlide.h",
"tools/viewer/ImGuiLayer.cpp",
"tools/viewer/ImGuiLayer.h",
"tools/viewer/ImageSlide.cpp",
"tools/viewer/ImageSlide.h",
"tools/viewer/MSKPSlide.cpp",
"tools/viewer/MSKPSlide.h",
"tools/viewer/ParticlesSlide.cpp",
"tools/viewer/ParticlesSlide.h",
"tools/viewer/SKPSlide.cpp",
"tools/viewer/SKPSlide.h",
"tools/viewer/SampleSlide.cpp",
"tools/viewer/SampleSlide.h",
"tools/viewer/SkRiveSlide.cpp",
"tools/viewer/SkRiveSlide.h",
"tools/viewer/SkSLSlide.cpp",
"tools/viewer/SkSLSlide.h",
"tools/viewer/SkottieSlide.cpp",
"tools/viewer/SkottieSlide.h",
"tools/viewer/Slide.h",
"tools/viewer/SlideDir.cpp",
"tools/viewer/SlideDir.h",
"tools/viewer/StatsLayer.cpp",
"tools/viewer/StatsLayer.h",
"tools/viewer/SvgSlide.cpp",
"tools/viewer/SvgSlide.h",
"tools/viewer/TouchGesture.cpp",
"tools/viewer/TouchGesture.h",
"tools/viewer/Viewer.cpp",
"tools/viewer/Viewer.h",
]
libs = []
deps = [
":common_flags_fontmgr",
":common_flags_gpu",
":flags",
":gm",
":gpu_tool_utils",
":samples",
":sk_app",
":skia",
":tool_utils",
":trace",
"${skia_third_party_dir}/imgui",
"experimental/skrive",
"experimental/sktext",
"modules/audioplayer",
"modules/particles",
"modules/skottie",
"modules/skottie:utils",
"modules/sksg:samples",
"modules/svg",
]
if (skia_use_experimental_xform) {
deps += [ ":experimental_xform" ]
sources += [ "gm/xform.cpp" ]
}
if (skia_use_vulkan) {
deps += [
"${skia_third_party_dir}/externals/spirv-tools:spvtools",
#spvtools depends on this but doesn't deps it in.
"${skia_third_party_dir}/externals/spirv-tools:spvtools_val",
]
}
}
}
if (skia_use_gl && !skia_use_angle && (is_linux || is_win || is_mac)) {
test_app("HelloWorld") {
sources = [ "example/HelloWorld.cpp" ]
libs = []
deps = [
":flags",
":gpu_tool_utils",
":sk_app",
":skia",
":tool_utils",
]
}
}
if (skia_qt_path != "" && (is_win || is_linux || is_mac)) {
action_foreach("generate_mocs") {
script = "gn/call.py"
sources = [ "tools/mdbviz/MainWindow.h" ]
outputs = [ "$target_gen_dir/mdbviz/{{source_name_part}}_moc.cpp" ]
args = [
"$skia_qt_path" + "/bin/moc",
"{{source}}",
"-o",
"gen/mdbviz/{{source_name_part}}_moc.cpp",
]
}
action_foreach("generate_resources") {
script = "gn/call.py"
sources = [ "tools/mdbviz/resources.qrc" ]
outputs = [ "$target_gen_dir/mdbviz/{{source_name_part}}_res.cpp" ]
args = [
"$skia_qt_path" + "/bin/rcc",
"{{source}}",
"-o",
"gen/mdbviz/{{source_name_part}}_res.cpp",
]
}
test_app("mdbviz") {
if (is_win && !is_mingw) {
# on Windows we need to disable some exception handling warnings due to the Qt headers
cflags = [ "/Wv:18" ] # 18 -> VS2013, 19 -> VS2015, 1910 -> VS2017
}
sources = [
"tools/UrlDataManager.cpp",
"tools/debugger/DebugCanvas.cpp",
"tools/debugger/DebugLayerManager.cpp",
"tools/debugger/DrawCommand.cpp",
"tools/debugger/JsonWriteBuffer.cpp",
"tools/mdbviz/MainWindow.cpp",
"tools/mdbviz/Model.cpp",
"tools/mdbviz/main.cpp",
# generated files
"$target_gen_dir/mdbviz/MainWindow_moc.cpp",
"$target_gen_dir/mdbviz/resources_res.cpp",
]
lib_dirs = [ "$skia_qt_path/lib" ]
libs = [
"Qt5Core.lib",
"Qt5Gui.lib",
"Qt5Widgets.lib",
]
include_dirs = [
"$skia_qt_path/include",
"$skia_qt_path/include/QtCore",
"$skia_qt_path/include/QtWidgets",
]
deps = [
":generate_mocs",
":generate_resources",
":skia",
]
}
}
if (is_android && defined(ndk) && ndk != "") {
copy("gdbserver") {
sources = [ "$ndk/$ndk_gdbserver" ]
outputs = [ "$root_out_dir/gdbserver" ]
}
}
skia_executable("cpu_modules") {
sources = [ "tools/cpu_modules.cpp" ]
deps = [
":skia",
"modules/particles",
]
}
if (skia_use_icu && skia_use_harfbuzz) {
test_app("editor") {
is_shared_library = is_android
deps = [ "modules/skplaintexteditor:editor_app" ]
}
test_app("text_editor") {
is_shared_library = is_android
deps = [ "experimental/sktext:text_editor" ]
}
}
skia_executable("image_diff_metric") {
sources = [ "tools/image_diff_metric.cpp" ]
deps = [ ":skia" ]
}
group("modules_testonly") {
testonly = true
deps = []
if (target_cpu == "wasm") {
deps += [ "modules/canvaskit:viewer_wasm" ]
}
}
if (skia_build_fuzzers) {
template("libfuzzer_app") {
skia_executable(target_name) {
output_dir = root_build_dir
check_includes = false
forward_variables_from(invoker, "*", [ "is_shared_library" ])
if (!defined(configs)) {
configs = []
}
configs += [ ":skia_private" ]
sources += [
"fuzz/Fuzz.cpp",
"fuzz/FuzzCommon.cpp",
]
deps += [
":flags",
":gpu_tool_utils",
":skia",
]
defines = [ "SK_BUILD_FOR_LIBFUZZER" ]
if (skia_use_libfuzzer_defaults) {
cflags = [ "-fsanitize=fuzzer" ]
ldflags = [ "-fsanitize=fuzzer" ]
}
testonly = true
}
}
libfuzzer_app("region_deserialize") {
sources = [ "fuzz/oss_fuzz/FuzzRegionDeserialize.cpp" ]
deps = []
}
libfuzzer_app("image_filter_deserialize") {
include_dirs = [
"tools",
"tools/fonts",
]
sources = [
"fuzz/oss_fuzz/FuzzImageFilterDeserialize.cpp",
"tools/Resources.cpp",
"tools/fonts/TestFontMgr.cpp",
"tools/fonts/TestSVGTypeface.cpp",
"tools/fonts/TestTypeface.cpp",
]
deps = [ "modules/svg" ]
}
libfuzzer_app("region_set_path") {
sources = [ "fuzz/oss_fuzz/FuzzRegionSetPath.cpp" ]
deps = []
}
libfuzzer_app("textblob_deserialize") {
include_dirs = [
"tools",
"tools/fonts",
]
sources = [
"fuzz/oss_fuzz/FuzzTextBlobDeserialize.cpp",
"tools/Resources.cpp",
"tools/fonts/TestFontMgr.cpp",
"tools/fonts/TestSVGTypeface.cpp",
"tools/fonts/TestTypeface.cpp",
]
deps = [ "modules/svg" ]
}
libfuzzer_app("path_deserialize") {
sources = [ "fuzz/oss_fuzz/FuzzPathDeserialize.cpp" ]
deps = []
}
libfuzzer_app("image_decode") {
sources = [ "fuzz/oss_fuzz/FuzzImage.cpp" ]
deps = []
}
libfuzzer_app("animated_image_decode") {
sources = [ "fuzz/oss_fuzz/FuzzAnimatedImage.cpp" ]
deps = []
}
libfuzzer_app("api_create_ddl") {
include_dirs = [
"include",
"include/gpu",
]
sources = [
"fuzz/FuzzCreateDDL.cpp",
"fuzz/oss_fuzz/FuzzAPICreateDDL.cpp",
"tools/Resources.cpp",
"tools/UrlDataManager.cpp",
"tools/debugger/DebugCanvas.cpp",
"tools/debugger/DebugLayerManager.cpp",
"tools/debugger/DrawCommand.cpp",
"tools/debugger/JsonWriteBuffer.cpp",
"tools/fonts/TestFontMgr.cpp",
"tools/fonts/TestSVGTypeface.cpp",
"tools/fonts/TestTypeface.cpp",
]
deps = [
"${skia_third_party_dir}/libpng",
"modules/svg",
]
}
libfuzzer_app("api_draw_functions") {
sources = [
"fuzz/FuzzDrawFunctions.cpp",
"fuzz/oss_fuzz/FuzzDrawFunctions.cpp",
]
deps = []
}
libfuzzer_app("api_ddl_threading") {
sources = [
"fuzz/FuzzDDLThreading.cpp",
"fuzz/oss_fuzz/FuzzDDLThreading.cpp",
]
deps = []
}
libfuzzer_app("api_gradients") {
sources = [
"fuzz/FuzzGradients.cpp",
"fuzz/oss_fuzz/FuzzGradients.cpp",
]
deps = []
}
libfuzzer_app("api_image_filter") {
include_dirs = [
"tools",
"tools/debugger",
]
sources = [
"fuzz/FuzzCanvas.cpp",
"fuzz/oss_fuzz/FuzzAPIImageFilter.cpp",
"tools/UrlDataManager.cpp",
"tools/debugger/DebugCanvas.cpp",
"tools/debugger/DebugLayerManager.cpp",
"tools/debugger/DrawCommand.cpp",
"tools/debugger/JsonWriteBuffer.cpp",
]
deps = [ "${skia_third_party_dir}/libpng" ]
}
libfuzzer_app("api_path_measure") {
sources = [
"fuzz/FuzzPathMeasure.cpp",
"fuzz/oss_fuzz/FuzzPathMeasure.cpp",
]
deps = []
}
libfuzzer_app("api_pathop") {
sources = [
"fuzz/FuzzPathop.cpp",
"fuzz/oss_fuzz/FuzzPathop.cpp",
]
deps = []
}
libfuzzer_app("api_triangulation") {
sources = [
"fuzz/FuzzTriangulation.cpp",
"fuzz/oss_fuzz/FuzzTriangulation.cpp",
]
deps = []
}
libfuzzer_app("api_raster_n32_canvas") {
include_dirs = [
"tools",
"tools/debugger",
"tools/fonts",
]
sources = [
"fuzz/FuzzCanvas.cpp",
"fuzz/oss_fuzz/FuzzRasterN32Canvas.cpp",
"tools/Resources.cpp",
"tools/UrlDataManager.cpp",
"tools/debugger/DebugCanvas.cpp",
"tools/debugger/DebugLayerManager.cpp",
"tools/debugger/DrawCommand.cpp",
"tools/debugger/JsonWriteBuffer.cpp",
"tools/fonts/TestFontMgr.cpp",
"tools/fonts/TestSVGTypeface.cpp",
"tools/fonts/TestTypeface.cpp",
]
deps = [
"${skia_third_party_dir}/libpng",
"modules/svg",
]
}
libfuzzer_app("api_regionop") {
sources = [
"fuzz/FuzzRegionOp.cpp",
"fuzz/oss_fuzz/FuzzRegionOp.cpp",
]
deps = []
}
if (skia_use_gl) {
libfuzzer_app("api_mock_gpu_canvas") {
include_dirs = [
"tools",
"tools/debugger",
"tools/fonts",
]
sources = [
"fuzz/FuzzCanvas.cpp",
"fuzz/oss_fuzz/FuzzMockGPUCanvas.cpp",
"tools/LsanSuppressions.cpp",
"tools/Resources.cpp",
"tools/UrlDataManager.cpp",
"tools/debugger/DebugCanvas.cpp",
"tools/debugger/DebugLayerManager.cpp",
"tools/debugger/DrawCommand.cpp",
"tools/debugger/JsonWriteBuffer.cpp",
"tools/fonts/TestFontMgr.cpp",
"tools/fonts/TestSVGTypeface.cpp",
"tools/fonts/TestTypeface.cpp",
]
deps = [
"${skia_third_party_dir}/libpng",
"modules/svg",
]
}
}
libfuzzer_app("api_null_canvas") {
include_dirs = [
"tools",
"tools/debugger",
"tools/fonts",
]
sources = [
"fuzz/FuzzCanvas.cpp",
"fuzz/oss_fuzz/FuzzNullCanvas.cpp",
"tools/Resources.cpp",
"tools/UrlDataManager.cpp",
"tools/debugger/DebugCanvas.cpp",
"tools/debugger/DebugLayerManager.cpp",
"tools/debugger/DrawCommand.cpp",
"tools/debugger/JsonWriteBuffer.cpp",
"tools/fonts/TestFontMgr.cpp",
"tools/fonts/TestSVGTypeface.cpp",
"tools/fonts/TestTypeface.cpp",
]
deps = [
"${skia_third_party_dir}/libpng",
"modules/svg",
]
}
libfuzzer_app("api_skparagraph") {
sources = [
"fuzz/FuzzSkParagraph.cpp",
"fuzz/oss_fuzz/FuzzSkParagraph.cpp",
"tools/Resources.cpp",
]
deps = [ "modules/skparagraph" ]
}
libfuzzer_app("api_svg_canvas") {
include_dirs = [
"include",
"include/svg",
]
sources = [
"fuzz/FuzzCanvas.cpp",
"fuzz/oss_fuzz/FuzzAPISVGCanvas.cpp",
"tools/Resources.cpp",
"tools/UrlDataManager.cpp",
"tools/debugger/DebugCanvas.cpp",
"tools/debugger/DebugLayerManager.cpp",
"tools/debugger/DrawCommand.cpp",
"tools/debugger/JsonWriteBuffer.cpp",
"tools/fonts/TestFontMgr.cpp",
"tools/fonts/TestSVGTypeface.cpp",
"tools/fonts/TestTypeface.cpp",
]
deps = [
"${skia_third_party_dir}/libpng",
"modules/svg",
]
}
libfuzzer_app("png_encoder") {
sources = [
"fuzz/FuzzEncoders.cpp",
"fuzz/oss_fuzz/FuzzPNGEncoder.cpp",
]
deps = []
}
libfuzzer_app("jpeg_encoder") {
sources = [
"fuzz/FuzzEncoders.cpp",
"fuzz/oss_fuzz/FuzzJPEGEncoder.cpp",
]
deps = []
}
libfuzzer_app("webp_encoder") {
sources = [
"fuzz/FuzzEncoders.cpp",
"fuzz/oss_fuzz/FuzzWEBPEncoder.cpp",
]
deps = []
}
libfuzzer_app("skottie_json") {
sources = [
"modules/skottie/fuzz/FuzzSkottieJSON.cpp",
"tools/Resources.cpp",
"tools/fonts/TestFontMgr.cpp",
"tools/fonts/TestSVGTypeface.cpp",
"tools/fonts/TestTypeface.cpp",
]
deps = [
"modules/skottie:skottie",
"modules/svg",
]
}
libfuzzer_app("skjson") {
sources = [ "fuzz/oss_fuzz/FuzzJSON.cpp" ]
deps = []
}
libfuzzer_app("api_polyutils") {
sources = [
"fuzz/FuzzPolyUtils.cpp",
"fuzz/oss_fuzz/FuzzPolyUtils.cpp",
]
deps = [ ":skia" ]
}
libfuzzer_app("android_codec") {
sources = [ "fuzz/oss_fuzz/FuzzAndroidCodec.cpp" ]
deps = []
}
libfuzzer_app("image_decode_incremental") {
sources = [ "fuzz/oss_fuzz/FuzzIncrementalImage.cpp" ]
deps = []
}
libfuzzer_app("sksl2glsl") {
sources = [ "fuzz/oss_fuzz/FuzzSKSL2GLSL.cpp" ]
deps = []
}
libfuzzer_app("sksl2spirv") {
sources = [ "fuzz/oss_fuzz/FuzzSKSL2SPIRV.cpp" ]
deps = []
}
libfuzzer_app("sksl2metal") {
sources = [ "fuzz/oss_fuzz/FuzzSKSL2Metal.cpp" ]
deps = []
}
libfuzzer_app("sksl2pipeline") {
sources = [ "fuzz/oss_fuzz/FuzzSKSL2Pipeline.cpp" ]
deps = []
}
libfuzzer_app("skdescriptor_deserialize") {
sources = [ "fuzz/oss_fuzz/FuzzSkDescriptorDeserialize.cpp" ]
deps = []
}
libfuzzer_app("svg_dom") {
sources = [ "fuzz/oss_fuzz/FuzzSVG.cpp" ]
deps = [ "modules/svg" ]
}
libfuzzer_app("skruntimeeffect") {
sources = [ "fuzz/oss_fuzz/FuzzSkRuntimeEffect.cpp" ]
deps = []
}
libfuzzer_app("skp") {
sources = [ "fuzz/oss_fuzz/FuzzSKP.cpp" ]
deps = []
}
}
}
if (is_ios && skia_use_metal && skia_enable_gpu &&
!skia_enable_flutter_defines) {
group("minimal_ios_mtl_skia_app") {
deps = [ "experimental/minimal_ios_mtl_skia_app" ]
}
}
if (is_ios && skia_enable_skottie && !skia_enable_flutter_defines) {
group("skottie_ios") {
deps = [ "tools/skottie_ios_app" ]
}
}
skia_executable("skia_c_api_example") {
sources = [ "experimental/c-api-example/skia-c-example.c" ]
include_dirs = [ "." ]
deps = [ ":skia" ]
}
1
https://gitee.com/openharmony/third_party_skia.git
git@gitee.com:openharmony/third_party_skia.git
openharmony
third_party_skia
third_party_skia
master

搜索帮助