mirror of
https://gitee.com/openharmony/graphic_graphic_2d
synced 2024-11-27 01:00:50 +00:00
回退 'Pull Request !15982 : PC扩展屏支持硬光标特性'
This commit is contained in:
parent
7013dedaf8
commit
7afdae73cf
@ -351,28 +351,6 @@ static void ClipRegion(Drawing::Canvas& canvas, Drawing::Region& region, bool cl
|
||||
}
|
||||
}
|
||||
|
||||
bool RSDisplayRenderNodeDrawable::HardCursorCreateLayer(std::shared_ptr<RSProcessor> processor)
|
||||
{
|
||||
bool ret = false;
|
||||
auto& hardCursorDrawables = RSUniRenderThread::Instance().GetRSRenderThreadParams()->GetHardCursorDrawables();
|
||||
RS_OPTIONAL_TRACE_NAME_FMT("HardCursorCreateLayer size:%d", static_cast<int>(hardCursorDrawables.size()));
|
||||
for (const auto& drawable : hardCursorDrawables) {
|
||||
if (drawable.id != GetId() || !drawable.drawablePtr) {
|
||||
continue;
|
||||
}
|
||||
auto surfaceParams = static_cast<RSSurfaceRenderParams*>(drawable.drawablePtr->GetRenderParams().get());
|
||||
if (!surfaceParams) {
|
||||
continue;
|
||||
}
|
||||
auto surfaceDrawable = std::static_pointer_cast<RSSurfaceRenderNodeDrawable>(drawable.drawablePtr);
|
||||
if (surfaceParams->IsHardCursorEnabled()) {
|
||||
processor->CreateLayerForRenderThread(*surfaceDrawable);
|
||||
ret = true;
|
||||
}
|
||||
}
|
||||
return ret;
|
||||
}
|
||||
|
||||
bool RSDisplayRenderNodeDrawable::CheckDisplayNodeSkip(
|
||||
RSDisplayRenderParams& params, std::shared_ptr<RSProcessor> processor)
|
||||
{
|
||||
@ -389,9 +367,8 @@ bool RSDisplayRenderNodeDrawable::CheckDisplayNodeSkip(
|
||||
RSUniRenderThread::Instance().SetSkipJankAnimatorFrame(true);
|
||||
#endif
|
||||
auto pendingDrawables = RSUifirstManager::Instance().GetPendingPostDrawables();
|
||||
auto isHardCursor = HardCursorCreateLayer(processor);
|
||||
if (!RSUniRenderThread::Instance().GetRSRenderThreadParams()->GetForceCommitLayer() &&
|
||||
pendingDrawables.size() == 0 && !isHardCursor) {
|
||||
pendingDrawables.size() == 0) {
|
||||
RS_TRACE_NAME("DisplayNodeSkip skip commit");
|
||||
return true;
|
||||
}
|
||||
@ -541,14 +518,7 @@ void RSDisplayRenderNodeDrawable::OnDraw(Drawing::Canvas& canvas)
|
||||
}
|
||||
drawable->GetRenderParams()->SetLayerCreated(false);
|
||||
}
|
||||
auto& hardCursorDrawables = uniParam->GetHardCursorDrawables();
|
||||
for (const auto& drawable : hardCursorDrawables) {
|
||||
if (drawable.id != GetId() || !drawable.drawablePtr ||
|
||||
!drawable.drawablePtr->GetRenderParams()) {
|
||||
continue;
|
||||
}
|
||||
drawable.drawablePtr->GetRenderParams()->SetLayerCreated(false);
|
||||
}
|
||||
|
||||
// if screen power off, skip on draw, needs to draw one more frame.
|
||||
if (params && RSUniRenderUtil::CheckRenderSkipIfScreenOff(true, params->GetScreenId())) {
|
||||
return;
|
||||
@ -835,7 +805,6 @@ void RSDisplayRenderNodeDrawable::OnDraw(Drawing::Canvas& canvas)
|
||||
processor->CreateLayerForRenderThread(*surfaceDrawable);
|
||||
}
|
||||
}
|
||||
HardCursorCreateLayer(processor);
|
||||
SetDirtyRects(damageRegionrects);
|
||||
processor->ProcessDisplaySurfaceForRenderThread(*this);
|
||||
RSUifirstManager::Instance().CreateUIFirstLayer(processor);
|
||||
@ -1427,20 +1396,6 @@ void RSDisplayRenderNodeDrawable::FindHardwareEnabledNodes(RSDisplayRenderParams
|
||||
params.GetHardwareEnabledDrawables().emplace_back(drawable);
|
||||
}
|
||||
}
|
||||
auto& hardCursorDrawables = RSUniRenderThread::Instance().GetRSRenderThreadParams()->GetHardCursorDrawables();
|
||||
for (const auto& drawable : hardCursorDrawables) {
|
||||
if (drawable.id != GetId() || !drawable.drawablePtr) {
|
||||
continue;
|
||||
}
|
||||
auto surfaceParams = static_cast<RSSurfaceRenderParams*>(drawable.drawablePtr->GetRenderParams().get());
|
||||
if (!surfaceParams) {
|
||||
continue;
|
||||
}
|
||||
auto surfaceDrawable = std::static_pointer_cast<RSSurfaceRenderNodeDrawable>(drawable.drawablePtr);
|
||||
if (surfaceParams->IsHardCursorEnabled()) {
|
||||
params.GetHardwareEnabledTopDrawables().emplace_back(drawable.drawablePtr);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
@ -159,7 +159,6 @@ private:
|
||||
void UpdateDisplayDirtyManager(int32_t bufferage, bool useAlignedDirtyRegion = false);
|
||||
static void CheckFilterCacheFullyCovered(RSSurfaceRenderParams& surfaceParams, RectI screenRect);
|
||||
static void CheckAndUpdateFilterCacheOcclusion(RSDisplayRenderParams& params, ScreenInfo& screenInfo);
|
||||
bool HardCursorCreateLayer(std::shared_ptr<RSProcessor> processor);
|
||||
// For P3-scRGB Control
|
||||
bool EnablescRGBForP3AndUiFirst(const GraphicColorGamut& currentGamut);
|
||||
|
||||
|
@ -294,12 +294,6 @@ bool RSSurfaceRenderNodeDrawable::IsHardwareEnabled()
|
||||
return false;
|
||||
}
|
||||
|
||||
bool RSSurfaceRenderNodeDrawable::IsHardwareEnabledTopSurface() const
|
||||
{
|
||||
return surfaceNodeType_ == RSSurfaceNodeType::SELF_DRAWING_WINDOW_NODE &&
|
||||
GetName() == "pointer window" && RSSystemProperties::GetHardCursorEnabled();
|
||||
}
|
||||
|
||||
void RSSurfaceRenderNodeDrawable::OnDraw(Drawing::Canvas& canvas)
|
||||
{
|
||||
if (!ShouldPaint()) {
|
||||
@ -355,10 +349,6 @@ void RSSurfaceRenderNodeDrawable::OnDraw(Drawing::Canvas& canvas)
|
||||
if (hasSkipCacheLayer_ && curDrawingCacheRoot_) {
|
||||
curDrawingCacheRoot_->SetSkipCacheLayer(true);
|
||||
}
|
||||
if (surfaceParams->IsHardCursorEnabled()) {
|
||||
RS_TRACE_NAME_FMT("RSSurfaceRenderNodeDrawable::OnDraw hardcursor skip SurfaceName:%s", name_.c_str());
|
||||
return;
|
||||
}
|
||||
|
||||
Drawing::Region curSurfaceDrawRegion = CalculateVisibleRegion(*uniParam, *surfaceParams, *this, isUiFirstNode);
|
||||
|
||||
@ -751,8 +741,7 @@ GraphicColorGamut RSSurfaceRenderNodeDrawable::GetAncestorDisplayColorGamut(cons
|
||||
void RSSurfaceRenderNodeDrawable::DealWithSelfDrawingNodeBuffer(
|
||||
RSPaintFilterCanvas& canvas, RSSurfaceRenderParams& surfaceParams)
|
||||
{
|
||||
if ((surfaceParams.GetHardwareEnabled() || surfaceParams.IsHardCursorEnabled()) &&
|
||||
!RSUniRenderThread::IsInCaptureProcess()) {
|
||||
if (surfaceParams.GetHardwareEnabled() && !RSUniRenderThread::IsInCaptureProcess()) {
|
||||
if (!IsHardwareEnabledTopSurface() && !surfaceParams.IsLayerTop()) {
|
||||
ClipHoleForSelfDrawingNode(canvas, surfaceParams);
|
||||
}
|
||||
|
@ -234,8 +234,10 @@ public:
|
||||
}
|
||||
void RegisterDeleteBufferListenerOnSync(sptr<IConsumerSurface> consumer) override;
|
||||
#endif
|
||||
|
||||
bool IsHardwareEnabledTopSurface() const;
|
||||
bool IsHardwareEnabledTopSurface() const
|
||||
{
|
||||
return surfaceNodeType_ == RSSurfaceNodeType::SELF_DRAWING_WINDOW_NODE && GetName() == "pointer window";
|
||||
}
|
||||
|
||||
inline bool CheckCacheSurface()
|
||||
{
|
||||
|
@ -1558,15 +1558,6 @@ void RSMainThread::CollectInfoForHardwareComposer()
|
||||
});
|
||||
}
|
||||
|
||||
void RSMainThread::CollectInfoForHardCursor(NodeId id,
|
||||
DrawableV2::RSRenderNodeDrawableAdapter::SharedPtr cursorDrawable)
|
||||
{
|
||||
if (!isUniRender_) {
|
||||
return;
|
||||
}
|
||||
hardCursorDrawables_.push_back({ id, cursorDrawable });
|
||||
}
|
||||
|
||||
bool RSMainThread::IsLastFrameUIFirstEnabled(NodeId appNodeId) const
|
||||
{
|
||||
for (auto& node : subThreadNodes_) {
|
||||
@ -2004,7 +1995,6 @@ void RSMainThread::UniRender(std::shared_ptr<RSBaseRenderNode> rootNode)
|
||||
WaitUntilUploadTextureTaskFinishedForGL();
|
||||
renderThreadParams_->selfDrawables_ = std::move(selfDrawables_);
|
||||
renderThreadParams_->hardwareEnabledTypeDrawables_ = std::move(hardwareEnabledDrwawables_);
|
||||
renderThreadParams_->hardCursorDrawables_ = std::move(hardCursorDrawables_);
|
||||
return;
|
||||
}
|
||||
}
|
||||
@ -2025,7 +2015,6 @@ void RSMainThread::UniRender(std::shared_ptr<RSBaseRenderNode> rootNode)
|
||||
uniVisitor->SurfaceOcclusionCallbackToWMS();
|
||||
rsVsyncRateReduceManager_.SetUniVsync();
|
||||
renderThreadParams_->selfDrawables_ = std::move(selfDrawables_);
|
||||
renderThreadParams_->hardCursorDrawables_ = std::move(hardCursorDrawables_);
|
||||
renderThreadParams_->hardwareEnabledTypeDrawables_ = std::move(hardwareEnabledDrwawables_);
|
||||
renderThreadParams_->isOverDrawEnabled_ = isOverDrawEnabledOfCurFrame_;
|
||||
renderThreadParams_->isDrawingCacheDfxEnabled_ = isDrawingCacheDfxEnabledOfCurFrame_;
|
||||
@ -3848,7 +3837,6 @@ void RSMainThread::ResetHardwareEnabledState(bool isUniRender)
|
||||
hardwareEnabledDrwawables_.clear();
|
||||
selfDrawingNodes_.clear();
|
||||
selfDrawables_.clear();
|
||||
hardCursorDrawables_.clear();
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -362,8 +362,6 @@ public:
|
||||
|
||||
bool IsHardwareEnabledNodesNeedSync();
|
||||
bool IsOcclusionNodesNeedSync(NodeId id, bool useCurWindow);
|
||||
void CollectInfoForHardCursor(NodeId id,
|
||||
DrawableV2::RSRenderNodeDrawableAdapter::SharedPtr cursorDrawable);
|
||||
|
||||
void CallbackDrawContextStatusToWMS(bool isUniRender = false);
|
||||
void SetHardwareTaskNum(uint32_t num);
|
||||
@ -630,7 +628,6 @@ private:
|
||||
std::vector<DrawableV2::RSRenderNodeDrawableAdapter::SharedPtr> selfDrawables_;
|
||||
bool isHardwareForcedDisabled_ = false; // if app node has shadow or filter, disable hardware composer for all
|
||||
std::vector<DrawableV2::RSRenderNodeDrawableAdapter::SharedPtr> hardwareEnabledDrwawables_;
|
||||
std::vector<HardCursorInfo> hardCursorDrawables_;
|
||||
|
||||
// for client node tree dump
|
||||
struct NodeTreeDumpTask {
|
||||
|
@ -802,9 +802,6 @@ void RSUniRenderVisitor::QuickPrepareSurfaceRenderNode(RSSurfaceRenderNode& node
|
||||
CheckIsGpuOverDrawBufferOptimizeNode(node);
|
||||
}
|
||||
PostPrepare(node, !isSubTreeNeedPrepare);
|
||||
if (node.IsHardwareEnabledTopSurface() && node.shared_from_this()) {
|
||||
UpdateHwcNodeProperty(node.shared_from_this()->ReinterpretCastTo<RSSurfaceRenderNode>());
|
||||
}
|
||||
CheckMergeFilterDirtyByIntersectWithDirty(curSurfaceNoBelowDirtyFilter_, false);
|
||||
curAlpha_ = prevAlpha;
|
||||
prepareClipRect_ = prepareClipRect;
|
||||
@ -1258,10 +1255,6 @@ bool RSUniRenderVisitor::BeforeUpdateSurfaceDirtyCalc(RSSurfaceRenderNode& node)
|
||||
if (node.GetRSSurfaceHandler() && node.GetRSSurfaceHandler()->GetBuffer()) {
|
||||
node.SetBufferRelMatrix(RSUniRenderUtil::GetMatrixOfBufferToRelRect(node));
|
||||
}
|
||||
if (node.IsHardwareEnabledTopSurface()) {
|
||||
RSMainThread::Instance()->CollectInfoForHardCursor(curDisplayNode_->GetId(),
|
||||
node.GetRenderDrawable());
|
||||
}
|
||||
node.setQosCal((RSMainThread::Instance()->GetDeviceType() == DeviceType::PC) &&
|
||||
RSSystemParameters::GetVSyncControlEnabled());
|
||||
return true;
|
||||
@ -1299,9 +1292,6 @@ bool RSUniRenderVisitor::AfterUpdateSurfaceDirtyCalc(RSSurfaceRenderNode& node)
|
||||
}
|
||||
// 3. Update HwcNode Info for appNode
|
||||
UpdateHwcNodeInfoForAppNode(node);
|
||||
if (node.IsHardwareEnabledTopSurface()) {
|
||||
UpdateSrcRect(node, geoPtr->GetAbsMatrix(), geoPtr->GetAbsRect());
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
@ -1388,14 +1378,12 @@ void RSUniRenderVisitor::UpdateSrcRect(RSSurfaceRenderNode& node,
|
||||
void RSUniRenderVisitor::UpdateDstRect(RSSurfaceRenderNode& node, const RectI& absRect, const RectI& clipRect)
|
||||
{
|
||||
auto dstRect = absRect;
|
||||
if (!node.IsHardwareEnabledTopSurface()) {
|
||||
// If the screen is expanded, intersect the destination rectangle with the screen rectangle
|
||||
dstRect = dstRect.IntersectRect(RectI(curDisplayNode_->GetDisplayOffsetX(),
|
||||
curDisplayNode_->GetDisplayOffsetY(), screenInfo_.width, screenInfo_.height));
|
||||
// Remove the offset of the screen
|
||||
dstRect.left_ = dstRect.left_ - curDisplayNode_->GetDisplayOffsetX();
|
||||
dstRect.top_ = dstRect.top_ - curDisplayNode_->GetDisplayOffsetY();
|
||||
}
|
||||
// If the screen is expanded, intersect the destination rectangle with the screen rectangle
|
||||
dstRect = dstRect.IntersectRect(RectI(curDisplayNode_->GetDisplayOffsetX(), curDisplayNode_->GetDisplayOffsetY(),
|
||||
screenInfo_.width, screenInfo_.height));
|
||||
// Remove the offset of the screen
|
||||
dstRect.left_ = dstRect.left_ - curDisplayNode_->GetDisplayOffsetX();
|
||||
dstRect.top_ = dstRect.top_ - curDisplayNode_->GetDisplayOffsetY();
|
||||
// If the node is a hardware-enabled type, intersect its destination rectangle with the prepare clip rectangle
|
||||
if (node.IsHardwareEnabledType()) {
|
||||
dstRect = dstRect.IntersectRect(clipRect);
|
||||
@ -1775,6 +1763,7 @@ void RSUniRenderVisitor::UpdateHwcNodeDirtyRegionAndCreateLayer(std::shared_ptr<
|
||||
if (hwcNodes.empty()) {
|
||||
return;
|
||||
}
|
||||
std::shared_ptr<RSSurfaceRenderNode> pointWindow;
|
||||
std::vector<std::shared_ptr<RSSurfaceRenderNode>> topLayers;
|
||||
for (auto hwcNode : hwcNodes) {
|
||||
auto hwcNodePtr = hwcNode.lock();
|
||||
@ -1786,6 +1775,10 @@ void RSUniRenderVisitor::UpdateHwcNodeDirtyRegionAndCreateLayer(std::shared_ptr<
|
||||
topLayers.emplace_back(hwcNodePtr);
|
||||
continue;
|
||||
}
|
||||
if (node->IsHardwareEnabledTopSurface()) {
|
||||
pointWindow = hwcNodePtr;
|
||||
continue;
|
||||
}
|
||||
if (hasUniRenderHdrSurface_) {
|
||||
hwcNodePtr->SetHardwareForcedDisabledState(true);
|
||||
}
|
||||
@ -1801,85 +1794,9 @@ void RSUniRenderVisitor::UpdateHwcNodeDirtyRegionAndCreateLayer(std::shared_ptr<
|
||||
if (!topLayers.empty()) {
|
||||
UpdateTopLayersDirtyStatus(topLayers);
|
||||
}
|
||||
}
|
||||
|
||||
bool RSUniRenderVisitor::HasMirrorDisplay() const
|
||||
{
|
||||
const std::shared_ptr<RSBaseRenderNode> rootNode =
|
||||
RSMainThread::Instance()->GetContext().GetGlobalRootRenderNode();
|
||||
if (rootNode == nullptr || rootNode->GetChildrenCount() <= 1) {
|
||||
return false;
|
||||
if (pointWindow) {
|
||||
UpdatePointWindowDirtyStatus(pointWindow);
|
||||
}
|
||||
for (auto& child : *rootNode->GetSortedChildren()) {
|
||||
if (!child || !child->IsInstanceOf<RSDisplayRenderNode>()) {
|
||||
continue;
|
||||
}
|
||||
auto displayNode = child->ReinterpretCastTo<RSDisplayRenderNode>();
|
||||
if (!displayNode) {
|
||||
continue;
|
||||
}
|
||||
if (displayNode->IsMirrorDisplay()) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
bool RSUniRenderVisitor::HasVirtualDisplay() const
|
||||
{
|
||||
const std::shared_ptr<RSBaseRenderNode> rootNode =
|
||||
RSMainThread::Instance()->GetContext().GetGlobalRootRenderNode();
|
||||
if (rootNode == nullptr || rootNode->GetChildrenCount() <= 1) {
|
||||
return false;
|
||||
}
|
||||
bool hasVirtualDisplay = false;
|
||||
for (auto& child : *rootNode->GetSortedChildren()) {
|
||||
if (!child || !child->IsInstanceOf<RSDisplayRenderNode>()) {
|
||||
continue;
|
||||
}
|
||||
auto displayNode = child->ReinterpretCastTo<RSDisplayRenderNode>();
|
||||
if (!displayNode) {
|
||||
continue;
|
||||
}
|
||||
auto screenManager = CreateOrGetScreenManager();
|
||||
if (!screenManager) {
|
||||
return false;
|
||||
}
|
||||
RSScreenType screenType;
|
||||
screenManager->GetScreenType(displayNode->GetScreenId(), screenType);
|
||||
if (screenType == RSScreenType::VIRTUAL_TYPE_SCREEN) {
|
||||
hasVirtualDisplay = true;
|
||||
}
|
||||
}
|
||||
return hasVirtualDisplay;
|
||||
}
|
||||
|
||||
bool RSUniRenderVisitor::CheckIfHardCursorEnable() const
|
||||
{
|
||||
if (RSMainThread::Instance()->GetDeviceType() != DeviceType::PC) {
|
||||
return false;
|
||||
}
|
||||
std::shared_ptr<RSBaseRenderNode> rootNode =
|
||||
RSMainThread::Instance()->GetContext().GetGlobalRootRenderNode();
|
||||
if (rootNode == nullptr) {
|
||||
RS_LOGE("CheckIfHardCursorEnable rootNode is nullptr");
|
||||
return false;
|
||||
}
|
||||
auto childCount = rootNode->GetChildrenCount();
|
||||
if (childCount == 1) {
|
||||
return true;
|
||||
} else if (childCount < 1) {
|
||||
return false;
|
||||
}
|
||||
bool hasMirrorDisplay = HasMirrorDisplay();
|
||||
bool hasVirtualDisplay = HasVirtualDisplay();
|
||||
RS_LOGD("CheckIfHardCursorEnable childCount:%{public}d, hasMirrorDisplay:%{public}d, hasVirtualDisplay:%{public}d",
|
||||
childCount, hasMirrorDisplay, hasVirtualDisplay);
|
||||
// For expand physical screen.
|
||||
if (!hasMirrorDisplay || (hasMirrorDisplay && hasVirtualDisplay)) {
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
void RSUniRenderVisitor::UpdatePointWindowDirtyStatus(std::shared_ptr<RSSurfaceRenderNode>& pointWindow)
|
||||
@ -1888,10 +1805,9 @@ void RSUniRenderVisitor::UpdatePointWindowDirtyStatus(std::shared_ptr<RSSurfaceR
|
||||
if (pointSurfaceHandler) {
|
||||
// globalZOrder_ + 2 is displayNode layer, point window must be at the top.
|
||||
pointSurfaceHandler->SetGlobalZOrder(globalZOrder_ + 2);
|
||||
auto checkHardCursorEnable = CheckIfHardCursorEnable();
|
||||
pointWindow->SetHardwareForcedDisabledState(true);
|
||||
pointWindow->SetHardwareForcedDisabledState(!IsHardwareComposerEnabled() || !pointWindow->ShouldPaint());
|
||||
auto transform = RSUniRenderUtil::GetLayerTransform(*pointWindow, screenInfo_);
|
||||
pointWindow->UpdateHwcNodeLayerInfo(transform, checkHardCursorEnable);
|
||||
pointWindow->UpdateHwcNodeLayerInfo(transform);
|
||||
if (RSMainThread::Instance()->GetDeviceType() == DeviceType::PC) {
|
||||
pointerWindowManager_.UpdatePointerDirtyToGlobalDirty(pointWindow, curDisplayNode_);
|
||||
}
|
||||
@ -1953,9 +1869,6 @@ void RSUniRenderVisitor::UpdateSurfaceDirtyAndGlobalDirty()
|
||||
RSMainThread::Instance()->GetContext().AddPendingSyncNode(nodePtr);
|
||||
// 0. update hwc node dirty region and create layer
|
||||
UpdateHwcNodeDirtyRegionAndCreateLayer(surfaceNode);
|
||||
if (surfaceNode->IsHardwareEnabledTopSurface()) {
|
||||
UpdatePointWindowDirtyStatus(surfaceNode);
|
||||
}
|
||||
// 1. calculate abs dirtyrect and update partialRenderParams
|
||||
// currently only sync visible region info
|
||||
surfaceNode->UpdatePartialRenderParams();
|
||||
|
@ -134,10 +134,6 @@ public:
|
||||
screenInfo_ = screenInfo;
|
||||
}
|
||||
|
||||
bool CheckIfHardCursorEnable() const;
|
||||
bool HasMirrorDisplay() const;
|
||||
bool HasVirtualDisplay() const;
|
||||
|
||||
// Use in updating hwcnode hardware state with background alpha
|
||||
void UpdateHardwareStateByHwcNodeBackgroundAlpha(const std::vector<std::weak_ptr<RSSurfaceRenderNode>>& hwcNodes);
|
||||
|
||||
|
@ -268,7 +268,6 @@ public:
|
||||
virtual bool IsLeashWindow() const { return true; }
|
||||
virtual bool IsAppWindow() const { return false; }
|
||||
virtual bool GetHardwareEnabled() const { return false; }
|
||||
virtual bool IsHardCursorEnabled() const { return false; }
|
||||
virtual bool GetLayerCreated() const { return false; }
|
||||
virtual bool GetLastFrameHardwareEnabled() const { return false; }
|
||||
virtual void SetLayerCreated(bool layerCreated) {}
|
||||
|
@ -44,10 +44,6 @@ struct CaptureParam {
|
||||
isFirstNode_(isFirstNode),
|
||||
isSystemCalling_(isSystemCalling) {}
|
||||
};
|
||||
struct HardCursorInfo {
|
||||
NodeId id = INVALID_NODEID;
|
||||
DrawableV2::RSRenderNodeDrawableAdapter::SharedPtr drawablePtr = nullptr;
|
||||
};
|
||||
class RSB_EXPORT RSRenderThreadParams {
|
||||
public:
|
||||
RSRenderThreadParams() = default;
|
||||
@ -128,11 +124,7 @@ public:
|
||||
return hardwareEnabledTypeDrawables_;
|
||||
}
|
||||
|
||||
const std::vector<HardCursorInfo>& GetHardCursorDrawables() const
|
||||
{
|
||||
return hardCursorDrawables_;
|
||||
}
|
||||
|
||||
|
||||
void SetPendingScreenRefreshRate(uint32_t rate)
|
||||
{
|
||||
pendingScreenRefreshRate_ = rate;
|
||||
@ -381,7 +373,6 @@ private:
|
||||
DirtyRegionDebugType dirtyRegionDebugType_ = DirtyRegionDebugType::DISABLED;
|
||||
std::vector<DrawableV2::RSRenderNodeDrawableAdapter::SharedPtr> selfDrawables_;
|
||||
std::vector<DrawableV2::RSRenderNodeDrawableAdapter::SharedPtr> hardwareEnabledTypeDrawables_;
|
||||
std::vector<HardCursorInfo> hardCursorDrawables_;
|
||||
bool isForceCommitLayer_ = false;
|
||||
bool hasMirrorDisplay_ = false;
|
||||
// accumulatedDirtyRegion to decide whether to skip tranasparent nodes.
|
||||
|
@ -327,8 +327,6 @@ public:
|
||||
const RSLayerInfo& GetLayerInfo() const override;
|
||||
void SetHardwareEnabled(bool enabled);
|
||||
bool GetHardwareEnabled() const override;
|
||||
void SetHardCursorEnabled(bool enabled);
|
||||
bool IsHardCursorEnabled() const override;
|
||||
void SetLastFrameHardwareEnabled(bool enabled);
|
||||
bool GetLastFrameHardwareEnabled() const override;
|
||||
void SetFixRotationByUser(bool flag);
|
||||
@ -540,7 +538,6 @@ private:
|
||||
Rect damageRect_ = {0, 0, 0, 0};
|
||||
#endif
|
||||
bool isHardwareEnabled_ = false;
|
||||
bool isHardCursorEnabled_ = false;
|
||||
bool isLastFrameHardwareEnabled_ = false;
|
||||
bool isFixRotationByUser_ = false;
|
||||
bool isInFixedRotation_ = false;
|
||||
|
@ -113,7 +113,10 @@ public:
|
||||
return isNodeDirty_;
|
||||
}
|
||||
|
||||
bool IsHardwareEnabledTopSurface() const;
|
||||
bool IsHardwareEnabledTopSurface() const
|
||||
{
|
||||
return nodeType_ == RSSurfaceNodeType::SELF_DRAWING_WINDOW_NODE && GetName() == "pointer window";
|
||||
}
|
||||
|
||||
void SetLayerTop(bool isTop);
|
||||
|
||||
@ -129,7 +132,7 @@ public:
|
||||
return false;
|
||||
}
|
||||
return (nodeType_ == RSSurfaceNodeType::SELF_DRAWING_NODE && isHardwareEnabledNode_) ||
|
||||
IsLayerTop();
|
||||
IsHardwareEnabledTopSurface() || IsLayerTop();
|
||||
}
|
||||
|
||||
void SetHardwareEnabled(bool isEnabled, SelfDrawingNodeType selfDrawingType = SelfDrawingNodeType::DEFAULT)
|
||||
@ -413,7 +416,7 @@ public:
|
||||
void ProcessAnimatePropertyAfterChildren(RSPaintFilterCanvas& canvas) override;
|
||||
void ProcessRenderAfterChildren(RSPaintFilterCanvas& canvas) override;
|
||||
bool IsSCBNode() const;
|
||||
void UpdateHwcNodeLayerInfo(GraphicTransformType transform, bool isHardCursorEnable = false);
|
||||
void UpdateHwcNodeLayerInfo(GraphicTransformType transform);
|
||||
void UpdateHardwareDisabledState(bool disabled);
|
||||
void SetHwcChildrenDisabledStateByUifirst();
|
||||
|
||||
|
@ -180,7 +180,6 @@ public:
|
||||
static HgmRefreshRates GetHgmRefreshRatesEnabled();
|
||||
static void SetHgmRefreshRateModesEnabled(std::string param);
|
||||
static HgmRefreshRateModes GetHgmRefreshRateModesEnabled();
|
||||
static bool GetHardCursorEnabled();
|
||||
|
||||
static float GetAnimationScale();
|
||||
static bool GetProxyNodeDebugEnabled();
|
||||
|
@ -167,20 +167,6 @@ bool RSSurfaceRenderParams::GetHardwareEnabled() const
|
||||
return isHardwareEnabled_;
|
||||
}
|
||||
|
||||
void RSSurfaceRenderParams::SetHardCursorEnabled(bool enabled)
|
||||
{
|
||||
if (isHardCursorEnabled_ == enabled) {
|
||||
return;
|
||||
}
|
||||
isHardCursorEnabled_ = enabled;
|
||||
needSync_ = true;
|
||||
}
|
||||
|
||||
bool RSSurfaceRenderParams::IsHardCursorEnabled() const
|
||||
{
|
||||
return isHardCursorEnabled_;
|
||||
}
|
||||
|
||||
void RSSurfaceRenderParams::SetLastFrameHardwareEnabled(bool enabled)
|
||||
{
|
||||
if (isLastFrameHardwareEnabled_ == enabled) {
|
||||
@ -466,7 +452,6 @@ void RSSurfaceRenderParams::OnSync(const std::unique_ptr<RSRenderParams>& target
|
||||
targetSurfaceParams->oldDirtyInSurface_ = oldDirtyInSurface_;
|
||||
targetSurfaceParams->transparentRegion_ = transparentRegion_;
|
||||
targetSurfaceParams->isHardwareEnabled_ = isHardwareEnabled_;
|
||||
targetSurfaceParams->isHardCursorEnabled_ = isHardCursorEnabled_;
|
||||
targetSurfaceParams->isLastFrameHardwareEnabled_ = isLastFrameHardwareEnabled_;
|
||||
targetSurfaceParams->isFixRotationByUser_ = isFixRotationByUser_;
|
||||
targetSurfaceParams->isInFixedRotation_ = isInFixedRotation_;
|
||||
|
@ -1143,12 +1143,6 @@ void RSSurfaceRenderNode::SetLayerTop(bool isTop)
|
||||
AddToPendingSyncList();
|
||||
}
|
||||
|
||||
bool RSSurfaceRenderNode::IsHardwareEnabledTopSurface() const
|
||||
{
|
||||
return ShouldPaint() && nodeType_ == RSSurfaceNodeType::SELF_DRAWING_WINDOW_NODE &&
|
||||
GetName() == "pointer window" && RSSystemProperties::GetHardCursorEnabled();
|
||||
}
|
||||
|
||||
void RSSurfaceRenderNode::SetColorSpace(GraphicColorGamut colorSpace)
|
||||
{
|
||||
colorSpace_ = colorSpace;
|
||||
@ -1556,7 +1550,7 @@ bool RSSurfaceRenderNode::IsSCBNode() const
|
||||
return surfaceWindowType_ != SurfaceWindowType::SYSTEM_SCB_WINDOW;
|
||||
}
|
||||
|
||||
void RSSurfaceRenderNode::UpdateHwcNodeLayerInfo(GraphicTransformType transform, bool isHardCursorEnable)
|
||||
void RSSurfaceRenderNode::UpdateHwcNodeLayerInfo(GraphicTransformType transform)
|
||||
{
|
||||
#ifndef ROSEN_CROSS_PLATFORM
|
||||
auto surfaceParams = static_cast<RSSurfaceRenderParams*>(stagingRenderParams_.get());
|
||||
@ -1602,7 +1596,6 @@ void RSSurfaceRenderNode::UpdateHwcNodeLayerInfo(GraphicTransformType transform,
|
||||
#endif
|
||||
surfaceParams->SetLayerInfo(layer);
|
||||
surfaceParams->SetHardwareEnabled(!IsHardwareForcedDisabled());
|
||||
surfaceParams->SetHardCursorEnabled(IsHardwareEnabledTopSurface() && isHardCursorEnable);
|
||||
surfaceParams->SetLastFrameHardwareEnabled(isLastFrameHwcEnabled_);
|
||||
surfaceParams->SetInFixedRotation(isInFixedRotation_);
|
||||
// 1 means need source tuning
|
||||
|
@ -221,11 +221,6 @@ HgmRefreshRateModes RSSystemProperties::GetHgmRefreshRateModesEnabled()
|
||||
return {};
|
||||
}
|
||||
|
||||
bool RSSystemProperties::GetHardCursorEnabled()
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
bool RSSystemProperties::GetSkipForAlphaZeroEnabled()
|
||||
{
|
||||
return {};
|
||||
|
@ -511,14 +511,6 @@ HgmRefreshRateModes RSSystemProperties::GetHgmRefreshRateModesEnabled()
|
||||
return static_cast<HgmRefreshRateModes>(ConvertToInt(enable, 0));
|
||||
}
|
||||
|
||||
bool RSSystemProperties::GetHardCursorEnabled()
|
||||
{
|
||||
static CachedHandle g_Handle = CachedParameterCreate("rosen.hardCursor.enabled", "1");
|
||||
int changed = 0;
|
||||
const char *enable = CachedParameterGetChanged(g_Handle, &changed);
|
||||
return ConvertToInt(enable, 1) != 0;
|
||||
}
|
||||
|
||||
bool RSSystemProperties::GetSkipForAlphaZeroEnabled()
|
||||
{
|
||||
static CachedHandle g_Handle = CachedParameterCreate("persist.skipForAlphaZero.enabled", "1");
|
||||
|
@ -221,11 +221,6 @@ HgmRefreshRateModes RSSystemProperties::GetHgmRefreshRateModesEnabled()
|
||||
return {};
|
||||
}
|
||||
|
||||
bool RSSystemProperties::GetHardCursorEnabled()
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
bool RSSystemProperties::GetSkipForAlphaZeroEnabled()
|
||||
{
|
||||
return {};
|
||||
|
@ -412,27 +412,6 @@ HWTEST_F(RSDisplayRenderNodeDrawableTest, CalculateVirtualDirtyForWiredScreen006
|
||||
ASSERT_EQ(damageRects.size(), 0);
|
||||
}
|
||||
|
||||
/**
|
||||
* @tc.name: HardCursorCreateLayer
|
||||
* @tc.desc: Test HardCursorCreateLayer
|
||||
* @tc.type: FUNC
|
||||
* @tc.require: #IAX2SN
|
||||
*/
|
||||
HWTEST_F(RSDisplayRenderNodeDrawableTest, HardCursorCreateLayerTest, TestSize.Level1)
|
||||
{
|
||||
ASSERT_NE(renderNode_, nullptr);
|
||||
ASSERT_NE(displayDrawable_, nullptr);
|
||||
ASSERT_NE(displayDrawable_->renderParams_, nullptr);
|
||||
|
||||
auto params = static_cast<RSDisplayRenderParams*>(displayDrawable_->GetRenderParams().get());
|
||||
ASSERT_NE(params, nullptr);
|
||||
auto processor = RSProcessorFactory::CreateProcessor(params->GetCompositeType());
|
||||
ASSERT_NE(processor, nullptr);
|
||||
|
||||
auto result = displayDrawable_->HardCursorCreateLayer(processor);
|
||||
ASSERT_EQ(result, false);
|
||||
}
|
||||
|
||||
/**
|
||||
* @tc.name: CheckDisplayNodeSkip
|
||||
* @tc.desc: Test CheckDisplayNodeSkip
|
||||
|
@ -1167,11 +1167,6 @@ HWTEST_F(RSSurfaceRenderNodeDrawableTest, DealWithSelfDrawingNodeBufferTest001,
|
||||
surfaceDrawable_->DealWithSelfDrawingNodeBuffer(canvas, *surfaceParams);
|
||||
ASSERT_TRUE(surfaceParams->GetHardwareEnabled());
|
||||
|
||||
surfaceParams->isHardCursorEnabled_ = true;
|
||||
surfaceDrawable_->DealWithSelfDrawingNodeBuffer(canvas, *surfaceParams);
|
||||
ASSERT_TRUE(surfaceParams->IsHardCursorEnabled());
|
||||
ASSERT_FALSE(surfaceDrawable_->IsHardwareEnabledTopSurface());
|
||||
|
||||
surfaceParams->isLayerTop_ = true;
|
||||
surfaceDrawable_->DealWithSelfDrawingNodeBuffer(canvas, *surfaceParams);
|
||||
ASSERT_TRUE(surfaceParams->IsLayerTop());
|
||||
|
@ -4499,46 +4499,4 @@ HWTEST_F(RSUniRenderVisitorTest, IsFirstFrameOfOverdrawSwitch, TestSize.Level1)
|
||||
ASSERT_NE(rsUniRenderVisitor, nullptr);
|
||||
ASSERT_EQ(rsUniRenderVisitor->IsFirstFrameOfOverdrawSwitch(), false);
|
||||
}
|
||||
|
||||
/**
|
||||
* @tc.name: HasMirrorDisplay
|
||||
* @tc.desc: Test HasMirrorDisplay
|
||||
* @tc.type: FUNC
|
||||
* @tc.require: issueIAX2SN
|
||||
*/
|
||||
HWTEST_F(RSUniRenderVisitorTest, HasMirrorDisplayTest, TestSize.Level1)
|
||||
{
|
||||
auto mainThread = RSMainThread::Instance();
|
||||
ASSERT_NE(mainThread, nullptr);
|
||||
auto result = mainThread->HasMirrorDisplay();
|
||||
ASSERT_EQ(result, false);
|
||||
}
|
||||
|
||||
/**
|
||||
* @tc.name: HasVirtualDisplay
|
||||
* @tc.desc: Test HasVirtualDisplay
|
||||
* @tc.type: FUNC
|
||||
* @tc.require: issueIAX2SN
|
||||
*/
|
||||
HWTEST_F(RSUniRenderVisitorTest, HasVirtualDisplayTest, TestSize.Level1)
|
||||
{
|
||||
auto rsUniRenderVisitor = std::make_shared<RSUniRenderVisitor>();
|
||||
ASSERT_NE(rsUniRenderVisitor, nullptr);
|
||||
auto result = rsUniRenderVisitor->HasVirtualDisplay();
|
||||
ASSERT_EQ(result, false);
|
||||
}
|
||||
|
||||
/**
|
||||
* @tc.name: CheckIfHardCursorEnable
|
||||
* @tc.desc: Test CheckIfHardCursorEnable
|
||||
* @tc.type: FUNC
|
||||
* @tc.require: issueIAX2SN
|
||||
*/
|
||||
HWTEST_F(RSUniRenderVisitorTest, CheckIfHardCursorEnableTest, TestSize.Level1)
|
||||
{
|
||||
auto rsUniRenderVisitor = std::make_shared<RSUniRenderVisitor>();
|
||||
ASSERT_NE(rsUniRenderVisitor, nullptr);
|
||||
auto result = rsUniRenderVisitor->CheckIfHardCursorEnable();
|
||||
ASSERT_EQ(result, false);
|
||||
}
|
||||
} // OHOS::Rosen
|
@ -290,22 +290,4 @@ HWTEST_F(RSSurfaceRenderParamsTest, SetNeedCacheSurface, TestSize.Level1)
|
||||
EXPECT_EQ(params.GetNeedCacheSurface(), false);
|
||||
EXPECT_EQ(params.needSync_, true);
|
||||
}
|
||||
|
||||
/**
|
||||
* @tc.name: SetHardCursorEnabled
|
||||
* @tc.desc: SetHardCursorEnabled and IsHardCursorEnabled test
|
||||
* @tc.type:FUNC
|
||||
* @tc.require: issueIAX2SN
|
||||
*/
|
||||
HWTEST_F(RSSurfaceRenderParamsTest, SetHardCursorEnabledTest, TestSize.Level1)
|
||||
{
|
||||
RSSurfaceRenderParams params(114);
|
||||
params.SetHardCursorEnabled(false);
|
||||
EXPECT_EQ(params.needSync_, false);
|
||||
EXPECT_EQ(params.IsHardCursorEnabled(), false);
|
||||
|
||||
params.SetHardCursorEnabled(true);
|
||||
EXPECT_EQ(params.needSync_, true);
|
||||
EXPECT_EQ(params.IsHardCursorEnabled(), true);
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue
Block a user