summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChris Young <chris@unsatisfactorysoftware.co.uk>2012-08-05 15:29:20 +0100
committerChris Young <chris@unsatisfactorysoftware.co.uk>2012-08-05 15:29:20 +0100
commit74e794d7a25db2c245120ce4d7b98fb6ff9e8d15 (patch)
tree22417b560c7a14df8b9f8678c7cf2c2cd9a721af
parentc359b9400b720f9ee175154a1ffa542b5ccc2d97 (diff)
downloadnetsurf-74e794d7a25db2c245120ce4d7b98fb6ff9e8d15.tar.gz
netsurf-74e794d7a25db2c245120ce4d7b98fb6ff9e8d15.tar.bz2
implement scaling
-rw-r--r--amiga/bitmap.c23
1 files changed, 21 insertions, 2 deletions
diff --git a/amiga/bitmap.c b/amiga/bitmap.c
index 5377adf3c..d8f11b8ed 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;
}