Add a ShadowedRectangle item

Authored by ahiemstra on Mar 12 2020, 1:56 PM.

Description

Add a ShadowedRectangle item

Summary:
This adds a ShadowedRectangle item, which is a rectangle with a shadow.
It uses a custom shader that draws the rectangle and the shadow below it
using distance fields, which has significantly better performance compared
to the DropShadow effect. It also supports rounded corners, which the
current Card code does not.

This is a first step to moving more of AbstractCard and related items to
C++ code. Other bits will include a ShadowedImage item and moving actual
card code to C++.

Test Plan:

Screenshot of test program showing ShadowedRectangle, Rectangle with DropShadow effect and empty Kirigami Card.

Rounded corners.

Performance comparison:

The video at top is using Rectangle with DropShadow, the one below that ShadowedRectangle.

Reviewers: Kirigami, mart

Reviewed By: Kirigami, mart

Subscribers: mart, cblack, zzag, plasma-devel

Tags: Kirigami

Differential Revision: https://phabricator.kde.org/D27984

Details

Committed
ahiemstraMar 13 2020, 9:16 AM
Reviewer
Kirigami
Differential Revision
D27984: Add a ShadowedRectangle item
Parents
R169:84536d95dfb4: alwaysVisibleActions property
Branches
Unknown
Tags
Unknown