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
1
vote
0 answers

Can I read line pixel coordinates in Skia, without actually rendering a line to bitmap?

I have quite unique use case for Skia 2D-graphics library, where I require the maximum performance. This puts some limitations to my code. Requirements: Calculate pixel coordinates (x,y) of hundreds of lines from (x0, y0, to x1, y1) Each line has…
1
vote
0 answers

How to access SkiaSharp color palette for quantization purposes?

I'm trying to make a quantizer that works with SkiaSharp right now. For that purpose I need a way to get a ColorPalette or a way to work with indexed color format in SkiaSharp. I see that Index8 is no longer a supported ColorType, and a lot of the…
Pangamma
  • 731
  • 12
  • 28
1
vote
0 answers

How can I build Flutter web with Skia

I want to improve the performance of my Flutter site. For running locally I use this command: flutter run -d chrome --dart-define=FLUTTER_WEB_USE_SKIA=true and it works nice, but I cannot find info on how to keep this performance in release…
Roman Soviak
  • 791
  • 2
  • 9
  • 30
1
vote
0 answers

Trying to compile Skia in Android tree under Cygwin

I'm trying to compile Skia in Android tree under Cygwin, but I get these error messages:
PLATFORM_VERSION_CODENAME=AOSP…
ymdai
  • 11
  • 2
1
vote
0 answers

How can I drawText using canvaskit with word-break as normal?

When we use canvaskit to drawText it draws text which is similar to the css word-break: break-word; i.e. it sub-wraps the word. How can we disable it so that canvaskit draws the text similar to word-break: normal style.
1
vote
0 answers

Problem Winform to Skia Calculating Size Of Text

I try to transform some text rendering code from WinForm to Skia. Winform: graphics.MeasureString(text, font) Skia: var rect = new SKRect(pos.X, pos.Y, 0, 0) paint.MeasureText(text, ref rect) If you compare the results you will realize that…
Matze
  • 1,402
  • 2
  • 17
  • 24
1
vote
0 answers

Force SkParagraph layout to account for ghost whitespace

SkParagraph automatically compensates for "ghostwhitespace" when shaping a paragraph. I'd like to disable this behaviour and allow the line to pushed out when whitespace is introduced. Center alignment with current behaviour: The quick brown…
matanube
  • 407
  • 3
  • 11
1
vote
1 answer

Qt QOpenGLWidget: Skia text disappears after resize

I created a basic application with a single Skia canvas using QT. When using QOpenGLWindow as base class it works fine. But using QOpenGLWidget, the text disappears when resizing the window. The main difference is that QOpenGLWidget recreates its…
D0r1an
  • 36
  • 5
1
vote
1 answer

Skia / SkiaSharp - Rotating shapes around their own vertical axis

I generate the scene above using the OnDraw method below: protected override void OnDraw(SKCanvas canvas, int width, int height) { int i = 0; int step = 0; List rects = new List(); // get the…
Salvuccino
  • 73
  • 1
  • 5
1
vote
1 answer

Skia: any benefit of using the CPU renderer over the GPU renderer

I've created a small sample animation with SkiaSharp and it runs with 60FPS. On a real Pixel 4 it has the following perfomance: SKGLView (GPU Renderer): average Frametimes 0.5ms SKCanvasView (CPU Renderer): average frametimes: 5ms If the gpu…
juwens
  • 3,729
  • 4
  • 31
  • 39
1
vote
1 answer

Is there a way I can turn video frames from GStreamer to SkImage instances to be used in Skia?

I'm currently writing my own game engine with GStreamer for media and Skia (Vulkan) for graphics. Is there a way I can turn video frames from GStreamer to SkImage instances to be used in Skia? I searched online for documentation and solutions, but…
user11748596
1
vote
1 answer

Drawing rounded rectangle with transparency in Skia

I'm trying to draw a rounded rectangle with transparency with the library Skia. I get a perfect result if i'm using overlapping without transparency. But when i'm using transparency, i get this: That's what i get when i do not overlap: Even if i…
Arakis
  • 849
  • 5
  • 16
1
vote
1 answer

Why does Android use pinImages to upload texutures of mutable bitmaps to GPU?

When I read Android source code SkiaRecordingCanvas, I found that if a bitmap is marked as mutable, namely !isImmutable() == true, the bitmap will be cached in GPU by function SkiaPipeline::pinImages which calls the skia interface…
HolyChen
  • 29
  • 1
  • 4
1
vote
1 answer

How to handle events in skia?

I am intending to use skia for an app. How to handle events like web input box click, wheel events etc in Skia ? What are the possible events in skia? How to handle events in skia?
mafiaqueen
  • 31
  • 1
1
vote
2 answers

Aseprite ninja build error "cannot find -lSKIA_OPENGL_LIBRARY-NOTFOUND"

While trying to build Aseprite on Debian 10 (amd64) virtualbox VM, after building Skia, the ninja aseprite command returns the error: /usr/bin/ld: cannot find -lSKIA_OPENGL_LIBRARY-NOTFOUND [1/1] Linking CXX executable bin/aseprite FAILED:…