summaryrefslogtreecommitdiff
path: root/src/haiku_draw_support.cc
diff options
context:
space:
mode:
authorPo Lu <luangruo@yahoo.com>2022-06-25 07:34:43 +0000
committerPo Lu <luangruo@yahoo.com>2022-06-25 07:35:45 +0000
commit230891d9f33644146cf1e962824618256374eadc (patch)
tree6f3ac2d902b90c4147feab1d2b918932a87c31ad /src/haiku_draw_support.cc
parent1754b0df75701cadb264b2c3ae829893f1a04327 (diff)
Implement image transform smoothing on Haiku
* src/dispextern.h (struct image): New field `use_bilinear_filtering'. * src/haiku_draw_support.cc (BView_DrawBitmap): Accept it. * src/haiku_support.h: Update prototypes. * src/haikuterm.c (haiku_draw_image_glyph_string): * src/image.c (image_set_transform): Set it.
Diffstat (limited to 'src/haiku_draw_support.cc')
-rw-r--r--src/haiku_draw_support.cc11
1 files changed, 8 insertions, 3 deletions
diff --git a/src/haiku_draw_support.cc b/src/haiku_draw_support.cc
index 768ffdabf82..e2025ed68d4 100644
--- a/src/haiku_draw_support.cc
+++ b/src/haiku_draw_support.cc
@@ -280,14 +280,19 @@ hsl_color_rgb (double h, double s, double l, uint32_t *rgb)
void
BView_DrawBitmap (void *view, void *bitmap, int x, int y,
int width, int height, int vx, int vy, int vwidth,
- int vheight)
+ int vheight, bool use_bilinear_filtering)
{
BView *vw = get_view (view);
BBitmap *bm = (BBitmap *) bitmap;
vw->SetDrawingMode (B_OP_OVER);
- vw->DrawBitmap (bm, BRect (x, y, x + width - 1, y + height - 1),
- BRect (vx, vy, vx + vwidth - 1, vy + vheight - 1));
+ if (!use_bilinear_filtering)
+ vw->DrawBitmap (bm, BRect (x, y, x + width - 1, y + height - 1),
+ BRect (vx, vy, vx + vwidth - 1, vy + vheight - 1));
+ else
+ vw->DrawBitmap (bm, BRect (x, y, x + width - 1, y + height - 1),
+ BRect (vx, vy, vx + vwidth - 1, vy + vheight - 1),
+ B_FILTER_BITMAP_BILINEAR);
vw->SetDrawingMode (B_OP_COPY);
}