[OpenJDK 2D-Dev] Question about STR pipelines and Surface/SW blits
roman.kennke at aicas.com
Tue Dec 2 11:46:16 PST 2008
> I am not sure if I completly understand how
> getRaster/getRasInfo/Sw-Surface blits fit together:
> First the pipeline looks for an appropriate blit, if one can be found
> its used. If not, getRasInfo is called by the native loops.
> Because the STR pipes cover all possibible surface combinations,
> getRasInfo is never called.
> Are those assumptions right?
AFAICS (I'm not the expert here, but I'm digging in this code right
now), GetRasInfo() (and the other SurfaceData.h function pointers) is
called whenever a native render loop needs to access pixel data of the
surface. This happens when a pipeline doesn't have certain graphics
primitive for that surface overridden, usually happens for complex stuff
like compositing, drawing with complex clip, etc.
> When is SurfaceData.getRaster called, and why does't it matter that
> its not implemented e.g. for X11SurfaceData?
AFAIK, it is called if there are no native ops registered, then as a
last resort the loops try to grab the raster and get the pixel data out
> Are there any disadvantages by relying on getRasInfo compared to
> explicit blit loops?
Performance. If you can implement a certain operation by an HW
accelerated blit, then it's most likely faster than letting the SW loops
render the stuff.
> Dmitri told me that it was done this way to avoid threading issues,
> however my pipeline is synchronous anyway, only generating X protocol
> on the java side ... and the getRasInfo code is already written ;)
> When getRasInfo is called, I intend to:
> 1. Call into Java code
> 2. Grab a lock on the protocoll buffer
> 3. Flush all pending operations (which is a Java->C call)
> 4. return to getRasInfo and continue (which calls XSync if needed).
> Should I expect problems with design?
> The STR pipelines could have used quite the same mechanism, why wasn't it done?
> Thanks, Clemens
Dipl.-Inform. (FH) Roman Kennke, Software Engineer, http://kennke.org
aicas Allerton Interworks Computer Automated Systems GmbH
Haid-und-Neu-Straße 18 * D-76131 Karlsruhe * Germany
http://www.aicas.com * Tel: +49-721-663 968-48
USt-Id: DE216375633, Handelsregister HRB 109481, AG Karlsruhe
Geschäftsführer: Dr. James J. Hunt
More information about the 2d-dev