[Spice-devel] [PATCH 25/30] Replace custom region implementation with pixman_region32_t
Alexander Larsson
alexl at redhat.com
Mon Feb 22 13:44:43 PST 2010
On Mon, 2010-02-22 at 16:15 +0200, Yonit Halperin wrote:
> On 02/18/2010 10:58 PM, Alexander Larsson wrote:
> > +int region_test(const QRegion *rgn, const QRegion *other_rgn, int
> query)
> > {
> > }
> >
>
>
> The new implementation is not efficient comparing to the previous
> implementation.
> The previous one returns immediately once the requested query is
> satisfied (e.g., if it is
> REGION_TEST_SHARED, it returns after it encounters the first two
> rectangles that intersect).
> However, the suggested implementation calculates the whole
> intersection.
> In addition, in case we query for REGION_TEST_RIGHT/LEFT_EXCLUSIVE it
> goes over the region again
> and compares it to the intersection. The previous implementation makes
>
> only one pass over the region.
Yes, I'm aware of this. I just did it the simple way to get something
working initially. Getting a short-circuiting version in should be
doable.
> One more thing: as Izik mentioned, in many places you transform pixman
>
> bboxes to SpiceRect. Can't we work only with one type and perform the
> transformation only once more upstream?
Long term this is what i want to do, however, pixman_box_t and
SpiceRects have coordinates stored in different order, and we can't just
change SpiceRect as it currently defines the network protocol. When we
have a real demarshaller for the network protocol we should be able to
have SpiceRect and pixman_box_t be compatible and avoid all this
conversion.
--
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
Alexander Larsson Red Hat, Inc
alexl at redhat.com alexander.larsson at gmail.com
He's a lounge-singing native American ex-con looking for 'the Big One.' She's
an artistic communist wrestler from the wrong side of the tracks. They fight
crime!
More information about the Spice-devel
mailing list