gnash-commit
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Gnash-commit] /srv/bzr/gnash/trunk r10889: Allow SDL/Cairo builds. It b


From: Sandro Santilli
Subject: [Gnash-commit] /srv/bzr/gnash/trunk r10889: Allow SDL/Cairo builds. It builds but doesn't work correctly yet. Looks like a problem with alpha (try ^H and wait some, chances are that the plain red squares will show up)
Date: Wed, 20 May 2009 01:29:52 +0200
User-agent: Bazaar (1.13.1)

------------------------------------------------------------
revno: 10889
committer: Sandro Santilli <address@hidden>
branch nick: trunk
timestamp: Wed 2009-05-20 01:29:52 +0200
message:
  Allow SDL/Cairo builds. It builds but doesn't work correctly yet. Looks like 
a problem with alpha (try ^H and wait some, chances are that the plain red 
squares will show up)
modified:
  configure.ac
  gui/sdl_cairo_glue.cpp
  gui/sdl_cairo_glue.h
=== modified file 'configure.ac'
--- a/configure.ac      2009-05-14 15:02:29 +0000
+++ b/configure.ac      2009-05-19 23:29:52 +0000
@@ -1910,9 +1910,9 @@
   if test x$build_fb = xyes; then
     AC_MSG_ERROR([Cairo renderer is not supported by FB gui. Use 
--enable-renderer=AGG or --enable-gui=gtk]);
   fi
-  if test x$build_sdl = xyes; then
-    AC_MSG_ERROR([Cairo renderer is not supported by SDL gui. Use 
--enable-renderer=AGG or --enable-gui=gtk]);
-  fi
+dnl   if test x$build_sdl = xyes; then
+dnl     AC_MSG_ERROR([Cairo renderer is not supported by SDL gui. Use 
--enable-renderer=AGG or --enable-gui=gtk]);
+dnl   fi
   if test x$build_fltk = xyes; then
     AC_MSG_ERROR([Cairo renderer is not supported by FLTK gui. Use 
--enable-renderer=AGG or --enable-gui=gtk]);
   fi

=== modified file 'gui/sdl_cairo_glue.cpp'
--- a/gui/sdl_cairo_glue.cpp    2009-05-19 08:19:31 +0000
+++ b/gui/sdl_cairo_glue.cpp    2009-05-19 23:29:52 +0000
@@ -33,10 +33,10 @@
 SdlCairoGlue::~SdlCairoGlue()
 {
 //    GNASH_REPORT_FUNCTION;
-    cairo_surface_destroy(_cairo_surface);
-    cairo_destroy (_cairo_handle);
-    SDL_FreeSurface(_sdl_surface);
-    SDL_FreeSurface(_screen);
+    if ( _cairo_surface ) cairo_surface_destroy(_cairo_surface);
+    if ( _cairo_handle ) cairo_destroy (_cairo_handle);
+    if ( _sdl_surface ) SDL_FreeSurface(_sdl_surface);
+    if ( _screen ) SDL_FreeSurface(_screen);
     delete [] _render_image;
 }
 
@@ -54,8 +54,9 @@
 //    GNASH_REPORT_FUNCTION;
     _bpp = depth;
 
-    return renderer::cairo::create_handler();
+    _renderer = renderer::cairo::create_handler();
 
+    return _renderer;
 }
 
 /// Not implemented, Fixme
@@ -85,7 +86,7 @@
 
     _cairo_handle = cairo_create(_cairo_surface);
 
-    renderer::cairo::set_handle(_cairo_handle);
+    renderer::cairo::set_context(_renderer, _cairo_handle);
 
     boost::uint32_t rmask, gmask, bmask, amask;
 
@@ -105,7 +106,14 @@
 SdlCairoGlue::render()
 {
 //    GNASH_REPORT_FUNCTION;
+
+    /*Fill the background in purple so we can see the alpha blend */
+    //SDL_FillRect (_screen, NULL, SDL_MapRGB(_screen->format,255,0,255));
+
     SDL_BlitSurface(_sdl_surface, NULL, _screen, NULL);
+
+    //cairo_surface_write_to_png (_cairo_surface, "/tmp/gnash.png");
+
     SDL_UpdateRect (_screen, 0, 0, 0, 0);
 }
 

=== modified file 'gui/sdl_cairo_glue.h'
--- a/gui/sdl_cairo_glue.h      2009-05-19 08:19:31 +0000
+++ b/gui/sdl_cairo_glue.h      2009-05-19 23:29:52 +0000
@@ -20,6 +20,11 @@
 #include <SDL.h>
 
 
+// Forward declarations
+namespace gnash {
+    class render_handler;
+}
+
 namespace gnash
 {
 
@@ -41,6 +46,7 @@
     SDL_Surface     *_sdl_surface;
     unsigned char   *_render_image;
     SDL_Surface     *_screen;
+    render_handler  *_renderer;
 };
 
 }


reply via email to

[Prev in Thread] Current Thread [Next in Thread]