#include <dali/public-api/dali-core.h>
// INTERNAL INCLUDES
+#include <dali-test-suite-utils.h>
#include "mesh-builder.h"
namespace Dali
return textureSet;
}
+void DirtyRectChecker(const std::vector<Rect<int>>& damagedRects, std::multiset<Rect<int>, RectSorter> expectedRectList, bool checkRectsExact, const char* testLocation)
+{
+ // Just check damagedRect contain all expectRectList.
+ DALI_TEST_GREATER(damagedRects.size() + 1u, expectedRectList.size(), testLocation);
+
+ for(auto& rect : damagedRects)
+ {
+ auto iter = expectedRectList.find(rect);
+ if(iter != expectedRectList.end())
+ {
+ expectedRectList.erase(iter);
+ }
+ else if(checkRectsExact)
+ {
+ std::ostringstream o;
+ o << rect << " exist in expectRectList" << std::endl;
+ fprintf(stderr, "Test failed in %s, checking %s", testLocation, o.str().c_str());
+ tet_result(TET_FAIL);
+ }
+ }
+
+ // Check all rects are matched
+ DALI_TEST_EQUALS(expectedRectList.empty(), true, testLocation);
+}
+
} // namespace Dali
// EXTERNAL INCLUDES
#include <dali/public-api/rendering/texture-set.h>
#include <dali/public-api/rendering/texture.h>
+#include <set> // For std::multiset
#include <string>
namespace Dali
Texture CreateTexture(TextureType::Type type, Pixel::Format format, int width, int height);
TextureSet CreateTextureSet(Pixel::Format format, int width, int height);
+// Check dirtyRect is equal with expected multiset.
+// Note that the order of damagedRect is not important
+struct RectSorter
+{
+ bool operator()(const Rect<int>& lhs, const Rect<int>& rhs) const
+ {
+ if(lhs.x != rhs.x)
+ {
+ return lhs.x < rhs.x;
+ }
+ if(lhs.y != rhs.y)
+ {
+ return lhs.y < rhs.y;
+ }
+ if(lhs.width != rhs.width)
+ {
+ return lhs.width < rhs.width;
+ }
+ return lhs.height < rhs.height;
+ }
+};
+
+void DirtyRectChecker(const std::vector<Rect<int>>& damagedRects, std::multiset<Rect<int>, RectSorter> expectedRectList, bool checkRectsExact, const char* testLocation);
+
} // namespace Dali
#endif // DALI_TEST_ACTOR_UTILS_H
bool isSetWithScreenSize = false;
if(mWindowWidth <= 0 || mWindowHeight <= 0)
{
- mWindowWidth = screenWidth;
- mWindowHeight = screenHeight;
+ mWindowWidth = screenWidth;
+ mWindowHeight = screenHeight;
isSetWithScreenSize = true;
DALI_LOG_RELEASE_INFO("Window size is set with screen size(%d x %d)\n", mWindowWidth, mWindowHeight);
}
mScene.KeepRendering(durationSeconds);
}
+void Window::SetPartialUpdateEnabled(bool enabled)
+{
+ mScene.SetPartialUpdateEnabled(enabled);
+}
+
+bool Window::IsPartialUpdateEnabled() const
+{
+ return mScene.IsPartialUpdateEnabled();
+}
+
std::string Window::GetNativeResourceId() const
{
return mWindowBase->GetNativeWindowResourceId();
void KeepRendering(float durationSeconds);
/**
+ * @copydoc Dali::Window::SetPartialUpdateEnabled()
+ */
+ void SetPartialUpdateEnabled(bool enabled);
+
+ /**
+ * @copydoc Dali::Window::IsPartialUpdateEnabled()
+ */
+ bool IsPartialUpdateEnabled() const;
+
+ /**
* @brief Get window resource ID assigned by window manager
* @return The resource ID of the window
*/
std::vector<int> mAvailableAngles;
int mPreferredAngle;
- int mRotationAngle; ///< The angle of the rotation
- int mWindowWidth; ///< The width of the window
- int mWindowHeight; ///< The height of the window
- int mNativeWindowId; ///< The Native Window Id
+ int mRotationAngle; ///< The angle of the rotation
+ int mWindowWidth; ///< The width of the window
+ int mWindowHeight; ///< The height of the window
+ int mNativeWindowId; ///< The Native Window Id
EventHandlerPtr mEventHandler; ///< The window events handler
OrientationMode mOrientationMode; ///< The physical screen mode is portrait or landscape
bool mOpaqueState : 1;
bool mWindowRotationAcknowledgement : 1;
bool mFocused : 1;
- bool mIsWindowRotating : 1; ///< The window rotating flag.
+ bool mIsWindowRotating : 1; ///< The window rotating flag.
bool mIsEnabledUserGeometry : 1; ///< The user geometry enable flag.
};
GetImplementation(*this).KeepRendering(durationSeconds);
}
+void Window::SetPartialUpdateEnabled(bool enabled)
+{
+ GetImplementation(*this).SetPartialUpdateEnabled(enabled);
+}
+
+bool Window::IsPartialUpdateEnabled() const
+{
+ return GetImplementation(*this).IsPartialUpdateEnabled();
+}
+
Window::KeyEventSignalType& Window::KeyEventSignal()
{
return GetImplementation(*this).KeyEventSignal();
RenderTaskList GetRenderTaskList();
/**
- * @brief Keep rendering for at least the given amount of time.
+ * @brief Keeps rendering for at least the given amount of time.
*
* By default, Dali will stop rendering when no Actor positions are being set, and when no animations are running etc.
* This method is useful to force screen refreshes.
*/
void KeepRendering(float durationSeconds);
+ /**
+ * @brief Sets whether the window will update partial area or full area.
+ *
+ * @SINCE_2_2.33
+ * @param[in] enabled True if the window should update partial area
+ * @note This doesn't change the global value which is set by the environment variable.
+ * This works when partial update is enabled by the environment variable. If the partial update is disabled by the environment variable, it changes nothing.
+ */
+ void SetPartialUpdateEnabled(bool enabled);
+
+ /**
+ * @brief Queries whether the window will update partial area.
+ *
+ * @SINCE_2_2.33
+ * @return True if the window should update partial area
+ */
+ bool IsPartialUpdateEnabled() const;
+
public: // Signals
/**
* @brief The user should connect to this signal to get a timing when window gains focus or loses focus.