Commit Graph

102 Commits

Author SHA1 Message Date
Alexander Larsson
8065944cdb Add @nomarshal in a few places where we're marshalling manually 2012-03-20 15:25:43 +01:00
Alexander Larsson
ac49057d02 spice.proto: add @outvar markup
With this we can reference pointer member with no naming conflicts
2012-03-20 15:25:43 +01:00
Alexander Larsson
e83ff054d7 Add support for generating message and structure marshallers 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
e9b33a194e Add python code to automake system 2012-03-20 15:25:43 +01:00
Alexander Larsson
522dc931e8 Initial import of spice protocol description and demarshall generator
The "spice.proto" file describes in detail the networking prototcol
that spice uses and spice_codegen.py can parse this and generate
demarshallers for such network messages.
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
Alexander Larsson
f816707671 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).
2012-03-20 15:25:42 +01:00
Alexander Larsson
4d086a580d win32 client: Remove unnecessary GDIImage type
We just use pixman_image_t as the "information about image data" structure.
2012-03-20 15:25:42 +01:00
Alexander Larsson
af81d10188 Add support for SPICE_IMAGE_FLAGS_HIGH_BITS_SET 2012-03-20 15:25:42 +01:00
Alexander Larsson
9d2e9eb190 Clear alpha in xRGB destination to avoid pixman setting it to 0xff
Pixman sometimes sets the ignored high byte to 0xff during alpha
blending. This is correct according to pixman specs, as the high
byte is ignored. However its not what windows expects, and it causes
unnecessary regions with non-zero high byte, causing us to
send rgba data instead of rgb which compresses worse.

So, we detect this and clear the high byte.
2012-03-20 15:25:42 +01:00
Alexander Larsson
b8da4097b1 Fix line lengths and tabs 2012-03-20 15:25:42 +01:00
Gerd Hoffmann
3579157721 fix two warnings 2012-03-20 15:25:42 +01:00
Alexander Larsson
7cd708c510 Remove surface format workaround now that win32 driver is fixed
The win32 driver makes all 32bit surfaces be xRGB now, so we
can remove this old workaround.
2012-03-20 15:25:42 +01:00
Alexander Larsson
d6bb2568f0 Win32 canvas fixes 2012-03-20 15:25:42 +01:00
Alexander Larsson
7337872098 Support alpha surface sources and destinations 2012-03-20 15:25:42 +01:00
Alexander Larsson
419dcf949c Localize palettes for LZ PLT format
This is needed since they always decode to 32bit mode.
2012-03-20 15:25:42 +01:00
Alexander Larsson
f5508e3c23 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.
2012-03-20 15:25:42 +01:00
Alexander Larsson
5fc47f848c 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.
2012-03-20 15:25:42 +01:00
Alexander Larsson
fbcc890794 common: Add lookaside storage for pixman image format
Ideally we should just read this from the pixman image, but
there is no API to do so in stable pixman, so we store it.
2012-03-20 15:25:41 +01:00
Alexander Larsson
eb14443bf2 Add pixman utilities for bitmap to pixman_image_t conversion 2012-03-20 15:25:41 +01:00
Alexander Larsson
f8ca7a37f6 Add support for 16bit rop3 2012-03-20 15:25:41 +01:00
Alexander Larsson
76ba080d8b Remove unused method canvas_surf_to_invers 2012-03-20 15:25:41 +01:00
Alexander Larsson
61fdf6bf0d Fix warnings breaking win32 build 2012-03-20 15:25:41 +01:00
Izik Eidus
b080f39fd1 spice: server: change update_area command
The new command return dirty area to be used
by users that want spice to render localy or
into some framebuffer (sdl / vnc)

Signed-off-by: Izik Eidus <ieidus@redhat.com>
2012-03-20 15:25:41 +01:00
Alexander Larsson
92e30df45c Relicense everything from GPL to LGPL 2.1+ 2012-03-20 15:25:41 +01:00
Alexander Larsson
ff34dbe28c Fix win32 build with pixman 0.18.0 2012-03-20 15:25:41 +01:00
Izik Eidus
8eff6d6921 fix 16bpp support on cairo_canvas
Signed-off-by: Izik Eidus <ieidus@redhat.com>
2012-03-20 15:25:41 +01:00
Alexander Larsson
f97d483281 Always tread depth 24 (i.e. non alpha) as depth 32 when blitting
When blitting we don't really care about alpha mismatches, we just copy bits
anyway.
2012-03-20 15:25:41 +01:00
Izik Eidus
8b6acdea07 spice: win32 client: fix gdi locking
While the fix could have been more effective,
it seems like this patch stream better with the coding
logic that was there..., maybe later we will want to change
the locking into more effective way.

(There is just the primary surface to protect in reiality)

Signed-off-by: Izik Eidus <ieidus@redhat.com>
2012-03-20 15:25:41 +01:00
Alexander Larsson
2f0bc9d38e Initialize _kill_mark so we don't get spurious valgrind warnings 2012-03-20 15:25:41 +01:00
Alexander Larsson
093e660191 Remove non-used lookup3.[ch] 2012-03-20 15:25:41 +01:00
Izik Eidus
c442c54c51 spice: common: gdi_canvas fix gdi objects leak
BitmapMask was used by the draw_text function as well
therefore we need to mark from_surface = 0 if we want
it to release the boject...

(Was evil, took me few hours to understand from where
 the leak come...)

Signed-off-by: Izik Eidus <ieidus@redhat.com>
2012-03-20 15:25:41 +01:00
Izik Eidus
e66440d563 libspice: add off screens support
Signed-off-by: Izik Eidus <ieidus@redhat.com>
2012-03-20 15:25:40 +01:00
Alexander Larsson
998bf873bf Add spice_strndup
Also, make str(n)dup handle NULL correctly
2012-03-20 15:25:40 +01:00
Alexander Larsson
a12f3fe242 Fix uninitilized memory read in stroke_fill_spans()
y2 was not initialized
2012-03-20 15:25:40 +01:00
Alexander Larsson
4594833a1b 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.
2012-03-20 15:25:40 +01:00
Alexander Larsson
7bf964b567 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().
2012-03-20 15:25:40 +01:00
Alexander Larsson
7653380e7e Use the spice allocator in common/ 2012-03-20 15:25:40 +01:00
Alexander Larsson
59b330b4d2 New memory allocators that exit on OOM and handle multiplication overflow
Every place that does a regular malloc/calloc and aborts on failure
should use spice_malloc/spice_mallo0 instead, which is leaner and cleaner.

Allocations of dynamically sized arrays can use g_malloc_n or g_new etc
which correctly handle multiplication overflow if some of the arguments
are not trusted.
2012-03-20 15:25:40 +01:00
Alexander Larsson
1327d81492 Define GL_GLEXT_PROTOTYPES in CFLAGS not in random places in the source 2012-03-20 15:25:40 +01:00
Alexander Larsson
a537adc621 Update gdi canvas wrt latest changes
ALIGN -> SPICE_ALIGN
2012-03-20 15:25:40 +01:00
Alexander Larsson
29b01c2c16 Use macros from <spice/macros.h> rather than duplicate them 2012-03-20 15:25:40 +01:00