Gitweb links:
...log
http://git.netsurf-browser.org/netsurf.git/shortlog/59af85e0b50f7343fe7c867cdb8cb868d7aac58f
...commit
http://git.netsurf-browser.org/netsurf.git/commit/59af85e0b50f7343fe7c867cdb8cb868d7aac58f
...tree
http://git.netsurf-browser.org/netsurf.git/tree/59af85e0b50f7343fe7c867cdb8cb868d7aac58f
The branch, chris/palette-mapped-plotters has been updated
via 59af85e0b50f7343fe7c867cdb8cb868d7aac58f (commit)
via 803970589b1a8516686481f6ef3b6456d46fceb2 (commit)
via 74e794d7a25db2c245120ce4d7b98fb6ff9e8d15 (commit)
via c359b9400b720f9ee175154a1ffa542b5ccc2d97 (commit)
via a46c5ae09f2a1fe048b0da5418cf9ed33f512166 (commit)
via 7716143240429371e8f357ddc44d15d343759ae1 (commit)
via 1e02eba1932b1fa2eff148ed6e9b58170a74189e (commit)
via 97aabaf49dc587345f40b1ab8e908fdc6dcfae0f (commit)
via 28ddb102687dc570f94a2f2157c80a279bf99274 (commit)
via f5891097cc955e05946f114a7e28b36f61faddf1 (commit)
via 9a0f7028a340f0678ce27d6a91f50faf96800187 (commit)
via 3e2123d9ec06ad7102ed32847755358ef43a84c2 (commit)
from 55c08431ee40a28589ff3278a51f61a6847b7f4e (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/commitdiff/59af85e0b50f7343fe7c867cdb8cb868d7aac58f
commit 59af85e0b50f7343fe7c867cdb8cb868d7aac58f
Author: Chris Young <[email protected]>
Commit: Chris Young <[email protected]>
disable mask for now, causing colourisation problems
diff --git a/amiga/bitmap.h b/amiga/bitmap.h
index 3153ee7..3b6f147 100755
--- a/amiga/bitmap.h
+++ b/amiga/bitmap.h
@@ -35,7 +35,7 @@ struct bitmap {
struct BitMap *nativebm;
int nativebmwidth;
int nativebmheight;
- APTR native_mask;
+ PLANEPTR native_mask;
Object *dto;
char *url; /* temporary storage space */
char *title; /* temporary storage space */
diff --git a/amiga/plotters.c b/amiga/plotters.c
index 5c5c7fa..ab880db 100755
--- a/amiga/plotters.c
+++ b/amiga/plotters.c
@@ -661,7 +661,7 @@ static bool ami_bitmap(int x, int y, int width, int height,
struct bitmap *bitma
} else {
tag = BLITA_MaskPlane;
tag_data = (ULONG)bitmap->native_mask;
- minterm = (ABC|ABNC|ANBC);
+ minterm = 0xc0; /* Should be (ABC|ABNC|ANBC) */
}
BltBitMapTags(BLITA_Width,width,
@@ -826,7 +826,7 @@ static void ami_bitmap_tile_hook(struct Hook *hook,struct
RastPort *rp,struct Ba
} else {
tag = BLITA_MaskPlane;
tag_data = (ULONG)bfbm->mask;
- minterm = (ABC|ABNC|ANBC);
+ minterm = 0xc0; /* Should be
(ABC|ABNC|ANBC) */
}
BltBitMapTags(BLITA_Width, bfbm->width,
commitdiff
http://git.netsurf-browser.org/netsurf.git/commitdiff/803970589b1a8516686481f6ef3b6456d46fceb2
commit 803970589b1a8516686481f6ef3b6456d46fceb2
Author: Chris Young <[email protected]>
Commit: Chris Young <[email protected]>
attempt blit through mask
diff --git a/amiga/plotters.c b/amiga/plotters.c
index 6d0f2cd..5c5c7fa 100755
--- a/amiga/plotters.c
+++ b/amiga/plotters.c
@@ -51,6 +51,7 @@ struct bfbitmap {
ULONG height;
int offsetx;
int offsety;
+ APTR mask;
};
bool palette_mapped = false;
@@ -651,6 +652,18 @@ static bool ami_bitmap(int x, int y, int width, int
height, struct bitmap *bitma
}
else
{
+ ULONG tag, tag_data, minterm;
+
+ if(palette_mapped == false) {
+ tag = BLITA_UseSrcAlpha;
+ tag_data = !bitmap->opaque;
+ minterm = 0xc0;
+ } else {
+ tag = BLITA_MaskPlane;
+ tag_data = (ULONG)bitmap->native_mask;
+ minterm = (ABC|ABNC|ANBC);
+ }
+
BltBitMapTags(BLITA_Width,width,
BLITA_Height,height,
BLITA_Source,tbm,
@@ -659,8 +672,8 @@ static bool ami_bitmap(int x, int y, int width, int height,
struct bitmap *bitma
BLITA_DestY,y,
BLITA_SrcType,BLITT_BITMAP,
BLITA_DestType,BLITT_RASTPORT,
-// BLITA_Mask,0xFF,
-
BLITA_UseSrcAlpha,!bitmap->opaque,
+ BLITA_Minterm, minterm,
+ tag, tag_data,
TAG_DONE);
}
@@ -691,7 +704,7 @@ bool ami_bitmap_tile(int x, int y, int width, int height,
if(!(repeat_x || repeat_y))
return ami_bitmap(x, y, width, height, bitmap);
-if(palette_mapped == true) return true; // stop trailling into tiled mode for
now
+
/* If it is a one pixel transparent image, we are wasting our time */
if((bitmap->opaque == false) && (bitmap->width == 1) && (bitmap->height
== 1))
return true;
@@ -756,6 +769,7 @@ if(palette_mapped == true) return true; // stop trailling
into tiled mode for no
bfbm.height = height;
bfbm.offsetx = ox;
bfbm.offsety = oy;
+ bfbm.mask = bitmap->native_mask;
bfh = AllocVec(sizeof(struct Hook),MEMF_CLEAR);
bfh->h_Entry = (HOOKFUNC)ami_bitmap_tile_hook;
bfh->h_SubEntry = 0;
@@ -787,9 +801,9 @@ static void ami_bitmap_tile_hook(struct Hook *hook,struct
RastPort *rp,struct Ba
for (xf = -bfbm->offsetx; xf < bfmsg->Bounds.MaxX; xf += bfbm->width) {
for (yf = -bfbm->offsety; yf < bfmsg->Bounds.MaxY; yf +=
bfbm->height) {
- if(GfxBase->LibNode.lib_Version >= 53) // AutoDoc says
v52, but this function isn't in OS4.0, so checking for v53 (OS4.1)
+ if((GfxBase->LibNode.lib_Version >= 53) &&
(palette_mapped == false))
{
-
CompositeTags(COMPOSITE_Src_Over_Dest,bfbm->bm,rp->BitMap,
+ CompositeTags(COMPOSITE_Src_Over_Dest,bfbm->bm,
rp->BitMap,
COMPTAG_Flags,COMPFLAG_IgnoreDestAlpha,
COMPTAG_DestX,bfmsg->Bounds.MinX,
COMPTAG_DestY,bfmsg->Bounds.MinY,
@@ -803,17 +817,30 @@ static void ami_bitmap_tile_hook(struct Hook *hook,struct
RastPort *rp,struct Ba
}
else
{
- BltBitMapTags(BLITA_Width,bfbm->width,
- BLITA_Height,bfbm->height,
- BLITA_Source,bfbm->bm,
- BLITA_Dest,rp,
- BLITA_DestX,xf,
- BLITA_DestY,yf,
- BLITA_SrcType,BLITT_BITMAP,
- BLITA_DestType,BLITT_RASTPORT,
- BLITA_UseSrcAlpha,TRUE,
+ ULONG tag, tag_data, minterm;
+
+ if(palette_mapped == false) {
+ tag = BLITA_UseSrcAlpha;
+ tag_data = TRUE;
+ minterm = 0xc0;
+ } else {
+ tag = BLITA_MaskPlane;
+ tag_data = (ULONG)bfbm->mask;
+ minterm = (ABC|ABNC|ANBC);
+ }
+
+ BltBitMapTags(BLITA_Width, bfbm->width,
+ BLITA_Height, bfbm->height,
+ BLITA_Source, bfbm->bm,
+ BLITA_Dest, rp,
+ BLITA_DestX, xf,
+ BLITA_DestY, yf,
+ BLITA_SrcType, BLITT_BITMAP,
+ BLITA_DestType, BLITT_RASTPORT,
+ BLITA_Minterm, minterm,
+ tag, tag_data,
TAG_DONE);
- }
+ }
}
}
}
commitdiff
http://git.netsurf-browser.org/netsurf.git/commitdiff/74e794d7a25db2c245120ce4d7b98fb6ff9e8d15
commit 74e794d7a25db2c245120ce4d7b98fb6ff9e8d15
Author: Chris Young <[email protected]>
Commit: Chris Young <[email protected]>
implement scaling
diff --git a/amiga/bitmap.c b/amiga/bitmap.c
index 5377adf..d8f11b8 100644
--- a/amiga/bitmap.c
+++ b/amiga/bitmap.c
@@ -469,19 +469,38 @@ struct BitMap *ami_bitmap_get_palettemapped(struct bitmap
*bitmap,
{
struct BitMap *dtbm;
+ /* Dispose the DataTypes object if we've performed a layout already,
+ and we need to scale, as scaling can only be performed before
+ the first GM_LAYOUT */
+
+ if(bitmap->dto &&
+ ((bitmap->nativebmwidth != width) ||
+ (bitmap->nativebmheight != height))) {
+ DisposeDTObject(bitmap->dto);
+ bitmap->dto = NULL;
+ }
+
if(bitmap->dto == NULL)
bitmap->dto = ami_datatype_object_from_bitmap(bitmap);
-
+
SetDTAttrs(bitmap->dto, NULL, NULL,
PDTA_Screen, scrn,
+ PDTA_ScaleQuality, nsoption_bool(scale_quality),
TAG_DONE);
+ if((bitmap->width != width) || (bitmap->height != height)) {
+ IDoMethod(bitmap->dto, PDTM_SCALE, width, height, 0);
+ }
+
if(DoDTMethod(bitmap->dto, 0, 0, DTM_PROCLAYOUT, 0, 1)) {
GetDTAttrs(bitmap->dto,
PDTA_DestBitMap, &dtbm,
PDTA_MaskPlane, &bitmap->native_mask,
TAG_END);
}
-/* TODO: support scaling */
+
+ bitmap->nativebmwidth = width;
+ bitmap->nativebmheight = height;
+
return dtbm;
}
commitdiff
http://git.netsurf-browser.org/netsurf.git/commitdiff/c359b9400b720f9ee175154a1ffa542b5ccc2d97
commit c359b9400b720f9ee175154a1ffa542b5ccc2d97
Author: Chris Young <[email protected]>
Commit: Chris Young <[email protected]>
Palette-mapped bitmap support
diff --git a/amiga/bitmap.c b/amiga/bitmap.c
index ce665aa..5377adf 100644
--- a/amiga/bitmap.c
+++ b/amiga/bitmap.c
@@ -117,7 +117,11 @@ void bitmap_destroy(void *bitmap)
if(bm)
{
- if(bm->nativebm) p96FreeBitMap(bm->nativebm);
+ if((bm->nativebm) && (bm->dto == NULL))
+ p96FreeBitMap(bm->nativebm);
+
+ if(bm->dto) DisposeDTObject(bm->dto);
+
FreeVec(bm->pixdata);
bm->pixdata = NULL;
FreeVec(bm);
@@ -160,8 +164,13 @@ bool bitmap_save(void *bitmap, const char *path, unsigned
flags)
void bitmap_modified(void *bitmap) {
struct bitmap *bm = bitmap;
- p96FreeBitMap(bm->nativebm);
+ if((bm->nativebm) && (bm->dto == NULL))
+ p96FreeBitMap(bm->nativebm);
+
+ if(bm->dto) DisposeDTObject(bm->dto);
bm->nativebm = NULL;
+ bm->dto = NULL;
+ bm->native_mask = NULL;
}
@@ -454,3 +463,25 @@ struct BitMap *ami_getcachenativebm(struct bitmap
*bitmap,int width,int height,s
return tbm;
}
+
+struct BitMap *ami_bitmap_get_palettemapped(struct bitmap *bitmap,
+ int width, int height)
+{
+ struct BitMap *dtbm;
+
+ if(bitmap->dto == NULL)
+ bitmap->dto = ami_datatype_object_from_bitmap(bitmap);
+
+ SetDTAttrs(bitmap->dto, NULL, NULL,
+ PDTA_Screen, scrn,
+ TAG_DONE);
+
+ if(DoDTMethod(bitmap->dto, 0, 0, DTM_PROCLAYOUT, 0, 1)) {
+ GetDTAttrs(bitmap->dto,
+ PDTA_DestBitMap, &dtbm,
+ PDTA_MaskPlane, &bitmap->native_mask,
+ TAG_END);
+ }
+/* TODO: support scaling */
+ return dtbm;
+}
diff --git a/amiga/bitmap.h b/amiga/bitmap.h
index 41d488e..3153ee7 100755
--- a/amiga/bitmap.h
+++ b/amiga/bitmap.h
@@ -35,12 +35,16 @@ struct bitmap {
struct BitMap *nativebm;
int nativebmwidth;
int nativebmheight;
+ APTR native_mask;
+ Object *dto;
char *url; /* temporary storage space */
char *title; /* temporary storage space */
ULONG *icondata; /* for appicons */
};
struct BitMap *ami_getcachenativebm(struct bitmap *bitmap,int width,int
height,struct BitMap *friendbm);
+struct BitMap *ami_bitmap_get_palettemapped(struct bitmap *bitmap, int width,
int height);
+
Object *ami_datatype_object_from_bitmap(struct bitmap *bitmap);
struct bitmap *ami_bitmap_from_datatype(char *filename);
#endif
diff --git a/amiga/plotters.c b/amiga/plotters.c
index 8537638..6d0f2cd 100755
--- a/amiga/plotters.c
+++ b/amiga/plotters.c
@@ -619,15 +619,19 @@ static bool ami_bitmap(int x, int y, int width, int
height, struct bitmap *bitma
(y > glob->rect.MaxY))
return true;
- tbm = ami_getcachenativebm(bitmap,width,height,glob->rp->BitMap);
-
+ if(palette_mapped == false) {
+ tbm = ami_getcachenativebm(bitmap, width, height,
glob->rp->BitMap);
+ } else {
+ tbm = ami_bitmap_get_palettemapped(bitmap, width, height);
+ }
+
if(!tbm) return true;
#ifdef AMI_PLOTTER_DEBUG
LOG(("[ami_plotter] ami_bitmap() got native bitmap"));
#endif
- if(GfxBase->LibNode.lib_Version >= 53) // AutoDoc says v52, but this
function isn't in OS4.0, so checking for v53 (OS4.1)
+ if((GfxBase->LibNode.lib_Version >= 53) && (palette_mapped == false))
{
uint32 comptype = COMPOSITE_Src;
if(!bitmap->opaque)
@@ -660,7 +664,7 @@ static bool ami_bitmap(int x, int y, int width, int height,
struct bitmap *bitma
TAG_DONE);
}
- if(tbm != bitmap->nativebm)
+ if((bitmap->dto == NULL) && (tbm != bitmap->nativebm))
{
p96FreeBitMap(tbm);
}
@@ -676,8 +680,6 @@ bool ami_bitmap_tile(int x, int y, int width, int height,
LOG(("[ami_plotter] Entered ami_bitmap_tile()"));
#endif
- if(palette_mapped == true) return true;
-
int xf,yf,xm,ym,oy,ox;
struct BitMap *tbm = NULL;
struct Hook *bfh = NULL;
@@ -689,13 +691,17 @@ bool ami_bitmap_tile(int x, int y, int width, int height,
if(!(repeat_x || repeat_y))
return ami_bitmap(x, y, width, height, bitmap);
-
+if(palette_mapped == true) return true; // stop trailling into tiled mode for
now
/* If it is a one pixel transparent image, we are wasting our time */
if((bitmap->opaque == false) && (bitmap->width == 1) && (bitmap->height
== 1))
return true;
- tbm = ami_getcachenativebm(bitmap,width,height,glob->rp->BitMap);
-
+ if(palette_mapped == false) {
+ tbm =
ami_getcachenativebm(bitmap,width,height,glob->rp->BitMap);
+ } else {
+ tbm = ami_bitmap_get_palettemapped(bitmap, width, height);
+ }
+
if(!tbm) return true;
ox = x;
@@ -764,7 +770,7 @@ bool ami_bitmap_tile(int x, int y, int width, int height,
if(bitmap->opaque) DeleteBackFillHook(bfh);
else FreeVec(bfh);
- if(tbm != bitmap->nativebm)
+ if((bitmap->dto == NULL) && (tbm != bitmap->nativebm))
{
p96FreeBitMap(tbm);
}
commitdiff
http://git.netsurf-browser.org/netsurf.git/commitdiff/a46c5ae09f2a1fe048b0da5418cf9ed33f512166
commit a46c5ae09f2a1fe048b0da5418cf9ed33f512166
Merge: 55c0843 7716143
Author: Chris Young <[email protected]>
Commit: Chris Young <[email protected]>
Merge branch 'master' into chris/palette-mapped-plotters
-----------------------------------------------------------------------
Summary of changes:
amiga/Makefile.target | 6 ++--
amiga/bitmap.c | 58 ++++++++++++++++++++++++++++++--
amiga/bitmap.h | 4 ++
amiga/dt_picture.c | 2 +
amiga/gui.c | 8 ++--
amiga/plotters.c | 79 ++++++++++++++++++++++++++++++------------
javascript/jsapi/document.c | 35 ++++++++++++++++++-
render/html.c | 24 ++++++-------
8 files changed, 169 insertions(+), 47 deletions(-)
diff --git a/amiga/Makefile.target b/amiga/Makefile.target
index fb0259c..f2d23bb 100644
--- a/amiga/Makefile.target
+++ b/amiga/Makefile.target
@@ -52,16 +52,16 @@ else
CFLAGS += -I$(GCCSDK_INSTALL_ENV)/include
CFLAGS += $(shell $(PKG_CONFIG) --cflags libxml-2.0 libcurl libcares openssl)
- CFLAGS += $(shell $(PKG_CONFIG) --cflags tre libhubbub libcss)
+ CFLAGS += $(shell $(PKG_CONFIG) --cflags tre libdom libcss)
LDFLAGS += $(shell $(PKG_CONFIG) --libs libxml-2.0 libcurl libcares openssl)
- LDFLAGS += $(shell $(PKG_CONFIG) --libs tre libhubbub libcss)
+ LDFLAGS += $(shell $(PKG_CONFIG) --libs tre libdom libcss)
LDFLAGS += -L$(GCCSDK_INSTALL_ENV)/lib
ifeq ($(SUBTARGET),os3)
LDFLAGS += -liconv
else
- LDFLAGS += -lauto
+ LDFLAGS += -lauto -lpbl
endif
EXETARGET := NetSurf
diff --git a/amiga/bitmap.c b/amiga/bitmap.c
index 4e1057e..d8f11b8 100644
--- a/amiga/bitmap.c
+++ b/amiga/bitmap.c
@@ -117,7 +117,11 @@ void bitmap_destroy(void *bitmap)
if(bm)
{
- if(bm->nativebm) p96FreeBitMap(bm->nativebm);
+ if((bm->nativebm) && (bm->dto == NULL))
+ p96FreeBitMap(bm->nativebm);
+
+ if(bm->dto) DisposeDTObject(bm->dto);
+
FreeVec(bm->pixdata);
bm->pixdata = NULL;
FreeVec(bm);
@@ -160,8 +164,13 @@ bool bitmap_save(void *bitmap, const char *path, unsigned
flags)
void bitmap_modified(void *bitmap) {
struct bitmap *bm = bitmap;
- p96FreeBitMap(bm->nativebm);
+ if((bm->nativebm) && (bm->dto == NULL))
+ p96FreeBitMap(bm->nativebm);
+
+ if(bm->dto) DisposeDTObject(bm->dto);
bm->nativebm = NULL;
+ bm->dto = NULL;
+ bm->native_mask = NULL;
}
@@ -208,7 +217,7 @@ bool bitmap_test_opaque(void *bitmap)
for(a=0;a<p;a+=4)
{
- if ((*bmi & 0x000000ffU) != 0x000000ffU) return false;
+ if ((*bmi & 0xff000000U) != 0xff000000U) return false;
bmi++;
}
return true;
@@ -328,6 +337,8 @@ struct bitmap *ami_bitmap_from_datatype(char *filename)
IDoMethod(dto, PDTM_READPIXELARRAY,
bitmap_get_buffer(bm),
PBPAFMT_RGBA, bitmap_get_rowstride(bm), 0, 0,
bmh->bmh_Width, bmh->bmh_Height);
+
+ bitmap_set_opaque(bm, bitmap_test_opaque(bm));
}
DisposeDTObject(dto);
}
@@ -452,3 +463,44 @@ struct BitMap *ami_getcachenativebm(struct bitmap
*bitmap,int width,int height,s
return tbm;
}
+
+struct BitMap *ami_bitmap_get_palettemapped(struct bitmap *bitmap,
+ int width, int height)
+{
+ struct BitMap *dtbm;
+
+ /* Dispose the DataTypes object if we've performed a layout already,
+ and we need to scale, as scaling can only be performed before
+ the first GM_LAYOUT */
+
+ if(bitmap->dto &&
+ ((bitmap->nativebmwidth != width) ||
+ (bitmap->nativebmheight != height))) {
+ DisposeDTObject(bitmap->dto);
+ bitmap->dto = NULL;
+ }
+
+ if(bitmap->dto == NULL)
+ bitmap->dto = ami_datatype_object_from_bitmap(bitmap);
+
+ SetDTAttrs(bitmap->dto, NULL, NULL,
+ PDTA_Screen, scrn,
+ PDTA_ScaleQuality, nsoption_bool(scale_quality),
+ TAG_DONE);
+
+ if((bitmap->width != width) || (bitmap->height != height)) {
+ IDoMethod(bitmap->dto, PDTM_SCALE, width, height, 0);
+ }
+
+ if(DoDTMethod(bitmap->dto, 0, 0, DTM_PROCLAYOUT, 0, 1)) {
+ GetDTAttrs(bitmap->dto,
+ PDTA_DestBitMap, &dtbm,
+ PDTA_MaskPlane, &bitmap->native_mask,
+ TAG_END);
+ }
+
+ bitmap->nativebmwidth = width;
+ bitmap->nativebmheight = height;
+
+ return dtbm;
+}
diff --git a/amiga/bitmap.h b/amiga/bitmap.h
index 41d488e..3b6f147 100755
--- a/amiga/bitmap.h
+++ b/amiga/bitmap.h
@@ -35,12 +35,16 @@ struct bitmap {
struct BitMap *nativebm;
int nativebmwidth;
int nativebmheight;
+ PLANEPTR native_mask;
+ Object *dto;
char *url; /* temporary storage space */
char *title; /* temporary storage space */
ULONG *icondata; /* for appicons */
};
struct BitMap *ami_getcachenativebm(struct bitmap *bitmap,int width,int
height,struct BitMap *friendbm);
+struct BitMap *ami_bitmap_get_palettemapped(struct bitmap *bitmap, int width,
int height);
+
Object *ami_datatype_object_from_bitmap(struct bitmap *bitmap);
struct bitmap *ami_bitmap_from_datatype(char *filename);
#endif
diff --git a/amiga/dt_picture.c b/amiga/dt_picture.c
index 15ae40d..b6e0a91 100644
--- a/amiga/dt_picture.c
+++ b/amiga/dt_picture.c
@@ -159,6 +159,8 @@ static struct bitmap *amiga_dt_picture_cache_convert(struct
content *c)
bm_buffer, bm_format, bitmap_get_rowstride(bitmap),
0, 0, c->width, c->height);
+ bitmap_set_opaque(bitmap, bitmap_test_opaque(bitmap));
+
DisposeDTObject(dto);
}
else return NULL;
diff --git a/amiga/gui.c b/amiga/gui.c
index ce39675..d772105 100755
--- a/amiga/gui.c
+++ b/amiga/gui.c
@@ -2824,7 +2824,7 @@ struct gui_window *gui_create_browser_window(struct
browser_window *bw,
GA_ID, GID_ICON,
SPACE_MinWidth, 16,
SPACE_MinHeight, 16,
- SPACE_Transparent, TRUE,
+ SPACE_Transparent, FALSE,
// SPACE_RenderHook,
&g->shared->favicon_hook,
SpaceEnd,
CHILD_WeightedWidth,0,
@@ -2850,7 +2850,7 @@ struct gui_window *gui_create_browser_window(struct
browser_window *bw,
GA_ID, GID_SEARCH_ICON,
SPACE_MinWidth, 16,
SPACE_MinHeight, 16,
- SPACE_Transparent, TRUE,
+ SPACE_Transparent,
FALSE,
SPACE_RenderHook,
&g->shared->search_ico_hook,
SpaceEnd,
CHILD_WeightedWidth,0,
@@ -3830,8 +3830,8 @@ void gui_window_set_icon(struct gui_window *g,
hlcache_handle *icon)
{
GetAttr(SPACE_AreaBox, g->shared->objects[GID_ICON], (ULONG
*)&bbox);
- EraseRect(g->shared->win->RPort, bbox->Left, bbox->Top,
- bbox->Left+16, bbox->Top+16);
+ RefreshGList((struct Gadget *)g->shared->objects[GID_ICON],
+ g->shared->win, NULL, 1);
if(bm)
{
diff --git a/amiga/plotters.c b/amiga/plotters.c
index 8537638..ab880db 100755
--- a/amiga/plotters.c
+++ b/amiga/plotters.c
@@ -51,6 +51,7 @@ struct bfbitmap {
ULONG height;
int offsetx;
int offsety;
+ APTR mask;
};
bool palette_mapped = false;
@@ -619,15 +620,19 @@ static bool ami_bitmap(int x, int y, int width, int
height, struct bitmap *bitma
(y > glob->rect.MaxY))
return true;
- tbm = ami_getcachenativebm(bitmap,width,height,glob->rp->BitMap);
-
+ if(palette_mapped == false) {
+ tbm = ami_getcachenativebm(bitmap, width, height,
glob->rp->BitMap);
+ } else {
+ tbm = ami_bitmap_get_palettemapped(bitmap, width, height);
+ }
+
if(!tbm) return true;
#ifdef AMI_PLOTTER_DEBUG
LOG(("[ami_plotter] ami_bitmap() got native bitmap"));
#endif
- if(GfxBase->LibNode.lib_Version >= 53) // AutoDoc says v52, but this
function isn't in OS4.0, so checking for v53 (OS4.1)
+ if((GfxBase->LibNode.lib_Version >= 53) && (palette_mapped == false))
{
uint32 comptype = COMPOSITE_Src;
if(!bitmap->opaque)
@@ -647,6 +652,18 @@ static bool ami_bitmap(int x, int y, int width, int
height, struct bitmap *bitma
}
else
{
+ ULONG tag, tag_data, minterm;
+
+ if(palette_mapped == false) {
+ tag = BLITA_UseSrcAlpha;
+ tag_data = !bitmap->opaque;
+ minterm = 0xc0;
+ } else {
+ tag = BLITA_MaskPlane;
+ tag_data = (ULONG)bitmap->native_mask;
+ minterm = 0xc0; /* Should be (ABC|ABNC|ANBC) */
+ }
+
BltBitMapTags(BLITA_Width,width,
BLITA_Height,height,
BLITA_Source,tbm,
@@ -655,12 +672,12 @@ static bool ami_bitmap(int x, int y, int width, int
height, struct bitmap *bitma
BLITA_DestY,y,
BLITA_SrcType,BLITT_BITMAP,
BLITA_DestType,BLITT_RASTPORT,
-// BLITA_Mask,0xFF,
-
BLITA_UseSrcAlpha,!bitmap->opaque,
+ BLITA_Minterm, minterm,
+ tag, tag_data,
TAG_DONE);
}
- if(tbm != bitmap->nativebm)
+ if((bitmap->dto == NULL) && (tbm != bitmap->nativebm))
{
p96FreeBitMap(tbm);
}
@@ -676,8 +693,6 @@ bool ami_bitmap_tile(int x, int y, int width, int height,
LOG(("[ami_plotter] Entered ami_bitmap_tile()"));
#endif
- if(palette_mapped == true) return true;
-
int xf,yf,xm,ym,oy,ox;
struct BitMap *tbm = NULL;
struct Hook *bfh = NULL;
@@ -694,8 +709,12 @@ bool ami_bitmap_tile(int x, int y, int width, int height,
if((bitmap->opaque == false) && (bitmap->width == 1) && (bitmap->height
== 1))
return true;
- tbm = ami_getcachenativebm(bitmap,width,height,glob->rp->BitMap);
-
+ if(palette_mapped == false) {
+ tbm =
ami_getcachenativebm(bitmap,width,height,glob->rp->BitMap);
+ } else {
+ tbm = ami_bitmap_get_palettemapped(bitmap, width, height);
+ }
+
if(!tbm) return true;
ox = x;
@@ -750,6 +769,7 @@ bool ami_bitmap_tile(int x, int y, int width, int height,
bfbm.height = height;
bfbm.offsetx = ox;
bfbm.offsety = oy;
+ bfbm.mask = bitmap->native_mask;
bfh = AllocVec(sizeof(struct Hook),MEMF_CLEAR);
bfh->h_Entry = (HOOKFUNC)ami_bitmap_tile_hook;
bfh->h_SubEntry = 0;
@@ -764,7 +784,7 @@ bool ami_bitmap_tile(int x, int y, int width, int height,
if(bitmap->opaque) DeleteBackFillHook(bfh);
else FreeVec(bfh);
- if(tbm != bitmap->nativebm)
+ if((bitmap->dto == NULL) && (tbm != bitmap->nativebm))
{
p96FreeBitMap(tbm);
}
@@ -781,9 +801,9 @@ static void ami_bitmap_tile_hook(struct Hook *hook,struct
RastPort *rp,struct Ba
for (xf = -bfbm->offsetx; xf < bfmsg->Bounds.MaxX; xf += bfbm->width) {
for (yf = -bfbm->offsety; yf < bfmsg->Bounds.MaxY; yf +=
bfbm->height) {
- if(GfxBase->LibNode.lib_Version >= 53) // AutoDoc says
v52, but this function isn't in OS4.0, so checking for v53 (OS4.1)
+ if((GfxBase->LibNode.lib_Version >= 53) &&
(palette_mapped == false))
{
-
CompositeTags(COMPOSITE_Src_Over_Dest,bfbm->bm,rp->BitMap,
+ CompositeTags(COMPOSITE_Src_Over_Dest,bfbm->bm,
rp->BitMap,
COMPTAG_Flags,COMPFLAG_IgnoreDestAlpha,
COMPTAG_DestX,bfmsg->Bounds.MinX,
COMPTAG_DestY,bfmsg->Bounds.MinY,
@@ -797,17 +817,30 @@ static void ami_bitmap_tile_hook(struct Hook *hook,struct
RastPort *rp,struct Ba
}
else
{
- BltBitMapTags(BLITA_Width,bfbm->width,
- BLITA_Height,bfbm->height,
- BLITA_Source,bfbm->bm,
- BLITA_Dest,rp,
- BLITA_DestX,xf,
- BLITA_DestY,yf,
- BLITA_SrcType,BLITT_BITMAP,
- BLITA_DestType,BLITT_RASTPORT,
- BLITA_UseSrcAlpha,TRUE,
+ ULONG tag, tag_data, minterm;
+
+ if(palette_mapped == false) {
+ tag = BLITA_UseSrcAlpha;
+ tag_data = TRUE;
+ minterm = 0xc0;
+ } else {
+ tag = BLITA_MaskPlane;
+ tag_data = (ULONG)bfbm->mask;
+ minterm = 0xc0; /* Should be
(ABC|ABNC|ANBC) */
+ }
+
+ BltBitMapTags(BLITA_Width, bfbm->width,
+ BLITA_Height, bfbm->height,
+ BLITA_Source, bfbm->bm,
+ BLITA_Dest, rp,
+ BLITA_DestX, xf,
+ BLITA_DestY, yf,
+ BLITA_SrcType, BLITT_BITMAP,
+ BLITA_DestType, BLITT_RASTPORT,
+ BLITA_Minterm, minterm,
+ tag, tag_data,
TAG_DONE);
- }
+ }
}
}
}
diff --git a/javascript/jsapi/document.c b/javascript/jsapi/document.c
index c54d2f6..49144c4 100644
--- a/javascript/jsapi/document.c
+++ b/javascript/jsapi/document.c
@@ -115,7 +115,40 @@ static JSClass jsclass_document =
static JSBool JSAPI_NATIVE(getElementById, JSContext *cx, uintN argc, jsval
*vp)
{
- JSAPI_SET_RVAL(cx, vp, JSVAL_VOID);
+ JSString* u16_txt;
+ char *txt;
+ unsigned long txtlen;
+ struct html_content *htmlc;
+ dom_string *idstr;
+ dom_element *idelement;
+
+ htmlc = JS_GetInstancePrivate(cx, JS_THIS_OBJECT(cx,vp),
&jsclass_document, NULL);
+ if (htmlc == NULL)
+ return JS_FALSE;
+
+ if (htmlc->document == NULL) {
+ /* no document available, this is obviously a problem
+ * for finding elements
+ */
+ JSAPI_SET_RVAL(cx, vp, JSVAL_NULL);
+
+ return JS_TRUE;
+ }
+
+ if (!JS_ConvertArguments(cx, argc, JSAPI_ARGV(cx, vp), "S", &u16_txt))
+ return JS_FALSE;
+
+ JSString_to_char(u16_txt, txt, txtlen);
+
+ dom_string_create((unsigned char*)txt, txtlen, &idstr);
+
+ dom_document_get_element_by_id(htmlc->document, idstr, &idelement);
+
+ if (idelement==NULL) {
+ JSAPI_SET_RVAL(cx, vp, JSVAL_NULL);
+ } else {
+ /* create element object and return it*/
+ }
return JS_TRUE;
}
diff --git a/render/html.c b/render/html.c
index 069f290..8526ca0 100644
--- a/render/html.c
+++ b/render/html.c
@@ -334,7 +334,8 @@ html_create_html_data(html_content *c, const http_parameter
*params)
/* Create the parser binding */
c->parser = dom_hubbub_parser_create(c->encoding,
true,
- nsoption_bool(enable_javascript),
+ nsoption_bool(enable_javascript),
+ &c->document,
NULL,
html_process_script,
c);
@@ -347,6 +348,7 @@ html_create_html_data(html_content *c, const http_parameter
*params)
c->parser = dom_hubbub_parser_create(c->encoding,
true,
nsoption_bool(enable_javascript),
+ &c->document,
NULL,
html_process_script,
c);
@@ -449,6 +451,7 @@ html_process_encoding_change(struct content *c,
html->parser = dom_hubbub_parser_create(html->encoding,
true,
nsoption_bool(enable_javascript),
+ &html->document,
NULL,
html_process_script,
html);
@@ -468,6 +471,8 @@ html_process_encoding_change(struct content *c,
html->parser = dom_hubbub_parser_create(html->encoding,
true,
nsoption_bool(enable_javascript),
+ &html->document,
+
NULL,
html_process_script,
html);
@@ -1966,7 +1971,8 @@ html_begin_conversion(html_content *htmlc)
union content_msg_data msg_data;
/** @todo Improve processing of errors */
- msg_data.error = messages_get("NoMemory");
+ LOG(("Parsing failed"));
+ msg_data.error = messages_get("ParsingFail");
content_broadcast(&htmlc->base, CONTENT_MSG_ERROR, msg_data);
return false;
@@ -1975,23 +1981,15 @@ html_begin_conversion(html_content *htmlc)
/* complete script execution */
html_scripts_exec(htmlc);
- htmlc->document = dom_hubbub_parser_get_document(htmlc->parser);
-
- if (htmlc->document == NULL) {
- LOG(("Parsing failed"));
- msg_data.error = messages_get("ParsingFail");
- content_broadcast(&htmlc->base, CONTENT_MSG_ERROR, msg_data);
- return false;
- }
-
+ /* quirks mode */
exc = dom_document_get_quirks_mode(htmlc->document, &htmlc->quirks);
if (exc != DOM_NO_ERR) {
LOG(("error retrieving quirks"));
+ /** @todo should this be fatal to the conversion? */
}
-
LOG(("quirks set to %d", htmlc->quirks));
-
+ /* get encoding */
if (htmlc->encoding == NULL) {
const char *encoding;
encoding = dom_hubbub_parser_get_encoding(htmlc->parser,
--
NetSurf Browser
_______________________________________________
netsurf-commits mailing list
[email protected]
http://vlists.pepperfish.net/cgi-bin/mailman/listinfo/netsurf-commits-netsurf-browser.org