[mapserver-commits] r10723 - in sandbox/mapserver6: . mapscript/swiginc

svn at osgeo.org svn at osgeo.org
Sun Nov 14 10:35:06 EST 2010


Author: tamas
Date: 2010-11-14 07:35:06 -0800 (Sun, 14 Nov 2010)
New Revision: 10723

Modified:
   sandbox/mapserver6/mapcairo.c
   sandbox/mapserver6/mapimageio.c
   sandbox/mapserver6/mapoutput.c
   sandbox/mapserver6/mapscript/swiginc/outputformat.i
   sandbox/mapserver6/mapserver.h
Log:
Add Win32 GDI direct rendering support (CAIRO/WINGDI)

Modified: sandbox/mapserver6/mapcairo.c
===================================================================
--- sandbox/mapserver6/mapcairo.c	2010-11-13 18:30:19 UTC (rev 10722)
+++ sandbox/mapserver6/mapcairo.c	2010-11-14 15:35:06 UTC (rev 10723)
@@ -551,6 +551,9 @@
                     _stream_write_fn,
                     r->outputStream,
                     width,height);
+        } else if(!strcasecmp(format->driver,"cairo/winGDI") && format->device) {
+			r->outputStream = NULL;
+            r->surface = cairo_win32_surface_create(format->device);
         }
 		else {
             r->outputStream = NULL;

Modified: sandbox/mapserver6/mapimageio.c
===================================================================
--- sandbox/mapserver6/mapimageio.c	2010-11-13 18:30:19 UTC (rev 10722)
+++ sandbox/mapserver6/mapimageio.c	2010-11-14 15:35:06 UTC (rev 10723)
@@ -805,9 +805,9 @@
 
     ctx = gdNewDynamicCtx (2048, NULL);
 
-    if( format->imagemode == MS_IMAGEMODE_RGBA )
-        gdImageSaveAlpha( ip, 1 );
-    else if( format->imagemode == MS_IMAGEMODE_RGB )
+    if( format->imagemode == MS_IMAGEMODE_RGBA )
+        gdImageSaveAlpha( ip, 1 );
+    else if( format->imagemode == MS_IMAGEMODE_RGB )
         gdImageSaveAlpha( ip, 0 );
     
     if(strcasecmp("ON", msGetOutputFormatOption(format, "INTERLACE", "ON")) == 0)

Modified: sandbox/mapserver6/mapoutput.c
===================================================================
--- sandbox/mapserver6/mapoutput.c	2010-11-13 18:30:19 UTC (rev 10722)
+++ sandbox/mapserver6/mapoutput.c	2010-11-14 15:35:06 UTC (rev 10723)
@@ -216,7 +216,17 @@
         format->extension = strdup("svg");
         format->renderer = MS_RENDER_WITH_CAIRO_SVG;
     }
+#ifdef _WIN32
+    if( strcasecmp(driver,"CAIRO/WINGDI") == 0 )
+    {
+        format = msAllocOutputFormat( map, "cairowinGDI", driver );
+        format->mimetype = strdup("");
+        format->imagemode = MS_IMAGEMODE_RGB;
+        format->extension = strdup("");
+        format->renderer = MS_RENDER_WITH_CAIRO_RASTER;
+    }
 #endif
+#endif
 
 #if defined(USE_OGL) 
     if( strcasecmp(driver,"OGL/PNG") == 0 ) 
@@ -401,6 +411,7 @@
     format->driver = strdup(driver);
     format->refcount = 0;
     format->vtable = NULL;
+    format->device = NULL;
     format->imagemode = MS_IMAGEMODE_PC256;
 
 /* -------------------------------------------------------------------- */

Modified: sandbox/mapserver6/mapscript/swiginc/outputformat.i
===================================================================
--- sandbox/mapserver6/mapscript/swiginc/outputformat.i	2010-11-13 18:30:19 UTC (rev 10722)
+++ sandbox/mapserver6/mapscript/swiginc/outputformat.i	2010-11-14 15:35:06 UTC (rev 10723)
@@ -99,6 +99,11 @@
         return strdup(retval);
     }
     
+    void attachDevice( void *device ) 
+    {
+        self->device = device;
+    }
+    
 }
 
 

Modified: sandbox/mapserver6/mapserver.h
===================================================================
--- sandbox/mapserver6/mapserver.h	2010-11-13 18:30:19 UTC (rev 10722)
+++ sandbox/mapserver6/mapserver.h	2010-11-14 15:35:06 UTC (rev 10723)
@@ -596,7 +596,10 @@
     char **formatoptions;
     int  refcount;
     int inmapfile; /* boolean value for writing */
+#ifndef SWIG
     rendererVTableObj *vtable;
+    void *device; /* for supporting direct rendering onto a device context */
+#endif
 } outputFormatObj;
 
 /* The following is used for "don't care" values in transparent, interlace and



More information about the mapserver-commits mailing list