[prev in list] [next in list] [prev in thread] [next in thread] 

List:       koffice-devel
Subject:    Re: Painting on the QImage in QPainter Canvas
From:       "LukasT.dev () gmail ! com" <lukast ! dev () gmail ! com>
Date:       2009-09-03 22:09:05
Message-ID: 200909040009.06071.LukasT.dev () gmail ! com
[Download RAW message or body]

[Attachment #2 (multipart/alternative)]


> > Did you test the patch? Have you seen any performance issues? Also
> > flickering is still present :)
>
> No, and i'm sure you won't see any significant performance issues with
> an eye. But they'll surely be present. It's just another memory-copy
> operation. We needn't it. (copying needs time and expands footprint).
>
> The thing i wanna say: we have three(!) duplications of original
> projection at run time.
> 1) KisPaintLayer::projection()
> 2) KisProjectionCache/KisImagePyramid
> 3) KisPrescaledProjection
>
> This means we have to copy (almost) the same image 3 times before
> drawing it on screen. Do you really want to add the forth step?
>

I found another reason to use QImage as buffer when implementing canvas:

Qt docs says:
<cite>
To get the optimal rendering result using QPainter, you should use the 
platform independent QImage as paint device; i.e. using QImage will ensure 
that the result has an identical pixel representation on any platform.
</cite>

I think we should lower the amount of buffers down in projections and maybe 
they should be able to read from canvas buffer. Although canvas buffer will 
contain also canvas border...At least infinite canvas works that way.

Lukas

[Attachment #5 (text/html)]

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN" \
"http://www.w3.org/TR/REC-html40/strict.dtd"><html><head><meta name="qrichtext" \
content="1" /><style type="text/css">p, li { white-space: pre-wrap; \
}</style></head><body style=" font-family:'Sans Serif'; font-size:10pt; \
font-weight:400; font-style:normal;">&gt; &gt; Did you test the patch? Have you seen \
any performance issues? Also<br> &gt; &gt; flickering is still present :)<br>
&gt;<br>
&gt; No, and i'm sure you won't see any significant performance issues with<br>
&gt; an eye. But they'll surely be present. It's just another memory-copy<br>
&gt; operation. We needn't it. (copying needs time and expands footprint).<br>
&gt;<br>
&gt; The thing i wanna say: we have three(!) duplications of original<br>
&gt; projection at run time.<br>
&gt; 1) KisPaintLayer::projection()<br>
&gt; 2) KisProjectionCache/KisImagePyramid<br>
&gt; 3) KisPrescaledProjection<br>
&gt;<br>
&gt; This means we have to copy (almost) the same image 3 times before<br>
&gt; drawing it on screen. Do you really want to add the forth step?<br>
&gt;<br>
<p style="-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; \
margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; \
-qt-user-state:0;"><br></p>I found another reason to use QImage as buffer when \
implementing canvas:<br> <p style="-qt-paragraph-type:empty; margin-top:0px; \
margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; \
text-indent:0px; -qt-user-state:0;"><br></p>Qt docs says:<br> &lt;cite&gt;<br>
To get the optimal rendering result using QPainter, you should use the platform \
independent <a href="http://doc.trolltech.com/4.5/qimage.html"><span style=" \
text-decoration: underline; color:#0057ae;">QImage</span></a> as paint device; i.e. \
using <a href="http://doc.trolltech.com/4.5/qimage.html"><span style=" \
text-decoration: underline; color:#0057ae;">QImage</span></a> will ensure that the \
result has an identical pixel representation on any platform.<br> &lt;/cite&gt;<br>
<p style="-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; \
margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; \
-qt-user-state:0;"><br></p>I think we should lower the amount of buffers down in \
projections and maybe they should be able to read from canvas buffer. Although canvas \
buffer will contain also canvas border...At least infinite canvas works that way.<br> \
<p style="-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; \
margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; \
-qt-user-state:0;"><br></p>Lukas</p></body></html>



_______________________________________________
koffice-devel mailing list
koffice-devel@kde.org
https://mail.kde.org/mailman/listinfo/koffice-devel


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic