/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /* * This file is part of the LibreOffice project. * * This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this * file, You can obtain one at http://mozilla.org/MPL/2.0/. * * This file incorporates work covered by the following license notice: * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed * with this work for additional information regarding copyright * ownership. The ASF licenses this file to you under the Apache * License, Version 2.0 (the "License"); you may not use this file * except in compliance with the License. You may obtain a copy of * the License at http://www.apache.org/licenses/LICENSE-2.0 .
*/
SalGraphics* pGraphics; if ( !pOutDev->mpGraphics )
(void)pOutDev->AcquireGraphics();
pGraphics = pOutDev->mpGraphics; if ( pGraphics )
{ if (pData)
mpVirDev = pSVData->mpDefInst->CreateVirtualDevice(*pGraphics, nDX, nDY, meFormatAndAlpha, *pData); else
mpVirDev = pSVData->mpDefInst->CreateVirtualDevice(*pGraphics, nDX, nDY, meFormatAndAlpha);
} else
mpVirDev = nullptr; if ( !mpVirDev )
{ // do not abort but throw an exception, may be the current thread terminates anyway (plugin-scenario) throw css::uno::RuntimeException(
u"Could not create system bitmap!"_ustr,
css::uno::Reference< css::uno::XInterface >() );
}
if ( !mpVirDev ) returnfalse; elseif ( rNewSize == GetOutputSizePixel() )
{ if ( bErase )
Erase();
SAL_INFO( "vcl.virdev", "Trying to re-use a VirtualDevice but this time using a pre-allocated buffer"); returntrue;
}
// #i32109#: Fill opaque areas correctly (without relying on // fill/linecolor state) void VirtualDevice::ImplFillOpaqueRectangle( const tools::Rectangle& rRect )
{ // Set line and fill color to opaque, // fill rect with that (linecolor, too, because of // those pesky missing pixel problems)
Push( vcl::PushFlags::LINECOLOR | vcl::PushFlags::FILLCOLOR );
SetLineColor( COL_ALPHA_OPAQUE );
SetFillColor( COL_ALPHA_OPAQUE );
DrawRect( rRect );
Pop();
}
// TODO: copy full outdev state to new one, here. Also needed in outdev2.cxx:DrawOutDev if( GetLineColor() != COL_TRANSPARENT )
mpAlphaVDev->SetLineColor( COL_ALPHA_OPAQUE );
void VirtualDevice::EnableRTL( bool bEnable )
{ // virdevs default to not mirroring, they will only be set to mirroring // under rare circumstances in the UI, eg the valueset control // because each virdev has its own SalGraphics we can safely switch the SalGraphics here // ...hopefully if( AcquireGraphics() )
mpGraphics->SetLayout( bEnable ? SalLayoutFlags::BiDiRtl : SalLayoutFlags::NONE );
OutputDevice::EnableRTL(bEnable);
}
bool VirtualDevice::SetOutputSizePixelScaleOffsetAndLOKBuffer( const Size& rNewSize, const Fraction& rScale, const Point& rNewOffset,
sal_uInt8 *const pBuffer)
{ // If this is ever needed for something else than LOK, changes will // be needed in SvpSalVirtualDevice::CreateSurface() .
assert(comphelper::LibreOfficeKit::isActive());
assert(pBuffer);
MapMode mm = GetMapMode();
mm.SetOrigin( rNewOffset );
mm.SetScaleX( rScale );
mm.SetScaleY( rScale );
SetMapMode( mm );
assert(meFormatAndAlpha == DeviceFormat::WITHOUT_ALPHA);
assert(mpVirDev);
assert( rNewSize != GetOutputSizePixel() && "Trying to re-use a VirtualDevice but this time using a pre-allocated buffer");
assert( rNewSize.Width() >= 1 );
assert( rNewSize.Height() >= 1 );
// avoid adjusting font lists when already in refdev mode
RefDevMode nOldRefDevMode = meRefDevMode;
meRefDevMode = i_eRefDevMode; if( nOldRefDevMode != RefDevMode::NONE ) return;
// the reference device should have only scalable fonts // => clean up the original font lists before getting new ones
mpFontInstance.clear();
mpFontFaceCollection.reset();
// preserve global font lists
ImplSVData* pSVData = ImplGetSVData();
mxFontCollection.reset();
mxFontCache.reset();
// get font list with scalable fonts only
(void)AcquireGraphics();
mxFontCollection = pSVData->maGDIData.mxScreenFontList->Clone();
// prepare to use new font lists
mxFontCache = std::make_shared<ImplFontCache>();
}
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.