mirror of
https://gitee.com/openharmony/graphic_graphic_2d
synced 2024-11-24 07:30:38 +00:00
Fix virtual screen blacklist timing issue
Signed-off-by: 钱常德 <qianchangde@huawei.com> Change-Id: I64ba6a86e68be9610797233edce7d94d1f317293
This commit is contained in:
parent
61b7714664
commit
b456e8ba37
@ -474,14 +474,7 @@ void RSDisplayRenderNodeDrawable::OnDraw(Drawing::Canvas& canvas)
|
||||
WiredScreenProjection(*params, processor);
|
||||
return;
|
||||
}
|
||||
castScreenEnableSkipWindow_ = screenManager->GetCastScreenEnableSkipWindow(paramScreenId);
|
||||
if (castScreenEnableSkipWindow_) {
|
||||
RS_LOGD("RSDisplayRenderNodeDrawable::OnDraw, Enable CastScreen SkipWindow.");
|
||||
screenManager->GetCastScreenBlackList(currentBlackList_);
|
||||
} else {
|
||||
RS_LOGD("RSDisplayRenderNodeDrawable::OnDraw, Enable RecordScreen SkipWindow.");
|
||||
currentBlackList_ = screenManager->GetVirtualScreenBlackList(paramScreenId);
|
||||
}
|
||||
currentBlackList_ = screenManager->GetVirtualScreenBlackList(paramScreenId);
|
||||
uniParam->SetBlackList(currentBlackList_);
|
||||
uniParam->SetWhiteList(screenInfo.whiteList);
|
||||
curSecExemption_ = params->GetSecurityExemption();
|
||||
@ -724,6 +717,10 @@ int32_t RSDisplayRenderNodeDrawable::GetSpecialLayerType(RSDisplayRenderParams&
|
||||
{
|
||||
auto hasGeneralSpecialLayer = params.HasSecurityLayer() || params.HasSkipLayer() || params.HasProtectedLayer() ||
|
||||
RSUniRenderThread::Instance().IsCurtainScreenOn() || params.GetHDRPresent();
|
||||
RS_LOGD("RSDisplayRenderNodeDrawable::GetSpecialLayerType, SecurityLayer:%{public}d, SkipLayer:%{public}d,"
|
||||
"ProtectedLayer:%{public}d, CurtainScreen:%{public}d, HDRPresent:%{public}d", params.HasSecurityLayer(),
|
||||
params.HasSkipLayer(), params.HasProtectedLayer(), RSUniRenderThread::Instance().IsCurtainScreenOn(),
|
||||
params.GetHDRPresent());
|
||||
if (RSUniRenderThread::GetCaptureParam().isSnapshot_) {
|
||||
return hasGeneralSpecialLayer ? HAS_SPECIAL_LAYER :
|
||||
(params.HasCaptureWindow() ? CAPTURE_WINDOW : NO_SPECIAL_LAYER);
|
||||
|
@ -180,8 +180,8 @@ private:
|
||||
mutable std::shared_ptr<RSPaintFilterCanvas> curCanvas_ = nullptr;
|
||||
std::shared_ptr<Drawing::Surface> offscreenSurface_ = nullptr; // temporary holds offscreen surface
|
||||
std::shared_ptr<RSPaintFilterCanvas> canvasBackup_ = nullptr; // backup current canvas before offscreen rende
|
||||
std::unordered_set<NodeId> currentBlackList_;
|
||||
std::unordered_set<NodeId> lastBlackList_;
|
||||
std::unordered_set<NodeId> currentBlackList_ = {};
|
||||
std::unordered_set<NodeId> lastBlackList_ = {};
|
||||
bool curSecExemption_ = false;
|
||||
bool lastSecExemption_ = false;
|
||||
std::shared_ptr<Drawing::Image> cacheImgForCapture_ = nullptr;
|
||||
|
@ -175,29 +175,6 @@ bool RSUniRenderVirtualProcessor::RequestVirtualFrame(DrawableV2::RSDisplayRende
|
||||
return true;
|
||||
}
|
||||
|
||||
void RSUniRenderVirtualProcessor::CanvasInit(RSDisplayRenderNode& node)
|
||||
{
|
||||
if (node.IsFirstTimeToProcessor() || canvasRotation_) {
|
||||
if (node.IsFirstTimeToProcessor()) {
|
||||
RS_LOGI("RSUniRenderVirtualProcessor::FirstInit, id: %{public}" PRIu64 ", " \
|
||||
"screen(%{public}f, %{public}f, %{public}f, %{public}f), " \
|
||||
"rotation: %{public}d, correction: %{public}d, needRotation: %{public}d, scaleMode: %{public}d",
|
||||
node.GetScreenId(), mainWidth_, mainHeight_, mirrorWidth_, mirrorHeight_,
|
||||
screenRotation_, screenCorrection_, canvasRotation_, scaleMode_);
|
||||
}
|
||||
node.SetOriginScreenRotation(screenRotation_);
|
||||
}
|
||||
auto rotationDiff = static_cast<int>(node.GetOriginScreenRotation()) - static_cast<int>(screenCorrection_);
|
||||
auto rotationAngle = static_cast<ScreenRotation>((rotationDiff + SCREEN_ROTATION_NUM) % SCREEN_ROTATION_NUM);
|
||||
OriginScreenRotation(rotationAngle, renderFrameConfig_.width, renderFrameConfig_.height);
|
||||
|
||||
RS_LOGD("RSUniRenderVirtualProcessor::CanvasInit, id: %{public}" PRIu64 ", " \
|
||||
"screen(%{public}f, %{public}f, %{public}f, %{public}f), " \
|
||||
"rotation: %{public}d, correction: %{public}d, needRotation: %{public}d, rotationAngle: %{public}d",
|
||||
node.GetScreenId(), mainWidth_, mainHeight_, mirrorWidth_, mirrorHeight_,
|
||||
screenRotation_, screenCorrection_, canvasRotation_, rotationAngle);
|
||||
}
|
||||
|
||||
void RSUniRenderVirtualProcessor::CanvasInit(DrawableV2::RSDisplayRenderNodeDrawable& displayDrawable)
|
||||
{
|
||||
// Save the initial canvas state
|
||||
@ -301,36 +278,6 @@ void RSUniRenderVirtualProcessor::OriginScreenRotation(ScreenRotation screenRota
|
||||
}
|
||||
}
|
||||
|
||||
void RSUniRenderVirtualProcessor::ScaleMirrorIfNeed(RSDisplayRenderNode& node, RSPaintFilterCanvas& canvas)
|
||||
{
|
||||
if (screenCorrection_ == ScreenRotation::ROTATION_90 ||
|
||||
screenCorrection_ == ScreenRotation::ROTATION_270) {
|
||||
std::swap(mirrorWidth_, mirrorHeight_);
|
||||
}
|
||||
|
||||
auto angle = node.GetOriginScreenRotation();
|
||||
if (angle == ScreenRotation::ROTATION_90 ||
|
||||
angle == ScreenRotation::ROTATION_270) {
|
||||
std::swap(mirrorWidth_, mirrorHeight_);
|
||||
}
|
||||
|
||||
RS_LOGD("RSUniRenderVirtualProcessor::ScaleMirrorIfNeed:(%{public}f, %{public}f, %{public}f, %{public}f), " \
|
||||
"screenCorrection:%{public}d, oriRotation:%{public}d, scaleMode:%{public}d",
|
||||
mainWidth_, mainHeight_, mirrorWidth_, mirrorHeight_,
|
||||
static_cast<int>(screenCorrection_), static_cast<int>(angle), static_cast<int>(scaleMode_));
|
||||
|
||||
if (mainWidth_ == mirrorWidth_ && mainHeight_ == mirrorHeight_) {
|
||||
return;
|
||||
}
|
||||
|
||||
canvas.Clear(SK_ColorBLACK);
|
||||
if (scaleMode_ == ScreenScaleMode::FILL_MODE) {
|
||||
Fill(canvas, mainWidth_, mainHeight_, mirrorWidth_, mirrorHeight_);
|
||||
} else if (scaleMode_ == ScreenScaleMode::UNISCALE_MODE) {
|
||||
UniScale(canvas, mainWidth_, mainHeight_, mirrorWidth_, mirrorHeight_);
|
||||
}
|
||||
}
|
||||
|
||||
void RSUniRenderVirtualProcessor::ScaleMirrorIfNeed(const ScreenRotation angle, RSPaintFilterCanvas& canvas)
|
||||
{
|
||||
if (screenCorrection_ == ScreenRotation::ROTATION_90 ||
|
||||
@ -383,26 +330,6 @@ void RSUniRenderVirtualProcessor::ProcessSurface(RSSurfaceRenderNode& node)
|
||||
RS_LOGI("RSUniRenderVirtualProcessor::ProcessSurface() is not supported.");
|
||||
}
|
||||
|
||||
void RSUniRenderVirtualProcessor::CalculateTransform(RSDisplayRenderNode& node)
|
||||
{
|
||||
if (isExpand_) {
|
||||
return;
|
||||
}
|
||||
auto drawable = node.GetRenderDrawable();
|
||||
if (!drawable) {
|
||||
return;
|
||||
}
|
||||
auto displayDrawable = std::static_pointer_cast<DrawableV2::RSDisplayRenderNodeDrawable>(drawable);
|
||||
if (canvas_ == nullptr || displayDrawable->GetRSSurfaceHandlerOnDraw()->GetBuffer() == nullptr) {
|
||||
RS_LOGE("RSUniRenderVirtualProcessor::ProcessDisplaySurface: Canvas or buffer is null!");
|
||||
return;
|
||||
}
|
||||
|
||||
canvas_->Save();
|
||||
ScaleMirrorIfNeed(node, *canvas_);
|
||||
canvasMatrix_ = canvas_->GetTotalMatrix();
|
||||
}
|
||||
|
||||
void RSUniRenderVirtualProcessor::CalculateTransform(DrawableV2::RSDisplayRenderNodeDrawable& displayDrawable)
|
||||
{
|
||||
if (canvas_ == nullptr || displayDrawable.GetRSSurfaceHandlerOnDraw()->GetBuffer() == nullptr) {
|
||||
|
@ -50,7 +50,6 @@ public:
|
||||
void ProcessSurface(RSSurfaceRenderNode& node) override;
|
||||
void ProcessRcdSurface(RSRcdSurfaceRenderNode& node) override;
|
||||
void PostProcess() override;
|
||||
void ScaleMirrorIfNeed(RSDisplayRenderNode& node, RSPaintFilterCanvas& canvas);
|
||||
void Fill(RSPaintFilterCanvas& canvas,
|
||||
float mainWidth, float mainHeight, float mirrorWidth, float mirrorHeight);
|
||||
void UniScale(RSPaintFilterCanvas& canvas,
|
||||
@ -77,13 +76,11 @@ public:
|
||||
// when virtual screen partial refresh closed, use this function to reset RoiRegion in buffer
|
||||
GSError SetRoiRegionToCodec(std::vector<RectI>& damageRegion);
|
||||
bool RequestVirtualFrame(DrawableV2::RSDisplayRenderNodeDrawable& displayDrawable);
|
||||
void CalculateTransform(RSDisplayRenderNode& node);
|
||||
void CalculateTransform(DrawableV2::RSDisplayRenderNodeDrawable& displayDrawable);
|
||||
void ScaleMirrorIfNeed(const ScreenRotation angle, RSPaintFilterCanvas& canvas);
|
||||
void ProcessVirtualDisplaySurface(DrawableV2::RSDisplayRenderNodeDrawable& displayDrawable);
|
||||
private:
|
||||
void CanvasInit(DrawableV2::RSDisplayRenderNodeDrawable& displayDrawable);
|
||||
void CanvasInit(RSDisplayRenderNode& node);
|
||||
void OriginScreenRotation(ScreenRotation screenRotation, float width, float height);
|
||||
|
||||
sptr<Surface> producerSurface_;
|
||||
|
@ -762,7 +762,7 @@ void RSUniRenderVisitor::CalculateOcclusion(RSSurfaceRenderNode& node)
|
||||
// check current surface Participate In Occlusion
|
||||
if (node.CheckParticipateInOcclusion() && !isAllSurfaceVisibleDebugEnabled_) {
|
||||
accumulatedOcclusionRegion_.OrSelf(node.GetOpaqueRegion());
|
||||
std::unordered_set<NodeId> currentBlackList = GetCurrentBlackList();
|
||||
const auto& currentBlackList = GetCurrentBlackList();
|
||||
if (IsValidInVirtualScreen(node) && currentBlackList.find(node.GetId()) == currentBlackList.end()) {
|
||||
occlusionRegionWithoutSkipLayer_.OrSelf(node.GetOpaqueRegion());
|
||||
}
|
||||
@ -848,19 +848,13 @@ void RSUniRenderVisitor::SurfaceOcclusionCallbackToWMS()
|
||||
}
|
||||
}
|
||||
|
||||
std::unordered_set<NodeId> RSUniRenderVisitor::GetCurrentBlackList() const
|
||||
const std::unordered_set<NodeId>& RSUniRenderVisitor::GetCurrentBlackList() const
|
||||
{
|
||||
if (!screenManager_ || !curDisplayNode_) {
|
||||
return std::unordered_set<NodeId>();
|
||||
}
|
||||
|
||||
std::unordered_set<NodeId> currentBlackList;
|
||||
if (screenManager_->GetCastScreenEnableSkipWindow(curDisplayNode_->GetScreenId())) {
|
||||
screenManager_->GetCastScreenBlackList(currentBlackList);
|
||||
} else {
|
||||
currentBlackList = screenManager_->GetVirtualScreenBlackList(curDisplayNode_->GetScreenId());
|
||||
}
|
||||
return currentBlackList;
|
||||
return screenManager_->GetVirtualScreenBlackList(curDisplayNode_->GetScreenId());
|
||||
}
|
||||
|
||||
RSVisibleLevel RSUniRenderVisitor::GetRegionVisibleLevel(const Occlusion::Region& visibleRegion,
|
||||
|
@ -142,7 +142,7 @@ public:
|
||||
|
||||
void SurfaceOcclusionCallbackToWMS();
|
||||
|
||||
std::unordered_set<NodeId> GetCurrentBlackList() const;
|
||||
const std::unordered_set<NodeId>& GetCurrentBlackList() const;
|
||||
|
||||
static void ClearRenderGroupCache();
|
||||
|
||||
|
@ -932,36 +932,25 @@ ScreenId RSScreenManager::CreateVirtualScreen(
|
||||
return newId;
|
||||
}
|
||||
|
||||
void RSScreenManager::GetCastScreenBlackList(std::unordered_set<uint64_t>& screenBlackList)
|
||||
{
|
||||
std::lock_guard<std::mutex> lock(blackListMutex_);
|
||||
screenBlackList = castScreenBlackLists_;
|
||||
}
|
||||
|
||||
void RSScreenManager::SetCastScreenBlackList(std::unordered_set<uint64_t>& screenBlackList)
|
||||
{
|
||||
std::lock_guard<std::mutex> lock(blackListMutex_);
|
||||
castScreenBlackLists_ = screenBlackList;
|
||||
}
|
||||
|
||||
int32_t RSScreenManager::SetVirtualScreenBlackList(ScreenId id, const std::vector<uint64_t>& blackList)
|
||||
{
|
||||
std::lock_guard<std::mutex> lock(mutex_);
|
||||
std::unordered_set<NodeId> screenBlackList(blackList.begin(), blackList.end());
|
||||
if (id == INVALID_SCREEN_ID) {
|
||||
RS_LOGD("RSScreenManager %{public}s: CastScreenBlackLists.", __func__);
|
||||
SetCastScreenBlackList(screenBlackList);
|
||||
RS_LOGI("RSScreenManager %{public}s: Cast screen blacklists for id %{public}" PRIu64 ".", __func__, id);
|
||||
castScreenBlackLists_ = screenBlackList;
|
||||
return SUCCESS;
|
||||
}
|
||||
std::lock_guard<std::mutex> lock(mutex_);
|
||||
auto virtualScreen = screens_.find(id);
|
||||
if (virtualScreen == screens_.end()) {
|
||||
RS_LOGW("RSScreenManager %{public}s: There is no screen for id %{public}" PRIu64 ".", __func__, id);
|
||||
return SCREEN_NOT_FOUND;
|
||||
} else {
|
||||
if (virtualScreen->second != nullptr) {
|
||||
RS_LOGI("RSScreenManager %{public}s: Record screen blacklists for id %{public}" PRIu64 ".", __func__, id);
|
||||
virtualScreen->second->SetBlackList(screenBlackList);
|
||||
} else {
|
||||
RS_LOGW("RSScreenManager %{public}s: Null screen for id %{public}" PRIu64 ".", __func__, id);
|
||||
RS_LOGW("RSScreenManager %{public}s: BlackLists are null for id %{public}" PRIu64 ".", __func__, id);
|
||||
return SCREEN_NOT_FOUND;
|
||||
}
|
||||
}
|
||||
@ -975,7 +964,8 @@ int32_t RSScreenManager::SetVirtualScreenBlackList(ScreenId id, const std::vecto
|
||||
if (mainScreen->second != nullptr) {
|
||||
mainScreen->second->SetBlackList(screenBlackList);
|
||||
} else {
|
||||
RS_LOGW("RSScreenManager %{public}s: Null screen for id %{public}" PRIu64 ".", __func__, mainId);
|
||||
RS_LOGW("RSScreenManager %{public}s: BlackLists are null for id %{public}" PRIu64 ".",
|
||||
__func__, mainId);
|
||||
return SCREEN_NOT_FOUND;
|
||||
}
|
||||
}
|
||||
@ -1030,6 +1020,26 @@ const std::vector<uint64_t> RSScreenManager::GetVirtualScreenSecurityExemptionLi
|
||||
return virtualScreen->second->GetSecurityExemptionList();
|
||||
}
|
||||
|
||||
std::unordered_set<NodeId> RSScreenManager::GetVirtualScreenBlackList(ScreenId id) const
|
||||
{
|
||||
std::lock_guard<std::mutex> lock(mutex_);
|
||||
auto virtualScreen = screens_.find(id);
|
||||
if (virtualScreen == screens_.end()) {
|
||||
RS_LOGW("RSScreenManager %{public}s: There is no screen for id %{public}" PRIu64 ".", __func__, id);
|
||||
return {};
|
||||
}
|
||||
if (GetCastScreenEnableSkipWindow(id)) {
|
||||
RS_LOGD("RSScreenManager %{public}s: Cast screen blacklists for id %{public}" PRIu64 ".", __func__, id);
|
||||
return castScreenBlackLists_;
|
||||
}
|
||||
if (virtualScreen->second != nullptr) {
|
||||
RS_LOGD("RSScreenManager %{public}s: Record screen blacklists for id %{public}" PRIu64 ".", __func__, id);
|
||||
return virtualScreen->second->GetBlackList();
|
||||
}
|
||||
RS_LOGD("RSScreenManager %{public}s: BlackLists are null for id %{public}" PRIu64 ".", __func__, id);
|
||||
return {};
|
||||
}
|
||||
|
||||
int32_t RSScreenManager::SetCastScreenEnableSkipWindow(ScreenId id, bool enable)
|
||||
{
|
||||
std::lock_guard<std::mutex> lock(mutex_);
|
||||
@ -1048,7 +1058,7 @@ int32_t RSScreenManager::SetCastScreenEnableSkipWindow(ScreenId id, bool enable)
|
||||
}
|
||||
}
|
||||
|
||||
bool RSScreenManager::GetCastScreenEnableSkipWindow(ScreenId id)
|
||||
bool RSScreenManager::GetCastScreenEnableSkipWindow(ScreenId id) const
|
||||
{
|
||||
std::lock_guard<std::mutex> lock(mutex_);
|
||||
auto virtualScreen = screens_.find(id);
|
||||
@ -1065,23 +1075,6 @@ bool RSScreenManager::GetCastScreenEnableSkipWindow(ScreenId id)
|
||||
}
|
||||
}
|
||||
|
||||
std::unordered_set<NodeId> RSScreenManager::GetVirtualScreenBlackList(ScreenId id)
|
||||
{
|
||||
std::lock_guard<std::mutex> lock(mutex_);
|
||||
auto virtualScreen = screens_.find(id);
|
||||
if (virtualScreen == screens_.end()) {
|
||||
RS_LOGW("RSScreenManager %{public}s: There is no screen for id %{public}" PRIu64 ".", __func__, id);
|
||||
return {};
|
||||
} else {
|
||||
if (virtualScreen->second != nullptr) {
|
||||
return virtualScreen->second->GetBlackList();
|
||||
} else {
|
||||
RS_LOGW("RSScreenManager %{public}s: Null screen for id %{public}" PRIu64 ".", __func__, id);
|
||||
return {};
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
int32_t RSScreenManager::SetVirtualScreenSurface(ScreenId id, sptr<Surface> surface)
|
||||
{
|
||||
std::lock_guard<std::mutex> lock(mutex_);
|
||||
|
@ -78,12 +78,8 @@ public:
|
||||
virtual const std::vector<uint64_t> GetVirtualScreenSecurityExemptionList(ScreenId id) = 0;
|
||||
|
||||
virtual int32_t SetCastScreenEnableSkipWindow(ScreenId id, bool enable) = 0;
|
||||
|
||||
virtual void GetCastScreenBlackList(std::unordered_set<uint64_t>& screenBlackList) = 0;
|
||||
|
||||
virtual bool GetCastScreenEnableSkipWindow(ScreenId id) = 0;
|
||||
|
||||
virtual std::unordered_set<uint64_t> GetVirtualScreenBlackList(ScreenId id) = 0;
|
||||
virtual std::unordered_set<uint64_t> GetVirtualScreenBlackList(ScreenId id) const = 0;
|
||||
|
||||
virtual int32_t SetVirtualScreenSurface(ScreenId id, sptr<Surface> surface) = 0;
|
||||
|
||||
@ -282,12 +278,8 @@ public:
|
||||
const std::vector<uint64_t> GetVirtualScreenSecurityExemptionList(ScreenId id) override;
|
||||
|
||||
int32_t SetCastScreenEnableSkipWindow(ScreenId id, bool enable) override;
|
||||
|
||||
void GetCastScreenBlackList(std::unordered_set<uint64_t>& screenBlackList) override;
|
||||
|
||||
bool GetCastScreenEnableSkipWindow(ScreenId id) override;
|
||||
|
||||
std::unordered_set<uint64_t> GetVirtualScreenBlackList(ScreenId id) override;
|
||||
std::unordered_set<uint64_t> GetVirtualScreenBlackList(ScreenId id) const override;
|
||||
|
||||
int32_t SetVirtualScreenSurface(ScreenId id, sptr<Surface> surface) override;
|
||||
|
||||
@ -467,7 +459,6 @@ private:
|
||||
ScreenRotation GetScreenCorrectionLocked(ScreenId id) const;
|
||||
int32_t GetScreenBacklightLocked(ScreenId id) const;
|
||||
|
||||
void SetCastScreenBlackList(std::unordered_set<uint64_t>& screenBlackList);
|
||||
void RemoveVirtualScreenLocked(ScreenId id);
|
||||
ScreenId GenerateVirtualScreenIdLocked();
|
||||
void ReuseVirtualScreenIdLocked(ScreenId id);
|
||||
@ -491,6 +482,7 @@ private:
|
||||
int32_t GetScreenColorSpaceLocked(ScreenId id, GraphicCM_ColorSpaceType& colorSpace) const;
|
||||
int32_t SetScreenColorSpaceLocked(ScreenId id, GraphicCM_ColorSpaceType colorSpace);
|
||||
ScreenInfo QueryScreenInfoLocked(ScreenId id) const;
|
||||
bool GetCastScreenEnableSkipWindow(ScreenId id) const;
|
||||
|
||||
#ifdef RS_SUBSCRIBE_SENSOR_ENABLE
|
||||
void RegisterSensorCallback();
|
||||
|
@ -797,6 +797,8 @@ void RSSurfaceRenderNode::SetSecurityLayer(bool isSecurityLayer)
|
||||
} else {
|
||||
securityLayerIds_.erase(GetId());
|
||||
}
|
||||
ROSEN_LOGI("RSSurfaceRenderNode::SetSecurityLayer, Node id: %{public}" PRIu64 ", SecurityLayer:%{public}d",
|
||||
GetId(), isSecurityLayer);
|
||||
SyncSecurityInfoToFirstLevelNode();
|
||||
}
|
||||
|
||||
|
@ -254,7 +254,7 @@ void RSSurfaceNode::SetSecurityLayer(bool isSecurityLayer)
|
||||
if (transactionProxy != nullptr) {
|
||||
transactionProxy->AddCommand(command, true);
|
||||
}
|
||||
ROSEN_LOGD("RSSurfaceNode::SetSecurityLayer, surfaceNodeId:[%{public}" PRIu64 "] isSecurityLayer:%{public}s",
|
||||
ROSEN_LOGI("RSSurfaceNode::SetSecurityLayer, surfaceNodeId:[%{public}" PRIu64 "] isSecurityLayer:%{public}s",
|
||||
GetId(), isSecurityLayer ? "true" : "false");
|
||||
}
|
||||
|
||||
|
@ -184,38 +184,6 @@ HWTEST_F(RSUniRenderVirtualProcessorTest, OriginScreenRotation, TestSize.Level2)
|
||||
virtualProcessor->OriginScreenRotation(ScreenRotation::ROTATION_270, DEFAULT_CANVAS_WIDTH, DEFAULT_CANVAS_HEIGHT);
|
||||
}
|
||||
|
||||
/**
|
||||
* @tc.name: ScaleMirrorIfNeed
|
||||
* @tc.desc: ScaleMirrorIfNeed Test
|
||||
* @tc.type: FUNC
|
||||
* @tc.require: issueI992VW
|
||||
*/
|
||||
HWTEST_F(RSUniRenderVirtualProcessorTest, ScaleMirrorIfNeed, TestSize.Level2)
|
||||
{
|
||||
auto processor = RSProcessorFactory::CreateProcessor(RSDisplayRenderNode::CompositeType::
|
||||
UNI_RENDER_MIRROR_COMPOSITE);
|
||||
auto virtualProcessor = std::static_pointer_cast<RSUniRenderVirtualProcessor>(processor);
|
||||
ASSERT_NE(nullptr, virtualProcessor);
|
||||
RSDisplayNodeConfig config;
|
||||
NodeId id = 0;
|
||||
RSDisplayRenderNode rsDisplayRenderNode(id, config);
|
||||
auto drawingCanvas = std::make_shared<Drawing::Canvas>(DEFAULT_CANVAS_WIDTH, DEFAULT_CANVAS_HEIGHT);
|
||||
ASSERT_NE(nullptr, drawingCanvas);
|
||||
virtualProcessor->canvas_ = std::make_unique<RSPaintFilterCanvas>(drawingCanvas.get());
|
||||
ASSERT_NE(nullptr, virtualProcessor->canvas_);
|
||||
virtualProcessor->scaleMode_ = ScreenScaleMode::FILL_MODE;
|
||||
virtualProcessor->ScaleMirrorIfNeed(rsDisplayRenderNode, *virtualProcessor->canvas_);
|
||||
|
||||
virtualProcessor->virtualScreenWidth_ = DEFAULT_CANVAS_WIDTH;
|
||||
virtualProcessor->virtualScreenHeight_ = DEFAULT_CANVAS_HEIGHT;
|
||||
virtualProcessor->mirroredScreenWidth_ = DEFAULT_CANVAS_WIDTH / 2;
|
||||
virtualProcessor->mirroredScreenHeight_ = DEFAULT_CANVAS_HEIGHT / 2;
|
||||
virtualProcessor->ScaleMirrorIfNeed(rsDisplayRenderNode, *virtualProcessor->canvas_);
|
||||
|
||||
virtualProcessor->scaleMode_ = ScreenScaleMode::UNISCALE_MODE;
|
||||
virtualProcessor->ScaleMirrorIfNeed(rsDisplayRenderNode, *virtualProcessor->canvas_);
|
||||
}
|
||||
|
||||
/**
|
||||
* @tc.name: Fill
|
||||
* @tc.desc: Fill Test
|
||||
@ -366,68 +334,6 @@ HWTEST_F(RSUniRenderVirtualProcessorTest, SetDirtyInfo_002, TestSize.Level2)
|
||||
virtualProcessor_->SetDirtyInfo(damageRegion);
|
||||
}
|
||||
|
||||
/**
|
||||
* @tc.name: CalculateTransform_001
|
||||
* @tc.desc: CalculateTransform Test, isExpand_ is false, return directly
|
||||
* @tc.type:FUNC
|
||||
* @tc.require:issuesIAJ4FW
|
||||
*/
|
||||
HWTEST_F(RSUniRenderVirtualProcessorTest, CalculateTransform_001, TestSize.Level2)
|
||||
{
|
||||
virtualProcessor_->isExpand_ = false;
|
||||
|
||||
virtualProcessor_->CalculateTransform(*rsDisplayRenderNode_);
|
||||
}
|
||||
|
||||
/**
|
||||
* @tc.name: CalculateTransform_002
|
||||
* @tc.desc: CalculateTransform Test, isExpand_ is true, renderDrawable_ is null , return directly
|
||||
* @tc.type:FUNC
|
||||
* @tc.require:issuesIAJ4FW
|
||||
*/
|
||||
HWTEST_F(RSUniRenderVirtualProcessorTest, CalculateTransform_002, TestSize.Level2)
|
||||
{
|
||||
virtualProcessor_->isExpand_ = true;
|
||||
rsDisplayRenderNode_->renderDrawable_ = nullptr;
|
||||
ASSERT_EQ(rsDisplayRenderNode_->GetRenderDrawable(), nullptr);
|
||||
|
||||
virtualProcessor_->CalculateTransform(*rsDisplayRenderNode_);
|
||||
}
|
||||
|
||||
/**
|
||||
* @tc.name: CalculateTransform_003
|
||||
* @tc.desc: CalculateTransform Test,isExpand_ is true, renderDrawable_ is not null,and canvas_ is null
|
||||
* @tc.type:FUNC
|
||||
* @tc.require:issuesIAJ4FW
|
||||
*/
|
||||
HWTEST_F(RSUniRenderVirtualProcessorTest, CalculateTransform_003, TestSize.Level2)
|
||||
{
|
||||
virtualProcessor_->isExpand_ = true;
|
||||
auto rsRenderNode = std::make_shared<RSRenderNode>(nodeId_);
|
||||
rsDisplayRenderNode_->renderDrawable_ = std::make_shared<DrawableV2::RSRenderNodeDrawable>(rsRenderNode);
|
||||
ASSERT_NE(rsDisplayRenderNode_->GetRenderDrawable(), nullptr);
|
||||
|
||||
virtualProcessor_->canvas_ = nullptr;
|
||||
virtualProcessor_->CalculateTransform(*rsDisplayRenderNode_);
|
||||
}
|
||||
|
||||
/**
|
||||
* @tc.name: CalculateTransform_004
|
||||
* @tc.desc: CalculateTransform Test,isExpand_ is true, renderDrawable_ is not null,and canvas_ not null
|
||||
* @tc.type:FUNC
|
||||
* @tc.require:issuesIAJ4FW
|
||||
*/
|
||||
HWTEST_F(RSUniRenderVirtualProcessorTest, CalculateTransform_004, TestSize.Level2)
|
||||
{
|
||||
virtualProcessor_->isExpand_ = true;
|
||||
auto rsRenderNode = std::make_shared<RSRenderNode>(nodeId_);
|
||||
rsDisplayRenderNode_->renderDrawable_ = std::make_shared<DrawableV2::RSRenderNodeDrawable>(rsRenderNode);
|
||||
ASSERT_NE(rsDisplayRenderNode_->GetRenderDrawable(), nullptr);
|
||||
|
||||
ASSERT_NE(virtualProcessor_->canvas_, nullptr);
|
||||
virtualProcessor_->CalculateTransform(*rsDisplayRenderNode_);
|
||||
}
|
||||
|
||||
/**
|
||||
* @tc.name: ProcessDisplaySurfaceForRenderThread_001
|
||||
* @tc.desc: ProcessDisplaySurfaceForRenderThread Test, isExpand_ is true, return directly
|
||||
|
Loading…
Reference in New Issue
Block a user