!752 修复分屏条和冻屏绘制问题

Merge pull request !752 from 邢亚楠/develop
This commit is contained in:
openharmony_ci
2022-04-25 10:04:55 +00:00
committed by Gitee
4 changed files with 10 additions and 28 deletions
+1 -1
View File
@@ -47,7 +47,7 @@ private:
std::map<DisplayId, sptr<Window>> coverWindowMap_;
#ifdef ACE_ENABLE_GL
RenderContext* rc_ = nullptr;
std::unique_ptr<RenderContext> renderContext_;
#endif
};
}
+1 -1
View File
@@ -69,7 +69,7 @@ private:
std::condition_variable conVar_;
bool ready_ = false;
#ifdef ACE_ENABLE_GL
RenderContext* rc_ = nullptr;
std::unique_ptr<RenderContext> renderContext_;
#endif
std::map<uint32_t, sptr<Window>> dividerMap_;
std::vector<std::unique_ptr<WindowInnerMessage>> messages_;
+4 -13
View File
@@ -46,18 +46,9 @@ bool FreezeController::FreezeDisplay(DisplayId displayId)
}
#ifdef ACE_ENABLE_GL
WLOGFI("Draw cover window on gpu");
// init render context
static bool hasInitRC = false;
if (!hasInitRC) {
rc_ = RenderContextFactory::GetInstance().CreateEngine();
if (rc_ != nullptr) {
rc_->InitializeEglContext();
hasInitRC = true;
} else {
WLOGFE("InitilizeEglContext failed");
return false;
}
if (renderContext_ == nullptr) {
renderContext_ = std::make_unique<RenderContext>();
renderContext_->InitializeEglContext();
}
#endif
@@ -77,7 +68,7 @@ bool FreezeController::FreezeDisplay(DisplayId displayId)
}
#ifdef ACE_ENABLE_GL
rsSurface->SetRenderContext(rc_);
rsSurface->SetRenderContext(renderContext_.get());
#endif
std::shared_ptr<Media::PixelMap> pixelMap = DisplayManagerServiceInner::GetInstance().GetDisplaySnapshot(displayId);
+4 -13
View File
@@ -65,7 +65,7 @@ void WindowInnerManager::DrawSurface(const sptr<Window>& window)
return;
}
#ifdef ACE_ENABLE_GL
rsSurface->SetRenderContext(rc_);
rsSurface->SetRenderContext(renderContext_.get());
#endif
if (!isDividerImageLoaded_) {
isDividerImageLoaded_ = DecodeImageFile(splitIconPath_, dividerBitmap_);
@@ -194,18 +194,9 @@ void WindowInnerManager::CreateAndShowDivider(std::unique_ptr<WindowInnerMessage
}
#ifdef ACE_ENABLE_GL
WLOGFI("Draw divider on gpu");
// init render context
static bool hasInitRC = false;
if (!hasInitRC) {
rc_ = RenderContextFactory::GetInstance().CreateEngine();
if (rc_) {
rc_->InitializeEglContext();
hasInitRC = true;
} else {
WLOGFE("InitilizeEglContext failed");
return;
}
if (renderContext_ == nullptr) {
renderContext_ = std::make_unique<RenderContext>();
renderContext_->InitializeEglContext();
}
#endif
DrawSurface(window);