Release notes

What’s new

Content Development

Disable accessing invalid game objects exposed by reference

Changes in Binding and Data Binding

Starting with this release, Gameface comes with better binding and databinding safety by improving the way properties of C++ models and objects exposed by reference are accessed in JavaScript.

Until now accessing in JavaScript a property of exposed by-ref object or a data binding model was essentially exposing that property by-ref too. That means that when the pointer to that C++ object is no longer valid, the C++ code is responsible to call additional methods like View::DestroyExposedObject(). This makes it very easy to create use-after-free bugs in the game, while understanding the reason for the crash is not trivial (i.e. where JavaScript is using an object whose game counterpart has been destroyed or relocated).

Now when caching into a variable a property of a model or exposed by-ref object, instead of storing the pointer to the underlying property, we store the path to reach that property. Every time the property is used, it will be queried from the top level object or model, instead of using a cached pointer that may not be valid any more. You still need to make sure that the top level object or model is valid and call respectively View::DestroyExposedObject() or View::UnregisterModel() when it is destroyed.

Behavioral changes

Exposed properties to JavaScript will no longer be cached by address, but by property/index and parent object. That means that caching the nth element of an array for example will always point to the nth element, even if the array was reordered and the nth element is now a different element, while someone may expect that the object that has been kept will be the original one.

Get unsafe reference to a model property in JavaScript

If you still need to have an unsafe reference to a property in JavaScript, you can use engine.pinUnsafeReference(model.property1.property2).

There is also a method to disable safe data binding, but we discourage using it: engine.enableSafeDataBinding(false)

Integration

Custom Properties

If you have custom classes that inherit from Property, you need to make sure that ToArray() method works correctly if your Property has such semantics, including with C-style arrays.

Custom array types

Binder::TryBindArrayByRef() has additional parameter typedef void* (*ArrayElementGetter)(void*, size_t) which returns a pointer to the nth element of the array. You need to provide such argument to TryBindArrayByRef if your engine has custom array types. You can check Array.h and Vector.h headers for example.

Custom map and pair types

Every type that uses Binder::MapBegin() and Binder::MapEnd() in the bind function, such as maps, pairs, etc, should wrap the call to CoherentBind with CoherentBindKeyValueProperty(). You can check Map.h, UnorderedMap.h and Pair.h for example.

Rendering

Emoji glyphs support

Gameface now supports certain kinds of emoji fonts.

Gameface can load and display emoji from COLRV0 emoji fonts. Those are flat shaded emoji glyphs comprising of several path objects.

Gameface renders the emojis on the GPU and caches them on glyph atlases. This makes the emojis rendering smooth and with no performance bottlenecks.

For more details, see the documentation for the emojis support

Migration guide

Migrating to 1.61

Support for BGRA8 textures

The graphics library has a new pixel format – PF_B8G8R8A8. All provided backends now support the new texture format and can create textures from it.

New shader types

With this version, Gameface comes with 2 new shader types: ST_CircleTextureRepeat, ST_EllipseTextureRepeat. Their corresponding pixel shader types are PST_CircleTextureRepeat (matching the already existing PST_RoundedRectTextureRepeat) and PST_EllipseTextureRepeat.

Changelog

Version 1.61.0


Released 09 Dec 2024
APINew pixel format for textures PF_B8G8R8A8
APINew shader types ST_CircleTextureRepeat and ST_EllipseTextureRepeat
APIUnreal EngineRenamed Switch libraries HttpServer.NN.nrs / nro to HttpServerNN.nrs / nro and MediaDecoders.NN.nrs / nro to MediaDecodersNN.nrs / nro to make them package correctly in Unreal Engine 5.5
FeatureAdded COLRv0 emoji support
FeatureDisable accessing invalid game objects exposed by reference
FeatureAdded ::slotted pseudo-element
FeatureAdded support for shadow DOM
FeatureAdded the slot element
FeatureAdded the host pseudo-class
FeatureAdded partial support for the ‘all’ css shorthand with value ‘initial’
EnhancementUnreal EngineSupport Unreal Engine 5.5
EnhancementImplemented surface cache flushing when changing render target
EnhancementAdded HDR support in media queries
EnhancementExtended View’s API to be able to get the current script stack trace
EnhancementAdded prebuilt C++20 ICU versions for Sony PlayStation 5 to allow linking with libc++ ABI v2. The libraries have cpp20 at the end of their filename
EnhancementUnreal EngineAdded control of texture pool size for Custom Effect textures
EnhancementUnreal EngineAdded custom effect texture pool APIs
EnhancementUnreal EngineCohtml and Renoir assert failures are now handled with ensureAlways, so they break the code execution only when a debugger is attached
EnhancementUnreal EngineFixed crash when Unreal Engine tries to execute Cohtml tasks one inside another
FixLeaking renoir commands for canvases on platforms with clang based compilers
FixFixed Sony PlayStation 4 and Sony PlayStation 5 virtual allocator memory protection
FixFixed the simple opacity when applied to SVGs
FixFixed crash when using canvas radial gradient
FixFixed crash when GC happens during cloneNode
FixCustom element callbacks are now executed in the correct order
FixFixed wrong assert when using SVG as background-image
FixUnityFixed OpenGL Rendering Target support
FixFixed assert for incorrect lineStart when wrapping inline text that ends with a new line
FixFixed assert with pseudo elements
FixFixed stack overflow when using calling .blur() in a focus event handler
FixFixed assert when removing focused node matching complex selectors
FixFixed animated GIF frame duration playback (previously each frame was displayed for 10 times longer).
FixUnityWhen an abort request is made, the DefaultResourceHandler responds with success and not displaying any error or warning messages
FixUnreal EngineImproved live reload path matching when using non-normalized paths
FixFixed wrong styles when using important declarations in pseudo-elements
FixUnityFixed crash in Development Unity player builds for Android