# Skia Graphics Library as a renderer in Processing

**URL:** <https://discourse.processing.org/t/skia-graphics-library-as-a-renderer-in-processing/25580>\
**Category:** Gallery\
**Created:** [November 20, 2020, 10:31pm UTC](https://discourse.processing.org/t/skia-graphics-library-as-a-renderer-in-processing/25580 "2020-11-20T22:31:36Z")\
**Posts on this page:** 20\
**Page:** 1

<div class="post-metadata">

**Author:** ![micycle](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/micycle/32/201_2.png) [@micycle](https://discourse.processing.org/u/micycle)\
**Post date:** [November 20, 2020, 10:31pm UTC](https://discourse.processing.org/t/skia-graphics-library-as-a-renderer-in-processing/25580/1 "2020-11-20T22:31:36Z")

</div>

I’ve just developed a small library to enable you to use Google’s Open Source _Skia_ Graphics Library (via [Skija](https://github.com/JetBrains/skija)) as a rendering engine for Processing.

README, a basic example and .jars here:

> **[micycle1/processing-skia](https://github.com/micycle1/processing-skia)**
>
> Eases Skija (Skia for Java) interoperability with Processing - micycle1/processing-skia

Because Skija targets JOGL (amongst other graphics back-ends) which is also used by Processing’s `P2D` and `P3D` modes, it’s possible to get Skija to render into the OPENGL window (sketch) that Processing creates. Though the code to do this isn’t much, it’s not straightforward, so this library eases that.

[![](https://raw.githubusercontent.com/micycle1/processing-skia/main/resources/squares_example.gif) ](https://raw.githubusercontent.com/micycle1/processing-skia/main/resources/squares_example.gif)

---

<div class="post-metadata">

**Author:** ![matheplica](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/matheplica/32/21035_2.png) [@matheplica](https://discourse.processing.org/u/matheplica)\
**Post date:** [November 21, 2020, 9:16am UTC](https://discourse.processing.org/t/skia-graphics-library-as-a-renderer-in-processing/25580/2 "2020-11-21T09:16:40Z")

</div>

Hi, I’m trying to use your library but I don’t find the order of files where I need to download your .jar. in my library sketchbook. If I understand well it only works with Processing 4 ? Thanks

---

<div class="post-metadata">

**Author:** ![micycle](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/micycle/32/201_2.png) [@micycle](https://discourse.processing.org/u/micycle)\
**Post date:** [November 21, 2020, 12:12pm UTC](https://discourse.processing.org/t/skia-graphics-library-as-a-renderer-in-processing/25580/3 "2020-11-21T12:12:46Z")

</div>

> [@matheplica](#):
>

You mean the location where you put the .jar?

---

<div class="post-metadata">

**Author:** ![GoToLoop](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/gotoloop/32/86_2.png) [@GoToLoop](https://discourse.processing.org/u/GoToLoop)\
**Post date:** [November 21, 2020, 8:43pm UTC](https://discourse.processing.org/t/skia-graphics-library-as-a-renderer-in-processing/25580/4 "2020-11-21T20:43:57Z")

</div>

> [@matheplica](#):
>
> If I understand well it only works with Processing 4?

Processing 3’s IDE (PDE) is bundled w/ Java 8:

> <https://github.com/JetBrains/skija/issues/57>
>
> Hi everyone,
> 
> I was wondering if there is any possibility to make skija wordki…ng with java 8 please ? Maybe a trick or something ? I need to swith to java 11, but due to some legacy code, i still need to wait a bit and i would love to try make skija working with my java 8 app.
> 
> Thank's a lot.

---

<div class="post-metadata">

**Author:** ![micycle](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/micycle/32/201_2.png) [@micycle](https://discourse.processing.org/u/micycle)\
**Post date:** [November 21, 2020, 9:27pm UTC](https://discourse.processing.org/t/skia-graphics-library-as-a-renderer-in-processing/25580/5 "2020-11-21T21:27:30Z")

</div>

@matheplica Yeah, so if you’re using the Processing IDE, it will only work with Processing 4; it works with Processing 3 if you’re using Processing as a library in another IDE.

---

<div class="post-metadata">

**Author:** ![matheplica](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/matheplica/32/21035_2.png) [@matheplica](https://discourse.processing.org/u/matheplica)\
**Post date:** [November 23, 2020, 9:07am UTC](https://discourse.processing.org/t/skia-graphics-library-as-a-renderer-in-processing/25580/6 "2020-11-23T09:07:58Z")

</div>

Thanks. I’m mean the location and name of folder(s) to put the .jar in my librairies folder

---

<div class="post-metadata">

**Author:** ![micycle](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/micycle/32/201_2.png) [@micycle](https://discourse.processing.org/u/micycle)\
**Post date:** [November 23, 2020, 12:09pm UTC](https://discourse.processing.org/t/skia-graphics-library-as-a-renderer-in-processing/25580/7 "2020-11-23T12:09:34Z")

</div>

You can simply drag-and-drop the jar onto the Processing IDE.

 ![image](https://canada1.discourse-cdn.com/flex036/uploads/processingfoundation1/original/2X/0/0e475cbcc14129b3d5db67ece7bf63233b124780.png)

---

<div class="post-metadata">

**Author:** ![matheplica](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/matheplica/32/21035_2.png) [@matheplica](https://discourse.processing.org/u/matheplica)\
**Post date:** [November 23, 2020, 2:20pm UTC](https://discourse.processing.org/t/skia-graphics-library-as-a-renderer-in-processing/25580/8 "2020-11-23T14:20:19Z")

</div>

I try it but I’ve got this error in P4:

```auto
No library found for org.jetbrains.skija
The type org.jetbrains.skija.Canvas cannot be resolved. It is indirectly referenced from required .class files
java.lang.reflect.InvocationTargetException

```

---

<div class="post-metadata">

**Author:** ![micycle](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/micycle/32/201_2.png) [@micycle](https://discourse.processing.org/u/micycle)\
**Post date:** [November 23, 2020, 2:36pm UTC](https://discourse.processing.org/t/skia-graphics-library-as-a-renderer-in-processing/25580/9 "2020-11-23T14:36:18Z")

</div>

I’m guessing you’re using the 5KB version which doesn’t include the skija dependency.

 ![image](https://canada1.discourse-cdn.com/flex036/uploads/processingfoundation1/original/2X/0/0ff576092d24eecdebdc3d43e7ca09a118ce5981.png)

Either use the other version (easier), or download skijia as .jar and drag-and-drop that onto Processing too.

---

<div class="post-metadata">

**Author:** ![matheplica](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/matheplica/32/21035_2.png) [@matheplica](https://discourse.processing.org/u/matheplica)\
**Post date:** [November 23, 2020, 3:04pm UTC](https://discourse.processing.org/t/skia-graphics-library-as-a-renderer-in-processing/25580/10 "2020-11-23T15:04:13Z")

</div>

Ok, I try the other .jar and now I’ve got this error :

```auto
java.lang.RuntimeException: java.lang.UnsupportedClassVersionError: micycle/processingSkia/SkiaCanvas has been compiled by a more recent version of the Java Runtime (class file version 55.0), this version of the Java Runtime only recognizes class file versions up to 52.0

```

---

<div class="post-metadata">

**Author:** ![micycle](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/micycle/32/201_2.png) [@micycle](https://discourse.processing.org/u/micycle)\
**Post date:** [November 23, 2020, 3:40pm UTC](https://discourse.processing.org/t/skia-graphics-library-as-a-renderer-in-processing/25580/11 "2020-11-23T15:40:47Z")

</div>

That suggests Processing is running in Java 8 – are you certainly using Processing 4?

If so,

 ![image](https://canada1.discourse-cdn.com/flex036/uploads/processingfoundation1/original/2X/d/d1c8dc8bed88f430133543580fea3dc25a35ab3d.png)

---

<div class="post-metadata">

**Author:** ![matheplica](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/matheplica/32/21035_2.png) [@matheplica](https://discourse.processing.org/u/matheplica)\
**Post date:** [November 23, 2020, 4:12pm UTC](https://discourse.processing.org/t/skia-graphics-library-as-a-renderer-in-processing/25580/12 "2020-11-23T16:12:12Z")

</div>

With P4 I’ve got this error now : `An illegal reflective access operation has occurred WARNING: Illegal reflective access by com.jogamp.common.os.NativeLibrary`  
After google It’s seem that is a bug of P4Version

---

<div class="post-metadata">

**Author:** ![micycle](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/micycle/32/201_2.png) [@micycle](https://discourse.processing.org/u/micycle)\
**Post date:** [November 23, 2020, 4:13pm UTC](https://discourse.processing.org/t/skia-graphics-library-as-a-renderer-in-processing/25580/13 "2020-11-23T16:13:07Z")

</div>

Kinda, it’s an warning (not an error) thrown by the JOGL library – the sketch should still run fine.

---

<div class="post-metadata">

**Author:** ![matheplica](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/matheplica/32/21035_2.png) [@matheplica](https://discourse.processing.org/u/matheplica)\
**Post date:** [November 23, 2020, 4:26pm UTC](https://discourse.processing.org/t/skia-graphics-library-as-a-renderer-in-processing/25580/14 "2020-11-23T16:26:47Z")

</div>

On my computer It’s an error but I need this line in settings to can run P2D mode :

```auto
System.setProperty("jogl.disable.openglcore", "true");

```

---

<div class="post-metadata">

**Author:** ![matheplica](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/matheplica/32/21035_2.png) [@matheplica](https://discourse.processing.org/u/matheplica)\
**Post date:** [December 1, 2020, 3:05pm UTC](https://discourse.processing.org/t/skia-graphics-library-as-a-renderer-in-processing/25580/15 "2020-12-01T15:05:43Z")

</div>

Ok, I tried on another computer and I have the same error, it’s maybe linux.  
Here is the full message :

```auto
WARNING: An illegal reflective access operation has occurred
WARNING: Illegal reflective access by com.jogamp.common.os.NativeLibrary$3 (file:/home/math/artCode/sketchProcessing/skia/code/processing-skia-1.0.jar) to method java.lang.ClassLoader.findLibrary(java.lang.String)
WARNING: Please consider reporting this to the maintainers of com.jogamp.common.os.NativeLibrary$3
WARNING: Use --illegal-access=warn to enable warnings of further illegal reflective access operations
WARNING: All illegal access operations will be denied in a future release
java.lang.RuntimeException: java.lang.ExceptionInInitializerError
	at processing.opengl.PSurfaceJOGL$2.run(PSurfaceJOGL.java:412)
	at java.base/java.lang.Thread.run(Thread.java:834)
Caused by: java.lang.ExceptionInInitializerError
	at micycle.processingSkia.SkiaCanvas.<init>(SkiaCanvas.java:68)
	at micycle.processingSkia.SkiaCanvas.getSkiaCanvas(SkiaCanvas.java:42)
	at skia.setup(skia.java:199)
	at processing.core.PApplet.handleDraw(PApplet.java:2401)
	at processing.opengl.PSurfaceJOGL$DrawListener.display(PSurfaceJOGL.java:866)
	at jogamp.opengl.GLDrawableHelper.displayImpl(GLDrawableHelper.java:692)
	at jogamp.opengl.GLDrawableHelper.display(GLDrawableHelper.java:674)
	at jogamp.opengl.GLAutoDrawableBase$2.run(GLAutoDrawableBase.java:443)
	at jogamp.opengl.GLDrawableHelper.invokeGLImpl(GLDrawableHelper.java:1293)
	at jogamp.opengl.GLDrawableHelper.invokeGL(GLDrawableHelper.java:1147)
	at com.jogamp.newt.opengl.GLWindow.display(GLWindow.java:759)
	at com.jogamp.opengl.util.AWTAnimatorImpl.display(AWTAnimatorImpl.java:81)
	at com.jogamp.opengl.util.AnimatorBase.display(AnimatorBase.java:452)
	at com.jogamp.opengl.util.FPSAnimator$MainTask.run(FPSAnimator.java:178)
	at java.base/java.util.TimerThread.mainLoop(Timer.java:556)
	at java.base/java.util.TimerThread.run(Timer.java:506)
Caused by: java.lang.IllegalArgumentException: Library file libskija.so not found in /
	at org.jetbrains.skija.impl.Library._extract(Library.java:48)
	at org.jetbrains.skija.impl.Library.load(Library.java:32)
	at org.jetbrains.skija.impl.Library.staticLoad(Library.java:15)
	at org.jetbrains.skija.BackendRenderTarget.<clinit>(BackendRenderTarget.java:7)
	... 16 more
RuntimeException: java.lang.ExceptionInInitializerError
java.lang.reflect.InvocationTargetException
	at java.base/jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
	at java.base/jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)
	at java.base/jdk.internal.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
	at java.base/java.lang.reflect.Constructor.newInstance(Constructor.java:490)
	at processing.app.contrib.ToolContribution.<init>(ToolContribution.java:66)
	at processing.app.contrib.ToolContribution.load(ToolContribution.java:41)
	at processing.app.contrib.ToolContribution.loadAll(ToolContribution.java:104)
	at processing.app.Base.getInstalledContribs(Base.java:956)
	at processing.app.Base.getInstalledContribsInfo(Base.java:964)
	at processing.app.contrib.ContributionListing$1.run(ContributionListing.java:385)
	at java.base/java.lang.Thread.run(Thread.java:834)
Caused by: java.lang.NoClassDefFoundError: processing/app/Editor
	at java.base/java.lang.Class.getDeclaredMethods0(Native Method)
	at java.base/java.lang.Class.privateGetDeclaredMethods(Class.java:3166)
	at java.base/java.lang.Class.getDeclaredMethod(Class.java:2473)
	at java.desktop/java.awt.Component.isCoalesceEventsOverriden(Component.java:6320)
	at java.desktop/java.awt.Component$3.run(Component.java:6274)
	at java.desktop/java.awt.Component$3.run(Component.java:6272)
	at java.base/java.security.AccessController.doPrivileged(Native Method)
	at java.desktop/java.awt.Component.checkCoalescing(Component.java:6271)
	at java.desktop/java.awt.Component.<init>(Component.java:6240)
	at java.desktop/java.awt.Container.<init>(Container.java:296)
	at java.desktop/java.awt.Window.<init>(Window.java:547)
	at java.desktop/java.awt.Frame.<init>(Frame.java:423)
	at java.desktop/java.awt.Frame.<init>(Frame.java:388)
	at java.desktop/javax.swing.JFrame.<init>(JFrame.java:180)
	at Shader.tool.ShaderTool.<init>(Unknown Source)
	... 11 more
Caused by: java.lang.ClassNotFoundException: processing.app.Editor
	at java.base/java.net.URLClassLoader.findClass(URLClassLoader.java:471)
	at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:589)
	at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:522)
	... 26 more

```

---

<div class="post-metadata">

**Author:** ![micycle](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/micycle/32/201_2.png) [@micycle](https://discourse.processing.org/u/micycle)\
**Post date:** [December 1, 2020, 11:31pm UTC](https://discourse.processing.org/t/skia-graphics-library-as-a-renderer-in-processing/25580/16 "2020-12-01T23:31:10Z")

</div>

Aye, it’ll be linux, as the version with dependencies includes Skija Windows version only.

---

<div class="post-metadata">

**Author:** ![perelacha](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/perelacha/32/11873_2.png) [@perelacha](https://discourse.processing.org/u/perelacha)\
**Post date:** [February 16, 2021, 7:56pm UTC](https://discourse.processing.org/t/skia-graphics-library-as-a-renderer-in-processing/25580/17 "2021-02-16T19:56:27Z")

</div>

Hi, did I understand correctly that it won’t start on mac OS?

---

<div class="post-metadata">

**Author:** ![micycle](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/micycle/32/201_2.png) [@micycle](https://discourse.processing.org/u/micycle)\
**Post date:** [February 16, 2021, 8:17pm UTC](https://discourse.processing.org/t/skia-graphics-library-as-a-renderer-in-processing/25580/18 "2021-02-16T20:17:23Z")

</div>

It can do… You’ll just need to download Skija for mac yourself, as I’ve only produced a jar bundled with windows Skija version so far.

---

<div class="post-metadata">

**Author:** ![micycle](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/micycle/32/201_2.png) [@micycle](https://discourse.processing.org/u/micycle)\
**Post date:** [April 21, 2021, 8:02pm UTC](https://discourse.processing.org/t/skia-graphics-library-as-a-renderer-in-processing/25580/19 "2021-04-21T20:02:55Z")

</div>

I’ve just added linux and mac .jars. Can someone test whether they work?

> **[Release processing-skia 1.0 · micycle1/processing-skia](https://github.com/micycle1/processing-skia/releases/tag/1.0)**
>
> //github.com/micycle1/processing-skia/releases/tag/1.0

---

<div class="post-metadata">

**Author:** ![matheplica](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/matheplica/32/21035_2.png) [@matheplica](https://discourse.processing.org/u/matheplica)\
**Post date:** [April 22, 2021, 7:24am UTC](https://discourse.processing.org/t/skia-graphics-library-as-a-renderer-in-processing/25580/20 "2021-04-22T07:24:40Z")

</div>

Tested on Linux (Ubuntu mate 20.10) with Processing 4 and the example works.  
I just rename the folder “processingSkia”, create a library folder within and put .jar rename processingSkia.jar.  
Thanks, it’s just missing help file to learn who to use it.

[Next page](https://discourse.processing.org/t/skia-graphics-library-as-a-renderer-in-processing/25580.md?page=2)
