Example #1
0
void intel_swap_buffers(struct egl_drm_drawable *draw)
{
	struct intel_framebuffer *intel_fb = (struct intel_framebuffer *)draw->priv;
	struct pipe_surface *back_surf;

	assert(intel_fb);
	assert(intel_fb->stfb);

	back_surf = st_get_framebuffer_surface(intel_fb->stfb, ST_SURFACE_BACK_LEFT);
	if (back_surf) {
		st_notify_swapbuffers(intel_fb->stfb);
		if (intel_fb->front)
			intel_display_surface(draw, back_surf);
		st_notify_swapbuffers_complete(intel_fb->stfb);
	}
}
Example #2
0
void
intelSwapBuffers(__DRIdrawablePrivate * dPriv)
{
   struct intel_framebuffer *intel_fb = intel_framebuffer(dPriv);
   struct pipe_surface *back_surf;

   assert(intel_fb);
   assert(intel_fb->stfb);

   back_surf = st_get_framebuffer_surface(intel_fb->stfb,
                                          ST_SURFACE_BACK_LEFT);
   if (back_surf) {
      st_notify_swapbuffers(intel_fb->stfb);
      intelDisplaySurface(dPriv, back_surf, NULL);
      st_notify_swapbuffers_complete(intel_fb->stfb);
   }
}
Example #3
0
/**
 * Called via glXCopySubBufferMESA() to copy a subrect of the back
 * buffer to the front buffer/screen.
 */
void
intelCopySubBuffer(__DRIdrawablePrivate * dPriv, int x, int y, int w, int h)
{
   struct intel_framebuffer *intel_fb = intel_framebuffer(dPriv);
   struct pipe_surface *back_surf;

   assert(intel_fb);
   assert(intel_fb->stfb);

   back_surf = st_get_framebuffer_surface(intel_fb->stfb,
                                          ST_SURFACE_BACK_LEFT);
   if (back_surf) {
      drm_clip_rect_t rect;
      rect.x1 = x;
      rect.y1 = y;
      rect.x2 = w;
      rect.y2 = h;

      st_notify_swapbuffers(intel_fb->stfb);
      intelDisplaySurface(dPriv, back_surf, &rect);
   }
}
Example #4
0
static EGLBoolean
xlib_eglSwapBuffers(_EGLDriver *drv, EGLDisplay dpy, EGLSurface draw)
{
   /* error checking step: */
   if (!_eglSwapBuffers(drv, dpy, draw))
      return EGL_FALSE;

   {
      struct xlib_egl_surface *xsurf = lookup_surface(draw);
      struct pipe_winsys *pws = xsurf->winsys;
      struct pipe_surface *psurf =
         st_get_framebuffer_surface(xsurf->Framebuffer, ST_SURFACE_BACK_LEFT);

      st_notify_swapbuffers(xsurf->Framebuffer);

      display_surface(pws, psurf, xsurf);

      check_and_update_buffer_size(xsurf);
   }

   return EGL_TRUE;
}
Example #5
0
/**
 * XXX: Dispatch pipe_screen::flush_front_buffer to our 
 * stw_winsys::flush_front_buffer.
 */
static void 
stw_flush_frontbuffer(struct pipe_screen *screen,
                     struct pipe_surface *surface,
                     void *context_private )
{
   const struct stw_winsys *stw_winsys = stw_dev->stw_winsys;
   HDC hdc = (HDC)context_private;
   struct stw_framebuffer *fb;
   
   fb = stw_framebuffer_from_hdc( hdc );
   /* fb can be NULL if window was destroyed already */
   if (fb) {
#if DEBUG
      {
         struct pipe_surface *surface2;
   
         if(!st_get_framebuffer_surface( fb->stfb, ST_SURFACE_FRONT_LEFT, &surface2 ))
            assert(0);
         else
            assert(surface2 == surface);
      }
#endif

#ifdef DEBUG
      if(stw_dev->trace_running) {
         screen = trace_screen(screen)->screen;
         surface = trace_surface(surface)->surface;
      }
#endif
   }
   
   stw_winsys->flush_frontbuffer(screen, surface, hdc);
   
   if(fb) {
      stw_framebuffer_update(fb);
      stw_framebuffer_release(fb);
   }
}