-
Bug
-
Resolution: Duplicate
-
P3
-
None
-
1.2.0
-
x86
-
windows_95
Sometime between the JDK 1.1.4 and JDK 1.2s (which is the source code we
have integrated with our modifications), Sun made radical changes to
drawing to offscreen images. In 1.2s, when you call createImage (see
WComponentPeer.java), it creates an instance of OffScreenImage which is
essentially a block of memory set up as an RGBA bitmap. All drawing is
done using a combination of Java and native code that draws to this
bitmap by setting pixels. In contrast, in 1.1.4, a call to createImage
would create a WOffScreenImage, which would create a bitmap using
"CreateCompatibleBitmap", and draw to that bitmap using Windows calls in
a manner identical to the way it was done for drawing to screen windows
(through a WGraphics object).
I believe the changes were made to accomodate the Java2D API changes,
but the result has been to very dramatically slow down both drawing to
offscreen images and the "drawImage" method used to blit them to a
screen windows. (A very dramatic example of this slowdown can be seen by
simply running the "Swingset" demo from Swing-0.5.1, which has
acceptable performance in 1.1.4, but is pathetic in 1.2s). Also, I have
attached a zip file with some test cases in it. To run, set your
classpath to the install directory and enter:
To run Offscreen performance test:
---------------------------------
% java com.bentley.test.graphics.OSGraphTest map.log
To run Onscreen performance test:
--------------------------------
% java com.bentley.test.graphics.GraphTest map.log
My results show the offscreen test OSGraphTest taking about 4.3 seconds
on JDK 1.1.4, and about 30 seconds on 1.2s.
The onscreen test is comparable on the two.
Note that there is a substantial delay when the test is started while it
reads in and parses the map.log file.
have integrated with our modifications), Sun made radical changes to
drawing to offscreen images. In 1.2s, when you call createImage (see
WComponentPeer.java), it creates an instance of OffScreenImage which is
essentially a block of memory set up as an RGBA bitmap. All drawing is
done using a combination of Java and native code that draws to this
bitmap by setting pixels. In contrast, in 1.1.4, a call to createImage
would create a WOffScreenImage, which would create a bitmap using
"CreateCompatibleBitmap", and draw to that bitmap using Windows calls in
a manner identical to the way it was done for drawing to screen windows
(through a WGraphics object).
I believe the changes were made to accomodate the Java2D API changes,
but the result has been to very dramatically slow down both drawing to
offscreen images and the "drawImage" method used to blit them to a
screen windows. (A very dramatic example of this slowdown can be seen by
simply running the "Swingset" demo from Swing-0.5.1, which has
acceptable performance in 1.1.4, but is pathetic in 1.2s). Also, I have
attached a zip file with some test cases in it. To run, set your
classpath to the install directory and enter:
To run Offscreen performance test:
---------------------------------
% java com.bentley.test.graphics.OSGraphTest map.log
To run Onscreen performance test:
--------------------------------
% java com.bentley.test.graphics.GraphTest map.log
My results show the offscreen test OSGraphTest taking about 4.3 seconds
on JDK 1.1.4, and about 30 seconds on 1.2s.
The onscreen test is comparable on the two.
Note that there is a substantial delay when the test is started while it
reads in and parses the map.log file.
- duplicates
-
JDK-4123926 JDK 1.2 graphics performance too slow, drawing to an offscreen Image
- Closed
- relates to
-
JDK-4128406 drawing polylines too slow when putting the graphics to the screen through AWT
- Closed
-
JDK-4128431 win32: awt_Graphics.cpp sets the clip region too often, reducing performance
- Closed