diff options
author | Igor Melichev <igor.melichev@artifex.com> | 2007-05-07 21:31:43 +0000 |
---|---|---|
committer | Igor Melichev <igor.melichev@artifex.com> | 2007-05-07 21:31:43 +0000 |
commit | 1b8524f3bae559989e7b8fb526212f197ef7e6d0 (patch) | |
tree | 8e86877c0eee6052f9a1f3250036f3b0ef70f222 /gs/src/gxshade4.h | |
parent | 4351f55636c770ff4bcaa304903e6ce3ac25c317 (diff) |
Fix (shadings) : Implement a color index cache.
DETAILS :
This partially improves performance for the test case of
the bug 689189 "PDF fails with /unregistered in --shfill--".
This change is algorithmically equivalent.
The old code redundantly converts client colors
to device colors. This patch implements a cache for
the conversion in the new module gscicach.h .
It works for contone devices only.
For the test case it reduces the number of color conversions
in 20+ times. However a rocket speeding up is not obtained.
This patch is an experimental one.
We have got an alternative approach,
which is more complicated but works for any device.
The alternative is to pass converted colors through the decomposition recursion.
We commit this now mainly for archiving purpose.
To disable it replace the call to gs_color_index_cache_create with NULL.
EXPECTED DIFFERENCES :
None.
git-svn-id: http://svn.ghostscript.com/ghostscript/trunk@7908 a1074d23-0009-0410-80fe-cf8c14f379e6
Diffstat (limited to 'gs/src/gxshade4.h')
-rw-r--r-- | gs/src/gxshade4.h | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/gs/src/gxshade4.h b/gs/src/gxshade4.h index ae618637c..5414743ce 100644 --- a/gs/src/gxshade4.h +++ b/gs/src/gxshade4.h @@ -112,7 +112,10 @@ struct patch_color_s { typedef struct patch_color_s patch_color_t; #endif - +#ifndef gs_color_index_cache_DEFINED +# define gs_color_index_cache_DEFINED +typedef struct gs_color_index_cache_s gs_color_index_cache_t; +#endif /* Define the common state for rendering Coons and tensor patches. */ typedef struct patch_fill_state_s { @@ -140,6 +143,7 @@ typedef struct patch_fill_state_s { byte *color_stack; /* A storage for shortened patch_color_t structures. */ byte *color_stack_limit; gs_memory_t *memory; /* Where color_buffer is allocated. */ + gs_color_index_cache_t *pcic; } patch_fill_state_t; /* Define a structure for mesh or patch vertex. */ |