Commit Graph

73 Commits

Author SHA1 Message Date
Daniel P. Berrange
3e50b41dc2 Remove trailing whitespace from end of lines 2012-01-13 18:11:59 +02:00
Daniel P. Berrange
c64594fca3 Remove useless if() before free()
The free() function allows NULL to be passed in, so any
code which puts a if() before free() is wasting time
2012-01-13 18:11:58 +02:00
Christophe Fergeau
875520739d common: use PANIC from spice_common.h 2011-05-03 14:44:11 +02:00
Christophe Fergeau
bb00047691 common,server: use ASSERT from spice_common.h
spice_common.h provides an ASSERT macro, no need to duplicate it
in many places. For now client/debug.h keeps its own copy since
debug.h and spice_common.h have clashes on other macros which are
trickier to unify.
2011-05-03 14:44:11 +02:00
Christophe Fergeau
da4b2715cc add #include <config.h> to all source files
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-03 14:44:10 +02:00
Christophe Fergeau
aa2b615cd8 autotools: correctly build canvas-related code
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-03 14:44:10 +02:00
Christophe Fergeau
9e8df89d01 common: don't try to redefine PANIC if it already exists
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.
2011-05-02 11:24:44 +02:00
Alon Levy
f0ee64c690 common/canvas_base.c: remove unused variables 2011-01-25 17:23:53 +02:00
Alon Levy
cfc2da5bae common, canvas_get_jpeg_alpha: let top_down be any value
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).
2011-01-05 15:31:46 +02:00
Alon Levy
abdf4ad91c mingw32 build: fix two functions 2010-12-08 17:13:02 +02:00
Alon Levy
4889f11190 mingw32 build: fix signed/unsigned warnings as errors 2010-12-08 17:11:45 +02:00
Alexander Larsson
24ab5a2bcb Handle surface images in DrawOpaque 2010-09-22 14:36:40 +02:00
Alexander Larsson
b80bc0704f Fix crash when resetting pixman image transform
Resetting the transform is done by setting it to the identity
transform, not passing in NULL. Passing in NULL causes a crash.
2010-09-21 20:08:46 +02:00
Yonit Halperin
6e4cd5f636 canvas_base jpeg_alpha: supply the correct size to jpeg_decoder 2010-07-15 11:50:28 +03:00
Alexander Larsson
a85b48594d Fix various misspellings
letancy -> latency
compund -> compound
SpicedSubMessage -> SpiceSubMessage
modifaiers -> modifiers
massage -> message
outgoiong -> outgoing
AlphaBlnd -> AlphaBlend
remoth -> remote
modifires -> modifiers
secore -> secure
2010-07-08 18:26:37 +02:00
Alexander Larsson
d1ed338483 Move in spice/draw.h from spice-protocol to common/ 2010-07-08 13:56:01 +02:00
Alexander Larsson
2b5fe8c7ac Properly parse QXLLineAttrs.style 2010-07-08 12:43:33 +02:00
Gerd Hoffmann
052c9bbbbf Properly parse QXLImage to the new-world SpiceImage
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-07-07 23:58:33 +02:00
Alexander Larsson
f564229a7f Convert SpicePath.segments to a pointer array 2010-07-05 20:45:13 +02:00
Gerd Hoffmann
1d0b18b5a3 Properly parse and marshall SpiceString 2010-07-02 16:47:51 +02:00
Alexander Larsson
b2c043c809 Fix build on win32 2010-07-01 16:46:12 +02:00
Alexander Larsson
132c9588d6 Update for the SpicePath.segments type change 2010-07-01 16:07:02 +02:00
Alexander Larsson
03a0b6741a Store SpicePath segment count rather than size
Internally and in the network protocol (for the new version) we
now store the actual number of segments rather than the size of the
full segments array in bytes. This change consists of multiple changes
to handle this:

* Make the qxl parser calculate num_segments
* Make the canvas stroke code handle the new SpicePath layout.
* Fix up is_equal_path in red_worker.c for the new layout
* replace multiple calls to spice_marshall_PathSegment with a single
  spice_marshall_Path call
* Make the byte_size() array size handling do the conversion from
  network size to number of elements when marshalling/demarshalling.
* Update the current spice protocol to send the segment count rather than
  the size
* Update the old spice protocol to use the new byte_size functionallity
  to calculate the size sent and the number of elements recieved
2010-06-30 22:35:17 +02:00
Gerd Hoffmann
9fcd7fa957 qxl-abi: handle clip rect and path references.
red_parse_qxl.c starts to follow QXLPHYSICAL references and build up
data structures.  Can zap a bunch of get_virt calls in red_worker.c,
followed by cleanups.

(de-) marshaller needs updates to deal with that.  Also I suspect with
the get_virt() calls being gone we can offload more work to generated
marshaller code.

client doesn't build.
2010-06-30 22:34:57 +02:00
Gerd Hoffmann
06c46357e5 qxl abi: parse QXLCopy + QXLBlend.
Also adapt to tyops fix (s/rop_decriptor/rop_descriptor/).
2010-06-29 12:30:20 +02:00
Gerd Hoffmann
3f12ce3c2b qxl abi: parse QXLOpaque.
Also adapt to tyops fix (s/rop_decriptor/rop_descriptor/).
2010-06-29 12:30:19 +02:00
Gerd Hoffmann
f2c7cb4122 qxl abi: parse QXLFill.
Also adapt to tyops fix (s/rop_decriptor/rop_descriptor/).
2010-06-29 12:30:19 +02:00
Alexander Larsson
831fb361fd Remove support for clip by path
This is not supported currently anyway and was not generated before.
2010-06-24 14:30:00 +02:00
Yonit Halperin
5ef5742843 Lossy compression of RGBA images (on WAN connection)
The RGB channels are compressed using JPEG.
The alpha channel is compressed using LZ.
2010-06-21 15:18:26 +02:00
Yonit Halperin
fec5354016 applying zlib compression over glz on WAN connection 2010-06-21 15:05:37 +02:00
Alexander Larsson
9c5bef32b6 Client: Use the autogenerated demarshallers
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-18 16:32:11 +02:00
Yonit Halperin
a23bf0c0d5 support for lossy images in the pixmap cache and fill bits
1) add an option to determine if a bitmap can be sent lossy to the client
2) when required, replacing lossy cache items with their correspending
   lossless bitmaps
2010-06-09 11:41:01 +02:00
Yonit Halperin
93fdeaa7e1 JPEG support: introducing jpeg encoding for spice bitmaps 2010-06-09 11:40:25 +02:00
Alexander Larsson
0261d7d689 Fix spelling errors in comments and strings 2010-05-21 10:51:28 +02:00
Alexander Larsson
e4501caa6e Remove all mentions of "cairo" from the code
The command line option is renamed from "cairo" to "sw", and
similarly all filenames and types from Cairo to Sw (and similar).
2010-05-03 12:38:02 +02:00
Alexander Larsson
2bb0187ad8 Add support for SPICE_IMAGE_FLAGS_HIGH_BITS_SET 2010-04-28 15:43:41 +02:00
Gerd Hoffmann
a0b1c5171e fix two warnings 2010-04-26 14:01:37 +02:00
Alexander Larsson
39969cea2f Support alpha surface sources and destinations 2010-04-23 16:41:47 +02:00
Alexander Larsson
c9a827ffd1 Localize palettes for LZ PLT format
This is needed since they always decode to 32bit mode.
2010-04-23 16:41:47 +02:00
Alexander Larsson
afea49d3c5 Make each surface its own depth/format
Surface creation now specifies the exact format, not only the bit depth
of each surface which is used for rendering.

Additionally we now actually store the surfaces in that format, instead
of converting everything to 32bpp when drawing or e.g. handling palettes.
2010-04-23 16:41:42 +02:00
Alexander Larsson
5a76ba473b Make client canvas and pixmaps handle more formats and simplify
We now support 16bit format pixmaps as well as the old ones. Including
both 555 and 565 modes.

We drop the palette argument for pixmap construction as it was only
used for black/white anyway.

Canvas creation is simplified so that there is no separate set_mode
state. Canvases are already created in the right mode and never change.
2010-04-23 16:36:35 +02:00
Alexander Larsson
d25af8ab19 Remove unused method canvas_surf_to_invers 2010-04-23 16:36:31 +02:00
Alexander Larsson
8974315747 Relicense everything from GPL to LGPL 2.1+ 2010-04-13 22:22:15 +02:00
Izik Eidus
519e8dcd55 libspice: add off screens support
Signed-off-by: Izik Eidus <ieidus@redhat.com>
2010-04-03 05:35:31 +03:00
Alexander Larsson
3e6a25dc7c Fix uninitilized memory read in stroke_fill_spans()
y2 was not initialized
2010-03-18 10:40:18 +01:00
Alexander Larsson
b83f707c7a Use nearest scaling for DRAW_ALPHA_BLEND since this is what win32 needs
DrvAlphaBlend is the only current user of DRAW_ALPHA_BLEND, and its
defined to do nearest (COLORONCOLOR) scaling, not bilinear.
2010-03-17 20:08:59 +01:00
Alexander Larsson
6b599f4147 Fix up empty region checks in canvas operations
We rely on not passing on empty rects to the drawing operations by
checking for empty regions and exiting early. However the checks
were wrongly using pixman_region32_n_rects(region) == 0, whereas
we should be using pixman_region32_not_empty().
2010-03-17 10:06:40 +01:00
Alexander Larsson
021f0514e4 Use the spice allocator in common/ 2010-03-11 12:14:08 +01:00
Alexander Larsson
3fbcfc1185 Use macros from <spice/macros.h> rather than duplicate them 2010-03-09 11:10:00 +01:00
Alexander Larsson
fe0e853cb7 Move draw_rop3 to canvas_base 2010-03-08 19:45:28 +01:00