diff -r d9a2fa86cd97 configure --- a/configure Sat Jun 21 12:38:46 2014 -0700 +++ b/configure Tue Jun 24 22:17:43 2014 +0200 @@ -842,6 +842,7 @@ enable_video_opengles enable_libudev enable_dbus +enable_ibus enable_input_tslib enable_pthreads enable_pthread_sem @@ -1573,6 +1574,7 @@ --enable-video-opengles include OpenGL ES support [[default=yes]] --enable-libudev enable libudev support [[default=yes]] --enable-dbus enable D-Bus support [[default=yes]] + --enable-ibus enable IBus support [[default=yes]] --enable-input-tslib use the Touchscreen library for input [[default=yes]] --enable-pthreads use POSIX threads for multi-threading @@ -21406,6 +21408,100 @@ $as_echo "#define HAVE_DBUS_DBUS_H 1" >>confdefs.h EXTRA_CFLAGS="$EXTRA_CFLAGS $DBUS_CFLAGS" + SOURCES="$SOURCES $srcdir/src/core/linux/SDL_dbus.c" + fi + fi + fi +} + +CheckIBus() +{ + # Check whether --enable-ibus was given. +if test "${enable_ibus+set}" = set; then : + enableval=$enable_ibus; +else + enable_ibus=yes +fi + + if test x$enable_ibus = xyes; then + # Extract the first word of "pkg-config", so it can be a program name with args. +set dummy pkg-config; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_path_PKG_CONFIG+:} false; then : + $as_echo_n "(cached) " >&6 +else + case $PKG_CONFIG in + [\\/]* | ?:[\\/]*) + ac_cv_path_PKG_CONFIG="$PKG_CONFIG" # Let the user override the test with a path. + ;; + *) + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_path_PKG_CONFIG="$as_dir/$ac_word$ac_exec_ext" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + + test -z "$ac_cv_path_PKG_CONFIG" && ac_cv_path_PKG_CONFIG="no" + ;; +esac +fi +PKG_CONFIG=$ac_cv_path_PKG_CONFIG +if test -n "$PKG_CONFIG"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $PKG_CONFIG" >&5 +$as_echo "$PKG_CONFIG" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + + if test x$PKG_CONFIG != xno; then + IBUS_CFLAGS=`$PKG_CONFIG --cflags ibus-1.0` + save_CFLAGS="$CFLAGS" + CFLAGS="$save_CFLAGS $IBUS_CFLAGS" + ac_fn_c_check_header_mongrel "$LINENO" "ibus-1.0/ibus.h" "ac_cv_header_ibus_1_0_ibus_h" "$ac_includes_default" +if test "x$ac_cv_header_ibus_1_0_ibus_h" = xyes; then : + have_ibus_ibus_h_hdr=yes +else + have_ibus_ibus_h_hdr=no +fi + + + ac_fn_c_check_header_mongrel "$LINENO" "sys/inotify.h" "ac_cv_header_sys_inotify_h" "$ac_includes_default" +if test "x$ac_cv_header_sys_inotify_h" = xyes; then : + have_inotify_inotify_h_hdr=yes +else + have_inotify_inotify_h_hdr=no +fi + + + CFLAGS="$save_CFLAGS" + if test x$have_ibus_ibus_h_hdr = xyes; then + if test x$enable_dbus != xyes; then + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: DBus support is required for IBus." >&5 +$as_echo "$as_me: WARNING: DBus support is required for IBus." >&2;} + have_ibus_ibus_h_hdr=no + elif test x$have_inotify_inotify_h_hdr != xyes; then + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: INotify support is required for IBus." >&5 +$as_echo "$as_me: WARNING: INotify support is required for IBus." >&2;} + have_ibus_ibus_h_hdr=no + else + +$as_echo "#define HAVE_IBUS_IBUS_H 1" >>confdefs.h + + EXTRA_CFLAGS="$EXTRA_CFLAGS $IBUS_CFLAGS" + SOURCES="$SOURCES $srcdir/src/core/linux/SDL_ibus.c" + fi fi fi fi @@ -22680,6 +22776,7 @@ CheckWayland CheckLibUDev CheckDBus + CheckIBus CheckInputEvents CheckInputKD CheckTslib @@ -23419,6 +23516,11 @@ else SUMMARY="${SUMMARY}Using dbus : NO\n" fi +if test x$have_ibus_ibus_h_hdr = xyes; then + SUMMARY="${SUMMARY}Using ibus : YES\n" +else + SUMMARY="${SUMMARY}Using ibus : NO\n" +fi ac_config_commands="$ac_config_commands summary" diff -r d9a2fa86cd97 src/render/opengles2/SDL_render_gles2.c --- a/src/render/opengles2/SDL_render_gles2.c Sat Jun 21 12:38:46 2014 -0700 +++ b/src/render/opengles2/SDL_render_gles2.c Tue Jun 24 22:17:43 2014 +0200 @@ -590,7 +590,7 @@ /* Reformat the texture data into a tightly packed array */ src_pitch = width * bpp; - src = (Uint8 *)data; + src = (Uint8 *)pixels; if (pitch != src_pitch) { blob = (Uint8 *)SDL_malloc(src_pitch * height); if (!blob) { @@ -637,6 +637,41 @@ tdata->pixel_type, pixels, pitch, SDL_BYTESPERPIXEL(texture->format)); + if (tdata->yuv) { + + /* Skip to the correct offset into the next texture */ + pixels = (const void*)((const Uint8*)pixels + rect->h * pitch); + if (texture->format == SDL_PIXELFORMAT_YV12) { + data->glBindTexture(tdata->texture_type, tdata->texture_v); + } else { + data->glBindTexture(tdata->texture_type, tdata->texture_u); + } + GLES2_TexSubImage2D(data, tdata->texture_type, + rect->x / 2, + rect->y / 2, + rect->w / 2, + rect->h / 2, + tdata->pixel_format, + tdata->pixel_type, + pixels, pitch / 2, 1); + + /* Skip to the correct offset into the next texture */ + pixels = (const void*)((const Uint8*)pixels + (rect->h * pitch)/4); + if (texture->format == SDL_PIXELFORMAT_YV12) { + data->glBindTexture(tdata->texture_type, tdata->texture_u); + } else { + data->glBindTexture(tdata->texture_type, tdata->texture_v); + } + GLES2_TexSubImage2D(data, tdata->texture_type, + rect->x / 2, + rect->y / 2, + rect->w / 2, + rect->h / 2, + tdata->pixel_format, + tdata->pixel_type, + pixels, pitch / 2, 1); + } + return GL_CheckError("glTexSubImage2D()", renderer); } @@ -684,7 +719,7 @@ rect->h, tdata->pixel_format, tdata->pixel_type, - Vplane, Vpitch, 1); + Yplane, Ypitch, 1); return GL_CheckError("glTexSubImage2D()", renderer); }