7189452: XRender pipeline does ignore source-surface offset for text rendering
Reviewed-by: prr, bae
--- a/jdk/src/solaris/classes/sun/font/XRTextRenderer.java Fri Aug 30 10:25:55 2013 -0700
+++ b/jdk/src/solaris/classes/sun/font/XRTextRenderer.java Sun Sep 01 09:38:03 2013 -0700
@@ -142,7 +142,7 @@
}
int maskFormat = containsLCDGlyphs ? XRUtils.PictStandardARGB32 : XRUtils.PictStandardA8;
- maskBuffer.compositeText(x11sd.picture, 0, maskFormat, eltList);
+ maskBuffer.compositeText(x11sd, (int) gl.getX(), (int) gl.getY(), 0, maskFormat, eltList);
eltList.clear();
} finally {
--- a/jdk/src/solaris/classes/sun/java2d/xr/XRBackendNative.java Fri Aug 30 10:25:55 2013 -0700
+++ b/jdk/src/solaris/classes/sun/java2d/xr/XRBackendNative.java Sun Sep 01 09:38:03 2013 -0700
@@ -267,8 +267,9 @@
private static native void
XRenderCompositeTextNative(int op, int src, int dst,
- long maskFormat, int[] eltArray,
- int[] glyphIDs, int eltCnt, int glyphCnt);
+ int srcX, int srcY, long maskFormat,
+ int[] eltArray, int[] glyphIDs, int eltCnt,
+ int glyphCnt);
public int XRenderCreateGlyphSet(int formatID) {
return XRenderCreateGlyphSetNative(getFormatPtr(formatID));
@@ -278,11 +279,11 @@
public void XRenderCompositeText(byte op, int src, int dst,
int maskFormatID,
- int src2, int src3, int dst2, int dst3,
+ int sx, int sy, int dx, int dy,
int glyphset, GrowableEltArray elts) {
GrowableIntArray glyphs = elts.getGlyphs();
- XRenderCompositeTextNative(op, src, dst, 0, elts.getArray(),
+ XRenderCompositeTextNative(op, src, dst, sx, sy, 0, elts.getArray(),
glyphs.getArray(), elts.getSize(),
glyphs.getSize());
}
--- a/jdk/src/solaris/classes/sun/java2d/xr/XRCompositeManager.java Fri Aug 30 10:25:55 2013 -0700
+++ b/jdk/src/solaris/classes/sun/java2d/xr/XRCompositeManager.java Sun Sep 01 09:38:03 2013 -0700
@@ -295,10 +295,10 @@
sy, 0, 0, dx, dy, w, h);
}
- public void compositeText(int dst, int glyphSet, int maskFormat,
- GrowableEltArray elts) {
- con.XRenderCompositeText(compRule, src.picture, dst, maskFormat, 0, 0,
- 0, 0, glyphSet, elts);
+ public void compositeText(XRSurfaceData dst, int sx, int sy,
+ int glyphSet, int maskFormat, GrowableEltArray elts) {
+ con.XRenderCompositeText(compRule, src.picture, dst.picture,
+ maskFormat, sx, sy, 0, 0, glyphSet, elts);
}
public XRColor getMaskColor() {
--- a/jdk/src/solaris/native/sun/java2d/x11/XRBackendNative.c Fri Aug 30 10:25:55 2013 -0700
+++ b/jdk/src/solaris/native/sun/java2d/x11/XRBackendNative.c Sun Sep 01 09:38:03 2013 -0700
@@ -911,8 +911,9 @@
JNIEXPORT void JNICALL
Java_sun_java2d_xr_XRBackendNative_XRenderCompositeTextNative
- (JNIEnv *env, jclass cls, jint op, jint src, jint dst, jlong maskFmt,
- jintArray eltArray, jintArray glyphIDArray, jint eltCnt, jint glyphCnt) {
+ (JNIEnv *env, jclass cls, jint op, jint src, jint dst,
+ jint sx, jint sy, jlong maskFmt, jintArray eltArray,
+ jintArray glyphIDArray, jint eltCnt, jint glyphCnt) {
jint i;
jint *ids;
jint *elts;
@@ -991,7 +992,7 @@
XRenderCompositeText32(awt_display, op, (Picture) src, (Picture) dst,
(XRenderPictFormat *) jlong_to_ptr(maskFmt),
- 0, 0, 0, 0, xelts, eltCnt);
+ sx, sy, 0, 0, xelts, eltCnt);
(*env)->ReleasePrimitiveArrayCritical(env, glyphIDArray, ids, JNI_ABORT);
(*env)->ReleasePrimitiveArrayCritical(env, eltArray, elts, JNI_ABORT);