Skip to content

GitLab

  • Projects
  • Groups
  • Snippets
  • Help
    • Loading...
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Sign in
gnome-shell
gnome-shell
  • Project overview
    • Project overview
    • Details
    • Activity
    • Releases
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
  • Issues 1,449
    • Issues 1,449
    • List
    • Boards
    • Labels
    • Service Desk
    • Milestones
  • Merge Requests 124
    • Merge Requests 124
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Schedules
  • Operations
    • Operations
    • Incidents
    • Environments
  • Packages & Registries
    • Packages & Registries
    • Container Registry
  • Analytics
    • Analytics
    • CI/CD
    • Repository
    • Value Stream
  • Wiki
    • Wiki
  • Snippets
    • Snippets
  • Members
    • Members
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar
  • GNOME
  • gnome-shellgnome-shell
  • Merge Requests
  • !1604

Closed
Created Jan 28, 2021 by verdre@verdreDeveloper
  • Report abuse
Report abuse

WIP: shell: Add a ClutterEffect for rounded clipping

  • Overview 8
  • Commits 1
  • Pipelines 4
  • Changes 3

This adds a new ClutterOffscreenEffect subclass to do rounded clipping of the edges of ClutterActors: ShellRoundedClipEffect

The way it works is by painting the actor to an offscreen framebuffer, and then painting that framebuffer using a custom fragment shader that modifies the color of each pixel, also performing anti-aliasing around the edges.

The shader code is taken completely from GTKs GSK and its GskRoundedRect clipping fragment shader, see gskSetOutputColor() [1].

The new effect has two properties, radius and bounds. The radius property allows conveniently specifying a floating point corner radius value for all four corners of the texture and can easily be animated, the bounds property allows setting a graphene_rect_t that's used as the basis clip rectangle that the rounding gets applied on top of.

[1] https://gitlab.gnome.org/GNOME/gtk/-/blob/master/gsk/resources/glsl/preamble.fs.glsl

Edited Feb 12, 2021 by verdre
Assignee
Assign to
Reviewer
Request review from
None
Milestone
None
Assign milestone
Time tracking
Source branch: new-rounded-clip-effect