Jeffrey Ratcliffe > Gtk2-ImageView-0.04 > DrawCache.xs

Download:
Gtk2-ImageView-0.04.tar.gz

Annotate this POD

CPAN RT

Open  0
Report a bug
Source   Latest Release: Gtk2-ImageView-0.05

DESCRIPTION ^

Gtk2::Gdk::Pixbuf::Draw::Cache provides a cache that should be used by the Gtk2::ImageView::Tool when redrawing the Gtk2::ImageView.

Creates a new pixbuf draw cache.

Returns

a new Gtk2::Gdk::Pixbuf::Draw::Cache

Deallocates a pixbuf draw cache and all its data.

Force the pixbuf draw cache to scale the pixbuf at the next draw.

Gtk2::Gdk::Pixbuf::Draw::Cache tries to minimize the number of scale operations needed by caching the last drawn pixbuf. It would be inefficient to check the individual pixels inside the pixbuf so it assumes that if the memory address of the pixbuf has not changed, then the cache is good to use.

However, when the image data is modified, this assumtion breaks, which is why this method must be used to tell draw cache about it.

Redraws the area specified in the pixbuf draw options in an efficient way by using caching.

cache : a GdkPixbufDrawCache
opts : the Gtk2::Gdk::Pixbuf::Draw::Opts to use in this draw
drawable : a GdkDrawable to draw on

Gets the fastest method to draw the specified draw options. old is assumed to be the last PixbufDrawOpts used and new is the one to use this time.

old : the last draw options used
new : the current draw options

Returns

the best draw method to use to draw