diff options
Diffstat (limited to 'include')
-rw-r--r-- | include/cru/osx/graphics/quartz/Image.hpp | 2 | ||||
-rw-r--r-- | include/cru/osx/graphics/quartz/Painter.hpp | 2 | ||||
-rw-r--r-- | include/cru/platform/graphics/Base.hpp | 3 | ||||
-rw-r--r-- | include/cru/platform/graphics/NullPainter.hpp | 8 | ||||
-rw-r--r-- | include/cru/platform/graphics/Painter.hpp | 2 |
5 files changed, 15 insertions, 2 deletions
diff --git a/include/cru/osx/graphics/quartz/Image.hpp b/include/cru/osx/graphics/quartz/Image.hpp index 66d7dca0..16b1ca2c 100644 --- a/include/cru/osx/graphics/quartz/Image.hpp +++ b/include/cru/osx/graphics/quartz/Image.hpp @@ -17,6 +17,8 @@ class QuartzImage : public OsxQuartzResource, public virtual IImage { ~QuartzImage() override; public: + CGImageRef GetCGImage() const { return image_; } + private: CGImageRef image_; bool auto_release_ = false; diff --git a/include/cru/osx/graphics/quartz/Painter.hpp b/include/cru/osx/graphics/quartz/Painter.hpp index 83f15516..c88987a0 100644 --- a/include/cru/osx/graphics/quartz/Painter.hpp +++ b/include/cru/osx/graphics/quartz/Painter.hpp @@ -48,6 +48,8 @@ class QuartzCGContextPainter : public OsxQuartzResource, void DrawText(const Point& offset, ITextLayout* text_layout, IBrush* brush) override; + void DrawImage(const Rect& rect, IImage* image) override; + void PushLayer(const Rect& bounds) override; void PopLayer() override; diff --git a/include/cru/platform/graphics/Base.hpp b/include/cru/platform/graphics/Base.hpp index 3a18e39d..416f0df4 100644 --- a/include/cru/platform/graphics/Base.hpp +++ b/include/cru/platform/graphics/Base.hpp @@ -16,7 +16,6 @@ #define CRU_PLATFORM_GRAPHICS_API #endif - namespace cru::platform::graphics { // forward declarations struct IGraphicsFactory; @@ -25,6 +24,8 @@ struct ISolidColorBrush; struct IFont; struct IGeometry; struct IGeometryBuilder; +struct IImage; +struct IImageFactory; struct IPainter; struct ITextLayout; diff --git a/include/cru/platform/graphics/NullPainter.hpp b/include/cru/platform/graphics/NullPainter.hpp index b5c796d3..a47546b6 100644 --- a/include/cru/platform/graphics/NullPainter.hpp +++ b/include/cru/platform/graphics/NullPainter.hpp @@ -3,7 +3,8 @@ #include "cru/common/Base.hpp" namespace cru::platform::graphics { -class CRU_PLATFORM_GRAPHICS_API NullPainter : public Object, public virtual IPainter { +class CRU_PLATFORM_GRAPHICS_API NullPainter : public Object, + public virtual IPainter { public: NullPainter() = default; @@ -65,6 +66,11 @@ class CRU_PLATFORM_GRAPHICS_API NullPainter : public Object, public virtual IPai CRU_UNUSED(brush) } + void DrawImage(const Rect& rect, IImage* image) override { + CRU_UNUSED(rect) + CRU_UNUSED(image) + } + void PushLayer(const Rect& bounds) override { CRU_UNUSED(bounds) } void PopLayer() override {} diff --git a/include/cru/platform/graphics/Painter.hpp b/include/cru/platform/graphics/Painter.hpp index 4104a752..eb5bf8e1 100644 --- a/include/cru/platform/graphics/Painter.hpp +++ b/include/cru/platform/graphics/Painter.hpp @@ -27,6 +27,8 @@ struct CRU_PLATFORM_GRAPHICS_API IPainter : virtual IPlatformResource { virtual void DrawText(const Point& offset, ITextLayout* text_layout, IBrush* brush) = 0; + virtual void DrawImage(const Rect& rect, IImage* image) = 0; + virtual void PushLayer(const Rect& bounds) = 0; virtual void PopLayer() = 0; |