summaryrefslogtreecommitdiff
path: root/vcl/inc
diff options
context:
space:
mode:
authorMichael Meeks <michael.meeks@collabora.com>2014-11-29 22:55:31 +0000
committerMarkus Mohrhard <markus.mohrhard@collabora.co.uk>2014-12-02 08:34:52 +0100
commit5dcaefdae5ddf5ee70b4dd453afee69cdf8fc9d7 (patch)
treece752cbbc6a3cddbd8a750bd2ea5a739e619cc36 /vcl/inc
parentc31ed7004dfb3e8e37ddeb9fddf0f015b661dd12 (diff)
vcl: Consolidate size information around the GeometryProvider.
Conflicts: vcl/inc/openglgdiimpl.hxx Change-Id: I1d764a8dba1850d2475f08e1014a085846f336c3
Diffstat (limited to 'vcl/inc')
-rw-r--r--vcl/inc/opengl/win/gdiimpl.hxx7
-rw-r--r--vcl/inc/opengl/x11/gdiimpl.hxx7
-rw-r--r--vcl/inc/openglgdiimpl.hxx11
-rw-r--r--vcl/inc/unx/salgdi.h2
-rw-r--r--vcl/inc/win/salgdi.h4
5 files changed, 17 insertions, 14 deletions
diff --git a/vcl/inc/opengl/win/gdiimpl.hxx b/vcl/inc/opengl/win/gdiimpl.hxx
index da1a2780e8e2..30ade233b543 100644
--- a/vcl/inc/opengl/win/gdiimpl.hxx
+++ b/vcl/inc/opengl/win/gdiimpl.hxx
@@ -24,13 +24,10 @@ private:
WinSalGraphics& mrParent;
public:
- WinOpenGLSalGraphicsImpl(WinSalGraphics& rGraphics);
+ WinOpenGLSalGraphicsImpl(WinSalGraphics& rGraphics,
+ SalGeometryProvider *mpProvider);
protected:
- virtual GLfloat GetWidth() const SAL_OVERRIDE;
- virtual GLfloat GetHeight() const SAL_OVERRIDE;
- virtual bool IsOffscreen() const SAL_OVERRIDE;
-
virtual OpenGLContext* CreateWinContext() SAL_OVERRIDE;
virtual bool UseContext( OpenGLContext* pContext ) SAL_OVERRIDE;
virtual OpenGLContext* CreatePixmapContext() SAL_OVERRIDE;
diff --git a/vcl/inc/opengl/x11/gdiimpl.hxx b/vcl/inc/opengl/x11/gdiimpl.hxx
index 53ebe5b30722..d6ef0101920b 100644
--- a/vcl/inc/opengl/x11/gdiimpl.hxx
+++ b/vcl/inc/opengl/x11/gdiimpl.hxx
@@ -26,10 +26,6 @@ public:
virtual ~X11OpenGLSalGraphicsImpl();
protected:
- GLfloat GetWidth() const SAL_OVERRIDE;
- GLfloat GetHeight() const SAL_OVERRIDE;
- bool IsOffscreen() const SAL_OVERRIDE;
-
virtual OpenGLContext* CreateWinContext() SAL_OVERRIDE;
virtual OpenGLContext* CreatePixmapContext() SAL_OVERRIDE;
virtual bool UseContext( OpenGLContext* pContext ) SAL_OVERRIDE;
@@ -38,6 +34,9 @@ public:
// implementation of X11GraphicsImpl
virtual void copyBits( const SalTwoRect& rPosAry, SalGraphics* pSrcGraphics ) SAL_OVERRIDE;
+
+ virtual void Init() SAL_OVERRIDE;
+
bool FillPixmapFromScreen( X11Pixmap* pPixmap, int nX, int nY ) SAL_OVERRIDE;
bool RenderPixmapToScreen( X11Pixmap* pPixmap, X11Pixmap* pMask, int nX, int nY ) SAL_OVERRIDE;
};
diff --git a/vcl/inc/openglgdiimpl.hxx b/vcl/inc/openglgdiimpl.hxx
index ac42527399fc..39e39fc77752 100644
--- a/vcl/inc/openglgdiimpl.hxx
+++ b/vcl/inc/openglgdiimpl.hxx
@@ -20,6 +20,7 @@
#ifndef INCLUDED_VCL_OPENGLGDIIMPL_HXX
#define INCLUDED_VCL_OPENGLGDIIMPL_HXX
+#include "salgeom.hxx"
#include "salgdiimpl.hxx"
#include <vcl/dllapi.h>
@@ -40,6 +41,8 @@ class VCL_PLUGIN_PUBLIC OpenGLSalGraphicsImpl : public SalGraphicsImpl
protected:
boost::shared_ptr<OpenGLContext> mpContext;
+ /// Pointer to the SalFrame or SalVirtualDevice
+ SalGeometryProvider* mpParent;
OpenGLFramebuffer* mpFramebuffer;
// clipping
@@ -144,13 +147,13 @@ public:
public:
// get the width of the device
- virtual GLfloat GetWidth() const = 0;
+ GLfloat GetWidth() const { return mpParent ? mpParent->GetWidth() : 1; }
// get the height of the device
- virtual GLfloat GetHeight() const = 0;
+ GLfloat GetHeight() const { return mpParent ? mpParent->GetHeight() : 1; }
// check whether this instance is used for offscreen rendering
- virtual bool IsOffscreen() const = 0;
+ bool IsOffscreen() const { return mpParent ? mpParent->IsOffScreen() : true; }
// operations to do before painting
virtual void PreDraw();
@@ -172,7 +175,7 @@ protected:
virtual bool UseContext( OpenGLContext* pContext ) = 0;
public:
- OpenGLSalGraphicsImpl();
+ OpenGLSalGraphicsImpl(SalGeometryProvider* pParent);
virtual ~OpenGLSalGraphicsImpl ();
OpenGLContext* GetOpenGLContext();
diff --git a/vcl/inc/unx/salgdi.h b/vcl/inc/unx/salgdi.h
index edf47b12eeef..29697a9f9e89 100644
--- a/vcl/inc/unx/salgdi.h
+++ b/vcl/inc/unx/salgdi.h
@@ -29,6 +29,7 @@
#include <vcl/metric.hxx>
#include "salgdi.hxx"
+#include "salgeom.hxx"
#include "sallayout.hxx"
#include "vclpluginapi.h"
@@ -132,6 +133,7 @@ public:
inline const SalDisplay* GetDisplay() const;
inline Display* GetXDisplay() const;
inline const SalVisual& GetVisual() const;
+ SalGeometryProvider *GetGeometryProvider() const;
inline Drawable GetDrawable() const { return hDrawable_; }
void SetDrawable( Drawable d, SalX11Screen nXScreen );
XRenderPictFormat* GetXRenderFormat() const;
diff --git a/vcl/inc/win/salgdi.h b/vcl/inc/win/salgdi.h
index 443c1c2377af..5a46cb1ff8dd 100644
--- a/vcl/inc/win/salgdi.h
+++ b/vcl/inc/win/salgdi.h
@@ -21,6 +21,7 @@
#define INCLUDED_VCL_INC_WIN_SALGDI_H
#include "sallayout.hxx"
+#include "salgeom.hxx"
#include "salgdi.hxx"
#include "outfont.hxx"
#include "PhysicalFontFace.hxx"
@@ -243,7 +244,8 @@ public:
HFONT ImplDoSetFont( FontSelectPattern* i_pFont, float& o_rFontScale, HFONT& o_rOldFont );
public:
- explicit WinSalGraphics(WinSalGraphics::Type eType, bool bScreen, HWND hWnd);
+ explicit WinSalGraphics(WinSalGraphics::Type eType, bool bScreen, HWND hWnd,
+ SalGeometryProvider *pProvider);
virtual ~WinSalGraphics();
SalGraphicsImpl* GetImpl() const SAL_OVERRIDE;