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. 8889a2b98cb4b6178b32


From: Rob Savoye
Subject: [Gnash-commit] [SCM] Gnash branch, openvg, updated. 8889a2b98cb4b6178b3250fd653b89a0bffc9190
Date: Thu, 23 Dec 2010 16:26:55 +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  8889a2b98cb4b6178b3250fd653b89a0bffc9190 (commit)
       via  db77fe3474d66421f1b8638e53b5342d716700c0 (commit)
       via  ee4bd93b6be2b962341e9303f6f279d89ee15f35 (commit)
       via  2eb6724f06b2eae9a4b93fe011bf1ef3bcf4cb48 (commit)
       via  8e38e2d0466910337e390d37fbf9b1b005cca5a6 (commit)
       via  ca2656924aa0a62730df5c000711baaf7bf379cf (commit)
       via  8c853260c48c4202914ab1853d257cdda0d0cb30 (commit)
       via  7f5c37d8e5108a63600975954b9d7dc7d0412c3f (commit)
       via  28e2068dc0dc1feb80cc32a1a471804766310a8a (commit)
       via  ac2a828248e8442352bbd49ddd1ff90d1261cf8d (commit)
       via  a82e6bb5368ec40c94a7efe05f8e09545e00d660 (commit)
      from  a45ed923f246dc3b66f0be0130408264c05b034b (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=8889a2b98cb4b6178b3250fd653b89a0bffc9190


commit 8889a2b98cb4b6178b3250fd653b89a0bffc9190
Author: Rob Savoye <address@hidden>
Date:   Thu Dec 23 09:26:42 2010 -0700

    add OpenVG renderer support to the framebuffer GUI

diff --git a/gui/fb/fb_glue_ovg.cpp b/gui/fb/fb_glue_ovg.cpp
index 0794f49..171372d 100644
--- a/gui/fb/fb_glue_ovg.cpp
+++ b/gui/fb/fb_glue_ovg.cpp
@@ -24,6 +24,16 @@
 #include "fb_glue_ovg.h"
 #include "GnashDevice.h"
 
+#ifdef BUILD_EGL_DEVICE
+# include <egl/eglDevice.h>
+#endif
+
+#ifdef BUILD_RAWFB_DEVICE
+# include <rawfb/RawFBDevice.h>
+#endif
+
+#include "GnashDevice.h"
+
 namespace gnash {
 
 namespace gui {
@@ -48,7 +58,7 @@ FBOvgGlue::init(int /* argc */, char **/*argv*/[])
     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) {
@@ -77,23 +87,50 @@ 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 if (rawfb) {
-            setDevice(renderer::GnashDevice::RAWFB);
-        } else if (dfb) {
-            setDevice(renderer::GnashDevice::DIRECTFB);
-        } else if (x11) {
-            setDevice(renderer::GnashDevice::X11);
-        }        
+        } else {
+            log_error("OpenVG needs EGL to work!");
+            return false;
+        }
+//    }
+#endif
+        
+//        _device.reset(new renderer::EGLDevice);
+    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
     }
-
-    // Initialize the display device
-    return _device->initDevice(0, 0);
 }
 
 
@@ -105,7 +142,7 @@ FBOvgGlue::createRenderHandler()
     // Create the renderer
     _renderer.reset(renderer::openvg::create_handler(0));
 
-    // Print the ID tag
+    // Print the description
     if (!_renderer->description().empty()) {
         log_debug("Renderer is: %s", _renderer->description());
     }
@@ -130,9 +167,6 @@ FBOvgGlue::prepDrawingArea(void *drawing_area)
 
     _device->attachWindow(reinterpret_cast
             <renderer::GnashDevice::native_window_t>(drawing_area));
-    
-    // if (_bpp == 16) {
-    // }       
 }
 
 void
diff --git a/gui/fb/fb_glue_ovg.h b/gui/fb/fb_glue_ovg.h
index 79fbd94..6a3a1ad 100644
--- a/gui/fb/fb_glue_ovg.h
+++ b/gui/fb/fb_glue_ovg.h
@@ -32,6 +32,10 @@
 #include <VG/openvg.h>
 #endif
 
+#ifdef BUILD_RAWFB_DEVICE
+# include "rawfb/RawFBDevice.h"
+#endif
+
 namespace gnash {
 
 namespace gui {
@@ -83,6 +87,7 @@ private:
     std::vector< geometry::Range2d<int> > _drawbounds;
     geometry::Range2d<int> _validbounds;
 
+//    renderer::rawfb::RawFBDevice         _framebuffer;
 //    boost::scoped_ptr<Renderer> _renderer;
 };
 

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


commit db77fe3474d66421f1b8638e53b5342d716700c0
Author: Rob Savoye <address@hidden>
Date:   Thu Dec 23 09:26:27 2010 -0700

    add OpenVG renderer support to the framebuffer GUI

diff --git a/gui/fb/fb.cpp b/gui/fb/fb.cpp
index 5b717c9..d710ee3 100644
--- a/gui/fb/fb.cpp
+++ b/gui/fb/fb.cpp
@@ -189,6 +189,24 @@ FBGui::init(int argc, char *** argv)
 {
     GNASH_REPORT_FUNCTION;
 
+    // the current renderer as set on the command line or gnashrc file
+    std::string renderer = _runResources.getRenderBackend();
+
+    // map framebuffer into memory
+    // Create a new Glue layer
+    if (renderer == "agg") {
+        _glue.reset(new FBAggGlue());
+    } else if (renderer == "openvg") {
+        _glue.reset(new FBOvgGlue(0));
+    } else {
+        log_error("No renderer! %s not supported.", renderer);
+    }
+        
+    // Initialize the glue layer between the renderer and the gui toolkit
+    _glue->init(argc, argv);
+
+    disable_terminal();
+    
     // Initialize all the input devices
 
     // Look for Mice that use the PS/2 mouse protocol
@@ -197,7 +215,6 @@ FBGui::init(int argc, char *** argv)
         log_error("Found no accessible input event devices");
     }
     
-#if 0
     // Set "window" size
     _width    = _var_screeninfo.xres;
     _height   = _var_screeninfo.yres;
@@ -231,26 +248,7 @@ FBGui::init(int argc, char *** argv)
     log_debug("X:%d, Y:%d", _xpos, _ypos);
 
     _validbounds.setTo(0, 0, _width - 1, _height - 1);
-#endif
 
-    // the current renderer as set on the command line or gnashrc file
-    std::string renderer = _runResources.getRenderBackend();
-
-    // map framebuffer into memory
-    // Create a new Glue layer
-    if (renderer == "agg") {
-        _glue.reset(new FBAggGlue());
-    } else if (renderer == "openvg") {
-        _glue.reset(new FBOvgGlue(0));
-    } else {
-        log_error("No renderer! %s not supported.", renderer);
-    }
-        
-    // Initialize the glue layer between the renderer and the gui toolkit
-    _glue->init(argc, argv);
-
-    disable_terminal();
-    
     return true;
 }
 
@@ -340,8 +338,16 @@ FBGui::createWindow(const char* /*title*/, int /*width*/, 
int /*height*/,
                      int /*xPosition*/, int /*yPosition*/)
 {
     GNASH_REPORT_FUNCTION;
+
+#if 0
+    if (_glue) {
+        _glue->prepDrawingArea(0);
+        return true;
+    }
+#endif
+    _runResources.setRenderer(_renderer);
     
-    return true;
+    return false;
 }
 
 bool

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


commit ee4bd93b6be2b962341e9303f6f279d89ee15f35
Author: Rob Savoye <address@hidden>
Date:   Thu Dec 23 09:25:43 2010 -0700

    add EGL support to run OpenVG on the desktop

diff --git a/gui/gtk/gtk_glue_ovg.cpp b/gui/gtk/gtk_glue_ovg.cpp
index 91135ef..151bafa 100644
--- a/gui/gtk/gtk_glue_ovg.cpp
+++ b/gui/gtk/gtk_glue_ovg.cpp
@@ -138,8 +138,18 @@ GtkOvgGlue::prepDrawingArea(GtkWidget *drawing_area)
     // contents from its internal offscreen buffer at the end of expose event
     gtk_widget_set_double_buffered(_drawing_area, FALSE);
 
-    // DUMP_CURRENT_SURFACE;
-    // DUMP_CURRENT_CONTEXT;
+    // EGL needs to be bound to the type of client. The possible
+    // clients are OpenVG, OpenGLES1, and OpenGLES2.
+    if (_device->getType() == renderer::GnashDevice::EGL) {
+        renderer::EGLDevice *egl = (renderer::EGLDevice*)_device.get();
+        egl->bindClient(renderer::GnashDevice::OPENVG);
+    }
+    
+#if 0
+    renderer::EGLDevice *egl = (renderer::EGLDevice*)_device.get();
+    egl->printEGLSurface(eglGetCurrentSurface(EGL_DRAW));
+    egl->printEGLContext(eglGetCurrentContext());
+#endif
 }
 
 Renderer*
@@ -155,22 +165,13 @@ GtkOvgGlue::createRenderHandler()
     GdkVisual* wvisual = gdk_drawable_get_visual(_drawing_area->window);
     GdkImage* tmpimage = gdk_image_new (GDK_IMAGE_FASTEST, wvisual, 1, 1);
     const GdkVisual* visual = tmpimage->visual;
-
-    // FIXME: we use bpp instead of depth, because depth doesn't appear to
-    // include the padding byte(s) the GdkImage actually has.
-    const char *pixelformat = 0;
-    // agg_detect_pixel_format(visual->red_shift, visual->red_prec,
-    // visual->green_shift, visual->green_prec, visual->blue_shift, 
visual->blue_prec,
-    // tmpimage->bpp * 8);
-
     gdk_image_destroy(tmpimage);
 
     _renderer.reset(reinterpret_cast<renderer::openvg::Renderer_ovg *>
-                    (renderer::openvg::create_handler(pixelformat)));
+                    (renderer::openvg::create_handler(0)));
     if (!_renderer) {
         boost::format fmt = boost::format(
-            _("Could not create OPENVG renderer with pixelformat %s")
-            ) % pixelformat;
+            _("Could not create OPENVG renderer"));
         throw GnashException(fmt.str());
     }
 
@@ -206,17 +207,33 @@ GtkOvgGlue::setRenderHandlerSize(int width, int height)
     _device->attachWindow(static_cast<renderer::GnashDevice::native_window_t>
                           (xid));
 
-    // EGL needs to be bound to the type of client. The possible
-    // clients are OpenVG, OpenGLES1, and OpenGLES2.
-    if (_device->getType() == renderer::GnashDevice::EGL) {
-        renderer::EGLDevice *egl = (renderer::EGLDevice*)_device.get();
-        egl->bindClient(renderer::GnashDevice::OPENVG);
-    }
-    
+    vgLoadIdentity();
+
     // Allow drawing everywhere by default
     InvalidatedRanges ranges;
     ranges.setWorld();
-    _renderer->set_invalidated_regions(ranges);    
+    _renderer->set_invalidated_regions(ranges);
+    
+    float red_color[4] = {1.0, 0.0, 0.0, 1.0};
+    float blue_color[4] = {0.0, 0.0, 1.0, 1.0};
+    
+    VGint scissor[4] = {100, 100, 25, 25};
+    vgSetfv(VG_CLEAR_COLOR, 4, red_color);
+    vgClear(0, 0, 300, 300);
+
+    vgSetfv(VG_CLEAR_COLOR, 4, blue_color);
+    vgClear(50, 50, 50, 50);
+
+    //vgSetiv(VG_SCISSOR_RECTS, 4, scissor);
+    //vgSeti(VG_SCISSORING, VG_TRUE);
+    vgCopyPixels(100, 100, 50, 50, 50, 50);
+    vgClear(150, 150, 50, 50);
+
+
+    renderer::EGLDevice *egl = (renderer::EGLDevice*)_device.get();
+    egl->swapPbuffers();
+    
+    sleep(5);
 }
 
 void 
@@ -281,7 +298,7 @@ GtkOvgGlue::render(int minx, int miny, int maxx, int maxy)
                    height);
     gdk_gc_unref(gc);
 #else
-//    eglSwapBuffers(_eglDisplay, _eglSurface);
+//    _device->swapBbuffers();
 #endif
 }
 
@@ -291,8 +308,6 @@ GtkOvgGlue::configure(GtkWidget *const /*widget*/, 
GdkEventConfigure *const even
     GNASH_REPORT_FUNCTION;
 
     setRenderHandlerSize(event->width, event->height);
-    
-    vgLoadIdentity();
 }
 
 #if 0

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


commit 2eb6724f06b2eae9a4b93fe011bf1ef3bcf4cb48
Author: Rob Savoye <address@hidden>
Date:   Thu Dec 23 09:24:39 2010 -0700

    free the XVisual after using it.

diff --git a/libdevice/x11/X11Device.cpp b/libdevice/x11/X11Device.cpp
index 590efa8..487ea84 100644
--- a/libdevice/x11/X11Device.cpp
+++ b/libdevice/x11/X11Device.cpp
@@ -80,10 +80,9 @@ X11Device::X11Device(int vid)
       _screen(0),
       _depth(0),
       _vinfo(0),
-      _vid(0)
+      _vid(vid)
 {
     GNASH_REPORT_FUNCTION;
-    _vid = vid;
 
     if (!initDevice(0, 0)) {
         log_error("Couldn't initialize X11 device!");
@@ -164,6 +163,8 @@ X11Device::initDevice(int argc, char *argv[])
          exit(1);
     }
     std::cerr << "X11 visual is: " << _vinfo->visual << std::endl;
+
+    XFree(_vinfo);
     
     // XWindowAttributes gattr;
     // XGetWindowAttributes(_display, _root, &gattr);
@@ -230,7 +231,7 @@ X11Device::createWindow(const char *name, int x, int y, int 
width, int height)
     attr.event_mask = StructureNotifyMask | ExposureMask | KeyPressMask;
     mask = CWBackPixel | CWBorderPixel | CWColormap | CWEventMask;
     
-    _window = XCreateWindow(_display, _root, 0, 0, width, width,
+    _window = XCreateWindow(_display, _root, 0, 0, width, height,
                         0, _vinfo->depth, InputOutput,
                         _vinfo->visual, mask, &attr);
     
@@ -244,7 +245,6 @@ X11Device::createWindow(const char *name, int x, int y, int 
width, int height)
     XSetNormalHints(_display, _window, &sizehints);
     XSetStandardProperties(_display, _window, name, name, None, (char **)NULL,
                            0, &sizehints);
-
     
     XMapWindow(_display, _window);
 }

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


commit 8e38e2d0466910337e390d37fbf9b1b005cca5a6
Author: Rob Savoye <address@hidden>
Date:   Thu Dec 23 09:24:15 2010 -0700

    remove debug crap

diff --git a/libdevice/events/test_events.cpp b/libdevice/events/test_events.cpp
index e749230..342a822 100644
--- a/libdevice/events/test_events.cpp
+++ b/libdevice/events/test_events.cpp
@@ -60,6 +60,8 @@ alarm_handler (int sig)
 int
 main(int argc, char *argv[])
 {
+    dbglogfile.setVerbosity();
+    
     struct sigaction act;
     act.sa_handler = alarm_handler;
     sigaction (SIGALRM, &act, NULL);

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


commit ca2656924aa0a62730df5c000711baaf7bf379cf
Author: Rob Savoye <address@hidden>
Date:   Thu Dec 23 09:23:52 2010 -0700

    tweak fake framebuffer settings to match our real 16bit LCD. Move mmap() 
from initDevice() to attachWindow(), so it's consistent with EGL

diff --git a/libdevice/rawfb/RawFBDevice.cpp b/libdevice/rawfb/RawFBDevice.cpp
index 5b304b5..807ec14 100644
--- a/libdevice/rawfb/RawFBDevice.cpp
+++ b/libdevice/rawfb/RawFBDevice.cpp
@@ -97,12 +97,13 @@ RawFBDevice::initDevice(int /* argc */, char **/* argv[] */)
 {
     GNASH_REPORT_FUNCTION;
     
+    char *devname = 0;
     // Open the framebuffer device
 #ifdef ENABLE_FAKE_FRAMEBUFFER
     _fd = open(FAKEFB, O_RDWR);
     log_debug("WARNING: Using %s as a fake framebuffer!", FAKEFB);
 #else
-    char *devname = getenv("FRAMEBUFFER");
+    devname = getenv("FRAMEBUFFER");
     if (!devname) {
         // We can't use the fake framebuffer with the FRAMEBUFFER
         // environment variable, as it coinfuses X11. So this
@@ -117,6 +118,8 @@ RawFBDevice::initDevice(int /* argc */, char **/* argv[] */)
     if (_fd < 0) {
         log_error("Could not open framebuffer device: %s", strerror(errno));
         return false;
+    } else {
+        log_debug("Opened framebuffer device: %s", devname);
     }
     
     // Load framebuffer properties
@@ -133,17 +136,6 @@ RawFBDevice::initDevice(int /* argc */, char **/* argv[] 
*/)
               _varinfo.xres, _varinfo.yres,
               _varinfo.bits_per_pixel);    
 
-    // map framebuffer into memory
-    _fbmem = (unsigned char *)mmap(0, _fixinfo.smem_len,
-                                   PROT_READ|PROT_WRITE, MAP_SHARED,
-                                   _fd, 0);
-    
-    if (!_fbmem) {
-        log_error("Couldn't mmap() %d bytes of memory!",
-                  _fixinfo.smem_len);
-        return false;
-    }
-    
     return true;
 }
 
@@ -195,6 +187,24 @@ bool
 RawFBDevice::attachWindow(GnashDevice::native_window_t window)
 {
     GNASH_REPORT_FUNCTION;
+
+    // map framebuffer into memory. There isn't really a native
+    // window when using a frambuffer, it's actualy the file descriptor
+    // 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,
+                                       PROT_READ|PROT_WRITE, MAP_SHARED,
+                                       window, 0);
+    }
+        
+    if (!_fbmem) {
+        log_error("Couldn't mmap() %d bytes of memory!",
+                  _fixinfo.smem_len);
+        return false;
+    }
+
+    return true;
 }
     
 
@@ -231,27 +241,32 @@ fakefb_ioctl(int /* fd */, int request, void *data)
       {
           struct fb_var_screeninfo *ptr =
               reinterpret_cast<struct fb_var_screeninfo *>(data);
-          // If we are using a simulated framebuffer, the default for
-          // fbe us 640x480, 8bits. So use that as a sensible
-          // default. Note that the fake framebuffer is only used for
+          // Note that the fake framebuffer is only used for
           // debugging and development.
-          ptr->xres          = 1280; // visible resolution
-          ptr->xres_virtual  = 1280; // virtual resolution
-          ptr->yres          = 1024; // visible resolution
-          ptr->yres_virtual  = 1024; // virtual resolution
+          // Framebuffer device uses 1536000 bytes of memory at this size
+#if 0
+          ptr->xres          = 1024; // visible resolution
+          ptr->xres_virtual  = 1024; // virtual resolution
+          ptr->yres          = 768; // visible resolution
+          ptr->yres_virtual  = 768; // virtual resolution
 
           // standard PC framebuffer use a 32 bit 8/8/8 framebuffer
-          ptr->bits_per_pixel = 32;
-          ptr->red.offset    = 16;
+          ptr->bits_per_pixel = 24;
+          ptr->red.offset    = 0;
           ptr->red.length    = 8;
-          ptr->green.offset  = 8;
+          ptr->green.offset  = 16;
           ptr->green.length  = 8;
           ptr->blue.offset   = 0;
-          ptr->blue.length   = 8;
+          ptr->blue.length   = 6;
           ptr->transp.offset = 0;
           ptr->transp.length = 0;
-#if 0
-          // Android and fbe use a 16bit 5/6/5 framebuffer
+#else
+          ptr->xres          = 800; // visible resolution
+          ptr->xres_virtual  = 1600; // virtual resolution
+          ptr->yres          = 480; // visible resolution
+          ptr->yres_virtual  = 480; // virtual resolution
+
+          // Most modile devices use a 16bit 5/6/5 framebuffer
           ptr->bits_per_pixel = 16;
           ptr->red.length    = 5;
           ptr->red.offset    = 11;
@@ -280,17 +295,18 @@ fakefb_ioctl(int /* fd */, int request, void *data)
       {
           struct fb_fix_screeninfo *ptr =
               reinterpret_cast<struct fb_fix_screeninfo *>(data);
-          // Android and fbe use a 16bit 5/6/5 framebuffer
-          ptr->smem_len = 5242880; // size of frame buffer memory
+#if 1
+          // Most mobile devices use a 16bit 5/6/5 framebuffer
+          ptr->smem_len = 33554432; // size of frame buffer memory
           ptr->type = 0; // see FB_TYPE_*
           ptr->visual = 2; // see FB_VISUAL_*
           ptr->xpanstep = 1;      // zero if no hardware panning
           ptr->ypanstep = 1;      // zero if no hardware panning
           ptr->ywrapstep = 0;     // zero if no hardware panning
-          ptr->line_length = 5120; // line length
+          ptr->line_length = 1600; // line length
           ptr->accel = FB_ACCEL_NONE; // Indicate to driver which specific
                                   // chip/card we have
-#if 0
+#else
           // Android and fbe use a 16bit 5/6/5 framebuffer
           ptr->smem_len = 307200; // Length of frame buffer mem
           ptr->type = FB_TYPE_PACKED_PIXELS; // see FB_TYPE_*
diff --git a/libdevice/rawfb/RawFBDevice.h b/libdevice/rawfb/RawFBDevice.h
index 3f27da8..3591109 100644
--- a/libdevice/rawfb/RawFBDevice.h
+++ b/libdevice/rawfb/RawFBDevice.h
@@ -111,6 +111,7 @@ class RawFBDevice : public GnashDevice
 
     boost::uint8_t *getFBMemory() { return _fbmem; };
     size_t getFBMemSize() { return _fixinfo.smem_len; };
+    int getFBHandle() { 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 269953a..22c9146 100644
--- a/libdevice/rawfb/test_rawfb.cpp
+++ b/libdevice/rawfb/test_rawfb.cpp
@@ -62,49 +62,49 @@ main(int argc, char *argv[])
         exit(0);
     }
     
-    if ((ret) && (rfb.getFBMemory() > 0) && (rfb.getFBMemSize() > 0)) {
+    if (ret && (rfb.getFBHandle() > 0)) {
         runtest.pass("RawFBDevice:InitDevice()");
     } else {
         runtest.fail("RawFBDevice:InitDevice()");
     }
 
-    if (rfb.getWidth()) {
+    if (ret && rfb.getWidth()) {
         runtest.pass("RawFBDevice::getWidth()");
     } else {
         runtest.fail("RawFBDevice::getWidth()");
     }
     
-    if (rfb.getHeight()) {
+    if (ret && rfb.getHeight()) {
         runtest.pass("RawFBDevice::getHeight()");
     } else {
         runtest.fail("DirecTFBDevice::getHeight()");
     }
 
-    if (rfb.isSingleBuffered()) {
+    if (ret && rfb.isSingleBuffered()) {
         runtest.pass("RawFBDevice::is*Buffered()");
     } else {
         runtest.fail("RawFBDevice::is*Buffered()");
     }
     
-    if (rfb.getDepth()) {
+    if (ret && rfb.getDepth()) {
         runtest.pass("RawFBDevice::getDepth()");
     } else {
         runtest.fail("RawFBDevice::getDepth()");
     }
     
-    if (rfb.getRedSize() > 0) {
+    if (ret && rfb.getRedSize() > 0) {
         runtest.pass("RawFBDevice::getRedSize()");
     } else {
         runtest.fail("RawFBDevice::getRedSize()");
     }
 
-    if (rfb.getGreenSize() > 0) {
+    if (ret && rfb.getGreenSize() > 0) {
         runtest.pass("RawFBDevice::getGreenSize()");
     } else {
         runtest.fail("RawFBDevice::getGreenSize()");
     }
 
-    if (rfb.getBlueSize() > 0) {
+    if (ret && rfb.getBlueSize() > 0) {
         runtest.pass("RawFBDevice::getBlueSize()");
     } else {
         runtest.fail("RawFBDevice::getBlueSize()");
@@ -120,19 +120,19 @@ main(int argc, char *argv[])
     
     // AGG uses these to calculate the poixel format
 #ifdef RENDERER_AGG
-    if (rfb.getRedOffset() > 0) {
+    if (ret && rfb.getRedOffset() > 0) {
         runtest.pass("RawFBDevice::getRedOffset()");
     } else {
         runtest.fail("RawFBDevice::getRedOffset()");
     }
     
-    if (rfb.getGreenOffset() > 0) {
+    if (ret && rfb.getGreenOffset() > 0) {
         runtest.pass("RawFBDevice::getGreenOffset()");
     } else {
         runtest.fail("RawFBDevice::getGreenOffset()");
     }
     
-    if (rfb.getBlueOffset() == 0) {
+    if (ret && rfb.getBlueOffset() == 0) {
         runtest.pass("RawFBDevice::getBlueOffset()");
     } else {
         runtest.fail("RawFBDevice::getBlueOffset()");

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


commit 8c853260c48c4202914ab1853d257cdda0d0cb30
Author: Rob Savoye <address@hidden>
Date:   Thu Dec 23 09:21:55 2010 -0700

    add accesors for the devices so it's easier toi use in a derived class.

diff --git a/libdevice/DeviceGlue.h b/libdevice/DeviceGlue.h
index 33a5def..10a37c1 100644
--- a/libdevice/DeviceGlue.h
+++ b/libdevice/DeviceGlue.h
@@ -26,6 +26,8 @@
 
 #include <boost/scoped_array.hpp>
 #include <boost/shared_array.hpp>
+#include <boost/scoped_ptr.hpp>
+#include <boost/shared_ptr.hpp>
 
 #include "GnashDevice.h"
 
@@ -137,6 +139,13 @@ public:
         // egl->printEGLConfig();
         // egl->printEGLSurface();
     }
+
+    bool initDevice(int argc, char *argv[]) { return
+            _device->initDevice(argc, argv); };
+
+    bool attachWindow(renderer::GnashDevice::native_window_t window) { return
+            _device->attachWindow(window); };
+    
 protected:
     boost::scoped_ptr<renderer::GnashDevice> _device;
 };

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


commit 7f5c37d8e5108a63600975954b9d7dc7d0412c3f
Author: Rob Savoye <address@hidden>
Date:   Thu Dec 23 09:20:37 2010 -0700

    remove trailing slash on filename

diff --git a/libdevice/Makefile.am b/libdevice/Makefile.am
index f82ea68..b59a6f8 100644
--- a/libdevice/Makefile.am
+++ b/libdevice/Makefile.am
@@ -78,7 +78,7 @@ libgnashdevice_la_LIBADD = \
 libgnashdevice_la_LDFLAGS =  -release $(VERSION) 
 libgnashdevice_la_SOURCES = \
        GnashDevice.h \
-       DeviceGlue.h \
+       DeviceGlue.h
 
 if BUILD_X11_DEVICE
 libgnashdevice_la_CPPFLAGS += $(X11_CFLAGS)

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


commit 28e2068dc0dc1feb80cc32a1a471804766310a8a
Author: Rob Savoye <address@hidden>
Date:   Thu Dec 23 09:19:26 2010 -0700

    tweak EGL config attributes to work on a real 16bit display instead of a 
fake one.

diff --git a/libdevice/egl/egl.am b/libdevice/egl/egl.am
index 1a5d98b..2c1c7b4 100644
--- a/libdevice/egl/egl.am
+++ b/libdevice/egl/egl.am
@@ -26,7 +26,7 @@ eglinfo_LDADD = \
        $(EGL_LIBS)
 
 # this tests the low level EGL interface, used by OpenVG, OpenGLES1, and 
OpenGLES2.
-check_PROGRAMS += test_egl 
+bin_PROGRAMS += test_egl 
 test_egl_SOURCES = egl/test_egl.cpp
 test_egl_CPPFLAGS = $(AM_CPPFLAGS)
 test_egl_LDADD = \
diff --git a/libdevice/egl/eglDevice.cpp b/libdevice/egl/eglDevice.cpp
index 46721f0..86c07a0 100644
--- a/libdevice/egl/eglDevice.cpp
+++ b/libdevice/egl/eglDevice.cpp
@@ -48,7 +48,7 @@ static const EGLint attrib32_list[] = {
     EGL_GREEN_SIZE,     8,
     EGL_BLUE_SIZE,      8,
 //  EGL_ALPHA_SIZE,     0,
-//  EGL_DEPTH_SIZE,     24,
+//    EGL_DEPTH_SIZE,     24,
 // #ifdef RENDERER_GLES1
 //     EGL_RENDERABLE_TYPE, EGL_OPENGL_ES_BIT,
 // #endif
@@ -57,12 +57,13 @@ static const EGLint attrib32_list[] = {
 // #endif
 #ifdef RENDERER_OPENVG
      EGL_RENDERABLE_TYPE, EGL_OPENVG_BIT,
-//    EGL_STENCIL_SIZE,   8,
+//     EGL_STENCIL_SIZE,   8,
 #endif
 //    EGL_RENDERABLE_TYPE, EGL_OPENVG_BIT|EGL_OPENGL_ES_BIT|EGL_OPENGL_ES2_BIT,
-//    EGL_SURFACE_TYPE,   EGL_WINDOW_BIT|EGL_PBUFFER_BIT|EGL_PIXMAP_BIT,
+    EGL_SURFACE_TYPE,   EGL_WINDOW_BIT|EGL_PBUFFER_BIT|EGL_PIXMAP_BIT,
 //    EGL_SAMPLE_BUFFERS, 1,
-// FIXME: Single Buffering appears not to work on X11, you get no visual.
+// FIXME: Single Buffering appears not to work on X11, you get no visual. This 
is
+// the default though.    
 //    EGL_RENDER_BUFFER, EGL_SINGLE_BUFFER,
     EGL_NONE
 };
@@ -83,7 +84,7 @@ static EGLint const attrib16_list[] = {
     EGL_SAMPLES,            0,
 #ifdef RENDERER_OPENVG
     EGL_RENDERABLE_TYPE, EGL_WINDOW_BIT|EGL_PBUFFER_BIT|EGL_PIXMAP_BIT,
-//    EGL_DEPTH_SIZE,     16,
+    EGL_DEPTH_SIZE,     16,
 #endif
     EGL_NONE
 };
@@ -156,10 +157,9 @@ EGLDevice::EGLDevice()
       _eglDisplay(EGL_NO_DISPLAY),
       _eglNumOfConfigs(0),
       _max_num_config(1),
-      _bpp(32)
+      _bpp(16)
 {
     GNASH_REPORT_FUNCTION;
-    dbglogfile.setVerbosity();
 }
 
 EGLDevice::EGLDevice(int argc, char *argv[])
@@ -169,7 +169,7 @@ EGLDevice::EGLDevice(int argc, char *argv[])
       _eglDisplay(EGL_NO_DISPLAY),
       _eglNumOfConfigs(0),
       _max_num_config(1),
-      _bpp(32)
+      _bpp(16)
 {
     GNASH_REPORT_FUNCTION;
     if (!initDevice(argc, argv)) {
@@ -184,7 +184,7 @@ EGLDevice::EGLDevice(GnashDevice::rtype_t rtype)
       _eglDisplay(EGL_NO_DISPLAY),
       _eglNumOfConfigs(0),
       _max_num_config(1),
-      _bpp(32)
+      _bpp(16)
 {
     GNASH_REPORT_FUNCTION;
     dbglogfile.setVerbosity();
@@ -220,7 +220,6 @@ EGLDevice::~EGLDevice()
         
         eglTerminate(_eglDisplay);
     }
-    
 }
 
 /// @note: There are a few steps required to initialize an EGL
@@ -250,33 +249,34 @@ EGLDevice::initDevice(int argc, char *argv[])
 
     // step 1 - get an EGL display
 
-    // This can be called multiple times, and always returns the same display
-//    _eglDisplay = eglGetDisplay(XOpenDisplay(0)/* EGL_DEFAULT_DISPLAY */);
+//    _eglDisplay = eglGetDisplay(XOpenDisplay(0));
     _eglDisplay = eglGetDisplay(EGL_DEFAULT_DISPLAY);
     if (EGL_NO_DISPLAY == _eglDisplay) {
         log_error( "eglGetDisplay() failed (error 0x%x)", eglGetError());
         return false;
     }
-    
+
     // This can be called multiple times safely
-    if (EGL_FALSE == eglInitialize(_eglDisplay, 0, 0)) {
+    if (eglInitialize(_eglDisplay, 0, 0) != EGL_TRUE) {
         log_error( "eglInitialize() failed (error %s)",
                    getErrorString(eglGetError()));
         return false;
     }
+
+    // step2 - bind to the wanted client API
+    /// This is done by bindClient() later on
+    // bindClient(GnashDevice::OPENVG);
+    // queryEGLConfig(_eglDisplay);
+    
     log_debug("EGL_CLIENT_APIS = %s", eglQueryString(_eglDisplay, 
EGL_CLIENT_APIS));
     log_debug("EGL_EXTENSIONS = %s",  eglQueryString(_eglDisplay, 
EGL_EXTENSIONS));
     log_debug("EGL_VERSION = %s, EGL_VENDOR = %s",
               eglQueryString(_eglDisplay, EGL_VERSION),
               eglQueryString(_eglDisplay, EGL_VENDOR));
 
-    // step2 - bind to the wanted client API
-    /// This is done by bindClient() later on
-    //bindClient(GnashDevice::OPENVG);
-    
     // step3 - find a suitable config
     if (_bpp == 32) {
-        if (EGL_FALSE == eglChooseConfig(_eglDisplay, attrib16_list, 
&_eglConfig,
+        if (EGL_FALSE == eglChooseConfig(_eglDisplay, attrib32_list, 
&_eglConfig,
                                           1, &_eglNumOfConfigs)) {
             log_error("eglChooseConfig(32) failed (error %s)", 
                        getErrorString(eglGetError()));
@@ -305,9 +305,6 @@ EGLDevice::initDevice(int argc, char *argv[])
        printEGLConfig(_eglConfig);
    }
     
-   // log_debug("Gnash EGL Frame width %d height %d bpp %d \n",
-   //           _width, _height, _bpp);
-    
     return true;
 }
 
@@ -405,11 +402,10 @@ EGLDevice::attachWindow(GnashDevice::native_window_t 
window)
         _nativeWindow = static_cast<EGLNativeWindowType>(window);
     }
 
-#if 1
     log_debug("Initializing EGL Surface");
     if (_eglDisplay && _eglConfig) {
         _eglSurface = eglCreateWindowSurface(_eglDisplay, _eglConfig,
-                                             window, NULL);
+                                             _nativeWindow, NULL);
     }
     
     if (EGL_NO_SURFACE == _eglSurface) {
@@ -418,7 +414,6 @@ EGLDevice::attachWindow(GnashDevice::native_window_t window)
     } else {
         printEGLSurface(_eglSurface);
     }
-#endif
     
     // step5 - create a context
     _eglContext = eglCreateContext(_eglDisplay, _eglConfig, EGL_NO_CONTEXT, 
NULL);
@@ -434,7 +429,7 @@ EGLDevice::attachWindow(GnashDevice::native_window_t window)
         log_error("eglMakeCurrent failed (error %s)",
                   getErrorString(eglGetError()));
     }       // begin user code
-    
+
     return true;
 }   
 
@@ -572,7 +567,7 @@ EGLDevice::queryEGLConfig(EGLDisplay display)
          return 0;
      }
      
-#if 1
+#if 0
      // This prints out all the configurations, so it can be quite large
      for (int i=0; i<max_num_config; i++ ) {
          std::cerr << "Config[" << i << "] is:" << i << std::endl;
@@ -591,26 +586,26 @@ EGLDevice::printEGLConfig(EGLConfig config)
     eglGetConfigAttrib(_eglDisplay, config, EGL_RED_SIZE, &red);
     eglGetConfigAttrib(_eglDisplay, config, EGL_GREEN_SIZE, &green);
     eglGetConfigAttrib(_eglDisplay, config, EGL_BLUE_SIZE, &blue);
-    std::cerr << "\tConfig has RED = " << red << ", GREEN = " << green
+    std::cout << "\tConfig has RED = " << red << ", GREEN = " << green
               << ", BLUE = " << blue  << std::endl;
     
     eglGetConfigAttrib(_eglDisplay, config, EGL_ALPHA_SIZE, &value);
-    std::cerr << "\tEGL_ALPHA_SIZE is " << value  << std::endl;
+    std::cout << "\tEGL_ALPHA_SIZE is " << value  << std::endl;
     eglGetConfigAttrib(_eglDisplay, config, EGL_STENCIL_SIZE, &value);
-    std::cerr << "\tEGL_STENCIL_SIZE is " << value  << std::endl;
+    std::cout << "\tEGL_STENCIL_SIZE is " << value  << std::endl;
     eglGetConfigAttrib(_eglDisplay, config, EGL_SAMPLES, &value);
-    std::cerr << "\tEGL_SAMPLES is " << value  << std::endl;
+    std::cout << "\tEGL_SAMPLES is " << value  << std::endl;
     eglGetConfigAttrib(_eglDisplay, config, EGL_DEPTH_SIZE, &value);
-    std::cerr << "\tEGL_DEPTH_SIZE is " << value  << std::endl;
+    std::cout << "\tEGL_DEPTH_SIZE is " << value  << std::endl;
     eglGetConfigAttrib(_eglDisplay, config, EGL_MAX_SWAP_INTERVAL, &value);
-    std::cerr << "\tEGL_MAX_SWAP_INTERVAL is " << value << std::endl;
+    std::cout << "\tEGL_MAX_SWAP_INTERVAL is " << value << std::endl;
     eglGetConfigAttrib(_eglDisplay, config, EGL_MIN_SWAP_INTERVAL, &value);
-    std::cerr << "\tEGL_MIN_SWAP_INTERVAL is " << value << std::endl;
+    std::cout << "\tEGL_MIN_SWAP_INTERVAL is " << value << std::endl;
     eglGetConfigAttrib(_eglDisplay, config, EGL_NATIVE_RENDERABLE, &value);
     std::string val = (value)? "true" : "false";
-    std::cerr << "\tEGL_NATIVE_RENDERABLE is " << val << std::endl;
+    std::cout << "\tEGL_NATIVE_RENDERABLE is " << val << std::endl;
     eglGetConfigAttrib(_eglDisplay, config, EGL_SAMPLE_BUFFERS, &value);
-    std::cerr << "\tEGL_SAMPLE_BUFFERS is " << value << std::endl;
+    std::cout << "\tEGL_SAMPLE_BUFFERS is " << value << std::endl;
     eglGetConfigAttrib(_eglDisplay, config, EGL_RENDERABLE_TYPE, &value);
     if (value > 0) {
         std::string str;
@@ -626,9 +621,9 @@ EGLDevice::printEGLConfig(EGLConfig config)
         if (value & EGL_OPENGL_BIT) {
             str += " OpenGL";
         }
-        std::cerr <<"\tEGL_RENDERABLE_TYPE = " << str << std::endl;
+        std::cout <<"\tEGL_RENDERABLE_TYPE = " << str << std::endl;
     } else {
-        std::cerr <<"\tEGL_RENDERABLE_TYPE (default)" << std::endl;
+        std::cout <<"\tEGL_RENDERABLE_TYPE (default)" << std::endl;
     }
     eglGetConfigAttrib(_eglDisplay, config, EGL_SURFACE_TYPE, &value);
     if (value > 0) {
@@ -642,9 +637,9 @@ EGLDevice::printEGLConfig(EGLConfig config)
         if (value & EGL_PBUFFER_BIT) {
             str += " Pbuffer";
         }
-        std::cerr <<"\tEGL_SURFACE_TYPE = " << str  << std::endl;
+        std::cout <<"\tEGL_SURFACE_TYPE = " << str  << std::endl;
     } else {
-          std::cerr <<"\tEGL_SURFACE_TYPE (default)" << std::endl;
+          std::cout <<"\tEGL_SURFACE_TYPE (default)" << std::endl;
     }
 }
 
@@ -653,15 +648,15 @@ EGLDevice::printEGLContext(EGLContext context)
 {
     EGLint value;
     eglQueryContext(_eglDisplay, context, EGL_CONFIG_ID, &value);
-    std::cerr << "Context EGL_CONFIG_ID is " << value << std::endl;
+    std::cout << "Context EGL_CONFIG_ID is " << value << std::endl;
     eglQueryContext(_eglDisplay, context, EGL_CONTEXT_CLIENT_TYPE, &value);
-    std::cerr << "\tEGL_CONTEXT_CLIENT_TYPE is "
+    std::cout << "\tEGL_CONTEXT_CLIENT_TYPE is "
               << std::string((value == EGL_OPENVG_API)
               ? "EGL_OPENVG_API" : "EGL_OPENGL_ES_API") << std::endl;
     // eglQueryContext(_eglDisplay, context, EGL_CONTEXT_CLIENT_VERSION, 
&value);
     // log_debug("EGL_CONTEXT_CLIENT_VERSION is %d", value);
     eglQueryContext(_eglDisplay, context, EGL_RENDER_BUFFER, &value);
-    std::cerr << "\tEGL_RENDER_BUFFER is " << std::string((value == 
EGL_BACK_BUFFER)
+    std::cout << "\tEGL_RENDER_BUFFER is " << std::string((value == 
EGL_BACK_BUFFER)
               ? "EGL_BACK_BUFFER" : "EGL_SINGLE_BUFFER") << std::endl;
 }
 
@@ -670,24 +665,24 @@ EGLDevice::printEGLSurface(EGLSurface surface)
 {
     EGLint value;
     eglQuerySurface(_eglDisplay, surface, EGL_CONFIG_ID, &value);
-    std::cerr << "Surface EGL_CONFIG_ID is " << value << std::endl;
+    std::cout << "Surface EGL_CONFIG_ID is " << value << std::endl;
     eglQuerySurface(_eglDisplay, surface, EGL_HEIGHT, &value);
-    std::cerr << "\tEGL_HEIGHT is " << value<< std::endl;
+    std::cout << "\tEGL_HEIGHT is " << value<< std::endl;
     eglQuerySurface(_eglDisplay, surface, EGL_WIDTH, &value);
-    std::cerr << "\tEGL_WIDTH is " << value << std::endl;
+    std::cout << "\tEGL_WIDTH is " << value << std::endl;
     eglQuerySurface(_eglDisplay, surface, EGL_RENDER_BUFFER, &value);
-    std::cerr << "\tEGL_RENDER_BUFFER is " << std::string((value == 
EGL_BACK_BUFFER)
+    std::cout << "\tEGL_RENDER_BUFFER is " << std::string((value == 
EGL_BACK_BUFFER)
               ? "EGL_BACK_BUFFER" : "EGL_SINGLE_BUFFER") << std::endl;
     eglQuerySurface(_eglDisplay, surface, EGL_VERTICAL_RESOLUTION, &value);
-    std::cerr << "\tEGL_VERTICAL_RESOLUTION is " << value << std::endl;
+    std::cout << "\tEGL_VERTICAL_RESOLUTION is " << value << std::endl;
     eglQuerySurface(_eglDisplay, surface, EGL_HORIZONTAL_RESOLUTION, &value);
-    std::cerr << "\tEGL_HORIZONTAL_RESOLUTION is " << value << std::endl;
+    std::cout << "\tEGL_HORIZONTAL_RESOLUTION is " << value << std::endl;
     eglQuerySurface(_eglDisplay, surface, EGL_SWAP_BEHAVIOR, &value);
-    std::cerr << "\tEGL_SWAP_BEHAVIOR is "
+    std::cout << "\tEGL_SWAP_BEHAVIOR is "
               << std::string((value == EGL_BUFFER_DESTROYED)
                  ? "EGL_BUFFER_DESTROYED" : "EGL_BUFFER_PRESERVED") << 
std::endl;
     eglQuerySurface(_eglDisplay, surface, EGL_MULTISAMPLE_RESOLVE, &value);
-    std::cerr << "\tEGL_MULTISAMPLE_RESOLVE is "
+    std::cout << "\tEGL_MULTISAMPLE_RESOLVE is "
               << std::string((value == EGL_MULTISAMPLE_RESOLVE_BOX)
                  ? "EGL_MULTISAMPLE_RESOLVE_BOX" : 
"EGL_MULTISAMPLE_RESOLVE_DEFAULT") << std::endl;
 }
diff --git a/libdevice/egl/eglDevice.h b/libdevice/egl/eglDevice.h
index 95161a9..59c3a5c 100644
--- a/libdevice/egl/eglDevice.h
+++ b/libdevice/egl/eglDevice.h
@@ -230,8 +230,8 @@ class EGLDevice : public GnashDevice
                 }
                 return true;
             }
-            return false;
         }
+        return false;        
     }
     
     size_t getVerticalRes() {

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


commit ac2a828248e8442352bbd49ddd1ff90d1261cf8d
Author: Rob Savoye <address@hidden>
Date:   Thu Dec 23 09:18:07 2010 -0700

    fix all test cases to match reality now that we have real hardware that 
supports EGL in a framebuffrer

diff --git a/libdevice/egl/test_egl.cpp b/libdevice/egl/test_egl.cpp
index d69d406..b6eefca 100644
--- a/libdevice/egl/test_egl.cpp
+++ b/libdevice/egl/test_egl.cpp
@@ -29,6 +29,10 @@
 #include <regex.h>
 #include <boost/assign/list_of.hpp>
 
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+
 #ifdef HAVE_EGL_EGL_H
 # include <EGL/egl.h>
 #else
@@ -65,27 +69,30 @@ main(int argc, char *argv[])
     // FIXME: for now, always run verbose till this supports command line args
     dbglogfile.setVerbosity();
     
-    EGLDevice egl1, egl2, egl3;
-
 #ifdef RENDERER_OPENVG
+    EGLDevice egl1;
     std::cerr << "== OpenVG tests ==" << std::endl;
     test_egl(egl1, GnashDevice::OPENVG, argc, argv);
     egl1.printEGLConfig();
     egl1.printEGLContext();
     egl1.printEGLSurface();
 #endif
-    
-#ifdef RENDERER_GLES1
+
+#if 0
+#ifdef RENDERER_GLES1 
+    EGLDevice egl2;
     std::cerr << "== OpenGLES1 tests ==" << std::endl;
     test_egl(egl2, GnashDevice::OPENGLES1, argc, argv);
 //    egl2.printEGLConfig();
 #endif
     
 #ifdef RENDERER_GLES2
+    EGLDevice egl3;
     std::cerr << "== OpenGLES2 tests ==" << std::endl;
     test_egl(egl3, GnashDevice::OPENGLES2, argc, argv);
 //    egl3.printEGLConfig();
 #endif
+#endif
 }
 
 void
@@ -133,15 +140,14 @@ test_egl(EGLDevice &egl, GnashDevice::rtype_t rtype, int 
argc, char *argv[])
         runtest.untested("EGLDevice::queryEGLConfig()");
     }
 
-#if 0
     // Init'ing to zero uses the root screen as the display. Otherwise
     // the argument should be an EGLNativeWindowType.
-    if (egl.attachWindow(0)) {
+    int fd = open("/dev/fb0", O_RDWR);
+    if (egl.attachWindow(fd)) {
         runtest.pass("EGLDevice::attachWindow(0)");
     } else {
         runtest.fail("EGLDevice::attachWindow(0)");
     }
-#endif
     
     if (hwinit) {
         if (egl.supportsRenderer(rtype)) {
@@ -214,10 +220,21 @@ test_egl(EGLDevice &egl, GnashDevice::rtype_t rtype, int 
argc, char *argv[])
         runtest.untested("EGLDevice::getHeigth()");
     }
 
-#if 0
-    // these are the same as width and height
     if (hwinit) {
-        if (egl.getVerticalRes()) {
+        if (egl.isSingleBuffered() != egl.isBackBuffered()) {
+            runtest.pass("EGLDevice::is*Buffered()");
+        } else {
+            runtest.fail("EGLDevice::is*Buffered()");
+        }
+    } else {
+        runtest.untested("EGLDevice::is*Buffered()");
+    }
+
+    // these are often the same as width and height, but not on all
+    // displays. When EGL is back buffered, the size of the display
+    // horizontally is doubled.
+    if (hwinit) {
+        if (egl.getVerticalRes() == 480) {
             runtest.pass("EGLDevice::getVerticalRes()");
         } else {
             runtest.fail("EGLDevice::getVerticalRes()");
@@ -228,7 +245,11 @@ test_egl(EGLDevice &egl, GnashDevice::rtype_t rtype, int 
argc, char *argv[])
 
     
     if (hwinit) {
-        if (egl.getHorzRes()) {
+        int newval = 800;
+        if (egl.isBackBuffered()) {
+            newval += newval;
+        }
+        if (egl.getHorzRes() == 1600) {
             runtest.pass("EGLDevice::getHorzRes()");
         } else {
             runtest.fail("EGLDevice::getHorzRes()");
@@ -236,23 +257,13 @@ test_egl(EGLDevice &egl, GnashDevice::rtype_t rtype, int 
argc, char *argv[])
     } else {
         runtest.untested("EGLDevice::getHorzRes()");
     }
-#endif
     
-    if (hwinit) {
-        if (egl.isSingleBuffered() != egl.isBackBuffered()) {
-            runtest.pass("EGLDevice::is*Buffered()");
-        } else {
-            runtest.fail("EGLDevice::is*Buffered()");
-        }
-    } else {
-        runtest.untested("EGLDevice::is*Buffered()");
-    }
-
+    // When running in a framebuffer, EGL_SWAP_BEHAVIOR is EGL_BUFFER_PRESERVED
     if (hwinit) {
         if (egl.isBufferDestroyed()) {
-            runtest.pass("EGLDevice::isBufferDestroyed()");
-        } else {
             runtest.fail("EGLDevice::isBufferDestroyed()");
+        } else {
+            runtest.pass("EGLDevice::isBufferDestroyed()");
         }
     } else {
         runtest.untested("EGLDevice::isBufferDestroyed()");
@@ -296,12 +307,13 @@ test_egl(EGLDevice &egl, GnashDevice::rtype_t rtype, int 
argc, char *argv[])
     } else {
         runtest.untested("EGLDevice::isContext*Buffered()");
     }
-    
+
+    // When running in a framebuffer, EGL_NATIVE_RENDERABLE is false
     if (hwinit) {
         if (egl.isNativeRender()) {
-            runtest.pass("EGLDevice::isNativeRender()");
-        } else {
             runtest.fail("EGLDevice::isNativeRender()");
+        } else {
+            runtest.pass("EGLDevice::isNativeRender()");
         }
     } else {
         runtest.untested("EGLDevice::isNativeRender()");
@@ -338,7 +350,7 @@ test_egl(EGLDevice &egl, GnashDevice::rtype_t rtype, int 
argc, char *argv[])
     }
     
     if (hwinit) {
-        if (egl.getMaxSwapInterval() == 0) {
+        if (egl.getMaxSwapInterval() == 1) {
             runtest.pass("EGLDevice::getMaxSwapInterval()");
         } else {
             runtest.fail("EGLDevice::getMaxSwapInterval()");
@@ -348,7 +360,7 @@ test_egl(EGLDevice &egl, GnashDevice::rtype_t rtype, int 
argc, char *argv[])
     }
     
     if (hwinit) {
-        if (egl.getMinSwapInterval() == 0) {
+        if (egl.getMinSwapInterval() == 1) {
             runtest.pass("EGLDevice::getMinSwapInterval()");
         } else {
             runtest.fail("EGLDevice::getMinSwapInterval()");
@@ -360,7 +372,7 @@ test_egl(EGLDevice &egl, GnashDevice::rtype_t rtype, int 
argc, char *argv[])
     // Test Pbuffers
     if (hwinit) {
         EGLSurface surf = egl.createPbuffer(200, 200);
-        if ((surf != EGL_NO_SURFACE) && (egl.getWidth(surf) == 200)) {
+        if ((egl.getWidth(surf) == 200) && (egl.getHeight(surf) == 200)) {
             runtest.pass("EGLDevice::createPbuffer(int, int)");
         } else {
             runtest.fail("EGLDevice::createPbuffer(int, int)");
@@ -400,9 +412,10 @@ test_egl(EGLDevice &egl, GnashDevice::rtype_t rtype, int 
argc, char *argv[])
     }
 
     egl.makePbufferCurrent(1);
+    // The current surface is fullscreen
     EGLSurface surf4 = eglGetCurrentSurface(EGL_DRAW);
     if (hwinit) {
-        if ((egl.getWidth(surf4) == 300) && ((egl.getHeight(surf4) == 300))) {
+        if ((egl.getWidth(surf4) == 800) && ((egl.getHeight(surf4) == 480))) {
             runtest.pass("EGLDevice::makePbufferCurrent(int)");
         } else {
             runtest.fail("EGLDevice::makePbufferCurrent(int)");
@@ -433,6 +446,7 @@ test_egl(EGLDevice &egl, GnashDevice::rtype_t rtype, int 
argc, char *argv[])
     
     // EGLSurface surf5 = eglGetCurrentSurface(EGL_DRAW);
     // egl.printEGLSurface(surf5);
+    close(fd);
 }
 
 // Local Variables:

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


commit a82e6bb5368ec40c94a7efe05f8e09545e00d660
Author: Rob Savoye <address@hidden>
Date:   Mon Dec 20 19:44:42 2010 -0700

    fix --enable-device= option

diff --git a/configure.ac b/configure.ac
index ae44046..ac5b22e 100644
--- a/configure.ac
+++ b/configure.ac
@@ -1134,11 +1134,7 @@ device_list="EGL RawFB"
 ndevice=2
 AC_ARG_ENABLE(device,
   AC_HELP_STRING([--enable-device], [Specify which hardware abstraction to use 
to support to enable (none,openmax,egl,directfb,rawfb,x11,vaapi)]),
-  if test -z ${enableval}; then
-      device_list="none"
-      ndevice=0
-      enableval=""
-  fi
+  enableval=`echo ${enableval} | tr '\054' ' ' `
   while test -n "${enableval}" ; do
     val=`echo ${enableval} | cut -d ' ' -f 1`
     [case "${val}" in

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

Summary of changes:
 configure.ac                     |    6 +--
 gui/fb/fb.cpp                    |   48 +++++++++++--------
 gui/fb/fb_glue_ovg.cpp           |   64 +++++++++++++++++++------
 gui/fb/fb_glue_ovg.h             |    5 ++
 gui/gtk/gtk_glue_ovg.cpp         |   63 +++++++++++++++---------
 libdevice/DeviceGlue.h           |    9 ++++
 libdevice/Makefile.am            |    2 +-
 libdevice/egl/egl.am             |    2 +-
 libdevice/egl/eglDevice.cpp      |   97 ++++++++++++++++++--------------------
 libdevice/egl/eglDevice.h        |    2 +-
 libdevice/egl/test_egl.cpp       |   76 +++++++++++++++++------------
 libdevice/events/test_events.cpp |    2 +
 libdevice/rawfb/RawFBDevice.cpp  |   74 +++++++++++++++++-----------
 libdevice/rawfb/RawFBDevice.h    |    1 +
 libdevice/rawfb/test_rawfb.cpp   |   22 ++++----
 libdevice/x11/X11Device.cpp      |    8 ++--
 16 files changed, 287 insertions(+), 194 deletions(-)


hooks/post-receive
-- 
Gnash



reply via email to

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