mirror of
https://github.com/openharmony/windowmanager.git
synced 2026-07-20 20:20:13 -04:00
@@ -47,7 +47,7 @@ private:
|
||||
|
||||
std::map<DisplayId, sptr<Window>> coverWindowMap_;
|
||||
#ifdef ACE_ENABLE_GL
|
||||
RenderContext* rc_ = nullptr;
|
||||
std::unique_ptr<RenderContext> renderContext_;
|
||||
#endif
|
||||
};
|
||||
}
|
||||
|
||||
@@ -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_;
|
||||
|
||||
@@ -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);
|
||||
|
||||
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user