[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Gnash-commit] [SCM] Gnash branch, openvg, updated. 2f13e506863737e64a7f
From: |
Rob Savoye |
Subject: |
[Gnash-commit] [SCM] Gnash branch, openvg, updated. 2f13e506863737e64a7fb6f92cb31de3f3744310 |
Date: |
Thu, 28 Oct 2010 18:15:48 +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 2f13e506863737e64a7fb6f92cb31de3f3744310 (commit)
via ec6778ff9f031eb350dd67927f576004590b88ce (commit)
via 3ba9427d73204e32b6642e726a19f2a2fc4e1ba9 (commit)
via 9d586c63c1bdc9fd8d3d15bd51b08c3875499d37 (commit)
from 90ad6a0a9469e71306d237408d39374aeb06c3b1 (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=2f13e506863737e64a7fb6f92cb31de3f3744310
commit 2f13e506863737e64a7fb6f92cb31de3f3744310
Author: Rob Savoye <address@hidden>
Date: Thu Oct 28 12:15:40 2010 -0600
use boost to time operations
diff --git a/librender/testr.cpp b/librender/testr.cpp
index 7c60b61..b8862b1 100644
--- a/librender/testr.cpp
+++ b/librender/testr.cpp
@@ -24,10 +24,13 @@
#include <string>
#include <cstdlib>
#include <vector>
+#include <sstream>
#include <map>
#include <cassert>
#include <regex.h>
#include <boost/assign/list_of.hpp>
+#include <boost/date_time/date.hpp>
+#include <boost/date_time/posix_time/posix_time.hpp>
// FIXME: this should be a command line option
#undef GTK_TEST_RENDER
@@ -44,6 +47,7 @@
#include "Transform.h"
#include "GnashVaapiImage.h"
#include "GnashVaapiImageProxy.h"
+#include "boost/date_time/posix_time/posix_time.hpp"
#ifdef RENDERER_AGG
#include "Renderer_agg.h"
@@ -74,16 +78,47 @@ TestState runtest;
using namespace gnash;
using namespace renderer;
-using namespace std;
+using namespace std;
+using namespace boost::posix_time;
void test_renderer(Renderer *renderer, const std::string &type);
void test_geometry(Renderer *renderer, const std::string &type);
void test_iterators(Renderer *renderer, const std::string &type);
-#ifdef HAVE_GTK2
-GtkWidget *create_GTK_window(int argc, char *argv[]);
+#ifdef HAVE_GTK_XX
+GtkWidget *create_GTK_window();
#endif
+// Simple class to do nanosecond based timing for performance analysis
+class Timer {
+public:
+ Timer(const std::string &name) { _name = name; start(); }
+ Timer() { start(); }
+ ~Timer() { /*cerr << "Total time for " << _name << " was: " << elapsed()
<< endl;*/ };
+
+ void start() {
+ _starttime = boost::posix_time::microsec_clock::local_time();
+ }
+
+ void stop() {
+ _stoptime = boost::posix_time::microsec_clock::local_time();
+ }
+
+ std::string elapsed() {
+ stringstream ss;
+ time_duration td = _stoptime - _starttime;
+ ss << td.total_nanoseconds() << "ns elapsed";
+ return ss.str();
+ }
+ void setName(const std::string &name) { _name = name; };
+ std::string &getName() { return _name; };
+
+private:
+ std::string _name;
+ boost::posix_time::ptime _starttime;
+ boost::posix_time::ptime _stoptime;
+};
+
// The debug log used by all the gnash libraries.
static LogFile& dbglogfile = LogFile::getDefaultInstance();
@@ -95,8 +130,8 @@ main(int argc, char *argv[])
const char *pixelformat = "RGB24";
-#ifdef HAVE_GTK2
- create_GTK_window(argc, argv);
+#ifdef HAVE_GTK2_XX
+ GtkWidget *window = create_GTK_window();
#endif
#ifdef GTK_TEST_RENDER
@@ -124,13 +159,17 @@ main(int argc, char *argv[])
Renderer *renderer = 0;
#ifdef RENDERER_AGG
+ Timer tagg("AGG");
renderer = create_Renderer_agg(pixelformat);
test_renderer(renderer, "AGG");
test_geometry(renderer, "AGG");
test_iterators(renderer, "AGG");
+ tagg.stop();
+ cerr << "AGG tests took " << tagg.elapsed() << endl;
#endif
-
-#ifdef RENDERER_OPENVG
+
+#ifdef RENDERER_OPENVG
+ Timer tovg("OpenVG");
renderer = renderer::openvg::create_handler(pixelformat);
if (renderer) {
test_renderer(renderer, "OpenVG");
@@ -139,9 +178,12 @@ main(int argc, char *argv[])
} else {
cerr << "ERROR: No OpenVG renderer to test!" << endl;
}
+ tovg.stop();
+ cerr << "OpenVG tests took " << tovg.elapsed() << endl;
#endif
#ifdef RENDERER_GLES1
+ Timer tgles1("OpenGLES1");
renderer = renderer::gles1::create_handler(pixelformat);
if (renderer) {
test_renderer(renderer, "OpenGLES1");
@@ -150,9 +192,12 @@ main(int argc, char *argv[])
} else {
cerr << "ERROR: No OpenGLES1 renderer to test!" << endl;
}
+ tgles1.stop();
+ cerr << "OpenGLES1 tests took " << tgles1.elapsed() << endl;
#endif
#ifdef RENDERER_GLES2
+ Timer tgles2("OpenGLES2");
renderer = renderer::gles2::create_handler(pixelformat);
if (renderer) {
test_renderer(renderer, "OpenGLES2");
@@ -161,9 +206,12 @@ main(int argc, char *argv[])
} else {
cerr << "ERROR: No OpenGLES2 renderer to test!" << endl;
}
+ tgles2.stop();
+ cerr << "OpenGLES2 tests took " << tgles2.elapsed() << endl;
#endif
-#ifdef RENDERER_CAIRO
+#ifdef RENDERER_CAIRO
+ Timer tcairo("Cairo");
renderer = renderer::cairo::create_handler();
if (renderer) {
test_renderer(renderer, "Cairo");
@@ -172,9 +220,12 @@ main(int argc, char *argv[])
} else {
cerr << "ERROR: No Cairo renderer to test!" << endl;
}
+ tcairo.stop();
+ cerr << "Cairo tests took " << tcairo.elapsed() << endl;
#endif
#ifdef RENDERER_OPENGL
+ Timer tgl("OpenGL");
renderer = renderer::opengl::create_handler(true);
if (renderer) {
test_renderer(renderer, "OpenGL");
@@ -183,14 +234,15 @@ main(int argc, char *argv[])
} else {
cerr << "ERROR: No OpenGL renderer to test!" << endl;
}
+ tgl.stop();
+ cerr << "OpenGL tests took " << tgl.elapsed() << endl;
#endif
-#ifdef HAVE_GTK2
+#ifdef HAVE_GTK2_XX
gtk_main();
gtk_main_quit();
gtk_exit(0);
#endif
-
}
void
@@ -248,13 +300,16 @@ test_renderer(Renderer *renderer, const std::string &type)
SWFMatrix mat;
mat.set_scale_rotation(1, 3, 0);
+ Timer tdrawline("drawline");
renderer->drawLine(box, color, mat);
+ tdrawline.stop();
+
// if (1) {
// runtest.pass("drawLine()");
// } else {
// runtest.fail("drawLine()");
// }
- runtest.unresolved("drawLine()");
+ runtest.unresolved(std::string("drawLine() ") + tdrawline.elapsed());
//drawVideoFrame(image::GnashImage* frame, const Transform& xform, const
SWFRect* bounds, bool smooth);
#if 0
@@ -262,47 +317,58 @@ test_renderer(Renderer *renderer, const std::string &type)
const Transform xform;
const SWFRect bounds;
bool smooth;
+ Timer tdrawvideo("drawVideoFrame");
renderer->drawVideoFrame(frame, xform, bounds, smooth);
+ tdrawvideo.stop();
#endif
- runtest.unresolved("drawVideoFrame()");
+ runtest.untested("drawVideoFrame()");
point *corners = 0;
size_t corner_count = 0;
rgba fill(0, 0, 0, 255);;
rgba outline(0, 0, 0, 255);;
bool masked = true;
+ Timer tdrawpoly("drawPoly");
renderer->drawPoly(corners, corner_count, fill, outline, mat, masked);
- runtest.unresolved("drawPoly()");
+ tdrawpoly.stop();
+ runtest.unresolved(std::string("drawPoly() ") + tdrawpoly.elapsed());
// SWF::ShapeRecord shape;
// Transform xform;
+// Timer drawshape("drawShape");
// renderer->drawShape(shape, xform);
- runtest.unresolved("drawShape()");
-
+ runtest.untested("drawShape()");
+// drawshape.stop();
+
// SWF::ShapeRecord rec;
// rgba color;
// SWFMatrix mat;
+// Timer drawGlyph("drawGlyph");
// renderer->drawGlyph(rec, color, mat);
- runtest.unresolved("drawGlyph()");
+ runtest.untested("drawGlyph()");
+// drawglyph.stop();
#if 0
boost::shared_ptr<IOChannel> io;
FileType ftype;
+ Timer renderi("renderToImage");
renderer->renderToImage(io, ftype);
+ renderi.stop();
#endif
- runtest.unresolved("renderToImage()");
+ runtest.untested("renderToImage()");
CachedBitmap *bitmap = 0;
image::GnashImage *frame2 = new image::ImageRGBA(10, 10);
std::auto_ptr<image::GnashImage> im(frame2);
+ Timer cbit("createCachedBitmap");
bitmap = renderer->createCachedBitmap(im);
+ cbit.stop();
if (bitmap) {
- runtest.pass("createCachedBitmap()");
+ runtest.pass(std::string("createCachedBitmap() ") + cbit.elapsed());
} else {
- runtest.fail("createCachedBitmap()");
+ runtest.fail(std::string("createCachedBitmap() ") + cbit.elapsed());
}
- runtest.unresolved("createCachedBitmap()");
}
void
@@ -321,44 +387,65 @@ test_geometry(Renderer *renderer, const std::string &type)
geometry::Point2d z(x, y);
geometry::Range2d<int> pixelbounds;
geometry::Range2d<int> worldbounds;
+ Timer tpixtow("pixel_to_world(int, int)");
z = renderer->pixel_to_world(x, y);
+ tpixtow.stop();
+
if ((z.x >= 199) || (z.y >= 199)) {
- runtest.pass("pixel_to_world(int, int)");
+ runtest.pass(std::string("pixel_to_world(int, int) ") +
tpixtow.elapsed());
} else {
- runtest.fail("pixel_to_world(int, int)");
+ runtest.fail(std::string("pixel_to_world(int, int) ") +
tpixtow.elapsed());
}
-// worldbounds = renderer->pixel_to_world(pixelbounds);
+
+#if 0
+ Timer tpixtow2("pixel_to_world(pixelbounds)");
+ worldbounds = renderer->pixel_to_world(pixelbounds);
+ tpixtow2.stop();
if (worldbounds.isNull()) {
- runtest.pass("pixel_to_world(geometry::Range2d<int>)");
+ runtest.pass(std::string("pixel_to_world(geometry::Range2d<int>) ") +
tpixtow2.elapsed());
} else {
- runtest.fail("pixel_to_world(geometry::Range2d<int>)");
+ runtest.fail(std::string("pixel_to_world(geometry::Range2d<int>) ") +
tpixtow2.elapsed());
}
+#else
+ runtest.untested("pixel_to_world(geometry::Range2d<int>)");
+#endif
+ Timer twtop("world_to_pixel(geometry::Range2d<int>)");
pixelbounds = renderer->world_to_pixel(worldbounds);
+ twtop.stop();
if (pixelbounds.isNull()) {
- runtest.pass("world_to_pixel(geometry::Range2d<int>)");
+ runtest.pass(std::string("world_to_pixel(geometry::Range2d<int>) ") +
twtop.elapsed());
} else {
- runtest.fail("world_to_pixel(geometry::Range2d<int>)");
+ runtest.fail(std::string("world_to_pixel(geometry::Range2d<int>) ") +
twtop.elapsed());
}
SWFRect bounds;
- if (!renderer->bounds_in_clipping_area(bounds)) {
- runtest.pass("bounds_in_clipping_area(SWFRect)");
+ Timer tbounds1("bounds_in_clipping_area(SWFRect)");
+ bool ret = renderer->bounds_in_clipping_area(bounds);
+ tbounds1.stop();
+ if (ret) {
+ runtest.pass(std::string("bounds_in_clipping_area(SWFRect) ") +
tbounds1.elapsed());
} else {
- runtest.fail("bounds_in_clipping_area(SWFRect)");
+ runtest.fail(std::string("bounds_in_clipping_area(SWFRect) ") +
tbounds1.elapsed());
}
InvalidatedRanges ranges;
- if (!renderer->bounds_in_clipping_area(ranges)) {
- runtest.pass("bounds_in_clipping_area(InvalidatedRanges)");
+ Timer tbounds2("bounds_in_clipping_area(InvalidatedRanges)");
+ ret = renderer->bounds_in_clipping_area(ranges);
+ tbounds2.stop();
+ if (!ret) {
+ runtest.pass(std::string("bounds_in_clipping_area(InvalidatedRanges)
") + tbounds2.elapsed());
} else {
- runtest.fail("bounds_in_clipping_area(InvalidatedRanges)");
+ runtest.fail(std::string("bounds_in_clipping_area(InvalidatedRanges)
") + tbounds2.elapsed());
}
- if (!renderer->bounds_in_clipping_area(pixelbounds)) {
- runtest.pass("bounds_in_clipping_area(geometry::Range2d<int>)");
+ Timer tbounds3("bounds_in_clipping_area(geometry::Range2d<int>)");
+ ret = renderer->bounds_in_clipping_area(pixelbounds);
+ tbounds3.stop();
+ if (!ret) {
+
runtest.pass(std::string("bounds_in_clipping_area(geometry::Range2d<int>) ") +
tbounds3.elapsed());
} else {
- runtest.fail("bounds_in_clipping_area(geometry::Range2d<int>)");
+
runtest.fail(std::string("bounds_in_clipping_area(geometry::Range2d<int>) ") +
tbounds3.elapsed());
}
}
http://git.savannah.gnu.org/cgit//commit/?id=ec6778ff9f031eb350dd67927f576004590b88ce
commit ec6778ff9f031eb350dd67927f576004590b88ce
Author: Rob Savoye <address@hidden>
Date: Thu Oct 28 12:14:55 2010 -0600
initialize EGL. now that it's a separate step
diff --git a/librender/test_egl.cpp b/librender/test_egl.cpp
index f76d385..619a2e5 100644
--- a/librender/test_egl.cpp
+++ b/librender/test_egl.cpp
@@ -93,6 +93,14 @@ test_egl(EGLDevice &egl, EGLDevice::rtype_t rtype)
runtest.fail("EGLDevice::init()");
}
+ // Init'ing to zero uses the root screen as the display. Otherwise
+ // the argument should be an EGLNativeWindowType.
+ if (egl.initEGL(0)) {
+ runtest.pass("EGLDevice::initEGL(0)");
+ } else {
+ runtest.fail("EGLDevice::initEGL(0)");
+ }
+
// If there are more than zero configurations, something beyond
// initializing is working
if (egl.queryEGLConfig()) {
http://git.savannah.gnu.org/cgit//commit/?id=3ba9427d73204e32b6642e726a19f2a2fc4e1ba9
commit 3ba9427d73204e32b6642e726a19f2a2fc4e1ba9
Author: Rob Savoye <address@hidden>
Date: Thu Oct 28 12:14:27 2010 -0600
init EGL separate from the device
diff --git a/librender/eglDevice.h b/librender/eglDevice.h
index f5daf7e..3df5c74 100644
--- a/librender/eglDevice.h
+++ b/librender/eglDevice.h
@@ -50,9 +50,12 @@ class EGLDevice
EGLDevice();
~EGLDevice();
- // Initialize EGL
+ // Initialize EGL Device layer
bool initDevice(rtype_t);
+ // Initialize EGL Window layer
+ bool initEGL(EGLNativeWindowType window);
+
// Utility methods not in the base class
/// Return a string with the error code as text, instead of a numeric value
const char *getErrorString(int error);
@@ -69,6 +72,7 @@ class EGLDevice
void printEGLSurface(EGLSurface surface);
private:
+
EGLConfig _eglConfig;
EGLContext _eglContext;
EGLSurface _eglSurface;
http://git.savannah.gnu.org/cgit//commit/?id=9d586c63c1bdc9fd8d3d15bd51b08c3875499d37
commit 9d586c63c1bdc9fd8d3d15bd51b08c3875499d37
Author: Rob Savoye <address@hidden>
Date: Thu Oct 28 12:13:56 2010 -0600
disable GTK support for now
diff --git a/librender/eglDevice.cpp b/librender/eglDevice.cpp
index 5d0ed5c..5c7817d 100644
--- a/librender/eglDevice.cpp
+++ b/librender/eglDevice.cpp
@@ -294,7 +294,7 @@ EGLDevice::initDevice(EGLDevice::rtype_t rtype)
return false;
}
-#ifdef HAVE_GTK2
+#ifdef HAVE_GTK2_XX
Display *X11Display = XOpenDisplay(0);
XVisualInfo *visInfo, visTemplate;
int num_visuals;
@@ -308,7 +308,7 @@ EGLDevice::initDevice(EGLDevice::rtype_t rtype)
XFree(visInfo);
#endif
- // printEGLConfig(_eglConfig);
+ // printEGLConfig(_eglConfig);
#if 0
if (!checkEGLConfig(_eglConfig)) {
log_error("EGL configuration doesn't match!");
@@ -317,59 +317,64 @@ EGLDevice::initDevice(EGLDevice::rtype_t rtype)
//printEGLConfig(_eglConfig);
}
#endif
-
-#if HAVE_GTK2
- _nativeWindow = gdk_x11_get_default_root_xwindow();
-#endif
-
- // step4 - create a window surface
- log_debug("Initializing EGL Surface");
- if (_nativeWindow) {
- _eglSurface = eglCreateWindowSurface(_eglDisplay, _eglConfig,
- _nativeWindow, 0); // was
window_attrib_list
- } else {
- log_error("No native window!");
- return false;
- }
-
- if (EGL_NO_SURFACE == _eglSurface) {
- log_error("eglCreateWindowSurface failed (error %s)",
- getErrorString(eglGetError()));
- return false;
- } else {
- //printEGLSurface(_eglSurface);
- }
-
- // step5 - create a context
- _eglContext = eglCreateContext(_eglDisplay, _eglConfig, EGL_NO_CONTEXT,
NULL);
- if (EGL_NO_CONTEXT == _eglContext) {
- log_error("eglCreateContext failed (error %s)",
- getErrorString(eglGetError()));
- return false;
- } else {
- printEGLContext(_eglContext);
- }
-
- // step6 - make the context and surface current
- if (EGL_FALSE == eglMakeCurrent(_eglDisplay, _eglSurface, _eglSurface,
_eglContext)) {
- log_error("eglMakeCurrent failed (error %s)",
- getErrorString(eglGetError()));
- return false;
- } // begin user code
-
+
#if 0
#if 0
eglSwapInterval(_eglDisplay, 0);
#else
eglSwapBuffers(_eglDisplay, _eglSurface);
#endif
-
+
// log_debug("Gnash EGL Frame width %d height %d bpp %d \n", _width,
_height, _bpp);
#endif
return true;
}
+bool
+EGLDevice::initEGL(EGLNativeWindowType window)
+{
+
+ if (!window) {
+#if HAVE_GTK2
+ _nativeWindow = gdk_x11_get_default_root_xwindow();
+#endif
+ } else {
+ _nativeWindow = window;
+ }
+
+ log_debug("Initializing EGL Surface");
+ if (_nativeWindow) {
+ _eglSurface = eglCreateWindowSurface(_eglDisplay, _eglConfig,
_nativeWindow, 0);
+ } else {
+ log_error("No native window!");
+ }
+
+ if (EGL_NO_SURFACE == _eglSurface) {
+ log_error("eglCreateWindowSurface failed (error %s)",
+ getErrorString(eglGetError()));
+ } else {
+ printEGLSurface(_eglSurface);
+ }
+
+ // step5 - create a context
+ _eglContext = eglCreateContext(_eglDisplay, _eglConfig, EGL_NO_CONTEXT,
NULL);
+ if (EGL_NO_CONTEXT == _eglContext) {
+ log_error("eglCreateContext failed (error %s)",
+ getErrorString(eglGetError()));
+ } else {
+ printEGLContext(_eglContext);
+ }
+
+ // step6 - make the context and surface current
+ if (EGL_FALSE == eglMakeCurrent(_eglDisplay, _eglSurface, _eglSurface,
_eglContext)) {
+ log_error("eglMakeCurrent failed (error %s)",
+ getErrorString(eglGetError()));
+ } // begin user code
+
+ return true;
+}
+
const char *
EGLDevice::getErrorString(int error)
{
-----------------------------------------------------------------------
Summary of changes:
librender/eglDevice.cpp | 91 ++++++++++++++-------------
librender/eglDevice.h | 6 ++-
librender/test_egl.cpp | 8 +++
librender/testr.cpp | 159 ++++++++++++++++++++++++++++++++++++-----------
4 files changed, 184 insertions(+), 80 deletions(-)
hooks/post-receive
--
Gnash
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Gnash-commit] [SCM] Gnash branch, openvg, updated. 2f13e506863737e64a7fb6f92cb31de3f3744310,
Rob Savoye <=