[MPlayer-cvslog] r35186 - in trunk/libvo: osx_common.h osx_objc_common.h osx_objc_common.m vo_gl.c

reimar subversion at mplayerhq.hu
Thu Sep 13 22:44:46 CEST 2012


Author: reimar
Date: Thu Sep 13 22:44:46 2012
New Revision: 35186

Log:
gl: support screen redraw on OSX.

This is necessary to support e.g. the smooth fullscreen animations.

Modified:
   trunk/libvo/osx_common.h
   trunk/libvo/osx_objc_common.h
   trunk/libvo/osx_objc_common.m
   trunk/libvo/vo_gl.c

Modified: trunk/libvo/osx_common.h
==============================================================================
--- trunk/libvo/osx_common.h	Thu Sep 13 22:28:30 2012	(r35185)
+++ trunk/libvo/osx_common.h	Thu Sep 13 22:44:46 2012	(r35186)
@@ -24,6 +24,7 @@ void change_movie_aspect(float new_aspec
 void config_movie_aspect(float config_aspect);
 void osx_foreground_hack(void);
 
+extern void (*vo_osx_redraw_func)(void);
 int vo_osx_init(void);
 int vo_osx_config(uint32_t, uint32_t, uint32_t);
 void vo_osx_uninit(void);

Modified: trunk/libvo/osx_objc_common.h
==============================================================================
--- trunk/libvo/osx_objc_common.h	Thu Sep 13 22:28:30 2012	(r35185)
+++ trunk/libvo/osx_objc_common.h	Thu Sep 13 22:44:46 2012	(r35186)
@@ -62,6 +62,7 @@
 //window & rendering
 - (void) preinit;
 - (void) config:(uint32_t)width:(uint32_t)height:(uint32_t)flags;
+- (void) drawRect: (NSRect *) bounds;
 - (void) reshape;
 
 //vo control

Modified: trunk/libvo/osx_objc_common.m
==============================================================================
--- trunk/libvo/osx_objc_common.m	Thu Sep 13 22:28:30 2012	(r35185)
+++ trunk/libvo/osx_objc_common.m	Thu Sep 13 22:44:46 2012	(r35186)
@@ -48,6 +48,8 @@ static BOOL isLeopardOrLater;
 static NSAutoreleasePool *autoreleasepool;
 static MPCommonOpenGLView *oglv;
 
+void (*vo_osx_redraw_func)(void);
+
 int vo_osx_init(void)
 {
     autoreleasepool = [[NSAutoreleasePool alloc] init];
@@ -210,6 +212,11 @@ void vo_osx_update_xinerama_info(void)
 		[window makeKeyAndOrderFront:self];
 }
 
+- (void) drawRect: (NSRect *) bounds
+{
+	if (vo_osx_redraw_func) vo_osx_redraw_func();
+}
+
 - (void)reshape
 {
 	NSRect frame = [self frame];

Modified: trunk/libvo/vo_gl.c
==============================================================================
--- trunk/libvo/vo_gl.c	Thu Sep 13 22:28:30 2012	(r35185)
+++ trunk/libvo/vo_gl.c	Thu Sep 13 22:44:46 2012	(r35186)
@@ -689,6 +689,14 @@ static int create_window(uint32_t d_widt
   return 0;
 }
 
+#ifdef CONFIG_GL_OSX
+static void osx_redraw(void)
+{
+  resize(vo_dwidth, vo_dheight);
+  redraw();
+}
+#endif
+
 /* connect to server, create and map window,
  * allocate colors and (shared) memory
  */
@@ -719,6 +727,9 @@ config(uint32_t width, uint32_t height, 
   }
   initGl(vo_dwidth, vo_dheight);
 
+#ifdef CONFIG_GL_OSX
+  vo_osx_redraw_func = osx_redraw;
+#endif
   return 0;
 }
 


More information about the MPlayer-cvslog mailing list