--- a/jdk/src/solaris/classes/sun/java2d/xr/XRSurfaceData.java Tue Oct 22 13:28:44 2013 +0400
+++ b/jdk/src/solaris/classes/sun/java2d/xr/XRSurfaceData.java Tue Oct 22 13:47:45 2013 -0700
@@ -395,6 +395,7 @@
boolean transformInUse = false;
AffineTransform validatedSourceTransform = new AffineTransform();
+ AffineTransform staticSrcTx = null;
int validatedRepeat = XRUtils.RepeatNone;
int validatedFilter = XRUtils.FAST;
@@ -423,13 +424,24 @@
}
} else if (!transformInUse ||
(transformInUse && !sxForm.equals(validatedSourceTransform))) {
+
validatedSourceTransform.setTransform(sxForm.getScaleX(),
sxForm.getShearY(),
sxForm.getShearX(),
sxForm.getScaleY(),
sxForm.getTranslateX(),
sxForm.getTranslateY());
- renderQueue.setPictureTransform(picture, validatedSourceTransform);
+
+ AffineTransform srcTransform = validatedSourceTransform;
+ if(staticSrcTx != null) {
+ // Apply static transform set when used as texture or gradient.
+ // Create a copy to not modify validatedSourceTransform as
+ // this would confuse the validation logic.
+ srcTransform = new AffineTransform(validatedSourceTransform);
+ srcTransform.preConcatenate(staticSrcTx);
+ }
+
+ renderQueue.setPictureTransform(picture, srcTransform);
transformInUse = true;
}
@@ -547,15 +559,10 @@
}
public static class XRInternalSurfaceData extends XRSurfaceData {
- public XRInternalSurfaceData(XRBackend renderQueue, int pictXid,
- AffineTransform transform) {
+ public XRInternalSurfaceData(XRBackend renderQueue, int pictXid) {
super(renderQueue);
this.picture = pictXid;
- this.validatedSourceTransform = transform;
-
- if (validatedSourceTransform != null) {
- transformInUse = true;
- }
+ this.transformInUse = false;
}
public boolean canSourceSendExposures(int x, int y, int w, int h) {
@@ -677,4 +684,8 @@
public XRGraphicsConfig getGraphicsConfig() {
return graphicsConfig;
}
+
+ public void setStaticSrcTx(AffineTransform staticSrcTx) {
+ this.staticSrcTx = staticSrcTx;
+ }
}