summaryrefslogtreecommitdiff
path: root/sw_canvas.c
AgeCommit message (Collapse)AuthorFilesLines
2012-01-13Remove useless if() before free()Daniel P. Berrange1-3/+1
The free() function allows NULL to be passed in, so any code which puts a if() before free() is wasting time
2012-01-13Death to all TABsDaniel P. Berrange1-8/+8
Source files should all use spaces instead of tabs for indentation. Update the few files not already in compliance
2012-01-13client/common: mingw32: workaround HAVE_STDLIB_H redefined in jconfig.hAlon Levy1-0/+3
2011-05-03add #include <config.h> to all source filesChristophe Fergeau1-0/+3
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
2011-05-03autotools: correctly build canvas-related codeChristophe Fergeau1-0/+4
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.
2011-05-02use foo(void) instead of foo() in prototypesChristophe Fergeau1-1/+1
In C, the latter isn't a prototype for a function with no arg, but declares a function with an undefined number of args.
2011-01-25common/sw_canvas: remove unused error valAlon Levy1-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?)
2010-12-08mingw32 build: fix signed/unsigned warnings as errorsAlon Levy1-2/+2
2010-08-31Fix scaling with large magnificationAlexander Larsson1-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.
2010-08-31Revert "Fix scaling with large magnification"Alexander Larsson1-104/+32
This reverts commit e13be77f33609cb3fdae354ce1f2686ae865f9e0.
2010-08-30Fix scaling with large magnificationAlexander Larsson1-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).
2010-08-27canvas: Better coordinate rounding in scalingAlexander Larsson1-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.
2010-08-18Stride can be negative, so don't use size_t for itAlexander Larsson1-1/+1
2010-07-07Properly parse QXLImage to the new-world SpiceImageGerd Hoffmann1-18/+0
SpiceImage now replaces RedImage and has all image types in it. All image data are now chunked (and as such not copied when demarshalling).
2010-06-21applying zlib compression over glz on WAN connectionYonit Halperin1-0/+6
2010-06-18Client: Use the autogenerated demarshallersAlexander Larsson1-10/+0
When a message has been read from the network we now pass it into the generated demarshaller for the channel. The demarshaller converts the network data to in-memory structures that is passed on to the spice internals. Additionally it also: * Converts endianness * Validates sizes of message and any pointers in it * Localizes offsets (converts them to pointers) * Checks for zero offsets in messages where they are not supported Some of this was previously done using custom code in the client, this is now removed.
2010-06-09JPEG support: introducing jpeg encoding for spice bitmapsYonit Halperin1-0/+6
2010-05-03Remove all mentions of "cairo" from the codeAlexander Larsson1-0/+1332
The command line option is renamed from "cairo" to "sw", and similarly all filenames and types from Cairo to Sw (and similar).