You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@harmony.apache.org by Igor Stolyarov <ig...@gmail.com> on 2006/07/27 08:24:40 UTC

AWT 2D PERFORMANCE ISSUE

Hi folks!

I want to discuss AWT 2D Performance Issue, especially performance of the
BufferedImage rendering.

In order to recieve best performance we have to use hardware acceleration.
Thus is appearing good thought using DirectDraw or Direct3D Surface as cache
of BufferedImage Raster for rendering operations. In other words all drawing
operations for BufferedImage Graphics we are doing on the BufferedImage
cache and then draw BufferedImage cache on the screen with hardware
acceleration. But sometimes we need Java access to the Raster, for example
BufferedImage has getRGB and setRGB methods. Appear synchronization issue.
We can use flags that inform us about cache or Raster was chaneged, after
that we have to update cache or Raster. But customer can to recieve full
access to the DataBuffer data (DataBuffer classes have getData methods which
return link for arrays which store data) and we don't know when customer
release data. Thus we have to update cache before each rendering operation
what will slow down performance. I have done package private class which can
safely give and release link for DataBuffer data and we can use this class
for our private API, but end customer know nothing about this possibility
:(.

Have anybody ideas about how solve this problem. Wellcome to the discussion.

Best regards,
Igor

Re: AWT 2D PERFORMANCE ISSUE

Posted by Denis Kishenko <dk...@gmail.com>.
2006/7/27, Stefano Mazzocchi <st...@apache.org>:
> Keep in mind that most of java people (and most people around here) are
> server side people. At the very best, they have written one swing
> application in their life. If you're very lucky, they have written their
> own swing components (me, for example). But I don't think you'll find
> many people familiar with DirectX or OpenGL type of native libraries and
> even less with the problem that Swing hardware acceleration presents as
> design issues.
I am surprised at this. Now I understand why there isn't any graphic
issue in JIRA =)

---------------------------------------------------------------------
Terms of use : http://incubator.apache.org/harmony/mailing.html
To unsubscribe, e-mail: harmony-dev-unsubscribe@incubator.apache.org
For additional commands, e-mail: harmony-dev-help@incubator.apache.org


Re: AWT 2D PERFORMANCE ISSUE

Posted by Igor Stolyarov <ig...@gmail.com>.
I'm sorry. May be I don't clear explained my question. Main target of my
question was discussion of synchronization of two arrays one of these is
java array, second is native array. Main issue of this synchronization is
the fact that customer can recieve reference to the java array and we don't
know when customer will release the array.

On 7/27/06, Stefano Mazzocchi <st...@apache.org> wrote:
>
> Denis Kishenko wrote:
> > 2006/7/27, Igor Stolyarov <ig...@gmail.com>:
> >> Denis I hope you understand that I discuss BufferedImage rendering.
> >> First of
> >> all I offer draw all primitive for example on the DirectDrawSurface
> which
> >> will be cache of BufferedImage and then blit this Surface to the
> >> PrimarySurface (Screen). When we need Java access to the Raster of this
> >> BufferedImage we have to synchronized Raster and cache
> >> --
> >> Igor V. Stolyarov
> >> Intel Middleware Products Division
> >>
> >>
> > I know details of your problem but other people don't. If you want to
> > get recommendations from community you should explain it more.
>
> +1 :-)
>
> Keep in mind that most of java people (and most people around here) are
> server side people. At the very best, they have written one swing
> application in their life. If you're very lucky, they have written their
> own swing components (me, for example). But I don't think you'll find
> many people familiar with DirectX or OpenGL type of native libraries and
> even less with the problem that Swing hardware acceleration presents as
> design issues.
>
> --
> Stefano.
>
>
> ---------------------------------------------------------------------
> Terms of use : http://incubator.apache.org/harmony/mailing.html
> To unsubscribe, e-mail: harmony-dev-unsubscribe@incubator.apache.org
> For additional commands, e-mail: harmony-dev-help@incubator.apache.org
>
>


-- 
Igor V. Stolyarov
Intel Middleware Products Division

Re: AWT 2D PERFORMANCE ISSUE

Posted by Stefano Mazzocchi <st...@apache.org>.
Denis Kishenko wrote:
> 2006/7/27, Igor Stolyarov <ig...@gmail.com>:
>> Denis I hope you understand that I discuss BufferedImage rendering.
>> First of
>> all I offer draw all primitive for example on the DirectDrawSurface which
>> will be cache of BufferedImage and then blit this Surface to the
>> PrimarySurface (Screen). When we need Java access to the Raster of this
>> BufferedImage we have to synchronized Raster and cache
>> -- 
>> Igor V. Stolyarov
>> Intel Middleware Products Division
>>
>>
> I know details of your problem but other people don't. If you want to
> get recommendations from community you should explain it more.

+1 :-)

Keep in mind that most of java people (and most people around here) are
server side people. At the very best, they have written one swing
application in their life. If you're very lucky, they have written their
own swing components (me, for example). But I don't think you'll find
many people familiar with DirectX or OpenGL type of native libraries and
even less with the problem that Swing hardware acceleration presents as
design issues.

-- 
Stefano.


---------------------------------------------------------------------
Terms of use : http://incubator.apache.org/harmony/mailing.html
To unsubscribe, e-mail: harmony-dev-unsubscribe@incubator.apache.org
For additional commands, e-mail: harmony-dev-help@incubator.apache.org


Re: AWT 2D PERFORMANCE ISSUE

Posted by Denis Kishenko <dk...@gmail.com>.
2006/7/27, Igor Stolyarov <ig...@gmail.com>:
> Denis I hope you understand that I discuss BufferedImage rendering. First of
> all I offer draw all primitive for example on the DirectDrawSurface which
> will be cache of BufferedImage and then blit this Surface to the
> PrimarySurface (Screen). When we need Java access to the Raster of this
> BufferedImage we have to synchronized Raster and cache
> --
> Igor V. Stolyarov
> Intel Middleware Products Division
>
>
I know details of your problem but other people don't. If you want to
get recommendations from community you should explain it more.

---------------------------------------------------------------------
Terms of use : http://incubator.apache.org/harmony/mailing.html
To unsubscribe, e-mail: harmony-dev-unsubscribe@incubator.apache.org
For additional commands, e-mail: harmony-dev-help@incubator.apache.org


Re: AWT 2D PERFORMANCE ISSUE

Posted by Igor Stolyarov <ig...@gmail.com>.
Denis I hope you understand that I discuss BufferedImage rendering. First of
all I offer draw all primitive for example on the DirectDrawSurface which
will be cache of BufferedImage and then blit this Surface to the
PrimarySurface (Screen). When we need Java access to the Raster of this
BufferedImage we have to synchronized Raster and cache
-- 
Igor V. Stolyarov
Intel Middleware Products Division

Re: AWT 2D PERFORMANCE ISSUE

Posted by Denis Kishenko <dk...@gmail.com>.
Igor

You suggest optimize rendering on BufferedImage, don't you?
You have decision but it has problem, isn't it?

I don't clearly understand the problem you have, may be some pictures
help us to help you. Could you please explain how
Graphics2D.drawLine() will work using new rendering?

Thanks

---------------------------------------------------------------------
Terms of use : http://incubator.apache.org/harmony/mailing.html
To unsubscribe, e-mail: harmony-dev-unsubscribe@incubator.apache.org
For additional commands, e-mail: harmony-dev-help@incubator.apache.org