Commit Graph

111 Commits

Author SHA1 Message Date
Alexander Larsson
5c2d9a3e32 Add RedDrawable::Format get_format()
This is useful because we can e.g. create pixmaps in the same format as
a window.
2010-04-23 16:36:35 +02:00
Alexander Larsson
cfa250caa2 Add XPlatform::get_screen_format for X11 2010-04-23 16:36:35 +02:00
Alexander Larsson
2d6fbde89b Move RedPixmap::Format to RedDrawable::Format
We need to know the format for other drawables too (like for instance
the native format of a window), so we're pushing this down.

This changes a bunch of references to be RedDrawable::, but not all.
The the old RedPixmap:: references still work, but will be phased out.
2010-04-23 16:36:35 +02:00
Alexander Larsson
98d91203c5 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
ee04978272 Add emacs modelines to more files 2010-04-23 16:36:31 +02:00
Alexander Larsson
aeab661c5d Make client start if screen is 16bpp
The current glx code is looking for a rgb32 visual and always failing
if there is none. This means not even software rendering starts up
on e.g. 16bit visuals. This commit makes it pick software fallbacks
on 16bit visuals.

Long term we need to fix the gl implementation to do 16bpp too.
2010-04-23 16:36:31 +02:00
Alexander Larsson
9c02d15396 Client: Don't die if XIM not availible 2010-04-23 16:36:31 +02:00
Alexander Larsson
43a61bb6fe Detect XShm extension sanely
The previous way XShm detection worked failed at least for me, and is
not the standard way. We now just use XShmQueryExtension and
XShmQueryVersion.
2010-04-23 16:36:31 +02:00
Alexander Larsson
5a1f8bafa0 Avoid unncessary buffer management in mjpeg decoder if possible 2010-04-14 11:41:37 +02:00
Alexander Larsson
c97116aeb9 Relicense everything from GPL to LGPL 2.1+ 2010-04-13 22:22:15 +02:00
Alexander Larsson
cc9b7a21fb Fix A1 handling in RedDrawable combine_pixels.
The previous code was just busted, as apparent on e.g. the cursor
in MS Paint.
2010-04-13 11:48:13 +02:00
Alexander Larsson
3f94cad657 Use upstream name for pthreads lib and new freetype version 2010-04-12 21:43:16 +02:00
Alexander Larsson
d033a7c71e Fixed vs2008 warning 2010-04-12 21:43:16 +02:00
Izik Eidus
22d1ac9eb5 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>
2010-04-09 05:09:02 +03:00
Alexander Larsson
187a4230e5 Remove leftover AutoVStreamInit class 2010-04-08 17:48:40 +02:00
Alexander Larsson
de4306af33 Initialize _kill_mark so we don't get spurious valgrind warnings 2010-04-08 17:09:32 +02:00
Alexander Larsson
18485cef06 Free the jpeg decoder with the stream 2010-04-08 16:35:10 +02:00
Alexander Larsson
5059c304be Use libjpeg to decode mjpegs, not ffmpeg
This is pretty straightforward, although there are two weird issues.
The current encoder has two bugs in the yuv conversion. First of all
it switches red and blue, due to something of an endianness issue. We
keep this behavior by switching red and blue. Maybe we want to
change this in the new protocol version since switching this may
cause jpeg compression to be worse.

Secondly, the old coder/decoder did rgb to/from yuv420 wrongly for
jpeg, not using the "full scale" version of Y that is used in jpeg,
but the other one where y goes from 16 to 235. (See jpeg/jfif
reference on http://en.wikipedia.org/wiki/YCbCr for details.)
The new decoder uses the full range in order to get better quality,
which means old encoders will show slightly darker images.

This completely removes all ffmpeg usage in the client
2010-04-08 11:30:18 +02:00
Alexander Larsson
ed568302ad Update project file to visual studio 2008 2010-04-08 09:30:16 +02:00
Yonit Halperin
88aa56045a client: handling SPICE_MSG_MAIN_MIGRATE_SWITCH_HOST
disconnecting from the current host and connecting to the target host.
2010-04-06 14:56:46 +02:00
Yonit Halperin
91bc0e8625 client: fix unsafe access to an event member 2010-04-06 11:34:21 +02:00
Yonit Halperin
6f40c593e9 client: x11: fix a crash caused by a call to a destroyed window.
Happens when a focused window is destroyed without a focus out event,
and a focus-in event occurs on another window.
2010-04-03 05:55:00 +03:00
Izik Eidus
4a208b3644 libspice: add off screens support
Signed-off-by: Izik Eidus <ieidus@redhat.com>
2010-04-03 05:35:31 +03:00
Izik Eidus
27a8ec1ef4 spice server: surface create/destroy protocol support
Now we can send commands from the server to the client
to destroy surfaces (right now just the primary surface)

Needed for offscreens support)

Another patch`s on the way.

Signed-off-by: Izik Eidus <ieidus@redhat.com>
2010-04-03 05:34:48 +03:00
Alon Levy
77f6d70541 spice: client: fix handling of top down images in video streams
Top down streams arrive from x11-qxl driver.
2010-03-24 15:23:20 +01:00
Alexander Larsson
1c98a3536b configure.ac: client: replace $(top_srcdir) in x11/Makefile.am (subdir config)
Replace all "$(top_srcdir)/common" with "$(SPICE_COMMON_DIR)"
and     all "$(top_srcdir)/client" with custom "$(CLIENTDIR)"

This would (after following patches) enables building the client from
either spice/ (top directory) or spice/client.
2010-03-24 15:04:30 +01:00
Yonit Halperin
457693fcfa client: add command line support for ciphers, ca file, and host certificate subject 2010-03-18 10:21:47 +01:00
Søren Sandmann Pedersen
46ad8fd070 Explicitly depend on various X libraries, and -pthread
In Fedora 13, the linker doesn't pull in DT_NEEDED libraries anymore,
so we have to list the things that we depend on explicitly.

This affects several X extension libraries, and also the pthread
library.
2010-03-11 06:37:41 -05:00
Alexander Larsson
440ac41cf1 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.
2010-03-11 12:13:59 +01:00
Alexander Larsson
22b551f97f Define __STDC_LIMIT_MACROS for c++ code to get SIZE_MAX
We need SIZE_MAX for the malloc overflow code, and its not defined
in C++ unless __STDC_LIMIT_MACROS is defined.
2010-03-10 21:28:48 +01:00
Alexander Larsson
0230541af5 Define GL_GLEXT_PROTOTYPES in CFLAGS not in random places in the source 2010-03-10 21:28:47 +01:00
Alexander Larsson
90c5766caf Use macros from <spice/macros.h> rather than duplicate them 2010-03-09 11:10:00 +01:00
Alexander Larsson
18606d99ea Move canvas_region and group_start/end to canvas_base 2010-03-08 19:45:28 +01:00
Alexander Larsson
f8217d8b96 Move virtualization of canvas drawing into common/canvas_base
Instead of having two virtualizations of the canvas we push the
virtualization into the canvas code itself. This not only avoids
the duplication of this code, it also makes the exposed API for the
canvas much smaller (in terms of exported API).

It also lets us use the virtualization to implement basic support
for operations in canvas_base which is then overridden by each canvas
implementation.
2010-03-08 19:45:28 +01:00
Alexander Larsson
c0fdcd1a10 Make canvas Glz decoder integration nicer
We use a dynamic interface similar to e.g. SpiceImageCache instead
of passing both function and opaque
2010-03-08 19:45:27 +01:00
Alexander Larsson
4f097150cb Fix up win32 build reference to pixman_utils.cpp
It was pointing to the wrong directory for pixman_utils.cpp
2010-03-05 17:17:23 +01:00
Alexander Larsson
2d203bc428 Only use AI_ADDRCONF if availible
AI_ADDRCONF not availible on winXP, so this fixes windows build.
2010-03-03 16:14:19 +01:00
Larsson@.(none)
d425690875 Update visual studio project for pixman changes 2010-03-01 15:12:37 +01:00
Larsson@.(none)
c28169976a Make gdi canvas build in the new pixman world 2010-03-01 15:12:35 +01:00
Gerd Hoffmann
872be6b2d7 spice client: add ipv6 support.
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2010-02-27 22:12:08 +02:00
Gerd Hoffmann
878c215501 spice client: fix dns lookup
ignore lookup results which are not ipv4

Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2010-02-27 22:08:47 +02:00
Alexander Larsson
239b2b66b2 Remove qcairo dependency, only use pixman 2010-02-23 22:52:06 +01:00
Alexander Larsson
295738b453 Remove cairo use in client 2010-02-23 22:52:06 +01:00
Alexander Larsson
1caa4b65c5 Remove no longer needed CAIRO_CANVAS_CACH_IS_SHARED define and code 2010-02-23 22:52:06 +01:00
Alexander Larsson
7992266ccf Remove cairo_t from cairo canvas 2010-02-23 22:52:06 +01:00
Alexander Larsson
98dde80ed3 Replace custom region implementation with pixman_region32_t
pixman_region32_t is an efficient well tested region implementation (its
the one used in X) that we already depend on via pixman and use in
some places. No need to have a custom region implementation.
2010-02-23 22:52:06 +01:00
Alexander Larsson
16780a7b81 Use pixman_image_t instead of cairo_surface_t as the generic pixman container
This allows us to use the simpler dependency of pixman outside of the
cairo backend, and it later lets us move the cairo backend to using
pixman only.
2010-02-23 22:52:01 +01:00
Alexander Larsson
0b0342ee7e Turn image and palette cache into c style dynamic interface
Instead of passing a bunch of function pointer and an opaque
pointer we make a real type and add a vtable pointer to it.
This means we can simplify all the canvas constructors, etc.
2010-02-23 14:43:20 +01:00
Alexander Larsson
7537acd630 Add optional templated base class to Cache and SharedCache
We want this for integration with C-style classes.
2010-02-23 14:43:20 +01:00
Alexander Larsson
60a189f250 Add line rasterizer 2010-02-23 14:43:20 +01:00