diff options
author | wm4 <wm4@nowhere> | 2016-05-23 21:23:41 +0200 |
---|---|---|
committer | wm4 <wm4@nowhere> | 2016-05-23 21:27:18 +0200 |
commit | e76aa7e8dbb3da3a6f7ea8a20adb7ae70ef9a8e3 (patch) | |
tree | b335cec989ed6d496bf022d74d14d1c9cac16cca /video/out/opengl/utils.c | |
parent | 66079048eaebdb03caea81d610fd1457ceaaa507 (diff) | |
download | mpv-e76aa7e8dbb3da3a6f7ea8a20adb7ae70ef9a8e3.tar.bz2 mpv-e76aa7e8dbb3da3a6f7ea8a20adb7ae70ef9a8e3.tar.xz |
vo_opengl: rename glUploadTex, drop unused parameter
Rename it to get out of OpenGL's namespace. The gl_ prefix is used by
other mpv functions, but no OpenGL ones.
The "slice" parameter was never actually used, and all callers passed 0
for it.
Diffstat (limited to 'video/out/opengl/utils.c')
-rw-r--r-- | video/out/opengl/utils.c | 15 |
1 files changed, 6 insertions, 9 deletions
diff --git a/video/out/opengl/utils.c b/video/out/opengl/utils.c index 76e119b8f7..afc768b0d2 100644 --- a/video/out/opengl/utils.c +++ b/video/out/opengl/utils.c @@ -67,25 +67,22 @@ static int get_alignment(int stride) // format, type: texture parameters // dataptr, stride: image data // x, y, width, height: part of the image to upload -// slice: height of an upload slice, 0 for all at once -void glUploadTex(GL *gl, GLenum target, GLenum format, GLenum type, - const void *dataptr, int stride, - int x, int y, int w, int h, int slice) +void gl_upload_tex(GL *gl, GLenum target, GLenum format, GLenum type, + const void *dataptr, int stride, + int x, int y, int w, int h) { int bpp = gl_bytes_per_pixel(format, type); const uint8_t *data = dataptr; int y_max = y + h; if (w <= 0 || h <= 0 || !bpp) return; - if (slice <= 0) - slice = h; if (stride < 0) { data += (h - 1) * stride; stride = -stride; } gl->PixelStorei(GL_UNPACK_ALIGNMENT, get_alignment(stride)); - bool use_rowlength = slice > 1 && (gl->mpgl_caps & MPGL_CAP_ROW_LENGTH); - if (use_rowlength) { + int slice = h; + if (gl->mpgl_caps & MPGL_CAP_ROW_LENGTH) { // this is not always correct, but should work for MPlayer gl->PixelStorei(GL_UNPACK_ROW_LENGTH, stride / bpp); } else { @@ -98,7 +95,7 @@ void glUploadTex(GL *gl, GLenum target, GLenum format, GLenum type, } if (y < y_max) gl->TexSubImage2D(target, 0, x, y, w, y_max - y, format, type, data); - if (use_rowlength) + if (gl->mpgl_caps & MPGL_CAP_ROW_LENGTH) gl->PixelStorei(GL_UNPACK_ROW_LENGTH, 0); gl->PixelStorei(GL_UNPACK_ALIGNMENT, 4); } |