393 private Region validatedGCClip; |
393 private Region validatedGCClip; |
394 private boolean validatedExposures = true; |
394 private boolean validatedExposures = true; |
395 |
395 |
396 boolean transformInUse = false; |
396 boolean transformInUse = false; |
397 AffineTransform validatedSourceTransform = new AffineTransform(); |
397 AffineTransform validatedSourceTransform = new AffineTransform(); |
|
398 AffineTransform staticSrcTx = null; |
398 int validatedRepeat = XRUtils.RepeatNone; |
399 int validatedRepeat = XRUtils.RepeatNone; |
399 int validatedFilter = XRUtils.FAST; |
400 int validatedFilter = XRUtils.FAST; |
400 |
401 |
401 /** |
402 /** |
402 * Validates an XRSurfaceData when used as source. Note that the clip is |
403 * Validates an XRSurfaceData when used as source. Note that the clip is |
421 validatedSourceTransform); |
422 validatedSourceTransform); |
422 transformInUse = false; |
423 transformInUse = false; |
423 } |
424 } |
424 } else if (!transformInUse || |
425 } else if (!transformInUse || |
425 (transformInUse && !sxForm.equals(validatedSourceTransform))) { |
426 (transformInUse && !sxForm.equals(validatedSourceTransform))) { |
|
427 |
426 validatedSourceTransform.setTransform(sxForm.getScaleX(), |
428 validatedSourceTransform.setTransform(sxForm.getScaleX(), |
427 sxForm.getShearY(), |
429 sxForm.getShearY(), |
428 sxForm.getShearX(), |
430 sxForm.getShearX(), |
429 sxForm.getScaleY(), |
431 sxForm.getScaleY(), |
430 sxForm.getTranslateX(), |
432 sxForm.getTranslateX(), |
431 sxForm.getTranslateY()); |
433 sxForm.getTranslateY()); |
432 renderQueue.setPictureTransform(picture, validatedSourceTransform); |
434 |
|
435 AffineTransform srcTransform = validatedSourceTransform; |
|
436 if(staticSrcTx != null) { |
|
437 // Apply static transform set when used as texture or gradient. |
|
438 // Create a copy to not modify validatedSourceTransform as |
|
439 // this would confuse the validation logic. |
|
440 srcTransform = new AffineTransform(validatedSourceTransform); |
|
441 srcTransform.preConcatenate(staticSrcTx); |
|
442 } |
|
443 |
|
444 renderQueue.setPictureTransform(picture, srcTransform); |
433 transformInUse = true; |
445 transformInUse = true; |
434 } |
446 } |
435 |
447 |
436 if (filter != validatedFilter && filter != -1) { |
448 if (filter != validatedFilter && filter != -1) { |
437 renderQueue.setFilter(picture, filter); |
449 renderQueue.setFilter(picture, filter); |
545 super.invalidate(); |
557 super.invalidate(); |
546 } |
558 } |
547 } |
559 } |
548 |
560 |
549 public static class XRInternalSurfaceData extends XRSurfaceData { |
561 public static class XRInternalSurfaceData extends XRSurfaceData { |
550 public XRInternalSurfaceData(XRBackend renderQueue, int pictXid, |
562 public XRInternalSurfaceData(XRBackend renderQueue, int pictXid) { |
551 AffineTransform transform) { |
|
552 super(renderQueue); |
563 super(renderQueue); |
553 this.picture = pictXid; |
564 this.picture = pictXid; |
554 this.validatedSourceTransform = transform; |
565 this.transformInUse = false; |
555 |
|
556 if (validatedSourceTransform != null) { |
|
557 transformInUse = true; |
|
558 } |
|
559 } |
566 } |
560 |
567 |
561 public boolean canSourceSendExposures(int x, int y, int w, int h) { |
568 public boolean canSourceSendExposures(int x, int y, int w, int h) { |
562 return false; |
569 return false; |
563 } |
570 } |