gnash-commit
[Top][All Lists]
Advanced

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

[Gnash-commit] [SCM] Gnash branch, master, updated. release_0_8_9_final-


From: Rob Savoye
Subject: [Gnash-commit] [SCM] Gnash branch, master, updated. release_0_8_9_final-1270-g3702f10
Date: Mon, 05 Dec 2011 05:08:44 +0000

This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "Gnash".

The branch, master has been updated
       via  3702f102a0f4b4c6dd948fa8fbea5fdfa2836710 (commit)
       via  e7773cb4e2288514059ef0dee1039c37ac947c7c (commit)
       via  d787f39d93ff17e88e2ac5a999bc3000e662f7ea (commit)
       via  fa46ef50ac0fc12f7f808033479a314d30a6282b (commit)
       via  8c78786456110c4886be47ae9a1a7f5958a69643 (commit)
       via  8816e9b400d1d113146e62b3b0158602cce4d102 (commit)
       via  c51e4510eb8433f32abaea29b5f96b4af2d56498 (commit)
       via  069fc55e4a4cdf18aa09f2d97874d7b6d24c8b8d (commit)
       via  62fa992d4bafcacd89fcc7696bbb54f0d8c78e7b (commit)
       via  ac61d617ad84ceb5204a832b720bf31cc6e2e00b (commit)
       via  dbd8d539a782f3fc7279bcff963f0c4032c63832 (commit)
       via  0acadd7e34d41955893cf98fdd6d2a67be48aba1 (commit)
       via  b58acd461566474d800fa2dc81fab711dc1547c6 (commit)
       via  5636bc0135b0688affd17f3b239a71dbd62327b4 (commit)
       via  087aa0b38856ade32d9376c8354355e560abd0f0 (commit)
       via  f2b313eb8835c596219e9fdf393ae7ed5cd53e49 (commit)
       via  b3dbc24a2e31c0082278899ca7e1a4ca7bbc8e5b (commit)
       via  87ea766e351369575b34bf1fda8b69a154b1cfab (commit)
       via  9812e9eeaa4f1d0ccc654291d6264f7bea99a73d (commit)
       via  152a908e6077666166f5106a853a4ed0f7a33b2e (commit)
       via  0f881b512dbaaf209e8ff4483a8c63c7b01747c5 (commit)
       via  a1a3f2d0a621d3495b38c1e3a9ba94baad7c04d5 (commit)
       via  923156c64b9af4cbf9ffb13cf3db6f55ce4b143c (commit)
       via  293ec508f640a90a9a6335f71915e3d5569e287a (commit)
      from  3c5d32e34516e7c87ca754f44b59cc28657d97ad (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
http://git.savannah.gnu.org/cgit//commit/?id=3702f102a0f4b4c6dd948fa8fbea5fdfa2836710


commit 3702f102a0f4b4c6dd948fa8fbea5fdfa2836710
Author: Rob Savoye <address@hidden>
Date:   Sun Dec 4 21:22:37 2011 -0700

    move swapBuffers() from header to source file

diff --git a/libdevice/rawfb/RawFBDevice.cpp b/libdevice/rawfb/RawFBDevice.cpp
index e22259e..023c797 100644
--- a/libdevice/rawfb/RawFBDevice.cpp
+++ b/libdevice/rawfb/RawFBDevice.cpp
@@ -228,8 +228,26 @@ RawFBDevice::attachWindow(GnashDevice::native_window_t 
window)
     
     return true;
 }
-    
 
+bool
+RawFBDevice::swapBuffers()
+{
+    // When using AGG, the pointer to the offscreen buffer has been
+    // passed to AGG, so it renders in the offscreen buffer by default,
+    // leaving it up to us to manually copy the data from the offscreeen
+    // buffer into the real framebuffer memory.
+    if (_fbmem && _offscreen_buffer) {
+        std::copy(_offscreen_buffer.get(),
+                  _offscreen_buffer.get() + _fixinfo.smem_len,
+                  _fbmem);
+        return true;
+    } else {
+        // When single buffered, there is no data to copy, so always true
+        return true;
+    }     
+    return false;
+}
+    
 // Return a string with the error code as text, instead of a numeric value
 const char *
 RawFBDevice::getErrorString(int /* error */)
diff --git a/libdevice/rawfb/RawFBDevice.h b/libdevice/rawfb/RawFBDevice.h
index 8ae4ce9..38d5b6e 100644
--- a/libdevice/rawfb/RawFBDevice.h
+++ b/libdevice/rawfb/RawFBDevice.h
@@ -131,27 +131,13 @@ class RawFBDevice : public GnashDevice
 
     bool isSingleBuffered() {
 #ifdef ENABLE_DOUBLE_BUFFERING
-        return true;
-#else
         return false;
+#else
+        return true;
 #endif
     }
 
-    bool swapBuffers() {
-        // When using AGG, the pointer to the offscreen buffer has been
-        // passed to AGG, so it renders in the offscreen buffer by default,
-        // leaving it up to us to manually copy the data from the offscreeen
-        // buffer into the real framebuffer memory.
-        if (_offscreen_buffer) {
-            std::copy(_fbmem, _fbmem + _fixinfo.smem_len,
-                      _offscreen_buffer.get());
-            return true;
-        } else {
-            // When single buffered, there is no data to copy, so always true
-            return true;
-        }     
-        return false;
-    }
+    bool swapBuffers();
     
 protected:
     /// Clear the framebuffer memory

http://git.savannah.gnu.org/cgit//commit/?id=e7773cb4e2288514059ef0dee1039c37ac947c7c


commit e7773cb4e2288514059ef0dee1039c37ac947c7c
Author: Rob Savoye <address@hidden>
Date:   Sun Dec 4 21:21:37 2011 -0700

    use isSingleBuffered() instead of getOffscreenBuffer()

diff --git a/gui/fb/fb_glue_agg.cpp b/gui/fb/fb_glue_agg.cpp
index c1526de..4a713e1 100644
--- a/gui/fb/fb_glue_agg.cpp
+++ b/gui/fb/fb_glue_agg.cpp
@@ -118,8 +118,7 @@ FBAggGlue::init (int argc, char ***argv)
         <renderer::rawfb::RawFBDevice *>(_device.get());
 
     // You must pass in the file descriptor to the opened
-    // framebuffer when creating a window. Under X11, this is
-    // actually the XID of the created window.
+    // framebuffer when creating a window.
     return _device->attachWindow(rawfb->getHandle());
 
     // Set the renderer for the AGG glue layer
@@ -187,16 +186,16 @@ FBAggGlue::createRenderHandler()
     assert(agg_handler != NULL);
 
     // Get the memory buffer to have AGG render into.
-    boost::uint8_t *mem = rawfb->getOffscreenBuffer();
-    if (mem) {
-        log_debug(_("Double buffering enabled"));
-    } else {
+    boost::uint8_t *mem = 0;
+    if (rawfb->isSingleBuffered()) {
         log_debug(_("Double buffering disabled"));
         mem = rawfb->getFBMemory();
+    } else {
+        log_debug(_("Double buffering enabled"));
+        mem = rawfb->getOffscreenBuffer();
     }
     
-    // This attaches the memory from the device to the AGG
-    // renderer.
+    // This attaches the memory from the device to the AGG renderer
     agg_handler->init_buffer((unsigned char *)mem, rawfb->getFBMemSize(),
                              width, height, rawfb->getStride());
     

http://git.savannah.gnu.org/cgit//commit/?id=d787f39d93ff17e88e2ac5a999bc3000e662f7ea


commit d787f39d93ff17e88e2ac5a999bc3000e662f7ea
Merge: fa46ef5 3c5d32e
Author: Rob Savoye <address@hidden>
Date:   Sun Dec 4 19:01:53 2011 -0700

    merge from master

diff --cc gui/fb/fb.cpp
index c5810d9,b2ab1ad..69a3010
--- a/gui/fb/fb.cpp
+++ b/gui/fb/fb.cpp
@@@ -182,7 -189,7 +182,7 @@@ FBGui::~FBGui(
  bool
  FBGui::init(int argc, char *** argv)
  {
--    GNASH_REPORT_FUNCTION;
++//  GNASH_REPORT_FUNCTION;
  
      // the current renderer as set on the command line or gnashrc file
      std::string renderer = _runResources.getRenderBackend();
@@@ -322,7 -329,7 +322,7 @@@
  bool
  FBGui::run()
  {
--    GNASH_REPORT_FUNCTION;
++//  GNASH_REPORT_FUNCTION;
  
  #ifdef USE_TSLIB
      int ts_loop_count;
@@@ -363,51 -370,37 +363,51 @@@
  void
  FBGui::renderBuffer()
  {
-     GNASH_REPORT_FUNCTION;
 -    // GNASH_REPORT_FUNCTION;
 -
 -//    if ( _drawbounds.size() == 0 ) return; // nothing to do..
 -
 -#ifdef ENABLE_DOUBLE_BUFFERING
 -
 -    // Size of a pixel in bytes
 -    // NOTE: +7 to support 15 bpp
 -    const unsigned int pixel_size = (var_screeninfo.bits_per_pixel+7)/8;
++//  GNASH_REPORT_FUNCTION;
      
 -    for (unsigned int bno=0; bno < _drawbounds.size(); bno++) {  
 -        geometry::Range2d<int>& bounds = _drawbounds[bno];
 -        assert ( ! bounds.isWorld() );  
 +#if 0
 +    if ( _drawbounds.size() == 0 ) {
 +        log_debug("No Drawbounds set!");
 +        return; // nothing to do..
 +    }
      
 -        // Size, in bytes, of a row that has to be copied
 -        const unsigned int row_size = (bounds.width()+1) * pixel_size;
 -      
 -        // copy each row
 -        const int minx = bounds.getMinX();
 -        const int maxy = bounds.getMaxY();
 -
 -        const int minx1 = minx+_xpos;
 -        for (int y=bounds.getMinY(), y1=y+_ypos; y<=maxy; ++y, ++y1) {
 -            const unsigned int pix_idx_in = y*m_rowsize + minx*pixel_size;
 -            const unsigned int pix_idx_out = y1*m_rowsize + minx1*pixel_size;
 -            memcpy(&(fbmem[pix_idx_out]), &buffer[pix_idx_in], row_size);
 -        }
 -    }  
 -       
 -#endif
 +    renderer::rawfb::RawFBDevice *rawfb = reinterpret_cast
 +        <renderer::rawfb::RawFBDevice *>(_glue.get());
 +
 +    // If we have a valid pointer to offscreen memory, then we're
 +    // using software double buffering.
 +    if (rawfb->getOffscreenBuffer()) {
  
 +        // Size of a pixel in bytes
 +        // NOTE: +7 to support 15 bpp
 +        const unsigned int pixel_size = (_var_screeninfo.bits_per_pixel+7)/8;
 +        
 +        for (unsigned int bno=0; bno < _drawbounds.size(); bno++) {  
 +            geometry::Range2d<int>& bounds = _drawbounds[bno];
 +            assert ( ! bounds.isWorld() );  
 +            
 +            // Size, in bytes, of a row that has to be copied
 +            const unsigned int row_size = (bounds.width()+1) * pixel_size;
 +            
 +            // copy each row
 +            const int minx = bounds.getMinX();
 +            const int maxy = bounds.getMaxY();
 +            
 +            boost::uint8_t *srcmem = rawfb->getOffscreenBuffer();
 +            boost::uint8_t *dstmem = rawfb->getFBMemory();
 +            size_t rowsize = rawfb->getWidth()
 +                * ((rawfb->getDepth() + 7)/8);
 +            
 +            const int minx1 = minx+_xpos;
 +            for (int y=bounds.getMinY(), y1=y+_ypos; y<=maxy; ++y, ++y1) {
 +                const unsigned int pix_idx_in = y * rowsize + minx * 
pixel_size;
 +                const unsigned int pix_idx_out = y1 * rowsize + minx1 * 
pixel_size;
 +                memcpy(&(dstmem[pix_idx_out]), &srcmem[pix_idx_in], row_size);
 +            }
 +        }  
 +    }
 +#endif
 +    
      _glue->render();
  }
  
@@@ -415,7 -408,7 +415,7 @@@ boo
  FBGui::createWindow(const char* /*title*/, int /*width*/, int /*height*/,
                       int /*xPosition*/, int /*yPosition*/)
  {
--    GNASH_REPORT_FUNCTION;
++//  GNASH_REPORT_FUNCTION;
  
      _runResources.setRenderer(_renderer);
      
@@@ -484,19 -477,28 +484,19 @@@ FBGui::showMouse(bool /*show*/
  }
  
  void
 -FBGui::setInvalidatedRegion(const SWFRect& /* bounds */)
 +FBGui::setInvalidatedRegion(const SWFRect& bounds)
  {
-     GNASH_REPORT_FUNCTION;
 -    // GNASH_REPORT_FUNCTION;
 -
 -#if 0
 -     FBAggGlue *fbag = reinterpret_cast
 -        <FBAggGlue *>(_glue.get());
++//  GNASH_REPORT_FUNCTION;
  
 -     fbag->setInvalidatedRegion(bounds);
 -#endif
 +    setInvalidatedRegion(bounds);
  }
  
  void
  FBGui::setInvalidatedRegions(const InvalidatedRanges& ranges)
   {
-      GNASH_REPORT_FUNCTION;
 -     // GNASH_REPORT_FUNCTION;
++//   GNASH_REPORT_FUNCTION;
  
 -#if 0
 -     FBAggGlue *fbag = reinterpret_cast<FBAggGlue *>(_glue.get());
 -     fbag->setInvalidatedRegions(ranges);
 -#endif
 -     _glue->setInvalidatedRegions(ranges);     
 +//   setInvalidatedRegions(ranges);
  }
  
  char *
diff --cc gui/fb/fb_glue_ovg.cpp
index af80165,af80165..24b8951
--- a/gui/fb/fb_glue_ovg.cpp
+++ b/gui/fb/fb_glue_ovg.cpp
@@@ -162,8 -162,8 +162,28 @@@ FBOvgGlue::createRenderHandler(
  
  /// Not implemented, Fixme
  void
--FBOvgGlue::setInvalidatedRegions(const InvalidatedRanges& /* ranges */)
++FBOvgGlue::setInvalidatedRegions(const InvalidatedRanges& ranges)
  {
++    if (!_renderer) {
++        log_error("No renderer set!");
++        return;
++    }
++
++    _renderer->set_invalidated_regions(ranges);
++    
++    _drawbounds.clear();
++
++    for (size_t rno = 0; rno<ranges.size(); rno++) {
++        geometry::Range2d<int> bounds = Intersection(
++            _renderer->world_to_pixel(ranges.getRange(rno)),
++            _validbounds);
++        // it may happen that a particular range is out of the screen, which 
++        // will lead to bounds==null. 
++        if (bounds.isNull()) continue; 
++        
++        _drawbounds.push_back(bounds);   
++    }
++    
      // GNASH_REPORT_FUNCTION;
      // if (_renderer) {
      //     _renderer->setInvalidatedRegions(ranges);
diff --cc gui/fb/fb_glue_ovg.h
index bdade49,de09411..84de344
--- a/gui/fb/fb_glue_ovg.h
+++ b/gui/fb/fb_glue_ovg.h
@@@ -87,10 -84,6 +87,10 @@@ private
      int         _width;
      int         _height;
      
 +    //Rectangle _bounds;
 +    std::vector< geometry::Range2d<int> > _drawbounds;
 +    geometry::Range2d<int>              _validbounds;
-     
++
      // EGL needs it's own display device, as that's how it stays platform
      // independent. For a Framebuffer we use that, and on the desktop,
      // well, there really isn't framebuffer support on the desktop because

http://git.savannah.gnu.org/cgit//commit/?id=fa46ef50ac0fc12f7f808033479a314d30a6282b


commit fa46ef50ac0fc12f7f808033479a314d30a6282b
Author: Rob Savoye <address@hidden>
Date:   Sun Dec 4 18:26:24 2011 -0700

    use the protected GnashDevice from the base class, instead of our own.

diff --git a/gui/fb/fb_glue_agg.h b/gui/fb/fb_glue_agg.h
index fb0a0c6..068b1a5 100644
--- a/gui/fb/fb_glue_agg.h
+++ b/gui/fb/fb_glue_agg.h
@@ -1,5 +1,5 @@
 //
-//   Copyright (C) 2005, 2006, 2007, 2008, 2009, 2010 Free Software
+//   Copyright (C) 2005, 2006, 2007, 2008, 2009, 2010, 2011 Free Software
 //   Foundation, Inc
 //
 // This program is free software; you can redistribute it and/or modify
@@ -81,6 +81,7 @@ public:
     //
     void setInvalidatedRegion(const SWFRect& bounds);
     void setInvalidatedRegions(const InvalidatedRanges &ranges);
+
     /// \brief
     ///  The Width of the drawing area, in pixels. For framebuffer
     ///  based devices, this is the size of the display screen.
@@ -94,37 +95,20 @@ public:
     void render();
     void render(void* const /* region */) { };
 
-    // these are used only for debugging purpose to access private data
-    size_t getBounds() { return _drawbounds.size(); };
-    size_t getMemSize() { return _fixinfo.smem_len; };
+    size_t getWidth()  { return (_device) ? _device->getWidth() : 0; };
+    size_t getHeight() { return (_device) ? _device->getWidth() : 0; };
+    size_t getDepth()  { return (_device) ? _device->getDepth() : 0; };
     
-    size_t getWidth()  { return (_Device) ? _Device->getWidth() : 0; };
-    size_t getHeight() { return (_Device) ? _Device->getWidth() : 0; };
-    size_t getDepth()  { return (_Device) ? _Device->getDepth() : 0; };
-    boost::scoped_ptr<renderer::GnashDevice> _Device;
 protected:
     /// This is the file descriptor for the framebuffer memory
-    int                      _fd;
-    struct fb_fix_screeninfo _fixinfo;
-    struct fb_var_screeninfo _varinfo;
-    boost::shared_ptr<boost::uint8_t> _fbmem;  // framebuffer memory
+    int                                 _fd;
+    struct fb_fix_screeninfo            _fixinfo;
+    struct fb_var_screeninfo            _varinfo;
     
-#ifdef ENABLE_DOUBLE_BUFFERING
-    boost::shared_ptr<boost::uint8_t> _buffer; // offscreen buffer
-#endif
-    geometry::Range2d<int> _validbounds;
-    std::vector< geometry::Range2d<int> > _drawbounds;
-
-    boost::scoped_ptr<Renderer> _renderer;
+    boost::scoped_ptr<Renderer>         _renderer;
 
-#ifdef BUILD_RAWFB_DEVICE
-    renderer::rawfb::RawFBDevice        _display;
-#else
-# ifdef BUILD_X11_DEVICE
-    renderer::x11::X11Device            _display;
-# endif
-#endif
-    
+    geometry::Range2d<int>              _validbounds;
+    std::vector< geometry::Range2d<int> > _drawbounds;    
 };
 
 } // end of namespace gui

http://git.savannah.gnu.org/cgit//commit/?id=8c78786456110c4886be47ae9a1a7f5958a69643


commit 8c78786456110c4886be47ae9a1a7f5958a69643
Author: Rob Savoye <address@hidden>
Date:   Sun Dec 4 18:25:35 2011 -0700

    cleanup AGG double buffering to work with libdevice

diff --git a/gui/fb/fb_glue_agg.cpp b/gui/fb/fb_glue_agg.cpp
index 610b173..c1526de 100644
--- a/gui/fb/fb_glue_agg.cpp
+++ b/gui/fb/fb_glue_agg.cpp
@@ -1,5 +1,5 @@
 //
-//   Copyright (C) 2005, 2006, 2007, 2008, 2009, 2010 Free Software
+//   Copyright (C) 2005, 2006, 2007, 2008, 2009, 2010, 2011 Free Software
 //   Foundation, Inc
 //
 // This program is free software; you can redistribute it and/or modify
@@ -42,16 +42,6 @@ namespace gnash {
 
 namespace gui {
 
-// FBGlue::FBGlue()
-// {
-//     GNASH_REPORT_FUNCTION;
-// }
-
-// FBGlue::~FBGlue()
-// {
-//     GNASH_REPORT_FUNCTION;
-// }
-
 //---------------------------------------------
 FBAggGlue::FBAggGlue()
     : _fd(-1)
@@ -91,7 +81,7 @@ FBAggGlue::setInvalidatedRegion(const SWFRect &/*bounds */)
 void
 FBAggGlue::setInvalidatedRegions(const InvalidatedRanges &ranges)
 {
-    // GNASH_REPORT_FUNCTION;
+    GNASH_REPORT_FUNCTION;
 
     if (!_renderer) {
         log_error("No renderer set!");
@@ -112,7 +102,6 @@ FBAggGlue::setInvalidatedRegions(const InvalidatedRanges 
&ranges)
         
         _drawbounds.push_back(bounds);   
     }
-
 }
 
 bool
@@ -125,6 +114,14 @@ FBAggGlue::init (int argc, char ***argv)
     _device.reset(new renderer::rawfb::RawFBDevice);
     _device->initDevice(argc, *argv);    
 
+    renderer::rawfb::RawFBDevice *rawfb = reinterpret_cast
+        <renderer::rawfb::RawFBDevice *>(_device.get());
+
+    // You must pass in the file descriptor to the opened
+    // framebuffer when creating a window. Under X11, this is
+    // actually the XID of the created window.
+    return _device->attachWindow(rawfb->getHandle());
+
     // Set the renderer for the AGG glue layer
     gnash::Renderer *rend = reinterpret_cast<gnash::Renderer *>
                                                 (createRenderHandler());
@@ -135,23 +132,12 @@ FBAggGlue::init (int argc, char ***argv)
         return false;
     }
 
-#ifdef PIXELFORMAT_LUT8
     // Set grayscale for 8 bit modes
-    renderer::rawfb::RawFBDevice *rawfb = reinterpret_cast
-        <renderer::rawfb::RawFBDevice *>(_device.get());    
     if (_varinfo.bits_per_pixel == 8) {
        if (!rawfb->setGrayscaleLUT8())
            return false;
     }
-#endif
 
-    _display.initDevice(0, 0);
-
-    // You must pass in the file descriptor to the opened
-    // framebuffer when creating a window. Under X11, this is
-    // actually the XID of the created window.
-    return _device->attachWindow(_display.getHandle());
-    
     return true;
 }
 
@@ -169,26 +155,9 @@ FBAggGlue::createRenderHandler()
     
     const int width     = _device->getWidth();
     const int height    = _device->getHeight();
-    const int bpp       = _device->getDepth();
     
-    // TODO: should recalculate!  
-    boost::uint8_t       *mem;
-    Renderer_agg_base   *agg_handler;
-
-    agg_handler = NULL;
-
     _validbounds.setTo(0, 0, width - 1, height - 1);
     
-#ifdef ENABLE_DOUBLE_BUFFERING
-    log_debug(_("Double buffering enabled"));
-    mem = _buffer;
-#else
-    log_debug(_("Double buffering disabled"));
-    mem = _device->getFBMemory();
-#endif
-    
-    agg_handler = NULL;
-  
     // choose apropriate pixel format
 
     renderer::rawfb::RawFBDevice *rawfb = reinterpret_cast
@@ -199,14 +168,15 @@ FBAggGlue::createRenderHandler()
              rawfb->getGreenSize());
     log_debug(_("blue channel: %d / %d"), rawfb->getBlueOffset(), 
               rawfb->getBlueSize());
-    log_debug(_("Total bits per pixel: %d"), bpp);
+    log_debug(_("Total bits per pixel: %d"),  rawfb->getDepth());
     
     const char* pixelformat = agg_detect_pixel_format(
         rawfb->getRedOffset(),   rawfb->getRedSize(),
         rawfb->getGreenOffset(), rawfb->getGreenSize(),
         rawfb->getBlueOffset(),  rawfb->getBlueSize(),
-        bpp);
+        rawfb->getDepth());
 
+    Renderer_agg_base *agg_handler = 0;
     if (pixelformat) {
        agg_handler = create_Renderer_agg(pixelformat);
     } else {
@@ -216,11 +186,19 @@ FBAggGlue::createRenderHandler()
     
     assert(agg_handler != NULL);
 
-    // This attaches the memory from the framebuffer to the AGG
+    // Get the memory buffer to have AGG render into.
+    boost::uint8_t *mem = rawfb->getOffscreenBuffer();
+    if (mem) {
+        log_debug(_("Double buffering enabled"));
+    } else {
+        log_debug(_("Double buffering disabled"));
+        mem = rawfb->getFBMemory();
+    }
+    
+    // This attaches the memory from the device to the AGG
     // renderer.
-    size_t rowsize = width*((bpp+7)/8);
-    agg_handler->init_buffer((unsigned char *)mem, _device->getFBMemSize(),
-                             width, height, rowsize);
+    agg_handler->init_buffer((unsigned char *)mem, rawfb->getFBMemSize(),
+                             width, height, rawfb->getStride());
     
     return (Renderer *)agg_handler;
 }    
@@ -233,49 +211,45 @@ FBAggGlue::prepDrawingArea(FbWidget */* drawing_area */)
     // creating the renderer.
 }
 
-#if 0
-void
-FBGlue::render(void * /* region */)
-{
-    GNASH_REPORT_FUNCTION;
-}
-#endif
-
 void
 FBAggGlue::render()
 {
     GNASH_REPORT_FUNCTION;
 
-    if ( _drawbounds.size() == 0 ) {
-        return; // nothing to do..
+    if (_drawbounds.size() == 0 ) {
+        log_debug("No Drawbounds set!");
+//        return; // nothing to do..
     }
-    
-#ifdef ENABLE_DOUBLE_BUFFERING
+
+#if 0
     // Size of a pixel in bytes
     // NOTE: +7 to support 15 bpp
-    const unsigned int pixel_size = (var_screeninfo.bits_per_pixel+7)/8;
+    const unsigned int pixel_size = (getDepth()+7)/8;
     
     for (unsigned int bno=0; bno < _drawbounds.size(); bno++) {
-       geometry::Range2d<int>& bounds = _drawbounds[bno];
+        geometry::Range2d<int>& bounds = _drawbounds[bno];
         
-       assert ( ! bounds.isWorld() );
-       
-       // Size, in bytes, of a row that has to be copied
-       const unsigned int row_size = (bounds.width()+1) * pixel_size;
-       
-       // copy each row
-       const int minx = bounds.getMinX();
-       const int maxy = bounds.getMaxY();
-       
-       for (int y=bounds.getMinY(); y<=maxy; ++y) {    
-           const unsigned int pixel_index = y * _rowsize + minx*pixel_size;
-           memcpy(&(_fbmem[pixel_index]), &buffer[pixel_index], row_size);
-           
-       }
-    }  
-    
+        assert ( ! bounds.isWorld() );
+        
+        // Size, in bytes, of a row that has to be copied
+        const unsigned int row_size = (bounds.width()+1) * pixel_size;
+        
+        // copy each row
+        const int minx = bounds.getMinX();
+        const int maxy = bounds.getMaxY();
+        
+        boost::uint8_t *srcmem = _device->getOffscreenBuffer();
+        boost::uint8_t *dstmem = _device->getFBMemory();
+        
+        for (int y=bounds.getMinY(); y<=maxy; ++y) {    
+            const unsigned int pixel_index = y * row_size + minx*pixel_size;
+            memcpy(&(dstmem[pixel_index]), &srcmem[pixel_index], row_size);
+        }
+    }    
 #endif
     
+    _device->swapBuffers();
+    
 #ifdef DEBUG_SHOW_FPS
     profile();
 #endif

http://git.savannah.gnu.org/cgit//commit/?id=8816e9b400d1d113146e62b3b0158602cce4d102


commit 8816e9b400d1d113146e62b3b0158602cce4d102
Author: Rob Savoye <address@hidden>
Date:   Sun Dec 4 18:19:24 2011 -0700

    add getStride() as it's now in the base class

diff --git a/libdevice/egl/eglDevice.h b/libdevice/egl/eglDevice.h
index 154177e..831eb4b 100644
--- a/libdevice/egl/eglDevice.h
+++ b/libdevice/egl/eglDevice.h
@@ -74,11 +74,16 @@ class EGLDevice : public GnashDevice
     /// Return a string with the error code as text, instead of a numeric value
     const char *getErrorString(int error);
 
+    size_t getStride() {
+        return getDepth() * getWidth();
+    };
+
     // Accessors for the settings needed by higher level code.
     // Surface accessors
     size_t getWidth() {
         return getWidth(_eglSurface);
     };
+    
     size_t getHeight() {
         return getHeight(_eglSurface);
     }

http://git.savannah.gnu.org/cgit//commit/?id=c51e4510eb8433f32abaea29b5f96b4af2d56498


commit c51e4510eb8433f32abaea29b5f96b4af2d56498
Author: Rob Savoye <address@hidden>
Date:   Sun Dec 4 17:31:42 2011 -0700

    remove leftover double buffering code that is now replaced by swapBuffers()

diff --git a/gui/fb/fb.cpp b/gui/fb/fb.cpp
index b2ab1ad..c5810d9 100644
--- a/gui/fb/fb.cpp
+++ b/gui/fb/fb.cpp
@@ -1,6 +1,6 @@
 //
-//   Copyright (C) 2005, 2006, 2007, 2008, 2009, 2010,
-//   2011 Free Software Foundation, Inc
+//   Copyright (C) 2005, 2006, 2007, 2008, 2009, 2010, 2011 Free Software
+//   Foundation, Inc
 //
 // This program is free software; you can redistribute it and/or modify
 // it under the terms of the GNU General Public License as published by
@@ -177,13 +177,6 @@ FBGui::~FBGui()
         log_debug(_("Closing framebuffer device"));
         close(_fd);
     }
-
-#ifdef ENABLE_DOUBLE_BUFFERING
-    if (buffer) {
-        log_debug(_("Freeing offscreen buffer"));
-        free(buffer);
-    }
-#endif
 }
 
 bool
@@ -370,37 +363,51 @@ FBGui::run()
 void
 FBGui::renderBuffer()
 {
-    // GNASH_REPORT_FUNCTION;
-
-//    if ( _drawbounds.size() == 0 ) return; // nothing to do..
-
-#ifdef ENABLE_DOUBLE_BUFFERING
-
-    // Size of a pixel in bytes
-    // NOTE: +7 to support 15 bpp
-    const unsigned int pixel_size = (var_screeninfo.bits_per_pixel+7)/8;
+    GNASH_REPORT_FUNCTION;
     
-    for (unsigned int bno=0; bno < _drawbounds.size(); bno++) {  
-        geometry::Range2d<int>& bounds = _drawbounds[bno];
-        assert ( ! bounds.isWorld() );  
+#if 0
+    if ( _drawbounds.size() == 0 ) {
+        log_debug("No Drawbounds set!");
+        return; // nothing to do..
+    }
     
-        // Size, in bytes, of a row that has to be copied
-        const unsigned int row_size = (bounds.width()+1) * pixel_size;
-      
-        // copy each row
-        const int minx = bounds.getMinX();
-        const int maxy = bounds.getMaxY();
-
-        const int minx1 = minx+_xpos;
-        for (int y=bounds.getMinY(), y1=y+_ypos; y<=maxy; ++y, ++y1) {
-            const unsigned int pix_idx_in = y*m_rowsize + minx*pixel_size;
-            const unsigned int pix_idx_out = y1*m_rowsize + minx1*pixel_size;
-            memcpy(&(fbmem[pix_idx_out]), &buffer[pix_idx_in], row_size);
-        }
-    }  
-       
-#endif
+    renderer::rawfb::RawFBDevice *rawfb = reinterpret_cast
+        <renderer::rawfb::RawFBDevice *>(_glue.get());
+
+    // If we have a valid pointer to offscreen memory, then we're
+    // using software double buffering.
+    if (rawfb->getOffscreenBuffer()) {
 
+        // Size of a pixel in bytes
+        // NOTE: +7 to support 15 bpp
+        const unsigned int pixel_size = (_var_screeninfo.bits_per_pixel+7)/8;
+        
+        for (unsigned int bno=0; bno < _drawbounds.size(); bno++) {  
+            geometry::Range2d<int>& bounds = _drawbounds[bno];
+            assert ( ! bounds.isWorld() );  
+            
+            // Size, in bytes, of a row that has to be copied
+            const unsigned int row_size = (bounds.width()+1) * pixel_size;
+            
+            // copy each row
+            const int minx = bounds.getMinX();
+            const int maxy = bounds.getMaxY();
+            
+            boost::uint8_t *srcmem = rawfb->getOffscreenBuffer();
+            boost::uint8_t *dstmem = rawfb->getFBMemory();
+            size_t rowsize = rawfb->getWidth()
+                * ((rawfb->getDepth() + 7)/8);
+            
+            const int minx1 = minx+_xpos;
+            for (int y=bounds.getMinY(), y1=y+_ypos; y<=maxy; ++y, ++y1) {
+                const unsigned int pix_idx_in = y * rowsize + minx * 
pixel_size;
+                const unsigned int pix_idx_out = y1 * rowsize + minx1 * 
pixel_size;
+                memcpy(&(dstmem[pix_idx_out]), &srcmem[pix_idx_in], row_size);
+            }
+        }  
+    }
+#endif
+    
     _glue->render();
 }
 
@@ -477,28 +484,19 @@ FBGui::showMouse(bool /*show*/)
 }
 
 void
-FBGui::setInvalidatedRegion(const SWFRect& /* bounds */)
+FBGui::setInvalidatedRegion(const SWFRect& bounds)
 {
-    // GNASH_REPORT_FUNCTION;
-
-#if 0
-     FBAggGlue *fbag = reinterpret_cast
-        <FBAggGlue *>(_glue.get());
+    GNASH_REPORT_FUNCTION;
 
-     fbag->setInvalidatedRegion(bounds);
-#endif
+    setInvalidatedRegion(bounds);
 }
 
 void
 FBGui::setInvalidatedRegions(const InvalidatedRanges& ranges)
  {
-     // GNASH_REPORT_FUNCTION;
+     GNASH_REPORT_FUNCTION;
 
-#if 0
-     FBAggGlue *fbag = reinterpret_cast<FBAggGlue *>(_glue.get());
-     fbag->setInvalidatedRegions(ranges);
-#endif
-     _glue->setInvalidatedRegions(ranges);     
+//   setInvalidatedRegions(ranges);
 }
 
 char *
@@ -725,7 +723,7 @@ FBGui::checkForData()
         (*it)->check();
         boost::shared_ptr<InputDevice::input_data_t> ie = (*it)->popData();
         if (ie) {
-#if 1
+#if 0
             std::cerr << "Got data: " << ((ie->pressed) ? "true" : "false");
             std::cerr << ", " << ie->key << ", " << ie->modifier;
             std::cerr << ", " << ie->x << ", " << ie->y << std::endl;

http://git.savannah.gnu.org/cgit//commit/?id=069fc55e4a4cdf18aa09f2d97874d7b6d24c8b8d


commit 069fc55e4a4cdf18aa09f2d97874d7b6d24c8b8d
Author: Rob Savoye <address@hidden>
Date:   Sun Dec 4 17:30:11 2011 -0700

    fix copyright date

diff --git a/gui/fb/fb_glue.h b/gui/fb/fb_glue.h
index 381ad76..fd38de0 100644
--- a/gui/fb/fb_glue.h
+++ b/gui/fb/fb_glue.h
@@ -1,5 +1,5 @@
 //
-//   Copyright (C) 2005, 2006, 2007, 2008, 2009, 2010 Free Software
+//   Copyright (C) 2005, 2006, 2007, 2008, 2009, 2010, 2011 Free Software
 //   Foundation, Inc
 //
 // This program is free software; you can redistribute it and/or modify
diff --git a/gui/fb/fbsup.h b/gui/fb/fbsup.h
index 9c56e3c..6a3ac2a 100644
--- a/gui/fb/fbsup.h
+++ b/gui/fb/fbsup.h
@@ -1,6 +1,6 @@
 //
-//   Copyright (C) 2005, 2006, 2007, 2008, 2009, 2010,
-//   2011 Free Software Foundation, Inc
+//   Copyright (C) 2005, 2006, 2007, 2008, 2009, 2010, 2011 Free Software
+//   Foundation, Inc
 //
 // This program is free software; you can redistribute it and/or modify
 // it under the terms of the GNU General Public License as published by

http://git.savannah.gnu.org/cgit//commit/?id=62fa992d4bafcacd89fcc7696bbb54f0d8c78e7b


commit 62fa992d4bafcacd89fcc7696bbb54f0d8c78e7b
Author: Rob Savoye <address@hidden>
Date:   Sun Dec 4 17:29:31 2011 -0700

    remove commented out lines

diff --git a/gui/fb/fb_glue_ovg.h b/gui/fb/fb_glue_ovg.h
index 53d1242..bdade49 100644
--- a/gui/fb/fb_glue_ovg.h
+++ b/gui/fb/fb_glue_ovg.h
@@ -81,13 +81,11 @@ public:
 
     // these are used only for debugging purpose to access private data
     size_t getBounds() { return _drawbounds.size(); };
-    // size_t getMemSize() { return _fixinfo.smem_len; };
 
 private:
     int         _stride;
     int         _width;
     int         _height;
-    boost::uint8_t *_offscreenbuf; // FIXME: I think this should go away
     
     //Rectangle _bounds;
     std::vector< geometry::Range2d<int> > _drawbounds;
@@ -105,7 +103,6 @@ private:
     renderer::x11::X11Device            _display;
 # endif
 #endif
-    //    boost::scoped_ptr<Renderer> _renderer;
 };
 
 } // end of namespace gui

http://git.savannah.gnu.org/cgit//commit/?id=ac61d617ad84ceb5204a832b720bf31cc6e2e00b


commit ac61d617ad84ceb5204a832b720bf31cc6e2e00b
Author: Rob Savoye <address@hidden>
Date:   Sun Dec 4 17:28:29 2011 -0700

    use isSingleBuffered() instead of ifdef

diff --git a/libdevice/rawfb/RawFBDevice.cpp b/libdevice/rawfb/RawFBDevice.cpp
index 3b06b17..e22259e 100644
--- a/libdevice/rawfb/RawFBDevice.cpp
+++ b/libdevice/rawfb/RawFBDevice.cpp
@@ -220,10 +220,11 @@ RawFBDevice::attachWindow(GnashDevice::native_window_t 
window)
         return false;
     }
     
-#ifdef ENABLE_DOUBLE_BUFFERING
-    // Create an offscreen buffer the same size as the Framebuffer
-    _offscreen_buffer.reset(new boost::uint8_t[_fixinfo.smem_len]);
-#endif
+    if (!isSingleBuffered()) {
+        // Create an offscreen buffer the same size as the Framebuffer
+        _offscreen_buffer.reset(new boost::uint8_t[_fixinfo.smem_len]);
+        memset(_offscreen_buffer.get(), 0, _fixinfo.smem_len);
+    }
     
     return true;
 }
diff --git a/libdevice/rawfb/RawFBDevice.h b/libdevice/rawfb/RawFBDevice.h
index 439ebec..8ae4ce9 100644
--- a/libdevice/rawfb/RawFBDevice.h
+++ b/libdevice/rawfb/RawFBDevice.h
@@ -130,11 +130,11 @@ class RawFBDevice : public GnashDevice
     bool setGrayscaleLUT8();
 
     bool isSingleBuffered() {
-        if (_offscreen_buffer) {
-            return true;
-        } else {
-            return false;
-        }
+#ifdef ENABLE_DOUBLE_BUFFERING
+        return true;
+#else
+        return false;
+#endif
     }
 
     bool swapBuffers() {

http://git.savannah.gnu.org/cgit//commit/?id=dbd8d539a782f3fc7279bcff963f0c4032c63832


commit dbd8d539a782f3fc7279bcff963f0c4032c63832
Author: Rob Savoye <address@hidden>
Date:   Sun Dec 4 16:22:36 2011 -0700

    use getStride() instead of calculating it ourselves

diff --git a/libdevice/rawfb/test_rawfb.cpp b/libdevice/rawfb/test_rawfb.cpp
index 513a09c..7a2194b 100644
--- a/libdevice/rawfb/test_rawfb.cpp
+++ b/libdevice/rawfb/test_rawfb.cpp
@@ -1,5 +1,5 @@
 // 
-//   Copyright (C) 2010 Free Software Foundation, Inc
+//   Copyright (C) 2010, 2011 Free Software Foundation, Inc
 // 
 // This program is free software; you can redistribute it and/or modify
 // it under the terms of the GNU General Public License as published by
@@ -76,6 +76,8 @@ main(int argc, char *argv[])
     } else {
         runtest.fail("RawFBDevice::getOffscreenBuffer()");
     }
+#else
+    runtest.untested("RawFBDevice::getOffscreenBuffer()");
 #endif
     
     if (ret && rfb.getStride()) {
@@ -159,10 +161,11 @@ main(int argc, char *argv[])
     // raw framebuffer to make sure it got initialized correctly.
     int x = 0, y = 0;
     long location = 0;
-    int line_length = rfb.getWidth() * ((rfb.getDepth()+7)/8);
-
-    boost::uint8_t *fbp = rfb.getFBMemory();
+    int line_length = rfb.getStride();
 
+    boost::uint8_t *fbp = 0;
+    fbp = rfb.getFBMemory();
+    
     for(y=100; y<102; y++);            /* Where we are going to put the pixel 
*/
     
     for(x=0; x<200; x++) {
@@ -174,7 +177,6 @@ main(int argc, char *argv[])
         *(fbp + location + 2) = 200; /* A lot of red */
         *(fbp + location + 3) = 0; /* No transparency */
     }
-
 }
 
 // Local Variables:

http://git.savannah.gnu.org/cgit//commit/?id=0acadd7e34d41955893cf98fdd6d2a67be48aba1


commit 0acadd7e34d41955893cf98fdd6d2a67be48aba1
Author: Rob Savoye <address@hidden>
Date:   Sun Dec 4 16:21:45 2011 -0700

    make isSingleBuffered() really work.

diff --git a/libdevice/rawfb/RawFBDevice.h b/libdevice/rawfb/RawFBDevice.h
index 83ba7ba..439ebec 100644
--- a/libdevice/rawfb/RawFBDevice.h
+++ b/libdevice/rawfb/RawFBDevice.h
@@ -1,5 +1,5 @@
 //
-//   Copyright (C) 2005, 2006, 2007, 2008, 2009, 2010 Free Software
+//   Copyright (C) 2005, 2006, 2007, 2008, 2009, 2010, 2011 Free Software
 //   Foundation, Inc
 //
 // This program is free software; you can redistribute it and/or modify
@@ -74,8 +74,6 @@ class RawFBDevice : public GnashDevice
     size_t getWidth() { return _varinfo.xres; };
     size_t getHeight() { return _varinfo.yres; };
     
-    bool isSingleBuffered() { return true; }
-    
     bool supportsRenderer(GnashDevice::rtype_t /* rtype */) { return false; }
     
     bool isBufferDestroyed() { return false; }
@@ -131,21 +129,27 @@ class RawFBDevice : public GnashDevice
     /// This GUI currently does not support palette modes. 
     bool setGrayscaleLUT8();
 
+    bool isSingleBuffered() {
+        if (_offscreen_buffer) {
+            return true;
+        } else {
+            return false;
+        }
+    }
+
     bool swapBuffers() {
-#ifdef ENABLE_DOUBLE_BUFFERING
         // When using AGG, the pointer to the offscreen buffer has been
         // passed to AGG, so it renders in the offscreen buffer by default,
         // leaving it up to us to manually copy the data from the offscreeen
         // buffer into the real framebuffer memory.
-        if (_fbmem && _offscreen_buffer) {
+        if (_offscreen_buffer) {
             std::copy(_fbmem, _fbmem + _fixinfo.smem_len,
                       _offscreen_buffer.get());
             return true;
-        }
-#else
-        // When single buffered, there is no data to copy, so always true
-        return true;
-#endif
+        } else {
+            // When single buffered, there is no data to copy, so always true
+            return true;
+        }     
         return false;
     }
     

http://git.savannah.gnu.org/cgit//commit/?id=b58acd461566474d800fa2dc81fab711dc1547c6


commit b58acd461566474d800fa2dc81fab711dc1547c6
Author: Rob Savoye <address@hidden>
Date:   Sun Dec 4 16:20:51 2011 -0700

    add getStride() to base class

diff --git a/libdevice/GnashDevice.h b/libdevice/GnashDevice.h
index 84efef4..1c6676c 100644
--- a/libdevice/GnashDevice.h
+++ b/libdevice/GnashDevice.h
@@ -80,6 +80,9 @@ struct GnashDevice
     // int queryGNASHConfig() { return queryGNASHConfig(_gnashDisplay); };
     // int queryGNASHConfig(GNASHDisplay display);
 
+    /// Get the stride of the device
+    virtual size_t getStride() = 0;
+ 
     /// Get the width of the device
     virtual size_t getWidth() = 0;
 

http://git.savannah.gnu.org/cgit//commit/?id=5636bc0135b0688affd17f3b239a71dbd62327b4


commit 5636bc0135b0688affd17f3b239a71dbd62327b4
Author: Rob Savoye <address@hidden>
Date:   Sun Dec 4 15:01:52 2011 -0700

    add comments about swapBuffers() beyhaviour

diff --git a/libdevice/rawfb/RawFBDevice.cpp b/libdevice/rawfb/RawFBDevice.cpp
index 9fa3c9a..3b06b17 100644
--- a/libdevice/rawfb/RawFBDevice.cpp
+++ b/libdevice/rawfb/RawFBDevice.cpp
@@ -223,7 +223,7 @@ RawFBDevice::attachWindow(GnashDevice::native_window_t 
window)
 #ifdef ENABLE_DOUBLE_BUFFERING
     // Create an offscreen buffer the same size as the Framebuffer
     _offscreen_buffer.reset(new boost::uint8_t[_fixinfo.smem_len]);
-#endif    
+#endif
     
     return true;
 }
diff --git a/libdevice/rawfb/RawFBDevice.h b/libdevice/rawfb/RawFBDevice.h
index 3528326..83ba7ba 100644
--- a/libdevice/rawfb/RawFBDevice.h
+++ b/libdevice/rawfb/RawFBDevice.h
@@ -132,11 +132,20 @@ class RawFBDevice : public GnashDevice
     bool setGrayscaleLUT8();
 
     bool swapBuffers() {
+#ifdef ENABLE_DOUBLE_BUFFERING
+        // When using AGG, the pointer to the offscreen buffer has been
+        // passed to AGG, so it renders in the offscreen buffer by default,
+        // leaving it up to us to manually copy the data from the offscreeen
+        // buffer into the real framebuffer memory.
         if (_fbmem && _offscreen_buffer) {
             std::copy(_fbmem, _fbmem + _fixinfo.smem_len,
                       _offscreen_buffer.get());
             return true;
         }
+#else
+        // When single buffered, there is no data to copy, so always true
+        return true;
+#endif
         return false;
     }
     
diff --git a/libdevice/rawfb/test_rawfb.cpp b/libdevice/rawfb/test_rawfb.cpp
index 834a131..513a09c 100644
--- a/libdevice/rawfb/test_rawfb.cpp
+++ b/libdevice/rawfb/test_rawfb.cpp
@@ -155,7 +155,6 @@ main(int argc, char *argv[])
     }
 #endif
 
-#if 0
     // This is a manual test to see if we can draw a line on the
     // raw framebuffer to make sure it got initialized correctly.
     int x = 0, y = 0;
@@ -175,7 +174,6 @@ main(int argc, char *argv[])
         *(fbp + location + 2) = 200; /* A lot of red */
         *(fbp + location + 3) = 0; /* No transparency */
     }
-#endif
 
 }
 

http://git.savannah.gnu.org/cgit//commit/?id=087aa0b38856ade32d9376c8354355e560abd0f0


commit 087aa0b38856ade32d9376c8354355e560abd0f0
Author: Rob Savoye <address@hidden>
Date:   Sun Dec 4 14:53:52 2011 -0700

    Add swapBuffers() for double buffering. USe a standard pointer for _fbmem, 
so boost doesn't try to free it. Fix test case

diff --git a/libdevice/rawfb/RawFBDevice.cpp b/libdevice/rawfb/RawFBDevice.cpp
index 81bb357..9fa3c9a 100644
--- a/libdevice/rawfb/RawFBDevice.cpp
+++ b/libdevice/rawfb/RawFBDevice.cpp
@@ -78,7 +78,7 @@ RawFBDevice::clear()
 {
     GNASH_REPORT_FUNCTION;
     if (_fbmem) {
-        memset(_fbmem.get(), 0, _fixinfo.smem_len);
+        memset(_fbmem, 0, _fixinfo.smem_len);
     }
     if (_offscreen_buffer) {
         memset(_offscreen_buffer.get(), 0, _fixinfo.smem_len);
@@ -90,20 +90,20 @@ RawFBDevice::~RawFBDevice()
     // GNASH_REPORT_FUNCTION;
 
     if (_fbmem) {
-        munmap(_fbmem.get(), 0);
+        munmap(_fbmem, 0);
         log_debug(_("Freeing framebuffer memory"));
-        _fbmem.reset();
-    }
-    
-    if (_fd) {
-        close (_fd);
-        _fd = -1;
+        _fbmem = 0;
     }
     
     if (_offscreen_buffer) {
         log_debug(_("Freeing offscreen buffer"));
         _offscreen_buffer.reset();
     }
+    
+    if (_fd) {
+        close (_fd);
+        _fd = -1;
+    }
 }
 
 bool
@@ -148,13 +148,10 @@ RawFBDevice::initDevice(int /* argc */, char **/* argv[] 
*/)
               _fixinfo.smem_len);
     log_debug(_("Video mode: %dx%d with %d bits per pixel."),
               _varinfo.xres, _varinfo.yres,
-              _varinfo.bits_per_pixel);    
+              _varinfo.bits_per_pixel);
+
+    log_debug("Framebuffer stride is: %d.",  _fixinfo.line_length);    
 
-#ifdef ENABLE_DOUBLE_BUFFERING
-    boost::uint8_t *mem = new boost::uint8_t[getWidth() * getHeight()];
-    _offscreen_buffer.reset(mem);
-#endif
-    
     return true;
 }
 
@@ -212,9 +209,9 @@ RawFBDevice::attachWindow(GnashDevice::native_window_t 
window)
     // of the opened device. EGL wants the descriptor here too, so
     // this way we work in a similar manner.
     if (window) {
-        _fbmem.reset((boost::uint8_t *)mmap(0, _fixinfo.smem_len,
-                                       PROT_READ|PROT_WRITE, MAP_SHARED,
-                                           window, 0));
+        _fbmem = reinterpret_cast<boost::uint8_t *>(mmap(0, _fixinfo.smem_len,
+                                        PROT_READ|PROT_WRITE, MAP_SHARED,
+                                        window, 0));
     }
         
     if (!_fbmem) {
@@ -222,7 +219,12 @@ RawFBDevice::attachWindow(GnashDevice::native_window_t 
window)
                   _fixinfo.smem_len);
         return false;
     }
-
+    
+#ifdef ENABLE_DOUBLE_BUFFERING
+    // Create an offscreen buffer the same size as the Framebuffer
+    _offscreen_buffer.reset(new boost::uint8_t[_fixinfo.smem_len]);
+#endif    
+    
     return true;
 }
     
diff --git a/libdevice/rawfb/RawFBDevice.h b/libdevice/rawfb/RawFBDevice.h
index fb24839..3528326 100644
--- a/libdevice/rawfb/RawFBDevice.h
+++ b/libdevice/rawfb/RawFBDevice.h
@@ -110,11 +110,12 @@ class RawFBDevice : public GnashDevice
     void createWindow(const char *name, int x, int y, int width, int height);
 
     // Get the memory from the real framebuffer
-    boost::uint8_t *getFBMemory() { return _fbmem.get(); };
+    boost::uint8_t *getFBMemory() { return _fbmem; };
 
-    // Get the memory from an offscreen buffer to support Double Buffering
+    // // Get the memory from an offscreen buffer to support Double Buffering
     boost::uint8_t *getOffscreenBuffer() { return _offscreen_buffer.get(); };
 
+    size_t getStride() { return _fixinfo.line_length; };
     size_t getFBMemSize() { return _fixinfo.smem_len; };
     int getHandle() { return _fd; };
     
@@ -129,6 +130,15 @@ class RawFBDevice : public GnashDevice
     /// For 8 bit (palette / LUT) modes, sets a grayscale palette.
     /// This GUI currently does not support palette modes. 
     bool setGrayscaleLUT8();
+
+    bool swapBuffers() {
+        if (_fbmem && _offscreen_buffer) {
+            std::copy(_fbmem, _fbmem + _fixinfo.smem_len,
+                      _offscreen_buffer.get());
+            return true;
+        }
+        return false;
+    }
     
 protected:
     /// Clear the framebuffer memory
@@ -138,10 +148,10 @@ protected:
     std::string                         _filespec;
     struct fb_fix_screeninfo            _fixinfo;
     struct fb_var_screeninfo            _varinfo;
-    boost::scoped_ptr<boost::uint8_t>   _fbmem;
+    boost::uint8_t                     *_fbmem;
     
     boost::scoped_ptr<boost::uint8_t>   _offscreen_buffer;
-    struct fb_cmap                      _cmap;       // the colormap    
+    struct fb_cmap                      _cmap;       // the colormap
 };
 
 #ifdef ENABLE_FAKE_FRAMEBUFFER
diff --git a/libdevice/rawfb/test_rawfb.cpp b/libdevice/rawfb/test_rawfb.cpp
index 3c556f0..834a131 100644
--- a/libdevice/rawfb/test_rawfb.cpp
+++ b/libdevice/rawfb/test_rawfb.cpp
@@ -56,18 +56,28 @@ main(int argc, char *argv[])
     dbglogfile.setVerbosity();
 
     rawfb::RawFBDevice rfb;
+    
+    if (!rfb.initDevice(argc, argv)) {
+        runtest.fail("RawFBDevice:InitDevice()");
+    } else {
+        runtest.pass("RawFBDevice:InitDevice()");
+    }
 
-    bool ret = rfb.initDevice(argc, argv);
-    if (ret <= 0) {
-        exit(0);
+    bool ret = rfb.attachWindow(rfb.getHandle());
+    if (rfb.getFBMemory()) {
+        runtest.pass("RawFBDevice::attachWindow()");
+    } else {
+        runtest.fail("RawFBDevice::attachWindow()");
     }
     
-    if (ret && (rfb.getHandle() > 0)) {
-        runtest.pass("RawFBDevice:InitDevice()");
+#ifdef ENABLE_DOUBLE_BUFFERING
+    if (rfb.getOffscreenBuffer()) {
+        runtest.pass("RawFBDevice::getOffscreenBuffer()");
     } else {
-        runtest.fail("RawFBDevice:InitDevice()");
+        runtest.fail("RawFBDevice::getOffscreenBuffer()");
     }
-
+#endif
+    
     if (ret && rfb.getStride()) {
         runtest.pass("RawFBDevice::getStride()");
     } else {

http://git.savannah.gnu.org/cgit//commit/?id=f2b313eb8835c596219e9fdf393ae7ed5cd53e49


commit f2b313eb8835c596219e9fdf393ae7ed5cd53e49
Author: Rob Savoye <address@hidden>
Date:   Sun Dec 4 14:13:26 2011 -0700

    add test for the stride

diff --git a/libdevice/rawfb/test_rawfb.cpp b/libdevice/rawfb/test_rawfb.cpp
index bd6ae53..3c556f0 100644
--- a/libdevice/rawfb/test_rawfb.cpp
+++ b/libdevice/rawfb/test_rawfb.cpp
@@ -68,6 +68,12 @@ main(int argc, char *argv[])
         runtest.fail("RawFBDevice:InitDevice()");
     }
 
+    if (ret && rfb.getStride()) {
+        runtest.pass("RawFBDevice::getStride()");
+    } else {
+        runtest.fail("RawFBDevice::getStride()");
+    }
+    
     if (ret && rfb.getWidth()) {
         runtest.pass("RawFBDevice::getWidth()");
     } else {

http://git.savannah.gnu.org/cgit//commit/?id=b3dbc24a2e31c0082278899ca7e1a4ca7bbc8e5b


commit b3dbc24a2e31c0082278899ca7e1a4ca7bbc8e5b
Author: Rob Savoye <address@hidden>
Date:   Sun Dec 4 14:06:06 2011 -0700

    don't manually draw a line for now

diff --git a/libdevice/rawfb/test_rawfb.cpp b/libdevice/rawfb/test_rawfb.cpp
index 9df67de..bd6ae53 100644
--- a/libdevice/rawfb/test_rawfb.cpp
+++ b/libdevice/rawfb/test_rawfb.cpp
@@ -139,7 +139,7 @@ main(int argc, char *argv[])
     }
 #endif
 
-#if 1
+#if 0
     // This is a manual test to see if we can draw a line on the
     // raw framebuffer to make sure it got initialized correctly.
     int x = 0, y = 0;

http://git.savannah.gnu.org/cgit//commit/?id=87ea766e351369575b34bf1fda8b69a154b1cfab


commit 87ea766e351369575b34bf1fda8b69a154b1cfab
Author: Rob Savoye <address@hidden>
Date:   Wed Oct 12 08:36:15 2011 -0600

    tweak indenting, minor change

diff --git a/gui/fb/fbsup.h b/gui/fb/fbsup.h
index 48b9e27..9c56e3c 100644
--- a/gui/fb/fbsup.h
+++ b/gui/fb/fbsup.h
@@ -192,14 +192,14 @@ private:
     int         _ypos;          // Y position of the output window
     size_t      _timeout;       // timeout period for the event loop
 
-    struct fb_var_screeninfo _var_screeninfo;
-    struct fb_fix_screeninfo _fix_screeninfo;
-    boost::shared_ptr<FBGlue> _glue;
+    struct fb_var_screeninfo    _var_screeninfo;
+    struct fb_fix_screeninfo    _fix_screeninfo;
+    boost::shared_ptr<FBGlue>   _glue;
 
     /// This is the array of functioning input devices.
     std::vector<boost::shared_ptr<InputDevice> > _inputs;
 
-    boost::shared_ptr<Renderer> _renderer;
+    boost::shared_ptr<Renderer>         _renderer;
 };
 
 } // end of namespace gui

http://git.savannah.gnu.org/cgit//commit/?id=9812e9eeaa4f1d0ccc654291d6264f7bea99a73d


commit 9812e9eeaa4f1d0ccc654291d6264f7bea99a73d
Author: Rob Savoye <address@hidden>
Date:   Wed Oct 12 08:35:37 2011 -0600

    clear the offscreen buffer in addition to the framebuffer

diff --git a/libdevice/rawfb/RawFBDevice.cpp b/libdevice/rawfb/RawFBDevice.cpp
index bd19b72..81bb357 100644
--- a/libdevice/rawfb/RawFBDevice.cpp
+++ b/libdevice/rawfb/RawFBDevice.cpp
@@ -77,7 +77,12 @@ void
 RawFBDevice::clear()
 {
     GNASH_REPORT_FUNCTION;
-    memset(_fbmem, 0, _fixinfo.smem_len);
+    if (_fbmem) {
+        memset(_fbmem.get(), 0, _fixinfo.smem_len);
+    }
+    if (_offscreen_buffer) {
+        memset(_offscreen_buffer.get(), 0, _fixinfo.smem_len);
+    }
 }
 
 RawFBDevice::~RawFBDevice()
@@ -85,12 +90,19 @@ RawFBDevice::~RawFBDevice()
     // GNASH_REPORT_FUNCTION;
 
     if (_fbmem) {
-        munmap(_fbmem, 0);
-        _fbmem = 0;
-        if (_fd) {
-            close (_fd);
-            _fd = -1;
-        }
+        munmap(_fbmem.get(), 0);
+        log_debug(_("Freeing framebuffer memory"));
+        _fbmem.reset();
+    }
+    
+    if (_fd) {
+        close (_fd);
+        _fd = -1;
+    }
+    
+    if (_offscreen_buffer) {
+        log_debug(_("Freeing offscreen buffer"));
+        _offscreen_buffer.reset();
     }
 }
 
@@ -138,6 +150,11 @@ RawFBDevice::initDevice(int /* argc */, char **/* argv[] 
*/)
               _varinfo.xres, _varinfo.yres,
               _varinfo.bits_per_pixel);    
 
+#ifdef ENABLE_DOUBLE_BUFFERING
+    boost::uint8_t *mem = new boost::uint8_t[getWidth() * getHeight()];
+    _offscreen_buffer.reset(mem);
+#endif
+    
     return true;
 }
 
@@ -195,9 +212,9 @@ RawFBDevice::attachWindow(GnashDevice::native_window_t 
window)
     // of the opened device. EGL wants the descriptor here too, so
     // this way we work in a similar manner.
     if (window) {
-        _fbmem = (unsigned char *)mmap(0, _fixinfo.smem_len,
+        _fbmem.reset((boost::uint8_t *)mmap(0, _fixinfo.smem_len,
                                        PROT_READ|PROT_WRITE, MAP_SHARED,
-                                       window, 0);
+                                           window, 0));
     }
         
     if (!_fbmem) {

http://git.savannah.gnu.org/cgit//commit/?id=152a908e6077666166f5106a853a4ed0f7a33b2e


commit 152a908e6077666166f5106a853a4ed0f7a33b2e
Author: Rob Savoye <address@hidden>
Date:   Wed Oct 12 08:35:02 2011 -0600

    add accessors for framebuffer and ofscreen buffer

diff --git a/libdevice/rawfb/RawFBDevice.h b/libdevice/rawfb/RawFBDevice.h
index db906ed..fb24839 100644
--- a/libdevice/rawfb/RawFBDevice.h
+++ b/libdevice/rawfb/RawFBDevice.h
@@ -109,7 +109,12 @@ class RawFBDevice : public GnashDevice
     // Create an RAWFB window to render in. This is only used by testing
     void createWindow(const char *name, int x, int y, int width, int height);
 
-    boost::uint8_t *getFBMemory() { return _fbmem; };
+    // Get the memory from the real framebuffer
+    boost::uint8_t *getFBMemory() { return _fbmem.get(); };
+
+    // Get the memory from an offscreen buffer to support Double Buffering
+    boost::uint8_t *getOffscreenBuffer() { return _offscreen_buffer.get(); };
+
     size_t getFBMemSize() { return _fixinfo.smem_len; };
     int getHandle() { return _fd; };
     
@@ -123,18 +128,20 @@ class RawFBDevice : public GnashDevice
     
     /// For 8 bit (palette / LUT) modes, sets a grayscale palette.
     /// This GUI currently does not support palette modes. 
-    bool setGrayscaleLUT8();    
+    bool setGrayscaleLUT8();
+    
 protected:
     /// Clear the framebuffer memory
     void clear();
 
-    int                      _fd;
-    std::string              _filespec;
-    struct fb_fix_screeninfo _fixinfo;
-    struct fb_var_screeninfo _varinfo;
-    boost::uint8_t           *_fbmem;
-    struct fb_cmap           _cmap;       // the colormap
+    int                                 _fd;
+    std::string                         _filespec;
+    struct fb_fix_screeninfo            _fixinfo;
+    struct fb_var_screeninfo            _varinfo;
+    boost::scoped_ptr<boost::uint8_t>   _fbmem;
     
+    boost::scoped_ptr<boost::uint8_t>   _offscreen_buffer;
+    struct fb_cmap                      _cmap;       // the colormap    
 };
 
 #ifdef ENABLE_FAKE_FRAMEBUFFER

http://git.savannah.gnu.org/cgit//commit/?id=0f881b512dbaaf209e8ff4483a8c63c7b01747c5


commit 0f881b512dbaaf209e8ff4483a8c63c7b01747c5
Author: Rob Savoye <address@hidden>
Date:   Wed Oct 12 08:30:12 2011 -0600

    add virtual accessor to get the offscreen buffer memory.

diff --git a/libdevice/GnashDevice.h b/libdevice/GnashDevice.h
index 3dcbdb6..84efef4 100644
--- a/libdevice/GnashDevice.h
+++ b/libdevice/GnashDevice.h
@@ -113,7 +113,14 @@ struct GnashDevice
     /// Is this renderering natively
     virtual bool isNativeRender() = 0;
 
+    // These are only used for the Framebuffer
+
+    /// Get the memory from the real framebuffer
     virtual boost::uint8_t *getFBMemory() { return 0; };
+    
+    /// Get the memory from an offscreen buffer to support Double Buffering
+    virtual boost::uint8_t *getOffscreenBuffer() { return 0; };
+
     virtual size_t getFBMemSize() { return 0; };
 
     // bindClient() is used by OpenVG, OpenGLES1, and OpenGLES2

http://git.savannah.gnu.org/cgit//commit/?id=a1a3f2d0a621d3495b38c1e3a9ba94baad7c04d5


commit a1a3f2d0a621d3495b38c1e3a9ba94baad7c04d5
Author: Rob Savoye <address@hidden>
Date:   Wed Oct 12 08:23:41 2011 -0600

    fix typos in comment

diff --git a/libdevice/DeviceGlue.h b/libdevice/DeviceGlue.h
index 6636ecb..98134b9 100644
--- a/libdevice/DeviceGlue.h
+++ b/libdevice/DeviceGlue.h
@@ -166,7 +166,7 @@ public:
     };
 
     /// Bind the client API to the device. As EGL can support different
-    /// renderers, namely OpenG:, OpenGLES1, OpenGLES2, amd OpenVG. This
+    /// renderers, namely OpenGL, OpenGLES1, OpenGLES2, and OpenVG. This
     /// is how the underlying hardware knows which API to implement.
     bool bindClient(renderer::GnashDevice::rtype_t rtype) {
         return (_device) ? _device->bindClient(rtype) : false;

http://git.savannah.gnu.org/cgit//commit/?id=923156c64b9af4cbf9ffb13cf3db6f55ce4b143c


commit 923156c64b9af4cbf9ffb13cf3db6f55ce4b143c
Author: Rob Savoye <address@hidden>
Date:   Wed Oct 12 08:22:40 2011 -0600

    enable double buffering by default for AGG with a framebuffer

diff --git a/configure.ac b/configure.ac
index 23ea1ad..1d2c3e1 100644
--- a/configure.ac
+++ b/configure.ac
@@ -1691,16 +1691,16 @@ dnl If defined, an internal software-buffer is used for 
rendering and is then
 dnl copied to the video RAM. This avoids flicker and is faster for complex 
 dnl graphics, as video RAM access is usually slower. (strongly suggested)
 AC_ARG_ENABLE(doublebuf,
-  AC_HELP_STRING([--enable-doublebuf], [Enable support for double buffering 
when rendering with AGG]),
+  AC_HELP_STRING([--disable-doublebuf], [Disble support for double buffering 
when rendering with AGG]),
   [case "${enableval}" in
     yes) doublebuf=yes ;;
     no)  doublebuf=no ;;
     *)   AC_MSG_ERROR([bad value ${enableval} for enable-doublebuf option]) ;;
-  esac], doublebuf=no
+  esac], doublebuf=yes
 )
 AM_CONDITIONAL(ENABLE_DBUF, [test x"$doublebuf" = xyes])
 if test x$doublebuf = xyes; then
-    AC_DEFINE(ENABLE_DOUBLE_BUFFERING, [1], [Enable double buffering for AGG])
+    AC_DEFINE(ENABLE_DOUBLE_BUFFERING, [1], [Disable double buffering for AGG])
 fi
 
 dnl --------------------------------------------------------

http://git.savannah.gnu.org/cgit//commit/?id=293ec508f640a90a9a6335f71915e3d5569e287a


commit 293ec508f640a90a9a6335f71915e3d5569e287a
Author: Rob Savoye <address@hidden>
Date:   Tue Oct 11 13:20:50 2011 -0600

    clarify that software double buffering is for AGG only.

diff --git a/configure.ac b/configure.ac
index e3f6db0..23ea1ad 100644
--- a/configure.ac
+++ b/configure.ac
@@ -1691,7 +1691,7 @@ dnl If defined, an internal software-buffer is used for 
rendering and is then
 dnl copied to the video RAM. This avoids flicker and is faster for complex 
 dnl graphics, as video RAM access is usually slower. (strongly suggested)
 AC_ARG_ENABLE(doublebuf,
-  AC_HELP_STRING([--enable-doublebuf], [Enable support for double buffering 
when rendering]),
+  AC_HELP_STRING([--enable-doublebuf], [Enable support for double buffering 
when rendering with AGG]),
   [case "${enableval}" in
     yes) doublebuf=yes ;;
     no)  doublebuf=no ;;
@@ -1700,7 +1700,7 @@ AC_ARG_ENABLE(doublebuf,
 )
 AM_CONDITIONAL(ENABLE_DBUF, [test x"$doublebuf" = xyes])
 if test x$doublebuf = xyes; then
-    AC_DEFINE(ENABLE_DOUBLE_BUFFERING, [1], [Enable double buffering])
+    AC_DEFINE(ENABLE_DOUBLE_BUFFERING, [1], [Enable double buffering for AGG])
 fi
 
 dnl --------------------------------------------------------

-----------------------------------------------------------------------

Summary of changes:
 configure.ac                    |    6 +-
 gui/fb/fb.cpp                   |  108 ++++++++++++++++-----------------
 gui/fb/fb_glue.h                |    2 +-
 gui/fb/fb_glue_agg.cpp          |  129 +++++++++++++++-----------------------
 gui/fb/fb_glue_agg.h            |   38 +++--------
 gui/fb/fb_glue_ovg.cpp          |   22 ++++++-
 gui/fb/fb_glue_ovg.h            |    7 ++
 gui/fb/fbsup.h                  |   12 ++--
 libdevice/DeviceGlue.h          |    2 +-
 libdevice/GnashDevice.h         |   10 +++
 libdevice/egl/eglDevice.h       |    5 ++
 libdevice/rawfb/RawFBDevice.cpp |   60 +++++++++++++++---
 libdevice/rawfb/RawFBDevice.h   |   36 ++++++++---
 libdevice/rawfb/test_rawfb.cpp  |   44 +++++++++----
 14 files changed, 274 insertions(+), 207 deletions(-)


hooks/post-receive
-- 
Gnash



reply via email to

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