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
2
votes
3 answers

Android SKIA Image Decoding

HI, I am currently studying how Android decode and image file. When I checked the code, it seems like it is calling the SKIA library. But, how do I know what are the image file format supported by android/skia basing on the source code? I am not an…
artsylar
  • 2,648
  • 4
  • 34
  • 51
2
votes
0 answers

Memory crash while drawing with skia on honeycomb

I have a function that instantiates an object of "SkPath" on stack. After that I call few functions such as "moveTo", "lineTo", "cubicTo" ( which is simply adds new points to inner array inside of the SkPath object). Then I instantiate object of…
2
votes
1 answer

Is Flutter's Canvas.drawOval an ellipse?

I've been learning about painting custom shapes in Flutter. Canvas has a method called drawOval(). An oval is not mathematically defined like an ellipse is, so not all ovals are ellipses. I assume that "oval" is an ellipse in this case, but I wanted…
Suragch
  • 484,302
  • 314
  • 1,365
  • 1,393
2
votes
2 answers

Set Canvas origin to lower-left corner in Skia

How can I change the origin of a Canvas to the lower-left corner instead of the default top-left corner? void draw(SkCanvas* canvas) { SkPaint p; p.setColor(SK_ColorRED); p.setAntiAlias(true); p.setStyle(SkPaint::kStroke_Style); …
Vahid
  • 5,144
  • 13
  • 70
  • 146
2
votes
2 answers

Is the format saved by Android's Picture.writeToStream() documented?

I know I can look at the source, but I'm wondering if there's any documentation for the format used by android.graphics.Picture.writeToStream(OutputStream).
Laurence Gonsalves
  • 137,896
  • 35
  • 246
  • 299
2
votes
0 answers

Error while building sample application viewer located under skia/platform_tools/android directory

Steps to reproduce the problem? bin/gn gen out/arm64 --args='ndk="/home/anurag/Android/android-ndk-r19" ndk_api=27 target_os="android" target_cpu="arm64" is_component_build=true is_debug=false' ninja -C out/arm64 Output of this step is …
Anurag Singh
  • 6,140
  • 2
  • 31
  • 47
2
votes
0 answers

Change color type of bitmap in SkiaSharp?

I have a bunch of gifs I want to create thumbnails for using SkiaSharp. But SKBitmap.Resize method returns null when having a source bitmap with color type other than 32-bit (as it seems). But how do I change the source bitmap to 32-bit colors?…
Andreas Zita
  • 7,232
  • 6
  • 54
  • 115
2
votes
1 answer

Translate matrix to center and fit a rectangle

I use SkiaSharp to draw some SKRect on a SKCanvas. I'm trying to implement a "scale to fit and center" functionality for the drawing area. I used the following code to calculate the bounding box for all the SKRects. private SKRect…
nor0x
  • 1,213
  • 1
  • 15
  • 41
2
votes
0 answers

SkiaSharp support for color quantization for PNG files

I'm looking for an all-in-one solution for processing web images Resizing Cropping Save as WEBP / JPEG / PNG Drawing simple rectangles Adding text Reducing colors (quantization) for PNG The only thing I'm not clear about is PNG quantization.…
Simon_Weaver
  • 140,023
  • 84
  • 646
  • 689
2
votes
1 answer

Flip an SKPath using SkiaSharp

I'm using slightly modified resize code based on example I found. However, on resize the everything is flipped. I would like to either flip it back or prevent it from flipping in the first place. Here is my resize code: private static void…
jdm
  • 33
  • 5
2
votes
2 answers

How can I get rid of artifacts in ImageSource created with SkiaSharp

I created an app in which I want to display text on top of google maps. I chose to use custom markers, but they can only be images, so I decided to create an image from my text utilizing SkiaSharp. private static ImageSource…
hot33331
  • 805
  • 11
  • 25
2
votes
2 answers

SkiaSharp ArcTo Method does not draw curve

I am trying to draw an arc on a SkiaSharp canvas view using following code. path3.ArcTo(new SKPoint(0, h/2), 1.57f, SKPathArcSize.Large, SKPathDirection.Clockwise, new SKPoint(w/2, h)); But instead of a curve, it is drawing a straight…
LCJ
  • 22,196
  • 67
  • 260
  • 418
2
votes
0 answers

How can SKIA be used to decode a jpeg image in android

I am new to android and i want to decode JPEG images for further processing. I used BitmapFactory.decodeByteArray but it takes a lot of time to decode. How can SKIA be used to decode JPEGs efficiently any sample codes aur link to tutorial would be…
Ahmed_Faraz
  • 615
  • 4
  • 25
2
votes
1 answer

Xamarin forms (android project) error rendering image using Skia graphics library

I am trying to load and render an image using the skia graphics library in my xamarin forms solution. When I try to render the image (running the android project) I get the following error: Value cannot be null. Parameter name: codec here is the…
noobie
  • 2,427
  • 5
  • 41
  • 66
2
votes
2 answers

About skia antialias

Recently I'm learning skia library(google open source 2d engine,be used on Android and chromium,etc.),Now I want to use it on windows instead of GDI+ dont support clip area with antialias,during it, I find a problem about pixel. up is set…
李维斯
  • 21
  • 1
  • 2