summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLuboš Luňák <l.lunak@collabora.com>2020-10-05 20:42:49 +0200
committerLuboš Luňák <l.lunak@collabora.com>2020-10-07 16:20:17 +0200
commitcc6941e8ce4a22cd7bdcdf1db72da02546b35fd2 (patch)
treea23d248306392aa43754380cc4881a60d4547d94
parentac2369cf0369da191ac970a6ed47d634a7fae0e7 (diff)
better way of ensuring Skia is used only with canvas that work
Most canvas implementations fall flat on their face when used with Skia for various reasons, such as assuming presence of cairo canvas or GDI bitmaps. I kind of already blocked them in b4c28826e0f8716583e7663ca2ea7a2, when I just copy&pasted the OpenGL case. That just selects the last implementation, which in reality appears to be always vclcanvas, which is probably just luck. Also this wouldn't work with more than one possible canvas implementation for Skia. Change-Id: If644abbaeed72f1a649f8974d00f564131aa9329 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/103784 Reviewed-by: Thorsten Behrens <Thorsten.Behrens@CIB.de> Tested-by: Jenkins
-rw-r--r--canvas/source/factory/cf_service.cxx10
1 files changed, 5 insertions, 5 deletions
diff --git a/canvas/source/factory/cf_service.cxx b/canvas/source/factory/cf_service.cxx
index 874b1ffe68bf..9bb75d5e26b0 100644
--- a/canvas/source/factory/cf_service.cxx
+++ b/canvas/source/factory/cf_service.cxx
@@ -304,8 +304,6 @@ Reference<XInterface> CanvasFactory::lookupAndUse(
if( OpenGLWrapper::isVCLOpenGLEnabled() )
bForceLastEntry = true;
#endif
- if( SkiaHelper::isVCLSkiaEnabled() )
- bForceLastEntry = true;
// use anti-aliasing canvas, if config flag set (or not existing)
bool bUseAAEntry(true);
@@ -379,10 +377,14 @@ Reference<XInterface> CanvasFactory::lookupAndUse(
if (bForceLastEntry && pCurrImpl != pEndImpl)
pCurrImpl = pEndImpl-1;
- while( pCurrImpl != pEndImpl )
+ for(; pCurrImpl != pEndImpl; ++pCurrImpl)
{
const OUString aCurrName(pCurrImpl->trim());
+ // Skia works only with vclcanvas.
+ if( SkiaHelper::isVCLSkiaEnabled() && !aCurrName.endsWith(".VCL"))
+ continue;
+
// check whether given canvas service is listed in the
// sequence of "accelerated canvas implementations"
const bool bIsAcceleratedImpl(
@@ -426,8 +428,6 @@ Reference<XInterface> CanvasFactory::lookupAndUse(
return xCanvas;
}
}
-
- ++pCurrImpl;
}
return Reference<XInterface>();