Thanks to visit codestin.com
Credit goes to github.com

Skip to content

[api] Add SKColorFilter.CreateOverdraw() for overdraw visualization #3941

@mattleibow

Description

@mattleibow

Part of #3680

Review for v4 inclusion — evaluate against time constraints and value. This wraps a single existing Skia C++ factory for debugging/profiling visualization.

Summary

Expose SkOverdrawColorFilter::MakeWithSkColors(SkColor[6]) which maps overdraw counts (0-5+) to a 6-color palette. Used for rendering performance debugging — paints areas by how many times they were drawn over.

What exists today

Layer Status
C++ SkOverdrawColorFilter::MakeWithSkColors() in include/effects/SkOverdrawColorFilter.h
C API ❌ No sk_colorfilter_new_overdraw
C# ❌ Not exposed

Proposed changes

  • Add sk_colorfilter_new_overdraw(sk_color_t colors[6]) to C API shim (~3 lines)
  • Regenerate bindings
  • Add SKColorFilter.CreateOverdraw(SKColor[]) + ReadOnlySpan<SKColor> overload (~15 lines)
  • Validate 6-element array constraint
  • Tests (~30 lines)

Estimated effort

~3 hours, ~75 lines total. Follows SKColorFilter.CreateTable pattern.

Use case

Primarily a developer tool for profiling rendering performance. Could also be used in gallery samples to demonstrate overdraw analysis.

Metadata

Metadata

Assignees

No one assigned

    Labels

    cost/xs~1 Isolated, well-understood, minimal context neededtype/feature-requestupgrading/4.xIssues and discussions relating to the upgrade from 3.x to 4.x

    Type

    No type

    Projects

    Status

    New

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions