Questions tagged [skia]

Skia is a complete C++ 2D graphics library for drawing text, geometries, and images.

Skia is a key part of several shipping products, including chromium, and as such will continue to track those projects' needs and priorities. However, Skia is also a general purpose graphics engine.

Features include:

  • 3x3 matrices w/ perspective
  • antialiasing, transparency, filters
  • shaders, xfermodes, maskfilters, patheffects
  • subpixel text

Device backends for Skia currently include:

  • Raster
  • OpenGL
  • PDF
  • XPS
  • Picture (for recording and then playing back into another Canvas)

Ports include:

  • Android
  • Windows
  • Macintosh
  • Linux

More information available at

  1. http://code.google.com/p/skia/
  2. http://en.wikipedia.org/wiki/Skia_Graphics_Engine
319 questions
65
votes
3 answers

How do the pieces of Android's (2D) Canvas drawing pipeline fit together?

I would like to have a better understanding of how the components of Android's (2D) Canvas drawing pipeline fit together. For example, how do XferMode, Shader, MaskFilter and ColorFilter interact? The reference docs for these classes are pretty…
Laurence Gonsalves
  • 137,896
  • 35
  • 246
  • 299
46
votes
4 answers

Android Graphics Internals

I haven't found a clear explanation on how the Android graphics system works, specifically, does it use a display server, is it based on DirectFB or X11, etc. From what I've managed to piece together, Android depends on the Linux frame buffer. I…
naasking
  • 2,514
  • 1
  • 27
  • 32
27
votes
1 answer

What is Canvas.save and Canvas.restore?

I am wondering why and when you would use Canvas.save, Canvas.restore, and maybe even Canvas.saveLayer. I have heard that they are really useful, but I do not know when to use them.
creativecreatorormaybenot
  • 114,516
  • 58
  • 291
  • 402
19
votes
4 answers

Using Skia in Android NDK

Is it true that android.graphics.* depends on the native Skia library? If so, is it possible to access the Skia library in my native C/C++ codes?
pinglamb
  • 407
  • 1
  • 4
  • 8
16
votes
1 answer

Canvas.drawText() doesn't render large emojis on Android

Canvas.drawText() doesn't render emojis above a certain font size on Android. Correct render at somewhere below 256 px: Incorrect render at above 256 px: (There is a similar question about Google Chrome, and just like Android, Chrome also uses the…
Attila Tanyi
  • 4,904
  • 5
  • 27
  • 34
15
votes
4 answers

How to use Skia / CanvasKit in Flutter Web?

I know that Flutter supports using Skia instead of DomCanvas in Flutter Web using WASM CanvasKit, i.e. "Skia + WebAssembly". I have heard that this provides significant performance improvements, however, I do not know how to enable it.
creativecreatorormaybenot
  • 114,516
  • 58
  • 291
  • 402
15
votes
1 answer

Skia vs Cairo vs Direct2D, which is the most feature rich?

A just curious question. I'm aware that: Skia, Cairo: library Direct2D: API But without any additional components, exclusively on Windows platform, which bears the most features? I'm not talking about performance or programming simplicity. Is…
Abrar Borno
  • 373
  • 1
  • 3
  • 10
11
votes
1 answer

How to add rect using Skia Sharp and apply both fill color and stroke color to that object?

How to add rect or any shape using Skia Sharp and apply both fill color and stroke color to that object in iOS
Devaraj
  • 138
  • 1
  • 8
10
votes
5 answers

org.jetbrains.skiko.LibraryLoadException: Cannot find libskiko-macos-arm64.dylib.sha256, proper native dependency missing

I try to compile https://github.com/CuriousNikhil/k5-compose in IntelliJ (Apple-Silicon) on an M1 MacbookPro, I got the below error Caused by: org.jetbrains.skiko.LibraryLoadException: Cannot find libskiko-macos-arm64.dylib.sha256, proper native…
Elye
  • 53,639
  • 54
  • 212
  • 474
10
votes
2 answers

Flutter mask a circle into a container

I want to add a circle effect over a container, but I want the circle to not extend the dimensions of the container, but instead get clipped by it. This is what I'm trying to achieve: As you can see the white circle naturally would extend the red…
Fabrizio
  • 1,138
  • 4
  • 18
  • 41
9
votes
2 answers

Non-uniform text scaling in Skia (FreeType 2 back-end)

My issue is that during smooth scaling applied to Skia canvas (with concat method) the text appears to scale in "spurts", non-uniformly. The issue is particularly evident on Android platform with FreeType 2 back-end. I believe this is how general…
Vsevolod Ganin
  • 623
  • 8
  • 22
9
votes
2 answers

Using SKIA library instead of Android Canvas

While I am researching about 2D rendering pipeline of android, I came to know a graphic library SKIA written in C++. But I am not sure it can be used instead of android Canvas. Can it be used as a replacement of the Canvas? Thanks in advance for…
user1985973
  • 181
  • 1
  • 2
  • 11
8
votes
0 answers

OpenGL/Skia rendering GL_TEXTURE_EXTERNAL_OES to GL_TEXTURE_2D

I'm having a weird issue with my OpenGL/Skia Android Camera2 app. My Camera renders frames into a SurfaceTexture, which is a GL_TEXTURE_EXTERNAL_OES texture in OpenGL. I can then simply render this OpenGL texture to all outputs (1920x1080 Preview…
mrousavy
  • 857
  • 8
  • 25
8
votes
1 answer

What is difference between ANGLE and Skia Graphics Engine?

ANGLE is an cross-platform graphics engine abstraction layer developed by Google. ANGLE team has described it as a portable OpenGL. The API is mainly designed to bring high-performance OpenGL compatibility to Windows computers and to web browsers…
Alok
  • 7,734
  • 8
  • 55
  • 100
8
votes
0 answers

compiling cpp wasm module using skia library face to an error

I'm trying to use SKIA lib in my WASM solution. first I Compiled Skia to wasm bitcode using bellow config: /bin/gn gen ./out/Build-wasm-Release/Release --args="cc=\"emcc\" extra_cflags_cc=[\"-frtti\",\"-s\",\"USE_FREETYPE=1\"] cxx=\"em++\"…
1
2 3
21 22