# HG changeset patch # User ceisserer # Date 1378053483 25200 # Node ID ce9a620fe8793402955cdfcf2d6d6f17bfc89866 # Parent 91b06f0168212405da941cbba3a5f6f3b9bd7f3b 7189452: XRender pipeline does ignore source-surface offset for text rendering Reviewed-by: prr, bae diff -r 91b06f016821 -r ce9a620fe879 jdk/src/solaris/classes/sun/font/XRTextRenderer.java --- 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 { diff -r 91b06f016821 -r ce9a620fe879 jdk/src/solaris/classes/sun/java2d/xr/XRBackendNative.java --- 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()); } diff -r 91b06f016821 -r ce9a620fe879 jdk/src/solaris/classes/sun/java2d/xr/XRCompositeManager.java --- 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() { diff -r 91b06f016821 -r ce9a620fe879 jdk/src/solaris/native/sun/java2d/x11/XRBackendNative.c --- 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);