Gitweb links:
...log
http://git.netsurf-browser.org/netsurf.git/shortlog/dad8065f0a0f9a572983444b3f51d4cddca69ecc
...commit
http://git.netsurf-browser.org/netsurf.git/commit/dad8065f0a0f9a572983444b3f51d4cddca69ecc
...tree
http://git.netsurf-browser.org/netsurf.git/tree/dad8065f0a0f9a572983444b3f51d4cddca69ecc
The branch, chris/palette-mapped-plotters has been updated
via dad8065f0a0f9a572983444b3f51d4cddca69ecc (commit)
via 6f647139778b86c00f77fa8b72807e4361530711 (commit)
from fce70264848a04683282da567e429b71b6666847 (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/dad8065f0a0f9a572983444b3f51d4cddca69ecc
commit dad8065f0a0f9a572983444b3f51d4cddca69ecc
Author: Chris Young <[email protected]>
Commit: Chris Young <[email protected]>
move text colour settings into plotters.c, and use palette-map capable
function
diff --git a/amiga/font.c b/amiga/font.c
index 8be4076..19d6dd1 100644
--- a/amiga/font.c
+++ b/amiga/font.c
@@ -712,8 +712,6 @@ ULONG ami_unicode_text(struct RastPort *rp,const char
*string,ULONG length,const
outf16 = utf16;
if(!(ofont = ami_open_outline_font(fstyle, 0))) return 0;
- if(rp)
SetRPAttrs(rp,RPTAG_APenColor,p96EncodeColor(RGBFB_A8B8G8R8,fstyle->foreground),TAG_DONE);
-
while(*utf16 != 0)
{
if (*utf16 < 0xD800 || 0xDFFF < *utf16)
diff --git a/amiga/plotters.c b/amiga/plotters.c
index 6881de9..7a8e6cc 100755
--- a/amiga/plotters.c
+++ b/amiga/plotters.c
@@ -19,24 +19,29 @@
#include "amiga/plotters.h"
#include "amiga/bitmap.h"
#include "amiga/font.h"
+#include "amiga/gui.h"
+#include "amiga/utf8.h"
+
+#include "desktop/options.h"
+#include "utils/utils.h"
+#include "utils/log.h"
+
#include <proto/Picasso96API.h>
+#include <proto/exec.h>
+#include <proto/intuition.h>
+
#include <intuition/intuition.h>
#include <graphics/rpattr.h>
#include <graphics/gfxmacros.h>
#include <graphics/gfxbase.h>
-#include "amiga/utf8.h"
-#include "desktop/options.h"
+
#ifdef __amigaos4__
#include <graphics/blitattr.h>
#include <graphics/composite.h>
#endif
-#include "utils/log.h"
+
#include <math.h>
#include <assert.h>
-#include <proto/exec.h>
-#include <proto/intuition.h>
-#include "amiga/gui.h"
-#include "utils/utils.h"
static void ami_bitmap_tile_hook(struct Hook *hook,struct RastPort *rp,struct
BackFillMessage *bfmsg);
@@ -231,6 +236,8 @@ void ami_plot_setapen(ULONG colour)
(colour & 0x00ff0000) << 8,
NULL);
+ if(pen == -1) LOG(("WARNING: Cannot allocate pen for ABGR:%lx",
colour));
+
SetAPen(glob->rp, pen);
}
}
@@ -499,7 +506,9 @@ bool ami_text(int x, int y, const char *text, size_t length,
LOG(("[ami_plotter] Entered ami_text()"));
#endif
+ ami_plot_setapen(fstyle->foreground);
ami_unicode_text(glob->rp,text,length,fstyle,x,y);
+
return true;
}
commitdiff
http://git.netsurf-browser.org/netsurf.git/commitdiff/6f647139778b86c00f77fa8b72807e4361530711
commit 6f647139778b86c00f77fa8b72807e4361530711
Author: Chris Young <[email protected]>
Commit: Chris Young <[email protected]>
alloc off-screen bm as friend of screen bm
diff --git a/amiga/plotters.c b/amiga/plotters.c
index 889d285..6881de9 100755
--- a/amiga/plotters.c
+++ b/amiga/plotters.c
@@ -120,20 +120,38 @@ void ami_init_layers(struct gui_globals *gg, ULONG width,
ULONG height)
/* init shared bitmaps *
* Height is set to screen width to give enough space for thumbnails *
* Also applies to the further gfx/layers functions and memory below */
+
+ ULONG depth = 32;
struct DrawInfo *dri;
struct BitMap *friend = NULL; /* Required to be NULL for Cairo and ARGB
bitmaps */
+ if(dri = GetScreenDrawInfo(scrn)) {
+ if(depth < 16) {
+ palette_mapped = true;
+ depth = dri->dri_Depth; /* this is always wrong */
+ friend = scrn->RastPort.BitMap;
+ } else {
+ palette_mapped = false;
+ }
+ FreeScreenDrawInfo(scrn, dri);
+ }
+
if(nsoption_int(redraw_tile_size_x) <= 0)
nsoption_set_int(redraw_tile_size_x, scrn->Width);
if(nsoption_int(redraw_tile_size_y) <= 0)
nsoption_set_int(redraw_tile_size_y, scrn->Height);
if(!width) width = nsoption_int(redraw_tile_size_x);
if(!height) height = nsoption_int(redraw_tile_size_y);
gg->layerinfo = NewLayerInfo();
- gg->areabuf = AllocVec(100,MEMF_PRIVATE | MEMF_CLEAR);
- gg->tmprasbuf = AllocVec(width*height,MEMF_PRIVATE | MEMF_CLEAR);
+ gg->areabuf = AllocVec(100, MEMF_PRIVATE | MEMF_CLEAR);
+ gg->tmprasbuf = AllocVec(width * height, MEMF_PRIVATE | MEMF_CLEAR);
- gg->bm = p96AllocBitMap(width, height, 32,
+ if(palette_mapped ==false) {
+ gg->bm = p96AllocBitMap(width, height, 32,
BMF_INTERLEAVED, friend,
RGBFB_A8R8G8B8);
+ } else {
+ gg->bm = AllocBitMap(width, height, depth, BMF_INTERLEAVED,
friend);
+ }
+
if(!gg->bm) warn_user("NoMemory","");
gg->rp = AllocVec(sizeof(struct RastPort), MEMF_PRIVATE | MEMF_CLEAR);
@@ -165,15 +183,6 @@ void ami_init_layers(struct gui_globals *gg, ULONG width,
ULONG height)
gg->surface = cairo_amigaos_surface_create(gg->rp->BitMap);
gg->cr = cairo_create(gg->surface);
#endif
-
- if(dri = GetScreenDrawInfo(scrn)) {
- if(dri->dri_Depth < 16) { /* this is always true */
- palette_mapped = true;
- } else {
- palette_mapped = false;
- }
- FreeScreenDrawInfo(scrn,dri);
- }
}
void ami_free_layers(struct gui_globals *gg)
-----------------------------------------------------------------------
Summary of changes:
amiga/font.c | 2 -
amiga/plotters.c | 56 +++++++++++++++++++++++++++++++++++------------------
2 files changed, 37 insertions(+), 21 deletions(-)
diff --git a/amiga/font.c b/amiga/font.c
index 8be4076..19d6dd1 100644
--- a/amiga/font.c
+++ b/amiga/font.c
@@ -712,8 +712,6 @@ ULONG ami_unicode_text(struct RastPort *rp,const char
*string,ULONG length,const
outf16 = utf16;
if(!(ofont = ami_open_outline_font(fstyle, 0))) return 0;
- if(rp)
SetRPAttrs(rp,RPTAG_APenColor,p96EncodeColor(RGBFB_A8B8G8R8,fstyle->foreground),TAG_DONE);
-
while(*utf16 != 0)
{
if (*utf16 < 0xD800 || 0xDFFF < *utf16)
diff --git a/amiga/plotters.c b/amiga/plotters.c
index 889d285..7a8e6cc 100755
--- a/amiga/plotters.c
+++ b/amiga/plotters.c
@@ -19,24 +19,29 @@
#include "amiga/plotters.h"
#include "amiga/bitmap.h"
#include "amiga/font.h"
+#include "amiga/gui.h"
+#include "amiga/utf8.h"
+
+#include "desktop/options.h"
+#include "utils/utils.h"
+#include "utils/log.h"
+
#include <proto/Picasso96API.h>
+#include <proto/exec.h>
+#include <proto/intuition.h>
+
#include <intuition/intuition.h>
#include <graphics/rpattr.h>
#include <graphics/gfxmacros.h>
#include <graphics/gfxbase.h>
-#include "amiga/utf8.h"
-#include "desktop/options.h"
+
#ifdef __amigaos4__
#include <graphics/blitattr.h>
#include <graphics/composite.h>
#endif
-#include "utils/log.h"
+
#include <math.h>
#include <assert.h>
-#include <proto/exec.h>
-#include <proto/intuition.h>
-#include "amiga/gui.h"
-#include "utils/utils.h"
static void ami_bitmap_tile_hook(struct Hook *hook,struct RastPort *rp,struct
BackFillMessage *bfmsg);
@@ -120,20 +125,38 @@ void ami_init_layers(struct gui_globals *gg, ULONG width,
ULONG height)
/* init shared bitmaps *
* Height is set to screen width to give enough space for thumbnails *
* Also applies to the further gfx/layers functions and memory below */
+
+ ULONG depth = 32;
struct DrawInfo *dri;
struct BitMap *friend = NULL; /* Required to be NULL for Cairo and ARGB
bitmaps */
+ if(dri = GetScreenDrawInfo(scrn)) {
+ if(depth < 16) {
+ palette_mapped = true;
+ depth = dri->dri_Depth; /* this is always wrong */
+ friend = scrn->RastPort.BitMap;
+ } else {
+ palette_mapped = false;
+ }
+ FreeScreenDrawInfo(scrn, dri);
+ }
+
if(nsoption_int(redraw_tile_size_x) <= 0)
nsoption_set_int(redraw_tile_size_x, scrn->Width);
if(nsoption_int(redraw_tile_size_y) <= 0)
nsoption_set_int(redraw_tile_size_y, scrn->Height);
if(!width) width = nsoption_int(redraw_tile_size_x);
if(!height) height = nsoption_int(redraw_tile_size_y);
gg->layerinfo = NewLayerInfo();
- gg->areabuf = AllocVec(100,MEMF_PRIVATE | MEMF_CLEAR);
- gg->tmprasbuf = AllocVec(width*height,MEMF_PRIVATE | MEMF_CLEAR);
+ gg->areabuf = AllocVec(100, MEMF_PRIVATE | MEMF_CLEAR);
+ gg->tmprasbuf = AllocVec(width * height, MEMF_PRIVATE | MEMF_CLEAR);
- gg->bm = p96AllocBitMap(width, height, 32,
+ if(palette_mapped ==false) {
+ gg->bm = p96AllocBitMap(width, height, 32,
BMF_INTERLEAVED, friend,
RGBFB_A8R8G8B8);
+ } else {
+ gg->bm = AllocBitMap(width, height, depth, BMF_INTERLEAVED,
friend);
+ }
+
if(!gg->bm) warn_user("NoMemory","");
gg->rp = AllocVec(sizeof(struct RastPort), MEMF_PRIVATE | MEMF_CLEAR);
@@ -165,15 +188,6 @@ void ami_init_layers(struct gui_globals *gg, ULONG width,
ULONG height)
gg->surface = cairo_amigaos_surface_create(gg->rp->BitMap);
gg->cr = cairo_create(gg->surface);
#endif
-
- if(dri = GetScreenDrawInfo(scrn)) {
- if(dri->dri_Depth < 16) { /* this is always true */
- palette_mapped = true;
- } else {
- palette_mapped = false;
- }
- FreeScreenDrawInfo(scrn,dri);
- }
}
void ami_free_layers(struct gui_globals *gg)
@@ -222,6 +236,8 @@ void ami_plot_setapen(ULONG colour)
(colour & 0x00ff0000) << 8,
NULL);
+ if(pen == -1) LOG(("WARNING: Cannot allocate pen for ABGR:%lx",
colour));
+
SetAPen(glob->rp, pen);
}
}
@@ -490,7 +506,9 @@ bool ami_text(int x, int y, const char *text, size_t length,
LOG(("[ami_plotter] Entered ami_text()"));
#endif
+ ami_plot_setapen(fstyle->foreground);
ami_unicode_text(glob->rp,text,length,fstyle,x,y);
+
return true;
}
--
NetSurf Browser
_______________________________________________
netsurf-commits mailing list
[email protected]
http://vlists.pepperfish.net/cgi-bin/mailman/listinfo/netsurf-commits-netsurf-browser.org