Author: jordi
Date: 2005-03-30 10:41:59 -0500 (Wed, 30 Mar 2005)
New Revision: 42377

Modified:
   trunk/mcs/class/System.Drawing/System.Drawing/Brush.cs
   trunk/mcs/class/System.Drawing/System.Drawing/ChangeLog
   trunk/mcs/class/System.Drawing/System.Drawing/Image.cs
   trunk/mcs/class/System.Drawing/System.Drawing/Pen.cs
Log:
2005-03-30 Jordi Mas i Hernandez <[EMAIL PROTECTED]>

        * Pen.cs: remove locks. They are done at gdiplus level
        * Brush.cs: remove locks. They are done at gdiplus level
        * Image.cs: remove locks. They are done at gdiplus level



Modified: trunk/mcs/class/System.Drawing/System.Drawing/Brush.cs
===================================================================
--- trunk/mcs/class/System.Drawing/System.Drawing/Brush.cs      2005-03-30 
15:33:36 UTC (rev 42376)
+++ trunk/mcs/class/System.Drawing/System.Drawing/Brush.cs      2005-03-30 
15:41:59 UTC (rev 42377)
@@ -87,13 +87,12 @@
 
                protected virtual void Dispose (bool disposing)
                {
-                       lock (this){
-                               if (disposed == false) {
-                                       GDIPlus.GdipDeleteBrush (nativeObject);
-                                       disposed = true;
-                                       nativeObject = IntPtr.Zero;
-                               }
-                       }
+
+                       if (disposed == false) {
+                               GDIPlus.GdipDeleteBrush (nativeObject);
+                               disposed = true;
+                               nativeObject = IntPtr.Zero;
+                       }                       
                }
 
                ~Brush ()

Modified: trunk/mcs/class/System.Drawing/System.Drawing/ChangeLog
===================================================================
--- trunk/mcs/class/System.Drawing/System.Drawing/ChangeLog     2005-03-30 
15:33:36 UTC (rev 42376)
+++ trunk/mcs/class/System.Drawing/System.Drawing/ChangeLog     2005-03-30 
15:41:59 UTC (rev 42377)
@@ -1,3 +1,9 @@
+2005-03-30 Jordi Mas i Hernandez <[EMAIL PROTECTED]>
+
+       * Pen.cs: remove locks. They are done at gdiplus level
+       * Brush.cs: remove locks. They are done at gdiplus level
+       * Image.cs: remove locks. They are done at gdiplus level
+
 2005-03-30  RogÃrio Pereira AraÃjo <[EMAIL PROTECTED]>
 
        * Icon.cs: Finished Icon(Type, String) ctor

Modified: trunk/mcs/class/System.Drawing/System.Drawing/Image.cs
===================================================================
--- trunk/mcs/class/System.Drawing/System.Drawing/Image.cs      2005-03-30 
15:33:36 UTC (rev 42376)
+++ trunk/mcs/class/System.Drawing/System.Drawing/Image.cs      2005-03-30 
15:41:59 UTC (rev 42377)
@@ -409,7 +409,7 @@
                
                IntPtr nativeEncoderParams = encoderParams.ToNativePtr ();
                st = GDIPlus.GdipSaveAdd (nativeObject, nativeEncoderParams);
-               Marshal.FreeHGlobal (nativeEncoderParams);
+               Marshal.FreeHGlobal (nativeEncoderParams);
                GDIPlus.CheckStatus (st);
        }
                
@@ -419,7 +419,7 @@
                
                IntPtr nativeEncoderParams = encoderParams.ToNativePtr ();
                st = GDIPlus.GdipSaveAddImage (nativeObject, 
image.NativeObject, nativeEncoderParams);
-               Marshal.FreeHGlobal (nativeEncoderParams);
+               Marshal.FreeHGlobal (nativeEncoderParams);
                GDIPlus.CheckStatus (st);
        }
                
@@ -673,11 +673,8 @@
 
        private void DisposeResources ()
        {
-               lock (this)
-               {
-                       Status status = GDIPlus.GdipDisposeImage (nativeObject);
-                       GDIPlus.CheckStatus (status);
-               }
+               Status status = GDIPlus.GdipDisposeImage (nativeObject);
+               GDIPlus.CheckStatus (status);           
        }
        
        protected virtual void Dispose (bool disposing)
@@ -690,22 +687,20 @@
        
        public virtual object Clone()
        {                               
-               lock (this)
-               {
-                       IntPtr newimage = IntPtr.Zero;
-                       
-                       if (!(this is Bitmap)) 
-                               throw new NotImplementedException (); 
-                       
-                       Status status = GDIPlus.GdipCloneImage (NativeObject, 
out newimage);                    
-                       GDIPlus.CheckStatus (status);                   
 
-                       if (this is Bitmap){
-                               return new Bitmap (newimage);
-                       }
-                       
+               IntPtr newimage = IntPtr.Zero;
+               
+               if (!(this is Bitmap)) 
                        throw new NotImplementedException (); 
+               
+               Status status = GDIPlus.GdipCloneImage (NativeObject, out 
newimage);                    
+               GDIPlus.CheckStatus (status);                   
+
+               if (this is Bitmap){
+                       return new Bitmap (newimage);
                }
+               
+               throw new NotImplementedException ();           
        }
 
 }

Modified: trunk/mcs/class/System.Drawing/System.Drawing/Pen.cs
===================================================================
--- trunk/mcs/class/System.Drawing/System.Drawing/Pen.cs        2005-03-30 
15:33:36 UTC (rev 42376)
+++ trunk/mcs/class/System.Drawing/System.Drawing/Pen.cs        2005-03-30 
15:41:59 UTC (rev 42377)
@@ -62,32 +62,27 @@
 
                public Pen (Brush brush, float width)
                {
-                       lock (this)
-                       {
-                               Status status = GDIPlus.GdipCreatePen2 
(brush.nativeObject, width, Unit.UnitWorld, out nativeObject);
+                       Status status = GDIPlus.GdipCreatePen2 
(brush.nativeObject, width, Unit.UnitWorld, out nativeObject);
+                       GDIPlus.CheckStatus (status);
+               
+                       this.brush = brush;
+                       if (brush is SolidBrush) {
+                               color = ((SolidBrush) brush).Color;
+                               status = GDIPlus.GdipSetPenColor (nativeObject, 
color.ToArgb ());
                                GDIPlus.CheckStatus (status);
-                       
-                               this.brush = brush;
-                               if (brush is SolidBrush) {
-                                       color = ((SolidBrush) brush).Color;
-                                       status = GDIPlus.GdipSetPenColor 
(nativeObject, color.ToArgb ());
-                                       GDIPlus.CheckStatus (status);
-                               }
-                       }
+                       }                       
                }
 
                public Pen (Color color, float width)
                {
-                       lock (this)
-                       {
-                               Status status = GDIPlus.GdipCreatePen1 
(color.ToArgb (), width, Unit.UnitWorld, out nativeObject);
-                               GDIPlus.CheckStatus (status);
-       
-                               this.color = color;
-                               brush = new SolidBrush (color);
-                               status = GDIPlus.GdipSetPenBrushFill 
(nativeObject, brush.nativeObject);
-                               GDIPlus.CheckStatus (status);
-                       }
+
+                       Status status = GDIPlus.GdipCreatePen1 (color.ToArgb 
(), width, Unit.UnitWorld, out nativeObject);
+                       GDIPlus.CheckStatus (status);
+
+                       this.color = color;
+                       brush = new SolidBrush (color);
+                       status = GDIPlus.GdipSetPenBrushFill (nativeObject, 
brush.nativeObject);
+                       GDIPlus.CheckStatus (status);                   
                }
 
                //

_______________________________________________
Mono-patches maillist  -  [email protected]
http://lists.ximian.com/mailman/listinfo/mono-patches

Reply via email to