Commit Graph

151 Commits

Author SHA1 Message Date
Alon Levy
e7cf427cb9 common/sw_canvas: remove unused error val
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?)
2011-01-25 17:27:42 +02:00
Alon Levy
7b08afc308 common/canvas_base.c: remove unused variables 2011-01-25 17:23:53 +02:00
Alon Levy
8480f32db5 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
916863202a mingw32 build: various fixes 2010-12-08 17:13:08 +02:00
Alon Levy
ff3fb423ed mingw32 build: fix two functions 2010-12-08 17:13:02 +02:00
Alon Levy
06749bd66b mingw32 build: fix signed/unsigned warnings as errors 2010-12-08 17:11:45 +02:00
Gerd Hoffmann
f6cacd0e51 mingw32 build: fix build errors
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2010-12-08 17:11:45 +02:00
Alexander Larsson
1670b220b5 Initialize variable to avoid compiler warning
Seems the OSX gcc warns on saveRight not being initialzied.
2010-09-29 12:47:15 +02:00
Alexander Larsson
c425ed626c Handle surface images in DrawOpaque 2010-09-22 14:36:40 +02:00
Alexander Larsson
1cd8076415 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
Alexander Larsson
012e54bf9f Fix scaling with large magnification
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-31 13:31:19 +02:00
Alexander Larsson
2e860b5b4a Revert "Fix scaling with large magnification"
This reverts commit e13be77f33.
2010-08-31 13:31:19 +02:00
Alexander Larsson
e13be77f33 Fix scaling with large magnification
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-30 16:56:41 +02:00
Alexander Larsson
9ac9099842 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.
2010-08-27 16:33:35 +02:00
Alexander Larsson
96987ebfde 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.
2010-08-26 09:38:36 +02:00
Alexander Larsson
eb5de022d4 Stride can be negative, so don't use size_t for it 2010-08-18 16:33:20 +02:00
Alexander Larsson
5f664e0ffb Don't send padding over the network with video data 2010-07-20 11:33:57 +02:00
Alexander Larsson
12b08f2c3e 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.
2010-07-19 16:28:22 +02:00
Yonit Halperin
7df548358c canvas_base jpeg_alpha: supply the correct size to jpeg_decoder 2010-07-15 11:50:28 +03:00
Alexander Larsson
05da46115e Add files i forgot to commit 2010-07-09 11:57:09 +02:00
Alexander Larsson
ceff16cad6 Make distcheck work 2010-07-08 20:20:35 +02:00
Alexander Larsson
1a6e77d6d4 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
925f6387c8 Fix sign warnings from win32 compiler 2010-07-08 15:44:39 +02:00
Alexander Larsson
9cc1582561 Fix inclusion of common files, no need for common/ part 2010-07-08 15:44:15 +02:00
Alexander Larsson
10734c8d74 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.
2010-07-08 14:46:04 +02:00
Alexander Larsson
c60c995e60 Make all internal structures not be packed 2010-07-08 14:30:01 +02:00
Alexander Larsson
1d64d39844 Move SpiceChunks to mem.h 2010-07-08 14:17:24 +02:00
Alexander Larsson
0659fb7897 Move in spice/draw.h from spice-protocol to common/ 2010-07-08 13:56:01 +02:00
Alexander Larsson
31d2d6e4e4 Properly parse QXLLineAttrs.style 2010-07-08 12:43:33 +02:00
Gerd Hoffmann
5ac88aa79f 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
ee26a9a773 Add spice_marshaller_add_ref_chunks 2010-07-07 23:10:51 +02:00
Alexander Larsson
a415c55765 Add spice_chunks_* helpers 2010-07-07 23:10:47 +02:00
Alexander Larsson
f39d64f40b Convert SpicePath.segments to a pointer array 2010-07-05 20:45:13 +02:00
Gerd Hoffmann
3764a36472 Properly parse and marshall SpiceString 2010-07-02 16:47:51 +02:00
Alexander Larsson
7e0099e18e Fix build on win32 2010-07-01 16:46:12 +02:00
Alexander Larsson
007d128973 Update for the SpicePath.segments type change 2010-07-01 16:07:02 +02:00
Alexander Larsson
00e1caf45d Simplify SpiceLineAttr by removing unsed stuff
Also in new protocol don't send style data if not needed.
2010-06-30 22:35:17 +02:00
Alexander Larsson
a24a8ff72a 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
Alexander Larsson
0f5a6f57b7 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.
2010-06-30 22:35:17 +02:00
Gerd Hoffmann
f87f63fdf5 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
e81c6ef7c4 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
08cfd6beaf qxl abi: parse QXLOpaque.
Also adapt to tyops fix (s/rop_decriptor/rop_descriptor/).
2010-06-29 12:30:19 +02:00
Gerd Hoffmann
ef3e20e29f qxl abi: parse QXLFill.
Also adapt to tyops fix (s/rop_decriptor/rop_descriptor/).
2010-06-29 12:30:19 +02:00
Alexander Larsson
9655dc30e9 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
Gerd Hoffmann
899a9df0e6 fix use-after-free in spice_marshaller_reset 2010-06-23 13:49:21 +02:00
Yonit Halperin
537280f183 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
25bb38f643 applying zlib compression over glz on WAN connection 2010-06-21 15:05:37 +02:00
Alexander Larsson
ae4436215c Make generated marshallers build on win32 2010-06-18 21:10:25 +02:00
Alexander Larsson
972951dbb7 Make sound data @as_ptr to avoid copying data 2010-06-18 20:27:32 +02:00
Alexander Larsson
4ce4364f84 Make ping data @as_ptr to avoid copying data 2010-06-18 20:27:32 +02:00