<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<!DOCTYPE bugzilla SYSTEM "https://bugs.kde.org/page.cgi?id=bugzilla.dtd">

<bugzilla version="5.0.6"
          urlbase="https://bugs.kde.org/"
          
          maintainer="sysadmin@kde.org"
>

    <bug>
          <bug_id>412522</bug_id>
          
          <creation_ts>2019-10-01 22:20:50 +0000</creation_ts>
          <short_desc>Krita freezes when creating Raindrop filter mask</short_desc>
          <delta_ts>2019-10-09 08:40:58 +0000</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>2</classification_id>
          <classification>Applications</classification>
          <product>krita</product>
          <component>Filters</component>
          <version>4.2.7-beta1</version>
          <rep_platform>Microsoft Windows</rep_platform>
          <op_sys>Microsoft Windows</op_sys>
          <bug_status>RESOLVED</bug_status>
          <resolution>FIXED</resolution>
          
          
          <bug_file_loc></bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords></keywords>
          <priority>NOR</priority>
          <bug_severity>normal</bug_severity>
          <target_milestone>---</target_milestone>
          
          
          <everconfirmed>0</everconfirmed>
          <reporter>acc4commissions</reporter>
          <assigned_to name="Krita Bugs">krita-bugs-null</assigned_to>
          <cc>ahab.greybeard</cc>
    
    <cc>halla</cc>
          
          <cf_commitlink>https://invent.kde.org/kde/krita/commit/da5a240daf90407769772eeeb01ee87b1ff88705</cf_commitlink>
          <cf_versionfixedin></cf_versionfixedin>
          <cf_sentryurl></cf_sentryurl>
          <votes>0</votes>

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>1883161</commentid>
    <comment_count>0</comment_count>
    <who name="">acc4commissions</who>
    <bug_when>2019-10-01 22:20:50 +0000</bug_when>
    <thetext>SUMMARY


STEPS TO REPRODUCE
1. load any image. (preferably larger ones)
2. Create a filter mask, and select the Raindrop filter.
3. freeze.

OBSERVED RESULT


EXPECTED RESULT


SOFTWARE/OS VERSIONS
Windows: 
macOS: 
Linux/KDE Plasma: 
(available in About System)
KDE Plasma Version: 
KDE Frameworks Version: 
Qt Version: 

ADDITIONAL INFORMATION</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1883185</commentid>
    <comment_count>1</comment_count>
    <who name="Ahab Greybeard">ahab.greybeard</who>
    <bug_when>2019-10-02 07:07:45 +0000</bug_when>
    <thetext>Using the 4.2.7-beta1 with Linux and a 2000 x 2000 px image, it takes 90 seconds to complete the Raindrop filter. During this time, I can open the brush editor and the settings window, i.e. there is no &apos;freeze&apos;. CPU usage is at about 60-80% while this is happening.

With Windows 10 on the same machine, it takes 8 minutes to complete the Raindrop filter and there is no visible output for the first four minutes. (The canvas is updated in 500 x 500 px blocks and this seems to be common for most filters but most filters are not this slow.)
It makes no difference if I use OpenGL or Angle.
During this time, there is no freeze and CPU usage is about 12%.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1883216</commentid>
    <comment_count>2</comment_count>
    <who name="">acc4commissions</who>
    <bug_when>2019-10-02 11:30:49 +0000</bug_when>
    <thetext>(In reply to Ahab Greybeard from comment #1)
&gt; Using the 4.2.7-beta1 with Linux and a 2000 x 2000 px image, it takes 90
&gt; seconds to complete the Raindrop filter. During this time, I can open the
&gt; brush editor and the settings window, i.e. there is no &apos;freeze&apos;. CPU usage
&gt; is at about 60-80% while this is happening.
&gt; 
&gt; With Windows 10 on the same machine, it takes 8 minutes to complete the
&gt; Raindrop filter and there is no visible output for the first four minutes.
&gt; (The canvas is updated in 500 x 500 px blocks and this seems to be common
&gt; for most filters but most filters are not this slow.)
&gt; It makes no difference if I use OpenGL or Angle.
&gt; During this time, there is no freeze and CPU usage is about 12%.

Ok. But it&apos;s not an expected behavior, is it?</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1883219</commentid>
    <comment_count>3</comment_count>
    <who name="Ahab Greybeard">ahab.greybeard</who>
    <bug_when>2019-10-02 11:57:02 +0000</bug_when>
    <thetext>It&apos;s certainly not reasonable at first sight, especially on Windows 10. (Which OS are you using?)
It may be that the Raindrop filter is famously hungry for CPU resources, I&apos;ve no idea. A developer with more knowledge of those sorts of details may be able to shed more light on this.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1883220</commentid>
    <comment_count>4</comment_count>
    <who name="Halla Rempt">halla</who>
    <bug_when>2019-10-02 12:12:27 +0000</bug_when>
    <thetext>Yes, the raindrops filter cannot be threaded, so it needs to calculate its effects for the whole image on one CPU core. That&apos;s something that cannot be changed, though.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1883233</commentid>
    <comment_count>5</comment_count>
    <who name="Ahab Greybeard">ahab.greybeard</who>
    <bug_when>2019-10-02 15:02:03 +0000</bug_when>
    <thetext>@Boud: The truly strange thing is that the more cores that are allocated to krita then the worse the performance is. For my previous image example, varying the cores allocated:
Linux- 6/8 cores takes 90 seconds - 1/8 cores takes 20 seconds.
Windows 10- 6/8 cores takes 8 minutes - 1/8 cores takes 20 seconds.
(8/8 cores is slightly faster than 6/8 which is the worst case for me.)
I don&apos;t know if this is something that can be &apos;fixed&apos; or if it just has to be accepted. (The Windows 10 results are very puzzling.)

@acc4commissions: If you need to use the Raindrop filter then it seems to be worth trying it with only one core allocated.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1883273</commentid>
    <comment_count>6</comment_count>
    <who name="">acc4commissions</who>
    <bug_when>2019-10-02 20:12:02 +0000</bug_when>
    <thetext>(In reply to Ahab Greybeard from comment #5)
&gt; @acc4commissions: If you need to use the Raindrop filter then it seems to be
&gt; worth trying it with only one core allocated.

I don&apos;t need to use Raindrop filter. It&apos;s just that I have to experience freeze for minutes every time I accidently click the raindrop filter in the list when creating filter mask.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1884157</commentid>
    <comment_count>7</comment_count>
    <who name="wolthera">griffinvalley</who>
    <bug_when>2019-10-07 15:31:36 +0000</bug_when>
    <thetext>Git commit e811af0858972912b07d163c1c088fb174c6fa4c by Wolthera van Hövell tot Westerflier.
Committed on 07/10/2019 at 15:23.
Pushed by woltherav into branch &apos;master&apos;.

Disable adjustmentlayer support on the raindrop filter.

By rule of thumb, filters that cannot multithread should not
be allowed as adjustment layers, (which are, afaik, multithreaded)
so I am half wodering if we should not somehow hardcode whether or
not adjustment layers are supported based on the availability of
multithread, but regardless, it&apos;s best to disable adjustment layers
on this specific filter.

M  +1    -1    plugins/filters/raindropsfilter/kis_raindrops_filter.cpp

https://invent.kde.org/kde/krita/commit/e811af0858972912b07d163c1c088fb174c6fa4c</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1884452</commentid>
    <comment_count>8</comment_count>
    <who name="Halla Rempt">halla</who>
    <bug_when>2019-10-09 08:40:58 +0000</bug_when>
    <thetext>Git commit da5a240daf90407769772eeeb01ee87b1ff88705 by Boudewijn Rempt, on behalf of Wolthera van Hövell tot Westerflier.
Committed on 09/10/2019 at 08:40.
Pushed by rempt into branch &apos;krita/4.2&apos;.

Disable adjustmentlayer support on the raindrop filter.

By rule of thumb, filters that cannot multithread should not
be allowed as adjustment layers, (which are, afaik, multithreaded)
so I am half wodering if we should not somehow hardcode whether or
not adjustment layers are supported based on the availability of
multithread, but regardless, it&apos;s best to disable adjustment layers
on this specific filter.
(cherry picked from commit e811af0858972912b07d163c1c088fb174c6fa4c)

M  +1    -1    plugins/filters/raindropsfilter/kis_raindrops_filter.cpp

https://invent.kde.org/kde/krita/commit/da5a240daf90407769772eeeb01ee87b1ff88705</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>