diff options
author | Michael Meeks <michael.meeks@collabora.com> | 2014-11-29 22:55:31 +0000 |
---|---|---|
committer | Markus Mohrhard <markus.mohrhard@collabora.co.uk> | 2014-12-02 08:34:52 +0100 |
commit | 5dcaefdae5ddf5ee70b4dd453afee69cdf8fc9d7 (patch) | |
tree | ce752cbbc6a3cddbd8a750bd2ea5a739e619cc36 /vcl/inc/openglgdiimpl.hxx | |
parent | c31ed7004dfb3e8e37ddeb9fddf0f015b661dd12 (diff) |
vcl: Consolidate size information around the GeometryProvider.
Conflicts:
vcl/inc/openglgdiimpl.hxx
Change-Id: I1d764a8dba1850d2475f08e1014a085846f336c3
Diffstat (limited to 'vcl/inc/openglgdiimpl.hxx')
-rw-r--r-- | vcl/inc/openglgdiimpl.hxx | 11 |
1 files changed, 7 insertions, 4 deletions
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(); |