Skip to content

Commit

Permalink
[client] redesign of the renderer archiceture for mt support
Browse files Browse the repository at this point in the history
This is the first of two commits that completely turn the rendering code
on it's head. This change set decouples the guest's capture rate from
the host's render rate for both cursor and frame updates. This helps
prevent the host application from stalling when waiting for frame draws
when all it want's to do is send cursor updates.

* Breaks OpenGL-Basic for now
  • Loading branch information
gnif committed Dec 19, 2017
1 parent a70adb2 commit 695822b
Show file tree
Hide file tree
Showing 7 changed files with 566 additions and 536 deletions.
4 changes: 2 additions & 2 deletions client/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,8 @@ OBJS = main.o \
lg-renderer.o \
spice/spice.o \
ivshmem/ivshmem.o \
renderers/opengl.o \
renderers/opengl-basic.o
renderers/opengl.o
# renderers/opengl-basic.o

BUILD_OBJS = $(foreach obj,$(OBJS),$(BUILD)/$(obj))

Expand Down
13 changes: 2 additions & 11 deletions client/lg-renderer.h
Original file line number Diff line number Diff line change
Expand Up @@ -28,10 +28,7 @@ Place, Suite 330, Boston, MA 02111-1307 USA
((x)->get_name && \
(x)->create && \
(x)->initialize && \
(x)->configure && \
(x)->deconfigure && \
(x)->deinitialize && \
(x)->is_compatible && \
(x)->on_resize && \
(x)->on_mouse_shape && \
(x)->on_mouse_event && \
Expand Down Expand Up @@ -96,15 +93,12 @@ LG_RendererCursor;
typedef const char * (* LG_RendererGetName )();
typedef bool (* LG_RendererCreate )(void ** opaque, const LG_RendererParams params);
typedef bool (* LG_RendererInitialize )(void * opaque, Uint32 * sdlFlags);
typedef bool (* LG_RendererConfigure )(void * opaque, SDL_Window *window, const LG_RendererFormat format);
typedef void (* LG_RendererDeConfigure )(void * opaque);
typedef void (* LG_RendererDeInitialize)(void * opaque);
typedef bool (* LG_RendererIsCompatible)(void * opaque, const LG_RendererFormat format);
typedef void (* LG_RendererOnResize )(void * opaque, const int width, const int height, const LG_RendererRect destRect);
typedef bool (* LG_RendererOnMouseShape)(void * opaque, const LG_RendererCursor cursor, const int width, const int height, const int pitch, const uint8_t * data);
typedef bool (* LG_RendererOnMouseEvent)(void * opaque, const bool visible , const int x, const int y);
typedef bool (* LG_RendererOnFrameEvent)(void * opaque, const uint8_t * data);
typedef bool (* LG_RendererRender )(void * opaque);
typedef bool (* LG_RendererOnFrameEvent)(void * opaque, const LG_RendererFormat format, const uint8_t * data);
typedef bool (* LG_RendererRender )(void * opaque, SDL_Window *window);

typedef struct LG_Renderer
{
Expand All @@ -113,10 +107,7 @@ typedef struct LG_Renderer
LG_RendererOptions options;
unsigned int option_count;
LG_RendererInitialize initialize;
LG_RendererConfigure configure;
LG_RendererDeConfigure deconfigure;
LG_RendererDeInitialize deinitialize;
LG_RendererIsCompatible is_compatible;
LG_RendererOnResize on_resize;
LG_RendererOnMouseShape on_mouse_shape;
LG_RendererOnMouseEvent on_mouse_event;
Expand Down
4 changes: 2 additions & 2 deletions client/lg-renderers.h
Original file line number Diff line number Diff line change
Expand Up @@ -21,12 +21,12 @@ Place, Suite 330, Boston, MA 02111-1307 USA
#include "lg-renderer.h"

extern const LG_Renderer LGR_OpenGL;
extern const LG_Renderer LGR_OpenGLBasic;
//extern const LG_Renderer LGR_OpenGLBasic;

const LG_Renderer * LG_Renderers[] =
{
&LGR_OpenGL,
&LGR_OpenGLBasic,
// &LGR_OpenGLBasic,
NULL // end of array sentinal
};

Expand Down
Loading

0 comments on commit 695822b

Please sign in to comment.