diff options
Diffstat (limited to 'vcl/win/source/gdi')
-rw-r--r-- | vcl/win/source/gdi/gdiimpl.cxx | 14 | ||||
-rw-r--r-- | vcl/win/source/gdi/gdiimpl.hxx | 6 | ||||
-rw-r--r-- | vcl/win/source/gdi/salnativewidgets-luna.cxx | 25 |
3 files changed, 30 insertions, 15 deletions
diff --git a/vcl/win/source/gdi/gdiimpl.cxx b/vcl/win/source/gdi/gdiimpl.cxx index 16b7d4b1d576..e4823a2c6452 100644 --- a/vcl/win/source/gdi/gdiimpl.cxx +++ b/vcl/win/source/gdi/gdiimpl.cxx @@ -17,11 +17,12 @@ * the License at http://www.apache.org/licenses/LICENSE-2.0 . */ +#include <svsys.h> + #include "gdiimpl.hxx" #include <stdio.h> #include <string.h> -#include <svsys.h> #include <rtl/strbuf.hxx> #include <tools/debug.hxx> #include <tools/poly.hxx> @@ -2377,4 +2378,15 @@ bool WinSalGraphicsImpl::drawGradient(const tools::PolyPolygon& /*rPolygon*/, return false; } +bool WinSalGraphicsImpl::TryRenderCachedNativeControl(ControlCacheKey& /*rControlCacheKey*/, int /*nX*/, int /*nY*/) +{ + return false; +} + +bool WinSalGraphicsImpl::RenderAndCacheNativeControl(OpenGLCompatibleDC& /*rWhite*/, OpenGLCompatibleDC& /*rBlack*/, + int /*nX*/, int /*nY*/ , ControlCacheKey& /*aControlCacheKey*/) +{ + return false; +} + /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/vcl/win/source/gdi/gdiimpl.hxx b/vcl/win/source/gdi/gdiimpl.hxx index 2890664406be..82a8333eb49f 100644 --- a/vcl/win/source/gdi/gdiimpl.hxx +++ b/vcl/win/source/gdi/gdiimpl.hxx @@ -18,6 +18,7 @@ */ #include "salgdiimpl.hxx" +#include "win/salgdi.h" #include <vcl/gradient.hxx> @@ -226,6 +227,11 @@ public: virtual void beginPaint() SAL_OVERRIDE { } virtual void endPaint() SAL_OVERRIDE { } + + virtual bool TryRenderCachedNativeControl(ControlCacheKey& rControlCacheKey, int nX, int nY); + + virtual bool RenderAndCacheNativeControl(OpenGLCompatibleDC& rWhite, OpenGLCompatibleDC& rBlack, + int nX, int nY , ControlCacheKey& aControlCacheKey); }; /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/vcl/win/source/gdi/salnativewidgets-luna.cxx b/vcl/win/source/gdi/salnativewidgets-luna.cxx index 7d545b02c4d4..ec3d79f44972 100644 --- a/vcl/win/source/gdi/salnativewidgets-luna.cxx +++ b/vcl/win/source/gdi/salnativewidgets-luna.cxx @@ -1170,6 +1170,16 @@ bool WinSalGraphics::drawNativeControl( ControlType nType, bool bOk = false; HTHEME hTheme = NULL; + Rectangle buttonRect = rControlRegion; + + WinOpenGLSalGraphicsImpl* pImpl = dynamic_cast<WinOpenGLSalGraphicsImpl*>(mpImpl.get()); + + ControlCacheKey aControlCacheKey(nType, nPart, nState, buttonRect.GetSize()); + if (pImpl != NULL && pImpl->TryRenderCachedNativeControl(aControlCacheKey, buttonRect.Left(), buttonRect.Top())) + { + return true; + } + switch( nType ) { case CTRL_PUSHBUTTON: @@ -1256,7 +1266,6 @@ bool WinSalGraphics::drawNativeControl( ControlType nType, if( !hTheme ) return false; - Rectangle buttonRect = rControlRegion; RECT rc; rc.left = buttonRect.Left(); rc.right = buttonRect.Right()+1; @@ -1265,7 +1274,6 @@ bool WinSalGraphics::drawNativeControl( ControlType nType, OUString aCaptionStr(aCaption.replace('~', '&')); // translate mnemonics - WinOpenGLSalGraphicsImpl *pImpl = dynamic_cast<WinOpenGLSalGraphicsImpl*>(mpImpl.get()); if (pImpl == NULL) { // set default text alignment @@ -1290,18 +1298,7 @@ bool WinSalGraphics::drawNativeControl( ControlType nType, if (ImplDrawNativeControl(aBlackDC.getCompatibleHDC(), hTheme, rc, nType, nPart, nState, aValue, aCaptionStr) && ImplDrawNativeControl(aWhiteDC.getCompatibleHDC(), hTheme, rc, nType, nPart, nState, aValue, aCaptionStr)) { - pImpl->PreDraw(); - - std::unique_ptr<OpenGLTexture> xBlackTexture(aBlackDC.getTexture()); - std::unique_ptr<OpenGLTexture> xWhiteTexture(aWhiteDC.getTexture()); - - if (xBlackTexture && xWhiteTexture) - { - pImpl->DrawTextureDiff(*xWhiteTexture, *xBlackTexture, aBlackDC.getTwoRect()); - bOk = true; - } - - pImpl->PostDraw(); + bOk = pImpl->RenderAndCacheNativeControl(aWhiteDC, aBlackDC, buttonRect.Left(), buttonRect.Top(), aControlCacheKey); } } |