Repository navigation
This release has a lot of graphics performance improvements, recovery from GPU device loss, better SVG support and a lot of bug fixes on every platform.
There are breaking changes from 0.1.0, listed below.
Performance
- Less GPU work when only part of a window changes on Vulkan and D3D11
- No hitch the first time a shader is used
- Frames are paced off the UI thread
- Layers are cleared with hardware clears instead of drawing fills
- Faster batching for frames that draw a lot of shapes
- Redrawing a lot of frames at once is faster
- Blurs no longer re-blur every frame
- Animated colors and gradients no longer re-upload the gradient atlas every frame
- Moving a layered frame no longer repacks its layer
- Vertex data is uploaded once per frame
Changes
- Apps recover when the GPU driver restarts or the WebGL context is lost
- Graphics shut down when the last window closes, so no driver threads are left running
- More accurate antialiasing on filled paths
- Strokes, dashes and gradients draw correctly at every DPI and after
Canvas::setPosition() - Backdrop effects work like CSS backdrop filters. Added a BackdropEffects example
- Luminance masks, and masks are drawn in
onDrawMask() - Better SVG support: masks, markers, nested svgs, CSS selectors and a lot of other fixes
- A lot of fixes for input, DPI, clipboard, drag and drop and windows on every platform
- IME, dead keys and the accent menu work on macOS
setWindowDimensionsFromHost()for host resizes in plugins- Wayland support on Linux with an X11 fallback
VISAGE_LIVE_SHADERSoption for live shader editing in the app
Breaking changes
- Build as C++20 with CMake 3.20. On Linux install
libxcb-present-devandlibfontconfig1-dev ColorandsetColor()no longer take a floatremoveAllChildren()is removed. CallremoveChild()on a copy ofchildren()CallbackList::remove(fn)and-=are removed. Keep the id fromadd()or useFrame::listen()setPaletteOverride()no longer takes arecursiveargumentsetMasked()is removed. Draw the mask inonDrawMask()BlendMode::Compositeis removed. UseBlendMode::AlphaPath::rotate()takes degrees and rotates the same direction asTransform::rotation()- Custom shaders need to output premultiplied color (
vec4(rgb * a, a)) and use GLSL math on every backend - DDS, KTX, PVR and EXR images no longer load
- On macOS pass
window->graphicsHandle()toCanvas::pairToWindow()instead ofnativeHandle() Renderer::initialize()takes a thirdwayland_displayargumentbgfx::handles are nowvisage::gpu::handles. The bgfx targets andBGFX_*options are removed
Behavior changes
close()sends a close request and returns. The window closes when the event loop handles it.close()andhide()work without anonCloseRequestedhandlershow()on a hidden window reuses the native window- Debug builds assert if an
ApplicationWindoworApplicationEditoris a global or static - Text edges are slightly lighter
- Strokes are no longer scaled by DPI twice, so they're thinner at DPI scales above 1
- Gradients follow
Canvas::setPosition() - On macOS colors are color managed. Call
Renderer::instance().setColorManaged(false)before opening a window to turn it off - SVG shapes default to the nonzero fill rule
- Blur radius matches the visible blur, so the same value blurs a different amount
MouseCursor::Dragwas added beforeDragging, so cursor values after it changedtime::milliseconds()uses a steady clock. Usetime::now()for wall-clock time- Number formatting and parsing ignore the C locale
Fixed issues
- #110 frames freezing when they call
redraw()during their own draw - #100
close()andhide()doing nothing without anonCloseRequestedhandler - #99 graphics never shutting down
- #89
Canvas::strokenot compiling with aconst Path - #45
Draggingis a closed hand andDragis an open hand - #19 no prebuilt x86 shaderc, the shader compiler builds from source
Known issues
- #25 no install rules yet. Use FetchContent or
add_subdirectory - #16 can't set the position of an embedded window
Getting it
include(FetchContent)
FetchContent_Declare(visage
GIT_REPOSITORY https://github.com/VitalAudio/visage.git
GIT_TAG v1.0.0)
FetchContent_MakeAvailable(visage)
target_link_libraries(my_app PRIVATE visage)Requirements
- CMake 3.20 and C++20. Targets that link Visage build as C++20
- Windows: Direct3D 11 with MSVC or MinGW
- macOS 10.15: Metal
- Linux: Vulkan and X11, and Wayland when available. Needs
libx11-dev libxrandr-dev libxinerama-dev libxcursor-dev libxcomposite-dev libxcb1-dev libxcb-present-dev libfontconfig1-dev, andlibwayland-dev libxkbcommon-dev wayland-protocolsfor Wayland - Web: Emscripten with WebGL2
Under the hood
- Removed bgfx. Visage has its own graphics layer with Metal, D3D11, Vulkan and WebGL2 backends
- Shaders are compiled at build time by an in-tree compiler built on glslang and SPIRV-Cross, which are fetched at configure time
- Path fills use tile-binned analytic coverage
- HDR layers are RGBA16F
- Images are decoded with stb_image
- Added a manual test app in
manual_tests/
Thanks to everyone who has contributed: Alexandre Veaux, August Pemberton, Chris Lucas, Chris Randall, Dan Raffel, Daniel Walz, dimapaloskin, dp-mason, Drew Vernon, Elan Hickler, IcebreakerAudio, JWBverheesen, Paul Walker, Randy Jones, Sean Chambers, Tad Nicol and Tarnith.