You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@harmony.apache.org by py...@apache.org on 2007/10/31 09:42:35 UTC
svn commit: r590591 [2/12] - in /harmony/enhanced/classlib/branches/java6:
depends/build/platform/ depends/files/ depends/jars/icu4j_3.8/
depends/libs/freebsd.x86/ depends/manifests/icu4j_3.4.4/
depends/manifests/icu4j_3.8/ depends/manifests/icu4j_3.8/...
Modified: harmony/enhanced/classlib/branches/java6/modules/awt/src/main/java/windows/org/apache/harmony/awt/gl/windows/WinVolatileImage.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/branches/java6/modules/awt/src/main/java/windows/org/apache/harmony/awt/gl/windows/WinVolatileImage.java?rev=590591&r1=590590&r2=590591&view=diff
==============================================================================
--- harmony/enhanced/classlib/branches/java6/modules/awt/src/main/java/windows/org/apache/harmony/awt/gl/windows/WinVolatileImage.java (original)
+++ harmony/enhanced/classlib/branches/java6/modules/awt/src/main/java/windows/org/apache/harmony/awt/gl/windows/WinVolatileImage.java Wed Oct 31 01:42:07 2007
@@ -156,6 +156,7 @@
WinGDIPGraphics2D.disposeGraphicsInfo(gi);
gi = 0;
}
+ if (surface != null) surface.dispose();
super.flush();
}
Modified: harmony/enhanced/classlib/branches/java6/modules/awt/src/main/native/gl/shared/SurfaceDataStructure.cpp
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/branches/java6/modules/awt/src/main/native/gl/shared/SurfaceDataStructure.cpp?rev=590591&r1=590590&r2=590591&view=diff
==============================================================================
--- harmony/enhanced/classlib/branches/java6/modules/awt/src/main/native/gl/shared/SurfaceDataStructure.cpp (original)
+++ harmony/enhanced/classlib/branches/java6/modules/awt/src/main/native/gl/shared/SurfaceDataStructure.cpp Wed Oct 31 01:42:07 2007
@@ -68,11 +68,11 @@
}
inline void updateCache
-(SURFACE_STRUCTURE *srcSurf, JNIEnv *env, jobject srcData, bool alphaPre){
+(SURFACE_STRUCTURE *srcSurf, JNIEnv *env, jobject srcData, bool alphaPre, int x, int y, int width, int height){
- unsigned int srcstride, dststride, offset;
- unsigned int h = srcSurf->height;
- unsigned int w = srcSurf->width;
+ int src_stride, dst_stride, src_offset, dst_offset;
+ int h = height;
+ int w = width;
void *bmpDataPtr = srcSurf->bmpData;
void *srcDataPtr = env->GetPrimitiveArrayCritical((jarray)srcData, 0);
@@ -81,22 +81,18 @@
case INT_RGB:
{
- unsigned int *src, *s, *dst, *d;
+ unsigned int *src, *dst;
- srcstride = srcSurf->scanline_stride;
- dststride = w;
+ src_stride = srcSurf->scanline_stride;
+ dst_stride = srcSurf->width;
- offset = w - 1;
- src = (unsigned int *)srcDataPtr + offset;
- dst = (unsigned int *)bmpDataPtr + offset;
+ src_offset = y * src_stride + x;
+ dst_offset = y * dst_stride + x;
+ src = (unsigned int *)srcDataPtr + src_offset;
+ dst = (unsigned int *)bmpDataPtr + dst_offset;
- for(int y = h; y > 0; y--, src += srcstride, dst += dststride){
- s = src;
- d = dst;
-
- for(int x = w; x > 0 ; x--){
- *d-- = 0xff000000 | *s--;
- }
+ for(int _y = 0; _y < h; _y++, src += src_stride, dst += dst_stride){
+ memcpy(dst, src, w * sizeof(int));
}
}
break;
@@ -105,19 +101,20 @@
{
unsigned char *src, *s, *dst, *d, sa;
- offset = (w << 2) - 1;
- src = (unsigned char *)srcDataPtr + offset;
- dst = (unsigned char *)bmpDataPtr + offset;
+ src_stride = srcSurf->scanline_stride_byte;
+ dst_stride = srcSurf->width << 2;
- srcstride = srcSurf->scanline_stride_byte;
- dststride = w << 2;
+ src_offset = y * src_stride + ((x + w) << 2) - 1;
+ dst_offset = y * dst_stride + ((x + w) << 2) - 1;
+ src = (unsigned char *)srcDataPtr + src_offset;
+ dst = (unsigned char *)bmpDataPtr + dst_offset;
if(alphaPre){
- for(int y = h; y > 0 ; y--, src += srcstride, dst += dststride){
+ for(int _y = h; _y > 0; _y--, src += src_stride, dst += dst_stride){
s = src;
d = dst;
- for(int x = w; x > 0 ; x--){
+ for(int _x = w; _x > 0; _x--){
sa = *s--;
*d-- = sa;
if(sa != 255){
@@ -134,11 +131,11 @@
}
srcSurf->isAlphaPre = true;
}else{
- for(int y = h; y > 0 ; y--, src += srcstride, dst += dststride){
+ for(int _y = h; _y > 0; _y--, src += src_stride, dst += dst_stride){
s = src;
d = dst;
- for(int x = w; x > 0 ; x--){
+ for(int _x = w; _x > 0; _x--){
sa = *s--;
if(sa == 0){
*d-- = 0;
@@ -163,19 +160,20 @@
{
unsigned char *src, *s, *dst, *d, sa;
- offset = (w << 2) - 1;
- src = (unsigned char *)srcDataPtr + offset;
- dst = (unsigned char *)bmpDataPtr + offset;
+ src_stride = srcSurf->scanline_stride_byte;
+ dst_stride = srcSurf->width << 2;
- srcstride = srcSurf->scanline_stride_byte;
- dststride = w << 2;
+ src_offset = y * src_stride + ((x + w) << 2) - 1;
+ dst_offset = y * dst_stride + ((x + w) << 2) - 1;
+ src = (unsigned char *)srcDataPtr + src_offset;
+ dst = (unsigned char *)bmpDataPtr + dst_offset;
if(alphaPre){
- for(int y = h; y > 0; y--, src += srcstride, dst += dststride){
+ for(int _y = h; _y > 0; _y--, src += src_stride, dst += dst_stride){
s = src;
d = dst;
- for(int x = w; x > 0 ; x--){
+ for(int _x = w; _x > 0; _x--){
sa = *s--;
*d-- = sa;
*d-- = *s--;
@@ -188,11 +186,11 @@
}
srcSurf->isAlphaPre = true;
}else{
- for(int y = h; y > 0 ; y--, src += srcstride, dst += dststride){
+ for(int _y = h; _y > 0; _y--, src += src_stride, dst += dst_stride){
s = src;
d = dst;
- for(int x = w; x > 0 ; x--){
+ for(int _x = w; _x > 0; _x--){
sa = *s--;
*d-- = sa;
*d-- = DIV(sa, *s--);
@@ -209,18 +207,19 @@
{
unsigned char *src, *s, *dst, *d;
- offset = (w << 2) - 1;
- src = (unsigned char *)srcDataPtr + offset;
- dst = (unsigned char *)bmpDataPtr + offset;
+ src_stride = srcSurf->scanline_stride_byte;
+ dst_stride = srcSurf->width << 2;
- srcstride = srcSurf->scanline_stride_byte;
- dststride = w << 2;
-
- for(int y = h; y > 0; y--, src += srcstride, dst += dststride){
+ src_offset = y * src_stride + ((x + w) << 2) - 1;
+ dst_offset = y * dst_stride + ((x + w) << 2) - 1;
+ src = (unsigned char *)srcDataPtr + src_offset;
+ dst = (unsigned char *)bmpDataPtr + dst_offset;
+
+ for(int _y = h; _y > 0; _y--, src += src_stride, dst += dst_stride){
s = src;
d = dst;
- for(int x = w; x > 0 ; x--){
+ for(int _x = w; _x > 0; _x--){
*d = 255;
*s--;
*(d - 3) = *s--;
@@ -236,19 +235,19 @@
{
unsigned char *src, *s, *dst, *d;
- offset = (w << 2) - 1;
- unsigned int srcOffset = w * 3 - 1;
- src = (unsigned char *)srcDataPtr + srcOffset;
- dst = (unsigned char *)bmpDataPtr + offset;
+ src_stride = srcSurf->scanline_stride_byte;
+ dst_stride = srcSurf->width << 2;
- srcstride = srcSurf->scanline_stride_byte;
- dststride = w << 2;
+ src_offset = y * src_stride + (x + w) * 3 - 1;
+ dst_offset = y * dst_stride + ((x + w) << 2) - 1;
+ src = (unsigned char *)srcDataPtr + src_offset;
+ dst = (unsigned char *)bmpDataPtr + dst_offset;
- for(int y = srcSurf->height; y > 0; y--, src += srcstride, dst += dststride){
+ for(int _y = h; _y > 0; _y--, src += src_stride, dst += dst_stride){
s = src;
d = dst;
- for(int x = w; x > 0 ; x--){
+ for(int _x = w; _x > 0; _x--){
*d-- = 255;
*d-- = *s--;
*d-- = *s--;
@@ -262,19 +261,20 @@
{
unsigned char *src, *s, *dst, *d, a, r, g, b;
- offset = (w << 2) - 1;
- src = (unsigned char *)srcDataPtr + offset;
- dst = (unsigned char *)bmpDataPtr + offset;
+ src_stride = srcSurf->scanline_stride_byte;
+ dst_stride = srcSurf->width << 2;
- srcstride = srcSurf->scanline_stride_byte;
- dststride = w << 2;
+ src_offset = y * src_stride + ((x + w) << 2) - 1;
+ dst_offset = y * dst_stride + ((x + w) << 2) - 1;
+ src = (unsigned char *)srcDataPtr + src_offset;
+ dst = (unsigned char *)bmpDataPtr + dst_offset;
if(alphaPre){
- for(int y = h; y > 0 ; y--, src += srcstride, dst += dststride){
+ for(int _y = h; _y > 0; _y--, src += src_stride, dst += dst_stride){
s = src;
d = dst;
- for(int x = w; x > 0 ; x--){
+ for(int _x = w; _x > 0; _x--){
r = *s--;
g = *s--;
b = *s--;
@@ -294,11 +294,11 @@
}
srcSurf->isAlphaPre = true;
}else{
- for(int y = h; y > 0 ; y--, src += srcstride, dst += dststride){
+ for(int _y = h; _y > 0; _y--, src += src_stride, dst += dst_stride){
s = src;
d = dst;
- for(int x = w; x > 0 ; x--){
+ for(int _x = w; _x > 0; _x--){
r = *s--;
g = *s--;
b = *s--;
@@ -325,19 +325,20 @@
{
unsigned char *src, *s, *dst, *d, a, r, g, b;
- offset = (w << 2) - 1;
- src = (unsigned char *)srcDataPtr + offset;
- dst = (unsigned char *)bmpDataPtr + offset;
+ src_stride = srcSurf->scanline_stride_byte;
+ dst_stride = srcSurf->width << 2;
- srcstride = srcSurf->scanline_stride_byte;
- dststride = w << 2;
+ src_offset = y * src_stride + ((x + w) << 2) - 1;
+ dst_offset = y * dst_stride + ((x + w) << 2) - 1;
+ src = (unsigned char *)srcDataPtr + src_offset;
+ dst = (unsigned char *)bmpDataPtr + dst_offset;
if(alphaPre){
- for(int y = h; y > 0 ; y--, src += srcstride, dst += dststride){
+ for(int _y = h; _y > 0; _y--, src += src_stride, dst += dst_stride){
s = src;
d = dst;
- for(int x = w; x > 0 ; x--){
+ for(int _x = w; _x > 0; _x--){
r = *s--;
g = *s--;
b = *s--;
@@ -353,11 +354,11 @@
}
srcSurf->isAlphaPre = true;
}else{
- for(int y = h; y > 0 ; y--, src += srcstride, dst += dststride){
+ for(int _y = h; _y > 0; _y--, src += src_stride, dst += dst_stride){
s = src;
d = dst;
- for(int x = w; x > 0 ; x--){
+ for(int _x = w; _x > 0; _x--){
r = *s--;
g = *s--;
b = *s--;
@@ -385,14 +386,6 @@
unsigned char *dst, *d;
unsigned short *src, *s, pixel;
- offset = (w << 2) - 1;
- unsigned int srcOffset = w - 1;
- src = (unsigned short *)srcDataPtr + srcOffset;
- dst = (unsigned char *)bmpDataPtr + offset;
-
- srcstride = srcSurf->scanline_stride;
- dststride = w << 2;
-
unsigned int mr = srcSurf->max_red;
unsigned int mg = srcSurf->max_green;
unsigned int mb = srcSurf->max_red;
@@ -403,10 +396,18 @@
unsigned int gs = srcSurf->green_sht;
unsigned int bs = srcSurf->blue_sht;
- for(int y = h; y > 0; y--, src += srcstride, dst += dststride){
+ src_stride = srcSurf->scanline_stride;
+ dst_stride = srcSurf->width << 2;
+
+ src_offset = y * src_stride + x + w - 1;
+ dst_offset = y * dst_stride + ((x + w) << 2) - 1;
+ src = (unsigned short *)srcDataPtr + src_offset;
+ dst = (unsigned char *)bmpDataPtr + dst_offset;
+
+ for(int _y = h; _y > 0; _y--, src += src_stride, dst += dst_stride){
d = dst;
s = src;
- for(int x = w; x > 0; x--){
+ for(int _x = w; _x > 0; _x--){
pixel = *s--;
*d-- = 255;
*d-- = DIV(mb, ((pixel & rm) >> rs));
@@ -422,16 +423,18 @@
unsigned char *dst, *d, pixel;
unsigned short *src, *s;
- src = (unsigned short *)srcDataPtr;
- dst = (unsigned char *)bmpDataPtr;
+ src_stride = srcSurf->scanline_stride;
+ dst_stride = srcSurf->width << 2;
- srcstride = srcSurf->scanline_stride;
- dststride = w << 2;
+ src_offset = y * src_stride + (x << 1);
+ dst_offset = y * dst_stride + (x << 2);
+ src = (unsigned short *)srcDataPtr + src_offset;
+ dst = (unsigned char *)bmpDataPtr + dst_offset;
- for(int y = h; y > 0; y--, src += srcstride, dst += dststride){
+ for(int _y = h; _y > 0; _y--, src += src_stride, dst += dst_stride){
s = src;
d = dst;
- for(int x = w; x > 0; x--){
+ for(int _x = w; _x > 0; _x--){
pixel = (unsigned char)(*s++ / 257);
*d++ = pixel;
*d++ = pixel;
@@ -447,19 +450,21 @@
unsigned char *src, *s;
unsigned int *dst, *d, pixel, bitnum, elem, shift, bitMask;
- src = (unsigned char *)srcDataPtr;
- dst = (unsigned int *)bmpDataPtr;
-
- srcstride = srcSurf->scanline_stride;
- dststride = w;
-
unsigned int pixelBits = srcSurf->pixel_stride;
int *cm = srcSurf->colormap;
- for(int y = h; y > 0; y--, src += srcstride, dst += dststride){
+ src_stride = srcSurf->scanline_stride;
+ dst_stride = srcSurf->width;
+
+ src_offset = y * src_stride;
+ dst_offset = y * dst_stride + x;
+ src = (unsigned char *)srcDataPtr + src_offset;
+ dst = (unsigned int *)bmpDataPtr + dst_offset;
+
+ for(int _y = h; _y > 0; _y--, src += src_stride, dst += dst_stride){
d = dst;
- for(unsigned int x = 0; x < w; x++){
+ for(int _x = 0; _x < w; _x++){
bitnum = x * pixelBits;
s = src + bitnum / 8;
elem = *s;
@@ -477,31 +482,33 @@
int transparency = srcSurf->transparency;
unsigned char *src, *s;
unsigned int *dst, *d, pixel, r, g, b, a;
-
- unsigned int offset = w - 1;
- src = (unsigned char *)srcDataPtr + offset;
- dst = (unsigned int *)bmpDataPtr + offset;
-
- srcstride = srcSurf->scanline_stride;
- dststride = w;
int *cm = srcSurf->colormap;
int tp = srcSurf->transparent_pixel;
+ src_stride = srcSurf->scanline_stride;
+ dst_stride = srcSurf->width;
+
+ src_offset = y * src_stride + x + w - 1;
+ dst_offset = y * dst_stride + x + w - 1;
+ src = (unsigned char *)srcDataPtr + src_offset;
+ dst = (unsigned int *)bmpDataPtr + dst_offset;
+
+
if(transparency == GL_OPAQUE){
- for(int y = h; y > 0; y--, src += srcstride, dst += dststride){
+ for(int _y = h; _y > 0; _y--, src += src_stride, dst += dst_stride){
s = src;
d = dst;
- for(int x = w; x > 0; x--){
+ for(int _x = w; _x > 0; _x--){
*d-- = 0xff000000 | *(cm + *s--);
}
}
}else if(transparency == GL_BITMASK){
- for(int y = h; y > 0; y--, src += srcstride, dst += dststride){
+ for(int _y = h; _y > 0; _y--, src += src_stride, dst += dst_stride){
s = src;
d = dst;
- for(int x = w; x > 0; x--){
+ for(int _x = w; _x > 0; _x--){
pixel = *s--;
if(pixel != tp){
*d-- = 0xff000000 | *(cm + pixel);
@@ -512,11 +519,11 @@
}
}
}else{
- for(int y = h; y > 0; y--, src += srcstride, dst += dststride){
+ for(int _y = h; _y > 0; _y--, src += src_stride, dst += dst_stride){
s = src;
d = dst;
- for(int x = w; x > 0; x--){
+ for(int _x = w; _x > 0; _x--){
pixel = *(cm + *s--);
a = (pixel >> 24) & 0xff;
if(alphaPre){
@@ -546,18 +553,19 @@
case BYTE_GRAY:
{
unsigned char *src, *s, *dst, *d, pixel;
+ src_stride = srcSurf->scanline_stride;
+ dst_stride = srcSurf->width << 2;
- src = (unsigned char *)srcDataPtr;
- dst = (unsigned char *)bmpDataPtr;
-
- srcstride = srcSurf->scanline_stride;
- dststride = w << 2;
+ src_offset = y * src_stride + x;
+ dst_offset = y * dst_stride + (x << 2);
+ src = (unsigned char *)srcDataPtr + src_offset;
+ dst = (unsigned char *)bmpDataPtr + dst_offset;
- for(int y = h; y > 0; y--, src += srcstride, dst += dststride){
+ for(int _y = h; _y > 0; _y--, src += src_stride, dst += dst_stride){
s = src;
d = dst;
- for(int x = srcSurf->width; x > 0; x--){
+ for(int _x = w; _x > 0; _x--){
pixel = *s++;
*d++ = pixel;
*d++ = pixel;
@@ -716,7 +724,7 @@
SURFACE_STRUCTURE *surf = (SURFACE_STRUCTURE *)ptr;
jlong cachePtr = 0;
if(surf != NULL){
- updateCache(surf, env, data, alphaPre != 0);
+ updateCache(surf, env, data, alphaPre != 0, 0, 0, surf->width, surf->height);
cachePtr = (jlong)surf->bmpData;
}
return cachePtr;
Modified: harmony/enhanced/classlib/branches/java6/modules/awt/src/main/native/gl/shared/SurfaceDataStructure.h
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/branches/java6/modules/awt/src/main/native/gl/shared/SurfaceDataStructure.h?rev=590591&r1=590590&r2=590591&view=diff
==============================================================================
--- harmony/enhanced/classlib/branches/java6/modules/awt/src/main/native/gl/shared/SurfaceDataStructure.h (original)
+++ harmony/enhanced/classlib/branches/java6/modules/awt/src/main/native/gl/shared/SurfaceDataStructure.h Wed Oct 31 01:42:07 2007
@@ -162,6 +162,6 @@
int parseMask(unsigned int, int *, int *);
int getShift(unsigned int);
-extern inline void updateCache(SURFACE_STRUCTURE *, JNIEnv *, jobject, bool);
+extern inline void updateCache(SURFACE_STRUCTURE *, JNIEnv *, jobject, bool, int, int, int, int);
#endif
Modified: harmony/enhanced/classlib/branches/java6/modules/awt/src/main/native/gl/windows/GDIBlitter.cpp
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/branches/java6/modules/awt/src/main/native/gl/windows/GDIBlitter.cpp?rev=590591&r1=590590&r2=590591&view=diff
==============================================================================
--- harmony/enhanced/classlib/branches/java6/modules/awt/src/main/native/gl/windows/GDIBlitter.cpp (original)
+++ harmony/enhanced/classlib/branches/java6/modules/awt/src/main/native/gl/windows/GDIBlitter.cpp Wed Oct 31 01:42:07 2007
@@ -39,14 +39,14 @@
JNIEXPORT void JNICALL Java_org_apache_harmony_awt_gl_windows_GDISurface_dispose
(JNIEnv *env, jobject obj, jlong surfDataPtr){
- free((void *)surfDataPtr);
+ if(surfDataPtr) free((void *)surfDataPtr);
}
JNIEXPORT void JNICALL Java_org_apache_harmony_awt_gl_windows_GDIBlitter_bltBGImage
(JNIEnv *env, jobject obj, jint srcX, jint srcY, jlong srcSurfStruct, jobject srcData,
jint dstX, jint dstY, jlong dstSurfStruct, jint width, jint height,
- jint bgcolor, jint compType, jfloat alpha, jdoubleArray matrix,
- jintArray clip, jint numVertex, jboolean invalidated){
+ jint bgcolor, jint compType, jfloat alpha, jdoubleArray matrix, jintArray clip,
+ jint numVertex, jboolean invalidated, jintArray dirtyRegions, jint regCount){
SURFACE_STRUCTURE *srcSurf = (SURFACE_STRUCTURE *)srcSurfStruct;
SURFACE_STRUCTURE *dstSurf = (SURFACE_STRUCTURE *)dstSurfStruct;
@@ -69,7 +69,23 @@
HBRUSH brush = CreateSolidBrush(RGB(r, g, b));
SelectObject(tmpDC, brush);
PatBlt(tmpDC, 0, 0, w, h, PATCOPY);
- if(initBitmap(srcSurf, env, srcData, true)){
+
+ int count;
+ int *regions;
+ if(dirtyRegions == 0){
+ regCount = 1;
+ regions = (int *)malloc(4 * sizeof(int));
+ regions[0] = 0;
+ regions[1] = 0;
+ regions[2] = srcSurf->width - 1;
+ regions[3] = srcSurf->height - 1;
+ } else {
+ count = regCount;
+ regions = (int *)malloc(count * sizeof(int));
+ env->GetIntArrayRegion(dirtyRegions, 1, count, regions);
+ }
+
+ if(initBitmap(srcSurf, env, srcData, true, regions, count)){
BLENDFUNCTION bf;
bf.AlphaFormat = AC_SRC_ALPHA;
bf.BlendOp = AC_SRC_OVER;
@@ -184,8 +200,8 @@
JNIEXPORT void JNICALL Java_org_apache_harmony_awt_gl_windows_GDIBlitter_bltImage
(JNIEnv *env, jobject obj, jint srcX, jint srcY, jlong srcSurfStruct, jobject srcData,
jint dstX, jint dstY, jlong dstSurfStruct, jint width, jint height,
- jint compType, jfloat alpha, jdoubleArray matrix,
- jintArray clip, jint numVertex, jboolean invalidated){
+ jint compType, jfloat alpha, jdoubleArray matrix, jintArray clip,
+ jint numVertex, jboolean invalidated, jintArray dirtyRegions, jint regCount){
SURFACE_STRUCTURE *srcSurf = (SURFACE_STRUCTURE *)srcSurfStruct;
SURFACE_STRUCTURE *dstSurf = (SURFACE_STRUCTURE *)dstSurfStruct;
@@ -196,9 +212,24 @@
memset(&blitStruct, 0, sizeof(BLITSTRUCT));
srcSurf->invalidated = invalidated != 0;
+
+ int count;
+ int *regions;
+ if(dirtyRegions == 0){
+ regCount = 1;
+ regions = (int *)malloc(4 * sizeof(int));
+ regions[0] = 0;
+ regions[1] = 0;
+ regions[2] = srcSurf->width - 1;
+ regions[3] = srcSurf->height - 1;
+ } else {
+ count = regCount;
+ regions = (int *)malloc(count * sizeof(int));
+ env->GetIntArrayRegion(dirtyRegions, 1, count, regions);
+ }
- if(!initBlitData(srcSurf, env, srcData, compType, srca, &blitStruct)){
- return;
+ if(!initBlitData(srcSurf, env, srcData, compType, srca, &blitStruct, regions, count)){
+ return;
}
XFORM currentTransform, transform;
@@ -370,13 +401,29 @@
JNIEXPORT void JNICALL Java_org_apache_harmony_awt_gl_windows_GDIBlitter_xorImage
(JNIEnv *env, jobject obj, jint srcX, jint srcY, jlong srcSurfStruct, jobject srcData,
jint dstX, jint dstY, jlong dstSurfStruct, jint width, jint height, jint xorcolor,
- jdoubleArray matrix, jintArray clip, jint numVertex, jboolean invalidated){
+ jdoubleArray matrix, jintArray clip, jint numVertex, jboolean invalidated,
+ jintArray dirtyRegions, jint regCount){
SURFACE_STRUCTURE *srcSurf = (SURFACE_STRUCTURE *)srcSurfStruct;
SURFACE_STRUCTURE *dstSurf = (SURFACE_STRUCTURE *)dstSurfStruct;
srcSurf->invalidated = invalidated != 0;
- if(!initBitmap(srcSurf, env, srcData, false)) return;
+
+ int count;
+ int *regions;
+ if(dirtyRegions == 0){
+ regCount = 1;
+ regions = (int *)malloc(4 * sizeof(int));
+ regions[0] = 0;
+ regions[1] = 0;
+ regions[2] = srcSurf->width - 1;
+ regions[3] = srcSurf->height - 1;
+ } else {
+ count = regCount;
+ regions = (int *)malloc(count * sizeof(int));
+ env->GetIntArrayRegion(dirtyRegions, 1, count, regions);
+ }
+ if(!initBitmap(srcSurf, env, srcData, true, regions, count)) return;
BYTE r = (BYTE)((xorcolor >> 16) & 0xff);
BYTE g = (BYTE)((xorcolor >> 8) & 0xff);
@@ -510,7 +557,7 @@
}
BOOL initBlitData
-(SURFACE_STRUCTURE *srcSurf, JNIEnv *env, jobject srcData, UINT compType, UCHAR srcConstAlpha, BLITSTRUCT *blitStruct){
+(SURFACE_STRUCTURE *srcSurf, JNIEnv *env, jobject srcData, UINT compType, UCHAR srcConstAlpha, BLITSTRUCT *blitStruct, int *dirtyRegions, int regCount){
switch(compType){
case COMPOSITE_CLEAR:
@@ -527,7 +574,7 @@
return true;
}
if(srcSurf->invalidated || srcSurf->isAlphaPre != false){
- if(!initBitmap(srcSurf, env, srcData, false)) return false;
+ if(!initBitmap(srcSurf, env, srcData, false, dirtyRegions, regCount)) return false;
}
blitStruct->blitFunctintType = BIT_BLT;
blitStruct->rastOp = SRCCOPY;
@@ -536,7 +583,7 @@
case COMPOSITE_SRC_OVER:
case COMPOSITE_SRC_ATOP:
if(srcSurf->invalidated || srcSurf->isAlphaPre != true){
- if(!initBitmap(srcSurf, env, srcData, true)) return false;
+ if(!initBitmap(srcSurf, env, srcData, true, dirtyRegions, regCount)) return false;
}
if(srcSurf->transparency != GL_OPAQUE || srcConstAlpha != 255){
blitStruct->blitFunctintType = ALPHA_BLEND;
@@ -581,17 +628,23 @@
}
BOOL initBitmap
-(SURFACE_STRUCTURE *srcSurf, JNIEnv *env, jobject srcData, bool alphaPre){
+(SURFACE_STRUCTURE *srcSurf, JNIEnv *env, jobject srcData, bool alphaPre, int *dirtyRegions, int regCount){
HBITMAP srcBmp = srcSurf->bitmap;
if(!srcBmp){
return false;
}
- updateCache(srcSurf, env, srcData, alphaPre);
- if(srcSurf->isTrueColor){
- SetDIBits(srcSurf->srcDC, srcSurf->bitmap, 0, srcSurf->height, srcSurf->bmpData, (BITMAPINFO *)&srcSurf->bmpInfo, DIB_RGB_COLORS);
- }else{
- GdiFlush();
+ for(int i = 0; i < regCount;){
+ int x = dirtyRegions[i++];
+ int y = dirtyRegions[i++];
+ int w = dirtyRegions[i++] - x + 1;
+ int h = dirtyRegions[i++] - y + 1;
+ updateCache(srcSurf, env, srcData, alphaPre, x, y, w, h);
+ if(srcSurf->isTrueColor){
+ SetDIBits(srcSurf->srcDC, srcSurf->bitmap, srcSurf->height - y - h, h, (int *)srcSurf->bmpData + y * srcSurf->width, (BITMAPINFO *)&srcSurf->bmpInfo, DIB_RGB_COLORS);
+ }else{
+ GdiFlush();
+ }
}
return true;
}
Modified: harmony/enhanced/classlib/branches/java6/modules/awt/src/main/native/gl/windows/GDIBlitter.h
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/branches/java6/modules/awt/src/main/native/gl/windows/GDIBlitter.h?rev=590591&r1=590590&r2=590591&view=diff
==============================================================================
--- harmony/enhanced/classlib/branches/java6/modules/awt/src/main/native/gl/windows/GDIBlitter.h (original)
+++ harmony/enhanced/classlib/branches/java6/modules/awt/src/main/native/gl/windows/GDIBlitter.h Wed Oct 31 01:42:07 2007
@@ -38,10 +38,11 @@
void findNonExistColor(DWORD &, DWORD *, UINT);
BOOL isRepeatColor(UINT , DWORD *, UINT);
+
BOOL initBlitData(SURFACE_STRUCTURE *srcSurf, JNIEnv *env, jobject srcData, UINT compType,
- UCHAR srcConstAlpha, BLITSTRUCT *blitStruct);
+ UCHAR srcConstAlpha, BLITSTRUCT *blitStruct, int *, int);
-BOOL initBitmap(SURFACE_STRUCTURE *srcSurf, JNIEnv *env, jobject srcData, bool alphaPre);
+BOOL initBitmap(SURFACE_STRUCTURE *srcSurf, JNIEnv *env, jobject srcData, bool alphaPre, int *, int);
void CompositeBlt(HDC, jint, jint, jint, jint, SURFACE_STRUCTURE *, void *, jint, jint, UINT, UCHAR, PXFORM, PXFORM);
Modified: harmony/enhanced/classlib/branches/java6/modules/awt/src/main/native/gl/windows/include/org_apache_harmony_awt_gl_windows_GDIBlitter.h
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/branches/java6/modules/awt/src/main/native/gl/windows/include/org_apache_harmony_awt_gl_windows_GDIBlitter.h?rev=590591&r1=590590&r2=590591&view=diff
==============================================================================
--- harmony/enhanced/classlib/branches/java6/modules/awt/src/main/native/gl/windows/include/org_apache_harmony_awt_gl_windows_GDIBlitter.h (original)
+++ harmony/enhanced/classlib/branches/java6/modules/awt/src/main/native/gl/windows/include/org_apache_harmony_awt_gl_windows_GDIBlitter.h Wed Oct 31 01:42:07 2007
@@ -47,11 +47,11 @@
jint, jint, jlong, jint, jint, jlong, jint, jint, jint, jdoubleArray, jintArray, jint);
/*
- * Method: org.apache.harmony.awt.gl.windows.GDIBlitter.xorImage(IIJLjava/lang/Object;IIJIII[D[IIZ)V
+ * Method: org.apache.harmony.awt.gl.windows.GDIBlitter.xorImage(IIJLjava/lang/Object;IIJIII[D[IIZ[II)V
*/
JNIEXPORT void JNICALL
Java_org_apache_harmony_awt_gl_windows_GDIBlitter_xorImage(JNIEnv *, jobject,
- jint, jint, jlong, jobject, jint, jint, jlong, jint, jint, jint, jdoubleArray, jintArray, jint, jboolean);
+ jint, jint, jlong, jobject, jint, jint, jlong, jint, jint, jint, jdoubleArray, jintArray, jint, jboolean, jintArray, jint);
/*
* Method: org.apache.harmony.awt.gl.windows.GDIBlitter.bltBitmap(IIJIIJIIIF[D[II)V
@@ -61,18 +61,18 @@
jint, jint, jlong, jint, jint, jlong, jint, jint, jint, jfloat, jdoubleArray, jintArray, jint);
/*
- * Method: org.apache.harmony.awt.gl.windows.GDIBlitter.bltImage(IIJLjava/lang/Object;IIJIIIF[D[IIZ)V
+ * Method: org.apache.harmony.awt.gl.windows.GDIBlitter.bltImage(IIJLjava/lang/Object;IIJIIIF[D[IIZ[II)V
*/
JNIEXPORT void JNICALL
Java_org_apache_harmony_awt_gl_windows_GDIBlitter_bltImage(JNIEnv *, jobject,
- jint, jint, jlong, jobject, jint, jint, jlong, jint, jint, jint, jfloat, jdoubleArray, jintArray, jint, jboolean);
+ jint, jint, jlong, jobject, jint, jint, jlong, jint, jint, jint, jfloat, jdoubleArray, jintArray, jint, jboolean, jintArray, jint);
/*
- * Method: org.apache.harmony.awt.gl.windows.GDIBlitter.bltBGImage(IIJLjava/lang/Object;IIJIIIIF[D[IIZ)V
+ * Method: org.apache.harmony.awt.gl.windows.GDIBlitter.bltBGImage(IIJLjava/lang/Object;IIJIIIIF[D[IIZ[II)V
*/
JNIEXPORT void JNICALL
Java_org_apache_harmony_awt_gl_windows_GDIBlitter_bltBGImage(JNIEnv *, jobject,
- jint, jint, jlong, jobject, jint, jint, jlong, jint, jint, jint, jint, jfloat, jdoubleArray, jintArray, jint, jboolean);
+ jint, jint, jlong, jobject, jint, jint, jlong, jint, jint, jint, jint, jfloat, jdoubleArray, jintArray, jint, jboolean, jintArray, jint);
#ifdef __cplusplus
Modified: harmony/enhanced/classlib/branches/java6/modules/awt/src/main/native/jpegdecoder/shared/JPEGDecoder.h
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/branches/java6/modules/awt/src/main/native/jpegdecoder/shared/JPEGDecoder.h?rev=590591&r1=590590&r2=590591&view=diff
==============================================================================
--- harmony/enhanced/classlib/branches/java6/modules/awt/src/main/native/jpegdecoder/shared/JPEGDecoder.h (original)
+++ harmony/enhanced/classlib/branches/java6/modules/awt/src/main/native/jpegdecoder/shared/JPEGDecoder.h Wed Oct 31 01:42:07 2007
@@ -33,7 +33,8 @@
#include "exceptions.h"
-#define MAX_BUFFER 32768
+#define MIN_BUFFER 32768
+#define MAX_BUFFER 33554432
jfieldID img_JPEG_imageWidthID;
jfieldID img_JPEG_imageHeightID;
Modified: harmony/enhanced/classlib/branches/java6/modules/awt/src/main/native/jpegdecoder/shared/JpegDecoder.c
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/branches/java6/modules/awt/src/main/native/jpegdecoder/shared/JpegDecoder.c?rev=590591&r1=590590&r2=590591&view=diff
==============================================================================
--- harmony/enhanced/classlib/branches/java6/modules/awt/src/main/native/jpegdecoder/shared/JpegDecoder.c (original)
+++ harmony/enhanced/classlib/branches/java6/modules/awt/src/main/native/jpegdecoder/shared/JpegDecoder.c Wed Oct 31 01:42:07 2007
@@ -107,7 +107,10 @@
cinfo->src->bytes_in_buffer = (size_t) srcmgr->valid_buffer_length;
}
-GLOBAL(boolean) gl_jpeg_init_source_mgr(j_decompress_ptr cinfo) {
+GLOBAL(boolean) gl_jpeg_init_source_mgr(j_decompress_ptr cinfo, int bufferSize) {
+
+ int perfBufferSize;
+
gl_jpeg_source_mgr* mgr = (gl_jpeg_source_mgr*) cinfo->src;
// jpeg_source_mgr fields
mgr->base.init_source = gl_jpeg_dummy_decompress;
@@ -116,7 +119,15 @@
mgr->base.resync_to_restart = jpeg_resync_to_restart; // Use default
mgr->base.term_source = gl_jpeg_dummy_decompress;
- mgr->buffer_size = MAX_BUFFER;
+ perfBufferSize = bufferSize * 8;
+
+ if (perfBufferSize < MIN_BUFFER) {
+ mgr->buffer_size = MIN_BUFFER;
+ } else if (perfBufferSize > MAX_BUFFER){
+ mgr->buffer_size = MAX_BUFFER;
+ } else {
+ mgr->buffer_size = perfBufferSize;
+ }
mgr->jpeg_buffer = malloc(mgr->buffer_size);
if(!mgr->jpeg_buffer) {
return FALSE;
@@ -162,7 +173,7 @@
throwNewExceptionByName(env, "java/lang/OutOfMemoryError", "Out of memory");
}
-GLOBAL(void) gl_decompress_struct_init(gl_decompress_struct** glDecompressPtr) {
+GLOBAL(void) gl_decompress_struct_init(gl_decompress_struct** glDecompressPtr, int bufferSize) {
gl_decompress_struct* glDecompress = *glDecompressPtr;
if(glDecompress == NULL) { // Allocate new decompress struct
@@ -186,7 +197,7 @@
// Set up source manager
glDecompress->decompress.src = &(glDecompress->srcMgr.base);
- if(!gl_jpeg_init_source_mgr(&glDecompress->decompress)) { // Out of memory
+ if(!gl_jpeg_init_source_mgr(&glDecompress->decompress, bufferSize)) { // Out of memory
free(glDecompress);
*glDecompressPtr = NULL;
return;
@@ -314,7 +325,7 @@
(gl_decompress_struct*) ((IDATA)hglDecompress);
if(glDecompress == NULL) {
- gl_decompress_struct_init(&glDecompress);
+ gl_decompress_struct_init(&glDecompress, bytesInBuffer);
if(glDecompress == NULL) { // Out of memory
outOfMemory(env, obj, NULL);
return 0;
Propchange: harmony/enhanced/classlib/branches/java6/modules/awt/src/main/native/oglwrapper/shared/org_apache_harmony_awt_gl_opengl_GL.cpp
------------------------------------------------------------------------------
svn:eol-style = native
Modified: harmony/enhanced/classlib/branches/java6/modules/awt/src/main/native/win32wrapper/windows/nativelib_common.cpp
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/branches/java6/modules/awt/src/main/native/win32wrapper/windows/nativelib_common.cpp?rev=590591&r1=590590&r2=590591&view=diff
==============================================================================
--- harmony/enhanced/classlib/branches/java6/modules/awt/src/main/native/win32wrapper/windows/nativelib_common.cpp (original)
+++ harmony/enhanced/classlib/branches/java6/modules/awt/src/main/native/win32wrapper/windows/nativelib_common.cpp Wed Oct 31 01:42:07 2007
@@ -1,17 +1,17 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
void *findFunctionRes = 0;
Propchange: harmony/enhanced/classlib/branches/java6/modules/awt/src/main/native/win32wrapper/windows/nativelib_common.cpp
------------------------------------------------------------------------------
svn:eol-style = native
Modified: harmony/enhanced/classlib/branches/java6/modules/awt/src/main/native/win32wrapper/windows/org_apache_harmony_awt_nativebridge_windows_WGL.cpp
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/branches/java6/modules/awt/src/main/native/win32wrapper/windows/org_apache_harmony_awt_nativebridge_windows_WGL.cpp?rev=590591&r1=590590&r2=590591&view=diff
==============================================================================
--- harmony/enhanced/classlib/branches/java6/modules/awt/src/main/native/win32wrapper/windows/org_apache_harmony_awt_nativebridge_windows_WGL.cpp (original)
+++ harmony/enhanced/classlib/branches/java6/modules/awt/src/main/native/win32wrapper/windows/org_apache_harmony_awt_nativebridge_windows_WGL.cpp Wed Oct 31 01:42:07 2007
@@ -1,141 +1,142 @@
-/*
- * Copyright 2005 - 2006 The Apache Software Software Foundation or its licensors, as applicable.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-/* DO NOT EDIT THIS FILE - it is based on WGL headers and has been generated by nativebridge tool.*/
-
-#include "org_apache_harmony_awt_nativebridge_windows_WGL.h"
-static libHandler libOpenGL32;
-
-JNIEXPORT void JNICALL Java_org_apache_harmony_awt_nativebridge_windows_WGL_init (JNIEnv * env, jclass cls) {
- LOAD_LIB(libOpenGL32, "OpenGL32");
- INIT_GL_GET_PROC_ADDRESS
-}
-
-void * (__stdcall * p_nbridge_wglGetProcAddress) (void *) = NULL;
-
-JNIEXPORT jlong JNICALL Java_org_apache_harmony_awt_nativebridge_windows_WGL_wglGetProcAddress( JNIEnv *env, jobject self, jlong param_0) {
- if (p_nbridge_wglGetProcAddress == NULL) {
- p_nbridge_wglGetProcAddress = (void * (__stdcall *) (void *)) FindFunction(libOpenGL32, "wglGetProcAddress");
- }
- return (jlong) (* p_nbridge_wglGetProcAddress)((void *) param_0);
-}
-
-void * (__stdcall * p_nbridge_wglCreateContext) (void *) = NULL;
-
-JNIEXPORT jlong JNICALL Java_org_apache_harmony_awt_nativebridge_windows_WGL_wglCreateContext( JNIEnv *env, jobject self, jlong param_0) {
- if (p_nbridge_wglCreateContext == NULL) {
- p_nbridge_wglCreateContext = (void * (__stdcall *) (void *)) FindFunction(libOpenGL32, "wglCreateContext");
- }
- return (jlong) (* p_nbridge_wglCreateContext)((void *) param_0);
-}
-
-int (__stdcall * p_nbridge_wglMakeCurrent) (void *, void *) = NULL;
-
-JNIEXPORT jint JNICALL Java_org_apache_harmony_awt_nativebridge_windows_WGL_wglMakeCurrent( JNIEnv *env, jobject self, jlong param_0, jlong param_1) {
- if (p_nbridge_wglMakeCurrent == NULL) {
- p_nbridge_wglMakeCurrent = (int (__stdcall *) (void *, void *)) FindFunction(libOpenGL32, "wglMakeCurrent");
- }
- return (jint) (* p_nbridge_wglMakeCurrent)((void *) param_0, (void *) param_1);
-}
-
-static int (__stdcall * p_nbridge_wglDestroyPbufferARB) (void *) = NULL;
-
-JNIEXPORT jint JNICALL Java_org_apache_harmony_awt_nativebridge_windows_WGL_wglDestroyPbufferARB( JNIEnv *env, jobject self, jlong param_0) {
- if (p_nbridge_wglDestroyPbufferARB == NULL) {
- p_nbridge_wglDestroyPbufferARB = (int (__stdcall *) (void *)) FindFunction(libOpenGL32, "wglDestroyPbufferARB");
- }
- return (jint) (* p_nbridge_wglDestroyPbufferARB)((void *) param_0);
-}
-
-int (__stdcall * p_nbridge_SwapBuffers) (void *) = NULL;
-
-JNIEXPORT jint JNICALL Java_org_apache_harmony_awt_nativebridge_windows_WGL_SwapBuffers( JNIEnv *env, jobject self, jlong param_0) {
- if (p_nbridge_SwapBuffers == NULL) {
- p_nbridge_SwapBuffers = (int (__stdcall *) (void *)) FindFunction(libOpenGL32, "SwapBuffers");
- }
- return (jint) (* p_nbridge_SwapBuffers)((void *) param_0);
-}
-
-static int (__stdcall * p_nbridge_wglReleasePbufferDCARB) (void *, void *) = NULL;
-
-JNIEXPORT jint JNICALL Java_org_apache_harmony_awt_nativebridge_windows_WGL_wglReleasePbufferDCARB( JNIEnv *env, jobject self, jlong param_0, jlong param_1) {
- if (p_nbridge_wglReleasePbufferDCARB == NULL) {
- p_nbridge_wglReleasePbufferDCARB = (int (__stdcall *) (void *, void *)) FindFunction(libOpenGL32, "wglReleasePbufferDCARB");
- }
- return (jint) (* p_nbridge_wglReleasePbufferDCARB)((void *) param_0, (void *) param_1);
-}
-
-static void * (__stdcall * p_nbridge_wglCreatePbufferARB) (void *, int, int, int, void *) = NULL;
-
-JNIEXPORT jlong JNICALL Java_org_apache_harmony_awt_nativebridge_windows_WGL_wglCreatePbufferARB( JNIEnv *env, jobject self, jlong param_0, jint param_1, jint param_2, jint param_3, jlong param_4) {
- if (p_nbridge_wglCreatePbufferARB == NULL) {
- p_nbridge_wglCreatePbufferARB = (void * (__stdcall *) (void *, int, int, int, void *)) FindFunction(libOpenGL32, "wglCreatePbufferARB");
- }
- return (jlong) (* p_nbridge_wglCreatePbufferARB)((void *) param_0, (int) param_1, (int) param_2, (int) param_3, (void *) param_4);
-}
-
-static int (__stdcall * p_nbridge_wglQueryPbufferARB) (void *, int, void *) = NULL;
-
-JNIEXPORT jint JNICALL Java_org_apache_harmony_awt_nativebridge_windows_WGL_wglQueryPbufferARB( JNIEnv *env, jobject self, jlong param_0, jint param_1, jlong param_2) {
- if (p_nbridge_wglQueryPbufferARB == NULL) {
- p_nbridge_wglQueryPbufferARB = (int (__stdcall *) (void *, int, void *)) FindFunction(libOpenGL32, "wglQueryPbufferARB");
- }
- return (jint) (* p_nbridge_wglQueryPbufferARB)((void *) param_0, (int) param_1, (void *) param_2);
-}
-
-int (__stdcall * p_nbridge_wglDeleteContext) (void *) = NULL;
-
-JNIEXPORT jint JNICALL Java_org_apache_harmony_awt_nativebridge_windows_WGL_wglDeleteContext( JNIEnv *env, jobject self, jlong param_0) {
- if (p_nbridge_wglDeleteContext == NULL) {
- p_nbridge_wglDeleteContext = (int (__stdcall *) (void *)) FindFunction(libOpenGL32, "wglDeleteContext");
- }
- return (jint) (* p_nbridge_wglDeleteContext)((void *) param_0);
-}
-
-static void * (__stdcall * p_nbridge_wglGetExtensionsStringARB) (void *) = NULL;
-
-JNIEXPORT jlong JNICALL Java_org_apache_harmony_awt_nativebridge_windows_WGL_wglGetExtensionsStringARB( JNIEnv *env, jobject self, jlong param_0) {
- if (p_nbridge_wglGetExtensionsStringARB == NULL) {
- p_nbridge_wglGetExtensionsStringARB = (void * (__stdcall *) (void *)) FindFunction(libOpenGL32, "wglGetExtensionsStringARB");
- }
- return (jlong) (* p_nbridge_wglGetExtensionsStringARB)((void *) param_0);
-}
-
-static int (__stdcall * p_nbridge_wglChoosePixelFormatARB) (void *, void *, void *, int, void *, void *) = NULL;
-
-JNIEXPORT jint JNICALL Java_org_apache_harmony_awt_nativebridge_windows_WGL_wglChoosePixelFormatARB( JNIEnv *env, jobject self, jlong param_0, jlong param_1, jlong param_2, jint param_3, jlong param_4, jlong param_5) {
- if (p_nbridge_wglChoosePixelFormatARB == NULL) {
- p_nbridge_wglChoosePixelFormatARB = (int (__stdcall *) (void *, void *, void *, int, void *, void *)) FindFunction(libOpenGL32, "wglChoosePixelFormatARB");
- }
- return (jint) (* p_nbridge_wglChoosePixelFormatARB)((void *) param_0, (void *) param_1, (void *) param_2, (int) param_3, (void *) param_4, (void *) param_5);
-}
-
-int (__stdcall * p_nbridge_wglShareLists) (void *, void *) = NULL;
-
-JNIEXPORT jint JNICALL Java_org_apache_harmony_awt_nativebridge_windows_WGL_wglShareLists( JNIEnv *env, jobject self, jlong param_0, jlong param_1) {
- if (p_nbridge_wglShareLists == NULL) {
- p_nbridge_wglShareLists = (int (__stdcall *) (void *, void *)) FindFunction(libOpenGL32, "wglShareLists");
- }
- return (jint) (* p_nbridge_wglShareLists)((void *) param_0, (void *) param_1);
-}
-
-static void * (__stdcall * p_nbridge_wglGetPbufferDCARB) (void *) = NULL;
-
-JNIEXPORT jlong JNICALL Java_org_apache_harmony_awt_nativebridge_windows_WGL_wglGetPbufferDCARB( JNIEnv *env, jobject self, jlong param_0) {
- if (p_nbridge_wglGetPbufferDCARB == NULL) {
- p_nbridge_wglGetPbufferDCARB = (void * (__stdcall *) (void *)) FindFunction(libOpenGL32, "wglGetPbufferDCARB");
- }
- return (jlong) (* p_nbridge_wglGetPbufferDCARB)((void *) param_0);
-}
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+/* DO NOT EDIT THIS FILE - it is based on WGL headers and has been generated by nativebridge tool.*/
+
+#include "org_apache_harmony_awt_nativebridge_windows_WGL.h"
+static libHandler libOpenGL32;
+
+JNIEXPORT void JNICALL Java_org_apache_harmony_awt_nativebridge_windows_WGL_init (JNIEnv * env, jclass cls) {
+ LOAD_LIB(libOpenGL32, "OpenGL32");
+ INIT_GL_GET_PROC_ADDRESS
+}
+
+void * (__stdcall * p_nbridge_wglGetProcAddress) (void *) = NULL;
+
+JNIEXPORT jlong JNICALL Java_org_apache_harmony_awt_nativebridge_windows_WGL_wglGetProcAddress( JNIEnv *env, jobject self, jlong param_0) {
+ if (p_nbridge_wglGetProcAddress == NULL) {
+ p_nbridge_wglGetProcAddress = (void * (__stdcall *) (void *)) FindFunction(libOpenGL32, "wglGetProcAddress");
+ }
+ return (jlong) (* p_nbridge_wglGetProcAddress)((void *) param_0);
+}
+
+void * (__stdcall * p_nbridge_wglCreateContext) (void *) = NULL;
+
+JNIEXPORT jlong JNICALL Java_org_apache_harmony_awt_nativebridge_windows_WGL_wglCreateContext( JNIEnv *env, jobject self, jlong param_0) {
+ if (p_nbridge_wglCreateContext == NULL) {
+ p_nbridge_wglCreateContext = (void * (__stdcall *) (void *)) FindFunction(libOpenGL32, "wglCreateContext");
+ }
+ return (jlong) (* p_nbridge_wglCreateContext)((void *) param_0);
+}
+
+int (__stdcall * p_nbridge_wglMakeCurrent) (void *, void *) = NULL;
+
+JNIEXPORT jint JNICALL Java_org_apache_harmony_awt_nativebridge_windows_WGL_wglMakeCurrent( JNIEnv *env, jobject self, jlong param_0, jlong param_1) {
+ if (p_nbridge_wglMakeCurrent == NULL) {
+ p_nbridge_wglMakeCurrent = (int (__stdcall *) (void *, void *)) FindFunction(libOpenGL32, "wglMakeCurrent");
+ }
+ return (jint) (* p_nbridge_wglMakeCurrent)((void *) param_0, (void *) param_1);
+}
+
+static int (__stdcall * p_nbridge_wglDestroyPbufferARB) (void *) = NULL;
+
+JNIEXPORT jint JNICALL Java_org_apache_harmony_awt_nativebridge_windows_WGL_wglDestroyPbufferARB( JNIEnv *env, jobject self, jlong param_0) {
+ if (p_nbridge_wglDestroyPbufferARB == NULL) {
+ p_nbridge_wglDestroyPbufferARB = (int (__stdcall *) (void *)) FindFunction(libOpenGL32, "wglDestroyPbufferARB");
+ }
+ return (jint) (* p_nbridge_wglDestroyPbufferARB)((void *) param_0);
+}
+
+int (__stdcall * p_nbridge_SwapBuffers) (void *) = NULL;
+
+JNIEXPORT jint JNICALL Java_org_apache_harmony_awt_nativebridge_windows_WGL_SwapBuffers( JNIEnv *env, jobject self, jlong param_0) {
+ if (p_nbridge_SwapBuffers == NULL) {
+ p_nbridge_SwapBuffers = (int (__stdcall *) (void *)) FindFunction(libOpenGL32, "SwapBuffers");
+ }
+ return (jint) (* p_nbridge_SwapBuffers)((void *) param_0);
+}
+
+static int (__stdcall * p_nbridge_wglReleasePbufferDCARB) (void *, void *) = NULL;
+
+JNIEXPORT jint JNICALL Java_org_apache_harmony_awt_nativebridge_windows_WGL_wglReleasePbufferDCARB( JNIEnv *env, jobject self, jlong param_0, jlong param_1) {
+ if (p_nbridge_wglReleasePbufferDCARB == NULL) {
+ p_nbridge_wglReleasePbufferDCARB = (int (__stdcall *) (void *, void *)) FindFunction(libOpenGL32, "wglReleasePbufferDCARB");
+ }
+ return (jint) (* p_nbridge_wglReleasePbufferDCARB)((void *) param_0, (void *) param_1);
+}
+
+static void * (__stdcall * p_nbridge_wglCreatePbufferARB) (void *, int, int, int, void *) = NULL;
+
+JNIEXPORT jlong JNICALL Java_org_apache_harmony_awt_nativebridge_windows_WGL_wglCreatePbufferARB( JNIEnv *env, jobject self, jlong param_0, jint param_1, jint param_2, jint param_3, jlong param_4) {
+ if (p_nbridge_wglCreatePbufferARB == NULL) {
+ p_nbridge_wglCreatePbufferARB = (void * (__stdcall *) (void *, int, int, int, void *)) FindFunction(libOpenGL32, "wglCreatePbufferARB");
+ }
+ return (jlong) (* p_nbridge_wglCreatePbufferARB)((void *) param_0, (int) param_1, (int) param_2, (int) param_3, (void *) param_4);
+}
+
+static int (__stdcall * p_nbridge_wglQueryPbufferARB) (void *, int, void *) = NULL;
+
+JNIEXPORT jint JNICALL Java_org_apache_harmony_awt_nativebridge_windows_WGL_wglQueryPbufferARB( JNIEnv *env, jobject self, jlong param_0, jint param_1, jlong param_2) {
+ if (p_nbridge_wglQueryPbufferARB == NULL) {
+ p_nbridge_wglQueryPbufferARB = (int (__stdcall *) (void *, int, void *)) FindFunction(libOpenGL32, "wglQueryPbufferARB");
+ }
+ return (jint) (* p_nbridge_wglQueryPbufferARB)((void *) param_0, (int) param_1, (void *) param_2);
+}
+
+int (__stdcall * p_nbridge_wglDeleteContext) (void *) = NULL;
+
+JNIEXPORT jint JNICALL Java_org_apache_harmony_awt_nativebridge_windows_WGL_wglDeleteContext( JNIEnv *env, jobject self, jlong param_0) {
+ if (p_nbridge_wglDeleteContext == NULL) {
+ p_nbridge_wglDeleteContext = (int (__stdcall *) (void *)) FindFunction(libOpenGL32, "wglDeleteContext");
+ }
+ return (jint) (* p_nbridge_wglDeleteContext)((void *) param_0);
+}
+
+static void * (__stdcall * p_nbridge_wglGetExtensionsStringARB) (void *) = NULL;
+
+JNIEXPORT jlong JNICALL Java_org_apache_harmony_awt_nativebridge_windows_WGL_wglGetExtensionsStringARB( JNIEnv *env, jobject self, jlong param_0) {
+ if (p_nbridge_wglGetExtensionsStringARB == NULL) {
+ p_nbridge_wglGetExtensionsStringARB = (void * (__stdcall *) (void *)) FindFunction(libOpenGL32, "wglGetExtensionsStringARB");
+ }
+ return (jlong) (* p_nbridge_wglGetExtensionsStringARB)((void *) param_0);
+}
+
+static int (__stdcall * p_nbridge_wglChoosePixelFormatARB) (void *, void *, void *, int, void *, void *) = NULL;
+
+JNIEXPORT jint JNICALL Java_org_apache_harmony_awt_nativebridge_windows_WGL_wglChoosePixelFormatARB( JNIEnv *env, jobject self, jlong param_0, jlong param_1, jlong param_2, jint param_3, jlong param_4, jlong param_5) {
+ if (p_nbridge_wglChoosePixelFormatARB == NULL) {
+ p_nbridge_wglChoosePixelFormatARB = (int (__stdcall *) (void *, void *, void *, int, void *, void *)) FindFunction(libOpenGL32, "wglChoosePixelFormatARB");
+ }
+ return (jint) (* p_nbridge_wglChoosePixelFormatARB)((void *) param_0, (void *) param_1, (void *) param_2, (int) param_3, (void *) param_4, (void *) param_5);
+}
+
+int (__stdcall * p_nbridge_wglShareLists) (void *, void *) = NULL;
+
+JNIEXPORT jint JNICALL Java_org_apache_harmony_awt_nativebridge_windows_WGL_wglShareLists( JNIEnv *env, jobject self, jlong param_0, jlong param_1) {
+ if (p_nbridge_wglShareLists == NULL) {
+ p_nbridge_wglShareLists = (int (__stdcall *) (void *, void *)) FindFunction(libOpenGL32, "wglShareLists");
+ }
+ return (jint) (* p_nbridge_wglShareLists)((void *) param_0, (void *) param_1);
+}
+
+static void * (__stdcall * p_nbridge_wglGetPbufferDCARB) (void *) = NULL;
+
+JNIEXPORT jlong JNICALL Java_org_apache_harmony_awt_nativebridge_windows_WGL_wglGetPbufferDCARB( JNIEnv *env, jobject self, jlong param_0) {
+ if (p_nbridge_wglGetPbufferDCARB == NULL) {
+ p_nbridge_wglGetPbufferDCARB = (void * (__stdcall *) (void *)) FindFunction(libOpenGL32, "wglGetPbufferDCARB");
+ }
+ return (jlong) (* p_nbridge_wglGetPbufferDCARB)((void *) param_0);
+}
Propchange: harmony/enhanced/classlib/branches/java6/modules/awt/src/main/native/win32wrapper/windows/org_apache_harmony_awt_nativebridge_windows_WGL.cpp
------------------------------------------------------------------------------
svn:eol-style = native
Modified: harmony/enhanced/classlib/branches/java6/modules/awt/src/main/native/win32wrapper/windows/org_apache_harmony_awt_nativebridge_windows_WGL.h
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/branches/java6/modules/awt/src/main/native/win32wrapper/windows/org_apache_harmony_awt_nativebridge_windows_WGL.h?rev=590591&r1=590590&r2=590591&view=diff
==============================================================================
--- harmony/enhanced/classlib/branches/java6/modules/awt/src/main/native/win32wrapper/windows/org_apache_harmony_awt_nativebridge_windows_WGL.h (original)
+++ harmony/enhanced/classlib/branches/java6/modules/awt/src/main/native/win32wrapper/windows/org_apache_harmony_awt_nativebridge_windows_WGL.h Wed Oct 31 01:42:07 2007
@@ -1,9 +1,10 @@
/*
- * Copyright 2005 - 2006 The Apache Software Software Foundation or its licensors, as applicable.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
Modified: harmony/enhanced/classlib/branches/java6/modules/awt/src/test/api/java/common/java/awt/BorderLayoutRTest.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/branches/java6/modules/awt/src/test/api/java/common/java/awt/BorderLayoutRTest.java?rev=590591&r1=590590&r2=590591&view=diff
==============================================================================
--- harmony/enhanced/classlib/branches/java6/modules/awt/src/test/api/java/common/java/awt/BorderLayoutRTest.java (original)
+++ harmony/enhanced/classlib/branches/java6/modules/awt/src/test/api/java/common/java/awt/BorderLayoutRTest.java Wed Oct 31 01:42:07 2007
@@ -38,67 +38,35 @@
}
public final void testGetLayoutAlignmentX1() {
- try {
- layout.getLayoutAlignmentX(null);
- } catch (Throwable t) {
- fail();
- }
+ layout.getLayoutAlignmentX(null);
}
public final void testGetLayoutAlignmentX2() {
- try {
- layout.getLayoutAlignmentX(emptyContainer);
- } catch (Throwable t) {
- fail();
- }
+ layout.getLayoutAlignmentX(emptyContainer);
}
public final void testGetLayoutAlignmentY1() {
- try {
- layout.getLayoutAlignmentY(null);
- } catch (Throwable t) {
- fail();
- }
+ layout.getLayoutAlignmentY(null);
}
public final void testGetLayoutAlignmentY2() {
- try {
- layout.getLayoutAlignmentY(emptyContainer);
- } catch (Throwable t) {
- fail();
- }
+ layout.getLayoutAlignmentY(emptyContainer);
}
public final void testInvalidateLayout1() {
- try {
- layout.invalidateLayout(null);
- } catch (Throwable t) {
- fail();
- }
+ layout.invalidateLayout(null);
}
public final void testInvalidateLayout2() {
- try {
- layout.invalidateLayout(emptyContainer);
- } catch (Throwable t) {
- fail();
- }
+ layout.invalidateLayout(emptyContainer);
}
public final void testMaximumLayoutSize1() {
- try {
- assertEquals(maxSize, layout.maximumLayoutSize(null));
- } catch (Throwable t) {
- fail();
- }
+ assertEquals(maxSize, layout.maximumLayoutSize(null));
}
public final void testMaximumLayoutSize2() {
- try {
- assertEquals(maxSize, layout.maximumLayoutSize(emptyContainer));
- } catch (Throwable t) {
- fail();
- }
+ assertEquals(maxSize, layout.maximumLayoutSize(emptyContainer));
}
Modified: harmony/enhanced/classlib/branches/java6/modules/awt/src/test/api/java/common/java/awt/CardLayoutRTest.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/branches/java6/modules/awt/src/test/api/java/common/java/awt/CardLayoutRTest.java?rev=590591&r1=590590&r2=590591&view=diff
==============================================================================
--- harmony/enhanced/classlib/branches/java6/modules/awt/src/test/api/java/common/java/awt/CardLayoutRTest.java (original)
+++ harmony/enhanced/classlib/branches/java6/modules/awt/src/test/api/java/common/java/awt/CardLayoutRTest.java Wed Oct 31 01:42:07 2007
@@ -43,40 +43,24 @@
} catch (IllegalArgumentException iae) {
return;
}
- fail();
+ fail("Expected IllegalArgumentException");
}
public final void testGetLayoutAlignmentX1() {
- try {
- layout.getLayoutAlignmentX(null);
- } catch (Throwable t) {
- fail();
- }
+ layout.getLayoutAlignmentX(null);
}
public final void testGetLayoutAlignmentX2() {
- try {
- layout.getLayoutAlignmentX(emptyContainer);
- } catch (Throwable t) {
- fail();
- }
+ layout.getLayoutAlignmentX(emptyContainer);
}
public final void testGetLayoutAlignmentY1() {
- try {
- layout.getLayoutAlignmentY(null);
- } catch (Throwable t) {
- fail();
- }
+ layout.getLayoutAlignmentY(null);
}
public final void testGetLayoutAlignmentY2() {
- try {
- layout.getLayoutAlignmentY(emptyContainer);
- } catch (Throwable t) {
- fail();
- }
+ layout.getLayoutAlignmentY(emptyContainer);
}
public void testLast() {
@@ -85,32 +69,20 @@
} catch (IllegalArgumentException iae) {
return;
}
- fail();
+ fail("Expected IllegalArgumentException");
}
public void testLayoutContainer() {
- try {
- layout.layoutContainer(emptyContainer);
- } catch (Throwable t) {
- fail();
- }
+ layout.layoutContainer(emptyContainer);
assertTrue(true);
}
public final void testMaximumLayoutSize1() {
- try {
- assertEquals(maxSize, layout.maximumLayoutSize(null));
- } catch (Throwable t) {
- fail();
- }
+ assertEquals(maxSize, layout.maximumLayoutSize(null));
}
public final void testMaximumLayoutSize2() {
- try {
- assertEquals(maxSize, layout.maximumLayoutSize(emptyContainer));
- } catch (Throwable t) {
- fail();
- }
+ assertEquals(maxSize, layout.maximumLayoutSize(emptyContainer));
}
@@ -124,7 +96,7 @@
} catch (IllegalArgumentException iae) {
return;
}
- fail();
+ fail("Expected IllegalArgumentException");
}
public final void testPreferredLayoutSize() {
@@ -137,15 +109,11 @@
} catch (IllegalArgumentException iae) {
return;
}
- fail();
+ fail("Expected IllegalArgumentException");
}
public void testRemoveLayoutComponent() {
- try {
- layout.removeLayoutComponent(emptyContainer);
- } catch (Throwable t) {
- fail();
- }
+ layout.removeLayoutComponent(emptyContainer);
}
}
Modified: harmony/enhanced/classlib/branches/java6/modules/awt/src/test/api/java/common/java/awt/DisplayModeTest.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/branches/java6/modules/awt/src/test/api/java/common/java/awt/DisplayModeTest.java?rev=590591&r1=590590&r2=590591&view=diff
==============================================================================
--- harmony/enhanced/classlib/branches/java6/modules/awt/src/test/api/java/common/java/awt/DisplayModeTest.java (original)
+++ harmony/enhanced/classlib/branches/java6/modules/awt/src/test/api/java/common/java/awt/DisplayModeTest.java Wed Oct 31 01:42:07 2007
@@ -1,3 +1,20 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
package java.awt;
import junit.framework.TestCase;
Modified: harmony/enhanced/classlib/branches/java6/modules/awt/src/test/api/java/common/java/awt/FlowLayoutRTest.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/branches/java6/modules/awt/src/test/api/java/common/java/awt/FlowLayoutRTest.java?rev=590591&r1=590590&r2=590591&view=diff
==============================================================================
--- harmony/enhanced/classlib/branches/java6/modules/awt/src/test/api/java/common/java/awt/FlowLayoutRTest.java (original)
+++ harmony/enhanced/classlib/branches/java6/modules/awt/src/test/api/java/common/java/awt/FlowLayoutRTest.java Wed Oct 31 01:42:07 2007
@@ -48,27 +48,15 @@
}
public final void testLayoutContainer() {
- try {
- layout.layoutContainer(emptyContainer);
- } catch (Throwable t) {
- fail();
- }
+ layout.layoutContainer(emptyContainer);
}
public void testSetAlignment() {
- try {
- layout.setAlignment(-1);
- } catch (Throwable t) {
- fail();
- }
+ layout.setAlignment(-1);
}
public void testRemoveLayoutComponent() {
- try {
- layout.removeLayoutComponent(null);
- } catch (Throwable t) {
- fail();
- }
+ layout.removeLayoutComponent(null);
}
}
Modified: harmony/enhanced/classlib/branches/java6/modules/awt/src/test/api/java/common/java/awt/GridBagLayoutRTest.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/branches/java6/modules/awt/src/test/api/java/common/java/awt/GridBagLayoutRTest.java?rev=590591&r1=590590&r2=590591&view=diff
==============================================================================
--- harmony/enhanced/classlib/branches/java6/modules/awt/src/test/api/java/common/java/awt/GridBagLayoutRTest.java (original)
+++ harmony/enhanced/classlib/branches/java6/modules/awt/src/test/api/java/common/java/awt/GridBagLayoutRTest.java Wed Oct 31 01:42:07 2007
@@ -111,11 +111,7 @@
public final void testInvalidate() {
GridBagLayout gbl = new GridBagLayout();
- try {
- gbl.invalidateLayout(null);
- } catch (Throwable t) {
- fail();
- }
+ gbl.invalidateLayout(null);
}
static void addToGridBag(Panel panel, Component comp, int x, int y, int w,
Modified: harmony/enhanced/classlib/branches/java6/modules/awt/src/test/api/java/common/java/awt/GridLayoutRTest.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/branches/java6/modules/awt/src/test/api/java/common/java/awt/GridLayoutRTest.java?rev=590591&r1=590590&r2=590591&view=diff
==============================================================================
--- harmony/enhanced/classlib/branches/java6/modules/awt/src/test/api/java/common/java/awt/GridLayoutRTest.java (original)
+++ harmony/enhanced/classlib/branches/java6/modules/awt/src/test/api/java/common/java/awt/GridLayoutRTest.java Wed Oct 31 01:42:07 2007
@@ -48,19 +48,11 @@
}
public final void testLayoutContainer() {
- try {
- layout.layoutContainer(emptyContainer);
- } catch (Throwable t) {
- fail();
- }
+ layout.layoutContainer(emptyContainer);
}
public void testRemoveLayoutComponent() {
- try {
- layout.removeLayoutComponent(emptyContainer);
- } catch (Throwable t) {
- fail();
- }
+ layout.removeLayoutComponent(emptyContainer);
}
}
Modified: harmony/enhanced/classlib/branches/java6/modules/awt/src/test/api/java/common/java/awt/MenuBarTest.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/branches/java6/modules/awt/src/test/api/java/common/java/awt/MenuBarTest.java?rev=590591&r1=590590&r2=590591&view=diff
==============================================================================
--- harmony/enhanced/classlib/branches/java6/modules/awt/src/test/api/java/common/java/awt/MenuBarTest.java (original)
+++ harmony/enhanced/classlib/branches/java6/modules/awt/src/test/api/java/common/java/awt/MenuBarTest.java Wed Oct 31 01:42:07 2007
@@ -116,21 +116,13 @@
public void testRemove1() {
MenuBar m = new MenuBar();
- try {
- m.remove(null);
- assertTrue(true);
- } catch (Throwable t) {
- fail("Unexpected exception : " + t);
- }
+ m.remove(null);
+ assertTrue(true);
}
public void testSetHelpMenu() {
MenuBar m = new MenuBar();
- try {
- m.setHelpMenu(null);
- assertTrue(true);
- } catch (Throwable t) {
- fail("Unexpected exception : " + t);
- }
+ m.setHelpMenu(null);
+ assertTrue(true);
}
}
Modified: harmony/enhanced/classlib/branches/java6/modules/awt/src/test/api/java/common/java/awt/Tools.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/branches/java6/modules/awt/src/test/api/java/common/java/awt/Tools.java?rev=590591&r1=590590&r2=590591&view=diff
==============================================================================
--- harmony/enhanced/classlib/branches/java6/modules/awt/src/test/api/java/common/java/awt/Tools.java (original)
+++ harmony/enhanced/classlib/branches/java6/modules/awt/src/test/api/java/common/java/awt/Tools.java Wed Oct 31 01:42:07 2007
@@ -62,7 +62,7 @@
public static void checkDeadLoop(Component c, int[] count) {
final int DEAD_LOOP_TIMEOUT = 1000;
- final int VALID_NUMBER_OF_PAINT_CALLS = 5;
+ final int VALID_NUMBER_OF_PAINT_CALLS = 15;
Frame f = new Frame();
Modified: harmony/enhanced/classlib/branches/java6/modules/awt/src/test/api/java/common/java/awt/datatransfer/UnsupportedFlavorExceptionTest.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/branches/java6/modules/awt/src/test/api/java/common/java/awt/datatransfer/UnsupportedFlavorExceptionTest.java?rev=590591&r1=590590&r2=590591&view=diff
==============================================================================
--- harmony/enhanced/classlib/branches/java6/modules/awt/src/test/api/java/common/java/awt/datatransfer/UnsupportedFlavorExceptionTest.java (original)
+++ harmony/enhanced/classlib/branches/java6/modules/awt/src/test/api/java/common/java/awt/datatransfer/UnsupportedFlavorExceptionTest.java Wed Oct 31 01:42:07 2007
@@ -1,3 +1,20 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
package java.awt.datatransfer;
import junit.framework.TestCase;
Modified: harmony/enhanced/classlib/branches/java6/modules/awt/src/test/api/java/common/java/awt/image/BufferedImageFilterTest.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/branches/java6/modules/awt/src/test/api/java/common/java/awt/image/BufferedImageFilterTest.java?rev=590591&r1=590590&r2=590591&view=diff
==============================================================================
--- harmony/enhanced/classlib/branches/java6/modules/awt/src/test/api/java/common/java/awt/image/BufferedImageFilterTest.java (original)
+++ harmony/enhanced/classlib/branches/java6/modules/awt/src/test/api/java/common/java/awt/image/BufferedImageFilterTest.java Wed Oct 31 01:42:07 2007
@@ -72,9 +72,8 @@
new BufferedImageFilter(null);
fail("Should throw NullPointerException, but was not.");
} catch (NullPointerException e) {
- } catch (Exception e) {
- fail("NullPointerException expected");
- }
+ // Expected
+ }
}
public void testGetBufferedImageOp() throws Exception {
Modified: harmony/enhanced/classlib/branches/java6/modules/awt/src/test/api/java/common/java/awt/image/BufferedImageTest.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/branches/java6/modules/awt/src/test/api/java/common/java/awt/image/BufferedImageTest.java?rev=590591&r1=590590&r2=590591&view=diff
==============================================================================
--- harmony/enhanced/classlib/branches/java6/modules/awt/src/test/api/java/common/java/awt/image/BufferedImageTest.java (original)
+++ harmony/enhanced/classlib/branches/java6/modules/awt/src/test/api/java/common/java/awt/image/BufferedImageTest.java Wed Oct 31 01:42:07 2007
@@ -1,3 +1,20 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
package java.awt.image;
import java.awt.Image;
Modified: harmony/enhanced/classlib/branches/java6/modules/awt/src/test/api/java/unix/org/apache/harmony/awt/gl/font/LineMetricsImplRTest.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/branches/java6/modules/awt/src/test/api/java/unix/org/apache/harmony/awt/gl/font/LineMetricsImplRTest.java?rev=590591&r1=590590&r2=590591&view=diff
==============================================================================
--- harmony/enhanced/classlib/branches/java6/modules/awt/src/test/api/java/unix/org/apache/harmony/awt/gl/font/LineMetricsImplRTest.java (original)
+++ harmony/enhanced/classlib/branches/java6/modules/awt/src/test/api/java/unix/org/apache/harmony/awt/gl/font/LineMetricsImplRTest.java Wed Oct 31 01:42:07 2007
@@ -32,14 +32,9 @@
Font font = new Font("Dialog", Font.PLAIN, 12);
FontRenderContext frc = new FontRenderContext(null, false, false);
final int count = 100;
- try {
+
for (int i = 0; i < count; i++) {
LineMetrics lm = font.getLineMetrics("", frc);
}
- } catch (Exception e) {
- if (e.getMessage().indexOf("Error opening TrueType font file.") != -1){
- fail("NPE \"Error opening TrueType font file.\" caught.");
- }
- }
}
}
Modified: harmony/enhanced/classlib/branches/java6/modules/beans/src/test/java/org/apache/harmony/beans/tests/java/beans/EventSetDescriptorTest.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/branches/java6/modules/beans/src/test/java/org/apache/harmony/beans/tests/java/beans/EventSetDescriptorTest.java?rev=590591&r1=590590&r2=590591&view=diff
==============================================================================
--- harmony/enhanced/classlib/branches/java6/modules/beans/src/test/java/org/apache/harmony/beans/tests/java/beans/EventSetDescriptorTest.java (original)
+++ harmony/enhanced/classlib/branches/java6/modules/beans/src/test/java/org/apache/harmony/beans/tests/java/beans/EventSetDescriptorTest.java Wed Oct 31 01:42:07 2007
@@ -1273,15 +1273,9 @@
/**
* The test checks the constructor
*/
- public void testEventSetDescriptorConstructor() {
- try {
- new EventSetDescriptor(OtherBean.class, "sample",
- SampleListener.class, "fireSampleEvent");
- } catch (Exception e) {
- fail("Exception of " + e.getClass() + " class with message "
- + e.getMessage() + " is thrown");
- }
-
+ public void testEventSetDescriptorConstructor() throws Exception {
+ new EventSetDescriptor(OtherBean.class, "sample",
+ SampleListener.class, "fireSampleEvent");
}
//Regression Test
Modified: harmony/enhanced/classlib/branches/java6/modules/beans/src/test/java/org/apache/harmony/beans/tests/java/beans/PersistenceDelegateTest.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/branches/java6/modules/beans/src/test/java/org/apache/harmony/beans/tests/java/beans/PersistenceDelegateTest.java?rev=590591&r1=590590&r2=590591&view=diff
==============================================================================
--- harmony/enhanced/classlib/branches/java6/modules/beans/src/test/java/org/apache/harmony/beans/tests/java/beans/PersistenceDelegateTest.java (original)
+++ harmony/enhanced/classlib/branches/java6/modules/beans/src/test/java/org/apache/harmony/beans/tests/java/beans/PersistenceDelegateTest.java Wed Oct 31 01:42:07 2007
@@ -1242,19 +1242,15 @@
return true;
}
}
- public void test_writeExpression_writeObject() {
+ public void test_writeExpression_writeObject() throws Exception {
ByteArrayOutputStream output = new ByteArrayOutputStream();
XMLEncoder encoder = new XMLEncoder( output );
Date date = new Date(2007, 06, 26);
Expression expression = new Expression( date, "toString", null );
String date_string = null;
- try {
- date_string = (String) expression.getValue();
- } catch (Exception e ) {
- System.out.println("Failed to get the date value.");
- e.printStackTrace();
- }
+ date_string = (String) expression.getValue();
+
DummyBean bean = new DummyBean( date_string );
// The expression knows about the date object.
encoder.writeExpression( expression );
Modified: harmony/enhanced/classlib/branches/java6/modules/beans/src/test/java/org/apache/harmony/beans/tests/java/beans/XMLEncoderTest.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/branches/java6/modules/beans/src/test/java/org/apache/harmony/beans/tests/java/beans/XMLEncoderTest.java?rev=590591&r1=590590&r2=590591&view=diff
==============================================================================
--- harmony/enhanced/classlib/branches/java6/modules/beans/src/test/java/org/apache/harmony/beans/tests/java/beans/XMLEncoderTest.java (original)
+++ harmony/enhanced/classlib/branches/java6/modules/beans/src/test/java/org/apache/harmony/beans/tests/java/beans/XMLEncoderTest.java Wed Oct 31 01:42:07 2007
@@ -428,9 +428,6 @@
try {
e.writeObject(new Boolean(true));
- } catch (Exception excp) {
- fail("Exception " + excp.getClass() + " is thrown: "
- + excp.getMessage());
} finally {
e.close();
}
@@ -450,9 +447,6 @@
try {
e.writeObject(new Byte((byte) 123));
- } catch (Exception excp) {
- fail("Exception " + excp.getClass() + " is thrown: "
- + excp.getMessage());
} finally {
e.close();
}
@@ -472,9 +466,6 @@
try {
e.writeObject(new Character('a'));
- } catch (Exception excp) {
- fail("Exception " + excp.getClass() + " is thrown: "
- + excp.getMessage());
} finally {
e.close();
}
@@ -494,9 +485,6 @@
try {
e.writeObject(Object.class);
- } catch (Exception excp) {
- fail("Exception " + excp.getClass() + " is thrown: "
- + excp.getMessage());
} finally {
e.close();
}
@@ -516,9 +504,6 @@
try {
e.writeObject(new Double(0.01));
- } catch (Exception excp) {
- fail("Exception " + excp.getClass() + " is thrown: "
- + excp.getMessage());
} finally {
e.close();
}
@@ -538,9 +523,6 @@
try {
e.writeObject(new Float((float) 0.01));
- } catch (Exception excp) {
- fail("Exception " + excp.getClass() + " is thrown: "
- + excp.getMessage());
} finally {
e.close();
}
@@ -560,9 +542,6 @@
try {
e.writeObject(new Integer(1));
- } catch (Exception excp) {
- fail("Exception " + excp.getClass() + " is thrown: "
- + excp.getMessage());
} finally {
e.close();
}
@@ -582,9 +561,6 @@
try {
e.writeObject(new Long(1));
- } catch (Exception excp) {
- fail("Exception " + excp.getClass() + " is thrown: "
- + excp.getMessage());
} finally {
e.close();
}
@@ -604,9 +580,6 @@
try {
e.writeObject(new Short((short) 1));
- } catch (Exception excp) {
- fail("Exception " + excp.getClass() + " is thrown: "
- + excp.getMessage());
} finally {
e.close();
}
@@ -626,9 +599,6 @@
try {
e.writeObject(new String("hello"));
- } catch (Exception excp) {
- fail("Exception " + excp.getClass() + " is thrown: "
- + excp.getMessage());
} finally {
e.close();
}
@@ -648,9 +618,6 @@
try {
e.writeObject(new int[] { 1, 2, 3 });
- } catch (Exception excp) {
- fail("Exception " + excp.getClass() + " is thrown: "
- + excp.getMessage());
} finally {
e.close();
}
@@ -670,9 +637,6 @@
try {
e.writeObject(null);
- } catch (Exception excp) {
- fail("Exception " + excp.getClass() + " is thrown: "
- + excp.getMessage());
} finally {
e.close();
}
@@ -701,9 +665,6 @@
try {
e.writeObject(bean1);
e.writeObject(bean2);
- } catch (Exception excp) {
- fail("Exception " + excp.getClass() + " is thrown: "
- + excp.getMessage());
} finally {
e.close();
}
@@ -739,9 +700,6 @@
// e.writeObject(object);
e.writeObject(a);
e.writeObject(object);
- } catch (Exception excp) {
- fail("Exception " + excp.getClass() + " is thrown: "
- + excp.getMessage());
} finally {
e.close();
}
Modified: harmony/enhanced/classlib/branches/java6/modules/crypto/src/test/api/java/org/apache/harmony/crypto/tests/javax/crypto/SecretKeyFactoryTest.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/branches/java6/modules/crypto/src/test/api/java/org/apache/harmony/crypto/tests/javax/crypto/SecretKeyFactoryTest.java?rev=590591&r1=590590&r2=590591&view=diff
==============================================================================
--- harmony/enhanced/classlib/branches/java6/modules/crypto/src/test/api/java/org/apache/harmony/crypto/tests/javax/crypto/SecretKeyFactoryTest.java (original)
+++ harmony/enhanced/classlib/branches/java6/modules/crypto/src/test/api/java/org/apache/harmony/crypto/tests/javax/crypto/SecretKeyFactoryTest.java Wed Oct 31 01:42:07 2007
@@ -381,12 +381,12 @@
try {
skF[i].getKeySpec(secKey, null);
fail("getKeySpec(secKey, null): NullPointerException or InvalidKeySpecException must be thrown");
- } catch (Exception e) {
- if (!(e instanceof NullPointerException) &&
- !(e instanceof InvalidKeySpecException)) {
- fail("Unexpected: "+e.toString() + "was thrown");
- }
+ } catch (InvalidKeySpecException e) {
+ // Expected
+ } catch (NullPointerException e) {
+ // Expected
}
+
try {
Class c;
if (defaultAlgorithm.equals(defaultAlgorithm2)) {
Propchange: harmony/enhanced/classlib/branches/java6/modules/jndi/src/main/java/org/apache/harmony/jndi/provider/ldap/CompareOp.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: harmony/enhanced/classlib/branches/java6/modules/jndi/src/main/java/org/apache/harmony/jndi/provider/ldap/ExtendedOp.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: harmony/enhanced/classlib/branches/java6/modules/jndi/src/main/java/org/apache/harmony/jndi/provider/ldap/ModifyDNOp.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: harmony/enhanced/classlib/branches/java6/modules/jndi/src/main/java/org/apache/harmony/jndi/provider/ldap/ModifyOp.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: harmony/enhanced/classlib/branches/java6/modules/jndi/src/test/java/org/apache/harmony/jndi/provider/ldap/CompareOpTest.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: harmony/enhanced/classlib/branches/java6/modules/jndi/src/test/java/org/apache/harmony/jndi/provider/ldap/LdapMessageTest.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: harmony/enhanced/classlib/branches/java6/modules/jndi/src/test/java/org/apache/harmony/jndi/provider/ldap/ModifyDNOpTest.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: harmony/enhanced/classlib/branches/java6/modules/jndi/src/test/java/org/apache/harmony/jndi/provider/ldap/ModifyOpTest.java
------------------------------------------------------------------------------
svn:eol-style = native