gnash-commit
[Top][All Lists]
Advanced

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

[Gnash-commit] [SCM] Gnash branch, openvg, updated. daa2113e07c68e06912d


From: Rob Savoye
Subject: [Gnash-commit] [SCM] Gnash branch, openvg, updated. daa2113e07c68e06912de59f0f66f212624a0dd0
Date: Fri, 24 Dec 2010 04:13:23 +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, openvg has been updated
       via  daa2113e07c68e06912de59f0f66f212624a0dd0 (commit)
       via  7ceda7e4af0b2ae4ca814a257cdaf3c74f684df8 (commit)
       via  e1188c1eb9b22eac12ea14ab93a70843181236ec (commit)
       via  b5253a0c7c7d895613f12970bbf77f41c599af49 (commit)
       via  59c102f20f999fadcf88bb11d500ffe0ab25ad43 (commit)
       via  376f20cb4027df24dabbf4eb5f813fe4fb5bc11c (commit)
      from  71b90900afaf3c5de6df18e4e710bf6d4139e1c6 (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=daa2113e07c68e06912de59f0f66f212624a0dd0


commit daa2113e07c68e06912de59f0f66f212624a0dd0
Author: Rob Savoye <address@hidden>
Date:   Thu Dec 23 21:12:44 2010 -0700

    add getHandle()

diff --git a/libdevice/x11/X11Device.h b/libdevice/x11/X11Device.h
index 6e24159..81c84a1 100644
--- a/libdevice/x11/X11Device.h
+++ b/libdevice/x11/X11Device.h
@@ -93,6 +93,8 @@ class X11Device : public GnashDevice
     bool isNativeRender() { return true; }
 
     Window getDrawableWindow() { return _window; };
+
+    int getHandle() { return _window; };
     
     //
     // Testing Support

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


commit 7ceda7e4af0b2ae4ca814a257cdaf3c74f684df8
Author: Rob Savoye <address@hidden>
Date:   Thu Dec 23 21:12:12 2010 -0700

    getFBHandle is now just getHandle

diff --git a/libdevice/rawfb/RawFBDevice.h b/libdevice/rawfb/RawFBDevice.h
index 3591109..e6bccb5 100644
--- a/libdevice/rawfb/RawFBDevice.h
+++ b/libdevice/rawfb/RawFBDevice.h
@@ -111,7 +111,7 @@ class RawFBDevice : public GnashDevice
 
     boost::uint8_t *getFBMemory() { return _fbmem; };
     size_t getFBMemSize() { return _fixinfo.smem_len; };
-    int getFBHandle() { return _fd; };
+    int getHandle() { return _fd; };
     
     /// Start an RAWFB event loop. This is only used by testing. Note that
     /// calling this function blocks until the specified number of events
diff --git a/libdevice/rawfb/test_rawfb.cpp b/libdevice/rawfb/test_rawfb.cpp
index 22c9146..31828ec 100644
--- a/libdevice/rawfb/test_rawfb.cpp
+++ b/libdevice/rawfb/test_rawfb.cpp
@@ -62,7 +62,7 @@ main(int argc, char *argv[])
         exit(0);
     }
     
-    if (ret && (rfb.getFBHandle() > 0)) {
+    if (ret && (rfb.getHandle() > 0)) {
         runtest.pass("RawFBDevice:InitDevice()");
     } else {
         runtest.fail("RawFBDevice:InitDevice()");

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


commit e1188c1eb9b22eac12ea14ab93a70843181236ec
Author: Rob Savoye <address@hidden>
Date:   Thu Dec 23 21:11:08 2010 -0700

    fix device handling for the framebuffer

diff --git a/gui/fb/fb.cpp b/gui/fb/fb.cpp
index d710ee3..56f17ee 100644
--- a/gui/fb/fb.cpp
+++ b/gui/fb/fb.cpp
@@ -194,17 +194,28 @@ FBGui::init(int argc, char *** argv)
 
     // map framebuffer into memory
     // Create a new Glue layer
+#ifdef RENDERER_AGG
     if (renderer == "agg") {
         _glue.reset(new FBAggGlue());
-    } else if (renderer == "openvg") {
+    } else
+#endif
+#ifdef RENDERER_OPENVG
+        if (renderer == "openvg") {
         _glue.reset(new FBOvgGlue(0));
     } else {
+#endif
         log_error("No renderer! %s not supported.", renderer);
     }
         
     // Initialize the glue layer between the renderer and the gui toolkit
     _glue->init(argc, argv);
 
+    FBOvgGlue *ovg = reinterpret_cast<FBOvgGlue *>(_glue.get());
+    // Set "window" size
+    _width =  ovg->getWidth();
+    _height = ovg->getHeight();
+    log_debug("Width:%d, Height:%d", _width, _height);
+    
     disable_terminal();
     
     // Initialize all the input devices
@@ -215,10 +226,11 @@ FBGui::init(int argc, char *** argv)
         log_error("Found no accessible input event devices");
     }
     
-    // Set "window" size
-    _width    = _var_screeninfo.xres;
-    _height   = _var_screeninfo.yres;
-
+#if 0
+    // FIXME: this allows to draw in a subsection of the screen. OpenVG
+    // should be able to support this, but right now it hust gets in
+    // the way of debugging.
+    
     // Let -j -k override "window" size
     optind = 0; opterr = 0; char c;
     while ((c = getopt (argc, *argv, "j:k:X:Y:")) != -1) {
@@ -237,15 +249,15 @@ FBGui::init(int argc, char *** argv)
                 break;
         }
     }
-
+    
     if ( _xpos < 0 ) _xpos += _var_screeninfo.xres - _width;
     _xpos = clamp<int>(_xpos, 0, _var_screeninfo.xres-_width);
 
     if ( _ypos < 0 ) _ypos += _var_screeninfo.yres - _height;
     _ypos = clamp<int>(_ypos, 0, _var_screeninfo.yres-_height);
 
-    log_debug("Width:%d, Height:%d", _width, _height);
     log_debug("X:%d, Y:%d", _xpos, _ypos);
+#endif
 
     _validbounds.setTo(0, 0, _width - 1, _height - 1);
 
@@ -264,7 +276,7 @@ FBGui::run()
     VirtualClock& timer = getClock();
     
     // let the GUI recompute the x/y scale factors to best fit the whole screen
-//    resize_view(_validbounds.width(), _validbounds.height());
+    resize_view(_validbounds.width(), _validbounds.height());
 
     // This loops endlessly at the frame rate
     while (!terminate_request) {  
@@ -407,11 +419,13 @@ void
 FBGui::setInvalidatedRegion(const SWFRect& bounds)
 {
     // GNASH_REPORT_FUNCTION;
-    
+
+#if 0
      FBAggGlue *fbag = reinterpret_cast
         <FBAggGlue *>(_glue.get());
 
      fbag->setInvalidatedRegion(bounds);
+#endif
 }
 
 void
diff --git a/gui/fb/fb_glue.h b/gui/fb/fb_glue.h
index 8b9067f..b229afd 100644
--- a/gui/fb/fb_glue.h
+++ b/gui/fb/fb_glue.h
@@ -46,15 +46,21 @@ namespace gnash {
 namespace gui {
     
 typedef void FbWidget;
-  
+
+/// \class FBGlue
+/// This class is the base class for the glue layer between the GUI toolkit
+/// and the renderer.
 class FBGlue : public DeviceGlue
 {
 public:
-    FBGlue();
-    virtual ~FBGlue();
-    
+    FBGlue() {};
+    virtual ~FBGlue() {};
+
+    /// Initialize the glue layer. This also initializes the Renderer
+    /// and display device.
     virtual bool init(int argc, char **argv[]) = 0;
-    
+
+    // Prepare the drawing area for the renderer
     virtual void prepDrawingArea(FbWidget *drawing_area) = 0;
     virtual Renderer* createRenderHandler() = 0;
     virtual void setRenderHandlerSize(int /*width*/, int /*height*/) {}
@@ -65,16 +71,11 @@ public:
     virtual int width() = 0;
     virtual int height() = 0;
     
-    virtual void render(void* const region);
+    virtual void render(void* const region) {};
 
     virtual void beforeRendering(movie_root *) {};
 
-    size_t getWidth()  { return (_device) ? _device->getWidth() : 0; };
-    size_t getHeight() { return (_device) ? _device->getWidth() : 0; };
-    size_t getDepth()  { return (_device) ? _device->getDepth() : 0; };
-    
 protected:
-    boost::scoped_ptr<renderer::GnashDevice> _device;
     boost::scoped_ptr<Renderer> _renderer;
 };
 
diff --git a/gui/fb/fb_glue_agg.h b/gui/fb/fb_glue_agg.h
index 1166f0a..296b4d8 100644
--- a/gui/fb/fb_glue_agg.h
+++ b/gui/fb/fb_glue_agg.h
@@ -98,6 +98,10 @@ public:
     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; };
+    boost::scoped_ptr<renderer::GnashDevice> _Device;
 protected:
     /// This is the file descriptor for the framebuffer memory
     int                      _fd;
diff --git a/gui/fb/fb_glue_ovg.cpp b/gui/fb/fb_glue_ovg.cpp
index 171372d..ebdea07 100644
--- a/gui/fb/fb_glue_ovg.cpp
+++ b/gui/fb/fb_glue_ovg.cpp
@@ -55,10 +55,10 @@ FBOvgGlue::init(int /* argc */, char **/*argv*/[])
     GNASH_REPORT_FUNCTION;
 
     bool egl = false;
+#if 0
     bool rawfb = false;
     bool dfb = false;
     bool x11 = false;
-#if 0
     // Probe to see what display devices we have that could be used.
     boost::shared_array<renderer::GnashDevice::dtype_t> devs = probeDevices();
     if (devs) {
@@ -87,52 +87,37 @@ FBOvgGlue::init(int /* argc */, char **/*argv*/[])
                   break;
             }
         }
-#endif
-        egl = true;
 
-#if 0
-        // Now that we know what exists, we have to decide which one to
-        // use, as OpenVG can work with anything. We can only have one
-        // display device operating at a time.
-        if (egl) {
-            setDevice(renderer::GnashDevice::EGL);
-        } else {
-            log_error("OpenVG needs EGL to work!");
-            return false;
-        }
-//    }
-#endif
-        
-//        _device.reset(new renderer::EGLDevice);
+    }
+    
+    // Now that we know what exists, we have to decide which one to
+    // use, as OpenVG can work with anything. We can only have one
+    // display device operating at a time.
     if (egl) {
-        renderer::EGLDevice egl; //= dynamic_cast<renderer::EGLDevice 
*>(_device.get());
-        // Initialize the display device
-        egl.initDevice(0, 0);
-        egl.bindClient(renderer::GnashDevice::OPENVG);
-        egl.queryEGLConfig();
-#if 0
-        // EGL still reqires us to open the framebuffer
-        _framebuffer.initDevice(0, 0);
-        // You must pass in the file descriptor to the opened
-        // framebuffer when creating a window
-        egl.attachWindow(_framebuffer.getFBHandle());
-#else
-        char *devname = getenv("FRAMEBUFFER");
-        if (!devname) {
-            devname = (char *)"/dev/fb0";
-            int fd = open(devname, O_RDWR); 
-            // You must pass in the file descriptor to the opened
-            // framebuffer when creating a window
-            if (fd > 0) {
-                egl.attachWindow(fd);
-            } else {
-                log_error("Couldn't attach the Framebuffer!");
-            }
-        }
-#endif
+        setDevice(renderer::GnashDevice::EGL);
+    } else {
+        // OpenVG reauires EGL, so if we don't have it, Gnash won't run
+        log_error("OpenVG needs EGL to work!");
+        return false;
     }
-}
+#endif
+
+    _device.reset(new renderer::EGLDevice(0, 0));
 
+    // Initialize the display device
+    // EGL still reqires us to open the framebuffer
+    _device->bindClient(renderer::GnashDevice::OPENVG);
+    
+    // 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.
+    _display.initDevice(0, 0);
+
+    _width = getWidth();
+    _height = getHeight();
+    
+    return _device->attachWindow(_display.getHandle());
+}
 
 Renderer*
 FBOvgGlue::createRenderHandler()
@@ -174,7 +159,7 @@ FBOvgGlue::render()
 {
     GNASH_REPORT_FUNCTION;
 
-    // SwapBuffer();
+//    _device->swapPbuffer();
 }
 
 } // end of namespace gui
diff --git a/gui/fb/fb_glue_ovg.h b/gui/fb/fb_glue_ovg.h
index 6a3a1ad..dce9812 100644
--- a/gui/fb/fb_glue_ovg.h
+++ b/gui/fb/fb_glue_ovg.h
@@ -36,6 +36,10 @@
 # include "rawfb/RawFBDevice.h"
 #endif
 
+#ifdef BUILD_EGL_DEVICE
+# include "egl/eglDevice.h"
+#endif
+
 namespace gnash {
 
 namespace gui {
@@ -46,6 +50,7 @@ class FBOvgGlue : public FBGlue
 {
     
 public:
+    FBOvgGlue() {};
     FBOvgGlue(int fd);
 //    FBOvgGlue(int x, int y, int width, int height);
     ~FBOvgGlue();
@@ -66,28 +71,40 @@ public:
     void resize(int width, int height);
     // void render(geometry::Range2d<int>& bounds);
 
-    /// \brief
-    ///  The Width of the drawing area, in pixels. For framebuffer
-    ///  based devices, this is the size of the display screen.
-    int width() { return (_device) ? _device->getWidth() : 0; };
-    
-    /// Height of the drawing area, in pixels. For framebuffer
-    ///  based devices, this is the size of the display screen.
-    int height() { return (_device) ? _device->getHeight() : 0; };
+    // FIXME: these should go away to be replaced by the DeviceGlue
+    // versions of the same methods.
+    // int width() { return (_device) ? _device->getWidth() : 0; };
+    // int height() { return (_device) ? _device->getHeight() : 0; };
+    int width() { return _width; };
+    int height() { return _height; };
 
     // 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 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;
-    geometry::Range2d<int> _validbounds;
+    geometry::Range2d<int>              _validbounds;
 
-//    renderer::rawfb::RawFBDevice         _framebuffer;
+    
+    // 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
+    // the X11 server has control of the device. So the X11 glue support
+    // for OpenVG on a fake framebuffer is for development only.
+#ifdef BUILD_RAWFB_DEVICE
+    renderer::rawfb::RawFBDevice        _display;
+#else
+# ifdef BUILD_X11_DEVICE
+    renderer::x11::X11Device            _display;
+# endif
+#endif
 //    boost::scoped_ptr<Renderer> _renderer;
 };
 

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


commit b5253a0c7c7d895613f12970bbf77f41c599af49
Author: Rob Savoye <address@hidden>
Date:   Thu Dec 23 21:09:11 2010 -0700

    work with on;y OpenVG, no AGG

diff --git a/gui/gtk/gtk_canvas.cpp b/gui/gtk/gtk_canvas.cpp
index 9e0de9a..2c1a5e4 100644
--- a/gui/gtk/gtk_canvas.cpp
+++ b/gui/gtk/gtk_canvas.cpp
@@ -25,6 +25,7 @@
 
 #include "gtk_canvas.h"
 #include "Renderer.h"
+#include "GnashException.h"
 #include "rc.h"
 #include "log.h"
 #include "gtk_glue.h"
@@ -289,16 +290,26 @@ gnash_canvas_setup(GnashCanvas *canvas, std::string& 
hwaccel,
             } else
 #endif
 #ifdef RENDERER_AGG
-        {
-            canvas->glue.reset(new gnash::GtkAggGlue);
-        }
-#else // ifdef RENDERER_AGG
-            boost::format fmt = boost::format("Support for renderer %1% "
-                                              "was not built") % renderer;
-            throw gnash::GnashException(fmt.str());
-#endif
+                {
+                    canvas->glue.reset(new gnash::GtkAggGlue);
+                }
+#else // end of RENDERER_AGG
+# ifdef RENDERER_OPENVG
             {
+                canvas->glue.reset(new gnash::gui::GtkOvgGlue);
+            }
+# endif // end of RENDERER_OPENVG
+#endif   // end of AGG
+            if (canvas->glue.get()) {
+                boost::format fmt = boost::format("Support for renderer %1% "
+                                                  "was not built") % renderer;
+                throw gnash::GnashException(fmt.str());
+#ifdef RENDERER_AGG
                 canvas->glue.reset(new gnash::GtkAggGlue);
+#endif
+#ifdef RENDERER_OPENVG
+                canvas->glue.reset(new gnash::gui::GtkOvgGlue);
+#endif
             }
         }
         
@@ -307,14 +318,14 @@ gnash_canvas_setup(GnashCanvas *canvas, std::string& 
hwaccel,
         // If the renderer with the least dependencies fails, we can't
         // proceed.
         if (!initialized_renderer && (renderer == "agg") &&
-                (hwaccel == "none")) {
+            (hwaccel == "none")) {
             break;
         }
         if (!initialized_renderer) {
             gnash::log_debug("Trying to find new Renderer %s, and HWAccel %s",
                              renderer, hwaccel);
         }
-    }
+    } // end of while initialized_renderer
         
     if (initialized_renderer && (renderer == "opengl" || renderer == 
"openvg")) {
         // OpenGL glue needs to prepare the drawing area for OpenGL

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


commit 59c102f20f999fadcf88bb11d500ffe0ab25ad43
Author: Rob Savoye <address@hidden>
Date:   Thu Dec 23 21:08:31 2010 -0700

    add comments

diff --git a/libdevice/DeviceGlue.h b/libdevice/DeviceGlue.h
index 10a37c1..1075553 100644
--- a/libdevice/DeviceGlue.h
+++ b/libdevice/DeviceGlue.h
@@ -105,28 +105,28 @@ public:
 #ifdef BUILD_EGL_DEVICE
           case renderer::GnashDevice::EGL:
           {
-              _device.reset(new renderer::EGLDevice);
+              _device.reset(new renderer::EGLDevice(0, 0));
               break;
           }
 #endif
 #ifdef BUILD_RAWFB_DEVICE
           case renderer::GnashDevice::RAWFB:
           {
-              _device.reset(new renderer::rawfb::RawFBDevice);
+              _device.reset(new renderer::rawfb::RawFBDevice(0, 0));
               break;
           }
 #endif
 #ifdef BUILD_DIRECTFB_DEVICE
           case renderer::GnashDevice::DIRECTFB:
           {
-              _device.reset(new renderer::directfb::DirectFBDevice);
+              _device.reset(new renderer::directfb::DirectFBDevice(0, 0));
               break;
           }
 #endif
 #ifdef BUILD_X11_DEVICE
           case renderer::GnashDevice::X11:
           {
-              _device.reset(new renderer::x11::X11Device);
+              _device.reset(new renderer::x11::X11Device(0, 0));
               break;
           }
 #endif
@@ -140,11 +140,26 @@ public:
         // egl->printEGLSurface();
     }
 
-    bool initDevice(int argc, char *argv[]) { return
-            _device->initDevice(argc, argv); };
+    bool initDevice(int argc, char *argv[]) {
+        return (_device) ? _device->initDevice(argc, argv) : false;
+    };
 
-    bool attachWindow(renderer::GnashDevice::native_window_t window) { return
-            _device->attachWindow(window); };
+    bool attachWindow(renderer::GnashDevice::native_window_t window) {
+        return (_device) ? _device->attachWindow(window) : false;
+    };
+
+    bool bindClient(renderer::GnashDevice::rtype_t rtype) {
+        return (_device) ? _device->bindClient(rtype) : false;
+    };
+
+    /// \brief
+    ///  The Width of the drawing area, in pixels. For framebuffer
+    ///  based devices, this is the size of the display screen.
+    size_t getWidth()  { return (_device) ? _device->getWidth() : 0; };
+
+    /// Height of the drawing area, in pixels. For framebuffer
+    ///  based devices, this is the size of the display screen.
+    size_t getHeight() { return (_device) ? _device->getHeight() : 0; };
     
 protected:
     boost::scoped_ptr<renderer::GnashDevice> _device;
diff --git a/libdevice/GnashDevice.h b/libdevice/GnashDevice.h
index bd39923..9f5ccd1 100644
--- a/libdevice/GnashDevice.h
+++ b/libdevice/GnashDevice.h
@@ -115,8 +115,13 @@ struct GnashDevice
 
     virtual boost::uint8_t *getFBMemory() { return 0; };
     virtual size_t getFBMemSize() { return 0; };
-};
 
+    // bindClient() is used by OpenVG, OpenGLES1, and OpenGLES2
+    // to bind the client type to the EGL surface. This method
+    // is unused by the RawFB, DirectFB, and X11 Devices.
+    virtual bool bindClient(GnashDevice::rtype_t rtype) {};
+};
+    
 } // namespace renderer
 } // namespace gnash
 

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


commit 376f20cb4027df24dabbf4eb5f813fe4fb5bc11c
Author: Rob Savoye <address@hidden>
Date:   Thu Dec 23 21:07:48 2010 -0700

    fix indenting

diff --git a/gui/gui.cpp b/gui/gui.cpp
index 2cfc2e8..4197b09 100644
--- a/gui/gui.cpp
+++ b/gui/gui.cpp
@@ -413,9 +413,10 @@ Gui::updateStageMatrix()
 void
 Gui::resize_view(int width, int height)
 {
-
-       assert(width>0);
-       assert(height>0);
+    GNASH_REPORT_FUNCTION;
+    
+    assert(width > 0);
+    assert(height > 0);
 
     if (_stage && _started) {
         _stage->setDimensions(width, height);

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

Summary of changes:
 gui/fb/fb.cpp                  |   32 ++++++++++++-----
 gui/fb/fb_glue.h               |   23 ++++++------
 gui/fb/fb_glue_agg.h           |    4 ++
 gui/fb/fb_glue_ovg.cpp         |   73 ++++++++++++++++------------------------
 gui/fb/fb_glue_ovg.h           |   41 ++++++++++++++++------
 gui/gtk/gtk_canvas.cpp         |   31 +++++++++++-----
 gui/gui.cpp                    |    7 ++--
 libdevice/DeviceGlue.h         |   31 ++++++++++++----
 libdevice/GnashDevice.h        |    7 +++-
 libdevice/rawfb/RawFBDevice.h  |    2 +-
 libdevice/rawfb/test_rawfb.cpp |    2 +-
 libdevice/x11/X11Device.h      |    2 +
 12 files changed, 155 insertions(+), 100 deletions(-)


hooks/post-receive
-- 
Gnash



reply via email to

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