Merge branch 'master' of git://git.netsurf-browser.org/netsurf into chris/fix-palmap-crash

Conflicts:
	amiga/bitmap.c
This commit is contained in:
Chris Young 2016-01-25 18:25:26 +00:00
commit 09ac17955b
15 changed files with 76 additions and 71 deletions

View File

@ -558,7 +558,11 @@ struct BitMap *ami_bitmap_get_native(struct bitmap *bitmap,
static nserror bitmap_render(struct bitmap *bitmap, hlcache_handle *content)
{
<<<<<<< HEAD
// if(ami_plot_screen_is_palettemapped() == true) return NSERROR_OK;
=======
if(ami_plot_screen_is_palettemapped() == true) return NSERROR_OK;
>>>>>>> 6847fad65368bab3418eb716af4f9d485dfe30b1
struct redraw_context ctx = {
.interactive = false,

View File

@ -809,7 +809,7 @@ static void ami_openscreen(void)
static void ami_openscreenfirst(void)
{
ami_openscreen();
if(!browserglob.bm) ami_init_layers(&browserglob, 0, 0);
if(!browserglob.bm) ami_init_layers(&browserglob, 0, 0, false);
ami_theme_throbber_setup();
}
@ -2859,7 +2859,7 @@ void ami_switch_tab(struct gui_window_2 *gwin, bool redraw)
return;
}
ami_plot_release_pens(&gwin->shared_pens);
ami_plot_release_pens(gwin->shared_pens);
ami_update_buttons(gwin);
ami_menu_update_disabled(gwin->gw, browser_window_get_content(gwin->gw->bw));
@ -3495,7 +3495,7 @@ static void ami_do_redraw_tiled(struct gui_window_2 *gwin, bool busy,
int tile_x_scale = (int)(tile_size_x / gwin->gw->scale);
int tile_y_scale = (int)(tile_size_y / gwin->gw->scale);
browserglob.shared_pens = &gwin->shared_pens; /* do we need this?? */
browserglob.shared_pens = gwin->shared_pens; /* do we need this?? */
if(top < 0) {
height += top;
@ -3869,7 +3869,7 @@ gui_window_create(struct browser_window *bw,
return NULL;
}
ami_NewMinList(&g->shared->shared_pens);
g->shared->shared_pens = ami_AllocMinList();
g->shared->scrollerhook.h_Entry = (void *)ami_scroller_hook;
g->shared->scrollerhook.h_Data = g->shared;
@ -4492,7 +4492,8 @@ static void gui_window_destroy(struct gui_window *g)
return;
}
ami_plot_release_pens(&g->shared->shared_pens);
ami_plot_release_pens(g->shared->shared_pens);
FreeVec(g->shared->shared_pens);
ami_schedule_redraw_remove(g->shared);
ami_schedule(-1, ami_gui_refresh_favicon, g->shared);
@ -4831,7 +4832,7 @@ static void ami_do_redraw(struct gui_window_2 *gwin)
}
else
{
browserglob.shared_pens = &gwin->shared_pens;
browserglob.shared_pens = gwin->shared_pens;
temprp = browserglob.rp;
browserglob.rp = gwin->win->RPort;
clip.x0 = bbox->Left;
@ -5202,7 +5203,7 @@ static void gui_window_new_content(struct gui_window *g)
g->shared->oldh = 0;
g->shared->oldv = 0;
g->favicon = NULL;
ami_plot_release_pens(&g->shared->shared_pens);
ami_plot_release_pens(g->shared->shared_pens);
ami_menu_update_disabled(g, c);
ami_gui_update_hotlist_button(g->shared);
ami_gui_scroller_update(g->shared);

View File

@ -138,7 +138,7 @@ struct gui_window_2 {
gui_drag_type drag_op;
struct IBox *ptr_lock;
struct AppWindow *appwin;
struct MinList shared_pens;
struct MinList *shared_pens;
gui_pointer_shape mouse_pointer;
struct Menu *imenu; /* Intuition menu */
struct VisualInfo *vi; /* For GadTools menu */

View File

@ -117,7 +117,7 @@ void ami_history_open(struct gui_window *gw)
{
gw->hw = ami_misc_allocvec_clear(sizeof(struct history_window), 0);
ami_init_layers(&gw->hw->gg, scrn->Width, scrn->Height);
ami_init_layers(&gw->hw->gg, scrn->Width, scrn->Height, false);
gw->hw->gw = gw;
browser_window_history_size(gw->bw, &width, &height);

View File

@ -70,7 +70,6 @@ struct bez_point {
float y;
};
static bool palette_mapped = false;
static int init_layers_count = 0;
static APTR pool_pens = NULL;
@ -90,7 +89,7 @@ static APTR pool_pens = NULL;
/* Define the below to get additional debug */
#undef AMI_PLOTTER_DEBUG
void ami_init_layers(struct gui_globals *gg, ULONG width, ULONG height)
void ami_init_layers(struct gui_globals *gg, ULONG width, ULONG height, bool force32bit)
{
/* init shared bitmaps *
* Height is set to screen width to give enough space for thumbnails *
@ -99,22 +98,23 @@ void ami_init_layers(struct gui_globals *gg, ULONG width, ULONG height)
int depth = 32;
struct BitMap *friend = NULL;
depth = GetBitMapAttr(scrn->RastPort.BitMap, BMA_DEPTH);
if(force32bit == false) depth = GetBitMapAttr(scrn->RastPort.BitMap, BMA_DEPTH);
LOG("Screen depth = %d", depth);
if(depth < 16) {
palette_mapped = true;
gg->palette_mapped = true;
} else {
palette_mapped = false;
gg->palette_mapped = false;
}
#ifndef __amigaos4__
#warning OS3 locked to palette-mapped modes
palette_mapped = true;
gg->palette_mapped = true;
if(depth > 8) depth = 8;
#endif
if(palette_mapped == true) nsoption_set_bool(font_antialiasing, false);
/* Probably need to fix this next line */
if(gg->palette_mapped == true) nsoption_set_bool(font_antialiasing, false);
if(!width) width = nsoption_int(redraw_tile_size_x);
if(!height) height = nsoption_int(redraw_tile_size_y);
@ -146,7 +146,7 @@ void ami_init_layers(struct gui_globals *gg, ULONG width, ULONG height)
}
#endif
if(palette_mapped == true) {
if(gg->palette_mapped == true) {
gg->bm = AllocBitMap(width, height, depth, 0, friend);
} else {
#ifdef __amigaos4__
@ -184,7 +184,7 @@ void ami_init_layers(struct gui_globals *gg, ULONG width, ULONG height)
InitTmpRas(gg->rp->TmpRas, gg->tmprasbuf, width*height);
if((palette_mapped == true) && (pool_pens == NULL)) {
if((gg->palette_mapped == true) && (pool_pens == NULL)) {
pool_pens = ami_misc_itempool_create(sizeof(struct ami_plot_pen));
}
@ -210,7 +210,7 @@ void ami_free_layers(struct gui_globals *gg)
FreeVec(gg->tmprasbuf);
FreeVec(gg->areabuf);
DisposeLayerInfo(gg->layerinfo);
if(palette_mapped == false) {
if(gg->palette_mapped == false) {
if(gg->bm) ami_rtg_freebitmap(gg->bm);
} else {
if(gg->bm) FreeBitMap(gg->bm);
@ -273,7 +273,7 @@ void ami_plot_release_pens(struct MinList *shared_pens)
static void ami_plot_setapen(struct RastPort *rp, ULONG colr)
{
#ifdef __amigaos4__
if(palette_mapped == false) {
if(glob->palette_mapped == false) {
SetRPAttrs(rp, RPTAG_APenColor,
ns_color_to_nscss(colr),
TAG_DONE);
@ -288,7 +288,7 @@ static void ami_plot_setapen(struct RastPort *rp, ULONG colr)
static void ami_plot_setopen(struct RastPort *rp, ULONG colr)
{
#ifdef __amigaos4__
if(palette_mapped == false) {
if(glob->palette_mapped == false) {
SetRPAttrs(rp, RPTAG_OPenColor,
ns_color_to_nscss(colr),
TAG_DONE);
@ -537,7 +537,7 @@ static bool ami_bitmap(int x, int y, int width, int height, struct bitmap *bitma
#endif
#ifdef __amigaos4__
if(__builtin_expect((GfxBase->LibNode.lib_Version >= 53) && (palette_mapped == false) &&
if(__builtin_expect((GfxBase->LibNode.lib_Version >= 53) && (glob->palette_mapped == false) &&
(nsoption_bool(direct_render) == false), 1)) {
uint32 comptype = COMPOSITE_Src_Over_Dest;
uint32 compflags = COMPFLAG_IgnoreDestAlpha;
@ -564,7 +564,7 @@ static bool ami_bitmap(int x, int y, int width, int height, struct bitmap *bitma
{
ULONG tag, tag_data, minterm = 0xc0;
if(palette_mapped == false) {
if(glob->palette_mapped == false) {
tag = BLITA_UseSrcAlpha;
tag_data = !bitmap->opaque;
minterm = 0xc0;
@ -715,7 +715,7 @@ HOOKF(void, ami_bitmap_tile_hook, struct RastPort *, rp, struct BackFillMessage
for (yf = -bfbm->offsety; yf < msg->Bounds.MaxY; yf += bfbm->height) {
#ifdef __amigaos4__
if(__builtin_expect((GfxBase->LibNode.lib_Version >= 53) &&
(palette_mapped == false), 1)) {
(glob->palette_mapped == false), 1)) {
CompositeTags(COMPOSITE_Src_Over_Dest, bfbm->bm, rp->BitMap,
COMPTAG_Flags, COMPFLAG_IgnoreDestAlpha,
COMPTAG_DestX, msg->Bounds.MinX,
@ -734,7 +734,7 @@ HOOKF(void, ami_bitmap_tile_hook, struct RastPort *, rp, struct BackFillMessage
{
ULONG tag, tag_data, minterm = 0xc0;
if(palette_mapped == false) {
if(glob->palette_mapped == false) {
tag = BLITA_UseSrcAlpha;
tag_data = TRUE;
minterm = 0xc0;
@ -876,7 +876,7 @@ static bool ami_path(const float *p, unsigned int n, colour fill, float width,
bool ami_plot_screen_is_palettemapped(void)
{
return palette_mapped;
return glob->palette_mapped;
}
struct plotter_table plot;

View File

@ -33,13 +33,14 @@ struct gui_globals
APTR tmprasbuf;
struct Rectangle rect;
struct MinList *shared_pens;
bool palette_mapped;
int width; /* size of bm and */
int height; /* associated memory */
};
extern const struct plotter_table amiplot;
void ami_init_layers(struct gui_globals *gg, ULONG width, ULONG height);
void ami_init_layers(struct gui_globals *gg, ULONG width, ULONG height, bool force32bit);
void ami_free_layers(struct gui_globals *gg);
void ami_clearclipreg(struct gui_globals *gg);
void ami_plot_clear_bbox(struct RastPort *rp, struct IBox *bbox);

View File

@ -481,7 +481,8 @@ bool ami_print_begin(struct print_settings *ps)
ami_init_layers(ami_print_info.gg,
ami_print_info.PED->ped_MaxXDots,
ami_print_info.PED->ped_MaxYDots);
ami_print_info.PED->ped_MaxYDots,
true);
ami_print_info.page = 0;

View File

@ -734,7 +734,7 @@ void ami_tree_open(struct treeview_window *twin,int type)
twin->scrollerhook.h_Entry = (void *)ami_tree_scroller_hook;
twin->scrollerhook.h_Data = twin;
ami_init_layers(&twin->globals, 0, 0);
ami_init_layers(&twin->globals, 0, 0, false);
ami_tree_menu(twin);
if(type == AMI_TREE_SSLCERT)

View File

@ -72,13 +72,13 @@ static struct atari_treeview_callbacks atari_hotlist_treeview_callbacks = {
static nserror atari_hotlist_init_phase2(struct core_window *cw,
struct core_window_callback_table *cb_t)
{
LOG("");
LOG("cw:%p", cw);
return(hotlist_init(cb_t, cw, hl.path));
}
static void atari_hotlist_finish(struct core_window *cw)
{
LOG("");
LOG("cw:%p", cw);
hotlist_fini(hl.path);
}
@ -123,7 +123,7 @@ static short handle_event(GUIWIN *win, EVMULT_OUT *ev_out, short msg[8])
GRECT tb_area;
GUIWIN * gemtk_win;
LOG("");
LOG("gw:%p", win);
tv = (struct atari_treeview_window*) gemtk_wm_get_user_data(win);
cw = (struct core_window *)tv;

View File

@ -35,7 +35,7 @@ method Document::write()
}
duk_concat(ctx, duk_get_top(ctx));
text = duk_safe_to_lstring(ctx, 0, &text_len);
LOG("Writing %*s", (int)text_len, text);
JS_LOG("Writing %*s", (int)text_len, text);
err = dom_node_get_user_data(priv->parent.node,
corestring_dom___ns_key_html_content_data,
@ -69,7 +69,7 @@ method Document::writeln()
duk_concat(ctx, duk_get_top(ctx));
text = duk_safe_to_lstring(ctx, 0, &text_len);
LOG("Writeln %*s", (int)text_len, text);
JS_LOG("Writeln %*s", (int)text_len, text);
err = dom_node_get_user_data(priv->parent.node,
corestring_dom___ns_key_html_content_data,
&htmlc);

View File

@ -52,7 +52,7 @@ prototype Window()
getter Window::document()
%{
LOG("priv=%p", priv);
JS_LOG("priv=%p", priv);
dom_document *doc = priv->htmlc->document;
dukky_push_node(ctx, (struct dom_node *)doc);
return 1;

View File

@ -236,7 +236,7 @@ dukky_push_node_klass(duk_context *ctx, struct dom_node *node)
duk_bool_t
dukky_push_node(duk_context *ctx, struct dom_node *node)
{
LOG("Pushing node %p", node);
JS_LOG("Pushing node %p", node);
/* First check if we can find the node */
/* ... */
duk_get_global_string(ctx, NODE_MAGIC);
@ -251,7 +251,7 @@ dukky_push_node(duk_context *ctx, struct dom_node *node)
/* ... node nodes */
duk_pop(ctx);
/* ... node */
LOG("Found it memoised");
JS_LOG("Found it memoised");
return true;
}
/* ... nodes undefined */

View File

@ -24,6 +24,12 @@
#ifndef DUKKY_H
#define DUKKY_H
#ifdef JS_DEBUG
# define JS_LOG(format, args...) LOG(format , ##args)
#else
# define JS_LOG(format, ...) ((void) 0)
#endif
duk_ret_t dukky_create_object(duk_context *ctx, const char *name, int args);
duk_bool_t dukky_push_node_stacked(duk_context *ctx);
duk_bool_t dukky_push_node(duk_context *ctx, struct dom_node *node);

View File

@ -4926,12 +4926,12 @@ DUK_INTERNAL_DECL duk_uint8_t *duk_bw_insert_ensure_area(duk_hthread *thr, duk_b
DUK_INTERNAL_DECL void duk_bw_remove_raw_slice(duk_hthread *thr, duk_bufwriter_ctx *bw, duk_size_t off, duk_size_t len);
/* No duk_bw_remove_ensure_slice(), functionality would be identical. */
DUK_INTERNAL_DECL duk_uint16_t duk_raw_read_u16_be(duk_uint8_t **p);
DUK_INTERNAL_DECL duk_uint32_t duk_raw_read_u32_be(duk_uint8_t **p);
DUK_INTERNAL_DECL duk_double_t duk_raw_read_double_be(duk_uint8_t **p);
DUK_INTERNAL_DECL void duk_raw_write_u16_be(duk_uint8_t **p, duk_uint16_t val);
DUK_INTERNAL_DECL void duk_raw_write_u32_be(duk_uint8_t **p, duk_uint32_t val);
DUK_INTERNAL_DECL void duk_raw_write_double_be(duk_uint8_t **p, duk_double_t val);
DUK_INTERNAL_DECL DUK_INLINE duk_uint16_t duk_raw_read_u16_be(duk_uint8_t **p);
DUK_INTERNAL_DECL DUK_INLINE duk_uint32_t duk_raw_read_u32_be(duk_uint8_t **p);
DUK_INTERNAL_DECL DUK_INLINE duk_double_t duk_raw_read_double_be(duk_uint8_t **p);
DUK_INTERNAL_DECL DUK_INLINE void duk_raw_write_u16_be(duk_uint8_t **p, duk_uint16_t val);
DUK_INTERNAL_DECL DUK_INLINE void duk_raw_write_u32_be(duk_uint8_t **p, duk_uint32_t val);
DUK_INTERNAL_DECL DUK_INLINE void duk_raw_write_double_be(duk_uint8_t **p, duk_double_t val);
#if defined(DUK_USE_DEBUGGER_SUPPORT) /* For now only needed by the debugger. */
DUK_INTERNAL void duk_byteswap_bytes(duk_uint8_t *p, duk_small_uint_t len);

View File

@ -30,7 +30,6 @@
# TARGET is set to the frontend target to build
# HOST is set to the identifier of the toolchain doing the building
# CC is the compiler (gcc or clang)
# BUILD_JS is the javascript type (json or jsoff)
# BUILD_NUMBER is the CI build number
#####
@ -346,7 +345,6 @@ if [ "${CC}" = "clang" ];then
fi
# convert javascript parameters
if [ "${BUILD_JS}" = "json" ];then
case ${HOST} in
"arm-unknown-riscos")
BUILD_MOZJS=NO
@ -371,12 +369,6 @@ if [ "${BUILD_JS}" = "json" ];then
esac
else
BUILD_JS=NO
BUILD_MOZJS=NO
BUILD_DUKTAPE=NO
fi
########### Use distcc if present ######
DISTCC=distcc