Pass Cairo context down to child elements instead of recreating it.

This commit is contained in:
Adam Reichold
2015-12-05 09:14:41 +01:00
parent 48f0225104
commit 333f9013dd
5 changed files with 7 additions and 13 deletions

View File

@@ -467,7 +467,7 @@ void ThumbBrowserEntryBase::drawFrame (Cairo::RefPtr<Cairo::Context> cc, const G
}
}
void ThumbBrowserEntryBase::draw ()
void ThumbBrowserEntryBase::draw (Cairo::RefPtr<Cairo::Context> cc)
{
if (!drawable || !parent) {
@@ -490,11 +490,6 @@ void ThumbBrowserEntryBase::draw ()
updateBackBuffer ();
}
Gtk::Widget* w = parent->getDrawingArea ();
Glib::RefPtr<Gdk::Window> win = w->get_window();
Cairo::RefPtr<Cairo::Context> cc = win->create_cairo_context();
int w_ = startx + ofsX;
int h_ = starty + ofsY;
cc->set_source(backBuffer->getSurface(), w_, h_);