evas: and now is the death of Qtopia engine.

SVN revision: 58362
devs/devilhorns/wayland_egl
Cedric BAIL 12 years ago
parent 30f906aac9
commit 1b3b01cb4f
  1. 3
      legacy/evas/ChangeLog
  2. 5
      legacy/evas/Makefile.am
  3. 2
      legacy/evas/README.in
  4. 10
      legacy/evas/configure.ac
  5. 3
      legacy/evas/evas-software-qtopia.pc.in
  6. 20
      legacy/evas/evas.spec.in
  7. 52
      legacy/evas/m4/evas_check_engine.m4
  8. 7
      legacy/evas/src/lib/Makefile.am
  9. 3
      legacy/evas/src/lib/canvas/evas_main.c
  10. 4
      legacy/evas/src/lib/file/evas_module.c
  11. 6
      legacy/evas/src/modules/engines/software_qtopia/.cvsignore
  12. 34
      legacy/evas/src/modules/engines/software_qtopia/Evas_Engine_Software_Qtopia.h
  13. 47
      legacy/evas/src/modules/engines/software_qtopia/Makefile.am
  14. 327
      legacy/evas/src/modules/engines/software_qtopia/evas_engine.c
  15. 129
      legacy/evas/src/modules/engines/software_qtopia/evas_engine.h
  16. 245
      legacy/evas/src/modules/engines/software_qtopia/evas_outbuf.c
  17. 109
      legacy/evas/src/modules/engines/software_qtopia/evas_qt_main.cpp

@ -212,4 +212,5 @@
2011-04-05 Cedric Bail
* Remove Evas Quartz backend.
* Remove Cairo backend.
* Remove Evas Cairo backend.
* Remove Evas Qtopia backend.

@ -37,7 +37,6 @@ evas-fb.pc.in \
evas-opengl-x11.pc.in \
evas-opengl-sdl.pc.in \
evas-software-buffer.pc.in \
evas-software-qtopia.pc.in \
evas-software-x11.pc.in \
evas-software-16-x11.pc.in \
evas-software-8-x11.pc.in \
@ -79,10 +78,6 @@ if BUILD_ENGINE_BUFFER
pkgconfig_DATA += evas-software-buffer.pc
endif
#if BUILD_ENGINE_SOFTWARE_QTOPIA
#pkgconfig_DATA += evas-software-qtopia.pc
#endif
if BUILD_ENGINE_GL_X11
pkgconfig_DATA += evas-opengl-x11.pc
endif

@ -27,7 +27,7 @@ Recommended:
libpthread
Optional:
XCB SDL OpenGL Qtopia librsvg libtiff libgif edb DirectFB
XCB SDL OpenGL librsvg libtiff libgif edb DirectFB
Evas is a clean display canvas API for several target display systems
that can draw anti-aliased text, smooth super and sub-sampled scaled

@ -105,7 +105,6 @@ want_evas_engine_direct3d="no"
want_evas_engine_software_sdl="no"
want_evas_engine_fb="no"
want_evas_engine_directfb="no"
want_evas_engine_software_qtopia="no"
want_evas_engine_software_8_x11="no"
want_evas_engine_software_16_x11="no"
want_evas_engine_software_16_ddraw="no"
@ -601,9 +600,6 @@ EVAS_CHECK_ENGINE([fb], [${want_evas_engine_fb}], [yes], [Framebuffer])
EVAS_CHECK_ENGINE([directfb], [${want_evas_engine_directfb}], [no], [DirectFB])
# disable qtopia engine for the release
#EVAS_CHECK_ENGINE([software-qtopia], [${want_evas_engine_software_qtopia}], [no], [Qtopia])
EVAS_CHECK_ENGINE([software-8-x11], [${want_evas_engine_software_8_x11}], [yes], [Software X11 8 bits grayscale])
EVAS_CHECK_ENGINE([software-16-x11], [${want_evas_engine_software_16_x11}], [yes], [Software X11 16 bits])
@ -1603,11 +1599,6 @@ README
evas.spec
])
#disabled for the release:
# evas-software-qtopia.pc
# src/modules/engines/software_qtopia/Makefile
#####################################################################
## Sanity Checks
@ -1666,7 +1657,6 @@ else
fi
echo " Software Framebuffer.......: $have_evas_engine_fb"
echo " DirectFB...................: $have_evas_engine_directfb"
dnl echo " Software Qtopia............: $have_evas_engine_software_qtopia"
echo " Software 8bit grayscale....: $have_evas_engine_software_8"
# FIXME: kill software 16bit
echo " Software 16bit ............: $have_evas_engine_software_16"

@ -1,3 +0,0 @@
Name: evas-software-qtopia
Description: Evas software Qtopia engine
Version: @VERSION@

@ -19,7 +19,6 @@
%bcond_with module_saver_edb
%bcond_with module_engine_directfb
%bcond_with module_engine_gl_x11
%bcond_with module_engine_software_qtopia
%bcond_with module_engine_software_16_x11
%bcond_with module_engine_software_sdl
%bcond_with module_engine_software_xcb
@ -76,7 +75,6 @@
%define ac_with_module_engine_gl_x11 --%{?with_module_engine_gl_x11:en}%{!?with_module_engine_gl_x11:dis}able-gl-x11
%define ac_with_module_engine_directfb --%{?with_module_engine_directfb:en}%{!?with_module_engine_directfb:dis}able-directfb
%define ac_with_module_engine_software_16_x11 --%{?with_module_engine_software_16_x11:en}%{!?with_module_engine_software_16_x11:dis}able-software-16-x11
%define ac_with_module_engine_software_qtopia --%{?with_module_engine_software_qtopia:en}%{!?with_module_engine_software_qtopia:dis}able-software-qtopia
%define ac_with_module_engine_software_sdl --%{?with_module_engine_software_sdl:en}%{!?with_module_engine_software_sdl:dis}able-sdl
%define ac_with_module_engine_software_xcb --%{?with_module_engine_software_xcb:en}%{!?with_module_engine_software_xcb:dis}able-software-xcb
%define ac_with_module_engine_xrender_xcb --%{?with_module_engine_xrender_xcb:en}%{!?with_module_engine_xrender_xcb:dis}able-xrender-xcb
@ -336,17 +334,6 @@ Requires: evas
Directfb rendering engine module for Evas
%endif
%if %{with module_engine_software_qtopia}
%package module_engine_software_qtopia
Summary: Qtopia rendering engine module for Evas
Group: System Environment/Libraries
BuildRequires: qtopia-devel
Requires: evas-module_engine_software_generic
Requires: evas
%description module_engine_software_qtopia
Qtopia rendering engine module for Evas
%endif
%if %{with module_engine_software_16_x11}
%package module_engine_software_16_x11
Summary: Software 16-bit X11 rendering engine module for Evas
@ -415,7 +402,6 @@ Xrender XCB X11 rendering engine module for Evas
%{?ac_with_module_engine_xrender_x11} \
%{?ac_with_module_engine_gl_x11} \
%{?ac_with_module_engine_directfb} \
%{?ac_with_module_engine_software_qtopia} \
%{?ac_with_module_engine_software_16_x11} \
%{?ac_with_module_engine_software_sdl} \
%{?ac_with_module_engine_software_xcb} \
@ -593,12 +579,6 @@ test "x$RPM_BUILD_ROOT" != "x/" && rm -rf $RPM_BUILD_ROOT
%{_libdir}/evas/modules/engines/directfb/*/module.so
%endif
%if %{with module_engine_software_qtopia}
%files module_engine_software_qtopia
%defattr(-, root, root)
%{_libdir}/evas/modules/engines/software_qtopia/*/module.so
%endif
%if %{with module_engine_software_16_x11}
%files module_engine_software_16_x11
%defattr(-, root, root)

@ -547,58 +547,6 @@ fi
])
dnl use: EVAS_CHECK_ENGINE_DEP_SOFTWARE_QTOPIA(engine, simple, want_static[, ACTION-IF-FOUND[, ACTION-IF-NOT-FOUND]])
AC_DEFUN([EVAS_CHECK_ENGINE_DEP_SOFTWARE_QTOPIA],
[
have_dep="no"
evas_engine_[]$1[]_cflags=""
evas_engine_[]$1[]_libs=""
evas_engine_[]$1[]_moc=""
AC_ARG_WITH([qtdir],
[AC_HELP_STRING([--with-qtdir=QT_DIR], [use qt directory specified])],
[
qt_dir=$withval;
echo "using "$qt_dir" for qt directory.";
],
[qt_dir="/opt/Qtopia"]
)
AC_LANG_PUSH(C++)
AC_CHECK_HEADER([qdirectpainter_qws.h],
[have_dep="yes"],
[have_dep="no"],
[
#include <qwidget.h>
#include <qnamespace.h>
#include <qbrush.h>
#include <qpainter.h>
]
)
AC_LANG_POP(C++)
if test "x${have_dep}" = "xyes" ; then
evas_engine_[]$1[]_cflags="-fno-exceptions -fno-rtti -I${qt_dir}/include"
evas_engine_[]$1[]_libs="-L${qt_dir}/lib -lqte -lqpe"
evas_engine_[]$1[]_moc="${qt_dir}/bin/moc"
fi
AC_SUBST([evas_engine_$1_cflags])
AC_SUBST([evas_engine_$1_libs])
AC_SUBST([evas_engine_$1_moc])
if test "x${have_dep}" = "xyes" ; then
m4_default([$4], [:])
else
m4_default([$5], [:])
fi
])
dnl use: EVAS_CHECK_ENGINE_DEP_SOFTWARE_8_X11(engine, simple, want_static[, ACTION-IF-FOUND[, ACTION-IF-NOT-FOUND]])
AC_DEFUN([EVAS_CHECK_ENGINE_DEP_SOFTWARE_8_X11],

@ -170,13 +170,6 @@ EVAS_STATIC_MODULE += ../modules/loaders/xpm/libevas_loader_xpm.la
EVAS_STATIC_LIBADD += @evas_image_loader_xpm_libs@
endif
#if EVAS_STATIC_BUILD_SOFTWARE_QTOPIA
#SUBDIRS += ../modules/engines/software_qtopia/
#EVAS_STATIC_MODULE += ../modules/engines/software_qtopia/libevas_engine_software_qtopia.la
#EVAS_STATIC_LIBADD += @evas_engine_software_qtopia_libs@
#endif
AM_CPPFLAGS = \
-I. \
-I$(top_srcdir)/src/lib \

@ -849,9 +849,6 @@ evas_render_method_list(void)
#ifdef BUILD_ENGINE_SOFTWARE_WIN32_GDI
methods = eina_list_append(methods, "software_win32_gdi");
#endif
#ifdef BUILD_ENGINE_SOFTWARE_QTOPIA
methods = eina_list_append(methods, "software_qtopia");
#endif
#ifdef BUILD_ENGINE_SOFTWARE_SDL
methods = eina_list_append(methods, "software_sdl");
#endif

@ -106,7 +106,6 @@ EVAS_EINA_STATIC_MODULE_DEFINE(engine, software_8_x11);
EVAS_EINA_STATIC_MODULE_DEFINE(engine, software_ddraw);
EVAS_EINA_STATIC_MODULE_DEFINE(engine, software_gdi);
EVAS_EINA_STATIC_MODULE_DEFINE(engine, software_generic);
EVAS_EINA_STATIC_MODULE_DEFINE(engine, software_qtopia);
EVAS_EINA_STATIC_MODULE_DEFINE(engine, software_sdl);
EVAS_EINA_STATIC_MODULE_DEFINE(engine, software_x11);
EVAS_EINA_STATIC_MODULE_DEFINE(engine, xrender_x11);
@ -181,9 +180,6 @@ static const struct {
#ifdef EVAS_STATIC_BUILD_SOFTWARE_GENERIC
EVAS_EINA_STATIC_MODULE_USE(engine, software_generic),
#endif
#ifdef EVAS_STATIC_BUILD_SOFTWARE_QTOPIA
EVAS_EINA_STATIC_MODULE_USE(engine, software_qtopia),
#endif
#ifdef EVAS_STATIC_BUILD_SOFTWARE_SDL
EVAS_EINA_STATIC_MODULE_USE(engine, software_sdl),
#endif

@ -1,6 +0,0 @@
.deps
.libs
Makefile
Makefile.in
*.lo
*.la

@ -1,34 +0,0 @@
#ifndef _EVAS_ENGINE_SOFTWARE_QTOPIA_H
#define _EVAS_ENGINE_SOFTWARE_QTOPIA_H
#ifdef EVAS_COMMON_H
#ifdef EVAS_PRIVATE_H
typedef void QWidget;
#endif
#endif
#ifndef EVAS_COMMON_H
#ifndef EVAS_PRIVATE_H
#include <qwidget.h>
#endif
#endif
typedef struct _Evas_Engine_Info_Software_Qtopia Evas_Engine_Info_Software_Qtopia;
struct _Evas_Engine_Info_Software_Qtopia
{
/* PRIVATE - don't mess with this baby or evas will poke its tongue out */
/* at you and make nasty noises */
Evas_Engine_Info magic;
struct {
QWidget *target;
int rotation;
} info;
/* non-blocking or blocking mode */
Evas_Engine_Render_Mode render_mode;
};
#endif

@ -1,47 +0,0 @@
MAINTAINERCLEANFILES = Makefile.in
AM_CPPFLAGS = \
-I. \
-I$(top_srcdir)/src/lib \
-I$(top_srcdir)/src/lib/include \
-I$(top_srcdir)/src/modules/engines \
@FREETYPE_CFLAGS@ \
@EINA_CFLAGS@ \
@evas_engine_software_qtopia_cflags@
AM_CXXFLAGS = $(CFLAGS) -DQT_QWS_EBX -DQT_QWS_CUSTOM -DQWS -DNO_DEBUG
if BUILD_ENGINE_SOFTWARE_QTOPIA
SOFTWARE_QTOPIA_SOURCES = \
evas_engine.c \
evas_outbuf.c \
evas_qt_main.cpp
SOFTWARE_QTOPIA_LIBADD = @evas_engine_software_qtopia_libs@
includes_HEADERS = Evas_Engine_Software_Qtopia.h
includesdir = $(includedir)/evas-@VMAJ@
if !EVAS_STATIC_BUILD_SOFTWARE_QTOPIA
pkgdir = $(libdir)/evas/modules/engines/software_qtopia/$(MODULE_ARCH)
pkg_LTLIBRARIES = module.la
module_la_SOURCES = $(SOFTWARE_QTOPIA_SOURCES)
module_la_LIBADD = @EINA_LIBS@ $(SOFTWARE_QTOPIA_LIBADD) $(top_builddir)/src/lib/libevas.la
module_la_LDFLAGS = -module -avoid-version
module_la_LIBTOOLFLAGS = --tag=disable-static
else
noinst_LTLIBRARIES = libevas_engine_software_qtopia.la
libevas_engine_software_qtopia_la_SOURCES = $(SOFTWARE_QTOPIA_SOURCES)
libevas_engine_software_qtopia_la_LIBADD = $(SOFTWARE_QTOPIA_LIBADD)
endif
endif
EXTRA_DIST = evas_engine.h

@ -1,327 +0,0 @@
#include "evas_common.h"
#include "evas_private.h"
#include "evas_engine.h"
#include "Evas_Engine_Software_Qtopia.h"
int _evas_engine_soft_qtopia_log_dom = -1;
/* function tables - filled in later (func and parent func) */
static Evas_Func func, pfunc;
/* engine struct data */
typedef struct _Render_Engine Render_Engine;
struct _Render_Engine
{
Tilebuf *tb;
Outbuf *ob;
Tilebuf_Rect *rects;
Eina_Inlist *cur_rect;
int end : 1;
};
/* prototypes we will use here */
static void *_output_setup(int w, int h, int rot, QWidget *target);
static void *eng_info(Evas *e);
static void eng_info_free(Evas *e, void *info);
static int eng_setup(Evas *e, void *info);
static void eng_output_free(void *data);
static void eng_output_resize(void *data, int w, int h);
static void eng_output_tile_size_set(void *data, int w, int h);
static void eng_output_redraws_rect_add(void *data, int x, int y, int w, int h);
static void eng_output_redraws_rect_del(void *data, int x, int y, int w, int h);
static void eng_output_redraws_clear(void *data);
static void *eng_output_redraws_next_update_get(void *data, int *x, int *y, int *w, int *h, int *cx, int *cy, int *cw, int *ch);
static void eng_output_redraws_next_update_push(void *data, void *surface, int x, int y, int w, int h);
static void eng_output_flush(void *data);
static void eng_output_idle_flush(void *data);
/* internal engine routines */
static void *
_output_setup(int w, int h, int rot, QWidget *target)
{
Render_Engine *re;
re = calloc(1, sizeof(Render_Engine));
if (!re)
return NULL;
/* if we haven't initialized - init (automatic abort if already done) */
evas_common_cpu_init();
evas_common_blend_init();
evas_common_image_init();
evas_common_convert_init();
evas_common_scale_init();
evas_common_rectangle_init();
evas_common_polygon_init();
evas_common_line_init();
evas_common_font_init();
evas_common_draw_init();
evas_common_tilebuf_init();
evas_qtopia_outbuf_software_qtopia_init();
/* get any stored performance metrics from device (xserver) */
re->ob = evas_qtopia_outbuf_software_qtopia_setup_q(w, h, rot, OUTBUF_DEPTH_INHERIT, target);
if (!re->ob)
{
free(re);
return NULL;
}
evas_qtopia_outbuf_software_qtopia_set_have_backbuf(re->ob, 0);
re->tb = evas_common_tilebuf_new(w, h);
if (!re->tb)
{
evas_qtopia_outbuf_software_qtopia_free(re->ob);
free(re);
return NULL;
}
/* in preliminary tests 16x16 gave highest framerates */
evas_common_tilebuf_set_tile_size(re->tb, TILESIZE, TILESIZE);
return re;
}
/* engine api this module provides */
static void *
eng_info(Evas *e)
{
Evas_Engine_Info_Software_Qtopia *info;
info = calloc(1, sizeof(Evas_Engine_Info_Software_Qtopia));
if (!info) return NULL;
info->magic.magic = rand();
info->render_mode = EVAS_RENDER_MODE_BLOCKING;
return info;
e = NULL;
}
static void
eng_info_free(Evas *e, void *info)
{
Evas_Engine_Info_Software_Qtopia *in;
in = (Evas_Engine_Info_Software_Qtopia *)info;
free(in);
}
static int
eng_setup(Evas *e, void *in)
{
Render_Engine *re;
Evas_Engine_Info_Software_Qtopia *info;
info = (Evas_Engine_Info_Software_Qtopia *)in;
if (!e->engine.data.output)
e->engine.data.output =
_output_setup(e->output.w,
e->output.h,
info->info.rotation,
info->info.target);
if (!e->engine.data.output) return 0;
if (!e->engine.data.context)
e->engine.data.context =
e->engine.func->context_new(e->engine.data.output);
re = e->engine.data.output;
return 1;
}
static void
eng_output_free(void *data)
{
Render_Engine *re;
re = (Render_Engine *)data;
evas_qtopia_outbuf_software_qtopia_free(re->ob);
evas_common_tilebuf_free(re->tb);
if (re->rects) evas_common_tilebuf_free_render_rects(re->rects);
free(re);
evas_common_font_shutdown();
evas_common_image_shutdown();
}
static void
eng_output_resize(void *data, int w, int h)
{
Render_Engine *re;
re = (Render_Engine *)data;
evas_qtopia_outbuf_software_qtopia_reconfigure(re->ob, w, h,
evas_qtopia_outbuf_software_qtopia_get_rot(re->ob),
OUTBUF_DEPTH_INHERIT);
evas_qtopia_outbuf_software_qtopia_set_have_backbuf(re->ob, 0);
evas_common_tilebuf_free(re->tb);
re->tb = evas_common_tilebuf_new(w, h);
if (re->tb)
evas_common_tilebuf_set_tile_size(re->tb, TILESIZE, TILESIZE);
}
static void
eng_output_tile_size_set(void *data, int w, int h)
{
Render_Engine *re;
re = (Render_Engine *)data;
evas_common_tilebuf_set_tile_size(re->tb, w, h);
}
static void
eng_output_redraws_rect_add(void *data, int x, int y, int w, int h)
{
Render_Engine *re;
re = (Render_Engine *)data;
evas_common_tilebuf_add_redraw(re->tb, x, y, w, h);
}
static void
eng_output_redraws_rect_del(void *data, int x, int y, int w, int h)
{
Render_Engine *re;
re = (Render_Engine *)data;
evas_common_tilebuf_del_redraw(re->tb, x, y, w, h);
}
static void
eng_output_redraws_clear(void *data)
{
Render_Engine *re;
re = (Render_Engine *)data;
evas_common_tilebuf_clear(re->tb);
}
static void *
eng_output_redraws_next_update_get(void *data, int *x, int *y, int *w, int *h, int *cx, int *cy, int *cw, int *ch)
{
Render_Engine *re;
RGBA_Image *surface;
Tilebuf_Rect *rect;
int ux, uy, uw, uh;
re = (Render_Engine *)data;
if (re->end)
{
re->end = 0;
return NULL;
}
if (!re->rects)
{
re->rects = evas_common_tilebuf_get_render_rects(re->tb);
re->cur_rect = EINA_INLIST_GET(re->rects);
}
if (!re->cur_rect) return NULL;
rect = (Tilebuf_Rect *)re->cur_rect;
ux = rect->x; uy = rect->y; uw = rect->w; uh = rect->h;
re->cur_rect = re->cur_rect->next;
if (!re->cur_rect)
{
evas_common_tilebuf_free_render_rects(re->rects);
re->rects = NULL;
re->end = 1;
}
surface = evas_qtopia_outbuf_software_qtopia_new_region_for_update(re->ob,
ux, uy, uw, uh,
cx, cy, cw, ch);
*x = ux; *y = uy; *w = uw; *h = uh;
return surface;
}
static void
eng_output_redraws_next_update_push(void *data, void *surface, int x, int y, int w, int h)
{
Render_Engine *re;
Evas_Engine_Info_Software_Qtopia *info;
re = (Render_Engine *)data;
#ifdef BUILD_PIPE_RENDER
evas_common_pipe_map_begin(surface);
#endif
evas_qtopia_outbuf_software_qtopia_push_updated_region(re->ob, surface, x, y, w, h);
evas_qtopia_outbuf_software_qtopia_free_region_for_update(re->ob, surface);
evas_common_cpu_end_opt();
}
static void
eng_output_flush(void *data)
{
Render_Engine *re;
re = (Render_Engine *)data;
}
static void
eng_output_idle_flush(void *data)
{
Render_Engine *re;
re = (Render_Engine *)data;
}
static Eina_Bool
eng_canvas_alpha_get(void *data, void *context)
{
return EINA_FALSE;
}
/* module advertising code */
static int
module_open(Evas_Module *em)
{
if (!em) return 0;
/* get whatever engine module we inherit from */
if (!_evas_module_engine_inherit(&pfunc, "software_generic")) return 0;
_evas_engine_soft_qtopia_log_dom = eina_log_domain_register
("evas-software_qtopia", EVAS_DEFAULT_LOG_COLOR);
if(_evas_engine_soft_qtopia_log_dom < 0)
{
EINA_LOG_ERR("Can not create a module log domain.");
return 0;
}
/* store it for later use */
func = pfunc;
/* now to override methods */
#define ORD(f) EVAS_API_OVERRIDE(f, &func, eng_)
ORD(info);
ORD(info_free);
ORD(setup);
ORD(canvas_alpha_get);
ORD(output_free);
ORD(output_resize);
ORD(output_tile_size_set);
ORD(output_redraws_rect_add);
ORD(output_redraws_rect_del);
ORD(output_redraws_clear);
ORD(output_redraws_next_update_get);
ORD(output_redraws_next_update_push);
ORD(output_flush);
ORD(output_idle_flush);
/* now advertise out own api */
em->functions = (void *)(&func);
return 1;
}
static void
module_close(Evas_Module *em)
{
eina_log_domain_unregister(_evas_engine_soft_qtopia_log_dom);
}
static Evas_Module_Api evas_modapi =
{
EVAS_MODULE_API_VERSION,
"software_qtopia",
"none",
{
module_open,
module_close
}
};
EVAS_MODULE_DEFINE(EVAS_MODULE_TYPE_ENGINE, engine, software_qtopia);
#ifndef EVAS_STATIC_BUILD_SOFTWARE_QTOPIA
EVAS_EINA_MODULE_DEFINE(engine, software_qtopia);
#endif

@ -1,129 +0,0 @@
#ifndef EVAS_ENGINE_H
#define EVAS_ENGINE_H
extern int _evas_engine_soft_qtopia_log_dom ;
#ifdef ERR
# undef ERR
#endif
#define ERR(...) EINA_LOG_DOM_ERR(_evas_engine_qtopia_log_dom, __VA_ARGS__)
#ifdef DBG
# undef DBG
#endif
#define DBG(...) EINA_LOG_DOM_DBG(_evas_engine_qtopia_log_dom, __VA_ARGS__)
#ifdef INF
# undef INF
#endif
#define INF(...) EINA_LOG_DOM_INFO(_evas_engine_qtopia_log_dom, __VA_ARGS__)
#ifdef WRN
# undef WRN
#endif
#define WRN(...) EINA_LOG_DOM_WARN(_evas_engine_qtopia_log_dom, __VA_ARGS__)
#ifdef CRIT
# undef CRIT
#endif
#define CRIT(...) EINA_LOG_DOM_CRIT(_evas_engine_qtopia_log_dom, __VA_ARGS__)
typedef struct _Outbuf Outbuf;
typedef struct _QT_Direct QT_Direct;
typedef struct _QT_Direct_Rect QT_Direct_Rect;
enum _Outbuf_Depth
{
OUTBUF_DEPTH_NONE,
OUTBUF_DEPTH_INHERIT,
OUTBUF_DEPTH_RGB_16BPP_565_565_DITHERED,
OUTBUF_DEPTH_RGB_16BPP_555_555_DITHERED,
OUTBUF_DEPTH_RGB_16BPP_444_444_DITHERED,
OUTBUF_DEPTH_RGB_16BPP_565_444_DITHERED,
OUTBUF_DEPTH_RGB_32BPP_888_8888,
OUTBUF_DEPTH_LAST
};
typedef enum _Outbuf_Depth Outbuf_Depth;
struct _Outbuf
{
Outbuf_Depth depth;
int w, h;
int rot;
struct {
void *target;
struct {
DATA32 r, g, b;
} mask;
RGBA_Image *back_buf;
} priv;
};
struct _QT_Direct_Rect
{
int x, y, w, h;
};
struct _QT_Direct
{
/* our target widget */
void *target;
/* our direct painter object */
void *direct;
/* The fb */
struct
{
DATA8 *data;
int bpp;
int rotation;
int width;
struct {
DATA32 r, g, b;
} mask;
} fb;
/* Relative to fb coords */
struct {
int count;
QT_Direct_Rect *r;
} rects;
/* Relative to fb coords */
QT_Direct_Rect location;
QT_Direct_Rect updated;
};
#ifdef __cplusplus
extern "C" {
#endif
/****/
void x_software_qtopia_init (void);
void evas_qtopia_outbuf_software_qtopia_init (void);
void evas_qtopia_outbuf_software_qtopia_free (Outbuf *buf);
Outbuf *evas_qtopia_outbuf_software_qtopia_setup_q (int w, int h, int rot, Outbuf_Depth depth, void *target);
void evas_qtopia_outbuf_software_qtopia_blit (Outbuf *buf, int src_x, int src_y, int w, int h, int dst_x, int dst_y);
void evas_qtopia_outbuf_software_qtopia_update (Outbuf *buf, int x, int y, int w, int h);
RGBA_Image *evas_qtopia_outbuf_software_qtopia_new_region_for_update (Outbuf *buf, int x, int y, int w, int h, int *cx, int *cy, int *cw, int *ch);
void evas_qtopia_outbuf_software_qtopia_free_region_for_update (Outbuf *buf, RGBA_Image *update);
void evas_qtopia_outbuf_software_qtopia_push_updated_region (Outbuf *buf, RGBA_Image *update, int x, int y, int w, int h);
void evas_qtopia_outbuf_software_qtopia_reconfigure (Outbuf *buf, int w, int h, int rot, Outbuf_Depth depth);
int evas_qtopia_outbuf_software_qtopia_get_width (Outbuf *buf);
int evas_qtopia_outbuf_software_qtopia_get_height (Outbuf *buf);
Outbuf_Depth evas_qtopia_outbuf_software_qtopia_get_depth (Outbuf *buf);
int evas_qtopia_outbuf_software_qtopia_get_rot (Outbuf *buf);
int evas_qtopia_outbuf_software_qtopia_get_have_backbuf (Outbuf *buf);
void evas_qtopia_outbuf_software_qtopia_set_have_backbuf (Outbuf *buf, int have_backbuf);
QT_Direct *evas_qt_main_direct_start (void *target);
void evas_qt_main_direct_stop (QT_Direct *d);
#ifdef __cplusplus
}
#endif
#endif

@ -1,245 +0,0 @@
#include "evas_common.h"
#include "evas_engine.h"
#include "evas_private.h"
#include "Evas_Engine_Software_Qtopia.h"
#include <sys/time.h>
#include <sys/utsname.h>
void
evas_qtopia_outbuf_software_qtopia_init(void)
{
}
void
evas_qtopia_outbuf_software_qtopia_free(Outbuf *buf)
{
free(buf);
}
Outbuf *
evas_qtopia_outbuf_software_qtopia_setup_q(int w, int h, int rot, Outbuf_Depth depth, QWidget *target)
{
Outbuf *buf;
buf = calloc(1, sizeof(Outbuf));
if (!buf)
{
free(buf);
return NULL;
}
buf->w = w;
buf->h = h;
buf->rot = rot;
buf->priv.target = target;
{
QT_Direct *direct;
direct = evas_qt_main_direct_start(buf->priv.target);
if (direct)
{
buf->w = direct->location.w;
buf->h = direct->location.h;
buf->rot = direct->fb.rotation;
evas_qt_main_direct_stop(direct);
}
}
return buf;
}
void
evas_qtopia_outbuf_software_qtopia_blit(Outbuf *buf, int src_x, int src_y, int w, int h, int dst_x, int dst_y)
{
}
void
evas_qtopia_outbuf_software_qtopia_update(Outbuf *buf, int x, int y, int w, int h)
{
}
RGBA_Image *
evas_qtopia_outbuf_software_qtopia_new_region_for_update(Outbuf *buf, int x, int y, int w, int h, int *cx, int *cy, int *cw, int *ch)
{
RGBA_Image *im;
*cx = 0; *cy = 0; *cw = w; *ch = h;
im = evas_common_image_create(w, h);
return im;
}
void
evas_qtopia_outbuf_software_qtopia_free_region_for_update(Outbuf *buf, RGBA_Image *update)
{
evas_common_image_free(update);
}
void
evas_qtopia_outbuf_software_qtopia_push_updated_region(Outbuf *buf, RGBA_Image *update, int x, int y, int w, int h)
{
Gfx_Func_Convert conv_func;
DATA8 *data;
QT_Direct *d;
data = NULL;
conv_func = NULL;
d = evas_qt_main_direct_start(buf->priv.target);
if (d)
{
int i;
for (i = 0; i < d->rects.count; i++)
{
int fb_bytes;
DATA8 *fb_mem;
int ox, oy, ow, oh;
int rx, ry, rw, rh;
ox = x; oy = y; ow = w; oh = h;
rx = d->rects.r[i].x - d->location.x;
ry = d->rects.r[i].y - d->location.y;
rw = d->rects.r[i].w;
rh = d->rects.r[i].h;
if (x < rx)
{
w += (x - rx);
x = rx;
}
if (y < ry)
{
h += (y - ry);
y = ry;
}
if ((w <= 0) || (h <= 0)) goto nope;
if ((x + w) > (rx + rw)) w = (rx + rw - x);
if ((y + h) > (ry + rh)) h = (ry + rh - y);
if ((w <= 0) || (h <= 0)) goto nope;
fb_bytes = d->fb.bpp / 8;
if (buf->rot == 0)
{
fb_mem = d->fb.data +
((d->location.y * d->fb.width * fb_bytes) +
(d->location.x * fb_bytes));
data = fb_mem + (fb_bytes * (x + (y * d->fb.width)));
conv_func = evas_common_convert_func_get(data, w, h, d->fb.bpp,
d->fb.mask.r, d->fb.mask.g, d->fb.mask.b,
PAL_MODE_NONE, buf->rot);
}
else if (buf->rot == 180)
{
// FIXME
}
else if (buf->rot == 270)
{
fb_mem = d->fb.data +
(fb_bytes *
((d->location.x * d->fb.width) +
(d->fb.width - d->location.y - d->location.h)));
data = fb_mem + (fb_bytes * (buf->h - y - h + (x * d->fb.width)));
conv_func = evas_common_convert_func_get(data, h, w, d->fb.bpp,
d->fb.mask.r, d->fb.mask.g, d->fb.mask.b,
PAL_MODE_NONE, buf->rot);
}
else if (buf->rot == 90)
{
// FIXME: wrong fb_mem
fb_mem = d->fb.data +
((d->location.y * d->fb.width * fb_bytes) +
(d->location.x * fb_bytes));
data = fb_mem + (fb_bytes * (y + ((buf->w - x - w) * d->fb.width)));
conv_func = evas_common_convert_func_get(data, h, w, d->fb.bpp,
d->fb.mask.r, d->fb.mask.g, d->fb.mask.b,
PAL_MODE_NONE, buf->rot);
}
if (conv_func)
{
DATA32 *src_data;
if (buf->rot == 0)
{
src_data = update->image->data +
(ow * (y - oy)) + (x - ox);
conv_func(src_data, data,
ow - w,
d->fb.width - w,
w, h,
x, y, NULL);
}
else if (buf->rot == 180)
{
// FIXME
}
else if (buf->rot == 270)
{
src_data = update->image->data +
(ow * (y - oy)) + (x - ox);
conv_func(src_data, data,
ow - w,
d->fb.width - h,
h, w,
x, y, NULL);
}
else if (buf->rot == 90)
{
src_data = update->image->data +
(ow * (y - oy)) + (x - ox);
conv_func(src_data, data,
ow - w,
d->fb.width - h,
h, w,
x, y, NULL);
}
}
nope:;
x = ox; y = oy; w = ow; h = oh;
}
d->updated.x = x; d->updated.y = y; d->updated.w = w; d->updated.h = h;
evas_qt_main_direct_stop(d);
}
}
void
evas_qtopia_outbuf_software_qtopia_reconfigure(Outbuf *buf, int w, int h, int rot, Outbuf_Depth depth)
{
if ((w == buf->w) && (h == buf->h) &&
(rot == buf->rot) && (depth == buf->depth))
return;
buf->w = w;
buf->h = h;
buf->rot = rot;
}
int
evas_qtopia_outbuf_software_qtopia_get_width(Outbuf *buf)
{
return buf->w;
}
int
evas_qtopia_outbuf_software_qtopia_get_height(Outbuf *buf)
{
return buf->h;
}
Outbuf_Depth
evas_qtopia_outbuf_software_qtopia_get_depth(Outbuf *buf)
{
return buf->depth;
}
int
evas_qtopia_outbuf_software_qtopia_get_rot(Outbuf *buf)
{
return buf->rot;
}
int
evas_qtopia_outbuf_software_qtopia_get_have_backbuf(Outbuf *buf)
{
return 0;
}
void
evas_qtopia_outbuf_software_qtopia_set_have_backbuf(Outbuf *buf, int have_backbuf)
{
}

@ -1,109 +0,0 @@
#include "evas_common.h"
#include "evas_engine.h"
#include <qwidget.h>
#include <qnamespace.h>
#include <qbrush.h>
#include <qpainter.h>
#include <qdirectpainter_qws.h>
//#define QVFB_BUG
extern "C" {
QT_Direct *
evas_qt_main_direct_start(void *target)
{
QT_Direct *d;
QDirectPainter *dp;
QWidget *widget;
int i;
widget = (QWidget *)target;
dp = new QDirectPainter(widget);
if (!dp) return NULL;
d = (QT_Direct *)calloc(1, sizeof(QT_Direct));
if (!d) return NULL;
d->target = target;
d->direct = (void *)dp;
d->fb.data = dp->frameBuffer();
d->fb.bpp = dp->depth();
d->fb.width = dp->lineStep() / (d->fb.bpp / 8);
if (dp->depth() == 16)
{
d->fb.mask.r = 0xf800;
d->fb.mask.g = 0x07e0;
d->fb.mask.b = 0x001f;
}
else if (dp->depth() == 32)
{
d->fb.mask.r = 0x00ff0000;
d->fb.mask.g = 0x0000ff00;
d->fb.mask.b = 0x000000ff;
}
else
{
delete dp;
free(d);
return NULL;
}
d->fb.rotation = dp->transformOrientation() * 90;
d->rects.count = dp->numRects();
if (d->rects.count > 0)
{
d->rects.r = (QT_Direct_Rect *)calloc(d->rects.count, sizeof(QT_Direct_Rect));
if (d->rects.r)
{
for (i = 0; i < d->rects.count; i++)
{
QRect r;
r = dp->rect(i);
if (d->fb.rotation == 0)
{
d->rects.r[i].x = r.x();
d->rects.r[i].y = r.y();
d->rects.r[i].w = r.width();
d->rects.r[i].h = r.height();
}
else if (d->fb.rotation == 270)
{
d->rects.r[i].x = r.y();
d->rects.r[i].y = d->fb.width - r.x() - r.width();
d->rects.r[i].w = r.height();
d->rects.r[i].h = r.width();
}
else if (d->fb.rotation == 90)
{
// FIXME: do
}
}
}
else
d->rects.count = 0;
}
d->location.x = dp->xOffset();
d->location.y = dp->yOffset();
d->location.w = dp->width();
d->location.h = dp->height();
return d;
}
void
evas_qt_main_direct_stop(QT_Direct *d)
{
QDirectPainter *dp;
#ifdef QVFB_BUG
{
QWidget *target = (QWidget *)d->target;
QRect rect(d->updated.x, d->updated.y,
d->updated.w, d->updated.h);
QPainter p(target);
p.fillRect(rect, QBrush::NoBrush);
}
#endif
dp = (QDirectPainter *)d->direct;
delete dp;
if (d->rects.r) free(d->rects.r);
free(d);
}
}
Loading…
Cancel
Save