Skip to content

gui_toolkit 0.5.0

Choose a tag to compare

@sachahjkl sachahjkl released this 22 Oct 09:43
· 725 commits to master since this release
v0.5.0
c7e2e97

Added

  • Filters on layers: draw.push_effects(dc, bounds, Layer_Effects{alpha, filters, blend}) (then pop_layer).
    Filter / Filter_Kind / Color_Matrix; constructors filter_blur, filter_drop_shadow, filter_brightness,
    filter_contrast, filter_grayscale, filter_sepia, filter_saturate, filter_hue_rotate, filter_invert,
    filter_opacity, filter_matrix; filter_is_identity, filters_outset. Chains run as GPU passes
    (render/filter.hlsl): color matrices fused (up to 8, clamped between), separable gaussian blur with bilinear tap
    pairs and power-of-two reductions above render.set_blur_sigma_limit, drop shadows. Colors are filtered in sRGB as
    browsers do.
  • Blend modes: Blend_Mode (the 16 modes of CSS Compositing 1, plus Plus_Darker / Plus_Lighter) on
    Layer_Effects.blend; the composite reads a copy of what lies under it (render.FLAG_BLEND, Batch.backdrop).
  • Backdrops: draw.backdrop(dc, r, radii, filters), backdrop_capture / backdrop_draw (CSS backdrop-filter,
    frosted glass), render.FLAG_SCREEN.
  • Clip shapes: draw.push_clip_ellipse, draw.push_clip_polygon (nonzero / even-odd), antialiased.
  • Renderer: render.Frame_Data, render.Op (clear, copy, filter pass), render.Pass, render.Image_Ref,
    render.acquire_snapshot, render.release_target, render.blur_taps.
  • tests/effects: pixel tests of every filter and blend mode against the specifications' formulas, blur energy /
    symmetry / profile (full resolution and reduced), drop shadows, ellipse and polygon clip coverage, backdrops,
    target reuse.
  • examples/effects (build.bat effects): demo, --stress=N, --bench=N. Screenshot in docs/screenshots.

Changed

  • Frames run their steps in recording order (layers are no longer drawn before the frame): frame_submit(r, Frame_Data) replaces the positional arguments; Batch gains backdrop and op; Layer.done is gone.
  • Inside a layer the clip stack restarts at the layer's rect; the clip shapes around it cut its composite.
  • Pooled targets are handed back as soon as their last reader is recorded: a frame with many layers uses a few
    textures.
  • Clip_Data is 80 bytes (kind, first, count, flags); CLIP_CIRCLE moved from parent to flags.