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/11/13 12:26:17 UTC
svn commit: r594489 - in
/harmony/enhanced/classlib/trunk/modules/awt/src/main:
java/windows/org/apache/harmony/awt/gl/windows/WinGDIPGraphics2D.java
native/gl/windows/WinGDIPGraphics2D.cpp
native/gl/windows/include/gl_GDIPlus.h
Author: apetrenko
Date: Tue Nov 13 03:26:15 2007
New Revision: 594489
URL: http://svn.apache.org/viewvc?rev=594489&view=rev
Log:
Patch for HARMONY-5052 "[classlib][awt][EIOffice]draw on component's
graphics out of bounds"
Modified:
harmony/enhanced/classlib/trunk/modules/awt/src/main/java/windows/org/apache/harmony/awt/gl/windows/WinGDIPGraphics2D.java
harmony/enhanced/classlib/trunk/modules/awt/src/main/native/gl/windows/WinGDIPGraphics2D.cpp
harmony/enhanced/classlib/trunk/modules/awt/src/main/native/gl/windows/include/gl_GDIPlus.h
Modified: harmony/enhanced/classlib/trunk/modules/awt/src/main/java/windows/org/apache/harmony/awt/gl/windows/WinGDIPGraphics2D.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/trunk/modules/awt/src/main/java/windows/org/apache/harmony/awt/gl/windows/WinGDIPGraphics2D.java?rev=594489&r1=594488&r2=594489&view=diff
==============================================================================
--- harmony/enhanced/classlib/trunk/modules/awt/src/main/java/windows/org/apache/harmony/awt/gl/windows/WinGDIPGraphics2D.java (original)
+++ harmony/enhanced/classlib/trunk/modules/awt/src/main/java/windows/org/apache/harmony/awt/gl/windows/WinGDIPGraphics2D.java Tue Nov 13 03:26:15 2007
@@ -96,7 +96,6 @@
size = new Dimension(b.width, b.height);
gi = createGraphicsInfo(this.nw.getId(), tx, ty, b.width, b.height);
- setTransformedClip(this.clip);
if (!FontManager.IS_FONTLIB) {
jtr = GDIPTextRenderer.inst;
}
@@ -112,7 +111,6 @@
size = new Dimension(width, height);
gi = createGraphicsInfo(this.nw.getId(), tx, ty, width, height);
- setTransformedClip(this.clip);
if (!FontManager.IS_FONTLIB) {
jtr = GDIPTextRenderer.inst;
}
@@ -138,7 +136,6 @@
} else {
this.gi = copyImageInfo(img.gi);
}
- setTransformedClip(this.clip);
dstSurf = img.getImageSurface();
blitter = GDIBlitter.getInstance();
if (!FontManager.IS_FONTLIB) {
Modified: harmony/enhanced/classlib/trunk/modules/awt/src/main/native/gl/windows/WinGDIPGraphics2D.cpp
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/trunk/modules/awt/src/main/native/gl/windows/WinGDIPGraphics2D.cpp?rev=594489&r1=594488&r2=594489&view=diff
==============================================================================
--- harmony/enhanced/classlib/trunk/modules/awt/src/main/native/gl/windows/WinGDIPGraphics2D.cpp (original)
+++ harmony/enhanced/classlib/trunk/modules/awt/src/main/native/gl/windows/WinGDIPGraphics2D.cpp Tue Nov 13 03:26:15 2007
@@ -105,6 +105,9 @@
gi->bmp = 0;
gi->matrix = new Matrix();
+ gi->clip = new Region(Rect(x, y, width, height));
+ gi->graphics->SetClip(gi->clip);
+
return (jlong)gi;
}
@@ -115,18 +118,21 @@
*/
JNIEXPORT jlong JNICALL Java_org_apache_harmony_awt_gl_windows_WinGDIPGraphics2D_createGraphicsInfoFor
(JNIEnv * env, jobject obj, jlong hdc, jchar pageUnit) {
- GraphicsInfo * gi = (GraphicsInfo *) malloc(sizeof(GraphicsInfo));
+ GraphicsInfo * gi = (GraphicsInfo *) malloc(sizeof(GraphicsInfo));
+
+ gi->hdc = (HDC) hdc;
+ gi->graphics = new Graphics(gi->hdc);
+ gi->pen = 0;
+ gi->brush = 0;
+ gi->bmp = 0;
+ gi->matrix = new Matrix();
- gi->hdc = (HDC) hdc;
- gi->graphics = new Graphics(gi->hdc);
- gi->pen = 0;
- gi->brush = 0;
- gi->bmp = 0;
- gi->matrix = new Matrix();
+ gi->clip = new Region();
+ gi->graphics->SetClip(gi->clip);
- gi->graphics->SetPageUnit((Gdiplus::Unit) pageUnit);
+ gi->graphics->SetPageUnit((Gdiplus::Unit) pageUnit);
- return (jlong)gi;
+ return (jlong)gi;
}
/*
@@ -172,6 +178,9 @@
gi->pen = 0;
gi->brush = 0;
gi->matrix = 0;
+
+ gi->clip = new Region(Rect(0, 0, width, height));
+ gi->graphics->SetClip(gi->clip);
return gi;
}
@@ -222,12 +231,13 @@
gi->hdc = origgi->hdc;
gi->bmp = 0;
gi->graphics = new Graphics(gi->hdc);
+
+ gi->clip = new Region();
if (origgi->graphics != NULL) {
- Region clip;
- origgi->graphics->GetClip(&clip);
- gi->graphics->SetClip(&clip);
+ origgi->graphics->GetClip(gi->clip);
}
+ gi->graphics->SetClip(gi->clip);
gi->pen = (origgi->pen != NULL)?origgi->pen->Clone():0;
gi->brush = (origgi->brush != NULL)?origgi->brush->Clone():0;
gi->matrix = (origgi->matrix != NULL)?origgi->matrix->Clone():new Matrix();
@@ -264,6 +274,10 @@
delete(gi->matrix);
}
+ if (gi->clip) {
+ delete(gi->clip);
+ }
+
// If hwnd and bmp are 0 then we should not destroy HDC
// because it's a copy of VolatileImage
if (gi->hwnd != 0 || gi->bmp != 0) {
@@ -679,7 +693,7 @@
return;
GraphicsInfo *gi = (GraphicsInfo *)gip;
- gi->graphics->ResetClip();
+ gi->graphics->SetClip(gi->clip);
}
/*
Modified: harmony/enhanced/classlib/trunk/modules/awt/src/main/native/gl/windows/include/gl_GDIPlus.h
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/trunk/modules/awt/src/main/native/gl/windows/include/gl_GDIPlus.h?rev=594489&r1=594488&r2=594489&view=diff
==============================================================================
--- harmony/enhanced/classlib/trunk/modules/awt/src/main/native/gl/windows/include/gl_GDIPlus.h (original)
+++ harmony/enhanced/classlib/trunk/modules/awt/src/main/native/gl/windows/include/gl_GDIPlus.h Tue Nov 13 03:26:15 2007
@@ -35,6 +35,7 @@
Brush *brush;
HBITMAP bmp;
Matrix *matrix;
+ Region *clip;
} GraphicsInfo;
typedef struct _GLBITMAPINFO{