From 0059c630d7406f672c113d6dc6da78810160ddbb Mon Sep 17 00:00:00 2001 From: David Robillard Date: Tue, 18 Feb 2020 22:50:52 +0100 Subject: Pass expose event to backend enter and leave functions This is needed for clipping. Unfortunately, the puglEnterContext() and puglLeaveContext() API was not suitable for this, but this shouldn't matter in user code because it is only used for setup, and is slated for removal anyway. Instead, just call the backend functions directly in the implementation. --- pugl/detail/x11_cairo.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'pugl/detail/x11_cairo.c') diff --git a/pugl/detail/x11_cairo.c b/pugl/detail/x11_cairo.c index 9d3ec16..7a02dcd 100644 --- a/pugl/detail/x11_cairo.c +++ b/pugl/detail/x11_cairo.c @@ -79,12 +79,12 @@ puglX11CairoDestroy(PuglView* view) } static PuglStatus -puglX11CairoEnter(PuglView* view, bool drawing) +puglX11CairoEnter(PuglView* view, const PuglEventExpose* expose) { PuglInternals* const impl = view->impl; PuglX11CairoSurface* const surface = (PuglX11CairoSurface*)impl->surface; - if (drawing) { + if (expose) { surface->cr = cairo_create(surface->front); if (!surface->cr || cairo_status(surface->cr)) { return PUGL_CREATE_CONTEXT_FAILED; @@ -95,12 +95,12 @@ puglX11CairoEnter(PuglView* view, bool drawing) } static PuglStatus -puglX11CairoLeave(PuglView* view, bool drawing) +puglX11CairoLeave(PuglView* view, const PuglEventExpose* expose) { PuglInternals* const impl = view->impl; PuglX11CairoSurface* const surface = (PuglX11CairoSurface*)impl->surface; - if (drawing) { + if (expose) { // Destroy front context that was used by the user for drawing cairo_destroy(surface->cr); -- cgit v1.2.1