comparison Framework/Scene2D/Internals/CompositorHelper.h @ 889:6e79e8c9021c am-dev

integration mainline->am-dev
author Sebastien Jodogne <s.jodogne@gmail.com>
date Wed, 10 Jul 2019 12:05:02 +0200
parents 6176917ef890 6e888cf6a48b
children e4ac54cb8771
comparison
equal deleted inserted replaced
887:6176917ef890 889:6e79e8c9021c
34 public: 34 public:
35 virtual ~ICompositor() 35 virtual ~ICompositor()
36 { 36 {
37 } 37 }
38 38
39 virtual unsigned int GetWidth() const = 0; 39 virtual unsigned int GetCanvasWidth() const = 0;
40 virtual unsigned int GetHeight() const = 0; 40 virtual unsigned int GetCanvasHeight() const = 0;
41 virtual void Refresh() = 0; 41 virtual void Refresh() = 0;
42 42
43 ScenePoint2D GetPixelCenterCoordinates(int x, int y) const 43 ScenePoint2D GetPixelCenterCoordinates(int x, int y) const
44 { 44 {
45 return ScenePoint2D( 45 return ScenePoint2D(
46 static_cast<double>(x) + 0.5 - static_cast<double>(GetWidth()) / 2.0, 46 static_cast<double>(x) + 0.5 - static_cast<double>(GetCanvasWidth()) / 2.0,
47 static_cast<double>(y) + 0.5 - static_cast<double>(GetHeight()) / 2.0); 47 static_cast<double>(y) + 0.5 - static_cast<double>(GetCanvasHeight()) / 2.0);
48 } 48 }
49 49
50 }; 50 };
51 51
52 namespace Internals 52 namespace Internals
59 public: 59 public:
60 virtual ~ILayerRenderer() 60 virtual ~ILayerRenderer()
61 { 61 {
62 } 62 }
63 63
64 virtual void Render(const AffineTransform2D& transform) = 0; 64 virtual void Render(const AffineTransform2D& transform,
65 unsigned int canvasWidth,
66 unsigned int canvasHeight) = 0;
65 67
66 // "Update()" is only called if the type of the layer has not changed 68 // "Update()" is only called if the type of the layer has not changed
67 virtual void Update(const ISceneLayer& layer) = 0; 69 virtual void Update(const ISceneLayer& layer) = 0;
68 }; 70 };
69 71
83 typedef std::map<int, Item*> Content; 85 typedef std::map<int, Item*> Content;
84 86
85 const Scene2D& scene_; 87 const Scene2D& scene_;
86 IRendererFactory& factory_; 88 IRendererFactory& factory_;
87 Content content_; 89 Content content_;
90
91 // Only valid during a call to Refresh()
88 AffineTransform2D sceneTransform_; 92 AffineTransform2D sceneTransform_;
89 93 unsigned int canvasWidth_;
94 unsigned int canvasHeight_;
95
90 protected: 96 protected:
91 virtual void Visit(const ISceneLayer& layer, 97 virtual void Visit(const ISceneLayer& layer,
92 uint64_t layerIdentifier, 98 uint64_t layerIdentifier,
93 int depth); 99 int depth);
94 100