};
struct GpCustomLineCap{
+ CustomLineCapType type;
GpPathData pathdata;
BOOL fill; /* TRUE for fill, FALSE for stroke */
GpLineCap cap; /* as far as I can tell, this value is ignored */
UINT frame_count, current_frame;
ColorPalette *palette;
REAL xres, yres;
+ LONG busy;
};
struct GpMetafile{
INT height;
PixelFormat format;
ImageLockMode lockmode;
- INT numlocks;
BYTE *bitmapbits; /* pointer to the buffer we passed in BitmapLockBits */
HBITMAP hbitmap;
HDC hdc;
void get_log_fontW(const GpFont *, GpGraphics *, LOGFONTW *) DECLSPEC_HIDDEN;
+static inline BOOL image_lock(GpImage *image, BOOL *unlock)
+{
+ LONG tid = GetCurrentThreadId(), owner_tid;
+ owner_tid = InterlockedCompareExchange(&image->busy, tid, 0);
+ *unlock = !owner_tid;
+ return !owner_tid || owner_tid==tid;
+}
+
+static inline void image_unlock(GpImage *image, BOOL unlock)
+{
+ if (unlock) image->busy = 0;
+}
+
#endif /* __WINE_GP_PRIVATE_H_ */