fix window blur bug

Signed-off-by: jiangdayuan <jiangdayuan@huawei.com>
This commit is contained in:
jiangdayuan
2022-03-21 21:32:42 +08:00
parent 716b46aeb5
commit 90fd19929c
3 changed files with 7 additions and 7 deletions
@@ -23,6 +23,7 @@ enum class WindowSizeChangeReason : uint32_t {
RECOVER,
ROTATION,
DRAG,
DRAG_START,
DRAG_END,
RESIZE,
MOVE,
@@ -1844,14 +1844,12 @@ void PipelineContext::WindowSizeChangeAnimate(int32_t width, int32_t height, Win
break;
[[fallthrough]];
}
case WindowSizeChangeReason::DRAG: {
case WindowSizeChangeReason::DRAG_START: {
BlurWindowWithDrag(true);
isDragStart_ = true;
break;
}
case WindowSizeChangeReason::DRAG_END: {
BlurWindowWithDrag(false);
isDragStart_ = false;
SetRootSizeWithWidthHeight(width, height);
break;
}
@@ -1868,15 +1866,17 @@ void PipelineContext::WindowSizeChangeAnimate(int32_t width, int32_t height, Win
void PipelineContext::OnSurfaceChanged(int32_t width, int32_t height, WindowSizeChangeReason type)
{
CHECK_RUN_ON(UI);
LOGI("PipelineContext: OnSurfaceChanged start.");
// Refresh the screen when developers customize the resolution and screen density on the PC preview.
#if !defined(WINDOWS_PLATFORM) and !defined(MAC_PLATFORM)
if (width_ == width && height_ == height && isSurfaceReady_ && type != WindowSizeChangeReason::DRAG_END) {
if (width_ == width && height_ == height && isSurfaceReady_ && type != WindowSizeChangeReason::DRAG_START &&
type != WindowSizeChangeReason::DRAG_END) {
LOGI("Surface size is same, no need update");
return;
}
#endif
if (type == WindowSizeChangeReason::DRAG && isDragStart_) {
LOGD("Type is drag, no need change size.");
if (type == WindowSizeChangeReason::DRAG) {
LOGI("WindowSizeChangeReason is drag, no need change size.");
return;
}
@@ -1391,7 +1391,6 @@ private:
bool isJsPlugin_ = false;
bool useLiteStyle_ = false;
bool isFirstLoaded_ = true;
bool isDragStart_ = false;
uint64_t flushAnimationTimestamp_ = 0;
TimeProvider timeProvider_;
OnPageShowCallBack onPageShowCallBack_;