mirror of
https://repo.dactyloidae.xyz/Dactyloidae/UXP.git
synced 2026-10-29 02:27:30 +09:00
pixman: restore XP hacks
This commit is contained in:
parent
2684671e2c
commit
40f0327a83
3 changed files with 16 additions and 3 deletions
|
|
@ -67,6 +67,9 @@ LOCAL_INCLUDES += [
|
||||||
if CONFIG['MOZ_USE_PTHREADS']:
|
if CONFIG['MOZ_USE_PTHREADS']:
|
||||||
DEFINES['HAVE_PTHREADS'] = True
|
DEFINES['HAVE_PTHREADS'] = True
|
||||||
|
|
||||||
|
if CONFIG['_MSC_VER']:
|
||||||
|
DEFINES['PIXMAN_USE_XP_DLL_TLS_WORKAROUND'] = True
|
||||||
|
|
||||||
DEFINES['PACKAGE'] = 'mozpixman'
|
DEFINES['PACKAGE'] = 'mozpixman'
|
||||||
|
|
||||||
DEFINES['_USE_MATH_DEFINES'] = True
|
DEFINES['_USE_MATH_DEFINES'] = True
|
||||||
|
|
|
||||||
|
|
@ -139,10 +139,12 @@
|
||||||
# define PIXMAN_GET_THREAD_LOCAL(name) \
|
# define PIXMAN_GET_THREAD_LOCAL(name) \
|
||||||
(&name)
|
(&name)
|
||||||
|
|
||||||
#elif defined(__MINGW32__)
|
#elif defined(__MINGW32__) || defined(PIXMAN_USE_XP_DLL_TLS_WORKAROUND)
|
||||||
|
|
||||||
# define _NO_W32_PSEUDO_MODIFIERS
|
# define _NO_W32_PSEUDO_MODIFIERS
|
||||||
# include <windows.h>
|
# include <windows.h>
|
||||||
|
#undef IN
|
||||||
|
#undef OUT
|
||||||
|
|
||||||
# define PIXMAN_DEFINE_THREAD_LOCAL(type, name) \
|
# define PIXMAN_DEFINE_THREAD_LOCAL(type, name) \
|
||||||
static volatile int tls_ ## name ## _initialized = 0; \
|
static volatile int tls_ ## name ## _initialized = 0; \
|
||||||
|
|
|
||||||
|
|
@ -90,7 +90,15 @@ _pixman_implementation_lookup_composite (pixman_implementation_t *toplevel,
|
||||||
/* Check cache for fast paths */
|
/* Check cache for fast paths */
|
||||||
cache = PIXMAN_GET_THREAD_LOCAL (fast_path_cache);
|
cache = PIXMAN_GET_THREAD_LOCAL (fast_path_cache);
|
||||||
|
|
||||||
for (i = 0; i < N_CACHED_FAST_PATHS; ++i)
|
/* Bug 1324130 - For compatibility with Windows XP, we have to use Tls
|
||||||
|
* functions for the per-thread fast-path cache instead of the safer
|
||||||
|
* __declspec(thread) mechanism. If the Tls functions fail to set up
|
||||||
|
* the storage for some reason, cache will end up null here. As a
|
||||||
|
* temporary workaround, just check that cache is not null before
|
||||||
|
* using it. The implementation lookup will still function without the
|
||||||
|
* fast-path cache, however, it will incur a slow linear search.
|
||||||
|
*/
|
||||||
|
if (cache) for (i = 0; i < N_CACHED_FAST_PATHS; ++i)
|
||||||
{
|
{
|
||||||
const pixman_fast_path_t *info = &(cache->cache[i].fast_path);
|
const pixman_fast_path_t *info = &(cache->cache[i].fast_path);
|
||||||
|
|
||||||
|
|
@ -162,7 +170,7 @@ _pixman_implementation_lookup_composite (pixman_implementation_t *toplevel,
|
||||||
return;
|
return;
|
||||||
|
|
||||||
update_cache:
|
update_cache:
|
||||||
if (i)
|
if (cache && i)
|
||||||
{
|
{
|
||||||
while (i--)
|
while (i--)
|
||||||
cache->cache[i + 1] = cache->cache[i];
|
cache->cache[i + 1] = cache->cache[i];
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue