https://bugs.kde.org/show_bug.cgi?id=254784

--- Comment #6 from wolthera <griffinval...@gmail.com> ---
Ok, I am enclosing a pseudo-patch here, because I am not sure how to go about
the stuff in the comments:


diff --git a/libs/ui/opengl/kis_texture_tile_update_info.h
b/libs/ui/opengl/kis_texture_tile_update_info.h
index 60900c9d58..42cd777e13 100644
--- a/libs/ui/opengl/kis_texture_tile_update_info.h
+++ b/libs/ui/opengl/kis_texture_tile_update_info.h
@@ -161,6 +161,8 @@ public:
     void retrieveData(KisPaintDeviceSP projectionDevice, const QBitArray
&channelFlags, bool onlyOneChannelSelected, int selectedChannelIndex)
     {
         m_patchColorSpace = projectionDevice->colorSpace();
+        //This seems like a dangerous thing to do at this place...?
+        bool isLab = m_patchColorSpace->colorModelId() == "LABA";
         m_patchPixels.allocate(m_patchColorSpace->pixelSize());

         projectionDevice->readBytes(m_patchPixels.data(),
@@ -185,6 +187,21 @@ public:
                     for (uint channelIndex = 0; channelIndex <
m_patchColorSpace->channelCount(); ++channelIndex) {

                         if (channelInfo[channelIndex]->channelType() ==
KoChannelInfo::COLOR) {
+                            if (isLab) {
+                                //if we're in lab, only copy the data into the
first color channel(l), and the others filled with gray.
+                                if (channelIndex==0) {
+                                    memcpy(conversionCache.data() +
(pixelIndex * pixelSize) + (channelIndex * channelSize),
+                                           m_patchPixels.data() + (pixelIndex
* pixelSize) + selectedChannelPos,
+                                           channelSize);
+                                } else {
+                                    //something that fills the section with
lab (0.5, 0.5, 0.5)
+                                }
+
+                            } else {
+                                memcpy(conversionCache.data() + (pixelIndex *
pixelSize) + (channelIndex * channelSize),
+                                       m_patchPixels.data() + (pixelIndex *
pixelSize) + selectedChannelPos,
+                                       channelSize);
+                            }
                             memcpy(conversionCache.data() + (pixelIndex *
pixelSize) + (channelIndex * channelSize),
                                    m_patchPixels.data() + (pixelIndex *
pixelSize) + selectedChannelPos,
                                    channelSize);
@@ -204,6 +221,8 @@ public:
                             memcpy(conversionCache.data() + (pixelIndex *
pixelSize) + (channelIndex * channelSize),
                                    m_patchPixels.data() + (pixelIndex *
pixelSize) + (channelIndex * channelSize),
                                    channelSize);
+                        } else if (isLab) {
+                            // fill the section with lab (0.5, 0.5, 0.5)
                         }
                         else {
                             memset(conversionCache.data() + (pixelIndex *
pixelSize) + (channelIndex * channelSize), 0, channelSize);

-- 
You are receiving this mail because:
You are watching all bug changes.

Reply via email to