Ejemplo n.º 1
0
 /*     */ public Texture getMaskTexture(MaskData paramMaskData) {
   /* 177 */ int i = paramMaskData.getWidth();
   /* 178 */ int j = paramMaskData.getHeight();
   /* 179 */ if ((this.maskTex == null)
       || (this.maskTex.getContentWidth() < i)
       || (this.maskTex.getContentHeight() < j))
   /*     */ {
     /* 183 */ int k = i;
     /* 184 */ int m = j;
     /* 185 */ if (this.maskTex != null)
     /*     */ {
       /* 190 */ k = Math.max(i, this.maskTex.getContentWidth());
       /* 191 */ m = Math.max(j, this.maskTex.getContentHeight());
       /* 192 */ this.maskTex.dispose();
       /*     */ }
     /* 194 */ this.maskTex = getResourceFactory().createMaskTexture(k, m);
     /*     */ }
   /*     */
   /* 198 */ paramMaskData.uploadToTexture(this.maskTex, 0, 0, false);
   /*     */
   /* 200 */ return this.maskTex;
   /*     */ }
Ejemplo n.º 2
0
 /*     */ public Texture getGradientTexture(
     Gradient paramGradient,
     BaseTransform paramBaseTransform,
     int paramInt1,
     int paramInt2,
     MaskData paramMaskData,
     float paramFloat1,
     float paramFloat2,
     float paramFloat3,
     float paramFloat4)
       /*     */ {
   /* 208 */ int i = paramInt1 * paramInt2;
   /* 209 */ int j = i * 4;
   /* 210 */ if ((this.paintBuffer == null) || (this.paintBuffer.capacity() < j)) {
     /* 211 */ this.paintPixels = new int[i];
     /* 212 */ this.paintBuffer = ByteBuffer.wrap(new byte[j]);
     /*     */ }
   /*     */
   /* 215 */ if ((this.paintTex == null)
       || (this.paintTex.getContentWidth() < paramInt1)
       || (this.paintTex.getContentHeight() < paramInt2))
   /*     */ {
     /* 219 */ int k = paramInt1;
     /* 220 */ int m = paramInt2;
     /* 221 */ if (this.paintTex != null)
     /*     */ {
       /* 226 */ k = Math.max(paramInt1, this.paintTex.getContentWidth());
       /* 227 */ m = Math.max(paramInt2, this.paintTex.getContentHeight());
       /* 228 */ this.paintTex.dispose();
       /*     */ }
     /* 230 */ this.paintTex =
         getResourceFactory()
             .createTexture(PixelFormat.BYTE_BGRA_PRE, Texture.Usage.DEFAULT, k, m, false);
     /*     */ }
   /*     */
   /* 238 */ PaintUtil.fillImageWithGradient(
       this.paintPixels,
       paramGradient,
       paramBaseTransform,
       0,
       0,
       paramInt1,
       paramInt2,
       paramFloat1,
       paramFloat2,
       paramFloat3,
       paramFloat4);
   /*     */
   /* 244 */ byte[] arrayOfByte1 = this.paintBuffer.array();
   /*     */ int i1;
   /*     */ int i2;
   /* 245 */ if (paramMaskData != null)
   /*     */ {
     /* 248 */ byte[] arrayOfByte2 = paramMaskData.getMaskBuffer().array();
     /* 249 */ i1 = 0;
     /* 250 */ for (i2 = 0; i2 < i; i2++) {
       /* 251 */ int i3 = this.paintPixels[i2];
       /* 252 */ int i4 = arrayOfByte2[i2] & 0xFF;
       /* 253 */ arrayOfByte1[(i1++)] = ((byte) ((i3 & 0xFF) * i4 / 255));
       /* 254 */ arrayOfByte1[(i1++)] = ((byte) ((i3 >> 8 & 0xFF) * i4 / 255));
       /* 255 */ arrayOfByte1[(i1++)] = ((byte) ((i3 >> 16 & 0xFF) * i4 / 255));
       /* 256 */ arrayOfByte1[(i1++)] = ((byte) ((i3 >>> 24) * i4 / 255));
       /*     */ }
     /*     */ }
   /*     */ else {
     /* 260 */ int n = 0;
     /* 261 */ for (i1 = 0; i1 < i; i1++) {
       /* 262 */ i2 = this.paintPixels[i1];
       /* 263 */ arrayOfByte1[(n++)] = ((byte) (i2 & 0xFF));
       /* 264 */ arrayOfByte1[(n++)] = ((byte) (i2 >> 8 & 0xFF));
       /* 265 */ arrayOfByte1[(n++)] = ((byte) (i2 >> 16 & 0xFF));
       /* 266 */ arrayOfByte1[(n++)] = ((byte) (i2 >>> 24));
       /*     */ }
     /*     */ }
   /*     */
   /* 270 */ this.paintTex.update(
       this.paintBuffer,
       PixelFormat.BYTE_BGRA_PRE,
       0,
       0,
       0,
       0,
       paramInt1,
       paramInt2,
       paramInt1 * 4,
       false);
   /*     */
   /* 273 */ return this.paintTex;
   /*     */ }