Commit Graph

71 Commits

Author SHA1 Message Date
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
Alexander Larsson
a64e487d78 Move draw_rop3 to canvas_base 2012-03-20 15:25:40 +01:00
Alexander Larsson
f01c1dac36 Move canvas_draw_stroke to canvas_base 2012-03-20 15:25:40 +01:00
Alexander Larsson
b6ba1e0138 Move most of the shared draw_xyz() methods from CairoCanvas to CanvasBase
This adds a set of virtual methods for low-level operations. A subclass
can choose to implement those and let the default CanvasBase implementations
handle the highlevel stuff.
2012-03-20 15:25:40 +01:00
Alexander Larsson
c0e6bd560e Move canvas_region and group_start/end to canvas_base 2012-03-20 15:25:40 +01:00
Alexander Larsson
3b73f93cf2 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.
2012-03-20 15:25:39 +01:00
Alexander Larsson
981270d38a Make virt mapping an interface 2012-03-20 15:25:39 +01:00
Alexander Larsson
5912af45f0 Make glz_decoder non-optional canvas_base in canvas constructors
It can still be NULL, but we simplify the headers by always including it.
There is no practical performance difference here.
2012-03-20 15:25:39 +01:00
Alexander Larsson
a8e126f524 Make canvas Glz decoder integration nicer
We use a dynamic interface similar to e.g. SpiceImageCache instead
of passing both function and opaque
2012-03-20 15:25:39 +01:00
Alexander Larsson
2f29c42fbf Fix colorkeying in pixman_utils.c
We were masking out the alpha bit in the key color not int
the source pixel, so colorkeying didn't work when the high byte
was != 0. For instance in the shutdown dialog in XP.
2012-03-20 15:25:39 +01:00
Larsson@.(none)
a5eccd6cdb Make gdi canvas build in the new pixman world 2012-03-20 15:25:39 +01:00
Larsson@.(none)
561ffc8fa4 Always include spice/types.h before pixman so standard int types exist 2012-03-20 15:25:39 +01:00
Larsson@.(none)
196e75a55f Fix warnings from visual studio compiler 2012-03-20 15:25:39 +01:00
Larsson@.(none)
61e27b04a1 Have only one copy of ROUND macro and cast to int explicitly 2012-03-20 15:25:39 +01:00
Alexander Larsson
6daf94a2bc Remove last cairo use from canvas_base 2012-03-20 15:25:39 +01:00
Alexander Larsson
82454573d1 Remove cairo_t from cairo canvas 2012-03-20 15:25:39 +01:00
Alexander Larsson
2192cc5e89 Covert cairo canvas put_image() to pixman 2012-03-20 15:25:39 +01:00
Alexander Larsson
2afb5544da 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.
2012-03-20 15:25:39 +01:00
Alexander Larsson
962bc74ed9 Convert cairo canvas clear() to pixman 2012-03-20 15:25:38 +01:00
Alexander Larsson
62a6c2513d Convert cairo canvas group_start/end to pixman 2012-03-20 15:25:38 +01:00
Alexander Larsson
f6f84f518c Convert cairo canvas read_bits() to pixman 2012-03-20 15:25:38 +01:00
Alexander Larsson
f853baae92 Remove unused cairo helper functions 2012-03-20 15:25:38 +01:00
Alexander Larsson
bbf8b18b85 Convert cairo canvas to use pixman for draw_stroke 2012-03-20 15:25:38 +01:00
Alexander Larsson
2685407da3 Convert cairo canvas draw_transparent to use pixman 2012-03-20 15:25:38 +01:00
Alexander Larsson
d2d7d6a806 Convert cairo canvas draw_rop3 to using pixman 2012-03-20 15:25:38 +01:00
Alexander Larsson
2e3a63a6dd Convert draw_blackness/whiteness/invers to using pixman 2012-03-20 15:25:38 +01:00
Alexander Larsson
1f1f32d4c8 Convert cairo canvas alpha_blend to using pixman 2012-03-20 15:25:38 +01:00
Alexander Larsson
45d5461183 Convert cairo canvas draw_text to using pixman 2012-03-20 15:25:38 +01:00
Alexander Larsson
0671b02dbc Convert cairo canvas copy bits to pixman 2012-03-20 15:25:38 +01:00
Alexander Larsson
fd80e8a0e8 Convert cairo canvas draw_copy() to using pixman
This is just identical to draw_blend().
2012-03-20 15:25:38 +01:00
Alexander Larsson
2275b25c94 Convert cairo canvas draw_blend() to using pixman 2012-03-20 15:25:38 +01:00
Alexander Larsson
2be667e8a3 Convert cairo canvas draw_opaque() to using pixman 2012-03-20 15:25:38 +01:00