[Libreoffice-commits] core.git: 2 commits - external/skia include/sfx2 sfx2/source

Thorsten Behrens (via logerrit) logerrit at kemper.freedesktop.org
Sun Dec 29 19:39:35 UTC 2019


 external/skia/UnpackedTarball_skia.mk      |    1 
 external/skia/fix-gcc-x86.patch.1          |   20 +++++++++++++++++
 include/sfx2/sidebar/ControllerFactory.hxx |    2 -
 sfx2/source/sidebar/ControllerFactory.cxx  |   33 +++++++++++++++++++----------
 4 files changed, 44 insertions(+), 12 deletions(-)

New commits:
commit c13f75de521cfb67ca4db431708f8cd366b23587
Author:     Thorsten Behrens <Thorsten.Behrens at CIB.de>
AuthorDate: Sun Dec 29 01:08:42 2019 +0100
Commit:     Thorsten Behrens <Thorsten.Behrens at CIB.de>
CommitDate: Sun Dec 29 20:39:17 2019 +0100

    skia: make gcc not crash for x86 builds
    
    Otherwise at least on x86, gcc bails out with an ICE:
     skia/third_party/skcms/src/Transform_inl.h: In function ‘void baseline::clut(const skcms_A2B*, baseline::F*, baseline::F*, baseline::F*, baseline::F)’:
     skia/third_party/skcms/src/Transform_inl.h:695:13: note: The ABI for passing parameters with 16-byte alignment has changed in GCC 4.6
        static void clut(const skcms_A2B* a2b, F* r, F* g, F* b, F a) {
                    ^~~~
     skia/third_party/skcms/skcms.cpp: At global scope:
     skia/third_party/skcms/skcms.cpp:2613:1: internal compiler error: Segmentation fault
        }
        ^
    
    Likely reason: optimizer stumbles over F being non-register-passable,
    c.f.
    https://stackoverflow.com/questions/39383193/compiling-legacy-gcc-code-with-avx-vector-warnings
    
    Fix is an obvious bandaid, but fixes build for CentOS7 devtoolset-7. I
    suspect though that non-avx/sse2 builds are not a supported scenario
    for skia, in the end...
    
    Change-Id: Iaff734de8dc8b9a6fbf868c13810074f9667720b
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/85933
    Reviewed-by: Thorsten Behrens <Thorsten.Behrens at CIB.de>
    Tested-by: Thorsten Behrens <Thorsten.Behrens at CIB.de>

diff --git a/external/skia/UnpackedTarball_skia.mk b/external/skia/UnpackedTarball_skia.mk
index 64bfe5e2e76e..e050b9832d6b 100644
--- a/external/skia/UnpackedTarball_skia.mk
+++ b/external/skia/UnpackedTarball_skia.mk
@@ -25,6 +25,7 @@ skia_patches := \
     Wdeprecated-copy.patch.0 \
     Wdeprecated-copy-dtor.patch.0 \
     fix-msvc.patch.1 \
+    fix-gcc-x86.patch.1	\
 
 $(eval $(call gb_UnpackedTarball_set_patchlevel,skia,1))
 
diff --git a/external/skia/fix-gcc-x86.patch.1 b/external/skia/fix-gcc-x86.patch.1
new file mode 100644
index 000000000000..d63e84499505
--- /dev/null
+++ b/external/skia/fix-gcc-x86.patch.1
@@ -0,0 +1,20 @@
+--- skia/third_party/skcms/skcms.cc		2019-12-28 22:39:17.886442654 +0000
++++ skia/third_party/skcms/skcms.cc~	2019-12-28 22:34:34.486843710 +0000
+@@ -2051,6 +2051,7 @@
+     #define N 4
+     template <typename T> using V = Vec<N,T>;
+     using Color = float;
++    #pragma message "Fallback to float color"
+ #endif
+ 
+     #include "src/Transform_inl.h"
+--- skia/third_party/skcms/src/Transform_inl.h	2019-12-28 22:38:41.739366565 +0000
++++ skia/third_party/skcms/src/Transform_inl.h~	2019-12-28 22:37:41.087942963 +0000
+@@ -85,6 +85,7 @@
+ // It helps codegen to call __builtin_memcpy() when we know the byte count at compile time.
+ #if defined(__clang__) || defined(__GNUC__)
+     #define SI static inline __attribute__((always_inline))
++    #pragma message "Forcing always_inline attribute for gcc"
+ #else
+     #define SI static inline
+ #endif
commit e02003390208ac80e1404a95a6c09e06bb84848f
Author:     Caolán McNamara <caolanm at redhat.com>
AuthorDate: Fri Dec 27 21:09:51 2019 +0000
Commit:     Caolán McNamara <caolanm at redhat.com>
CommitDate: Sun Dec 29 20:39:01 2019 +0100

    pass in a awt::XWindow in the first place
    
    Change-Id: Ie94ba063b6f2ad98019bad21259125aabd16d93b
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/85879
    Tested-by: Jenkins
    Reviewed-by: Caolán McNamara <caolanm at redhat.com>
    Tested-by: Caolán McNamara <caolanm at redhat.com>

diff --git a/include/sfx2/sidebar/ControllerFactory.hxx b/include/sfx2/sidebar/ControllerFactory.hxx
index c54de67b5545..e84b139563a4 100644
--- a/include/sfx2/sidebar/ControllerFactory.hxx
+++ b/include/sfx2/sidebar/ControllerFactory.hxx
@@ -54,7 +54,7 @@ public:
 
 private:
     static css::uno::Reference<css::frame::XToolbarController> CreateToolBarController(
-        ToolBox* pToolBox,
+        const css::uno::Reference<css::awt::XWindow>& rToolbar,
         const OUString& rsCommandName,
         const css::uno::Reference<css::frame::XFrame>& rxFrame,
         const css::uno::Reference<css::frame::XController>& rxController,
diff --git a/sfx2/source/sidebar/ControllerFactory.cxx b/sfx2/source/sidebar/ControllerFactory.cxx
index edb29abd5280..61ed92452c54 100644
--- a/sfx2/source/sidebar/ControllerFactory.cxx
+++ b/sfx2/source/sidebar/ControllerFactory.cxx
@@ -27,6 +27,7 @@
 
 #include <framework/sfxhelperfunctions.hxx>
 #include <vcl/commandinfoprovider.hxx>
+#include <vcl/weldutils.hxx>
 #include <svtools/generictoolboxcontroller.hxx>
 #include <comphelper/processfactory.hxx>
 #include <toolkit/helper/vclunohelper.hxx>
@@ -47,7 +48,7 @@ Reference<frame::XToolbarController> ControllerFactory::CreateToolBoxController(
 {
     Reference<frame::XToolbarController> xController (
         CreateToolBarController(
-            pToolBox,
+            VCLUnoHelper::GetInterface(pToolBox),
             rsCommandName,
             rxFrame, rxController,
             nWidth));
@@ -142,15 +143,25 @@ Reference<frame::XToolbarController> ControllerFactory::CreateToolBoxController(
     const OUString& rsCommandName,
     const Reference<frame::XFrame>& rxFrame)
 {
-    Reference<frame::XToolbarController> xController;
+    css::uno::Reference<css::awt::XWindow> xWidget(new weld::TransportAsXWindow(&rToolbar));
 
-    xController.set(
-        static_cast<XWeak*>(new svt::GenericToolboxController(
-                ::comphelper::getProcessComponentContext(),
-                rxFrame,
-                rToolbar,
-                rsCommandName)),
-        UNO_QUERY);
+    Reference<frame::XToolbarController> xController(
+        CreateToolBarController(
+            xWidget,
+            rsCommandName,
+            rxFrame, rxFrame->getController(),
+            -1));
+
+    if (!xController.is())
+    {
+        xController.set(
+            static_cast<XWeak*>(new svt::GenericToolboxController(
+                    ::comphelper::getProcessComponentContext(),
+                    rxFrame,
+                    rToolbar,
+                    rsCommandName)),
+            UNO_QUERY);
+    }
 
     // Initialize the controller with eg a service factory.
     Reference<lang::XInitialization> xInitialization (xController, UNO_QUERY);
@@ -187,7 +198,7 @@ Reference<frame::XToolbarController> ControllerFactory::CreateToolBoxController(
 
 
 Reference<frame::XToolbarController> ControllerFactory::CreateToolBarController(
-    ToolBox* pToolBox,
+    const Reference<awt::XWindow>& rxToolbar,
     const OUString& rsCommandName,
     const Reference<frame::XFrame>& rxFrame,
     const Reference<frame::XController>& rxController,
@@ -217,7 +228,7 @@ Reference<frame::XToolbarController> ControllerFactory::CreateToolBarController(
             aPropertyVector.push_back( makeAny( aPropValue ));
 
             aPropValue.Name = "ParentWindow";
-            aPropValue.Value <<= VCLUnoHelper::GetInterface(pToolBox);
+            aPropValue.Value <<= rxToolbar;
             aPropertyVector.push_back( makeAny( aPropValue ));
 
             if (nWidth > 0)


More information about the Libreoffice-commits mailing list