gnash-commit
[Top][All Lists]
Advanced

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

[Gnash-commit] [SCM] Gnash branch, openvg, updated. 787c8b4bbd171a494bad


From: Rob Savoye
Subject: [Gnash-commit] [SCM] Gnash branch, openvg, updated. 787c8b4bbd171a494badd69b8a01709d707aa869
Date: Fri, 28 Jan 2011 21:23:36 +0000

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

The branch, openvg has been updated
       via  787c8b4bbd171a494badd69b8a01709d707aa869 (commit)
       via  5967fc8c741816ac337bb0fbc125abd041a73aba (commit)
       via  e883333b5c831b42cea3b23567b780517c4d7ed4 (commit)
       via  da0cde9779fb6e60817fe3cd5b1852b58a836efc (commit)
       via  f6053db65a955591b50eb52c7b0d8b42f397f2a4 (commit)
       via  e069f739a5bc8cc4541f68d1baeb82633657e03f (commit)
       via  1ada27384311dcb181589570c26f52ae57fb9639 (commit)
       via  307bf26c2ef7bd316f687e3833ae3f0c2c42d0bc (commit)
       via  d51835595ea8b50ed498124294761721b85bf89d (commit)
       via  26291d49ff1b4dd7e586fdd0a2d124416b0ed959 (commit)
       via  73cc72b2ad6b4d4c9e4a9f19ddaa541babbc7c1c (commit)
       via  988ec330e66033b0808fbbe73a1978f814bbda9a (commit)
      from  09148d6506a2422e77bd594cdd985627f79dcba7 (commit)

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

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


commit 787c8b4bbd171a494badd69b8a01709d707aa869
Author: Rob Savoye <address@hidden>
Date:   Fri Jan 28 14:23:04 2011 -0700

    don't convert mouse locations when using tslib, as tslib does it for us.

diff --git a/gui/fb/fb.cpp b/gui/fb/fb.cpp
index 77fbd6e..11a116b 100644
--- a/gui/fb/fb.cpp
+++ b/gui/fb/fb.cpp
@@ -301,7 +301,7 @@ FBGui::init(int argc, char *** argv)
     log_debug("X:%d, Y:%d", _xpos, _ypos);
 #endif
 
-_validbounds.setTo(0, 0, _width - 1, _height - 1);
+    _validbounds.setTo(0, 0, _width - 1, _height - 1);
 
     _renderer.reset(renderer::openvg::create_handler(0));
   
@@ -733,16 +733,17 @@ FBGui::checkForData()
             }
 #endif
             // See if a mouse button was clicked
-            //if (ie->pressed) {
-            notifyMouseClick(true);
+            if (ie->pressed) {
+                notifyMouseClick(true);
 #if 0
-            double x = 0.655 * ie->x;
-            double y = 0.46875 * ie->y;
-            log_debug("Mouse clicked at: %g:%g", x, y);
-            notifyMouseMove(int(x), int(y));
+                double x = 0.655 * ie->x;
+                double y = 0.46875 * ie->y;
+                log_debug("Mouse clicked at: %g:%g", x, y);
+                notifyMouseMove(int(x), int(y));
 #else
-            notifyMouseMove(ie->x, ie->y);
-#endif            
+                notifyMouseMove(ie->x, ie->y);
+#endif  
+            }
         }
     }
 }

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


commit 5967fc8c741816ac337bb0fbc125abd041a73aba
Author: Rob Savoye <address@hidden>
Date:   Fri Jan 28 14:21:47 2011 -0700

    move scanDevices() from the header back to the src

diff --git a/libdevice/events/InputDevice.cpp b/libdevice/events/InputDevice.cpp
index 7a220e1..35167c2 100644
--- a/libdevice/events/InputDevice.cpp
+++ b/libdevice/events/InputDevice.cpp
@@ -74,20 +74,6 @@ InputDevice::init(InputDevice::devicetype_e type, const 
std::string &filespec,
     return init(filespec, size);
 }
 
-#if 0
-boost::shared_ptr<InputDevice::input_data_t>
-InputDevice::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;
-}
-#endif
-
 void
 InputDevice::addData(bool pressed, key::code key, int modifier, int x, int y)
 {
@@ -171,14 +157,27 @@ InputDevice::dump()
 //    std::cerr << "\tX is: " << _x << ", Y is: " << _y << std::endl;
 }
 
-// Scan for all the possible input devices. This aggregates all
-// the devices from each type into a single big vector.
-#if 0
-std::vector<boost::shared_ptr<InputDevice> >
+// The Babbage touchscreen gives is absolute coordinates, but they don't
+// match the actual screen resolution. So we convert the coordinates
+// to a new absolute location.
+// For example, if the LCD is 480 x 800, the tablet thinks this is 1010 x 960.
+// This should really use a calibration function, but as we know the numbers...
+boost::shared_array<int>
+InputDevice::convertAbsCoords(int x, int y, int width, int height)
+{
+    boost::shared_array<int> coords(new int[2]);
+
+    coords[0] = (x/width) * x;
+    coords[1] = (y/height) * y;
+    
+    return coords;
+}
+
+std::vector<boost::shared_ptr<InputDevice> > 
 InputDevice::scanForDevices()
 {
     // GNASH_REPORT_FUNCTION;
-
+    
     std::vector<boost::shared_ptr<InputDevice> > devices;
     
     std::vector<boost::shared_ptr<InputDevice> > id;
@@ -200,28 +199,10 @@ InputDevice::scanForDevices()
     for (it=id.begin(); it!=id.end(); ++it) {
         devices.push_back(*it);
     }
-#endif
-
+#endif    
     return devices;
 }
-#endif
-
-// The Babbage touchscreen gives is absolute coordinates, but they don't
-// match the actual screen resolution. So we convert the coordinates
-// to a new absolute location.
-// For example, if the LCD is 480 x 800, the tablet thinks this is 1010 x 960.
-// This should really use a calibration function, but as we know the numbers...
-boost::shared_array<int>
-InputDevice::convertAbsCoords(int x, int y, int width, int height)
-{
-    boost::shared_array<int> coords(new int[2]);
-
-    coords[0] = (x/width) * x;
-    coords[1] = (y/height) * y;
     
-    return coords;
-}
-
 // end of gnash namespace
 }
 
diff --git a/libdevice/events/InputDevice.h b/libdevice/events/InputDevice.h
index 287bfb3..d328cd4 100644
--- a/libdevice/events/InputDevice.h
+++ b/libdevice/events/InputDevice.h
@@ -95,34 +95,7 @@ public:
     virtual bool init(const std::string &filespec, size_t size) = 0;
     virtual bool check() = 0;
 
-    static std::vector<boost::shared_ptr<InputDevice> > scanForDevices()
-    {
-        // GNASH_REPORT_FUNCTION;
-        
-        std::vector<boost::shared_ptr<InputDevice> > devices;
-        
-        std::vector<boost::shared_ptr<InputDevice> > id;
-        std::vector<boost::shared_ptr<InputDevice> >::iterator it;
-#ifdef USE_INPUT_EVENTS
-        id = EventDevice::scanForDevices();
-        for (it=id.begin(); it!=id.end(); ++it) {
-            devices.push_back(*it);
-        }
-#endif
-#if defined(USE_MOUSE_PS2) || defined(USE_MOUSE_ETT)
-        id = MouseDevice::scanForDevices();
-        for (it=id.begin(); it!=id.end(); ++it) {
-        devices.push_back(*it);
-        }
-#endif
-#if defined(HAVE_TSLIB_H) && defined(USE_TSLIB)
-        id = TouchDevice::scanForDevices();
-        for (it=id.begin(); it!=id.end(); ++it) {
-        devices.push_back(*it);
-        }
-#endif    
-    return devices;
-    }        
+    static std::vector<boost::shared_ptr<InputDevice> > scanForDevices();
     
     InputDevice::devicetype_e getType() { return _type; };
 

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


commit e883333b5c831b42cea3b23567b780517c4d7ed4
Author: Rob Savoye <address@hidden>
Date:   Fri Jan 28 14:19:50 2011 -0700

    cleanup position handling, as we can use ts_calibrate instead of our own

diff --git a/libdevice/events/TouchDevice.cpp b/libdevice/events/TouchDevice.cpp
index e57b07c..ae7b74b 100644
--- a/libdevice/events/TouchDevice.cpp
+++ b/libdevice/events/TouchDevice.cpp
@@ -77,8 +77,6 @@ TouchDevice::init(const std::string &filespec, size_t /* size 
*/)
     
     char *devname = getenv(TSLIB_DEVICE_ENV);
     if (!devname) {
-        devname = const_cast<char *>(TSLIB_DEVICE_NAME);
-    } else {
         if (!filespec.empty()) {
             devname = const_cast<char *>(_filespec.c_str());
         } else {
@@ -88,19 +86,20 @@ TouchDevice::init(const std::string &filespec, size_t /* 
size */)
     
     _tsDev = ts_open(devname, 1);  //Open tslib non-blocking
     if (_tsDev == 0) {
-        log_debug("Could not open touchscreen %s: %s", devname, 
strerror(errno));
+        log_error("Could not open touchscreen %s: %s", devname, 
strerror(errno));
         return false;
     }
     
     ts_config(_tsDev); 
     if (ts_fd(_tsDev) < 0) {
-        log_debug("Could not get touchscreen fd %s: %s", devname, 
strerror(errno));
+        log_error("Could not get touchscreen fd %s: %s", devname, 
strerror(errno));
         return false;
     }
     
     _fd = ts_fd(_tsDev);
     
     log_debug("Using TSLIB on %s", devname);
+    
     return true;
 }
 
@@ -112,8 +111,6 @@ TouchDevice::check()
     // Read events from the touchscreen and transport them into Gnash
     // Tslib should be setup so the output is pretty clean.
     struct ts_sample event;
-    // unsigned long    flags;
-    // unsigned long    buttons;
     
     if (_tsDev == 0) {
         return false;           // No tslib device initialized, exit!
@@ -126,27 +123,11 @@ TouchDevice::check()
         if (event.pressure > 0) {
             // the screen is touched
             boost::shared_array<int> coords =
-                MouseDevice::convertCoordinates(event.x, event.y, 1024, 768);
-//          MouseDevice::convertCoordinates(event.x, event.y,
-//                                 _gui->getStage()->getStageWidth(),
-//                                 _gui->getStage()->getStageHeight());
-            event.x = coords[0];
-            event.y = coords[1];
-#if 0
-            // FIXME: the API for these mouse events has changed, so this 
needs to be
-            // updated.
-            _gui->notifyMouseMove(int(event.x / _gui->getXScale()),
-                                  int(event.y / _gui->getYScale()));
-            _gui->notifyMouseClick(true);  //fire mouse click event into Gnash
-            
-            log_debug("Touched x: %d y: %d width: %d height: %d",
-                      event.x , event.y, _gui->getStage()->getStageWidth(),
-                      _gui->getStage()->getStageHeight());
-#endif
+                MouseDevice::convertCoordinates(event.x, event.y, 800, 480);
+            log_debug("Touched x: %d, y: %d", event.x , event.y);
             addData(true, gnash::key::INVALID, 0, event.x, event.y);
         } else {
             addData(false, gnash::key::INVALID, 0, event.x, event.y);
-//            _gui->notifyMouseClick(false);  //button released
             log_debug("lifted x: %d y: %d", event.x, event.y); //debug
         }
     }
@@ -154,9 +135,14 @@ TouchDevice::check()
     return true;
 }
 
+// FIXME: this currently is lacking thw swf program used to generate the
+// input data. Instead use the tslib utility 'ts_calibrate', as Gnash now
+// has TSlib support.
 void
 TouchDevice::apply_ts_calibration(float* cx, float* cy, int rawx, int rawy)
 {
+    GNASH_REPORT_FUNCTION;
+    
     // This method use 3 points calibration
     // it is described in http://www.embedded.com/story/OEG20020529S0046
     
@@ -319,16 +305,17 @@ TouchDevice::scanForDevices()
                 log_error("You don't have the proper permissions to open %s",
                           touch[i].filespec);
                 i++;
-                close(fd);
-                log_debug("Found a %s device for touchscreen input using %s",
-                          debug[touch[i].type], touch[i].filespec);
-                boost::shared_ptr<InputDevice> dev;
-                dev = boost::shared_ptr<InputDevice>(new TouchDevice());
-                if (dev->init(touch[i].filespec, DEFAULT_BUFFER_SIZE)) {
-                    devices.push_back(dev);
-                    break;
-                }
-            } // open()
+                continue;
+            }
+            close(fd);
+            log_debug("Found a %s device for touchscreen input using %s",
+                      debug[touch[i].type], touch[i].filespec);
+            boost::shared_ptr<InputDevice> dev
+                = boost::shared_ptr<InputDevice>(new TouchDevice());
+            if (dev->init(touch[i].filespec, DEFAULT_BUFFER_SIZE)) {
+                devices.push_back(dev);
+            }
+            break;
 //            dev->dump();
         }     // stat()
         i++;

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


commit da0cde9779fb6e60817fe3cd5b1852b58a836efc
Author: Rob Savoye <address@hidden>
Date:   Fri Jan 28 12:01:18 2011 -0700

    add rcfile, so the renderer is configurable at runtime. Use tslib with 
Babbage tablet instead of linux input events.

diff --git a/gui/fb/fb.cpp b/gui/fb/fb.cpp
index 25c4f3f..77fbd6e 100644
--- a/gui/fb/fb.cpp
+++ b/gui/fb/fb.cpp
@@ -102,6 +102,7 @@
 #endif
 
 #include "gui.h"
+#include "rc.h"
 #include "fbsup.h"
 #include "log.h"
 #include "movie_root.h"
@@ -133,10 +134,14 @@
 #endif
 #endif
 
+namespace {
+gnash::RcInitFile& rcfile = gnash::RcInitFile::getDefaultInstance();
+}
 namespace gnash {
 
 namespace gui {
 
+
 int terminate_request = false;  // global scope to avoid GUI access
 
 std::auto_ptr<Gui> createFBGui(unsigned long windowid, float scale,
@@ -190,7 +195,8 @@ FBGui::init(int argc, char *** argv)
     // GNASH_REPORT_FUNCTION;
 
     // the current renderer as set on the command line or gnashrc file
-    std::string renderer = _runResources.getRenderBackend();
+//    std::string renderer = _runResources.getRenderBackend();
+    std::string renderer = rcfile.getRenderer();
 
     // map framebuffer into memory
     // Create a new Glue layer
@@ -234,7 +240,7 @@ FBGui::init(int argc, char *** argv)
         //(*it)->dump();
         if ((*it)->getType() == InputDevice::MOUSE) {
             log_debug("WARNING: Mouse support disabled as it conflicts with 
the input event support.");
-            // For now we only want keyboards input events, as the mouse
+            // For now we only want keyboard input events, as the mouse
             // interface default of /dev/input/mice supports hotpluging 
devices,
             // unlike the regular events.
             // _inputs.push_back(*it);
@@ -242,13 +248,20 @@ FBGui::init(int argc, char *** argv)
         if ((*it)->getType() == InputDevice::KEYBOARD) {
             _inputs.push_back(*it);
         }
+        // TSLib also supports linux input events, so we
+        // use that instead of handling the events directly. The
+        // Babbage is configured as a tablet when using input events.
         if ((*it)->getType() == InputDevice::TOUCHSCREEN) {
-            log_debug("WARNING: Touchscreen support disabled as it conflicts 
with the input event support.");
-//            _inputs.push_back(*it);
+            log_debug("Enabling Touchscreen support.");
+            _inputs.push_back(*it);
         }
         if ((*it)->getType() == InputDevice::TABLET) {
+#if 1
+            log_debug("WARNING: Babbage Tablet support disabled as it 
conflicts with TSlib");
+#else
             log_debug("Enabling Babbage Touchscreen support");
             _inputs.push_back(*it);
+#endif
         }
         if ((*it)->getType() == InputDevice::POWERBUTTON) {
             _inputs.push_back(*it);
@@ -700,7 +713,7 @@ FBGui::checkForData()
         (*it)->check();
         boost::shared_ptr<InputDevice::input_data_t> ie = (*it)->popData();
         if (ie) {
-#if 0
+#if 1
             std::cerr << "Got data: " << ((ie->pressed) ? "true" : "false");
             std::cerr << ", " << ie->key << ", " << ie->modifier;
             std::cerr << ", " << ie->x << ", " << ie->y << std::endl;
@@ -722,13 +735,14 @@ FBGui::checkForData()
             // See if a mouse button was clicked
             //if (ie->pressed) {
             notifyMouseClick(true);
+#if 0
             double x = 0.655 * ie->x;
             double y = 0.46875 * ie->y;
             log_debug("Mouse clicked at: %g:%g", x, y);
+            notifyMouseMove(int(x), int(y));
+#else
             notifyMouseMove(ie->x, ie->y);
-//                notifyMouseMove(int(x), int(y));
-//        }
-            
+#endif            
         }
     }
 }

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


commit f6053db65a955591b50eb52c7b0d8b42f397f2a4
Author: Rob Savoye <address@hidden>
Date:   Thu Jan 27 22:54:39 2011 -0700

    merge apply() into createPatternBitmap()

diff --git a/librender/openvg/OpenVGBitmap.cpp 
b/librender/openvg/OpenVGBitmap.cpp
index 459117a..f3eefcc 100644
--- a/librender/openvg/OpenVGBitmap.cpp
+++ b/librender/openvg/OpenVGBitmap.cpp
@@ -83,7 +83,7 @@ OpenVGBitmap::OpenVGBitmap(CachedBitmap *bitmap, VGPaint 
vgpaint)
         log_debug("Image has RGBA Pixel Format, Stride is %d",
                   im.stride());
         // Copy the image data into the VG image container
-        vgImageSubData(_vgimage, im.begin(), im.stride(), VG_sRGBX_8888,
+        vgImageSubData(_vgimage, im.begin(), im.stride(), VG_sRGBA_8888,
                    0, 0, im.width(), im.height());
         break;
     default:
@@ -118,13 +118,13 @@ OpenVGBitmap::OpenVGBitmap(image::GnashImage *image, 
VGPaint vgpaint)
     case image::TYPE_RGB:
         log_debug("Image has RGB Pixel Format, Stride is %d",
                   image->stride());
-        vgImageSubData(_vgimage, image->begin(), image->stride(), 
VG_sRGBX_8888,
+        vgImageSubData(_vgimage, image->begin(), image->stride(), 
VG_sRGBA_8888,
                    0, 0, image->width(), image->height());
         break;
     case image::TYPE_RGBA:
         log_debug("Image has RGBA Pixel Format, Stride is %d",
                   image->stride());
-        vgImageSubData(_vgimage, image->begin(), image->stride(), 
VG_sRGBX_8888,
+        vgImageSubData(_vgimage, image->begin(), image->stride(), 
VG_sRGBA_8888,
                    0, 0, image->width(), image->height());
         break;
     default:
@@ -180,72 +180,6 @@ OpenVGBitmap::image()
     }
 }    
 
-// This applies the cached VGimage or VGpath to the current paint object.
-// a VGimage is used for a bitmap, for example a jpeg. VGpath is used
-// instead of a VGimage when handling gradients, as a VGPath has hardware
-// support for gradients.
-void
-OpenVGBitmap::apply(const gnash::SWFMatrix& bitmap_matrix,
-                    bitmap_wrap_mode wrap_mode, VGPaint paint) const
-{
-    GNASH_REPORT_FUNCTION;
-    
-    gnash::SWFMatrix mat;
-    VGfloat     vmat[9];
-
-//    Renderer_ovg::printVGMatrix(bitmap_matrix);
-    
-    // if (_vgimage == VG_INVALID_HANDLE) {
-    //     log_error("No cached VG image!");
-    // } else {
-    
-    vgSetParameteri (paint, VG_PAINT_TYPE, VG_PAINT_TYPE_PATTERN);
-    // Paint the cached VG image into the VG paint surface
-    mat = bitmap_matrix;
-    mat.invert();
-    Renderer_ovg::printVGMatrix(mat);
-    
-#if 1
-    memset(vmat, 0, sizeof(vmat));
-    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;
-    
-    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);
-#endif
-    
-    switch (wrap_mode) {
-      case WRAP_FILL:
-          vgSetParameteri (paint, VG_PAINT_PATTERN_TILING_MODE, VG_TILE_FILL);
-          break;
-      case WRAP_PAD:
-          vgSetParameteri (paint, VG_PAINT_PATTERN_TILING_MODE, VG_TILE_PAD);
-          break;
-      case WRAP_REPEAT:
-          vgSetParameteri (paint, VG_PAINT_PATTERN_TILING_MODE, 
VG_TILE_REPEAT);
-          break;
-      case WRAP_REFLECT:
-          vgSetParameteri (paint, VG_PAINT_PATTERN_TILING_MODE, 
VG_TILE_REFLECT);
-          break;
-      default:
-          log_error("No supported wrap mode specified!");
-          break;
-    }
-
-    vgPaintPattern(paint, _vgimage);
-    vgDrawImage(_vgimage);
-    vgFlush();
-}
-
 /// 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.
@@ -320,46 +254,90 @@ OpenVGBitmap::createLinearBitmap(float x0, float y0, 
float x1, float y1,
 
     // Create and fill pattern image
 OpenVGBitmap *
-OpenVGBitmap::createPatternBitmap(image::GnashImage &im, VGPaint vgpaint)
+OpenVGBitmap::createPatternBitmap(CachedBitmap *bitmap, const 
gnash::SWFMatrix& matrix,
+                                  bitmap_wrap_mode mode)
 {
     GNASH_REPORT_FUNCTION;
 
-    VGImage vgimage;
-    if (vgpaint != VG_INVALID_HANDLE) {
-        vgimage = vgCreateImage(_pixel_format, im.width(), im.height(),
-                                 VG_IMAGE_QUALITY_FASTER);
-        vgImageSubData(vgimage, im.begin(), 4*im.width(), /* stride */
-                       _pixel_format, 0, 0, im.width(), im.height());
-        
-        vgSetParameteri(vgpaint, VG_PAINT_TYPE, VG_PAINT_TYPE_PATTERN);
-        vgSetParameteri(vgpaint, VG_PAINT_PATTERN_TILING_MODE, VG_TILE_REPEAT);
-        vgPaintPattern(vgpaint, vgimage);
-        vgDrawImage(vgimage);
-        vgFlush();
-    }
+    // extract a reference to the image from the cached bitmap
+    image::GnashImage &im = bitmap->image();
 
-    return this;
-}
+    // 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",
+                  im.stride());
+        vgImageSubData(_vgimage, im.begin(), im.stride(), VG_sRGBA_8888,
+                   0, 0, im.width(), im.height());
+        break;
+    case image::TYPE_RGBA:
+        log_debug("Image has RGBA Pixel Format, Stride is %d",
+                  im.stride());
+        // 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:
+        log_error("");
+        return 0;
+    }
 
-    // Create and fill pattern image
-OpenVGBitmap *
-OpenVGBitmap::createPatternBitmap()
-{
-    GNASH_REPORT_FUNCTION;
+    vgSetParameteri (_vgpaint, VG_PAINT_TYPE, VG_PAINT_TYPE_PATTERN);
+//    vgPaintPattern (_vgpaint, _vgimage);
 
-    if (_vgpaint != VG_INVALID_HANDLE) {
-        VGImage vgimage = vgCreateImage(_pixel_format, _image->width(), 
_image->height(),
-                                 VG_IMAGE_QUALITY_FASTER);
-        vgImageSubData(vgimage, _image->begin(), 4*_image->width(), /* stride 
*/
-                       _pixel_format, 0, 0, _image->width(), _image->height());
-        
-        vgSetParameteri(_vgpaint, VG_PAINT_TYPE, VG_PAINT_TYPE_PATTERN);
-        vgSetParameteri(_vgpaint, VG_PAINT_PATTERN_TILING_MODE, 
VG_TILE_REPEAT);
-        vgPaintPattern(_vgpaint, vgimage);
-        vgDrawImage(vgimage);
-        vgFlush();
+    gnash::SWFMatrix mat;
+    VGfloat     vmat[9];
+    
+    // Paint the cached VG image into the VG paint surface
+    mat = matrix;
+    mat.invert();
+//    Renderer_ovg::printVGMatrix(mat);
+    
+    memset(vmat, 0, sizeof(vmat));
+    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;
+    
+    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);
+//    vgDrawImage(_vgimage);
+//    vgFlush();
+
     return this;
 }
 
diff --git a/librender/openvg/OpenVGBitmap.h b/librender/openvg/OpenVGBitmap.h
index 46fc367..b2ca95c 100644
--- a/librender/openvg/OpenVGBitmap.h
+++ b/librender/openvg/OpenVGBitmap.h
@@ -48,8 +48,6 @@ public:
 
     image::GnashImage& image();
     
-    void apply(const gnash::SWFMatrix& bitmap_matrix,
-               bitmap_wrap_mode wrap_mode, VGPaint paint) const;
     // Accessors for the GnashImage internal data
     VGPaint getFillPaint() const { return _vgpaint; }
     int getWidth() { return _image->width(); }
@@ -66,10 +64,9 @@ public:
                                      const rgba &incolor, const VGPaint paint);
 
     // This is for images
-    OpenVGBitmap *createPatternBitmap(image::GnashImage &im,
-                                      VGPaint paint);
-    OpenVGBitmap *createPatternBitmap();
-
+    OpenVGBitmap *createPatternBitmap(CachedBitmap *bitmap, const 
gnash::SWFMatrix& matrix,
+                                      bitmap_wrap_mode mode);
+    
 private:
     boost::scoped_ptr<image::GnashImage> _image;
     VGImageFormat   _pixel_format;
diff --git a/librender/openvg/OpenVGRenderer.cpp 
b/librender/openvg/OpenVGRenderer.cpp
index 3902265..b3a2921 100644
--- a/librender/openvg/OpenVGRenderer.cpp
+++ b/librender/openvg/OpenVGRenderer.cpp
@@ -835,24 +835,8 @@ Renderer_ovg::apply_fill_style(const FillStyle& style, 
const SWFMatrix& mat,
       case SWF::FILL_RADIAL_GRADIENT:
       case SWF::FILL_FOCAL_GRADIENT:
       {
-          OpenVGBitmap* binfo = new OpenVGBitmap(_fillpaint);
-          // Renderer_ovg::printVGMatrix(sm);
-          
-          eglScopeMatrix scope_mat(mat);
-          rgba c = cx.transform(incolor);
-          switch (fill_type) {
-          case SWF::FILL_LINEAR_GRADIENT:
-              log_error("Fill Style Type: Linear Gradient, you shouldn't be 
here");
-              break;
-          case SWF::FILL_RADIAL_GRADIENT:
-          case SWF::FILL_FOCAL_GRADIENT:
-              log_error("Fill Style Type: Radial Gradient, you shouldn't be 
here");
-              break;
-          default:
-              std::abort();
-          }
-          // binfo->apply(sm, OpenVGBitmap::WRAP_PAD, _fillpaint);
-          vgSetParameteri (_fillpaint, VG_PAINT_TYPE, VG_PAINT_TYPE_PATTERN);
+          // This is handled elsewhere, as it's now hardware supported.
+          log_error("Fill Style Type: Gradient, you shouldn't be here!");
           break;
       }
       case SWF::FILL_TILED_BITMAP_HARD:
@@ -860,10 +844,8 @@ Renderer_ovg::apply_fill_style(const FillStyle& style, 
const SWFMatrix& mat,
       {
           log_debug("Fill Style Type: Tiled Bitmap");
           CachedBitmap *cb = boost::apply_visitor(GetBitmap(), style.fill);
-          //          std::auto_ptr<image::GnashImage> im(&cb->image());
-          OpenVGBitmap *binfo = new OpenVGBitmap(cb, _fillpaint);
-          binfo->apply(sm, OpenVGBitmap::WRAP_REPEAT, _fillpaint);
-          //vgSetParameteri (_fillpaint, VG_PAINT_TYPE, VG_PAINT_TYPE_PATTERN);
+          OpenVGBitmap *binfo = new OpenVGBitmap(_fillpaint);
+          binfo->createPatternBitmap(cb, sm, OpenVGBitmap::WRAP_REPEAT);
           break;
       }
       
@@ -872,14 +854,8 @@ Renderer_ovg::apply_fill_style(const FillStyle& style, 
const SWFMatrix& mat,
       {     
           log_debug("Fill Style Type: Clipped Bitmap");
           CachedBitmap *cb = boost::apply_visitor(GetBitmap(), style.fill);
-          OpenVGBitmap *binfo = new OpenVGBitmap(cb, _fillpaint);
-#if 0
-          binfo->createPatternBitmap();
-          image::GnashImage *im = boost::apply_visitor(GetImage(), style.fill);
-          OpenVGBitmap *binfo = new OpenVGBitmap(im, _fillpaint);
-#endif
-          binfo->apply(sm, OpenVGBitmap::WRAP_PAD, _fillpaint);
-          //vgSetParameteri (_fillpaint, VG_PAINT_TYPE, VG_PAINT_TYPE_PATTERN);
+          OpenVGBitmap *binfo = new OpenVGBitmap(_fillpaint);
+          binfo->createPatternBitmap(cb, sm, OpenVGBitmap::WRAP_FILL);
           break;
       } 
       case SWF::FILL_SOLID:

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


commit e069f739a5bc8cc4541f68d1baeb82633657e03f
Author: Rob Savoye <address@hidden>
Date:   Thu Jan 27 21:40:10 2011 -0700

    fix bitmap loading

diff --git a/librender/openvg/OpenVGBitmap.cpp 
b/librender/openvg/OpenVGBitmap.cpp
index 6efc5c7..459117a 100644
--- a/librender/openvg/OpenVGBitmap.cpp
+++ b/librender/openvg/OpenVGBitmap.cpp
@@ -58,23 +58,38 @@ OpenVGBitmap::OpenVGBitmap(CachedBitmap *bitmap, VGPaint 
vgpaint)
 {
     GNASH_REPORT_FUNCTION;
 
-    // extract a reference to the image from the cached bitmap
-    image::GnashImage &im = bitmap->image();
-
     // Store the reference so so it's available to createPatternBitmap()
     //    _image.reset(&im);
 
+    // extract a reference to the image from the cached bitmap
+    image::GnashImage &im = bitmap->image();
+
     // 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()));
+        log_error("Failed to create VG image! %s",
+                  Renderer_ovg::getErrorString(vgGetError()));
     }
     
-    // Copy the image data into the VG image container
-    vgImageSubData(_vgimage, im.begin(), im.width() * _stride, _pixel_format,
+    switch (im.type()) {
+    case image::TYPE_RGB:
+        log_debug("Image has RGB Pixel Format, Stride is %d",
+                  im.stride());
+        vgImageSubData(_vgimage, im.begin(), im.stride(), VG_sRGBA_8888,
                    0, 0, im.width(), im.height());
-    
+        break;
+    case image::TYPE_RGBA:
+        log_debug("Image has RGBA Pixel Format, Stride is %d",
+                  im.stride());
+        // Copy the image data into the VG image container
+        vgImageSubData(_vgimage, im.begin(), im.stride(), VG_sRGBX_8888,
+                   0, 0, im.width(), im.height());
+        break;
+    default:
+        std::abort();
+    }
+
     vgSetParameteri (_vgpaint, VG_PAINT_TYPE, VG_PAINT_TYPE_PATTERN);
     vgPaintPattern (_vgpaint, _vgimage);
 }
@@ -99,6 +114,23 @@ OpenVGBitmap::OpenVGBitmap(image::GnashImage *image, 
VGPaint vgpaint)
 {
     GNASH_REPORT_FUNCTION;
     
+    switch (image->type()) {
+    case image::TYPE_RGB:
+        log_debug("Image has RGB Pixel Format, Stride is %d",
+                  image->stride());
+        vgImageSubData(_vgimage, image->begin(), image->stride(), 
VG_sRGBX_8888,
+                   0, 0, image->width(), image->height());
+        break;
+    case image::TYPE_RGBA:
+        log_debug("Image has RGBA Pixel Format, Stride is %d",
+                  image->stride());
+        vgImageSubData(_vgimage, image->begin(), image->stride(), 
VG_sRGBX_8888,
+                   0, 0, image->width(), image->height());
+        break;
+    default:
+        std::abort();
+    }
+
     size_t width = _image->width();
     size_t height = _image->height();
 
@@ -106,11 +138,11 @@ OpenVGBitmap::OpenVGBitmap(image::GnashImage *image, 
VGPaint vgpaint)
     _vgimage = vgCreateImage(_pixel_format, width, height,
                              VG_IMAGE_QUALITY_FASTER);    
     
-    vgImageSubData(_vgimage, image->begin(), width * _stride, _pixel_format,
+    vgImageSubData(_vgimage, image->begin(), image->stride(), _pixel_format,
                    0, 0, width, height);
 
-    vgSetParameteri(vgpaint, VG_PAINT_TYPE, VG_PAINT_TYPE_PATTERN);
-    vgSetParameteri(vgpaint, VG_PAINT_PATTERN_TILING_MODE, VG_TILE_REPEAT);
+    // vgSetParameteri(vgpaint, VG_PAINT_TYPE, VG_PAINT_TYPE_PATTERN);
+    //    vgSetParameteri(vgpaint, VG_PAINT_PATTERN_TILING_MODE, 
VG_TILE_REPEAT);
     vgPaintPattern(vgpaint, _vgimage);
     vgDrawImage(_vgimage);
     vgFlush();
@@ -173,6 +205,7 @@ OpenVGBitmap::apply(const gnash::SWFMatrix& bitmap_matrix,
     mat.invert();
     Renderer_ovg::printVGMatrix(mat);
     
+#if 1
     memset(vmat, 0, sizeof(vmat));
     vmat[0] = mat.sx  / 65536.0f;
     vmat[1] = mat.shx / 65536.0f;
@@ -188,6 +221,7 @@ OpenVGBitmap::apply(const gnash::SWFMatrix& bitmap_matrix,
     vgSeti (VG_MATRIX_MODE, VG_MATRIX_STROKE_PAINT_TO_USER);
     vgLoadMatrix (vmat);
     vgSeti (VG_MATRIX_MODE, VG_MATRIX_PATH_USER_TO_SURFACE);
+#endif
     
     switch (wrap_mode) {
       case WRAP_FILL:
@@ -206,6 +240,10 @@ OpenVGBitmap::apply(const gnash::SWFMatrix& bitmap_matrix,
           log_error("No supported wrap mode specified!");
           break;
     }
+
+    vgPaintPattern(paint, _vgimage);
+    vgDrawImage(_vgimage);
+    vgFlush();
 }
 
 /// OpenVG supports creating linear and gradient fills in hardware, so
diff --git a/librender/openvg/OpenVGRenderer.cpp 
b/librender/openvg/OpenVGRenderer.cpp
index d004e5a..3902265 100644
--- a/librender/openvg/OpenVGRenderer.cpp
+++ b/librender/openvg/OpenVGRenderer.cpp
@@ -863,7 +863,7 @@ Renderer_ovg::apply_fill_style(const FillStyle& style, 
const SWFMatrix& mat,
           //          std::auto_ptr<image::GnashImage> im(&cb->image());
           OpenVGBitmap *binfo = new OpenVGBitmap(cb, _fillpaint);
           binfo->apply(sm, OpenVGBitmap::WRAP_REPEAT, _fillpaint);
-          vgSetParameteri (_fillpaint, VG_PAINT_TYPE, VG_PAINT_TYPE_PATTERN);
+          //vgSetParameteri (_fillpaint, VG_PAINT_TYPE, VG_PAINT_TYPE_PATTERN);
           break;
       }
       
@@ -879,7 +879,7 @@ Renderer_ovg::apply_fill_style(const FillStyle& style, 
const SWFMatrix& mat,
           OpenVGBitmap *binfo = new OpenVGBitmap(im, _fillpaint);
 #endif
           binfo->apply(sm, OpenVGBitmap::WRAP_PAD, _fillpaint);
-          vgSetParameteri (_fillpaint, VG_PAINT_TYPE, VG_PAINT_TYPE_PATTERN);
+          //vgSetParameteri (_fillpaint, VG_PAINT_TYPE, VG_PAINT_TYPE_PATTERN);
           break;
       } 
       case SWF::FILL_SOLID:

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


commit 1ada27384311dcb181589570c26f52ae57fb9639
Author: Rob Savoye <address@hidden>
Date:   Thu Jan 27 21:39:24 2011 -0700

    remove commented out lines

diff --git a/librender/linear.as b/librender/linear.as
index c95d345..93f6c4d 100644
--- a/librender/linear.as
+++ b/librender/linear.as
@@ -1,12 +1,3 @@
-
-// _root.lineStyle(1, 0x000000, 100);
-// _root.moveTo(200, 100);
-// _root.lineTo(350, 100);
-// _root.lineTo(350, 200);
-// _root.lineTo(200, 200);
-// _root.lineTo(200, 100);
-
-
 fillType = "linear";
 colors = [0xFF0000, 0x0000FF];
 alphas = [100, 100];
@@ -30,7 +21,7 @@ _root.beginGradientFill(fillType, colors, alphas, ratios, 
matrix);
 // This is the dimensions of the big black box that is supposed to have
 // a linear gradient in it.
 x0 = 200; // 200 pixels = 4000 twips
-y0 = 200; // 200 pixels = 4000 twips -77, was -102 at 150
+y0 = 200; // 200 pixels = 4000 twips
 x1 = 500; // 500 pixels = 10000 twips
 y1 = 400; // 400 pixels = 8000 twips
 _root.moveTo(x0, y0);

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


commit 307bf26c2ef7bd316f687e3833ae3f0c2c42d0bc
Author: Rob Savoye <address@hidden>
Date:   Wed Jan 26 20:04:15 2011 -0700

    don't dump

diff --git a/gui/fb/fb.cpp b/gui/fb/fb.cpp
index 36a5e91..25c4f3f 100644
--- a/gui/fb/fb.cpp
+++ b/gui/fb/fb.cpp
@@ -231,7 +231,7 @@ FBGui::init(int argc, char *** argv)
     
     std::vector<boost::shared_ptr<InputDevice> >::iterator it;
     for (it=possibles.begin(); it!=possibles.end(); ++it) {
-        (*it)->dump();
+        //(*it)->dump();
         if ((*it)->getType() == InputDevice::MOUSE) {
             log_debug("WARNING: Mouse support disabled as it conflicts with 
the input event support.");
             // For now we only want keyboards input events, as the mouse

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


commit d51835595ea8b50ed498124294761721b85bf89d
Author: Rob Savoye <address@hidden>
Date:   Wed Jan 26 20:03:57 2011 -0700

    Renderer_ovg.h is now OpenVGRenderer.h

diff --git a/gui/gtk/gtk_glue_ovg.cpp b/gui/gtk/gtk_glue_ovg.cpp
index 9f1ec94..5e61a7a 100644
--- a/gui/gtk/gtk_glue_ovg.cpp
+++ b/gui/gtk/gtk_glue_ovg.cpp
@@ -31,7 +31,7 @@
 #include "GnashException.h"
 
 #ifdef HAVE_VG_OPENVG_H
-# include "openvg/Renderer_ovg.h"
+# include "openvg/OpenVGRenderer.h"
 # include <VG/openvg.h>
 #endif
 

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


commit 26291d49ff1b4dd7e586fdd0a2d124416b0ed959
Author: Rob Savoye <address@hidden>
Date:   Wed Jan 26 20:03:00 2011 -0700

    move some code from the source to the header, so the static functions for 
scanning devices work without Linux Input events.

diff --git a/libdevice/events/InputDevice.cpp b/libdevice/events/InputDevice.cpp
index 73a949b..7a220e1 100644
--- a/libdevice/events/InputDevice.cpp
+++ b/libdevice/events/InputDevice.cpp
@@ -74,6 +74,7 @@ InputDevice::init(InputDevice::devicetype_e type, const 
std::string &filespec,
     return init(filespec, size);
 }
 
+#if 0
 boost::shared_ptr<InputDevice::input_data_t>
 InputDevice::popData()
 {
@@ -85,6 +86,7 @@ InputDevice::popData()
     }
     return input;
 }
+#endif
 
 void
 InputDevice::addData(bool pressed, key::code key, int modifier, int x, int y)
@@ -171,6 +173,7 @@ InputDevice::dump()
 
 // Scan for all the possible input devices. This aggregates all
 // the devices from each type into a single big vector.
+#if 0
 std::vector<boost::shared_ptr<InputDevice> >
 InputDevice::scanForDevices()
 {
@@ -201,6 +204,7 @@ InputDevice::scanForDevices()
 
     return devices;
 }
+#endif
 
 // The Babbage touchscreen gives is absolute coordinates, but they don't
 // match the actual screen resolution. So we convert the coordinates
diff --git a/libdevice/events/InputDevice.h b/libdevice/events/InputDevice.h
index 9245e34..287bfb3 100644
--- a/libdevice/events/InputDevice.h
+++ b/libdevice/events/InputDevice.h
@@ -95,13 +95,49 @@ public:
     virtual bool init(const std::string &filespec, size_t size) = 0;
     virtual bool check() = 0;
 
-    static std::vector<boost::shared_ptr<InputDevice> > scanForDevices();
-
+    static std::vector<boost::shared_ptr<InputDevice> > scanForDevices()
+    {
+        // GNASH_REPORT_FUNCTION;
+        
+        std::vector<boost::shared_ptr<InputDevice> > devices;
+        
+        std::vector<boost::shared_ptr<InputDevice> > id;
+        std::vector<boost::shared_ptr<InputDevice> >::iterator it;
+#ifdef USE_INPUT_EVENTS
+        id = EventDevice::scanForDevices();
+        for (it=id.begin(); it!=id.end(); ++it) {
+            devices.push_back(*it);
+        }
+#endif
+#if defined(USE_MOUSE_PS2) || defined(USE_MOUSE_ETT)
+        id = MouseDevice::scanForDevices();
+        for (it=id.begin(); it!=id.end(); ++it) {
+        devices.push_back(*it);
+        }
+#endif
+#if defined(HAVE_TSLIB_H) && defined(USE_TSLIB)
+        id = TouchDevice::scanForDevices();
+        for (it=id.begin(); it!=id.end(); ++it) {
+        devices.push_back(*it);
+        }
+#endif    
+    return devices;
+    }        
+    
     InputDevice::devicetype_e getType() { return _type; };
 
     // 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<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);
diff --git a/libdevice/events/TouchDevice.cpp b/libdevice/events/TouchDevice.cpp
index 2063071..e57b07c 100644
--- a/libdevice/events/TouchDevice.cpp
+++ b/libdevice/events/TouchDevice.cpp
@@ -319,17 +319,16 @@ TouchDevice::scanForDevices()
                 log_error("You don't have the proper permissions to open %s",
                           touch[i].filespec);
                 i++;
-                continue;
+                close(fd);
+                log_debug("Found a %s device for touchscreen input using %s",
+                          debug[touch[i].type], touch[i].filespec);
+                boost::shared_ptr<InputDevice> dev;
+                dev = boost::shared_ptr<InputDevice>(new TouchDevice());
+                if (dev->init(touch[i].filespec, DEFAULT_BUFFER_SIZE)) {
+                    devices.push_back(dev);
+                    break;
+                }
             } // open()
-            close(fd);
-            log_debug("Found a %s device for touchscreen input using %s",
-                      debug[touch[i].type], touch[i].filespec);
-            boost::shared_ptr<InputDevice> dev;
-            dev = boost::shared_ptr<InputDevice>(new TouchDevice());
-            if (dev->init(touch[i].filespec, DEFAULT_BUFFER_SIZE)) {
-                devices.push_back(dev);
-                break;
-            }
 //            dev->dump();
         }     // stat()
         i++;

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


commit 73cc72b2ad6b4d4c9e4a9f19ddaa541babbc7c1c
Author: Rob Savoye <address@hidden>
Date:   Wed Jan 26 17:25:06 2011 -0700

    don't try to mask if it's disabled.  Fx radial gradients to use the color.

diff --git a/librender/openvg/OpenVGBitmap.cpp 
b/librender/openvg/OpenVGBitmap.cpp
index 517b343..6efc5c7 100644
--- a/librender/openvg/OpenVGBitmap.cpp
+++ b/librender/openvg/OpenVGBitmap.cpp
@@ -216,19 +216,25 @@ OpenVGBitmap::apply(const gnash::SWFMatrix& bitmap_matrix,
 // 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,
+OpenVGBitmap::createRadialBitmap(float cx, float cy, float fx, float fy,
+                                 float radial, const rgba &incolor,
                                  VGPaint paint)
 {
     GNASH_REPORT_FUNCTION;
 
     VGfloat rgParams[] = { cx, cy, fx, fy, radial };
-    VGfloat stops[5*NUM_STOPS];
     
     // Paint Type 
     vgSetParameteri(paint, VG_PAINT_TYPE, VG_PAINT_TYPE_RADIAL_GRADIENT);
 
     // Gradient Parameters
-    vgSetParameterfv(paint, VG_PAINT_RADIAL_GRADIENT, 4, rgParams);
+    vgSetParameterfv(paint, VG_PAINT_RADIAL_GRADIENT, 5, rgParams);
+
+    VGfloat rampStop[] = {0.00f, 1.0f, 1.0f, 1.0f, 1.0f,
+                          0.33f, 1.0f, 0.0f, 0.0f, 1.0f,
+                          0.66f, 0.0f, 1.0f, 0.0f, 1.0f,
+                          1.00f, 0.0f, 0.0f,  1.0f, 1.0f};
+    vgSetParameterfv(paint, VG_PAINT_COLOR_RAMP_STOPS, 20, rampStop);    
 
     // Color Ramp is the same as for linear gradient
     return this;
@@ -253,10 +259,11 @@ OpenVGBitmap::createLinearBitmap(float x0, float y0, 
float x1, float y1,
     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);
+    vgSetParameteri(paint, VG_PAINT_COLOR_RAMP_SPREAD_MODE,
+                    VG_COLOR_RAMP_SPREAD_PAD);
 
-    VGfloat linearGradient[4] = { x0, y0, 10000, 10000 };
-//    VGfloat linearGradient[4] = { x0, y0, x1, y1 };
+    //    VGfloat linearGradient[4] = { x0, y0, 10000, 10000 };
+    VGfloat linearGradient[4] = { x0, y0, x1, y1 };
     vgSetParameterfv(paint, VG_PAINT_LINEAR_GRADIENT, 4, linearGradient);
 
 #if 0
diff --git a/librender/openvg/OpenVGBitmap.h b/librender/openvg/OpenVGBitmap.h
index 803a9aa..46fc367 100644
--- a/librender/openvg/OpenVGBitmap.h
+++ b/librender/openvg/OpenVGBitmap.h
@@ -60,7 +60,8 @@ public:
     /// we want to use that instead of the existing way of calculating the
     /// gradient in software.
     OpenVGBitmap *createRadialBitmap(float x0, float y0, float x1,
-                                     float y1, float radial, VGPaint paint);
+                                     float y1, float radial,
+                                     const rgba &incolor, VGPaint paint);
     OpenVGBitmap *createLinearBitmap(float x0, float y0, float x1, float y1,
                                      const rgba &incolor, const VGPaint paint);
 
diff --git a/librender/openvg/OpenVGRenderer.cpp 
b/librender/openvg/OpenVGRenderer.cpp
index d0ffb28..d004e5a 100644
--- a/librender/openvg/OpenVGRenderer.cpp
+++ b/librender/openvg/OpenVGRenderer.cpp
@@ -268,7 +268,10 @@ Renderer_ovg::init(float x, float y)
     vgSetfv( VG_CLEAR_COLOR, 4, clearColor );
     
 #ifdef OPENVG_VERSION_1_1    
-    _mask = vgCreateMaskLayer(x, y);
+    // If masking isn't enabled, don't use it.
+    if (vgGeti(VG_MASKING) == VG_TRUE) {
+        _mask = vgCreateMaskLayer(x, y);
+    }
 #endif
 
     log_debug("VG Vendor is %s, VG Version is %s, VG Renderer is %s",
@@ -389,8 +392,9 @@ void
 Renderer_ovg::begin_display(gnash::rgba const&, int width, int height,
                             float x0, float x1, float y0, float y1)
 {
-    GNASH_REPORT_FUNCTION;
+    // GNASH_REPORT_FUNCTION;
 
+    // Disable masking
     vgSeti (VG_MASKING, VG_FALSE);
 
     VGfloat mat[9];
@@ -572,20 +576,24 @@ void
 Renderer_ovg::begin_submit_mask()
 {
     GNASH_REPORT_FUNCTION;
-    PathVec mask;
-    _masks.push_back(mask);
-    
-    _drawing_mask = true;
-    
+
+    // If masking is disabled, then we can't use it
+    if (vgGeti(VG_MASKING) == VG_TRUE) {
+        PathVec mask;
+        _masks.push_back(mask);
+        _drawing_mask = true;
+    }
 }
 
 void
 Renderer_ovg::end_submit_mask()
 {
     GNASH_REPORT_FUNCTION;
-    _drawing_mask = false;
-    
-    apply_mask();
+    // 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.
@@ -647,13 +655,15 @@ Renderer_ovg::disable_mask()
 {
     GNASH_REPORT_FUNCTION;
     
-    _masks.pop_back();
-    
-    if (_masks.empty()) {
-        vgSeti (VG_MASKING, VG_FALSE);
-    } else {
-        apply_mask();
-    }    
+    if (vgGeti(VG_MASKING) == VG_TRUE) {
+        _masks.pop_back();
+        
+        if (_masks.empty()) {
+            vgSeti (VG_MASKING, VG_FALSE);
+        } else {
+            apply_mask();
+        }
+    }
 }
 
 Path
@@ -832,19 +842,12 @@ Renderer_ovg::apply_fill_style(const FillStyle& style, 
const SWFMatrix& mat,
           rgba c = cx.transform(incolor);
           switch (fill_type) {
           case SWF::FILL_LINEAR_GRADIENT:
-          {
-              log_debug("FIXME: Fill Style Type: Linear Gradient");
-              // binfo->createLinearBitmap(sm, c, _fillpaint);
+              log_error("Fill Style Type: Linear Gradient, you shouldn't be 
here");
               break;
-          }
           case SWF::FILL_RADIAL_GRADIENT:
           case SWF::FILL_FOCAL_GRADIENT:
-          {
-              log_debug("Fill Style Type: Radial Gradient");
-              float radial = 0.5;
-              binfo->createRadialBitmap(mat.sx, mat.sy, mat.tx, mat.ty, 
radial, _fillpaint);
+              log_error("Fill Style Type: Radial Gradient, you shouldn't be 
here");
               break;
-          }
           default:
               std::abort();
           }
@@ -1062,16 +1065,17 @@ Renderer_ovg::draw_mask(const PathVec& path_vec)
 { 
     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_fill0 || cur_path.m_fill1) {
-            _masks.back().push_back(cur_path);
-            _masks.back().back().m_line = 0;    
-        }
-    }  
-    
+    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
@@ -1184,6 +1188,18 @@ Renderer_ovg::draw_subshape(const PathVec& path_vec,
                                           _display_width * 20.0f, 
_display_height * 20.0f,
                                           incolor, _fillpaint);
             }
+            if (fill_type == SWF::FILL_RADIAL_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.
+                binfo->createRadialBitmap((*(refs[0])).ap.x, (*(refs[0])).ap.y,
+                                          _display_width * 20.0f,
+                                          _display_height * 20.0f, 500,
+                                          incolor, _fillpaint);
+            }
             for (PathPtrVec::const_iterator it = refs.begin(), end = 
refs.end();
                  it != end; ++it) {
                 const Path& cur_path = *(*it);

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


commit 988ec330e66033b0808fbbe73a1978f814bbda9a
Author: Rob Savoye <address@hidden>
Date:   Wed Jan 26 17:21:55 2011 -0700

    dump the value of the Alpha Mask Size

diff --git a/libdevice/egl/eglDevice.cpp b/libdevice/egl/eglDevice.cpp
index f82da32..7aa213f 100644
--- a/libdevice/egl/eglDevice.cpp
+++ b/libdevice/egl/eglDevice.cpp
@@ -617,6 +617,8 @@ EGLDevice::printEGLConfig(EGLConfig config)
     std::cout << "\tEGL_BUFFER_SIZE is " << value  << std::endl;
     eglGetConfigAttrib(_eglDisplay, config, EGL_ALPHA_SIZE, &value);
     std::cout << "\tEGL_ALPHA_SIZE is " << value  << std::endl;
+    eglGetConfigAttrib(_eglDisplay, config, EGL_ALPHA_MASK_SIZE, &value);
+    std::cout << "\tEGL_ALPHA_MASK_SIZE is " << value  << std::endl;
     eglGetConfigAttrib(_eglDisplay, config, EGL_STENCIL_SIZE, &value);
     std::cout << "\tEGL_STENCIL_SIZE is " << value  << std::endl;
     eglGetConfigAttrib(_eglDisplay, config, EGL_SAMPLES, &value);

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

Summary of changes:
 gui/fb/fb.cpp                       |   47 +++++---
 gui/gtk/gtk_glue_ovg.cpp            |    2 +-
 libdevice/egl/eglDevice.cpp         |    2 +
 libdevice/events/InputDevice.cpp    |   53 +++-----
 libdevice/events/InputDevice.h      |   13 ++-
 libdevice/events/TouchDevice.cpp    |   42 ++----
 librender/linear.as                 |   11 +--
 librender/openvg/OpenVGBitmap.cpp   |  239 +++++++++++++++++++----------------
 librender/openvg/OpenVGBitmap.h     |   12 +-
 librender/openvg/OpenVGRenderer.cpp |  120 ++++++++----------
 10 files changed, 271 insertions(+), 270 deletions(-)


hooks/post-receive
-- 
Gnash



reply via email to

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