7189452: XRender pipeline does ignore source-surface offset for text rendering

Reviewed-by: prr, bae
This commit is contained in:
Clemens Eisserer 2013-09-01 09:38:03 -07:00
parent d5c4be9c65
commit 24f306c761
4 changed files with 14 additions and 12 deletions

View File

@ -142,7 +142,7 @@ public class XRTextRenderer extends GlyphListPipe {
}
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 {

View File

@ -267,8 +267,9 @@ public class XRBackendNative implements XRBackend {
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 class XRBackendNative implements XRBackend {
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());
}

View File

@ -295,10 +295,10 @@ public class XRCompositeManager {
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() {

View File

@ -911,8 +911,9 @@ Java_sun_java2d_xr_XRBackendNative_XRenderCreateGlyphSetNative
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 @@ Java_sun_java2d_xr_XRBackendNative_XRenderCompositeTextNative
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);