Commit Graph

159 Commits

Author SHA1 Message Date
Christophe Fergeau
9a715c8b95 common: add missing header guards to gl_canvas.h 2011-05-02 11:24:44 +02:00
Christophe Fergeau
531d5bdf52 common: add extern "C" guards to headers
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.
2011-05-02 11:24:44 +02:00
Christophe Fergeau
b41ad89024 draw: remove SPICE_ADDRESS
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
2011-04-18 12:55:37 +02:00
Christophe Fergeau
c80c42008c common/pixman: remove dead assignments
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.
2011-04-08 12:14:19 +02:00
Christophe Fergeau
a33cb671c7 common/gl: remove unused variable
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.
2011-03-23 11:26:33 +01:00
Alon Levy
6ee99d330f ring: add RING_FOREACH{,_SAFE,_REVERSED} 2011-03-02 17:27:52 +02:00
Alon Levy
db6835f616 server/common: introduce common/spice_common.h
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).
2011-03-02 17:27:51 +02:00
Marc-André Lureau
597767d983 common: add SpiceBuffer - based on qemu-vnc Buffer
https://bugs.freedesktop.org/show_bug.cgi?id=34795
2011-02-28 16:36:35 +01:00
Alon Levy
29cc055be8 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
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
f359b264ae mingw32 build: various fixes 2010-12-08 17:13:08 +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
Gerd Hoffmann
074555bcf3 mingw32 build: fix build errors
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2010-12-08 17:11:45 +02:00
Alexander Larsson
53c4477379 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
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
Alexander Larsson
e598e2f55f 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
86ab1abb3a Revert "Fix scaling with large magnification"
This reverts commit e13be77f33609cb3fdae354ce1f2686ae865f9e0.
2010-08-31 13:31:19 +02:00
Alexander Larsson
f9690982a8 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
37ac00ae64 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
698d0e471a 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
f912ffbc2a Stride can be negative, so don't use size_t for it 2010-08-18 16:33:20 +02:00
Alexander Larsson
5fad948a0b Don't send padding over the network with video data 2010-07-20 11:33:57 +02:00
Alexander Larsson
11a3ec34a7 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
6e4cd5f636 canvas_base jpeg_alpha: supply the correct size to jpeg_decoder 2010-07-15 11:50:28 +03:00
Alexander Larsson
5858552f62 Add files i forgot to commit 2010-07-09 11:57:09 +02:00
Alexander Larsson
6473932345 Make distcheck work 2010-07-08 20:20:35 +02: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
1989b09a5e Fix sign warnings from win32 compiler 2010-07-08 15:44:39 +02:00
Alexander Larsson
405a1f71ca Fix inclusion of common files, no need for common/ part 2010-07-08 15:44:15 +02:00
Alexander Larsson
14ceecd4e2 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
23f0b3d5b2 Make all internal structures not be packed 2010-07-08 14:30:01 +02:00
Alexander Larsson
74c767fd26 Move SpiceChunks to mem.h 2010-07-08 14:17:24 +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
c226eb0300 Add spice_marshaller_add_ref_chunks 2010-07-07 23:10:51 +02:00
Alexander Larsson
23ace37e71 Add spice_chunks_* helpers 2010-07-07 23:10:47 +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
bb63090839 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
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
Alexander Larsson
efe133f71d 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
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