Add X11DRV_DIB_UpdateDIBSection2 that takes a HBITMAP parameter.
diff --git a/graphics/x11drv/dib.c b/graphics/x11drv/dib.c
index 5780cfa..2d1874d 100644
--- a/graphics/x11drv/dib.c
+++ b/graphics/x11drv/dib.c
@@ -3186,25 +3186,12 @@
}
/***********************************************************************
- * X11DRV_DIB_UpdateDIBSection
+ * X11DRV_DIB_CmnUpdateDIBSection
*/
-void X11DRV_DIB_UpdateDIBSection(DC *dc, BOOL toDIB)
+static void X11DRV_DIB_CmnUpdateDIBSection(BITMAPOBJ *bmp, BOOL toDIB)
{
- BITMAPOBJ *bmp;
-
- /* Ensure this is a Compatible DC that has a DIB section selected */
-
- if (!dc) return;
- if (!(dc->w.flags & DC_MEMORY)) return;
-
- bmp = (BITMAPOBJ *)GDI_GetObjPtr( dc->w.hBitmap, BITMAP_MAGIC );
if (!bmp) return;
-
- if (!bmp->dib)
- {
- GDI_HEAP_UNLOCK(dc->w.hBitmap);
- return;
- }
+ if (!bmp->dib) return;
if (!toDIB)
{
@@ -3263,8 +3250,34 @@
break;
}
}
+}
- GDI_HEAP_UNLOCK(dc->w.hBitmap);
+/***********************************************************************
+ * X11DRV_DIB_UpdateDIBSection2
+ */
+void X11DRV_DIB_UpdateDIBSection2(HBITMAP hbmp, BOOL toDIB)
+{
+ BITMAPOBJ *bmp;
+
+ bmp = (BITMAPOBJ *)GDI_GetObjPtr( hbmp, BITMAP_MAGIC );
+ if (!bmp) return;
+
+ X11DRV_DIB_CmnUpdateDIBSection(bmp, toDIB);
+
+ GDI_HEAP_UNLOCK(hbmp);
+}
+
+/***********************************************************************
+ * X11DRV_DIB_UpdateDIBSection
+ */
+void X11DRV_DIB_UpdateDIBSection(DC *dc, BOOL toDIB)
+{
+ /* Ensure this is a Compatible DC that has a DIB section selected */
+
+ if (!dc) return;
+ if (!(dc->w.flags & DC_MEMORY)) return;
+
+ X11DRV_DIB_UpdateDIBSection2(dc->w.hBitmap, toDIB);
}
/***********************************************************************
diff --git a/include/x11drv.h b/include/x11drv.h
index 9de72fa..c15c356 100644
--- a/include/x11drv.h
+++ b/include/x11drv.h
@@ -263,6 +263,7 @@
WORD depth, const BITMAPINFO *info,
int *nColors );
extern void X11DRV_DIB_UpdateDIBSection(struct tagDC *dc, BOOL toDIB);
+extern void X11DRV_DIB_UpdateDIBSection2(HBITMAP hbmp, BOOL toDIB);
extern HBITMAP X11DRV_DIB_CreateDIBSection(struct tagDC *dc, BITMAPINFO *bmi, UINT usage,
LPVOID *bits, HANDLE section, DWORD offset, DWORD ovr_pitch);