Skip to content

Commit c535d37

Browse files
sync: from linuxdeepin/dtkdeclarative
Synchronize source files from linuxdeepin/dtkdeclarative. Source-pull-request: linuxdeepin/dtkdeclarative#390
1 parent 153bf4e commit c535d37

10 files changed

Lines changed: 2431 additions & 0 deletions

examples/qml-inspect/Example_3.qml

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,28 @@ Item {
4343
invert: true
4444
}
4545

46+
Rectangle {
47+
id: sourceItem1
48+
x: 300
49+
y: 50
50+
width: 200
51+
height: 200
52+
color: "green"
53+
}
54+
55+
DRadiusEffect {
56+
x: 300
57+
y: 300
58+
width: 200
59+
height: 200
60+
sourceItem: sourceItem1
61+
radius: 30
62+
topRightRadius: 10
63+
topLeftRadius: 20
64+
bottomRightRadius: 30
65+
bottomLeftRadius: 40
66+
}
67+
4668
BoxShadow {
4769
hollow: true
4870
anchors.fill: shadowedRect

qt6/src/CMakeLists.txt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,8 @@ qt_add_shaders(${LIB_NAME} "_shaders_ng"
6161
"shaders_ng/cornerscolorshader.frag"
6262
"shaders_ng/shadowmaterial.vert"
6363
"shaders_ng/shadowmaterial.frag"
64+
"shaders_ng/radiussmoothtexture.vert"
65+
"shaders_ng/radiussmoothtexture.frag"
6466
)
6567

6668
include(${PROJECT_SOURCE_DIR}/qmlplugin/targets.cmake)
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
#version 440
2+
3+
layout(location = 0) in vec2 texCoord;
4+
layout(location = 1) in float vertexOpacity;
5+
6+
layout(location = 0) out vec4 fragColor;
7+
8+
layout(binding = 1) uniform sampler2D qt_Texture;
9+
10+
void main()
11+
{
12+
fragColor = texture(qt_Texture, texCoord) * vertexOpacity;
13+
}
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
#version 440
2+
3+
layout(location = 0) in vec4 vertex;
4+
layout(location = 1) in vec2 multiTexCoord;
5+
layout(location = 2) in float vertexOpacityIn;
6+
7+
layout(location = 0) out vec2 texCoord;
8+
layout(location = 1) out float vertexOpacity;
9+
10+
layout(std140, binding = 0) uniform buf {
11+
mat4 qt_Matrix;
12+
float opacity;
13+
vec2 pixelSize;
14+
} ubuf;
15+
16+
out gl_PerVertex { vec4 gl_Position; };
17+
18+
void main()
19+
{
20+
vec4 pos = ubuf.qt_Matrix * vertex;
21+
gl_Position = pos;
22+
texCoord = multiTexCoord;
23+
vertexOpacity = ubuf.opacity * vertexOpacityIn;
24+
}

0 commit comments

Comments
 (0)