Skip to content

Commit cb2e059

Browse files
committed
Fix some more bugs within the compositor
1 parent 9fd54c2 commit cb2e059

5 files changed

Lines changed: 123 additions & 112 deletions

File tree

kos/include/libvideo/codec/rectutils.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -88,15 +88,15 @@ __LOCAL __ATTR_WUNUSED __ATTR_IN(1) __ATTR_IN(2) __ATTR_OUT(3) __BOOL LIBVIDEO_C
8888
video_rect_intersect_overflow_in_b(struct video_rect const *__restrict a,
8989
struct video_rect const *__restrict b,
9090
struct video_rect *__restrict intersect) {
91+
video_offset_t b_xend, b_yend, intersect_xend, intersect_yend;
9192
video_offset_t a_xend = video_rect_getxend(a);
9293
video_offset_t a_yend = video_rect_getyend(a);
93-
video_offset_t b_xend, b_yend;
94-
video_offset_t intersect_xend = __hybrid_min(a_xend, b_xend);
95-
video_offset_t intersect_yend = __hybrid_min(a_yend, b_yend);
9694
if (__hybrid_overflow_sadd(video_rect_getxmin(b), video_rect_getxdim(b), &b_xend))
9795
b_xend = VIDEO_OFFSET_MAX;
9896
if (__hybrid_overflow_sadd(video_rect_getymin(b), video_rect_getydim(b), &b_yend))
9997
b_yend = VIDEO_OFFSET_MAX;
98+
intersect_xend = __hybrid_min(a_xend, b_xend);
99+
intersect_yend = __hybrid_min(a_yend, b_yend);
100100
video_rect_setxmin(intersect, __hybrid_max(video_rect_getxmin(a), video_rect_getxmin(b)));
101101
video_rect_setymin(intersect, __hybrid_max(video_rect_getymin(a), video_rect_getymin(b)));
102102
if (video_rect_getxmin(intersect) < intersect_xend && video_rect_getymin(intersect) < intersect_yend) {

kos/include/libvideo/compositor/compositor.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,7 @@ __DECL_BEGIN
4242
* - When set, `VIDEO_WINDOW_F_PASSTHRU' is ignored
4343
* - When set, buffer returned by `video_window_getbuffer' has alpha-support */
4444
#define VIDEO_WINDOW_F_PASSTHRU 0x0002 /* Enable support for video_buffer passthru (when possible) */
45+
/* TODO: "VIDEO_WINDOW_F_PASSTHRU" should be the default -- disallow should be its own flag */
4546
#define VIDEO_WINDOW_F_HIDDEN 0x0004 /* Window is being hidden right now */
4647
#define VIDEO_WINDOW_F_ALL (VIDEO_WINDOW_F_ALPHA | VIDEO_WINDOW_F_PASSTHRU | VIDEO_WINDOW_F_HIDDEN)
4748

kos/src/apps/showpic/main.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -604,7 +604,7 @@ int main(int argc, char *argv[]) {
604604

605605
/* Create a second (small) window to interact with the first (big) one */
606606
position.vwp_over = VIDEO_WINDOW_MOVE_OVER__FOREGROUND;
607-
position.vwp_attr.vwa_flags = VIDEO_WINDOW_F_PASSTHRU /*| VIDEO_WINDOW_F_ALPHA*/;
607+
position.vwp_attr.vwa_flags = VIDEO_WINDOW_F_PASSTHRU | VIDEO_WINDOW_F_ALPHA;
608608
position.vwp_attr.vwa_rect.vr_xmin = 10;
609609
position.vwp_attr.vwa_rect.vr_ymin = 10;
610610
position.vwp_attr.vwa_rect.vr_xdim = 200;
@@ -626,7 +626,7 @@ int main(int argc, char *argv[]) {
626626
colors[0][0] = VIDEO_COLOR_RGBA(0xff, 0, 0, 0xff);
627627
colors[0][1] = VIDEO_COLOR_RGBA(0, 0xff, 0, 0xff);
628628
colors[1][0] = VIDEO_COLOR_RGBA(0, 0, 0xff, 0xff);
629-
colors[1][1] = VIDEO_COLOR_RGBA(0xff, 0xff, 0xff, 0xff);
629+
colors[1][1] = VIDEO_COLOR_RGBA(0xff, 0xff, 0xff, 0);
630630
video_gfx_gradient(&window2_gfx, 0, 0,
631631
video_gfx_getclipw(&window2_gfx),
632632
video_gfx_getcliph(&window2_gfx),

0 commit comments

Comments
 (0)