<?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>386620</bug_id>
          
          <creation_ts>2017-11-07 17:07:46 +0000</creation_ts>
          <short_desc>Canvas framerate limiter might not be working as intended</short_desc>
          <delta_ts>2019-09-25 06:09:01 +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>OpenGL Canvas</component>
          <version>4.0 pre-alpha</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>1</everconfirmed>
          <reporter name="Neviril">nevineviril</reporter>
          <assigned_to name="Bernhard Liebl">poke1024</assigned_to>
          <cc>alvin</cc>
    
    <cc>dimula73</cc>
    
    <cc>halla</cc>
          
          <cf_commitlink></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>1710056</commentid>
    <comment_count>0</comment_count>
    <who name="Neviril">nevineviril</who>
    <bug_when>2017-11-07 17:07:46 +0000</bug_when>
    <thetext>Krita 4.0 pre-alpha (git 86851fa) exposes to the user a frame limiting function under &quot;Settings &gt; Configure Krita &gt; Performance &gt; Advanced &gt; Limit Frames per Second while painting&quot;.

After fiddling around with it for a while, trying different settings (making sure to restart the program to apply the new values), I came to the conclusion that the frame limiting function might not be working as intended, producing as a result an *effective* canvas update framerate that is roughly (slightly more than) half the user set value.


==How to observe it?==

1) Try setting a low frame limit value, like for example 20 fps.
2) Reboot Krita.
3) Create a new image and proceed to recording a short video capture of the desktop/program at the frame rate of the display frequency rate (typically 60 Hz) using for example the open source OBS (Open Broadcast Studio) software, and a small brush at 100% canvas zoom in order to avoid any GPU bottleneck issue.
4) The framerate of the canvas in Krita can then be easily analyzed using a standard video player (e.g. VLC) advancing the video frame by frame.


==Results==

At a Krita canvas fps of 20 fps, and a video framerate of 60 fps, brush strokes and the brush cursor appear to update roughly every 5 or 6 frames (sometimes 4 or 7). This corresponds to an *effective* canvas frame rate of 10-12 fps, which is significantly lower than the user set value.

At a Krita canvas fps of 60 fps (equivalent to the display refresh rate) and again a recording video frame rate of 60 fps, bursh strokes appear to update most of the time 2 frames, less often every frame. In a test, the canvas updated 44 times over the course of 69 frames, implying an actual framerate of about 38 fps. That the canvas updates at a much lower rate than the screen refresh rate is also subjectively noticeable by eye during ordinary program operation.


==System configuration==

Windows 10 64bit Fall Creators Update
AMD Radeon RX480 with Radeon Software 17.11
Intel i5 3550 4-core GPU.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1710138</commentid>
    <comment_count>1</comment_count>
    <who name="Halla Rempt">halla</who>
    <bug_when>2017-11-08 10:39:03 +0000</bug_when>
    <thetext>Bernhard,

Could you take a look? I&apos;m wondering whether this is related to 

commit 4cb82985c37e07d8e628094fb137169c35ac1df6
Author: Bernhard Liebl &lt;poke1024@gmx.de&gt;
Date:   Sun Oct 22 13:51:07 2017 +0200

    Adds a user configuration for maximum fps for canvas updates
    
    Under &quot;Performance / Advanced / Limit Frames per Second&quot; there is now a slider that allows the configuration of the targeted frames per second updates the canvas should receive. This configures the updateSignalCompressor in KisCanvas2 to not trigger update events more often. Having a lower fps gives the main thread more time to do other QT event processing, which could be beneficial one some machines/installations.
    
    Differential Revision: https://phabricator.kde.org/D8193

As Neviril&apos;s bisect seems to suggest.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1711253</commentid>
    <comment_count>2</comment_count>
    <who name="Bernhard Liebl">poke1024</who>
    <bug_when>2017-11-13 22:13:19 +0000</bug_when>
    <thetext>see https://phabricator.kde.org/D8804</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1882135</commentid>
    <comment_count>3</comment_count>
    <who name="Dmitry Kazakov">dimula73</who>
    <bug_when>2019-09-25 06:09:01 +0000</bug_when>
    <thetext>I think I have fixed exactly this bug, when fixing bug 409460. Please check if the problem still persists in the nightly builds (I don&apos;t think it is available in 4.2 branch):

https://binary-factory.kde.org/job/Krita_Nightly_Windows_Build/

If the bug still present, please reopen this report :)</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>