You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@pivot.apache.org by Sandro Martini <sa...@gmail.com> on 2009/03/30 12:38:48 UTC

Effects Levels for Pivot Applications

Hi to all,
what do you think on adding a Global Setting (independent on the
current skin used) to enable a profile related to the usage of effects
in skins ? I've found a thing like this in GNome Control Panel, for
example in ubuntu, take a look:

http://brainstorm.ubuntu.com/idea/16536/

https://wiki.edubuntu.org/DesktopTeam/Specs/HardyDesktopEffectsProfiles

I don't find a screenshot of this feature at the moment, sorry.


In this way, we could have for example 4 or 5 effect-levels: "None",
"Low", "Normal", "High" and maybe "Custom".
As usual, the default level will the that of today, so All effects enabled.

In this way we could force the usage (or better, the non-usage) of
some effects like transitions, animations etc where not wanted, and
not depending on the skin chosen. Because in some Corporate
Environments or with older PCs sometimes this is not wanted or simply
to not slow down running applications.
And so the application creator could (is wanted) ask to Pivot to set
the desired effects level, if possible at runtime.
But also a User could have this feature, for example available by the
application creator in a Menu, or other ...


What do you think ?

Bye,
Sandro

Re: Effects Levels for Pivot Applications

Posted by Sandro Martini <sa...@gmail.com>.
Hi John,
thanks for your detailed answer ...

I hope we can start on this for one of the next Releases, at least in
its simplest form, because as you said do this in a general way is an
hard task (maybe ok for mid-to-long term), but could help to push Java
Rich Clients running at top performances.

Good work,
Sandro

Re: Effects Levels for Pivot Applications

Posted by John Pritchard <jd...@syntelos.com>.
Hi,

I think there's a good idea in here, but I wouldn't be too sure about where
to begin with it today.
Partly because my head goes to other subjects here, like performance, timing
and synchronicity, and partly because your work on this subject illustrates
how complicated this gets.  You list five areas affected.

But I think you're not wrong when you point to an architectural step into it
with a single global constant like high, med and low.  And let skins and
effects and easings look at that as they will or won't.

As for an autoheuristic setup, reminds me of another graphics capabilities
selection process

http://code.google.com/p/wtkx/source/browse/trunk/src/wtkx/in/Screen.java

        if (Java.IsVersion16OrNewer)

            return BackingStore.Type.GPU;

        else if (Os.IsDarwin && Java.IsVersion15OrNewer){
            if (Os.Version.equalsOrNewer(10,5)){
                if (container instanceof java.applet.Applet){
                    Object peer = container.getPeer();
                    if (null != peer &&
"apple.awt.MyCPanel".equals(peer.getClass().getName()))
                        return BackingStore.Type.GPU;
                    else
                        return BackingStore.Type.CPU;
                }
                else
                    return BackingStore.Type.CPU;
            }
            else
                return BackingStore.Type.GPU;
        }
        else
            return BackingStore.Type.CPU;


cheers,
john



On Thu, Apr 2, 2009 at 5:07 AM, Sandro Martini <sa...@gmail.com>wrote:

> Hi to all,
> sorry, some other hints on this subject.
>
> As effects, we could have the following categories (and handle on/off
> when desired):
> - animations (like animated images or movies)
> - transitions (like fading or sliding)
> - gradients
> - transparencies (like for menus, popups, etc)
> - background (with gradient, with watermark, with vectorial drawings, etc)
> - others ...
>
> Having a support in the base Pivot classes for standard levels (and by
> default all on), but leaving any skin to override what is
> enabled/disabled, or at least for the custom level.
> Instead Minimum (none) and Maximum levels could be handled in base Pivot.
>
> For example, I've seen many articles on (poor) performance of
> gradients etc on many OS / Window Managers and Graphics Cards /
> Drivers, the the category for this.
>
> But the best could be to have a utility class to query the graphics
> engine to tell is the desired effect is Hardware-enabled (but I don't
> know if this is possible and how to do, sorry), maybe in a way
> callable (if desired) by the user Applet/Application at Startup (and
> maybe persisting results with Preferences or some other way).
> Then any skin could think at what to do in its custom level, depending
> also on these values, but i understand that all this could be
> difficult.
>
>
> What do you think ?
>
> Bye,
> Sandro
>

Re: Effects Levels for Pivot Applications

Posted by Sandro Martini <sa...@gmail.com>.
> I think you're greatly over-complicating this, which is just going to
> lead to weird behaviour when things turn on and off, and arguments about
> which level some painting should be in.
Mhhh maybe, but why not think at an architecture for med-to-long term,
and implement only most common cases (like all as today, and none) ?
And maybe the medium level at the moment as all without animations and
transitions ?
To not change existing base classes maybe also this could be done only
inside a skin, and see later if refactor/move ...

> Before "features" like this go in, I'd like to see some example of a
> real problem caused by any of these.
OK, no real problem, but in many Enterprises you know that many PCs
are outdated or have graphics cards with poor performances, so why not
provide a way to disable all the visual stuff that can cause slowness
?
And there are also Companies with Polices that doesn't want
applications with too much graphics effects ... while at the opposite
for Consumer Users this is wanted.

A Test implementation could be simple (ok, nothing is simple), and we
could decide later if keep or extend, or remove ...


Many of my ideas come from my direct experience on Enterprise
Companies, where Rich Client Applications are not wanted and Browser +
AJAX + sometimes Flash are the only solution ... so trying to push
technologies like Pivot there is difficult for many reasons, so my
trouble to optimize Pivot for this type of users.



> The gradients in Pivot are software-rendered, so that's not an issue.
> Java doesn't currently offer any way (short of using JOGL) to get
> hardware accelerated gradients.
>From Java 6 Update 10 this has changed, the Graphics pipeline has been
optimized a lot for most common operations like this, at least on
Windows.

>> But the best could be to have a utility class to query the graphics
>> engine to tell is the desired effect is Hardware-enabled (but I don't
>> know if this is possible and how to do, sorry), maybe in a way
OK, I don't know if this is currently possible, and also if it is
maybe it's too much complex.


I could try to make some experiment on this, for the 1.2 release ...
Comments ?

Thanks,
Sandro

Re: Effects Levels for Pivot Applications

Posted by Noel Grandin <no...@gmail.com>.
Sandro Martini wrote:
> Hi to all,
> sorry, some other hints on this subject.
>
> As effects, we could have the following categories (and handle on/off
> when desired):
> - animations (like animated images or movies)
> - transitions (like fading or sliding)
> - gradients
> - transparencies (like for menus, popups, etc)
> - background (with gradient, with watermark, with vectorial drawings, etc)
> - others ...
>
>   
I think you're greatly over-complicating this, which is just going to
lead to weird behaviour when things turn on and off, and arguments about
which level some painting should be in.
Before "features" like this go in, I'd like to see some example of a
real problem caused by any of these.

> For example, I've seen many articles on (poor) performance of
> gradients etc on many OS / Window Managers and Graphics Cards /
> Drivers, the the category for this.
>   
The gradients in Pivot are software-rendered, so that's not an issue.
Java doesn't currently offer any way (short of using JOGL) to get
hardware accelerated gradients.
> But the best could be to have a utility class to query the graphics
> engine to tell is the desired effect is Hardware-enabled (but I don't
> know if this is possible and how to do, sorry), maybe in a way
>   
Unfortunately, no it's not. (again, unless using JOGL).


Re: Effects Levels for Pivot Applications

Posted by Sandro Martini <sa...@gmail.com>.
Hi to all,
sorry, some other hints on this subject.

As effects, we could have the following categories (and handle on/off
when desired):
- animations (like animated images or movies)
- transitions (like fading or sliding)
- gradients
- transparencies (like for menus, popups, etc)
- background (with gradient, with watermark, with vectorial drawings, etc)
- others ...

Having a support in the base Pivot classes for standard levels (and by
default all on), but leaving any skin to override what is
enabled/disabled, or at least for the custom level.
Instead Minimum (none) and Maximum levels could be handled in base Pivot.

For example, I've seen many articles on (poor) performance of
gradients etc on many OS / Window Managers and Graphics Cards /
Drivers, the the category for this.

But the best could be to have a utility class to query the graphics
engine to tell is the desired effect is Hardware-enabled (but I don't
know if this is possible and how to do, sorry), maybe in a way
callable (if desired) by the user Applet/Application at Startup (and
maybe persisting results with Preferences or some other way).
Then any skin could think at what to do in its custom level, depending
also on these values, but i understand that all this could be
difficult.


What do you think ?

Bye,
Sandro

Re: Effects Levels for Pivot Applications

Posted by Sandro Martini <sa...@gmail.com>.
Sorry, I missed the final part of mail:

As always, comments, suggestions, etc are welcome.

Sandro

Re: Effects Levels for Pivot Applications

Posted by Sandro Martini <sa...@gmail.com>.
Hi to all,
thank to all for your feedback ...

> I've seen a couple of applications use this, and I think a simple
> "animations on/off" flag is sufficient.
Ok, but i was thinking also at other features, like transparency
on/off , etc ... so maybe using that level from near future could help
to isolate this ...

> What exactly would a level mean anyhow? Even for the same animation,
> different low-end hardware will have different trade-offs.
Right. I wouldn't like to complicate code, but are we able to query
AWT for what type of operations are accelerated in hardware, and
depending on it choose what to do on any effect, depending on the flag
?

But the real question is if it's possible to do this not only in the
Terra theme, but in a more general way in Pivot (ok, at least we could
leave this the the Skin domain ...), putting some common stuff for
this at a lower level (if not already there), and leave to the skin
the last word (using or not these hints).


@john:
I am sorry that you chose the fork way. In the future I hope we can
combine efforts to build both better products. In any case, best
wishes and thanks for your suggestions.


What do you think ?

Bye,
Sandro

Re: Effects Levels for Pivot Applications

Posted by Noel Grandin <no...@gmail.com>.
I've seen a couple of applications use this, and I think a simple
"animations on/off" flag is sufficient.

What exactly would a level mean anyhow? Even for the same animation,
different low-end hardware will have different trade-offs.

Regards, Noel Grandin

Greg Brown wrote:
>> what do you think on adding a Global Setting (independent on the
>> current skin used) to enable a profile related to the usage of effects
>> in skins ? I've found a thing like this in GNome Control Panel
>>     
>
> It's not a bad idea. Windows has a similar feature. We could define an enum in TerraTheme that defined the levels and default to HIGH.
>
>
>   


Re: Effects Levels for Pivot Applications

Posted by Greg Brown <gk...@mac.com>.
>what do you think on adding a Global Setting (independent on the
>current skin used) to enable a profile related to the usage of effects
>in skins ? I've found a thing like this in GNome Control Panel

It's not a bad idea. Windows has a similar feature. We could define an enum in TerraTheme that defined the levels and default to HIGH.



Re: Effects Levels for Pivot Applications

Posted by John Pritchard <jd...@syntelos.com>.
Hi,

One note on the subject.  This change may not be necessary, at least on the
short term (near future).

I've been doing some related work in a fork @ wtkx.org.  I just like Pivot
that much.

In this effort I found two areas with large performance improvements: text
layout and graphics buffering -- since pivot 1.0 a couple weeks ago, before
Greg rewrote Text.

For the graphics buffering I can recommend an approach as in this class..
http://code.google.com/p/wtkx/source/browse/trunk/src/wtkx/in/BackingStore.java
..although as of this minute there is a bug there..
http://code.google.com/p/wtkx/issues/detail?id=5
..i expect it's plainly usable.


Best wishes,

John



On Mon, Mar 30, 2009 at 6:38 AM, Sandro Martini <sa...@gmail.com>wrote:

> Hi to all,
> what do you think on adding a Global Setting (independent on the
> current skin used) to enable a profile related to the usage of effects
> in skins ? I've found a thing like this in GNome Control Panel, for
> example in ubuntu, take a look:
>
> http://brainstorm.ubuntu.com/idea/16536/
>
> https://wiki.edubuntu.org/DesktopTeam/Specs/HardyDesktopEffectsProfiles
>
> I don't find a screenshot of this feature at the moment, sorry.
>
>
> In this way, we could have for example 4 or 5 effect-levels: "None",
> "Low", "Normal", "High" and maybe "Custom".
> As usual, the default level will the that of today, so All effects enabled.
>
> In this way we could force the usage (or better, the non-usage) of
> some effects like transitions, animations etc where not wanted, and
> not depending on the skin chosen. Because in some Corporate
> Environments or with older PCs sometimes this is not wanted or simply
> to not slow down running applications.
> And so the application creator could (is wanted) ask to Pivot to set
> the desired effects level, if possible at runtime.
> But also a User could have this feature, for example available by the
> application creator in a Menu, or other ...
>
>
> What do you think ?
>
> Bye,
> Sandro
>