Introducing to SKIA with C++ by Vladyslav Yeremeichuk

preview_player
Показать описание
Skia is a 2D graphics library from Google that provides a common API for lots of platforms like: Windows, Mac, Android, IOS, WebGL, ChromeOS, etc.
This library also supports lots of backends for canvas: rasterized (that will works on CPU only) and GPU-based like OpenGL/DirectX/Angle.

The presentation includes some general information about this library, several notes about how build Skia and examples like:

Create first Skia-based application
Drawing of simple shapes
Text rendering
How to load and draw bitmaps
Canvas transformations
Objects blending and shaders

Detailed Skia build instruction:

Add Python and depot_tools to PATH
Run cmd in skia folder
python tools/git-sync-deps
Build:
PROD: bin\gn gen out/Shared --args="is_debug=false is_official_build=true is_component_build=true skia_use_system_expat=false skia_use_system_libjpeg_turbo=false skia_use_system_libpng=false skia_use_system_libwebp=false skia_use_system_zlib=false skia_use_system_icu=false skia_use_system_harfbuzz=false skia_use_gl=true"
DEBUG: bin\gn gen out/Shared --args="is_debug=true is_component_build=true skia_use_system_expat=false skia_use_system_libjpeg_turbo=false skia_use_system_libpng=false skia_use_system_libwebp=false skia_use_system_zlib=false skia_use_system_icu=false skia_use_system_harfbuzz=false skia_use_gl=true"
ninja -C out/Shared
Рекомендации по теме
Комментарии
Автор

simple and a fast skia intro, thankyou

sourbhkamboj
Автор

Usually, programming on GPU is done with special languages like CUDA or OpenCL. What language is used in Skia?

khaimgulkovich
Автор

I wanted to build on Windows with Visual Studio a while ago but gave up because the instructions on the official website are garbage. It talks about bin/gn and --ide=vs etc. but none of those commands work. It also talks about 'args' without defining what they are or how to use them. Just lists them. This is typical of open source... complete lack of useful instruction. Wondering who else has not been able to build this library?

robby
Автор

Your example works well, thank you! But if i build skparagraph.lib(static),and copy example from skia\modules\skparagraph\tests, it always crash, when calling paragraph->layout(); Can you try and give me some advice?

zhenji
Автор

Skia like every other web rendering engine has a problem with text rendering. Margins and paddings are calculated from the caret selection text area instead from em square text area. It makes all dimensions meaningles since if you for an example make padding 24px, it will not be 24px from the em square but from the caret selection which makes it maybe 25.6 or what ever it is.

Rendering em square text is as well an another nonsense, even when correct, because it means nothing as every typefaces has different amount of space used in em square area. In digita age, controlling x height, cap height and other should be used for dimensioning.

ZlatanYU
Автор

Sorry, I could not give better rating for this video. You have performed all the program before starting the tutorial. For a platform like Skia, this approach is useless. Even if you have written just one simple program showing how to create skia objects while doing the tutorial, it would have been very useful. Undoubtedly you are a very good programmer, but unfortunately your tutorial is not useful for most of people who want to learn how to use Skia.

SatyaKolachina
Автор

Без обид, но думаю на русском было бы лучше.

АлександрСтадник-кк
Автор

Note: the green arrow threw me off. I started with "bin\gn" command before running "python tools/..." command!!! that caused me all kinds of problems. Just warning...

videosmydad
Автор

bin\gn gen out/Shared is_component_build=true skia_use_system_expat=false skia_use_system_libpng=false skia_use_system_libwebp=false skia_use_system_zlib=false skia_use_system_icu=false skia_use_gl=true"

videosmydad
visit shbcf.ru