Commit Graph

228 Commits

Author SHA1 Message Date
Alexander Larsson
fcbd3208fc client: Report window format right for win32 2010-04-29 13:34:44 +02:00
Alexander Larsson
1e4ec1f513 client: Support 16bpp pixmaps on win32 2010-04-29 13:34:16 +02:00
Alexander Larsson
7dddbfe488 win32 client: Remove unnecessary GDIImage type
We just use pixman_image_t as the "information about image data" structure.
2010-04-29 11:40:07 +02:00
Alexander Larsson
42e83e3843 Add support for SPICE_IMAGE_FLAGS_HIGH_BITS_SET 2010-04-28 15:43:41 +02:00
Alexander Larsson
bc6029d0b0 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.
2010-04-28 12:15:24 +02:00
Alexander Larsson
ac5535048c Fix line lengths and tabs 2010-04-28 12:00:25 +02:00
Gerd Hoffmann
e52974c7b4 fix two warnings 2010-04-26 14:01:37 +02:00
Alexander Larsson
16328d2035 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.
2010-04-23 21:02:59 +02:00
Alexander Larsson
a1ec6e065a Fix up win32 client with recent changes 2010-04-23 16:41:47 +02:00
Alexander Larsson
b2165b4d04 Win32 canvas fixes 2010-04-23 16:41:47 +02:00
Alexander Larsson
c2f38a68ba If we have alpha in a 32bit rgb surface, ensure we send that
If we don't then alpha is lost which is problematic if the surface
is later used as with alpha_blend and SRC_SURFACE_HAS_ALPHA.
2010-04-23 16:41:47 +02:00
Alexander Larsson
810caf0e77 Support alpha surface sources and destinations 2010-04-23 16:41:47 +02:00
Alexander Larsson
1a590c50c0 Localize palettes for LZ PLT format
This is needed since they always decode to 32bit mode.
2010-04-23 16:41:47 +02:00
Alexander Larsson
395b5a5626 Server: Use the right image format when updating from a surface 2010-04-23 16:41:47 +02:00
Alexander Larsson
4f5a09a73d 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.
2010-04-23 16:41:42 +02:00
Alexander Larsson
774e5bd36f Client: Support pixmap format conversion in copy_pixels
In order to be able to support 16bit canvases on 32bit screens and 32bit
canvases on 16bit screens we need to handle format conversion when drawing
RedPixmaps.

The way this works now for X11 is that we only have one PIXELS_SOURCE_TYPE
for pixmaps, which always has a pixman_image_t for the data, but additionally
it has an XImage (shared mem or not) if the screen the pixmap was created
for (i.e. an explicit one or the default screen) has the same format as
the pixmap.

When we draw a pixmap on a drawable we have two variants. If the pixmap
has a XImage and it matches the format of the target drawable then we
just X(Shm)PutImage it to the drawable. If the formats differ, then we
create a temporary XImage and convert into that before drawing it to
the screen.

Right now this is a bit inefficient, because we always allocate a new
temporary image when converting. We want to add some caching here, but
at least this lets things work again.
2010-04-23 16:39:13 +02:00
Alexander Larsson
d2a2f18b6e X11 client: Add helper for XImage construction 2010-04-23 16:36:35 +02:00
Alexander Larsson
4200c66cd7 Add utility functions to create XShm images 2010-04-23 16:36:35 +02:00
Alexander Larsson
ecc51c6478 Create screen composit area in same format as window
This way we don't have to convert when drawing to it, or drawing it to
the dc.
2010-04-23 16:36:35 +02:00
Alexander Larsson
1efe358a05 Add helper to compare RedDrawable::Formats for copy compabible
Being copy compatible means the format are identical except
that some bits in the source may be ignored in the destination.
2010-04-23 16:36:35 +02:00
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
619c37af17 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.
2010-04-23 16:36:35 +02:00
Alexander Larsson
6dc52f1389 Add pixman utilities for bitmap to pixman_image_t conversion 2010-04-23 16:36:32 +02:00
Alexander Larsson
8bd1a87370 Add support for 16bit rop3 2010-04-23 16:36:31 +02:00
Alexander Larsson
ee04978272 Add emacs modelines to more files 2010-04-23 16:36:31 +02:00
Alexander Larsson
f5b00cdd6c Remove unused method canvas_surf_to_invers 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
c39f9e4a5b Detect big endian systems 2010-04-23 16:36:31 +02:00
Alexander Larsson
36f7c3b1e3 Fix warnings breaking win32 build 2010-04-23 16:36:31 +02:00
Izik Eidus
042bc0f632 Merge branch 'master' of ssh://git.freedesktop.org/git/spice/spice 2010-04-14 19:40:03 +03:00
Izik Eidus
99341e058f 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>
2010-04-14 19:38:49 +03: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
Alexander Larsson
ee035787ef Fix win32 build with pixman 0.18.0 2010-04-12 21:43:15 +02:00
Alexander Larsson
288a9ad03f Use fast DCT method for better jpeg compression performance 2010-04-12 20:54:35 +02:00
Izik Eidus
ad1a4849ee spice server: fix validate_chunk
Signed-off-by: Izik Eidus <ieidus@redhat.com>
2010-04-12 13:43:38 +03:00
Izik Eidus
85d4355d79 fix 16bpp support on cairo_canvas
Signed-off-by: Izik Eidus <ieidus@redhat.com>
2010-04-12 11:57:34 +03:00
Alexander Larsson
063af4a4f3 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.
2010-04-12 10:32:25 +02:00
Izik Eidus
03fb4e05be take the right lock when freeing glz stuff of surfaces
this was noticed by Yonit.

Signed-off-by: Izik Eidus <ieidus@redhat.com>
2010-04-09 22:47:03 +03:00
Alexander Larsson
34fb3f6806 Split out the memslot stuff from red_worker.c to its own files
This is required so that we can have code in other files that does address
validation.
2010-04-09 16:51:52 +02:00
Yonit Halperin
a3700a1bfb server: fix race condition in lz global dictionary, in its image segments list 2010-04-09 10:11:09 +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