This file records local changes made under third_party/skia_dart so we can
track the delta from the published package and avoid losing rendering-critical
API work during future vendor refreshes.
Purpose:
- Keep missing Skia APIs in the vendored implementation instead of adding renderer-side workarounds.
- Expose Skia gradient shader creation through typed Dart APIs so the rendering port can call Skia directly.
Files changed:
third_party/skia_dart/packages/skia_dart/lib/src/shader.dartthird_party/skia_dart/packages/skia_dart/lib/src/skia.g.dart
Changes:
- Added Dart FFI bindings for:
sk_shader_new_linear_gradientsk_shader_new_radial_gradientsk_shader_new_sweep_gradientsk_shader_new_two_point_conical_gradient
- Added typed
SkShaderfactories for:SkShader.linearGradientSkShader.radialGradientSkShader.sweepGradientSkShader.twoPointConicalGradient
- Added shared gradient color/position pointer plumbing for the new factories.
Notes:
- This API surface was added before the native dylib had matching exported symbols. The native wrapper work below makes the Dart bindings resolvable at runtime.
Purpose:
- Enable full Skia-backed gradient rendering from Dart without pre-rasterizing gradient pixels in the rendering port.
- Make the existing Dart gradient shader API resolve against the vendored native dylib.
Files changed:
third_party/skia_dart/src/wrapper/include/sk_shader.hthird_party/skia_dart/src/wrapper/sk_shader.cppthird_party/skia_dart/src/wrapper/sk_surface.cpp
Changes:
- Re-enabled the native C wrapper declarations for Skia gradient shader creation so the dylib exports unmangled C symbols.
- Ported the native gradient wrapper from the older
SkGradientShader::Make*API to current Skia'sSkShaders::*GradientAPI usingSkGradient,SkGradient::Colors,SkSpan, andSkColor4f. - Preserved the existing C ABI shape by converting legacy
SkColorarrays toSkColor4farrays inside the native wrapper. - Updated
sk_surface_write_pixelsfor current Skia, replacing the removed five-argumentSkSurface::writePixelsoverload withSkPixmapconstruction plus the current three-argument call.
Native rebuild:
- Synced Skia third-party dependencies with
python3 bin/sync. - Rebuilt
third_party/skia_dart/out/mac_arm64_graphite/libskia_dart.dylibusingthird_party/ninja/ninja -C ../out/mac_arm64_graphite libskia_dart.dylib. - Copied the rebuilt dylib to
third_party/skia_dart/packages/skia_dart/.dart_tool/lib/libskia_dart.dylibfor local Dart test execution.
Verification:
nm -gU third_party/skia_dart/out/mac_arm64_graphite/libskia_dart.dylib | rg "sk_shader_new_(linear|radial|sweep|two_point)"nm -gU third_party/skia_dart/packages/skia_dart/.dart_tool/lib/libskia_dart.dylib | rg "sk_shader_new_(linear|radial|sweep|two_point)"
Both dylibs export:
_sk_shader_new_linear_gradient_sk_shader_new_linear_gradient_color4f_sk_shader_new_radial_gradient_sk_shader_new_radial_gradient_color4f_sk_shader_new_sweep_gradient_sk_shader_new_sweep_gradient_color4f_sk_shader_new_two_point_conical_gradient_sk_shader_new_two_point_conical_gradient_color4f
The following paths are local build outputs or dependency checkouts created to rebuild the vendored native library; they are not hand-authored source changes:
third_party/skia_dart/skia/third_party/skia_dart/out/third_party/skia_dart/packages/skia_dart/.dart_tool/lib/libskia_dart.dylib