diff Framework/Scene2D/CairoCompositor.h @ 905:88bf49aebc13

introduced ICompositor and allow SdlViewport to work with a CairoCompositor (to run on machines without OpenGL drivers)
author Alain Mazy <alain@mazy.be>
date Wed, 17 Jul 2019 16:56:53 +0200
parents 6e888cf6a48b
children 7a7e4e1f558f
line wrap: on
line diff
--- a/Framework/Scene2D/CairoCompositor.h	Wed Jul 17 15:33:34 2019 +0200
+++ b/Framework/Scene2D/CairoCompositor.h	Wed Jul 17 16:56:53 2019 +0200
@@ -13,7 +13,7 @@
  * WITHOUT ANY WARRANTY; without even the implied warranty of
  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
  * Affero General Public License for more details.
- * 
+ *
  * You should have received a copy of the GNU Affero General Public License
  * along with this program. If not, see <http://www.gnu.org/licenses/>.
  **/
@@ -21,6 +21,7 @@
 
 #pragma once
 
+#include "ICompositor.h"
 #include "../Fonts/GlyphBitmapAlphabet.h"
 #include "../Wrappers/CairoContext.h"
 #include "Internals/CompositorHelper.h"
@@ -29,8 +30,9 @@
 namespace OrthancStone
 {
   class CairoCompositor :
-    private Internals::CompositorHelper::IRendererFactory,
-    private Internals::ICairoContextProvider
+      public ICompositor,
+      private Internals::CompositorHelper::IRendererFactory,
+      private Internals::ICairoContextProvider
   {
   private:
     typedef std::map<size_t, GlyphBitmapAlphabet*>   Fonts;
@@ -51,19 +53,19 @@
                     unsigned int canvasWidth,
                     unsigned int canvasHeight);
     
-    ~CairoCompositor();
+    virtual ~CairoCompositor();
 
     const CairoSurface& GetCanvas() const
     {
       return canvas_;
     }
 
-    unsigned int GetCanvasWidth() const
+    virtual unsigned int GetCanvasWidth() const
     {
       return canvas_.GetWidth();
     }
 
-    unsigned int GetCanvasHeight() const
+    virtual unsigned int GetCanvasHeight() const
     {
       return canvas_.GetHeight();
     }
@@ -72,13 +74,13 @@
                  GlyphBitmapAlphabet* dict);  // Takes ownership
 
 #if ORTHANC_ENABLE_LOCALE == 1
-    void SetFont(size_t index,
-                 Orthanc::EmbeddedResources::FileResourceId resource,
-                 unsigned int fontSize,
-                 Orthanc::Encoding codepage);
+    virtual void SetFont(size_t index,
+                         Orthanc::EmbeddedResources::FileResourceId resource,
+                         unsigned int fontSize,
+                         Orthanc::Encoding codepage);
 #endif
 
-    void Refresh();
+    virtual void Refresh();
 
     Orthanc::ImageAccessor* RenderText(size_t fontIndex,
                                        const std::string& utf8) const;