Skip to content

Make DrawingTextCache thread-safe - #420

Merged
JimBobSquarePants merged 2 commits into
release/3.1.xfrom
js/drawing-cache
Sep 14, 2026
Merged

JimBobSquarePants merged 2 commits into
release/3.1.xfrom
js/drawing-cache

Conversation

@JimBobSquarePants

Copy link
Copy Markdown
Member

Prerequisites

  • I have written a descriptive pull-request title
  • I have verified that there are no overlapping pull-requests open
  • I have verified that I am following matches the existing coding patterns and practice as demonstrated in the repository. These follow strict Stylecop rules 👮.
  • I have provided test coverage for my change (where applicable)

Description

Protect cache metadata, publish complete glyph entries, and lease reusable working buffers to each drawing operation. Keep outline construction and rasterization unchanged.

Add tests for concurrent drawing, outline reuse, complete publication, eviction, clearing, and buffer ownership. Update Fonts to 3.1.2 and ImageSharp to 4.1.2.

Validation: Full Release suite passed on .NET 8 and .NET 10, with 2,754 passed and 9 skipped per target.

Protect cache metadata, publish complete glyph entries, and lease reusable working buffers to each drawing operation. Keep outline construction and rasterization unchanged.

Add tests for concurrent drawing, outline reuse, complete publication, eviction, clearing, and buffer ownership. Update Fonts to 3.1.2 and ImageSharp to 4.1.2.

Validation: Full Release suite passed on .NET 8 and .NET 10, with 2,754 passed and 9 skipped per target.
@JimBobSquarePants JimBobSquarePants added the enhancement New feature or request label Sep 14, 2026
Use `Task.Factory.StartNew` with `TaskCreationOptions.LongRunning` in the concurrent drawing text cache tests so each barrier participant gets a dedicated thread. This avoids thread-pool starvation and intermittent failures on small CI runners when other tests are also scheduling work.
@codecov

codecov Bot commented Sep 14, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 97.95918% with 2 lines in your changes missing coverage. Please review.
✅ Project coverage is 80%. Comparing base (9b612ed) to head (70d94cd).

Files with missing lines Patch % Lines
...eSharp.Drawing/Processing/DrawingCanvas{TPixel}.cs 87% 2 Missing ⚠️
Additional details and impacted files
@@              Coverage Diff              @@
##           release/3.1.x    #420   +/-   ##
=============================================
  Coverage             80%     80%           
=============================================
  Files                232     232           
  Lines              27359   27392   +33     
  Branches            3114    3120    +6     
=============================================
+ Hits               21896   21959   +63     
+ Misses              4576    4540   -36     
- Partials             887     893    +6     
Flag Coverage Δ
unittests 80% <97%> (+<1%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@JimBobSquarePants
JimBobSquarePants merged commit ef8c9c8 into release/3.1.x Sep 14, 2026
12 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant