[GUI] Replace Pixman 16.16 fixed-point gradient shader emulation (RecordedCairoGradient) with native SKShader gradients
Maintainers usually reply within 1 day
Nobody has claimed this yet.
Assessment
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Newbie friendliness
- 52/100
- Issue type
- Refactor
- Clarity
- Clearly specified
- Activity status
- Active
- Tech stack
- csharp
- Domain
- performance
Research direction
Start with sources/Cairo/wrapper/RecordedCairoGradient.cs and inspect how Create records gradient stops and the matrix; then read RecordedCairoIntegerBlend.cs to see which blend modes use custom runtime effects. Compare those paths with Skia's native gradient and blend APIs. Done means both wrappers use the proposed native APIs and the per-gradient bitmap stop encoding is removed.
Written by the indexing model from the issue text.
Description
Problem
RecordedCairoGradient.Create (sources/Cairo/wrapper/RecordedCairoGradient.cs:14-95) bypasses Skia's native GPU gradient shaders (SKShader.CreateLinearGradient and SKShader.CreateRadialGradient) in order to emulate Pixman's 16.16 fixed-point gradient interpolation quirks:
- Allocates a
new SKBitmap(256, ...)on the CPU for every gradient. - Encodes stop offsets and 16-bit color channels into pixels via
bitmap.SetPixel(...)calls. - Uploads the stop table bitmap as an
SKImagechild texture (SKImage.FromBitmap(bitmap)). - Evaluates a custom SkSL
SKRuntimeEffectshader that reproduces Cairo's fixed16 matrix quantization and stop lookup math.
Similarly, RecordedCairoIntegerBlend.cs compiles custom SKRuntimeEffect blenders just to replicate 8-bit integer rounding differences in Difference and Exclusion blend modes.
Proposed Fix
- Replace
RecordedCairoGradientwith direct calls toSKShader.CreateLinearGradientandSKShader.CreateRadialGradientusing the recorded gradient stops and matrix. - Replace
RecordedCairoIntegerBlendwith nativeSKBlendMode.DifferenceandSKBlendMode.Exclusion. - Remove the per-gradient
SKBitmapallocation andSetPixelstop-encoding loop.
- Dominant language
- C#
- Stars
- 22
- Forks
- 4
- Avg merge
- 1h 11m
- Merged PRs (30d)
- 40
Getting set up
- No Dockerfile or Docker Compose file
- No pull request template
- Read the contributing guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from StratumServer/Optimum
-
complexity: hard enhancement performance rendering
Difficulty 5/5 Over a week Newbie friendliness 25/100
StratumServer/Optimum#230 ·
Maintainers usually reply within 1 day
-
complexity: medium performance rendering
Difficulty 5/5 Over a week Newbie friendliness 32/100
StratumServer/Optimum#227 ·
Maintainers usually reply within 1 day
-
complexity: medium enhancement rendering
Difficulty 5/5 Over a week Newbie friendliness 24/100
StratumServer/Optimum#226 ·
Maintainers usually reply within 1 day
-
complexity: hard performance rendering
Difficulty 5/5 Over a week Newbie friendliness 35/100
StratumServer/Optimum#225 ·
Maintainers usually reply within 1 day
-
[GUI] Avoid per-command clip array cloning and redundant SKPath allocations in SurfaceRecorderPossibly taken @Zaldaryon claimed this today. Opencomplexity: medium performance rendering
Difficulty 4/5 3-5 days Newbie friendliness 35/100
StratumServer/Optimum#224 ·
Maintainers usually reply within 1 day
All issues in StratumServer/Optimum
Similar issues
-
needs-triage
Difficulty 1/5 1-3 hours Newbie friendliness 76/100
Azure/azure-sdk-for-net#64658 · 1 comment · 1 reaction ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
dotnet/aspnetcore#70370 ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
NethermindEth/nethermind#15684 ·
Maintainers usually reply within 1 day
-
area/ai-assistant squad/flyt
Difficulty 2/5 1-3 hours Newbie friendliness 83/100
Altinn/altinn-studio#21798 ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 64/100
SubtitleEdit/subtitleedit#16699 ·
Maintainers usually reply within 1 day