You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@harmony.apache.org by ap...@apache.org on 2007/12/07 14:35:00 UTC
svn commit: r602098 -
/harmony/enhanced/classlib/trunk/modules/awt/src/main/native/gl/windows/GDIBlitter.cpp
Author: apetrenko
Date: Fri Dec 7 05:34:59 2007
New Revision: 602098
URL: http://svn.apache.org/viewvc?rev=602098&view=rev
Log:
Patch for HARMONY-5264 "[classlib][awt] XORMode leads to crash"
Modified:
harmony/enhanced/classlib/trunk/modules/awt/src/main/native/gl/windows/GDIBlitter.cpp
Modified: harmony/enhanced/classlib/trunk/modules/awt/src/main/native/gl/windows/GDIBlitter.cpp
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/trunk/modules/awt/src/main/native/gl/windows/GDIBlitter.cpp?rev=602098&r1=602097&r2=602098&view=diff
==============================================================================
--- harmony/enhanced/classlib/trunk/modules/awt/src/main/native/gl/windows/GDIBlitter.cpp (original)
+++ harmony/enhanced/classlib/trunk/modules/awt/src/main/native/gl/windows/GDIBlitter.cpp Fri Dec 7 05:34:59 2007
@@ -70,22 +70,20 @@
SelectObject(tmpDC, brush);
PatBlt(tmpDC, 0, 0, w, h, PATCOPY);
- int count;
int *regions;
if(dirtyRegions == 0){
- regCount = 1;
+ regCount = 4;
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);
+ regions = (int *)malloc(regCount * sizeof(int));
+ env->GetIntArrayRegion(dirtyRegions, 1, regCount, regions);
}
- if(initBitmap(srcSurf, env, srcData, true, regions, count)){
+ if(initBitmap(srcSurf, env, srcData, true, regions, regCount)){
BLENDFUNCTION bf;
bf.AlphaFormat = AC_SRC_ALPHA;
bf.BlendOp = AC_SRC_OVER;
@@ -213,22 +211,20 @@
srcSurf->invalidated = invalidated != 0;
- int count;
int *regions;
if(dirtyRegions == 0){
- regCount = 1;
+ regCount = 4;
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);
+ regions = (int *)malloc(regCount * sizeof(int));
+ env->GetIntArrayRegion(dirtyRegions, 1, regCount, regions);
}
- if(!initBlitData(srcSurf, env, srcData, compType, srca, &blitStruct, regions, count)){
+ if(!initBlitData(srcSurf, env, srcData, compType, srca, &blitStruct, regions, regCount)){
return;
}
@@ -409,21 +405,19 @@
srcSurf->invalidated = invalidated != 0;
- int count;
int *regions;
if(dirtyRegions == 0){
- regCount = 1;
+ regCount = 4;
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);
+ regions = (int *)malloc(regCount * sizeof(int));
+ env->GetIntArrayRegion(dirtyRegions, 1, regCount, regions);
}
- if(!initBitmap(srcSurf, env, srcData, true, regions, count)) return;
+ if(!initBitmap(srcSurf, env, srcData, true, regions, regCount)) return;
BYTE r = (BYTE)((xorcolor >> 16) & 0xff);
BYTE g = (BYTE)((xorcolor >> 8) & 0xff);