mirror of
https://gitee.com/openharmony/graphic_graphic_2d
synced 2024-11-27 17:21:51 +00:00
commit
ef8735109f
@ -49,6 +49,9 @@
|
||||
|
||||
namespace OHOS {
|
||||
namespace Rosen {
|
||||
namespace {
|
||||
constexpr int32_t FIX_ROTATION_DEGREE_FOR_FOLD_SCREEN = -90;
|
||||
}
|
||||
void RSUniRenderUtil::MergeDirtyHistory(std::shared_ptr<RSDisplayRenderNode>& node, int32_t bufferAge,
|
||||
bool useAlignedDirtyRegion, bool renderParallel)
|
||||
{
|
||||
@ -1186,7 +1189,7 @@ void RSUniRenderUtil::DealWithNodeGravity(RSSurfaceRenderNode& node, const Scree
|
||||
|
||||
void RSUniRenderUtil::CheckForceHardwareAndUpdateDstRect(RSSurfaceRenderNode& node)
|
||||
{
|
||||
if (!node.GetForceHardwareByUser()) {
|
||||
if (!node.GetForceHardware()) {
|
||||
return;
|
||||
}
|
||||
RectI srcRect = { 0, 0, node.GetBuffer()->GetSurfaceBufferWidth(), node.GetBuffer()->GetSurfaceBufferHeight() };
|
||||
@ -1235,7 +1238,9 @@ GraphicTransformType RSUniRenderUtil::GetLayerTransform(RSSurfaceRenderNode& nod
|
||||
if (!consumer) {
|
||||
return GraphicTransformType::GRAPHIC_ROTATE_NONE;
|
||||
}
|
||||
int surfaceNodeRotation = node.GetForceHardwareByUser() ? -1 * node.GetFixedRotationDegree() :
|
||||
static int32_t rotationDegree = (system::GetParameter("const.build.product", "") == "ALT") ?
|
||||
FIX_ROTATION_DEGREE_FOR_FOLD_SCREEN : 0;
|
||||
int surfaceNodeRotation = node.GetForceHardware() ? -1 * rotationDegree :
|
||||
RSUniRenderUtil::GetRotationFromMatrix(node.GetTotalMatrix());
|
||||
int totalRotation = (RotateEnumToInt(screenInfo.rotation) + surfaceNodeRotation +
|
||||
RSBaseRenderUtil::RotateEnumToInt(RSBaseRenderUtil::GetRotateTransform(consumer->GetTransform()))) % 360;
|
||||
|
@ -1223,7 +1223,8 @@ void RSUniRenderVisitor::QuickPrepareDisplayRenderNode(RSDisplayRenderNode& node
|
||||
SendRcdMessage(node);
|
||||
ancestorNodeHasAnimation_ = false;
|
||||
|
||||
dirtyFlag_ = isDirty_ || node.IsRotationChanged();
|
||||
displayNodeRotationChanged_ = node.IsRotationChanged();
|
||||
dirtyFlag_ = isDirty_ || displayNodeRotationChanged_;
|
||||
prepareClipRect_ = screenRect_;
|
||||
curAlpha_ = 1.0f;
|
||||
node.UpdateRotation();
|
||||
@ -1634,7 +1635,8 @@ void RSUniRenderVisitor::UpdateHwcNodeInfoForAppNode(RSSurfaceRenderNode& node)
|
||||
}
|
||||
node.SetHardwareForcedDisabledState(false);
|
||||
node.SetHardwareForcedDisabledByVisibility(false);
|
||||
if ((!node.GetForceHardwareByUser() && !IsHardwareComposerEnabled()) ||
|
||||
node.SetForceHardware(displayNodeRotationChanged_ || isScreenRotationAnimating_);
|
||||
if ((!node.GetForceHardware() && !IsHardwareComposerEnabled()) ||
|
||||
curSurfaceNode_->GetVisibleRegion().IsEmpty() || !node.GetBuffer()) {
|
||||
RS_OPTIONAL_TRACE_NAME_FMT("hwc debug: name:%s id:%llu disabled by param/invisible/no buffer",
|
||||
node.GetName().c_str(), node.GetId());
|
||||
@ -1699,6 +1701,7 @@ void RSUniRenderVisitor::UpdateHwcNodeByTransform(RSSurfaceRenderNode& node)
|
||||
if (!node.GetBuffer()) {
|
||||
return;
|
||||
}
|
||||
node.SetForceHardware(displayNodeRotationChanged_ || isScreenRotationAnimating_);
|
||||
RSUniRenderUtil::DealWithNodeGravity(node, screenInfo_);
|
||||
RSUniRenderUtil::LayerRotate(node, screenInfo_);
|
||||
RSUniRenderUtil::LayerCrop(node, screenInfo_);
|
||||
|
@ -472,6 +472,7 @@ private:
|
||||
bool isOcclusionEnabled_ = false;
|
||||
bool isSkipCanvasNodeOutOfScreen_ = false;
|
||||
bool isScreenRotationAnimating_ = false;
|
||||
bool displayNodeRotationChanged_ = false;
|
||||
std::vector<std::string> dfxTargetSurfaceNames_;
|
||||
PartialRenderType partialRenderType_;
|
||||
QuickSkipPrepareType quickSkipPrepareType_;
|
||||
|
@ -133,8 +133,8 @@ public:
|
||||
}
|
||||
|
||||
void SetForceHardwareAndFixRotation(bool flag);
|
||||
bool GetForceHardwareByUser() const;
|
||||
int32_t GetFixedRotationDegree() const;
|
||||
bool GetForceHardware() const;
|
||||
void SetForceHardware(bool flag);
|
||||
|
||||
SelfDrawingNodeType GetSelfDrawingNodeType() const
|
||||
{
|
||||
@ -246,7 +246,7 @@ public:
|
||||
|
||||
bool IsHardwareForcedDisabled() const
|
||||
{
|
||||
if (isForceHardwareByUser_ && !isHardwareForcedDisabledByVisibility_) {
|
||||
if (isForceHardware_ && !isHardwareForcedDisabledByVisibility_) {
|
||||
return false;
|
||||
}
|
||||
return isHardwareForcedDisabled_ || isHardwareForcedDisabledByVisibility_ ||
|
||||
@ -1236,9 +1236,9 @@ private:
|
||||
// used for hardware enabled nodes
|
||||
bool isHardwareEnabledNode_ = false;
|
||||
bool isForceHardwareByUser_ = false;
|
||||
bool isForceHardware_ = false;
|
||||
bool isHardwareForcedDisabledByVisibility_ = false;
|
||||
RectI originalDstRect_;
|
||||
int32_t fixedRotationDegree_ = -90;
|
||||
SelfDrawingNodeType selfDrawingType_ = SelfDrawingNodeType::DEFAULT;
|
||||
bool isCurrentFrameHardwareEnabled_ = false;
|
||||
bool isLastFrameHardwareEnabled_ = false;
|
||||
|
@ -639,14 +639,14 @@ void RSSurfaceRenderNode::SetForceHardwareAndFixRotation(bool flag)
|
||||
}
|
||||
}
|
||||
|
||||
bool RSSurfaceRenderNode::GetForceHardwareByUser() const
|
||||
bool RSSurfaceRenderNode::GetForceHardware() const
|
||||
{
|
||||
return isForceHardwareByUser_;
|
||||
return isForceHardware_;
|
||||
}
|
||||
|
||||
int32_t RSSurfaceRenderNode::GetFixedRotationDegree() const
|
||||
void RSSurfaceRenderNode::SetForceHardware(bool flag)
|
||||
{
|
||||
return fixedRotationDegree_;
|
||||
isForceHardware_ = isForceHardwareByUser_ && flag;
|
||||
}
|
||||
|
||||
void RSSurfaceRenderNode::SetSecurityLayer(bool isSecurityLayer)
|
||||
|
Loading…
Reference in New Issue
Block a user