summaryrefslogtreecommitdiffstats
path: root/common
diff options
context:
space:
mode:
authorwm4 <wm4@nowhere>2017-08-07 19:14:18 +0200
committerwm4 <wm4@nowhere>2017-08-07 19:17:28 +0200
commit47ea771b7a29b04e35276d38733f72970b4dd448 (patch)
tree2a9f9c52acba9f662d62a290f739c502c6ca0ff8 /common
parent1adf324d8b1261abfc02d905f98055991b29ac11 (diff)
downloadmpv-47ea771b7a29b04e35276d38733f72970b4dd448.tar.bz2
mpv-47ea771b7a29b04e35276d38733f72970b4dd448.tar.xz
vo_opengl: further GL API use separation
Move multiple GL-specific things from the renderer to other places like vo_opengl.c, vo_opengl_cb.c, and ra_gl.c. The vp_w/vp_h parameters to gl_video_resize() make no sense anymore, and are implicitly part of struct fbodst. Checking the main framebuffer depth is moved to vo_opengl.c. For vo_opengl_cb.c it always assumes 8. The API user now has to override this manually. The previous heuristic didn't make much sense anyway. The only remaining dependency on GL is the hwdec stuff, which is harder to change.
Diffstat (limited to 'common')
-rw-r--r--common/common.c6
-rw-r--r--common/common.h1
2 files changed, 7 insertions, 0 deletions
diff --git a/common/common.c b/common/common.c
index a07af8c461..9ed63e1783 100644
--- a/common/common.c
+++ b/common/common.c
@@ -115,6 +115,12 @@ bool mp_rect_intersection(struct mp_rect *rc, const struct mp_rect *rc2)
return rc->x1 > rc->x0 && rc->y1 > rc->y0;
}
+bool mp_rect_equals(struct mp_rect *rc1, struct mp_rect *rc2)
+{
+ return rc1->x0 == rc2->x0 && rc1->y0 == rc2->y0 &&
+ rc1->x1 == rc2->x1 && rc1->y1 == rc2->y1;
+}
+
// This works like snprintf(), except that it starts writing the first output
// character to str[strlen(str)]. This returns the number of characters the
// string would have *appended* assuming a large enough buffer, will make sure
diff --git a/common/common.h b/common/common.h
index fb40d251f1..cdd1d56ed5 100644
--- a/common/common.h
+++ b/common/common.h
@@ -82,6 +82,7 @@ struct mp_rect {
void mp_rect_union(struct mp_rect *rc, const struct mp_rect *src);
bool mp_rect_intersection(struct mp_rect *rc, const struct mp_rect *rc2);
bool mp_rect_contains(struct mp_rect *rc, int x, int y);
+bool mp_rect_equals(struct mp_rect *rc1, struct mp_rect *rc2);
int mp_snprintf_cat(char *str, size_t size, const char *format, ...)
PRINTF_ATTRIBUTE(3, 4);