Module: wine Branch: master Commit: 25d43d7a09f15fe84f19d31940a64160fc1c8c97 URL: http://source.winehq.org/git/wine.git/?a=commit;h=25d43d7a09f15fe84f19d31940...
Author: Aric Stewart aric@codeweavers.com Date: Sun Nov 20 21:06:18 2011 -0700
usp10: Cache the script with the feature so that in caches with multiple scripts we do not fetch the wrong feature from the cache.
---
dlls/usp10/shape.c | 8 +++++++- dlls/usp10/usp10_internal.h | 3 ++- 2 files changed, 9 insertions(+), 2 deletions(-)
diff --git a/dlls/usp10/shape.c b/dlls/usp10/shape.c index c463681..66d65c2 100644 --- a/dlls/usp10/shape.c +++ b/dlls/usp10/shape.c @@ -1094,11 +1094,16 @@ static const char* get_opentype_script(HDC hdc, SCRIPT_ANALYSIS *psa, ScriptCach static LPCVOID load_GSUB_feature(HDC hdc, SCRIPT_ANALYSIS *psa, ScriptCache *psc, const char* feat) { const GSUB_Feature *feature; + const char* script; int i;
+ script = get_opentype_script(hdc,psa,psc,FALSE); + for (i = 0; i < psc->feature_count; i++) - if (strncmp(psc->features[i].tag,feat,4)==0) + { + if (strncmp(psc->features[i].tag,feat,4)==0 && strncmp(psc->features[i].script,script,4)==0) return psc->features[i].feature; + }
feature = NULL;
@@ -1146,6 +1151,7 @@ static LPCVOID load_GSUB_feature(HDC hdc, SCRIPT_ANALYSIS *psa, ScriptCache *psc psc->features = HeapAlloc(GetProcessHeap(), 0, psc->feature_count * sizeof(LoadedFeature));
lstrcpynA(psc->features[psc->feature_count - 1].tag, feat, 5); + lstrcpynA(psc->features[psc->feature_count - 1].script, script, 5); psc->features[psc->feature_count - 1].feature = feature; return feature; } diff --git a/dlls/usp10/usp10_internal.h b/dlls/usp10/usp10_internal.h index ebf9667..6f5d3d1 100644 --- a/dlls/usp10/usp10_internal.h +++ b/dlls/usp10/usp10_internal.h @@ -82,7 +82,8 @@ #define GLYPH_MAX 65536
typedef struct { - char tag[4]; + char tag[5]; + char script[5]; LPCVOID feature; } LoadedFeature;