Implementing Vulkan-capable LibreOffice user interface using the Skia library

This work by Collabora Productivity was possible thanks to AMD.

LibreOffice 7.0, just released, includes a new drawing backend based on the Skia library, which allows LibreOffice to use the modern Vulkan API to graphics operations. This Visual Class Library (VCL) backend is the default on the Windows platform, superseding the OpenGL-based backend.

Working on the future of graphics for office productivity

Having multiple VCL backends has its benefit to integrate with different operating systems, but each backend performing its own rendering implementation is far from optimal, since we cannot add new rendering functionality and assume that it will work cross-platform. Many backends across different platforms and toolkits miss optimized paths for various rendering tasks. This adds complexity and makes it hard to ensure that rendering objects happens in an accelerated way everywhere.

Another problem is that multiple backends regularly perform the same type of mapping from VCL’s APIs to what a modern toolkit provides these days. This duplication means not only maintenance cost, but also can lead to having to fix the same bug at multiple places.

Moving away from GDI and OpenGL

The VCL library is responsible for widgets (buttons, controls, etc.) and basic rendering. It does not implement the drawing directly, but it provides an internal API, which is implemented by various backends that implement the actual graphics operations. These backends usually adapt LibreOffice to each platform , for example the ‘win’ backend is used on Windows, the ‘kf5’ and ‘gtk3’ backends are for Unix-like platforms using the KDE Frameworks and the Gtk3 graphics toolkit respectively and there is a ‘headless’ backend used by tests that does not render to the screen.

Each VCL backend uses an underlying graphics API available on the platform to perform the graphics operations. The Cairo library is used by some Unix-like and ‘headless’ backends, the ‘osx’ backend uses the macOS Quartz. On Windows, the ‘win’ backend has several plugable drawing implementations:

  • GDI drawing. This code is relatively old and has several limitations, such as not being double-buffered.
  • OpenGL drawing. This code provides GPU-accelerated drawing. OpenGL is used directly, so all relevant code including OpenGL shaders needed to be implemented in LibreOffice. The OpenGL API is also slowly being phased out in the industry.
  • Skia drawing. The Skia library hides implementation details, and provides several rendering methods, including Vulkan API.

Integrating Skia and Vulkan

The Skia library is not shipped in a binary form, not even by 3rd-party providers such as Linux distributions. It is provided only as source and the usual way to use it in a project is to ship it with that project. LibreOffice includes Skia as a 3rd-party library and fortunately building it using the LibreOffice gbuild system is reasonably simple. An additional complication is that Skia provides a new release roughly every 6 weeks, and generally only the latest release receives any fixes, requiring repeated updates. Since Skia is continually evolving, each update may also require adjustments (although so far it seems they are generally small).

Collabora’s developers taking the first hurdles

The Skia API is generally well documented, but it appears to be mostly aimed at developers already working on a project using Skia, such as Chrome. Important classes have their API well described, but it can be difficult to find tutorials for them and some classes are harder to understand at the beginning (for example, SkPixmap, SkBitmap, SkImage and SkSurface are all classes representing a drawable, but it was unclear at the beginning what the suitable use cases would be for each for them).

Similarly, it is not obvious how to use Skia in a new project. There does not seem to be any actual developer introduction to Skia in the documentation, nor does thereseem to be any documentation on how to setup a new or standalone project using Skia. There is a Hello-World example in the examples/ directory that is based on platform integration code that is not part of the Skia library itself but is inside a sk_app/ directory in the tools/ directory. That code was usable for LibreOffice, but required patching to cover LibreOffice needs (for example, the code created a new graphics context for each toplevel window, and Skia requires proper graphic context to be used in drawing operations, but LibreOffice code sometimes does not know which toplevel window will use the result of a drawing).

LibreOffice is a fairly old codebase, and still uses relatively old concepts such as paletted bitmaps, low-resolution bitmaps (such as 4bpp) or drawing that uses the XOR operation on pixels. Skia, being a relatively new library, has features that assume modern concepts are used (for example, RGB bitmaps are required to be 32bpp with unused alpha channel, 24bpp RGB bitmaps are not supported).

 

AMD Skia / Vulkan integrated in a alpha-release of LibreOffice 7.0

 

Once the initial learning period is over, Skia is consistent in its API and reasonable flexible to use allowing progress to be relatively fast. Code using Skia is very readable, and using Skia makes future maintainance tasks easier to perform. Even some old concepts, such as LibreOffice using a separate bitmap for alpha channel, sometimes interpreted as 8bpp and sometimes as alpha, later blended with data bitmap to get the actual result, could be mostly implemented using Skia API, making them GPU-accelerated.

Nice performance and even room for improving

While there were some concerns about how performance would be affected by moving to Skia compared to OpenGL driver and and hardware implementations that have been heavily optimized over the past several decades, it turns out that performance within LibreOffice is at least equivalent to the OpenGL version and synthetic benchmarks show that there is room for improvement.

Benefits for LibreOffice-technology

While somewhat complicated at the beginning, using Skia in LibreOffice has been in general a rather pleasant experience. In the future LibreOffice’s use of Skia could be extended to other platforms, reducing the number of platform rendering APIs used, eliminating duplicated code, reducing bug count and generally improving quality.

For comparison, LibreOffice OpenGL drawing code is roughly 12k lines of code, while Skia drawing code is only 4k.

Apart from the immediate benefits, moving to Skia and Vulkan on Windows paves the way for a single, powerful, hardware-accelerated rendering API cross-platform.

Moving to Skia on Windows required about 7 person-months ol, which lets us use Vulkan acceleration without large implementation costs. It will be interesting to see how much time is saved in the next few years from the reduced maintenance cost. The resulting work is mature enough that there is no real negative change in performance, and we have not started heavily optimizing yet.

Read More

Ad Visible Digital Signatures to Existing PDF Files in Collabora Office 6.4

Collabora Office already had the capability to add a digital signature to an existing PDF file. The PDF file was to be selected, starting with File > Digital Signatures > Sign existing PDF. This still works the same now. The file is then opened as read only in Draw and the button Sign Document on the notification bar, allows you to add a digital signature. That signature however is (and was) only visible on the status bar and in file properties. There is no visible signature in the PDF file.

Now in Collabora Office 6.4 it is possible to ad visible signatures too.

 

Adding a Visible Digital Signature

To achieve this, the procedure starts the same: select the PDF file with File > Digital Signatures > Sign existing PDF. Then, as the file is read only in Draw, choose File > Digital Signatures > Signature Line.
 
After opening the PDF for signing, again use File > Digital Signatures ..

The mouse pointer changes, and it is possible to drag a rectangle in the file. When the mouse is released, the dialog to select the signature appears.

 

When done, the notification bar now indicates the button Finish Signing. Click that and the digital signature will be confirmed. The rectangle, showing a picture and information about the signature, can be resized before signing is finished.

 

If needed, the signature image can be resized

After that, again all is read only – of course. It is possible however to add another signature, so that for example more people can sign.

 

Confirm signing the PDF file

Some more background details can be found in the developer blog by Miklos Vajna. Thanks to the Dutch Ministry of Defense in cooperation with Nou&Off who made this work by Collabora possible.

Read more about Collabora Office 6.4

Read all about the new Collabora Office 6.4. Or try it yourself! Just head to the Collabora Office page and request your demo today, or simply click the button below.

Try the Demo

Read More

Collabora Online and mobile now with full CJK support

Starting from today’s release more users around the globe will benefit from Collabora Office on iOS and Android! With the just released version 4.2.6 there is full support of CJK fonts and also the user interface has various related improvements.
Fonts available on your mobile device for Chinese, Japanese, Korean, Hindi, Arabic and other scripts, will now be used by the app. This gives many new users the native usability they need, the privacy and control over their data with a quality product they expect from a Collabora.

The latest Collabora Online has some related improvements too.

 

Which scripts are now supported

The updated Collabora Office mobile apps do now support a wide range of scripts and fonts natively available on your phone. Namely, those are:

  • Chinese (Mandarin, simplified)
  • Chinese (Mandarin, traditional)
  • Hindi
  • Japanese
  • Korean
  • Thai
  • Vietnamese
Example of Writer document with different Asian fonts

Improvement in fontconfig

The support for Chinese, Japanese, Korean, Arabic, and other previously unsupported scripts, could be added thanks to a performance fix in fontconfig. This allows resulted in a much improved loading time of the app. Thanks to Behdad Esfahbod (branch faster), fontconfig authors and contributors, and Michael Weghorn (for updating fontconfig) for their work on this!

All info

Do you want to learn more about the mobile office apps by Collabora Productivity? Find all the relevant info summarized on the product page. A good reference for those interested in the detailed development progress of Collabora Office for Android & iOS are the latest release notes. If you want to find out about the history of the apps and the people and entities involved, we suggest you take a look at our detailed chronological credits article.

For information about Collabora Online, see the release notes and the initial announcement of version 4.2.

Get Collabora Online

Collabora Online is the business ready supported product for professional use. Collabora products are built on LibreOffice technology. Collabora is the creator of LibreOffice online.

Get Collabora Office

Collabora Office for Android and iOS enables editing of documents on the go and is developed with your privacy in mind. Download it for free from the App Store of from Google Play.

Read More

Collabora Office ships for Chromebooks

London, July 24 2020 – Collabora Productivity, the driving force behind LibreOffice in the cloud, announces the immediate availability of Collabora Office for Chromebooks, its first native productivity tool for Chrome OS.

User control of documents on Chrome OS

Chromebooks are popular, and their use continues to grow rapidly. However, until now they have lacked a rich office productivity tool that users could combine with their choice of storage, to regain control over their files and privacy.

Today, we make a new release of Collabora Office, the LibreOffice-technology based suite for professional, mobile, and online use, available ready to run on Chromebooks!

Privacy Shield

Chromebooks are not the only relevant positive trend. The desire to keep control over data and document storage is another. With digital sovereignty becoming a hot topic for regional and national administrations and by the EU, who have launched a special program in this area.

The recent EU court ruling that declares that the US Privacy Shield conflicts with the GDPR, has further raised people’s awareness of digital freedom and sovereignty.

Education

Since Chromebooks are attractive and affordable PCs, they are present everywhere these days and with today’s release of Collabora Office, users control over their files and privacy is back. Because of the rich features it is not needed to use Microsoft or Google for professional use or for study. These benefits, make education an area where both Collabora Online and Chromebooks are widely used.

Collabora is thrilled to provide even more convenient products for schools and universities. […] We are glad to serve our many partners in the education market, and together to protect the privacy of students.”
– Michael Meeks, General Manager at Collabora Productivity

Collabora Products are popular because they allow organizations to have applications and storage on-site and be GDPR compliant, still working with excellent collaboration and interoperability tools for office productivity.

Rich editing, work with images, comment and more in windows mode

Working with partners

While Collabora has developed almost the entirety of this mobile technology and UX, we are profoundly grateful for support from our partners. For this release, we are indebted to AMD for helping to bring the existing Android app to their next generation of extraordinary Chromebooks.

Really richly featured

Chromebook’s popularity clearly shows that businesses and education increasingly opt for the reliable and straightforward Google platform. But do users get a great feature richness to work on their files?
With the new Collabora Office, users get an app that not only supports all their documents (from Microsoft formats DOCX, XLSX, PPTX, DOC, XLS, PPT to the open standards ODF) and offers viewing and working on text and contents, but also provides rich editing with a handsome interface for e.g., images, page formatting, charts, and indices.


Setting the right Bullets and Numbering style

Working with Columns in text files

Save to your private cloud only

Private friendly cloud storage solutions, such as Nextcloud and ownCloud, provide plugins for Chrome OS that allow users to write directly to their private cloud, without having to save to the device first, after which the file would be saved directly on the Google or Microsoft server storage as well..

Collabora Office matches perfectly with the wish to save directly to your own cloud. It allows users to use the mentioned plugins with ease and not be forced to save their office documents to someone else’s server anymore.

Arriving ahead of native platform curve

With the release of Collabora Office for mobile devices version 4.2.5, Chrome OS is fully supported by Collabora Office. Our products now run on iOS, Windows, Android, Chromebook, and Linux and of course, in any modern browser.

Collabora Office brings its first native productivity tool for Chrome OS, ahead of Google’s recently announced work to bring Microsoft’s Office to Chromebooks. The currently available mobile Microsoft Office apps in contrast provides just a limited set of features.

Remember that, to be able to enjoy the Collabora Online on a Chromebook, a recent version of Chrome OS, that includes the Android Runtime (for Google Play), is required.

On the technical side, the new Collabora Office release supports two new platforms: x86 and AMD64. X86 was needed to run native on the Chromebooks, and with AMD64 we matched the need for a a 64-bit version, as required by Google Play.

Users of Collabora Office on Android may remember that the first Android builds were able to start up on Chromebooks. However that was by coincidence. These worked under a slower emulation, and were missing lots of required polishing and performance.

Collabora Office for Chrome OS can be installed from Google Play

 


More information

Read More

Collabora’s LibreOffice development experts are supporting students for GSoC 2020

Collabora developers are mentoring students during this year’s Google Summer of Code

Google Summer of Code is an amazing, international program encouraging the participation of university students in open source software development. It enables students to independently gain practical experience on concrete projects and matches them with experienced developers. This year a record number of almost 1200 students is taking part in the sponsored projects. Collabora is always delighted to support GSoC projects: some of our experienced developers are mentoring the students: guiding them in the code, encouraging them, and supporting the growth of their skills.

Collabora developers at GSoC 2020

Also for this year’s GSoC several students are being mentored by Collabora Productivity team members. Tomaž Vajngerl, Muhammet Kara, Miklos Vajna, Mike Kaganski, and Michael Meeks are assisting the work on several projects around LibreOffice. And our companies involvement is not just limited to that. Andrej Shadura, a developer from our parent company Collabora, is in charge of various projects around the Debian operating system. Collabora’s support of these Google Summer of Code reflects our commitment to open source software and is also a matter of personal attachment. Several of today’s Collaborans like Elie Tournier and Rohan Garg have successfully participated in the GSoC program in the past. So have the current mentors Muhammet Kara, Miklos Vajna, and Pranam Lashkari from Collabora Productivity team.

A success story – development camps in Turkey

The successful application of no less than six LibreOffice office projects for this year’s Summer of Code would not be fully told without mentioning some previous happenings in winter. Collabora Productivity had sponsored the LibreOffice Developer Bootcamp in Ankara and the LibreOffice Development Workshop at the Anadolu University in Eskişehir (Turkey) during the Free Software Wintercamp 2020. These ambitious development courses by Muhammet Kara spawned no less than three of the six successfully submitted LibreOffice projects of GSoC 2020. Find out more about the great outcome of these development camps within our community news blog post.

LibreOffice projects mentored by Collabora Productivity

The student Ahmad Ganzouri has successfully submitted two projects. Supported by the mentors Tomaž Vajngerl, Miklos Vajna, and Michael Meeks, he will work on a project adding blurry shadows to objects in LibreOffice and on a second one that aims to move the current gallery data in favour to easier to handle ZIP files. Yusuf Keten, another participant of the LibreOffice Developers Bootcamp in Ankara, will be working on additions to better integrate extensions. Keten’s project is being mentored by Collabora’s Muhammet Kara.

Also Collabora’s parent company developers are mentoring

Another interesting GSoC project is bringing a CiviCRM integration to LibreOffice and Collabora Office. “Styles Inspector“, also mentored by Tomaž Vajngerl, is another project aimed at LibreOffice. We all look forward to the results of the students work. And for sure we will try to cover some of that here. Another wonderful story is that of Collabora Productivity developer Pranam Lashkari. He was a GSoC student during the last two years while graduating and this year he is already a mentor for two projects within the Boost C++ libraries. Collabora developer Andrej Shadura is mentoring no less than three projects focusing on Android SDK Tools for the Debian operating system. Find out more about these and other noteworthy projects in the Collabora news blog.

About Google Summer of Code

Google Summer of Code is a program awarding a three months stipend to students who successfully complete a free and open-source software coding project during the summer. The annual program started in 2005. This year, 199 organizations and 1199 student projects are taking part. Within the last 15 years more than 15.000 students from over 100 countries had been accepted. Developers from free and open source projects serve as mentors. Between 80 – 90% of the accepted projects get completed successfully.

Read More