diff options
| -rw-r--r-- | Android/386/include/lib9.h | 3 | ||||
| -rw-r--r-- | Android/arm/include/lib9.h | 1 | ||||
| -rw-r--r-- | emu/Android/alloc-andr.c | 5 | ||||
| -rw-r--r-- | emu/Android/amain.c | 3 | ||||
| -rw-r--r-- | emu/port/devdraw.c | 156 | ||||
| -rw-r--r-- | libdraw/getsubfont_ft.c | 1 | ||||
| -rw-r--r-- | libfreetype/freetype.c | 18 | ||||
| -rw-r--r-- | libmemdraw/alloc.c | 24 | ||||
| -rw-r--r-- | libmemdraw/draw.c | 234 | ||||
| -rw-r--r-- | libmemdraw/hwdraw.c | 59 | ||||
| -rw-r--r-- | libmemlayer/draw.c | 13 | ||||
| -rw-r--r-- | libmemlayer/lalloc.c | 18 | ||||
| -rw-r--r-- | libmemlayer/ldelete.c | 12 | ||||
| -rw-r--r-- | libmemlayer/ltofront.c | 5 | ||||
| -rw-r--r-- | libmemlayer/ltorear.c | 5 | ||||
| -rw-r--r-- | limbo/asm.o | bin | 33636 -> 0 bytes | |||
| -rw-r--r-- | limbo/com.o | bin | 90292 -> 0 bytes | |||
| -rw-r--r-- | limbo/decls.o | bin | 96528 -> 0 bytes | |||
| -rw-r--r-- | limbo/dis.o | bin | 52496 -> 0 bytes | |||
| -rw-r--r-- | limbo/dtocanon.o | bin | 4252 -> 0 bytes | |||
| -rw-r--r-- | limbo/ecom.o | bin | 127764 -> 0 bytes | |||
| -rw-r--r-- | limbo/gen.o | bin | 78192 -> 0 bytes | |||
| -rw-r--r-- | limbo/lex.o | bin | 94416 -> 0 bytes | |||
| -rw-r--r-- | limbo/nodes.o | bin | 94316 -> 0 bytes | |||
| -rw-r--r-- | limbo/optab.o | bin | 18432 -> 0 bytes | |||
| -rw-r--r-- | limbo/optim.o | bin | 94656 -> 0 bytes | |||
| -rw-r--r-- | limbo/sbl.o | bin | 36820 -> 0 bytes | |||
| -rw-r--r-- | limbo/stubs.o | bin | 50736 -> 0 bytes | |||
| -rw-r--r-- | limbo/typecheck.o | bin | 193724 -> 0 bytes | |||
| -rw-r--r-- | limbo/types.o | bin | 253212 -> 0 bytes | |||
| -rw-r--r-- | limbo/y.tab.o | bin | 103156 -> 0 bytes | |||
| -rw-r--r-- | mkconfig | 2 | ||||
| -rw-r--r-- | mkfiles/mkfile-Android-arm | 1 | ||||
| -rw-r--r-- | tools/libstyx/Posix.o | bin | 22188 -> 0 bytes | |||
| -rw-r--r-- | tools/libstyx/styxserver.o | bin | 64944 -> 0 bytes | |||
| -rw-r--r-- | tools/styxtest/o.out | bin | 185116 -> 0 bytes | |||
| -rw-r--r-- | tools/styxtest/styxtest.o | bin | 20228 -> 0 bytes | |||
| -rw-r--r-- | utils/iyacc/o.out | bin | 216296 -> 0 bytes | |||
| -rw-r--r-- | utils/iyacc/yacc.o | bin | 144404 -> 0 bytes |
39 files changed, 487 insertions, 73 deletions
diff --git a/Android/386/include/lib9.h b/Android/386/include/lib9.h index 6c4153a..eac65be 100644 --- a/Android/386/include/lib9.h +++ b/Android/386/include/lib9.h @@ -64,7 +64,8 @@ typedef unsigned long uintptr; #undef offsetof #define offsetof(s, m) (ulong)(&(((s*)0)->m)) #undef assert -#define assert(x) if(x){}else _assert("x") +//#define assert(x) if(x){}else _assert("x") +#define assert(x) if(x){}else _assert("%s: %d", __func__, __LINE__) /* * most mem and string routines are declared by ANSI/POSIX files above diff --git a/Android/arm/include/lib9.h b/Android/arm/include/lib9.h index 20f676f..33fac6d 100644 --- a/Android/arm/include/lib9.h +++ b/Android/arm/include/lib9.h @@ -92,6 +92,7 @@ typedef unsigned long uintptr; */ extern char* strecpy(char*, char*, char*); +#define strdup strdup_ extern char* strdup(const char*); extern int cistrncmp(char*, char*, int); extern int cistrcmp(char*, char*); diff --git a/emu/Android/alloc-andr.c b/emu/Android/alloc-andr.c index 196062e..8325951 100644 --- a/emu/Android/alloc-andr.c +++ b/emu/Android/alloc-andr.c @@ -805,7 +805,7 @@ free(void *v) { Bhdr *b; - if(v != nil) { + if(v != nil && v > 0x1000 && v < 0xffff0000) { if(Npadlong) v = (ulong*)v-Npadlong; D2B(b, v); @@ -820,6 +820,9 @@ realloc(void *v, size_t size) { void *nv; + if(v <= 0x1000 || v >= 0xffff0000) + v = nil; + if(size == 0) return malloc(size); /* temporary change until realloc calls can be checked */ if(v != nil) diff --git a/emu/Android/amain.c b/emu/Android/amain.c index 46f5ebf..26ca8c5 100644 --- a/emu/Android/amain.c +++ b/emu/Android/amain.c @@ -31,7 +31,7 @@ extern int mflag; extern int Xsize; // = 640; // = 640; extern int Ysize; // = 480; // = 480; int bflag = 1; - int sflag = 0; + int sflag = 1; int qflag = 0; int xtblbit = 0; ulong displaychan = 32; @@ -295,6 +295,7 @@ amain() snprint(sdcard_path, 127, "%s/Inferno", getenv("EXTERNAL_STORAGE")); strecpy(rootdir, rootdir+sizeof(rootdir), sdcard_path); +//LOGI("%s: %d sdcard_path=%s", __func__, __LINE__, sdcard_path); snprint(calltracelog_path, 127, "%s/backtrace.log", rootdir); f = fopen(calltracelog_path, "a"); if(f){ diff --git a/emu/port/devdraw.c b/emu/port/devdraw.c index eda8798..161c36a 100644 --- a/emu/port/devdraw.c +++ b/emu/port/devdraw.c @@ -12,6 +12,15 @@ #include "interp.h" +#include <android/log.h> + + +#define LOG_TAG "inferno D-DRW" +#define LOGI(...) __android_log_print(ANDROID_LOG_INFO,LOG_TAG,__VA_ARGS__) +#define LOGW(...) __android_log_print(ANDROID_LOG_WARN,LOG_TAG,__VA_ARGS__) +#define LOGE(...) __android_log_print(ANDROID_LOG_ERROR,LOG_TAG,__VA_ARGS__) + + enum { @@ -385,7 +394,17 @@ void dstflush(Memimage *dst, Rectangle r) { Memlayer *l; - + + int dstw, dsth; + void *ext_win=NULL; +/**/ +#ifdef EXT_WIN + if(dst->ext_win){ + clutter_ext_win_repaint(dst->ext_win); + return; + } +#endif +/**/ if(dst == screenimage){ combinerect(&flushrect, r); return; @@ -643,6 +662,9 @@ drawfreedimage(DImage *dimage) ds = dimage->dscreen; if(ds){ l = dimage->image; +#ifdef EXT_WIN + if(l->layer->screen->image->ext_win == NULL) +#endif if(l->data == screenimage->data) dstflush(l->layer->screen->image, l->layer->screenr); if(l->layer->refreshfn == drawrefresh) /* else true owner will clean up */ @@ -1260,7 +1282,7 @@ printmesg(char *fmt, uchar *a, int plsprnt) char *p, *q; int s; -#if 1 +#if 0 if(1|| plsprnt==0){ SET(s); SET(q); SET(p); USED(fmt); USED(a); USED(buf); USED(p); USED(q); USED(s); @@ -1302,7 +1324,8 @@ printmesg(char *fmt, uchar *a, int plsprnt) } *q++ = '\n'; *q = 0; - iprint("%.*s", (int)(q-buf), buf); +// iprint("%.*s", (int)(q-buf), buf); +LOGI("%s", buf); } void @@ -1376,6 +1399,12 @@ drawmesg(Client *client, void *av, int n) l = memlalloc(scrn, r, reffn, 0, value); if(l == 0) error(Edrawmem); +#ifdef EXT_WIN + if(l->ext_win){ + clutter_ext_win_child_to_layer(l->ext_win, scrnid); + } +// if(l->layer->screen->image->ext_win == NULL) +#endif dstflush(l->layer->screen->image, l->layer->screenr); l->clipr = clipr; rectclip(&l->clipr, r); @@ -1431,6 +1460,11 @@ drawmesg(Client *client, void *av, int n) error(Enodrawimage); if(drawinstallscreen(client, 0, dstid, ddst, dsrc, a[13]) == 0) error(Edrawmem); +#ifdef EXT_WIN + if(ddst->image->ext_win){ + clutter_ext_win_add_layer(ddst->image->ext_win, dstid); + } +#endif continue; /* set repl and clip: 'c' dstid[4] repl[1] clipR[4*4] */ @@ -1447,12 +1481,36 @@ drawmesg(Client *client, void *av, int n) dst = ddst->image; if(a[5]) dst->flags |= Frepl; +#ifndef EXT_WIN drawrectangle(&dst->clipr, a+6); +#else +LOGI("%s: %d ext_win=%x, repl=%d", __func__, __LINE__, dst->ext_win, a[5]); + if(!dst->ext_win){ + drawrectangle(&dst->clipr, a+6); + }else{ + drawrectangle(&dst->clipr, a+6); + /**/ + { + Rectangle *rr = &dst->clipr; + int x, y, w, h; + clutter_ext_win_get_coords(dst->ext_win, &x, &y, &w, &h); + + //clutter_clipr_actor(dst->ext_win, rr->min.x, rr->min.y, rr->max.x, rr->max.y); + + rr->max.x += x; + rr->max.y += y; + rr->min.x += x; + rr->min.y += y; +//LOGI("clutter clipr window wh=(%d, %d)\n", rr->max.x - rr->min.x, rr->max.y - rr->min.y); + } + /**/ + } +#endif continue; /* attach to ext win: 'W' dstid[4] */ case 'W': - printmesg(fmt="L", a, 0); +// printmesg(fmt="L", a, 0); m = 1+4; if(n < m) error(Eshortdraw); @@ -1461,18 +1519,18 @@ drawmesg(Client *client, void *av, int n) //op = drawclientop(client); //memdraw(dst, r, src, p, mask, q, op); //dstflush(dst, r); -#ifdef clutter - if(dst->data && !dst->ext_win) - dst->ext_win = attach_clutter_actor(dst->data->bdata, - r.min.x, r.min.y, - r.max.x, r.max.y); -printf("clutter new window\n"); +#ifdef EXT_WIN +// if(dst->data && !dst->ext_win) +// dst->ext_win = attach_clutter_actor(dst->data->bdata, +// r.min.x, r.min.y, +// r.max.x, r.max.y); +//print("clutter new window\n"); #endif continue; /* draw: 'd' dstid[4] srcid[4] maskid[4] R[4*4] P[2*4] P[2*4] */ case 'd': - printmesg(fmt="LLLRPP", a, 0); +// printmesg(fmt="LLLRPP", a, 0); m = 1+4+4+4+4*4+2*4+2*4; if(n < m) error(Eshortdraw); @@ -1489,7 +1547,7 @@ printf("clutter new window\n"); /* toggle debugging: 'D' val[1] */ case 'D': - printmesg(fmt="b", a, 0); +// printmesg(fmt="b", a, 0); m = 1+1; if(n < m) error(Eshortdraw); @@ -1499,7 +1557,7 @@ printf("clutter new window\n"); /* ellipse: 'e' dstid[4] srcid[4] center[2*4] a[4] b[4] thick[4] sp[2*4] alpha[4] phi[4]*/ case 'e': case 'E': - printmesg(fmt="LLPlllPll", a, 0); +// printmesg(fmt="LLPlllPll", a, 0); m = 1+4+4+2*4+4+4+4+2*4+2*4; if(n < m) error(Eshortdraw); @@ -1554,7 +1612,7 @@ printf("clutter new window\n"); /* initialize font: 'i' fontid[4] nchars[4] ascent[1] */ case 'i': - printmesg(fmt="Llb", a, 1); +// printmesg(fmt="Llb", a, 1); m = 1+4+4+1; if(n < m) error(Eshortdraw); @@ -1581,7 +1639,7 @@ printf("clutter new window\n"); /* load character: 'l' fontid[4] srcid[4] index[2] R[4*4] P[2*4] left[1] width[1] */ case 'l': - printmesg(fmt="LLSRPbb", a, 0); +// printmesg(fmt="LLSRPbb", a, 0); m = 1+4+4+2+4*4+2*4+1+1; if(n < m) error(Eshortdraw); @@ -1608,7 +1666,7 @@ printf("clutter new window\n"); /* draw line: 'L' dstid[4] p0[2*4] p1[2*4] end0[4] end1[4] radius[4] srcid[4] sp[2*4] */ case 'L': - printmesg(fmt="LPPlllLP", a, 0); +// printmesg(fmt="LPPlllLP", a, 0); m = 1+4+2*4+2*4+4+4+4+4+2*4; if(n < m) error(Eshortdraw); @@ -1713,6 +1771,39 @@ printf("clutter new window\n"); if(n < m) error(Eshortdraw); dst = drawimage(client, a+1); +#ifdef EXT_WIN + if(dst->ext_win){ + int x, y, dx, dy, cdx, cdy; + Rectangle *r = &(dst->r); + + drawpoint(&p, a+5); + drawpoint(&q, a+13); + + x = q.x-p.x; + y = q.y-p.y; + + dx = x - dst->r.min.x; + dy = y - dst->r.min.y; + + cdx = dst->clipr.min.x - dst->r.min.x; + cdy = dst->clipr.min.y - dst->r.min.y; + + /**/ + dst->r.min.x += dx; + dst->r.min.y += dy; + dst->r.max.x += dx; + dst->r.max.y += dy; + /**/ + dst->clipr.max.x += dx; + dst->clipr.max.y += dy; + dst->clipr.min.x += dx; + dst->clipr.min.y += dy; +// //dst->clipr = *r; + /**/ + clutter_move_actor(dst->ext_win, x, y); +//LOGI("clutter pos window x=%d, y=%d", x, y); + }else +#endif if(dst->layer){ drawpoint(&p, a+5); drawpoint(&q, a+13); @@ -1742,7 +1833,7 @@ printf("clutter new window\n"); /* polygon: 'p' dstid[4] n[2] end0[4] end1[4] radius[4] srcid[4] sp[2*4] p0[2*4] dp[2*2*n] */ case 'p': case 'P': - printmesg(fmt="LslllLPP", a, 0); +// printmesg(fmt="LslllLPP", a, 0); m = 1+4+2+4+4+4+4+2*4; if(n < m) error(Eshortdraw); @@ -1822,6 +1913,18 @@ printf("clutter new window\n"); error(Eshortdraw); i = drawimage(client, a+1); drawrectangle(&r, a+5); +#ifdef EXT_WIN + /** + if(i->ext_win){ + int x,y; + clutter_ext_win_get_coords(i->ext_win, &x, &y, NULL, NULL); + r.min.x += x; + r.min.y += y; + r.max.x += x; + r.max.y += y; + } + /**/ +#endif if(!rectinrect(r, i->r)) error(Ereadoutside); c = bytesperline(r, i->depth); @@ -1842,7 +1945,7 @@ printf("clutter new window\n"); /* stringbg: 'x' dstid[4] srcid[4] fontid[4] P[2*4] clipr[4*4] sp[2*4] ni[2] bgid[4] bgpt[2*4] ni*(index[2]) */ case 's': case 'x': - printmesg(fmt="LLLPRPs", a, 0); +// printmesg(fmt="LLLPRPs", a, 0); m = 1+4+4+4+2*4+4*4+2*4+2; if(*a == 'x') m += 4+2*4; @@ -1864,6 +1967,19 @@ printf("clutter new window\n"); m += ni*2; if(n < m) error(Eshortdraw); +#ifdef EXT_WIN + /**/ + if(dst->ext_win){ + int x, y, w, h; + clutter_ext_win_get_coords(dst->ext_win, &x, &y, &w, &h); + + r.min.x += x; + r.min.y += y; + r.max.x += x; + r.max.y += y; + } + /**/ +#endif clipr = dst->clipr; dst->clipr = r; op = drawclientop(client); @@ -1953,11 +2069,13 @@ printf("clutter new window\n"); memltofrontn(lp, nw); else memltorearn(lp, nw); +#ifndef EXT_WIN if(lp[0]->layer->screen->image->data == screenimage->data) for(j=0; j<nw; j++) dstflush(lp[j]->layer->screen->image, lp[j]->layer->screenr); ll = drawlookup(client, BGLONG(a+1+1+2), 1); drawrefreshscreen(ll, client); +#endif poperror(); free(lp); continue; @@ -1973,7 +2091,7 @@ printf("clutter new window\n"); /* write from compressed data: 'Y' id[4] R[4*4] data[x*1] */ case 'y': case 'Y': - printmesg(fmt="LR", a, 0); +// printmesg(fmt="LR", a, 0); // iprint("load %c\n", *a); m = 1+4+4*4; if(n < m) diff --git a/libdraw/getsubfont_ft.c b/libdraw/getsubfont_ft.c index 7a62084..a2074b9 100644 --- a/libdraw/getsubfont_ft.c +++ b/libdraw/getsubfont_ft.c @@ -22,6 +22,7 @@ #include "freetype.h" + int is_subfont_ft(char *name){ char c1, c2, c3, c4; diff --git a/libfreetype/freetype.c b/libfreetype/freetype.c index d7e07a4..ccbd7c0 100644 --- a/libfreetype/freetype.c +++ b/libfreetype/freetype.c @@ -5,18 +5,36 @@ static char* fterrstr(int); +#ifdef EXT_WIN +extern char rootdir[]; +#endif + char* ftnewface(char *path, int index, FTface *f, FTfaceinfo *finfo) { FT_Library ft_lib; FT_Face ft_face; char *err; +#ifdef EXT_WIN + char *path2; +#endif err = fterrstr(FT_Init_FreeType(&ft_lib)); if (err != nil) return err; +#ifdef EXT_WIN + path2 = malloc(strlen(rootdir) + 1 + strlen(path) + 1); + sprintf(path2, "%s%s", rootdir, path); + path = path2; +#endif + err = fterrstr(FT_New_Face(ft_lib, path, index, &ft_face)); + +#ifdef EXT_WIN + free(path2); +#endif + if (err != nil) { FT_Done_FreeType(ft_lib); return err; diff --git a/libmemdraw/alloc.c b/libmemdraw/alloc.c index 8a52a49..04211fa 100644 --- a/libmemdraw/alloc.c +++ b/libmemdraw/alloc.c @@ -3,6 +3,16 @@ #include "memdraw.h" #include "pool.h" +#ifdef EXT_WIN +#include <android/log.h> + + +#define LOG_TAG "inferno LmALC" +#define LOGI(...) __android_log_print(ANDROID_LOG_INFO,LOG_TAG,__VA_ARGS__) +#define LOGW(...) __android_log_print(ANDROID_LOG_WARN,LOG_TAG,__VA_ARGS__) +#define LOGE(...) __android_log_print(ANDROID_LOG_ERROR,LOG_TAG,__VA_ARGS__) +#endif + extern Pool* imagmem; void @@ -87,6 +97,7 @@ allocmemimage(Rectangle r, ulong chan) } md->base[0] = (ulong)md; + md->base[1] = 0; /* md->base[1] = getcallerpc(&r); */ /* if this changes, memimagemove must change too */ @@ -109,6 +120,13 @@ freememimage(Memimage *i) { if(i == nil) return; +#ifdef EXT_WIN + if(i->ext_win){ +LOGI("(%d) clutter free img ext_win=%x", __LINE__, i->ext_win); + clutter_ext_win_free(i->ext_win); + i->ext_win = NULL; + } +#endif if(i->data->ref-- == 1 && i->data->allocd){ if(i->data->base) poolfree(imagmem, i->data->base); @@ -131,6 +149,12 @@ byteaddr(Memimage *i, Point p) { uchar *a; +#ifdef EXT_WIN + if(i->ext_win){ + a = clutter_ext_win_get_dp(i->ext_win, p.x, p.y, NULL, NULL, NULL); + if(a) return a; + } +#endif a = i->data->bdata+i->zero+sizeof(ulong)*p.y*i->width; if(i->depth < 8){ diff --git a/libmemdraw/draw.c b/libmemdraw/draw.c index e37de6b..cc7a9c7 100644 --- a/libmemdraw/draw.c +++ b/libmemdraw/draw.c @@ -3,6 +3,18 @@ #include "memdraw.h" #include "pool.h" +//#undef EXT_WIN + +#ifdef ANDROID +#include <android/log.h> + +#define LOG_TAG "inferno DRWml" +#define LOGI(...) __android_log_print(ANDROID_LOG_INFO,LOG_TAG,__VA_ARGS__) +#define LOGW(...) __android_log_print(ANDROID_LOG_WARN,LOG_TAG,__VA_ARGS__) +#define LOGE(...) __android_log_print(ANDROID_LOG_ERROR,LOG_TAG,__VA_ARGS__) +#endif + + extern Pool* imagmem; int drawdebug; static int tablesbuilt; @@ -87,24 +99,98 @@ static ulong imgtorgba(Memimage*, ulong); static ulong rgbatoimg(Memimage*, ulong); static ulong pixelbits(Memimage*, Point); + +#ifdef EXT_WIN +int clutter_ext_win_get_coords(void *actor, int *x, int *y, int *w, int *h); +#endif + + #define DBG if(0) void memimagedraw(Memimage *dst, Rectangle r, Memimage *src, Point p0, Memimage *mask, Point p1, int op) { Memdrawparam par; +#ifdef EXT_WIN + Rectangle tr = r; +#endif if(mask == nil) mask = memopaque; DBG print("memimagedraw %p/%luX %R @ %p %p/%luX %P %p/%luX %P... ", dst, dst->chan, r, dst->data->bdata, src, src->chan, p0, mask, mask->chan, p1); +#ifdef EXT_WIN + Rectangle ocr = dst->clipr; + if(dst->ext_win){ + int x, y, w, h, dx, dy; + + clutter_ext_win_get_coords(dst->ext_win, &x, &y, &w, &h); + + LOGE("-- Fr: %s: %i cl=%x (%d, %d, %d, %d), \nr=(%d, %d, %d, %d), \nsr=(%d, %d, %d, %d), \nmr=(%d, %d, %d, %d), \ndst->r=(%d, %d, %d, %d), \ndst->clipr=(%d, %d, %d, %d), \np0=(%d, %d), p1=(%d, %d)", + __func__, __LINE__, + dst->ext_win, x, y, w, h, + r.min.x, r.min.y, Dx(r), Dy(r), + par.sr.min.x, par.sr.min.y, Dx(par.sr), Dy(par.sr), + par.mr.min.x, par.mr.min.y, Dx(par.mr), Dy(par.mr), + dst->r.min.x, dst->r.min.y, Dx(dst->r), Dy(dst->r), + dst->clipr.min.x, dst->clipr.min.y, Dx(dst->clipr), Dy(dst->clipr), + p0.x, p0.y, p1.x, p1.y); + + /**/ + r.max.x += x; + r.max.y += y; + r.min.x += x; + r.min.y += y; + + /** / + dst->clipr.max.x += x; + dst->clipr.max.y += y; + dst->clipr.min.x += x; + dst->clipr.min.y += y; + /**/ + + } + if(src->ext_win){ + int x, y, w, h, dx, dy; + clutter_ext_win_get_coords(src->ext_win, &x, &y, &w, &h); +//LOGE("-- Src->ext_win: %s: %i cl=%x", __func__, __LINE__, src->ext_win); + /**/ + p0.x += x; + p0.y += y; + /**/ + } +#endif if(drawclip(dst, &r, src, &p0, mask, &p1, &par.sr, &par.mr) == 0){ +#ifdef EXT_WIN + dst->clipr = ocr; +#endif // if(drawdebug) // iprint("empty clipped rectangle\n"); return; } +#ifdef EXT_WIN + if(dst->ext_win){ + int x, y, w, h; + if(clutter_ext_win_get_coords(dst->ext_win, &x, &y, &w, &h)){ + LOGE("-- To: %s: %i cl=%x (%d, %d, %d, %d), \nr=(%d, %d, %d, %d), \nsr=(%d, %d, %d, %d), \nmr=(%d, %d, %d, %d), \ndst->r=(%d, %d, %d, %d), \ndst->clipr=(%d, %d, %d, %d), \np0=(%d, %d), p1=(%d, %d)", + __func__, __LINE__, + dst->ext_win, x, y, w, h, + r.min.x, r.min.y, Dx(r), Dy(r), + par.sr.min.x, par.sr.min.y, Dx(par.sr), Dy(par.sr), + par.mr.min.x, par.mr.min.y, Dx(par.mr), Dy(par.mr), + dst->r.min.x, dst->r.min.y, Dx(dst->r), Dy(dst->r), + dst->clipr.min.x, dst->clipr.min.y, Dx(dst->clipr), Dy(dst->clipr), + p0.x, p0.y, p1.x, p1.y); + + } + + } +#endif if(op < Clear || op > SoverD){ +#ifdef EXT_WIN + dst->clipr = ocr; +#endif // if(drawdebug) // iprint("op out of range: %d\n", op); return; @@ -127,6 +213,9 @@ DBG print("memimagedraw %p/%luX %R @ %p %p/%luX %P %p/%luX %P... ", dst, dst->ch par.srgba = imgtorgba(src, par.sval); par.sdval = rgbatoimg(dst, par.srgba); if((par.srgba&0xFF) == 0 && (op&DoutS)){ +#ifdef EXT_WIN + dst->clipr = ocr; +#endif // if (drawdebug) iprint("fill with transparent source\n"); return; /* no-op successfully handled */ } @@ -138,6 +227,9 @@ DBG print("memimagedraw %p/%luX %R @ %p %p/%luX %P %p/%luX %P... ", dst, dst->ch if(Dx(mask->r)==1 && Dy(mask->r)==1){ par.mval = pixelbits(mask, mask->r.min); if(par.mval == 0 && (op&DoutS)){ +#ifdef EXT_WIN + dst->clipr = ocr; +#endif // if(drawdebug) iprint("fill with zero mask\n"); return; /* no-op successfully handled */ } @@ -166,6 +258,9 @@ DBG print("draw dr %R sr %R mr %R %lux\n", r, par.sr, par.mr, par.state); */ DBG print("test hwdraw\n"); if(hwdraw(&par)){ +#ifdef EXT_WIN + dst->clipr = ocr; +#endif //if(drawdebug) iprint("hw handled\n"); DBG print("hwdraw handled\n"); return; @@ -175,6 +270,14 @@ DBG print("hwdraw handled\n"); */ DBG print("test memoptdraw\n"); if(memoptdraw(&par)){ +#ifdef EXT_WIN + void *ext_win=NULL; + + dst->clipr = ocr; + +// ext_win = dst->ext_win; +// if(ext_win) clutter_ext_win_repaint(ext_win); +#endif //if(drawdebug) iprint("memopt handled\n"); DBG print("memopt handled\n"); return; @@ -186,6 +289,14 @@ DBG print("memopt handled\n"); */ DBG print("test chardraw\n"); if(chardraw(&par)){ +#ifdef EXT_WIN + void *ext_win=NULL; + + dst->clipr = ocr; + +// ext_win = dst->ext_win; +// if(ext_win) clutter_ext_win_repaint(ext_win); +#endif //if(drawdebug) iprint("chardraw handled\n"); DBG print("chardraw handled\n"); return; @@ -198,6 +309,9 @@ DBG print("do alphadraw\n"); alphadraw(&par); //if(drawdebug) iprint("alphadraw handled\n"); DBG print("alphadraw handled\n"); +#ifdef EXT_WIN + dst->clipr = ocr; +#endif } #undef DBG @@ -513,14 +627,30 @@ getparam(Param *p, Memimage *img, Rectangle r, int convgrey, int needbuf, int *n p->bytey0s = byteaddr(img, Pt(img->r.min.x, img->r.min.y)); p->bytermin = byteaddr(img, Pt(r.min.x, img->r.min.y)); - p->bytey0e = byteaddr(img, Pt(img->r.max.x, img->r.min.y)); +#ifdef EXT_WIN + p->bytey0e = byteaddr(img, Pt(img->r.max.x, img->r.max.y)); //img->r.min.y)); +#else + p->bytey0e = byteaddr(img, Pt(img->r.max.x, img->r.max.y)); //img->r.min.y)); +#endif p->bwidth = sizeof(ulong)*img->width; +#ifdef EXT_WIN + if(img->ext_win){ + void* a; + int wid; + a = clutter_ext_win_get_dp(img->ext_win, img->r.min.x, r.min.y, &wid, NULL, NULL); + if(a){ + p->bwidth = wid; + } + } +#endif + assert(p->bytey0s <= p->bytermin && p->bytermin <= p->bytey0e); - if(p->r.min.x == p->img->r.min.x) + if(p->r.min.x == p->img->r.min.x){ assert(p->bytermin == p->bytey0s); - + } + nbuf = 1; if((img->flags&Frepl) && Dy(img->r) <= MAXBCACHE && Dy(img->r) < Dy(r)){ p->replcache = 1; @@ -608,6 +738,7 @@ alphadraw(Memdrawparam *par) Memimage *src, *mask, *dst; Rectangle r, sr, mr; Dbuf *z; + void *ext_win = NULL; z = allocdbuf(); if(z == nil) @@ -623,7 +754,7 @@ alphadraw(Memdrawparam *par) sr = par->sr; mr = par->mr; op = par->op; - + isgrey = dst->flags&Fgrey; /* @@ -732,6 +863,16 @@ alphadraw(Memdrawparam *par) z->dpar.bufbase = drawbuf+z->dpar.bufoff; z->spar.convbuf = drawbuf+z->spar.convbufoff; +#ifdef EXT_WIN + ext_win = dst->ext_win; + if(ext_win){ + int x, y, w, h; + clutter_ext_win_get_coords(ext_win, &x, &y, &w, &h); + dy = (dy >= h ? h-1 : dy); + dx = (dx >= w ? w-1 : dx); + } +#endif + if(dir == 1){ starty = 0; endy = dy; @@ -1714,6 +1855,7 @@ boolmemmove(Buffer bdst, Buffer bsrc, Buffer b1, int dx, int i, int o) USED(i); USED(o); USED(b1.grey); +LOGI("%s: %d", __func__, __LINE__); memmove(bdst.red, bsrc.red, dx*bdst.delta); return bdst; } @@ -1898,8 +2040,9 @@ pixelbits(Memimage *i, Point pt) static Calcfn* boolcopyfn(Memimage *img, Memimage *mask) { - if(mask->flags&Frepl && Dx(mask->r)==1 && Dy(mask->r)==1 && pixelbits(mask, mask->r.min)==~0) + if(mask->flags&Frepl && Dx(mask->r)==1 && Dy(mask->r)==1 && pixelbits(mask, mask->r.min)==~0){ return boolmemmove; + } switch(img->depth){ case 8: @@ -2071,6 +2214,8 @@ memoptdraw(Memdrawparam *par) ulong v; Memimage *src; Memimage *dst; + int dstw, dsth; + void *ext_win=NULL; dx = Dx(par->r); dy = Dy(par->r); @@ -2078,6 +2223,10 @@ memoptdraw(Memdrawparam *par) dst = par->dst; op = par->op; +#ifdef EXT_WIN + ext_win = dst->ext_win; +#endif + DBG print("state %lux mval %lux dd %d\n", par->state, par->mval, dst->depth); /* * If we have an opaque mask and source is one opaque pixel we can convert to the @@ -2090,8 +2239,30 @@ DBG print("state %lux mval %lux dd %d\n", par->state, par->mval, dst->depth); uchar lm, rm; DBG print("memopt, dst %p, dst->data->bdata %p\n", dst, dst->data->bdata); - dwid = dst->width*sizeof(ulong); dp = byteaddr(dst, par->r.min); + dwid = dst->width*sizeof(ulong); +#ifdef EXT_WIN + if(ext_win){ + dp = clutter_ext_win_get_dp(ext_win, par->r.min.x, par->r.min.y, &dwid, &dstw, &dsth); + if(!dp) + return 1; + dy = (dy > dsth ? dsth : dy); + dx = (dx > dstw ? dstw : dx); + } +#endif + +#ifdef EXT_WIN + if(ext_win) + LOGI("%s: %d zakr src_xy=(%d, %d), src_wh=(%d, %d), dst_wh=(%d, %d), clu_xy=(%d, %d), clu_wh=(%d, %d), clu=%x", + __func__, __LINE__, + par->sr.min.x, par->sr.min.y, + Dx(src->r), Dy(src->r), + dx, dy, + par->r.min.x, par->r.min.y, + dstw, dsth, + ext_win); +#endif + v = par->sdval; DBG print("sdval %lud, depth %d\n", v, dst->depth); switch(dst->depth){ @@ -2174,6 +2345,7 @@ DBG print("dp=%p; dx=%d; for(y=0; y<%d; y++, dp+=%d)\nmemsets(dp, v, dx);\n", p[2] = v>>16; p[3] = v>>24; v = *(ulong*)p; + for(y=0; y<dy; y++, dp+=dwid) memsetl(dp, v, dx); return 1; @@ -2199,10 +2371,31 @@ DBG print("dp=%p; dx=%d; for(y=0; y<%d; y++, dp+=%d)\nmemsets(dp, v, dx);\n", else dir = 1; - swid = src->width*sizeof(ulong); - dwid = dst->width*sizeof(ulong); sp = byteaddr(src, par->sr.min); + swid = src->width*sizeof(ulong); dp = byteaddr(dst, par->r.min); + dwid = dst->width*sizeof(ulong); +#ifdef EXT_WIN + if(ext_win){ + dp = clutter_ext_win_get_dp(ext_win, par->r.min.x, par->r.min.y, &dwid, &dstw, &dsth); + if(!dp) + return 1; + dy = (dy > dsth ? dsth : dy); + dx = (dx > dstw ? dstw : dx); + } +#endif + +#ifdef EXT_WIN + if(ext_win) +LOGI("%s: %d img src_xy=(%d, %d), src_wh=(%d, %d), dst_wh=(%d, %d), clu_xy=(%d, %d), clu_wh=(%d, %d), clu=%x", + __func__, __LINE__, + par->sr.min.x, par->sr.min.y, + Dx(src->r), Dy(src->r), + dx, dy, + par->r.min.x, par->r.min.y, + dstw, dsth, + ext_win); +#endif if(dir == -1){ sp += (dy-1)*swid; dp += (dy-1)*dwid; @@ -2210,6 +2403,7 @@ DBG print("dp=%p; dx=%d; for(y=0; y<%d; y++, dp+=%d)\nmemsets(dp, v, dx);\n", dwid = -dwid; } nb = (dx*src->depth)/8; + for(y=0; y<dy; y++, sp+=swid, dp+=dwid) memmove(dp, sp, nb); return 1; @@ -2227,13 +2421,25 @@ DBG print("dp=%p; dx=%d; for(y=0; y<%d; y++, dp+=%d)\nmemsets(dp, v, dx);\n", uchar lm, rm; long swid, dwid, mwid; int i, x, dir; + int dstw, dsth; sp = byteaddr(src, par->sr.min); - dp = byteaddr(dst, par->r.min); - mp = byteaddr(par->mask, par->mr.min); swid = src->width*sizeof(ulong); + dp = byteaddr(dst, par->r.min); dwid = dst->width*sizeof(ulong); + mp = byteaddr(par->mask, par->mr.min); mwid = par->mask->width*sizeof(ulong); +#ifdef EXT_WIN + /**/ + if(ext_win){ + dp = clutter_ext_win_get_dp(ext_win, par->r.min.x, par->r.min.y, &dwid, &dstw, &dsth); + if(!dp) + return 1; + dy = (dy > dsth ? dsth : dy); + dx = (dx > dstw ? dstw : dx); + } + /**/ +#endif if(src->data == dst->data && byteaddr(dst, par->r.min) > byteaddr(src, par->sr.min)){ dir = -1; @@ -2331,6 +2537,7 @@ chardraw(Memdrawparam *par) uchar sp[4]; Rectangle r, mr; Memimage *mask, *src, *dst; + int dstw, dsth; if(0) if(drawdebug) iprint("chardraw? mf %lux md %d sf %lux dxs %d dys %d dd %d ddat %p sdat %p\n", par->mask->flags, par->mask->depth, par->src->flags, @@ -2358,6 +2565,13 @@ if(0) if(drawdebug) iprint("chardraw? mf %lux md %d sf %lux dxs %d dys %d dd %d wp = byteaddr(dst, r.min); dstwid = dst->width*sizeof(ulong); +#ifdef EXT_WIN_ + if(dst->ext_win){ + wp = clutter_ext_win_get_dp(dst->ext_win, par->r.min.x, par->r.min.y, &dstwid, &dstw, &dsth); + if(!wp) + return 1; + } +#endif DBG print("bsh %d\n", bsh); dy = Dy(r); dx = Dx(r); diff --git a/libmemdraw/hwdraw.c b/libmemdraw/hwdraw.c index cee4823..802e2c3 100644 --- a/libmemdraw/hwdraw.c +++ b/libmemdraw/hwdraw.c @@ -2,48 +2,29 @@ #include "draw.h" #include "memdraw.h" + +#ifdef ANDROID + +#include <android/log.h> + +#define LOG_TAG "inferno HW" +#define LOGI(...) __android_log_print(ANDROID_LOG_INFO,LOG_TAG,__VA_ARGS__) +#define LOGW(...) __android_log_print(ANDROID_LOG_WARN,LOG_TAG,__VA_ARGS__) +#define LOGE(...) __android_log_print(ANDROID_LOG_ERROR,LOG_TAG,__VA_ARGS__) + +#else + +#define LOG_TAG "inferno HW" +#define LOGI(...) //__android_log_print(ANDROID_LOG_INFO,LOG_TAG,__VA_ARGS__) +#define LOGW(...) //__android_log_print(ANDROID_LOG_WARN,LOG_TAG,__VA_ARGS__) +#define LOGE(...) //__android_log_print(ANDROID_LOG_ERROR,LOG_TAG,__VA_ARGS__) + +#endif + + int hwdraw(Memdrawparam *par) { -// USED(par); - int m, y, dy, dx, op; - ulong v; - Memimage *src; - Memimage *dst; - void *ext_win; - - dx = Dx(par->r); - dy = Dy(par->r); - src = par->src; - dst = par->dst; - - ext_win = dst->ext_win; - - if(ext_win){ - uchar *sp, *dp; - long swid, dwid, nb; - int dir; - - print(">>> dst=%x, ext_win=%x, w=%d, h=%d\n", dst, ext_win, Dx(dst->r), Dy(dst->r)); -#ifdef CLUTTER - swid = src->width*sizeof(ulong); -// dwid = dst->width*sizeof(ulong); - sp = byteaddr(src, par->sr.min); -// dp = byteaddr(dst, par->r.min); -// if(dir == -1){ -// sp += (dy-1)*swid; -// dp += (dy-1)*dwid; -// swid = -swid; -// dwid = -dwid; -// } - nb = (dx*src->depth)/8; -// for(y=0; y<dy; y++, sp+=swid, dp+=dwid) -// memmove(dp, sp, nb); - - clutter_ext_win_draw(par->r.min.x, par->r.min.y, sp, nb, dy, swid); - return 1; -#endif - } return 0; /* could not satisfy request */ } diff --git a/libmemlayer/draw.c b/libmemlayer/draw.c index 413c7bc..f5b893d 100644 --- a/libmemlayer/draw.c +++ b/libmemlayer/draw.c @@ -69,8 +69,19 @@ if(drawdebug) iprint("mask->layer != nil\n"); } Top: - if(dst->layer==nil && src->layer==nil){ + if( +#ifndef EXT_WIN + dst->layer==nil && + src->layer==nil +#else + 1 +#endif + ){ +#ifndef EXT_WIN memimagedraw(dst, r, src, p0, mask, p1, op); +#else + memimagedraw(dst, r, src, p0, mask, p1, op); +#endif return; } diff --git a/libmemlayer/lalloc.c b/libmemlayer/lalloc.c index 0dee2a1..dc92054 100644 --- a/libmemlayer/lalloc.c +++ b/libmemlayer/lalloc.c @@ -3,6 +3,12 @@ #include "memdraw.h" #include "memlayer.h" + +#ifdef EXT_WIN +extern void* attach_clutter_actor(char* buffer, int min_x, int min_y, int max_x, int max_y); +#endif + + Memimage* memlalloc(Memscreen *s, Rectangle screenr, Refreshfn refreshfn, void *refreshptr, ulong val) { @@ -18,7 +24,19 @@ memlalloc(Memscreen *s, Rectangle screenr, Refreshfn refreshfn, void *refreshptr paint->clipr = Rect(-0x3FFFFFF, -0x3FFFFFF, 0x3FFFFFF, 0x3FFFFFF); } +#ifndef EXT_WIN n = allocmemimaged(screenr, s->image->chan, s->image->data); +#else + n = allocmemimage(screenr, s->image->chan); + if(n && n->data && n->data->bdata /*&& !n->ext_win*/){ + n->ext_win = attach_clutter_actor(n->data->bdata, + n->r.min.x, n->r.min.y, + n->r.max.x, n->r.max.y); + }else{ + n->ext_win = NULL; + } +print("clutter new window chan=%d\n", chantodepth(s->image->chan) ); +#endif if(n == nil) return nil; l = malloc(sizeof(Memlayer)); diff --git a/libmemlayer/ldelete.c b/libmemlayer/ldelete.c index fdf4fb6..99a473e 100644 --- a/libmemlayer/ldelete.c +++ b/libmemlayer/ldelete.c @@ -3,6 +3,18 @@ #include "memdraw.h" #include "memlayer.h" + +#ifdef EXT_WIN +#include <android/log.h> + + +#define LOG_TAG "inferno LDEL" +#define LOGI(...) __android_log_print(ANDROID_LOG_INFO,LOG_TAG,__VA_ARGS__) +#define LOGW(...) __android_log_print(ANDROID_LOG_WARN,LOG_TAG,__VA_ARGS__) +#define LOGE(...) __android_log_print(ANDROID_LOG_ERROR,LOG_TAG,__VA_ARGS__) +#endif + + void memldelete(Memimage *i) { diff --git a/libmemlayer/ltofront.c b/libmemlayer/ltofront.c index 04066ca..e5a11e9 100644 --- a/libmemlayer/ltofront.c +++ b/libmemlayer/ltofront.c @@ -72,6 +72,11 @@ memltofrontn(Memimage **ip, int n) front = nil; while(--n >= 0){ i = *ip++; +#ifdef EXT_WIN + if(i->ext_win){ + clutter_ext_win_tofront(i->ext_win); + }else +#endif _memltofront(i, front, 1); front = i; } diff --git a/libmemlayer/ltorear.c b/libmemlayer/ltorear.c index 4409761..0bb64a4 100644 --- a/libmemlayer/ltorear.c +++ b/libmemlayer/ltorear.c @@ -60,6 +60,11 @@ memltorearn(Memimage **ip, int n) rear = nil; while(--n >= 0){ i = *ip++; +#ifdef EXT_WIN + if(i->ext_win){ + clutter_ext_win_torear(i->ext_win); + }else +#endif _memltorear(i, rear); rear = i; } diff --git a/limbo/asm.o b/limbo/asm.o Binary files differdeleted file mode 100644 index 9bfdd42..0000000 --- a/limbo/asm.o +++ /dev/null diff --git a/limbo/com.o b/limbo/com.o Binary files differdeleted file mode 100644 index 5ddb0be..0000000 --- a/limbo/com.o +++ /dev/null diff --git a/limbo/decls.o b/limbo/decls.o Binary files differdeleted file mode 100644 index 2d83d71..0000000 --- a/limbo/decls.o +++ /dev/null diff --git a/limbo/dis.o b/limbo/dis.o Binary files differdeleted file mode 100644 index b0971c2..0000000 --- a/limbo/dis.o +++ /dev/null diff --git a/limbo/dtocanon.o b/limbo/dtocanon.o Binary files differdeleted file mode 100644 index 2911383..0000000 --- a/limbo/dtocanon.o +++ /dev/null diff --git a/limbo/ecom.o b/limbo/ecom.o Binary files differdeleted file mode 100644 index 7eb06b7..0000000 --- a/limbo/ecom.o +++ /dev/null diff --git a/limbo/gen.o b/limbo/gen.o Binary files differdeleted file mode 100644 index 3688ec9..0000000 --- a/limbo/gen.o +++ /dev/null diff --git a/limbo/lex.o b/limbo/lex.o Binary files differdeleted file mode 100644 index f7dc984..0000000 --- a/limbo/lex.o +++ /dev/null diff --git a/limbo/nodes.o b/limbo/nodes.o Binary files differdeleted file mode 100644 index 064582a..0000000 --- a/limbo/nodes.o +++ /dev/null diff --git a/limbo/optab.o b/limbo/optab.o Binary files differdeleted file mode 100644 index bd67633..0000000 --- a/limbo/optab.o +++ /dev/null diff --git a/limbo/optim.o b/limbo/optim.o Binary files differdeleted file mode 100644 index 580ead3..0000000 --- a/limbo/optim.o +++ /dev/null diff --git a/limbo/sbl.o b/limbo/sbl.o Binary files differdeleted file mode 100644 index 2d9627e..0000000 --- a/limbo/sbl.o +++ /dev/null diff --git a/limbo/stubs.o b/limbo/stubs.o Binary files differdeleted file mode 100644 index 3fb53ff..0000000 --- a/limbo/stubs.o +++ /dev/null diff --git a/limbo/typecheck.o b/limbo/typecheck.o Binary files differdeleted file mode 100644 index 76d6027..0000000 --- a/limbo/typecheck.o +++ /dev/null diff --git a/limbo/types.o b/limbo/types.o Binary files differdeleted file mode 100644 index 05071fc..0000000 --- a/limbo/types.o +++ /dev/null diff --git a/limbo/y.tab.o b/limbo/y.tab.o Binary files differdeleted file mode 100644 index 1bfcd54..0000000 --- a/limbo/y.tab.o +++ /dev/null @@ -11,7 +11,7 @@ ROOT=$ROOT # TKSTYLE=std -WINDOW_BACKEND=andr # andr, clutter +WINDOW_BACKEND=clutter # andr, clutter # # Except for building kernels, SYSTARG must always be the same as SYSHOST diff --git a/mkfiles/mkfile-Android-arm b/mkfiles/mkfile-Android-arm index 23ab3de..fe2def1 100644 --- a/mkfiles/mkfile-Android-arm +++ b/mkfiles/mkfile-Android-arm @@ -23,6 +23,7 @@ CFLAGS= -O\ -I$ROOT/Android/arm/include\ -I$ROOT/include\ -DLINUX_ARM\ + -DEXT_WIN\ -D__arm__\ -D__ANDROID_API__=17 -DANDROID\ -ffunction-sections -funwind-tables \ diff --git a/tools/libstyx/Posix.o b/tools/libstyx/Posix.o Binary files differdeleted file mode 100644 index 6f5963c..0000000 --- a/tools/libstyx/Posix.o +++ /dev/null diff --git a/tools/libstyx/styxserver.o b/tools/libstyx/styxserver.o Binary files differdeleted file mode 100644 index a19b92a..0000000 --- a/tools/libstyx/styxserver.o +++ /dev/null diff --git a/tools/styxtest/o.out b/tools/styxtest/o.out Binary files differdeleted file mode 100644 index 84094a9..0000000 --- a/tools/styxtest/o.out +++ /dev/null diff --git a/tools/styxtest/styxtest.o b/tools/styxtest/styxtest.o Binary files differdeleted file mode 100644 index 20507aa..0000000 --- a/tools/styxtest/styxtest.o +++ /dev/null diff --git a/utils/iyacc/o.out b/utils/iyacc/o.out Binary files differdeleted file mode 100644 index 0c1f865..0000000 --- a/utils/iyacc/o.out +++ /dev/null diff --git a/utils/iyacc/yacc.o b/utils/iyacc/yacc.o Binary files differdeleted file mode 100644 index de36290..0000000 --- a/utils/iyacc/yacc.o +++ /dev/null |
