diff options
Diffstat (limited to 'cocoa')
-rw-r--r-- | cocoa/PlatCocoa.h | 3 | ||||
-rw-r--r-- | cocoa/PlatCocoa.mm | 10 |
2 files changed, 11 insertions, 2 deletions
diff --git a/cocoa/PlatCocoa.h b/cocoa/PlatCocoa.h index 8a47e7302..d6f2bf449 100644 --- a/cocoa/PlatCocoa.h +++ b/cocoa/PlatCocoa.h @@ -63,6 +63,9 @@ private: static const int BITS_PER_COMPONENT = 8; static const int BITS_PER_PIXEL = BITS_PER_COMPONENT * 4; static const int BYTES_PER_PIXEL = BITS_PER_PIXEL / 8; + + void Clear(); + public: SurfaceImpl(); ~SurfaceImpl() override; diff --git a/cocoa/PlatCocoa.mm b/cocoa/PlatCocoa.mm index c89a6f3aa..9c4d6a340 100644 --- a/cocoa/PlatCocoa.mm +++ b/cocoa/PlatCocoa.mm @@ -146,12 +146,12 @@ SurfaceImpl::SurfaceImpl() { //-------------------------------------------------------------------------------------------------- SurfaceImpl::~SurfaceImpl() { - Release(); + Clear(); } //-------------------------------------------------------------------------------------------------- -void SurfaceImpl::Release() { +void SurfaceImpl::Clear() { textLayout->setContext(nullptr); if (bitmapData) { bitmapData.reset(); @@ -169,6 +169,12 @@ void SurfaceImpl::Release() { //-------------------------------------------------------------------------------------------------- +void SurfaceImpl::Release() { + Clear(); +} + +//-------------------------------------------------------------------------------------------------- + bool SurfaceImpl::Initialised() { // We are initalised if the graphics context is not null return gc != NULL;// || port != NULL; |