提交 79da3b81 编写于 作者: C ceisserer

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

Reviewed-by: prr, bae
上级 c9ce1415
...@@ -142,7 +142,7 @@ public class XRTextRenderer extends GlyphListPipe { ...@@ -142,7 +142,7 @@ public class XRTextRenderer extends GlyphListPipe {
} }
int maskFormat = containsLCDGlyphs ? XRUtils.PictStandardARGB32 : XRUtils.PictStandardA8; 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(); eltList.clear();
} finally { } finally {
......
...@@ -267,8 +267,9 @@ public class XRBackendNative implements XRBackend { ...@@ -267,8 +267,9 @@ public class XRBackendNative implements XRBackend {
private static native void private static native void
XRenderCompositeTextNative(int op, int src, int dst, XRenderCompositeTextNative(int op, int src, int dst,
long maskFormat, int[] eltArray, int srcX, int srcY, long maskFormat,
int[] glyphIDs, int eltCnt, int glyphCnt); int[] eltArray, int[] glyphIDs, int eltCnt,
int glyphCnt);
public int XRenderCreateGlyphSet(int formatID) { public int XRenderCreateGlyphSet(int formatID) {
return XRenderCreateGlyphSetNative(getFormatPtr(formatID)); return XRenderCreateGlyphSetNative(getFormatPtr(formatID));
...@@ -278,11 +279,11 @@ public class XRBackendNative implements XRBackend { ...@@ -278,11 +279,11 @@ public class XRBackendNative implements XRBackend {
public void XRenderCompositeText(byte op, int src, int dst, public void XRenderCompositeText(byte op, int src, int dst,
int maskFormatID, int maskFormatID,
int src2, int src3, int dst2, int dst3, int sx, int sy, int dx, int dy,
int glyphset, GrowableEltArray elts) { int glyphset, GrowableEltArray elts) {
GrowableIntArray glyphs = elts.getGlyphs(); 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.getArray(), elts.getSize(),
glyphs.getSize()); glyphs.getSize());
} }
......
...@@ -295,10 +295,10 @@ public class XRCompositeManager { ...@@ -295,10 +295,10 @@ public class XRCompositeManager {
sy, 0, 0, dx, dy, w, h); sy, 0, 0, dx, dy, w, h);
} }
public void compositeText(int dst, int glyphSet, int maskFormat, public void compositeText(XRSurfaceData dst, int sx, int sy,
GrowableEltArray elts) { int glyphSet, int maskFormat, GrowableEltArray elts) {
con.XRenderCompositeText(compRule, src.picture, dst, maskFormat, 0, 0, con.XRenderCompositeText(compRule, src.picture, dst.picture,
0, 0, glyphSet, elts); maskFormat, sx, sy, 0, 0, glyphSet, elts);
} }
public XRColor getMaskColor() { public XRColor getMaskColor() {
......
...@@ -911,8 +911,9 @@ Java_sun_java2d_xr_XRBackendNative_XRenderCreateGlyphSetNative ...@@ -911,8 +911,9 @@ Java_sun_java2d_xr_XRBackendNative_XRenderCreateGlyphSetNative
JNIEXPORT void JNICALL JNIEXPORT void JNICALL
Java_sun_java2d_xr_XRBackendNative_XRenderCompositeTextNative Java_sun_java2d_xr_XRBackendNative_XRenderCompositeTextNative
(JNIEnv *env, jclass cls, jint op, jint src, jint dst, jlong maskFmt, (JNIEnv *env, jclass cls, jint op, jint src, jint dst,
jintArray eltArray, jintArray glyphIDArray, jint eltCnt, jint glyphCnt) { jint sx, jint sy, jlong maskFmt, jintArray eltArray,
jintArray glyphIDArray, jint eltCnt, jint glyphCnt) {
jint i; jint i;
jint *ids; jint *ids;
jint *elts; jint *elts;
...@@ -991,7 +992,7 @@ Java_sun_java2d_xr_XRBackendNative_XRenderCompositeTextNative ...@@ -991,7 +992,7 @@ Java_sun_java2d_xr_XRBackendNative_XRenderCompositeTextNative
XRenderCompositeText32(awt_display, op, (Picture) src, (Picture) dst, XRenderCompositeText32(awt_display, op, (Picture) src, (Picture) dst,
(XRenderPictFormat *) jlong_to_ptr(maskFmt), (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, glyphIDArray, ids, JNI_ABORT);
(*env)->ReleasePrimitiveArrayCritical(env, eltArray, elts, JNI_ABORT); (*env)->ReleasePrimitiveArrayCritical(env, eltArray, elts, JNI_ABORT);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册