fix webview show when window drag

Signed-off-by: jiangdayuan <jiangdayuan@huawei.com>
This commit is contained in:
jiangdayuan
2022-03-22 18:54:58 +08:00
parent 3af2a0203d
commit 716b5c9761
3 changed files with 21 additions and 1 deletions
@@ -59,6 +59,9 @@ void RosenRenderWeb::Paint(RenderContext& context, const Offset& offset)
LOGE("OnAttachContext context null");
return;
}
if (pipelineContext->GetIsDragStart()) {
drawSize_ = Size(1.0, 1.0);
}
if (drawSize_.Width() > pipelineContext->GetRootWidth() || drawSize_.Height() > pipelineContext->GetRootHeight()) {
LOGE("Web drawSize height or width is invalid");
}
+10 -1
View File
@@ -1845,10 +1845,19 @@ void PipelineContext::WindowSizeChangeAnimate(int32_t width, int32_t height, Win
[[fallthrough]];
}
case WindowSizeChangeReason::DRAG_START: {
isDragStart_ = true;
BlurWindowWithDrag(true);
break;
}
case WindowSizeChangeReason::DRAG: {
isFirstDrag_ = false;
// Refresh once when first dragging.
SetRootSizeWithWidthHeight(width, height);
break;
}
case WindowSizeChangeReason::DRAG_END: {
isDragStart_ = false;
isFirstDrag_ = true;
BlurWindowWithDrag(false);
SetRootSizeWithWidthHeight(width, height);
break;
@@ -1875,7 +1884,7 @@ void PipelineContext::OnSurfaceChanged(int32_t width, int32_t height, WindowSize
return;
}
#endif
if (type == WindowSizeChangeReason::DRAG) {
if (type == WindowSizeChangeReason::DRAG && isDragStart_ && !isFirstDrag_) {
LOGI("WindowSizeChangeReason is drag, no need change size.");
return;
}
@@ -1224,6 +1224,12 @@ public:
{
return isSubPipeline_;
}
bool GetIsDragStart() const
{
return isDragStart_;
}
private:
void FlushVsync(uint64_t nanoTimestamp, uint32_t frameCount);
void FlushPipelineWithoutAnimation();
@@ -1391,6 +1397,8 @@ private:
bool isJsPlugin_ = false;
bool useLiteStyle_ = false;
bool isFirstLoaded_ = true;
bool isDragStart_ = false;
bool isFirstDrag_ = true;
uint64_t flushAnimationTimestamp_ = 0;
TimeProvider timeProvider_;
OnPageShowCallBack onPageShowCallBack_;