Re: BufferedShapeLayer

From: Chinh Tang <ctang@teloptica.com>
Date: Thu Aug 02 2001 - 17:26:51 EDT

I looked at it again and found I created a layer derived directly from Layer.
It was slower until I copied the Graphics and worked on it.

Don Dietrick wrote:

> Hi Chinh,
>
> I just tried these changes, and was not able to see any different in
> performance.
>
> With copied graphics:
>
> For ShapeLayer at scale 1.0E7, the time to render is: 76
> For ShapeLayer at scale 1.0E7, the time to render is: 60
> For ShapeLayer at scale 2.0E7, the time to render is: 52
> For ShapeLayer at scale 4.0E7, the time to render is: 70
> For ShapeLayer at scale 8.0E7, the time to render is: 196
> For ShapeLayer at scale 1.6E8, the time to render is: 545
> For ShapeLayer at scale 2.0488352E8, the time to render is: 541
>
> Original:
>
> For ShapeLayer at scale 1.0E7, the time to render is: 68
> For ShapeLayer at scale 1.0E7, the time to render is: 43
> For ShapeLayer at scale 2.0E7, the time to render is: 48
> For ShapeLayer at scale 4.0E7, the time to render is: 72
> For ShapeLayer at scale 8.0E7, the time to render is: 183
> For ShapeLayer at scale 1.6E8, the time to render is: 542
> For ShapeLayer at scale 2.0488352E8, the time to render is: 550
> For ShapeLayer at scale 2.0488352E8, the time to render is: 571
>
> Time is in milliseconds.
>
> Do you have different performance numbers?
>
> Cheers,
>
> Don
>
> On Thursday, August 2, 2001, at 04:12 PM, Chinh Tang wrote:
>
> > Hey all,
> >
> > I found that BufferedShapeLayer repaints much faster if I create a copy
> > of
> > the Graphics object, paint on this buffer, then paint it back on the
> > original Graphics object.
> > Modified paint() is below. Is there a reason why this was not done
> > before?
> >
> > -Chinh
> >
> > /**
> > * Renders the layer on the map.
> > *
> > * @param g a graphics context
> > */
> > public void paint (Graphics g) {
> > // grab local for thread safety
> > OMGraphicList omg = omgraphics;
> >
> > Graphics g2 = g.create();
> >
> > if (omg != null){
> > if (Debug.debugging("shape"))
> > Debug.output("ShapeLayer.paint(): " + omg.size() +
> > " omg" + " shadow=" + shadowX + "," + shadowY);
> >
> > if (shadowX != 0 || shadowY != 0){
> > Graphics shadowG = g2.create();
> > shadowG.translate(shadowX, shadowY);
> > omg.render(shadowG);
> > } else {
> > omg.render(g2);
> > }
> > if (Debug.debugging("shape")){
> > Debug.output("ShapeLayer.paint(): done");
> > }
> > }
> > ((Graphics2D)g).draw(g2.getClip());
> > g2.dispose();
> > g.dispose();
> > }
> >
> >
> >
> > --
> > [To unsubscribe to this list send an email to "majdart@bbn.com"
> > with the following text in the BODY of the message "unsubscribe
> > openmap-users"]
> >
>
> =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
> Donald F. Dietrick, dietrick@bbn.com
> BBN Technologies, 10 Moulton Street, Cambridge, MA 02138
> 617.873.3031 FAX 2794
> =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=

--
[To unsubscribe to this list send an email to "majdart@bbn.com"
with the following text in the BODY of the message "unsubscribe openmap-users"]
Received on Thu Aug 2 17:28:15 2001

This archive was generated by hypermail 2.1.8 : Thu May 12 2005 - 07:18:31 EDT