gnash-commit
[Top][All Lists]
Advanced

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

[Gnash-commit] [SCM] Gnash branch, hwaccel, created. release_0_8_9_start


From: Rob Savoye
Subject: [Gnash-commit] [SCM] Gnash branch, hwaccel, created. release_0_8_9_start-918-gd56072b
Date: Mon, 04 Apr 2011 02:54:37 +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, hwaccel has been created
        at  d56072bc6240d043e2208fd81e754b650851b367 (commit)

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


commit d56072bc6240d043e2208fd81e754b650851b367
Author: Rob Savoye <address@hidden>
Date:   Sun Apr 3 20:53:36 2011 -0600

    fix config ifdef for DirectFB support

diff --git a/libdevice/directfb/DirectFBDevice.cpp 
b/libdevice/directfb/DirectFBDevice.cpp
index eec4a83..1970eb7 100644
--- a/libdevice/directfb/DirectFBDevice.cpp
+++ b/libdevice/directfb/DirectFBDevice.cpp
@@ -30,10 +30,10 @@
 #include "Renderer.h"
 #include "GnashException.h"
 
-#ifdef HAVE_DIRECTFB_DIRECTFB_H
+#ifdef HAVE_DIRECTFB_H
 # include <directfb/directfb.h>
 #else
-# error "This file needs DIRECTFB"
+# error "This file needs DirectFB"
 #endif
 
 #include "DirectFBDevice.h"
diff --git a/libdevice/directfb/DirectFBDevice.h 
b/libdevice/directfb/DirectFBDevice.h
index c8ad9a7..1071d61 100644
--- a/libdevice/directfb/DirectFBDevice.h
+++ b/libdevice/directfb/DirectFBDevice.h
@@ -27,10 +27,10 @@
 #include <boost/scoped_array.hpp>
 #include <boost/scoped_ptr.hpp>
 
-#ifdef HAVE_DIRECTFB_DIRECTFB_H
+#ifdef HAVE_DIRECTFB_H
 # include <directfb/directfb.h>
 #else
-# error "This file needs DIRECTFB"
+# error "This file needs DirectFB"
 #endif
 
 #include "GnashDevice.h"

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


commit f5ed425abf4e0ac10d302fc6cebeda0c73694585
Author: Rob Savoye <address@hidden>
Date:   Sun Apr 3 12:32:00 2011 -0600

    drop references to gles2

diff --git a/libdevice/egl/test_egl.cpp b/libdevice/egl/test_egl.cpp
index 73e7b0b..711ffe5 100644
--- a/libdevice/egl/test_egl.cpp
+++ b/libdevice/egl/test_egl.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
@@ -63,7 +63,6 @@ static LogFile& dbglogfile = LogFile::getDefaultInstance();
 const char *estrs[] = {
     "OpenVG",
     "OpenGLES1",
-    "OpenGLES2",
     "X11",
     "VAAPI"
 };
@@ -93,12 +92,6 @@ main(int argc, char *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
 }
 

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


commit 520fb39846f22b32290ea2300bf8a6c29e556e01
Author: Rob Savoye <address@hidden>
Date:   Sun Apr 3 12:31:31 2011 -0600

    add error message fr bad window handle

diff --git a/libdevice/egl/eglDevice.cpp b/libdevice/egl/eglDevice.cpp
index 6013181..7bdf728 100644
--- a/libdevice/egl/eglDevice.cpp
+++ b/libdevice/egl/eglDevice.cpp
@@ -379,6 +379,7 @@ EGLDevice::attachWindow(GnashDevice::native_window_t window)
     GNASH_REPORT_FUNCTION;
     
     if (!window) {
+        log_error("bogus window handle!");
         return false;
     } else {
         _nativeWindow = static_cast<EGLNativeWindowType>(window);

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


commit 8851430b6c6ce8e9559eb8026b568317b2fa29f1
Author: Rob Savoye <address@hidden>
Date:   Sun Apr 3 12:30:59 2011 -0600

    make whether the drawing area needs to be intitizlized when realized 
dynamic, rather than a compile time option.

diff --git a/gui/gtk/gtk_canvas.cpp b/gui/gtk/gtk_canvas.cpp
index 4aaa155..15d229f 100644
--- a/gui/gtk/gtk_canvas.cpp
+++ b/gui/gtk/gtk_canvas.cpp
@@ -187,12 +187,12 @@ gnash_canvas_realize(GtkWidget *widget)
                                     &attributes, attributes_mask);
     gdk_window_set_user_data (widget->window, widget);
 
-#if defined(RENDERER_CAIRO) || defined(RENDERER_AGG) || 
defined(RENDERER_OPENVG)
-    // cairo needs the _drawingArea.window to prepare it ..
-    // TODO: find a way to make 'glue' use independent from actual
-    // renderer in use
-    canvas->glue->prepDrawingArea(GTK_WIDGET(canvas));
-#endif
+    if (canvas->glue->needsDrawingArea()) {
+       // cairo needs the _drawingArea.window to prepare it ..
+       // TODO: find a way to make 'glue' use independent from actual
+       // renderer in use
+       canvas->glue->prepDrawingArea(GTK_WIDGET(canvas));
+    }
 }
 
 static void
diff --git a/gui/gtk/gtk_glue.h b/gui/gtk/gtk_glue.h
index e49e92d..721e2b5 100644
--- a/gui/gtk/gtk_glue.h
+++ b/gui/gtk/gtk_glue.h
@@ -40,7 +40,7 @@ namespace gnash {
 class GtkGlue : public DeviceGlue
 {
   public:
-    GtkGlue() : _drawing_area(0) { }
+    GtkGlue() : _drawing_area(0), _needs_area(false) { }
     virtual ~GtkGlue() { }
     virtual bool init(int argc, char **argv[]) = 0;
 
@@ -48,7 +48,6 @@ class GtkGlue : public DeviceGlue
     virtual Renderer* createRenderHandler() = 0;
     virtual void setRenderHandlerSize(int /*width*/, int /*height*/) {}
     virtual void render() = 0;
-    
     virtual void render(int /*minx*/, int /*miny*/, int /*maxx*/, int /*maxy*/)
     {
         render();      
@@ -75,8 +74,11 @@ class GtkGlue : public DeviceGlue
     
     virtual void beforeRendering(movie_root*) {};
 
+    virtual bool needsDrawingArea() { return _needs_area; };
+
   protected:
     GtkWidget *_drawing_area;
+    bool      _needs_area;  
 };
 
 } // namespace gnash
diff --git a/gui/gtk/gtk_glue_agg.h b/gui/gtk/gtk_glue_agg.h
index a7f0925..fd86558 100644
--- a/gui/gtk/gtk_glue_agg.h
+++ b/gui/gtk/gtk_glue_agg.h
@@ -37,6 +37,7 @@ class GtkAggGlue : public GtkGlue
     ~GtkAggGlue();
 
     bool init(int argc, char **argv[]);
+    bool needsDrawingArea() { return true; };
     void prepDrawingArea(GtkWidget *drawing_area);
     Renderer* createRenderHandler();
     void setRenderHandlerSize(int width, int height);
diff --git a/gui/gtk/gtk_glue_cairo.h b/gui/gtk/gtk_glue_cairo.h
index b3d61f9..a8e4a49 100644
--- a/gui/gtk/gtk_glue_cairo.h
+++ b/gui/gtk/gtk_glue_cairo.h
@@ -33,6 +33,7 @@ class GtkCairoGlue : public GtkGlue
     ~GtkCairoGlue();
 
     bool init(int argc, char ***argv);
+    bool needsDrawingArea() { return true; };
     void prepDrawingArea(GtkWidget *drawing_area);
     Renderer* createRenderHandler();
     void beforeRendering();
diff --git a/gui/gtk/gtk_glue_ovg.cpp b/gui/gtk/gtk_glue_ovg.cpp
index 5e61a7a..aafc7c9 100644
--- a/gui/gtk/gtk_glue_ovg.cpp
+++ b/gui/gtk/gtk_glue_ovg.cpp
@@ -145,6 +145,14 @@ GtkOvgGlue::prepDrawingArea(GtkWidget *drawing_area)
         egl->bindClient(renderer::GnashDevice::OPENVG);
     }
     
+
+    // Attach the window to the low level device
+    long xid = GDK_WINDOW_XID(gtk_widget_get_window(drawing_area));
+    _device->attachWindow(static_cast<renderer::GnashDevice::native_window_t>
+                          (xid));
+
+    //vgLoadIdentity();
+
 #if 0
     renderer::EGLDevice *egl = (renderer::EGLDevice*)_device.get();
     egl->printEGLSurface(eglGetCurrentSurface(EGL_DRAW));

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


commit 6a25673950adc9b630fc3b58c22afda0de1d38a0
Author: Rob Savoye <address@hidden>
Date:   Sun Apr 3 08:57:25 2011 -0600

    drop original version that is unused

diff --git a/gui/gtk/gtk_glue_egl.cpp b/gui/gtk/gtk_glue_egl.cpp
deleted file mode 100644
index d574fe4..0000000
--- a/gui/gtk/gtk_glue_egl.cpp
+++ /dev/null
@@ -1,746 +0,0 @@
-//
-//   Copyright (C) 2005, 2006, 2007, 2008, 2009, 2010 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
-// the Free Software Foundation; either version 3 of the License, or
-// (at your option) any later version.
-//
-// This program is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-// GNU General Public License for more details.
-// 
-// You should have received a copy of the GNU General Public License
-// along with this program; if not, write to the Free Software
-// Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
-
-#ifdef HAVE_CONFIG_H
-#include "gnashconfig.h"
-#endif
-
-#include <cerrno>
-#include <exception>
-#include <gtk/gtk.h>
-#include <gdk/gdk.h>
-
-#include "log.h"
-#include "RunResources.h"
-#include "Renderer.h"
-#include "gtk_glue_egl.h"
-#include "GnashException.h"
-#include "openvg/Renderer_ovg.h"
-
-#ifdef HAVE_VG_OPENVG_H
-#include <VG/openvg.h>
-#endif
-
-#ifdef HAVE_EGL_EGL_H
-# include <EGL/egl.h>
-#else
-# error "This file needs EGL, which is part of OpenGL-ES"
-#endif
-
-#include <GL/gl.h>
-
-namespace gnash
-{
-
-static const EGLint attrib32_list[] = {
-    EGL_RED_SIZE,       8,
-    EGL_GREEN_SIZE,     8,
-    EGL_BLUE_SIZE,      8,
-    EGL_ALPHA_SIZE,     0,
-#ifdef RENDERER_GLES    
-    EGL_RENDERABLE_TYPE, EGL_OPENGL_ES_BIT,
-#endif
-#ifdef RENDERER_OPENVG
-    EGL_RENDERABLE_TYPE, EGL_OPENVG_BIT,
-    EGL_DEPTH_SIZE,     24,
-    EGL_STENCIL_SIZE,   8,
-#endif
-    EGL_SURFACE_TYPE,   EGL_WINDOW_BIT,
-    EGL_NONE
-};
-
-static EGLint const attrib16_list[] = {
-    EGL_RED_SIZE,       5,
-    EGL_GREEN_SIZE,     6,
-    EGL_BLUE_SIZE,      5,
-    EGL_ALPHA_SIZE,     0,
-#ifdef RENDERER_GLES    
-    EGL_RENDERABLE_TYPE, EGL_OPENGL_ES_BIT,
-#endif
-#ifdef RENDERER_OPENVG
-    EGL_RENDERABLE_TYPE, EGL_OPENVG_BIT,
-    EGL_DEPTH_SIZE,     0,
-    EGL_STENCIL_SIZE,   0,
-#endif
-    EGL_SURFACE_TYPE,   EGL_WINDOW_BIT,
-    EGL_SAMPLE_BUFFERS, 0,
-    EGL_NONE
-};
-
-const EGLint window_attrib_list[] = {
-    // Back buffering is used for window and pbuffer surfaces. Windows
-    // require eglSwapBuffers() to become visible, and pbuffers don't.   
-    // EGL_SINGLE_BUFFER is by pixmap surfaces. With OpenVG, windows
-    // can also be single buffered. eglCopyBuffers() can be used to copy
-    // both back and single buffered surfaces to a pixmap.
-    EGL_RENDER_BUFFER, EGL_BACK_BUFFER,
-    EGL_COLORSPACE,    EGL_COLORSPACE_sRGB,
-    EGL_NONE
-};
-
-// From the EGL 1.4 spec:
-//
-// EGL defines several types of drawing surfaces collectively referred
-// to as EGLSurfaces. These include windows, used for onscreen
-// rendering; pbuffers, used for offscreen rendering; and pixmaps,
-// used for offscreen rendering into buffers that may be accessed
-// through native APIs. EGL windows and pixmaps are tied to native
-// window system windows and pixmaps.
-//
-// depth, multisample, and stencil buffers are currently used only by
-// OpenGL-ES.
-
-// EGL and OpenGL ES supports two rendering models: back buffered and
-// single buffered. Back buffered rendering is used by window and
-// pbuffer surfaces. Memory for the color buffer used during rendering
-// is allocated and owned by EGL. When the client is finished drawing
-// a frame, the back buffer may be copied to a visible window using
-// eglSwapBuffers. Pbuffer surfaces have a back buffer but no
-// associated window, so the back buffer need not be copied.
-//
-// Single buffered rendering is used by pixmap surfaces. Memory for
-// the color buffer is specified at surface creation time in the form
-// of a native pixmap, and client APIs are required to use that memory
-// during rendering. When the client is finished drawing a frame, the
-// native pixmap contains the final image. Pixmap surfaces typically
-// do not support multisampling, since the native pixmap used as the
-// color buffer is unlikely to provide space to store multisample
-// information. Some client APIs , such as OpenGL and OpenVG , also
-// support single buffered rendering to window surfaces. This behavior
-// can be selected when creating the window surface, as defined in
-// section 3.5.1. When mixing use of client APIs which do not support
-// single buffered rendering into windows, like OpenGL ES , with
-// client APIs which do support it, back color buffers and visible
-// window contents must be kept consistent when binding window
-// surfaces to contexts for each API type. Both back and single
-// buffered surfaces may also be copied to a specified native pixmap
-// using eglCopyBuffers.
-
-// Native rendering will always be supported by pixmap surfaces (to
-// the extent that native rendering APIs can draw to native
-// pixmaps). Pixmap surfaces are typically used when mixing native and
-// client API rendering is desirable, since there is no need to move
-// data between the back buffer visible to the client APIs and the
-// native pixmap visible to native rendering APIs. However, pixmap
-// surfaces may, for the same reason, have restricted capabilities and
-// performance relative to window and pbuffer surfaces.
-
-GtkEGLGlue::GtkEGLGlue()
-:   _offscreenbuf(0),
-    _renderer(0),
-    _eglConfig(0),
-    _eglContext(EGL_NO_CONTEXT),
-    _eglSurface(EGL_NO_SURFACE),
-    _eglDisplay(EGL_NO_DISPLAY),
-    _eglNumOfConfigs(0),
-    _nativeWindow(0),
-    _max_num_config(1),
-    _bpp(32),
-    _width(0),
-    _height(0)
-{
-    GNASH_REPORT_FUNCTION;
-}
-
-GtkEGLGlue::~GtkEGLGlue()
-{
-    GNASH_REPORT_FUNCTION;
-
-#ifdef ENABLE_EGL_OFFSCREEN
-    if (_offscreenbuf) {
-        gdk_image_destroy(_offscreenbuf);
-    }
-#endif    
-    if (_eglDisplay != EGL_NO_DISPLAY) {  
-        eglMakeCurrent(_eglDisplay, EGL_NO_SURFACE, EGL_NO_SURFACE, 
EGL_NO_CONTEXT);
-        
-        if (_eglContext != EGL_NO_CONTEXT)
-            eglDestroyContext(_eglDisplay, _eglContext);
-        
-        if (_eglSurface != EGL_NO_SURFACE)
-            eglDestroySurface(_eglDisplay, _eglSurface);
-        
-        // if (_eglwin_native)
-        //     free(_eglwin_native);
-        
-        eglTerminate(_eglDisplay);
-    }
-}
-
-bool
-GtkEGLGlue::init(int /*argc*/, char ** /*argv*/[])
-{
-    GNASH_REPORT_FUNCTION;
-    
-    EGLint major, minor;
-    // see egl_config.c for a list of supported configs, this looks for
-    // a 5650 (rgba) config, supporting OpenGL ES and windowed surfaces
-
-    // step 1 - get an EGL display
-    
-    // This can be called multiple times, and always returns the same display
-    _eglDisplay = eglGetDisplay(EGL_DEFAULT_DISPLAY); // FIXME: gdk_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, &major, &minor)) {
-        log_error( "eglInitialize() failed (error %s)",
-                   getErrorString(eglGetError()));
-        return false;
-    }
-    // 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
-#ifdef  RENDERER_GLES
-    if(EGL_FALSE == eglBindAPI(EGL_OPENGL_ES_API)) {
-        log_error("eglBindAPI() failed to retrive the number of configs (error 
%s)",
-                  getErrorString(eglGetError()));
-        return false;
-    }
-#endif
-#ifdef RENDERER_OPENVG
-    if(EGL_FALSE == eglBindAPI(EGL_OPENVG_API)) {
-        log_error("eglBindAPI() failed to retrive the number of configs (error 
%s)",
-                  getErrorString(eglGetError()));
-        return false;
-    }
-#endif
-
-//    queryEGLConfig(_eglDisplay);
-    
-    // step3 - find a suitable config
-    if (_bpp == 32) {
-        if (EGL_FALSE == eglChooseConfig(_eglDisplay, attrib32_list, 
&_eglConfig,
-                                          1, &_eglNumOfConfigs)) {
-            log_error("eglChooseConfig() failed (error %s)", 
-                       getErrorString(eglGetError()));
-            return false;
-        }
-    } else if (_bpp == 16) {
-        if (EGL_FALSE == eglChooseConfig(_eglDisplay, attrib16_list, 
&_eglConfig,
-                                         1, &_eglNumOfConfigs)) {
-            log_error("eglChooseConfig() failed (error %s)",
-                       getErrorString(eglGetError()));
-            return false;
-        }
-    } else {
-        log_error("No supported bpp value!");
-    }
-
-    if (0 == _eglNumOfConfigs) {
-        log_error("eglChooseConfig() was unable to find a suitable config");
-        return false;
-    }
-
-    EGLint vid;
-    if (!eglGetConfigAttrib(_eglDisplay, _eglConfig, EGL_NATIVE_VISUAL_ID, 
&vid)) {
-        log_error("eglGetConfigAttrib() failed (error %s)",
-                  getErrorString(eglGetError()));
-        return false;
-    }
-    
-    XVisualInfo *visInfo, visTemplate;
-    int num_visuals;
-    // The X window visual must match the EGL config
-   visTemplate.visualid = vid;
-   visInfo = XGetVisualInfo(gdk_display, VisualIDMask, &visTemplate, 
&num_visuals);
-   if (!visInfo) {
-       log_error("couldn't get X visual");
-       return false;
-   }
-   XFree(visInfo);
-    
-   if (!checkEGLConfig(_eglConfig)) {
-       log_error("EGL configuration doesn't match!");
-//       return false;
-   } else {
-       //printEGLConfig(_eglConfig);
-   }
-
-    // step4 - create a window surface
-    _nativeWindow = gdk_x11_get_default_root_xwindow();
-    
-
-#ifdef  RENDERER_GLES
-    _eglSurface = eglCreateWindowSurface(_eglDisplay, &_eglConfig, 
_nativeWindow, NULL);
-#endif
-#ifdef  RENDERER_OPENVG
-    if (_nativeWindow) {
-        _eglSurface = eglCreateWindowSurface(_eglDisplay, _eglConfig,
-                                             _nativeWindow, 0); // was 
window_attrib_list
-    } else {
-        log_error("No native window!");
-        return false;
-    }
-#endif
-
-    if (EGL_NO_SURFACE == _eglSurface) {
-        log_error("eglCreateWindowSurface failed (error %s)", 
-                  getErrorString(eglGetError()));
-        return false;
-    } else {
-        //printEGLSurface(_eglSurface);
-    }
-
-    // step5 - create a context
-    _eglContext = eglCreateContext(_eglDisplay, _eglConfig, EGL_NO_CONTEXT, 
NULL);
-    if (EGL_NO_CONTEXT == _eglContext) {
-        log_error("eglCreateContext failed (error %s)",
-                   getErrorString(eglGetError()));
-        return false;
-    } else {
-        printEGLContext(_eglContext);
-    }
-    
-    // step6 - make the context and surface current
-    if (EGL_FALSE == eglMakeCurrent(_eglDisplay, _eglSurface, _eglSurface, 
_eglContext)) {
-        log_error("eglMakeCurrent failed (error %s)",
-                  getErrorString(eglGetError()));
-        return false;
-    }       // begin user code
-
-#if 0
-#if 1
-    eglSwapInterval(_eglDisplay, 0);
-#else
-    eglSwapBuffers(_eglDisplay, _eglSurface);
-#endif
-
-    log_debug("Gnash EGL Frame width %d height %d bpp %d \n", _width, _height, 
_bpp);
-#endif
-    
-    return true;
-}
-
-void
-GtkEGLGlue::prepDrawingArea(GtkWidget *drawing_area)
-{
-    GNASH_REPORT_FUNCTION;
-
-    _drawing_area = drawing_area;
-
-    // Disable double buffering, otherwise gtk tries to update widget
-    // 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;
-}
-
-Renderer*
-GtkEGLGlue::createRenderHandler()
-{
-    GNASH_REPORT_FUNCTION;
-
-    if (!_drawing_area) {
-        log_error("No area to draw in!");
-        return 0;
-    }
-    
-    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 = dynamic_cast<Renderer 
*>(renderer::openvg::create_handler(pixelformat));
-    if (! _renderer) {
-        boost::format fmt = boost::format(
-            _("Could not create OPENVG renderer with pixelformat %s")
-            ) % pixelformat;
-        throw GnashException(fmt.str());
-    }
-
-    return _renderer;
-}
-
-void
-GtkEGLGlue::setRenderHandlerSize(int width, int height)
-{
-    GNASH_REPORT_FUNCTION;
-
-    assert(width > 0);
-    assert(height > 0);
-    assert(_renderer != NULL);
-    
-#ifdef ENABLE_EGL_OFFSCREEN
-    if (_offscreenbuf && _offscreenbuf->width == width &&
-        _offscreenbuf->height == height) {
-        return; 
-    }
-
-    if (_offscreenbuf) {
-        gdk_image_destroy(_offscreenbuf);
-    }
-
-    GdkVisual* visual = gdk_drawable_get_visual(_drawing_area->window);
-
-    _offscreenbuf = gdk_image_new (GDK_IMAGE_FASTEST, visual, width,
-                                   height);
-    
-    static_cast<Renderer_ovg_base *>(_renderer)->init_buffer(
-        (unsigned char*) _offscreenbuf->mem,
-        _offscreenbuf->bpl * _offscreenbuf->height,
-        _offscreenbuf->width,
-        _offscreenbuf->height,
-        _offscreenbuf->bpl);
-#else
-        _renderer->init(width, height);
-#endif
-}
-
-void 
-GtkEGLGlue::beforeRendering()
-{
-    GNASH_REPORT_FUNCTION;
-
-#ifdef ENABLE_EGL_OFFSCREEN
-    if (_offscreenbuf && _offscreenbuf->type == GDK_IMAGE_SHARED) {
-         gdk_flush();
-    }
-#endif
-}
-
-void
-GtkEGLGlue::render()
-{
-    GNASH_REPORT_FUNCTION;
-
-#if 0
-    // clear the color buffer
-    glClearColor(1.0, 1.0, 0.0, 1.0);
-    glClear(GL_COLOR_BUFFER_BIT);
-    glFlush();
-#endif
-
-#ifdef ENABLE_EGL_OFFSCREEN
-    if ( _drawbounds.size() == 0 ) {
-        return; // nothing to do
-    }
-
-    if (!_offscreenbuf) {
-        log_error("No off screen buffer!");
-        return;
-    }
-    
-    render(0, 0, _offscreenbuf->width, _offscreenbuf->height);
-#else
-    render(0, 0, _width, _height);
-#endif
-}
-
-void
-GtkEGLGlue::render(int minx, int miny, int maxx, int maxy)
-{
-    GNASH_REPORT_FUNCTION;
-
-#ifdef ENABLE_EGL_OFFSCREEN
-    if (!_offscreenbuf) {
-        log_error("No off screen buffer!");
-        return;
-    }
-    
-    const int& x = minx;
-    const int& y = miny;
-    size_t width = std::min(_offscreenbuf->width, maxx - minx);
-    size_t height = std::min(_offscreenbuf->height, maxy - miny);
-    
-    GdkGC* gc = gdk_gc_new(_drawing_area->window);
-    
-    gdk_draw_image(_drawing_area->window, gc, _offscreenbuf, x, y, x, y, width,
-                   height);
-    gdk_gc_unref(gc);
-#else
-    eglSwapBuffers(_eglDisplay, _eglSurface);
-#endif
-}
-
-void
-GtkEGLGlue::configure(GtkWidget *const /*widget*/, GdkEventConfigure *const 
event)
-{
-    GNASH_REPORT_FUNCTION;
-
-    if (_renderer) {
-        setRenderHandlerSize(event->width, event->height);
-    }
-}
-
-const char *
-GtkEGLGlue::getErrorString(int error)
-{
-    switch (error) {
-    case EGL_SUCCESS:
-        return "EGL_SUCCESS";
-    case EGL_NOT_INITIALIZED:
-        return "EGL_NOT_INITIALIZED";
-    case EGL_BAD_ACCESS:
-        return "EGL_BAD_ACCESS";
-    case EGL_BAD_ALLOC:
-        return "EGL_BAD_ALLOC";
-    case EGL_BAD_ATTRIBUTE:
-        return "EGL_BAD_ATTRIBUTE";
-    case EGL_BAD_CONFIG:
-        return "EGL_BAD_CONFIG";
-    case EGL_BAD_CONTEXT:
-        return "EGL_BAD_CONTEXT";
-    case EGL_BAD_CURRENT_SURFACE:
-        return "EGL_BAD_CURRENT_SURFACE";
-    case EGL_BAD_DISPLAY:
-        return "EGL_BAD_DISPLAY";
-    case EGL_BAD_MATCH:
-        return "EGL_BAD_MATCH";
-    case EGL_BAD_NATIVE_PIXMAP:
-        return "EGL_BAD_NATIVE_PIXMAP";
-    case EGL_BAD_NATIVE_WINDOW:
-        return "EGL_BAD_NATIVE_WINDOW";
-    case EGL_BAD_PARAMETER:
-        return "EGL_BAD_PARAMETER";
-    case EGL_BAD_SURFACE:
-        return "EGL_BAD_SURFACE";
-    case EGL_CONTEXT_LOST:
-        return "EGL_CONTEXT_LOST";
-    default:
-        return "unknown error code";
-    }
-}
-
-bool
-GtkEGLGlue::checkEGLConfig(EGLConfig config)
-{
-    // GNASH_REPORT_FUNCTION;
-    
-    // Use this to explicitly check that the EGL config has the expected color 
depths
-    EGLint value;
-    if (_bpp == 32) {            
-        eglGetConfigAttrib(_eglDisplay, config, EGL_RED_SIZE, &value);
-        if (8 != value) {
-            return false;
-        }
-        eglGetConfigAttrib(_eglDisplay, config, EGL_GREEN_SIZE, &value);
-        if (8 != value) {
-            return false;
-        }
-        eglGetConfigAttrib(_eglDisplay, config, EGL_BLUE_SIZE, &value);
-        if (8 != value) {
-            return false;
-        }
-        eglGetConfigAttrib(_eglDisplay, config, EGL_ALPHA_SIZE, &value);
-        if (8 != value) {
-            return false;
-        }
-        eglGetConfigAttrib(_eglDisplay, config, EGL_SAMPLES, &value);
-        if (0 != value) {
-            return false;
-        }
-    } else if (_bpp == 16) {
-        eglGetConfigAttrib(_eglDisplay, config, EGL_RED_SIZE, &value);
-        if ( 5 != value ) {
-            return false;
-        }
-        eglGetConfigAttrib(_eglDisplay, config, EGL_GREEN_SIZE, &value);
-        if (6 != value) {
-            return false;
-        }
-        eglGetConfigAttrib(_eglDisplay, config, EGL_BLUE_SIZE, &value);
-        if (5 != value) {
-            return false;
-        }
-        eglGetConfigAttrib(_eglDisplay, config, EGL_ALPHA_SIZE, &value);
-        if (0 != value) {
-            return false;
-        }
-        eglGetConfigAttrib(_eglDisplay, config, EGL_SAMPLES, &value);
-#ifdef  RENDERER_GLES            
-        if (4 != value) {
-            return false;
-        }
-#endif
-#ifdef  RENDERER_OPENVG
-        if (0 != value) {
-            return false;
-            }
-#endif
-    } else {
-        return false;
-    }
-
-    return true;
-}
-
-/// Query the system for all supported configs
-int
-GtkEGLGlue::queryEGLConfig(EGLDisplay display)
-{
-     GNASH_REPORT_FUNCTION;
-     EGLConfig *configs = 0;
-     EGLint max_num_config = 0;
-
-     // Get the number of supported configurations
-     if ( EGL_FALSE == eglGetConfigs(display, 0, 0, &max_num_config) ) {
-         log_error("eglGetConfigs() failed to retrive the number of configs 
(error %s)",
-                   getErrorString(eglGetError()));
-         return 0;
-     }
-     if(max_num_config <= 0) {
-         printf( "No EGLconfigs found\n" );
-         return 0;
-     }
-     log_debug("Max number of EGL Configs is %d", max_num_config);     
-     
-     configs = new EGLConfig[max_num_config];
-     if (0 == configs) {
-         log_error( "Out of memory\n" );
-         return 0;
-     }
-
-     if ( EGL_FALSE == eglGetConfigs(display, configs, max_num_config, 
&max_num_config)) {
-         log_error("eglGetConfigs() failed to retrive the configs (error %s)",
-                   getErrorString(eglGetError()));
-         return 0;
-     }
-     for (int i=0; i<max_num_config; i++ ) {
-         log_debug("Config[%d] is:", i);
-         printEGLConfig(configs[i]);
-     }
-
-     return max_num_config;
-}
-
-void
-GtkEGLGlue::printEGLConfig(EGLConfig config)
-{
-    EGLint red, blue, green;
-    EGLint value;
-    eglGetConfigAttrib(_eglDisplay, config, EGL_RED_SIZE, &red);
-    eglGetConfigAttrib(_eglDisplay, config, EGL_GREEN_SIZE, &green);
-    eglGetConfigAttrib(_eglDisplay, config, EGL_BLUE_SIZE, &blue);
-    log_debug("\tConfig has RED = %d, GREEN = %d, BLUE = %d", red, green, 
blue);
-    
-    eglGetConfigAttrib(_eglDisplay, config, EGL_ALPHA_SIZE, &value);
-    log_debug("\tEGL_ALPHA_SIZE is %d", value);
-    eglGetConfigAttrib(_eglDisplay, config, EGL_STENCIL_SIZE, &value);
-    log_debug("\tEGL_STENCIL_SIZE is %d", value);
-    eglGetConfigAttrib(_eglDisplay, config, EGL_SAMPLES, &value);
-    log_debug("\tEGL_SAMPLES is %d", value);
-    eglGetConfigAttrib(_eglDisplay, config, EGL_DEPTH_SIZE, &value);
-    log_debug("\tEGL_DEPTH_SIZE is %d", value);
-    eglGetConfigAttrib(_eglDisplay, config, EGL_MAX_SWAP_INTERVAL, &value);
-    log_debug("\tEGL_MAX_SWAP_INTERVAL is %d", value);
-    eglGetConfigAttrib(_eglDisplay, config, EGL_MIN_SWAP_INTERVAL, &value);
-    log_debug("\tEGL_MIN_SWAP_INTERVAL is %d", value);
-    eglGetConfigAttrib(_eglDisplay, config, EGL_NATIVE_RENDERABLE, &value);
-    log_debug("\tEGL_NATIVE_RENDERABLE is %s", (value)? "true" : "false");
-    eglGetConfigAttrib(_eglDisplay, config, EGL_SAMPLE_BUFFERS, &value);
-    log_debug("\tEGL_SAMPLE_BUFFERS is %d", value);
-    eglGetConfigAttrib(_eglDisplay, config, EGL_RENDERABLE_TYPE, &value);
-    if (value > 0) {
-        std::string str;
-        if (value & EGL_OPENGL_ES_BIT) {
-            str += " OpenGL-ES 1.1";
-        }
-        if (value & EGL_OPENVG_BIT) {
-            str += " OpenVG";
-        }
-        if (value & EGL_OPENGL_BIT) {
-            str += " OpenGL";
-        }
-        log_debug("\tEGL_RENDERABLE_TYPE = %s", str);
-    } else {
-        log_debug("\tEGL_RENDERABLE_TYPE (default)");
-    }
-    eglGetConfigAttrib(_eglDisplay, config, EGL_SURFACE_TYPE, &value);
-    if (value > 0) {
-        std::string str;
-        if (value & EGL_WINDOW_BIT) {
-            str += " Window";
-        }
-        if (value & EGL_PIXMAP_BIT) {
-            str += " Pixmap";
-        }
-        if (value & EGL_PBUFFER_BIT) {
-            str += " Pbuffer";
-        }
-        log_debug("\tEGL_SURFACE_TYPE = %s", str);
-    } else {
-        log_debug("\tEGL_SURFACE_TYPE (default)");
-    }
-}
-
-void
-GtkEGLGlue::printEGLContext(EGLContext context)
-{
-    EGLint value;
-    eglQueryContext(_eglDisplay, context, EGL_CONFIG_ID, &value);
-    log_debug("Context EGL_CONFIG_ID is %d", value);
-    eglQueryContext(_eglDisplay, context, EGL_CONTEXT_CLIENT_TYPE, &value);
-    log_debug("\tEGL_CONTEXT_CLIENT_TYPE is %d", (value == EGL_OPENVG_API)
-              ? "EGL_OPENVG_API" : "EGL_OPENGL_ES_API");
-    // eglQueryContext(_eglDisplay, context, EGL_CONTEXT_CLIENT_VERSION, 
&value);
-    // log_debug("EGL_CONTEXT_CLIENT_VERSION is %d", value);
-    eglQueryContext(_eglDisplay, context, EGL_RENDER_BUFFER, &value);
-    log_debug("\tEGL_RENDER_BUFFER is %s", (value == EGL_BACK_BUFFER)
-              ? "EGL_BACK_BUFFER" : "EGL_SINGLE_BUFFER");
-}
-
-void
-GtkEGLGlue::printEGLSurface(EGLSurface surface)
-{
-    EGLint value;
-    eglQuerySurface(_eglDisplay, surface, EGL_CONFIG_ID, &value);
-    log_debug("Surface EGL_CONFIG_ID is %d", value);
-    eglQuerySurface(_eglDisplay, surface, EGL_HEIGHT, &value);
-    log_debug("\tEGL_HEIGHT is %d", value);
-    eglQuerySurface(_eglDisplay, surface, EGL_WIDTH, &value);
-    log_debug("\tEGL_WIDTH is %d", value);
-    eglQuerySurface(_eglDisplay, surface, EGL_RENDER_BUFFER, &value);
-    log_debug("\tEGL_RENDER_BUFFER is %s", (value == EGL_BACK_BUFFER)
-              ? "EGL_BACK_BUFFER" : "EGL_SINGLE_BUFFER");
-    eglQuerySurface(_eglDisplay, surface, EGL_VERTICAL_RESOLUTION, &value);
-    log_debug("\tEGL_VERTICAL_RESOLUTION is %d", value);
-    eglQuerySurface(_eglDisplay, surface, EGL_HORIZONTAL_RESOLUTION, &value);
-    log_debug("\tEGL_HORIZONTAL_RESOLUTION is %d", value);
-    eglQuerySurface(_eglDisplay, surface, EGL_SWAP_BEHAVIOR, &value);
-    log_debug("\tEGL_SWAP_BEHAVIOR is %d", (value == EGL_BUFFER_DESTROYED)
-              ? "EGL_BUFFER_DESTROYED" : "EGL_BUFFER_PRESERVED");
-    eglQuerySurface(_eglDisplay, surface, EGL_MULTISAMPLE_RESOLVE, &value);
-    log_debug("\tEGL_MULTISAMPLE_RESOLVE is %d", (value == 
EGL_MULTISAMPLE_RESOLVE_BOX)
-              ? "EGL_MULTISAMPLE_RESOLVE_BOX" : 
"EGL_MULTISAMPLE_RESOLVE_DEFAULT");
-}
-
-} // namespace gnash
-
-// local Variables:
-// mode: C++
-// indent-tabs-mode: nil
-// End:
diff --git a/gui/gtk/gtk_glue_egl.h b/gui/gtk/gtk_glue_egl.h
deleted file mode 100644
index d239dbb..0000000
--- a/gui/gtk/gtk_glue_egl.h
+++ /dev/null
@@ -1,106 +0,0 @@
-//
-//   Copyright (C) 2005, 2006, 2007, 2008, 2009, 2010 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
-// the Free Software Foundation; either version 3 of the License, or
-// (at your option) any later version.
-//
-// This program is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-// GNU General Public License for more details.
-// 
-// You should have received a copy of the GNU General Public License
-// along with this program; if not, write to the Free Software
-// Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
-//
-
-#ifdef HAVE_CONFIG_H
-#include "gnashconfig.h"
-#endif
-
-#include "gtk_glue.h"
-
-#include <gtk/gtk.h>
-#include <gdk/gdk.h>
-#include <boost/scoped_array.hpp>
-#include "openvg/Renderer_ovg.h"
-
-#ifdef HAVE_VG_OPENVG_H
-#include <VG/openvg.h>
-#endif
-
-#ifdef HAVE_EGL_EGL_H
-# include <EGL/egl.h>
-#else
-# error "This file needs EGL, which is part of OpenGL-ES"
-#endif
-
-namespace gnash
-{
-
-class GtkEGLGlue : public GtkGlue
-{
-  public:
-    GtkEGLGlue();
-    ~GtkEGLGlue();
-
-    // Initialize EGL
-    bool init(int argc, char **argv[]);
-
-    // Prepare the drawing area
-    void prepDrawingArea(GtkWidget *drawing_area);
-
-    // Create the renderer
-    Renderer* createRenderHandler();
-
-    // Set the size of the rendering window
-    void setRenderHandlerSize(int width, int height);
-    void beforeRendering();
-
-    // Render the drawing area to the display
-    void render();
-    void render(int minx, int miny, int maxx, int maxy);
-
-    // Configure EGL
-    void configure(GtkWidget *const widget, GdkEventConfigure *const event);
-
-    // Utility methods not in the base class
-    /// Return a string with the error code as text, instead of a numeric value
-    const char *getErrorString(int error);
-    /// Check the requested EGl configuration against the current one
-    bool checkEGLConfig(EGLConfig config);
-    /// Query the system for all supported configs
-    int queryEGLConfig(EGLDisplay display);
-    void printEGLConfig(EGLConfig config);
-    void printEGLContext(EGLContext context);
-    void printEGLSurface(EGLSurface surface);
-
-  private:
-    // offscreenbuf is only used with ENABLE_EGL_OFFSCREEN
-    GdkImage            *_offscreenbuf;
-    renderer::openvg::Renderer_ovg        *_renderer;
-    
-    EGLConfig           _eglConfig;
-    EGLContext          _eglContext;
-    EGLSurface          _eglSurface;
-    EGLDisplay          _eglDisplay;
-    EGLint              _eglNumOfConfigs;
-    EGLNativeWindowType _nativeWindow;
-    EGLint              _max_num_config;
-    unsigned int        _bpp;
-    unsigned int        _width;
-    unsigned int        _height;
-};
-
-#define DUMP_CURRENT_SURFACE printEGLSurface(eglGetCurrentSurface(EGL_DRAW))
-#define DUMP_CURRENT_CONTEXT printEGLContext(eglGetCurrentContext())
-
-} // namespace gnash
-
-// local Variables:
-// mode: C++
-// indent-tabs-mode: nil
-// End:

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


commit 91b425ba49eef45fb296aa65415d8ece352fa5ae
Author: Rob Savoye <address@hidden>
Date:   Sun Apr 3 08:25:34 2011 -0600

    cleanup warnings about unused variables

diff --git a/libdevice/egl/eglDevice.cpp b/libdevice/egl/eglDevice.cpp
index 16f1602..6013181 100644
--- a/libdevice/egl/eglDevice.cpp
+++ b/libdevice/egl/eglDevice.cpp
@@ -167,9 +167,9 @@ EGLDevice::~EGLDevice()
 /// desktop or framebuffer to EGL. This is what binds EGL to the
 /// desktop or framebuffer.
 bool
-EGLDevice::initDevice(int argc, char *argv[])
+EGLDevice::initDevice(int /* argc */, char **/*argv[] */)
 {
-    EGLDevice::rtype_t rtype;
+    // EGLDevice::rtype_t rtype;
 
     dbglogfile.setVerbosity(2);
 
@@ -334,8 +334,6 @@ EGLDevice::bindClient(rtype_t rtype)
 {
     GNASH_REPORT_FUNCTION;
     
-    EGLint value;
-
     switch (rtype) {
       case GnashDevice::OPENGLES2:
       {
diff --git a/libdevice/x11/X11Device.cpp b/libdevice/x11/X11Device.cpp
index 487ea84..d6d7be9 100644
--- a/libdevice/x11/X11Device.cpp
+++ b/libdevice/x11/X11Device.cpp
@@ -220,9 +220,9 @@ X11Device::createWindow(const char *name, int x, int y, int 
width, int height)
 
     XSetWindowAttributes attr;
     unsigned long mask;
-    Window root;
-    XVisualInfo visTemplate;
-    int num_visuals;
+    // Window root;
+    // XVisualInfo visTemplate;
+    // int num_visuals;
 
     // window attributes
     attr.background_pixel = 0;
@@ -261,7 +261,7 @@ X11Device::eventLoop(size_t passes)
         
         reshape_func reshape = 0;
         key_func     keyPress = 0;
-        draw_func    draw = 0;
+        // draw_func    draw = 0;
         
         XNextEvent(_display, &event);
         

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


commit b77e2c0ec708bfbf403f7726c8c1778ae7b39457
Author: Rob Savoye <address@hidden>
Date:   Sun Apr 3 08:24:58 2011 -0600

    drop gles2 header

diff --git a/librender/Makefile.am b/librender/Makefile.am
index 9d1ba66..e19f635 100644
--- a/librender/Makefile.am
+++ b/librender/Makefile.am
@@ -61,7 +61,6 @@ noinst_HEADERS = \
        opengl/Renderer_ogl.h \
        opengles1/Renderer_gles1.h \
        opengles1/render_handler_gles.h \
-       opengles2/Renderer_gles2.h \
        openvg/OpenVGRenderer.h \
        openvg/OpenVGBitmap.h \
        openvg/OpenVGStyle.h \

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


commit dd63124d9ec0c359ce079d9f71a95b014d16090f
Author: Rob Savoye <address@hidden>
Date:   Sun Apr 3 08:15:26 2011 -0600

    make const correct to work with the latest Gnash internal  rendering API

diff --git a/librender/opengles1/Renderer_gles1.cpp 
b/librender/opengles1/Renderer_gles1.cpp
index 7925f87..b505844 100644
--- a/librender/opengles1/Renderer_gles1.cpp
+++ b/librender/opengles1/Renderer_gles1.cpp
@@ -127,7 +127,7 @@ Renderer_gles1::drawVideoFrame(image::GnashImage* /* frame 
*/,
 
 
 void
-Renderer_gles1::world_to_pixel(int& x, int& y, float world_x, float world_y)
+Renderer_gles1::world_to_pixel(int& x, int& y, float world_x, float world_y) 
const
 {
 #if 0
     // negative pixels seems ok here... we don't
@@ -141,7 +141,7 @@ Renderer_gles1::world_to_pixel(int& x, int& y, float 
world_x, float world_y)
 }
 
 geometry::Range2d<int>
-Renderer_gles1::world_to_pixel(const SWFRect& wb)
+Renderer_gles1::world_to_pixel(const SWFRect& wb) const
 {
     using namespace gnash::geometry;
     
@@ -157,7 +157,7 @@ Renderer_gles1::world_to_pixel(const SWFRect& wb)
 }
 
 geometry::Range2d<int>
-Renderer_gles1::world_to_pixel(const geometry::Range2d<float>& wb)
+Renderer_gles1::world_to_pixel(const geometry::Range2d<float>& wb) const
 {
     if (wb.isNull() || wb.isWorld()) return wb;
     
@@ -170,7 +170,7 @@ Renderer_gles1::world_to_pixel(const 
geometry::Range2d<float>& wb)
 }
 
 point
-Renderer_gles1::pixel_to_world(int x, int y)
+Renderer_gles1::pixel_to_world(int x, int y) const
 {
 #if 0
     point p(x, y);
@@ -200,7 +200,7 @@ Renderer_gles1::drawLine(const std::vector<point>& coords, 
const rgba& fill,
     GNASH_REPORT_FUNCTION;
 }
 void
-Renderer_gles1::drawPoly(const point* corners, size_t corner_count, 
+Renderer_gles1::draw_poly(const std::vector<point>& corners,
                        const rgba& fill, const rgba& /* outline */,
                        const SWFMatrix& mat, bool /* masked */)
 {
diff --git a/librender/opengles1/Renderer_gles1.h 
b/librender/opengles1/Renderer_gles1.h
index 37411ff..ee546b2 100644
--- a/librender/opengles1/Renderer_gles1.h
+++ b/librender/opengles1/Renderer_gles1.h
@@ -141,10 +141,10 @@ public:
     void init(float x, float y);
     CachedBitmap *createCachedBitmap(std::auto_ptr<image::GnashImage> im);
 
-    void world_to_pixel(int& x, int& y, float world_x, float world_y);
-    gnash::geometry::Range2d<int> world_to_pixel(const gnash::SWFRect& wb);
-    geometry::Range2d<int> world_to_pixel(const geometry::Range2d<float>& wb);
-    gnash::point pixel_to_world(int, int);
+    void world_to_pixel(int& x, int& y, float world_x, float world_y) const;
+    gnash::geometry::Range2d<int> world_to_pixel(const gnash::SWFRect& wb) 
const;
+    geometry::Range2d<int> world_to_pixel(const geometry::Range2d<float>& wb) 
const;
+    gnash::point pixel_to_world(int, int) const;
 
     void begin_display(const gnash::rgba&, int, int, float,
                                         float, float, float);
@@ -158,7 +158,7 @@ public:
                   const SWFMatrix& mat);
     void drawVideoFrame(gnash::image::GnashImage *frame, const 
gnash::Transform& tx,
                         const gnash::SWFRect *bounds, bool smooth);
-    void drawPoly(const point* corners, size_t corner_count, 
+    void draw_poly(const std::vector<point>& corners,
                   const rgba& fill, const rgba& outline,
                   const SWFMatrix& mat, bool masked);
     void drawShape(const gnash::SWF::ShapeRecord&, const gnash::Transform&);

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


commit 97b9ed0b765bbdc9851dc85b4e76e561deeb05b7
Author: Rob Savoye <address@hidden>
Date:   Sun Apr 3 08:14:51 2011 -0600

    rename create_Renderer_ogl to create_handler

diff --git a/librender/opengl/Renderer_ogl.cpp 
b/librender/opengl/Renderer_ogl.cpp
index fd340e5..f4a0cec 100644
--- a/librender/opengl/Renderer_ogl.cpp
+++ b/librender/opengl/Renderer_ogl.cpp
@@ -1882,7 +1882,7 @@ private:
 #endif
 }; // class Renderer_ogl
   
-Renderer* create_Renderer_ogl(bool init)
+Renderer* create_handler(bool init)
 // Factory.
 {
   Renderer_ogl* renderer = new Renderer_ogl;

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


commit fb4dd7ac8a69c0eb9fe54e81e532d980215e1608
Author: Rob Savoye <address@hidden>
Date:   Sun Apr 3 08:14:18 2011 -0600

    pass in defaut argument

diff --git a/gui/gtk/gtk_glue_gtkglext.cpp b/gui/gtk/gtk_glue_gtkglext.cpp
index f6f0c48..66cebbc 100644
--- a/gui/gtk/gtk_glue_gtkglext.cpp
+++ b/gui/gtk/gtk_glue_gtkglext.cpp
@@ -108,7 +108,7 @@ GtkGlExtGlue::createRenderHandler()
     // Attach our OpenGL context to the drawing_area.
     gdk_gl_drawable_make_current(gldrawable, glcontext);
 
-    Renderer* renderer = renderer::opengl::create_handler();
+    Renderer* renderer = renderer::opengl::create_handler(true);
 
     return renderer;
 }

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


commit df1bd23c95547501a2089d916984b859033966ad
Author: Rob Savoye <address@hidden>
Date:   Sun Apr 3 08:13:51 2011 -0600

    remove gles2 as it will be better to recreate in the far future

diff --git a/librender/Makefile.am b/librender/Makefile.am
index 6e5f06f..9d1ba66 100644
--- a/librender/Makefile.am
+++ b/librender/Makefile.am
@@ -114,13 +114,6 @@ libgnashrender_la_SOURCES += \
 libgnashrender_la_LIBADD += $(GLES1_LIBS)
 endif
 
-if  BUILD_GLES2_RENDERER
-libgnashrender_la_SOURCES += \
-       opengles2/Renderer_gles2.cpp \
-       opengles2/Renderer_gles2.h
-libgnashrender_la_LIBADD += $(GLES2_LIBS)
-endif
-
 if  BUILD_CAIRO_RENDERER
 libgnashrender_la_SOURCES += \
        cairo/Renderer_cairo.cpp \
@@ -167,7 +160,6 @@ testr_CPPFLAGS = \
        $(EGL_CFLAGS) \
        $(OPENVG_CFLAGS) \
        $(GLES1_CFLAGS) \
-       $(GLES2_CFLAGS)
        $(DIRECTFB_CFLAGS)
 testr_LDADD = \
        libgnashrender.la \
@@ -178,6 +170,5 @@ testr_LDADD = \
        $(EGL_LIBS) \
        $(GNASH_LIBS) \
        $(OPENVG_LIBS) \
-       $(GLES1_LIBS) \
-       $(GLES2_LIBS)
+       $(GLES1_LIBS)
 endif

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


commit af645854413a94224fb094dfffead51f3d6b60d5
Author: Rob Savoye <address@hidden>
Date:   Sun Apr 3 08:13:33 2011 -0600

    remove gles2 as it will be better to recreate in the far future

diff --git a/configure.ac b/configure.ac
index ec701b8..431aa02 100644
--- a/configure.ac
+++ b/configure.ac
@@ -875,21 +875,34 @@ if test x"${build_sdl}" = xauto; then
   fi
 fi
 
-
 dnl -------------------------------
 dnl Renderer Selection
 dnl -------------------------------
 input_events=
 dnl By default, we want to to build all renderers
+dnl DirectFB has both a device layer and a rendering layer, although
+dnl currently the rendering part is incomplete. Configure support is
+dnl included for development purposes.
 build_directfb=no
+dnl The OpenVG support works on both the desktop and embedded devices
+dnl that don't run X11. It is supported by iPhone/iPad/Android
+dnl devices, and the nouveau driver on the desktop.
 build_ovg=no
+dnl The OpenGLES1 renderer is a work in progress. It is originally
+dnl based on a patch to Gnash 0.8.5, which of course not only didn't
+dnl compile anymore, it was all hardcoded into the framebuffer
+dnl code. This version compiles with the latest internal rendering
+dnl API, and works properly with the glue code for the Gnash GUIs.
 build_gles1=no
+dnl OpenGL works, but suffers from performance problems. This should
+dnl eventually be replacd by the OpenGLES1 and OpenVG renders.
 build_ogl=yes
+dnl AGG is a software only renderer
 build_agg=yes
 build_cairo=yes
 renderer_list="agg cairo"
 AC_ARG_ENABLE(renderer,
-  AC_HELP_STRING([--enable-renderer=], [Enable support for the specified 
renderers (agg|cairo|opengl|all, default=all)]),
+  AC_HELP_STRING([--enable-renderer=], [Enable support for the specified 
renderers (agg|cairo|opengl|openvg|all, default=all)]),
   if test -n ${enableval}; then
     if test "x${enableval}" != "xno" -o "x${enableval}" != "xnone" ; then
       renderer_list="none"
@@ -954,7 +967,7 @@ AC_ARG_ENABLE(renderer,
         renderer_list="${renderer_list} cairo"
         build_cairo=yes
         ;;
-      *) AC_MSG_ERROR([invalid renderer specified: ${enableval} given (accept: 
 (ogl|ovg|cairo|agg|gles1|all)])
+      *) AC_MSG_ERROR([invalid renderer specified: ${enableval} given (accept: 
 (opengl|openvg|cairo|agg|all)])
         ;;
       esac]
     enableval=`echo ${enableval} | cut -d ' ' -f 2-`
@@ -963,6 +976,7 @@ AC_ARG_ENABLE(renderer,
     fi
   done
 )
+
 dnl 16 bit: RGB555, RGB565
 dnl 24 bit: RGB24, BGR24
 dnl 32 bit: RGBA32, BGRA32
@@ -2426,12 +2440,12 @@ AM_CONDITIONAL(NPAPI,   [test x"${npapi}" = xyes])
 AM_CONDITIONAL(KPARTS3, [test x"${build_kparts3}" = xyes])
 AM_CONDITIONAL(KPARTS4, [test x"${build_kparts4}" = xyes])
 
-if test x"${build_gles1}" = xyes -o x"${build_gles2}" = xyes; then
+if test x"${build_gles1}"; then
   GNASH_PATH_GLES
 fi
 
 dnl The OpenGLES1, OpenGLES2, and OpenVG all need the EGL support, X11 can use 
it also
-if test x"${build_gles1}" = xyes -o  x"${build_gles2}" = xyes -o 
x"${build_ovg}" = xyes; then
+if test x"${build_gles1}" = xyes -o x"${build_ovg}" = xyes; then
   build_egl_device=yes
 fi
 
@@ -3153,7 +3167,6 @@ if test x"${build_ovg}" = x"yes"; then
   fi
 fi
 
-
 if test x"${build_ogl}" = x"yes"; then
   if test x"$OPENGL_LIBS" != x; then
     if test x"$OPENGL_CFLAGS" != x; then
@@ -3185,20 +3198,6 @@ if test x"${build_gles1}" = x"yes"; then
       echo "               or use a different renderer with 
--enable-renderer=" >&3
   fi
 fi
-if test x"${build_gles2}" = xyes; then
-  if test x"${has_gles2}" = xyes; then
-    if test x"${GLES2_CFLAGS}" != x; then
-      echo "        OpenGLES2 flags are: ${GLES2_CFLAGS}"
-    else
-      echo "        OpenGLES2 flags are: default include path"
-    fi
-    echo "        OpenGLES2 libs are: ${GLES2_LIBS}"
-  else
-      echo "        ERROR: No OpenGLES2 development package installed!" >&3
-      echo "               You need to install the this from source proobably" 
>&3
-      echo "               or use a different renderer with 
--enable-renderer=" >&3
-  fi
-fi
 
 dnl GLEXT is only needed for GTK/OpenGL
 if test x$build_gtk = xyes -a x$build_ogl = xyes ; then

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


commit 984883c66e4713268979f5ab0d16cfa174807334
Author: Rob Savoye <address@hidden>
Date:   Sun Apr 3 08:12:56 2011 -0600

    remove stubs

diff --git a/librender/opengles2/Renderer_gles2.cpp 
b/librender/opengles2/Renderer_gles2.cpp
deleted file mode 100644
index 56c6c45..0000000
--- a/librender/opengles2/Renderer_gles2.cpp
+++ /dev/null
@@ -1,302 +0,0 @@
-// 
-//   Copyright (C) 2005, 2006, 2007, 2008, 2009, 2010 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
-// the Free Software Foundation; either version 3 of the License, or
-// (at your option) any later version.
-// 
-// This program is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-// GNU General Public License for more details.
-// 
-// You should have received a copy of the GNU General Public License
-// along with this program; if not, write to the Free Software
-// Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301 USA
-
-
-#ifdef HAVE_CONFIG_H
-#include "gnashconfig.h"
-#endif
-
-#ifdef HAVE_GLES2_GL2_H
-# include <GLES2/gl2.h>
-# include <GLES2/gl2ext.h>
-#endif
-
-#include <cstring>
-#include <cmath>
-
-#include <smart_ptr.h>
-#include "swf/ShapeRecord.h"
-#include "RGBA.h"
-#include "GnashImage.h"
-#include "GnashTexture.h"
-#include "GnashNumeric.h"
-#include "log.h"
-#include "utility.h"
-#include "Range2d.h"
-#include "SWFMatrix.h"
-#include "swf/ShapeRecord.h"
-
-#include "Renderer_gles2.h"
-
-#include <boost/utility.hpp>
-#include <boost/bind.hpp>
-
-// Defined to 1 to disable (slow) anti-aliasing with the accumulation buffer
-#define NO_ANTIALIASING 1
-
-/// \file Renderer_gles.cpp
-/// \brief The OpenGL-ES renderer and related code.
-///
-
-// TODO:
-// - Profiling!
-// - Optimize code:
-// * Use display lists
-// * Use better suited standard containers
-// * convert to double at a later stage (oglVertex)
-// * keep data for less time
-// * implement hardware accelerated gradients. Most likely this will require
-//   the use of fragment shader language.
-
-// * The "Programming Tips" in the OpenGL "red book" discusses a coordinate 
system
-// that would give "exact two-dimensional rasterization". AGG uses a similar
-// system; consider the benefits and drawbacks of switching.
-
-namespace gnash {
-
-namespace renderer {
-
-namespace gles2 {
-
-Renderer_gles2::Renderer_gles2()
-{
-//    if (!initDevice(EGLDevice::OPENVG))
-    if (!initDevice(0, 0)) {
-        log_error("Couldn't initialize EGL Device!");
-    }
-}
-
-Renderer_gles2::~Renderer_gles2()
-{
-
-}
-
-void
-Renderer_gles2::init(float x, float y)
-{
-    GNASH_REPORT_FUNCTION;
-}
-
-CachedBitmap *
-Renderer_gles2::createCachedBitmap(std::auto_ptr<gnash::image::GnashImage>)
-{
-    return 0;
-}
-
-void
-Renderer_gles2::drawVideoFrame(image::GnashImage* /* frame */,
-                               const gnash::Transform& t/* m */,
-                               const SWFRect* /* bounds */, bool /*smooth*/)
-{
-    log_unimpl("drawVideoFrame");  
-}
-
-
-
-void
-Renderer_gles2::world_to_pixel(int& x, int& y, float world_x, float world_y)
-{
-#if 0
-    // negative pixels seems ok here... we don't
-    // clip to valid range, use world_to_pixel(rect&)
-    // and Intersect() against valid range instead.
-    point p(world_x, world_y);
-    stage_matrix.transform(p);
-    x = (int)p.x;
-    y = (int)p.y;
-#endif
-}
-
-geometry::Range2d<int>
-Renderer_gles2::world_to_pixel(const SWFRect& wb)
-{
-    using namespace gnash::geometry;
-    
-    if ( wb.is_null() ) return Range2d<int>(nullRange);
-    if ( wb.is_world() ) return Range2d<int>(worldRange);
-    
-    int xmin, ymin, xmax, ymax;
-    
-    world_to_pixel(xmin, ymin, wb.get_x_min(), wb.get_y_min());
-    world_to_pixel(xmax, ymax, wb.get_x_max(), wb.get_y_max());
-    
-    return Range2d<int>(xmin, ymin, xmax, ymax);
-}
-
-geometry::Range2d<int>
-Renderer_gles2::world_to_pixel(const geometry::Range2d<float>& wb)
-{
-    if (wb.isNull() || wb.isWorld()) return wb;
-    
-    int xmin, ymin, xmax, ymax;
-    
-    world_to_pixel(xmin, ymin, wb.getMinX(), wb.getMinY());
-    world_to_pixel(xmax, ymax, wb.getMaxX(), wb.getMaxY());
-    
-    return geometry::Range2d<int>(xmin, ymin, xmax, ymax);
-}
-
-point
-Renderer_gles2::pixel_to_world(int x, int y)
-{
-#if 0
-    point p(x, y);
-    SWFMatrix mat = stage_matrix;
-    mat.invert().transform(p);
-    return p;
-#endif
-};
-
-void
-Renderer_gles2::begin_display(const gnash::rgba&, int, int, float,
-                                        float, float, float)
-{
-    GNASH_REPORT_FUNCTION;
-}
-
-void
-Renderer_gles2::end_display()
-{
-    GNASH_REPORT_FUNCTION;
-}
-
-void
-Renderer_gles2::drawLine(const std::vector<point>& coords, const rgba& fill,
-                       const SWFMatrix& mat)
-{
-    GNASH_REPORT_FUNCTION;
-}
-void
-Renderer_gles2::drawPoly(const point* corners, size_t corner_count, 
-                       const rgba& fill, const rgba& /* outline */,
-                       const SWFMatrix& mat, bool /* masked */)
-{
-    GNASH_REPORT_FUNCTION;
-}
-void
-Renderer_gles2::drawShape(const gnash::SWF::ShapeRecord&, const 
gnash::Transform&)
-{
-    GNASH_REPORT_FUNCTION;
-}
-// void
-// Renderer_gles2::drawShape(const SWF::ShapeRecord& shape, const SWFCxForm& 
cx,
-//                         const SWFMatrix& mat)
-// {
-//     GNASH_REPORT_FUNCTION;
-// }
-void
-Renderer_gles2::drawGlyph(const SWF::ShapeRecord& rec, const rgba& c,
-                        const SWFMatrix& mat)
-{
-    GNASH_REPORT_FUNCTION;
-}
-
-void
-Renderer_gles2::set_antialiased(bool /* enable */)
-{
-    log_unimpl("set_antialiased");
-}
-
-void
-Renderer_gles2::begin_submit_mask()
-{
-#if 0
-    PathVec mask;
-    _masks.push_back(mask);
-    
-    _drawing_mask = true;
-#endif
-}
-
-void
-Renderer_gles2::end_submit_mask()
-{
-#if 0
-    _drawing_mask = false;
-    apply_mask();
-#endif
-}
-void
-Renderer_gles2::apply_mask()
-{
-    GNASH_REPORT_FUNCTION;
-}
-void
-Renderer_gles2::disable_mask()
-{
-    GNASH_REPORT_FUNCTION;
-}
-void
-Renderer_gles2::set_scale(float xscale, float yscale)
-{
-#if 0
-    _xscale = xscale;
-    _yscale = yscale;
-    stage_matrix.set_identity();
-    stage_matrix.set_scale(xscale/20.0f, yscale/20.0f);
-#endif
-}
-
-void
-Renderer_gles2::set_invalidated_regions(const InvalidatedRanges& /* ranges */)
-{
-}
-
-bool
-Renderer_gles2::initTestBuffer(unsigned int width, unsigned int height)
-{
-#if 0
-    int size = width * height; // * getBytesPerPixel();
-    
-    _testBuffer = static_cast<unsigned char *>(realloc(_testBuffer, size));
-    memset(_testBuffer, 0, size);
-    printf("\tRenderer Test memory at: %p\n", _testBuffer);
-#endif
-//    init_buffer(_testBuffer, size, width, height, width * 
getBytesPerPixel());
-//    init(width, height);
-    
-    return true;
-}
-
-Renderer *
-Renderer_gles2::startInternalRender(gnash::image::GnashImage&)
-{
-}
-
-void
-Renderer_gles2::endInternalRender()
-{
-}
-
-Renderer *
-create_handler(const char *pixelformat)
-{
-  Renderer_gles2 *renderer = new Renderer_gles2;
-  return renderer;
-
-  return 0;
-}  
-
-} // namespace gnash::renderer::gles2
-} // namespace gnash::renderer
-} // end of gnash namespace
-
-// local Variables:
-// mode: C++
-// indent-tabs-mode: nil
-// End:
diff --git a/librender/opengles2/Renderer_gles2.h 
b/librender/opengles2/Renderer_gles2.h
deleted file mode 100644
index c679501..0000000
--- a/librender/opengles2/Renderer_gles2.h
+++ /dev/null
@@ -1,214 +0,0 @@
-// 
-//   Copyright (C) 2005, 2006, 2007, 2008, 2009, 2010 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
-// the Free Software Foundation; either version 3 of the License, or
-// (at your option) any later version.
-// 
-// This program is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-// GNU General Public License for more details.
-// 
-// You should have received a copy of the GNU General Public License
-// along with this program; if not, write to the Free Software
-// Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301 USA
-
-#ifndef GNASH_RENDER_HANDLER_GLES2_H
-#define GNASH_RENDER_HANDLER_GLES2_H
-
-#ifdef HAVE_CONFIG_H
-#include "gnashconfig.h"
-#endif
-
-#include <vector>
-
-// gles-1.0c for Linux
-#ifdef HAVE_GLES2_GL_H
-# include <GLES/gl.h>
-#endif
-#ifdef HAVE_GLES2_EGL_H
-#include <GLES/egl.h>
-#endif
-
-#if 0
-// Mali Developer Tools for ARM 1.x
-#ifdef HAVE_EGL_EGL_H
-# include <EGL/egl.h>
-# include <EGL/eglext.h>
-#endif
-// Mali Developer Tools for ARM 2.x and Android 2.1
-#ifdef HAVE_GLES2_GL2_H
-# include <GLES2/gl2.h>
-# include <GLES2/gl2ext.h>
-#endif
-#endif
-
-#include "Renderer.h"
-#include "Geometry.h"
-#include "egl/eglDevice.h"
-
-#include <map>
-
-namespace gnash {
-
-class GnashImage;
-class SWFCxForm;
-
-namespace renderer {
-
-namespace gles2 {
-
-typedef std::vector<const Path*> PathRefs;
-
-struct oglVertex {
-    oglVertex(GLfloat x, GLfloat y, GLfloat z = 0.0)
-        : _x(x), _y(y), _z(z)
-        {
-        }
-    
-    oglVertex(const point& p)
-        : _x(p.x), _y(p.y), _z(0.0)
-        {
-        }
-    
-    GLfloat _x;
-    GLfloat _y;
-    GLfloat _z;
-};
-
-typedef std::map<const Path*, std::vector<oglVertex> > PathPointMap;
-
-class WholeShape
-{
-public:
-    void newPath(const Path& new_path)
-    {
-        PathRefs refs;
-        refs.push_back(&new_path); 
-        shape.push_back(refs);
-    }
-  
-    void addPath(const Path& add_path)
-    {
-        PathRefs& refs = shape.back();
-        refs.push_back(&add_path);
-    }
-  
-    void addPathRefs(const PathRefs& pathrefs)
-    {
-        PathRefs new_refs(pathrefs.begin(), pathrefs.end());
-        shape.push_back(new_refs);
-    }
-  
-    const std::vector<PathRefs>& get() const
-    {
-        return shape;
-    }
-private:
-    std::vector<PathRefs> shape;
-};
-
-    class bitmap_info_ogl //: public BitmapInfo
-{
-public:
-    
-    /// Set line and fill styles for mesh & line_strip rendering.
-    enum bitmap_wrap_mode
-    {
-        WRAP_REPEAT,
-        WRAP_CLAMP
-    };
-    
-    bitmap_info_ogl(GnashImage* image, GLenum pixelformat,
-                    bool ogl_accessible);
-    ~bitmap_info_ogl();
-    
-    void apply(const gnash::SWFMatrix& bitmap_matrix,
-               bitmap_wrap_mode wrap_mode) const;
-private:
-    inline bool ogl_accessible() const;
-    void setup() const;    
-    void upload(boost::uint8_t* data, size_t width, size_t height) const;
-    
-    mutable std::auto_ptr<GnashImage> _img;
-    GLenum _pixel_format;
-    GLenum _ogl_img_type;
-    mutable bool _ogl_accessible;  
-    mutable GLuint _texture_id;
-    size_t _orig_width;
-    size_t _orig_height;
-};
-
-class  DSOEXPORT Renderer_gles2: public Renderer, public EGLDevice
-{
-public:
-    std::string description() const { return "OpenGLES2"; }
-    Renderer_gles2();
-    ~Renderer_gles2();
-        
-    void init(float x, float y);
-    CachedBitmap *createCachedBitmap(std::auto_ptr<image::GnashImage> im);
-
-    void world_to_pixel(int& x, int& y, float world_x, float world_y);
-    gnash::geometry::Range2d<int> world_to_pixel(const gnash::SWFRect& wb);
-    geometry::Range2d<int> world_to_pixel(const geometry::Range2d<float>& wb);
-    gnash::point pixel_to_world(int, int);
-
-    void begin_display(const gnash::rgba&, int, int, float,
-                                        float, float, float);
-    // // This is from the patch
-    // void begin_display(const rgba& bg_color, int viewport_x0,
-    //                    int viewport_y0, int viewport_width,
-    //                    int viewport_height, float x0, float x1,
-    //                    float y0, float y1);
-    void end_display();
-    void drawLine(const std::vector<point>& coords, const rgba& fill,
-                  const SWFMatrix& mat);
-    void drawVideoFrame(gnash::image::GnashImage *frame, const 
gnash::Transform& tx,
-                        const gnash::SWFRect *bounds, bool smooth);
-    void drawPoly(const point* corners, size_t corner_count, 
-                  const rgba& fill, const rgba& outline,
-                  const SWFMatrix& mat, bool masked);
-    void drawShape(const gnash::SWF::ShapeRecord&, const gnash::Transform&);
-    void drawGlyph(const SWF::ShapeRecord& rec, const rgba& c,
-                   const SWFMatrix& mat);
-
-    void set_antialiased(bool enable);
-    void begin_submit_mask();
-    void end_submit_mask();
-    void apply_mask();
-    void disable_mask();
-        
-    void set_scale(float xscale, float yscale);
-    void set_invalidated_regions(const InvalidatedRanges &ranges);
-
-    // These weren't in the patch
-    Renderer *startInternalRender(gnash::image::GnashImage&);
-    void endInternalRender();
-
-    unsigned int getBitsPerPixel();
-    bool initTestBuffer(unsigned width, unsigned height);
-
-    // These methods are only for debugging and development
-    void printVGParams();
-    void printVGHardware();
-    void printVGPath();
-  private:
-    unsigned char *_testBuffer; // buffer used by initTestBuffer() only
-};    
-
-DSOEXPORT Renderer* create_handler(const char *pixelformat);
-
-} // namespace gnash::renderer::gles2
-} // namespace gnash::renderer
-} // namespace gnash
-
-#endif // __RENDER_HANDLER_GLES2_H__
-
-// local Variables:
-// mode: C++
-// indent-tabs-mode: nil
-// End:

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


commit 31450f905310b60821cc6f0ed0cd430c1e25d7be
Author: Rob Savoye <address@hidden>
Date:   Sun Apr 3 07:47:30 2011 -0600

    reenable Texture support for OpenGL, look in libdevice for headers

diff --git a/librender/Makefile.am b/librender/Makefile.am
index 1f9a52e..6e5f06f 100644
--- a/librender/Makefile.am
+++ b/librender/Makefile.am
@@ -33,6 +33,7 @@ AM_CPPFLAGS = -I.. \
        -I$(top_srcdir)/libcore/swf \
        -I$(top_srcdir)/libbase \
        -I$(top_srcdir)/librender \
+       -I$(top_srcdir)/libdevice \
        $(BOOST_CFLAGS) \
        $(OPENGL_CFLAGS) \
        $(AGG_CFLAGS) \
@@ -147,15 +148,15 @@ install-exec-hook:
 uninstall-local:
        $(RM) $(DESTDIR)$(libdir)/gnash/libgnashrender-*.so
 
-# if BUILD_OGL_RENDERER
-#    libgnashrender_la_SOURCES += \
-#      GnashTexture.cpp \
-#      $(NULL)
+if BUILD_OGL_RENDERER
+    libgnashrender_la_SOURCES += \
+       GnashTexture.cpp \
+       $(NULL)
 
-#    noinst_HEADERS += \
-#      GnashTexture.h \
-#      $(NULL)
-# endif
+noinst_HEADERS += \
+       GnashTexture.h \
+       $(NULL)
+endif
 
 if ENABLE_DEVELOPER_TESTS
 check_PROGRAMS = testr

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


commit a9cac4e8e3e38deb45719c60a3e742057b4f6bb0
Author: Rob Savoye <address@hidden>
Date:   Sun Apr 3 07:44:30 2011 -0600

    check for gles1 and gles2 errors separetely

diff --git a/configure.ac b/configure.ac
index 8522e45..ec701b8 100644
--- a/configure.ac
+++ b/configure.ac
@@ -3171,7 +3171,7 @@ if test x"${build_ogl}" = x"yes"; then
   fi
 fi
 
-if test x"${build_gles1}" = x"yes" -o x"${build_gles2}" = xyes; then
+if test x"${build_gles1}" = x"yes"; then
   if test x"${has_gles1}" = xyes; then
     if test x"${GLES1_CFLAGS}" != x; then
       echo "        OpenGLES1 flags are: ${GLES1_CFLAGS}"
@@ -3184,6 +3184,8 @@ if test x"${build_gles1}" = x"yes" -o x"${build_gles2}" = 
xyes; then
       echo "               You need to install the this from source proobably" 
>&3
       echo "               or use a different renderer with 
--enable-renderer=" >&3
   fi
+fi
+if test x"${build_gles2}" = xyes; then
   if test x"${has_gles2}" = xyes; then
     if test x"${GLES2_CFLAGS}" != x; then
       echo "        OpenGLES2 flags are: ${GLES2_CFLAGS}"

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


commit 6e229c0e2622dec2cd653700d4b92b0111514d4e
Merge: 476deea d90badb
Author: Rob Savoye <address@hidden>
Date:   Sun Apr 3 07:17:51 2011 -0600

    merge from master

diff --cc .gitignore
index afd7213,03b9853..ae15dee
--- a/.gitignore
+++ b/.gitignore
@@@ -1,4 -1,4 +1,5 @@@
 +TAGS
+ *~
  *.frame*.pp
  *unner
  *.lo
diff --cc gui/Makefile.am
index ea8d717,a7ab3be..53d249d
--- a/gui/Makefile.am
+++ b/gui/Makefile.am
@@@ -74,20 -80,9 +74,16 @@@ AM_CPPFLAGS = 
        -DLOCALEDIR=\"$(localedir)\" \
        -DPLUGINSDIR=\"$(pluginsdir)\" \
        -DLIBAVCODEC_IDENT=\"$(LIBAVCODEC_IDENT)\" \
-       $(GLIB_CFLAGS) \
-       $(LIRC_CFLAGS) \
        $(BOOST_CFLAGS) \
-       $(PYTHON_LIBS) \
-       $(PTHREAD_CFLAGS) \
        $(NULL)
  
 +if BUILD_EGL_DEVICE
 +AM_CPPFLAGS += $(EGL_CFLAGS)
 +endif
 +if BUILD_DIRECTFB_DEVICE
 +AM_CPPFLAGS += $(DIRECTFB_CFLAGS)
 +endif
 +
  GTK_CFLAGS = \
        $(GTK2_CFLAGS) \
        $(GLEXT_CFLAGS) \
diff --cc libcore/parser/Makefile.am
index cc8142e,d334fab..d451dc7
--- a/libcore/parser/Makefile.am
+++ b/libcore/parser/Makefile.am
@@@ -39,20 -38,9 +39,17 @@@ AM_CPPFLAGS = 
        -I$(top_srcdir)/libbase \
        -I$(top_srcdir)/libmedia \
        -I$(top_srcdir)/libsound \
-       $(GLIB_CFLAGS) \
-       $(PTHREAD_CFLAGS) \
        $(BOOST_CFLAGS) \
-       $(FREETYPE2_CFLAGS) \
        $(NULL)
  
 +
 +if BUILD_EGL_DEVICE
 +AM_CPPFLAGS += $(EGL_CFLAGS)
 +endif
 +if BUILD_DIRECTFB_DEVICE
 +AM_CPPFLAGS += $(DIRECTFB_CFLAGS)
 +endif
 +
  libgnashparser_la_SOURCES = \
        action_buffer.cpp \
        BitmapMovieDefinition.cpp \
diff --cc libcore/vm/Makefile.am
index e75db35,b940fce..060f7b9
--- a/libcore/vm/Makefile.am
+++ b/libcore/vm/Makefile.am
@@@ -33,19 -32,9 +33,16 @@@ AM_CPPFLAGS = 
        -I$(top_srcdir)/libbase \
        -I$(top_srcdir)/libmedia \
        -I$(top_srcdir)/libsound \
-       $(GLIB_CFLAGS) \
-       $(PTHREAD_CFLAGS) \
        $(BOOST_CFLAGS) \
-       $(FFMPEG_CFLAGS) \
        $(NULL)
  
 +if BUILD_EGL_DEVICE
 +AM_CPPFLAGS += $(EGL_CFLAGS)
 +endif
 +if BUILD_DIRECTFB_DEVICE
 +AM_CPPFLAGS += $(DIRECTFB_CFLAGS)
 +endif
 +
  libgnashvm_la_SOURCES = \
        ASHandlers.cpp \
        ActionExec.cpp \
diff --cc utilities/Makefile.am
index c7391ff,2753692..fbd691b
--- a/utilities/Makefile.am
+++ b/utilities/Makefile.am
@@@ -72,17 -63,8 +64,15 @@@ AM_CPPFLAGS = 
        $(GSTREAMER_PLUGINS_BASE_CFLAGS) \
        $(GLIB_CFLAGS) \
        $(BOOST_CFLAGS) \
-       $(PTHREAD_CFLAGS) \
-       $(MYSQL_CFLAGS) \
        $(NULL)
  
 +if BUILD_EGL_DEVICE
 +AM_CPPFLAGS += $(EGL_CFLAGS)
 +endif
 +if BUILD_DIRECTFB_DEVICE
 +AM_CPPFLAGS += $(DIRECTFB_CFLAGS)
 +endif
 +
  if WIN32
    GNASH_LIBS += -lintl -lz -lws2_32
  endif

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


commit 476deea83d4d6199879d5f879404cb8f3af96666
Author: Rob Savoye <address@hidden>
Date:   Sun Apr 3 07:09:41 2011 -0600

    adjust namespace definitions

diff --git a/librender/opengl/Renderer_ogl.cpp 
b/librender/opengl/Renderer_ogl.cpp
index eb18dce..fd340e5 100644
--- a/librender/opengl/Renderer_ogl.cpp
+++ b/librender/opengl/Renderer_ogl.cpp
@@ -109,16 +109,13 @@
 
 namespace gnash {
 
-namespace {
-    const CachedBitmap* createGradientBitmap(const GradientFill& gf,
-            Renderer& renderer);
-}
-
 namespace renderer {
 
 namespace opengl {
 
 namespace {
+    const CachedBitmap* createGradientBitmap(const GradientFill& gf,
+            Renderer& renderer);
 
 class bitmap_info_ogl : public CachedBitmap
 {

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


commit 246c20eba07f3150f97e9db7c9d3851dd1878545
Author: Rob Savoye <address@hidden>
Date:   Sat Apr 2 18:10:45 2011 -0600

    fix function definition

diff --git a/librender/openvg/OpenVGRenderer.cpp 
b/librender/openvg/OpenVGRenderer.cpp
index 3496fdc..582d44a 100644
--- a/librender/openvg/OpenVGRenderer.cpp
+++ b/librender/openvg/OpenVGRenderer.cpp
@@ -319,7 +319,7 @@ Renderer_ovg::drawVideoFrame(image::GnashImage* /* frame 
*/, const SWFMatrix* /*
 }
 
 void
-Renderer_ovg::world_to_pixel(int& x, int& y, float world_x, float world_y)
+Renderer_ovg::world_to_pixel(int& x, int& y, float world_x, float world_y) 
const
 {
     GNASH_REPORT_FUNCTION;
 
@@ -344,10 +344,8 @@ Renderer_ovg::world_to_pixel(const SWFRect& wb) const
     
     int xmin, ymin, xmax, ymax;
 
-#if 0                           // FIXME:
     world_to_pixel(xmin, ymin, wb.get_x_min(), wb.get_y_min());
     world_to_pixel(xmax, ymax, wb.get_x_max(), wb.get_y_max());
-#endif
     
     return Range2d<int>(xmin, ymin, xmax, ymax);
 }
@@ -361,10 +359,8 @@ Renderer_ovg::world_to_pixel(const 
geometry::Range2d<float>& wb) const
     
     int xmin, ymin, xmax, ymax;
     
-#if 0                           // FIXME:
     world_to_pixel(xmin, ymin, wb.getMinX(), wb.getMinY());
     world_to_pixel(xmax, ymax, wb.getMaxX(), wb.getMaxY());
-#endif
     
     return geometry::Range2d<int>(xmin, ymin, xmax, ymax);
 }
diff --git a/librender/openvg/OpenVGRenderer.h 
b/librender/openvg/OpenVGRenderer.h
index f46bd20..81623a0 100644
--- a/librender/openvg/OpenVGRenderer.h
+++ b/librender/openvg/OpenVGRenderer.h
@@ -79,7 +79,7 @@ public:
     void drawVideoFrame(gnash::image::GnashImage*, const gnash::Transform&,
                         const gnash::SWFRect*, bool);
 
-    void world_to_pixel(int& x, int& y, float world_x, float world_y);
+    void world_to_pixel(int& x, int& y, float world_x, float world_y) const;
     gnash::geometry::Range2d<int> world_to_pixel(const gnash::SWFRect& wb) 
const;
     gnash::geometry::Range2d<int> world_to_pixel(const 
geometry::Range2d<float>& wb) const;
     

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


commit cb6613632bef4bd842d027af154c5e012bc01e96
Merge: b5617cc a6125ce
Author: Rob Savoye <address@hidden>
Date:   Sat Apr 2 08:23:32 2011 -0600

    huge merge to catch up with master, still a few changed API bugs to fix

diff --cc .gitignore
index 2177e56,0c3c3b3..afd7213
--- a/.gitignore
+++ b/.gitignore
@@@ -1,3 -1,3 +1,4 @@@
++TAGS
  *.frame*.pp
  *unner
  *.lo
diff --cc Makefile.am
index f912c95,bc0434f..8ab11b8
--- a/Makefile.am
+++ b/Makefile.am
@@@ -48,8 -48,11 +48,12 @@@ if CYGNA
  CYGNAL_DIR = cygnal
  endif
  
+ if BUILD_DEVICES
+ DEVICES_DIR = libdevice
+ endif
+ 
  STD_DIRS = \
 +      desktop \
        libbase \
        libmedia \
        libsound \
@@@ -61,12 -67,12 +66,8 @@@
        po \
        $(NULL)
  
- if HAVE_VAAPI
- VAAPI_DIR = libvaapi
- endif
- 
- SUBDIRS = $(VAAPI_DIR) $(STD_DIRS) $(CYGNAL_DIR) utilities
- DIST_SUBDIRS = $(STD_DIRS) cygnal utilities extensions testsuite libvaapi
 -if LIBLTDL2
 -LIBLTDLDIR = libltdl
 -endif
 -
 -SUBDIRS = $(LIBLTDLDIR) $(STD_DIRS)
 -DIST_SUBDIRS = $(STD_DIRS) cygnal extensions testsuite libltdl
++SUBDIRS = $(STD_DIRS)
++DIST_SUBDIRS = $(STD_DIRS) cygnal extensions testsuite
  
  if TESTSUITE
  SUBDIRS += testsuite
diff --cc configure.ac
index f94fb5f,0609020..41007a7
--- a/configure.ac
+++ b/configure.ac
@@@ -277,15 -285,15 +281,12 @@@ if test x"$with_cpu" != x"none"; the
     cross_compiling=yes
  fi
  
 -AC_PROG_LIBTOOL
 -AC_SUBST([LIBTOOL_DEPS])
 +AC_C_BIGENDIAN
 +AC_C_CONST
 +AC_C_INLINE
  
- AM_CONDITIONAL(ENABLE_SHARED, [test x"${enable_shared}" = xyes])
- AM_CONDITIONAL(ENABLE_STATIC, [test x"${enable_shared}" = xno])
- 
  AC_PATH_PROG(DEJAGNU, runtest)
  
 -dnl AC_CHECK_LIB(ltdl, lt_dlmutex_register, AC_DEFINE(LT_DLMUTEX, 1, [Has 
lt_dlmutex_register]),
 -dnl                                         AC_DEFINE(LT_DLMUTEX, 0, [doesn't 
have lt_dlmutex_register]) )
 -
  dnl These options are for Cygnal, which collects optional statistics
  dnl on all the network traffic By default, we turn on statistics
  dnl collecting for the incoming and outgoing queues, since those are
@@@ -758,55 -816,120 +772,123 @@@ if test x${build_media_none} = xno -a x
    build_media_gst=yes
  fi
  
 -MEDIA_CONFIG="${media_list}"
 -AC_SUBST(MEDIA_CONFIG)
 -
 -if test x"$build_media_ffmpeg" = x"yes"; then
 +if test x"$build_media_ffmpeg" != x"no"; then # yes or auto
    GNASH_PATH_FFMPEG
 +  if test x"${build_media_ffmpeg}" = xauto; then
 +    dnl TODO: have GNASH_PATH_FFMPEG set ${has_ffmpeg}
 +    if test x"$FFMPEG_LIBS" != x; then
 +      build_media_ffmpeg=yes
 +      media_list="${media_list} ffmpeg"
 +    else
 +      build_ogl=no
 +    fi
 +  fi
  fi
  
 -dnl -------------------------------
 -dnl Input Device selection
 -dnl -------------------------------
 +MEDIA_CONFIG="${media_list}"
 +AC_SUBST(MEDIA_CONFIG)
  
- dnl -----------------------------------------------------
- dnl Check for SDL and decide about auto gui accordingly.
- dnl Need be done after build_sound_sdl and build_sdl are
- dnl initialized and before they are checked for yes/no
- dnl -----------------------------------------------------
+ dnl Multiple input devices are supported. These can all work in
+ dnl varying combinations, so several may be listed. These are only
+ dnl required when using the Framebuffer, as without the X11 desktop,
+ dnl Gnash has to handle all these internally. This can get
+ dnl messy, as one might want to use a touchscreen with a normal mouse
+ dnl or keyboard attached. 
+ dnl By default, don't build any of these, as they are only for the 
+ dnl Framebuffer running without X11.
+ if test x"${build_fb}" = xyes -a x"${linux}" = xyes; then
+   build_ps2mouse=yes
+   build_ps2keyboard=yes
+   build_input_events=yes
+   build_tslib=yes
+   input_events="PS/2 Mouse, PS/2 Keyboard, Input Devices, Touchscreen via 
Tslib"
+ else
+   build_ps2mouse=no
+   build_ps2keyboard=no
+   build_input_events=no
+   build_tslib=no
+   input_events=
+ fi
+ AC_ARG_ENABLE(input,
+   AC_HELP_STRING([--enable-input], [Enable support for the specified input 
devices for the framebuffer GUI 
(default=ps2mouse|ps2keyboard|events|touchscreen)]),
+   [if test -n ${enableval}; then
+     enableval=`echo ${enableval} | tr '\054' ' ' `
+   fi
+   build_ps2mouse=no
+   build_ps2keyboard=no
+   build_input_events=no
+   build_tslib=no
+   while test -n "${enableval}" ; do
+     val=`echo ${enableval} | cut -d ' ' -f 1`
+     case "${val}" in
+       ps2m*|PS2m*|m*|M*)        dnl a PS/2 style mouse
+         build_ps2mouse=yes
+         input_events="${input_events}, PS/2 Mouse"
+         ;;
+       ps2k*|PS2K*|k*|K*)        dnl a PS/2 style keyboard
+         build_ps2keyboard=yes
+         input_events="${input_events}, PS/2 Keyboard"
+         ;;
+       i*|I*|ev*|Ev*)    dnl use the new Input Event, which supports both
+         input_events="${input_events}, Input Event Device"
+         build_input_events=yes
+         ;;
+       t*|T*) dnl use a touchscreen with tslib, which works like a mouse
+         build_tslib=yes
+         input_events="${input_events}, Touchscreen"
+         ;;
+       a*) dnl all
+         build_ps2mouse=yes
+         build_ps2keyboard=yes
+         build_input_events=yes
+         build_tslib=yes
+         input_events="PS/2 Mouse, PS/2 Keyboard, Input Devices, Touchscreen 
via Tslib"                
+         ;;
+       *) AC_MSG_ERROR([invalid input device list! ${enableval} given (accept: 
ps2mouse|keyboard|events,touchscreen)])
+          ;;
+       esac
+     enableval=`echo ${enableval} | cut -d ' ' -f 2-6`
+     if test "x$val" = "x$enableval"; then
+       break;
+     fi
+   done],
+ )
  
 -if test x"${build_tslib}" = xyes; then
 -  AC_DEFINE(USE_TSLIB, [1], [Use a tslib supported touchscreen])
 -  GNASH_PKG_FIND(ts, [tslib.h], [Touchscreen library], ts_config)
 +if test x$build_sdl != xno -o x$build_sound_sdl = xyes; then
 +  GNASH_PATH_SDL
  fi
+ AM_CONDITIONAL(ENABLE_TSLIB, [test x${ac_cv_header_tslib_h} = xyes])
+ 
 -if test x"${build_ps2mouse}" = xyes; then
 -  AC_DEFINE(USE_MOUSE_PS2, [1], [Add support for a directly using a PS/2 
Mouse])
 -fi
 -AM_CONDITIONAL(ENABLE_MOUSE, [test x"${build_ps2mouse}" = xyes])
  
 -if test x"${build_ps2keyboard}" = xyes; then
 -  AC_DEFINE(USE_KEYBOARD_PS2, [1], [Add support for directly using a PS/2 
Keyboard])
 -fi
 -if test x"${build_input_events}" = xyes; then
 -  AC_DEFINE(USE_INPUT_EVENTS, [1], [Add support for a directly using Linux 
Input Event Devices])
++dnl -----------------------------------------------------
++dnl Check for SDL and decide about auto gui accordingly.
++dnl Need be done after build_sound_sdl and build_sdl are
++dnl initialized and before they are checked for yes/no
++dnl -----------------------------------------------------
 +if test x"${build_sdl}" = xauto; then
 +  if test xyes = x"${has_sdl}"; then
 +    build_sdl=yes
 +  else
 +    AC_MSG_NOTICE([sdl GUI will not be built (no sdl development files 
found)])
 +    build_sdl=no
 +  fi
  fi
 -AM_CONDITIONAL(ENABLE_INPUT_EVENTS, [test x"${build_input_events}" = xyes])
 -dnl this is enabled if we have any input devices at all
 -AM_CONDITIONAL(ENABLE_INPUT_DEVICES, [test x"${input_events}" != x])
 +
  
  dnl -------------------------------
  dnl Renderer Selection
  dnl -------------------------------
  input_events=
  dnl By default, we want to to build all renderers
+ build_directfb=no
  build_ovg=no
- build_gles=no
- build_ogl=auto
+ build_gles1=no
 -build_gles2=no
+ build_ogl=yes
  build_agg=yes
  build_cairo=yes
 -renderer_list="OpenGL AGG Cairo"
 -nrender=3
 +renderer_list="agg cairo"
  AC_ARG_ENABLE(renderer,
 -  AC_HELP_STRING([--enable-renderer=], [Enable support for the specified 
renderers (ogl|gles|cairo|agg|all, default=all)]),
 +  AC_HELP_STRING([--enable-renderer=], [Enable support for the specified 
renderers (agg|cairo|opengl|all, default=all)]),
    if test -n ${enableval}; then
      if test "x${enableval}" != "xno" -o "x${enableval}" != "xnone" ; then
        renderer_list="none"
@@@ -817,9 -940,11 +899,10 @@@
      fi
    fi
    renderer_list=""
 -  nrender=0
    build_ovg=no
    build_ogl=no
-   build_gles=no
+   build_gles1=no
+   build_gles2=no
    build_agg=no
    build_cairo=no
    while test -n "${enableval}" ; do
@@@ -829,43 -954,63 +912,51 @@@
          renderer_list="none"
          build_ovg=no
          build_ogl=no
-         build_gles=no
+         build_gles1=no
+         build_gles2=no
          build_agg=no
          build_cairo=no
 -        nrender=1
          ;;
        all|ALL)
-         renderer_list="agg cairo opengl"
 -        renderer_list="OpenGL, Cairo, AGG, OpenVG, OpenGLES1"
++        renderer_list="agg cairo opengl openvg, opengles1"
          build_ogl=yes
          build_agg=yes
          build_cairo=yes
          build_ovg=yes
 -        build_gles1=yes
 -        build_gles2=no
 -        nrender=5
++        nrender=4
          ;;
        ogl|OGL|OpenGL|opengl)
 -        renderer_list="${renderer_list} OpenGL"
 +        renderer_list="${renderer_list} opengl"
-         build_gles=no
          build_ogl=yes
 -        nrender=$((nrender+1))
          ;;
-       gles|GLES|GL-ES|gl-es)
-         renderer_list="${renderer_list} opengl-es"
-         build_gles=yes
+       gles|GLES|gles1|GLES1)
 -        renderer_list="${renderer_list} OpenGLES1"
++        renderer_list="${renderer_list} opengles1"
+         build_gles1=yes
          build_ogl=no
+         nrender=$((nrender+1))
          ;;
 -      gles2|GLES2)
 -        renderer_list="${renderer_list} OpenGLES2"
 -        build_gles2=yes
 -        build_ogl=no
 -        nrender=$((nrender+1))
 -        ;;
        ovg|OVG|OpenVG|openvg)
 -        renderer_list="${renderer_list} OpenVG"
 +        renderer_list="${renderer_list} openvg"
-         build_ogv=yes
+         build_ovg=yes
+         nrender=$((nrender+1))
+         ;;
+       directfb|dfb)
+         renderer_list="${renderer_list} DirectFB"
+         build_directfb=yes
+         nrender=$((nrender+1))
          ;;
        agg|AGG)
 -        renderer_list="${renderer_list} AGG"
 +        renderer_list="${renderer_list} agg"
          build_agg=yes
 -        nrender=$((nrender+1))
          ;;
        cairo|CAIRO|Cairo*)
 -        renderer_list="${renderer_list} Cairo"
 +        renderer_list="${renderer_list} cairo"
          build_cairo=yes
 -        nrender=$((nrender+1))
          ;;
-       *) AC_MSG_ERROR([invalid renderer specified: ${enableval} given 
(accept:  (agg|cairo|opengl|all)])
 -      *) AC_MSG_ERROR([invalid renderer specified: ${enableval} given 
(accept:  (ogl|ovg|cairo|agg|all)])
++      *) AC_MSG_ERROR([invalid renderer specified: ${enableval} given 
(accept:  (ogl|ovg|cairo|agg|gles1|all)])
          ;;
        esac]
 -    enableval=`echo ${enableval} | cut -d ' ' -f 2-6`
 +    enableval=`echo ${enableval} | cut -d ' ' -f 2-`
      if test "x$val" = "x$enableval"; then
        break;
      fi
@@@ -945,35 -1090,28 +1036,40 @@@ if test x$pixelformat = xall; the
    fi
  fi
  
 +if test x"${build_ogl}" != xno; then # yes or auto
 +  GNASH_PATH_OPENGL
 +  if test x"${build_ogl}" = xauto; then
 +    if test xyes = x"${has_opengl}"; then
 +      build_ogl=yes
 +      renderer_list="${renderer_list} OpenGL"
 +    else
 +      build_ogl=no
 +    fi
 +  fi
 +fi
 +
- AM_CONDITIONAL(BUILD_OVG_RENDERER, [ test x$build_ovg = xyes ])
- AM_CONDITIONAL(BUILD_GLES_RENDERER, [ test x$build_gles = xyes ])
- AM_CONDITIONAL(BUILD_OGL_RENDERER, [ test x$build_ogl = xyes])
- AM_CONDITIONAL(BUILD_AGG_RENDERER, [ test x$build_agg = xyes ])
- AM_CONDITIONAL(BUILD_CAIRO_RENDERER, [ test x$build_cairo = xyes ])
+ AM_CONDITIONAL(BUILD_OVG_RENDERER,   [ test x${build_ovg} = xyes ])
+ AM_CONDITIONAL(BUILD_GLES1_RENDERER, [ test x${build_gles1} = xyes ])
+ AM_CONDITIONAL(BUILD_GLES2_RENDERER, [ test x${build_gles2} = xyes ])
+ AM_CONDITIONAL(BUILD_OGL_RENDERER,   [ test x${build_ogl} = xyes])
+ AM_CONDITIONAL(BUILD_AGG_RENDERER,   [ test x${build_agg} = xyes ])
+ AM_CONDITIONAL(BUILD_CAIRO_RENDERER, [ test x${build_cairo} = xyes ])
+ 
+ if test x"${build_ovg}" = xyes; then
+    AC_DEFINE([RENDERER_OPENVG], [1], [Use OpenVG renderer])
+ fi
  
  if test x"${build_ogl}" = xyes; then
-    AC_DEFINE([RENDERER_OPENGL], [], [Use OpenGL renderer])
+    AC_DEFINE([RENDERER_OPENGL], [1], [Use OpenGL renderer])
  fi
  
- if test x"$build_agg" = xyes; then
-   AC_DEFINE([RENDERER_AGG], [], [Use AntiGrain renderer])
+ if test x"${build_agg}" = xyes; then
+   AC_DEFINE([RENDERER_AGG], [1], [Use AntiGrain renderer])
  fi
  
- if test x"$build_cairo" = xyes; then
+ if test x"${build_cairo}" = xyes; then
    GNASH_PKG_FIND(cairo, [cairo.h], [cairo render library], cairo_status)
-   AC_DEFINE([RENDERER_CAIRO], [], [Use cairo renderer])
+   AC_DEFINE([RENDERER_CAIRO], [1], [Use cairo renderer])
  fi
  
  if test x"${build_agg}" = xyes; then
@@@ -989,43 -1127,75 +1085,74 @@@ dnl     Moorestown platform and future 
  dnl NOTE: it is possible to use Gnash/VAAPI on platforms with an Intel
  dnl GMA500 but you currently will have to build the AGG renderer
  dnl instead of the OGL (OpenGL) one. 
--
- build_vaapi=yes
- hwaccel_list="VAAPI"
- nhwaccel=1
- AC_ARG_ENABLE(hwaccel,
-   AC_HELP_STRING([--enable-hwaccel], [Enable hardware accelerated video 
decoding (none,vaapi)]),
-   if test -z ${enableval}; then
-       hwaccel_list="none"
-       nhwaccel=0
-       enableval=""
-   fi
+ build_vaapi_device=no
+ build_openmax_device=no
+ build_x11_device=no
+ build_directfb_device=no
+ build_egl_device=yes
+ build_rawfb_device=yes
+ 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)]),
++  AC_HELP_STRING([--enable-device], [Specify which hardware abstraction to 
use to support to enable (none,egl,directfb,rawfb,x11,vaapi)]),
+   enableval=`echo ${enableval} | tr '\054' ' ' `
+   build_egl_device=no
+   build_rawfb_device=no
+   device_list=""
+   ndevice=0
    while test -n "${enableval}" ; do
      val=`echo ${enableval} | cut -d ' ' -f 1`
      [case "${val}" in
        no*|NO*)
-         hwaccel_list="none"
-         build_vaapi=no
-         build_omap=no
-         nhwaccel=0
+         device_list="none"
+         build_vaapi_device=no
+         build_openmax_device=no
+         build_egl_device=no
+         build_directfb_device=no
+         build_x11_device=no
+         ndevice=0
          ;;
        va*|VA*)
-         hwaccel_list="${hwaccel_list} vaapi"
-         build_vaapi=yes
-         nhwaccel=$((nhwaccel+1))
+         device_list="${device_list} VAAPI"
+         build_vaapi_device=yes
+         ndevice=$((ndevice+1))
+         ;;
+       eg*|EG*)
+         device_list="${device_list} EGL"
+         build_egl_device=yes
+         ndevice=$((ndevice+1))
+         ;;
+       x1*|X1*)
+         device_list="${device_list} X11"
+         build_x11_device=yes
+         ndevice=$((ndevice+1))
+         ;;
+       di*|Di*|DI*|dfb)
+         device_list="${device_list} DirectFB"
+         build_directfb_device=yes
+         ndevice=$((ndevice+1))
+         ;;
+       ra*|RAW*)
+         device_list="${device_list} RawFB"
+         build_rawfb_device=yes
+         ndevice=$((ndevice+1))
          ;;
        all|ALL)
-         hwaccel_list="VAAPI OMAP"
-         nhwaccel=2
-         build_omap=yes
-         build_vaapi=yes
+         device_list="EGL DirectFB X11"
+         build_openmax_device=no
+         build_vaapi_device=no
+         build_egl_device=yes
+         build_rawfb_device=yes
+         build_directfb_device=yes
+         build_x11_device=yes
+         ndevice=5
          ;;
-       omap*|OMAP*)
-         hwaccel_list="${hwaccel_list} omap"
-         build_omap=yes
-         nhwaccel=$((nhwaccel+1))
+       op*|Op*|OP*)
+         device_list="${device_list} OpenMAX"
+         build_openmax_device=yes
+         ndevice=$((ndevice+1))
          ;;
-       *) AC_MSG_ERROR([invalid hwaccel feature specified: ${enableval} given 
(accept: none,vaapi,omap)])
 -      *) AC_MSG_ERROR([invalid device feature specified: ${enableval} given 
(accept: none,vaapi,omap)])
++      *) AC_MSG_ERROR([invalid device feature specified: ${enableval} given 
(accept: none,vaapi)])
          ;;
        esac]
      enableval=`echo ${enableval} | cut -d ' ' -f 2-6`
@@@ -1584,156 -1828,8 +1717,146 @@@ if test x$build_gtk = xyes; the
        GNASH_PKG_FIND(cairo, [cairo.h], [cairo render library], cairo_status)
     fi
  fi
 +
 +if test x"${build_qt4}" != xno; then
 + GNASH_PATH_QT4
 +fi
 +
 +if test x"${build_qt4}" = xauto; then
 +  if test x"${has_qt4}" = xyes; then
 +     build_qt4=yes
 +  else
 +     build_qt4=no
 +  fi
 +fi
 +
 +if test x"${build_kde3}" != xno -o x"${build_qtopia3}" != xno; then
 + GNASH_PATH_QT3
 +fi
 +
 +if test x"${build_kde3}" != xno; then
 +  GNASH_PATH_KDE3
 +fi
 +
 +
 +if test x"${build_kde3}" = xauto; then
 +  if test x"${has_qt3}" = xyes -a x"${has_kde3}" = xyes; then
 +     build_kde3=yes
 +  else
 +     build_kde3=no
 +  fi
 +fi
 +
 +dnl Check possibility to build DUMP gui, if requested
 +if test x"${build_dump}" != xno; then
 +  if test x"${build_agg}" = xyes; then
 +    build_dump=yes
 +  else
 +    if test x"${build_dump}" = xyes; then
 +      dnl SHOULD we just check at the end of file instead ?
 +      AC_MSG_ERROR(dump GUI cannot be built without AGG renderer);
 +    fi
 +    build_dump=no
 +  fi
 +fi
 +
 +dnl Check possibility to build FB gui, if requested
- dnl FB dependencies are a linux system (linux/fb.h) 
- dnl and AGG renderer
++dnl FB dependency is a linux system (linux/fb.h)
 +if test x"${build_fb}" != xno; then
 +  if test x"${linux}" = xyes; then
-     if test x"${build_agg}" = xyes; then
 +      build_fb=yes
-     else
-       if test x"${build_fb}" = xyes; then
-         dnl SHOULD we just check at the end of file instead ?
-         AC_MSG_ERROR([fb GUI cannot be built without AGG renderer])
-       fi
-       AC_MSG_NOTICE([fb GUI won't be built (needs AGG renderer)])
-       build_fb=no
-     fi
 +  else
 +    if test x"${build_fb}" = xyes; then
 +      dnl SHOULD we just check at the end of file instead ?
 +      AC_MSG_ERROR(fb GUI cannot be built on non-linux platforms);
 +    fi
 +    AC_MSG_NOTICE([fb GUI won't be built (non-linux platform)])
 +    build_fb=no
 +  fi
 +fi
 +
  dnl TODO: add checks for all other GUIs
  
 +dnl -------------------------------
 +dnl Input Device selection
 +dnl -------------------------------
 +
 +dnl Multiple input devices are supported. These can all work in
 +dnl varying combinations, so several may be listed. These are only
 +dnl required when using the Framebuffer, as without the X11 desktop,
 +dnl Gnash has to handle all these internally. This can get
 +dnl messy, as one might want to use a touchscreen with a normal mouse
 +dnl or keyboard attached. 
 +dnl By default, don't build any of these, as they are only for the Framebuffer
 +dnl running without X11.
 +if test x"${build_fb}" = xyes; then
 +build_ps2mouse=yes
 +build_ps2keyboard=no
 +build_input_events=yes
 +build_tslib=yes
 +input_events="PS/2 Mouse, Input Devices, Touchscreen via Tslib"
 +else
 +build_ps2mouse=no
 +build_ps2keyboard=no
 +build_input_events=no
 +build_tslib=no
 +input_events=
 +fi
 +AC_ARG_ENABLE(input,
 +  AC_HELP_STRING([--enable-input=], [Enable support for the specified input 
devices for the framebuffer GUI 
(default=ps2mouse|ps2keyboard|events|touchscreen)]),
 +  [if test -n ${enableval}; then
 +    enableval=`echo ${enableval} | tr '\054' ' ' `
 +  fi
 +  while test -n "${enableval}" ; do
 +    val=`echo ${enableval} | cut -d ' ' -f 1`
 +    case "${val}" in
 +      ps2m*|PS2m*|m*|M*)        dnl a PS/2 style mouse
 +        build_ps2mouse=yes
 +        input_events="${input_events}, PS/2 Mouse"
 +        ;;
 +      ps2k*|PS2K*|k*|K*)        dnl a PS/2 style keyboard
 +        build_ps2keyboard=yes
 +        input_events="${input_events}, PS/2 Keyboard"
 +        ;;
 +      i*|I*|ev*|Ev*)    dnl use the new Input Event, which supports both
 +        input_events="${input_events}, Input Event Device"
 +        build_input_events=yes
 +        ;;
 +      t*|T*) dnl use a touchscreen with tslib, which works like a mouse
 +        build_tslib=yes
 +        input_events="${input_events}, Touchscreen"
 +        ;;
 +      *) AC_MSG_ERROR([invalid input device list! ${enableval} given (accept: 
ps2mouse|keyboard|events,touchscreen)])
 +         ;;
 +      esac
 +    enableval=`echo ${enableval} | cut -d ' ' -f 2-6`
 +    if test "x$val" = "x$enableval"; then
 +      break;
 +    fi
 +  done],
 +)
 +
 +if test x"${build_tslib}" = xyes; then
 +  AC_DEFINE(USE_TSLIB, [1], [Use a tslib supported touchscreen])
 +  GNASH_PKG_FIND(ts, [tslib.h], [Touchscreen library], ts_config)
 +fi
 +AM_CONDITIONAL(ENABLE_TSLIB, [test x${ac_cv_header_tslib_h} != xno])
 +
 +if test x"${build_ps2mouse}" = xyes; then
 +  AC_DEFINE(USE_MOUSE_PS2, [1], [Add support for a directly using a PS/2 
Mouse])
 +fi
 +AM_CONDITIONAL(ENABLE_MOUSE, [test x"${build_ps2mouse}" = xyes])
 +
 +if test x"${build_ps2keyboard}" = xyes; then
 +  AC_DEFINE(USE_KEYBOARD_PS2, [1], [Add support for directly using a PS/2 
Keyboard])
 +fi
 +if test x"${build_input_events}" = xyes; then
 +  AC_DEFINE(USE_INPUT_EVENTS, [1], [Add support for a directly using Linux 
Input Event Devices])
 +fi
 +AM_CONDITIONAL(ENABLE_INPUT_EVENTS, [test x"${build_input_events}" = xyes])
 +dnl this is enabled if we have any input devices at all
 +AM_CONDITIONAL(ENABLE_INPUT_DEVICES, [test x"${input_events}" != x])
 +
  
  dnl -----------------------------------------------------------
  dnl Try to ignore stupid dependencies
@@@ -1888,7 -2007,11 +2015,12 @@@ dnl AC_CHECK_LIB(gmp, _gmp_get_memory_f
  GNASH_PATH_X11
  AC_CHECK_LIB(Xi, XInput_find_display)
  AC_CHECK_LIB(X11, XDisableAccessControl)
- AM_CONDITIONAL(HAVE_X11, [test x$x11 = xyes])
+ dnl fi
+ AM_CONDITIONAL(HAVE_X11, [test x${has_x11} = xyes])
+ if test x${build_x11_device} = xyes -a  x${has_x11} = xyes; then
+   AC_DEFINE(BUILD_X11_DEVICE, [1], [Build the X11 device])
+ fi
++
  AC_CHECK_LIB(rt, shm_unlink)
  AC_CHECK_FUNCS(shm_open shm_unlink)
  AC_TRY_COMPILE([#include <strings.h>], [
@@@ -2318,11 -2465,40 +2449,36 @@@ if test x"${build_gles1}" = xyes -o x"$
    GNASH_PATH_GLES
  fi
  
- if test x"${build_ogv}" = xyes; then
+ dnl The OpenGLES1, OpenGLES2, and OpenVG all need the EGL support, X11 can 
use it also
+ if test x"${build_gles1}" = xyes -o  x"${build_gles2}" = xyes -o 
x"${build_ovg}" = xyes; then
+   build_egl_device=yes
+ fi
+ 
+ dnl only Linux supports /dev/fb0
+ if test x"${build_rawfb_device}" = xyes -a x"${linux}" = xyes; then
+    AC_DEFINE([BUILD_RAWFB_DEVICE], [1], [Use raw Framebuffer device support])
+ fi
+ 
+ if test x"${build_directfb_device}" = xyes; then
+    GNASH_PKG_FIND(directfb, [directfb.h], [DirectFB render library], 
DirectFBCreate)
+    AC_DEFINE([BUILD_DIRECTFB_DEVICE], [1], [Use DirectFB device support])
+ fi
+ 
+ if test x"${build_egl_device}" = xyes; then
    GNASH_PKG_FIND(EGL, [EGL/egl.h], [EGL library], eglGetDisplay)
-   GNASH_PKG_FIND(OpenVG, [vg/openvg.h], [OpenVG library], vgDrawImage)
+   AC_DEFINE(BUILD_EGL_DEVICE, [1], [Build the EGL device for OpenVG, 
OpenGLES1&2, and X11/Mesa])
+ fi
+ 
+ AM_CONDITIONAL(BUILD_VAAPI_DEVICE, [test x"${use_libva}" = xyes])
+ AM_CONDITIONAL(BUILD_EGL_DEVICE, [test x"${build_egl_device}" = xyes])
+ AM_CONDITIONAL(BUILD_DIRECTFB_DEVICE, [ test x${build_directfb_device} = 
xyes])
+ AM_CONDITIONAL(BUILD_RAWFB_DEVICE, [ test x${build_rawfb_device} = xyes])
+ AM_CONDITIONAL(BUILD_X11_DEVICE, [test x${build_x11_device} = xyes])
+ 
+ if test x"${build_ovg}" = xyes; then
+   GNASH_PATH_OPENVG
  fi
  
 -if test x"${build_ogl}" = xyes; then
 -  GNASH_PATH_OPENGL
 -fi
 -
  if test x"${build_gtk}" = xyes; then
    AC_ARG_ENABLE(ghelp,
      AC_HELP_STRING([--enable-ghelp], [Enable support for the GNOME help 
system]),
@@@ -2780,8 -2967,6 +2935,7 @@@ testsuite/movies.all/Makefil
  testsuite/libcore.all/Makefile
  testsuite/libmedia.all/Makefile
  gui/Makefile
- gui/fb/Makefile
 +gui/dump/Makefile
  gui/Info.plist
  gui/pythonmod/Makefile
  extensions/Makefile
diff --cc gui/Makefile.am
index 82f89d0,2e0a796..ea8d717
--- a/gui/Makefile.am
+++ b/gui/Makefile.am
@@@ -23,24 -22,12 +23,16 @@@
  
  AUTOMAKE_OPTIONS = -Wno-portability
  
- DIST_SUBDIRS = pythonmod fb dump
- 
- # Build the current directory first. It's hard to see, but there is a '.' dot 
here.
- SUBDIRS = . fb
- 
- if BUILD_FB_GUI
- SUBDIRS += fb
- endif
- 
- if BUILD_DUMP_GUI
- SUBDIRS += dump
- endif
 -DIST_SUBDIRS = pythonmod
++SUBDIRS = .
  
  # If python support is enabled, built that too
  if HAS_PYTHON
 -SUBDIRS = pythonmod
 +SUBDIRS += pythonmod
 +endif
 +
++if BUILD_DUMP_GUI
++SUBDIRS += dump
+ endif
  
  localedir = $(datadir)/locale
  
@@@ -50,10 -37,10 +42,11 @@@ pluginsdir = $(libdir)/gnash/plugin
  # noinst_LTLIBRARIES = libgnashgui.la
  BUILT_SOURCES =
  
++DIST_SUBDIRS = pythonmod
  EXTRA_DIST = gnash.in \
 -      kde/klash3.moc.in \
 -      kde/Kde4Gui.moc.in \
 -      kde/Kde4Glue.moc.in
 +      qt/klash3.moc.in \
 +      qt/Qt4Gui.moc.in \
 +      qt/Qt4Glue.moc.in
  
  noinst_HEADERS =
  noinst_LTLIBRARIES = 
@@@ -171,15 -189,9 +173,9 @@@ bin_SCRIPTS = gnas
  bin_PROGRAMS = 
  
  gnash: gnash.in
 -      cp $< $@
 +      cp $(srcdir)/gnash.in $@
        chmod +x $@
  
- # Always include the device files in the source tarball
- EXTRA_DIST += \
-       fb/TouchDevice.cpp \
-       fb/MouseDevice.cpp \
-       fb/EventDevice.cpp
- 
  GUI_SRCS = gnash.cpp \
        gui.cpp gui.h \
        Player.cpp Player.h \
@@@ -192,9 -204,14 +188,14 @@@ BUILT_SOURCES += bundl
  EXTRA_DIST += Gnash.app
  endif
  
+ # Build the FB gui
+ if BUILD_FB_GUI
+ include $(srcdir)/fb/fb.am
+ endif
+ 
  # Build the QTOPIA gui
  if BUILD_QTOPIA3_GUI
 -include $(srcdir)/kde/qtopia3.am
 +include $(srcdir)/qt/qtopia3.am
  endif
  
  # Build the KDE3 gui
@@@ -260,3 -293,26 +261,17 @@@ mudflap
  clean-hook:
        -rm -f core.* $(CLEANFILES)
  
 -# if DYNAMIC_GUI
 -# install-pluginsLTLIBRARIES: $(plugins_LTLIBRARIES)
 -#     test -d "$(DESTDIR)$(plugindir)" || $(mkinstalldirs) 
"$(DESTDIR)$(plugindir)"
 -#     for i in $(plugins_LTLIBRARIES); do \
 -#       $(LIBTOOL) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$i 
"$(DESTDIR)$(plugindir)/$$i" ; \
 -#     done
 -# endif
 -
+ if ENABLE_DEVELOPER_TESTS
+ check_PROGRAMS = test_glue
+ 
+ test_glue_SOURCES = \
+       test_glue.cpp \
+       fb/fb_glue_agg.cpp \
+       fb/fb_glue_ovg.cpp
+ test_glue_CPPFLAGS = \
+       -DFAKEFB=\"$(FAKEFB)\" \
+       $(AM_CPPFLAGS) \
+       $(DIRECTFB_CFLAGS)
+ #       -DUSE_TESTSUITE
+ test_glue_LDADD = $(GNASH_LIBS)
+ endif
 -
diff --cc gui/fb/fb.cpp
index 75f31ff,c5a0800..9229f50
--- a/gui/fb/fb.cpp
+++ b/gui/fb/fb.cpp
@@@ -382,6 -332,11 +332,9 @@@ FBGui::init(int argc, char *** argv
  bool
  FBGui::run()
  {
 -    // GNASH_REPORT_FUNCTION;
 -  
+ #ifdef USE_TSLIB
+     int ts_loop_count;
+ #endif
  
      VirtualClock& timer = getClock();
      
diff --cc gui/fb/fb_glue_ovg.cpp
index 0000000,ef0e556..87a75a8
mode 000000,100644..100644
--- a/gui/fb/fb_glue_ovg.cpp
+++ b/gui/fb/fb_glue_ovg.cpp
@@@ -1,0 -1,192 +1,195 @@@
+ //
+ //   Copyright (C) 2005, 2006, 2007, 2008, 2009, 2010 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
+ // the Free Software Foundation; either version 3 of the License, or
+ // (at your option) any later version.
+ //
+ // This program is distributed in the hope that it will be useful,
+ // but WITHOUT ANY WARRANTY; without even the implied warranty of
+ // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ // GNU General Public License for more details.
+ // 
+ // You should have received a copy of the GNU General Public License
+ // along with this program; if not, write to the Free Software
+ // Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+ 
+ #ifdef HAVE_CONFIG_H
+ #include "gnashconfig.h"
+ #endif
+ 
+ #include "log.h"
+ #include "fb_glue_ovg.h"
+ #include "GnashDevice.h"
+ #include "GnashException.h"
+ 
+ #ifdef BUILD_EGL_DEVICE
+ # include <egl/eglDevice.h>
+ #endif
+ 
+ #ifdef BUILD_RAWFB_DEVICE
+ # include <rawfb/RawFBDevice.h>
+ #endif
+ 
+ #include "GnashDevice.h"
++#include <sys/types.h>
++#include <sys/stat.h>
++#include <fcntl.h>
+ 
+ namespace gnash {
+ 
+ namespace gui {
+ 
+ FBOvgGlue::FBOvgGlue(int fd)
+     : _stride(0)
+ {
+     // GNASH_REPORT_FUNCTION;    
+ }
+ 
+ FBOvgGlue::~FBOvgGlue()
+ {
+     // GNASH_REPORT_FUNCTION;
+ }
+ 
+ bool
+ FBOvgGlue::init(int /* argc */, char **/*argv*/[])
+ {
+     // GNASH_REPORT_FUNCTION;
+ 
+     bool egl = false;
+ #if 0
+     bool rawfb = false;
+     bool dfb = false;
+     bool x11 = false;
+     // Probe to see what display devices we have that could be used.
+     boost::shared_array<renderer::GnashDevice::dtype_t> devs = probeDevices();
+     if (devs) {
+         int i = 0;
+         while (devs[i] != renderer::GnashDevice::NODEV) {
+             switch (devs[i++]) {
+               case renderer::GnashDevice::EGL:
+                   log_debug("Probing found an EGL display device");
+                   egl = true;
+                   break;
+               case renderer::GnashDevice::RAWFB:
+                   log_debug("Probing found a raw Framebuffer display device");
+                   rawfb = true;
+                   break;
+               case renderer::GnashDevice::X11:
+                   log_debug("Probing found an X11 display device");
+                   x11 = true;
+                   break;
+               case renderer::GnashDevice::DIRECTFB:
+                   log_debug("Probing found a DirectFB display device");
+                   dfb = true;
+                   break;
+               case renderer::GnashDevice::NODEV:
+               default:
+                   log_error("No display devices found by probing!");
+                   break;
+             }
+         }
+ 
+     }
+     
+     // 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 {
+         // 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();
+ 
+     // Some linux distros like ltib have more information available
+     // about the framebuffer
+     int fd = ::open("/sys/class/graphics/fb0/stride", O_RDONLY);
+     char number[10];
+     if (::read(fd, &number, 10)) {
+         _stride = strtol(number, NULL, 0);
+     } else {
+         if (getDepth() == 32) {
+             _stride = _width * 4;
+         } else {
+             _stride = _width * 2;
+         }
+     }
+         
+     return _device->attachWindow(_display.getHandle());
+ }
+ 
+ Renderer*
+ FBOvgGlue::createRenderHandler()
+ {
+     // GNASH_REPORT_FUNCTION;
+ 
+     // Create the renderer
+     _renderer.reset(renderer::openvg::create_handler(0));
+ 
+     // Print the description
+     if (!_renderer->description().empty()) {
+         log_debug("Renderer is: %s", _renderer->description());
+     }
+     
+     if (!_renderer) {
+         boost::format fmt = boost::format(
+             _("Could not create OpenVG renderer"));
+         throw GnashException(fmt.str());
+     }
+ 
+     return _renderer.get();
+ }
+ 
+ /// Not implemented, Fixme
+ void
+ FBOvgGlue::setInvalidatedRegions(const InvalidatedRanges& ranges)
+ {
+     // GNASH_REPORT_FUNCTION;
+     // if (_renderer) {
+     //     _renderer->setInvalidatedRegions(ranges);
+     // }
+ }
+ 
+ void
+ FBOvgGlue::prepDrawingArea(void *drawing_area)
+ {
+     GNASH_REPORT_FUNCTION;
+ 
+     _device->attachWindow(reinterpret_cast
+             <renderer::GnashDevice::native_window_t>(drawing_area));
+ }
+ 
+ void
+ FBOvgGlue::render()
+ {
+     // GNASH_REPORT_FUNCTION;
+ 
+     _device->swapBuffers();
+ }
+ 
+ } // end of namespace gui
+ } // end of namespace gnash
+     
+ // Local Variables:
+ // mode: C++
+ // indent-tabs-mode: nil
+ // End:
diff --cc gui/gtk/gtk_canvas.cpp
index 78e94af,57317b0..4aaa155
--- a/gui/gtk/gtk_canvas.cpp
+++ b/gui/gtk/gtk_canvas.cpp
@@@ -152,9 -164,14 +164,12 @@@ gnash_canvas_configure_event(GtkWidget 
  static void
  gnash_canvas_realize(GtkWidget *widget)
  {
+     GNASH_REPORT_FUNCTION;
+     
 -    GnashCanvas *canvas = GNASH_CANVAS(widget);
 -    GdkWindowAttr attributes;
 -    gint attributes_mask;
 -
      GTK_WIDGET_SET_FLAGS (widget, GTK_REALIZED);
  
++    GnashCanvas *canvas = GNASH_CANVAS(widget);
 +    GdkWindowAttr attributes;
      attributes.window_type = GDK_WINDOW_CHILD;
      attributes.x = widget->allocation.x;
      attributes.y = widget->allocation.y;
diff --cc gui/gtk/gtk_glue_gtkglext.cpp
index 1e67ff5,41ec1a5..f6f0c48
--- a/gui/gtk/gtk_glue_gtkglext.cpp
+++ b/gui/gtk/gtk_glue_gtkglext.cpp
@@@ -107,8 -117,12 +108,8 @@@ GtkGlExtGlue::createRenderHandler(
      // Attach our OpenGL context to the drawing_area.
      gdk_gl_drawable_make_current(gldrawable, glcontext);
  
-     Renderer* renderer = create_Renderer_ogl();
+     Renderer* renderer = renderer::opengl::create_handler();
  
 -#ifdef FIX_I810_LOD_BIAS
 -    glTexEnvf(GL_TEXTURE_FILTER_CONTROL_EXT, GL_TEXTURE_LOD_BIAS_EXT, 
_tex_lod_bias);
 -#endif
 -
      return renderer;
  }
  
diff --cc gui/gtk/gtk_glue_gtkglext.h
index 2961378,fa5f4b9..cb65726
--- a/gui/gtk/gtk_glue_gtkglext.h
+++ b/gui/gtk/gtk_glue_gtkglext.h
@@@ -23,13 -23,9 +23,13 @@@
  #include "gnashconfig.h"
  #endif
  
 +#include <gtk/gtk.h>
 +#include <gdk/gdk.h>
 +#include <boost/scoped_array.hpp>
 +
  #include <gtk/gtkgl.h>
  
- #include "Renderer_ogl.h"
+ #include "opengl/Renderer_ogl.h"
  #include "gtk_glue.h"
  #include "tu_opengl_includes.h"
  
diff --cc gui/gui.cpp
index 5ae1080,4f92445..ee152c9
--- a/gui/gui.cpp
+++ b/gui/gui.cpp
@@@ -820,26 -788,29 +810,25 @@@ Gui::display(movie_root* m
                      float xmax = bounds.getMaxX();
                      float ymin = bounds.getMinY();
                      float ymax = bounds.getMaxY();
- 
+                     
 -                    corners[0].x = xmin;
 -                    corners[0].y = ymin;
 -                    corners[1].x = xmax;
 -                    corners[1].y = ymin;
 -                    corners[2].x = xmax;
 -                    corners[2].y = ymax;
 -                    corners[3].x = xmin;
 -                    corners[3].y = ymax;
 -                    SWFMatrix no_transform;
 -                    _renderer->drawPoly(corners, 4,
 -                                      rgba(0,0,0,0), rgba(255,0,0,255), 
no_transform, false);
 +                    const std::vector<point> box = boost::assign::list_of
 +                        (point(xmin, ymin))
 +                        (point(xmax, ymin))
 +                        (point(xmax, ymax))
 +                        (point(xmin, ymax));
- 
++                    
 +                    _renderer->draw_poly(box, rgba(0,0,0,0), 
rgba(255,0,0,255),
-                             SWFMatrix(), false);
-                         
++                                         SWFMatrix(), false);
+                     
                  }
              }
-               );
- 
-               // show frame on screen
-               renderBuffer();
-       
-       };
-   
-       return true;
+             );
+         
+         // show frame on screen
 -        renderBuffer();
 -      
++        renderBuffer();       
+     };
+     
+     return true;
  }
  
  void
diff --cc gui/gui.h
index 8f87c1f,c81bb56..6de9d10
--- a/gui/gui.h
+++ b/gui/gui.h
@@@ -610,12 -601,14 +608,14 @@@ private
  };
  
  /// Named constructors
+ namespace gui {
+   std::auto_ptr<Gui> createFBGui(unsigned long xid, float scale, bool loop, 
RunResources& r);
+ }
  std::auto_ptr<Gui> createGTKGui(unsigned long xid, float scale, bool loop, 
RunResources& r);
  std::auto_ptr<Gui> createKDEGui(unsigned long xid, float scale, bool loop, 
RunResources& r);
 -std::auto_ptr<Gui> createKDE4Gui(unsigned long xid, float scale, bool loop, 
RunResources& r);
 +std::auto_ptr<Gui> createQt4Gui(unsigned long xid, float scale, bool loop, 
RunResources& r);
  std::auto_ptr<Gui> createSDLGui(unsigned long xid, float scale, bool loop, 
RunResources& r);
  std::auto_ptr<Gui> createFLTKGui(unsigned long xid, float scale, bool loop, 
RunResources& r);
- std::auto_ptr<Gui> createFBGui(unsigned long xid, float scale, bool loop, 
RunResources& r);
  std::auto_ptr<Gui> createAQUAGui(unsigned long xid, float scale, bool loop, 
RunResources& r);
  std::auto_ptr<Gui> createRISCOSGui(unsigned long xid, float scale, bool loop, 
RunResources& r);
  std::auto_ptr<Gui> createAOS4Gui(unsigned long xid, float scale, bool loop, 
RunResources& r);
diff --cc gui/qt/Qt4GlueOgl.cpp
index 8b8ac32,0000000..3408e72
mode 100644,000000..100644
--- a/gui/qt/Qt4GlueOgl.cpp
+++ b/gui/qt/Qt4GlueOgl.cpp
@@@ -1,97 -1,0 +1,97 @@@
 +//
 +//   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
 +// the Free Software Foundation; either version 3 of the License, or
 +// (at your option) any later version.
 +//
 +// This program is distributed in the hope that it will be useful,
 +// but WITHOUT ANY WARRANTY; without even the implied warranty of
 +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 +// GNU General Public License for more details.
 +// 
 +// You should have received a copy of the GNU General Public License
 +// along with this program; if not, write to the Free Software
 +// Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
 +
 +
 +#ifdef HAVE_CONFIG_H
 +#include "gnashconfig.h"
 +#endif
 +
 +#include <QWidget>
 +#include <QGLWidget>
 +#include <QRect>
 +
 +#include "Qt4GlueOgl.h"
 +#include "Qt4Gui.h"
 +#include "Renderer.h"
- #include "Renderer_ogl.h"
++#include "opengl/Renderer_ogl.h"
 +#include "GnashException.h"
 +
 +namespace gnash
 +{
 +
 +Qt4OglGlue::Qt4OglGlue()
 +:
 +  _width(0),
 +  _height(0),
 +  _renderer(0)
 +{
 +}
 +
 +Qt4OglGlue::~Qt4OglGlue()
 +{
 +}
 +
 +bool
 +Qt4OglGlue::init(int /* argc */, char *** /* argv */)
 +{
 +    return true;
 +}
 +
 +
 +void
 +Qt4OglGlue::prepDrawingArea(DrawingWidget *drawing_area)
 +{
 +    assert(drawing_area);
 +    _drawing_area = drawing_area;
 +    _drawing_area->_glWidget = new QGLWidget(drawing_area);
 +    _drawing_area->_glWidget->setVisible(drawing_area->isVisible());
 +    _drawing_area->_glWidget->setMinimumSize(drawing_area->minimumSize());
 +    _drawing_area->_glWidget->setSizePolicy(QSizePolicy::Expanding,
 +                                            QSizePolicy::Expanding);
 +    _drawing_area->_glWidget->makeCurrent();
 +}
 +
 +
 +void
 +Qt4OglGlue::render()
 +{
 +    assert(_drawing_area);
 +    _drawing_area->_glWidget->swapBuffers();
 +}
 +
 +
 +void
 +Qt4OglGlue::render(const QRect& /*updateRect*/)
 +{
 +  render();
 +}
 +
 +
 +Renderer*
 +Qt4OglGlue::createRenderHandler()
 +{
 +    _renderer = create_Renderer_ogl();
 +
 +    if ( ! _renderer ) {
 +        throw GnashException("Could not create OpenGL renderer");
 +    }
 +    return _renderer;
 +}
 +
 +// end of namespace gnash
 +}
diff --cc gui/qt/kde_glue_opengl.h
index da1f77e,0000000..117aafa
mode 100644,000000..100644
--- a/gui/qt/kde_glue_opengl.h
+++ b/gui/qt/kde_glue_opengl.h
@@@ -1,40 -1,0 +1,40 @@@
 +//
 +//   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
 +// the Free Software Foundation; either version 3 of the License, or
 +// (at your option) any later version.
 +//
 +// This program is distributed in the hope that it will be useful,
 +// but WITHOUT ANY WARRANTY; without even the implied warranty of
 +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 +// GNU General Public License for more details.
 +// 
 +// You should have received a copy of the GNU General Public License
 +// along with this program; if not, write to the Free Software
 +// Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
 +
 +#include <qapplication.h>
 +#include "kde_glue.h"
- #include "Renderer_ogl.h"
++#include "opengl/Renderer_ogl.h"
 +#include <qgl.h>
 +
 +
 +namespace gnash
 +{
 +
 +class KdeOpenGLGlue : public KdeGlue
 +{
 +  public:
 +    KdeOpenGLGlue();
 +    ~KdeOpenGLGlue();
 +    
 +    bool init(int argc, char **argv[]);
 +    void prepDrawingArea(QWidget *drawing_area);
 +    Renderer* createRenderHandler();
 +    void render();
 +};
 +
 +}
diff --cc libbase/Makefile.am
index 66c0bb7,c73384e..9060db5
--- a/libbase/Makefile.am
+++ b/libbase/Makefile.am
@@@ -129,8 -124,17 +129,6 @@@ if USE_GI
  libgnashbase_la_SOURCES += GnashImageGif.cpp
  endif
  
- libgnashbase_la_LIBADD += $(LTDL_LIBS)
- 
 -# if LIBLTDL1
 -# noinst_LTLIBRARIES = libltdlc.la
 -# libltdlc_la_CPPFLAGS = $(LTDLINCL) -I$(top_srcdir)/libltdl
 -# libltdlc_la_SOURCES = $(top_srcdir)/libltdl/ltdl.c
 -# libgnashbase_la_LIBADD += $(top_builddir)/libbase/libltdlc.la
 -# endif
 -
 -# if LIBLTDL2
 -# libgnashbase_la_LIBADD += $(top_builddir)/libltdl/libltdlc.la
 -# endif
 -
  if HAIKU
    libgnashbase_la_LIBADD += $(HAIKU_LIBS)
  endif
@@@ -224,19 -225,9 +222,9 @@@ EXTENSIONS_API = 
  instdir = $(includedir)/gnash
  inst_HEADERS += $(EXTENSIONS_API)
  
 -libgnashbase_la_LDFLAGS = -release $(VERSION) 
 -libgnashbase_la_DEPENDENCIES = $(LIBLTDLLIB)
 +libgnashbase_la_LDFLAGS = -release $(VERSION)
 +libgnashbase_la_DEPENDENCIES =
  
- if BUILD_OGL_RENDERER
-    libgnashbase_la_SOURCES += \
-       GnashTexture.cpp \
-       $(NULL)
- 
-    noinst_HEADERS += \
-       GnashTexture.h \
-       $(NULL)
- endif
- 
  if HAVE_VAAPI
     libgnashbase_la_SOURCES += \
        GnashVaapiImage.cpp \
diff --cc libcore/FillStyle.cpp
index 99e0202,e4173cf..4114b6b
--- a/libcore/FillStyle.cpp
+++ b/libcore/FillStyle.cpp
@@@ -182,9 -182,11 +182,11 @@@ const CachedBitmap
  BitmapFill::bitmap() const
  {
      if (_bitmapInfo) {
 -        return  _bitmapInfo->disposed() ? 0 : _bitmapInfo.get();
 +        return  _bitmapInfo.get();
      }
-     if (!_md) return 0;
+     if (!_md) {
+         return 0;
+     }
      _bitmapInfo = _md->getBitmap(_id);
  
      // May still be 0!
diff --cc libdevice/GnashDevice.h
index 0000000,9d0e1de..3dcbdb6
mode 000000,100644..100644
--- a/libdevice/GnashDevice.h
+++ b/libdevice/GnashDevice.h
@@@ -1,0 -1,138 +1,138 @@@
+ //
+ //   Copyright (C) 2005, 2006, 2007, 2008, 2009, 2010 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
+ // the Free Software Foundation; either version 3 of the License, or
+ // (at your option) any later version.
+ //
+ // This program is distributed in the hope that it will be useful,
+ // but WITHOUT ANY WARRANTY; without even the implied warranty of
+ // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ // GNU General Public License for more details.
+ // 
+ // You should have received a copy of the GNU General Public License
+ // along with this program; if not, write to the Free Software
+ // Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+ //
+ 
+ #ifndef __GNASH_DEVICE_H__
+ #define __GNASH_DEVICE_H__ 1
+ 
+ #ifdef HAVE_CONFIG_H
+ #include "gnashconfig.h"
+ #endif
+ 
+ #include <boost/scoped_array.hpp>
+ 
+ #include "Geometry.h"
+ 
+ /// @note This file is the base class for all low level rendering and display
+ /// devices. These devices must be probed and initialized first, before any
+ /// renderering or window creation happens.
+ /// The derived classes for this base class are then used by the renderer to
+ /// determine functionality.
+ namespace gnash {
+ 
+ namespace renderer {
+ 
+ struct GnashDevice
+ {
+     typedef std::vector<const Path*> PathRefs;
+     typedef std::vector<Path> PathVec;
+     typedef std::vector<geometry::Range2d<int> > ClipBounds;
+     typedef std::vector<const Path*> PathPtrVec;
+     
+     /// Handle multiple window types. The derived classes will cast this to
+     /// the proper data type.
+     typedef long native_window_t;
+     
+     /// The list of supported renders that use devices
+     typedef enum {OPENVG, OPENGL, OPENGLES1, OPENGLES2, XORG, VAAPI} rtype_t;
+     /// The list of supported device types
+     typedef enum {NODEV, EGL, DIRECTFB, X11, RAWFB} dtype_t;
+     
+     GnashDevice(int argc, char *argv[]);
+     GnashDevice() { };
+     
+     virtual ~GnashDevice() { };
+ 
+     /// Get the type of the instatiated device. Since the
+     /// renderer has a single value for the supported device,
+     /// this is used to see which device has been loaded.
+     virtual dtype_t getType() = 0;
+     
+     /// Initialize GNASH Device layer. This mostly just
+     /// initializes all the private data.
+     virtual bool initDevice(int argc, char *argv[]) = 0;
+ 
+     /// Attach Native Window to device. This connects a
+     /// Native Window to the device so surfaces can be created.
+     virtual bool attachWindow(native_window_t window) = 0;
+     
+     // Utility methods not in the base class
+     
+     /// Return a string with the error code as text, instead of a numeric 
value
+     virtual const char *getErrorString(int error) = 0;
+     
+     /// Query the system for all supported configs
+     // int queryGNASHConfig() { return queryGNASHConfig(_gnashDisplay); };
+     // int queryGNASHConfig(GNASHDisplay display);
+ 
+     /// Get the width of the device
+     virtual size_t getWidth() = 0;
+ 
+     /// Get the Height of the device
+     virtual size_t getHeight() = 0;
+ 
+     /// Get the depth of the device
+     virtual int getDepth() = 0;
+ 
+     /// Get the size of the Red pixel
+     virtual int getRedSize() = 0;
+ 
+     /// Get the size of the Green pixel
+     virtual int getGreenSize() = 0;
+ 
+     /// Get the size of the Blue pixel
+     virtual int getBlueSize() = 0;
+ 
+     /// Is this device single buffered
+     virtual bool isSingleBuffered() = 0;
+ 
+     /// Are buffers destroyed ?
+     virtual bool isBufferDestroyed() = 0;
+ 
+     /// Get the window ID handle
+     virtual int getID() = 0;
+ 
+     /// Is the specified renderer supported by this hardware ?
+     virtual bool supportsRenderer(rtype_t rtype) = 0;
+ 
+     /// Is this renderering natively
+     virtual bool isNativeRender() = 0;
+ 
+     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) { return false; };
++    virtual bool bindClient(GnashDevice::rtype_t) { return false; };
+     
+     virtual bool swapBuffers() {
+         GNASH_REPORT_FUNCTION;
+         return false;
+     };
+ };
+     
+ } // namespace renderer
+ } // namespace gnash
+ 
+ #endif  // end of __GNASH_DEVICE_H__
+ 
+ // local Variables:
+ // mode: C++
+ // indent-tabs-mode: nil
+ // End:
diff --cc libdevice/Makefile.am
index 7498b73,b59a6f8..8571373
--- a/libdevice/Makefile.am
+++ b/libdevice/Makefile.am
@@@ -57,40 -60,34 +60,35 @@@ GNASH_LIBS = 
  
  instdir = $(includedir)/gnash
  
- inst_HEADERS = \
-       Renderer.h \
-       $(NULL)
- 
  noinst_HEADERS = \
-       agg/Renderer_agg.h \
-       agg/LinearRGB.h \
-       agg/Renderer_agg_bitmap.h \
-       agg/Renderer_agg_style.h \
-       opengl/tu_opengl_includes.h \
-       opengl/Renderer_ogl.h \
-       cairo/Renderer_cairo.h \
-       cairo/PathParser.h
+       GnashDevice.h \
+       DeviceGlue.h \
        $(NULL)
  
- pkglib_LTLIBRARIES = libgnashrender.la
- libgnashrender_la_LIBADD = $(LIBVA_LIBS) $(LIBVA_X11_LIBS) $(LIBVA_GLX_LIBS)
- libgnashrender_la_LDFLAGS =  -release $(VERSION) 
- libgnashrender_la_SOURCES =
- 
- if BUILD_OGL_RENDERER
- libgnashrender_la_SOURCES += opengl/Renderer_ogl.cpp
- libgnashrender_la_LIBADD += $(OPENGL_LIBS)
- endif
- 
- if  BUILD_AGG_RENDERER
- libgnashrender_la_SOURCES += agg/Renderer_agg.cpp 
- libgnashrender_la_LIBADD += $(AGG_LIBS) $(LIBVA)
- endif
- 
- if  BUILD_CAIRO_RENDERER
- libgnashrender_la_SOURCES += cairo/Renderer_cairo.cpp
- libgnashrender_la_SOURCES += cairo/PathParser.cpp
- libgnashrender_la_LIBADD += $(CAIRO_LIBS)
+ pkglib_LTLIBRARIES =  libgnashdevice.la
+ 
+ libgnashdevice_la_CPPFLAGS = $(AM_CPPFLAGS)
+ libgnashdevice_la_LIBADD = \
+       $(CURL_LIBS) \
+       $(LIBVA_LIBS) \
+       $(LIBVA_X11_LIBS) \
+       $(LIBVA_GLX_LIBS) \
+       $(TS_LIBS) \
++      $(LTDL_LIBS) \
+       $(GNASH_LIBS)
+ libgnashdevice_la_LDFLAGS =  -release $(VERSION) 
+ libgnashdevice_la_SOURCES = \
+       GnashDevice.h \
+       DeviceGlue.h
+ 
+ if BUILD_X11_DEVICE
+ libgnashdevice_la_CPPFLAGS += $(X11_CFLAGS)
+ libgnashdevice_la_SOURCES += \
+       x11/X11Device.cpp \
+       x11/X11Device.h
+ libgnashdevice_la_LIBADD += \
+       $(TS_LIBS) \
+       $(X11_LIBS)
  endif
  
  # Rebuild with GCC 4.x Mudflap support
diff --cc libdevice/egl/egl.am
index 0000000,797970c..a340041
mode 000000,100644..100644
--- a/libdevice/egl/egl.am
+++ b/libdevice/egl/egl.am
@@@ -1,0 -1,48 +1,50 @@@
+ # 
+ #   Copyright (C) 2005, 2006, 2007, 2008, 2009, 2010 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
+ #   the Free Software Foundation; either version 3 of the License, or
+ #   (at your option) any later version.
+ #
+ #   This program is distributed in the hope that it will be useful,
+ #   but WITHOUT ANY WARRANTY; without even the implied warranty of
+ #   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ #   GNU General Public License for more details.
+ #
+ #   You should have received a copy of the GNU General Public License
+ #   along with this program; if not, write to the Free Software
+ #   Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+ #
+ 
+ # eglinfo is a utility program that isn't always available. Since it's useful
+ # when bring up Gnash on a new target, it's included here.
+ bin_PROGRAMS += eglinfo
+ eglinfo_SOURCES = egl/eglinfo.c
+ eglinfo_CPPFLAGS = $(AM_CPPFLAGS) $(EGL_CFLAGS)
+ eglinfo_LDADD = \
+       $(EXTRA_EGL_LIBS) \
++      $(LTDL_LIBS) \
+       $(EGL_LIBS) \
+       $(NULL)
+ 
+ # this tests the low level EGL interface, used by OpenVG, OpenGLES1, and 
OpenGLES2.
+ bin_PROGRAMS += test_egl 
+ test_egl_SOURCES = egl/test_egl.cpp
+ test_egl_CPPFLAGS = $(AM_CPPFLAGS) $(EGL_CFLAGS)
+ test_egl_LDADD = \
+       libgnashdevice.la \
+       $(EXTRA_EGL_LIBS) \
+       $(TS_LIBS) \
+       $(CURL_LIBS) \
+       $(EGL_LIBS) \
+       $(GNASH_LIBS) \
++      $(LTDL_LIBS) \
+       $(NULL)
+ 
+ libgnashdevice_la_CPPFLAGS += $(EGL_CFLAGS)
+ libgnashdevice_la_SOURCES += \
+       egl/eglDevice.cpp \
+       egl/eglDevice.h \
+       egl/configTemplates.h  \
+       $(NULL)
+ libgnashdevice_la_LIBADD += $(EGL_LIBS)
diff --cc libdevice/events/InputDevice.cpp
index f2ed504,35167c2..14704e8
--- a/libdevice/events/InputDevice.cpp
+++ b/libdevice/events/InputDevice.cpp
@@@ -20,9 -20,9 +20,10 @@@
  #include "gnashconfig.h"
  #endif
  
- #include "gui.h"
  #include "log.h"
  #include "InputDevice.h"
+ #include "GnashKey.h"
++#include "iostream"
  
  namespace gnash {
  
diff --cc libdevice/events/InputDevice.h
index 1ecccf0,d328cd4..2a57914
--- a/libdevice/events/InputDevice.h
+++ b/libdevice/events/InputDevice.h
@@@ -80,10 -101,24 +101,25 @@@ public
  
      // Read data into the Device input buffer.
      boost::shared_array<boost::uint8_t> readData(size_t size);
+     boost::shared_ptr<input_data_t> popData()
+     {
+         boost::shared_ptr<InputDevice::input_data_t> input;
+         if (_data.size()) {
+             // std::cerr << "FIXME: " <<_data.size() << std::endl;
+             input = _data.front();
+             _data.pop();
+         }
+         return input;
+     }
+ 
+     static boost::shared_array<int> convertAbsCoords(int x, int y,
+                                                      int width, int height);
  
 -    void dump();
 +    void dump() const;
-     
++
  protected:
+     void addData(bool pressed, key::code key, int modifier, int x, int y);
+     
      devicetype_e        _type;
      std::string         _filespec;
      int                 _fd;
diff --cc librender/Makefile.am
index 7498b73,322c471..6d774ac
--- a/librender/Makefile.am
+++ b/librender/Makefile.am
@@@ -57,23 -60,35 +61,36 @@@ GNASH_LIBS = 
  
  instdir = $(includedir)/gnash
  
- inst_HEADERS = \
-       Renderer.h \
-       $(NULL)
- 
  noinst_HEADERS = \
+       Renderer.h \
        agg/Renderer_agg.h \
 +      agg/LinearRGB.h \
        agg/Renderer_agg_bitmap.h \
        agg/Renderer_agg_style.h \
+       cairo/Renderer_cairo.h \
+       cairo/PathParser.h \
        opengl/tu_opengl_includes.h \
        opengl/Renderer_ogl.h \
-       cairo/Renderer_cairo.h \
-       cairo/PathParser.h
+       opengles1/Renderer_gles1.h \
+       opengles1/render_handler_gles.h \
+       opengles2/Renderer_gles2.h \
+       openvg/OpenVGRenderer.h \
+       openvg/OpenVGBitmap.h \
+       openvg/OpenVGStyle.h \
+       opengl/Renderer_ogl.h \
        $(NULL)
  
- pkglib_LTLIBRARIES = libgnashrender.la
- libgnashrender_la_LIBADD = $(LIBVA_LIBS) $(LIBVA_X11_LIBS) $(LIBVA_GLX_LIBS)
+ EXTRA_DIST = $(noinst_HEADERS)
+ 
+ pkglib_LTLIBRARIES =  libgnashrender.la
+ 
+ libgnashrender_la_CPPFLAGS = $(AM_CPPFLAGS)
+ libgnashrender_la_LIBADD = \
+       ../libdevice/libgnashdevice.la \
+       $(LIBVA_LIBS) \
+       $(LIBVA_X11_LIBS) \
+       $(LIBVA_GLX_LIBS) \
+       $(GNASH_LIBS)
  libgnashrender_la_LDFLAGS =  -release $(VERSION) 
  libgnashrender_la_SOURCES =
  
@@@ -106,9 -151,36 +153,43 @@@ if ENABLE_PC
  AM_CXXFLAGS = $(PCH_FLAGS)
  endif
  
 -if BUILD_OGL_RENDERER
 -   libgnashrender_la_SOURCES += \
 -      GnashTexture.cpp \
 -      $(NULL)
 +# Remove libtool .la files
 +install-exec-hook:
 +      $(RM) $(DESTDIR)$(libdir)/gnash/libgnashrender.la
  
 -   noinst_HEADERS += \
 -      GnashTexture.h \
 -      $(NULL)
 -endif
 +uninstall-local:
 +      $(RM) $(DESTDIR)$(libdir)/gnash/libgnashrender-*.so
++
++# if BUILD_OGL_RENDERER
++#    libgnashrender_la_SOURCES += \
++#     GnashTexture.cpp \
++#     $(NULL)
++
++#    noinst_HEADERS += \
++#     GnashTexture.h \
++#     $(NULL)
++# endif
+ 
+ if ENABLE_DEVELOPER_TESTS
+ check_PROGRAMS = testr
+ 
+ testr_SOURCES = testr.cpp # testr_gtk.cpp
+ testr_CPPFLAGS = \
+       $(AM_CPPFLAGS) \
+       $(EGL_CFLAGS) \
+       $(OPENVG_CFLAGS) \
+       $(GLES1_CFLAGS) \
+       $(GLES2_CFLAGS)
+       $(DIRECTFB_CFLAGS)
+ testr_LDADD = \
+       libgnashrender.la \
+       ../libdevice/libgnashdevice.la \
+       ../libsound/libgnashsound.la \
+       $(GTK2_LIBS) \
+       $(EXTRA_EGL_LIBS) \
+       $(EGL_LIBS) \
+       $(GNASH_LIBS) \
+       $(OPENVG_LIBS) \
+       $(GLES1_LIBS) \
+       $(GLES2_LIBS)
+ endif
diff --cc librender/Renderer.h
index 4614451,7681630..acb2b34
--- a/librender/Renderer.h
+++ b/librender/Renderer.h
@@@ -446,7 -478,62 +446,61 @@@ public
          abort();        
          return false; // avoid compiler warning        
      }
+ 
+     void addRenderImage(boost::shared_ptr<GnashVaapiImageProxy> image) {
+         _render_images.push_back(image);
+     }
+     
+     /// Returns the average RGB color for a square block on the stage. The 
+     /// width and height of the block is defined by "radius" and x/y refer
+     /// to the center of the block. radius==1 equals getPixel() and radius==0
+     /// is illegal. For even "radius" values, the center point is not exactly
+     /// defined. 
+     /// The function returns false when at least one pixel of the block was
+     /// outside the main frame buffer. In that case the value in color_return
+     /// is undefined.
+     /// This implementation is provided for simplicity. Renderers should
+     /// implement a specialized version for better performance.
+     virtual bool getAveragePixel(rgba& color_return, int x, int y, 
+         unsigned int radius) const
+     {
+     
+         assert(radius>0); 
+     
+         // optimization:
+         if (radius==1) return getPixel(color_return, x, y);
+     
+         unsigned int r=0, g=0, b=0, a=0;
+         
+         x -= radius/2;
+         y -= radius/2;
+         
+         int xe = x+radius;
+         int ye = y+radius;
+ 
+         rgba pixel;
+         
+         for (int yp=y; yp<ye; yp++)
+         for (int xp=x; xp<xe; xp++)
+         {
+             if (!getPixel(pixel, xp, yp))
+                 return false;
+                 
+             r += pixel.m_r;            
+             g += pixel.m_g;            
+             b += pixel.m_b;            
+             a += pixel.m_a;            
+         }
+         
+         int pcount = radius*radius; 
+         color_return.m_r = r / pcount; 
+         color_return.m_g = g / pcount; 
+         color_return.m_b = b / pcount; 
+         color_return.m_a = a / pcount; 
+         
+         return true;
+     }
      
 -    
      /// \brief
      /// Initializes the renderer for off-screen rendering used by the    
      /// testsuite.
diff --cc librender/opengl/Renderer_ogl.cpp
index 248a435,0ea96ec..eb18dce
--- a/librender/opengl/Renderer_ogl.cpp
+++ b/librender/opengl/Renderer_ogl.cpp
@@@ -93,7 -93,7 +93,6 @@@
  ///    us. The GLU tesselator will take care of shapes having inner boundaries
  ///    (for example a donut shape). This makes life a LOT easier!
  
--
  // TODO:
  // - Profiling!
  // - Optimize code:
@@@ -108,14 -108,18 +107,17 @@@
  // that would give "exact two-dimensional rasterization". AGG uses a similar
  // system; consider the benefits and drawbacks of switching.
  
--
  namespace gnash {
  
 -namespace renderer {
 -
 -namespace opengl {
 -
  namespace {
      const CachedBitmap* createGradientBitmap(const GradientFill& gf,
              Renderer& renderer);
  }
  
++namespace renderer {
++
++namespace opengl {
++
  namespace {
  
  class bitmap_info_ogl : public CachedBitmap
@@@ -306,7 -309,7 +308,6 @@@ private
    GLenum _cap;
  };
  
--
  class oglScopeMatrix : public boost::noncopyable
  {
  public:
@@@ -407,8 -410,8 +408,6 @@@ void trace_curve(const point& startP, c
    }
  }
  
--
--
  std::vector<oglVertex> interpolate(const std::vector<Edge>& edges,
          const float& anchor_x, const float& anchor_y)
  {
@@@ -436,7 -439,7 +435,6 @@@
    return shape_points;  
  }
  
--
  // FIXME: OSX doesn't like void (*)().
  Tesselator::Tesselator()
  : _tessobj(gluNewTess())
@@@ -515,8 -518,8 +513,6 @@@ Tesselator::rememberVertex(GLdouble* v
    _vertices.push_back(v);
  }
  
--
--
  // static
  void
  Tesselator::error(GLenum error)
@@@ -542,13 -545,13 +538,11 @@@ Tesselator::combine(GLdouble coords [3]
    tess->rememberVertex(v);
  }
  
--
  bool isEven(const size_t& n)
  {
    return n % 2 == 0;
  }
  
--
  bitmap_info_ogl::bitmap_info_ogl(std::auto_ptr<image::GnashImage> image,
          GLenum pixelformat, bool ogl_accessible)
  :
diff --cc librender/opengl/Renderer_ogl.h
index f05e3eb,db4a532..43e66b7
--- a/librender/opengl/Renderer_ogl.h
+++ b/librender/opengl/Renderer_ogl.h
@@@ -56,16 -56,14 +56,15 @@@
  
  #include <map>
  
 +
  namespace gnash {
  
+ namespace renderer {
  
- 
+ namespace opengl {
  
 -  typedef std::vector<const Path*> PathRefs;
 -
 +typedef std::vector<const Path*> PathRefs;
- 
- 
- 
++ 
  struct oglVertex {
    oglVertex(double x, double y, double z = 0.0)
      : _x(x), _y(y), _z(z)
@@@ -149,16 -144,16 +148,16 @@@ private
    std::vector<PathRefs> shape;
  
  };
 - 
 -DSOEXPORT Renderer* create_handler(bool init = true);
 +
- 
- 
- 
 +DSOEXPORT Renderer* create_Renderer_ogl(bool init = true);
  
- 
- 
+ } // namespace gnash::renderer::opengl
+ } // namespace gnash::renderer
  } // namespace gnash
  
- 
  #endif
  
+ // local Variables:
+ // mode: C++
+ // indent-tabs-mode: nil
+ // End:
diff --cc librender/openvg/OpenVGBitmap.cpp
index 0000000,dd0d18a..1bcb20b
mode 000000,100644..100644
--- a/librender/openvg/OpenVGBitmap.cpp
+++ b/librender/openvg/OpenVGBitmap.cpp
@@@ -1,0 -1,354 +1,354 @@@
+ // 
+ //   Copyright (C) 2005, 2006, 2007, 2008, 2009, 2010 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
+ // the Free Software Foundation; either version 3 of the License, or
+ // (at your option) any later version.
+ // 
+ // This program is distributed in the hope that it will be useful,
+ // but WITHOUT ANY WARRANTY; without even the implied warranty of
+ // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ // GNU General Public License for more details.
+ // 
+ // You should have received a copy of the GNU General Public License
+ // along with this program; if not, write to the Free Software
+ // Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301 USA
+ 
+ #include <boost/scoped_ptr.hpp>
+ 
+ #include "Geometry.h"
+ #include "CachedBitmap.h"
+ #include "GnashImage.h"
+ #include "Renderer.h"
+ #include "FillStyle.h"
+ #include "SWFCxForm.h"
+ #include "openvg/OpenVGRenderer.h"
+ #include "openvg/OpenVGBitmap.h"
+ #include "VG/openvg.h"
+ 
+ namespace gnash {
+ 
+ namespace renderer {
+ 
+ namespace openvg {
+ 
+ static const int NUM_STOPS = 10;
+ 
+ /// @param vgpaint the VG paint context
+ OpenVGBitmap::OpenVGBitmap(VGPaint paint)
+     : _vgimage(VG_INVALID_HANDLE),
+ #ifdef BUILD_X11_DEVICE
+       _pixel_format(VG_sARGB_8888),
+ #else
+       _pixel_format(VG_sRGB_565),
+ #endif
+       _vgpaint(paint)
+ {
+     // GNASH_REPORT_FUNCTION;
+ }
+ 
+ /// Construct a new bitmap
+ ///
+ /// @param bitmap A CachedBitmap
+ /// @param vgpaint the VG paint context
+ OpenVGBitmap::OpenVGBitmap(CachedBitmap *bitmap, VGPaint vgpaint)
+     : _vgimage(VG_INVALID_HANDLE),
+ #ifdef BUILD_X11_DEVICE
+       _pixel_format(VG_sARGB_8888),
+ #else
+       _pixel_format(VG_sRGB_565),
+ #endif
+        _vgpaint(vgpaint)
+ {
+     // GNASH_REPORT_FUNCTION;
+ 
+     // extract a reference to the image from the cached bitmap
+     image::GnashImage &im = bitmap->image();
+ 
+     // Store the reference so it's available to applyPatternBitmap()
+     _image.reset(&im);
+ 
+     // Create a VG image
+     _vgimage = vgCreateImage(_pixel_format, im.width(), im.height(),
+                              VG_IMAGE_QUALITY_FASTER);    
+     if (_vgimage == VG_INVALID_HANDLE) {
+         log_error("Failed to create VG image! %s",
+                   Renderer_ovg::getErrorString(vgGetError()));
+     }
+     
+     switch (im.type()) {
+     case image::TYPE_RGB:
+         log_debug("Image has RGB Pixel Format, Stride is %d, width is %d, 
height is %d",
+                   im.stride(), im.width(), im.height());
+         vgImageSubData(_vgimage, im.begin(), im.stride(), VG_sRGBX_8888,
+                    0, 0, im.width(), im.height());
+         break;
+     case image::TYPE_RGBA:
+         log_debug("Image has RGBA Pixel Format, Stride is %d, width is %d, 
height is %d",
+                   im.stride(), im.width(), im.height());
+         // Copy the image data into the VG image container
+         vgImageSubData(_vgimage, im.begin(), im.stride(), VG_sRGBA_8888,
+                    0, 0, im.width(), im.height());
+         break;
+     default:
+         std::abort();
+     }
+ }
+ 
+ /// Construct a new bitmap
+ ///
+ /// @param A pointer to a GnashImage
+ /// @param vgpaint the VG paint context
+ 
+ /// @note This is usually only called by createCachedBitmap() when a bitmap
+ /// is loaded from a swf file. As the renderer isn't initialized yet,
+ /// only the GnashImage is cached.
+ OpenVGBitmap::OpenVGBitmap(image::GnashImage *image, VGPaint vgpaint)
+     : _image(image),
+       _vgimage(VG_INVALID_HANDLE),
+ #ifdef BUILD_X11_DEVICE
+       _pixel_format(VG_sARGB_8888),
+ #else
+       _pixel_format(VG_sRGB_565),
+ #endif
+     _vgpaint(vgpaint)
+ {
+     // GNASH_REPORT_FUNCTION;
+ } 
+ 
+ OpenVGBitmap::~OpenVGBitmap()
+ {
+     // GNASH_REPORT_FUNCTION;
+     
+     vgDestroyPaint(_vgpaint);
+     vgDestroyImage(_vgimage);
+ }
+ 
+ image::GnashImage&
+ OpenVGBitmap::image()
+ {
+     // GNASH_REPORT_FUNCTION;
+     if (_image) {
+         return *_image;
+     }
+ }    
+ 
+ /// Create a radial gradient and paint it to the context
+ ///
+ /// @param x0 The X coordinate of the origin point
+ /// @param y0 The Y coordinate of the origin point
+ /// @param x1 The X coordinate of the opposite corner point
+ /// @param y1 The Y coordinate of the opposite corner point
+ /// @param incolor The base color of the gradient
+ /// @param paint The VG paint context
+ /// @return A pointer to the new Bitmap
+ 
+ /// @note
+ /// OpenVG supports creating linear and gradient fills in hardware, so
+ /// we want to use that instead of the existing way of calculating the
+ /// gradient in software.
+ 
+ // A Radial Gradient Bitmap uses two points and a radius in the paint
+ // coordinate system. The gradient starts at x0,y0 as the center, and
+ // x1,y1 is the focal point that is forced to be in the circle.
+ OpenVGBitmap *
+ OpenVGBitmap::createRadialBitmap(float cx, float cy, float fx, float fy,
+                                  float radial, const rgba &incolor,
+                                  const GradientFill::GradientRecords &records,
+                                  const SWFCxForm& cxform,
+                                  VGPaint paint)
+ {
+     // GNASH_REPORT_FUNCTION;
+ 
+     VGfloat color[] = {
+         incolor.m_r / 255.0f,
+         incolor.m_g / 255.0f,
+         incolor.m_b / 255.0f,
+         incolor.m_a / 255.0f
+     };
+     vgSetParameteri (paint, VG_PAINT_TYPE, VG_PAINT_TYPE_COLOR);
+     vgSetParameterfv (paint, VG_PAINT_COLOR, 4, color);
+     
+     VGfloat rgParams[] = { cx, cy, fx, fy, radial };
+     
+     // Paint Type 
+     vgSetParameteri(paint, VG_PAINT_TYPE, VG_PAINT_TYPE_RADIAL_GRADIENT);
+ 
+     // Gradient Parameters
+     vgSetParameterfv(paint, VG_PAINT_RADIAL_GRADIENT, 5, rgParams);
+ 
+     // Color Ramp is the same as for linear gradient
+     size_t entries = records.size() * 5;
+     VGfloat ramps[entries];
+     int j = 0;
+     for (size_t i=0; i!= records.size(); ++i) {
+         // std::cerr << "The record is: " << records[i].ratio/255.0f;
+         rgba c = records[i].color;
+         // std::cerr << ", " << c.m_r/255.0f << ", " << c.m_g/255.0f << ", "
+         //           << c.m_b/255.0f << ", " << c.m_a/255.0f << std::endl;
+         // The set of 5 for each record is simply: { Offset, R, G, B, A }
+         ramps[j++] = records[i].ratio/255.0f;
+         ramps[j++] = c.m_r / 255.0f;
+         ramps[j++] = c.m_g / 255.0f;
+         ramps[j++] = c.m_b / 255.0f;
+         ramps[j++] = c.m_a / 255.0f;
+     }
+     vgSetParameterfv(paint, VG_PAINT_COLOR_RAMP_STOPS, entries, ramps);
+ 
+     return this;
+ }
+ 
+ /// Create a linear gradient and paint it to the context
+ ///
+ /// @param x0 The X coordinate of the origin point
+ /// @param y0 The Y coordinate of the origin point
+ /// @param x1 The X coordinate of the opposite corner point
+ /// @param y1 The Y coordinate of the opposite corner point
+ /// @param incolor The base color of the gradient
+ /// @param paint The VG paint context
+ /// @return A pointer to the new Bitmap
+ ///
+ /// @note A Linear Gradient Bitmap uses two points, x0,y0 and x1,y1 in the 
paint
+ /// coordinate system. The gradient starts at x0,y0 and goes to x1,y1. If
+ /// x1 and y1 are outside the boundaries of the shape, then the gradient gets
+ /// clipped at the boundary instead of x1,y1.
+ OpenVGBitmap *
+ OpenVGBitmap::createLinearBitmap(float x0, float y0, float x1, float y1,
+                                  const rgba &incolor,
+                                  const GradientFill::GradientRecords &records,
+                                  const SWFCxForm& cxform,                     
            
+                                  const VGPaint paint)
+ {
+     // GNASH_REPORT_FUNCTION;
+ 
+     rgba nc = cxform.transform(incolor);
+ 
+     VGfloat color[] = {
+         nc.m_r / 255.0f,
+         nc.m_g / 255.0f,
+         nc.m_b / 255.0f,
+         nc.m_a / 255.0f
+     };
+     vgSetParameteri (paint, VG_PAINT_TYPE, VG_PAINT_TYPE_COLOR);
+     vgSetParameterfv (paint, VG_PAINT_COLOR, 4, color);
+ 
+     vgSetParameteri(paint, VG_PAINT_TYPE, VG_PAINT_TYPE_LINEAR_GRADIENT);
+     vgSetParameteri(paint, VG_PAINT_COLOR_RAMP_SPREAD_MODE,
+                     VG_COLOR_RAMP_SPREAD_PAD);
+ 
+     // This is the origin and size of the gradient
+     VGfloat linearGradient[4] = { x0, y0, x1, y1 };
+     vgSetParameterfv(paint, VG_PAINT_LINEAR_GRADIENT, 4, linearGradient);
+ 
+     // The application defines the non-premultiplied sRGBA color and alpha 
value
+     // associated with each of a number of values, called stops.
+     // A stop is defined by an offset between 0 and 1, inclusive, and a color 
value.
+     
+     // an array of floating-point values giving the offsets and colors
+     // of the stops. Each stop is defined by a floating-point offset
+     // value and four floating-point values containing the sRGBA color
+     // and alpha value associated with each stop, in the form of a
+     // non-premultiplied (R, G, B, α) quad. The vgSetParameter
+     // function will generate an error if the number of values
+     // submitted is not a multiple of 5 (zero is acceptable)
+     size_t entries = records.size() * 5;
+     VGfloat ramps[entries];
+     int j = 0;
+     for (size_t i=0; i!= records.size(); ++i) {
+         // std::cerr << "The record is: " << records[i].ratio/255.0f;
+         rgba c = cxform.transform(records[i].color);
+         // std::cerr << ", " << c.m_r/255.0f << ", " << c.m_g/255.0f << ", "
+         //           << c.m_b/255.0f << ", " << c.m_a/255.0f << std::endl;
+         // The set of 5 for each record is simply: { Offset, R, G, B, A }
+         ramps[j++] = records[i].ratio/255.0f;
+         ramps[j++] = c.m_r / 255.0f;
+         ramps[j++] = c.m_g / 255.0f;
+         ramps[j++] = c.m_b / 255.0f;
+         ramps[j++] = c.m_a / 255.0f;
+     }
+     vgSetParameterfv(paint, VG_PAINT_COLOR_RAMP_STOPS, entries, ramps);
+     
+     return this;
+ }
+ 
+ /// Create and fill pattern image
+ ///
+ /// @param matrix The transformation matrix
+ /// @param mode The mode used to pain the image
+ /// @param paint The VG paint context
+ /// @return A pointer to the new Bitmap
+ OpenVGBitmap *
+ OpenVGBitmap::applyPatternBitmap(const gnash::SWFMatrix& matrix,
+                                  bitmap_wrap_mode mode, VGPaint paint)
+ {
+     // GNASH_REPORT_FUNCTION;
+ 
+     if (_vgimage == VG_INVALID_HANDLE) {
+         log_error("No VG image to paint! %s",
+                   Renderer_ovg::getErrorString(vgGetError()));
+         return 0;
+     }
+ 
+     _vgpaint = paint;
+         
+     vgSetParameteri (_vgpaint, VG_PAINT_TYPE, VG_PAINT_TYPE_PATTERN);
+ 
+     gnash::SWFMatrix mat;
+     VGfloat     vmat[9];
+     
+     // Paint the cached VG image into the VG paint surface
+     mat = matrix;
+     mat.invert();
+     Renderer_ovg::printVGMatrix(matrix);
+     //Renderer_ovg::printVGMatrix(mat);
+     
+     memset(vmat, 0, sizeof(vmat));
+     // Convert from fixed point to floating point
 -    vmat[0] = mat.sx  / 65536.0f;
 -    vmat[1] = mat.shx / 65536.0f;
 -    vmat[3] = mat.shy / 65536.0f;
 -    vmat[4] = mat.sy  / 65536.0f;
 -    vmat[6] = mat.tx;
 -    vmat[7] = mat.ty;
++    vmat[0] = mat.a() / 65536.0f;
++    vmat[1] = mat.b() / 65536.0f;
++    vmat[3] = mat.c() / 65536.0f;
++    vmat[4] = mat.d() / 65536.0f;
++    vmat[6] = mat.tx();
++    vmat[7] = mat.ty();
+     
+     Renderer_ovg::printVGMatrix(vmat);
+     
+     vgSeti (VG_MATRIX_MODE, VG_MATRIX_FILL_PAINT_TO_USER);
+     vgLoadMatrix (vmat);
+     vgSeti (VG_MATRIX_MODE, VG_MATRIX_STROKE_PAINT_TO_USER);
+     vgLoadMatrix (vmat);
+     vgSeti (VG_MATRIX_MODE, VG_MATRIX_PATH_USER_TO_SURFACE);
+     
+     switch (mode) {
+       case WRAP_FILL:
+           vgSetParameteri (_vgpaint, VG_PAINT_PATTERN_TILING_MODE, 
VG_TILE_FILL);
+           break;
+       case WRAP_PAD:
+           vgSetParameteri (_vgpaint, VG_PAINT_PATTERN_TILING_MODE, 
VG_TILE_PAD);
+           break;
+       case WRAP_REPEAT:
+           vgSetParameteri (_vgpaint, VG_PAINT_PATTERN_TILING_MODE, 
VG_TILE_REPEAT);
+           break;
+       case WRAP_REFLECT:
+           vgSetParameteri (_vgpaint, VG_PAINT_PATTERN_TILING_MODE, 
VG_TILE_REFLECT);
+           break;
+       default:
+           log_error("No supported wrap mode specified!");
+           break;
+     }
+ 
+     vgPaintPattern(_vgpaint, _vgimage);
+     vgDestroyImage(_vgimage);
+     
+     return this;
+ }
+ 
+ } // namespace gnash::renderer::openvg
+ } // namespace gnash::renderer
+ } // namespace gnash
+ 
+ // local Variables:
+ // mode: C++
+ // indent-tabs-mode: nil
+ // End:
diff --cc librender/openvg/OpenVGRenderer.cpp
index 0000000,7dd5264..3496fdc
mode 000000,100644..100644
--- a/librender/openvg/OpenVGRenderer.cpp
+++ b/librender/openvg/OpenVGRenderer.cpp
@@@ -1,0 -1,1731 +1,1730 @@@
+ // 
+ //   Copyright (C) 2005, 2006, 2007, 2008, 2009, 2010 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
+ // the Free Software Foundation; either version 3 of the License, or
+ // (at your option) any later version.
+ // 
+ // This program is distributed in the hope that it will be useful,
+ // but WITHOUT ANY WARRANTY; without even the implied warranty of
+ // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ // GNU General Public License for more details.
+ // 
+ // You should have received a copy of the GNU General Public License
+ // along with this program; if not, write to the Free Software
+ // Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301 USA
+ 
 -///
 -/// Original author: Visor <address@hidden>
 -/// Heavily hacked by Rob <address@hidden> to work with Gnash
 -/// git master.
 -///
 -
+ #ifdef HAVE_CONFIG_H
+ #include "gnashconfig.h"
+ #endif
+ 
+ #include <sys/time.h>
+ #include <cstring>
+ #include <cmath>
++#include <iostream>
+ #include <boost/utility.hpp>
+ #include <boost/bind.hpp>
+ 
+ #include "log.h"
+ #include "RGBA.h"
+ #include "smart_ptr.h"
+ #include "GnashImage.h"
+ #include "GnashNumeric.h"
+ #include "FillStyle.h"
+ #include "LineStyle.h"
+ #include "Transform.h"
+ #include "log.h"
+ #include "utility.h"
+ #include "Range2d.h"
+ #include "SWFCxForm.h"
+ #include "openvg/OpenVGRenderer.h"
+ #include "openvg/OpenVGBitmap.h"
+ #include "openvg/OpenVGStyle.h"
+ #include "SWFMatrix.h"
+ #include "swf/ShapeRecord.h"
+ #include "CachedBitmap.h"
+ 
+ #include <VG/vgu.h>
+ #ifdef OPENVG_VERSION_1_1
+ # include <VG/ext.h>
+ #else
+ # include <VG/vgext.h>
+ #endif
+ #include <VG/openvg.h>
+ #define GNASH_IMAGE_QUALITY     VG_IMAGE_QUALITY_FASTER
+ #define GNASH_RENDER_QUALITY    VG_RENDERING_QUALITY_FASTER
+ 
+ #define  MAX_POINTS (4096)
+ 
+ /// \file Renderer_ovg.cpp
+ /// \brief The OpenVG renderer and related code.
+ ///
+ 
+ static const int TwipsPerInch = 1440;
+ 
+ namespace gnash {
+ 
+ static int tex_size;
+ 
+ typedef std::vector<Path> PathVec;
+ typedef std::vector<geometry::Range2d<int> > ClipBounds;
+ 
+ namespace renderer {
+ 
+ namespace openvg {
+ 
+ /// Transforms the current OpenVG SWFMatrix using the given SWFMatrix.
+ /// When it goes out of scope, the SWFMatrix will be reset to what it
+ /// was before the new SWFMatrix was applied.
+ class eglScopeMatrix : public boost::noncopyable
+ {
+ public:
+     eglScopeMatrix(const SWFMatrix& m)
+         {
+             GNASH_REPORT_FUNCTION;            
+             vgGetMatrix(_orig_mat);
+             // Renderer_ovg::printVGMatrix(_orig_mat);
+             
+             float mat[9];
+             memset(mat, 0, sizeof(mat));
 -            mat[0] = m.sx  / 65536.0f;
 -            mat[1] = m.shx / 65536.0f;
 -            mat[3] = m.shy / 65536.0f;
 -            mat[4] = m.sy  / 65536.0f;
 -            mat[6] = m.tx;
 -            mat[7] = m.ty;
++            mat[0] = m.a() / 65536.0f;
++            mat[1] = m.b() / 65536.0f;
++            mat[3] = m.c() / 65536.0f;
++            mat[4] = m.d() / 65536.0f;
++            mat[6] = m.tx();
++            mat[7] = m.ty();
+             vgMultMatrix(mat);
+             Renderer_ovg::printVGMatrix(mat);
+         }
+   
+     ~eglScopeMatrix()
+         {
+             vgLoadMatrix(_orig_mat);
+         }
+ private:
+     VGfloat _orig_mat[9];
+ };
+ 
+ /// @note
+ /// A VGpath is constructed from a series of appended path
+ /// segments. When drawing shapes from flash, we start each path by
+ /// moving to a known location. Then segments are appended, and then
+ /// the path is closed. This is also used for fills.
+ 
+ #define MAX_SEG  (256)
+ 
+ /// Start a VGPath by moving to a specified location
+ ///
+ /// @param path The VGPath to start
+ /// @returns nothing
+ inline void
+ startpath(VGPath path, const int x, const int y)
+ {
+     VGubyte     gseg[1];
+     VGfloat     gdata[2];
+ 
+     gseg[0] = VG_MOVE_TO;
+     gdata[0] = x;
+     gdata[1] = y;
+     vgAppendPathData (path, 1, gseg, gdata);
+ }
+ 
+ /// Close the VGPath started by startpath()
+ ///
+ /// @param path The VGPath to close
+ /// @returns nothing
+ inline void
+ closepath(VGPath path)
+ {
+     VGubyte     gseg[1];
+     VGfloat     gdata[2];
+   
+     gseg[0] = VG_CLOSE_PATH;
+     vgAppendPathData (path, 1, gseg, gdata);
+ }
+ 
+ /// Add a series of edges to the existing path created by startpath()
+ ///
+ /// @param path The VGPath to append segments to
+ /// @param edges The segments to append to the path
+ /// @param anchor_x The X coordinate to start from
+ /// @param anchor_y The Y coordinate to start from
+ /// @returns nothing
+ inline void
+ preparepath(VGPath path, const std::vector<Edge>& edges,
+                         const float& anchor_x, const float& anchor_y)
+ {
+     VGubyte     gseg[MAX_SEG];
+     VGfloat     gdata[MAX_SEG*3*2];
+     int         scount = 0;
+     int         dcount = 0; 
+ 
+     point start(anchor_x, anchor_y);
+     point anchor(anchor_x, anchor_y);
+   
+     for (std::vector<Edge>::const_iterator it = edges.begin(), end = 
edges.end();
+          it != end; ++it) {
+         const Edge& the_edge = *it;
+       
+         point target(the_edge.ap.x, the_edge.ap.y);
+ 
+         if (the_edge.straight()) {
+             gseg[scount++]  = VG_LINE_TO;
+             gdata[dcount++] = target.x;
+             gdata[dcount++] = target.y;
+         } else {
+             gseg[scount++]  = VG_QUAD_TO;
+             gdata[dcount++] = the_edge.cp.x;
+             gdata[dcount++] = the_edge.cp.y;
+             gdata[dcount++] = target.x;
+             gdata[dcount++] = target.y; 
+         }
+         if (scount >= MAX_SEG-2) {
+             vgAppendPathData(path, scount, gseg, gdata);
+             scount = 0;
+             dcount = 0;
+         }
+         anchor = target;
+     }
+   
+     if (scount > 0)
+         vgAppendPathData (path, scount, gseg, gdata);
+ }
+ 
+ template<typename C, typename T, typename R, typename A>
+ void 
+ for_each(C& container, R (T::*pmf)(const A&),const A& arg)
+ {
+     std::for_each(container.begin(), container.end(),
+                   boost::bind(pmf, _1, boost::ref(arg)));
+ }
+ 
+ Renderer_ovg::Renderer_ovg()
+     : _display_width(0.0),
+       _display_height(0.0),
+       _drawing_mask(false),
+ #ifdef OPENVG_VERSION_1_1    
+       _mask_layer(VG_INVALID_HANDLE),
+ #endif
+       _fillpaint(VG_INVALID_HANDLE),
+       _strokepaint(VG_INVALID_HANDLE),
+       _aspect_ratio(0.75)       // 4:3 aspect ratio
+ {
+     // GNASH_REPORT_FUNCTION;
+ }
+ 
+ Renderer_ovg::Renderer_ovg(renderer::GnashDevice::dtype_t /* dtype */)
+     : _display_width(0.0),
+       _display_height(0.0),
+       _drawing_mask(false),
+ #ifdef OPENVG_VERSION_1_1    
+       _mask_layer(VG_INVALID_HANDLE),
+ #endif
+       _fillpaint(VG_INVALID_HANDLE),
+       _strokepaint(VG_INVALID_HANDLE),
+       _aspect_ratio(0.75)       // 4:3 aspect ratio
+ {
+     GNASH_REPORT_FUNCTION;
+ 
+     set_scale(1.0f, 1.0f);
+ 
+ #if 0
+     _fillpaint = vgCreatePaint();
+     
+     _strokepaint = vgCreatePaint();
+     
+     // this paint object is used for solid, gradient, and pattern fills.
+     vgSetPaint (_fillpaint,   VG_FILL_PATH);
+ 
+     // this pain object is used for paths
+     vgSetPaint (_strokepaint, VG_STROKE_PATH);
+ #endif
+ }
+ 
+ void
+ Renderer_ovg::init(float x, float y)
+ {
+     GNASH_REPORT_FUNCTION;
+ 
+     _display_width = x;
+     _display_height = y;
+     
+     // this paint object is used for solid, gradient, and pattern fills.
+     _fillpaint = vgCreatePaint();
+     vgSetPaint (_fillpaint, VG_FILL_PATH);
+ 
+     // this pain object is used for paths
+     _strokepaint = vgCreatePaint();
+     vgSetPaint (_strokepaint, VG_STROKE_PATH);
+ 
+     // Turn on alpha blending.
+     vgSeti (VG_BLEND_MODE, VG_BLEND_SRC_OVER);
+     
+     vgSeti(VG_RENDERING_QUALITY, GNASH_RENDER_QUALITY);
+     vgSetf(VG_STROKE_LINE_WIDTH, 20.0f);
+     
+     VGfloat clearColor[4] = { 1.0f, 1.0f, 1.0f, 1.0f };
+     vgSetfv( VG_CLEAR_COLOR, 4, clearColor );
+     
+ #ifdef OPENVG_VERSION_1_1    
+     _mask_layer = vgCreateMaskLayer(x, y);
+ #endif
+ 
+     log_debug("VG Vendor is %s, VG Version is %s, VG Renderer is %s",
+               vgGetString(VG_VENDOR), vgGetString(VG_VERSION),
+               vgGetString(VG_RENDERER));
+     log_debug("VG Extensions are: ", vgGetString(VG_EXTENSIONS));
+     printVGParams();
+     
+     // vgSeti(VG_SCISSORING, VG_FALSE);
+     vgClear(0, 0, x*2, y*2);
+ }
+ 
+ Renderer_ovg::~Renderer_ovg()
+ {
+     // GNASH_REPORT_FUNCTION;
+ 
+     vgDestroyPaint(_fillpaint);
+     vgDestroyPaint(_strokepaint);
+ #ifdef OPENVG_VERSION_1_1    
+     vgDestroyMaskLayer(_mask_layer);
+ #endif
+ }
+ 
+ // Given an image, returns a pointer to a CachedBitmap class
+ // that can later be passed to fill_styleX_bitmap(), to set a
+ // bitmap fill style. We only cache the GnashImage here, as a
+ // VGImage can't be created yet until the renderer is initialized.
+ CachedBitmap *
+ Renderer_ovg::createCachedBitmap(std::auto_ptr<image::GnashImage> im)
+ {
+     // GNASH_REPORT_FUNCTION;
+ 
+     CachedBitmap *cbinfo = reinterpret_cast<CachedBitmap *>(new 
OpenVGBitmap(im.release(),
+                                                                              
_fillpaint));
+     return cbinfo;
+ }
+ 
+ // Since we store drawing operations in display lists, we take special care
+ // to store video frame operations in their own display list, lest they be
+ // anti-aliased with the rest of the drawing. Since display lists cannot be
+ // concatenated this means we'll add up with several display lists for normal
+ // drawing operations.
+ void
+ Renderer_ovg::drawVideoFrame(image::GnashImage* /* frame */, const SWFMatrix* 
/* m */,
+                              const SWFRect* /* bounds */, bool /*smooth*/)
+ {
+     log_unimpl("drawVideoFrame");  
+ }
+ 
+ void
+ Renderer_ovg::world_to_pixel(int& x, int& y, float world_x, float world_y)
+ {
+     GNASH_REPORT_FUNCTION;
+ 
+     // negative pixels seems ok here... we don't
+     // clip to valid range, use world_to_pixel(rect&)
+     // and Intersect() against valid range instead.
+     point p(world_x, world_y);
+     stage_matrix.transform(p);
+     x = (int)p.x;
+     y = (int)p.y;
+ }
+ 
+ geometry::Range2d<int>
 -Renderer_ovg::world_to_pixel(const SWFRect& wb)
++Renderer_ovg::world_to_pixel(const SWFRect& wb) const
+ {
+     GNASH_REPORT_FUNCTION;
+ 
+     using namespace gnash::geometry;
+     
+     if ( wb.is_null() ) return Range2d<int>(nullRange);
+     if ( wb.is_world() ) return Range2d<int>(worldRange);
+     
+     int xmin, ymin, xmax, ymax;
 -    
++
++#if 0                           // FIXME:
+     world_to_pixel(xmin, ymin, wb.get_x_min(), wb.get_y_min());
+     world_to_pixel(xmax, ymax, wb.get_x_max(), wb.get_y_max());
++#endif
+     
+     return Range2d<int>(xmin, ymin, xmax, ymax);
+ }
+ 
+ geometry::Range2d<int>
 -Renderer_ovg::world_to_pixel(const geometry::Range2d<float>& wb)
++Renderer_ovg::world_to_pixel(const geometry::Range2d<float>& wb) const
+ {
+     GNASH_REPORT_FUNCTION;
+ 
+     if (wb.isNull() || wb.isWorld()) return wb;
+     
+     int xmin, ymin, xmax, ymax;
+     
++#if 0                           // FIXME:
+     world_to_pixel(xmin, ymin, wb.getMinX(), wb.getMinY());
+     world_to_pixel(xmax, ymax, wb.getMaxX(), wb.getMaxY());
++#endif
+     
+     return geometry::Range2d<int>(xmin, ymin, xmax, ymax);
+ }
+ 
+ point
 -Renderer_ovg::pixel_to_world(int x, int y)
++Renderer_ovg::pixel_to_world(int x, int y) const
+ {
+     GNASH_REPORT_FUNCTION;
+ 
+     point p(x, y);
+     SWFMatrix mat = stage_matrix;
+     mat.invert().transform(p);
+     return p;
+ };
+ 
+ /// Setup the renderer to display by setting the Matrix for scaling,
+ /// shearing, and transformations.
+ ///
+ /// @param width - stage width
+ /// @param height - stage height
+ /// @param x0 - minimum frame size in X dimension in twips
+ /// @param x1 - maximum frame size in X dimension in twips
+ /// @param y0 - minimum frame size in Y dimension in twips
+ /// @param y1 - maximum frame size in Y dimension in twips
+ void
+ Renderer_ovg::begin_display(gnash::rgba const&, int width, int height,
+                             float x0, float x1, float y0, float y1)
+ {
+     // GNASH_REPORT_FUNCTION;
+ 
+     // Disable masking
+     vgSeti (VG_MASKING, VG_FALSE);
+ 
+     VGfloat mat[9];
+     memset(mat, 0, sizeof(mat));
+     // sx and sy define scaling in the x and y directions, respectively;
+     // shx and shy define shearing in the x and y directions, respectively;
+     // tx and ty define translation in the x and y directions, respectively.
+     
+     // Flash internally calculates anything that uses pixels with
+     // twips (or 1/20 of a pixel). Sprites, movie clips and any other
+     // object on the stage are positioned with twips. As a result, the
+     // coordinates of (for example) sprites are always multiples of
+     // 0.05 (i.e. 1/20).
+     mat[0] = (VGfloat)width / VGfloat(x1 - x0);  // scale sx = 0.05
+     mat[1] = 0; // shx
+     mat[3] = 0; // shy
+     mat[4] = -((VGfloat)height / VGfloat(y1 - y0)); // scale sy = -0.05
+     mat[6] = 0;   // shift tx in pixels
+     mat[7] = height;   // shift ty in pixels
+     
+     vgSeti (VG_MATRIX_MODE, VG_MATRIX_PATH_USER_TO_SURFACE);
+     // The default values after vgLoadIdentity() are:
+     //          [ 1 0 0 ]
+     //       M =| 0 1 0 |
+     //          [ 0 0 1 ]
+     vgLoadIdentity();
+ 
+     // An affine transformation maps a point (x, y) (represented using
+     // homogeneous coordinates as the column vector [x, y, 1]T) into the
+     // point (x*sx + y*shx + tx, x*shy + y*sy + ty) using matrix 
multiplication:
+     // [ sx shx tx ] [ x ]   [ x∗sx + y∗shx + tx ]
+     // | shy sy ty |.[ y | = | x∗shy + y∗sy + ty |
+     // [   0  0  1 ] [ 1 ]   [            1      ]
+     //
+     // If not VG_MATRIX_IMAGE_USER_TO_SURFACE, w0, w1, and w2 are ignored.
+     vgLoadMatrix (mat);
+     
+     // vgSeti(VG_SCISSORING, VG_FALSE);
+     vgClear(0, 0, _display_width, _display_height);
+ }
+ 
+ void
+ Renderer_ovg::end_display()
+ {
+     GNASH_REPORT_FUNCTION;
+ }
+ 
+ /// Draw a line-strip directly, using a thin, solid line. 
+ //
+ /// Can be used to draw empty boxes and cursors.
+ void
+ Renderer_ovg::drawLine(const std::vector<point>& coords, const rgba& fill,
+                        const SWFMatrix& mat)
+ {
+     GNASH_REPORT_FUNCTION;
+     
+     VGubyte     gseg[MAX_SEG];
+     VGfloat     gdata[MAX_SEG*3*2];
+     int         scount = 0;
+     int         dcount = 0;
+ 
+     if (coords.empty()) return;
+     
+     eglScopeMatrix scope_mat(mat);
+     
+     VGfloat color[] = {
+         fill.m_r / 255.0f,
+         fill.m_g / 255.0f,
+         fill.m_b / 255.0f,
+         1.0f
+     };
+     VGPath      vg_path;
+     vg_path = vgCreatePath (VG_PATH_FORMAT_STANDARD,
+                             VG_PATH_DATATYPE_F,
+                             1, 0, 0, 0,
+                             VG_PATH_CAPABILITY_ALL);
+     vgSetf (VG_FILL_RULE, VG_EVEN_ODD );
+     vgSetParameteri (_strokepaint, VG_PAINT_TYPE, VG_PAINT_TYPE_COLOR);
+     vgSetParameterfv (_strokepaint, VG_PAINT_COLOR, 4, color);
+     
+     std::vector<point>::const_iterator  it = coords.begin();
+     std::vector<point>::const_iterator end = coords.end();
+     
+     gseg[scount++] = VG_MOVE_TO;
+     gdata[dcount++] = (float)(*it).x;
+     gdata[dcount++] = (float)(*it).y;
+     ++it;            
+     
+     for (; it != end; ++it) {
+         gseg[scount++] = VG_LINE_TO;
+         gdata[dcount++] = (float)(*it).x;
+         gdata[dcount++] = (float)(*it).y;
+         if (scount >= MAX_SEG-1) {
+             vgAppendPathData(vg_path, scount, gseg, gdata);
+             scount = 0;
+             dcount = 0;
+         }
+     }
+     
+     if (scount > 0) {
+         vgAppendPathData(vg_path, scount, gseg, gdata);
+         
+     }
+     
+     vgSetf (VG_STROKE_JOIN_STYLE, VG_JOIN_ROUND);
+     vgSetf (VG_STROKE_CAP_STYLE, VG_CAP_ROUND);
+     vgSetf (VG_STROKE_LINE_WIDTH, 20.0f);
+     
+     vgDrawPath (vg_path, VG_STROKE_PATH);
+     vgDestroyPath(vg_path);
+ }
+ 
+ void
 -Renderer_ovg::drawPoly(const point* corners, size_t corner_count, 
 -                       const rgba& fill, const rgba& /* outline */,
 -                       const SWFMatrix& mat, bool /* masked */)
++Renderer_ovg::draw_poly(const std::vector<point>& corners,
++                        const rgba& fill, const rgba& /* outline */,
++                        const SWFMatrix& mat, bool /* masked */)
+ {
+     GNASH_REPORT_FUNCTION;
+     VGubyte     gseg[MAX_SEG];
+     VGfloat     gdata[MAX_SEG*3*2];
+     int         scount = 0;
+     int         dcount = 0;
+ 
 -    if (corner_count < 1) {
++    if (corners.empty()) {
+         return;
+     }
+     
 -    unsigned int i;
 -    
+     eglScopeMatrix scope_mat(mat);
+     
+     VGfloat color[] = {
+         fill.m_r / 255.0f,
+         fill.m_g / 255.0f,
+         fill.m_b / 255.0f,
+         fill.m_a / 255.0f
+     };
+     VGPath      vg_path;
+     vg_path = vgCreatePath (VG_PATH_FORMAT_STANDARD,
+                             VG_PATH_DATATYPE_F,
+                             1, 0, 0, 0,
+                             VG_PATH_CAPABILITY_ALL);
+     vgSetf (VG_FILL_RULE, VG_NON_ZERO );
+     
+     vgSetParameteri (_fillpaint, VG_PAINT_TYPE, VG_PAINT_TYPE_COLOR);
+     vgSetParameterfv (_fillpaint, VG_PAINT_COLOR, 4, color);
+     
 -    const point *ptr = corners;
++    const point *ptr = &corners.front();
+     gseg[scount++] = VG_MOVE_TO;
+     gdata[dcount++] = (float)ptr->x;
+     gdata[dcount++] = (float)ptr->y;
+     ptr++;
+     
 -    for (i = 1; i < corner_count; i++) {
++    for (size_t i = 1; i < corners.size(); i++) {
+         gseg[scount++] = VG_LINE_TO;
+         gdata[dcount++] = (float)ptr->x;
+         gdata[dcount++] = (float)ptr->y;
+         ptr++;
+         if (scount >= MAX_SEG-2) {
+             vgAppendPathData(vg_path, scount, gseg, gdata);
+             scount = 0;
+             dcount = 0;
+         }
+     }
+     gseg[scount++] = VG_CLOSE_PATH;
+     vgAppendPathData (vg_path, scount, gseg, gdata);
+     
+     vgDrawPath (vg_path, VG_FILL_PATH);
+     vgDestroyPath(vg_path);
+ }
+ 
+ void
+ Renderer_ovg::set_antialiased(bool /* enable */)
+ {
+     log_unimpl("set_antialiased");
+ }
+ 
+ void
+ Renderer_ovg::begin_submit_mask()
+ {
+     GNASH_REPORT_FUNCTION;
+ 
+     PathVec mask;
+     _masks.push_back(mask);
+     _drawing_mask = true;
+ }
+ 
+ void
+ Renderer_ovg::end_submit_mask()
+ {
+     GNASH_REPORT_FUNCTION;
+ 
+     // If masking is disabled, rhen we can't use it
+     if (_drawing_mask == true) {
+         _drawing_mask = false;    
+         apply_mask();
+     }
+ }
+ 
+ /// Apply the current mask; nesting is supported.
+ ///
+ /// This method marks the stencil buffer by incrementing every stencil pixel
+ /// by one every time a solid from one of the current masks is drawn. When
+ /// all the mask solids are drawn, we change the stencil operation to permit
+ /// only drawing where all masks have drawn, in other words, where all masks
+ /// intersect, or in even other words, where the stencil pixel buffer equals
+ /// the number of masks.
+ void
+ Renderer_ovg::apply_mask()
+ {  
+     GNASH_REPORT_FUNCTION;
+     if (_masks.empty()) {
+         return;
+     }
+     
+     float mat[9];
+     float omat[9];
+     
+     vgSeti (VG_MATRIX_MODE, VG_MATRIX_PATH_USER_TO_SURFACE);
+     vgLoadIdentity();
+     vgGetMatrix (omat);         // get the current matrix
+     
+     memset(mat, 0, sizeof(mat));
+     mat[0] =  stage_matrix.get_x_scale(); // scale sx
+     mat[1] =  0.0f; // shx
+     mat[3] =  0.0f; // shy
+     mat[4] =  -stage_matrix.get_x_scale(); // scale sy
+     mat[6] =  0;    // shift tx
+     mat[7] =  _display_height;   // shift ty
+     vgLoadMatrix(mat);
+     Renderer_ovg::printVGMatrix(mat);
+     
+ #ifdef OPENVG_VERSION_1_1
+     vgMask(_mask_layer, VG_FILL_MASK, 0, 0, _display_width, _display_height);
+ #endif
+ // Call add_paths for each mask.
+     std::for_each(_masks.begin(), _masks.end(),
+                   boost::bind(&Renderer_ovg::add_paths, this, _1));
+     vgSeti(VG_MASKING, VG_TRUE);
+     
+     vgLoadMatrix (omat);        // restore the current matrix
+ }
+ 
+ void
+ Renderer_ovg::disable_mask()
+ {
+     GNASH_REPORT_FUNCTION;
+     
+     // if (vgGeti(VG_MASKING) == VG_TRUE) {
+         _masks.pop_back();
+         
+         if (_masks.empty()) {
+             vgSeti (VG_MASKING, VG_FALSE);
+         } else {
+             apply_mask();
+         }
+     // }
+ }
+ 
+ void
+ Renderer_ovg::add_paths(const PathVec& path_vec)
+ {
+     GNASH_REPORT_FUNCTION;
+ 
+     SWFCxForm dummy_cx;
+     
+     FillStyle coloring = FillStyle(SolidFill(rgba(0, 255, 0, 255)));
+ 
+     draw_submask(path_vec, SWFMatrix(), dummy_cx, coloring);
+ }
+ 
+ Path
+ Renderer_ovg::reverse_path(const Path& cur_path)
+ {
+     // GNASH_REPORT_FUNCTION;
+ 
+     const Edge& cur_end = cur_path.m_edges.back();    
+     
+     float prev_cx = cur_end.cp.x;
+     float prev_cy = cur_end.cp.y;        
+     
+     Path newpath(cur_end.ap.x, cur_end.ap.y, cur_path.m_fill1, 
cur_path.m_fill0, cur_path.m_line, cur_path.m_new_shape);
+     
+     float prev_ax = cur_end.ap.x;
+     float prev_ay = cur_end.ap.y; 
+     
+     for (std::vector<Edge>::const_reverse_iterator it = 
cur_path.m_edges.rbegin()+1, end = cur_path.m_edges.rend(); it != end; ++it) {
+         const Edge& cur_edge = *it;
+         
+         if (prev_ax == prev_cx && prev_ay == prev_cy) {
+             prev_cx = cur_edge.ap.x;
+             prev_cy = cur_edge.ap.y;      
+         }
+         
+         Edge newedge(prev_cx, prev_cy, cur_edge.ap.x, cur_edge.ap.y); 
+         
+         newpath.m_edges.push_back(newedge);
+         
+         prev_cx = cur_edge.cp.x;
+         prev_cy = cur_edge.cp.y;
+         prev_ax = cur_edge.ap.x;
+         prev_ay = cur_edge.ap.y;
+         
+     }
+     
+     Edge newlastedge(prev_cx, prev_cy, cur_path.ap.x, cur_path.ap.y);    
+     newpath.m_edges.push_back(newlastedge);
+     
+     return newpath;
+ }
+ 
+ const Path *
+ Renderer_ovg::find_connecting_path(const Path& to_connect,
+                                    std::list<const Path*> path_refs)
+ {        
+     // GNASH_REPORT_FUNCTION;
+ 
+     float target_x = to_connect.m_edges.back().ap.x;
+     float target_y = to_connect.m_edges.back().ap.y;
+     
+     if (target_x == to_connect.ap.x &&
+         target_y == to_connect.ap.y) {
+         return NULL;
+     }
+     
+     for (std::list<const Path*>::const_iterator it = path_refs.begin(),
+              end = path_refs.end(); it != end; ++it) {
+         const Path* cur_path = *it;
+         
+         if (cur_path == &to_connect) {
+             continue;
+         }
+         
+         if (cur_path->ap.x == target_x && cur_path->ap.y == target_y) {
+             if (cur_path->m_fill1 != to_connect.m_fill1) {
+                 continue;
+             }
+             return cur_path;
+         }
+     }    
+     
+     return NULL;  
+ }
+ 
+ PathVec
+ Renderer_ovg::normalize_paths(const PathVec &paths)
+ {
+     // GNASH_REPORT_FUNCTION;
+ 
+     PathVec normalized;
+     
+     for (PathVec::const_iterator it = paths.begin(), end = paths.end();
+          it != end; ++it) {
+         const Path& cur_path = *it;
+         
+         if (cur_path.m_edges.empty()) {
+             continue;
+             
+         } else if (cur_path.m_fill0 && cur_path.m_fill1) {     
+             
+             // Two fill styles; duplicate and then reverse the left-filled 
one.
+             normalized.push_back(cur_path);
+             normalized.back().m_fill0 = 0; 
+             
+             Path newpath = reverse_path(cur_path);
+             newpath.m_fill0 = 0;        
+             
+             normalized.push_back(newpath);       
+             
+         } else if (cur_path.m_fill0) {
+             // Left fill style.
+             Path newpath = reverse_path(cur_path);
+             newpath.m_fill0 = 0;
+             
+             normalized.push_back(newpath);
+         } else if (cur_path.m_fill1) {
+             // Right fill style.
+             normalized.push_back(cur_path);
+         } else {
+             // No fill styles; copy without modifying.
+             normalized.push_back(cur_path);
+         }
+         
+     }
+     
+     return normalized;
+ }
+ 
+ 
+ /// Analyzes a set of paths to detect real presence of fills and/or outlines
+ /// TODO: This should be something the character tells us and should be 
+ /// cached. 
+ void
+ Renderer_ovg::analyze_paths(const PathVec &paths, bool& have_shape,
+                             bool& have_outline) 
+ {
+     // GNASH_REPORT_FUNCTION;
+ 
+     have_shape = false;
+     have_outline = false;
+     
+     int pcount = paths.size();
+     
+     for (int pno= 0; pno<pcount; pno++) {
+         
+         const Path &the_path = paths[pno];
+         
+         // If a left or right fill is set, then this is an outline
+         if ((the_path.m_fill0 > 0) || (the_path.m_fill1 > 0)) {
+             have_shape = true;
+             if (have_outline) return; // have both
+         }
+         
+         // If a line is set, then it's a shape. A path can be both
+         if (the_path.m_line > 0) {
+             have_outline = true;
+             if (have_shape) return; // have both
+         }
+     }    
+ }
+ 
+ void
+ Renderer_ovg::apply_fill_style(const FillStyle& style, const SWFMatrix& mat,
+                                const SWFCxForm& cx)
+ {
+     // GNASH_REPORT_FUNCTION;
+ 
+     // Renderer_ovg::printVGMatrix(mat);
+     
+     SWF::FillType fill_type = boost::apply_visitor(GetType(), style.fill);
+     SWFMatrix sm = boost::apply_visitor(GetMatrix(), style.fill);
+     rgba incolor = boost::apply_visitor(GetColor(), style.fill);
+     switch (fill_type) {
+         
+       case SWF::FILL_LINEAR_GRADIENT:
+       case SWF::FILL_RADIAL_GRADIENT:
+       case SWF::FILL_FOCAL_GRADIENT:
+       {
+           // This is handled elsewhere, as it's now hardware supported.
+           log_error("Fill Style Type: Gradient, you shouldn't be here!");
+           break;
+       }
+       // FIXME: Bitmap cacheing needs to be improved. Currently the GnashInage
+       // is cached, but the VG image is not. This forces the VG Image to be
+       // recalculated all the time from the GnashImage. Ideally the VG Image
+       // should be cached instead by the Renderer.
+       case SWF::FILL_TILED_BITMAP_HARD:
+       case SWF::FILL_TILED_BITMAP:
+       {
+           log_debug("Fill Style Type: Tiled Bitmap");
+           CachedBitmap *cb = boost::apply_visitor(GetBitmap(), style.fill);
+           // Convert the GnashImage to a VG Image
+           OpenVGBitmap *binfo = new OpenVGBitmap(cb, _fillpaint);
+           // Adjust the X scale by the aspect ratio or images get squished
 -          sm.sx = sm.sx * _aspect_ratio;
++          //sm.a() = sm.a() * _aspect_ratio;
++          SWFMatrix nsm(sm.a() * _aspect_ratio, sm.b(), sm.c(), sm.d(), 
sm.tx(), sm.ty());
+           // Apply the transformation and paint
 -          binfo->applyPatternBitmap(sm, OpenVGBitmap::WRAP_FILL, _fillpaint);
++          binfo->applyPatternBitmap(nsm, OpenVGBitmap::WRAP_FILL, _fillpaint);
+           break;
+       }
+       
+       case SWF::FILL_CLIPPED_BITMAP:
+       case SWF::FILL_CLIPPED_BITMAP_HARD:
+       {     
+           log_debug("Fill Style Type: Clipped Bitmap");
+           CachedBitmap *cb = boost::apply_visitor(GetBitmap(), style.fill);   
       
+           // Convert the GnashImage to a VG Image
+           OpenVGBitmap *binfo = new OpenVGBitmap(cb, _fillpaint);
+           // Adjust the X scale by the aspect ratio or images get squished
 -          sm.sx = sm.sx * _aspect_ratio;
++          // sm.a() = sm.a() * _aspect_ratio;
++          SWFMatrix nsm(sm.a() * _aspect_ratio, sm.b(), sm.c(), sm.d(), 
sm.tx(), sm.ty());
+           // Apply the transformation and paint
 -          binfo->applyPatternBitmap(sm, OpenVGBitmap::WRAP_FILL, _fillpaint);
++          binfo->applyPatternBitmap(nsm, OpenVGBitmap::WRAP_FILL, _fillpaint);
+           break;
+       } 
+       case SWF::FILL_SOLID:
+       {
+ //          log_debug("Fill Style Type: Solid");
+           rgba incolor = boost::apply_visitor(GetColor(), style.fill);
+           rgba c = cx.transform(incolor);
+           VGfloat color[] = {
+               c.m_r / 255.0f,
+               c.m_g / 255.0f,
+               c.m_b / 255.0f,
+               c.m_a / 255.0f
+           };
+ 
+           vgSetParameteri (_fillpaint, VG_PAINT_TYPE, VG_PAINT_TYPE_COLOR);
+           vgSetParameterfv (_fillpaint, VG_PAINT_COLOR, 4, color);
+       }
+       
+     } // switch fill_type
+ }
+ 
+ bool
+ Renderer_ovg::apply_line_style(const LineStyle& style, const SWFCxForm& cx, 
+                                const SWFMatrix& mat)
+ {
+     // GNASH_REPORT_FUNCTION;
+     
+     bool rv = true;
+     
+     switch(style.joinStyle()) {
+       case JOIN_ROUND:
+           vgSetf (VG_STROKE_JOIN_STYLE, VG_JOIN_ROUND);
+           break;
+       case JOIN_BEVEL:
+           vgSetf (VG_STROKE_JOIN_STYLE, VG_JOIN_BEVEL);
+           break;
+       case JOIN_MITER:
+           vgSetf (VG_STROKE_JOIN_STYLE, VG_JOIN_MITER);
+           break;
+       default:
+           log_unimpl("join style");
+     }
+     
+     switch(style.startCapStyle()) {
+       case CAP_ROUND:
+           vgSetf (VG_STROKE_CAP_STYLE, VG_CAP_ROUND);
+           break;
+       case CAP_NONE:
+           vgSetf (VG_STROKE_CAP_STYLE, VG_CAP_BUTT);
+           break;
+       case CAP_SQUARE:
+           vgSetf (VG_STROKE_CAP_STYLE, VG_CAP_SQUARE);
+           break;
+       default:
+           log_unimpl("cap style");
+     }
+     
+     vgSetf (VG_STROKE_MITER_LIMIT, style.miterLimitFactor());
+     
+     float width = style.getThickness();
+     
+     if (!width) {
+         vgSetf(VG_STROKE_LINE_WIDTH, 20.0f);
+         rv = false; // Don't draw rounded lines.
+     } else if ( (!style.scaleThicknessVertically()) && 
(!style.scaleThicknessHorizontally()) ) {
+         vgSetf(VG_STROKE_LINE_WIDTH, width);
+     } else {
+         if ( (!style.scaleThicknessVertically()) || 
(!style.scaleThicknessHorizontally()) ) {
+             LOG_ONCE( log_unimpl(_("Unidirectionally scaled strokes in OGL 
renderer")) );
+         }
+         
+         float stroke_scale = fabsf(mat.get_x_scale()) + 
fabsf(mat.get_y_scale());
+         stroke_scale /= 2.0f;
+         stroke_scale *= (stage_matrix.get_x_scale() + 
stage_matrix.get_y_scale()) / 2.0f;
+         width *= stroke_scale;
+         
+         if (width < 20.0f) {
+             width = 20.0f;
+         }
+         
+         vgSetf(VG_STROKE_LINE_WIDTH, width);
+     }
+     
+     rgba c = cx.transform(style.get_color());
+     VGfloat color[] = {
+         c.m_r / 255.0f,
+         c.m_g / 255.0f,
+         c.m_b / 255.0f,
+         c.m_a / 255.0f
+     };
+     
+     
+     vgSetParameteri (_strokepaint, VG_PAINT_TYPE, VG_PAINT_TYPE_COLOR);
+     vgSetParameterfv (_strokepaint, VG_PAINT_COLOR, 4, color);
+     
+     return rv;
+ }
+ 
+ typedef std::vector<const Path*> PathPtrVec;
+   
+ void
+ Renderer_ovg::draw_outlines(const PathVec& path_vec, const SWFMatrix& mat,
+                             const SWFCxForm& cx, const 
std::vector<LineStyle>& line_styles)
+ {
+     // GNASH_REPORT_FUNCTION;
+ 
+     for (PathVec::const_iterator it = path_vec.begin(), end = path_vec.end();
+          it != end; ++it) {
+         
+         const Path& cur_path = *it;
+         
+         if (!cur_path.m_line) {
+             continue;
+         }
+         
+         VGPath      vpath;
+         vpath = vgCreatePath (VG_PATH_FORMAT_STANDARD,
+                               VG_PATH_DATATYPE_F,
+                               1, 0, 0, 0,
+                               VG_PATH_CAPABILITY_ALL);
+         vgSetf (VG_FILL_RULE, VG_EVEN_ODD );
+         startpath(vpath, cur_path.ap.x, cur_path.ap.y);
+         preparepath(vpath, cur_path.m_edges, cur_path.ap.x,
+                     cur_path.ap.y);
+         
+         apply_line_style(line_styles[cur_path.m_line-1], cx, mat);
+         vgDrawPath (vpath, VG_STROKE_PATH);
+         vgDestroyPath(vpath);
+     }
+ }
+ 
+ std::list<PathPtrVec>
+ Renderer_ovg::get_contours(const PathPtrVec &paths)
+ {
+     // GNASH_REPORT_FUNCTION;
+ 
+     std::list<const Path*> path_refs;
+     std::list<PathPtrVec> contours;
+     
+     for (PathPtrVec::const_iterator it = paths.begin(), end = paths.end();
+          it != end; ++it) {
+         const Path* cur_path = *it;
+         path_refs.push_back(cur_path);
+     }
+     
+     for (std::list<const Path*>::const_iterator it = path_refs.begin(), end = 
path_refs.end();
+          it != end; ++it) {
+         const Path* cur_path = *it;
+         
+         if (cur_path->m_edges.empty()) {
+             continue;
+         }
+         
+         if (!cur_path->m_fill0 && !cur_path->m_fill1) {
+             continue;
+         }
+         
+         PathPtrVec contour;
+         
+         contour.push_back(cur_path);
+         
+         const Path* connector = find_connecting_path(*cur_path, path_refs);
+         
+         while (connector) {       
+             contour.push_back(connector);
+             
+             const Path* tmp = connector;
+             connector = find_connecting_path(*connector, std::list<const 
Path*>(boost::next(it), end));
+             
+             // make sure we don't iterate over the connecting path in the for 
loop.
+             path_refs.remove(tmp);
+             
+         } 
+         
+         contours.push_back(contour);   
+     }
+     
+     return contours;
+ }
+ 
+ void
+ Renderer_ovg::draw_mask(const PathVec& path_vec)
+ { 
+     GNASH_REPORT_FUNCTION;
+    
+     if (_drawing_mask == true) {
+         for (PathVec::const_iterator it = path_vec.begin(), end = 
path_vec.end();
+              it != end; ++it) {
+             const Path& cur_path = *it;
+             
+             if (cur_path.m_fill0 || cur_path.m_fill1) {
+                 _masks.back().push_back(cur_path);
+                 _masks.back().back().m_line = 0;    
+             }
+         }  
+     }
+ }
+ 
+ PathPtrVec
+ Renderer_ovg::paths_by_style(const PathVec& path_vec, unsigned int style)
+ {
+     // GNASH_REPORT_FUNCTION;
+ 
+     PathPtrVec paths;
+     for (PathVec::const_iterator it = path_vec.begin(), end = path_vec.end();
+          it != end; ++it) {
+         const Path& cur_path = *it;
+         
+         if (cur_path.m_fill0 == style) {
+             paths.push_back(&cur_path);
+         }
+         
+         if (cur_path.m_fill1 == style) {
+             paths.push_back(&cur_path);
+         }
+         
+     }
+     return paths;
+ }
+ 
+ 
+ std::vector<PathVec::const_iterator>
+ Renderer_ovg::find_subshapes(const PathVec& path_vec)
+ {
+     // GNASH_REPORT_FUNCTION;
+ 
+     std::vector<PathVec::const_iterator> subshapes;
+     
+     PathVec::const_iterator it = path_vec.begin(),
+         end = path_vec.end();
+     
+     subshapes.push_back(it);
+     ++it;
+     
+     for (;it != end; ++it) {
+         const Path& cur_path = *it;
+         
+         if (cur_path.m_new_shape) {
+             subshapes.push_back(it); 
+         } 
+     }
+     
+     if (subshapes.back() != end) {
+         subshapes.push_back(end);
+     }
+     
+     return subshapes;
+ }
+ 
+ /// Takes a path and translates it using the given SWFMatrix.
+ void
+ Renderer_ovg::apply_matrix_to_paths(std::vector<Path>& paths, const 
SWFMatrix& mat)
+ {  
+     GNASH_REPORT_FUNCTION;
+ 
+     std::for_each(paths.begin(), paths.end(),
+                   boost::bind(&Path::transform, _1, boost::ref(mat)));
+ }  
+ 
+ void
+ Renderer_ovg::draw_subshape(const PathVec& path_vec,
+                             const SWFMatrix& mat,
+                             const SWFCxForm& cx,
+                             const std::vector<FillStyle>& fill_styles,
+                             const std::vector<LineStyle>& line_styles)
+ {
+     // GNASH_REPORT_FUNCTION;
+ 
+     PathVec normalized = normalize_paths(path_vec);
+     
+     for (size_t i = 0; i < fill_styles.size(); ++i) {
+         PathPtrVec paths = paths_by_style(normalized, i+1);
+         
+         if (!paths.size()) {
+             continue;
+         }
+         
+         SWF::FillType fill_type = boost::apply_visitor(GetType(), 
fill_styles[i].fill);
+         if ((fill_type != SWF::FILL_LINEAR_GRADIENT)
+             && (fill_type != SWF::FILL_RADIAL_GRADIENT)) {
+             apply_fill_style(fill_styles[i], mat, cx);
+         }
+ 
+         std::list<PathPtrVec> contours = get_contours(paths);
+         
+         VGPath      vg_path;
+         vg_path = vgCreatePath (VG_PATH_FORMAT_STANDARD,
+                                 VG_PATH_DATATYPE_F,
+                                 1, 0, 0, 0,
+                                 VG_PATH_CAPABILITY_ALL);              
+         vgSetf (VG_FILL_RULE, VG_EVEN_ODD );                                  
+         
+         for (std::list<PathPtrVec>::const_iterator iter = contours.begin(),
+                  final = contours.end(); iter != final; ++iter) {
+             const PathPtrVec& refs = *iter;
+             
+             startpath(vg_path, (*(refs[0])).ap.x, (*(refs[0])).ap.y);
+             if (fill_type == SWF::FILL_LINEAR_GRADIENT) {
+                 rgba incolor = boost::apply_visitor(GetColor(), 
fill_styles[i].fill);
+                 OpenVGBitmap* binfo = new OpenVGBitmap(_fillpaint);
+                 // All positions are specified in twips, which are 20 to the
+                 // pixel. Use th display size for the extent of the shape, 
+                 // as it'll get clipped by OpenVG at the end of the
+                 // shape that is being filled with the gradient.
+                 const std::vector<gnash::GradientRecord> &records =
+                     boost::apply_visitor(GetGradientRecords(), 
fill_styles[i].fill);
+                 // log_debug("Fill Style Type: Linear Gradient, %d records", 
records.size());
+                 binfo->createLinearBitmap((*(refs[0])).ap.x, 
(*(refs[0])).ap.y,
+                                           _display_width * 20.0f, 
(_display_height * 20.0f)/2,
+                                           incolor, records, cx, _fillpaint);
+             }
+             if (fill_type == SWF::FILL_RADIAL_GRADIENT) {
+                 rgba incolor = boost::apply_visitor(GetColor(), 
fill_styles[i].fill);
+                 double focalpt = boost::apply_visitor(GetFocalPoint(), 
fill_styles[i].fill);
+                 const std::vector<gnash::GradientRecord> &records =
+                     boost::apply_visitor(GetGradientRecords(), 
fill_styles[i].fill);
+                 log_debug("Fill Style Type: Radial Gradient: focal is: %d, 
%d:%d",
+                           focalpt, (*(refs[0])).ap.x, (*(refs[0])).ap.y);
+                 OpenVGBitmap* binfo = new OpenVGBitmap(_fillpaint);
+                 // All positions are specified in twips, which are 20 to the
+                 // pixel. Use the display size for the extent of the shape, 
+                 // as it'll get clipped by OpenVG at the end of the
+                 // shape that is being filled with the gradient.
+                 binfo->createRadialBitmap((*(refs[0])).ap.x, 
(*(refs[0])).ap.y,
+                                           (*(refs[0])).ap.x+1000, 
(*(refs[0])).ap.y+1000, focalpt,
+                                           incolor, records, cx, _fillpaint);
+             }
+             for (PathPtrVec::const_iterator it = refs.begin(), end = 
refs.end();
+                  it != end; ++it) {
+                 const Path& cur_path = *(*it);
+                 if (!cur_path.m_fill0 && !cur_path.m_fill1)
+                     continue;
+                 preparepath(vg_path, cur_path.m_edges, cur_path.ap.x,
+                             cur_path.ap.y);
+             }
+             closepath(vg_path);
+         }
+         vgDrawPath (vg_path, VG_FILL_PATH);
+         vgDestroyPath(vg_path);
+     }
+     
+     draw_outlines(normalized, mat, cx, line_styles);
+ }
+ 
+ void
+ Renderer_ovg::draw_submask(const PathVec& path_vec,
+                            const SWFMatrix& /* mat */,
+                            const SWFCxForm& /* cx */,
+                             const FillStyle& /* f_style */)
+ {
+     GNASH_REPORT_FUNCTION;
+     
+     PathVec normalized = normalize_paths(path_vec);
+     
+     PathPtrVec paths = paths_by_style(normalized, 1);
+     
+     std::list<PathPtrVec> contours = get_contours(paths);
+     
+     VGfloat color[] = {1.0f, 1.0f, 1.0f, 1.0f};
+     
+     vgSetParameteri (_fillpaint, VG_PAINT_TYPE, VG_PAINT_TYPE_COLOR);
+     vgSetParameterfv (_fillpaint, VG_PAINT_COLOR, 4, color);
+     
+     
+     VGPath      vg_path;
+     vg_path = vgCreatePath (VG_PATH_FORMAT_STANDARD,
+                             VG_PATH_DATATYPE_F,
+                             1, 0, 0, 0,
+                             VG_PATH_CAPABILITY_ALL);
+     vgSetf (VG_FILL_RULE, VG_EVEN_ODD );
+     
+     for (std::list<PathPtrVec>::const_iterator iter = contours.begin(),
+              final = contours.end(); iter != final; ++iter) {
+         const PathPtrVec& refs = *iter;
+         startpath(vg_path, (*(refs[0])).ap.x, (*(refs[0])).ap.y);
+         for (PathPtrVec::const_iterator it = refs.begin(), end = refs.end();
+              it != end; ++it) {
+             const Path& cur_path = *(*it);
+             preparepath(vg_path, cur_path.m_edges, cur_path.ap.x,
+                         cur_path.ap.y);
+         }
+         closepath(vg_path);
+     }
+     
+ #ifdef OPENVG_VERSION_1_1
+     vgRenderToMask(vg_path, VG_FILL_PATH, VG_INTERSECT_MASK);
+ #endif
+     vgDestroyPath(vg_path);
+ }
+ 
+ // Drawing procedure:
+ // 1. Separate paths by subshape.
+ // 2. Separate subshapes by fill style.
+ // 3. For every subshape/fill style combo:
+ //  a. Separate contours: find closed shapes by connecting ends.
+ //  b. Apply fill style.
+ //  c. Feed the contours in the tesselator. (Render.)
+ //  d. Draw outlines for every path in the subshape with a line style.
+ void
+ Renderer_ovg::drawShape(gnash::SWF::ShapeRecord const &shape, 
+                         gnash::Transform const& xform)
+ {
+     // GNASH_REPORT_FUNCTION;
+ 
+     const PathVec& path_vec = shape.paths();
+     
+     if (!path_vec.size()) {
+         // No paths. Nothing to draw...
+         return;
+     }
+     if (_drawing_mask) {
+         PathVec scaled_path_vec = path_vec;
+         apply_matrix_to_paths(scaled_path_vec, xform.matrix);
+         draw_mask(scaled_path_vec); 
+         return;
+     }    
+     
+     bool have_shape, have_outline;
+     
+     analyze_paths(path_vec, have_shape, have_outline);
+     
+     if (!have_shape && !have_outline) {
+         return;
+     }    
+     
+     eglScopeMatrix scope_mat(xform.matrix);
+     
+     std::vector<PathVec::const_iterator> subshapes = find_subshapes(path_vec);
+     
+     const std::vector<FillStyle>& fill_styles = shape.fillStyles();
+     const std::vector<LineStyle>& line_styles = shape.lineStyles();
+     
+     for (size_t i = 0; i < subshapes.size()-1; ++i) {
+         PathVec subshape_paths;
+         
+         if (subshapes[i] != subshapes[i+1]) {
+             subshape_paths = PathVec(subshapes[i], subshapes[i+1]);
+         } else {
+             subshape_paths.push_back(*subshapes[i]);
+         }
+         
+         draw_subshape(subshape_paths, xform.matrix, xform.colorTransform,
+                       fill_styles, line_styles);
+     }
+ }
+ 
+ void
+ Renderer_ovg::drawGlyph(const SWF::ShapeRecord& rec, const rgba& c,
+                         const SWFMatrix& mat)
+ {
+     // GNASH_REPORT_FUNCTION;
+ 
+     if (_drawing_mask) {
+         abort();
+     }
+     
+     if (rec.getBounds().is_null()) {
+         return;
+     }
+     
+     SWFCxForm dummy_cx;
+     std::vector<FillStyle> glyph_fs;
+     
+     FillStyle coloring = FillStyle(SolidFill(c));
+ 
+     glyph_fs.push_back(coloring);
+ 
+     std::vector<LineStyle> dummy_ls;
+     
+     eglScopeMatrix scope_mat(mat);
+     
+     draw_subshape(rec.paths(), mat, dummy_cx, glyph_fs, dummy_ls);
+     
+ }
+ 
+ void
+ Renderer_ovg::set_scale(float xscale, float yscale)
+ {
+     GNASH_REPORT_FUNCTION;
+ 
+     _xscale = xscale;
+     _yscale = yscale;
+     stage_matrix.set_identity();
+     stage_matrix.set_scale(xscale/20.0f, yscale/20.0f);
+ }
+ 
+ void
+ Renderer_ovg::set_invalidated_regions(const InvalidatedRanges& /* ranges */)
+ {
+     GNASH_REPORT_FUNCTION;
+ 
+     // do nothing obviously. This method is required by the base class though,
+     // so something has to be here.
+ }
+   
+ DSOEXPORT Renderer *
+ create_handler(const char */* pixelformat */)
+ {
+     // GNASH_REPORT_FUNCTION;
+ 
+     Renderer_ovg *renderer = new Renderer_ovg;
+     return renderer;
+ }
+ 
+ 
+ // These methods are only for debugging and development
+ void
+ Renderer_ovg::printVGParams()
+ {
+     // vgGetVectorSize();
+ 
+     std::string str;
+     switch(vgGeti(VG_MATRIX_MODE)) {
+       case VG_MATRIX_PATH_USER_TO_SURFACE:
+           str = "VG_MATRIX_PATH_USER_TO_SURFACE";
+           break;
+       case VG_MATRIX_IMAGE_USER_TO_SURFACE:
+           str = "VG_MATRIX_IMAGE_USER_TO_SURFACE";
+           break;
+       case VG_MATRIX_FILL_PAINT_TO_USER:
+           str = "VG_MATRIX_FILL_PAINT_TO_USER";
+           break;
+       case VG_MATRIX_STROKE_PAINT_TO_USER:
+           str = "VG_MATRIX_STROKE_PAINT_TO_USER";
+           break;
+ #ifdef VG_MATRIX_MODE_FORCE_SIZE
+       case VG_MATRIX_MODE_FORCE_SIZE:
+           str = "VG_MATRIX_MODE_FORCE_SIZE";
+           break;
+ #endif
+       default:
+           log_error("unsupported VG_MATRIX_MODE!");
+     }
+     log_debug("VG_MATRIX_MODE is %s", str);
+     str.clear();
+ 
+     switch(vgGeti(VG_FILL_RULE)) {
+       case VG_EVEN_ODD:
+           str = "VG_EVEN_ODD";
+           break;
+       case VG_NON_ZERO:
+           str = "VG_NON_ZERO";
+           break;
+       default:
+           log_error("unsupported VG_FILL_RULE!");          
+     }
+     log_debug("VG_FILL_RULE is %s", str);
+     str.clear();
+ 
+     switch(vgGeti(VG_IMAGE_QUALITY)) {
+       case VG_IMAGE_QUALITY_NONANTIALIASED:
+           str = "VG_IMAGE_QUALITY_NONANTIALIASED";
+           break;
+       case VG_IMAGE_QUALITY_FASTER:
+           str = "VG_IMAGE_QUALITY_FASTER";
+           break;
+       case VG_IMAGE_QUALITY_BETTER:
+           str = "VG_IMAGE_QUALITY_BETTER";
+           break;
+ #ifdef VG_MATRIX_MODE_FORCE_SIZE
+       case VG_IMAGE_QUALITY_FORCE_SIZE:
+           str = "VG_IMAGE_QUALITY_FORCE_SIZE";
+           break;
+ #endif
+       default:
+           log_error("unsupported VG_IMAGE_QUALITY!");
+     }
+     log_debug("VG_IMAGE_QUALITY is %s", str);
+     str.clear();
+     
+     switch(vgGeti(VG_RENDERING_QUALITY)) {
+       case VG_RENDERING_QUALITY_NONANTIALIASED:
+           str = "VG_RENDERING_QUALITY_NONANTIALIASED";
+           break;
+       case VG_RENDERING_QUALITY_FASTER:
+           str = "VG_RENDERING_QUALITY_FASTER";
+           break;
+       case VG_RENDERING_QUALITY_BETTER:
+           str = "VG_RENDERING_QUALITY_BETTER";
+           break;
+ #ifdef VG_MATRIX_MODE_FORCE_SIZE
+       case VG_RENDERING_QUALITY_FORCE_SIZE:
+           str = "VG_RENDERING_QUALITY_FORCE_SIZE";
+           break;
+ #endif
+       default:
+           log_error("unsupported VG_RENDERING_QUALITY!");
+     }
+     log_debug("VG_RENDERING_QUALITY is %s", str);
+     str.clear();
+     
+     switch(vgGeti(VG_BLEND_MODE)) {
+       case VG_BLEND_SRC:
+           str = "VG_BLEND_SRC";
+           break;
+       case VG_BLEND_SRC_OVER:
+           str = "VG_BLEND_SRC_OVER";
+           break;
+       case VG_BLEND_DST_OVER:
+           str = "VG_BLEND_DST_OVER";
+           break;
+       case VG_BLEND_SRC_IN:
+           str = "VG_BLEND_SRC_IN";
+           break;
+       case VG_BLEND_DST_IN:
+           str = "VG_BLEND_DST_IN";
+           break;
+       case VG_BLEND_MULTIPLY: 
+           str = "VG_BLEND_MULTIPLY";
+           break;
+       case VG_BLEND_SCREEN:
+           str = "VG_BLEND_SCREEN";
+           break;
+       case VG_BLEND_DARKEN:
+           str = "VG_BLEND_DARKEN";
+           break;
+       case VG_BLEND_LIGHTEN:
+           str = "VG_BLEND_LIGHTEN";
+           break;
+       case VG_BLEND_ADDITIVE:
+           str = "VG_BLEND_ADDITIVE";
+           break;
+       default:
+           log_error("unsupported VG_BLEND_MODE!");
+     }
+     log_debug("VG_BLEND_MODE is %s", str);    
+     str.clear();
+     
+     switch(vgGeti(VG_IMAGE_MODE)) {
+       case VG_DRAW_IMAGE_NORMAL:
+           str = "VG_DRAW_IMAGE_MULTIPLY";
+           break;
+       case VG_DRAW_IMAGE_MULTIPLY:
+           str = "VG_DRAW_IMAGE_MULTIPLY";
+           break;
+       case VG_DRAW_IMAGE_STENCIL:
+           str = "VG_DRAW_IMAGE_STENCIL";
+           break;
+ #ifdef VG_MATRIX_MODE_FORCE_SIZE
+       case VG_IMAGE_MODE_FORCE_SIZE:
+           str = "VG_IMAGE_MODE_FORCE_SIZE";
+           break;
+ #endif
+       default:
+           log_error("unsupported VG_IMAGE_MODE!");
+     }
+     log_debug("VG_IMAGE_MODE is %s", str);
+     str.clear();
+     
+     log_debug("VG_STROKE_LINE_WIDTH is %d", vgGeti(VG_STROKE_LINE_WIDTH));    
+     str.clear();
+     
+     switch(vgGeti(VG_STROKE_CAP_STYLE)) {
+       case VG_CAP_BUTT:
+           str = "VG_CAP_BUTT";
+           break;
+       case VG_CAP_ROUND:
+           str = "VG_CAP_ROUND";
+           break;
+       case VG_CAP_SQUARE:
+           str = "VG_CAP_SQUARE";
+           break;
+ #ifdef VG_MATRIX_MODE_FORCE_SIZE
+       case VG_CAP_STYLE_FORCE_SIZE:
+           str = "VG_CAP_STYLE_FORCE_SIZE";
+           break;
+ #endif
+       default:
+           log_error("unsupported VG_STROKE_CAP_STYLE!");
+     }
+     log_debug("VG_STROKE_CAP_STYLE is %s", str);
+     str.clear();
+     
+     switch(vgGeti(VG_STROKE_JOIN_STYLE)) {
+       case VG_JOIN_MITER:
+           str = "VG_JOIN_MITER";
+           break;
+       case VG_JOIN_ROUND:
+           str = "VG_JOIN_ROUND";
+           break;
+       case VG_JOIN_BEVEL:
+           str = "VG_JOIN_BEVEL";
+           break;
+ #ifdef VG_MATRIX_MODE_FORCE_SIZE
+       case VG_JOIN_STYLE_FORCE_SIZE:
+           str = "VG_JOIN_STYLE_FORCE_SIZE";
+           break;
+ #endif
+       default:
+           log_error("unsupported VG_STROKE_JOIN_STYLE!");
+     }
+     log_debug("VG_STROKE_JOIN_STYLE is %s", str);
+     str.clear();
+     
+     log_debug("VG_STROKE_MITER_LIMIT is %d", vgGeti(VG_STROKE_MITER_LIMIT));
+     log_debug("VG_MASKING is %d", vgGeti(VG_MASKING));
+     log_debug("VG_SCISSORING is %d", vgGeti(VG_SCISSORING));    
+     str.clear();
+     
+     switch(vgGeti(VG_PIXEL_LAYOUT)) {
+       case VG_PIXEL_LAYOUT_UNKNOWN:
+           str = "VG_PIXEL_LAYOUT_UNKNOWN";
+           break;
+       case VG_PIXEL_LAYOUT_RGB_VERTICAL:
+           str = "VG_PIXEL_LAYOUT_RGB_VERTICAL";
+           break;
+       case VG_PIXEL_LAYOUT_BGR_VERTICAL:
+           str = "VG_PIXEL_LAYOUT_BGR_VERTICAL";
+           break;
+       case VG_PIXEL_LAYOUT_RGB_HORIZONTAL:
+           str = "VG_PIXEL_LAYOUT_RGB_HORIZONTAL";
+           break;
+       case VG_PIXEL_LAYOUT_BGR_HORIZONTAL:
+           str = "VG_PIXEL_LAYOUT_BGR_HORIZONTAL";
+           break;
+ #ifdef VG_MATRIX_MODE_FORCE_SIZE
+       case VG_PIXEL_LAYOUT_FORCE_SIZE:
+           str = "VG_PIXEL_LAYOUT_FORCE_SIZE";
+           break;
+ #endif
+       default:
+           log_error("unsupported VG_PIXEL_LAYOUT!");
+     }
+     log_debug("VG_PIXEL_LAYOUT is %s", str);
+     
+     log_debug("VG_STROKE_DASH_PHASE_RESET is %s",
+               (vgGeti(VG_STROKE_DASH_PHASE_RESET) == true) ? "true" : 
"false");
+     log_debug("VG_FILTER_FORMAT_LINEAR is %s",
+               (vgGeti(VG_FILTER_FORMAT_LINEAR) == true) ? "true" : "false");
+     log_debug("VG_FILTER_FORMAT_PREMULTIPLIED is %s",
+               (vgGeti(VG_FILTER_FORMAT_PREMULTIPLIED) == true) ? "true" : 
"false");
+     str.clear();
+     
+     VGint value = vgGeti(VG_FILTER_CHANNEL_MASK);
+     if (value & VG_RED) {
+         str += " VG_RED";
+     }
+     if (value & VG_GREEN) {
+         str += " VG_GREEN";
+     }
+     if (value & VG_BLUE) {
+         str += " VG_BLUE";
+     }
+     if (value & VG_ALPHA) {
+         str += " VG_ALPHA";
+     }
+     log_debug("VG_FILTER_CHANNEL_MASK is %s", str);
+     
+     log_debug("VG_MAX_IMAGE_WIDTH is %d", vgGeti(VG_MAX_IMAGE_WIDTH));
+     log_debug("VG_MAX_IMAGE_HEIGHT is %d", vgGeti(VG_MAX_IMAGE_HEIGHT));
+     log_debug("VG_MAX_IMAGE_PIXELS is %d", vgGeti(VG_MAX_IMAGE_PIXELS));
+     log_debug("VG_MAX_IMAGE_BYTES is %d", vgGeti(VG_MAX_IMAGE_BYTES));
+ 
+ }
+ 
+ void
+ Renderer_ovg::printVGPath(VGPath path)
+ {
+     log_debug("VG_PATH_FORMAT is %d", vgGetParameteri(path, VG_PATH_FORMAT));
+     log_debug("VG_PATH_DATATYPE is %d", vgGetParameteri(path, 
VG_PATH_DATATYPE));
+     log_debug("VG_PATH_CAPABILITY_APPEND_TO is %d", vgGetParameteri(path, 
VG_PATH_CAPABILITY_APPEND_TO));
+     log_debug("VG_PATH_SCALE is %g", vgGetParameteri(path, VG_PATH_SCALE));
+     log_debug("VG_PATH_BIA is %g", vgGetParameteri(path, VG_PATH_BIAS));
+ 
+     log_debug("VG_PATH_NUM_SEGMENTS is %d", vgGetParameteri(path, 
VG_PATH_NUM_SEGMENTS));
+     log_debug("VG_PATH_NUM_COORDS is %d", vgGetParameteri(path, 
VG_PATH_NUM_COORDS));
+ }
+ 
+ // Print an OpenVG matric, which is 3 x 3. Elements 2 and 5 are
+ // ignored, as they are the w0 and w1 paramaters.
+ // It looks like this: { sx, shy, w0, shx, sy, w1, tx, ty, w2 }
+ void
+ Renderer_ovg::printVGMatrix(VGfloat *mat)
+ {
+     std::cerr << "sx, shx, tx: " << mat[0] << ", " << mat[1]<< ", "  << 
mat[3] << std::endl;
+     std::cerr << "sy, shy, ty: " << mat[4]<< ", " << mat[6] << ", "<< mat[7] 
<< std::endl;
+ }
+ 
+ void
+ Renderer_ovg::printVGMatrix(const SWFMatrix &mat)
+ {
 -    std::cerr << "sx, shx, tx: " << mat.sx << ", " << mat.shx << ", " << 
mat.tx << std::endl;
 -    std::cerr << "sy, shy, ty: " << mat.sy << ", " << mat.shy << ", " << 
mat.ty << std::endl;
++    std::cerr << "a, shx, tx: " << mat.a() << ", " << mat.b() << ", " << 
mat.tx() << std::endl;
++    std::cerr << "sy, shy, ty: " << mat.c() << ", " << mat.d() << ", " << 
mat.ty() << std::endl;
+ }
+ 
+ Renderer *
+ Renderer_ovg::startInternalRender(gnash::image::GnashImage&)
+ {
+     // GNASH_REPORT_FUNCTION;
+ 
+     return 0;
+ }
+ 
+ void
+ Renderer_ovg::endInternalRender()
+ {
+     // GNASH_REPORT_FUNCTION;    
+ }
+ 
+ void
+ Renderer_ovg::drawVideoFrame(gnash::image::GnashImage*, gnash::Transform 
const&, gnash::SWFRect const*, bool)
+ {
+     GNASH_REPORT_FUNCTION;
+ }
+ 
+ unsigned int
+ Renderer_ovg::getBitsPerPixel()
+ {
+     return 0;
+ }
+ 
+ const char *
+ Renderer_ovg::getErrorString(VGErrorCode error)
+ {
+     switch (error) {
+     case VG_NO_ERROR:
+         return "No Error";
+         break;
+     case VG_BAD_HANDLE_ERROR:
+         return "Bad Handle";
+         break;
+     case VG_ILLEGAL_ARGUMENT_ERROR:
+         return "Illegal Argument";
+         break;
+     case VG_OUT_OF_MEMORY_ERROR:
+         return "Our Of Memory";
+         break;
+     case VG_PATH_CAPABILITY_ERROR:
+         return "Path Capability";
+         break;
+     case VG_UNSUPPORTED_IMAGE_FORMAT_ERROR:
+         return "Unsupported Image Format";
+         break;
+     case VG_UNSUPPORTED_PATH_FORMAT_ERROR:
+         return "Unsupported Path Format";
+         break;
+     case VG_IMAGE_IN_USE_ERROR: 
+         return "VG Image In Use";
+        break;
+     case VG_NO_CONTEXT_ERROR:
+         return "No COntext";
+         break;
+ #ifdef VG_ERROR_CODE_FORCE_SIZE
+     case VG_ERROR_CODE_FORCE_SIZE:
+         return "Code Force Size";
+         break;
+ #endif
+     default:
+         return "Unknown error";
+         break;
+     }
+ }
+ 
+ } // namespace gnash::renderer::gles1
+ } // namespace gnash::renderer
+ } // namespace gnash
+ 
+ // local Variables:
+ // mode: C++
+ // indent-tabs-mode: nil
+ // End:
diff --cc librender/openvg/OpenVGRenderer.h
index 0000000,ed9d161..f46bd20
mode 000000,100644..100644
--- a/librender/openvg/OpenVGRenderer.h
+++ b/librender/openvg/OpenVGRenderer.h
@@@ -1,0 -1,216 +1,218 @@@
+ // 
+ //   Copyright (C) 2005, 2006, 2007, 2008, 2009, 2010 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
+ // the Free Software Foundation; either version 3 of the License, or
+ // (at your option) any later version.
+ // 
+ // This program is distributed in the hope that it will be useful,
+ // but WITHOUT ANY WARRANTY; without even the implied warranty of
+ // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ // GNU General Public License for more details.
+ // 
+ // You should have received a copy of the GNU General Public License
+ // along with this program; if not, write to the Free Software
+ // Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301 USA
+ 
+ ///
+ /// Original Author: Visor <address@hidden>.
+ /// Heavily hacked by Rob <address@hidden> to work with Gnash
+ /// git master.
+ ///
+ 
+ #ifndef GNASH_RENDER_HANDLER_OVG_H
+ #define GNASH_RENDER_HANDLER_OVG_H
+ 
+ #include <EGL/egl.h>
+ #include <vector>
++#include <list>
+ #include <boost/scoped_array.hpp>
+ #include <boost/scoped_ptr.hpp>
+ 
+ #include "Geometry.h"
+ #include "Renderer.h"
+ //#include "directfb/DirectFBDevice.h"
+ #include "GnashDevice.h"
+ #include "CachedBitmap.h"
+ #include "FillStyle.h"
+ 
+ #include <VG/vgu.h>
+ #ifdef OPENVG_VERSION_1_1
+ # include <VG/ext.h>
+ #else
+ # include <VG/vgext.h>
+ #endif
+ #include <VG/openvg.h>
+ #include "openvg/OpenVGBitmap.h"
+ #include "egl/eglDevice.h"
+ 
+ namespace gnash {
+ 
+ class SWFCxForm;
+ class GnashImage;
+ 
+ namespace renderer {
+ 
+ namespace openvg {
+ 
+ typedef std::vector<const Path*> PathRefs;
+ typedef std::vector<Path> PathVec;
+ typedef std::vector<geometry::Range2d<int> > ClipBounds;
+ typedef std::vector<const Path*> PathPtrVec;
+ 
+ // typedef std::map<const Path*, VGPath > PathPointMap;
+ 
+ class  DSOEXPORT Renderer_ovg: public Renderer
+ {
+ public:
+     std::string description() const { return "OpenVG"; }
+ 
+     Renderer_ovg();
+     Renderer_ovg(renderer::GnashDevice::dtype_t dtype);
+     
+     ~Renderer_ovg();
+         
+     void init(float x, float y);
+     CachedBitmap *createCachedBitmap(std::auto_ptr<image::GnashImage> im);
+ 
+     void drawVideoFrame(gnash::image::GnashImage*, const gnash::Transform&,
+                         const gnash::SWFRect*, bool);
+ 
+     void world_to_pixel(int& x, int& y, float world_x, float world_y);
 -    gnash::geometry::Range2d<int> world_to_pixel(const gnash::SWFRect& wb);
 -    geometry::Range2d<int> world_to_pixel(const geometry::Range2d<float>& wb);
 -    gnash::point pixel_to_world(int, int);
++    gnash::geometry::Range2d<int> world_to_pixel(const gnash::SWFRect& wb) 
const;
++    gnash::geometry::Range2d<int> world_to_pixel(const 
geometry::Range2d<float>& wb) const;
++    
++    gnash::point pixel_to_world(int, int) const;
+ 
+     // Called by movie_root::display()
+     void begin_display(const gnash::rgba&, int, int, float,
+                        float, float, float);
+     void end_display();
+     void drawLine(const std::vector<point>& coords, const rgba& fill,
+                   const SWFMatrix& mat);
+     void drawVideoFrame(image::GnashImage* frame, const SWFMatrix *m,
+                    const SWFRect* bounds, bool smooth);
 -    void drawPoly(const point* corners, size_t corner_count, 
++    void draw_poly(const std::vector<point>& corners,
+                   const rgba& fill, const rgba& outline,
+                   const SWFMatrix& mat, bool masked);
+     // this is in master
+     void drawShape(const gnash::SWF::ShapeRecord&, const gnash::Transform&);
+     // This is from the patch
+     void drawGlyph(const SWF::ShapeRecord& rec, const rgba& c,
+                    const SWFMatrix& mat);
+ 
+     void set_antialiased(bool enable);
+     void begin_submit_mask();
+     void end_submit_mask();
+     void apply_mask();
+     void disable_mask();
+         
+     void set_scale(float xscale, float yscale);
+     void set_invalidated_regions(const InvalidatedRanges &ranges);
+ 
+     // These weren't in the patch, and do nothing anyway
+     Renderer *startInternalRender(gnash::image::GnashImage&);
+     void endInternalRender();
+ 
+     unsigned int getBitsPerPixel();
+ 
+     void setFillPaint(const VGPaint paint) { _fillpaint = paint; }
+ 
+     // These methods are only for debugging and development
+     void printVGParams();
+     void printVGHardware();
+     static void printVGPath(VGPath path);
+     static void printVGMatrix(VGfloat *mat);
+     static void printVGMatrix(const SWFMatrix &mat);
+ 
+     static const char *getErrorString(VGErrorCode error);
+ 
+     // VGImage (CachedBitmap *x) { return _image_cache[x]; };
+   private:
+     void add_paths(const PathVec& path_vec);
+     Path reverse_path(const Path& cur_path);
+     const Path* find_connecting_path(const Path& to_connect,
+                                      std::list<const Path*> path_refs);
+     PathVec normalize_paths(const PathVec &paths);
+     
+     /// Analyzes a set of paths to detect real presence of fills and/or 
outlines
+     /// TODO: This should be something the character tells us and should be 
+     /// cached. 
+     void analyze_paths(const PathVec &paths, bool& have_shape,
+                        bool& have_outline);
+     void apply_fill_style(const FillStyle& style, const SWFMatrix& /* mat */,
+                           const SWFCxForm& cx);
+     bool apply_line_style(const LineStyle& style, const SWFCxForm& cx,
+                           const SWFMatrix& mat);
+     void draw_outlines(const PathVec& path_vec, const SWFMatrix& mat,
+                        const SWFCxForm& cx, const std::vector<
+                        LineStyle>& line_styles);
+     std::list<PathPtrVec> get_contours(const PathPtrVec &paths);
+     PathPtrVec paths_by_style(const PathVec& path_vec, unsigned int style);
+     std::vector<PathVec::const_iterator> find_subshapes(const PathVec& 
path_vec);
+     void apply_matrix_to_paths(std::vector<Path>& paths, const SWFMatrix& 
mat);
+     
+     void draw_subshape(const PathVec& path_vec, const SWFMatrix& mat,
+                        const SWFCxForm& cx,
+                        const std::vector<FillStyle>& fill_styles,
+                        const std::vector<LineStyle>& line_styles);
+     void draw_mask(const PathVec& path_vec);    
+     void draw_submask(const PathVec& path_vec, const SWFMatrix& mat,
+                       const SWFCxForm& cx, const FillStyle& f_style);
+ 
+     float       _xscale;
+     float       _yscale;
+     float       _width; // Width of the movie, in world coordinates.
+     float       _height;
+   
+     // Output size.
+     float       _display_width;
+     float       _display_height;
+   
+     std::vector<PathVec> _masks;
+     bool        _drawing_mask;
+ #ifdef OPENVG_VERSION_1_1
+     VGMaskLayer _mask_layer;
+ #endif
+     gnash::SWFMatrix stage_matrix;  // conversion from TWIPS to pixels
+     
+     /// this paint object is used for solid, gradient, and pattern fills.
+     VGPaint     _fillpaint;
+ 
+     /// this pain object is used for paths
+     VGPaint     _strokepaint;
+ 
+     /// This stores the Aspect Ratio, which is required to properly
+     /// set the X axis scale. This is usually represented as 4:3 or
+     /// 16:9 for most framebuffers. To get the scale, divide the 2nd
+     /// argument by the first, ie... 4:3 = 3/4 = 0.75.
+     /// The official calculation for the aspect ratio for a monitor of
+     /// 800x480 returns a 5:3 aspect ratio, which for a WVGA LCD
+     /// touchscreen is wrong. The manufacturer specs say it's a 4:3 or
+     /// 16:9, so we use 4:3, which in my testing is correct.
+     double      _aspect_ratio;
+     
+     // FIXME: A cache for the VGImages might make some sense assuming
+     // it takes more time to render the cached GnashImage to a
+     // VGImage. Right now every til a fill style is applied, the
+     // VGImage is rebuilt from the GnashImage. This appears to be
+     // relatively fast, and possibly faster than the lookup in a map
+     // as the size of the cache grows. The other issue would be when
+     // to clear the cache, as we have no knowledge from the VM when
+     // images are deleted, or unused.
+     // std::map<CachedBitmap *, VGImage > _image_cache;
+ };
+ 
+ DSOEXPORT Renderer* create_handler(const char *pixelformat);
+ 
+ } // namespace gnash::renderer::openvg
+ } // namespace gnash::renderer
+ } // namespace gnash
+ 
+ #endif // __RENDER_HANDLER_OVG_H__
+ 
+ // local Variables:
+ // mode: C++
+ // indent-tabs-mode: nil
+ // End:
diff --cc librender/openvg/OpenVGStyle.h
index 0000000,2f662cb..9e2a2f2
mode 000000,100644..100644
--- a/librender/openvg/OpenVGStyle.h
+++ b/librender/openvg/OpenVGStyle.h
@@@ -1,0 -1,186 +1,186 @@@
+ // 
+ //   Copyright (C) 2005, 2006, 2007, 2008, 2009, 2010 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
+ // the Free Software Foundation; either version 3 of the License, or
+ // (at your option) any later version.
+ // 
+ // This program is distributed in the hope that it will be useful,
+ // but WITHOUT ANY WARRANTY; without even the implied warranty of
+ // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ // GNU General Public License for more details.
+ // 
+ // You should have received a copy of the GNU General Public License
+ // along with this program; if not, write to the Free Software
+ // Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301 USA
+ 
+ #ifndef GNASH_OPENVG_STYLE_H
+ #define GNASH_OPENVG_STYLE_H
+ 
+ #include "CachedBitmap.h"
+ #include "GnashImage.h"
+ #include "Renderer.h"
+ 
+ namespace gnash {
+ 
+ class SolidFill;
+ class GradientFill;
+ class BitmapFill;
+ class rgba; 
+  
+ namespace renderer {
+ 
+ namespace openvg {
+ 
+ /// @note These helper functions are used by the boost::variant used
+ /// for fill styles. A variant is a C++ style version of the C union.
+ /// Before accessing any of the data of the variant, we have to use
+ /// boost::apply_visitor() to bind one of these classes to the style
+ /// to extract the data.
+ 
+ /// Get the color of a style from the variant
+ class GetColor : public boost::static_visitor<rgba>
+ {
+ public:
+     rgba operator()(const SolidFill& f) const {
+         return f.color();
+     }
+     rgba operator()(const GradientFill&) const {
+         return rgba();
+     }
+     rgba operator()(const BitmapFill&) const {
+         return rgba();
+     }
+ };
+ 
+ /// Get the fill type. Each fill type has it's own sub types,
+ /// so we map the sub type name to the fill type name.
+ class GetType : public boost::static_visitor<SWF::FillType>
+ {
+ public:
 -    SWF::FillType operator()(const SolidFill& f) const {
++    SWF::FillType operator()(const SolidFill&) const {
+         return SWF::FILL_SOLID;
+     }
+     SWF::FillType operator()(const GradientFill& g) const {
+         switch (g.type()) {
+           case GradientFill::LINEAR:
+               return SWF::FILL_LINEAR_GRADIENT;
+               break;
+           case GradientFill::RADIAL:
+               return SWF::FILL_RADIAL_GRADIENT;
+               break;
+           default:
+               break;              
+         }
+     }
+     SWF::FillType operator()(const BitmapFill& b) const {
+         switch (b.type()) {
+           case BitmapFill::TILED:
+               if (b.smoothingPolicy() == BitmapFill::SMOOTHING_OFF) {
+                   return SWF::FILL_TILED_BITMAP_HARD;
+               } else {
+                   return SWF::FILL_TILED_BITMAP;
+               }
+               break;
+           case BitmapFill::CLIPPED:
+               if (b.smoothingPolicy() == BitmapFill::SMOOTHING_OFF) {
+                   return SWF::FILL_CLIPPED_BITMAP_HARD;
+               } else {
+                   return SWF::FILL_CLIPPED_BITMAP;
+               }
+               break;
+           default:
+               break;
+         }
+     }
+ };
+ 
+ /// Get the bitmap data of a style from the variant
+ class GetBitmap : public boost::static_visitor<CachedBitmap *>
+ {
+ public:
+     CachedBitmap *operator()(const SolidFill&) const {
+         return 0;
+     }
+     CachedBitmap *operator()(const GradientFill&) const {
+         return 0;
+     }
+     CachedBitmap *operator()(const BitmapFill& b) const {
+         return const_cast<CachedBitmap *>(b.bitmap());
+     }
+ };
+ 
+ /// Get the image from style variant
+ class GetImage : public boost::static_visitor<image::GnashImage *>
+ {
+ public:
+     image::GnashImage *operator()(const SolidFill&) const {
+         return 0;
+     }
+     image::GnashImage *operator()(const GradientFill&) const {
+         return 0;
+     }
+     image::GnashImage *operator()(const BitmapFill& b) const {
+         CachedBitmap *cb = const_cast<CachedBitmap *>(b.bitmap());
+         image::GnashImage &im = cb->image();
+ //      image::GnashImage::const_iterator it = const_cast<CachedBitmap 
*>(cb)->image().begin();
+         return &im;
+     }
+ };
+ 
+ /// Get the matrix of a style from the variant
+ class GetMatrix : public boost::static_visitor<SWFMatrix>
+ {
+ public:
+     SWFMatrix operator()(const SolidFill&) const {
+     }
+     SWFMatrix operator()(const GradientFill& g) const {
+         return g.matrix();
+     }
+     SWFMatrix operator()(const BitmapFill& b) const {
+         return b.matrix();
+     }
+ };
+ 
+ /// GradientFills have more data we need to construct the gradient.
+ 
+ /// Return the focal point of a radial gradient
+ class GetFocalPoint : public boost::static_visitor<double>
+ {
+ public:
+     double operator()(const SolidFill&) const {
+         return 0.0f;
+     }
+     double operator()(const GradientFill& g) const {
+         return g.focalPoint();
+     }
+     double operator()(const BitmapFill&) const {
+         return 0.0f;
+     }
+ };
+ 
+ /// Return the records in the gradient
+ class GetGradientRecords : public boost::static_visitor<const 
GradientFill::GradientRecords &>
+ {
+ public:
+     const GradientFill::GradientRecords &operator()(const SolidFill&) const {
+     }
+     const GradientFill::GradientRecords &operator()(const GradientFill& fs) 
const {
+         return fs.getRecords();
+     }
+     const GradientFill::GradientRecords &operator()(const BitmapFill&) const {
+     }
+ };
+ 
+ 
+ } // namespace gnash::renderer::openvg
+ } // namespace gnash::renderer
+ } // namespace gnash
+ 
+ #endif // __RENDER_OPENVG_STYLE_H__
+ 
+ // local Variables:
+ // mode: C++
+ // indent-tabs-mode: nil
+ // End:
diff --cc macros/x11.m4
index 16b2152,9e77ec5..8125f01
--- a/macros/x11.m4
+++ b/macros/x11.m4
@@@ -36,7 -38,7 +39,8 @@@ AC_DEFUN([GNASH_PATH_X11]
      for i in $newlist; do
        if test -f $i/X11/X.h; then
            ac_cv_path_x11_incl="-I$i"
-             break
+         AC_DEFINE(HAVE_X11_X_H, [1], [Have the X11 X.h header file])
++        break
        fi
      done
    fi
@@@ -134,13 -131,9 +135,9 @@@
      AC_MSG_RESULT(none)
    fi
  
-   if test -n "$X11_LIBS" -a -n "$x11_incl"; then
-     x11=yes
-   fi
- 
-   if test "x$x11" = xyes; then
 -  dnl if test "x$has_x11" = xyes; then
 -  dnl   AC_DEFINE(HAVE_X11, [1], [X11 headers and libraries])
 -  dnl fi
++  if test "x$has_x11" = xyes; then
 +    AC_DEFINE(HAVE_X11, [1], [X11 headers and libraries])
 +  fi
    
    if test x"$xv_incl" != x -a x"$xv_lib" != x; then
      AC_DEFINE(HAVE_XV, [1], [X Video extension header and library])

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


hooks/post-receive
-- 
Gnash



reply via email to

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