[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Gnash-commit] [SCM] Gnash branch, openvg, updated. c6d3c3ffbcdc61a0a5d8
From: |
Rob Savoye |
Subject: |
[Gnash-commit] [SCM] Gnash branch, openvg, updated. c6d3c3ffbcdc61a0a5d8bfe01f0b06984d1e5181 |
Date: |
Wed, 19 Jan 2011 18:27:19 +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 c6d3c3ffbcdc61a0a5d8bfe01f0b06984d1e5181 (commit)
via 3de6d6e16607ccc712f64ce239114b36d3514c29 (commit)
via 1eea82c92abedce5c7d980d64f3f3f3646ae5006 (commit)
via 867a9c09b37e42047a79b92dbe176caad9ef4691 (commit)
via 3f77250962c27e26a36c85a0ab68be79e9d64615 (commit)
via bb705e25b68fbaae29aa3d5b14babdd6006b7816 (commit)
via 826fc612f89b0554405cd2426bef8e4f7d5696d2 (commit)
via 4824895fd3dbd6d6ce0525f441ae2c4deaa5c9a7 (commit)
via e38638404e4a76d2d6286980303523ffd07867fc (commit)
via f49fe89e5ee4bcdd7358dbd89ca2159e9bafde6f (commit)
via 006ac95db511c2b638adae4a27735560ca90cc5a (commit)
via 8d7a0d5c400d8cd0ca675ca15c02f30f878ddb51 (commit)
via df82ffd3bacb3785ea541aba0771429abcc6e1e5 (commit)
from 543e494d6a61dbe6ffc549e6030bc99e8bddb4eb (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=c6d3c3ffbcdc61a0a5d8bfe01f0b06984d1e5181
commit c6d3c3ffbcdc61a0a5d8bfe01f0b06984d1e5181
Author: Rob Savoye <address@hidden>
Date: Wed Jan 19 11:26:51 2011 -0700
be less verbose
diff --git a/libdevice/egl/eglDevice.cpp b/libdevice/egl/eglDevice.cpp
index 148ad89..f82da32 100644
--- a/libdevice/egl/eglDevice.cpp
+++ b/libdevice/egl/eglDevice.cpp
@@ -131,7 +131,7 @@ EGLDevice::setAttrib(int bpp)
EGLDevice::~EGLDevice()
{
- GNASH_REPORT_FUNCTION;
+ // GNASH_REPORT_FUNCTION;
if (_eglDisplay != EGL_NO_DISPLAY) {
eglMakeCurrent(_eglDisplay, EGL_NO_SURFACE, EGL_NO_SURFACE,
EGL_NO_CONTEXT);
diff --git a/libdevice/egl/eglDevice.h b/libdevice/egl/eglDevice.h
index 8e2b35d..154177e 100644
--- a/libdevice/egl/eglDevice.h
+++ b/libdevice/egl/eglDevice.h
@@ -196,7 +196,7 @@ class EGLDevice : public GnashDevice
// directly.
// Swap to the default surface
bool swapBuffers() {
- GNASH_REPORT_FUNCTION;
+ // GNASH_REPORT_FUNCTION;
if (!isSingleBuffered()) {
return eglSwapBuffers(_eglDisplay, _eglSurface);
}
http://git.savannah.gnu.org/cgit//commit/?id=3de6d6e16607ccc712f64ce239114b36d3514c29
commit 3de6d6e16607ccc712f64ce239114b36d3514c29
Author: Rob Savoye <address@hidden>
Date: Wed Jan 19 11:26:40 2011 -0700
use a back buffer instead of single buffering
diff --git a/libdevice/egl/configTemplates.h b/libdevice/egl/configTemplates.h
index e184b0a..14927c8 100644
--- a/libdevice/egl/configTemplates.h
+++ b/libdevice/egl/configTemplates.h
@@ -186,7 +186,7 @@ const EGLint surface_attributes[] = {
// 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_SINGLE_BUFFER,
+ EGL_RENDER_BUFFER, EGL_BACK_BUFFER,
EGL_VG_COLORSPACE, EGL_VG_COLORSPACE_sRGB,
EGL_NONE
};
http://git.savannah.gnu.org/cgit//commit/?id=1eea82c92abedce5c7d980d64f3f3f3646ae5006
commit 1eea82c92abedce5c7d980d64f3f3f3646ae5006
Author: Rob Savoye <address@hidden>
Date: Wed Jan 19 11:26:00 2011 -0700
be less verbose
diff --git a/libdevice/GnashDevice.h b/libdevice/GnashDevice.h
index 5f9cc92..9d0e1de 100644
--- a/libdevice/GnashDevice.h
+++ b/libdevice/GnashDevice.h
@@ -54,9 +54,9 @@ struct GnashDevice
typedef enum {NODEV, EGL, DIRECTFB, X11, RAWFB} dtype_t;
GnashDevice(int argc, char *argv[]);
- GnashDevice() { GNASH_REPORT_FUNCTION; };
+ GnashDevice() { };
- virtual ~GnashDevice() { GNASH_REPORT_FUNCTION; };
+ virtual ~GnashDevice() { };
/// Get the type of the instatiated device. Since the
/// renderer has a single value for the supported device,
http://git.savannah.gnu.org/cgit//commit/?id=867a9c09b37e42047a79b92dbe176caad9ef4691
commit 867a9c09b37e42047a79b92dbe176caad9ef4691
Author: Rob Savoye <address@hidden>
Date: Wed Jan 19 11:25:46 2011 -0700
be less verbose
diff --git a/gui/fb/fb.cpp b/gui/fb/fb.cpp
index 472e22a..c7b5409 100644
--- a/gui/fb/fb.cpp
+++ b/gui/fb/fb.cpp
@@ -142,7 +142,7 @@ int terminate_request = false; // global scope to avoid
GUI access
std::auto_ptr<Gui> createFBGui(unsigned long windowid, float scale,
bool do_loop, RunResources& r)
{
- GNASH_REPORT_FUNCTION;
+ // GNASH_REPORT_FUNCTION;
return std::auto_ptr<Gui>(new FBGui(windowid, scale, do_loop, r));
}
@@ -162,7 +162,7 @@ FBGui::FBGui(unsigned long xid, float scale, bool loop,
RunResources& r)
_ypos(0),
_timeout(0)
{
- GNASH_REPORT_FUNCTION;
+ // GNASH_REPORT_FUNCTION;
// initializing to zero helps with debugging and prevents weird bugs
// memset(mouse_buf, 0, 256);
@@ -175,7 +175,7 @@ FBGui::FBGui(unsigned long xid, float scale, bool loop,
RunResources& r)
FBGui::~FBGui()
{
- GNASH_REPORT_FUNCTION;
+ // GNASH_REPORT_FUNCTION;
if (_fd > 0) {
enable_terminal();
@@ -187,7 +187,7 @@ FBGui::~FBGui()
bool
FBGui::init(int argc, char *** argv)
{
- GNASH_REPORT_FUNCTION;
+ // GNASH_REPORT_FUNCTION;
// the current renderer as set on the command line or gnashrc file
std::string renderer = _runResources.getRenderBackend();
@@ -273,7 +273,7 @@ FBGui::init(int argc, char *** argv)
bool
FBGui::run()
{
- GNASH_REPORT_FUNCTION;
+ // GNASH_REPORT_FUNCTION;
#ifdef USE_TSLIB
int ts_loop_count;
@@ -302,9 +302,6 @@ FBGui::run()
// FIXME: process the input data
// boost::shared_ptr<input_event_t> popData();
- draw_hack(_glue.get());
- //_glue->render();
-
// advance movie
Gui::advance_movie(this);
@@ -320,7 +317,7 @@ FBGui::run()
void
FBGui::renderBuffer()
{
- GNASH_REPORT_FUNCTION;
+ // GNASH_REPORT_FUNCTION;
// if ( _drawbounds.size() == 0 ) return; // nothing to do..
@@ -453,7 +450,8 @@ FBGui::setInvalidatedRegions(const InvalidatedRanges&
ranges)
char *
FBGui::find_accessible_tty(int no)
{
- GNASH_REPORT_FUNCTION;
+ // GNASH_REPORT_FUNCTION;
+
char* fn;
fn = find_accessible_tty("/dev/vc/%d", no); if (fn) return fn;
@@ -487,7 +485,8 @@ FBGui::find_accessible_tty(const char* format, int no)
bool
FBGui::disable_terminal()
{
- GNASH_REPORT_FUNCTION;
+ // GNASH_REPORT_FUNCTION;
+
_original_kd = -1;
struct vt_stat vts;
@@ -619,7 +618,8 @@ FBGui::disable_terminal()
bool
FBGui::enable_terminal()
{
- GNASH_REPORT_FUNCTION;
+ // GNASH_REPORT_FUNCTION;
+
log_debug(_("Restoring terminal..."));
char* tty = find_accessible_tty(_own_vt);
diff --git a/gui/fb/fb_glue_ovg.cpp b/gui/fb/fb_glue_ovg.cpp
index d25eb2b..ef0e556 100644
--- a/gui/fb/fb_glue_ovg.cpp
+++ b/gui/fb/fb_glue_ovg.cpp
@@ -42,18 +42,18 @@ namespace gui {
FBOvgGlue::FBOvgGlue(int fd)
: _stride(0)
{
- GNASH_REPORT_FUNCTION;
+ // GNASH_REPORT_FUNCTION;
}
FBOvgGlue::~FBOvgGlue()
{
- GNASH_REPORT_FUNCTION;
+ // GNASH_REPORT_FUNCTION;
}
bool
FBOvgGlue::init(int /* argc */, char **/*argv*/[])
{
- GNASH_REPORT_FUNCTION;
+ // GNASH_REPORT_FUNCTION;
bool egl = false;
#if 0
@@ -117,35 +117,27 @@ FBOvgGlue::init(int /* argc */, char **/*argv*/[])
_width = getWidth();
_height = getHeight();
-#if 1
+ // 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());
-#endif
- _device->attachWindow(_display.getHandle());
-
- float red_color[4] = {1.0, 0.0, 0.0, 1.0};
- float blue_color[4] = {0.0, 0.0, 1.0, 1.0};
-
- VGint scissor[4] = {100, 100, 25, 25};
- vgSetfv(VG_CLEAR_COLOR, 4, red_color);
- vgClear(0, 0, _width, _height);
-
- vgSetfv(VG_CLEAR_COLOR, 4, blue_color);
- vgClear(50, 50, 50, 50);
-
- //vgSetiv(VG_SCISSOR_RECTS, 4, scissor);
- //vgSeti(VG_SCISSORING, VG_TRUE);
- vgCopyPixels(100, 100, 50, 50, 50, 50);
- vgClear(150, 150, 50, 50);
-
- _device->swapBuffers();
-
- return true;
}
Renderer*
FBOvgGlue::createRenderHandler()
{
- GNASH_REPORT_FUNCTION;
+ // GNASH_REPORT_FUNCTION;
// Create the renderer
_renderer.reset(renderer::openvg::create_handler(0));
@@ -157,7 +149,7 @@ FBOvgGlue::createRenderHandler()
if (!_renderer) {
boost::format fmt = boost::format(
- _("Could not create OPENVG renderer"));
+ _("Could not create OpenVG renderer"));
throw GnashException(fmt.str());
}
@@ -186,7 +178,7 @@ FBOvgGlue::prepDrawingArea(void *drawing_area)
void
FBOvgGlue::render()
{
- GNASH_REPORT_FUNCTION;
+ // GNASH_REPORT_FUNCTION;
_device->swapBuffers();
}
diff --git a/gui/fb/fb_glue_ovg.h b/gui/fb/fb_glue_ovg.h
index 94ae24b..fb07d05 100644
--- a/gui/fb/fb_glue_ovg.h
+++ b/gui/fb/fb_glue_ovg.h
@@ -77,6 +77,7 @@ public:
// int height() { return (_device) ? _device->getHeight() : 0; };
int width() { return _width; };
int height() { return _height; };
+ int stride() { return _stride; };
// these are used only for debugging purpose to access private data
size_t getBounds() { return _drawbounds.size(); };
http://git.savannah.gnu.org/cgit//commit/?id=3f77250962c27e26a36c85a0ab68be79e9d64615
commit 3f77250962c27e26a36c85a0ab68be79e9d64615
Author: Rob Savoye <address@hidden>
Date: Wed Jan 19 11:24:56 2011 -0700
add accessor for the display depth from the device
diff --git a/libdevice/DeviceGlue.h b/libdevice/DeviceGlue.h
index 3833d6f..6636ecb 100644
--- a/libdevice/DeviceGlue.h
+++ b/libdevice/DeviceGlue.h
@@ -180,6 +180,9 @@ public:
/// based devices, this is the size of the display screen.
size_t getHeight() { return (_device) ? _device->getHeight() : 0; };
+ /// Depth of the display
+ size_t getDepth() { return (_device) ? _device->getDepth() : 0; };
+
/// Make the current buffer the active one.
bool swapBuffers() {
return (_device) ? _device->swapBuffers() : false;
http://git.savannah.gnu.org/cgit//commit/?id=bb705e25b68fbaae29aa3d5b14babdd6006b7816
commit bb705e25b68fbaae29aa3d5b14babdd6006b7816
Author: Rob Savoye <address@hidden>
Date: Wed Jan 19 11:24:22 2011 -0700
be less verbose
diff --git a/libdevice/events/EventDevice.cpp b/libdevice/events/EventDevice.cpp
index 3194a54..425bbac 100644
--- a/libdevice/events/EventDevice.cpp
+++ b/libdevice/events/EventDevice.cpp
@@ -44,7 +44,7 @@ EventDevice::EventDevice()
bool
EventDevice::init()
{
- GNASH_REPORT_FUNCTION;
+ // GNASH_REPORT_FUNCTION;
return init(INPUT_DEVICE, DEFAULT_BUFFER_SIZE);
}
@@ -52,7 +52,8 @@ EventDevice::init()
bool
EventDevice::init(const std::string &filespec, size_t /* size */)
{
- GNASH_REPORT_FUNCTION;
+ // GNASH_REPORT_FUNCTION;
+
dbglogfile.setVerbosity();
_filespec = filespec;
@@ -176,7 +177,7 @@ EventDevice::init(const std::string &filespec, size_t /*
size */)
log_unimpl("is an i2C bus type ");
break;
case BUS_HOST:
- log_debug("is Host bus type");
+ // log_debug("is Host bus type");
// ON the Babbage board, this is the evdev driver version 1.0.0
if (strstr(name, "mxc_ts") != 0) {
log_debug("Babbage Touchscreen found!");
diff --git a/libdevice/events/InputDevice.cpp b/libdevice/events/InputDevice.cpp
index 1661272..e5902fb 100644
--- a/libdevice/events/InputDevice.cpp
+++ b/libdevice/events/InputDevice.cpp
@@ -165,10 +165,10 @@ InputDevice::dump()
"Infrared Receiver"
};
- std::cerr << "Device type is: " << debug[_type] << std::endl;
- std::cerr << "\tfilespec is: " << _filespec
+ std::cerr << "Device type is: " << debug[_type];
+ std::cerr << ", \tfilespec is: " << _filespec
<< ", fd #" << _fd << std::endl;
- std::cerr << "\tX is: " << _x << ", Y is: " << _y << std::endl;
+// std::cerr << "\tX is: " << _x << ", Y is: " << _y << std::endl;
}
// Scan for all the possible input devices. This aggregates all
diff --git a/libdevice/events/MouseDevice.cpp b/libdevice/events/MouseDevice.cpp
index ec5736c..af38ea6 100644
--- a/libdevice/events/MouseDevice.cpp
+++ b/libdevice/events/MouseDevice.cpp
@@ -35,7 +35,7 @@ static const char *MOUSE_DEVICE = "/dev/input/mice";
MouseDevice::MouseDevice()
{
- GNASH_REPORT_FUNCTION;
+ // GNASH_REPORT_FUNCTION;
}
std::vector<boost::shared_ptr<InputDevice> >
@@ -109,7 +109,7 @@ MouseDevice::scanForDevices()
bool
MouseDevice::init()
{
- GNASH_REPORT_FUNCTION;
+ // GNASH_REPORT_FUNCTION;
return init(MOUSE_DEVICE, DEFAULT_BUFFER_SIZE);
}
@@ -117,7 +117,7 @@ MouseDevice::init()
bool
MouseDevice::init(const std::string &filespec, size_t size)
{
- GNASH_REPORT_FUNCTION;
+ // GNASH_REPORT_FUNCTION;
_type = MOUSE;
_filespec = filespec;
@@ -325,7 +325,7 @@ MouseDevice::check()
bool
MouseDevice::command(unsigned char cmd, unsigned char *buf, int count)
{
- GNASH_REPORT_FUNCTION;
+ // GNASH_REPORT_FUNCTION;
int n;
diff --git a/libdevice/events/TouchDevice.cpp b/libdevice/events/TouchDevice.cpp
index a15aef6..5a5fbfd 100644
--- a/libdevice/events/TouchDevice.cpp
+++ b/libdevice/events/TouchDevice.cpp
@@ -49,11 +49,13 @@ static const char *TSLIB_DEVICE_NAME = "/dev/ts";
TouchDevice::TouchDevice()
{
- GNASH_REPORT_FUNCTION;
+ // GNASH_REPORT_FUNCTION;
}
TouchDevice::~TouchDevice()
{
+ // GNASH_REPORT_FUNCTION;
+
if (_tsDev) {
ts_close(_tsDev);
}
@@ -68,7 +70,7 @@ TouchDevice::init()
bool
TouchDevice::init(const std::string &filespec, size_t /* size */)
{
- GNASH_REPORT_FUNCTION;
+ // GNASH_REPORT_FUNCTION;
_type = TouchDevice::TOUCHSCREEN;
_filespec = filespec;
http://git.savannah.gnu.org/cgit//commit/?id=826fc612f89b0554405cd2426bef8e4f7d5696d2
commit 826fc612f89b0554405cd2426bef8e4f7d5696d2
Author: Rob Savoye <address@hidden>
Date: Wed Jan 19 11:23:09 2011 -0700
Add comments.
Make less verbose now that it works.
Remove overloaded begin_display() that was causing trouble.
diff --git a/librender/openvg/OpenVGRenderer.cpp
b/librender/openvg/OpenVGRenderer.cpp
index 90591f0..68ce53b 100644
--- a/librender/openvg/OpenVGRenderer.cpp
+++ b/librender/openvg/OpenVGRenderer.cpp
@@ -77,6 +77,9 @@ 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:
@@ -186,7 +189,7 @@ Renderer_ovg::Renderer_ovg()
, _mask(0)
#endif
{
- GNASH_REPORT_FUNCTION;
+ // GNASH_REPORT_FUNCTION;
}
Renderer_ovg::Renderer_ovg(renderer::GnashDevice::dtype_t /* dtype */)
@@ -344,29 +347,52 @@ Renderer_ovg::pixel_to_world(int x, int y)
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
+/// @param x1 - maximum frame size in X dimension
+/// @param y0 - minimum frame size in Y dimension
+/// @param y1 - maximum frame size in Y dimension
void
-Renderer_ovg::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)
+Renderer_ovg::begin_display(gnash::rgba const&, int width, int height,
+ float x0, float x1, float y0, float y1)
{
GNASH_REPORT_FUNCTION;
vgSeti (VG_MASKING, VG_FALSE);
- float mat[9];
+ VGfloat mat[9];
memset(mat, 0, sizeof(mat));
- mat[0] = (float)_display_width / float(x1 - x0); // scale sx
+ // 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.
+ mat[0] = (VGfloat)width / VGfloat(x1 - x0); // scale sx
mat[1] = 0; // shx
mat[3] = 0; // shy
- mat[4] = -((float)_display_height / float(y1 - y0)); // scale sy
+ mat[4] = -((VGfloat)height / VGfloat(y1 - y0)); // scale sy
mat[6] = 0; // shift tx
- mat[7] = _display_height; // shift ty
+ mat[7] = height; // shift ty
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);
- }
+}
void
Renderer_ovg::end_display()
@@ -569,7 +595,8 @@ Renderer_ovg::apply_mask()
void
Renderer_ovg::add_paths(const PathVec& path_vec)
{
- GNASH_REPORT_FUNCTION;
+ // GNASH_REPORT_FUNCTION;
+
SWFCxForm dummy_cx;
FillStyle coloring = FillStyle(SolidFill(rgba(0, 255, 0, 255)));
@@ -581,6 +608,7 @@ void
Renderer_ovg::disable_mask()
{
GNASH_REPORT_FUNCTION;
+
_masks.pop_back();
if (_masks.empty()) {
@@ -634,7 +662,7 @@ const Path *
Renderer_ovg::find_connecting_path(const Path& to_connect,
std::list<const Path*> path_refs)
{
- GNASH_REPORT_FUNCTION;
+ // GNASH_REPORT_FUNCTION;
float target_x = to_connect.m_edges.back().ap.x;
float target_y = to_connect.m_edges.back().ap.y;
@@ -668,7 +696,7 @@ Renderer_ovg::find_connecting_path(const Path& to_connect,
PathVec
Renderer_ovg::normalize_paths(const PathVec &paths)
{
- GNASH_REPORT_FUNCTION;
+ // GNASH_REPORT_FUNCTION;
PathVec normalized;
@@ -717,7 +745,7 @@ void
Renderer_ovg::analyze_paths(const PathVec &paths, bool& have_shape,
bool& have_outline)
{
- GNASH_REPORT_FUNCTION;
+ // GNASH_REPORT_FUNCTION;
have_shape = false;
have_outline = false;
@@ -912,7 +940,7 @@ void
Renderer_ovg::draw_outlines(const PathVec& path_vec, const SWFMatrix& mat,
const SWFCxForm& cx, const std::vector<LineStyle>&
line_styles)
{
- GNASH_REPORT_FUNCTION;
+ // GNASH_REPORT_FUNCTION;
for (PathVec::const_iterator it = path_vec.begin(), end = path_vec.end();
it != end; ++it) {
@@ -942,7 +970,7 @@ Renderer_ovg::draw_outlines(const PathVec& path_vec, const
SWFMatrix& mat,
std::list<PathPtrVec>
Renderer_ovg::get_contours(const PathPtrVec &paths)
{
- GNASH_REPORT_FUNCTION;
+ // GNASH_REPORT_FUNCTION;
std::list<const Path*> path_refs;
std::list<PathPtrVec> contours;
@@ -1008,7 +1036,7 @@ Renderer_ovg::draw_mask(const PathVec& path_vec)
PathPtrVec
Renderer_ovg::paths_by_style(const PathVec& path_vec, unsigned int style)
{
- GNASH_REPORT_FUNCTION;
+ // GNASH_REPORT_FUNCTION;
PathPtrVec paths;
for (PathVec::const_iterator it = path_vec.begin(), end = path_vec.end();
@@ -1031,7 +1059,8 @@ Renderer_ovg::paths_by_style(const PathVec& path_vec,
unsigned int style)
std::vector<PathVec::const_iterator>
Renderer_ovg::find_subshapes(const PathVec& path_vec)
{
- GNASH_REPORT_FUNCTION;
+ // GNASH_REPORT_FUNCTION;
+
std::vector<PathVec::const_iterator> subshapes;
PathVec::const_iterator it = path_vec.begin(),
@@ -1060,6 +1089,7 @@ 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)));
}
@@ -1071,7 +1101,8 @@ Renderer_ovg::draw_subshape(const PathVec& path_vec,
const std::vector<FillStyle>& fill_styles,
const std::vector<LineStyle>& line_styles)
{
- GNASH_REPORT_FUNCTION;
+ // GNASH_REPORT_FUNCTION;
+
PathVec normalized = normalize_paths(path_vec);
for (size_t i = 0; i < fill_styles.size(); ++i) {
@@ -1265,7 +1296,7 @@ Renderer_ovg::set_invalidated_regions(const
InvalidatedRanges& /* ranges */)
DSOEXPORT Renderer *
create_handler(const char */* pixelformat */)
{
- GNASH_REPORT_FUNCTION;
+ // GNASH_REPORT_FUNCTION;
Renderer_ovg *renderer = new Renderer_ovg;
return renderer;
@@ -1536,12 +1567,6 @@ Renderer_ovg::endInternalRender()
}
void
-Renderer_ovg::begin_display(gnash::rgba const&, int, int, float, float, float,
float)
-{
- // GNASH_REPORT_FUNCTION;
-
-}
-void
Renderer_ovg::drawVideoFrame(gnash::image::GnashImage*, gnash::Transform
const&, gnash::SWFRect const*, bool)
{
GNASH_REPORT_FUNCTION;
diff --git a/librender/openvg/OpenVGRenderer.h
b/librender/openvg/OpenVGRenderer.h
index 6799efe..f12a6b2 100644
--- a/librender/openvg/OpenVGRenderer.h
+++ b/librender/openvg/OpenVGRenderer.h
@@ -83,14 +83,9 @@ public:
geometry::Range2d<int> world_to_pixel(const geometry::Range2d<float>& wb);
gnash::point pixel_to_world(int, int);
- // this is in master
+ // Called by movie_root::display()
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);
+ float, float, float);
void end_display();
void drawLine(const std::vector<point>& coords, const rgba& fill,
const SWFMatrix& mat);
http://git.savannah.gnu.org/cgit//commit/?id=4824895fd3dbd6d6ce0525f441ae2c4deaa5c9a7
commit 4824895fd3dbd6d6ce0525f441ae2c4deaa5c9a7
Author: Rob Savoye <address@hidden>
Date: Wed Jan 19 11:22:44 2011 -0700
update comment
diff --git a/librender/Renderer.h b/librender/Renderer.h
index 616751f..7681630 100644
--- a/librender/Renderer.h
+++ b/librender/Renderer.h
@@ -564,7 +564,7 @@ public:
///
/// TODO: this should be a pure abstract function, just don't want
/// to scan ogl and cairo backend for an implementation *now*
- /// but would be needed for automated testing... Quinn, can you help ?
+ /// but would be needed for automated testing...
virtual unsigned int getBitsPerPixel() const {
return 0;
}
@@ -628,7 +628,6 @@ protected:
RenderImages _render_images;
private:
-
/// Bracket the displaying of a frame from a movie.
//
/// Set up to render a full frame from a movie and fills the
http://git.savannah.gnu.org/cgit//commit/?id=e38638404e4a76d2d6286980303523ffd07867fc
commit e38638404e4a76d2d6286980303523ffd07867fc
Author: Rob Savoye <address@hidden>
Date: Mon Jan 17 16:54:07 2011 -0700
get image handling of bitmaps working
diff --git a/librender/openvg/OpenVGBitmap.cpp
b/librender/openvg/OpenVGBitmap.cpp
index 8b4582b..4f33f04 100644
--- a/librender/openvg/OpenVGBitmap.cpp
+++ b/librender/openvg/OpenVGBitmap.cpp
@@ -32,11 +32,46 @@ namespace openvg {
static const int NUM_STOPS = 10;
OpenVGBitmap::OpenVGBitmap(VGPaint paint)
+ : _vgimage(VG_INVALID_HANDLE),
+ _pixel_format(VG_sRGB_565), // was VG_sARGB_8888, VG_sRGB_565
+ _vgpaint(paint)
{
GNASH_REPORT_FUNCTION;
- if (paint) {
- _vgpaint = paint;
+}
+
+OpenVGBitmap::OpenVGBitmap(CachedBitmap *bitmap, VGPaint vgpaint)
+ : _pixel_format(VG_sRGBA_8888), // was VG_sARGB_8888, VG_sRGB_565
+ _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);
+
+ // Create a VG image
+#ifdef BUILD_X11_DEVICE
+ _vgimage = vgCreateImage(VG_sRGBA_8888, im.width(), im.height(),
+ VG_IMAGE_QUALITY_FASTER);
+ // Copy the image data into the VG image container
+ vgImageSubData(_vgimage, im.begin(), 0, VG_sRGBA_8888,
+ 0, 0, im.width(), im.height());
+#else
+ _vgimage = vgCreateImage(VG_sRGB_565, im.width(), im.height(),
+ VG_IMAGE_QUALITY_FASTER);
+ // Copy the image data into the VG image container
+ vgImageSubData(_vgimage, im.begin(), im.width() * 2, VG_sRGB_565,
+ 0, 0, im.width(), im.height());
+#endif
+ if (_vgimage == VG_INVALID_HANDLE) {
+ log_error("Failed to create VG image! %s",
Renderer_ovg::getErrorString(vgGetError()));
}
+
+ // vgPaintPattern(_vgpaint, _vgimage);
+ // vgDrawImage(_vgimage);
+ // vgFlush();
}
//
@@ -44,14 +79,15 @@ OpenVGBitmap::OpenVGBitmap(VGPaint paint)
// VG_sRGBA_5551
// VG_sRGBA_4444
// VG_A_8
-OpenVGBitmap::OpenVGBitmap(std::auto_ptr<image::GnashImage> image, VGPaint
paint)
+// VG_A_4
+OpenVGBitmap::OpenVGBitmap(image::GnashImage *image, VGPaint vgpaint)
:
_image(image),
- _pixel_format(VG_A_4), // was VG_sARGB_8888 VG_sRGB_565
- _vgpaint(paint)
+ _pixel_format(VG_sRGB_565), // was VG_sARGB_8888, VG_sRGB_565
+ _vgpaint(vgpaint)
{
GNASH_REPORT_FUNCTION;
-
+
size_t width = _image->width();
size_t height = _image->height();
@@ -59,26 +95,36 @@ OpenVGBitmap::OpenVGBitmap(std::auto_ptr<image::GnashImage>
image, VGPaint paint
_vgimage = vgCreateImage(_pixel_format, width, height,
VG_IMAGE_QUALITY_FASTER);
- vgImageSubData(_vgimage, _image->begin(), width * 4, _pixel_format,
+ vgImageSubData(_vgimage, image->begin(), width * 4, _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);
+ vgPaintPattern(vgpaint, _vgimage);
+ vgDrawImage(_vgimage);
+ vgFlush();
+
+#if 0
_tex_size += width * height * 4;
log_debug("Add Texture size:%d (%d x %d x %dbpp)", width * height * 4,
width, height, 4);
log_debug("Current Texture size: %d", _tex_size);
+#endif
}
OpenVGBitmap::~OpenVGBitmap()
{
GNASH_REPORT_FUNCTION;
+#if 0
_tex_size -= _image->width() * _image->height() * 4;
log_debug(_("Remove Texture size:%d (%d x %d x %dbpp)"),
_image->width() * _image->height() * 4,
_image->width(), _image->height(), 4);
log_debug(_("Current Texture size: %d"), _tex_size);
-
-// vgDestroyPaint(_vgpaint);
+#endif
+
+ vgDestroyPaint(_vgpaint);
vgDestroyImage(_vgimage);
}
@@ -104,8 +150,14 @@ OpenVGBitmap::apply(const gnash::SWFMatrix& bitmap_matrix,
mat = bitmap_matrix;
vgSetParameteri (paint, VG_PAINT_TYPE, VG_PAINT_TYPE_PATTERN);
- vgPaintPattern (paint, _vgimage);
+
+ if (_vgimage == VG_INVALID_HANDLE) {
+ log_error("No cached VG image!");
+ }
+ // Paint the cached VG image into the VG paint surface
+ vgPaintPattern (paint, _vgimage);
+
mat.invert();
memset(vmat, 0, sizeof(vmat));
vmat[0] = mat.sx / 65536.0f;
@@ -171,20 +223,43 @@ OpenVGBitmap::createLinearBitmap(float x0, float y0,
float x1, float y1, VGPaint
// Create and fill pattern image
OpenVGBitmap *
-OpenVGBitmap::createPatternBitmap(std::auto_ptr<image::GnashImage> im, VGPaint
paint)
+OpenVGBitmap::createPatternBitmap(image::GnashImage &im, VGPaint vgpaint)
+{
+ 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();
+ }
+
+ return this;
+}
+
+ // Create and fill pattern image
+OpenVGBitmap *
+OpenVGBitmap::createPatternBitmap()
{
GNASH_REPORT_FUNCTION;
- if (paint != VG_INVALID_HANDLE) {
- _vgimage = vgCreateImage(_pixel_format, im->width(), im->height(),
+ if (_vgpaint != VG_INVALID_HANDLE) {
+ VGImage vgimage = vgCreateImage(_pixel_format, _image->width(),
_image->height(),
VG_IMAGE_QUALITY_FASTER);
- vgImageSubData(_vgimage, im->begin(), 4*im->width(), /* stride */
- _pixel_format, 0, 0, im->width(), im->height());
+ 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);
+ vgPaintPattern(_vgpaint, vgimage);
+ vgDrawImage(vgimage);
vgFlush();
}
diff --git a/librender/openvg/OpenVGBitmap.h b/librender/openvg/OpenVGBitmap.h
index c3ebc31..fb302ab 100644
--- a/librender/openvg/OpenVGBitmap.h
+++ b/librender/openvg/OpenVGBitmap.h
@@ -39,8 +39,8 @@ public:
enum bitmap_wrap_mode { WRAP_REPEAT, WRAP_CLAMP };
OpenVGBitmap(VGPaint paint);
- OpenVGBitmap(const CachedBitmap *bitmap, VGPaint vgpaint);
- OpenVGBitmap(std::auto_ptr<image::GnashImage> im, VGPaint vgpaint);
+ OpenVGBitmap(CachedBitmap *bitmap, VGPaint vgpaint);
+ OpenVGBitmap(image::GnashImage *im, VGPaint vgpaint);
~OpenVGBitmap();
void dispose() { _image.reset(); }
@@ -63,8 +63,9 @@ public:
float y1, float radial, VGPaint paint);
OpenVGBitmap *createLinearBitmap(float x0, float y0, float x1,
float y1, VGPaint paint);
- OpenVGBitmap *createPatternBitmap(std::auto_ptr<image::GnashImage> im,
+ OpenVGBitmap *createPatternBitmap(image::GnashImage &im,
VGPaint paint);
+ OpenVGBitmap *createPatternBitmap();
private:
boost::scoped_ptr<image::GnashImage> _image;
diff --git a/librender/openvg/OpenVGRenderer.cpp
b/librender/openvg/OpenVGRenderer.cpp
index 557e7c3..90591f0 100644
--- a/librender/openvg/OpenVGRenderer.cpp
+++ b/librender/openvg/OpenVGRenderer.cpp
@@ -204,7 +204,10 @@ Renderer_ovg::Renderer_ovg(renderer::GnashDevice::dtype_t
/* dtype */)
_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);
}
@@ -218,10 +221,12 @@ Renderer_ovg::init(float x, float y)
_fillpaint = vgCreatePaint();
- log_debug("FIXME: %s: %p", __FUNCTION__, _fillpaint);
_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);
// Turn on alpha blending.
@@ -265,10 +270,8 @@
Renderer_ovg::createCachedBitmap(std::auto_ptr<image::GnashImage> im)
// OpenVG don't support 24bit RGB, so we need to translate
// the colorspace
-// image::GnashImage &image = im.release();
- return reinterpret_cast<CachedBitmap *>(new OpenVGBitmap(im, _fillpaint));
-
- return 0;
+ image::GnashImage *image = im.release();
+ return reinterpret_cast<CachedBitmap *>(new OpenVGBitmap(image,
_fillpaint));
}
// Since we store drawing operations in display lists, we take special care
@@ -286,6 +289,8 @@ Renderer_ovg::drawVideoFrame(image::GnashImage* /* frame
*/, const SWFMatrix* /*
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.
@@ -298,6 +303,8 @@ Renderer_ovg::world_to_pixel(int& x, int& y, float world_x,
float world_y)
geometry::Range2d<int>
Renderer_ovg::world_to_pixel(const SWFRect& wb)
{
+ GNASH_REPORT_FUNCTION;
+
using namespace gnash::geometry;
if ( wb.is_null() ) return Range2d<int>(nullRange);
@@ -314,6 +321,8 @@ Renderer_ovg::world_to_pixel(const SWFRect& wb)
geometry::Range2d<int>
Renderer_ovg::world_to_pixel(const geometry::Range2d<float>& wb)
{
+ GNASH_REPORT_FUNCTION;
+
if (wb.isNull() || wb.isWorld()) return wb;
int xmin, ymin, xmax, ymax;
@@ -327,6 +336,8 @@ Renderer_ovg::world_to_pixel(const
geometry::Range2d<float>& wb)
point
Renderer_ovg::pixel_to_world(int x, int y)
{
+ GNASH_REPORT_FUNCTION;
+
point p(x, y);
SWFMatrix mat = stage_matrix;
mat.invert().transform(p);
@@ -433,6 +444,7 @@ Renderer_ovg::drawPoly(const point* corners, size_t
corner_count,
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;
@@ -581,6 +593,7 @@ Renderer_ovg::disable_mask()
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;
@@ -621,6 +634,8 @@ 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;
@@ -653,7 +668,7 @@ Renderer_ovg::find_connecting_path(const Path& to_connect,
PathVec
Renderer_ovg::normalize_paths(const PathVec &paths)
{
- // GNASH_REPORT_FUNCTION;
+ GNASH_REPORT_FUNCTION;
PathVec normalized;
@@ -702,27 +717,28 @@ void
Renderer_ovg::analyze_paths(const PathVec &paths, bool& have_shape,
bool& have_outline)
{
- // GNASH_REPORT_FUNCTION;
+ GNASH_REPORT_FUNCTION;
- have_shape=false;
- have_outline=false;
+ have_shape = false;
+ have_outline = false;
int pcount = paths.size();
- for (int pno=0; pno<pcount; pno++) {
+ for (int pno= 0; pno<pcount; pno++) {
const Path &the_path = paths[pno];
- if ((the_path.m_fill0>0) || (the_path.m_fill1>0)) {
- have_shape=true;
+ // 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 (the_path.m_line>0) {
- have_outline=true;
+ // 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
}
-
}
}
@@ -739,13 +755,13 @@ Renderer_ovg::apply_fill_style(const FillStyle& style,
const SWFMatrix& mat,
case SWF::FILL_RADIAL_GRADIENT:
case SWF::FILL_FOCAL_GRADIENT:
{
- log_debug("Fill Style Type: Gradient");
OpenVGBitmap* binfo = new OpenVGBitmap(_fillpaint);
GradientFill::Type gt;
switch (fill_type) {
case SWF::FILL_LINEAR_GRADIENT:
{
+ log_debug("Fill Style Type: Linear Gradient");
binfo->createLinearBitmap(mat.sx, mat.sy, mat.tx, mat.ty,
_fillpaint);
break;
@@ -753,6 +769,7 @@ Renderer_ovg::apply_fill_style(const FillStyle& style,
const SWFMatrix& mat,
case SWF::FILL_RADIAL_GRADIENT:
case SWF::FILL_FOCAL_GRADIENT:
{
+ log_debug("Fill Style Type: Radial Gradient");
float x0, y0, x1, y1, radial;
binfo->createRadialBitmap(x0, y0, x1, y1, radial, _fillpaint);
break;
@@ -768,11 +785,11 @@ Renderer_ovg::apply_fill_style(const FillStyle& style,
const SWFMatrix& mat,
case SWF::FILL_TILED_BITMAP_HARD:
case SWF::FILL_TILED_BITMAP:
{
+ log_debug("Fill Style Type: Tiled Bitmap");
SWFMatrix sm = boost::apply_visitor(GetMatrix(), style.fill);
CachedBitmap *cb = boost::apply_visitor(GetBitmap(), style.fill);
- std::auto_ptr<image::GnashImage> im(&cb->image());
- OpenVGBitmap *binfo = new OpenVGBitmap(_fillpaint);
- binfo->createPatternBitmap(im, _fillpaint);
+ // std::auto_ptr<image::GnashImage> im(&cb->image());
+ OpenVGBitmap *binfo = new OpenVGBitmap(cb, _fillpaint);
binfo->apply(sm, OpenVGBitmap::WRAP_REPEAT, _fillpaint);
break;
}
@@ -780,15 +797,22 @@ Renderer_ovg::apply_fill_style(const FillStyle& style,
const SWFMatrix& mat,
case SWF::FILL_CLIPPED_BITMAP:
case SWF::FILL_CLIPPED_BITMAP_HARD:
{
+ log_debug("Fill Style Type: Clipped Bitmap");
SWFMatrix sm = boost::apply_visitor(GetMatrix(), style.fill);
+
CachedBitmap *cb = boost::apply_visitor(GetBitmap(), style.fill);
- std::auto_ptr<image::GnashImage> im(&cb->image());
+ 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_CLAMP, _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[] = {
@@ -802,7 +826,7 @@ Renderer_ovg::apply_fill_style(const FillStyle& style,
const SWFMatrix& mat,
vgSetParameterfv (_fillpaint, VG_PAINT_COLOR, 4, color);
}
- } // switch
+ } // switch fill_type
}
bool
@@ -888,7 +912,7 @@ void
Renderer_ovg::draw_outlines(const PathVec& path_vec, const SWFMatrix& mat,
const SWFCxForm& cx, const std::vector<LineStyle>&
line_styles)
{
- // GNASH_REPORT_FUNCTION;
+ GNASH_REPORT_FUNCTION;
for (PathVec::const_iterator it = path_vec.begin(), end = path_vec.end();
it != end; ++it) {
@@ -918,7 +942,7 @@ Renderer_ovg::draw_outlines(const PathVec& path_vec, const
SWFMatrix& mat,
std::list<PathPtrVec>
Renderer_ovg::get_contours(const PathPtrVec &paths)
{
- // GNASH_REPORT_FUNCTION;
+ GNASH_REPORT_FUNCTION;
std::list<const Path*> path_refs;
std::list<PathPtrVec> contours;
@@ -984,6 +1008,8 @@ Renderer_ovg::draw_mask(const PathVec& path_vec)
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) {
@@ -1005,6 +1031,7 @@ Renderer_ovg::paths_by_style(const PathVec& path_vec,
unsigned int style)
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(),
@@ -1032,6 +1059,7 @@ Renderer_ovg::find_subshapes(const PathVec& path_vec)
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)));
}
@@ -1043,6 +1071,7 @@ Renderer_ovg::draw_subshape(const PathVec& path_vec,
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) {
@@ -1092,6 +1121,7 @@ Renderer_ovg::draw_submask(const PathVec& path_vec,
const SWFCxForm& /* cx */,
const FillStyle& /* f_style */)
{
+ GNASH_REPORT_FUNCTION;
PathVec normalized = normalize_paths(path_vec);
@@ -1139,12 +1169,11 @@ Renderer_ovg::draw_submask(const PathVec& path_vec,
// 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.
-// FIMXE: this doesn't work anymore as the API has changed.
void
Renderer_ovg::drawShape(gnash::SWF::ShapeRecord const &shape,
gnash::Transform const& xform)
{
- // GNASH_REPORT_FUNCTION;
+ GNASH_REPORT_FUNCTION;
const PathVec& path_vec = shape.paths();
@@ -1216,7 +1245,10 @@ Renderer_ovg::drawGlyph(const SWF::ShapeRecord& rec,
const rgba& c,
}
void
-Renderer_ovg::set_scale(float xscale, float yscale) {
+Renderer_ovg::set_scale(float xscale, float yscale)
+{
+ GNASH_REPORT_FUNCTION;
+
_xscale = xscale;
_yscale = yscale;
stage_matrix.set_identity();
@@ -1227,7 +1259,7 @@ void
Renderer_ovg::set_invalidated_regions(const InvalidatedRanges& /* ranges */)
{
// do nothing obviously. This method is required by the base class though,
- // something has to be here.
+ // so something has to be here.
}
DSOEXPORT Renderer *
@@ -1521,6 +1553,48 @@ 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
diff --git a/librender/openvg/OpenVGRenderer.h
b/librender/openvg/OpenVGRenderer.h
index 9e9e6dd..6799efe 100644
--- a/librender/openvg/OpenVGRenderer.h
+++ b/librender/openvg/OpenVGRenderer.h
@@ -126,6 +126,8 @@ public:
void printVGParams();
void printVGHardware();
void printVGPath();
+
+ static const char *getErrorString(VGErrorCode error);
#if 0
// These are all required by the Render class
void draw_poly(const point* corners, size_t corner_count,
@@ -185,7 +187,10 @@ public:
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;
#ifdef OPENVG_VERSION_1_1
http://git.savannah.gnu.org/cgit//commit/?id=f49fe89e5ee4bcdd7358dbd89ca2159e9bafde6f
commit f49fe89e5ee4bcdd7358dbd89ca2159e9bafde6f
Author: Rob Savoye <address@hidden>
Date: Mon Jan 17 16:52:38 2011 -0700
add accessor for variant to return GnahImage
diff --git a/librender/openvg/OpenVGStyle.h b/librender/openvg/OpenVGStyle.h
index 2127a3b..c9fe171 100644
--- a/librender/openvg/OpenVGStyle.h
+++ b/librender/openvg/OpenVGStyle.h
@@ -111,6 +111,24 @@ public:
}
};
+/// 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>
{
http://git.savannah.gnu.org/cgit//commit/?id=006ac95db511c2b638adae4a27735560ca90cc5a
commit 006ac95db511c2b638adae4a27735560ca90cc5a
Author: Rob Savoye <address@hidden>
Date: Sun Jan 16 19:16:21 2011 -0700
call prepDrawingArea() for OPenVG too
diff --git a/gui/gtk/gtk_canvas.cpp b/gui/gtk/gtk_canvas.cpp
index 2c1a5e4..57317b0 100644
--- a/gui/gtk/gtk_canvas.cpp
+++ b/gui/gtk/gtk_canvas.cpp
@@ -188,7 +188,7 @@ gnash_canvas_realize(GtkWidget *widget)
&attributes, attributes_mask);
gdk_window_set_user_data (widget->window, widget);
-#if defined(RENDERER_CAIRO) || defined(RENDERER_AGG)
+#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
http://git.savannah.gnu.org/cgit//commit/?id=8d7a0d5c400d8cd0ca675ca15c02f30f878ddb51
commit 8d7a0d5c400d8cd0ca675ca15c02f30f878ddb51
Author: Rob Savoye <address@hidden>
Date: Sun Jan 16 19:14:44 2011 -0700
don't swap if single buffered
diff --git a/libdevice/egl/eglDevice.cpp b/libdevice/egl/eglDevice.cpp
index 91871cf..148ad89 100644
--- a/libdevice/egl/eglDevice.cpp
+++ b/libdevice/egl/eglDevice.cpp
@@ -286,8 +286,8 @@ EGLDevice::initDevice(int argc, char *argv[])
} else {
printEGLConfig(_eglConfig);
}
-
- return true;
+
+ return true;
}
bool
diff --git a/libdevice/egl/eglDevice.h b/libdevice/egl/eglDevice.h
index 55e22b5..8e2b35d 100644
--- a/libdevice/egl/eglDevice.h
+++ b/libdevice/egl/eglDevice.h
@@ -197,7 +197,10 @@ class EGLDevice : public GnashDevice
// Swap to the default surface
bool swapBuffers() {
GNASH_REPORT_FUNCTION;
- return eglSwapBuffers(_eglDisplay, _eglSurface);
+ if (!isSingleBuffered()) {
+ return eglSwapBuffers(_eglDisplay, _eglSurface);
+ }
+ return true;
}
bool copyPbuffers(size_t x) {
GNASH_REPORT_FUNCTION;
http://git.savannah.gnu.org/cgit//commit/?id=df82ffd3bacb3785ea541aba0771429abcc6e1e5
commit df82ffd3bacb3785ea541aba0771429abcc6e1e5
Author: Rob Savoye <address@hidden>
Date: Sat Jan 15 09:14:56 2011 -0700
clean up formatting
diff --git a/libcore/FillStyle.cpp b/libcore/FillStyle.cpp
index 1b325ef..e4173cf 100644
--- a/libcore/FillStyle.cpp
+++ b/libcore/FillStyle.cpp
@@ -184,7 +184,9 @@ BitmapFill::bitmap() const
if (_bitmapInfo) {
return _bitmapInfo->disposed() ? 0 : _bitmapInfo.get();
}
- if (!_md) return 0;
+ if (!_md) {
+ return 0;
+ }
_bitmapInfo = _md->getBitmap(_id);
// May still be 0!
-----------------------------------------------------------------------
Summary of changes:
gui/fb/fb.cpp | 24 +++---
gui/fb/fb_glue_ovg.cpp | 48 ++++------
gui/fb/fb_glue_ovg.h | 1 +
gui/gtk/gtk_canvas.cpp | 2 +-
libcore/FillStyle.cpp | 4 +-
libdevice/DeviceGlue.h | 3 +
libdevice/GnashDevice.h | 4 +-
libdevice/egl/configTemplates.h | 2 +-
libdevice/egl/eglDevice.cpp | 6 +-
libdevice/egl/eglDevice.h | 7 +-
libdevice/events/EventDevice.cpp | 7 +-
libdevice/events/InputDevice.cpp | 6 +-
libdevice/events/MouseDevice.cpp | 8 +-
libdevice/events/TouchDevice.cpp | 6 +-
librender/Renderer.h | 3 +-
librender/openvg/OpenVGBitmap.cpp | 109 ++++++++++++++++++----
librender/openvg/OpenVGBitmap.h | 7 +-
librender/openvg/OpenVGRenderer.cpp | 181 +++++++++++++++++++++++++++--------
librender/openvg/OpenVGRenderer.h | 14 ++--
librender/openvg/OpenVGStyle.h | 18 ++++
20 files changed, 328 insertions(+), 132 deletions(-)
hooks/post-receive
--
Gnash
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Gnash-commit] [SCM] Gnash branch, openvg, updated. c6d3c3ffbcdc61a0a5d8bfe01f0b06984d1e5181,
Rob Savoye <=