modules/graphics/src/main/java/com/sun/prism/sw/SWGraphics.java

Print this page




  75 
  76     private final BaseTransform tx = new Affine2D();
  77 
  78     private CompositeMode compositeMode = CompositeMode.SRC_OVER;
  79 
  80     private Rectangle clip;
  81     private final Rectangle finalClip = new Rectangle();
  82     private RectBounds nodeBounds;
  83 
  84     private int clipRectIndex;
  85 
  86     private Paint paint = DEFAULT_PAINT;
  87     private BasicStroke stroke = DEFAULT_STROKE;
  88 
  89     private Ellipse2D ellipse2d;
  90     private Line2D line2d;
  91     private RoundRectangle2D rect2d;
  92 
  93     private boolean antialiasedShape = true;
  94     private boolean hasPreCullingBits = false;
  95     private float pixelScale = 1.0f;

  96 
  97     private NodePath renderRoot;
  98     @Override
  99     public void setRenderRoot(NodePath root) {
 100         this.renderRoot = root;
 101     }
 102 
 103     @Override
 104     public NodePath getRenderRoot() {
 105         return renderRoot;
 106     }
 107 
 108     public SWGraphics(SWRTTexture target, SWContext context, PiscesRenderer pr) {
 109         this.target = target;
 110         this.context = context;
 111         this.pr = pr;
 112         this.swPaint = new SWPaint(context, pr);
 113 
 114         this.setClipRect(null);
 115     }


 909 
 910         final int pixels[] = rbb.getDataNoClone();
 911         this.target.getSurface().getRGB(pixels, 0, rbb.getPhysicalWidth(), view.x, view.y, w, h);
 912         return rbb;
 913     }
 914 
 915     public void releaseReadBackBuffer(RTTexture view) {
 916     }
 917 
 918     public void setState3D(boolean flag) {
 919     }
 920 
 921     public boolean isState3D() {
 922         return false;
 923     }
 924 
 925     public void setup3DRendering() {
 926     }
 927 
 928     @Override
 929     public void setPixelScaleFactor(float pixelScale) {
 930         this.pixelScale = pixelScale;
 931     }
 932 
 933     @Override
 934     public float getPixelScaleFactor() {
 935         return pixelScale;





 936     }
 937 
 938     @Override
 939     public void setLights(NGLightBase[] lights) {
 940         // Light are not supported by SW pipeline
 941     }
 942 
 943     @Override
 944     public NGLightBase[] getLights() {
 945         // Light are not supported by SW pipeline
 946         return null;
 947     }
 948 
 949     @Override
 950     public void blit(RTTexture srcTex, RTTexture dstTex,
 951                     int srcX0, int srcY0, int srcX1, int srcY1,
 952                     int dstX0, int dstY0, int dstX1, int dstY1) {
 953         Graphics g = dstTex.createGraphics();
 954         g.drawTexture(srcTex,
 955                       dstX0, dstY0, dstX1, dstY1,


  75 
  76     private final BaseTransform tx = new Affine2D();
  77 
  78     private CompositeMode compositeMode = CompositeMode.SRC_OVER;
  79 
  80     private Rectangle clip;
  81     private final Rectangle finalClip = new Rectangle();
  82     private RectBounds nodeBounds;
  83 
  84     private int clipRectIndex;
  85 
  86     private Paint paint = DEFAULT_PAINT;
  87     private BasicStroke stroke = DEFAULT_STROKE;
  88 
  89     private Ellipse2D ellipse2d;
  90     private Line2D line2d;
  91     private RoundRectangle2D rect2d;
  92 
  93     private boolean antialiasedShape = true;
  94     private boolean hasPreCullingBits = false;
  95     private float pixelScaleX = 1.0f;
  96     private float pixelScaleY = 1.0f;
  97 
  98     private NodePath renderRoot;
  99     @Override
 100     public void setRenderRoot(NodePath root) {
 101         this.renderRoot = root;
 102     }
 103 
 104     @Override
 105     public NodePath getRenderRoot() {
 106         return renderRoot;
 107     }
 108 
 109     public SWGraphics(SWRTTexture target, SWContext context, PiscesRenderer pr) {
 110         this.target = target;
 111         this.context = context;
 112         this.pr = pr;
 113         this.swPaint = new SWPaint(context, pr);
 114 
 115         this.setClipRect(null);
 116     }


 910 
 911         final int pixels[] = rbb.getDataNoClone();
 912         this.target.getSurface().getRGB(pixels, 0, rbb.getPhysicalWidth(), view.x, view.y, w, h);
 913         return rbb;
 914     }
 915 
 916     public void releaseReadBackBuffer(RTTexture view) {
 917     }
 918 
 919     public void setState3D(boolean flag) {
 920     }
 921 
 922     public boolean isState3D() {
 923         return false;
 924     }
 925 
 926     public void setup3DRendering() {
 927     }
 928 
 929     @Override
 930     public void setPixelScaleFactors(float pixelScaleX, float pixelScaleY) {
 931         this.pixelScaleX = pixelScaleX;
 932     }
 933 
 934     @Override
 935     public float getPixelScaleFactorX() {
 936         return pixelScaleX;
 937     }
 938 
 939     @Override
 940     public float getPixelScaleFactorY() {
 941         return pixelScaleY;
 942     }
 943 
 944     @Override
 945     public void setLights(NGLightBase[] lights) {
 946         // Light are not supported by SW pipeline
 947     }
 948 
 949     @Override
 950     public NGLightBase[] getLights() {
 951         // Light are not supported by SW pipeline
 952         return null;
 953     }
 954 
 955     @Override
 956     public void blit(RTTexture srcTex, RTTexture dstTex,
 957                     int srcX0, int srcY0, int srcX1, int srcY1,
 958                     int dstX0, int dstY0, int dstX1, int dstY1) {
 959         Graphics g = dstTex.createGraphics();
 960         g.drawTexture(srcTex,
 961                       dstX0, dstY0, dstX1, dstY1,