In message <[EMAIL PROTECTED]>
          Jim Graham <[EMAIL PROTECTED]> wrote:

> Hi Mark,

> In an ideal world we would have made TexturePaint, or at least its
> createContext() method, final.  Internally it is useful for us to know
> that a texture is being applied so we can use optimized code to paint
> with the texture directly rather than having to call createContext() and
> cause Raster objects to be created for the data.

> We used to have cases in our code as well where we would do an
> instanceof on TexturePaint before we ran across someone trying to
> subclass it as you are doing.  We've since tried to trigger off of
> comparing the paint.getClass() to TexturePaint.class so we only apply
> the optimizations in the case where it is a true TexturePaint instance,
> but that is less than ideal in the long run as the more specific test
> does not use language optimizations and also penalizes developers who
> subclass TexturePaint for reasons other than to override the
> createContext() method.

> I'm guessing Apply may still have a few instanceof tests in their code.
>   Have you tried it on their beta version of 6 at all?

> Also, out of curiousity, why are you overriding the createContext() method?

>                         ...jim

We use a custom PaintContext in our PDF renderer to handle
PatternColorspaces where the Pattern is also rotated or inverted.
In PatternColorspaces a single titled image is drawn again and again
to fill an area. Because the pattern needs to overlap and repeat
correctly when rotated, you can not just use a standard TextPaint to
just repeatedly draw it as it will not line up.

Our custom PaintContext creates a single image and works out the
tiling repeat offsets so it is drawn correctly.

When we started to debug it on the Apple, our TexturePaint is
instanced as we would expect, but createContext is never called.

This seeems like a major deviation from the Java standard to us :-(

Have not tried it on 1.6 (Apple have removed their beta).

MArk

===========================================================================
To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
of the message "signoff JAVA2D-INTEREST".  For general help, send email to
[EMAIL PROTECTED] and include in the body of the message "help".

Reply via email to