comparison Framework/Viewport/WebAssemblyCairoViewport.cpp @ 1331:ab81ee8fce1f broker

- Viewport is not passed and stored as a shared_ptr instead of raw reference. - ViewportController can now be injected with an undo stack (not a ctor param anymore, as a preparation for the move of the undo stack to an interactor) - Added (temp) flag to disable emscripten events registration in the WebAssemblyViewport (because legacy client code deals with them directly) - Added emscripten_clear_timeout in ~WebGLViewportsRegistry - Removed GenericToolbox::HoldingRef whose responsibility is better served with proper callback un-registration.
author Benjamin Golinvaux <bgo@osimis.io>
date Mon, 30 Mar 2020 14:23:46 +0200
parents cbfdba08e039
children 1b8e37770d78
comparison
equal deleted inserted replaced
1329:8d3e669f01a2 1331:ab81ee8fce1f
120 120
121 dynamic_cast<CairoCompositor&>(compositor).UpdateSize(width, height); 121 dynamic_cast<CairoCompositor&>(compositor).UpdateSize(width, height);
122 } 122 }
123 123
124 124
125 WebAssemblyCairoViewport::WebAssemblyCairoViewport(const std::string& canvasId) : 125 WebAssemblyCairoViewport::WebAssemblyCairoViewport(
126 WebAssemblyViewport(canvasId, NULL, boost::weak_ptr<UndoStack>()) 126 const std::string& canvasId) :
127 WebAssemblyViewport(canvasId)
127 { 128 {
128 unsigned int width, height; 129 unsigned int width, height;
129 GetCanvasSize(width, height); 130 GetCanvasSize(width, height);
130 emscripten_set_canvas_element_size(GetFullCanvasId().c_str(), width, height); 131 emscripten_set_canvas_element_size(GetFullCanvasId().c_str(),
132 width,
133 height);
134
131 AcquireCompositor(new CairoCompositor(width, height)); 135 AcquireCompositor(new CairoCompositor(width, height));
132 } 136 }
133 } 137 }