Skip to main content

[JAVA2D] JDK 1.5 and Java2D pipeline

7 replies [Last post]
Anonymous

I've been reading the thread so far, and am quite interested in the
imporvements that are in store for Java2D. Having worked quite a bit
with the 1.4 Java2D pipeline, I have some questions:

Will the OpenGL pipeline be enabled by default in the release version of
1.5? Will my older 1.4 programs take advantage of it right away?

Will images with transparency which are initialized once and then used
intensively for bilting from be invisibly promoted to system managed
VolitileImages, the way images without transparency currently are? Will
the JDK still handle Images and BufferedImages differently in this
respect? (Only Images are promoted; BufferedImages are not)

Are there any tips and tricks that will allow savvy developers gain
maximum performance from the J2D engine?

When will Java 1.5 be officially released? I've been getting really
excited aobut this realease, but don't want to upgrade until it's official.

Mark McKay
--
http://www.kitfox.com

===========================================================================
To unsubscribe, send email to listserv@java.sun.com and include in the body
of the message "signoff JAVA2D-INTEREST". For general help, send email to
listserv@java.sun.com and include in the body of the message "help".

Reply viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
Chris Campbell

Hi Keith,

On Mar 17, 2004, at 9:05 AM, Keith Lea wrote:
> Chet Haase wrote:
>> The current plan is for the OpenGL pipeline to be disabled by default,
>> but enabled via a command-line flag.
> Does this mean that applets and programs run by double-clicking a jar
> file won't be able to use the OpenGL pipeline, unless the user knows
> the
> command line switch (in the case of jars)?

Yes, that is the case for this release. The command line switch is
more for developers (and advanced end users), so they can test their
apps with this new pipeline. Ideally, Java 2D would automagically
determine whether the OGL drivers on the system were reliable enough to
enable the pipeline (we already do this to some extent with the DX
pipeline). The user (or the developer deploying an app) should not
have to know about this flag...

> This seems like a crazy idea,
> considering the amount of effort going into the OpenGL pipeline. I
> imagine that disabling it by default will make it so that for 99% of
> people, the OpenGL pipeline won't be used. Most users don't want to
> open
> the command line to run a program and they don't want to have to
> remember -Ds.d.sdf.asd.OpenGL=true every time they run a program, and
> most users don't know how to modify the file association for .jar to
> pass in that property.
>

As Chet has mentioned, there are many valid reasons for not enabling
this thing by default. The fact is, those 99% that you mention
probably have old (or non-conformant, or buggy) OGL drivers installed
on their machines, if at all. We're working with driver makers to get
these issues resolved, so that we can enable this pipeline whereever
possible in an upcoming release. Stay tuned.

> This decision makes me mad at Sun. It seems they always start something
> good and then mess it up, like making an OpenGL pipeline then making it
> so no one will use it and it's hard to enable.
>

Whenever we schedule meetings, we always allot the first 20 minutes to
discussing a great idea, and then we spend the other 40 minutes
devising evil schemes. We always end meetings with a hearty round of
diabolical laughter.

> Will there be a way to programmatically enable the GL pipeline or is it
> only a system property at startup that can do it?
>

You can programmatically set the system property (via
System.setProperty) in your app at startup. But I highly discourage
you from doing so, for the same reasons that we haven't enabled the OGL
pipeline in the first place.

If you follow this approach, and then deploy your app to many different
hardware configurations, it's likely that we'll try to enable the OGL
pipeline, and then the app will crash, or there will be rendering
artifacts, all due to driver bugs. If you're working in a controlled
environment, you might be able to take that risk, but most developers
can't afford to offer that sort of end-user experience.

Thanks,
Chris

===========================================================================
To unsubscribe, send email to listserv@java.sun.com and include in the body
of the message "signoff JAVA2D-INTEREST". For general help, send email to
listserv@java.sun.com and include in the body of the message "help".

Michele Puccini

About the Windows implementation of Java2D, it is somewhat obscure if we
will have OpenGL acceleration even on this platform. Apart from OpenGL, can
we expect some sort of hardware acceleration in the new Java2D ?

Cheers,

Mik of ClassX
============================================================================
> ClassX Development Italy Via Francesca, 463 I-56030 Montecalvoli (PI) <
> Tel.(+39)-0587-749206 Fax.(+39)-0587-749206 WEB: http://www.classx.it <
============================================================================

===========================================================================
To unsubscribe, send email to listserv@java.sun.com and include in the body
of the message "signoff JAVA2D-INTEREST". For general help, send email to
listserv@java.sun.com and include in the body of the message "help".

Nidel, Michael


>
> Whenever we schedule meetings, we always allot the first 20 minutes to
> discussing a great idea, and then we spend the other 40 minutes
> devising evil schemes. We always end meetings with a hearty round of
> diabolical laughter.
>

I don't think I've laughed so hard at work in... well, ever. :)
Unfortunately, here we don't have diabolical laughter mastered
yet. It's more of a bewildered/confused/incredulous kind of laughter.

Seriously though, Sun does have a lot of power to make
relatively-inconsequential users/developers quake with fear. Just
the fact that there are still whole software systems built around
1.3.1 or earlier releases is a testament to the distrust by many
software systems engineers. I don't mean this as a criticism at all,
just an observation of people's conceptions about Java.

For myself, I was one of the first on my team to install 1.5b1 and
I was proud of the fact... until it fragged my system. Something
involving the new Java plug-in control panel not allowing me to
choose a 1.4 JRE I think. I'll have to reinstall and investigate
what was going on there. (Some of us like being on the bleeding
edge, with all its pain... :) )

> You can programmatically set the system property (via
> System.setProperty) in your app at startup. But I highly discourage
> you from doing so, for the same reasons that we haven't
> enabled the OGL
> pipeline in the first place.

But assuming your app has some kind of user profile/preferences
mechanism, you could allow the user to choose whether they want to
enable the high-performance* mode or not, then save that setting and
use it early in your app startup to set the system property...

just a thought.

Mike Nidel

* not a guarantee

===========================================================================
To unsubscribe, send email to listserv@java.sun.com and include in the body
of the message "signoff JAVA2D-INTEREST". For general help, send email to
listserv@java.sun.com and include in the body of the message "help".

Chris Campbell

Hi Mark,

On Mar 17, 2004, at 6:20 AM, Mark McKay wrote:
> When will Java 1.5 be officially released? I've been getting really
> excited aobut this realease, but don't want to upgrade until it's
> official.
>

I encourage you (and everyone else) to download the 1.5-beta release as
soon as possible. Now is the time to make sure your apps work
better/faster/not-worse with 1.5... If you simply wait until the final
release, it will be much too late for us to resolve any issues that you
might find.

We want to shake out any quality/performance issues in the 1.5 release
as early as possible, and we could use everyone's help in making sure
this is a solid release. Please file a new bug report for any problems
you might encounter in the 1.5-beta release:
http://java.sun.com/webapps/bugreport/

Thanks,
Chris

===========================================================================
To unsubscribe, send email to listserv@java.sun.com and include in the body
of the message "signoff JAVA2D-INTEREST". For general help, send email to
listserv@java.sun.com and include in the body of the message "help".

Chet Haase

Hi Mark,

I'm glad to see that you're interested in Java2D and the
upcoming 1.5 release.

I'll see if I can answer most of your questions....

> Will the OpenGL pipeline be enabled by default in the release version of
> 1.5? Will my older 1.4 programs take advantage of it right away?

The current plan is for the OpenGL pipeline to be disabled by default,
but enabled via a command-line flag. This is due to concerns over
robustness (especially with the somewhat chaotic state of GL
driver support on both Linux and Windows) and performance for
some operations (OpenGL tends to get incredible performance for
advanced rendering features but performance for some simple
operations can be less amazing due to pbuffer support and
acceleration on many drivers/hardware. We're working on
both of these issues, but that's why this otherwise pretty
awesome hw acceleration feature will not be enabled by default...

> Will images with transparency which are initialized once and then used
> intensively for bilting from be invisibly promoted to system managed
> VolitileImages, the way images without transparency currently are? Will
> the JDK still handle Images and BufferedImages differently in this
> respect? (Only Images are promoted; BufferedImages are not)

More (most, even) images will become "managed images" (our
term for the hidden acceleration feature that you're talking about).
So, for instance, when you do:
new BufferedImage(...)
and start copying from that image to an accelerated destination
(such as the back buffer or the screen) then we will try to
create a cached, accelerated version of that image.

Note that this is mainly beneficial on Windows (opaque and
transparent images only - not translucent by default yet)
and on Unix with OpenGL enabled.

> Are there any tips and tricks that will allow savvy developers gain
> maximum performance from the J2D engine?

Tons. But that's a bit beyond the scope of this email. Check
out some of the postings/blogs at javadesktop.org and
javagaming.org. Also, check out JavaOne; we tend to have
a tips & tricks talk every year.

> When will Java 1.5 be officially released? I've been getting really
> excited aobut this realease, but don't want to upgrade until it's official.

I don't know the official date, and one never knows with software
in any case. We should be releasing our Beta2 sometime soon, after
which the next release should be the final one. As to how that
equates into specific dates...

Chet.

>
> Mark McKay
> --
> http://www.kitfox.com
>
> ===========================================================================
> To unsubscribe, send email to listserv@java.sun.com and include in the body
> of the message "signoff JAVA2D-INTEREST". For general help, send email to
> listserv@java.sun.com and include in the body of the message "help".

===========================================================================
To unsubscribe, send email to listserv@java.sun.com and include in the body
of the message "signoff JAVA2D-INTEREST". For general help, send email to
listserv@java.sun.com and include in the body of the message "help".

Keith Lea

Chet Haase wrote:
> The current plan is for the OpenGL pipeline to be disabled by default,
> but enabled via a command-line flag. This is due to concerns over
> robustness (especially with the somewhat chaotic state of GL
> driver support on both Linux and Windows) and performance for
> some operations (OpenGL tends to get incredible performance for
> advanced rendering features but performance for some simple
> operations can be less amazing due to pbuffer support and
> acceleration on many drivers/hardware. We're working on
> both of these issues, but that's why this otherwise pretty
> awesome hw acceleration feature will not be enabled by default...

Does this mean that applets and programs run by double-clicking a jar
file won't be able to use the OpenGL pipeline, unless the user knows the
command line switch (in the case of jars)? This seems like a crazy idea,
considering the amount of effort going into the OpenGL pipeline. I
imagine that disabling it by default will make it so that for 99% of
people, the OpenGL pipeline won't be used. Most users don't want to open
the command line to run a program and they don't want to have to
remember -Ds.d.sdf.asd.OpenGL=true every time they run a program, and
most users don't know how to modify the file association for .jar to
pass in that property.

This decision makes me mad at Sun. It seems they always start something
good and then mess it up, like making an OpenGL pipeline then making it
so no one will use it and it's hard to enable.

Will there be a way to programmatically enable the GL pipeline or is it
only a system property at startup that can do it?

> I don't know the official date, and one never knows with software
> in any case. We should be releasing our Beta2 sometime soon, after
> which the next release should be the final one. As to how that
> equates into specific dates...

Sun says Java 1.5 final will be released in August:

* Beta 1 - Feb 2004
* Beta 2 - Apr 2004
* Release Candidate - June 2004
* FCS - Aug 2004

-Keith

===========================================================================
To unsubscribe, send email to listserv@java.sun.com and include in the body
of the message "signoff JAVA2D-INTEREST". For general help, send email to
listserv@java.sun.com and include in the body of the message "help".

Phil Race

Keith,

Keith Lea wrote:
> Chet Haase wrote:
>
>> The current plan is for the OpenGL pipeline to be disabled by default,
>> but enabled via a command-line flag. This is due to concerns over
>> robustness (especially with the somewhat chaotic state of GL
>> driver support on both Linux and Windows) and performance for
>> some operations (OpenGL tends to get incredible performance for
>> advanced rendering features but performance for some simple
>> operations can be less amazing due to pbuffer support and
>> acceleration on many drivers/hardware. We're working on
>> both of these issues, but that's why this otherwise pretty
>> awesome hw acceleration feature will not be enabled by default...
>
>
> Does this mean that applets and programs run by double-clicking a jar
> file won't be able to use the OpenGL pipeline, unless the user knows the
> command line switch (in the case of jars)? This seems like a crazy idea,
> considering the amount of effort going into the OpenGL pipeline. I
> imagine that disabling it by default will make it so that for 99% of
> people, the OpenGL pipeline won't be used. Most users don't want to open
> the command line to run a program and they don't want to have to
> remember -Ds.d.sdf.asd.OpenGL=true every time they run a program, and
> most users don't know how to modify the file association for .jar to
> pass in that property.

No one expects "users" to do this.
"developers" and "deployers" will to it, if they know its OK.
And a system property set in the "main" program before 2D is initialised
will work just fine.

>
> This decision makes me mad at Sun. It seems they always start something
> good and then mess it up, like making an OpenGL pipeline then making it
> so no one will use it and it's hard to enable.

The reason its not enabled by default is that its chances of working
properly are not great and its not due to bugs in JDK - its due to
bugs and limitations in OpenGL.

I think what would make people really mad is enabling by default
something that causes most people's apps to behave incorrectly
or perhaps even crash whilst perhaps offering minimal benefit.
So this is prudence not craziness. And its reluctant prudence until
the state of OpenGL gets better. The engineer working on this is
probably even sicker about this than you are.

-phil.

===========================================================================
To unsubscribe, send email to listserv@java.sun.com and include in the body
of the message "signoff JAVA2D-INTEREST". For general help, send email to
listserv@java.sun.com and include in the body of the message "help".