equal
deleted
inserted
replaced
70 |
70 |
71 static pthread_mutex_t gColorCacheLock = PTHREAD_MUTEX_INITIALIZER; |
71 static pthread_mutex_t gColorCacheLock = PTHREAD_MUTEX_INITIALIZER; |
72 |
72 |
73 // given a UInt32 color, it tries to find that find the corresponding CGColorRef in the hash cache. If the CGColorRef |
73 // given a UInt32 color, it tries to find that find the corresponding CGColorRef in the hash cache. If the CGColorRef |
74 // doesn't exist or there is a collision, it creates a new one CGColorRef and put's in the cache. Then, |
74 // doesn't exist or there is a collision, it creates a new one CGColorRef and put's in the cache. Then, |
75 // it sets with current fill/stroke color for the the CGContext passed in (qsdo->cgRef). |
75 // it sets with current fill/stroke color for the CGContext passed in (qsdo->cgRef). |
76 void setCachedColor(QuartzSDOps *qsdo, UInt32 color) |
76 void setCachedColor(QuartzSDOps *qsdo, UInt32 color) |
77 { |
77 { |
78 static const CGFloat kColorConversionMultiplier = 1.0f/255.0f; |
78 static const CGFloat kColorConversionMultiplier = 1.0f/255.0f; |
79 |
79 |
80 pthread_mutex_lock(&gColorCacheLock); |
80 pthread_mutex_lock(&gColorCacheLock); |