mirror of
https://gitee.com/openharmony/graphic_graphic_2d
synced 2024-11-27 17:21:51 +00:00
commit
8fbf7e6505
@ -399,6 +399,9 @@ void RSDisplayRenderNodeDrawable::OnDraw(Drawing::Canvas& canvas)
|
||||
canvasRotation_ = screenManager->GetCanvasRotation(params->GetScreenId());
|
||||
|
||||
auto mirroredNode = params->GetMirrorSource().lock();
|
||||
if (!mirroredNode && displayNodeSp->GetCacheImgForCapture()) {
|
||||
displayNodeSp->SetCacheImgForCapture(nullptr);
|
||||
}
|
||||
if (!mirroredNode && displayNodeSp->GetCacheImgForCapture()) {
|
||||
mirroredNode->SetCacheImgForCapture(nullptr);
|
||||
}
|
||||
@ -472,7 +475,6 @@ void RSDisplayRenderNodeDrawable::OnDraw(Drawing::Canvas& canvas)
|
||||
curCanvas_->SetBrightnessRatio(0.5f);
|
||||
curCanvas_->SetScreenId(screenId);
|
||||
}
|
||||
curCanvas_->SetCurDisplayNode(displayNodeSp);
|
||||
|
||||
// canvas draw
|
||||
{
|
||||
|
@ -183,7 +183,11 @@ void RSSurfaceRenderNodeDrawable::OnDraw(Drawing::Canvas& canvas)
|
||||
}
|
||||
Drawing::Region curSurfaceDrawRegion = CalculateVisibleRegion(uniParam, surfaceParams, surfaceNode, isuifirstNode);
|
||||
// when surfacenode named "CapsuleWindow", cache the current canvas as SkImage for screen recording
|
||||
auto curDisplayNode = rscanvas->GetCurDisplayNode();
|
||||
auto curDisplayNode = surfaceParams->GetAncestorDisplayNode().lock()->ReinterpretCastTo<RSDisplayRenderNode>();
|
||||
if (!curDisplayNode) {
|
||||
RS_LOGE("surfaceNode GetAncestorDisplayNode() return nullptr");
|
||||
return;
|
||||
}
|
||||
if (curDisplayNode && surfaceParams->GetName().find("CapsuleWindow") != std::string::npos) {
|
||||
CacheImgForCapture(*rscanvas, curDisplayNode);
|
||||
NodeId nodeId = FindInstanceChildOfDisplay(surfaceNode->GetParent().lock());
|
||||
|
@ -31,7 +31,6 @@
|
||||
|
||||
namespace OHOS {
|
||||
namespace Rosen {
|
||||
class RSDisplayRenderNode;
|
||||
|
||||
class RSB_EXPORT RSPaintFilterCanvasBase : public Drawing::Canvas {
|
||||
public:
|
||||
@ -154,8 +153,6 @@ public:
|
||||
void PopDirtyRegion();
|
||||
bool IsDirtyRegionStackEmpty();
|
||||
Drawing::Region& GetCurDirtyRegion();
|
||||
std::shared_ptr<RSDisplayRenderNode> GetCurDisplayNode() const;
|
||||
void SetCurDisplayNode(std::shared_ptr<RSDisplayRenderNode> curDisplayNode);
|
||||
|
||||
// alpha related
|
||||
void MultiplyAlpha(float alpha);
|
||||
@ -320,7 +317,6 @@ protected:
|
||||
}
|
||||
|
||||
private:
|
||||
std::shared_ptr<RSDisplayRenderNode> curDisplayNode_ = nullptr;
|
||||
Drawing::Surface* surface_ = nullptr;
|
||||
std::stack<float> alphaStack_;
|
||||
std::stack<Env> envStack_;
|
||||
|
@ -1235,16 +1235,6 @@ void RSPaintFilterCanvas::RestoreEnvToCount(int count)
|
||||
}
|
||||
}
|
||||
|
||||
std::shared_ptr<RSDisplayRenderNode> RSPaintFilterCanvas::GetCurDisplayNode() const
|
||||
{
|
||||
return curDisplayNode_;
|
||||
}
|
||||
|
||||
void RSPaintFilterCanvas::SetCurDisplayNode(std::shared_ptr<RSDisplayRenderNode> curDisplayNode)
|
||||
{
|
||||
curDisplayNode_ = curDisplayNode;
|
||||
}
|
||||
|
||||
int RSPaintFilterCanvas::GetEnvSaveCount() const
|
||||
{
|
||||
return envStack_.size();
|
||||
|
Loading…
Reference in New Issue
Block a user