comparison Framework/Scene2D/CairoCompositor.h @ 888:6e888cf6a48b

renderers now have access to canvas width/height
author Sebastien Jodogne <s.jodogne@gmail.com>
date Wed, 10 Jul 2019 11:58:38 +0200
parents c237e0625065
children 6e79e8c9021c 88bf49aebc13
comparison
equal deleted inserted replaced
871:4bc8d9609447 888:6e888cf6a48b
42 // Only valid during a call to "Refresh()" 42 // Only valid during a call to "Refresh()"
43 std::auto_ptr<CairoContext> context_; 43 std::auto_ptr<CairoContext> context_;
44 44
45 virtual cairo_t* GetCairoContext(); 45 virtual cairo_t* GetCairoContext();
46 46
47 virtual unsigned int GetCairoWidth()
48 {
49 return canvas_.GetWidth();
50 }
51
52 virtual unsigned int GetCairoHeight()
53 {
54 return canvas_.GetHeight();
55 }
56
57 virtual Internals::CompositorHelper::ILayerRenderer* Create(const ISceneLayer& layer); 47 virtual Internals::CompositorHelper::ILayerRenderer* Create(const ISceneLayer& layer);
58 48
59 public: 49 public:
60 CairoCompositor(const Scene2D& scene, 50 CairoCompositor(const Scene2D& scene,
61 unsigned int canvasWidth, 51 unsigned int canvasWidth,
64 ~CairoCompositor(); 54 ~CairoCompositor();
65 55
66 const CairoSurface& GetCanvas() const 56 const CairoSurface& GetCanvas() const
67 { 57 {
68 return canvas_; 58 return canvas_;
59 }
60
61 unsigned int GetCanvasWidth() const
62 {
63 return canvas_.GetWidth();
64 }
65
66 unsigned int GetCanvasHeight() const
67 {
68 return canvas_.GetHeight();
69 } 69 }
70 70
71 void SetFont(size_t index, 71 void SetFont(size_t index,
72 GlyphBitmapAlphabet* dict); // Takes ownership 72 GlyphBitmapAlphabet* dict); // Takes ownership
73 73