diff options
author | Tomaž Vajngerl <tomaz.vajngerl@collabora.co.uk> | 2015-09-02 22:47:50 +0900 |
---|---|---|
committer | Tomaž Vajngerl <tomaz.vajngerl@collabora.co.uk> | 2015-09-02 23:25:32 +0900 |
commit | 54962518fa2ca3860fcb4d2c772dea21b22a184e (patch) | |
tree | da43df4e2a71411af3617320a9d64f49ebcdeac3 /vcl | |
parent | 26e84b3852bbb9585fab76e8d3dba5dcd77f0357 (diff) |
tdf#93859 opengl - don't cache radiobuttons, refactor code dupl.
Radio buttons and check boxes can't be cached with current
framework as they have an additional rendering state provided in
additional data.
Refactor code to control which controls can be cached in one place
only.
Change-Id: I095a01cbf5dde013247d70ada89020f64c8c6510
Diffstat (limited to 'vcl')
-rw-r--r-- | vcl/opengl/win/gdiimpl.cxx | 2 | ||||
-rw-r--r-- | vcl/opengl/x11/gdiimpl.cxx | 2 | ||||
-rw-r--r-- | vcl/unx/gtk/gdi/salnativewidgets-gtk.cxx | 5 |
3 files changed, 6 insertions, 3 deletions
diff --git a/vcl/opengl/win/gdiimpl.cxx b/vcl/opengl/win/gdiimpl.cxx index 0b531141be17..6896a024ec7d 100644 --- a/vcl/opengl/win/gdiimpl.cxx +++ b/vcl/opengl/win/gdiimpl.cxx @@ -119,7 +119,7 @@ bool WinOpenGLSalGraphicsImpl::RenderAndCacheNativeControl(OpenGLCompatibleDC& r if (!bResult) return false; - if (aControlCacheKey.mnType == CTRL_CHECKBOX) + if (!aControlCacheKey.canCacheControl()) return true; ControlCachePair pair(aControlCacheKey, std::move(pCombo)); diff --git a/vcl/opengl/x11/gdiimpl.cxx b/vcl/opengl/x11/gdiimpl.cxx index 0663ce933d24..4c592842d9d8 100644 --- a/vcl/opengl/x11/gdiimpl.cxx +++ b/vcl/opengl/x11/gdiimpl.cxx @@ -235,7 +235,7 @@ bool X11OpenGLSalGraphicsImpl::RenderAndCacheNativeControl(X11Pixmap* pPixmap, X if (!bResult) return false; - if (aControlCacheKey.mnType == CTRL_CHECKBOX) + if (!aControlCacheKey.canCacheControl()) return true; ControlCachePair pair(aControlCacheKey, std::move(pCombo)); diff --git a/vcl/unx/gtk/gdi/salnativewidgets-gtk.cxx b/vcl/unx/gtk/gdi/salnativewidgets-gtk.cxx index 6a0768388693..6a0df252fdbd 100644 --- a/vcl/unx/gtk/gdi/salnativewidgets-gtk.cxx +++ b/vcl/unx/gtk/gdi/salnativewidgets-gtk.cxx @@ -904,8 +904,11 @@ bool GtkSalGraphics::drawNativeControl(ControlType nType, ControlPart nPart, Size( aCtrlRect.GetWidth()+2, aCtrlRect.GetHeight()+2) ); ControlCacheKey aControlCacheKey(nType, nPart, nState, aPixmapRect.GetSize()); - if (TryRenderCachedNativeControl(aControlCacheKey, aPixmapRect.Left(), aPixmapRect.Top())) + if (aControlCacheKey.canCacheControl() + && TryRenderCachedNativeControl(aControlCacheKey, aPixmapRect.Left(), aPixmapRect.Top())) + { return true; + } clipList aClip; int nPasses = 0; |