Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/).
- New `GpuTexture` class (`rhi/yup_GpuTexture.h`): opaque reference-counted GPU texture wrapping `rive::gpu::Texture` or `rive::gpu::RenderCanvas`. Obtained from `GpuCanvas::asTexture()` or constructed internally by `Image::fromTexture()`.
- New `GpuTarget` class (`rhi/yup_GpuTarget.h`): low-level render-pass-only offscreen GPU surface (`create`, `beginRenderPass`, `asTexture`, `asImage`, `readPixels`). Its backing texture is allocated from the context's main render context, so it does not reserve a dedicated `rive::gpu::RenderContext` — use it for custom `GpuPipeline` work (e.g. post-process passes) that needs no 2D drawing.
- New `GpuCanvas` class (`rhi/yup_GpuCanvas.h`): consolidated backend-agnostic offscreen GPU surface that now composes a `GpuTarget` (over a `RenderableTarget`) and creates a non-owning `Graphics` lazily only when 2D drawing is requested.
- Python bindings now expose `GpuColor` as `yup.GpuColor` (backing `GpuRenderOptions.clearColor`), comparable with `yup.Color`.

#### RHI module extraction & GpuDevice

Expand Down
14 changes: 8 additions & 6 deletions justfile
Original file line number Diff line number Diff line change
Expand Up @@ -89,26 +89,28 @@ emscripten_test:

[doc("serve project for WASM")]
emscripten_serve:
#python3 -m http.server -d .
python3 tools/serve.py -p 8000 -d .
#uv run python -m http.server -d .
uv run python tools/serve.py -p 8000 -d .

[working-directory: 'python']
python_wheel:
python -m build --wheel
uv pip install build
uv run python -m build --wheel
@just python_install
@just python_test

[working-directory: 'python']
python_install:
python -m pip install --force-reinstall dist/yup-*.whl
uv pip install --force-reinstall dist/yup-*.whl

[working-directory: 'python']
python_uninstall:
python -m pip uninstall -y yup
uv pip uninstall -y yup

[working-directory: 'python']
python_test *TEST_OPTS:
python -m pytest -s {{TEST_OPTS}}
uv sync --group test
uv run --group test python -m pytest -s {{TEST_OPTS}}

[working-directory: 'cmake/tools/shader_bundler']
shader_bundler *COMPILE_ARGS:
Expand Down
6 changes: 6 additions & 0 deletions modules/yup_animation/renderer/yup_AnimationFrameExporter.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ AnimationFrameExporter::AnimationFrameExporter (GraphicsContext& ctx)

AnimationFrameExporter::~AnimationFrameExporter() = default;

//==============================================================================
Size<int> AnimationFrameExporter::resolveTargetSize (const Animation& anim, Size<int> requested)
{
if (requested.getWidth() > 0 && requested.getHeight() > 0)
Expand All @@ -41,6 +42,7 @@ Size<int> AnimationFrameExporter::resolveTargetSize (const Animation& anim, Size
return { (int) native.getWidth(), (int) native.getHeight() };
}

//==============================================================================
Image AnimationFrameExporter::renderFrame (const Animation& anim,
float frameNo,
Size<int> targetSize)
Expand All @@ -63,6 +65,7 @@ Image AnimationFrameExporter::renderFrame (const Animation& anim,
return img;
}

//==============================================================================
ResultValue<std::vector<Image>> AnimationFrameExporter::renderAllFrames (const Animation& anim, Size<int> targetSize)
{
if (! anim.isValid())
Expand All @@ -85,6 +88,8 @@ ResultValue<std::vector<Image>> AnimationFrameExporter::renderAllFrames (const A
return makeResultValueOk (std::move (frames));
}

//==============================================================================
#if YUP_IMAGE_FORMAT_GIF
Result AnimationFrameExporter::exportToGif (const Animation& anim,
const File& destination,
Size<int> targetSize,
Expand Down Expand Up @@ -165,5 +170,6 @@ Result AnimationFrameExporter::exportToGif (const std::vector<Image>& frames,

return Result::ok();
}
#endif

} // namespace yup
2 changes: 2 additions & 0 deletions modules/yup_animation/renderer/yup_AnimationFrameExporter.h
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,7 @@ class YUP_API AnimationFrameExporter
[[nodiscard]] ResultValue<std::vector<Image>> renderAllFrames (const Animation& anim,
Size<int> targetSize = {});

#if YUP_IMAGE_FORMAT_GIF
//==============================================================================
/** Exports the animation to an animated GIF file.

Expand Down Expand Up @@ -119,6 +120,7 @@ class YUP_API AnimationFrameExporter
float frameRate,
const File& destination,
int qualityLevel = 80);
#endif

private:
static Size<int> resolveTargetSize (const Animation& anim, Size<int> requested);
Expand Down
Loading
Loading