Gitweb links:

...log 
http://git.netsurf-browser.org/netsurf.git/shortlog/bb2341898113f37936832c8828bd515c3e3860c9
...commit 
http://git.netsurf-browser.org/netsurf.git/commit/bb2341898113f37936832c8828bd515c3e3860c9
...tree 
http://git.netsurf-browser.org/netsurf.git/tree/bb2341898113f37936832c8828bd515c3e3860c9

The branch, master has been updated
       via  bb2341898113f37936832c8828bd515c3e3860c9 (commit)
       via  86a0f14d0aa13c7808b57bbb6092ac6805babf02 (commit)
       via  8af9a8407bc9f65fc34eecfe0fbd4beb6dacdfac (commit)
       via  36b26b861f375de5b2be3ff9de37288049f05a26 (commit)
       via  43bbdc520dd054acdf46088fbbee5d4a3b638d24 (commit)
       via  b7551fec72372df4cb40384818da5419904e4c98 (commit)
       via  570212add2ec6b70474eb49b74259d7c73733c03 (commit)
       via  adac4d98bb9acdeb76725c946e53ff0e2c0235df (commit)
       via  982a59744f634aee73dc11d4a30c93b4652a1e7e (commit)
       via  205abcf18950bf3ee8600c4a4e4945b096985f9e (commit)
       via  937dce4f2eef86c563bb93ded5c355c1446bf88c (commit)
       via  493036a920aba5cf470637b7aa2ca69f7f57b41c (commit)
       via  a83afda7918cdb7ebc28db204ceb3e0f3d1cb0d3 (commit)
       via  0804c43bf1afa0cb9d851ceb89e29ec8096f272f (commit)
      from  5382ad2aa69b6ef8e479c5714052086eba8133b5 (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 -----------------------------------------------------------------
commitdiff 
http://git.netsurf-browser.org/netsurf.git/commit/?id=bb2341898113f37936832c8828bd515c3e3860c9
commit bb2341898113f37936832c8828bd515c3e3860c9
Merge: 5382ad2 86a0f14
Author: Chris Young <[email protected]>
Commit: Chris Young <[email protected]>

    Merge branch 'chris/extmem'
    This enables AmigaOS4.1FEU1 to use Extended Memory for the storage of 
uncompressed bitmaps.



commitdiff 
http://git.netsurf-browser.org/netsurf.git/commit/?id=86a0f14d0aa13c7808b57bbb6092ac6805babf02
commit 86a0f14d0aa13c7808b57bbb6092ac6805babf02
Author: Chris Young <[email protected]>
Commit: Chris Young <[email protected]>

    Make the documentation reflect reality.
    ExtMem is enabled by default for now to give it a good workout.  Disabled 
may be a more sensible default.

diff --git a/frontends/amiga/dist/NetSurf.guide 
b/frontends/amiga/dist/NetSurf.guide
index 8fc6cc3..754cdbe 100755
--- a/frontends/amiga/dist/NetSurf.guide
+++ b/frontends/amiga/dist/NetSurf.guide
@@ -145,7 +145,7 @@ There are a couple of Amiga-specific options which can only 
be changed directly
 @{b}web_search_width@{ub} Defaults to 0.  Larger values will increase the size 
of the web search gadget next to the URL bar.
 @{b}mask_alpha@{ub} Threshold to use when determining which alpha values to 
convert to full transparency (0 - 255, where 255 will convert even opaque 
pixels to transparent).  Defaults to 0.  This is only used in palette-mapped 
modes where alpha blending is not currently supported.
 @{b}tab_new_session{ub} If NetSurf is already running, this will cause any 
passed URLs to open in a new tab rather than a new window.
-@{b}use_extmem@{ub} Defaults to 0 (disabled).  Setting to 1 will make NetSurf 
use Extended Memory to store uncompressed images.  OS4 only; does not work on 
Pegasus 2.
+@{b}use_extmem@{ub} Defaults to 1 (enabled).  Setting to 0 will prevent 
NetSurf using Extended Memory to store uncompressed images - this may have a 
performance benefit and no disadvantage for <2GB configurations.  OS4.1FEU1 
only.
 @{b}url_file@{ub} Path to URL database file
 @{b}hotlist_file@{ub} Path to Hotlist file
 @{b}arexx_dir@{ub} Path to ARexx scripts dir


commitdiff 
http://git.netsurf-browser.org/netsurf.git/commit/?id=8af9a8407bc9f65fc34eecfe0fbd4beb6dacdfac
commit 8af9a8407bc9f65fc34eecfe0fbd4beb6dacdfac
Author: Chris Young <[email protected]>
Commit: Chris Young <[email protected]>

    Don't unmap ExtMem immediately as:
    (a) it is upsetting the gif decoder (although I suspect it is caused by the 
OS struggling with the excessive remaps)
    (b) We are probably going to need to map it back in imminently for display

diff --git a/frontends/amiga/bitmap.c b/frontends/amiga/bitmap.c
index fe84a94..5b5d6bb 100644
--- a/frontends/amiga/bitmap.c
+++ b/frontends/amiga/bitmap.c
@@ -277,7 +277,8 @@ void amiga_bitmap_modified(void *bitmap)
        struct bitmap *bm = bitmap;
 
 #ifdef __amigaos4__
-       amiga_bitmap_unmap_buffer(bm);
+               /* unmap the buffer after 0.5s - we might need it imminently */
+               ami_schedule(500, amiga_bitmap_unmap_buffer, bm);
 #endif
 
        if(bm->nativebm) ami_rtg_freebitmap(bm->nativebm);
diff --git a/frontends/amiga/gui.c b/frontends/amiga/gui.c
index a51d8c2..ba0a786 100644
--- a/frontends/amiga/gui.c
+++ b/frontends/amiga/gui.c
@@ -1,5 +1,5 @@
 /*
- * Copyright 2008-2015 Chris Young <[email protected]>
+ * Copyright 2008-2016 Chris Young <[email protected]>
  *
  * This file is part of NetSurf, http://www.netsurf-browser.org/
  *
@@ -616,6 +616,11 @@ static nserror ami_set_options(struct nsoption_s *defaults)
 
        /* Some OS-specific overrides */
 #ifdef __amigaos4__
+       if(!LIB_IS_AT_LEAST((struct Library *)SysBase, 53, 89)) {
+               /* Disable ExtMem usage pre-OS4.1FEU1 */
+               nsoption_set_bool(use_extmem, false);
+       }
+
        if(codeset == 0) codeset = 4; /* ISO-8859-1 */
        const char *encname = (const char *)ObtainCharsetInfo(DFCS_NUMBER, 
codeset,
                                                        DFCS_MIMENAME);


-----------------------------------------------------------------------

Summary of changes:
 frontends/amiga/bitmap.c           |   76 +++++++++++++++++++++++++++++++++---
 frontends/amiga/dist/NetSurf.guide |    2 +-
 frontends/amiga/gui.c              |    7 +++-
 frontends/amiga/options.h          |    5 ++-
 4 files changed, 81 insertions(+), 9 deletions(-)

diff --git a/frontends/amiga/bitmap.c b/frontends/amiga/bitmap.c
index c6e23b2..5b5d6bb 100644
--- a/frontends/amiga/bitmap.c
+++ b/frontends/amiga/bitmap.c
@@ -40,6 +40,7 @@
 #endif
 
 #ifdef __amigaos4__
+#include <exec/extmem.h>
 #include <sys/param.h>
 #endif
 #include "assert.h"
@@ -57,6 +58,7 @@
 #include "amiga/memory.h"
 #include "amiga/misc.h"
 #include "amiga/rtg.h"
+#include "amiga/schedule.h"
 
 // disable use of "triangle mode" for scaling
 #ifdef AMI_NS_TRIANGLE_SCALING
@@ -67,6 +69,8 @@ struct bitmap {
        int width;
        int height;
        UBYTE *pixdata;
+       struct ExtMemIFace *iextmem;
+       uint32 size;
        bool opaque;
        int native;
        struct BitMap *nativebm;
@@ -113,7 +117,25 @@ void *amiga_bitmap_create(int width, int height, unsigned 
int state)
        bitmap = ami_memory_itempool_alloc(pool_bitmap, sizeof(struct bitmap));
        if(bitmap == NULL) return NULL;
 
-       bitmap->pixdata = ami_memory_clear_alloc(width*height*4, 0xff);
+       bitmap->size = width * height * 4;
+
+#ifdef __amigaos4__
+       if(nsoption_bool(use_extmem) == true) {
+               uint64 size64 = bitmap->size;
+               bitmap->iextmem = AllocSysObjectTags(ASOT_EXTMEM,
+                                                               ASOEXTMEM_Size, 
&size64,
+                                                               
ASOEXTMEM_AllocationPolicy, EXTMEMPOLICY_IMMEDIATE,
+                                                               TAG_END);
+
+               bitmap->pixdata = NULL;
+               UBYTE *pixdata = amiga_bitmap_get_buffer(bitmap);
+               memset(pixdata, 0xff, bitmap->size);
+       } else
+#endif
+       {
+               bitmap->pixdata = ami_memory_clear_alloc(bitmap->size, 0xff);
+       }
+
        bitmap->width = width;
        bitmap->height = height;
 
@@ -133,11 +155,36 @@ void *amiga_bitmap_create(int width, int height, unsigned 
int state)
        return bitmap;
 }
 
+static void amiga_bitmap_unmap_buffer(void *p)
+{
+#ifdef __amigaos4__
+       struct bitmap *bm = p;
+
+       if((nsoption_bool(use_extmem) == true) && (bm->pixdata != NULL)) {
+               LOG("Unmapping ExtMem object %p for bitmap %p", bm->iextmem, 
bm);
+               bm->iextmem->Unmap(bm->pixdata, bm->size);
+               bm->pixdata = NULL;
+       }
+#endif
+}
 
 /* exported function documented in amiga/bitmap.h */
 unsigned char *amiga_bitmap_get_buffer(void *bitmap)
 {
        struct bitmap *bm = bitmap;
+
+#ifdef __amigaos4__
+       if(nsoption_bool(use_extmem) == true) {
+               if(bm->pixdata == NULL) {
+                       LOG("Mapping ExtMem object %p for bitmap %p", 
bm->iextmem, bm);
+                       bm->pixdata = bm->iextmem->Map(NULL, bm->size, 0LL, 0);
+               }
+
+               /* unmap the buffer after one second */
+               ami_schedule(1000, amiga_bitmap_unmap_buffer, bm);
+       }
+#endif
+
        return bm->pixdata;
 }
 
@@ -169,8 +216,19 @@ void amiga_bitmap_destroy(void *bitmap)
                }
 
                if(bm->native_mask) FreeRaster(bm->native_mask, bm->width, 
bm->height);
-               if(bm->drawhandle) ReleaseDrawHandle(bm->drawhandle);
-               ami_memory_clear_free(bm->pixdata);
+
+#ifdef __amigaos4__
+               if(nsoption_bool(use_extmem) == true) {
+                       ami_schedule(-1, amiga_bitmap_unmap_buffer, bm);
+                       amiga_bitmap_unmap_buffer(bm);
+                       FreeSysObject(ASOT_EXTMEM, bm->iextmem);
+                       bm->iextmem = NULL;
+               } else
+#endif
+               {
+                       if(bm->drawhandle) ReleaseDrawHandle(bm->drawhandle);
+                       ami_memory_clear_free(bm->pixdata);
+               }
 
                if(bm->url) nsurl_unref(bm->url);
                if(bm->title) free(bm->title);
@@ -218,9 +276,12 @@ void amiga_bitmap_modified(void *bitmap)
 {
        struct bitmap *bm = bitmap;
 
-       if((bm->nativebm)) // && (bm->native == AMI_NSBM_TRUECOLOUR))
-               ami_rtg_freebitmap(bm->nativebm);
-               
+#ifdef __amigaos4__
+               /* unmap the buffer after 0.5s - we might need it imminently */
+               ami_schedule(500, amiga_bitmap_unmap_buffer, bm);
+#endif
+
+       if(bm->nativebm) ami_rtg_freebitmap(bm->nativebm);
        if(bm->drawhandle) ReleaseDrawHandle(bm->drawhandle);
        if(bm->native_mask) FreeRaster(bm->native_mask, bm->width, bm->height);
        bm->nativebm = NULL;
@@ -645,6 +706,7 @@ struct BitMap *ami_bitmap_get_native(struct bitmap *bitmap,
                                int width, int height, struct BitMap *friendbm)
 {
        if(bitmap == NULL) return NULL;
+       LOG("Getting native BitMap for %p", bitmap);
 
        if(__builtin_expect(ami_plot_screen_is_palettemapped() == true, 0)) {
                return ami_bitmap_get_palettemapped(bitmap, width, height, 
friendbm);
@@ -662,6 +724,8 @@ void ami_bitmap_fini(void)
 static nserror bitmap_render(struct bitmap *bitmap, struct hlcache_handle 
*content)
 {
 #ifdef __amigaos4__
+       LOG("Entering bitmap_render");
+
        struct redraw_context ctx = {
                .interactive = false,
                .background_images = true,
diff --git a/frontends/amiga/dist/NetSurf.guide 
b/frontends/amiga/dist/NetSurf.guide
index dd2f46d..754cdbe 100755
--- a/frontends/amiga/dist/NetSurf.guide
+++ b/frontends/amiga/dist/NetSurf.guide
@@ -145,7 +145,7 @@ There are a couple of Amiga-specific options which can only 
be changed directly
 @{b}web_search_width@{ub} Defaults to 0.  Larger values will increase the size 
of the web search gadget next to the URL bar.
 @{b}mask_alpha@{ub} Threshold to use when determining which alpha values to 
convert to full transparency (0 - 255, where 255 will convert even opaque 
pixels to transparent).  Defaults to 0.  This is only used in palette-mapped 
modes where alpha blending is not currently supported.
 @{b}tab_new_session{ub} If NetSurf is already running, this will cause any 
passed URLs to open in a new tab rather than a new window.
-
+@{b}use_extmem@{ub} Defaults to 1 (enabled).  Setting to 0 will prevent 
NetSurf using Extended Memory to store uncompressed images - this may have a 
performance benefit and no disadvantage for <2GB configurations.  OS4.1FEU1 
only.
 @{b}url_file@{ub} Path to URL database file
 @{b}hotlist_file@{ub} Path to Hotlist file
 @{b}arexx_dir@{ub} Path to ARexx scripts dir
diff --git a/frontends/amiga/gui.c b/frontends/amiga/gui.c
index a51d8c2..ba0a786 100644
--- a/frontends/amiga/gui.c
+++ b/frontends/amiga/gui.c
@@ -1,5 +1,5 @@
 /*
- * Copyright 2008-2015 Chris Young <[email protected]>
+ * Copyright 2008-2016 Chris Young <[email protected]>
  *
  * This file is part of NetSurf, http://www.netsurf-browser.org/
  *
@@ -616,6 +616,11 @@ static nserror ami_set_options(struct nsoption_s *defaults)
 
        /* Some OS-specific overrides */
 #ifdef __amigaos4__
+       if(!LIB_IS_AT_LEAST((struct Library *)SysBase, 53, 89)) {
+               /* Disable ExtMem usage pre-OS4.1FEU1 */
+               nsoption_set_bool(use_extmem, false);
+       }
+
        if(codeset == 0) codeset = 4; /* ISO-8859-1 */
        const char *encname = (const char *)ObtainCharsetInfo(DFCS_NUMBER, 
codeset,
                                                        DFCS_MIMENAME);
diff --git a/frontends/amiga/options.h b/frontends/amiga/options.h
index 3aa8451..b5b2b3b 100644
--- a/frontends/amiga/options.h
+++ b/frontends/amiga/options.h
@@ -89,8 +89,11 @@ NSOPTION_INTEGER(monitor_aspect_x, 0)
 NSOPTION_INTEGER(monitor_aspect_y, 0)
 NSOPTION_BOOL(accept_lang_locale, true)
 NSOPTION_STRING(local_charset, "ISO-8859-1")
+#ifdef __amigaos4__
+/* Options relevant for OS4 only */
+NSOPTION_BOOL(use_extmem, true)
+#else
 /* Options relevant for OS3 only */
-#ifndef __amigaos4__
 NSOPTION_BOOL(friend_bitmap, false)
 #endif
 


-- 
NetSurf Browser

_______________________________________________
netsurf-commits mailing list
[email protected]
http://listmaster.pepperfish.net/cgi-bin/mailman/listinfo/netsurf-commits-netsurf-browser.org

Reply via email to