diff options
Diffstat (limited to 'vncviewer/Surface_X11.cxx')
-rw-r--r-- | vncviewer/Surface_X11.cxx | 32 |
1 files changed, 18 insertions, 14 deletions
diff --git a/vncviewer/Surface_X11.cxx b/vncviewer/Surface_X11.cxx index 7725cb5b..d27fcd26 100644 --- a/vncviewer/Surface_X11.cxx +++ b/vncviewer/Surface_X11.cxx @@ -43,20 +43,22 @@ void Surface::clear(unsigned char r, unsigned char g, unsigned char b, unsigned 0, 0, width(), height()); } -void Surface::draw(int src_x, int src_y, int x, int y, int w, int h) +void Surface::draw(int src_x, int src_y, int dst_x, int dst_y, + int dst_w, int dst_h) { Picture winPict; - winPict = XRenderCreatePicture(fl_display, fl_window, visFormat, 0, NULL); + winPict = XRenderCreatePicture(fl_display, fl_window, visFormat, 0, nullptr); XRenderComposite(fl_display, PictOpSrc, picture, None, winPict, - src_x, src_y, 0, 0, x, y, w, h); + src_x, src_y, 0, 0, dst_x, dst_y, dst_w, dst_h); XRenderFreePicture(fl_display, winPict); } -void Surface::draw(Surface* dst, int src_x, int src_y, int x, int y, int w, int h) +void Surface::draw(Surface* dst, int src_x, int src_y, + int dst_x, int dst_y, int dst_w, int dst_h) { XRenderComposite(fl_display, PictOpSrc, picture, None, dst->picture, - src_x, src_y, 0, 0, x, y, w, h); + src_x, src_y, 0, 0, dst_x, dst_y, dst_w, dst_h); } static Picture alpha_mask(int a) @@ -86,27 +88,29 @@ static Picture alpha_mask(int a) return pict; } -void Surface::blend(int src_x, int src_y, int x, int y, int w, int h, int a) +void Surface::blend(int src_x, int src_y, int dst_x, int dst_y, + int dst_w, int dst_h, int a) { Picture winPict, alpha; - winPict = XRenderCreatePicture(fl_display, fl_window, visFormat, 0, NULL); + winPict = XRenderCreatePicture(fl_display, fl_window, visFormat, 0, nullptr); alpha = alpha_mask(a); XRenderComposite(fl_display, PictOpOver, picture, alpha, winPict, - src_x, src_y, 0, 0, x, y, w, h); + src_x, src_y, 0, 0, dst_x, dst_y, dst_w, dst_h); XRenderFreePicture(fl_display, winPict); if (alpha != None) XRenderFreePicture(fl_display, alpha); } -void Surface::blend(Surface* dst, int src_x, int src_y, int x, int y, int w, int h, int a) +void Surface::blend(Surface* dst, int src_x, int src_y, + int dst_x, int dst_y, int dst_w, int dst_h, int a) { Picture alpha; alpha = alpha_mask(a); XRenderComposite(fl_display, PictOpOver, picture, alpha, dst->picture, - src_x, src_y, 0, 0, x, y, w, h); + src_x, src_y, 0, 0, dst_x, dst_y, dst_w, dst_h); if (alpha != None) XRenderFreePicture(fl_display, alpha); } @@ -154,7 +158,7 @@ void Surface::alloc() if (!format) throw rdr::Exception("XRenderFindFormat"); - picture = XRenderCreatePicture(fl_display, pixmap, format, 0, NULL); + picture = XRenderCreatePicture(fl_display, pixmap, format, 0, nullptr); visFormat = XRenderFindVisualFormat(fl_display, fl_visual->visual); } @@ -177,8 +181,8 @@ void Surface::update(const Fl_RGB_Image* image) assert(image->w() == width()); assert(image->h() == height()); - img = XCreateImage(fl_display, CopyFromParent, 32, - ZPixmap, 0, NULL, width(), height(), + img = XCreateImage(fl_display, (Visual*)CopyFromParent, 32, + ZPixmap, 0, nullptr, width(), height(), 32, 0); if (!img) throw rdr::Exception("XCreateImage"); @@ -224,7 +228,7 @@ void Surface::update(const Fl_RGB_Image* image) in += image->ld() - image->w() * image->d(); } - gc = XCreateGC(fl_display, pixmap, 0, NULL); + gc = XCreateGC(fl_display, pixmap, 0, nullptr); XPutImage(fl_display, pixmap, gc, img, 0, 0, 0, 0, img->width, img->height); XFreeGC(fl_display, gc); |