* added filter type to draw batch
* c++ implementation of ImageSamplerOptions
* image sampler options now pushes correct for RiveRenderPaint
* wip
* OpenGL uses correct sample options
* now only one filter option that accounts for mip map
* d3d now uses sampler states options
* better way to get the filter option
* added mirror and inverse mirror options
* started using helper functions for retreiving sampler optiojnhs
* workaround for vulkn semaphore issue
* wip
* added filter type to draw batch
* c++ implementation of ImageSamplerOptions
* image sampler options now pushes correct for RiveRenderPaint
* wip
* OpenGL uses correct sample options
* now only one filter option that accounts for mip map
* d3d now uses sampler states options
* better way to get the filter option
* added mirror and inverse mirror options
* started using helper functions for retreiving sampler optiojnhs
* workaround for vulkn semaphore issue
* wip
* undo deleting empty descriptor
* properly packed image options
* removed uneeded checks
* more unit tests
* unreal image_filter_options integration, gm for image filters
* properly implement new draw functions for cgrender
* finish mege conflicts
* merge vulkan sampler options
* cherry-picked vulkan imp into branch
* initial metal
* clang-format
* d3d12 image filter options
* fixed d3d
* clang-format
* fixed mip filter for metal
* made every filter option act as similiar as possible
* addressed pr changes
* fixed tests
* empty commit to fix github
* fix: webgl renderers
* started addressing PR comments
* metal change for pr
* more pr stuff
* final PR address
* shader update per PR request
* rhi updat e
* added gm requested in pr
* made d3d12 work with more then 2000 sampler changes per flush
* pr comments
Co-authored-by: Chris Dalton <chris@rive.app>
Co-authored-by: Jonathon Copeland <jcopela4@gmail.com>
Co-authored-by: Luigi Rosso <luigi.rosso@gmail.com>
# Description
This adds the ability to serialize draw commands to .sriv file via a SerializingFactory which can be used by the unit tests in place of the NoOpFactory.
# Details
You can use the SerializingFactory to initialize your .riv and annotate the serialization with things like frame size and new frame/frame begin. This makes it possible to drop the generated .sriv into the Flutter viewer which will perform the serialized rendering commands to show exactly what the runtime is doing, high level rendering-wise. It can also diff two .sriv files if they are dropped in one drag/drop op.
When adding new "Silver" tests make sure to rebaseline the silvers by doing:
```
cd rive/packages/runtime/tests/unit_tests
./test.sh rebaseline
```
You can now modify the runtime and re-run the tests to make sure the silvers still match:
```
./test.sh
```
The important function to call at the end of your test is ::matches on the SerializingFactory. This will either save or check for equality of the existing silver.
```
TEST_CASE("juice silver", "[file]")
{
SerializingFactory silver;
// .. actually use the factory
CHECK(silver.matches("juice"));
}
```
Diffs=
b329a96f26 Silvers (#9281)
Co-authored-by: Luigi Rosso <luigi-rosso@users.noreply.github.com>
Made lite rtti now use compile time hashes that use the name of the class with rtti enabled as the hash string.
Every use of rtti now needs to be a macro. but other then that, usage of lite rtti is unchanged.
Diffs=
2be44a0f45 Deterministic lite rtti (#8349)
Co-authored-by: Jonathon Copeland <jcopela4@gmail.com>
This gives better support for smaller screens and side-by-side windows.
Also standardize the formatting check on GitHub on version 17.
Diffs=
e52e9fff29 Drop the ColumnLimit to 80 for clang-format (#8320)
Co-authored-by: Chris Dalton <99840794+csmartdalton@users.noreply.github.com>
We need to be more robust if a user tries to use mismatched factories and renderers. This PR creates a simple "lite_rtti" utility and applies it to every Render object. The renderers now abort early instead of crashing if they are given a Render object for the wrong renderer.
Diffs=
c357e7aa7 Add a "lite_rtti" utility and use it with Render objects (#6311)
Co-authored-by: Chris Dalton <99840794+csmartdalton@users.noreply.github.com>
Ok, got this passing testes, which I guess is a step in the right direction.
Before changing unique pointers to rcp, we could only use an image once, as soon as we assigned a new image, the old image would get garbage collected. (this is the actual problem we are trying to solve)
This "solves" the problem and allows us to add images to a cache in wasm, and then cycle through the cache, swapping out the render image to be displayed for a given fileAsset. We can replace images & fonts on the fly this way.
Problems:
1. overwriting ref & unref in RenderImage, shows that is being reffed and un-reffed constantly (when viewing the attached file with the viewer). Is that expected? doing something similar for Font does not show up the same. I suspect this is related to how we use images when it comes to rendering, just figured i'd check
2. We dont seem to "leak" anything as detectable by our tests, which is good, but our wasm examples show that neither our fonts nor our render images get collected. presumably thats because we would need to manually tell wasm via js that we want to let go of an image?
Also @csmartdalton @umberto-sonnino & @luigi-rosso it would be great to see what else is concerning.
example file
[just_a_box_with_a_tree.riv.zip](https://github.com/rive-app/rive/files/13042414/just_a_box_with_a_tree.riv.zip)
Diffs=
1506b069c Outofbandcache (#6049)
Co-authored-by: Maxwell Talbot <talbot.maxwell@gmail.com>
Adds map() and unmap() functions to RenderBuffer, and changes Mesh::draw() to map and update the vertex buffer instead of making a new one.
Also refactors RenderBuffer to just be a blob of data as opposed to an array of elements of fixed size and type. Removes the type-specific factory methods for creating RenderBuffers in favor of a single one that just takes a buffer type and buffer size.
Diffs=
06a187288 Make RenderBuffer mappable (#5907)
Co-authored-by: Chris Dalton <99840794+csmartdalton@users.noreply.github.com>
Not ready for review! But feel free to peek :)
Starting to add support for runtime text. This is the bulk of the implementation marrying the Core objects to the text engine we've been working on at the runtime level. PRing in draft early to let tests run.
Also refactors some class and file names to disambiguate more clearly with the Core objects.
Diffs=
051769242 Runtime Text! (#4741)
Adding support for bidirectional text using SheenBidi to break styled runs into directional runs. This also needs to introduce the "baseDirection" of a paragraph (and the concept of a paragraph) in order to properly flow the runs after shaping.
Diffs=
291a3a02b Bidi Text Support (#4282)
Deletes the version that takes spans of points and verbs. We are
planning to inject the implicit moveTos into RawPath, at which point we
won't be able to just copy in arrays of points and verbs anymore.
Also changes the "RawPath" version of the factory method to take a
non-const "RawPath&" ref. This enables zero-copy construction via
stealing the arrays out from under the RawPath's points and verbs.
Diffs=
1bd616612 Update Factory::makeRenderPath to only accept a RawPath (#4211)
* Always align function arguments at the opening paren if they have to
break (never just indented 4 spaces)
* Only break after a function's return type if there's no other way to
make it fit in 100 columns
* Allow one-liner case labels in a switch statement
* Delete packages/coop/.clang-format
* Reformat the world
Diffs=
7d242ebc8 clang-format tweaks
This is a way to handle missing characters from a given Font -- we detect this, and then try using other font(s).
The current test just adds some Chinese characters and tries to draw them (which are not present in most of our sample fonts).
CoreGraphics backend handles this for us, we just needed to notice when they introduce a new/different font in the GlyphRun, and wrap-it.
Diffs=
4f4b79858 Work on font-fallback
Move common subclass of RenderBuffer (just cpu memory) into shareable location
- used by both Skia and CoreGraphics factories
Diffs=
be8594d42 Sharable utilities for runtime
We had the idea of a "noop" factory or renderer in a few places. Centralize these in "utils".
Involved moving the specialized noorenderpath into its test file.
Diffs=
ec44ae50d Move noop subclasses into utils