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

Luboš Luňák (via logerrit) logerrit at kemper.freedesktop.org
Tue Jan 14 11:16:28 UTC 2020


 external/skia/Library_skia.mk                  |   10 -
 external/skia/UnpackedTarball_skia.mk          |    1 
 external/skia/msvc-vectorcall-sse.patch.1      |   25 +++
 extras/source/glade/libreoffice-catalog.xml.in |    3 
 include/sfx2/charwin.hxx                       |   32 ---
 sfx2/source/control/charwin.cxx                |  205 -------------------------
 solenv/bin/native-code.py                      |    1 
 7 files changed, 27 insertions(+), 250 deletions(-)

New commits:
commit 51882d9ec5a139bc7bc282ebf4ab03ada9ff2694
Author:     Luboš Luňák <l.lunak at collabora.com>
AuthorDate: Mon Jan 13 13:33:41 2020 +0100
Commit:     Luboš Luňák <l.lunak at collabora.com>
CommitDate: Tue Jan 14 12:16:09 2020 +0100

    fix Skia CPU instruction set support (tdf#129546)
    
    It was a mistake to compile the SkOpts.cpp file with the highest
    CPU set available. I got confused by what SK_CPU_SSE_LEVEL means.
    That setting is the lowest set supported, so we should leave
    it at whatever Skia's SkPreConfig.h detects it to be from the actual
    compiler flags (the ones used for building everything).
    SkOpts::init() does runtime checks only for sets _lower_ than what
    SK_CPU_SSE_LEVEL says, so by compiling the file with the highest set
    all these runtime checks got disabled and it was assumed that
    the set defined by SK_CPU_SSE_LEVEL is always available.
    
    Change-Id: I839370645a9cafbede2d37017b9332cc739fc317
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/86682
    Tested-by: Jenkins
    Reviewed-by: Luboš Luňák <l.lunak at collabora.com>

diff --git a/external/skia/Library_skia.mk b/external/skia/Library_skia.mk
index ecebc4a4fe14..9a619a9d51dd 100644
--- a/external/skia/Library_skia.mk
+++ b/external/skia/Library_skia.mk
@@ -208,6 +208,7 @@ $(eval $(call gb_Library_add_generated_exception_objects,skia,\
     UnpackedTarball/skia/src/core/SkNormalFlatSource \
     UnpackedTarball/skia/src/core/SkNormalMapSource \
     UnpackedTarball/skia/src/core/SkNormalSource \
+    UnpackedTarball/skia/src/core/SkOpts \
     UnpackedTarball/skia/src/core/SkOverdrawCanvas \
     UnpackedTarball/skia/src/core/SkPaint \
     UnpackedTarball/skia/src/core/SkPaintPriv \
@@ -815,15 +816,6 @@ $(eval $(call gb_Library_add_generated_exception_objects,skia,\
     UnpackedTarball/skia/src/opts/SkOpts_ssse3, $(CXXFLAGS_INTRINSICS_SSSE3) \
 ))
 
-# Compile this file with the best intrinsics available.
-$(eval $(call gb_Library_add_generated_exception_objects,skia,\
-    UnpackedTarball/skia/src/core/SkOpts, \
-    $(CXXFLAGS_INTRINSICS_SSSE3) \
-    $(CXXFLAGS_INTRINSICS_SSE41) $(CXXFLAGS_INTRINSICS_SSE42) \
-    $(CXXFLAGS_INTRINSICS_AVX) \
-    $(CXXFLAGS_INTRINSICS_AVX2) $(CXXFLAGS_INTRINSICS_F16C) $(CXXFLAGS_INTRINSICS_FMA) \
-))
-
 $(eval $(call gb_Library_add_generated_exception_objects,skia,\
     UnpackedTarball/skia/tools/gpu/vk/VkTestUtils \
     UnpackedTarball/skia/tools/sk_app/GLWindowContext \
diff --git a/external/skia/UnpackedTarball_skia.mk b/external/skia/UnpackedTarball_skia.mk
index e050b9832d6b..6ad0bdc455dc 100644
--- a/external/skia/UnpackedTarball_skia.mk
+++ b/external/skia/UnpackedTarball_skia.mk
@@ -26,6 +26,7 @@ skia_patches := \
     Wdeprecated-copy-dtor.patch.0 \
     fix-msvc.patch.1 \
     fix-gcc-x86.patch.1	\
+    msvc-vectorcall-sse.patch.1 \
 
 $(eval $(call gb_UnpackedTarball_set_patchlevel,skia,1))
 
diff --git a/external/skia/msvc-vectorcall-sse.patch.1 b/external/skia/msvc-vectorcall-sse.patch.1
new file mode 100644
index 000000000000..f06dca41cff3
--- /dev/null
+++ b/external/skia/msvc-vectorcall-sse.patch.1
@@ -0,0 +1,25 @@
+From 9a75d6249ed5c5eff36d70db2a9b87000437fc09 Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?Lubo=C5=A1=20Lu=C5=88=C3=A1k?= <l.lunak at centrum.cz>
+Date: Mon, 13 Jan 2020 14:34:12 +0100
+Subject: [PATCH] MSVC's __vectorcall does not work with /arch:SSE
+
+---
+ src/opts/SkRasterPipeline_opts.h | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/src/opts/SkRasterPipeline_opts.h b/src/opts/SkRasterPipeline_opts.h
+index 692530828f..7f2b473d82 100644
+--- a/src/opts/SkRasterPipeline_opts.h
++++ b/src/opts/SkRasterPipeline_opts.h
+@@ -1047,7 +1047,7 @@ static const size_t N = sizeof(F) / sizeof(float);
+     // TODO: crashes during compilation  :(
+     #define ABI __attribute__((sysv_abi))
+     #define JUMPER_NARROW_STAGES 0
+-#elif defined(_MSC_VER)
++#elif defined(_MSC_VER) && SK_CPU_SSE_LEVEL >= SK_CPU_SSE_LEVEL_SSE2
+     // Even if not vectorized, this lets us pass {r,g,b,a} as registers,
+     // instead of {b,a} on the stack.  Narrow stages work best for __vectorcall.
+     #define ABI __vectorcall
+-- 
+2.16.4
+
commit 3888b5e0000c27c0f1de283e05a6daf0196553b4
Author:     Caolán McNamara <caolanm at redhat.com>
AuthorDate: Mon Jan 13 11:53:28 2020 +0000
Commit:     Caolán McNamara <caolanm at redhat.com>
CommitDate: Tue Jan 14 12:15:56 2020 +0100

    SvxCharViewControl is newly unused
    
    Change-Id: I8319f6498b6c2adf74c94c76d78aa02cabc01c64
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/86689
    Tested-by: Jenkins
    Reviewed-by: Caolán McNamara <caolanm at redhat.com>

diff --git a/extras/source/glade/libreoffice-catalog.xml.in b/extras/source/glade/libreoffice-catalog.xml.in
index 6e548251266f..1b43f651ac91 100644
--- a/extras/source/glade/libreoffice-catalog.xml.in
+++ b/extras/source/glade/libreoffice-catalog.xml.in
@@ -141,9 +141,6 @@
                         generic-name="DataTreeListBox" parent="GtkTreeView"
                         icon-name="widget-gtk-treeview"/>
 
-    <glade-widget-class title="Char Win" name="sfxlo-SvxCharViewControl"
-                        generic-name="ShowText" parent="GtkDrawingArea"
-                        icon-name="widget-gtk-drawingarea"/>
     <glade-widget-class title="Notebook switching tabs depending on context" name="sfxlo-NotebookbarTabControl"
                         generic-name="NotebookbarTabControl" parent="GtkNotebook"
                         icon-name="widget-gtk-notebook"/>
diff --git a/include/sfx2/charwin.hxx b/include/sfx2/charwin.hxx
index 06d971d0f304..26337be0913d 100644
--- a/include/sfx2/charwin.hxx
+++ b/include/sfx2/charwin.hxx
@@ -21,7 +21,6 @@
 #define INCLUDED_SFX2_INC_CHARWIN_HXX
 
 #include <sfx2/dllapi.h>
-#include <vcl/ctrl.hxx>
 #include <vcl/customweld.hxx>
 #include <vcl/virdev.hxx>
 #include <vcl/weld.hxx>
@@ -71,37 +70,6 @@ public:
     void ContextMenuSelect(const OString& rIdent);
 };
 
-class SvxCharViewControl final : public Control
-{
-public:
-    SvxCharViewControl(vcl::Window* pParent);
-
-    void            SetFont( const vcl::Font& rFont );
-    void            SetText( const OUString& rText ) override;
-    void            InsertCharToDoc();
-
-    void            createContextMenu();
-
-    virtual void    Resize() override;
-
-    virtual Size    GetOptimalSize() const override;
-
-    void setMouseClickHdl(const Link<SvxCharViewControl*,void> &rLink);
-
-private:
-    virtual void    Paint(vcl::RenderContext& rRenderContext, const ::tools::Rectangle&) override;
-
-    virtual void MouseButtonDown( const MouseEvent& rMEvt ) override;
-
-    virtual void KeyInput( const KeyEvent& rKEvt ) override;
-
-    long            mnY;
-    Point           maPosition;
-    vcl::Font       maFont;
-
-    Link<SvxCharViewControl*, void> maMouseClickHdl;
-};
-
 #endif
 
 /* vim:set shiftwidth=4 softtabstop=4 expandtab cinoptions=b1,g0,N-s cinkeys+=0=break: */
diff --git a/sfx2/source/control/charwin.cxx b/sfx2/source/control/charwin.cxx
index e13032d7be08..3c2e72317db3 100644
--- a/sfx2/source/control/charwin.cxx
+++ b/sfx2/source/control/charwin.cxx
@@ -18,11 +18,9 @@
  */
 
 #include <vcl/settings.hxx>
-#include <vcl/builderfactory.hxx>
 #include <vcl/virdev.hxx>
 #include <vcl/event.hxx>
 #include <vcl/svapp.hxx>
-#include <vcl/syswin.hxx>
 #include <sfx2/charwin.hxx>
 #include <comphelper/dispatchcommand.hxx>
 #include <comphelper/processfactory.hxx>
@@ -274,207 +272,4 @@ void SvxCharView::SetHasInsert( bool bInsert )
     maHasInsert = bInsert;
 }
 
-SvxCharViewControl::SvxCharViewControl(vcl::Window* pParent)
-    : Control(pParent, WB_TABSTOP | WB_BORDER)
-    , mnY(0)
-    , maPosition(0,0)
-{
-}
-
-VCL_BUILDER_FACTORY(SvxCharViewControl)
-
-void SvxCharViewControl::MouseButtonDown( const MouseEvent& rMEvt )
-{
-    Control::MouseButtonDown(rMEvt);
-
-    if ( rMEvt.IsLeft() )
-    {
-        if ( !(rMEvt.GetClicks() % 2) )
-        {
-            InsertCharToDoc();
-        }
-
-        maMouseClickHdl.Call(this);
-    }
-
-    // suppress context menu on floating windows
-    if (rMEvt.IsRight() && GetSystemWindow()->GetType() != WindowType::FLOATINGWINDOW)
-    {
-        Point aPosition (rMEvt.GetPosPixel());
-        maPosition = aPosition;
-        GrabFocus();
-        Invalidate();
-        createContextMenu();
-    }
-}
-
-void SvxCharViewControl::KeyInput( const KeyEvent& rKEvt )
-{
-    vcl::KeyCode aCode = rKEvt.GetKeyCode();
-
-    switch (aCode.GetCode())
-    {
-        case KEY_SPACE:
-        case KEY_RETURN:
-            InsertCharToDoc();
-            break;
-    }
-    Control::KeyInput(rKEvt);
-}
-
-void SvxCharViewControl::InsertCharToDoc()
-{
-    if(GetText().isEmpty())
-        return;
-
-    uno::Reference< uno::XComponentContext > xContext( comphelper::getProcessComponentContext() );
-
-    uno::Sequence<beans::PropertyValue> aArgs(2);
-    aArgs[0].Name = "Symbols";
-    aArgs[0].Value <<= GetText();
-
-    aArgs[1].Name = "FontName";
-    aArgs[1].Value <<= maFont.GetFamilyName();
-
-    uno::Reference<frame::XFrame> xFrame = SfxViewFrame::Current()->GetFrame().GetFrameInterface();
-    comphelper::dispatchCommand(".uno:InsertSymbol", xFrame, aArgs);
-}
-
-void SvxCharViewControl::createContextMenu()
-{
-    ScopedVclPtrInstance<PopupMenu> pItemMenu;
-    pItemMenu->InsertItem(0,SfxResId(STR_CLEAR_CHAR));
-    pItemMenu->InsertItem(1,SfxResId(STR_CLEAR_ALL_CHAR));
-    pItemMenu->Execute(this, tools::Rectangle(maPosition,Size(1,1)), PopupMenuFlags::ExecuteDown);
-    Invalidate();
-}
-
-void SvxCharViewControl::Paint(vcl::RenderContext& rRenderContext, const ::tools::Rectangle&)
-{
-    rRenderContext.SetFont(maFont);
-
-    const StyleSettings& rStyleSettings = Application::GetSettings().GetStyleSettings();
-    const Color aWindowTextColor(rStyleSettings.GetFieldTextColor());
-    Color aHighlightColor(rStyleSettings.GetHighlightColor());
-    Color aHighlightTextColor(rStyleSettings.GetHighlightTextColor());
-    Color aFillColor(rStyleSettings.GetWindowColor());
-    Color aTextColor(rStyleSettings.GetWindowTextColor());
-
-    const OUString aText = GetText();
-    const Size aSize(GetOutputSizePixel());
-
-    long nAvailWidth = aSize.Width();
-    long nWinHeight = GetOutputSizePixel().Height();
-
-    bool bGotBoundary = true;
-    bool bShrankFont = false;
-    vcl::Font aOrigFont(rRenderContext.GetFont());
-    Size aFontSize(aOrigFont.GetFontSize());
-    ::tools::Rectangle aBoundRect;
-
-    for (long nFontHeight = aFontSize.Height(); nFontHeight > 0; nFontHeight -= 1)
-    {
-        if (!rRenderContext.GetTextBoundRect( aBoundRect, aText ) || aBoundRect.IsEmpty())
-        {
-            bGotBoundary = false;
-            break;
-        }
-
-        //only shrink in the single glyph large view mode
-        long nTextWidth = aBoundRect.GetWidth();
-        if (nAvailWidth > nTextWidth)
-            break;
-        vcl::Font aFont(aOrigFont);
-        aFontSize.setHeight( nFontHeight );
-        aFont.SetFontSize(aFontSize);
-        rRenderContext.SetFont(aFont);
-        mnY = (nWinHeight - GetTextHeight()) / 2;
-        bShrankFont = true;
-    }
-
-    Point aPoint(2, mnY);
-
-    if (!bGotBoundary)
-        aPoint.setX( (aSize.Width() - rRenderContext.GetTextWidth(aText)) / 2 );
-    else
-    {
-        // adjust position
-        aBoundRect += aPoint;
-
-        // vertical adjustment
-        int nYLDelta = aBoundRect.Top();
-        int nYHDelta = aSize.Height() - aBoundRect.Bottom();
-        if( nYLDelta <= 0 )
-            aPoint.AdjustY( -(nYLDelta - 1) );
-        else if( nYHDelta <= 0 )
-            aPoint.AdjustY(nYHDelta - 1 );
-
-        // centrally align glyph
-        aPoint.setX( -aBoundRect.Left() + (aSize.Width() - aBoundRect.GetWidth()) / 2 );
-    }
-
-    if (HasFocus())
-    {
-        rRenderContext.SetFillColor(aHighlightColor);
-        rRenderContext.DrawRect(tools::Rectangle(Point(0, 0), Size(GetOutputSizePixel().Width(), GetOutputSizePixel().Height())));
-
-        rRenderContext.SetTextColor(aHighlightTextColor);
-        rRenderContext.DrawText(aPoint, aText);
-    }
-    else
-    {
-        rRenderContext.SetFillColor(aFillColor);
-        rRenderContext.DrawRect(tools::Rectangle(Point(0, 0), Size(GetOutputSizePixel().Width(), GetOutputSizePixel().Height())));
-
-        rRenderContext.SetTextColor(aWindowTextColor);
-        rRenderContext.DrawText(aPoint, aText);
-    }
-    rRenderContext.SetFillColor(aFillColor);
-    rRenderContext.SetTextColor(aTextColor);
-
-    if (bShrankFont)
-        rRenderContext.SetFont(aOrigFont);
-}
-
-void SvxCharViewControl::setMouseClickHdl(const Link<SvxCharViewControl*,void> &rLink)
-{
-    maMouseClickHdl = rLink;
-}
-
-void SvxCharViewControl::SetFont( const vcl::Font& rFont )
-{
-    long nWinHeight = GetOutputSizePixel().Height();
-    maFont = rFont;
-    maFont.SetWeight(WEIGHT_NORMAL);
-    maFont.SetAlignment(ALIGN_TOP);
-    maFont.SetFontSize(PixelToLogic(Size(0, nWinHeight / 2)));
-    maFont.SetTransparent(true);
-    Control::SetFont(maFont);
-
-    mnY = (nWinHeight - GetTextHeight()) / 2;
-
-    Invalidate();
-}
-
-Size SvxCharViewControl::GetOptimalSize() const
-{
-    const vcl::Font &rFont = GetFont();
-    const Size rFontSize = rFont.GetFontSize();
-    long nWinHeight = LogicToPixel(rFontSize).Height() * 2;
-    return Size( GetTextWidth( GetText() ) + 2 * 12, nWinHeight );
-}
-
-void SvxCharViewControl::Resize()
-{
-    Control::Resize();
-    SetFont(GetFont());
-}
-
-
-void SvxCharViewControl::SetText( const OUString& rText )
-{
-    Control::SetText( rText );
-    Invalidate();
-}
-
 /* vim:set shiftwidth=4 softtabstop=4 expandtab cinoptions=b1,g0,N-s cinkeys+=0=break: */
diff --git a/solenv/bin/native-code.py b/solenv/bin/native-code.py
index 3cdcf933f84a..10d4f73dab7b 100755
--- a/solenv/bin/native-code.py
+++ b/solenv/bin/native-code.py
@@ -513,7 +513,6 @@ custom_widgets = [
     'SearchResultsBox',
     'SidebarToolBox',
     'Svx3DPreviewControl',
-    'SvxCharViewControl',
     'SvxColorListBox',
     'SvxColorValueSet',
     'SvxLightCtl3D',


More information about the Libreoffice-commits mailing list