Re: New drawing/scrolling model
- From: Alexander Larsson <alexl redhat com>
- To: Paul Davis <paul linuxaudiosystems com>
- Cc: Søren Sandmann <sandmann cs au dk>, GTK Devel List <gtk-devel-list gnome org>
- Subject: Re: New drawing/scrolling model
- Date: Fri, 03 May 2013 09:02:13 +0200
On tor, 2013-05-02 at 18:20 -0400, Paul Davis wrote:
On Thu, May 2, 2013 at 6:03 PM, Søren Sandmann <sandmann cs au dk>
wrote:
Alexander Larsson <alexl redhat com> writes:
> * Try a tile-based approach for GtkPixelCache to avoid
having
> to do a same-surface copy (usign an intermediate surface)
when
> scrolling the cache.
An alternative to tiles is to keep track of an origin within
the
surface:
+--------+--------------------------+
| Bot R | Bottom left |
| | |
+--------O--------------------------+
| Top R | Top left |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
+--------+--------------------------+
with the contents of the surface addressed modulo width and
height. Scrolling is then just a matter of moving that origin,
but
copying from the surface may require four separate blits.
Similarly,
rendering to some rectangle may have to be split into four
separate
operations.
this is where trying to be too generic hurts.
a given widget knows its aspect ratio. for things that are short and
wide, their "pixel cache" will consist of a set of full-height,
partial-width surfaces.
for things that are tall and narrow, their "pixel cache" will consist
of a set of full-width, partial-height caches. for things that are
short and narrow, their cache will consist of a single surface. for
things that are wide and tall ... well, they're on their own ...
This is not really a problem the pixel cache knows the size of the
"canvas" and the "viewport" so it will automatically not pick an
unnecessarily wide/tall offscreen surface.
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]