Questions tagged [skia]
Skia is a complete C++ 2D graphics library for drawing text, geometries, and images.
350
questions
65
votes
3
answers
13k
views
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? ...
46
votes
4
answers
28k
views
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,...
30
votes
1
answer
8k
views
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.
19
votes
4
answers
21k
views
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?
16
votes
1
answer
18k
views
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 ...
16
votes
1
answer
2k
views
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 ...
15
votes
4
answers
22k
views
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 ...
13
votes
1
answer
9k
views
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
11
votes
5
answers
4k
views
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 ...
11
votes
0
answers
572
views
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 ...
10
votes
2
answers
15k
views
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 ...
10
votes
1
answer
4k
views
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 ...
10
votes
2
answers
13k
views
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 ...
9
votes
1
answer
17k
views
How to draw rich text with Skia or SkiaSharp
I want to draw rich text like iOS's Attributed Text or Xamarin.Forms's FormattedString with SkiaSharp, but I can't find how to.
I found the DrawText method, but it's for simple text rendering with ...
9
votes
2
answers
443
views
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 ...
8
votes
0
answers
853
views
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\",...
8
votes
0
answers
1k
views
How to use double buffering with SkiaSharp
I'm just playing around with Xamarin Forms and SkiaSharp. I've create a simple Xamarin forms ContentView with a SkiaCanvas. My PaintSurface is as follows to draw a simple green circle:
private ...
7
votes
2
answers
6k
views
How to compile skia on Windows
I tried compiling skia on Windows as suggested in https://skia.org/user/build
bin/gn gen out/Static --args='is_official_build=true'
ninja -C out/Static
Build fails to find libjpeg.h, libpng.h
Then ...
7
votes
4
answers
8k
views
Skia Decoder fails to decode remote Stream
I am trying to open a remote Stream of a JPEG image and convert it into a Bitmap object:
BitmapFactory.decodeStream(
new URL("http://some.url.to/source/image.jpg")
.openStream());
The decoder ...
7
votes
2
answers
5k
views
How to draw with an "inverted" paint in Android Canvas?
I draw some stuff on a canvas, over I want to draw a circle in inverted color :
canvas.drawCircle(zx, zy, 8f, myPaint);
How to configure myPaint for circle pixel to be in the inverted color of the ...
7
votes
0
answers
783
views
How can I render a set of primitives using Avalonia and Skia backend on macos?
I need to create a simple app to draw a graph network onto a canvas. As I use .net core it seems that one of the best solutions could be Avalonia + Skia backend. The problem is that I haven't found ...
7
votes
3
answers
13k
views
What graphic library does chrome use [closed]
I know about openGL/directX graphic library that can be used to render graphics. Hardware vendor of
Graphic processing unit support these libraries.
I wanted to know about what chrome use to render ...
6
votes
5
answers
6k
views
Is it possible to create a Skia Canvas element in an Avalonia application?
I am hoping to port an Electron app over to Avalonia. The app currently uses Paper.js to draw and manage interactions with complex polygons. Looking into Avalonia, I noticed it uses Skia, which seems ...
6
votes
2
answers
5k
views
Draw rotated text in SkiaSharp
How to draw rotated text in SkiaSharp.
Currently I'm rotating the SKCanvas, drawing the text and then rotating it back. But I thought may be there is a more efficient way to do this.
canvas....
6
votes
2
answers
9k
views
Want to learn graphics using Skia on Ubuntu [closed]
I want to learn graphics programming, and I want to use Skia as the library.
How do I begin with it on Ubuntu?
6
votes
1
answer
1k
views
How does Skia or Direct2D render lines or polygons with GPU?
This is a question to understand the principles of GPU accelerated rendering of 2d vector graphics.
With Skia or Direct2D, you can draw e.g. rounded rectangles, Bezier curves, polygons, and also have ...
6
votes
1
answer
1k
views
Native Crash in Android 4.3 when calling Picture.writeToStream()
A regression has been introduced into Android 4.3. Code that used to work in previous versions of Android now causes a native crash which shuts down the process.
The crash occurs when drawing an ...
6
votes
1
answer
999
views
How to intercept Skia draw commands from Chromium Browser
This is an experimental project of mine related to remote browser isolation. I'm trying to intercept Skia draw commands in a running Chromium instance and later replay them in a different browser ...
6
votes
2
answers
4k
views
Skia and Android Paint drawing objects and their use or documentation
Does anyone know of good documentation for the Skia drawing library used by Android?
The main Canvas object has hardly any state, so I'm thinking especially of the objects you can embed into the ...
6
votes
0
answers
2k
views
Use metal as backend in skia
I want to try the metal with skia, but the surface always returns null, and I can't find any way around..
Here is the code:
_device = MTLCreateSystemDefaultDevice();
MTLTextureDescriptor* textureDst = ...
5
votes
1
answer
3k
views
Draw Text within DrawScope - Jetpack Compose Desktop
I want to draw Text inside a canvas to display a label for a chart.
On Android, I can use the library: https://github.com/tehras/charts (For Compose: 1-alpha03)
but on Desktop I can't.
Thus I tried to ...
5
votes
1
answer
2k
views
How to find PixelFormat for decoded bitmap using SkiaSharp
In System.Drawing we retrieve the PixelFormat from Image object, but SkiaSharp.SkImage does not provide API to find the PixelFormat of decoded image. Whether it has any other workaround to find the ...
5
votes
1
answer
3k
views
Render an SVG with filter effects to PNG
I would like to render an SVG I've created to a hi-res (600 DPI) PNG. This SVG has filter effects, specifically gaussian blur.
Ideally rendering could be done via the command line.
I know the SVG is ...
5
votes
2
answers
873
views
How to obtain mesh from Skia path geometry?
I'm trying to figure out how to make Skia produce mesh from path geometry. I've checked SkPath::dump, SkPath::writeToMemory, SkPath::serialize, however all of them seem to output path content rather ...
5
votes
1
answer
312
views
Chrome Render Bug while resizing Table, header background stick on top of another div
I have two different panels those are resizable by dragging.
All things are working fine in other browsers but in chrome somehow the background of header stick to the parent div. it seems the new ...
5
votes
0
answers
776
views
How do I properly build a .NET 7 application using SkiaSharp on Linux? Getting a segmentation fault when creating GRGlInterface
I have a test application written in F# on .NET 7 that opens a window using GLFW and draws to it using SkiaSharp. This application works on Windows, and now I am testing support on Linux. Right now, I ...
5
votes
0
answers
347
views
How to find the equivalent pixel format in skiasharp?
In system.drawing there is a pixelformat in which we have added the pixel format while creating the BITMAP.Kindly refer the below code.
Bitmap image = new Bitmap((int)width, (int)height, ...
5
votes
0
answers
691
views
SkiaSharp SVG click element get id
let say i have svg document like this:
"<svg height='300' width='300'><rect class='rect us' id='12212' x='34' y='54' width='20' height='20'/><rect class='rect us' id='12213' x='64' y='...
5
votes
1
answer
4k
views
Picasso fails to decode some images: skia decode returned false
Update: It seems that this question boils down to that some images are correctly decoded, while some don't. If I convert the non-working JPEGs to pngs, they work. None of my images taken directly as ...
4
votes
1
answer
4k
views
How to link the Skia library for a C++ project with Xcode
Skia is a graphics library (skia.org).
The documentation explains how to build the library after cloning the project via git. But the documentation is unclear as of this date, how to build a C++ ...
4
votes
2
answers
3k
views
SkiaSharp does not fill triangle with StrokeAndFill
I am trying to draw and fill a triangle. I referred an android - question How to draw filled triangle on android Canvas and did the following. It draws the triangle but it doesn’t fill it. How to get ...
4
votes
1
answer
4k
views
How to use Skia on Windows or Linux
I have built Skia. What do I do now to get an SkCanvas and draw on it? This answer does not properly answer the question because
A: It uses API that doesn't exist anymore, like bitmap.lockPixels(),
B:...
4
votes
2
answers
3k
views
Fody Costura Does Not Embed SkiaSharp DLL
I created a solution that uses the Costura.Fody nuget package to merge referenced assemblies as embedded resources. I want this so that I can create a single exe for my application. This was working ...
4
votes
2
answers
5k
views
SKIA :: Get Text height of a text inside a canvas
I am using Skia for one of my sample program. I have a canvas and inside this I am writing text with font_size 30, this is the code snippet.
string = "Test String";
SkString text(string);
SkPaint ...
4
votes
2
answers
525
views
How to measure trailing spaces using SkiaSharp?
SkiaSharp doesn't consider the white spaces, when a text contains white spaces in prefix or suffix. It returns the text width only and ignore the white spaces. I am using the following code snippet to ...
4
votes
1
answer
534
views
What is the optimal render loop in Dart 2?
I am looking for ideas regarding an optimal/minimal structure for the inner render loop in Dart 2, for a 2d game (if that part matters).
Clarification / Explanation: Every framework / language has ...
4
votes
2
answers
2k
views
How to make the SKBitmap bitmap color as Transparent in SkiaSharp
In System.Drawing we will make the bitmap image color as transparent by using maketransparent method Whether SKBITMAP has any other equivalent method for making the color to transparent.
Bitmap ...
4
votes
3
answers
3k
views
Building Skia on Windows 32 bit
I'm building Skia on Windows following this link.
For Windows x64 the build was quite smooth. But not for 32 bit.
1) I tried specifying target_cpu = "x86" instead of target_cpu = "x64", gn gen works ...
4
votes
1
answer
779
views
Drawing complex text in android ics in native c
NB: My whole senario is for only android version ICS.
My Goal is to render text having complex script/indic script. In ICS, this feature has been added in WebView (and so Browser). If any indic text ...
4
votes
1
answer
456
views
How can I allow the user to scroll a very large Skia canvas?
I have a React Native app which will include a graph that the user can scroll through. For the sake of this example, I'm just using a horizontal row of circles.
To draw my graph, I am using Skia (...