summaryrefslogtreecommitdiffstatsci
path: root/samples/tests/compositing.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'samples/tests/compositing.cpp')
-rw-r--r--samples/tests/compositing.cpp31
1 files changed, 31 insertions, 0 deletions
diff --git a/samples/tests/compositing.cpp b/samples/tests/compositing.cpp
new file mode 100644
index 0000000..6ef062e
--- /dev/null
+++ b/samples/tests/compositing.cpp
@@ -0,0 +1,31 @@
+#include "VkvgTest.hpp"
+
+TEST(compositing) {
+ VkvgContext ctx = vkvg_create(test->surf);
+
+ vkvg_set_source_rgba(ctx, 1, 0, 0, 0.5f);
+ vkvg_rectangle(ctx, 100, 100, 200, 200);
+ vkvg_fill(ctx);
+
+ vkvg_set_source_rgba(ctx, 0, 0, 1, 0.5f);
+ vkvg_rectangle(ctx, 200, 200, 200, 200);
+ vkvg_fill(ctx);
+
+ vkvg_destroy(ctx);
+}
+
+TEST(opacity) {
+ VkvgContext ctx = vkvg_create(test->surf);
+
+ vkvg_set_source_rgba(ctx, 1, 0, 0, 1.0f);
+ vkvg_rectangle(ctx, 100, 100, 200, 200);
+ vkvg_fill(ctx);
+
+ vkvg_set_opacity(ctx, 0.5f);
+
+ vkvg_set_source_rgba(ctx, 0, 0, 1, 1.0f);
+ vkvg_rectangle(ctx, 200, 200, 200, 200);
+ vkvg_fill(ctx);
+
+ vkvg_destroy(ctx);
+}