virtual bool start(int maxIterationDurationInMS) = 0;
virtual void stop() = 0;
virtual void allocatePlatformSurface(Surface *surface) = 0;
- virtual void doScreenShot(std::string fileName) = 0;
+ virtual void doScreenShot(std::string fileName, const uint screen_id) = 0;
virtual void doScreenShotOfLayer(std::string fileName, const uint id) = 0;
virtual void doScreenShotOfSurface(std::string fileName, const uint id, const uint layer_id) = 0;
virtual void finishFrame() { }
struct wl_display* getNativeDisplayHandle();
virtual void allocatePlatformSurface(Surface *surface);
virtual void deallocatePlatformSurface(Surface *surface);
- void doScreenShot(std::string fileName);
+ void doScreenShot(std::string fileName, const uint screen_id);
void doScreenShotOfLayer(std::string fileName, const uint id);
void doScreenShotOfSurface(std::string fileName, const uint id, const uint layer_id);
int getWindowWidth() const;
WaylandWindowSystemStates m_systemState;
uint m_manageConnectionId;
std::string m_screenShotFile;
+ uint m_screenShotScreenID;
uint m_screenShotSurfaceID;
uint m_screenShotLayerID;
bool m_debugMode;
Window getCompositorNativeWindowHandle();
virtual void allocatePlatformSurface(Surface *surface);
virtual void deallocatePlatformSurface(Surface *surface);
- void doScreenShot(std::string fileName);
+ void doScreenShot(std::string fileName, const uint screen_id);
void doScreenShotOfLayer(std::string fileName, const uint id);
void doScreenShotOfSurface(std::string fileName, const uint id, const uint layer_id);
int getIterationCounter();
private:
ScreenShotType takeScreenshot;
std::string screenShotFile;
+ uint screenShotScreenID;
uint screenShotSurfaceID;
uint screenShotLayerID;
const char* displayname;
, m_systemState(IDLE_STATE)
, m_manageConnectionId(256)
, m_screenShotFile()
+, m_screenShotScreenID(0)
, m_screenShotSurfaceID(0)
, m_screenShotLayerID(0)
, m_debugMode(false)
if (m_takeScreenshot == ScreenshotOfDisplay)
{
LOG_DEBUG("WaylandBaseWindowSystem", "Taking screenshot");
+ graphicSystem->switchScreen(m_screenShotScreenID);
+
RedrawAllLayers(true, false); // Do clear, Don't swap
}
else if (m_takeScreenshot == ScreenshotOfLayer)
{
LOG_DEBUG("WaylandBaseWindowSystem", "Taking screenshot of layer");
Layer* layer = m_pScene->getLayer(m_screenShotLayerID);
+ graphicSystem->switchScreen(layer->getContainingScreenId());
+ graphicSystem->clearBackground();
if (layer != NULL)
{
graphicSystem->renderSWLayer(layer, true); // Do clear
LOG_DEBUG("WaylandBaseWindowSystem", "Taking screenshot of surface");
Layer* layer = m_pScene->getLayer(m_screenShotLayerID);
Surface* surface = m_pScene->getSurface(m_screenShotSurfaceID);
+ graphicSystem->switchScreen(layer->getContainingScreenId());
graphicSystem->clearBackground();
if (layer != NULL && surface != NULL)
LOG_DEBUG("WaylandBaseWindowSystem", "deallocatePlatformSurface end");
}
-void WaylandBaseWindowSystem::doScreenShot(std::string fileName)
+void WaylandBaseWindowSystem::doScreenShot(std::string fileName, const uint screen_id)
{
m_takeScreenshot = ScreenshotOfDisplay;
m_screenShotFile = fileName;
+ m_screenShotScreenID = screen_id;
}
void WaylandBaseWindowSystem::doScreenShotOfLayer(std::string fileName, const uint id)
LOG_DEBUG("X11WindowSystem", "deallocatePlatformSurface end");
}
-void X11WindowSystem::doScreenShot(std::string fileName)
+void X11WindowSystem::doScreenShot(std::string fileName, const uint screen_id)
{
takeScreenshot = ScreenshotOfDisplay;
screenShotFile = fileName;
+ screenShotScreenID = screen_id;
}
void X11WindowSystem::doScreenShotOfLayer(std::string fileName, const uint id)