Skip to content
/ vkvg Public
forked from jpbruyere/vkvg

Vulkan vector drawing, try to stay close to cairo api

License

Notifications You must be signed in to change notification settings

lineCode/vkvg

 
 

Repository files navigation


vkvg

Vulkan Vector Graphics

What is vkvg?

vkvg is a multiplatform c library for drawing 2D vector graphics with Vulkan.

Cairo was missing a Vulkan backend, so I decided to start one myself trying to keep my api as close to Cairo as possible.

Current status:

vkvg is in early development stage, 0.1 beta release is on the road.

  • Fill (with stencil even-odd technic) and Stroke functional.
  • Basic painting operation.
  • Font system with caching operational.
  • Linear Gradients.
  • Line caps and joins.
  • Context should be thread safe, extensive tests required.
  • Image loading and writing with stb lib
  • Test includes svg rendering with nanoSVG

Requirements:

  • Vulkan
  • FontConfig
  • Freetype
  • PkgConfig (currently used only to find harbfbuzz)
  • Harfbuzz
  • GLSLC: spirv compiler, included in LunarG SDK (building only)
  • xxd: generate headers with precompiled shaders (building only)
  • GLFW (only for running demo app)
  • CMake

if glslc or xxd are not present, a precompiled version of the shaders is stored in the git tree.

Building

git clone https://github.com/jpbruyere/vkvg.git     # Download source code from github
cd vkvg                                             # Enter the source directory
git submodule update --init --recursive             # Dowload vkhelpers sources
mkdir build					    # Create build directory
cd build
cmake ..					    # Run CMake, optionaly setup glslc path
make						    # Run Make

Roadmap

  • Radial gradients.
  • Dashed lines.
  • Operators.
  • Improve stroke algorithms.
  • Offscreen pattern building.
  • Optimize vulkan memory allocations by sub-allocating from a single shared memory chunk per type.
  • Optimize command submissions.
  • Test SDF font rendering.
  • Avoid line joins inside curves and arc.
  • Structured unit testing.
  • Perf and memory checks.
  • Code clean and comment.
  • Documentations.

About

Vulkan vector drawing, try to stay close to cairo api

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • C 96.9%
  • CMake 1.5%
  • Other 1.6%