namespace
{ // check for env var that decides for using downscale pattern constchar* pDisableDownScale(getenv("SAL_DISABLE_CAIRO_DOWNSCALE")); bool bDisableDownScale(nullptr != pDisableDownScale);
if (nullptr != pHelper)
{
cairo_surface_t* pSurface(pHelper->getSurface());
if (pSurface)
{ const tools::Long nStride(cairo_image_surface_get_stride(pSurface)); const tools::Long nHeight(cairo_image_surface_get_height(pSurface));
nRetval = nStride * nHeight;
// if we do downscale, size will grow by 1/4 + 1/16 + 1/32 + ..., // rough estimation just multiplies by 1.25, should be good enough // for estimation of buffer survival time if (!bDisableDownScale)
{
nRetval = (nRetval * 5) / 4;
}
}
}
if (bBufferSource)
{
pSystemDependentData_BitmapHelper
= rSourceBitmap.getSystemDependentData<SystemDependentData_BitmapHelper>(
basegfx::SDD_Type::SDDType_BitmapHelper);
if (pSystemDependentData_BitmapHelper)
{ // reuse buffered data
rSurface = pSystemDependentData_BitmapHelper->getBitmapHelper();
}
}
if (rSurface) return;
// create data on-demand
rSurface = std::make_shared<BitmapHelper>(rSourceBitmap);
if (bBufferSource)
{ // add to buffering mechanism to potentially reuse next time
rSourceBitmap.addOrReplaceSystemDependentData<SystemDependentData_BitmapHelper>(rSurface);
}
}
if (bBufferMask)
{
pSystemDependentData_MaskHelper
= rMaskBitmap.getSystemDependentData<SystemDependentData_MaskHelper>(
basegfx::SDD_Type::SDDType_MaskHelper);
if (pSystemDependentData_MaskHelper)
{ // reuse buffered data
rMask = pSystemDependentData_MaskHelper->getMaskHelper();
}
}
if (rMask) return;
// create data on-demand
rMask = std::make_shared<MaskHelper>(rMaskBitmap);
if (bBufferMask)
{ // add to buffering mechanism to potentially reuse next time
rMaskBitmap.addOrReplaceSystemDependentData<SystemDependentData_MaskHelper>(rMask);
}
}
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.