[Libreoffice-commits] core.git: canvas/source vcl/unx

Stephan Bergmann (via logerrit) logerrit at kemper.freedesktop.org
Sun Nov 1 17:08:28 UTC 2020


 canvas/source/cairo/cairo_canvasbitmap.hxx |    2 +-
 canvas/source/vcl/canvasbitmap.hxx         |    2 +-
 vcl/unx/generic/gdi/salbmp.cxx             |    2 +-
 vcl/unx/generic/gdi/salgdi.cxx             |    2 +-
 vcl/unx/generic/window/salobj.cxx          |    4 ++--
 5 files changed, 6 insertions(+), 6 deletions(-)

New commits:
commit 3c77541ec0ba2c9f209c67da272f57093092ebdb
Author:     Stephan Bergmann <sbergman at redhat.com>
AuthorDate: Sun Nov 1 16:27:17 2020 +0100
Commit:     Stephan Bergmann <sbergman at redhat.com>
CommitDate: Sun Nov 1 18:07:47 2020 +0100

    Transport Pixmap from GetNativeSurfaceHandle via css::uno::Any as sal_Int64
    
    The values returned from GetNativeSurfaceHandle are only used in
    cairocanvas::CanvasBitmap::getFastPropertyValue
    (canvas/source/cairo/cairo_canvasbitmap.cxx), whose consumers in turn are (at
    least the ones I could identify):
    
    * OGLTransitionerImpl::setSlides
      (slideshow/source/engine/opengl/TransitionerImpl.cxx), passing the
      values on to X11SalObject::SetLeaveEnterBackgrounds, which extracts the
      Pixmap value to pass it on to XSetWindowBackgroundPixmap.
    
    * X11SalBitmap::Create (vcl/unx/generic/gdi/salbmp.cxx), which extracts the
      Pixmap value to pass it on to X11SalBitmap::ImplCreateFromDrawable (as a
      Drawable) and to XFreePixmap.
    
    While Pixmap XIDs are apparently 32-bit in the X11 protocol, see e.g.
    <https://www.x.org/releases/X11R7.7/doc/xproto/x11protocol.html>, Xlib and the
    underlying /usr/include/X11/Xdefs.h appear to be somewhat confused whether the
    typedef for XID should be unsigned long (presumably stemming from times when
    long was universally 32-bit) or CARD32, see e.g. <https://gitlab.freedesktop.org
    /xorg/proto/xorgproto/-/blob/master/include/X11/Xdefs.h>.  So conservatively
    stick to a 64-bit type here, even if it should only ever contain 32-bit values.
    
    Change-Id: I26c3a2ff74cef092042a6e3648cd9a6f4a9e3aac
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/105144
    Tested-by: Jenkins
    Reviewed-by: Stephan Bergmann <sbergman at redhat.com>

diff --git a/canvas/source/cairo/cairo_canvasbitmap.hxx b/canvas/source/cairo/cairo_canvasbitmap.hxx
index 72a22ca0cfe3..a4e55f7b642a 100644
--- a/canvas/source/cairo/cairo_canvasbitmap.hxx
+++ b/canvas/source/cairo/cairo_canvasbitmap.hxx
@@ -108,7 +108,7 @@ namespace cairocanvas
         // 2 ... FIXME: leftover? ever called with this? always returns nothing (empty Any)
         // returned any contains either BitmapEx pointer or array of three Any value
         //     1st a bool value: true - free the pixmap after used by XFreePixmap, false do nothing, the pixmap is used internally in the canvas
-        //     2nd the pixmap handle
+        //     2nd the pixmap handle (sal_Int64)
         //     3rd the pixmap depth
         virtual css::uno::Any SAL_CALL getFastPropertyValue(sal_Int32 nHandle) override;
         virtual void SAL_CALL setFastPropertyValue(sal_Int32, const css::uno::Any&) override {}
diff --git a/canvas/source/vcl/canvasbitmap.hxx b/canvas/source/vcl/canvasbitmap.hxx
index 7eea1ac31383..1a95ce8c632c 100644
--- a/canvas/source/vcl/canvasbitmap.hxx
+++ b/canvas/source/vcl/canvasbitmap.hxx
@@ -101,7 +101,7 @@ namespace vclcanvas
         // 2 ... get X pixmap handle to alpha mask
         // returned any contains either BitmapEx pointer or array of three Any value
         //     1st a bool value: true - free the pixmap after used by XFreePixmap, false do nothing, the pixmap is used internally in the canvas
-        //     2nd the pixmap handle
+        //     2nd the pixmap handle (sal_Int64)
         //     3rd the pixmap depth
         virtual css::uno::Any SAL_CALL getFastPropertyValue(sal_Int32 nHandle) override;
         virtual void SAL_CALL setFastPropertyValue(sal_Int32, const css::uno::Any&) override {}
diff --git a/vcl/unx/generic/gdi/salbmp.cxx b/vcl/unx/generic/gdi/salbmp.cxx
index ac3b704f870b..aa3cd0ac034d 100644
--- a/vcl/unx/generic/gdi/salbmp.cxx
+++ b/vcl/unx/generic/gdi/salbmp.cxx
@@ -707,7 +707,7 @@ bool X11SalBitmap::Create(
         css::uno::Sequence< css::uno::Any > args;
 
         if( xFastPropertySet->getFastPropertyValue(bMask ? 2 : 1) >>= args ) {
-            tools::Long pixmapHandle = {}; // spurious -Werror=maybe-uninitialized
+            sal_Int64 pixmapHandle = {}; // spurious -Werror=maybe-uninitialized
             sal_Int32 depth;
             if( ( args[1] >>= pixmapHandle ) && ( args[2] >>= depth ) ) {
 
diff --git a/vcl/unx/generic/gdi/salgdi.cxx b/vcl/unx/generic/gdi/salgdi.cxx
index 06400197d490..35b9fe7fd2f8 100644
--- a/vcl/unx/generic/gdi/salgdi.cxx
+++ b/vcl/unx/generic/gdi/salgdi.cxx
@@ -573,7 +573,7 @@ css::uno::Any X11SalGraphics::GetNativeSurfaceHandle(cairo::SurfaceSharedPtr& rS
     cairo::X11Surface& rXlibSurface=dynamic_cast<cairo::X11Surface&>(*rSurface);
     css::uno::Sequence< css::uno::Any > args( 3 );
     args[0] <<= false;  // do not call XFreePixmap on it
-    args[1] <<= tools::Long(rXlibSurface.getPixmap()->mhDrawable);
+    args[1] <<= sal_Int64(rXlibSurface.getPixmap()->mhDrawable);
     args[2] <<= sal_Int32( rXlibSurface.getDepth() );
     return css::uno::Any(args);
 }
diff --git a/vcl/unx/generic/window/salobj.cxx b/vcl/unx/generic/window/salobj.cxx
index 864b5e22307f..04368e7eea4b 100644
--- a/vcl/unx/generic/window/salobj.cxx
+++ b/vcl/unx/generic/window/salobj.cxx
@@ -479,7 +479,7 @@ void X11SalObject::SetLeaveEnterBackgrounds(const css::uno::Sequence<css::uno::A
     if (rEnterArgs.getLength() == 3)
     {
         rEnterArgs[0] >>= bFreePixmap;
-        tools::Long pixmapHandle = None;
+        sal_Int64 pixmapHandle = None;
         rEnterArgs[1] >>= pixmapHandle;
         aPixmap = pixmapHandle;
     }
@@ -493,7 +493,7 @@ void X11SalObject::SetLeaveEnterBackgrounds(const css::uno::Sequence<css::uno::A
     if (rLeaveArgs.getLength() == 3)
     {
         rLeaveArgs[0] >>= bFreePixmap;
-        tools::Long pixmapHandle = None;
+        sal_Int64 pixmapHandle = None;
         rLeaveArgs[1] >>= pixmapHandle;
         aPixmap = pixmapHandle;
     }


More information about the Libreoffice-commits mailing list