Commit Graph

138 Commits

Author SHA1 Message Date
Alexander Larsson
b0fe22b6ff canvas: Better coordinate rounding in scaling
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.
2012-03-20 15:25:49 +01:00
Alexander Larsson
6264783c53 server: Fix alloc_lz_image_surface stride allocations
All lz surfaces are not 4 bytes per pixel, calculate the right stride
based on the pixman format.
2012-03-20 15:25:49 +01:00
Alexander Larsson
c74a845198 Stride can be negative, so don't use size_t for it 2012-03-20 15:25:49 +01:00
Alexander Larsson
68d204f649 Don't send padding over the network with video data 2012-03-20 15:25:49 +01:00
Alexander Larsson
bdcfb2c83d codegen: Various cleanups
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.
2012-03-20 15:25:48 +01:00
Yonit Halperin
f43de528fa canvas_base jpeg_alpha: supply the correct size to jpeg_decoder 2012-03-20 15:25:48 +01:00
Alexander Larsson
7c8a4e1ac6 Add files i forgot to commit 2012-03-20 15:25:48 +01:00
Alexander Larsson
1b8f3388b0 Make distcheck work 2012-03-20 15:25:48 +01:00
Alexander Larsson
f6735d7d9f Fix various misspellings
letancy -> latency
compund -> compound
SpicedSubMessage -> SpiceSubMessage
modifaiers -> modifiers
massage -> message
outgoiong -> outgoing
AlphaBlnd -> AlphaBlend
remoth -> remote
modifires -> modifiers
secore -> secure
2012-03-20 15:25:48 +01:00
Alexander Larsson
58d52d5ec7 Fix sign warnings from win32 compiler 2012-03-20 15:25:48 +01:00
Alexander Larsson
24c2e3c85f Fix inclusion of common files, no need for common/ part 2012-03-20 15:25:48 +01:00
Alexander Larsson
fb935fe73b Simplify spice_pixman_region32_init_rects with new types
Don't manually of SpiceRects to pixman_box32_t now that they are compatible
and SpiceRect is internal.
2012-03-20 15:25:48 +01:00
Alexander Larsson
12a734e336 Make all internal structures not be packed 2012-03-20 15:25:48 +01:00
Alexander Larsson
69c1444add Move SpiceChunks to mem.h 2012-03-20 15:25:48 +01:00
Alexander Larsson
c471990a9f Move in spice/draw.h from spice-protocol to common/ 2012-03-20 15:25:48 +01:00
Alexander Larsson
4bcb58cc9f Properly parse QXLLineAttrs.style 2012-03-20 15:25:47 +01:00
Gerd Hoffmann
e37ce72809 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).
2012-03-20 15:25:47 +01:00
Alexander Larsson
cd9b3dac8b Add spice_marshaller_add_ref_chunks 2012-03-20 15:25:47 +01:00
Alexander Larsson
8f568a4073 Add spice_chunks_* helpers 2012-03-20 15:25:47 +01:00
Alexander Larsson
09d9a18702 Convert SpicePath.segments to a pointer array 2012-03-20 15:25:47 +01:00
Gerd Hoffmann
c5d06102b7 Properly parse and marshall SpiceString 2012-03-20 15:25:46 +01:00
Alexander Larsson
dabdea4fac Fix build on win32 2012-03-20 15:25:46 +01:00
Alexander Larsson
f90b89d521 Update for the SpicePath.segments type change 2012-03-20 15:25:46 +01:00
Alexander Larsson
bef8a0cf19 Simplify SpiceLineAttr by removing unsed stuff
Also in new protocol don't send style data if not needed.
2012-03-20 15:25:46 +01:00
Alexander Larsson
e6eb19e752 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
2012-03-20 15:25:46 +01:00
Alexander Larsson
93405abac7 Add spice_marshaller_set_uint32
With this function you can update an added uint32 after it being added.
To make this possible all the spice_marshaller_add_add_foo functions
now return a pointer that can be used as a reference when later
setting a value.
2012-03-20 15:25:46 +01:00
Gerd Hoffmann
51c71e6883 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.
2012-03-20 15:25:46 +01:00
Gerd Hoffmann
908c841563 qxl abi: parse QXLCopy + QXLBlend.
Also adapt to tyops fix (s/rop_decriptor/rop_descriptor/).
2012-03-20 15:25:46 +01:00
Gerd Hoffmann
6ba331f45e qxl abi: parse QXLOpaque.
Also adapt to tyops fix (s/rop_decriptor/rop_descriptor/).
2012-03-20 15:25:45 +01:00
Gerd Hoffmann
bc1c2837f3 qxl abi: parse QXLFill.
Also adapt to tyops fix (s/rop_decriptor/rop_descriptor/).
2012-03-20 15:25:45 +01:00
Alexander Larsson
90193bf160 Remove support for clip by path
This is not supported currently anyway and was not generated before.
2012-03-20 15:25:45 +01:00
Gerd Hoffmann
d217864737 fix use-after-free in spice_marshaller_reset 2012-03-20 15:25:45 +01:00
Yonit Halperin
9c906e0c2f Lossy compression of RGBA images (on WAN connection)
The RGB channels are compressed using JPEG.
The alpha channel is compressed using LZ.
2012-03-20 15:25:44 +01:00
Yonit Halperin
e48d14df78 applying zlib compression over glz on WAN connection 2012-03-20 15:25:44 +01:00
Alexander Larsson
075087b180 Make generated marshallers build on win32 2012-03-20 15:25:44 +01:00
Alexander Larsson
08d94f60b1 Make sound data @as_ptr to avoid copying data 2012-03-20 15:25:44 +01:00
Alexander Larsson
ebd34a4291 Make ping data @as_ptr to avoid copying data 2012-03-20 15:25:44 +01:00
Alexander Larsson
101ceba717 Make cursor data @as_ptr to avoid copying data 2012-03-20 15:25:44 +01:00
Alexander Larsson
cc71d4989b Make pointer types in messages be 64bit in memory
Right now we always assume pointers are stored as SPICE_ADDRESS,
i.e. 64bit, independent on the size sent on the network.
This is required for 64bit architectures of course, but slightly overkill
on 32bit architectures, so needs fixing when all SPICE_ADDRESS elements
can be made internal.
2012-03-20 15:25:44 +01:00
Alexander Larsson
6ebdf56797 Don't pack the message structures 2012-03-20 15:25:44 +01:00
Alexander Larsson
c09f1ef5be Make all message structs internal to spice
We move all message structs from spice-protocol to spice as
we want to be able to change these as needed internally. The
on-network format is no longer defined by these structures anyway,
but rather by the spice protocol description.
2012-03-20 15:25:43 +01:00
Alexander Larsson
d6a4cad947 Add SpiceMarshaller for easy marshalling 2012-03-20 15:25:43 +01:00
Alexander Larsson
3645036d7e 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.
2012-03-20 15:25:43 +01:00
Alexander Larsson
7e8a81f49f There are multiple line attribute flags enums, use only one 2012-03-20 15:25:43 +01:00
Alexander Larsson
d4361e12d0 Add spice_strnlen 2012-03-20 15:25:43 +01:00
Yonit Halperin
f3d77c3e84 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
2012-03-20 15:25:43 +01:00
Yonit Halperin
19bca5b373 JPEG support: introducing jpeg encoding for spice bitmaps 2012-03-20 15:25:43 +01:00
Alexander Larsson
41171d081d Fix spelling errors in comments and strings 2012-03-20 15:25:42 +01:00
Alexander Larsson
4640fbccf6 Use the new byteswap macros from spice-protocol 2012-03-20 15:25:42 +01:00
Gerd Hoffmann
1c4cfe3022 Add C version of find_msb()
This patch allows people to build the spice-client on any 32bit/64bit
architecture.

by Bryan Stillwell <bryan@bokeoa.com>
2012-03-20 15:25:42 +01:00