Gitweb links:
...log
http://git.netsurf-browser.org/netsurf.git/shortlog/fce70264848a04683282da567e429b71b6666847
...commit
http://git.netsurf-browser.org/netsurf.git/commit/fce70264848a04683282da567e429b71b6666847
...tree
http://git.netsurf-browser.org/netsurf.git/tree/fce70264848a04683282da567e429b71b6666847
The branch, chris/palette-mapped-plotters has been updated
via fce70264848a04683282da567e429b71b6666847 (commit)
via 5f8d9e25ab7d504b41dfdde7dc65878ef87692f8 (commit)
from da4968b8e0af30d0caaf2fcaed88f5d60a0fccdf (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/fce70264848a04683282da567e429b71b6666847
commit fce70264848a04683282da567e429b71b6666847
Author: Chris Young <[email protected]>
Commit: Chris Young <[email protected]>
Attempt to draw palette-mapped rectangles.
Problems:
1. The DrawInfo structure is returning a depth of 8 for >8-bit screens
2. Colours are wrong (probably related to our off-screen rendering
mechanism)
3. Pens obtained through ObtainBestPenA() are never freed - we need to
keep track of them and somehow work out when it is best to free them.
diff --git a/amiga/plotters.c b/amiga/plotters.c
index c2a5c0b..889d285 100755
--- a/amiga/plotters.c
+++ b/amiga/plotters.c
@@ -1,5 +1,5 @@
/*
- * Copyright 2008,2009 Chris Young <[email protected]>
+ * Copyright 2008, 2009, 2012 Chris Young <[email protected]>
*
* This file is part of NetSurf, http://www.netsurf-browser.org/
*
@@ -34,6 +34,7 @@
#include <math.h>
#include <assert.h>
#include <proto/exec.h>
+#include <proto/intuition.h>
#include "amiga/gui.h"
#include "utils/utils.h"
@@ -47,6 +48,7 @@ struct bfbitmap {
int offsety;
};
+bool palette_mapped = false;
#ifndef M_PI /* For some reason we don't always get this from math.h */
#define M_PI 3.14159265358979323846
@@ -118,7 +120,7 @@ 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 */
-
+ struct DrawInfo *dri;
struct BitMap *friend = NULL; /* Required to be NULL for Cairo and ARGB
bitmaps */
if(nsoption_int(redraw_tile_size_x) <= 0)
nsoption_set_int(redraw_tile_size_x, scrn->Width);
@@ -163,6 +165,15 @@ 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)
@@ -198,6 +209,23 @@ void ami_clearclipreg(struct gui_globals *gg)
gg->rect.MaxY = scrn->Height-1;
}
+void ami_plot_setapen(ULONG colour)
+{
+ if(palette_mapped == false) {
+ SetRPAttrs(glob->rp, RPTAG_APenColor,
+ p96EncodeColor(RGBFF_A8B8G8R8, colour),
+ TAG_DONE);
+ } else {
+ ULONG pen = ObtainBestPenA(scrn->ViewPort.ColorMap,
+ (colour & 0x000000ff) << 24,
+ (colour & 0x0000ff00) << 16,
+ (colour & 0x00ff0000) << 8,
+ NULL);
+
+ SetAPen(glob->rp, pen);
+ }
+}
+
bool ami_rectangle(int x0, int y0, int x1, int y1, const plot_style_t *style)
{
#ifdef AMI_PLOTTER_DEBUG
@@ -206,11 +234,10 @@ bool ami_rectangle(int x0, int y0, int x1, int y1, const
plot_style_t *style)
if (style->fill_type != PLOT_OP_TYPE_NONE) {
- if(nsoption_int(cairo_renderer) < 2)
+ if((nsoption_int(cairo_renderer) < 2) ||
+ (palette_mapped == true))
{
- SetRPAttrs(glob->rp, RPTAG_APenColor,
- p96EncodeColor(RGBFB_A8B8G8R8,
style->fill_colour),
- TAG_DONE);
+ ami_plot_setapen(style->fill_colour);
RectFill(glob->rp, x0, y0, x1-1, y1-1);
}
else
@@ -228,7 +255,8 @@ bool ami_rectangle(int x0, int y0, int x1, int y1, const
plot_style_t *style)
}
if (style->stroke_type != PLOT_OP_TYPE_NONE) {
- if(nsoption_int(cairo_renderer) < 2)
+ if((nsoption_int(cairo_renderer) < 2) ||
+ (palette_mapped == true))
{
glob->rp->PenWidth = style->stroke_width;
glob->rp->PenHeight = style->stroke_width;
commitdiff
http://git.netsurf-browser.org/netsurf.git/commitdiff/5f8d9e25ab7d504b41dfdde7dc65878ef87692f8
commit 5f8d9e25ab7d504b41dfdde7dc65878ef87692f8
Author: Chris Young <[email protected]>
Commit: Chris Young <[email protected]>
Allow <16-bit depth in options GUI too
diff --git a/amiga/gui_options.c b/amiga/gui_options.c
index 2d65099..59e9c90 100755
--- a/amiga/gui_options.c
+++ b/amiga/gui_options.c
@@ -669,7 +669,7 @@ void ami_gui_opts_open(void)
GA_RelVerify, TRUE,
GA_Disabled,screenmodedisabled,
GETSCREENMODE_DisplayID,screenmodeid,
-
GETSCREENMODE_MinDepth, 16,
+
GETSCREENMODE_MinDepth, 0,
GETSCREENMODE_MaxDepth, 32,
GetScreenModeEnd,
LAYOUT_AddChild, gow->objects[GID_OPTS_SCREENNAME] = StringObject,
-----------------------------------------------------------------------
Summary of changes:
amiga/gui_options.c | 2 +-
amiga/plotters.c | 42 +++++++++++++++++++++++++++++++++++-------
2 files changed, 36 insertions(+), 8 deletions(-)
diff --git a/amiga/gui_options.c b/amiga/gui_options.c
index 2d65099..59e9c90 100755
--- a/amiga/gui_options.c
+++ b/amiga/gui_options.c
@@ -669,7 +669,7 @@ void ami_gui_opts_open(void)
GA_RelVerify, TRUE,
GA_Disabled,screenmodedisabled,
GETSCREENMODE_DisplayID,screenmodeid,
-
GETSCREENMODE_MinDepth, 16,
+
GETSCREENMODE_MinDepth, 0,
GETSCREENMODE_MaxDepth, 32,
GetScreenModeEnd,
LAYOUT_AddChild, gow->objects[GID_OPTS_SCREENNAME] = StringObject,
diff --git a/amiga/plotters.c b/amiga/plotters.c
index c2a5c0b..889d285 100755
--- a/amiga/plotters.c
+++ b/amiga/plotters.c
@@ -1,5 +1,5 @@
/*
- * Copyright 2008,2009 Chris Young <[email protected]>
+ * Copyright 2008, 2009, 2012 Chris Young <[email protected]>
*
* This file is part of NetSurf, http://www.netsurf-browser.org/
*
@@ -34,6 +34,7 @@
#include <math.h>
#include <assert.h>
#include <proto/exec.h>
+#include <proto/intuition.h>
#include "amiga/gui.h"
#include "utils/utils.h"
@@ -47,6 +48,7 @@ struct bfbitmap {
int offsety;
};
+bool palette_mapped = false;
#ifndef M_PI /* For some reason we don't always get this from math.h */
#define M_PI 3.14159265358979323846
@@ -118,7 +120,7 @@ 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 */
-
+ struct DrawInfo *dri;
struct BitMap *friend = NULL; /* Required to be NULL for Cairo and ARGB
bitmaps */
if(nsoption_int(redraw_tile_size_x) <= 0)
nsoption_set_int(redraw_tile_size_x, scrn->Width);
@@ -163,6 +165,15 @@ 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)
@@ -198,6 +209,23 @@ void ami_clearclipreg(struct gui_globals *gg)
gg->rect.MaxY = scrn->Height-1;
}
+void ami_plot_setapen(ULONG colour)
+{
+ if(palette_mapped == false) {
+ SetRPAttrs(glob->rp, RPTAG_APenColor,
+ p96EncodeColor(RGBFF_A8B8G8R8, colour),
+ TAG_DONE);
+ } else {
+ ULONG pen = ObtainBestPenA(scrn->ViewPort.ColorMap,
+ (colour & 0x000000ff) << 24,
+ (colour & 0x0000ff00) << 16,
+ (colour & 0x00ff0000) << 8,
+ NULL);
+
+ SetAPen(glob->rp, pen);
+ }
+}
+
bool ami_rectangle(int x0, int y0, int x1, int y1, const plot_style_t *style)
{
#ifdef AMI_PLOTTER_DEBUG
@@ -206,11 +234,10 @@ bool ami_rectangle(int x0, int y0, int x1, int y1, const
plot_style_t *style)
if (style->fill_type != PLOT_OP_TYPE_NONE) {
- if(nsoption_int(cairo_renderer) < 2)
+ if((nsoption_int(cairo_renderer) < 2) ||
+ (palette_mapped == true))
{
- SetRPAttrs(glob->rp, RPTAG_APenColor,
- p96EncodeColor(RGBFB_A8B8G8R8,
style->fill_colour),
- TAG_DONE);
+ ami_plot_setapen(style->fill_colour);
RectFill(glob->rp, x0, y0, x1-1, y1-1);
}
else
@@ -228,7 +255,8 @@ bool ami_rectangle(int x0, int y0, int x1, int y1, const
plot_style_t *style)
}
if (style->stroke_type != PLOT_OP_TYPE_NONE) {
- if(nsoption_int(cairo_renderer) < 2)
+ if((nsoption_int(cairo_renderer) < 2) ||
+ (palette_mapped == true))
{
glob->rp->PenWidth = style->stroke_width;
glob->rp->PenHeight = style->stroke_width;
--
NetSurf Browser
_______________________________________________
netsurf-commits mailing list
[email protected]
http://vlists.pepperfish.net/cgi-bin/mailman/listinfo/netsurf-commits-netsurf-browser.org