[Libreoffice-commits] online.git: kit/ChildSession.cpp

Jan Holesovsky kendy at collabora.com
Fri Dec 15 16:11:23 UTC 2017


 kit/ChildSession.cpp |    8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)

New commits:
commit 2ef04a64460971d410080b3e8120b9675d6a781e
Author: Jan Holesovsky <kendy at collabora.com>
Date:   Fri Dec 15 17:08:00 2017 +0100

    lokdialog: Fix RGBA vs. BGRA confusion.
    
    Change-Id: I42ce8f46ab09e9b6684ace0627323a013831c571
    Reviewed-on: https://gerrit.libreoffice.org/46564
    Reviewed-by: Jan Holesovsky <kendy at collabora.com>
    Tested-by: Jan Holesovsky <kendy at collabora.com>

diff --git a/kit/ChildSession.cpp b/kit/ChildSession.cpp
index 326dabcd..530c5d98 100644
--- a/kit/ChildSession.cpp
+++ b/kit/ChildSession.cpp
@@ -447,7 +447,9 @@ bool ChildSession::sendFontRendering(const char* /*buffer*/, int /*length*/, con
         return sendTextFrame(output.data(), output.size());
     }
 
-    if (Png::encodeBufferToPNG(ptrFont, width, height, output, LOK_TILEMODE_RGBA))
+    const auto mode = static_cast<LibreOfficeKitTileMode>(getLOKitDocument()->getTileMode());
+
+    if (Png::encodeBufferToPNG(ptrFont, width, height, output, mode))
     {
         bSuccess = sendTextFrame(output.data(), output.size());
     }
@@ -999,8 +1001,10 @@ bool ChildSession::renderWindow(const char* /*buffer*/, int /*length*/, const st
     output.resize(response.size());
     std::memcpy(output.data(), response.data(), response.size());
 
+    const auto mode = static_cast<LibreOfficeKitTileMode>(getLOKitDocument()->getTileMode());
+
     // TODO: use png cache for dialogs too
-    if (!Png::encodeSubBufferToPNG(pixmap.data(), 0, 0, width, height, bufferWidth, bufferHeight, output, LOK_TILEMODE_RGBA))
+    if (!Png::encodeSubBufferToPNG(pixmap.data(), 0, 0, width, height, bufferWidth, bufferHeight, output, mode))
     {
         LOG_ERR("Failed to encode into PNG.");
         return false;


More information about the Libreoffice-commits mailing list