summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChris Young <chris@unsatisfactorysoftware.co.uk>2016-10-23 19:31:43 +0100
committerChris Young <chris@unsatisfactorysoftware.co.uk>2016-10-23 19:31:43 +0100
commitf814edee75db5158f8fbb1930e25e0877d5448de (patch)
tree482878403d9559d2071f3712b48ed27f5c0a7717
parent90541333c052b1c89a3f97c1adecf62aeb178668 (diff)
downloadnetsurf-f814edee75db5158f8fbb1930e25e0877d5448de.tar.gz
netsurf-f814edee75db5158f8fbb1930e25e0877d5448de.tar.bz2
Disable triangle mode for bitmap scaling
Potential workaround for #2478
-rw-r--r--frontends/amiga/bitmap.c16
1 files changed, 14 insertions, 2 deletions
diff --git a/frontends/amiga/bitmap.c b/frontends/amiga/bitmap.c
index 3dbe3ddce..8c691eded 100644
--- a/frontends/amiga/bitmap.c
+++ b/frontends/amiga/bitmap.c
@@ -57,6 +57,11 @@
#include "amiga/misc.h"
#include "amiga/rtg.h"
+// disable use of "triangle mode" for scaling
+#ifdef AMI_NS_TRIANGLE_SCALING
+#undef AMI_NS_TRIANGLE_SCALING
+#endif
+
struct bitmap {
int width;
int height;
@@ -510,13 +515,17 @@ static inline struct BitMap *ami_bitmap_get_generic(struct bitmap *bitmap,
(type == AMI_NSBM_TRUECOLOUR)), 1)) {
/* AutoDoc says v52, but this function isn't in OS4.0, so checking for v53 (OS4.1)
* Additionally, when we use friend BitMaps in non 32-bit modes it freezes the OS */
+
+ uint32 flags = 0;
+ uint32 err = COMPERR_Success;
+#ifdef AMI_NS_TRIANGLE_SCALING
struct vertex vtx[6];
VTX_RECT(0, 0, bitmap->width, bitmap->height, 0, 0, width, height);
- uint32 flags = COMPFLAG_HardwareOnly;
+ flags = COMPFLAG_HardwareOnly;
if(nsoption_bool(scale_quality) == true) flags |= COMPFLAG_SrcFilter;
- uint32 err = CompositeTags(COMPOSITE_Src, tbm, scaledbm,
+ err = CompositeTags(COMPOSITE_Src, tbm, scaledbm,
COMPTAG_VertexArray, vtx,
COMPTAG_VertexFormat, COMPVF_STW0_Present,
COMPTAG_NumTriangles, 2,
@@ -527,6 +536,9 @@ static inline struct BitMap *ami_bitmap_get_generic(struct bitmap *bitmap,
if (err != COMPERR_Success) {
LOG("Composite error %ld - falling back", err);
/* If it failed, do it again the way which works in software */
+#else
+ {
+#endif
flags = 0;
if(nsoption_bool(scale_quality) == true) flags |= COMPFLAG_SrcFilter;