From 5b9057823a1b4897d8f659e7117af9c3ac597077 Mon Sep 17 00:00:00 2001 From: Maciej Suminski Date: Mon, 15 Apr 2013 16:03:05 +0200 Subject: [PATCH] Introduced SetGAL() functions that will allow changing GAL backend for rendering on the fly. --- common/painter.cpp | 7 +++++++ include/gal/stroke_font.h | 10 ++++++++++ include/painter.h | 7 +++++++ 3 files changed, 24 insertions(+) diff --git a/common/painter.cpp b/common/painter.cpp index 5d24210aa7..fa28295158 100644 --- a/common/painter.cpp +++ b/common/painter.cpp @@ -80,3 +80,10 @@ PAINTER::~PAINTER() { delete m_stroke_font; } + + +void PAINTER::SetGAL( GAL* aGal ) +{ + m_gal = aGal; + m_stroke_font->SetGAL( aGal ); +} diff --git a/include/gal/stroke_font.h b/include/gal/stroke_font.h index 96aa5647b5..0d394ba613 100644 --- a/include/gal/stroke_font.h +++ b/include/gal/stroke_font.h @@ -152,6 +152,16 @@ public: m_verticalJustify = aVerticalJustify; } + /** + * Function SetGAL + * Changes Graphics Abstraction Layer used for drawing items for a new one. + * @param aGal is the new GAL instance. + */ + void SetGAL( GAL* aGal ) + { + m_gal = aGal; + } + private: GAL* m_gal; ///< Pointer to the GAL GlyphList m_glyphs; ///< Glyph list diff --git a/include/painter.h b/include/painter.h index a90c8026c5..a9e9dc947a 100644 --- a/include/painter.h +++ b/include/painter.h @@ -180,6 +180,13 @@ public: m_settings = aSettings; } + /** + * Function SetGAL + * Changes Graphics Abstraction Layer used for drawing items for a new one. + * @param aGal is the new GAL instance. + */ + void SetGAL( GAL* aGal ); + /** * Function GetSettings * Returns pointer to current settings that are going to be used when drawing items.