OpaqueImage rendering speed

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

OpaqueImage rendering speed

Andres Fortier-2
Hi list,
         I've been playing around with some graphic stuff and was kind
of surprised when I saw how OpaqueImage was implemented, since it
doesn't optimize much the rendering process. The opaque image stores the
image and the mask in whatever format they are originally passed, but
when it has to render itself it is forced to convert them in retained
mediums. Just to test it, I created a FastOpaqueImage, which performs
the conversion when the figure/shape are set (and also to skip a few
messages in the displaying process). Pofiling the render speed of a
typical image used in the GUI (the XP radio button image/mask) 10000
times I get an average of 3258 msec vs 80 msec, something like a 40x
speedup. So, my first question is, am I missing something? The only
reason I can think of is that the "fix" implies holding a reference to
an OS handle constantly, while the standard opaque image does not
require that, but is that it? Or is there somethig else?

Just for fun I also converted all the icons in the image that are
treated using OpaqueImages to FastOpaqueImages the results in the GUI
are not big, but they show a little improvement in a standard window
(the RB) rendering time: 11068 vs 9065, something like 1.22 ratio.

Cheers,
         Andrés

Reply | Threaded
Open this post in threaded view
|

RE: OpaqueImage rendering speed

Mark Plas
Andrés,

I think the class CachedImage does the same thing that you're doing. If you read the class comment on OpaqueImage you'll see that these can be created using either an Image or a CachedImage as the figure&shape. Using the CachedImage makes it perform a lot faster.

-----Original Message-----
From: Andres Fortier [mailto:[hidden email]] On Behalf Of Andres Fortier
Sent: donderdag 21 februari 2008 16:47
To: VWNC List
Subject: OpaqueImage rendering speed

Hi list,
         I've been playing around with some graphic stuff and was kind
of surprised when I saw how OpaqueImage was implemented, since it
doesn't optimize much the rendering process. The opaque image stores the
image and the mask in whatever format they are originally passed, but
when it has to render itself it is forced to convert them in retained
mediums. Just to test it, I created a FastOpaqueImage, which performs
the conversion when the figure/shape are set (and also to skip a few
messages in the displaying process). Pofiling the render speed of a
typical image used in the GUI (the XP radio button image/mask) 10000
times I get an average of 3258 msec vs 80 msec, something like a 40x
speedup. So, my first question is, am I missing something? The only
reason I can think of is that the "fix" implies holding a reference to
an OS handle constantly, while the standard opaque image does not
require that, but is that it? Or is there somethig else?

Just for fun I also converted all the icons in the image that are
treated using OpaqueImages to FastOpaqueImages the results in the GUI
are not big, but they show a little improvement in a standard window
(the RB) rendering time: 11068 vs 9065, something like 1.22 ratio.

Cheers,
         Andrés

Reply | Threaded
Open this post in threaded view
|

Re: OpaqueImage rendering speed

Andres Fortier-2
Hi Mark,
         thanks for pointing that out, I completely missed it. However,
creating:

OpaqueImage
        figure: (CachedImage on: WinXPRadioButtonView disabledOn)
        shape: (CachedImage on: WinXPRadioButtonView disabledOnMask).

is still twice slower than using a dedicated class for it (i.e. a
FastOpaqueImage). Maybe I'm too picky with this, just that when it comes
to GUI things rendering times worry me.

Thanks again!
Andrés

Mark Plas escribió:

> Andrés,
>
> I think the class CachedImage does the same thing that you're doing. If you read the class comment on OpaqueImage you'll see that these can be created using either an Image or a CachedImage as the figure&shape. Using the CachedImage makes it perform a lot faster.
>
> -----Original Message-----
> From: Andres Fortier [mailto:[hidden email]] On Behalf Of Andres Fortier
> Sent: donderdag 21 februari 2008 16:47
> To: VWNC List
> Subject: OpaqueImage rendering speed
>
> Hi list,
>          I've been playing around with some graphic stuff and was kind
> of surprised when I saw how OpaqueImage was implemented, since it
> doesn't optimize much the rendering process. The opaque image stores the
> image and the mask in whatever format they are originally passed, but
> when it has to render itself it is forced to convert them in retained
> mediums. Just to test it, I created a FastOpaqueImage, which performs
> the conversion when the figure/shape are set (and also to skip a few
> messages in the displaying process). Pofiling the render speed of a
> typical image used in the GUI (the XP radio button image/mask) 10000
> times I get an average of 3258 msec vs 80 msec, something like a 40x
> speedup. So, my first question is, am I missing something? The only
> reason I can think of is that the "fix" implies holding a reference to
> an OS handle constantly, while the standard opaque image does not
> require that, but is that it? Or is there somethig else?
>
> Just for fun I also converted all the icons in the image that are
> treated using OpaqueImages to FastOpaqueImages the results in the GUI
> are not big, but they show a little improvement in a standard window
> (the RB) rendering time: 11068 vs 9065, something like 1.22 ratio.
>
> Cheers,
>          Andrés
>
>

Reply | Threaded
Open this post in threaded view
|

Re: OpaqueImage rendering speed

Andres Fortier-2
so, after playing a bit more it turns out that with bigger images the
rendering times are even, so no point in adding a new class.

Thanks again,
              Andres

Andres Fortier escribió:

> Hi Mark,
>         thanks for pointing that out, I completely missed it. However,
> creating:
>
> OpaqueImage
>     figure: (CachedImage on: WinXPRadioButtonView disabledOn)
>     shape: (CachedImage on: WinXPRadioButtonView disabledOnMask).
>
> is still twice slower than using a dedicated class for it (i.e. a
> FastOpaqueImage). Maybe I'm too picky with this, just that when it comes
> to GUI things rendering times worry me.
>
> Thanks again!
> Andrés
>
> Mark Plas escribió:
>> Andrés,
>>
>> I think the class CachedImage does the same thing that you're doing.
>> If you read the class comment on OpaqueImage you'll see that these can
>> be created using either an Image or a CachedImage as the figure&shape.
>> Using the CachedImage makes it perform a lot faster.
>>
>> -----Original Message-----
>> From: Andres Fortier [mailto:[hidden email]] On Behalf Of
>> Andres Fortier
>> Sent: donderdag 21 februari 2008 16:47
>> To: VWNC List
>> Subject: OpaqueImage rendering speed
>>
>> Hi list,
>>          I've been playing around with some graphic stuff and was kind
>> of surprised when I saw how OpaqueImage was implemented, since it
>> doesn't optimize much the rendering process. The opaque image stores the
>> image and the mask in whatever format they are originally passed, but
>> when it has to render itself it is forced to convert them in retained
>> mediums. Just to test it, I created a FastOpaqueImage, which performs
>> the conversion when the figure/shape are set (and also to skip a few
>> messages in the displaying process). Pofiling the render speed of a
>> typical image used in the GUI (the XP radio button image/mask) 10000
>> times I get an average of 3258 msec vs 80 msec, something like a 40x
>> speedup. So, my first question is, am I missing something? The only
>> reason I can think of is that the "fix" implies holding a reference to
>> an OS handle constantly, while the standard opaque image does not
>> require that, but is that it? Or is there somethig else?
>>
>> Just for fun I also converted all the icons in the image that are
>> treated using OpaqueImages to FastOpaqueImages the results in the GUI
>> are not big, but they show a little improvement in a standard window
>> (the RB) rendering time: 11068 vs 9065, something like 1.22 ratio.
>>
>> Cheers,
>>          Andrés
>>
>>
>
>