harmony-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From apetre...@apache.org
Subject svn commit: r574539 - in /harmony/enhanced/classlib/trunk/modules/awt/src/main: java/windows/org/apache/harmony/awt/gl/windows/ native/gl/windows/ native/gl/windows/include/
Date Tue, 11 Sep 2007 10:06:03 GMT
Author: apetrenko
Date: Tue Sep 11 03:06:02 2007
New Revision: 574539

URL: http://svn.apache.org/viewvc?rev=574539&view=rev
Log:
Patch for HARMONY-4746 "[classlib][awt] drawOval function of Graphics need to be implemented
on native layer"

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/org_apache_harmony_awt_gl_windows_WinGDIPGraphics2D.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=574539&r1=574538&r2=574539&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 Sep 11 03:06:02 2007
@@ -332,6 +332,16 @@
     }
 
     @Override
+    public void drawOval(int x, int y, int width, int height) {
+        if (!nativePen) {
+            super.drawOval(x, y, width, height);
+            return;
+        }
+
+        drawOval(gi, x, y, width, height);
+    }
+
+    @Override
     public void fill(Shape s) {
         if (!nativeBrush) {
             super.fill(s);
@@ -540,6 +550,7 @@
     // Draw native primitives
     private native void drawLine(long gi, int x1, int y1, int x2, int y2);
     private native void drawRect(long gi, int x, int y, int width, int height);
+    private native void drawOval(long gi, int x, int y, int width, int height);
 
     // Fill native primitives
     private native void fillRect(long gi, int x, int y, int width, int height);

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=574539&r1=574538&r2=574539&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 Sep 11 03:06:02 2007
@@ -555,6 +555,31 @@
 
 /*
  * Class:     org_apache_harmony_awt_gl_windows_WinGDIPGraphics2D
+ * Method:    drawOval
+ * Signature: (JIIII)V
+ */
+JNIEXPORT void JNICALL Java_org_apache_harmony_awt_gl_windows_WinGDIPGraphics2D_drawOval
+  (JNIEnv *env, jobject obj, jlong gip, jint x, jint y, jint width, jint height)
+{
+    if (width == 0) {
+        Java_org_apache_harmony_awt_gl_windows_WinGDIPGraphics2D_drawLine(env, obj, gip,
x, y, x, y+height);
+        return;
+    } else if (height == 0) {
+        Java_org_apache_harmony_awt_gl_windows_WinGDIPGraphics2D_drawLine(env, obj, gip,
x, y, x+width, y);
+        return;
+    }
+
+    GraphicsInfo *gi = (GraphicsInfo *)gip;
+    
+    gi->graphics->SetTransform(gi->matrix);
+
+    gi->graphics->DrawEllipse(gi->pen, x, y, width, height);
+
+    gi->graphics->ResetTransform();
+}
+ 
+/*
+ * Class:     org_apache_harmony_awt_gl_windows_WinGDIPGraphics2D
  * Method:    fillRect
  * Signature: (JIIII)V
  */

Modified: harmony/enhanced/classlib/trunk/modules/awt/src/main/native/gl/windows/include/org_apache_harmony_awt_gl_windows_WinGDIPGraphics2D.h
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/trunk/modules/awt/src/main/native/gl/windows/include/org_apache_harmony_awt_gl_windows_WinGDIPGraphics2D.h?rev=574539&r1=574538&r2=574539&view=diff
==============================================================================
--- harmony/enhanced/classlib/trunk/modules/awt/src/main/native/gl/windows/include/org_apache_harmony_awt_gl_windows_WinGDIPGraphics2D.h
(original)
+++ harmony/enhanced/classlib/trunk/modules/awt/src/main/native/gl/windows/include/org_apache_harmony_awt_gl_windows_WinGDIPGraphics2D.h
Tue Sep 11 03:06:02 2007
@@ -49,162 +49,190 @@
 /* Native methods */
 
 /*
- * Method: org.apache.harmony.awt.gl.windows.WinGDIPGraphics2D.setNativeTransform(J[D)V
+ * Class:     org_apache_harmony_awt_gl_windows_WinGDIPGraphics2D
+ * Method:    gdiPlusStartup
+ * Signature: ()J
  */
-JNIEXPORT void JNICALL
-Java_org_apache_harmony_awt_gl_windows_WinGDIPGraphics2D_setNativeTransform(JNIEnv *, jobject,

-    jlong, jdoubleArray);
+JNIEXPORT jlong JNICALL Java_org_apache_harmony_awt_gl_windows_WinGDIPGraphics2D_gdiPlusStartup
+  (JNIEnv *, jclass);
 
 /*
- * Method: org.apache.harmony.awt.gl.windows.WinGDIPGraphics2D.resetClip(J)V
+ * Class:     org_apache_harmony_awt_gl_windows_WinGDIPGraphics2D
+ * Method:    gdiPlusShutdown
+ * Signature: (J)V
  */
-JNIEXPORT void JNICALL
-Java_org_apache_harmony_awt_gl_windows_WinGDIPGraphics2D_resetClip(JNIEnv *, jobject, 
-    jlong);
+JNIEXPORT void JNICALL Java_org_apache_harmony_awt_gl_windows_WinGDIPGraphics2D_gdiPlusShutdown
+  (JNIEnv *, jclass, jlong);
 
 /*
- * Method: org.apache.harmony.awt.gl.windows.WinGDIPGraphics2D.setClip(J[II)V
+ * Class:     org_apache_harmony_awt_gl_windows_WinGDIPGraphics2D
+ * Method:    createGraphicsInfo
+ * Signature: (JIIII)J
  */
-JNIEXPORT void JNICALL
-Java_org_apache_harmony_awt_gl_windows_WinGDIPGraphics2D_setClip(JNIEnv *, jobject, 
-    jlong, jintArray, jint);
+JNIEXPORT jlong JNICALL Java_org_apache_harmony_awt_gl_windows_WinGDIPGraphics2D_createGraphicsInfo
+  (JNIEnv *, jobject, jlong, jint, jint, jint, jint);
 
 /*
- * Method: org.apache.harmony.awt.gl.windows.WinGDIPGraphics2D.fillRect(JIIII)V
+ * Class:     org_apache_harmony_awt_gl_windows_WinGDIPGraphics2D
+ * Method:    createCompatibleImageInfo
+ * Signature: (JII)J
  */
-JNIEXPORT void JNICALL
-Java_org_apache_harmony_awt_gl_windows_WinGDIPGraphics2D_fillRect(JNIEnv *, jobject, 
-    jlong, jint, jint, jint, jint);
+JNIEXPORT jlong JNICALL Java_org_apache_harmony_awt_gl_windows_WinGDIPGraphics2D_createCompatibleImageInfo__JII
+  (JNIEnv *, jclass, jlong, jint, jint);
 
 /*
- * Method: org.apache.harmony.awt.gl.windows.WinGDIPGraphics2D.drawRect(JIIII)V
+ * Class:     org_apache_harmony_awt_gl_windows_WinGDIPGraphics2D
+ * Method:    createCompatibleImageInfo
+ * Signature: ([BII)J
  */
-JNIEXPORT void JNICALL
-Java_org_apache_harmony_awt_gl_windows_WinGDIPGraphics2D_drawRect(JNIEnv *, jobject, 
-    jlong, jint, jint, jint, jint);
+JNIEXPORT jlong JNICALL Java_org_apache_harmony_awt_gl_windows_WinGDIPGraphics2D_createCompatibleImageInfo___3BII
+  (JNIEnv *, jclass, jbyteArray, jint, jint);
 
 /*
- * Method: org.apache.harmony.awt.gl.windows.WinGDIPGraphics2D.drawLine(JIIII)V
+ * Class:     org_apache_harmony_awt_gl_windows_WinGDIPGraphics2D
+ * Method:    copyImageInfo
+ * Signature: (J)J
  */
-JNIEXPORT void JNICALL
-Java_org_apache_harmony_awt_gl_windows_WinGDIPGraphics2D_drawLine(JNIEnv *, jobject, 
-    jlong, jint, jint, jint, jint);
+JNIEXPORT jlong JNICALL Java_org_apache_harmony_awt_gl_windows_WinGDIPGraphics2D_copyImageInfo
+  (JNIEnv *, jobject, jlong);
 
 /*
- * Method: org.apache.harmony.awt.gl.windows.WinGDIPGraphics2D.fillShape(J[FII)V
+ * Class:     org_apache_harmony_awt_gl_windows_WinGDIPGraphics2D
+ * Method:    disposeGraphicsInfo
+ * Signature: (J)V
  */
-JNIEXPORT void JNICALL
-Java_org_apache_harmony_awt_gl_windows_WinGDIPGraphics2D_fillShape(JNIEnv *, jobject, 
-    jlong, jfloatArray, jint, jint);
+JNIEXPORT void JNICALL Java_org_apache_harmony_awt_gl_windows_WinGDIPGraphics2D_disposeGraphicsInfo
+  (JNIEnv *, jclass, jlong);
 
 /*
- * Method: org.apache.harmony.awt.gl.windows.WinGDIPGraphics2D.drawShape(J[FII)V
+ * Class:     org_apache_harmony_awt_gl_windows_WinGDIPGraphics2D
+ * Method:    copyArea
+ * Signature: (JIIIIII)V
  */
-JNIEXPORT void JNICALL
-Java_org_apache_harmony_awt_gl_windows_WinGDIPGraphics2D_drawShape(JNIEnv *, jobject, 
-    jlong, jfloatArray, jint, jint);
+JNIEXPORT void JNICALL Java_org_apache_harmony_awt_gl_windows_WinGDIPGraphics2D_copyArea
+  (JNIEnv *, jobject, jlong, jint, jint, jint, jint, jint, jint);
 
 /*
- * Method: org.apache.harmony.awt.gl.windows.WinGDIPGraphics2D.deletePen(J)V
+ * Class:     org_apache_harmony_awt_gl_windows_WinGDIPGraphics2D
+ * Method:    setSolidBrush
+ * Signature: (JIIII)V
  */
-JNIEXPORT void JNICALL
-Java_org_apache_harmony_awt_gl_windows_WinGDIPGraphics2D_deletePen(JNIEnv *, jobject, 
-    jlong);
+JNIEXPORT void JNICALL Java_org_apache_harmony_awt_gl_windows_WinGDIPGraphics2D_setSolidBrush
+  (JNIEnv *, jobject, jlong, jint, jint, jint, jint);
 
 /*
- * Method: org.apache.harmony.awt.gl.windows.WinGDIPGraphics2D.setPen(JFIIF[FIF)Z
+ * Class:     org_apache_harmony_awt_gl_windows_WinGDIPGraphics2D
+ * Method:    setLinearGradientBrush
+ * Signature: (JIIIIIIIIIIIIZ)V
  */
-JNIEXPORT jboolean JNICALL
-Java_org_apache_harmony_awt_gl_windows_WinGDIPGraphics2D_setPen(JNIEnv *, jobject, 
-    jlong, jfloat, jint, jint, jfloat, jfloatArray, jint, jfloat);
+JNIEXPORT void JNICALL Java_org_apache_harmony_awt_gl_windows_WinGDIPGraphics2D_setLinearGradientBrush
+  (JNIEnv *, jobject, jlong, jint, jint, jint, jint, jint, jint, jint, jint, jint, jint,
jint, jint, jboolean);
 
 /*
- * Method: org.apache.harmony.awt.gl.windows.WinGDIPGraphics2D.getDC(J)J
+ * Class:     org_apache_harmony_awt_gl_windows_WinGDIPGraphics2D
+ * Method:    fillRects
+ * Signature: (J[II)V
  */
-JNIEXPORT jlong JNICALL
-Java_org_apache_harmony_awt_gl_windows_WinGDIPGraphics2D_getDC(JNIEnv *, jobject, 
-    jlong);
+JNIEXPORT void JNICALL Java_org_apache_harmony_awt_gl_windows_WinGDIPGraphics2D_fillRects
+  (JNIEnv *, jobject, jlong, jintArray, jint);
 
 /*
- * Method: org.apache.harmony.awt.gl.windows.WinGDIPGraphics2D.fillRects(J[II)V
+ * Class:     org_apache_harmony_awt_gl_windows_WinGDIPGraphics2D
+ * Method:    getDC
+ * Signature: (J)J
  */
-JNIEXPORT void JNICALL
-Java_org_apache_harmony_awt_gl_windows_WinGDIPGraphics2D_fillRects(JNIEnv *, jobject, 
-    jlong, jintArray, jint);
+JNIEXPORT jlong JNICALL Java_org_apache_harmony_awt_gl_windows_WinGDIPGraphics2D_getDC
+  (JNIEnv *, jobject, jlong);
 
 /*
- * Method: org.apache.harmony.awt.gl.windows.WinGDIPGraphics2D.setLinearGradientBrush(JIIIIIIIIIIIIZ)V
+ * Class:     org_apache_harmony_awt_gl_windows_WinGDIPGraphics2D
+ * Method:    setPen
+ * Signature: (JFIIF[FIF)Z
  */
-JNIEXPORT void JNICALL
-Java_org_apache_harmony_awt_gl_windows_WinGDIPGraphics2D_setLinearGradientBrush(JNIEnv *,
jobject, 
-    jlong, jint, jint, jint, jint, jint, jint, jint, jint, jint, jint, jint, jint, jboolean);
+JNIEXPORT jboolean JNICALL Java_org_apache_harmony_awt_gl_windows_WinGDIPGraphics2D_setPen
+  (JNIEnv *, jobject, jlong, jfloat, jint, jint, jfloat, jfloatArray, jint, jfloat);
 
 /*
- * Method: org.apache.harmony.awt.gl.windows.WinGDIPGraphics2D.setSolidBrush(JIIII)V
+ * Class:     org_apache_harmony_awt_gl_windows_WinGDIPGraphics2D
+ * Method:    deletePen
+ * Signature: (J)V
  */
-JNIEXPORT void JNICALL
-Java_org_apache_harmony_awt_gl_windows_WinGDIPGraphics2D_setSolidBrush(JNIEnv *, jobject,

-    jlong, jint, jint, jint, jint);
+JNIEXPORT void JNICALL Java_org_apache_harmony_awt_gl_windows_WinGDIPGraphics2D_deletePen
+  (JNIEnv *, jobject, jlong);
 
 /*
- * Method: org.apache.harmony.awt.gl.windows.WinGDIPGraphics2D.copyArea(JIIIIII)V
+ * Class:     org_apache_harmony_awt_gl_windows_WinGDIPGraphics2D
+ * Method:    drawShape
+ * Signature: (J[FII)V
  */
-JNIEXPORT void JNICALL
-Java_org_apache_harmony_awt_gl_windows_WinGDIPGraphics2D_copyArea(JNIEnv *, jobject, 
-    jlong, jint, jint, jint, jint, jint, jint);
+JNIEXPORT void JNICALL Java_org_apache_harmony_awt_gl_windows_WinGDIPGraphics2D_drawShape
+  (JNIEnv *, jobject, jlong, jfloatArray, jint, jint);
 
 /*
- * Method: org.apache.harmony.awt.gl.windows.WinGDIPGraphics2D.copyImageInfo(J)J
+ * Class:     org_apache_harmony_awt_gl_windows_WinGDIPGraphics2D
+ * Method:    fillShape
+ * Signature: (J[FII)V
  */
-JNIEXPORT jlong JNICALL
-Java_org_apache_harmony_awt_gl_windows_WinGDIPGraphics2D_copyImageInfo(JNIEnv *, jobject,

-    jlong);
+JNIEXPORT void JNICALL Java_org_apache_harmony_awt_gl_windows_WinGDIPGraphics2D_fillShape
+  (JNIEnv *, jobject, jlong, jfloatArray, jint, jint);
 
 /*
- * Method: org.apache.harmony.awt.gl.windows.WinGDIPGraphics2D.createGraphicsInfo(JIIII)J
+ * Class:     org_apache_harmony_awt_gl_windows_WinGDIPGraphics2D
+ * Method:    drawLine
+ * Signature: (JIIII)V
  */
-JNIEXPORT jlong JNICALL
-Java_org_apache_harmony_awt_gl_windows_WinGDIPGraphics2D_createGraphicsInfo(JNIEnv *, jobject,

-    jlong, jint, jint, jint, jint);
+JNIEXPORT void JNICALL Java_org_apache_harmony_awt_gl_windows_WinGDIPGraphics2D_drawLine
+  (JNIEnv *, jobject, jlong, jint, jint, jint, jint);
 
 /*
- * Method: org.apache.harmony.awt.gl.windows.WinGDIPGraphics2D.disposeGraphicsInfo(J)V
+ * Class:     org_apache_harmony_awt_gl_windows_WinGDIPGraphics2D
+ * Method:    drawRect
+ * Signature: (JIIII)V
  */
-JNIEXPORT void JNICALL
-Java_org_apache_harmony_awt_gl_windows_WinGDIPGraphics2D_disposeGraphicsInfo(JNIEnv *, jclass,

-    jlong);
+JNIEXPORT void JNICALL Java_org_apache_harmony_awt_gl_windows_WinGDIPGraphics2D_drawRect
+  (JNIEnv *, jobject, jlong, jint, jint, jint, jint);
 
 /*
- * Method: org.apache.harmony.awt.gl.windows.WinGDIPGraphics2D.createCompatibleImageInfo([BII)J
+ * Class:     org_apache_harmony_awt_gl_windows_WinGDIPGraphics2D
+ * Method:    drawOval
+ * Signature: (JIIII)V
  */
-JNIEXPORT jlong JNICALL
-Java_org_apache_harmony_awt_gl_windows_WinGDIPGraphics2D_createCompatibleImageInfo___3BII(JNIEnv
*, jclass, 
-    jbyteArray, jint, jint);
+JNIEXPORT void JNICALL Java_org_apache_harmony_awt_gl_windows_WinGDIPGraphics2D_drawOval
+  (JNIEnv *, jobject, jlong, jint, jint, jint, jint);
 
 /*
- * Method: org.apache.harmony.awt.gl.windows.WinGDIPGraphics2D.createCompatibleImageInfo(JII)J
+ * Class:     org_apache_harmony_awt_gl_windows_WinGDIPGraphics2D
+ * Method:    fillRect
+ * Signature: (JIIII)V
  */
-JNIEXPORT jlong JNICALL
-Java_org_apache_harmony_awt_gl_windows_WinGDIPGraphics2D_createCompatibleImageInfo__JII(JNIEnv
*, jclass, 
-    jlong, jint, jint);
+JNIEXPORT void JNICALL Java_org_apache_harmony_awt_gl_windows_WinGDIPGraphics2D_fillRect
+  (JNIEnv *, jobject, jlong, jint, jint, jint, jint);
 
 /*
- * Method: org.apache.harmony.awt.gl.windows.WinGDIPGraphics2D.gdiPlusShutdown(J)V
+ * Class:     org_apache_harmony_awt_gl_windows_WinGDIPGraphics2D
+ * Method:    setClip
+ * Signature: (J[II)V
  */
-JNIEXPORT void JNICALL
-Java_org_apache_harmony_awt_gl_windows_WinGDIPGraphics2D_gdiPlusShutdown(JNIEnv *, jclass,

-    jlong);
+JNIEXPORT void JNICALL Java_org_apache_harmony_awt_gl_windows_WinGDIPGraphics2D_setClip
+  (JNIEnv *, jobject, jlong, jintArray, jint);
 
 /*
- * Method: org.apache.harmony.awt.gl.windows.WinGDIPGraphics2D.gdiPlusStartup()J
+ * Class:     org_apache_harmony_awt_gl_windows_WinGDIPGraphics2D
+ * Method:    resetClip
+ * Signature: (J)V
  */
-JNIEXPORT jlong JNICALL
-Java_org_apache_harmony_awt_gl_windows_WinGDIPGraphics2D_gdiPlusStartup(JNIEnv *, jclass);
+JNIEXPORT void JNICALL Java_org_apache_harmony_awt_gl_windows_WinGDIPGraphics2D_resetClip
+  (JNIEnv *, jobject, jlong);
 
+/*
+ * Class:     org_apache_harmony_awt_gl_windows_WinGDIPGraphics2D
+ * Method:    setNativeTransform
+ * Signature: (J[D)V
+ */
+JNIEXPORT void JNICALL Java_org_apache_harmony_awt_gl_windows_WinGDIPGraphics2D_setNativeTransform
+  (JNIEnv *, jobject, jlong, jdoubleArray);
 
 #ifdef __cplusplus
 }
 #endif
-
-#endif /* _ORG_APACHE_HARMONY_AWT_GL_WINDOWS_WINGDIPGRAPHICS2D_H */
-
+#endif



Mime
View raw message