LibreOffice Module vcl (master)  1
win/gdiimpl.hxx
Go to the documentation of this file.
1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /*
3  * This file is part of the LibreOffice project.
4  *
5  * This Source Code Form is subject to the terms of the Mozilla Public
6  * License, v. 2.0. If a copy of the MPL was not distributed with this
7  * file, You can obtain one at http://mozilla.org/MPL/2.0/.
8  */
9 
10 #ifndef INCLUDED_VCL_INC_OPENGL_WIN_GDIIMPL_HXX
11 #define INCLUDED_VCL_INC_OPENGL_WIN_GDIIMPL_HXX
12 
13 #include <memory>
14 #include <vcl/dllapi.h>
15 
16 #include <openglgdiimpl.hxx>
17 #include <svdata.hxx>
18 #include <win/salgdi.h>
19 #include <o3tl/lru_map.hxx>
21 #include <ControlCacheKey.hxx>
22 
24 {
25  friend class WinLayout;
26 private:
28 
30  int nX, int nY, TextureCombo& rCombo);
31 
32 public:
35 
36 protected:
38 
39  bool RenderTextureCombo(TextureCombo const & rCombo, int nX, int nY);
40 
41 public:
42  virtual void Init() override;
43  virtual void copyBits( const SalTwoRect& rPosAry, SalGraphics* pSrcGraphics ) override;
44 
45 
46  bool TryRenderCachedNativeControl(ControlCacheKey const & rControlCacheKey, int nX, int nY);
47 
49  int nX, int nY , ControlCacheKey& aControlCacheKey);
50 
51 };
52 
54 {
55  std::size_t operator()(ControlCacheKey const& aCache) const
56  {
57  std::size_t seed = 0;
58  boost::hash_combine(seed, aCache.mnType);
59  boost::hash_combine(seed, aCache.mnPart);
60  boost::hash_combine(seed, aCache.mnState);
61  boost::hash_combine(seed, aCache.maSize.Width());
62  boost::hash_combine(seed, aCache.maSize.Height());
63  return seed;
64  }
65 };
66 
67 typedef std::pair<ControlCacheKey, std::unique_ptr<TextureCombo>> ControlCachePair;
69 
72 
74 
75 public:
76  static ControlCacheType & get();
77 };
78 
79 #endif
80 
81 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
Interface used to share logic on sizing between SalVirtualDevices and SalFrames.
Definition: salgeom.hxx:62
std::pair< ControlCacheKey, std::unique_ptr< TextureCombo > > ControlCachePair
Definition: win/gdiimpl.hxx:67
long Width() const
SalGeometryProvider * mpProvider
Pointer to the SalFrame or SalVirtualDevice.
long Height() const
bool RenderAndCacheNativeControl(OpenGLCompatibleDC &rWhite, OpenGLCompatibleDC &rBlack, int nX, int nY, ControlCacheKey &aControlCacheKey)
virtual void Init() override
bool RenderCompatibleDC(OpenGLCompatibleDC &rWhite, OpenGLCompatibleDC &rBlack, int nX, int nY, TextureCombo &rCombo)
WinSalGraphics & mrWinParent
Definition: win/gdiimpl.hxx:27
ControlType const mnType
virtual rtl::Reference< OpenGLContext > CreateWinContext() override
create a new context for rendering to the underlying window
ControlCacheType cache
Definition: win/gdiimpl.hxx:71
std::size_t operator()(ControlCacheKey const &aCache) const
Definition: win/gdiimpl.hxx:55
ControlState const mnState
ControlPart const mnPart
virtual void copyBits(const SalTwoRect &rPosAry, SalGraphics *pSrcGraphics) override
bool RenderTextureCombo(TextureCombo const &rCombo, int nX, int nY)
o3tl::lru_map< ControlCacheKey, std::unique_ptr< TextureCombo >, ControlCacheHashFunction > ControlCacheType
Definition: win/gdiimpl.hxx:68
Class that creates (and destroys) a compatible Device Context.
Definition: win/salgdi.h:100
WinOpenGLSalGraphicsImpl(WinSalGraphics &rGraphics, SalGeometryProvider *mpProvider)
bool TryRenderCachedNativeControl(ControlCacheKey const &rControlCacheKey, int nX, int nY)