[Libreoffice-commits] core.git: vcl/unx
Caolán McNamara
caolanm at redhat.com
Mon May 23 14:03:26 UTC 2016
vcl/unx/gtk3/gtk3gtkdata.cxx | 18 +++++++++++-------
1 file changed, 11 insertions(+), 7 deletions(-)
New commits:
commit 81a8d1250319023f6ca272e0b233ef638cae40f7
Author: Caolán McNamara <caolanm at redhat.com>
Date: Mon May 23 15:02:21 2016 +0100
Resolves: tdf#99874 gtk3: all-black xbm cursors
Change-Id: I1feca80dd75f7a09e05ac43293e8645da391a775
diff --git a/vcl/unx/gtk3/gtk3gtkdata.cxx b/vcl/unx/gtk3/gtk3gtkdata.cxx
index 3480fe1..3aae62b 100644
--- a/vcl/unx/gtk3/gtk3gtkdata.cxx
+++ b/vcl/unx/gtk3/gtk3gtkdata.cxx
@@ -183,31 +183,35 @@ GdkCursor* GtkSalDisplay::getFromXBM( const unsigned char *pBitmap,
int cairo_stride = cairo_format_stride_for_width(CAIRO_FORMAT_A1, nWidth);
unsigned char *pPaddedXBM = ensurePaddedForCairo(pBitmap, nWidth, nHeight, cairo_stride);
- cairo_surface_t *s = cairo_image_surface_create_for_data(
+ cairo_surface_t *source = cairo_image_surface_create_for_data(
pPaddedXBM,
CAIRO_FORMAT_A1, nWidth, nHeight,
cairo_stride);
- cairo_t *cr = cairo_create(s);
unsigned char *pPaddedMaskXBM = ensurePaddedForCairo(pMask, nWidth, nHeight, cairo_stride);
cairo_surface_t *mask = cairo_image_surface_create_for_data(
pPaddedMaskXBM,
CAIRO_FORMAT_A1, nWidth, nHeight,
cairo_stride);
+
+ cairo_surface_t *s = cairo_surface_create_similar(source, CAIRO_CONTENT_ALPHA, nWidth, nHeight);
+ cairo_t *cr = cairo_create(s);
+ cairo_set_source_surface(cr, source, 0, 0);
cairo_mask_surface(cr, mask, 0, 0);
cairo_destroy(cr);
+
+ GdkCursor *cursor = gdk_cursor_new_from_surface(m_pGdkDisplay, s, nXHot, nYHot);
+
+ cairo_surface_destroy(s);
cairo_surface_destroy(mask);
+ cairo_surface_destroy(source);
+
if (pPaddedMaskXBM != pMask)
delete [] pPaddedMaskXBM;
- GdkPixbuf *pixbuf = gdk_pixbuf_get_from_surface(s, 0, 0, nWidth, nHeight);
- cairo_surface_destroy(s);
if (pPaddedXBM != pBitmap)
delete [] pPaddedXBM;
- GdkCursor *cursor = gdk_cursor_new_from_pixbuf(m_pGdkDisplay, pixbuf, nXHot, nYHot);
- g_object_unref(pixbuf);
-
return cursor;
}
More information about the Libreoffice-commits
mailing list