diff options
author | Michael Meeks <michael.meeks@collabora.com> | 2014-11-29 22:55:31 +0000 |
---|---|---|
committer | Markus Mohrhard <markus.mohrhard@collabora.co.uk> | 2014-12-02 08:34:52 +0100 |
commit | 5dcaefdae5ddf5ee70b4dd453afee69cdf8fc9d7 (patch) | |
tree | ce752cbbc6a3cddbd8a750bd2ea5a739e619cc36 /vcl/win | |
parent | c31ed7004dfb3e8e37ddeb9fddf0f015b661dd12 (diff) |
vcl: Consolidate size information around the GeometryProvider.
Conflicts:
vcl/inc/openglgdiimpl.hxx
Change-Id: I1d764a8dba1850d2475f08e1014a085846f336c3
Diffstat (limited to 'vcl/win')
-rw-r--r-- | vcl/win/source/gdi/salgdi.cxx | 4 | ||||
-rw-r--r-- | vcl/win/source/gdi/salprn.cxx | 2 | ||||
-rw-r--r-- | vcl/win/source/gdi/salvd.cxx | 11 | ||||
-rw-r--r-- | vcl/win/source/window/salframe.cxx | 4 |
4 files changed, 13 insertions, 8 deletions
diff --git a/vcl/win/source/gdi/salgdi.cxx b/vcl/win/source/gdi/salgdi.cxx index 4c36bb341468..c2d644dbb7a5 100644 --- a/vcl/win/source/gdi/salgdi.cxx +++ b/vcl/win/source/gdi/salgdi.cxx @@ -613,7 +613,7 @@ OpenGLTexture* OpenGLCompatibleDC::getTexture() return new OpenGLTexture(maRects.mnSrcWidth, maRects.mnSrcHeight, GL_BGRA, GL_UNSIGNED_BYTE, reinterpret_cast<sal_uInt8*>(mpData)); } -WinSalGraphics::WinSalGraphics(WinSalGraphics::Type eType, bool bScreen, HWND hWnd): +WinSalGraphics::WinSalGraphics(WinSalGraphics::Type eType, bool bScreen, HWND hWnd, SalGeometryProvider *pProvider): mhLocalDC(0), mbPrinter(eType == WinSalGraphics::PRINTER), mbVirDev(eType == WinSalGraphics::VIRTUAL_DEVICE), @@ -634,7 +634,7 @@ WinSalGraphics::WinSalGraphics(WinSalGraphics::Type eType, bool bScreen, HWND hW mnPenWidth(GSL_PEN_WIDTH) { if (OpenGLHelper::isVCLOpenGLEnabled() && !mbPrinter) - mpImpl.reset(new WinOpenGLSalGraphicsImpl(*this)); + mpImpl.reset(new WinOpenGLSalGraphicsImpl(*this, pProvider)); else mpImpl.reset(new WinSalGraphicsImpl(*this)); diff --git a/vcl/win/source/gdi/salprn.cxx b/vcl/win/source/gdi/salprn.cxx index ad22b4e817a2..78226624ddaa 100644 --- a/vcl/win/source/gdi/salprn.cxx +++ b/vcl/win/source/gdi/salprn.cxx @@ -1045,7 +1045,7 @@ static HDC ImplCreateSalPrnIC( WinSalInfoPrinter* pPrinter, ImplJobSetup* pSetup static WinSalGraphics* ImplCreateSalPrnGraphics( HDC hDC ) { - WinSalGraphics* pGraphics = new WinSalGraphics(WinSalGraphics::PRINTER, false, 0); + WinSalGraphics* pGraphics = new WinSalGraphics(WinSalGraphics::PRINTER, false, 0, /* CHECKME */ NULL); pGraphics->SetLayout( 0 ); pGraphics->setHDC(hDC); pGraphics->InitGraphics(); diff --git a/vcl/win/source/gdi/salvd.cxx b/vcl/win/source/gdi/salvd.cxx index cea8a768a36b..6758b098e112 100644 --- a/vcl/win/source/gdi/salvd.cxx +++ b/vcl/win/source/gdi/salvd.cxx @@ -105,7 +105,7 @@ SalVirtualDevice* WinSalInstance::CreateVirtualDevice( SalGraphics* pSGraphics, { WinSalVirtualDevice* pVDev = new WinSalVirtualDevice; SalData* pSalData = GetSalData(); - WinSalGraphics* pVirGraphics = new WinSalGraphics(WinSalGraphics::VIRTUAL_DEVICE, pGraphics->isScreen(), 0); + WinSalGraphics* pVirGraphics = new WinSalGraphics(WinSalGraphics::VIRTUAL_DEVICE, pGraphics->isScreen(), 0, pVDev); pVirGraphics->SetLayout( 0 ); // by default no! mirroring for VirtualDevices, can be enabled with EnableRTL() pVirGraphics->setHDC(hDC); if ( pSalData->mhDitherPal && pVirGraphics->isScreen() ) @@ -115,8 +115,8 @@ SalVirtualDevice* WinSalInstance::CreateVirtualDevice( SalGraphics* pSGraphics, } pVirGraphics->InitGraphics(); - mnWidth = nDX; - mnHeight = nDY; + pVDev->mnWidth = nDX; + pVDev->mnHeight = nDY; pVDev->setHDC(hDC); pVDev->mhBmp = hBmp; if( hBmp ) @@ -207,6 +207,9 @@ bool WinSalVirtualDevice::SetSize( long nDX, long nDY ) HBITMAP hNewBmp = ImplCreateVirDevBitmap(getHDC(), nDX, nDY, mnBitCount, &pDummy); if ( hNewBmp ) { + mnWidth = nDX; + mnHeight = nDY; + SelectBitmap( getHDC(), hNewBmp ); DeleteBitmap( mhBmp ); mhBmp = hNewBmp; @@ -215,6 +218,8 @@ bool WinSalVirtualDevice::SetSize( long nDX, long nDY ) else { ImplWriteLastError( GetLastError(), "ImplCreateVirDevBitmap in SetSize" ); + mnWidth = 0; + mnHeight = 0; return FALSE; } } diff --git a/vcl/win/source/window/salframe.cxx b/vcl/win/source/window/salframe.cxx index c8f5f3f7b917..a048e2eca72b 100644 --- a/vcl/win/source/window/salframe.cxx +++ b/vcl/win/source/window/salframe.cxx @@ -983,7 +983,7 @@ SalGraphics* WinSalFrame::AcquireGraphics() if ( !mpGraphics2 ) { - mpGraphics2 = new WinSalGraphics(WinSalGraphics::WINDOW, true, mhWnd); + mpGraphics2 = new WinSalGraphics(WinSalGraphics::WINDOW, true, mhWnd, this); mpGraphics2->setHDC(0); } @@ -1014,7 +1014,7 @@ SalGraphics* WinSalFrame::AcquireGraphics() HDC hDC = GetDC( mhWnd ); if ( hDC ) { - mpGraphics = new WinSalGraphics(WinSalGraphics::WINDOW, true, mhWnd); + mpGraphics = new WinSalGraphics(WinSalGraphics::WINDOW, true, mhWnd, this); mpGraphics->setHDC(hDC); if ( pSalData->mhDitherPal ) { |