1 /* 2 * Copyright (c) 2024 Huawei Device Co., Ltd. 3 * Licensed under the Apache License, Version 2.0 (the "License"); 4 * you may not use this file except in compliance with the License. 5 * You may obtain a copy of the License at 6 * 7 * http://www.apache.org/licenses/LICENSE-2.0 8 * 9 * Unless required by applicable law or agreed to in writing, software 10 * distributed under the License is distributed on an "AS IS" BASIS, 11 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 * See the License for the specific language governing permissions and 13 * limitations under the License. 14 */ 15 16 #ifndef RENDER_SERVICE_BASE_PARAMS_RS_SURFACE_RENDER_PARAMS_H 17 #define RENDER_SERVICE_BASE_PARAMS_RS_SURFACE_RENDER_PARAMS_H 18 19 #include <memory> 20 #include <string> 21 #include <unordered_map> 22 23 #include "common/rs_occlusion_region.h" 24 #include "common/rs_special_layer_manager.h" 25 #include "drawable/rs_render_node_drawable_adapter.h" 26 #include "params/rs_render_params.h" 27 #include "pipeline/rs_base_render_node.h" 28 #include "platform/common/rs_system_properties.h" 29 #ifndef ROSEN_CROSS_PLATFORM 30 #include "surface_buffer.h" 31 #include "sync_fence.h" 32 #endif 33 #include "surface_type.h" 34 35 namespace OHOS::Rosen { 36 class RSSurfaceRenderNode; 37 struct RSLayerInfo { 38 #ifndef ROSEN_CROSS_PLATFORM 39 GraphicIRect srcRect; 40 GraphicIRect dstRect; 41 GraphicIRect boundRect; 42 Drawing::Matrix matrix; 43 int32_t gravity = 0; 44 int32_t zOrder = 0; 45 float alpha = 1.f; 46 GraphicBlendType blendType; 47 GraphicTransformType transformType = GraphicTransformType::GRAPHIC_ROTATE_NONE; 48 GraphicLayerType layerType = GraphicLayerType::GRAPHIC_LAYER_TYPE_GRAPHIC; 49 int32_t layerSource; 50 bool arsrTag = true; 51 bool operator==(const RSLayerInfo& layerInfo) const 52 { 53 return (srcRect == layerInfo.srcRect) && (dstRect == layerInfo.dstRect) && 54 (boundRect == layerInfo.boundRect) && (matrix == layerInfo.matrix) && (gravity == layerInfo.gravity) && 55 (zOrder == layerInfo.zOrder) && (blendType == layerInfo.blendType) && 56 (transformType == layerInfo.transformType) && (ROSEN_EQ(alpha, layerInfo.alpha)) && 57 (layerSource == layerInfo.layerSource) && (layerType == layerInfo.layerType) && 58 (arsrTag == layerInfo.arsrTag); 59 } 60 #endif 61 }; 62 class RSB_EXPORT RSSurfaceRenderParams : public RSRenderParams { 63 public: 64 explicit RSSurfaceRenderParams(NodeId id); 65 ~RSSurfaceRenderParams() override = default; IsMainWindowType()66 inline bool IsMainWindowType() const 67 { 68 return isMainWindowType_; 69 } IsLeashWindow()70 inline bool IsLeashWindow() const override 71 { 72 return isLeashWindow_; 73 } IsAppWindow()74 bool IsAppWindow() const override 75 { 76 return isAppWindow_; 77 } GetSurfaceNodeType()78 RSSurfaceNodeType GetSurfaceNodeType() const 79 { 80 return rsSurfaceNodeType_; 81 } GetSelfDrawingNodeType()82 SelfDrawingNodeType GetSelfDrawingNodeType() const 83 { 84 return selfDrawingType_; 85 } SetAncestorDisplayNode(const RSRenderNode::WeakPtr & ancestorDisplayNode)86 void SetAncestorDisplayNode(const RSRenderNode::WeakPtr& ancestorDisplayNode) 87 { 88 ancestorDisplayNode_ = ancestorDisplayNode; 89 auto node = ancestorDisplayNode.lock(); 90 ancestorDisplayDrawable_ = node ? node->GetRenderDrawable() : nullptr; 91 } 92 GetAncestorDisplayNode()93 RSRenderNode::WeakPtr GetAncestorDisplayNode() const 94 { 95 return ancestorDisplayNode_; 96 } GetAncestorDisplayDrawable()97 DrawableV2::RSRenderNodeDrawableAdapter::WeakPtr GetAncestorDisplayDrawable() const 98 { 99 return ancestorDisplayDrawable_; 100 } 101 GetAlpha()102 float GetAlpha() const 103 { 104 return alpha_; 105 } IsClonedNodeOnTheTree()106 bool IsClonedNodeOnTheTree() const 107 { 108 return isClonedNodeOnTheTree_; 109 } IsCrossNode()110 bool IsCrossNode() const 111 { 112 return isCrossNode_; 113 } IsSpherizeValid()114 bool IsSpherizeValid() const 115 { 116 return isSpherizeValid_; 117 } IsAttractionValid()118 bool IsAttractionValid() const 119 { 120 return isAttractionValid_; 121 } NeedBilinearInterpolation()122 bool NeedBilinearInterpolation() const 123 { 124 return needBilinearInterpolation_; 125 } GetBackgroundColor()126 const Color& GetBackgroundColor() const 127 { 128 return backgroundColor_; 129 } GetAbsDrawRect()130 const RectI& GetAbsDrawRect() const override 131 { 132 return absDrawRect_; 133 } GetRRect()134 const RRect& GetRRect() const 135 { 136 return rrect_; 137 } GetAnimateState()138 bool GetAnimateState() const 139 { 140 return animateState_; 141 } SetStencilVal(int64_t stencilVal)142 void SetStencilVal(int64_t stencilVal) 143 { 144 stencilVal_ = stencilVal; 145 } GetStencilVal()146 int64_t GetStencilVal() const 147 { 148 return stencilVal_; 149 } SetIsOutOfScreen(bool isOutOfScreen)150 void SetIsOutOfScreen(bool isOutOfScreen) 151 { 152 if (isOutOfScreen_ == isOutOfScreen) { 153 return; 154 } 155 isOutOfScreen_ = isOutOfScreen; 156 needSync_ = true; 157 } GetIsOutOfScreen()158 bool GetIsOutOfScreen() 159 { 160 return isOutOfScreen_; 161 } GetIsRotating()162 bool GetIsRotating() const 163 { 164 return isRotating_; 165 } GetMultableSpecialLayerMgr()166 RSSpecialLayerManager& GetMultableSpecialLayerMgr() 167 { 168 return specialLayerManager_; 169 } GetSpecialLayerMgr()170 const RSSpecialLayerManager& GetSpecialLayerMgr() const 171 { 172 return specialLayerManager_; 173 } HasPrivacyContentLayer()174 bool HasPrivacyContentLayer() 175 { 176 return privacyContentLayerIds_.size() != 0; 177 } 178 GetLeashPersistentId()179 LeashPersistentId GetLeashPersistentId() const 180 { 181 return leashPersistentId_; 182 } 183 GetName()184 std::string GetName() const 185 { 186 return name_; 187 } 188 189 // [Attention] The function only used for unlocking screen for PC currently 190 DrawableV2::RSRenderNodeDrawableAdapter::WeakPtr GetClonedNodeRenderDrawable(); 191 SetLeashWindowVisibleRegionEmptyParam(bool isLeashWindowVisibleRegionEmpty)192 void SetLeashWindowVisibleRegionEmptyParam(bool isLeashWindowVisibleRegionEmpty) 193 { 194 if (isLeashWindowVisibleRegionEmpty_ == isLeashWindowVisibleRegionEmpty) { 195 return; 196 } 197 isLeashWindowVisibleRegionEmpty_ = isLeashWindowVisibleRegionEmpty; 198 needSync_ = true; 199 } 200 GetLeashWindowVisibleRegionEmptyParam()201 bool GetLeashWindowVisibleRegionEmptyParam() const 202 { 203 return isLeashWindowVisibleRegionEmpty_; 204 } 205 SetUifirstNodeEnableParam(MultiThreadCacheType isUifirst)206 bool SetUifirstNodeEnableParam(MultiThreadCacheType isUifirst) 207 { 208 if (uiFirstFlag_ == isUifirst) { 209 return false; 210 } 211 uiFirstFlag_ = isUifirst; 212 needSync_ = true; 213 return true; 214 } 215 GetUifirstNodeEnableParam()216 MultiThreadCacheType GetUifirstNodeEnableParam() const 217 { 218 return uiFirstFlag_; 219 } 220 SetIsParentUifirstNodeEnableParam(bool isUifirstParent)221 void SetIsParentUifirstNodeEnableParam(bool isUifirstParent) 222 { 223 if (uiFirstParentFlag_ == isUifirstParent) { 224 return; 225 } 226 uiFirstParentFlag_ = isUifirstParent; 227 needSync_ = true; 228 } 229 SetUifirstUseStarting(NodeId id)230 void SetUifirstUseStarting(NodeId id) 231 { 232 if (uifirstUseStarting_ == id) { 233 return; 234 } 235 uifirstUseStarting_ = id; 236 needSync_ = true; 237 } 238 GetUifirstUseStarting()239 NodeId GetUifirstUseStarting() const 240 { 241 return uifirstUseStarting_; 242 } 243 SetUifirstChildrenDirtyRectParam(const RectI & rect)244 void SetUifirstChildrenDirtyRectParam(const RectI& rect) 245 { 246 childrenDirtyRect_ = rect; 247 needSync_ = true; 248 } 249 GetUifirstChildrenDirtyRectParam()250 RectI& GetUifirstChildrenDirtyRectParam() 251 { 252 return childrenDirtyRect_; 253 } GetDstRect()254 const RectI& GetDstRect() const 255 { 256 return dstRect_; 257 } 258 void SetSurfaceCacheContentStatic(bool contentStatic, bool lastFrameSynced); 259 bool GetSurfaceCacheContentStatic() const; 260 bool GetPreSurfaceCacheContentStatic() const; 261 262 float GetPositionZ() const; 263 264 void SetSurfaceSubTreeDirty(bool isSubTreeDirty); 265 bool GetSurfaceSubTreeDirty() const; 266 GetParentUifirstNodeEnableParam()267 bool GetParentUifirstNodeEnableParam() 268 { 269 return uiFirstParentFlag_; 270 } 271 SetUIFirstFrameGravity(Gravity gravity)272 void SetUIFirstFrameGravity(Gravity gravity) 273 { 274 if (uiFirstFrameGravity_ == gravity) { 275 return; 276 } 277 uiFirstFrameGravity_ = gravity; 278 needSync_ = true; 279 } 280 GetUIFirstFrameGravity()281 Gravity GetUIFirstFrameGravity() const 282 { 283 return uiFirstFrameGravity_; 284 } 285 286 void SetOcclusionVisible(bool visible); 287 bool GetOcclusionVisible() const override; 288 289 void SetIsParentScaling(bool isParentScaling); 290 bool IsParentScaling() const; 291 292 void SetTransparentRegion(const Occlusion::Region& transparentRegion); 293 const Occlusion::Region& GetTransparentRegion() const; 294 295 void SetOldDirtyInSurface(const RectI& oldDirtyInSurface) override; 296 RectI GetOldDirtyInSurface() const override; 297 298 void SetVisibleRegion(const Occlusion::Region& visibleRegion); 299 Occlusion::Region GetVisibleRegion() const override; 300 301 void SetVisibleRegionInVirtual(const Occlusion::Region& visibleRegion); 302 Occlusion::Region GetVisibleRegionInVirtual() const; 303 304 void SetOccludedByFilterCache(bool val); 305 bool GetOccludedByFilterCache() const; 306 307 void SetFilterCacheFullyCovered(bool val); 308 bool GetFilterCacheFullyCovered() const; 309 310 const std::vector<NodeId>& GetVisibleFilterChild() const; 311 bool IsTransparent() const; 312 void CheckValidFilterCacheFullyCoverTarget( 313 bool isFilterCacheValidForOcclusion, const RectI& filterCachedRect, const RectI& targetRect); 314 315 void SetLayerInfo(const RSLayerInfo& layerInfo); 316 const RSLayerInfo& GetLayerInfo() const override; 317 void SetHardwareEnabled(bool enabled); 318 bool GetHardwareEnabled() const override; 319 void SetNeedMakeImage(bool enabled); 320 bool GetNeedMakeImage() const override; 321 void SetHardCursorStatus(bool status); 322 bool GetHardCursorStatus() const override; 323 void SetPreSubHighPriorityType(bool enabledType); 324 bool GetPreSubHighPriorityType() const; 325 void SetLastFrameHardwareEnabled(bool enabled); 326 bool GetLastFrameHardwareEnabled() const override; 327 void SetFixRotationByUser(bool flag); 328 bool GetFixRotationByUser() const; 329 void SetInFixedRotation(bool flag); 330 bool IsInFixedRotation() const; 331 // source crop tuning 332 void SetLayerSourceTuning(int32_t needSourceTuning); 333 int32_t GetLayerSourceTuning() const; 334 335 void SetGpuOverDrawBufferOptimizeNode(bool overDrawNode); 336 bool IsGpuOverDrawBufferOptimizeNode() const; 337 void SetOverDrawBufferNodeCornerRadius(const Vector4f& radius); 338 const Vector4f& GetOverDrawBufferNodeCornerRadius() const; 339 340 void SetIsSubSurfaceNode(bool isSubSurfaceNode); 341 bool IsSubSurfaceNode() const; 342 343 void SetGlobalPositionEnabled(bool isEnabled); 344 bool GetGlobalPositionEnabled() const; 345 346 void SetIsNodeToBeCaptured(bool isNodeToBeCaptured); 347 bool IsNodeToBeCaptured() const; 348 349 void SetSkipDraw(bool skip); 350 bool GetSkipDraw() const; 351 352 void SetHidePrivacyContent(bool needHidePrivacyContent); 353 bool GetHidePrivacyContent() const; 354 355 void SetLayerTop(bool isTop); 356 bool IsLayerTop() const; 357 358 bool IsVisibleDirtyRegionEmpty(const Drawing::Region curSurfaceDrawRegion) const; 359 360 void SetWatermarkEnabled(const std::string& name, bool isEnabled); 361 const std::unordered_map<std::string, bool>& GetWatermarksEnabled() const; 362 bool IsWatermarkEmpty() const; 363 364 #ifndef ROSEN_CROSS_PLATFORM 365 void SetBuffer(const sptr<SurfaceBuffer>& buffer, const Rect& damageRect) override; 366 sptr<SurfaceBuffer> GetBuffer() const override; 367 void SetPreBuffer(const sptr<SurfaceBuffer>& preBuffer) override; 368 sptr<SurfaceBuffer> GetPreBuffer() override; 369 void SetAcquireFence(const sptr<SyncFence>& acquireFence) override; 370 sptr<SyncFence> GetAcquireFence() const override; 371 const Rect& GetBufferDamage() const override; SetBufferSynced(bool bufferSynced)372 inline void SetBufferSynced(bool bufferSynced) 373 { 374 bufferSynced_ = bufferSynced; 375 } IsBufferSynced()376 bool IsBufferSynced() const 377 { 378 return bufferSynced_; 379 } 380 #endif 381 382 virtual void OnSync(const std::unique_ptr<RSRenderParams>& target) override; 383 SetRoundedCornerRegion(const Occlusion::Region & roundedCornerRegion)384 void SetRoundedCornerRegion(const Occlusion::Region& roundedCornerRegion) 385 { 386 roundedCornerRegion_ = roundedCornerRegion; 387 } 388 GetRoundedCornerRegion()389 const Occlusion::Region& GetRoundedCornerRegion() const 390 { 391 return roundedCornerRegion_; 392 } 393 394 // DFX 395 std::string ToString() const override; 396 // Set/Get OpaqueRegion, currently only used for DFX 397 void SetOpaqueRegion(const Occlusion::Region& opaqueRegion); 398 const Occlusion::Region& GetOpaqueRegion() const; 399 SetNeedOffscreen(bool needOffscreen)400 void SetNeedOffscreen(bool needOffscreen) 401 { 402 if (needOffscreen_ == needOffscreen) { 403 return; 404 } 405 needOffscreen_ = needOffscreen; 406 needSync_ = true; 407 } 408 GetNeedOffscreen()409 bool GetNeedOffscreen() const 410 { 411 return RSSystemProperties::GetSurfaceOffscreenEnadbled() ? needOffscreen_ : false; 412 } 413 SetLayerCreated(bool layerCreated)414 void SetLayerCreated(bool layerCreated) override 415 { 416 layerCreated_ = layerCreated; 417 } 418 GetLayerCreated()419 bool GetLayerCreated() const override 420 { 421 return layerCreated_; 422 } SetTotalMatrix(const Drawing::Matrix & totalMatrix)423 void SetTotalMatrix(const Drawing::Matrix& totalMatrix) override 424 { 425 if (totalMatrix_ == totalMatrix) { 426 return; 427 } 428 totalMatrix_ = totalMatrix; 429 needSync_ = true; 430 } GetTotalMatrix()431 const Drawing::Matrix& GetTotalMatrix() override 432 { 433 return totalMatrix_; 434 } SetFingerprint(bool hasFingerprint)435 void SetFingerprint(bool hasFingerprint) override 436 { 437 if (hasFingerprint_ == hasFingerprint) { 438 return; 439 } 440 hasFingerprint_ = hasFingerprint; 441 needSync_ = true; 442 } GetFingerprint()443 bool GetFingerprint() override { 444 return false; 445 } 446 SetCornerRadiusInfoForDRM(const std::vector<float> & drmCornerRadiusInfo)447 void SetCornerRadiusInfoForDRM(const std::vector<float>& drmCornerRadiusInfo) 448 { 449 if (drmCornerRadiusInfo_ == drmCornerRadiusInfo) { 450 return; 451 } 452 drmCornerRadiusInfo_ = drmCornerRadiusInfo; 453 needSync_ = true; 454 } 455 SetForceDisableClipHoleForDRM(bool isForceDisable)456 void SetForceDisableClipHoleForDRM(bool isForceDisable) 457 { 458 if (isForceDisableClipHoleForDRM_ == isForceDisable) { 459 return; 460 } 461 isForceDisableClipHoleForDRM_ = isForceDisable; 462 needSync_ = true; 463 } 464 GetForceDisableClipHoleForDRM()465 bool GetForceDisableClipHoleForDRM() const 466 { 467 return isForceDisableClipHoleForDRM_; 468 } 469 GetCornerRadiusInfoForDRM()470 const std::vector<float>& GetCornerRadiusInfoForDRM() const 471 { 472 return drmCornerRadiusInfo_; 473 } 474 SetHDRPresent(bool hasHdrPresent)475 void SetHDRPresent(bool hasHdrPresent) 476 { 477 if (hasHdrPresent_ == hasHdrPresent) { 478 return; 479 } 480 hasHdrPresent_ = hasHdrPresent; 481 needSync_ = true; 482 } 483 GetHDRPresent()484 bool GetHDRPresent() const 485 { 486 return hasHdrPresent_; 487 } 488 SetSdrNit(float sdrNit)489 void SetSdrNit(float sdrNit) 490 { 491 if (ROSEN_EQ(sdrNit_, sdrNit)) { 492 return; 493 } 494 sdrNit_ = sdrNit; 495 needSync_ = true; 496 } 497 GetSdrNit()498 float GetSdrNit() const 499 { 500 return sdrNit_; 501 } 502 SetDisplayNit(float displayNit)503 void SetDisplayNit(float displayNit) 504 { 505 if (ROSEN_EQ(displayNit_, displayNit)) { 506 return; 507 } 508 displayNit_ = displayNit; 509 needSync_ = true; 510 } 511 GetDisplayNit()512 float GetDisplayNit() const 513 { 514 return displayNit_; 515 } 516 SetBrightnessRatio(float brightnessRatio)517 void SetBrightnessRatio(float brightnessRatio) 518 { 519 if (ROSEN_EQ(brightnessRatio_, brightnessRatio)) { 520 return; 521 } 522 brightnessRatio_ = brightnessRatio; 523 needSync_ = true; 524 } 525 GetBrightnessRatio()526 float GetBrightnessRatio() const 527 { 528 return brightnessRatio_; 529 } 530 SetLayerLinearMatrix(const std::vector<float> & layerLinearMatrix)531 void SetLayerLinearMatrix(const std::vector<float>& layerLinearMatrix) 532 { 533 if (layerLinearMatrix_ == layerLinearMatrix) { 534 return; 535 } 536 layerLinearMatrix_ = layerLinearMatrix; 537 needSync_ = true; 538 } 539 GetLayerLinearMatrix()540 std::vector<float> GetLayerLinearMatrix() const 541 { 542 return layerLinearMatrix_; 543 } 544 SetSdrHasMetadata(bool hasMetadata)545 void SetSdrHasMetadata(bool hasMetadata) 546 { 547 if (hasMetadata_ == hasMetadata) { 548 return; 549 } 550 hasMetadata_ = hasMetadata; 551 needSync_ = true; 552 } 553 GetSdrHasMetadata()554 bool GetSdrHasMetadata() const 555 { 556 return hasMetadata_; 557 } 558 559 // [Attention] The function only used for unlocking screen for PC currently 560 bool IsCloneNode() const; 561 GetIsHwcEnabledBySolidLayer()562 bool GetIsHwcEnabledBySolidLayer() 563 { 564 return isHwcEnabledBySolidLayer_; 565 } 566 SetIsHwcEnabledBySolidLayer(bool isHwcEnabledBySolidLayer)567 void SetIsHwcEnabledBySolidLayer(bool isHwcEnabledBySolidLayer) 568 { 569 isHwcEnabledBySolidLayer_ = isHwcEnabledBySolidLayer; 570 } 571 572 void SetNeedCacheSurface(bool needCacheSurface); 573 bool GetNeedCacheSurface() const; HasSubSurfaceNodes()574 inline bool HasSubSurfaceNodes() const 575 { 576 return hasSubSurfaceNodes_; 577 } GetAllSubSurfaceNodeIds()578 const std::unordered_set<NodeId>& GetAllSubSurfaceNodeIds() const 579 { 580 return allSubSurfaceNodeIds_; 581 } GetCrossNodeSkipDisplayConversionMatrix()582 const std::unordered_map<NodeId, Drawing::Matrix>& GetCrossNodeSkipDisplayConversionMatrix() const 583 { 584 return crossNodeSkipDisplayConversionMatrices_; 585 } 586 SetApiCompatibleVersion(uint32_t apiCompatibleVersion)587 void SetApiCompatibleVersion(uint32_t apiCompatibleVersion) 588 { 589 if (ROSEN_EQ(apiCompatibleVersion_, apiCompatibleVersion)) { 590 return; 591 } 592 apiCompatibleVersion_ = apiCompatibleVersion; 593 needSync_ = true; 594 } GetApiCompatibleVersion()595 uint32_t GetApiCompatibleVersion() const 596 { 597 return apiCompatibleVersion_; 598 } 599 600 // [Attention] The function only used for unlocking screen for PC currently ClonedSourceNode()601 bool ClonedSourceNode() const 602 { 603 return clonedSourceNode_; 604 } 605 606 // [Attention] The function only used for unlocking screen for PC currently SetIsCloned(bool isCloned)607 void SetIsCloned(bool isCloned) 608 { 609 if (clonedSourceNode_ == isCloned) { 610 return; 611 } 612 clonedSourceNode_ = isCloned; 613 needSync_ = true; 614 } 615 SetIsBufferFlushed(bool isBufferFlushed)616 void SetIsBufferFlushed(bool isBufferFlushed) 617 { 618 if (isBufferFlushed_ == isBufferFlushed) { 619 return; 620 } 621 isBufferFlushed_ = isBufferFlushed; 622 needSync_ = true; 623 } 624 GetIsBufferFlushed()625 bool GetIsBufferFlushed() const 626 { 627 return isBufferFlushed_; 628 } 629 SetIsUnobscuredUEC(bool flag)630 void SetIsUnobscuredUEC(bool flag) 631 { 632 IsUnobscuredUIExtension_ = flag; 633 } 634 IsUnobscuredUIExtension()635 bool IsUnobscuredUIExtension() const 636 { 637 return IsUnobscuredUIExtension_; 638 } 639 MarkSurfaceCapturePipeline()640 void MarkSurfaceCapturePipeline() 641 { 642 isSurfaceCapturePipeline_ = true; 643 } 644 GetSourceDisplayRenderNodeDrawable()645 DrawableV2::RSRenderNodeDrawableAdapter::WeakPtr GetSourceDisplayRenderNodeDrawable() const 646 { 647 return sourceDisplayRenderNodeDrawable_; 648 } 649 protected: 650 private: 651 bool isMainWindowType_ = false; 652 bool isLeashWindow_ = false; 653 bool isAppWindow_ = false; 654 RSSurfaceNodeType rsSurfaceNodeType_ = RSSurfaceNodeType::DEFAULT; 655 SelfDrawingNodeType selfDrawingType_ = SelfDrawingNodeType::DEFAULT; 656 RSRenderNode::WeakPtr ancestorDisplayNode_; 657 DrawableV2::RSRenderNodeDrawableAdapter::WeakPtr ancestorDisplayDrawable_; 658 DrawableV2::RSRenderNodeDrawableAdapter::WeakPtr clonedNodeRenderDrawable_; 659 DrawableV2::RSRenderNodeDrawableAdapter::WeakPtr sourceDisplayRenderNodeDrawable_; 660 661 float alpha_ = 0; 662 bool isClonedNodeOnTheTree_ = false; 663 bool isCrossNode_ = false; 664 bool isCloneNode_ = false; 665 bool clonedSourceNode_ = false; 666 bool isTransparent_ = false; 667 bool isSpherizeValid_ = false; 668 bool isAttractionValid_ = false; 669 bool isParentScaling_ = false; 670 bool needBilinearInterpolation_ = false; 671 MultiThreadCacheType uiFirstFlag_ = MultiThreadCacheType::NONE; 672 bool uiFirstParentFlag_ = false; 673 Color backgroundColor_ = RgbPalette::Transparent(); 674 bool isHwcEnabledBySolidLayer_ = false; 675 676 RectI dstRect_; 677 RectI oldDirtyInSurface_; 678 RectI childrenDirtyRect_; 679 RectI absDrawRect_; 680 RRect rrect_; 681 NodeId uifirstUseStarting_ = INVALID_NODEID; 682 Occlusion::Region transparentRegion_; 683 Occlusion::Region roundedCornerRegion_; 684 Occlusion::Region opaqueRegion_; 685 686 bool IsUnobscuredUIExtension_ = false; 687 688 LeashPersistentId leashPersistentId_ = INVALID_LEASH_PERSISTENTID; 689 690 bool surfaceCacheContentStatic_ = false; 691 bool preSurfaceCacheContentStatic_ = false; 692 bool isSubTreeDirty_ = false; 693 float positionZ_ = 0.0f; 694 bool occlusionVisible_ = false; 695 bool isLeashWindowVisibleRegionEmpty_ = false; 696 Occlusion::Region visibleRegion_; 697 Occlusion::Region visibleRegionInVirtual_; 698 bool isOccludedByFilterCache_ = false; 699 // if current surfaceNode has filter cache to occlude the back surfaceNode 700 bool isFilterCacheFullyCovered_ = false; 701 std::vector<NodeId> visibleFilterChild_; 702 RSLayerInfo layerInfo_; 703 #ifndef ROSEN_CROSS_PLATFORM 704 sptr<SurfaceBuffer> buffer_ = nullptr; 705 sptr<SurfaceBuffer> preBuffer_ = nullptr; 706 sptr<SyncFence> acquireFence_ = SyncFence::InvalidFence(); 707 Rect damageRect_ = {0, 0, 0, 0}; 708 bool bufferSynced_ = true; 709 #endif 710 bool isHardwareEnabled_ = false; 711 bool needMakeImage_ = false; 712 bool isHardCursor_ = false; 713 bool isLastFrameHardwareEnabled_ = false; 714 bool subHighPriorityType_ = false; 715 bool isFixRotationByUser_ = false; 716 bool isInFixedRotation_ = false; 717 int32_t releaseInHardwareThreadTaskNum_ = 0; 718 bool animateState_ = false; 719 bool isOutOfScreen_ = false; 720 bool isRotating_ = false; 721 bool isSubSurfaceNode_ = false; 722 bool isGlobalPositionEnabled_ = false; 723 Gravity uiFirstFrameGravity_ = Gravity::TOP_LEFT; 724 bool isNodeToBeCaptured_ = false; 725 RSSpecialLayerManager specialLayerManager_; 726 std::set<NodeId> privacyContentLayerIds_ = {}; 727 std::set<int32_t> bufferCacheSet_ = {}; 728 std::string name_= ""; 729 Vector4f overDrawBufferNodeCornerRadius_; 730 bool isGpuOverDrawBufferOptimizeNode_ = false; 731 bool isSkipDraw_ = false; 732 bool isLayerTop_ = false; 733 bool needHidePrivacyContent_ = false; 734 bool needOffscreen_ = false; 735 bool layerCreated_ = false; 736 int32_t layerSource_ = 0; 737 int64_t stencilVal_ = -1; 738 std::unordered_map<std::string, bool> watermarkHandles_ = {}; 739 std::vector<float> drmCornerRadiusInfo_; 740 bool isForceDisableClipHoleForDRM_ = false; 741 742 Drawing::Matrix totalMatrix_; 743 float globalAlpha_ = 1.0f; 744 bool hasFingerprint_ = false; 745 // hdr 746 bool hasHdrPresent_ = false; 747 float sdrNit_ = 500.0f; // default sdrNit 748 float displayNit_ = 500.0f; // default displayNit_ 749 float brightnessRatio_ = 1.0f; // 1.0f means no discount. 750 // color temperature 751 std::vector<float> layerLinearMatrix_; // matrix for linear colorspace 752 bool hasMetadata_ = false; // SDR with metadata 753 bool needCacheSurface_ = false; 754 755 bool hasSubSurfaceNodes_ = false; 756 std::unordered_set<NodeId> allSubSurfaceNodeIds_ = {}; 757 std::unordered_map<NodeId, Drawing::Matrix> crossNodeSkipDisplayConversionMatrices_ = {}; 758 759 uint32_t apiCompatibleVersion_ = 0; 760 761 bool isSurfaceCapturePipeline_ = false; 762 763 friend class RSSurfaceRenderNode; 764 friend class RSUniRenderProcessor; 765 friend class RSUniRenderThread; 766 767 bool isBufferFlushed_ = false; 768 }; 769 } // namespace OHOS::Rosen 770 #endif // RENDER_SERVICE_BASE_PARAMS_RS_SURFACE_RENDER_PARAMS_H 771