diff options
48 files changed, 964 insertions, 680 deletions
diff --git a/fontconfig/configure.in b/fontconfig/configure.in index b2174d99b..f455cb5a5 100644 --- a/fontconfig/configure.in +++ b/fontconfig/configure.in @@ -154,6 +154,8 @@ if test "x$ac_cv_func_fstatfs" = "xyes"; then #include <sys/mount.h> #endif]) fi +AC_CHECK_MEMBERS([struct dirent.d_type],,, + [#include <dirent.h>]) # # regex # diff --git a/fontconfig/fc-cat/fc-cat.c b/fontconfig/fc-cat/fc-cat.c index b273f25d1..72912b798 100644 --- a/fontconfig/fc-cat/fc-cat.c +++ b/fontconfig/fc-cat/fc-cat.c @@ -231,7 +231,7 @@ cache_print_set (FcFontSet *set, FcStrSet *dirs, const FcChar8 *base_name, FcBoo if (s) { printf ("%s", s); - free (s); + FcStrFree (s); } } if (verbose && !set->nfont && !ndir) diff --git a/fontconfig/fc-list/fc-list.c b/fontconfig/fc-list/fc-list.c index 0149b0c53..eb7b688c5 100644 --- a/fontconfig/fc-list/fc-list.c +++ b/fontconfig/fc-list/fc-list.c @@ -183,7 +183,7 @@ main (int argc, char **argv) if (s) { printf ("%s", s); - free (s); + FcStrFree (s); } } } diff --git a/fontconfig/fc-match/fc-match.c b/fontconfig/fc-match/fc-match.c index 4642c8dee..8ae8ee9cd 100644 --- a/fontconfig/fc-match/fc-match.c +++ b/fontconfig/fc-match/fc-match.c @@ -230,7 +230,7 @@ main (int argc, char **argv) if (s) { printf ("%s", s); - free (s); + FcStrFree (s); } } diff --git a/fontconfig/fc-pattern/fc-pattern.c b/fontconfig/fc-pattern/fc-pattern.c index aa51e5f39..84eb1eea1 100644 --- a/fontconfig/fc-pattern/fc-pattern.c +++ b/fontconfig/fc-pattern/fc-pattern.c @@ -176,7 +176,7 @@ main (int argc, char **argv) if (s) { printf ("%s", s); - free (s); + FcStrFree (s); } } else diff --git a/fontconfig/fc-query/fc-query.c b/fontconfig/fc-query/fc-query.c index 0680b92cf..2ed18a2c3 100644 --- a/fontconfig/fc-query/fc-query.c +++ b/fontconfig/fc-query/fc-query.c @@ -165,7 +165,7 @@ main (int argc, char **argv) if (s) { printf ("%s", s); - free (s); + FcStrFree (s); } } else diff --git a/fontconfig/fc-scan/fc-scan.c b/fontconfig/fc-scan/fc-scan.c index ebf56064e..c852e0d95 100644 --- a/fontconfig/fc-scan/fc-scan.c +++ b/fontconfig/fc-scan/fc-scan.c @@ -168,7 +168,7 @@ main (int argc, char **argv) if (s) { printf ("%s", s); - free (s); + FcStrFree (s); } } else diff --git a/fontconfig/src/fccfg.c b/fontconfig/src/fccfg.c index 5b7249201..b45d74a23 100644 --- a/fontconfig/src/fccfg.c +++ b/fontconfig/src/fccfg.c @@ -1698,17 +1698,17 @@ static FcChar8 * FcConfigFileExists (const FcChar8 *dir, const FcChar8 *file) { FcChar8 *path; - int size; + int size, osize; if (!dir) dir = (FcChar8 *) ""; - size = strlen ((char *) dir) + 1 + strlen ((char *) file) + 1; + osize = strlen ((char *) dir) + 1 + strlen ((char *) file) + 1; /* * workaround valgrind warning because glibc takes advantage of how it knows memory is * allocated to implement strlen by reading in groups of 4 */ - size = (size + 3) & ~3; + size = (osize + 3) & ~3; path = malloc (size); if (!path) @@ -1729,11 +1729,12 @@ FcConfigFileExists (const FcChar8 *dir, const FcChar8 *file) #endif strcat ((char *) path, (char *) file); - FcMemAlloc (FC_MEM_STRING, size); + FcMemAlloc (FC_MEM_STRING, osize); if (access ((char *) path, R_OK) == 0) return path; FcStrFree (path); + return 0; } @@ -1853,6 +1854,7 @@ FcConfigXdgCacheHome (void) ret = malloc (len + 7 + 1); if (ret) { + FcMemAlloc (FC_MEM_STRING, len + 7 + 1); memcpy (ret, home, len); memcpy (&ret[len], FC_DIR_SEPARATOR_S ".cache", 7); ret[len + 7] = 0; @@ -1878,6 +1880,7 @@ FcConfigXdgConfigHome (void) ret = malloc (len + 8 + 1); if (ret) { + FcMemAlloc (FC_MEM_STRING, len + 8 + 1); memcpy (ret, home, len); memcpy (&ret[len], FC_DIR_SEPARATOR_S ".config", 8); ret[len + 8] = 0; @@ -1903,6 +1906,7 @@ FcConfigXdgDataHome (void) ret = malloc (len + 13 + 1); if (ret) { + FcMemAlloc (FC_MEM_STRING, len + 13 + 1); memcpy (ret, home, len); memcpy (&ret[len], FC_DIR_SEPARATOR_S ".local" FC_DIR_SEPARATOR_S "share", 13); ret[len + 13] = 0; diff --git a/fontconfig/src/fcformat.c b/fontconfig/src/fcformat.c index 0e63d5d7c..8eef7bb29 100644 --- a/fontconfig/src/fcformat.c +++ b/fontconfig/src/fcformat.c @@ -294,7 +294,7 @@ interpret_builtin (FcFormatContext *c, if (new_str) { FcStrBufString (buf, new_str); - free (new_str); + FcStrFree (new_str); return FcTrue; } else @@ -1014,7 +1014,7 @@ interpret_convert (FcFormatContext *c, if (new_str) { FcStrBufString (buf, new_str); - free (new_str); + FcStrFree (new_str); return FcTrue; } else diff --git a/fontconfig/src/fcpat.c b/fontconfig/src/fcpat.c index 54ec45c75..ebd6e57e2 100644 --- a/fontconfig/src/fcpat.c +++ b/fontconfig/src/fcpat.c @@ -1046,7 +1046,8 @@ FcSharedStrFree (const FcChar8 *name) { *p = b->next; size = sizeof (struct objectBucket) + strlen ((char *)name) + 1; - FcMemFree (FC_MEM_SHAREDSTR, size + sizeof (int)); + size = (size + 3) & ~3; + FcMemFree (FC_MEM_SHAREDSTR, size); free (b); } return FcTrue; diff --git a/fontconfig/src/fcstat.c b/fontconfig/src/fcstat.c index 0c15f8700..fd64d5cb3 100644 --- a/fontconfig/src/fcstat.c +++ b/fontconfig/src/fcstat.c @@ -26,6 +26,7 @@ #include "fcint.h" #include "fcarch.h" #include <dirent.h> +#include <limits.h> #include <sys/types.h> #include <sys/stat.h> #include <fcntl.h> @@ -159,12 +160,14 @@ Adler32Finish (struct Adler32 *ctx) return ctx->a + (ctx->b << 16); } +#ifdef HAVE_STRUCT_DIRENT_D_TYPE /* dirent.d_type can be relied upon on FAT filesystem */ static FcBool FcDirChecksumScandirFilter(const struct dirent *entry) { return entry->d_type != DT_DIR; } +#endif static int FcDirChecksumScandirSorter(const struct dirent **lhs, const struct dirent **rhs) @@ -177,25 +180,62 @@ FcDirChecksum (const FcChar8 *dir, time_t *checksum) { struct Adler32 ctx; struct dirent **files; - int n; + int n, ret = 0; +#ifndef HAVE_STRUCT_DIRENT_D_TYPE + size_t len = strlen ((const char *)dir); +#endif Adler32Init (&ctx); n = scandir ((const char *)dir, &files, - &FcDirChecksumScandirFilter, - &FcDirChecksumScandirSorter); +#ifdef HAVE_STRUCT_DIRENT_D_TYPE + &FcDirChecksumScandirFilter, +#else + NULL, +#endif + &FcDirChecksumScandirSorter); if (n == -1) - return -1; + return -1; while (n--) { - Adler32Update (&ctx, files[n]->d_name, strlen(files[n]->d_name) + 1); - Adler32Update (&ctx, (char *)&files[n]->d_type, sizeof(files[n]->d_type)); - free(files[n]); + size_t dlen = strlen (files[n]->d_name); + int dtype; + +#ifdef HAVE_STRUCT_DIRENT_D_TYPE + dtype = files[n]->d_type; +#else + struct stat statb; + char f[PATH_MAX + 1]; + + memcpy (f, dir, len); + f[len] = FC_DIR_SEPARATOR; + memcpy (&f[len + 1], files[n]->d_name, dlen); + f[len + 1 + dlen] = 0; + if (lstat (f, &statb) < 0) + { + ret = -1; + goto bail; + } + if (S_ISDIR (statb.st_mode)) + goto bail; + + dtype = statb.st_mode; +#endif + Adler32Update (&ctx, files[n]->d_name, dlen + 1); + Adler32Update (&ctx, (char *)&dtype, sizeof (int)); + +#ifndef HAVE_STRUCT_DIRENT_D_TYPE + bail: +#endif + free (files[n]); } - free(files); + free (files); + if (ret == -1) + return -1; *checksum = Adler32Finish (&ctx); + return 0; } diff --git a/fontconfig/src/fcstr.c b/fontconfig/src/fcstr.c index f20d05e7d..e372af080 100644 --- a/fontconfig/src/fcstr.c +++ b/fontconfig/src/fcstr.c @@ -833,6 +833,7 @@ FcStrBufChar (FcStrBuf *buf, FcChar8 c) if (buf->allocated) { size = buf->size * 2; + FcMemFree (FC_MEM_STRBUF, buf->size); new = realloc (buf->buf, size); } else @@ -850,8 +851,6 @@ FcStrBufChar (FcStrBuf *buf, FcChar8 c) buf->failed = FcTrue; return FcFalse; } - if (buf->size) - FcMemFree (FC_MEM_STRBUF, buf->size); FcMemAlloc (FC_MEM_STRBUF, size); buf->size = size; buf->buf = new; diff --git a/fontconfig/src/fcxml.c b/fontconfig/src/fcxml.c index 799352e6f..343208617 100644 --- a/fontconfig/src/fcxml.c +++ b/fontconfig/src/fcxml.c @@ -1359,6 +1359,7 @@ FcParseRange (FcConfigParse *parse) break; default: FcConfigMessage (parse, FcSevereError, "invalid element in range"); + n = 0; break; } if (count == 1) @@ -1868,12 +1869,14 @@ FcParseDir (FcConfigParse *parse) size_t plen = strlen ((const char *)prefix); size_t dlen = strlen ((const char *)data); + FcMemFree (FC_MEM_STRING, plen + 1); prefix = realloc (prefix, plen + 1 + dlen + 1); if (!prefix) { FcConfigMessage (parse, FcSevereError, "out of memory"); goto bail; } + FcMemAlloc (FC_MEM_STRING, plen + 1 + dlen + 1); prefix[plen] = FC_DIR_SEPARATOR; memcpy (&prefix[plen + 1], data, dlen); prefix[plen + 1 + dlen] = 0; @@ -1938,7 +1941,7 @@ FcParseDir (FcConfigParse *parse) bail: if (prefix) - free (prefix); + FcStrFree (prefix); } static void @@ -1961,12 +1964,14 @@ FcParseCacheDir (FcConfigParse *parse) size_t plen = strlen ((const char *)prefix); size_t dlen = strlen ((const char *)data); + FcMemFree (FC_MEM_STRING, plen + 1); prefix = realloc (prefix, plen + 1 + dlen + 1); if (!prefix) { FcConfigMessage (parse, FcSevereError, "out of memory"); goto bail; } + FcMemAlloc (FC_MEM_STRING, plen + 1 + dlen + 1); prefix[plen] = FC_DIR_SEPARATOR; memcpy (&prefix[plen + 1], data, dlen); prefix[plen + 1 + dlen] = 0; @@ -2057,12 +2062,14 @@ FcParseInclude (FcConfigParse *parse) size_t plen = strlen ((const char *)prefix); size_t dlen = strlen ((const char *)s); + FcMemFree (FC_MEM_STRING, plen + 1); prefix = realloc (prefix, plen + 1 + dlen + 1); if (!prefix) { FcConfigMessage (parse, FcSevereError, "out of memory"); goto bail; } + FcMemAlloc (FC_MEM_STRING, plen + 1 + dlen + 1); prefix[plen] = FC_DIR_SEPARATOR; memcpy (&prefix[plen + 1], s, dlen); prefix[plen + 1 + dlen] = 0; @@ -2080,7 +2087,7 @@ FcParseInclude (FcConfigParse *parse) bail: if (prefix) - free (prefix); + FcStrFree (prefix); } typedef struct _FcOpMap { diff --git a/libX11/AUTHORS b/libX11/AUTHORS index 5b621efb8..58a3acc39 100644 --- a/libX11/AUTHORS +++ b/libX11/AUTHORS @@ -12,6 +12,11 @@ Marineau, Holger Veit, Bruno Haible, Keith Packard, Bob Scheifler, Takashi Fujiwara, Kazunori Nishihara, Hideki Hiura, Hiroyuki Miyamoto, Katsuhisi Yano, Shigeru Yamada, Stephen Gildea, Li Yuhong, Seiji Kuwari. +The specifications and documentation contain extensive credits. +Conversion of those documents from troff to DocBook/XML was performed +by Matt Dew, with assistance in editing & formatting tool setup from +Gaetan Nadon and Alan Coopersmith. + This work was supported by many organizations (in no particular order), including the X Consortium, Digital Equipment Corporation, Tektronix, The Open Group, OMRON, Wyse Technology, Fujitsu Limited, diff --git a/libX11/configure.ac b/libX11/configure.ac index feb2e3841..48a0c8ab9 100644 --- a/libX11/configure.ac +++ b/libX11/configure.ac @@ -1,7 +1,7 @@ # Initialize Autoconf AC_PREREQ([2.60]) -AC_INIT([libX11], [1.4.99.902], +AC_INIT([libX11], [1.5.0], [https://bugs.freedesktop.org/enter_bug.cgi?product=xorg], [libX11]) AC_CONFIG_SRCDIR([Makefile.am]) AC_CONFIG_HEADERS([src/config.h include/X11/XlibConf.h]) diff --git a/libXft/configure.ac b/libXft/configure.ac index b54311ec7..dd415ef5e 100644 --- a/libXft/configure.ac +++ b/libXft/configure.ac @@ -27,7 +27,7 @@ AC_PREREQ([2.60]) # version. This version number will be substituted into Xft.h # Please bump the minor library number at each release as well. # -AC_INIT([libXft], [2.3.0], +AC_INIT([libXft], [2.3.1], [https://bugs.freedesktop.org/enter_bug.cgi?product=xorg], [libXft]) AC_CONFIG_SRCDIR([Makefile.am]) AC_CONFIG_HEADERS([config.h]) diff --git a/mesalib/configs/autoconf.in b/mesalib/configs/autoconf.in index 38f49a295..ce02ae6eb 100644 --- a/mesalib/configs/autoconf.in +++ b/mesalib/configs/autoconf.in @@ -34,8 +34,10 @@ X11_LIBS = @X11_LIBS@ X11_CFLAGS = @X11_CFLAGS@ LLVM_BINDIR = @LLVM_BINDIR@ LLVM_CFLAGS = @LLVM_CFLAGS@ +LLVM_CPPFLAGS = @LLVM_CPPFLAGS@ LLVM_CXXFLAGS = @LLVM_CXXFLAGS@ LLVM_LDFLAGS = @LLVM_LDFLAGS@ +LLVM_LIBDIR = @LLVM_LIBDIR@ LLVM_LIBS = @LLVM_LIBS@ LLVM_INCLUDEDIR = @LLVM_INCLUDEDIR@ GLW_CFLAGS = @GLW_CFLAGS@ @@ -64,6 +66,10 @@ NM = @NM@ # Perl PERL = @PERL@ +# Indent (used for generating dispatch tables) +INDENT = @INDENT@ +INDENT_FLAGS = @INDENT_FLAGS@ + # Python and flags (generally only needed by the developers) PYTHON2 = @PYTHON2@ PYTHON_FLAGS = -t -O -O @@ -187,6 +193,9 @@ VA_LIB_INSTALL_DIR=@VA_LIB_INSTALL_DIR@ # Xorg driver install directory (for xorg state-tracker) XORG_DRIVER_INSTALL_DIR = @XORG_DRIVER_INSTALL_DIR@ +# Path to OpenCL C library libclc +LIBCLC_PATH = @LIBCLC_PATH@ + # pkg-config substitutions GL_PC_REQ_PRIV = @GL_PC_REQ_PRIV@ GL_PC_LIB_PRIV = @GL_PC_LIB_PRIV@ diff --git a/mesalib/configure.ac b/mesalib/configure.ac index 20bd00b67..fc1c28eb2 100644 --- a/mesalib/configure.ac +++ b/mesalib/configure.ac @@ -72,6 +72,11 @@ AC_PROG_LEX AC_PATH_PROG([PERL], [perl]) +AC_CHECK_PROG(INDENT, indent, indent, cat) +if test "x$INDENT" != "xcat"; then + AC_SUBST(INDENT_FLAGS, '-i4 -nut -br -brs -npcs -ce -T GLubyte -T GLbyte -T Bool') +fi + dnl Our fallback install-sh is a symlink to minstall. Use the existing dnl configuration in that case. AC_PROG_INSTALL @@ -266,6 +271,7 @@ if test "x$enable_32bit" = xyes; then if test "x$GCC" = xyes; then CFLAGS="$CFLAGS -m32" ARCH_FLAGS="$ARCH_FLAGS -m32" + CCASFLAGS="$CCASFLAGS -m32" fi if test "x$GXX" = xyes; then CXXFLAGS="$CXXFLAGS -m32" @@ -1615,6 +1621,14 @@ dnl dnl OpenCL configuration dnl +AC_ARG_WITH([libclc-path], + [AS_HELP_STRING([--with-libclc-path], + [Path to libclc builtins library. Example: --with-libclc-path=\$HOME/libclc/])], + [LIBCLC_PATH="$withval"], + [LIBCLC_PATH=""]) + +AC_SUBST([LIBCLC_PATH]) + if test "x$enable_opencl" = xyes; then if test "x$with_gallium_drivers" = x; then AC_MSG_ERROR([cannot enable OpenCL without Gallium]) @@ -1692,7 +1706,9 @@ fi AC_SUBST([LLVM_BINDIR]) AC_SUBST([LLVM_CFLAGS]) +AC_SUBST([LLVM_CPPFLAGS]) AC_SUBST([LLVM_CXXFLAGS]) +AC_SUBST([LLVM_LIBDIR]) AC_SUBST([LLVM_LIBS]) AC_SUBST([LLVM_LDFLAGS]) AC_SUBST([LLVM_INCLUDEDIR]) @@ -1839,11 +1855,16 @@ if test "x$enable_gallium_llvm" = xyes; then LLVM_LIBS="-lLLVM-`$LLVM_CONFIG --version`" else LLVM_LIBS="`$LLVM_CONFIG --libs engine bitwriter`" + if test "x$enable_opencl" = xyes; then + LLVM_LIBS="${LLVM_LIBS} `llvm-config --libs ipo linker instrumentation`" + fi fi LLVM_LDFLAGS=`$LLVM_CONFIG --ldflags` LLVM_BINDIR=`$LLVM_CONFIG --bindir` LLVM_CXXFLAGS=`$LLVM_CONFIG --cxxflags` + LLVM_CPPFLAGS=`$LLVM_CONFIG --cppflags` LLVM_INCLUDEDIR=`$LLVM_CONFIG --includedir` + LLVM_LIBDIR=`$LLVM_CONFIG --libdir` DEFINES="${DEFINES} -DHAVE_LLVM=`echo $LLVM_VERSION | sed -e 's/\([[0-9]]\)\.\([[0-9]]\)/0x0\10\2/g'`" MESA_LLVM=1 else @@ -1973,13 +1994,18 @@ if test "x$with_gallium_drivers" != x; then PKG_CHECK_MODULES([RADEON], [libdrm_radeon >= $LIBDRM_RADEON_REQUIRED]) gallium_require_drm_loader GALLIUM_DRIVERS_DIRS="$GALLIUM_DRIVERS_DIRS r600" - if test "x$enable_r600_llvm" = xyes; then + if test "x$enable_r600_llvm" = xyes -o "x$enable_opencl" = xyes; then if test "x$LLVM_VERSION" != "x3.1"; then AC_MSG_ERROR([LLVM 3.1 is required for the r600 llvm compiler.]) fi NEED_RADEON_GALLIUM=yes; + fi + if test "x$enable_r600_llvm" = xyes; then USE_R600_LLVM_COMPILER=yes; fi + if test "x$enable_opencl" = xyes -a "x$with_llvm_shared_libs" = xno; then + LLVM_LIBS="${LLVM_LIBS} `llvm-config --libs bitreader asmparser`" + fi gallium_check_st "radeon/drm" "dri-r600" "xorg-r600" "" "xvmc-r600" "vdpau-r600" "va-r600" ;; xradeonsi) @@ -2075,6 +2101,7 @@ AM_CONDITIONAL(NEED_RADEON_GALLIUM, test x$NEED_RADEON_GALLIUM = xyes) AM_CONDITIONAL(USE_R600_LLVM_COMPILER, test x$USE_R600_LLVM_COMPILER = xyes) AM_CONDITIONAL(HAVE_LOADER_GALLIUM, test x$enable_gallium_loader = xyes) AM_CONDITIONAL(HAVE_DRM_LOADER_GALLIUM, test x$enable_gallium_drm_loader = xyes) +AM_CONDITIONAL(HAVE_GALLIUM_COMPUTE, test x$enable_opencl = xyes) AC_SUBST([GALLIUM_MAKE_DIRS]) AM_CONDITIONAL(HAVE_X11_DRIVER, echo "$DRIVER_DIRS" | grep 'x11' >/dev/null 2>&1) diff --git a/mesalib/src/SConscript b/mesalib/src/SConscript index 3d0087887..75c444677 100644 --- a/mesalib/src/SConscript +++ b/mesalib/src/SConscript @@ -16,6 +16,7 @@ if env['hostonly']: # used. libgl-xlib and libgl-gdi adapt themselves to use the targets defined # in mapi/glapi-shared/SConscript. mesa/SConscript also adapts itself to # enable OpenGL ES support. +SConscript('mapi/glapi/gen/SConscript') SConscript('mapi/glapi/SConscript') SConscript('mesa/SConscript') diff --git a/mesalib/src/glsl/ast_to_hir.cpp b/mesalib/src/glsl/ast_to_hir.cpp index e23718bdb..15aa88ea9 100644 --- a/mesalib/src/glsl/ast_to_hir.cpp +++ b/mesalib/src/glsl/ast_to_hir.cpp @@ -3733,13 +3733,10 @@ ast_case_label::hir(exec_list *instructions, instructions->push_tail(set_fallthru_on_test); } else { /* default case */ if (state->switch_state.previous_default) { - printf("a\n"); YYLTYPE loc = this->get_location(); _mesa_glsl_error(& loc, state, "multiple default labels in one switch"); - printf("b\n"); - loc = state->switch_state.previous_default->get_location(); _mesa_glsl_error(& loc, state, "this is the first default label"); diff --git a/mesalib/src/glsl/ralloc.c b/mesalib/src/glsl/ralloc.c index 2f93dcdea..3da09b559 100644 --- a/mesalib/src/glsl/ralloc.c +++ b/mesalib/src/glsl/ralloc.c @@ -278,7 +278,7 @@ ralloc_parent(const void *ptr) return NULL; info = get_header(ptr); - return PTR_FROM_HEADER(info->parent); + return info->parent ? PTR_FROM_HEADER(info->parent) : NULL; } static void *autofree_context = NULL; diff --git a/mesalib/src/mapi/glapi/SConscript b/mesalib/src/mapi/glapi/SConscript index 4097a7fe1..ad007a6f4 100644 --- a/mesalib/src/mapi/glapi/SConscript +++ b/mesalib/src/mapi/glapi/SConscript @@ -2,6 +2,8 @@ # SConscript for glapi +from sys import executable as python_cmd + Import('*') env = env.Clone() @@ -47,6 +49,8 @@ for s in mapi_sources: # Assembly sources # if env['gcc'] and env['platform'] not in ('darwin', 'windows'): + GLAPI = '#src/mapi/glapi/' + if env['machine'] == 'x86': env.Append(CPPDEFINES = [ 'USE_X86_ASM', @@ -54,6 +58,12 @@ if env['gcc'] and env['platform'] not in ('darwin', 'windows'): glapi_sources += [ 'glapi_x86.S', ] + env.CodeGenerate( + target = 'glapi_x86.S', + script = GLAPI + 'gen/gl_x86_asm.py', + source = GLAPI + 'gen/gl_API.xml', + command = python_cmd + ' $SCRIPT -f $SOURCE > $TARGET' + ) elif env['machine'] == 'x86_64': env.Append(CPPDEFINES = [ 'USE_X86_64_ASM', @@ -61,6 +71,12 @@ if env['gcc'] and env['platform'] not in ('darwin', 'windows'): glapi_sources += [ 'glapi_x86-64.S' ] + env.CodeGenerate( + target = 'glapi_x86-64.S', + script = GLAPI + 'gen/gl_x86-64_asm.py', + source = GLAPI + 'gen/gl_API.xml', + command = python_cmd + ' $SCRIPT -f $SOURCE > $TARGET' + ) elif env['machine'] == 'sparc': env.Append(CPPDEFINES = [ 'USE_SPARC_ASM', @@ -68,6 +84,12 @@ if env['gcc'] and env['platform'] not in ('darwin', 'windows'): glapi_sources += [ 'glapi_sparc.S' ] + env.CodeGenerate( + target = 'glapi_sparc.S', + script = GLAPI + 'gen/gl_SPARC_asm.py', + source = GLAPI + 'gen/gl_API.xml', + command = python_cmd + ' $SCRIPT -f $SOURCE > $TARGET' + ) else: pass @@ -81,3 +103,6 @@ glapi = env.ConvenienceLibrary( source = glapi_sources, ) Export('glapi') + + +env.Depends(glapi_sources, glapi_headers) diff --git a/mesalib/src/mapi/glapi/gen/SConscript b/mesalib/src/mapi/glapi/gen/SConscript new file mode 100644 index 000000000..e8bb22731 --- /dev/null +++ b/mesalib/src/mapi/glapi/gen/SConscript @@ -0,0 +1,49 @@ +Import('*') + +from sys import executable as python_cmd + + +# Generate the GL API headers that are used by various parts of the +# Mesa and GLX tree. Other .c and .h files are generated elsewhere +# if they're only used in one place. + +GLAPI = '#src/mapi/glapi/' + +glapi_headers = [] + +glapi_headers += env.CodeGenerate( + target = '#src/mesa/main/dispatch.h', + script = GLAPI + 'gen/gl_table.py', + source = GLAPI + 'gen/gl_API.xml', + command = python_cmd + ' $SCRIPT -m remap_table -f $SOURCE > $TARGET', + ) + +glapi_headers += env.CodeGenerate( + target = '#src/mapi/glapi/glapitable.h', + script = GLAPI + 'gen/gl_table.py', + source = GLAPI + 'gen/gl_API.xml', + command = python_cmd + ' $SCRIPT -f $SOURCE > $TARGET' + ) + +glapi_headers += env.CodeGenerate( + target = '#src/mapi/glapi/glapitemp.h', + script = GLAPI + 'gen/gl_apitemp.py', + source = GLAPI + 'gen/gl_API.xml', + command = python_cmd + ' $SCRIPT -f $SOURCE > $TARGET' + ) + +glapi_headers += env.CodeGenerate( + target = '#src/mapi/glapi/glprocs.h', + script = GLAPI + 'gen/gl_procs.py', + source = GLAPI + 'gen/gl_API.xml', + command = python_cmd + ' $SCRIPT -f $SOURCE > $TARGET' + ) + +glapi_headers += env.CodeGenerate( + target = '#src/mesa/main/remap_helper.h', + script = GLAPI + 'gen/remap_helper.py', + source = GLAPI + 'gen/gl_API.xml', + command = python_cmd + ' $SCRIPT -f $SOURCE > $TARGET' + ) + +env.Export('glapi_headers') diff --git a/mesalib/src/mesa/Makefile b/mesalib/src/mesa/Makefile index 069527e3a..05aea8d93 100644 --- a/mesalib/src/mesa/Makefile +++ b/mesalib/src/mesa/Makefile @@ -215,6 +215,7 @@ clean: -@cd drivers/osmesa && $(MAKE) clean -@cd x86 && $(MAKE) clean -@cd x86-64 && $(MAKE) clean + -@cd libdricore && $(MAKE) clean -include $(DEPENDS) diff --git a/mesalib/src/mesa/SConscript b/mesalib/src/mesa/SConscript index d7932c7c9..99bdfad46 100644 --- a/mesalib/src/mesa/SConscript +++ b/mesalib/src/mesa/SConscript @@ -6,6 +6,7 @@ Import('*') import filecmp import os import subprocess +from sys import executable as python_cmd env = env.Clone() @@ -328,8 +329,9 @@ mesa_sources = ( statetracker_sources ) +GLAPI = '#src/mapi/glapi/' + if env['gles']: - from sys import executable as python_cmd env.Append(CPPDEFINES = ['FEATURE_ES1=1', 'FEATURE_ES2=1']) @@ -349,7 +351,6 @@ if env['gles']: ) # generate GLES headers - GLAPI = '#src/mapi/glapi/' gles_headers = [] gles_headers += env.CodeGenerate( target = 'main/api_exec_es1_dispatch.h', @@ -452,6 +453,16 @@ if env['gcc'] and env['platform'] not in ('darwin', 'windows'): env.Append(CPPPATH = [matypes[0].dir]) +# The enums.c file is generated from the GL/ES API.xml file +env.CodeGenerate( + target = 'main/enums.c', + script = GLAPI + 'gen/gl_enums.py', + source = GLAPI + 'gen/gl_and_es_API.xml', + command = python_cmd + ' $SCRIPT -f $SOURCE > $TARGET' + ) + +# We also depend on the auto-generated GL API headers +env.Depends(mesa_sources, glapi_headers) def write_git_sha1_h_file(filename): diff --git a/mesalib/src/mesa/drivers/common/meta.c b/mesalib/src/mesa/drivers/common/meta.c index 95336fc28..a20e41972 100644 --- a/mesalib/src/mesa/drivers/common/meta.c +++ b/mesalib/src/mesa/drivers/common/meta.c @@ -1793,7 +1793,7 @@ meta_glsl_clear_init(struct gl_context *ctx, struct clear_state *clear) clear->ColorLocation = _mesa_GetUniformLocationARB(clear->ShaderProg, "color"); - if (ctx->Const.GLSLVersion >= 130) { + if (ctx->API == API_OPENGL && ctx->Const.GLSLVersion >= 130) { vs = compile_shader_with_debug(ctx, GL_VERTEX_SHADER, vs_int_source); fs = compile_shader_with_debug(ctx, GL_FRAGMENT_SHADER, fs_int_source); diff --git a/mesalib/src/mesa/main/attrib.c b/mesalib/src/mesa/main/attrib.c index b114ec941..318d576e8 100644 --- a/mesalib/src/mesa/main/attrib.c +++ b/mesalib/src/mesa/main/attrib.c @@ -799,6 +799,14 @@ pop_texture_group(struct gl_context *ctx, struct texture_state *texstate) _mesa_TexParameterf(target, GL_TEXTURE_COMPARE_FAIL_VALUE_ARB, samp->CompareFailValue); } + if (ctx->Extensions.ARB_shadow) { + _mesa_TexParameteri(target, GL_TEXTURE_COMPARE_MODE, + samp->CompareMode); + _mesa_TexParameteri(target, GL_TEXTURE_COMPARE_FUNC, + samp->CompareFunc); + } + if (ctx->Extensions.ARB_depth_texture) + _mesa_TexParameteri(target, GL_DEPTH_TEXTURE_MODE, samp->DepthMode); } /* remove saved references to the texture objects */ diff --git a/mesalib/src/mesa/state_tracker/st_draw_feedback.c b/mesalib/src/mesa/state_tracker/st_draw_feedback.c index 4209fb214..820918e51 100644 --- a/mesalib/src/mesa/state_tracker/st_draw_feedback.c +++ b/mesalib/src/mesa/state_tracker/st_draw_feedback.c @@ -232,8 +232,9 @@ st_feedback_draw_vbo(struct gl_context *ctx, mapped_indices = ib->ptr; } - draw_set_index_buffer(draw, &ibuffer); - draw_set_mapped_index_buffer(draw, mapped_indices); + draw_set_indexes(draw, + (ubyte *) mapped_indices + ibuffer.offset, + ibuffer.index_size); } /* set the constant buffer */ @@ -252,9 +253,7 @@ st_feedback_draw_vbo(struct gl_context *ctx, * unmap vertex/index buffers */ if (ib) { - draw_set_mapped_index_buffer(draw, NULL); - draw_set_index_buffer(draw, NULL); - + draw_set_indexes(draw, NULL, 0); if (ib_transfer) pipe_buffer_unmap(pipe, ib_transfer); pipe_resource_reference(&ibuffer.buffer, NULL); diff --git a/mesalib/src/mesa/state_tracker/st_glsl_to_tgsi.cpp b/mesalib/src/mesa/state_tracker/st_glsl_to_tgsi.cpp index 60a4e2831..e8d60f80d 100644 --- a/mesalib/src/mesa/state_tracker/st_glsl_to_tgsi.cpp +++ b/mesalib/src/mesa/state_tracker/st_glsl_to_tgsi.cpp @@ -2810,8 +2810,12 @@ glsl_to_tgsi_visitor::glsl_to_tgsi_visitor() num_immediates = 0; current_function = NULL; num_address_regs = 0; + samplers_used = 0; indirect_addr_temps = false; indirect_addr_consts = false; + num_clip_distances = 0; + glsl_version = 0; + native_integers = false; mem_ctx = ralloc_context(NULL); ctx = NULL; prog = NULL; diff --git a/pixman/pixman/pixman-bits-image.c b/pixman/pixman/pixman-bits-image.c index 1f6897c2c..3ba6739d1 100644 --- a/pixman/pixman/pixman-bits-image.c +++ b/pixman/pixman/pixman-bits-image.c @@ -1248,7 +1248,7 @@ src_get_scanline_wide (pixman_iter_t *iter, const uint32_t *mask) void _pixman_bits_image_src_iter_init (pixman_image_t *image, pixman_iter_t *iter) { - if (iter->flags & ITER_NARROW) + if (iter->iter_flags & ITER_NARROW) iter->get_scanline = src_get_scanline_narrow; else iter->get_scanline = src_get_scanline_wide; @@ -1380,9 +1380,9 @@ dest_write_back_wide (pixman_iter_t *iter) void _pixman_bits_image_dest_iter_init (pixman_image_t *image, pixman_iter_t *iter) { - if (iter->flags & ITER_NARROW) + if (iter->iter_flags & ITER_NARROW) { - if ((iter->flags & (ITER_IGNORE_RGB | ITER_IGNORE_ALPHA)) == + if ((iter->iter_flags & (ITER_IGNORE_RGB | ITER_IGNORE_ALPHA)) == (ITER_IGNORE_RGB | ITER_IGNORE_ALPHA)) { iter->get_scanline = _pixman_iter_get_scanline_noop; diff --git a/pixman/pixman/pixman-conical-gradient.c b/pixman/pixman/pixman-conical-gradient.c index e3f230262..8b52176e4 100644 --- a/pixman/pixman/pixman-conical-gradient.c +++ b/pixman/pixman/pixman-conical-gradient.c @@ -1,211 +1,211 @@ -/*
- * Copyright © 2000 SuSE, Inc.
- * Copyright © 2007 Red Hat, Inc.
- * Copyright © 2000 Keith Packard, member of The XFree86 Project, Inc.
- * 2005 Lars Knoll & Zack Rusin, Trolltech
- *
- * Permission to use, copy, modify, distribute, and sell this software and its
- * documentation for any purpose is hereby granted without fee, provided that
- * the above copyright notice appear in all copies and that both that
- * copyright notice and this permission notice appear in supporting
- * documentation, and that the name of Keith Packard not be used in
- * advertising or publicity pertaining to distribution of the software without
- * specific, written prior permission. Keith Packard makes no
- * representations about the suitability of this software for any purpose. It
- * is provided "as is" without express or implied warranty.
- *
- * THE COPYRIGHT HOLDERS DISCLAIM ALL WARRANTIES WITH REGARD TO THIS
- * SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND
- * FITNESS, IN NO EVENT SHALL THE COPYRIGHT HOLDERS BE LIABLE FOR ANY
- * SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
- * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN
- * AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING
- * OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
- * SOFTWARE.
- */
-
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
-
-#include <stdlib.h>
-#include <math.h>
-#include "pixman-private.h"
-
-static force_inline double
-coordinates_to_parameter (double x, double y, double angle)
-{
- double t;
-
- t = atan2 (y, x) + angle;
-
- while (t < 0)
- t += 2 * M_PI;
-
- while (t >= 2 * M_PI)
- t -= 2 * M_PI;
-
- return 1 - t * (1 / (2 * M_PI)); /* Scale t to [0, 1] and
- * make rotation CCW
- */
-}
-
-static uint32_t *
-conical_get_scanline_narrow (pixman_iter_t *iter, const uint32_t *mask)
-{
- pixman_image_t *image = iter->image;
- int x = iter->x;
- int y = iter->y;
- int width = iter->width;
- uint32_t *buffer = iter->buffer;
-
- gradient_t *gradient = (gradient_t *)image;
- conical_gradient_t *conical = (conical_gradient_t *)image;
- uint32_t *end = buffer + width;
- pixman_gradient_walker_t walker;
- pixman_bool_t affine = TRUE;
- double cx = 1.;
- double cy = 0.;
- double cz = 0.;
- double rx = x + 0.5;
- double ry = y + 0.5;
- double rz = 1.;
-
- _pixman_gradient_walker_init (&walker, gradient, image->common.repeat);
-
- if (image->common.transform)
- {
- pixman_vector_t v;
-
- /* reference point is the center of the pixel */
- v.vector[0] = pixman_int_to_fixed (x) + pixman_fixed_1 / 2;
- v.vector[1] = pixman_int_to_fixed (y) + pixman_fixed_1 / 2;
- v.vector[2] = pixman_fixed_1;
-
- if (!pixman_transform_point_3d (image->common.transform, &v))
- return iter->buffer;
-
- cx = image->common.transform->matrix[0][0] / 65536.;
- cy = image->common.transform->matrix[1][0] / 65536.;
- cz = image->common.transform->matrix[2][0] / 65536.;
-
- rx = v.vector[0] / 65536.;
- ry = v.vector[1] / 65536.;
- rz = v.vector[2] / 65536.;
-
- affine =
- image->common.transform->matrix[2][0] == 0 &&
- v.vector[2] == pixman_fixed_1;
- }
-
- if (affine)
- {
- rx -= conical->center.x / 65536.;
- ry -= conical->center.y / 65536.;
-
- while (buffer < end)
- {
- if (!mask || *mask++)
- {
- double t = coordinates_to_parameter (rx, ry, conical->angle);
-
- *buffer = _pixman_gradient_walker_pixel (
- &walker, (pixman_fixed_48_16_t)pixman_double_to_fixed (t));
- }
-
- ++buffer;
-
- rx += cx;
- ry += cy;
- }
- }
- else
- {
- while (buffer < end)
- {
- double x, y;
-
- if (!mask || *mask++)
- {
- double t;
-
- if (rz != 0)
- {
- x = rx / rz;
- y = ry / rz;
- }
- else
- {
- x = y = 0.;
- }
-
- x -= conical->center.x / 65536.;
- y -= conical->center.y / 65536.;
-
- t = coordinates_to_parameter (x, y, conical->angle);
-
- *buffer = _pixman_gradient_walker_pixel (
- &walker, (pixman_fixed_48_16_t)pixman_double_to_fixed (t));
- }
-
- ++buffer;
-
- rx += cx;
- ry += cy;
- rz += cz;
- }
- }
-
- iter->y++;
- return iter->buffer;
-}
-
-static uint32_t *
-conical_get_scanline_wide (pixman_iter_t *iter, const uint32_t *mask)
-{
- uint32_t *buffer = conical_get_scanline_narrow (iter, NULL);
-
- pixman_expand ((uint64_t *)buffer, buffer, PIXMAN_a8r8g8b8, iter->width);
-
- return buffer;
-}
-
-void
-_pixman_conical_gradient_iter_init (pixman_image_t *image, pixman_iter_t *iter)
-{
- if (iter->flags & ITER_NARROW)
- iter->get_scanline = conical_get_scanline_narrow;
- else
- iter->get_scanline = conical_get_scanline_wide;
-}
-
-PIXMAN_EXPORT pixman_image_t *
-pixman_image_create_conical_gradient (pixman_point_fixed_t * center,
- pixman_fixed_t angle,
- const pixman_gradient_stop_t *stops,
- int n_stops)
-{
- pixman_image_t *image = _pixman_image_allocate ();
- conical_gradient_t *conical;
-
- if (!image)
- return NULL;
-
- conical = &image->conical;
-
- if (!_pixman_init_gradient (&conical->common, stops, n_stops))
- {
- free (image);
- return NULL;
- }
-
- angle = MOD (angle, pixman_int_to_fixed (360));
-
- image->type = CONICAL;
-
- conical->center = *center;
- conical->angle = (pixman_fixed_to_double (angle) / 180.0) * M_PI;
-
- return image;
-}
-
+/* + * Copyright © 2000 SuSE, Inc. + * Copyright © 2007 Red Hat, Inc. + * Copyright © 2000 Keith Packard, member of The XFree86 Project, Inc. + * 2005 Lars Knoll & Zack Rusin, Trolltech + * + * Permission to use, copy, modify, distribute, and sell this software and its + * documentation for any purpose is hereby granted without fee, provided that + * the above copyright notice appear in all copies and that both that + * copyright notice and this permission notice appear in supporting + * documentation, and that the name of Keith Packard not be used in + * advertising or publicity pertaining to distribution of the software without + * specific, written prior permission. Keith Packard makes no + * representations about the suitability of this software for any purpose. It + * is provided "as is" without express or implied warranty. + * + * THE COPYRIGHT HOLDERS DISCLAIM ALL WARRANTIES WITH REGARD TO THIS + * SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS, IN NO EVENT SHALL THE COPYRIGHT HOLDERS BE LIABLE FOR ANY + * SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES + * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN + * AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING + * OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS + * SOFTWARE. + */ + +#ifdef HAVE_CONFIG_H +#include <config.h> +#endif + +#include <stdlib.h> +#include <math.h> +#include "pixman-private.h" + +static force_inline double +coordinates_to_parameter (double x, double y, double angle) +{ + double t; + + t = atan2 (y, x) + angle; + + while (t < 0) + t += 2 * M_PI; + + while (t >= 2 * M_PI) + t -= 2 * M_PI; + + return 1 - t * (1 / (2 * M_PI)); /* Scale t to [0, 1] and + * make rotation CCW + */ +} + +static uint32_t * +conical_get_scanline_narrow (pixman_iter_t *iter, const uint32_t *mask) +{ + pixman_image_t *image = iter->image; + int x = iter->x; + int y = iter->y; + int width = iter->width; + uint32_t *buffer = iter->buffer; + + gradient_t *gradient = (gradient_t *)image; + conical_gradient_t *conical = (conical_gradient_t *)image; + uint32_t *end = buffer + width; + pixman_gradient_walker_t walker; + pixman_bool_t affine = TRUE; + double cx = 1.; + double cy = 0.; + double cz = 0.; + double rx = x + 0.5; + double ry = y + 0.5; + double rz = 1.; + + _pixman_gradient_walker_init (&walker, gradient, image->common.repeat); + + if (image->common.transform) + { + pixman_vector_t v; + + /* reference point is the center of the pixel */ + v.vector[0] = pixman_int_to_fixed (x) + pixman_fixed_1 / 2; + v.vector[1] = pixman_int_to_fixed (y) + pixman_fixed_1 / 2; + v.vector[2] = pixman_fixed_1; + + if (!pixman_transform_point_3d (image->common.transform, &v)) + return iter->buffer; + + cx = image->common.transform->matrix[0][0] / 65536.; + cy = image->common.transform->matrix[1][0] / 65536.; + cz = image->common.transform->matrix[2][0] / 65536.; + + rx = v.vector[0] / 65536.; + ry = v.vector[1] / 65536.; + rz = v.vector[2] / 65536.; + + affine = + image->common.transform->matrix[2][0] == 0 && + v.vector[2] == pixman_fixed_1; + } + + if (affine) + { + rx -= conical->center.x / 65536.; + ry -= conical->center.y / 65536.; + + while (buffer < end) + { + if (!mask || *mask++) + { + double t = coordinates_to_parameter (rx, ry, conical->angle); + + *buffer = _pixman_gradient_walker_pixel ( + &walker, (pixman_fixed_48_16_t)pixman_double_to_fixed (t)); + } + + ++buffer; + + rx += cx; + ry += cy; + } + } + else + { + while (buffer < end) + { + double x, y; + + if (!mask || *mask++) + { + double t; + + if (rz != 0) + { + x = rx / rz; + y = ry / rz; + } + else + { + x = y = 0.; + } + + x -= conical->center.x / 65536.; + y -= conical->center.y / 65536.; + + t = coordinates_to_parameter (x, y, conical->angle); + + *buffer = _pixman_gradient_walker_pixel ( + &walker, (pixman_fixed_48_16_t)pixman_double_to_fixed (t)); + } + + ++buffer; + + rx += cx; + ry += cy; + rz += cz; + } + } + + iter->y++; + return iter->buffer; +} + +static uint32_t * +conical_get_scanline_wide (pixman_iter_t *iter, const uint32_t *mask) +{ + uint32_t *buffer = conical_get_scanline_narrow (iter, NULL); + + pixman_expand ((uint64_t *)buffer, buffer, PIXMAN_a8r8g8b8, iter->width); + + return buffer; +} + +void +_pixman_conical_gradient_iter_init (pixman_image_t *image, pixman_iter_t *iter) +{ + if (iter->iter_flags & ITER_NARROW) + iter->get_scanline = conical_get_scanline_narrow; + else + iter->get_scanline = conical_get_scanline_wide; +} + +PIXMAN_EXPORT pixman_image_t * +pixman_image_create_conical_gradient (pixman_point_fixed_t * center, + pixman_fixed_t angle, + const pixman_gradient_stop_t *stops, + int n_stops) +{ + pixman_image_t *image = _pixman_image_allocate (); + conical_gradient_t *conical; + + if (!image) + return NULL; + + conical = &image->conical; + + if (!_pixman_init_gradient (&conical->common, stops, n_stops)) + { + free (image); + return NULL; + } + + angle = MOD (angle, pixman_int_to_fixed (360)); + + image->type = CONICAL; + + conical->center = *center; + conical->angle = (pixman_fixed_to_double (angle) / 180.0) * M_PI; + + return image; +} + diff --git a/pixman/pixman/pixman-general.c b/pixman/pixman/pixman-general.c index 27fa3abe5..d4b2daa37 100644 --- a/pixman/pixman/pixman-general.c +++ b/pixman/pixman/pixman-general.c @@ -110,7 +110,7 @@ general_composite_rect (pixman_implementation_t *imp, pixman_iter_t src_iter, mask_iter, dest_iter; pixman_combine_32_func_t compose; pixman_bool_t component_alpha; - iter_flags_t narrow, src_flags; + iter_flags_t narrow, src_iter_flags; int Bpp; int i; @@ -140,14 +140,14 @@ general_composite_rect (pixman_implementation_t *imp, dest_buffer = mask_buffer + width * Bpp; /* src iter */ - src_flags = narrow | op_flags[op].src; + src_iter_flags = narrow | op_flags[op].src; _pixman_implementation_src_iter_init (imp->toplevel, &src_iter, src_image, src_x, src_y, width, height, - src_buffer, src_flags); + src_buffer, src_iter_flags, info->src_flags); /* mask iter */ - if ((src_flags & (ITER_IGNORE_ALPHA | ITER_IGNORE_RGB)) == + if ((src_iter_flags & (ITER_IGNORE_ALPHA | ITER_IGNORE_RGB)) == (ITER_IGNORE_ALPHA | ITER_IGNORE_RGB)) { /* If it doesn't matter what the source is, then it doesn't matter @@ -164,12 +164,12 @@ general_composite_rect (pixman_implementation_t *imp, _pixman_implementation_src_iter_init ( imp->toplevel, &mask_iter, mask_image, mask_x, mask_y, width, height, - mask_buffer, narrow | (component_alpha? 0 : ITER_IGNORE_RGB)); + mask_buffer, narrow | (component_alpha? 0 : ITER_IGNORE_RGB), info->mask_flags); /* dest iter */ _pixman_implementation_dest_iter_init ( imp->toplevel, &dest_iter, dest_image, dest_x, dest_y, width, height, - dest_buffer, narrow | op_flags[op].dst); + dest_buffer, narrow | op_flags[op].dst, info->dest_flags); compose = _pixman_implementation_lookup_combiner ( imp->toplevel, op, component_alpha, narrow); diff --git a/pixman/pixman/pixman-image.c b/pixman/pixman/pixman-image.c index 8599a1eb1..6a965e462 100644 --- a/pixman/pixman/pixman-image.c +++ b/pixman/pixman/pixman-image.c @@ -883,7 +883,7 @@ _pixman_image_get_solid (pixman_implementation_t *imp, _pixman_implementation_src_iter_init ( imp, &iter, image, 0, 0, 1, 1, - (uint8_t *)&result, ITER_NARROW); + (uint8_t *)&result, ITER_NARROW, image->common.flags); result = *iter.get_scanline (&iter, NULL); diff --git a/pixman/pixman/pixman-implementation.c b/pixman/pixman/pixman-implementation.c index b0a295939..c769ab8cb 100644 --- a/pixman/pixman/pixman-implementation.c +++ b/pixman/pixman/pixman-implementation.c @@ -185,7 +185,8 @@ _pixman_implementation_src_iter_init (pixman_implementation_t *imp, int width, int height, uint8_t *buffer, - iter_flags_t flags) + iter_flags_t iter_flags, + uint32_t image_flags) { iter->image = image; iter->buffer = (uint32_t *)buffer; @@ -193,7 +194,8 @@ _pixman_implementation_src_iter_init (pixman_implementation_t *imp, iter->y = y; iter->width = width; iter->height = height; - iter->flags = flags; + iter->iter_flags = iter_flags; + iter->image_flags = image_flags; (*imp->src_iter_init) (imp, iter); } @@ -207,7 +209,8 @@ _pixman_implementation_dest_iter_init (pixman_implementation_t *imp, int width, int height, uint8_t *buffer, - iter_flags_t flags) + iter_flags_t iter_flags, + uint32_t image_flags) { iter->image = image; iter->buffer = (uint32_t *)buffer; @@ -215,7 +218,8 @@ _pixman_implementation_dest_iter_init (pixman_implementation_t *imp, iter->y = y; iter->width = width; iter->height = height; - iter->flags = flags; + iter->iter_flags = iter_flags; + iter->image_flags = image_flags; (*imp->dest_iter_init) (imp, iter); } diff --git a/pixman/pixman/pixman-linear-gradient.c b/pixman/pixman/pixman-linear-gradient.c index 3d5bbf63d..32b8ba786 100644 --- a/pixman/pixman/pixman-linear-gradient.c +++ b/pixman/pixman/pixman-linear-gradient.c @@ -1,286 +1,286 @@ -/* -*- Mode: c; c-basic-offset: 4; tab-width: 8; indent-tabs-mode: t; -*- */
-/*
- * Copyright © 2000 SuSE, Inc.
- * Copyright © 2007 Red Hat, Inc.
- * Copyright © 2000 Keith Packard, member of The XFree86 Project, Inc.
- * 2005 Lars Knoll & Zack Rusin, Trolltech
- *
- * Permission to use, copy, modify, distribute, and sell this software and its
- * documentation for any purpose is hereby granted without fee, provided that
- * the above copyright notice appear in all copies and that both that
- * copyright notice and this permission notice appear in supporting
- * documentation, and that the name of Keith Packard not be used in
- * advertising or publicity pertaining to distribution of the software without
- * specific, written prior permission. Keith Packard makes no
- * representations about the suitability of this software for any purpose. It
- * is provided "as is" without express or implied warranty.
- *
- * THE COPYRIGHT HOLDERS DISCLAIM ALL WARRANTIES WITH REGARD TO THIS
- * SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND
- * FITNESS, IN NO EVENT SHALL THE COPYRIGHT HOLDERS BE LIABLE FOR ANY
- * SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
- * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN
- * AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING
- * OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
- * SOFTWARE.
- */
-
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
-#include <stdlib.h>
-#include "pixman-private.h"
-
-static pixman_bool_t
-linear_gradient_is_horizontal (pixman_image_t *image,
- int x,
- int y,
- int width,
- int height)
-{
- linear_gradient_t *linear = (linear_gradient_t *)image;
- pixman_vector_t v;
- pixman_fixed_32_32_t l;
- pixman_fixed_48_16_t dx, dy;
- double inc;
-
- if (image->common.transform)
- {
- /* projective transformation */
- if (image->common.transform->matrix[2][0] != 0 ||
- image->common.transform->matrix[2][1] != 0 ||
- image->common.transform->matrix[2][2] == 0)
- {
- return FALSE;
- }
-
- v.vector[0] = image->common.transform->matrix[0][1];
- v.vector[1] = image->common.transform->matrix[1][1];
- v.vector[2] = image->common.transform->matrix[2][2];
- }
- else
- {
- v.vector[0] = 0;
- v.vector[1] = pixman_fixed_1;
- v.vector[2] = pixman_fixed_1;
- }
-
- dx = linear->p2.x - linear->p1.x;
- dy = linear->p2.y - linear->p1.y;
-
- l = dx * dx + dy * dy;
-
- if (l == 0)
- return FALSE;
-
- /*
- * compute how much the input of the gradient walked changes
- * when moving vertically through the whole image
- */
- inc = height * (double) pixman_fixed_1 * pixman_fixed_1 *
- (dx * v.vector[0] + dy * v.vector[1]) /
- (v.vector[2] * (double) l);
-
- /* check that casting to integer would result in 0 */
- if (-1 < inc && inc < 1)
- return TRUE;
-
- return FALSE;
-}
-
-static uint32_t *
-linear_get_scanline_narrow (pixman_iter_t *iter,
- const uint32_t *mask)
-{
- pixman_image_t *image = iter->image;
- int x = iter->x;
- int y = iter->y;
- int width = iter->width;
- uint32_t * buffer = iter->buffer;
-
- pixman_vector_t v, unit;
- pixman_fixed_32_32_t l;
- pixman_fixed_48_16_t dx, dy;
- gradient_t *gradient = (gradient_t *)image;
- linear_gradient_t *linear = (linear_gradient_t *)image;
- uint32_t *end = buffer + width;
- pixman_gradient_walker_t walker;
-
- _pixman_gradient_walker_init (&walker, gradient, image->common.repeat);
-
- /* reference point is the center of the pixel */
- v.vector[0] = pixman_int_to_fixed (x) + pixman_fixed_1 / 2;
- v.vector[1] = pixman_int_to_fixed (y) + pixman_fixed_1 / 2;
- v.vector[2] = pixman_fixed_1;
-
- if (image->common.transform)
- {
- if (!pixman_transform_point_3d (image->common.transform, &v))
- return iter->buffer;
-
- unit.vector[0] = image->common.transform->matrix[0][0];
- unit.vector[1] = image->common.transform->matrix[1][0];
- unit.vector[2] = image->common.transform->matrix[2][0];
- }
- else
- {
- unit.vector[0] = pixman_fixed_1;
- unit.vector[1] = 0;
- unit.vector[2] = 0;
- }
-
- dx = linear->p2.x - linear->p1.x;
- dy = linear->p2.y - linear->p1.y;
-
- l = dx * dx + dy * dy;
-
- if (l == 0 || unit.vector[2] == 0)
- {
- /* affine transformation only */
- pixman_fixed_32_32_t t, next_inc;
- double inc;
-
- if (l == 0 || v.vector[2] == 0)
- {
- t = 0;
- inc = 0;
- }
- else
- {
- double invden, v2;
-
- invden = pixman_fixed_1 * (double) pixman_fixed_1 /
- (l * (double) v.vector[2]);
- v2 = v.vector[2] * (1. / pixman_fixed_1);
- t = ((dx * v.vector[0] + dy * v.vector[1]) -
- (dx * linear->p1.x + dy * linear->p1.y) * v2) * invden;
- inc = (dx * unit.vector[0] + dy * unit.vector[1]) * invden;
- }
- next_inc = 0;
-
- if (((pixman_fixed_32_32_t )(inc * width)) == 0)
- {
- register uint32_t color;
-
- color = _pixman_gradient_walker_pixel (&walker, t);
- while (buffer < end)
- *buffer++ = color;
- }
- else
- {
- int i;
-
- i = 0;
- while (buffer < end)
- {
- if (!mask || *mask++)
- {
- *buffer = _pixman_gradient_walker_pixel (&walker,
- t + next_inc);
- }
- i++;
- next_inc = inc * i;
- buffer++;
- }
- }
- }
- else
- {
- /* projective transformation */
- double t;
-
- t = 0;
-
- while (buffer < end)
- {
- if (!mask || *mask++)
- {
- if (v.vector[2] != 0)
- {
- double invden, v2;
-
- invden = pixman_fixed_1 * (double) pixman_fixed_1 /
- (l * (double) v.vector[2]);
- v2 = v.vector[2] * (1. / pixman_fixed_1);
- t = ((dx * v.vector[0] + dy * v.vector[1]) -
- (dx * linear->p1.x + dy * linear->p1.y) * v2) * invden;
- }
-
- *buffer = _pixman_gradient_walker_pixel (&walker, t);
- }
-
- ++buffer;
-
- v.vector[0] += unit.vector[0];
- v.vector[1] += unit.vector[1];
- v.vector[2] += unit.vector[2];
- }
- }
-
- iter->y++;
-
- return iter->buffer;
-}
-
-static uint32_t *
-linear_get_scanline_wide (pixman_iter_t *iter, const uint32_t *mask)
-{
- uint32_t *buffer = linear_get_scanline_narrow (iter, NULL);
-
- pixman_expand ((uint64_t *)buffer, buffer, PIXMAN_a8r8g8b8, iter->width);
-
- return buffer;
-}
-
-void
-_pixman_linear_gradient_iter_init (pixman_image_t *image, pixman_iter_t *iter)
-{
- if (linear_gradient_is_horizontal (
- iter->image, iter->x, iter->y, iter->width, iter->height))
- {
- if (iter->flags & ITER_NARROW)
- linear_get_scanline_narrow (iter, NULL);
- else
- linear_get_scanline_wide (iter, NULL);
-
- iter->get_scanline = _pixman_iter_get_scanline_noop;
- }
- else
- {
- if (iter->flags & ITER_NARROW)
- iter->get_scanline = linear_get_scanline_narrow;
- else
- iter->get_scanline = linear_get_scanline_wide;
- }
-}
-
-PIXMAN_EXPORT pixman_image_t *
-pixman_image_create_linear_gradient (pixman_point_fixed_t * p1,
- pixman_point_fixed_t * p2,
- const pixman_gradient_stop_t *stops,
- int n_stops)
-{
- pixman_image_t *image;
- linear_gradient_t *linear;
-
- image = _pixman_image_allocate ();
-
- if (!image)
- return NULL;
-
- linear = &image->linear;
-
- if (!_pixman_init_gradient (&linear->common, stops, n_stops))
- {
- free (image);
- return NULL;
- }
-
- linear->p1 = *p1;
- linear->p2 = *p2;
-
- image->type = LINEAR;
-
- return image;
-}
-
+/* -*- Mode: c; c-basic-offset: 4; tab-width: 8; indent-tabs-mode: t; -*- */ +/* + * Copyright © 2000 SuSE, Inc. + * Copyright © 2007 Red Hat, Inc. + * Copyright © 2000 Keith Packard, member of The XFree86 Project, Inc. + * 2005 Lars Knoll & Zack Rusin, Trolltech + * + * Permission to use, copy, modify, distribute, and sell this software and its + * documentation for any purpose is hereby granted without fee, provided that + * the above copyright notice appear in all copies and that both that + * copyright notice and this permission notice appear in supporting + * documentation, and that the name of Keith Packard not be used in + * advertising or publicity pertaining to distribution of the software without + * specific, written prior permission. Keith Packard makes no + * representations about the suitability of this software for any purpose. It + * is provided "as is" without express or implied warranty. + * + * THE COPYRIGHT HOLDERS DISCLAIM ALL WARRANTIES WITH REGARD TO THIS + * SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS, IN NO EVENT SHALL THE COPYRIGHT HOLDERS BE LIABLE FOR ANY + * SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES + * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN + * AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING + * OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS + * SOFTWARE. + */ + +#ifdef HAVE_CONFIG_H +#include <config.h> +#endif +#include <stdlib.h> +#include "pixman-private.h" + +static pixman_bool_t +linear_gradient_is_horizontal (pixman_image_t *image, + int x, + int y, + int width, + int height) +{ + linear_gradient_t *linear = (linear_gradient_t *)image; + pixman_vector_t v; + pixman_fixed_32_32_t l; + pixman_fixed_48_16_t dx, dy; + double inc; + + if (image->common.transform) + { + /* projective transformation */ + if (image->common.transform->matrix[2][0] != 0 || + image->common.transform->matrix[2][1] != 0 || + image->common.transform->matrix[2][2] == 0) + { + return FALSE; + } + + v.vector[0] = image->common.transform->matrix[0][1]; + v.vector[1] = image->common.transform->matrix[1][1]; + v.vector[2] = image->common.transform->matrix[2][2]; + } + else + { + v.vector[0] = 0; + v.vector[1] = pixman_fixed_1; + v.vector[2] = pixman_fixed_1; + } + + dx = linear->p2.x - linear->p1.x; + dy = linear->p2.y - linear->p1.y; + + l = dx * dx + dy * dy; + + if (l == 0) + return FALSE; + + /* + * compute how much the input of the gradient walked changes + * when moving vertically through the whole image + */ + inc = height * (double) pixman_fixed_1 * pixman_fixed_1 * + (dx * v.vector[0] + dy * v.vector[1]) / + (v.vector[2] * (double) l); + + /* check that casting to integer would result in 0 */ + if (-1 < inc && inc < 1) + return TRUE; + + return FALSE; +} + +static uint32_t * +linear_get_scanline_narrow (pixman_iter_t *iter, + const uint32_t *mask) +{ + pixman_image_t *image = iter->image; + int x = iter->x; + int y = iter->y; + int width = iter->width; + uint32_t * buffer = iter->buffer; + + pixman_vector_t v, unit; + pixman_fixed_32_32_t l; + pixman_fixed_48_16_t dx, dy; + gradient_t *gradient = (gradient_t *)image; + linear_gradient_t *linear = (linear_gradient_t *)image; + uint32_t *end = buffer + width; + pixman_gradient_walker_t walker; + + _pixman_gradient_walker_init (&walker, gradient, image->common.repeat); + + /* reference point is the center of the pixel */ + v.vector[0] = pixman_int_to_fixed (x) + pixman_fixed_1 / 2; + v.vector[1] = pixman_int_to_fixed (y) + pixman_fixed_1 / 2; + v.vector[2] = pixman_fixed_1; + + if (image->common.transform) + { + if (!pixman_transform_point_3d (image->common.transform, &v)) + return iter->buffer; + + unit.vector[0] = image->common.transform->matrix[0][0]; + unit.vector[1] = image->common.transform->matrix[1][0]; + unit.vector[2] = image->common.transform->matrix[2][0]; + } + else + { + unit.vector[0] = pixman_fixed_1; + unit.vector[1] = 0; + unit.vector[2] = 0; + } + + dx = linear->p2.x - linear->p1.x; + dy = linear->p2.y - linear->p1.y; + + l = dx * dx + dy * dy; + + if (l == 0 || unit.vector[2] == 0) + { + /* affine transformation only */ + pixman_fixed_32_32_t t, next_inc; + double inc; + + if (l == 0 || v.vector[2] == 0) + { + t = 0; + inc = 0; + } + else + { + double invden, v2; + + invden = pixman_fixed_1 * (double) pixman_fixed_1 / + (l * (double) v.vector[2]); + v2 = v.vector[2] * (1. / pixman_fixed_1); + t = ((dx * v.vector[0] + dy * v.vector[1]) - + (dx * linear->p1.x + dy * linear->p1.y) * v2) * invden; + inc = (dx * unit.vector[0] + dy * unit.vector[1]) * invden; + } + next_inc = 0; + + if (((pixman_fixed_32_32_t )(inc * width)) == 0) + { + register uint32_t color; + + color = _pixman_gradient_walker_pixel (&walker, t); + while (buffer < end) + *buffer++ = color; + } + else + { + int i; + + i = 0; + while (buffer < end) + { + if (!mask || *mask++) + { + *buffer = _pixman_gradient_walker_pixel (&walker, + t + next_inc); + } + i++; + next_inc = inc * i; + buffer++; + } + } + } + else + { + /* projective transformation */ + double t; + + t = 0; + + while (buffer < end) + { + if (!mask || *mask++) + { + if (v.vector[2] != 0) + { + double invden, v2; + + invden = pixman_fixed_1 * (double) pixman_fixed_1 / + (l * (double) v.vector[2]); + v2 = v.vector[2] * (1. / pixman_fixed_1); + t = ((dx * v.vector[0] + dy * v.vector[1]) - + (dx * linear->p1.x + dy * linear->p1.y) * v2) * invden; + } + + *buffer = _pixman_gradient_walker_pixel (&walker, t); + } + + ++buffer; + + v.vector[0] += unit.vector[0]; + v.vector[1] += unit.vector[1]; + v.vector[2] += unit.vector[2]; + } + } + + iter->y++; + + return iter->buffer; +} + +static uint32_t * +linear_get_scanline_wide (pixman_iter_t *iter, const uint32_t *mask) +{ + uint32_t *buffer = linear_get_scanline_narrow (iter, NULL); + + pixman_expand ((uint64_t *)buffer, buffer, PIXMAN_a8r8g8b8, iter->width); + + return buffer; +} + +void +_pixman_linear_gradient_iter_init (pixman_image_t *image, pixman_iter_t *iter) +{ + if (linear_gradient_is_horizontal ( + iter->image, iter->x, iter->y, iter->width, iter->height)) + { + if (iter->iter_flags & ITER_NARROW) + linear_get_scanline_narrow (iter, NULL); + else + linear_get_scanline_wide (iter, NULL); + + iter->get_scanline = _pixman_iter_get_scanline_noop; + } + else + { + if (iter->iter_flags & ITER_NARROW) + iter->get_scanline = linear_get_scanline_narrow; + else + iter->get_scanline = linear_get_scanline_wide; + } +} + +PIXMAN_EXPORT pixman_image_t * +pixman_image_create_linear_gradient (pixman_point_fixed_t * p1, + pixman_point_fixed_t * p2, + const pixman_gradient_stop_t *stops, + int n_stops) +{ + pixman_image_t *image; + linear_gradient_t *linear; + + image = _pixman_image_allocate (); + + if (!image) + return NULL; + + linear = &image->linear; + + if (!_pixman_init_gradient (&linear->common, stops, n_stops)) + { + free (image); + return NULL; + } + + linear->p1 = *p1; + linear->p2 = *p2; + + image->type = LINEAR; + + return image; +} + diff --git a/pixman/pixman/pixman-mmx.c b/pixman/pixman/pixman-mmx.c index 096793b89..7c1f4fe24 100644 --- a/pixman/pixman/pixman-mmx.c +++ b/pixman/pixman/pixman-mmx.c @@ -3682,19 +3682,13 @@ static void mmx_src_iter_init (pixman_implementation_t *imp, pixman_iter_t *iter) { pixman_image_t *image = iter->image; - int x = iter->x; - int y = iter->y; - int width = iter->width; - int height = iter->height; #define FLAGS \ - (FAST_PATH_STANDARD_FLAGS | FAST_PATH_ID_TRANSFORM | FAST_PATH_BITS_IMAGE) + (FAST_PATH_STANDARD_FLAGS | FAST_PATH_ID_TRANSFORM | \ + FAST_PATH_BITS_IMAGE | FAST_PATH_SAMPLES_COVER_CLIP_NEAREST) - if ((iter->flags & ITER_NARROW) && - (image->common.flags & FLAGS) == FLAGS && - x >= 0 && y >= 0 && - x + width <= image->bits.width && - y + height <= image->bits.height) + if ((iter->iter_flags & ITER_NARROW) && + (iter->image_flags & FLAGS) == FLAGS) { const fetcher_info_t *f; @@ -3705,7 +3699,7 @@ mmx_src_iter_init (pixman_implementation_t *imp, pixman_iter_t *iter) uint8_t *b = (uint8_t *)image->bits.bits; int s = image->bits.rowstride * 4; - iter->bits = b + s * iter->y + x * PIXMAN_FORMAT_BPP (f->format) / 8; + iter->bits = b + s * iter->y + iter->x * PIXMAN_FORMAT_BPP (f->format) / 8; iter->stride = s; iter->get_scanline = f->get_scanline; diff --git a/pixman/pixman/pixman-noop.c b/pixman/pixman/pixman-noop.c index d835de64f..7b017e8ec 100644 --- a/pixman/pixman/pixman-noop.c +++ b/pixman/pixman/pixman-noop.c @@ -71,18 +71,18 @@ noop_src_iter_init (pixman_implementation_t *imp, pixman_iter_t *iter) { iter->get_scanline = get_scanline_null; } - else if ((iter->flags & (ITER_IGNORE_ALPHA | ITER_IGNORE_RGB)) == + else if ((iter->iter_flags & (ITER_IGNORE_ALPHA | ITER_IGNORE_RGB)) == (ITER_IGNORE_ALPHA | ITER_IGNORE_RGB)) { iter->get_scanline = _pixman_iter_get_scanline_noop; } else if (image->common.extended_format_code == PIXMAN_solid && - ((image->common.flags & (FAST_PATH_BITS_IMAGE | FAST_PATH_NO_ALPHA_MAP)) == + ((iter->image_flags & (FAST_PATH_BITS_IMAGE | FAST_PATH_NO_ALPHA_MAP)) == (FAST_PATH_BITS_IMAGE | FAST_PATH_NO_ALPHA_MAP))) { bits_image_t *bits = &image->bits; - if (iter->flags & ITER_NARROW) + if (iter->iter_flags & ITER_NARROW) { uint32_t color = bits->fetch_pixel_32 (bits, 0, 0); uint32_t *buffer = iter->buffer; @@ -104,8 +104,8 @@ noop_src_iter_init (pixman_implementation_t *imp, pixman_iter_t *iter) iter->get_scanline = _pixman_iter_get_scanline_noop; } else if (image->common.extended_format_code == PIXMAN_a8r8g8b8 && - (iter->flags & ITER_NARROW) && - (image->common.flags & FLAGS) == FLAGS && + (iter->iter_flags & ITER_NARROW) && + (iter->image_flags & FLAGS) == FLAGS && iter->x >= 0 && iter->y >= 0 && iter->x + iter->width <= image->bits.width && iter->y + iter->height <= image->bits.height) @@ -125,8 +125,8 @@ static void noop_dest_iter_init (pixman_implementation_t *imp, pixman_iter_t *iter) { pixman_image_t *image = iter->image; - uint32_t image_flags = image->common.flags; - uint32_t iter_flags = iter->flags; + uint32_t image_flags = iter->image_flags; + uint32_t iter_flags = iter->iter_flags; if ((image_flags & FAST_PATH_STD_DEST_FLAGS) == FAST_PATH_STD_DEST_FLAGS && (iter_flags & ITER_NARROW) == ITER_NARROW && diff --git a/pixman/pixman/pixman-private.h b/pixman/pixman/pixman-private.h index f456bbd33..f4ca63216 100644 --- a/pixman/pixman/pixman-private.h +++ b/pixman/pixman/pixman-private.h @@ -218,7 +218,8 @@ struct pixman_iter_t int x, y; int width; int height; - iter_flags_t flags; + iter_flags_t iter_flags; + uint32_t image_flags; /* These function pointers are initialized by the implementation */ pixman_iter_get_scanline_t get_scanline; @@ -516,7 +517,8 @@ _pixman_implementation_src_iter_init (pixman_implementation_t *imp, int width, int height, uint8_t *buffer, - iter_flags_t flags); + iter_flags_t flags, + uint32_t image_flags); void _pixman_implementation_dest_iter_init (pixman_implementation_t *imp, @@ -527,7 +529,8 @@ _pixman_implementation_dest_iter_init (pixman_implementation_t *imp, int width, int height, uint8_t *buffer, - iter_flags_t flags); + iter_flags_t flags, + uint32_t image_flags); /* Specific implementations */ pixman_implementation_t * diff --git a/pixman/pixman/pixman-radial-gradient.c b/pixman/pixman/pixman-radial-gradient.c index b6dd6b2c7..715711fd6 100644 --- a/pixman/pixman/pixman-radial-gradient.c +++ b/pixman/pixman/pixman-radial-gradient.c @@ -413,7 +413,7 @@ radial_get_scanline_wide (pixman_iter_t *iter, const uint32_t *mask) void _pixman_radial_gradient_iter_init (pixman_image_t *image, pixman_iter_t *iter) { - if (iter->flags & ITER_NARROW) + if (iter->iter_flags & ITER_NARROW) iter->get_scanline = radial_get_scanline_narrow; else iter->get_scanline = radial_get_scanline_wide; diff --git a/pixman/pixman/pixman-solid-fill.c b/pixman/pixman/pixman-solid-fill.c index fcda3abb5..8b25d5d08 100644 --- a/pixman/pixman/pixman-solid-fill.c +++ b/pixman/pixman/pixman-solid-fill.c @@ -1,89 +1,89 @@ -/*
- * Copyright © 2000 SuSE, Inc.
- * Copyright © 2007, 2009 Red Hat, Inc.
- * Copyright © 2009 Soren Sandmann
- *
- * Permission to use, copy, modify, distribute, and sell this software and its
- * documentation for any purpose is hereby granted without fee, provided that
- * the above copyright notice appear in all copies and that both that
- * copyright notice and this permission notice appear in supporting
- * documentation, and that the name of SuSE not be used in advertising or
- * publicity pertaining to distribution of the software without specific,
- * written prior permission. SuSE makes no representations about the
- * suitability of this software for any purpose. It is provided "as is"
- * without express or implied warranty.
- *
- * SuSE DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING ALL
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL SuSE
- * BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
- * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION
- * OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN
- * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
- */
-
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
-#include "pixman-private.h"
-
-void
-_pixman_solid_fill_iter_init (pixman_image_t *image, pixman_iter_t *iter)
-{
- if (iter->flags & ITER_NARROW)
- {
- uint32_t *b = (uint32_t *)iter->buffer;
- uint32_t *e = b + iter->width;
- uint32_t color = iter->image->solid.color_32;
-
- while (b < e)
- *(b++) = color;
- }
- else
- {
- uint64_t *b = (uint64_t *)iter->buffer;
- uint64_t *e = b + iter->width;
- uint64_t color = image->solid.color_64;
-
- while (b < e)
- *(b++) = color;
- }
-
- iter->get_scanline = _pixman_iter_get_scanline_noop;
-}
-
-static uint32_t
-color_to_uint32 (const pixman_color_t *color)
-{
- return
- (color->alpha >> 8 << 24) |
- (color->red >> 8 << 16) |
- (color->green & 0xff00) |
- (color->blue >> 8);
-}
-
-static uint64_t
-color_to_uint64 (const pixman_color_t *color)
-{
- return
- ((uint64_t)color->alpha << 48) |
- ((uint64_t)color->red << 32) |
- ((uint64_t)color->green << 16) |
- ((uint64_t)color->blue);
-}
-
-PIXMAN_EXPORT pixman_image_t *
-pixman_image_create_solid_fill (pixman_color_t *color)
-{
- pixman_image_t *img = _pixman_image_allocate ();
-
- if (!img)
- return NULL;
-
- img->type = SOLID;
- img->solid.color = *color;
- img->solid.color_32 = color_to_uint32 (color);
- img->solid.color_64 = color_to_uint64 (color);
-
- return img;
-}
-
+/* + * Copyright © 2000 SuSE, Inc. + * Copyright © 2007, 2009 Red Hat, Inc. + * Copyright © 2009 Soren Sandmann + * + * Permission to use, copy, modify, distribute, and sell this software and its + * documentation for any purpose is hereby granted without fee, provided that + * the above copyright notice appear in all copies and that both that + * copyright notice and this permission notice appear in supporting + * documentation, and that the name of SuSE not be used in advertising or + * publicity pertaining to distribution of the software without specific, + * written prior permission. SuSE makes no representations about the + * suitability of this software for any purpose. It is provided "as is" + * without express or implied warranty. + * + * SuSE DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING ALL + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL SuSE + * BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES + * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION + * OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN + * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. + */ + +#ifdef HAVE_CONFIG_H +#include <config.h> +#endif +#include "pixman-private.h" + +void +_pixman_solid_fill_iter_init (pixman_image_t *image, pixman_iter_t *iter) +{ + if (iter->iter_flags & ITER_NARROW) + { + uint32_t *b = (uint32_t *)iter->buffer; + uint32_t *e = b + iter->width; + uint32_t color = iter->image->solid.color_32; + + while (b < e) + *(b++) = color; + } + else + { + uint64_t *b = (uint64_t *)iter->buffer; + uint64_t *e = b + iter->width; + uint64_t color = image->solid.color_64; + + while (b < e) + *(b++) = color; + } + + iter->get_scanline = _pixman_iter_get_scanline_noop; +} + +static uint32_t +color_to_uint32 (const pixman_color_t *color) +{ + return + (color->alpha >> 8 << 24) | + (color->red >> 8 << 16) | + (color->green & 0xff00) | + (color->blue >> 8); +} + +static uint64_t +color_to_uint64 (const pixman_color_t *color) +{ + return + ((uint64_t)color->alpha << 48) | + ((uint64_t)color->red << 32) | + ((uint64_t)color->green << 16) | + ((uint64_t)color->blue); +} + +PIXMAN_EXPORT pixman_image_t * +pixman_image_create_solid_fill (pixman_color_t *color) +{ + pixman_image_t *img = _pixman_image_allocate (); + + if (!img) + return NULL; + + img->type = SOLID; + img->solid.color = *color; + img->solid.color_32 = color_to_uint32 (color); + img->solid.color_64 = color_to_uint64 (color); + + return img; +} + diff --git a/pixman/pixman/pixman-sse2.c b/pixman/pixman/pixman-sse2.c index db1489a25..c3ba4b93a 100644 --- a/pixman/pixman/pixman-sse2.c +++ b/pixman/pixman/pixman-sse2.c @@ -5976,19 +5976,13 @@ static void sse2_src_iter_init (pixman_implementation_t *imp, pixman_iter_t *iter) { pixman_image_t *image = iter->image; - int x = iter->x; - int y = iter->y; - int width = iter->width; - int height = iter->height; #define FLAGS \ - (FAST_PATH_STANDARD_FLAGS | FAST_PATH_ID_TRANSFORM | FAST_PATH_BITS_IMAGE) + (FAST_PATH_STANDARD_FLAGS | FAST_PATH_ID_TRANSFORM | \ + FAST_PATH_BITS_IMAGE | FAST_PATH_SAMPLES_COVER_CLIP_NEAREST) - if ((iter->flags & ITER_NARROW) && - (image->common.flags & FLAGS) == FLAGS && - x >= 0 && y >= 0 && - x + width <= image->bits.width && - y + height <= image->bits.height) + if ((iter->iter_flags & ITER_NARROW) && + (iter->image_flags & FLAGS) == FLAGS) { const fetcher_info_t *f; @@ -5999,7 +5993,7 @@ sse2_src_iter_init (pixman_implementation_t *imp, pixman_iter_t *iter) uint8_t *b = (uint8_t *)image->bits.bits; int s = image->bits.rowstride * 4; - iter->bits = b + s * iter->y + x * PIXMAN_FORMAT_BPP (f->format) / 8; + iter->bits = b + s * iter->y + iter->x * PIXMAN_FORMAT_BPP (f->format) / 8; iter->stride = s; iter->get_scanline = f->get_scanline; diff --git a/xorg-server/configure.ac b/xorg-server/configure.ac index 97ceab1b8..9ae77fbae 100644 --- a/xorg-server/configure.ac +++ b/xorg-server/configure.ac @@ -773,7 +773,7 @@ RECORDPROTO="recordproto >= 1.13.99.1" SCRNSAVERPROTO="scrnsaverproto >= 1.1" RESOURCEPROTO="resourceproto >= 1.2.0" DRIPROTO="xf86driproto >= 2.1.0" -DRI2PROTO="dri2proto >= 2.6" +DRI2PROTO="dri2proto >= 2.7" XINERAMAPROTO="xineramaproto" BIGFONTPROTO="xf86bigfontproto >= 1.2.0" DGAPROTO="xf86dgaproto >= 2.0.99.1" diff --git a/xorg-server/dix/getevents.c b/xorg-server/dix/getevents.c index be369ec72..7242c2c79 100644 --- a/xorg-server/dix/getevents.c +++ b/xorg-server/dix/getevents.c @@ -1636,7 +1636,7 @@ GetPointerEvents(InternalEvent *events, DeviceIntPtr pDev, int type, /* Now turn the smooth-scrolling axes back into emulated button presses * for legacy clients, based on the integer delta between before and now */ for (i = 0; i < valuator_mask_size(&mask); i++) { - if (i >= pDev->valuator->numAxes) + if ( !pDev->valuator || (i >= pDev->valuator->numAxes)) break; if (!valuator_mask_isset(&mask, i)) diff --git a/xorg-server/hw/xfree86/dri2/dri2.c b/xorg-server/hw/xfree86/dri2/dri2.c index 591ff3ace..babf32f13 100644 --- a/xorg-server/hw/xfree86/dri2/dri2.c +++ b/xorg-server/hw/xfree86/dri2/dri2.c @@ -107,6 +107,7 @@ typedef struct _DRI2Screen { DRI2AuthMagicProcPtr AuthMagic; DRI2ReuseBufferNotifyProcPtr ReuseBufferNotify; DRI2SwapLimitValidateProcPtr SwapLimitValidate; + DRI2GetParamProcPtr GetParam; HandleExposuresProcPtr HandleExposures; @@ -1210,6 +1211,11 @@ DRI2ScreenInit(ScreenPtr pScreen, DRI2InfoPtr info) ds->SwapLimitValidate = info->SwapLimitValidate; } + if (info->version >= 7) { + ds->GetParam = info->GetParam; + cur_minor = 4; + } + /* * if the driver doesn't provide an AuthMagic function or the info struct * version is too low, it relies on the old method (using libdrm) or fail @@ -1332,3 +1338,38 @@ DRI2Version(int *major, int *minor) if (minor != NULL) *minor = DRI2VersRec.minorversion; } + +int +DRI2GetParam(ClientPtr client, + DrawablePtr drawable, + CARD64 param, + BOOL *is_param_recognized, + CARD64 *value) +{ + DRI2ScreenPtr ds = DRI2GetScreen(drawable->pScreen); + char high_byte = (param >> 24); + + switch (high_byte) { + case 0: + /* Parameter names whose high_byte is 0 are reserved for the X + * server. The server currently recognizes no parameters. + */ + goto not_recognized; + case 1: + /* Parameter names whose high byte is 1 are reserved for the DDX. */ + if (ds->GetParam) + return ds->GetParam(client, drawable, param, + is_param_recognized, value); + else + goto not_recognized; + default: + /* Other parameter names are reserved for future use. They are never + * recognized. + */ + goto not_recognized; + } + +not_recognized: + *is_param_recognized = FALSE; + return Success; +} diff --git a/xorg-server/hw/xfree86/dri2/dri2.h b/xorg-server/hw/xfree86/dri2/dri2.h index 00b3668cc..f849be67a 100644 --- a/xorg-server/hw/xfree86/dri2/dri2.h +++ b/xorg-server/hw/xfree86/dri2/dri2.h @@ -176,9 +176,23 @@ typedef Bool (*DRI2SwapLimitValidateProcPtr) (DrawablePtr pDraw, int swap_limit); /** + * \brief Get the value of a parameter. + * + * The parameter's \a value is looked up on the screen associated with + * \a pDrawable. + * + * \return \c Success or error code. + */ +typedef int (*DRI2GetParamProcPtr) (ClientPtr client, + DrawablePtr pDrawable, + CARD64 param, + BOOL *is_param_recognized, + CARD64 *value); + +/** * Version of the DRI2InfoRec structure defined in this header */ -#define DRI2INFOREC_VERSION 6 +#define DRI2INFOREC_VERSION 7 typedef struct { unsigned int version; /**< Version of this struct */ @@ -211,6 +225,10 @@ typedef struct { DRI2ReuseBufferNotifyProcPtr ReuseBufferNotify; DRI2SwapLimitValidateProcPtr SwapLimitValidate; + + /* added in version 7 */ + + DRI2GetParamProcPtr GetParam; } DRI2InfoRec, *DRI2InfoPtr; extern _X_EXPORT int DRI2EventBase; @@ -308,4 +326,10 @@ extern _X_EXPORT void DRI2WaitMSCComplete(ClientPtr client, DrawablePtr pDraw, int frame, unsigned int tv_sec, unsigned int tv_usec); +extern _X_EXPORT int DRI2GetParam(ClientPtr client, + DrawablePtr pDrawable, + CARD64 param, + BOOL *is_param_recognized, + CARD64 *value); + #endif diff --git a/xorg-server/hw/xfree86/dri2/dri2ext.c b/xorg-server/hw/xfree86/dri2/dri2ext.c index 61578f3c1..c6f5b4e11 100644 --- a/xorg-server/hw/xfree86/dri2/dri2ext.c +++ b/xorg-server/hw/xfree86/dri2/dri2ext.c @@ -535,6 +535,37 @@ ProcDRI2WaitSBC(ClientPtr client) } static int +ProcDRI2GetParam(ClientPtr client) +{ + REQUEST(xDRI2GetParamReq); + xDRI2GetParamReply rep; + DrawablePtr pDrawable; + CARD64 value; + int status; + + REQUEST_SIZE_MATCH(xDRI2GetParamReq); + rep.type = X_Reply; + rep.length = 0; + rep.sequenceNumber = client->sequence; + + if (!validDrawable(client, stuff->drawable, DixReadAccess, + &pDrawable, &status)) + return status; + + status = DRI2GetParam(client, pDrawable, stuff->param, + &rep.is_param_recognized, &value); + rep.value_hi = value >> 32; + rep.value_lo = value & 0xffffffff; + + if (status != Success) + return status; + + WriteToClient(client, sizeof(xDRI2GetParamReply), &rep); + + return status; +} + +static int ProcDRI2Dispatch(ClientPtr client) { REQUEST(xReq); @@ -572,6 +603,8 @@ ProcDRI2Dispatch(ClientPtr client) return ProcDRI2WaitSBC(client); case X_DRI2SwapInterval: return ProcDRI2SwapInterval(client); + case X_DRI2GetParam: + return ProcDRI2GetParam(client); default: return BadRequest; } diff --git a/xorg-server/xkb/XKBMAlloc.c b/xorg-server/xkb/XKBMAlloc.c index 645e90544..3ffd5dad1 100644 --- a/xorg-server/xkb/XKBMAlloc.c +++ b/xorg-server/xkb/XKBMAlloc.c @@ -375,8 +375,10 @@ XkbResizeKeyType(XkbDescPtr xkb, nResize = 0; for (nTotal = 1, i = xkb->min_key_code; i <= xkb->max_key_code; i++) { width = XkbKeyGroupsWidth(xkb, i); - if (width < type->num_levels) + if (width < type->num_levels || width >= new_num_lvls) { + nTotal += XkbKeyNumSyms(xkb,i); continue; + } for (match = 0, g = XkbKeyNumGroups(xkb, i) - 1; (g >= 0) && (!match); g--) { if (XkbKeyKeyTypeIndex(xkb, i, g) == type_ndx) { @@ -384,7 +386,7 @@ XkbResizeKeyType(XkbDescPtr xkb, match = 1; } } - if ((!match) || (width >= new_num_lvls)) + if (!match) nTotal += XkbKeyNumSyms(xkb, i); else { nTotal += XkbKeyNumGroups(xkb, i) * new_num_lvls; diff --git a/xorg-server/xkeyboard-config/symbols/is b/xorg-server/xkeyboard-config/symbols/is index f8e0ce133..e5f5d82a5 100644 --- a/xorg-server/xkeyboard-config/symbols/is +++ b/xorg-server/xkeyboard-config/symbols/is @@ -21,14 +21,14 @@ xkb_symbols "basic" { key <AE12> { [ minus, underscore, dead_cedilla, dead_ogonek ] }; key <AD11> { [ eth, ETH, dead_diaeresis, dead_abovering ] }; - key <AD12> { [apostrophe, question, dead_tilde, dead_macron ] }; + key <AD12> { [apostrophe, question, asciitilde, dead_macron ] }; key <AC10> { [ ae, AE, asciicircum, dead_doubleacute ] }; key <AC11> { [dead_acute, dead_acute, dead_circumflex, dead_caron ] }; key <TLDE> { [dead_abovering, dead_diaeresis, notsign, hyphen ] }; // <AC12> = <BKSL> - key <BKSL> { [ plus, asterisk, dead_grave, dead_breve ] }; + key <BKSL> { [ plus, asterisk, grave, dead_breve ] }; // <AB00> = <LSGT>, is in file "pc": pc105 key <AB10> { [ thorn, THORN, dead_belowdot, dead_abovedot ] }; |