devilhorns pushed a commit to branch master.
commit 57052b92e1a1d8b0c73a69f8a2e9e977a156f956
Author: Chris Michael <[email protected]>
Date: Mon Apr 29 13:02:00 2013 +0100
Add start of drm engine
NB: Nothing to see here, just basic evas_engine setup.
Signed-off-by: Chris Michael <[email protected]>
---
src/modules/evas/engines/drm/evas_engine.c | 89 ++++++++++++++++++++++++++++++
1 file changed, 89 insertions(+)
diff --git a/src/modules/evas/engines/drm/evas_engine.c
b/src/modules/evas/engines/drm/evas_engine.c
new file mode 100644
index 0000000..a3fa93e
--- /dev/null
+++ b/src/modules/evas/engines/drm/evas_engine.c
@@ -0,0 +1,89 @@
+#include "evas_common.h"
+#include "evas_private.h"
+#include "Evas_Engine_Drm.h"
+#include "evas_engine.h"
+
+/* function tables - filled in later (func and parent func) */
+static Evas_Func func, pfunc;
+
+/* external variables */
+int _evas_engine_drm_log_dom;
+
+/* engine api functions */
+static void *
+eng_info(Evas *evas EINA_UNUSED)
+{
+ Evas_Engine_Info_Drm *info;
+
+ /* try to allocate space for our engine info structure */
+ if (!(info = calloc(1, sizeof(Evas_Engine_Info_Drm))))
+ return NULL;
+
+ /* set some engine default properties */
+ info->magic.magic = rand();
+ info->render_mode = EVAS_RENDER_MODE_BLOCKING;
+
+ return info;
+}
+
+static void
+eng_info_free(Evas *evas EINA_UNUSED, void *einfo)
+{
+ Evas_Engine_Info_Drm *info;
+
+ /* free the engine info */
+ if ((info = (Evas_Engine_Info_Drm *)einfo))
+ free(info);
+}
+
+/* module api functions */
+static int
+module_open(Evas_Module *em)
+{
+ /* check for valid evas module */
+ if (!em) return 0;
+
+ /* try to inherit functions from software_generic engine */
+ if (!_evas_module_engine_inherit(&pfunc, "software_generic")) return 0;
+
+ /* try to create eina logging domain */
+ _evas_engine_drm_log_dom =
+ eina_log_domain_register("evas-drm", EVAS_DEFAULT_LOG_COLOR);
+
+ /* if we could not create a logging domain, error out */
+ if (_evas_engine_drm_log_dom < 0)
+ {
+ EINA_LOG_ERR("Can not create a module log domain.");
+ return 0;
+ }
+
+ /* store parent functions */
+ func = pfunc;
+
+ /* override the methods we provide */
+ EVAS_API_OVERRIDE(info, &func, eng_);
+ EVAS_API_OVERRIDE(info_free, &func, eng_);
+
+ /* advertise our engine functions */
+ em->functions = (void *)(&func);
+
+ return 1;
+}
+
+static void
+module_close(Evas_Module *em EINA_UNUSED)
+{
+ /* unregister the eina log domain for this engine */
+ eina_log_domain_unregister(_evas_engine_drm_log_dom);
+}
+
+static Evas_Module_Api evas_modapi =
+{
+ EVAS_MODULE_API_VERSION, "drm", "none", { module_open, module_close }
+};
+
+EVAS_MODULE_DEFINE(EVAS_MODULE_TYPE_ENGINE, engine, drm);
+
+#ifndef EVAS_STATIC_BUILD_DRM
+EVAS_EINA_MODULE_DEFINE(engine, drm);
+#endif
--
------------------------------------------------------------------------------
Try New Relic Now & We'll Send You this Cool Shirt
New Relic is the only SaaS-based application performance monitoring service
that delivers powerful full stack analytics. Optimize and monitor your
browser, app, & servers with just a few lines of code. Try New Relic
and get this awesome Nerd Life shirt! http://p.sf.net/sfu/newrelic_d2d_apr