* @brief TBD
* @since_tizen 7.0
*/
- bool takeScreenshot(std::string path, bool asPixels, void **pixels) override;
+ bool takeScreenshot(std::string path, bool asPixels, void **pixels, int angle = 0) override;
/**
* @brief TBD
#include <set>
#include <efl_util.h>
+#include <efl_util_screenshot_extension.h>
#include <shared_mutex>
using namespace Aurum;
/**
* @copydoc IDevice::takeScreenshot()
*/
- bool takeScreenshot(std::string path, bool asPixels, void **pixels) override;
+ bool takeScreenshot(std::string path, bool asPixels, void **pixels, int angle = 0) override;
/**
* @copydoc IDevice::getSystemTime()
* @param[in] path where the image file should be written to
* @param[in] asPixels asPixels wheter to receive screen pixel data
* @param[in] pixels pixel pixel buffer data pointer
+ * @param[in] angle rotation angle of current screen
*
* @return true if screen shot is created successfully, false otherwise
*
- * @since_tizen 6.5
+ * @since_tizen 8.0
*/
- virtual bool takeScreenshot(std::string path, bool asPixels, void **pixels) = 0;
+ virtual bool takeScreenshot(std::string path, bool asPixels, void **pixels, int angle = 0) = 0;
/**
* @brief Gets device system time.
* @param[in] path where the image file should be written to
* @param[in] asPixels asPixels wheter to receive screen pixel data
* @param[in] pixels pixel pixel buffer data pointer
+ * @param[in] angle rotation angle of current screen
*
* @return true if screen shot is created successfully, false otherwise
*
- * @since_tizen 7.0
+ * @since_tizen 8.0
*/
- bool takeScreenshot(std::string path, bool asPixels, void **pixels) override;
+ bool takeScreenshot(std::string path, bool asPixels, void **pixels, int angle = 0) override;
/**
* @brief Gets device system time.
return false;
}
-bool MockDeviceImpl::takeScreenshot(std::string path, bool asPixels, void **pixels)
+bool MockDeviceImpl::takeScreenshot(std::string path, bool asPixels, void **pixels, int angle)
{
return true;
}
return result == EFL_UTIL_ERROR_NONE;
}
-bool TizenDeviceImpl::takeScreenshot(std::string path, bool asPixels, void **pixels)
+bool TizenDeviceImpl::takeScreenshot(std::string path, bool asPixels, void **pixels, int angle)
{
efl_util_screenshot_h screenshot = NULL;
tbm_surface_h tbm_surface = NULL;
void *ptr = NULL;
- const int WIDTH = mScreenSize.width;
- const int HEIGHT = mScreenSize.height;
+ int WIDTH = 0;
+ int HEIGHT = 0;
+ if (angle == 90 || angle == 270) {
+ WIDTH = mScreenSize.height;
+ HEIGHT = mScreenSize.width;
+ } else {
+ WIDTH = mScreenSize.width;
+ HEIGHT = mScreenSize.height;
+ }
CaptureMutex.lock();
screenshot = efl_util_screenshot_initialize(WIDTH, HEIGHT);
if (screenshot) {
+ efl_util_screenshot_set_auto_rotation(screenshot, EINA_TRUE);
tbm_surface = efl_util_screenshot_take_tbm_surface(screenshot);
if (tbm_surface) {
if (asPixels) {
return result;
}
-bool UiDevice::takeScreenshot(std::string path, bool asPixels, void **pixels)
+bool UiDevice::takeScreenshot(std::string path, bool asPixels, void **pixels, int angle)
{
- return mDeviceImpl->takeScreenshot(path, asPixels, pixels);
+ angle = getWindowAngle();
+ return mDeviceImpl->takeScreenshot(path, asPixels, pixels, angle);
}
long long UiDevice::getSystemTime(TimeRequestType type)
if (wins.size() > 0) return wins[0]->getTargetAngle();
return 0;
-}
\ No newline at end of file
+}