Skip to content

Bump skia to milestone 122#3559

Closed
mattleibow wants to merge 5 commits into
mainfrom
dev/update-skia-m122
Closed

Bump skia to milestone 122#3559
mattleibow wants to merge 5 commits into
mainfrom
dev/update-skia-m122

Conversation

@mattleibow

Copy link
Copy Markdown
Contributor

Bump Skia to Chrome Milestone 122

Update Skia from m119 to m122 (3-milestone jump: m120→m121→m122).

Changes

C# Wrapper (binding/SkiaSharp/):

  • SKTypeface.CreateDefault, FromFamilyName, FromFile, FromStream, FromData — marked [Obsolete], redirected to SKFontManager.Default methods
  • SKTypeface.Default static initializer — uses SKFontManager.Default.MatchFamily(null) instead of removed sk_typeface_ref_default
  • New binding: sk_surface_draw_with_sampling (from upstream)

Version Updates:

  • scripts/VERSIONS.txt: milestone 122, soname 122.0.0, assembly 3.122.0.0, nuget 3.122.0
  • cgmanifest.json: chrome_milestone → 122

Tests:

  • Updated CanSetTypefacesWithoutCrashing tests — null typeface now falls back to platform default instead of staying null (m122 behavior)
  • All 5,346 tests pass (0 failures, 5 platform-specific skips)

Companion PR

Submodule: mono/skia#170

Migration Guide for Users

// Before (deprecated)
var typeface = SKTypeface.FromFamilyName("Arial");

// After (recommended)
var typeface = SKFontManager.Default.MatchFamily("Arial");

// Before (deprecated)
var typeface = SKTypeface.FromFile("font.ttf");

// After (recommended)
var typeface = SKFontManager.Default.CreateTypeface("font.ttf");

@mattleibow

Copy link
Copy Markdown
Contributor Author

Companion PR: mono/skia#170

@mattleibow mattleibow force-pushed the dev/update-skia-m122 branch 2 times, most recently from 0b02c20 to 442e4e7 Compare March 12, 2026 00:31
Update Skia from m119 to m122 (3-milestone jump: m120→m121→m122).

Breaking changes addressed:
- SkTypeface::MakeDefault/RefDefault/MakeFromName/File/Stream/Data removed (m120)
  → C API functions removed; C# redirects to SKFontManager.Default with [Obsolete]
- SkFontMgr::RefDefault/MakeDefault/Factory removed (m122)
  → C API implements platform-specific font manager singleton
- SkFont(nullptr) now creates empty typeface instead of default (m122)
  → C API intercepts null to provide platform default typeface
- GrMipmapped/GrMipMapped aliases removed (m121)
  → Updated to skgpu::Mipmapped
- GrDirectContext::MakeVulkan/MakeGL moved to GrDirectContexts namespace (m120/m122)
  → Updated includes and call sites
- GrVkYcbcrConversionInfo changed from struct to type alias (m122)
  → Changed DEF_STRUCT_MAP to DEF_MAP with SK_VULKAN guard
- skresources bool parameter changed to ImageDecodeStrategy enum (m122)
  → Updated enum conversion

Version updates: soname 122.0.0, assembly 3.122.0.0, nuget 3.122.0

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@mattleibow mattleibow force-pushed the dev/update-skia-m122 branch from 442e4e7 to 8d61e8b Compare March 12, 2026 00:36
mattleibow and others added 4 commits March 12, 2026 05:24
Use SkFontMgr_New_Custom_Data for WASM/embedded platforms instead of
SkFontMgr::RefEmpty(). The empty font manager cannot create typefaces
from data, breaking SKFontManager.CreateTypeface(data) on WASM.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Use SkFontMgr_New_Custom_Embedded with NotoMono-Regular.ttf instead
of empty SkFontMgr_New_Custom_Data. This preserves the existing WASM
behavior where text renders with a monospace fallback font without
requiring explicit font registration.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Add 8 new lessons learned from the m119→m122 update:
- C API has no ABI compat: remove dead stubs, don't leave them
- SkFont null typeface = empty (draws nothing) in m122+
- Platform-specific font manager selection (comprehensive mapping)
- WASM must use embedded font manager with NotoMono fallback
- No more custom patches to upstream headers
- Upstream DEPS reverts custom dependency bumps
- Ganesh namespace migration patterns (Gr* → GrDirectContexts)
- SKTypeface factory migration to SKFontManager
- skresources bool → enum migration pattern
- Static singleton pattern for shared C API state

Update files-changed table with all files discovered during m122.
Add m119→m122 historical example to breaking-changes-checklist.
Expand troubleshooting table with new error patterns.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@mattleibow mattleibow closed this Mar 27, 2026
@mattleibow mattleibow deleted the dev/update-skia-m122 branch March 27, 2026 19:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

1 participant