diff options
author | Pierre Ossman <ossman@cendio.se> | 2024-09-02 22:58:35 +0200 |
---|---|---|
committer | Pierre Ossman <ossman@cendio.se> | 2024-11-06 21:06:27 +0100 |
commit | 1d9b2f9984fefbc050c8e3295397ffd280e41788 (patch) | |
tree | c6fa8a4f5e0e6fbc0e165c2bd80b2c81a48bf6bc /vncviewer/Surface_OSX.cxx | |
parent | 5c3588c464520a4757bfc20974090e21af220cdc (diff) | |
download | tigervnc-1d9b2f9984fefbc050c8e3295397ffd280e41788.tar.gz tigervnc-1d9b2f9984fefbc050c8e3295397ffd280e41788.zip |
Use standard exception classes
Use the more specific already included exception classes for common
errors to keep things more understandable.
Diffstat (limited to 'vncviewer/Surface_OSX.cxx')
-rw-r--r-- | vncviewer/Surface_OSX.cxx | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/vncviewer/Surface_OSX.cxx b/vncviewer/Surface_OSX.cxx index 673f37e9..dcc3d857 100644 --- a/vncviewer/Surface_OSX.cxx +++ b/vncviewer/Surface_OSX.cxx @@ -22,14 +22,14 @@ #include <assert.h> +#include <stdexcept> + #include <ApplicationServices/ApplicationServices.h> #include <FL/Fl_RGB_Image.H> #include <FL/Fl_Window.H> #include <FL/x.H> -#include <rdr/Exception.h> - #include "cocoa.h" #include "Surface.h" @@ -47,7 +47,7 @@ static CGImageRef create_image(CGColorSpaceRef lut, provider = CGDataProviderCreateWithData(nullptr, data, w * h * 4, nullptr); if (!provider) - throw rdr::Exception("CGDataProviderCreateWithData"); + throw std::runtime_error("CGDataProviderCreateWithData"); // FIXME: This causes a performance hit, but is necessary to avoid // artifacts in the edges of the window @@ -62,7 +62,7 @@ static CGImageRef create_image(CGColorSpaceRef lut, kCGRenderingIntentDefault); CGDataProviderRelease(provider); if (!image) - throw rdr::Exception("CGImageCreate"); + throw std::runtime_error("CGImageCreate"); return image; } @@ -85,7 +85,7 @@ static void render(CGContextRef gc, CGColorSpaceRef lut, subimage = CGImageCreateWithImageInRect(image, rect); if (!subimage) - throw rdr::Exception("CGImageCreateImageWithImageInRect"); + throw std::runtime_error("CGImageCreateImageWithImageInRect"); CGContextSaveGState(gc); @@ -112,7 +112,7 @@ static CGContextRef make_bitmap(int width, int height, unsigned char* data) bitmap = CGBitmapContextCreate(data, width, height, 8, width*4, srgb, kCGImageAlphaPremultipliedFirst | kCGBitmapByteOrder32Little); if (!bitmap) - throw rdr::Exception("CGBitmapContextCreate"); + throw std::runtime_error("CGBitmapContextCreate"); return bitmap; } |