Skip to content
Back to skills

Frb Pixel Harness

ASecurity

Pixel tests that render Gum through a real FlatRedBall (FRB1) game. Triggers: premultiplied alpha, Blend/BlendState changes, render-target bake or composite, Tests/FlatRedBall.GumRendering.Tests, BlendMathTests.

  • 666 stars
  • 0 votes
  • 0 copies
  • 1 view
  • Added November 7, 2026
designgoaws

Security analysis

A100/100

Scanned November 7, 2026

npx -y skills add vchelaru/Gum --skill frb-pixel-harness --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Frb Pixel Harness?

Add the live security badge to your README. It updates with every re-scan.

Security grade badge for Frb Pixel Harness
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/vchelaru-frb-pixel-harness/badge)](https://www.skillsdirectory.com/skills/vchelaru-frb-pixel-harness)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

Download with Pro
SKILL.md
---
name: frb-pixel-harness
description: Pixel tests that render Gum through a real FlatRedBall (FRB1) game. Triggers: premultiplied alpha, Blend/BlendState changes, render-target bake or composite, Tests/FlatRedBall.GumRendering.Tests, BlendMathTests.
---

# FRB Pixel Harness

`Tests/FlatRedBall.GumRendering.Tests` draws Gum through FRB's own `GumIdb` and checks single pixels against arithmetic. It exists because `MonoGameGum.IntegrationTests` cannot model FRB's premultiplied pipeline (`NormalBlendState == AlphaBlend`). Run it after changing blend states, `Sprite.Render`, or the render-target bake/composite in `Renderer.cs`. For compile-only checks see `frb-build-verification`.

Run it by path, `dotnet test Tests/FlatRedBall.GumRendering.Tests`, or one class with `pwsh Tools/fast-test.ps1 FlatRedBall.GumRendering.Tests:BlendMathTests`; it is in no solution, so fast-test needs the `Project:` prefix. The build skips itself with a warning when `../FlatRedBall` is missing.

| File | Purpose |
|---|---|
| `Harness/FrbGumHost.cs` | One real FRB `Game` per process; `Render(...)` draws elements and returns the backbuffer |
| `BlendMathTests.cs` | Solid colors at a known alpha, expected value computed in the test |
| `SpriteTintTests.cs` | Sprite `Red`/`Green`/`Blue`/`Alpha` set through `SetProperty`, as a loaded project sets them |

## Gotchas

- `FrbGumHost.Initialize` copies the hooks Glue generates into `Game1.Initialize` (`GumGame1CodeGenerator.cs` in the FRB repo). When Glue's generated setup changes, update the host to match.
- FRB state is static, so there is exactly one host per process. Touch `FrbGumHost.Instance` before anything that uses `SystemManagers.Default`.
- Sprite textures must go through `TextureContentLoader.MakePremultiplied`, as real FRB loads do.
- Inside `namespace FlatRedBall.*`, `Gum.` and `Sprite` resolve to FRB types. Use `global::Gum...` and `RenderingLibrary.Graphics.Sprite`.
- The `FRB` compile constant makes `ToBlendState` return the premultiplied blend states; a plain `dotnet test` of `MonoGameGum.Tests` never exercises that path.
- `Blend.Replace` on a translucent texture looks darker in FRB than in the tool. FRB's texture is premultiplied and `BlendState.Opaque` writes it unchanged, while the tool replaces with the straight color; matching it needs a shader that un-premultiplies, so the difference is accepted and not tested.
- A `Skip`ped test documents a known FRB bug; remove the `Skip` in the same change that fixes it.

Attribution

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

View all in design →

Comments

Loading comments…

Newsletter

Get the weekly list of safe new skills, and the ones we pulled.