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
4
votes
1 answer

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++ project with Xcode which uses the Skia library. I…
arqam
  • 3,582
  • 5
  • 34
  • 69
4
votes
3 answers

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 fine but ninja throws errors complaining that the…
Yun Tao Hai
  • 111
  • 1
  • 8
4
votes
0 answers

SKIA SkCreateWGLContext returns NULL on Remote Session

I have a problem with SkCreateWGLContext on Remote Desktop Session: HDC dc = GetDC((HWND)fHWND); fHGLRC = SkCreateWGLContext(dc, msaaSampleCount, kGLPreferCompatibilityProfile_SkWGLContextRequest); if (NULL == fHGLRC) { return…
user2179256
  • 659
  • 2
  • 9
  • 21
4
votes
1 answer

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 is rendered in Browser or WebView it renders…
Sarim
  • 3,124
  • 2
  • 20
  • 20
3
votes
1 answer

How to convert SVG file to PNG file with transparency using Delphi

I want to convert a SVG file to PNG file programmatically. I'm using Delphi 10.3.3 with Skia4Delphi, but this code snippet doesn't respect transparency. It creates black background. var LBitmap: TBitmap; MyPng: TPNGImage; begin if…
Xel Naga
  • 826
  • 11
  • 28
3
votes
1 answer

Flutter web linear gradient banding on chrome

I have some trouble creating a smooth linear gradient in flutter web without getting a banding effect. My simplified code looks like this. void main() { Paint.enableDithering = true; runApp(const MyApp()); } class MyApp extends StatelessWidget…
3
votes
1 answer

How can I use the Skia API in a Flutter widget?

I want to use Skia API directly in my widget for drawing. How do I create a Skia widget? Or is there any reason why I shouldn't do that?
Wizard of Kneup
  • 1,863
  • 1
  • 18
  • 35
3
votes
0 answers

How to use a specific font style from a collection in Skia?

I am loading OpenType/TrueType font collections from memory to use for rendering text with Skia. The fonts in question are NOT active on the system running the application. To do this I'm using (in SkiaSharp) SKTypeface.FromStream which takes a…
3
votes
1 answer

Most Efficient way to render a large amount of simple shapes in Flutter

I'm implementing a particle system renderer in my Flutter application. Currently I'm using a CustomPainter which renders each particle as a rectangle using canvas.drawRect(). But I need to draw thousands of such rectangles and doing and while being…
Fabrizio
  • 1,138
  • 4
  • 18
  • 41
3
votes
1 answer

Does Android internally use Skia for drawing text on bitmaps?

I am dealing with an application which has to rapidly draw text on bitmaps. I've pretty much optimized the memory usage of the rendering process but I still want the process to be as fast as possible and that's when I learned about the Skia library…
Piyachet Kanda
  • 139
  • 3
  • 9
3
votes
1 answer

What does Elevation in DrawShadow do exactly?

I know that Flutter's Canvas.drawShadow translates to Skia's SkShadowUtils::DrawUtils, where the elevation on the Flutter side affects the zPlaneParams on the Skia side (see the flutter::PhysicalShapeLayer::DrawShadow engine implementation, which is…
creativecreatorormaybenot
  • 114,516
  • 58
  • 291
  • 402
3
votes
1 answer

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: It uses some unkown context and draws a this…
Fudge Fudge
  • 1,024
  • 1
  • 10
  • 25
3
votes
2 answers

Missing header files when trying to build Skia

I'm trying to use the Skia graphics library on Windows which requires building it from source. However, when I run the build command: ninja -C out/Static I get this build error: "C:\Program Files (x86)\Microsoft Visual…
Fudge Fudge
  • 1,024
  • 1
  • 10
  • 25
3
votes
2 answers

How to set the opacity of an image drawn to a canvas with drawImageRect?

I'm drawing to a Canvas in Flutter using drawImageRect: canvas.drawImageRect(image, sourceRect, destRect, _paint); I have an Opacity value (a double between 0 and 1). How do I paint the image using this value (so that 0 is not visible and 0.5 is…
Danny Tuppeny
  • 40,147
  • 24
  • 151
  • 275
3
votes
1 answer

JPEG hardware Decode support in Android application

My Android app needs to decode large resolution based JPEG images on Android 2.2 phones(and above), currently I am using BitmapFactory.decodeStream API, i.e. SKIA library to decode the stream. 1) As per my knowledge SKIA uses software decoding, i.e.…
Rohit
  • 6,941
  • 17
  • 58
  • 102