diff options
Diffstat (limited to 'src/platform/graphics/quartz')
| -rw-r--r-- | src/platform/graphics/quartz/Factory.cpp | 2 | ||||
| -rw-r--r-- | src/platform/graphics/quartz/Image.cpp | 2 | ||||
| -rw-r--r-- | src/platform/graphics/quartz/ImageFactory.cpp | 12 | ||||
| -rw-r--r-- | src/platform/graphics/quartz/Painter.cpp | 24 | ||||
| -rw-r--r-- | src/platform/graphics/quartz/TextLayout.cpp | 2 |
5 files changed, 21 insertions, 21 deletions
diff --git a/src/platform/graphics/quartz/Factory.cpp b/src/platform/graphics/quartz/Factory.cpp index 862c0966..5d5b48b5 100644 --- a/src/platform/graphics/quartz/Factory.cpp +++ b/src/platform/graphics/quartz/Factory.cpp @@ -33,7 +33,7 @@ std::unique_ptr<IFont> QuartzGraphicsFactory::CreateFont(String font_family, std::unique_ptr<ITextLayout> QuartzGraphicsFactory::CreateTextLayout( std::shared_ptr<IFont> font, String text) { - auto f = CheckPlatform<OsxCTFont>(font, GetPlatformId()); + auto f = CheckPlatform<OsxCTFont>(font, GetPlatformIdUtf8()); return std::make_unique<OsxCTTextLayout>(this, f, text); } diff --git a/src/platform/graphics/quartz/Image.cpp b/src/platform/graphics/quartz/Image.cpp index 966ce6be..d4ccd416 100644 --- a/src/platform/graphics/quartz/Image.cpp +++ b/src/platform/graphics/quartz/Image.cpp @@ -35,7 +35,7 @@ std::unique_ptr<IImage> QuartzImage::CreateWithRect(const Rect& rect) { std::unique_ptr<IPainter> QuartzImage::CreatePainter() { if (!buffer_) throw Exception( - u"Failed to create painter for image because failed to get its " + "Failed to create painter for image because failed to get its " u"buffer."); auto width = CGImageGetWidth(image_); diff --git a/src/platform/graphics/quartz/ImageFactory.cpp b/src/platform/graphics/quartz/ImageFactory.cpp index 93e452e1..62229bcb 100644 --- a/src/platform/graphics/quartz/ImageFactory.cpp +++ b/src/platform/graphics/quartz/ImageFactory.cpp @@ -39,17 +39,17 @@ static String GetImageFormatUniformTypeIdentifier(ImageFormat format) { case ImageFormat::Gif: return u"com.compuserve.gif"; default: - throw Exception(u"Unknown image format."); + throw Exception("Unknown image format."); } } void QuartzImageFactory::EncodeToStream(IImage* image, io::Stream* stream, ImageFormat format, float quality) { if (quality <= 0 || quality > 1) { - throw Exception(u"Invalid quality value."); + throw Exception("Invalid quality value."); } - auto quartz_image = CheckPlatform<QuartzImage>(image, GetPlatformId()); + auto quartz_image = CheckPlatform<QuartzImage>(image, GetPlatformIdUtf8()); auto cg_image = quartz_image->GetCGImage(); auto uti = ToCFString(GetImageFormatUniformTypeIdentifier(format)); @@ -67,7 +67,7 @@ void QuartzImageFactory::EncodeToStream(IImage* image, io::Stream* stream, CGImageDestinationAddImage(destination, cg_image, properties); if (!CGImageDestinationFinalize(destination)) { - throw Exception(u"Failed to finalize image destination."); + throw Exception("Failed to finalize image destination."); } CFRelease(quality_wrap); @@ -78,8 +78,8 @@ void QuartzImageFactory::EncodeToStream(IImage* image, io::Stream* stream, std::unique_ptr<IImage> QuartzImageFactory::CreateBitmap(int width, int height) { - if (width <= 0) throw Exception(u"Image width should be greater than 0."); - if (height <= 0) throw Exception(u"Image height should be greater than 0."); + if (width <= 0) throw Exception("Image width should be greater than 0."); + if (height <= 0) throw Exception("Image height should be greater than 0."); CGColorSpaceRef color_space = CGColorSpaceCreateDeviceRGB(); diff --git a/src/platform/graphics/quartz/Painter.cpp b/src/platform/graphics/quartz/Painter.cpp index 69e187c3..fe0f5d43 100644 --- a/src/platform/graphics/quartz/Painter.cpp +++ b/src/platform/graphics/quartz/Painter.cpp @@ -66,7 +66,7 @@ void QuartzCGContextPainter::DrawLine(const Point& start, const Point& end, CGContextMoveToPoint(cg_context_, start.x, start.y); CGContextAddLineToPoint(cg_context_, end.x, end.y); - QuartzBrush* b = CheckPlatform<QuartzBrush>(brush, GetPlatformId()); + QuartzBrush* b = CheckPlatform<QuartzBrush>(brush, GetPlatformIdUtf8()); b->Select(cg_context_); SetLineWidth(width); @@ -77,7 +77,7 @@ void QuartzCGContextPainter::StrokeRectangle(const Rect& rectangle, IBrush* brush, float width) { Validate(); - QuartzBrush* b = CheckPlatform<QuartzBrush>(brush, GetPlatformId()); + QuartzBrush* b = CheckPlatform<QuartzBrush>(brush, GetPlatformIdUtf8()); b->Select(cg_context_); CGContextStrokeRectWithWidth(cg_context_, Convert(rectangle), width); } @@ -86,7 +86,7 @@ void QuartzCGContextPainter::FillRectangle(const Rect& rectangle, IBrush* brush) { Validate(); - QuartzBrush* b = CheckPlatform<QuartzBrush>(brush, GetPlatformId()); + QuartzBrush* b = CheckPlatform<QuartzBrush>(brush, GetPlatformIdUtf8()); b->Select(cg_context_); CGContextFillRect(cg_context_, Convert(rectangle)); } @@ -95,7 +95,7 @@ void QuartzCGContextPainter::StrokeEllipse(const Rect& outline_rect, IBrush* brush, float width) { Validate(); - QuartzBrush* b = CheckPlatform<QuartzBrush>(brush, GetPlatformId()); + QuartzBrush* b = CheckPlatform<QuartzBrush>(brush, GetPlatformIdUtf8()); b->Select(cg_context_); SetLineWidth(width); @@ -106,7 +106,7 @@ void QuartzCGContextPainter::FillEllipse(const Rect& outline_rect, IBrush* brush) { Validate(); - QuartzBrush* b = CheckPlatform<QuartzBrush>(brush, GetPlatformId()); + QuartzBrush* b = CheckPlatform<QuartzBrush>(brush, GetPlatformIdUtf8()); b->Select(cg_context_); CGContextFillEllipseInRect(cg_context_, Convert(outline_rect)); } @@ -115,8 +115,8 @@ void QuartzCGContextPainter::StrokeGeometry(IGeometry* geometry, IBrush* brush, float width) { Validate(); - QuartzGeometry* g = CheckPlatform<QuartzGeometry>(geometry, GetPlatformId()); - QuartzBrush* b = CheckPlatform<QuartzBrush>(brush, GetPlatformId()); + QuartzGeometry* g = CheckPlatform<QuartzGeometry>(geometry, GetPlatformIdUtf8()); + QuartzBrush* b = CheckPlatform<QuartzBrush>(brush, GetPlatformIdUtf8()); b->Select(cg_context_); SetLineWidth(width); @@ -129,8 +129,8 @@ void QuartzCGContextPainter::StrokeGeometry(IGeometry* geometry, IBrush* brush, void QuartzCGContextPainter::FillGeometry(IGeometry* geometry, IBrush* brush) { Validate(); - QuartzGeometry* g = CheckPlatform<QuartzGeometry>(geometry, GetPlatformId()); - QuartzBrush* b = CheckPlatform<QuartzBrush>(brush, GetPlatformId()); + QuartzGeometry* g = CheckPlatform<QuartzGeometry>(geometry, GetPlatformIdUtf8()); + QuartzBrush* b = CheckPlatform<QuartzBrush>(brush, GetPlatformIdUtf8()); b->Select(cg_context_); CGContextBeginPath(cg_context_); @@ -142,7 +142,7 @@ void QuartzCGContextPainter::DrawText(const Point& offset, ITextLayout* text_layout, IBrush* brush) { Validate(); - auto tl = CheckPlatform<OsxCTTextLayout>(text_layout, GetPlatformId()); + auto tl = CheckPlatform<OsxCTTextLayout>(text_layout, GetPlatformIdUtf8()); Color color; @@ -169,7 +169,7 @@ void QuartzCGContextPainter::DrawText(const Point& offset, void QuartzCGContextPainter::DrawImage(const Point& offset, IImage* image) { Validate(); - auto i = CheckPlatform<QuartzImage>(image, GetPlatformId()); + auto i = CheckPlatform<QuartzImage>(image, GetPlatformIdUtf8()); auto cg_image = i->GetCGImage(); @@ -225,6 +225,6 @@ void QuartzCGContextPainter::DoEndDraw() { void QuartzCGContextPainter::Validate() { if (cg_context_ == nullptr) - throw ReuseException(u"QuartzCGContextPainter has already be released."); + throw ReuseException("QuartzCGContextPainter has already be released."); } } // namespace cru::platform::graphics::quartz diff --git a/src/platform/graphics/quartz/TextLayout.cpp b/src/platform/graphics/quartz/TextLayout.cpp index 8c573c7a..41a2f176 100644 --- a/src/platform/graphics/quartz/TextLayout.cpp +++ b/src/platform/graphics/quartz/TextLayout.cpp @@ -31,7 +31,7 @@ OsxCTTextLayout::~OsxCTTextLayout() { } void OsxCTTextLayout::SetFont(std::shared_ptr<IFont> font) { - font_ = CheckPlatform<OsxCTFont>(font, GetPlatformId()); + font_ = CheckPlatform<OsxCTFont>(font, GetPlatformIdUtf8()); RecreateFrame(); } |
