diff options
author | kevin_walzer <kevin_walzer@noemail.net> | 2012-09-25 14:51:04 (GMT) |
---|---|---|
committer | kevin_walzer <kevin_walzer@noemail.net> | 2012-09-25 14:51:04 (GMT) |
commit | 5f46bda6dc44ef146b4444d218c12784d33c0305 (patch) | |
tree | dea6f020e98cf06efcef68e084c7a1787f87e140 /xlib | |
parent | 587b38d3f868f51936cde286a36435b5bf0567fa (diff) | |
parent | 0142246dcd9c2931c185d1902ac7aad1b8f1b88e (diff) | |
download | tk-5f46bda6dc44ef146b4444d218c12784d33c0305.zip tk-5f46bda6dc44ef146b4444d218c12784d33c0305.tar.gz tk-5f46bda6dc44ef146b4444d218c12784d33c0305.tar.bz2 |
Merge Tk-Cocoa backport into core-8-5-branch
FossilOrigin-Name: 1a739d63cf7634d566b9d5d6f3c58960bfc38c08
Diffstat (limited to 'xlib')
-rw-r--r-- | xlib/xgc.c | 38 |
1 files changed, 34 insertions, 4 deletions
@@ -5,7 +5,8 @@ * contexts. * * Copyright (c) 1995-1996 Sun Microsystems, Inc. - * Copyright (c) 2002-2007 Daniel A. Steffen <das@users.sourceforge.net> + * Copyright (c) 2002-2009 Daniel A. Steffen <das@users.sourceforge.net> + * Copyright 2008-2009, Apple Inc. * * See the file "license.terms" for information on usage and redistribution of * this file, and for a DISCLAIMER OF ALL WARRANTIES. @@ -15,13 +16,17 @@ #if !defined(MAC_OSX_TK) # include <X11/Xlib.h> -#endif -#ifdef MAC_OSX_TK +# define gcCacheSize 0 +# define TkpInitGCCache(gc) +# define TkpFreeGCCache(gc) +# define TkpGetGCCache(gc) +#else # include <tkMacOSXInt.h> # include <X11/Xlib.h> # include <X11/X.h> # define Cursor XCursor # define Region XRegion +# define gcCacheSize sizeof(TkpGCCache) #endif #undef TkSetRegion @@ -118,7 +123,8 @@ XCreateGC( #define MAX_DASH_LIST_SIZE 10 - gp = (XGCValues *) ckalloc(sizeof(XGCValues) + MAX_DASH_LIST_SIZE); + gp = (XGCValues *) ckalloc(sizeof(XGCValues) + MAX_DASH_LIST_SIZE + + gcCacheSize); if (!gp) { return None; } @@ -159,10 +165,33 @@ XCreateGC( clip_mask->type = TKP_CLIP_PIXMAP; clip_mask->value.pixmap = values->clip_mask; } + TkpInitGCCache(gp); return gp; } +#ifdef MAC_OSX_TK +/* + *---------------------------------------------------------------------- + * + * TkpGetGCCache -- + * + * Results: + * Pointer to the TkpGCCache at the end of the GC. + * + * Side effects: + * None. + * + *---------------------------------------------------------------------- + */ + +TkpGCCache* +TkpGetGCCache(GC gc) { + return (gc ? (TkpGCCache*)(((char*) gc) + sizeof(XGCValues) + + MAX_DASH_LIST_SIZE) : NULL); +} +#endif + /* *---------------------------------------------------------------------- * @@ -242,6 +271,7 @@ int XFreeGC( { if (gc != None) { FreeClipMask(gc); + TkpFreeGCCache(gc); ckfree((char *) gc); } return Success; |