37 import sun.java2d.loops.GraphicsPrimitive;
38 import sun.java2d.pipe.Region;
39 import sun.java2d.pipe.PixelDrawPipe;
40 import sun.java2d.pipe.PixelFillPipe;
41 import sun.java2d.pipe.ShapeDrawPipe;
42 import sun.java2d.pipe.SpanIterator;
43 import sun.java2d.pipe.ShapeSpanIterator;
44 import sun.java2d.pipe.LoopPipe;
45
46 public class X11Renderer implements
47 PixelDrawPipe,
48 PixelFillPipe,
49 ShapeDrawPipe
50 {
51 public static X11Renderer getInstance() {
52 return (GraphicsPrimitive.tracingEnabled()
53 ? new X11TracingRenderer()
54 : new X11Renderer());
55 }
56
57 private final long validate(SunGraphics2D sg2d) {
58 // NOTE: getCompClip() will revalidateAll() if the
59 // surfaceData is invalid. This should ensure that
60 // the clip and pixel that we are validating against
61 // are the most current.
62 //
63 // The assumption is that the pipeline after that
64 // revalidation will either be another X11 pipe
65 // (because the drawable format never changes on X11)
66 // or a null pipeline if the surface is disposed.
67 //
68 // Since we do not get the ops structure of the SurfaceData
69 // until the actual call down to the native level we will
70 // pick up the most recently validated copy.
71 // Note that if the surface is disposed, a NullSurfaceData
72 // (with null native data structure) will be set in
73 // sg2d, so we have to protect against it in native code.
74
75 X11SurfaceData x11sd = (X11SurfaceData)sg2d.surfaceData;
76 return x11sd.getRenderGC(sg2d.getCompClip(),
77 sg2d.compositeState, sg2d.composite,
|
37 import sun.java2d.loops.GraphicsPrimitive;
38 import sun.java2d.pipe.Region;
39 import sun.java2d.pipe.PixelDrawPipe;
40 import sun.java2d.pipe.PixelFillPipe;
41 import sun.java2d.pipe.ShapeDrawPipe;
42 import sun.java2d.pipe.SpanIterator;
43 import sun.java2d.pipe.ShapeSpanIterator;
44 import sun.java2d.pipe.LoopPipe;
45
46 public class X11Renderer implements
47 PixelDrawPipe,
48 PixelFillPipe,
49 ShapeDrawPipe
50 {
51 public static X11Renderer getInstance() {
52 return (GraphicsPrimitive.tracingEnabled()
53 ? new X11TracingRenderer()
54 : new X11Renderer());
55 }
56
57 private long validate(SunGraphics2D sg2d) {
58 // NOTE: getCompClip() will revalidateAll() if the
59 // surfaceData is invalid. This should ensure that
60 // the clip and pixel that we are validating against
61 // are the most current.
62 //
63 // The assumption is that the pipeline after that
64 // revalidation will either be another X11 pipe
65 // (because the drawable format never changes on X11)
66 // or a null pipeline if the surface is disposed.
67 //
68 // Since we do not get the ops structure of the SurfaceData
69 // until the actual call down to the native level we will
70 // pick up the most recently validated copy.
71 // Note that if the surface is disposed, a NullSurfaceData
72 // (with null native data structure) will be set in
73 // sg2d, so we have to protect against it in native code.
74
75 X11SurfaceData x11sd = (X11SurfaceData)sg2d.surfaceData;
76 return x11sd.getRenderGC(sg2d.getCompClip(),
77 sg2d.compositeState, sg2d.composite,
|