summaryrefslogtreecommitdiff
path: root/vcl/opengl
diff options
context:
space:
mode:
authorLuboš Luňák <l.lunak@collabora.com>2019-10-23 11:29:22 +0200
committerLuboš Luňák <l.lunak@collabora.com>2019-11-27 09:55:10 +0100
commit619959827003814053a5e9ec81acfd07b3aa270a (patch)
tree29d77c1bc8a45f5102b62d04211bedd3d0ae41c7 /vcl/opengl
parentc6b50a85a2371c1f49f75d1a9fccc8548e03e02f (diff)
implement pruning in SkiaGlobalWinGlyphCache
Currently based on identifying the SkBitmap's by their getPixels(), but this may need changed later since it's probably going to be more performant to use SkSurface. Also move the cache pruning out of AllocateTexture(), as that may possibly remove elements that would be used by DrawCachedGlyphs(). Change-Id: Ide2de752f634593b97573667af49b7aa9ec1f47f
Diffstat (limited to 'vcl/opengl')
-rw-r--r--vcl/opengl/win/winlayout.cxx9
1 files changed, 5 insertions, 4 deletions
diff --git a/vcl/opengl/win/winlayout.cxx b/vcl/opengl/win/winlayout.cxx
index ddc72c8b28cf..52569682af06 100644
--- a/vcl/opengl/win/winlayout.cxx
+++ b/vcl/opengl/win/winlayout.cxx
@@ -20,16 +20,17 @@ bool OpenGLGlobalWinGlyphCache::AllocateTexture(WinGlyphDrawElement& rElement, i
texture->texture = maPackedTextureAtlas.Reserve(nWidth, nHeight);
if (!texture->texture)
return false;
+ return true;
+}
+
+void OpenGLGlobalWinGlyphCache::Prune()
+{
std::vector<GLuint> aTextureIDs = maPackedTextureAtlas.ReduceTextureNumber(8);
if (!aTextureIDs.empty())
{
for (auto& pWinGlyphCache : maWinGlyphCaches)
- {
- assert(dynamic_cast<OpenGLWinGlyphCache*>(pWinGlyphCache));
static_cast<OpenGLWinGlyphCache*>(pWinGlyphCache)->RemoveTextures(aTextureIDs);
- }
}
- return true;
}
void OpenGLWinGlyphCache::RemoveTextures(std::vector<GLuint>& rTextureIDs)