Kaydet (Commit) 1b1c7501 authored tarafından Tomaž Vajngerl's avatar Tomaž Vajngerl Kaydeden (comit) Tomaž Vajngerl

macOS: store VirtualDevice size in an instance variable

Change-Id: Id0a7317e9aed4b0222affb7292f6a3a44af74040
Reviewed-on: https://gerrit.libreoffice.org/72438
Tested-by: Jenkins
Reviewed-by: 's avatarTomaž Vajngerl <quikee@gmail.com>
üst 356dd543
...@@ -44,6 +44,9 @@ private: ...@@ -44,6 +44,9 @@ private:
CGLayerRef mxLayer; // Quartz layer CGLayerRef mxLayer; // Quartz layer
AquaSalGraphics* mpGraphics; // current VirDev graphics AquaSalGraphics* mpGraphics; // current VirDev graphics
long mnWidth;
long mnHeight;
void Destroy(); void Destroy();
public: public:
...@@ -54,8 +57,15 @@ public: ...@@ -54,8 +57,15 @@ public:
virtual void ReleaseGraphics( SalGraphics* pGraphics ) override; virtual void ReleaseGraphics( SalGraphics* pGraphics ) override;
virtual bool SetSize( long nNewDX, long nNewDY ) override; virtual bool SetSize( long nNewDX, long nNewDY ) override;
virtual long GetWidth() const override; long GetWidth() const override
virtual long GetHeight() const override; {
return mnWidth;
}
long GetHeight() const override
{
return mnHeight;
}
}; };
#endif // INCLUDED_VCL_INC_QUARTZ_SALVD_H #endif // INCLUDED_VCL_INC_QUARTZ_SALVD_H
......
...@@ -68,6 +68,8 @@ AquaSalVirtualDevice::AquaSalVirtualDevice( AquaSalGraphics* pGraphic, long &nDX ...@@ -68,6 +68,8 @@ AquaSalVirtualDevice::AquaSalVirtualDevice( AquaSalGraphics* pGraphic, long &nDX
, mxBitmapContext( nullptr ) , mxBitmapContext( nullptr )
, mnBitmapDepth( 0 ) , mnBitmapDepth( 0 )
, mxLayer( nullptr ) , mxLayer( nullptr )
, mnWidth(0)
, mnHeight(0)
{ {
SAL_INFO( "vcl.virdev", "AquaSalVirtualDevice::AquaSalVirtualDevice() this=" << this SAL_INFO( "vcl.virdev", "AquaSalVirtualDevice::AquaSalVirtualDevice() this=" << this
<< " size=(" << nDX << "x" << nDY << ") bitcount=" << static_cast<int>(eFormat) << << " size=(" << nDX << "x" << nDY << ") bitcount=" << static_cast<int>(eFormat) <<
...@@ -228,6 +230,9 @@ bool AquaSalVirtualDevice::SetSize( long nDX, long nDY ) ...@@ -228,6 +230,9 @@ bool AquaSalVirtualDevice::SetSize( long nDX, long nDY )
Destroy(); Destroy();
mnWidth = nDX;
mnHeight = nDY;
// create a Quartz layer matching to the intended virdev usage // create a Quartz layer matching to the intended virdev usage
CGContextRef xCGContext = nullptr; CGContextRef xCGContext = nullptr;
if( mnBitmapDepth && (mnBitmapDepth < 16) ) if( mnBitmapDepth && (mnBitmapDepth < 16) )
...@@ -305,16 +310,4 @@ bool AquaSalVirtualDevice::SetSize( long nDX, long nDY ) ...@@ -305,16 +310,4 @@ bool AquaSalVirtualDevice::SetSize( long nDX, long nDY )
return (mxLayer != nullptr); return (mxLayer != nullptr);
} }
long AquaSalVirtualDevice::GetWidth() const
{
const CGSize aSize = CGLayerGetSize( mxLayer );
return aSize.width;
}
long AquaSalVirtualDevice::GetHeight() const
{
const CGSize aSize = CGLayerGetSize( mxLayer );
return aSize.height;
}
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment