aboutsummaryrefslogtreecommitdiff
path: root/src/windows
diff options
context:
space:
mode:
authorlana <none@none>2009-01-06 16:24:03 -0800
committerlana <none@none>2009-01-06 16:24:03 -0800
commit939ce78b1984dc77cc7b00767663f9c881649605 (patch)
tree0dee679f0e906480015eb8451d9f0fc8b8ada221 /src/windows
parent6178bb55a676bc25b35cc790375f109941d3017d (diff)
parent79f6cda307a94d2c6b34f582f93b54990eb0e7d0 (diff)
Diffstat (limited to 'src/windows')
-rw-r--r--src/windows/classes/sun/awt/Win32GraphicsEnvironment.java5
-rw-r--r--src/windows/classes/sun/java2d/d3d/D3DBlitLoops.java8
-rw-r--r--src/windows/classes/sun/java2d/d3d/D3DSurfaceData.java5
-rw-r--r--src/windows/classes/sun/java2d/opengl/WGLGraphicsConfig.java14
-rw-r--r--src/windows/native/sun/font/fontpath.c54
-rw-r--r--src/windows/native/sun/java2d/d3d/D3DBadHardware.h39
-rw-r--r--src/windows/native/sun/java2d/d3d/D3DBlitLoops.cpp29
-rw-r--r--src/windows/native/sun/java2d/d3d/D3DContext.cpp9
-rw-r--r--src/windows/native/sun/java2d/d3d/D3DSurfaceData.h1
9 files changed, 123 insertions, 41 deletions
diff --git a/src/windows/classes/sun/awt/Win32GraphicsEnvironment.java b/src/windows/classes/sun/awt/Win32GraphicsEnvironment.java
index 80ee77470..73b73dbb0 100644
--- a/src/windows/classes/sun/awt/Win32GraphicsEnvironment.java
+++ b/src/windows/classes/sun/awt/Win32GraphicsEnvironment.java
@@ -393,4 +393,9 @@ public class Win32GraphicsEnvironment
private static void dwmCompositionChanged(boolean enabled) {
isDWMCompositionEnabled = enabled;
}
+
+ @Override
+ public boolean isDisplayLocal() {
+ return true;
+ }
}
diff --git a/src/windows/classes/sun/java2d/d3d/D3DBlitLoops.java b/src/windows/classes/sun/java2d/d3d/D3DBlitLoops.java
index 459a197fa..45d6cd8fd 100644
--- a/src/windows/classes/sun/java2d/d3d/D3DBlitLoops.java
+++ b/src/windows/classes/sun/java2d/d3d/D3DBlitLoops.java
@@ -85,6 +85,8 @@ class D3DBlitLoops {
D3DSurfaceData.ST_INT_RGB),
new D3DSwToSurfaceBlit(SurfaceType.IntBgr,
D3DSurfaceData.ST_INT_BGR),
+ new D3DSwToSurfaceBlit(SurfaceType.ThreeByteBgr,
+ D3DSurfaceData.ST_3BYTE_BGR),
new D3DSwToSurfaceBlit(SurfaceType.Ushort565Rgb,
D3DSurfaceData.ST_USHORT_565_RGB),
new D3DSwToSurfaceBlit(SurfaceType.Ushort555Rgb,
@@ -106,6 +108,8 @@ class D3DBlitLoops {
D3DSurfaceData.ST_INT_RGB),
new D3DSwToSurfaceScale(SurfaceType.IntBgr,
D3DSurfaceData.ST_INT_BGR),
+ new D3DSwToSurfaceScale(SurfaceType.ThreeByteBgr,
+ D3DSurfaceData.ST_3BYTE_BGR),
new D3DSwToSurfaceScale(SurfaceType.Ushort565Rgb,
D3DSurfaceData.ST_USHORT_565_RGB),
new D3DSwToSurfaceScale(SurfaceType.Ushort555Rgb,
@@ -124,6 +128,8 @@ class D3DBlitLoops {
D3DSurfaceData.ST_INT_RGB),
new D3DSwToSurfaceTransform(SurfaceType.IntBgr,
D3DSurfaceData.ST_INT_BGR),
+ new D3DSwToSurfaceTransform(SurfaceType.ThreeByteBgr,
+ D3DSurfaceData.ST_3BYTE_BGR),
new D3DSwToSurfaceTransform(SurfaceType.Ushort565Rgb,
D3DSurfaceData.ST_USHORT_565_RGB),
new D3DSwToSurfaceTransform(SurfaceType.Ushort555Rgb,
@@ -147,6 +153,8 @@ class D3DBlitLoops {
D3DSurfaceData.ST_INT_ARGB),
new D3DSwToTextureBlit(SurfaceType.IntBgr,
D3DSurfaceData.ST_INT_BGR),
+ new D3DSwToTextureBlit(SurfaceType.ThreeByteBgr,
+ D3DSurfaceData.ST_3BYTE_BGR),
new D3DSwToTextureBlit(SurfaceType.Ushort565Rgb,
D3DSurfaceData.ST_USHORT_565_RGB),
new D3DSwToTextureBlit(SurfaceType.Ushort555Rgb,
diff --git a/src/windows/classes/sun/java2d/d3d/D3DSurfaceData.java b/src/windows/classes/sun/java2d/d3d/D3DSurfaceData.java
index 3d1457c72..722440a77 100644
--- a/src/windows/classes/sun/java2d/d3d/D3DSurfaceData.java
+++ b/src/windows/classes/sun/java2d/d3d/D3DSurfaceData.java
@@ -135,6 +135,7 @@ public class D3DSurfaceData extends SurfaceData implements AccelSurface {
public static final int ST_USHORT_555_RGB = 6;
public static final int ST_BYTE_INDEXED = 7;
public static final int ST_BYTE_INDEXED_BM = 8;
+ public static final int ST_3BYTE_BGR = 9;
/** Equals to D3DSWAPEFFECT_DISCARD */
public static final int SWAP_DISCARD = 1;
@@ -501,12 +502,14 @@ public class D3DSurfaceData extends SurfaceData implements AccelSurface {
* - the pixel shaders are available, and
* - blending is disabled, and
* - the source color is opaque
+ * - and the destination is opaque
*/
public boolean canRenderLCDText(SunGraphics2D sg2d) {
return
graphicsDevice.isCapPresent(CAPS_LCD_SHADER) &&
sg2d.compositeState <= SunGraphics2D.COMP_ISCOPY &&
- sg2d.paintState <= SunGraphics2D.PAINT_OPAQUECOLOR;
+ sg2d.paintState <= SunGraphics2D.PAINT_OPAQUECOLOR &&
+ sg2d.surfaceData.getTransparency() == Transparency.OPAQUE;
}
public void validatePipe(SunGraphics2D sg2d) {
diff --git a/src/windows/classes/sun/java2d/opengl/WGLGraphicsConfig.java b/src/windows/classes/sun/java2d/opengl/WGLGraphicsConfig.java
index 7ff7e1e8d..bdd0ade46 100644
--- a/src/windows/classes/sun/java2d/opengl/WGLGraphicsConfig.java
+++ b/src/windows/classes/sun/java2d/opengl/WGLGraphicsConfig.java
@@ -127,12 +127,14 @@ public class WGLGraphicsConfig
new WGLGetConfigInfo(device.getScreen(), pixfmt);
rq.flushAndInvokeNow(action);
cfginfo = action.getConfigInfo();
- OGLContext.setScratchSurface(cfginfo);
- rq.flushAndInvokeNow(new Runnable() {
- public void run() {
- ids[0] = OGLContext.getOGLIdString();
- }
- });
+ if (cfginfo != 0L) {
+ OGLContext.setScratchSurface(cfginfo);
+ rq.flushAndInvokeNow(new Runnable() {
+ public void run() {
+ ids[0] = OGLContext.getOGLIdString();
+ }
+ });
+ }
} finally {
rq.unlock();
}
diff --git a/src/windows/native/sun/font/fontpath.c b/src/windows/native/sun/font/fontpath.c
index 71b1da85f..2fd3c3af9 100644
--- a/src/windows/native/sun/font/fontpath.c
+++ b/src/windows/native/sun/font/fontpath.c
@@ -153,7 +153,8 @@ static int CALLBACK EnumFontFacesInFamilyProcA(
JNIEnv *env = fmi->env;
jstring fullname, fullnameLC;
- if (FontType != TRUETYPE_FONTTYPE) {
+ /* Both Vista and XP return DEVICE_FONTTYPE for OTF fonts */
+ if (FontType != TRUETYPE_FONTTYPE && FontType != DEVICE_FONTTYPE) {
return 1;
}
@@ -227,7 +228,8 @@ static int CALLBACK EnumFontFacesInFamilyProcW(
JNIEnv *env = fmi->env;
jstring fullname, fullnameLC;
- if (FontType != TRUETYPE_FONTTYPE) {
+ /* Both Vista and XP return DEVICE_FONTTYPE for OTF fonts */
+ if (FontType != TRUETYPE_FONTTYPE && FontType != DEVICE_FONTTYPE) {
return 1;
}
@@ -274,7 +276,8 @@ static int CALLBACK EnumFamilyNamesA(
jstring familyLC;
LOGFONTA lfa;
- if (FontType != TRUETYPE_FONTTYPE) {
+ /* Both Vista and XP return DEVICE_FONTTYPE for OTF fonts */
+ if (FontType != TRUETYPE_FONTTYPE && FontType != DEVICE_FONTTYPE) {
return 1;
}
@@ -323,7 +326,8 @@ static int CALLBACK EnumFamilyNamesW(
int slen;
LOGFONTW lfw;
- if (FontType != TRUETYPE_FONTTYPE) {
+ /* Both Vista and XP return DEVICE_FONTTYPE for OTF fonts */
+ if (FontType != TRUETYPE_FONTTYPE && FontType != DEVICE_FONTTYPE) {
return 1;
}
/* wprintf(L"FAMILY=%s charset=%d FULL=%s\n", */
@@ -383,15 +387,16 @@ static int CALLBACK EnumFamilyNamesW(
* Also if a Font has a name for this locale that name also
* exists in the registry using the appropriate platform encoding.
* What do we do then?
+ *
+ * Note: OpenType fonts seems to have " (TrueType)" suffix on Vista
+ * but " (OpenType)" on XP.
*/
-/* static const wchar_t W_TTSUFFIX[] = L" (TrueType)"; */
-/* static const char C_TTSUFFIX[] = " (TrueType)"; */
-/* static int TTSLEN = 11; hard-coded - be careful */
-static BOOL RegistryToBaseTTNameA(LPCSTR name) {
+static BOOL RegistryToBaseTTNameA(LPSTR name) {
static const char TTSUFFIX[] = " (TrueType)";
+ static const char OTSUFFIX[] = " (OpenType)";
int TTSLEN = strlen(TTSUFFIX);
- char *match;
+ char *suffix;
int len = strlen(name);
if (len == 0) {
@@ -403,19 +408,21 @@ static BOOL RegistryToBaseTTNameA(LPCSTR name) {
if (len <= TTSLEN) {
return FALSE;
}
- match = strstr(name, TTSUFFIX);
- if ((match != NULL) && (match == name+(len-TTSLEN))) {
- match[0] = '\0'; /* truncate name */
+
+ /* suffix length is the same for truetype and opentype fonts */
+ suffix = name + len - TTSLEN;
+ if (strcmp(suffix, TTSUFFIX) == 0 || strcmp(suffix, OTSUFFIX) == 0) {
+ suffix[0] = '\0'; /* truncate name */
return TRUE;
- } else {
- return FALSE;
}
+ return FALSE;
}
static BOOL RegistryToBaseTTNameW(LPWSTR name) {
static const wchar_t TTSUFFIX[] = L" (TrueType)";
+ static const wchar_t OTSUFFIX[] = L" (OpenType)";
int TTSLEN = wcslen(TTSUFFIX);
- wchar_t *match;
+ wchar_t *suffix;
int len = wcslen(name);
if (len == 0) {
@@ -427,13 +434,13 @@ static BOOL RegistryToBaseTTNameW(LPWSTR name) {
if (len <= TTSLEN) {
return FALSE;
}
- match = wcsstr(name, TTSUFFIX);
- if ((match != NULL) && (match == name+(len-TTSLEN))) {
- match[0] = L'\0'; /* truncate name */
+ /* suffix length is the same for truetype and opentype fonts */
+ suffix = name + (len - TTSLEN);
+ if (wcscmp(suffix, TTSUFFIX) == 0 || wcscmp(suffix, OTSUFFIX) == 0) {
+ suffix[0] = L'\0'; /* truncate name */
return TRUE;
- } else {
- return FALSE;
}
+ return FALSE;
}
static void registerFontA(GdiFontMapInfo *fmi, jobject fontToFileMap,
@@ -675,18 +682,19 @@ Java_sun_font_FontManager_populateFontFileNameMap
}
if (IS_NT) {
if (!RegistryToBaseTTNameW((LPWSTR)wname) ) {
- /* If the filename ends with ".ttf" also accept it.
+ /* If the filename ends with ".ttf" or ".otf" also accept it.
* Not expecting to need to do this for .ttc files.
* Also note this code is not mirrored in the "A" (win9x) path.
*/
LPWSTR dot = wcsrchr((LPWSTR)data, L'.');
- if (dot == NULL || (wcsicmp(dot, L".ttf") != 0)) {
+ if (dot == NULL || ((wcsicmp(dot, L".ttf") != 0)
+ && (wcsicmp(dot, L".otf") != 0))) {
continue; /* not a TT font... */
}
}
registerFontW(&fmi, fontToFileMap, (LPWSTR)wname, (LPWSTR)data);
} else {
- if (!RegistryToBaseTTNameA(cname) ) {
+ if (!RegistryToBaseTTNameA((LPSTR)cname)) {
continue; /* not a TT font... */
}
registerFontA(&fmi, fontToFileMap, cname, (LPCSTR)data);
diff --git a/src/windows/native/sun/java2d/d3d/D3DBadHardware.h b/src/windows/native/sun/java2d/d3d/D3DBadHardware.h
index 52629d1a5..20c9ad1e3 100644
--- a/src/windows/native/sun/java2d/d3d/D3DBadHardware.h
+++ b/src/windows/native/sun/java2d/d3d/D3DBadHardware.h
@@ -85,6 +85,19 @@ static const ADAPTER_INFO badHardware[] = {
{ 0x1002, 0x71C5, D_VERSION(6,14,10,6706), OS_WINXP },
{ 0x1002, 0x71C5, D_VERSION(7,14,10,0567), OS_VISTA },
+ // ATI Mobility Radeon 9700
+ // Reason: workaround for 6773336
+ { 0x1002, 0x4E50, D_VERSION(6,14,10,6561), OS_WINXP },
+
+ // Nvidia FX 5200
+ // Reason: workaround for 6717988
+ { 0x10DE, 0x0322, D_VERSION(6,14,11,6921), OS_WINXP },
+
+ // Nvidia FX Go5600, Go5700
+ // Reason: workaround for 6714579
+ { 0x10DE, 0x031A, D_VERSION(6,14,11,6921), OS_WINXP },
+ { 0x10DE, 0x0347, D_VERSION(6,14,11,6921), OS_WINXP },
+
// Nvidia Quadro NVS 110M
// Reason: workaround for 6629891
{ 0x10DE, 0x01D7, D_VERSION(6,14,11,5665), OS_WINXP },
@@ -93,6 +106,32 @@ static const ADAPTER_INFO badHardware[] = {
// Reason: workaround for 6653860
{ 0x10DE, 0x00FD, D_VERSION(6,14,10,6573), OS_WINXP },
+ // Nvidia Quadro FX family
+ // Reason: workaround for 6772137
+ { 0x10DE, 0x00F8, D_VERSION(6,14,10,9381), OS_WINXP },
+ { 0x10DE, 0x009D, D_VERSION(6,14,10,9381), OS_WINXP },
+ { 0x10DE, 0x029C, D_VERSION(6,14,10,9381), OS_WINXP },
+ { 0x10DE, 0x029D, D_VERSION(6,14,10,9381), OS_WINXP },
+ { 0x10DE, 0x029E, D_VERSION(6,14,10,9381), OS_WINXP },
+ { 0x10DE, 0x029F, D_VERSION(6,14,10,9381), OS_WINXP },
+ { 0x10DE, 0x01DE, D_VERSION(6,14,10,9381), OS_WINXP },
+ { 0x10DE, 0x039E, D_VERSION(6,14,10,9381), OS_WINXP },
+ { 0x10DE, 0x019D, D_VERSION(6,14,10,9381), OS_WINXP },
+ { 0x10DE, 0x019E, D_VERSION(6,14,10,9381), OS_WINXP },
+ { 0x10DE, 0x040A, D_VERSION(6,14,10,9381), OS_WINXP },
+ { 0x10DE, 0x040E, D_VERSION(6,14,10,9381), OS_WINXP },
+ { 0x10DE, 0x040F, D_VERSION(6,14,10,9381), OS_WINXP },
+ { 0x10DE, 0x061A, D_VERSION(6,14,10,9381), OS_WINXP },
+ { 0x10DE, 0x06F9, D_VERSION(6,14,10,9381), OS_WINXP },
+ { 0x10DE, 0x05FD, D_VERSION(6,14,10,9381), OS_WINXP },
+ { 0x10DE, 0x05FE, D_VERSION(6,14,10,9381), OS_WINXP },
+ { 0x10DE, 0x004E, D_VERSION(6,14,10,9381), OS_WINXP },
+ { 0x10DE, 0x00CD, D_VERSION(6,14,10,9381), OS_WINXP },
+ { 0x10DE, 0x00CE, D_VERSION(6,14,10,9381), OS_WINXP },
+ { 0x10DE, 0x014C, D_VERSION(6,14,10,9381), OS_WINXP },
+ { 0x10DE, 0x014D, D_VERSION(6,14,10,9381), OS_WINXP },
+ { 0x10DE, 0x014E, D_VERSION(6,14,10,9381), OS_WINXP },
+
// Nvidia GeForce 6200 TurboCache(TM)
// Reason: workaround for 6588384
{ 0x10DE, 0x0161, NO_VERSION, OS_VISTA },
diff --git a/src/windows/native/sun/java2d/d3d/D3DBlitLoops.cpp b/src/windows/native/sun/java2d/d3d/D3DBlitLoops.cpp
index 6792a444a..c8a5d7861 100644
--- a/src/windows/native/sun/java2d/d3d/D3DBlitLoops.cpp
+++ b/src/windows/native/sun/java2d/d3d/D3DBlitLoops.cpp
@@ -47,6 +47,7 @@ extern "C" BlitFunc IntArgbToIntArgbPreConvert;
extern "C" BlitFunc IntArgbPreToIntArgbConvert;
extern "C" BlitFunc IntArgbBmToIntArgbConvert;
extern "C" BlitFunc IntRgbToIntArgbConvert;
+extern "C" BlitFunc ThreeByteBgrToIntArgbConvert;
extern "C" BlitFunc Ushort565RgbToIntArgbConvert;
extern "C" BlitFunc Ushort555RgbToIntArgbConvert;
extern "C" BlitFunc IntBgrToIntArgbConvert;
@@ -220,12 +221,17 @@ D3DBL_CopyImageToIntXrgbSurface(SurfaceDataRasInfo *pSrcInfo,
" srctype=%d rect={%-4d, %-4d, %-4d, %-4d}",
srctype, r.left, r.top, r.right, r.bottom);
- if (pDesc->Usage == D3DUSAGE_DYNAMIC &&
- dstx == 0 && dstx == 0 &&
- srcWidth == pDesc->Width && srcHeight == pDesc->Height)
- {
+ if (pDesc->Usage == D3DUSAGE_DYNAMIC) {
+ // it is safe to lock with discard because we don't care about the
+ // contents of dynamic textures, and some drivers are happier if
+ // dynamic textures are always locked with DISCARD
dwLockFlags |= D3DLOCK_DISCARD;
pR = NULL;
+ } else {
+ // in non-DYNAMIC case we lock the exact rect so there's no need to
+ // offset the destination pointer
+ dstx = 0;
+ dsty = 0;
}
res = pDstSurface->LockRect(&lockedRect, pR, dwLockFlags);
@@ -242,7 +248,9 @@ D3DBL_CopyImageToIntXrgbSurface(SurfaceDataRasInfo *pSrcInfo,
void *pSrcBase = PtrCoord(pSrcInfo->rasBase,
srcx, pSrcInfo->pixelStride,
srcy, pSrcInfo->scanStride);
- void *pDstBase = lockedRect.pBits;
+ void *pDstBase = PtrCoord(lockedRect.pBits,
+ dstx, dstInfo.pixelStride,
+ dsty, dstInfo.scanStride);
switch (srctype) {
case ST_INT_ARGB:
@@ -251,11 +259,15 @@ D3DBL_CopyImageToIntXrgbSurface(SurfaceDataRasInfo *pSrcInfo,
pSrcInfo, &dstInfo, NULL, NULL);
break;
case ST_INT_ARGB_PRE:
- case ST_INT_RGB:
AnyIntIsomorphicCopy(pSrcBase, pDstBase,
srcWidth, srcHeight,
pSrcInfo, &dstInfo, NULL, NULL);
break;
+ case ST_INT_RGB:
+ IntRgbToIntArgbConvert(pSrcBase, pDstBase,
+ srcWidth, srcHeight,
+ pSrcInfo, &dstInfo, NULL, NULL);
+ break;
case ST_INT_ARGB_BM:
// REMIND: we don't have such sw loop
// so this path is disabled for now on java level
@@ -268,6 +280,11 @@ D3DBL_CopyImageToIntXrgbSurface(SurfaceDataRasInfo *pSrcInfo,
srcWidth, srcHeight,
pSrcInfo, &dstInfo, NULL, NULL);
break;
+ case ST_3BYTE_BGR:
+ ThreeByteBgrToIntArgbConvert(pSrcBase, pDstBase,
+ srcWidth, srcHeight,
+ pSrcInfo, &dstInfo, NULL, NULL);
+ break;
case ST_USHORT_555_RGB:
Ushort555RgbToIntArgbConvert(pSrcBase, pDstBase,
srcWidth, srcHeight,
diff --git a/src/windows/native/sun/java2d/d3d/D3DContext.cpp b/src/windows/native/sun/java2d/d3d/D3DContext.cpp
index e3937b8d3..186f4d755 100644
--- a/src/windows/native/sun/java2d/d3d/D3DContext.cpp
+++ b/src/windows/native/sun/java2d/d3d/D3DContext.cpp
@@ -1174,11 +1174,10 @@ D3DContext::UploadTileToTexture(D3DResource *pTextureRes, void *pixels,
" rect={%-4d, %-4d, %-4d, %-4d}",
r.left, r.top, r.right, r.bottom);
- // REMIND: we should also check for dstx, dsty being 0 here,
- // but they're always 0 in dynamic texture case
- if (pDesc->Usage == D3DUSAGE_DYNAMIC &&
- srcWidth == pDesc->Width && srcHeight == pDesc->Height)
- {
+ if (pDesc->Usage == D3DUSAGE_DYNAMIC) {
+ // it is safe to lock with discard because we don't care about the
+ // contents of dynamic textures and dstx,dsty for this case is
+ // always 0,0 because we are uploading into a tile texture
dwLockFlags |= D3DLOCK_DISCARD;
pR = NULL;
}
diff --git a/src/windows/native/sun/java2d/d3d/D3DSurfaceData.h b/src/windows/native/sun/java2d/d3d/D3DSurfaceData.h
index 22a89bc15..b115ed837 100644
--- a/src/windows/native/sun/java2d/d3d/D3DSurfaceData.h
+++ b/src/windows/native/sun/java2d/d3d/D3DSurfaceData.h
@@ -68,6 +68,7 @@ struct _D3DSDOps {
#define ST_USHORT_555_RGB sun_java2d_d3d_D3DSurfaceData_ST_USHORT_555_RGB
#define ST_BYTE_INDEXED sun_java2d_d3d_D3DSurfaceData_ST_BYTE_INDEXED
#define ST_BYTE_INDEXED_BM sun_java2d_d3d_D3DSurfaceData_ST_BYTE_INDEXED_BM
+#define ST_3BYTE_BGR sun_java2d_d3d_D3DSurfaceData_ST_3BYTE_BGR
/**
* These are defined to be the same as ExtendedBufferCapabilities.VSyncType