wasm: add force parameter for update() function

This commit is contained in:
Michal Maciola 2021-09-08 17:33:17 +02:00 committed by Hermet Park
parent 1ea9692841
commit 8c4197a8a5

View file

@ -90,32 +90,26 @@ public:
return true;
}
void update(int width, int height)
bool update(int width, int height, bool force)
{
mErrorMsg = "None";
if (!mSwCanvas) {
mErrorMsg = "Canvas is NULL";
return;
if (!mSwCanvas || !mPicture) {
mErrorMsg = "Invalid Conditions";
return false;
}
if (!mPicture) {
mErrorMsg = "Picture is NULL";
return;
}
if (mWidth == width && mHeight == height) {
return;
if (!force && mWidth == width && mHeight == height) {
return true;
}
updateSize(width, height);
if (mSwCanvas->update(mPicture) != Result::Success) {
mErrorMsg = "Update failed";
return;
return false;
}
return;
return true;
}
val render()