Mercurial > hg > orthanc-stone
comparison Framework/Scene2D/CairoCompositor.h @ 1211:d10d2acb8a02 broker
compositors do not keep a reference to the scene anymore
author | Sebastien Jodogne <s.jodogne@gmail.com> |
---|---|
date | Wed, 04 Dec 2019 16:47:21 +0100 |
parents | 685c9a2d115f |
children | 0ca50d275b9a |
comparison
equal
deleted
inserted
replaced
1210:644baa70373d | 1211:d10d2acb8a02 |
---|---|
35 private Internals::ICairoContextProvider | 35 private Internals::ICairoContextProvider |
36 { | 36 { |
37 private: | 37 private: |
38 typedef std::map<size_t, GlyphBitmapAlphabet*> Fonts; | 38 typedef std::map<size_t, GlyphBitmapAlphabet*> Fonts; |
39 | 39 |
40 Internals::CompositorHelper helper_; | 40 std::auto_ptr<Internals::CompositorHelper> helper_; |
41 CairoSurface canvas_; | 41 CairoSurface canvas_; |
42 Fonts fonts_; | 42 Fonts fonts_; |
43 | 43 |
44 // Only valid during a call to "Refresh()" | 44 // Only valid during a call to "Refresh()" |
45 std::auto_ptr<CairoContext> context_; | 45 std::auto_ptr<CairoContext> context_; |
47 virtual cairo_t* GetCairoContext() ORTHANC_OVERRIDE; | 47 virtual cairo_t* GetCairoContext() ORTHANC_OVERRIDE; |
48 | 48 |
49 virtual Internals::CompositorHelper::ILayerRenderer* Create(const ISceneLayer& layer) ORTHANC_OVERRIDE; | 49 virtual Internals::CompositorHelper::ILayerRenderer* Create(const ISceneLayer& layer) ORTHANC_OVERRIDE; |
50 | 50 |
51 public: | 51 public: |
52 CairoCompositor(const Scene2D& scene, | 52 CairoCompositor(unsigned int canvasWidth, |
53 unsigned int canvasWidth, | |
54 unsigned int canvasHeight); | 53 unsigned int canvasHeight); |
55 | 54 |
56 virtual ~CairoCompositor(); | 55 virtual ~CairoCompositor(); |
57 | 56 |
58 const CairoSurface& GetCanvas() const | 57 const CairoSurface& GetCanvas() const |
78 Orthanc::EmbeddedResources::FileResourceId resource, | 77 Orthanc::EmbeddedResources::FileResourceId resource, |
79 unsigned int fontSize, | 78 unsigned int fontSize, |
80 Orthanc::Encoding codepage) ORTHANC_OVERRIDE; | 79 Orthanc::Encoding codepage) ORTHANC_OVERRIDE; |
81 #endif | 80 #endif |
82 | 81 |
83 virtual void Refresh() ORTHANC_OVERRIDE; | 82 virtual void Refresh(const Scene2D& scene) ORTHANC_OVERRIDE; |
83 | |
84 virtual void ResetScene() ORTHANC_OVERRIDE | |
85 { | |
86 helper_.reset(new Internals::CompositorHelper(*this)); | |
87 } | |
84 | 88 |
85 void UpdateSize(unsigned int canvasWidth, | 89 void UpdateSize(unsigned int canvasWidth, |
86 unsigned int canvasHeight); | 90 unsigned int canvasHeight); |
87 | 91 |
88 Orthanc::ImageAccessor* RenderText(size_t fontIndex, | 92 Orthanc::ImageAccessor* RenderText(size_t fontIndex, |