[mono/libgdiplus] [3 commits] 969f5c03: Partial implementation of BitBlt from gdi32.dll

"Miguel de Icaza ([email protected])" <[email protected]> Tue, 19 Nov 2013 14:35:56 +0000
Newsgroups gmane.comp.gnome.mono.patches
Message-ID <0000014270ca02da-5d52c37f-ff02-41cc-9699-0af8eb5c78c7-000000@email.amazonses.com>
   Branch: refs/heads/master
     Home: https://github.com/mono/libgdiplus
  Compare: https://github.com/mono/libgdiplus/compare/506df13e6e1c...c50d1f96348b

   Commit: 969f5c03e9b297ee3ba1b5c42bf5bb920286ab64
   Author: Francis Fisher <[email protected]> (wtfrank)
     Date: 2013-08-16 23:02:25 GMT
      URL: https://github.com/mono/libgdiplus/commit/969f5c03e9b297ee3ba1b5c42bf5bb920286ab64

Partial implementation of BitBlt from gdi32.dll

Changed paths:
  M src/Makefile.am
Added paths:
  A src/gdi32.c
  A src/gdi32.h

Modified: src/Makefile.am
===================================================================
@@ -27,6 +27,8 @@ libgdiplus_la_SOURCES = \
 	fontcollection-private.h	\
 	fontfamily.h			\
 	fontfamily-private.h		\
+	gdi32.h				\
+	gdi32.c				\
 	GdiPlusFlat.h			\
 	gdiplus-private.h		\
 	gdip.h				\

Added: src/gdi32.c
===================================================================
@@ -0,0 +1,55 @@
+// Authors:
+// Francis Fisher ([email protected])
+//
+// (C) Francis Fisher 2013
+//
+// Permission is hereby granted, free of charge, to any person obtaining
+// a copy of this software and associated documentation files (the
+// "Software"), to deal in the Software without restriction, including
+// without limitation the rights to use, copy, modify, merge, publish,
+// distribute, sublicense, and/or sell copies of the Software, and to
+// permit persons to whom the Software is furnished to do so, subject to
+// the following conditions:
+// 
+// The above copyright notice and this permission notice shall be
+// included in all copies or substantial portions of the Software.
+// 
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+
+
+#include "graphics-private.h"
+#include "graphics-cairo-private.h"
+
+#include <cairo-features.h>
+
+#define	NO_CAIRO_AA
+
+#define MAX_GRAPHICS_STATE_STACK 512
+
+#define SRCCOPY             (DWORD)0x00CC0020
+
+BOOL
+BitBlt (HDC hdcDest, int nXDest, int nYDest, int nWidth, int nHeight, HDC hdcSrc, int nXSrc, int nYSrc, DWORD dwRop)
+{
+	if (dwRop != SRCCOPY)
+		return FALSE;
+	GpGraphics *src = (GpGraphics *) hdcSrc;
+	GpGraphics *dest = (GpGraphics *) hdcDest;
+
+	cairo_t *cr = dest->ct;
+	cairo_surface_t *src_surface = cairo_get_target(src->ct);
+
+	cairo_set_operator(cr, CAIRO_OPERATOR_SOURCE);
+	cairo_set_source_surface (cr, src_surface, nXDest - nXSrc, nYDest - nYSrc);
+	cairo_rectangle (cr, nXDest, nYDest, nWidth, nHeight);
+	cairo_fill (cr);
+
+	return TRUE;
+}
+

Added: src/gdi32.h
===================================================================
@@ -0,0 +1,34 @@
+// Authors:
+// Francis Fisher ([email protected])
+//
+// (C) Francis Fisher 2013
+//
+// Permission is hereby granted, free of charge, to any person obtaining
+// a copy of this software and associated documentation files (the
+// "Software"), to deal in the Software without restriction, including
+// without limitation the rights to use, copy, modify, merge, publish,
+// distribute, sublicense, and/or sell copies of the Software, and to
+// permit persons to whom the Software is furnished to do so, subject to
+// the following conditions:
+// 
+// The above copyright notice and this permission notice shall be
+// included in all copies or substantial portions of the Software.
+// 
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+
+
+#include "graphics-private.h"
+
+#ifndef __GDI32_H__
+#define __GDI32_H__
+
+/* Graphics public API (only!) */
+BitBlt (HDC hdcDest, int nXDest, int nYDest, int nWidth, int nHeight, HDC hdcSrc, int nXSrc, int nYSrc, DWORD dwRop);
+
+#endif

   Commit: ab718ace66292b66f3587da0ee446ae9688a9beb
   Author: Francis Fisher <[email protected]> (wtfrank)
     Date: 2013-08-17 07:24:33 GMT
      URL: https://github.com/mono/libgdiplus/commit/ab718ace66292b66f3587da0ee446ae9688a9beb

tidy code a little

Changed paths:
  M src/gdi32.c
  M src/gdi32.h

Modified: src/gdi32.c
===================================================================
@@ -45,7 +45,7 @@
 	cairo_t *cr = dest->ct;
 	cairo_surface_t *src_surface = cairo_get_target(src->ct);
 
-	cairo_set_operator(cr, CAIRO_OPERATOR_SOURCE);
+	cairo_set_operator (cr, CAIRO_OPERATOR_SOURCE);
 	cairo_set_source_surface (cr, src_surface, nXDest - nXSrc, nYDest - nYSrc);
 	cairo_rectangle (cr, nXDest, nYDest, nWidth, nHeight);
 	cairo_fill (cr);

Modified: src/gdi32.h
===================================================================
@@ -28,7 +28,6 @@
 #ifndef __GDI32_H__
 #define __GDI32_H__
 
-/* Graphics public API (only!) */
 BitBlt (HDC hdcDest, int nXDest, int nYDest, int nWidth, int nHeight, HDC hdcSrc, int nXSrc, int nYSrc, DWORD dwRop);
 
 #endif

   Commit: c50d1f96348b729aa01768b007cad64fb5937be2
   Author: Miguel de Icaza <[email protected]> (migueldeicaza)
     Date: 2013-11-19 14:32:40 GMT
      URL: https://github.com/mono/libgdiplus/commit/c50d1f96348b729aa01768b007cad64fb5937be2

Merge pull request #9 from wtfrank/bitblt

Partial implementation of BitBlt from gdi32.dll

Changed paths:
  M src/Makefile.am
Added paths:
  A src/gdi32.c
  A src/gdi32.h

Modified: src/Makefile.am
===================================================================
@@ -27,6 +27,8 @@ libgdiplus_la_SOURCES = \
 	fontcollection-private.h	\
 	fontfamily.h			\
 	fontfamily-private.h		\
+	gdi32.h				\
+	gdi32.c				\
 	GdiPlusFlat.h			\
 	gdiplus-private.h		\
 	gdip.h				\

Added: src/gdi32.c
===================================================================
@@ -0,0 +1,55 @@
+// Authors:
+// Francis Fisher ([email protected])
+//
+// (C) Francis Fisher 2013
+//
+// Permission is hereby granted, free of charge, to any person obtaining
+// a copy of this software and associated documentation files (the
+// "Software"), to deal in the Software without restriction, including
+// without limitation the rights to use, copy, modify, merge, publish,
+// distribute, sublicense, and/or sell copies of the Software, and to
+// permit persons to whom the Software is furnished to do so, subject to
+// the following conditions:
+// 
+// The above copyright notice and this permission notice shall be
+// included in all copies or substantial portions of the Software.
+// 
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+
+
+#include "graphics-private.h"
+#include "graphics-cairo-private.h"
+
+#include <cairo-features.h>
+
+#define	NO_CAIRO_AA
+
+#define MAX_GRAPHICS_STATE_STACK 512
+
+#define SRCCOPY             (DWORD)0x00CC0020
+
+BOOL
+BitBlt (HDC hdcDest, int nXDest, int nYDest, int nWidth, int nHeight, HDC hdcSrc, int nXSrc, int nYSrc, DWORD dwRop)
+{
+	if (dwRop != SRCCOPY)
+		return FALSE;
+	GpGraphics *src = (GpGraphics *) hdcSrc;
+	GpGraphics *dest = (GpGraphics *) hdcDest;
+
+	cairo_t *cr = dest->ct;
+	cairo_surface_t *src_surface = cairo_get_target(src->ct);
+
+	cairo_set_operator (cr, CAIRO_OPERATOR_SOURCE);
+	cairo_set_source_surface (cr, src_surface, nXDest - nXSrc, nYDest - nYSrc);
+	cairo_rectangle (cr, nXDest, nYDest, nWidth, nHeight);
+	cairo_fill (cr);
+
+	return TRUE;
+}
+

Added: src/gdi32.h
===================================================================
@@ -0,0 +1,33 @@
+// Authors:
+// Francis Fisher ([email protected])
+//
+// (C) Francis Fisher 2013
+//
+// Permission is hereby granted, free of charge, to any person obtaining
+// a copy of this software and associated documentation files (the
+// "Software"), to deal in the Software without restriction, including
+// without limitation the rights to use, copy, modify, merge, publish,
+// distribute, sublicense, and/or sell copies of the Software, and to
+// permit persons to whom the Software is furnished to do so, subject to
+// the following conditions:
+// 
+// The above copyright notice and this permission notice shall be
+// included in all copies or substantial portions of the Software.
+// 
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+
+
+#include "graphics-private.h"
+
+#ifndef __GDI32_H__
+#define __GDI32_H__
+
+BitBlt (HDC hdcDest, int nXDest, int nYDest, int nWidth, int nHeight, HDC hdcSrc, int nXSrc, int nYSrc, DWORD dwRop);
+
+#endif


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