You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@pivot.apache.org by "Todd Volkert (JIRA)" <ji...@apache.org> on 2009/04/09 20:26:12 UTC

[jira] Created: (PIVOT-66) Optimize Viewport by only painting the revealed area

Optimize Viewport by only painting the revealed area
----------------------------------------------------

                 Key: PIVOT-66
                 URL: https://issues.apache.org/jira/browse/PIVOT-66
             Project: Pivot
          Issue Type: Improvement
          Components: wtk
    Affects Versions: 1.1
            Reporter: Todd Volkert
            Assignee: Todd Volkert
            Priority: Minor
             Fix For: 1.1.1


We can cache the paint results of a Viewport in a BufferedImage and re-use that image when the scroll top or scroll left changes, thus enabling us to clip the paint region to just the bounds that were revealed by the scroll change.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Resolved: (PIVOT-66) Optimize Viewport by only painting the revealed area

Posted by "Todd Volkert (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/PIVOT-66?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Todd Volkert resolved PIVOT-66.
-------------------------------

       Resolution: Fixed
    Fix Version/s:     (was: 1.3)
                   1.2

This is done, and it shows from a 70% to a 95% improvement in scrolling efficiency depending on the size of the viewport.

> Optimize Viewport by only painting the revealed area
> ----------------------------------------------------
>
>                 Key: PIVOT-66
>                 URL: https://issues.apache.org/jira/browse/PIVOT-66
>             Project: Pivot
>          Issue Type: Improvement
>          Components: wtk
>    Affects Versions: 1.1
>            Reporter: Todd Volkert
>            Assignee: Todd Volkert
>            Priority: Minor
>             Fix For: 1.2
>
>
> We can cache the paint results of a Viewport in a BufferedImage and re-use that image when the scroll top or scroll left changes, thus enabling us to clip the paint region to just the bounds that were revealed by the scroll change.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (PIVOT-66) Optimize Viewport by only painting the revealed area

Posted by "Todd Volkert (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/PIVOT-66?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12700640#action_12700640 ] 

Todd Volkert commented on PIVOT-66:
-----------------------------------

http://java.sun.com/javase/6/docs/api/java/awt/Graphics.html#copyArea(int,%20int,%20int,%20int,%20int,%20int) is the key to implementing this.  viewport.getDisplay().getDisplayHost().getGraphics() allows us to get the graphics upon which we can call this method.  Testing shows it to work well, and research suggests that it's *fast*.  The trick is how to tell our repaint system to limit the repaint rect (since we have to change the location of the view, which causes the whole viewport bounds to need to be repainted).

> Optimize Viewport by only painting the revealed area
> ----------------------------------------------------
>
>                 Key: PIVOT-66
>                 URL: https://issues.apache.org/jira/browse/PIVOT-66
>             Project: Pivot
>          Issue Type: Improvement
>          Components: wtk
>    Affects Versions: 1.1
>            Reporter: Todd Volkert
>            Assignee: Todd Volkert
>            Priority: Minor
>             Fix For: 1.3
>
>
> We can cache the paint results of a Viewport in a BufferedImage and re-use that image when the scroll top or scroll left changes, thus enabling us to clip the paint region to just the bounds that were revealed by the scroll change.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (PIVOT-66) Optimize Viewport by only painting the revealed area

Posted by "Todd Volkert (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/PIVOT-66?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12698149#action_12698149 ] 

Todd Volkert commented on PIVOT-66:
-----------------------------------

After some rough prototyping, this may not be worth it.  It definitely cuts down the execution time of scrolling, but not by that much after all's said and done, and it drastically complicates the code in Viewport.java.  The bottom line seems to be that the buffered image management required to accomplish this feat eats substantially into the runtime execution savings we were hoping to achieve.  I'll leave this issue open for now because we may be able to get access to the display pixels at a higher level in the framework, but if nothing changes, this issue may die on the vine.

> Optimize Viewport by only painting the revealed area
> ----------------------------------------------------
>
>                 Key: PIVOT-66
>                 URL: https://issues.apache.org/jira/browse/PIVOT-66
>             Project: Pivot
>          Issue Type: Improvement
>          Components: wtk
>    Affects Versions: 1.1
>            Reporter: Todd Volkert
>            Assignee: Todd Volkert
>            Priority: Minor
>             Fix For: 1.2
>
>
> We can cache the paint results of a Viewport in a BufferedImage and re-use that image when the scroll top or scroll left changes, thus enabling us to clip the paint region to just the bounds that were revealed by the scroll change.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Updated: (PIVOT-66) Optimize Viewport by only painting the revealed area

Posted by "Todd Volkert (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/PIVOT-66?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Todd Volkert updated PIVOT-66:
------------------------------

    Fix Version/s:     (was: 1.2)
                   1.3

> Optimize Viewport by only painting the revealed area
> ----------------------------------------------------
>
>                 Key: PIVOT-66
>                 URL: https://issues.apache.org/jira/browse/PIVOT-66
>             Project: Pivot
>          Issue Type: Improvement
>          Components: wtk
>    Affects Versions: 1.1
>            Reporter: Todd Volkert
>            Assignee: Todd Volkert
>            Priority: Minor
>             Fix For: 1.3
>
>
> We can cache the paint results of a Viewport in a BufferedImage and re-use that image when the scroll top or scroll left changes, thus enabling us to clip the paint region to just the bounds that were revealed by the scroll change.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.