summaryrefslogtreecommitdiff
path: root/vcl/inc/win/salgdi.h
diff options
context:
space:
mode:
authorJan Holesovsky <kendy@collabora.com>2014-11-20 14:14:30 +0100
committerJan Holesovsky <kendy@collabora.com>2014-11-20 18:51:55 +0100
commit3f94c9e9ddfd807b449f3bb9b232cf2041fa12d2 (patch)
tree6ed50eaf47113ae1cf06a5985f5abd02c5da7076 /vcl/inc/win/salgdi.h
parent1307c65d74fc9a1241f0a50142921cadac1e882b (diff)
windows opengl: Introduce OpenGLCompatibleDC.
This is to abstract the compatible DC creation and usage, to be reused in the native theme rendering. Change-Id: Id34bba4aeea7f46fc2aa42f292f0a525d753b8d7
Diffstat (limited to 'vcl/inc/win/salgdi.h')
-rw-r--r--vcl/inc/win/salgdi.h35
1 files changed, 34 insertions, 1 deletions
diff --git a/vcl/inc/win/salgdi.h b/vcl/inc/win/salgdi.h
index 74e8fe00e61d..831a7032fa8e 100644
--- a/vcl/inc/win/salgdi.h
+++ b/vcl/inc/win/salgdi.h
@@ -41,6 +41,7 @@ class ImplWinFontEntry;
class ImplFontAttrCache;
class PhysicalFontCollection;
class SalGraphicsImpl;
+class WinOpenGLSalGraphicsImpl;
#define RGB_TO_PALRGB(nRGB) ((nRGB)|0x02000000)
#define PALRGB_TO_RGB(nPalRGB) ((nPalRGB)&0x00ffffff)
@@ -139,11 +140,43 @@ public:
bool IsGSUBstituted( sal_UCS4 ) const;
};
+/** Class that creates (and destroys) a compatible Device Context.
+
+This is to be used for GDI drawing into a DIB that we later use as a texture for OpenGL drawing.
+*/
+class OpenGLCompatibleDC
+{
+private:
+ /// The compatible DC that we create for our purposes.
+ HDC mhCompatibleDC;
+
+ /// DIBSection that we use for the GDI drawing, and later obtain.
+ HBITMAP mhBitmap;
+
+ /// DIBSection data.
+ sal_uInt8 *mpData;
+
+ /// Mapping between the GDI position and OpenGL, to use for OpenGL drawing.
+ SalTwoRect maRects;
+
+ /// The OpenGL-based SalGraphicsImpl where we will draw. If null, we ignora the drawing, it means it happened directly to the DC..
+ WinOpenGLSalGraphicsImpl *mpImpl;
+
+public:
+ OpenGLCompatibleDC(SalGraphics &rGraphics, int x, int y, int width, int height);
+ ~OpenGLCompatibleDC();
+
+ HDC getCompatibleHDC() { return mhCompatibleDC; }
+
+ /// Call the WinOpenGLSalGraphicsImpl's DrawMask().
+ void DrawMask(SalColor color);
+};
+
class WinSalGraphics : public SalGraphics
{
friend class WinSalGraphicsImpl;
friend class ScopedFont;
- friend class WinLayout;
+ friend class OpenGLCompatibleDC;
private:
boost::scoped_ptr<SalGraphicsImpl> mpImpl;