summaryrefslogtreecommitdiffstats
path: root/common
Commit message (Collapse)AuthorAgeFilesLines
...
* add #include <config.h> to all source filesChristophe Fergeau2011-05-0320-5/+63
| | | | | | | | When using config.h, it must be the very first include in all source files since it contains #define that may change the compilation process (eg libc structure layout changes when it's used to enable large file support on 32 bit x86 archs). This commit adds it at the beginning of all .c and .cpp files
* autotools: correctly build canvas-related codeChristophe Fergeau2011-05-039-14/+39
| | | | | | | | | | | | | | | | | | | | | spice client and spice server shares code from common/{gdi,gl,sw}_canvas.[ch]. However, while most of the code is shared, the server code wants a canvas compiled with SW_CANVAS_IMAGE_CACHE defined while the client code wants a canvas compiled with SW_CANVAS_CACHE. The initial autotools refactoring didn't take that into account, this is now fixed by this commit. After this commit, the canvas files from common/ are no longer compiled as part of the libspice-common.la convenience library. Instead, there are "proxy" canvas source files in client/ and server/ which #include the appropriate C files after defining the relevant #define for the binary that is being built. To prevent misuse of the canvas c files and headers in common/, SPICE_CANVAS_INTERNAL must be set when including the canvas headers from common/ or when building the c files from common/ otherwise the build will error out.
* autotools: refactor the whole build machineryChristophe Fergeau2011-05-031-31/+56
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | spice Makefile.am setup is a bit confusing, with source file names being listed several times in different Makefile.am (generally, once in EXTRA_DIST and another time in another Makefile.am in _SOURCES). The client binaries are built by client/x11/Makefile.am, which means recursing into client, then into x11 to finally build spicec. This Makefile.am is also referencing files from common/ and client/, which is a bit unusual with autotools. This patch attempts to simplify the build process to get something more usual from an autotools point of view. The source from common/ are compiled into a libtool convenience library, which the server and the client links against which avoids referencing source files from common/ when building the server and the client. The client is built in client/Makefile.am and directly builds files from x11/ windows/ and gui/ if needed (without recursing in these subdirectories). This makes the build simpler to understand, and also makes it possible to list source files once, which avoids potential make distcheck breakage when adding new files. There is a regression in this patch with respect to sw_canvas/gl_canvas/gdi_canvas. They should be built with different preprocessor #defines resulting in different behaviour of the canvas for the client and the server. However, this is not currently the case, both the client and the server will use the same code for now (which probably means one of them is broken). This will be fixed in a subsequent commit. make distcheck passes, but compilation on windows using the autotools build system hasn't been tested, which means it's likely to be broken. It shouldn't be too hard ot fix it though, just let me know of any issues with this.
* common: don't try to redefine PANIC if it already existsChristophe Fergeau2011-05-021-0/+2
| | | | | | | | | | canvas_base.c tries to define PANIC, but it might already be set if eg client/debug.h has been included before. All the other macros in this file are guarded by #ifndef, this commit adds the missing #ifndef to PANIC. Note that this is just a bandaid, ideally common/ would contain a logging frameword, and these macros would only be defined once instead of being defined in several places.
* use foo(void) instead of foo() in prototypesChristophe Fergeau2011-05-0211-11/+11
| | | | | In C, the latter isn't a prototype for a function with no arg, but declares a function with an undefined number of args.
* common: add missing header guards to gl_canvas.hChristophe Fergeau2011-05-021-0/+5
|
* common: add extern "C" guards to headersChristophe Fergeau2011-05-0223-2/+182
| | | | | | Since some spice C++ code is using code from common/, the C functions need to be marked as such for the C++ compiler, otherwise we'll get linkage issues.
* draw: remove SPICE_ADDRESSChristophe Fergeau2011-04-181-1/+0
| | | | | | This commit removes the typedef for SPICE_ADDRESS which was no longer used. This is the last thing that was missing to close fdo bug #28984
* common/pixman: remove dead assignmentsChristophe Fergeau2011-04-081-7/+3
| | | | | | They were detected using clang-static-analyzer. Don't initialize the variable to a value to override it with a different value a few lines after.
* common/gl: remove unused variableChristophe Fergeau2011-03-231-3/+2
| | | | | | | clang static analyzer warned that 'len' was computed but never used in glc_vertex2d. glc_stroke_line_dash has side effects so we have to call it, but we don't need to save its return value since it's not used.
* ring: add RING_FOREACH{,_SAFE,_REVERSED}Alon Levy2011-03-021-0/+21
|
* server/common: introduce common/spice_common.hAlon Levy2011-03-021-0/+70
| | | | | | move all the ASSERT/PANIC/PANIC_ON/red_error/red_printf* macros to a common file to be used with ring.h that is going to be used externally (by spice-gtk).
* common: add SpiceBuffer - based on qemu-vnc BufferMarc-André Lureau2011-02-282-0/+70
| | | | https://bugs.freedesktop.org/show_bug.cgi?id=34795
* common/sw_canvas: remove unused error valAlon Levy2011-01-251-2/+1
| | | | | | | | | | | This is the only unused var change I'll want to revisit eventually, I'm submitting anyway since it doesn't change current behavior. I'm talking about ignoring the return value from canvas creation. Adding a print is possible but I didn't test (may be too verbose, also preferable to be a debug print if so, and we don't have that option in the code atm - probably an environment variable will do, or adding some spice_server_set_logging_level api, maybe even spice_server_set_logging_fd?)
* common/canvas_base.c: remove unused variablesAlon Levy2011-01-251-12/+0
|
* common, canvas_get_jpeg_alpha: let top_down be any valueAlon Levy2011-01-051-1/+1
| | | | | | | Allow top_down flag to have any value, only ASSERT it is positive when needs to be positive and zero otherwise. Allows older server bug of sending 4 instead of 1 in top down flag to not affect newer clients (previous patch fixes server).
* mingw32 build: various fixesAlon Levy2010-12-081-2/+2
|
* mingw32 build: fix two functionsAlon Levy2010-12-081-1/+1
|
* mingw32 build: fix signed/unsigned warnings as errorsAlon Levy2010-12-083-7/+7
|
* mingw32 build: fix build errorsGerd Hoffmann2010-12-081-2/+2
| | | | Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
* Initialize variable to avoid compiler warningAlexander Larsson2010-09-291-1/+1
| | | | Seems the OSX gcc warns on saveRight not being initialzied.
* Handle surface images in DrawOpaqueAlexander Larsson2010-09-221-19/+42
|
* Fix crash when resetting pixman image transformAlexander Larsson2010-09-211-1/+2
| | | | | Resetting the transform is done by setting it to the identity transform, not passing in NULL. Passing in NULL causes a crash.
* Fix scaling with large magnificationAlexander Larsson2010-08-311-20/+16
| | | | | | | | | | | | | | When scaling part of an image we need to specify the source coordinates in transformed coordinates. For large magnifications this means we will get pretty large values. Now, if e.g. src_x * transform is larger than 32765, then the coordinate ends up outside the pixman 16bit image size, so the rendering will not work. The fix is to make the src_x/y offset part of the transformation. This means its automatically transformed by the correct scaling, and the coordinates passed into pixman are not (typically) over 16bit.
* Revert "Fix scaling with large magnification"Alexander Larsson2010-08-311-104/+32
| | | | This reverts commit e13be77f33609cb3fdae354ce1f2686ae865f9e0.
* Fix scaling with large magnificationAlexander Larsson2010-08-301-32/+104
| | | | | | | | | | | | | | When scaling part of an image we need to specify the source coordinates in transformed coordinates. For large magnifications this means we will get pretty large values. Now, if e.g. src_x * transform is larger than 32765, then the coordinate ends up outside the pixman 16bit image size, so the rendering will not work. In order to work around this we generate a "sub-image" of the pixman image such that the src_x/y values we have to specify are zero (or near zero).
* canvas: Better coordinate rounding in scalingAlexander Larsson2010-08-271-28/+36
| | | | | | | | | | | | | When scaling in pixman you give the source coordinates in transformed space rather than in the source coordinates. This is a bit problematic when both source and destination coordinates are at integer positions, but the scaling factor is not an exact 16.16 fixed point value. We used to calculate the transformed source based on the floating point transformation, which gave the wrong answer sometimes. Now we do the calculations based on the fixed point transform that we give pixman. However, even with this patch I can still sometimes see issues related to this, although they are less bad.
* server: Fix alloc_lz_image_surface stride allocationsAlexander Larsson2010-08-261-1/+1
| | | | | All lz surfaces are not 4 bytes per pixel, calculate the right stride based on the pixman format.
* Stride can be negative, so don't use size_t for itAlexander Larsson2010-08-182-2/+2
|
* Don't send padding over the network with video dataAlexander Larsson2010-07-201-1/+0
|
* codegen: Various cleanupsAlexander Larsson2010-07-191-11/+12
| | | | | | | | | | | | Remove all uses of @end in the marshaller, instead just using the C struct array-at-end-of-struct. To make this work we also remove all use of @end for switches (making them C unions). We drop the zero member of the notify message so that we can avoid this use of @end for a primitive in the marshaller (plus its useless to send over the wire). We change the offsets and stuff in the migration messages to real pointers.
* canvas_base jpeg_alpha: supply the correct size to jpeg_decoderYonit Halperin2010-07-151-1/+1
|
* Add files i forgot to commitAlexander Larsson2010-07-092-0/+15
|
* Make distcheck workAlexander Larsson2010-07-082-8/+8
|
* Fix various misspellingsAlexander Larsson2010-07-086-7/+7
| | | | | | | | | | | | | letancy -> latency compund -> compound SpicedSubMessage -> SpiceSubMessage modifaiers -> modifiers massage -> message outgoiong -> outgoing AlphaBlnd -> AlphaBlend remoth -> remote modifires -> modifiers secore -> secure
* Fix sign warnings from win32 compilerAlexander Larsson2010-07-082-3/+3
|
* Fix inclusion of common files, no need for common/ partAlexander Larsson2010-07-0811-11/+11
|
* Simplify spice_pixman_region32_init_rects with new typesAlexander Larsson2010-07-081-28/+2
| | | | | Don't manually of SpiceRects to pixman_box32_t now that they are compatible and SpiceRect is internal.
* Make all internal structures not be packedAlexander Larsson2010-07-081-37/+33
|
* Move SpiceChunks to mem.hAlexander Larsson2010-07-083-19/+19
|
* Move in spice/draw.h from spice-protocol to common/Alexander Larsson2010-07-0815-13/+305
|
* Properly parse QXLLineAttrs.styleAlexander Larsson2010-07-082-3/+2
|
* Properly parse QXLImage to the new-world SpiceImageGerd Hoffmann2010-07-076-219/+92
| | | | | SpiceImage now replaces RedImage and has all image types in it. All image data are now chunked (and as such not copied when demarshalling).
* Add spice_marshaller_add_ref_chunksAlexander Larsson2010-07-072-0/+12
|
* Add spice_chunks_* helpersAlexander Larsson2010-07-072-0/+64
|
* Convert SpicePath.segments to a pointer arrayAlexander Larsson2010-07-053-27/+19
|
* Properly parse and marshall SpiceStringGerd Hoffmann2010-07-021-19/+4
|
* Fix build on win32Alexander Larsson2010-07-012-20/+20
|
* Update for the SpicePath.segments type changeAlexander Larsson2010-07-013-3/+3
|
* Simplify SpiceLineAttr by removing unsed stuffAlexander Larsson2010-06-302-42/+5
| | | | Also in new protocol don't send style data if not needed.