[Libreoffice-commits] core.git: Branch 'feature/skia' - 2 commits - vcl/skia

Luboš Luňák (via logerrit) logerrit at kemper.freedesktop.org
Wed Oct 23 11:27:20 UTC 2019


 vcl/skia/gdiimpl.cxx |   10 +++++++++-
 vcl/skia/salbmp.cxx  |    8 +++++++-
 2 files changed, 16 insertions(+), 2 deletions(-)

New commits:
commit 55137889b59d24d22b507430363bf66998e93e58
Author:     Luboš Luňák <l.lunak at collabora.com>
AuthorDate: Wed Oct 23 13:25:12 2019 +0200
Commit:     Luboš Luňák <l.lunak at collabora.com>
CommitDate: Wed Oct 23 13:25:57 2019 +0200

    finish Skia toSkRegion()
    
    vcldemo now starts without aborting
    
    Change-Id: Ic9cd382d0f638f2040a0ac5fc204bce13f6768a9

diff --git a/vcl/skia/gdiimpl.cxx b/vcl/skia/gdiimpl.cxx
index c9d5d05ea433..0cad7cd24cd7 100644
--- a/vcl/skia/gdiimpl.cxx
+++ b/vcl/skia/gdiimpl.cxx
@@ -234,7 +234,15 @@ static SkRegion toSkRegion(const vcl::Region& region)
         return SkRegion();
     if (region.IsRectangle())
         return SkRegion(toSkIRect(region.GetBoundRect()));
-    if (!region.HasPolyPolygonOrB2DPolyPolygon())
+    if (region.HasPolyPolygonOrB2DPolyPolygon())
+    {
+        SkPath path;
+        lclPolyPolygonToPath(region.GetAsB2DPolyPolygon(), path);
+        SkRegion skRegion;
+        skRegion.setPath(path, SkRegion(path.getBounds().roundOut()));
+        return skRegion;
+    }
+    else
     {
         SkRegion skRegion;
         RectangleVector rectangles;
commit ee8599e00f2f7d73058b1ccb3188f8eabfc9c8ca
Author:     Luboš Luňák <l.lunak at collabora.com>
AuthorDate: Wed Oct 23 12:46:19 2019 +0200
Commit:     Luboš Luňák <l.lunak at collabora.com>
CommitDate: Wed Oct 23 13:25:55 2019 +0200

    note about SkiaSalBitmap::ConvertToGreyscale() not being worth it
    
    Change-Id: I3056eea5c7b241dab566a900a3ed4b9d6daee74e

diff --git a/vcl/skia/salbmp.cxx b/vcl/skia/salbmp.cxx
index dfe12f57db91..89d9d4937a0c 100644
--- a/vcl/skia/salbmp.cxx
+++ b/vcl/skia/salbmp.cxx
@@ -266,7 +266,13 @@ bool SkiaSalBitmap::Replace(const Color& rSearchColor, const Color& rReplaceColo
     return false;
 }
 
-bool SkiaSalBitmap::ConvertToGreyscale() { return false; }
+bool SkiaSalBitmap::ConvertToGreyscale()
+{
+    // Skia can convert color SkBitmap to a greyscale one (draw using SkCanvas),
+    // but it uses different coefficients for the color->grey conversion than VCL.
+    // So just let VCL do it.
+    return false;
+}
 
 const SkBitmap& SkiaSalBitmap::GetSkBitmap() const
 {


More information about the Libreoffice-commits mailing list