1 /* 2 * Copyright (c) 2021-2022 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 #ifndef RENDER_SERVICE_CLIENT_CORE_PIPELINE_RS_SURFACE_RENDER_NODE_H 16 #define RENDER_SERVICE_CLIENT_CORE_PIPELINE_RS_SURFACE_RENDER_NODE_H 17 18 #include <functional> 19 #include <limits> 20 #include <memory> 21 #include <tuple> 22 23 #include "include/core/SkRect.h" 24 #include "include/core/SkRefCnt.h" 25 #include "include/gpu/GrContext.h" 26 #include "refbase.h" 27 28 #include "common/rs_macros.h" 29 #include "common/rs_occlusion_region.h" 30 #include "common/rs_vector4.h" 31 #include "ipc_callbacks/buffer_available_callback.h" 32 #include "pipeline/rs_paint_filter_canvas.h" 33 #include "pipeline/rs_render_node.h" 34 #include "pipeline/rs_surface_handler.h" 35 #include "property/rs_properties_painter.h" 36 #include "screen_manager/screen_types.h" 37 #include "transaction/rs_occlusion_data.h" 38 39 namespace OHOS { 40 namespace Rosen { 41 class RSCommand; 42 class RSDirtyRegionManager; 43 class RSB_EXPORT RSSurfaceRenderNode : public RSRenderNode, public RSSurfaceHandler { 44 public: 45 using WeakPtr = std::weak_ptr<RSSurfaceRenderNode>; 46 using SharedPtr = std::shared_ptr<RSSurfaceRenderNode>; 47 static inline constexpr RSRenderNodeType Type = RSRenderNodeType::SURFACE_NODE; GetType()48 RSRenderNodeType GetType() const override 49 { 50 return Type; 51 } 52 53 explicit RSSurfaceRenderNode(NodeId id, std::weak_ptr<RSContext> context = {}); 54 explicit RSSurfaceRenderNode(const RSSurfaceRenderNodeConfig& config, std::weak_ptr<RSContext> context = {}); 55 ~RSSurfaceRenderNode() override; 56 57 void PrepareRenderBeforeChildren(RSPaintFilterCanvas& canvas); 58 void PrepareRenderAfterChildren(RSPaintFilterCanvas& canvas); 59 void ResetParent() override; 60 IsAppWindow()61 bool IsAppWindow() const 62 { 63 return nodeType_ == RSSurfaceNodeType::APP_WINDOW_NODE; 64 } 65 GetSurfaceNodeType()66 RSSurfaceNodeType GetSurfaceNodeType() const 67 { 68 return nodeType_; 69 } 70 SetSurfaceNodeType(RSSurfaceNodeType nodeType)71 void SetSurfaceNodeType(RSSurfaceNodeType nodeType) 72 { 73 if (nodeType_ != RSSurfaceNodeType::ABILITY_COMPONENT_NODE) { 74 nodeType_ = nodeType; 75 } 76 } 77 GetName()78 std::string GetName() const 79 { 80 return name_; 81 } 82 SetOffSetX(int32_t offset)83 void SetOffSetX(int32_t offset) 84 { 85 offsetX_ = offset; 86 } 87 GetOffSetX()88 int32_t GetOffSetX() 89 { 90 return offsetX_; 91 } 92 SetOffSetY(int32_t offset)93 void SetOffSetY(int32_t offset) 94 { 95 offsetY_ = offset; 96 } 97 GetOffSetY()98 int32_t GetOffSetY() 99 { 100 return offsetY_; 101 } 102 SetOffset(int32_t offsetX,int32_t offsetY)103 void SetOffset(int32_t offsetX, int32_t offsetY) 104 { 105 offsetX_ = offsetX; 106 offsetY_ = offsetY; 107 } 108 109 void CollectSurface(const std::shared_ptr<RSBaseRenderNode>& node, 110 std::vector<RSBaseRenderNode::SharedPtr>& vec, 111 bool isUniRender) override; 112 void Prepare(const std::shared_ptr<RSNodeVisitor>& visitor) override; 113 void Process(const std::shared_ptr<RSNodeVisitor>& visitor) override; 114 115 void SetContextBounds(const Vector4f bounds); 116 SetTotalMatrix(const SkMatrix & totalMatrix)117 void SetTotalMatrix(const SkMatrix& totalMatrix) 118 { 119 totalMatrix_ = totalMatrix; 120 } GetTotalMatrix()121 const SkMatrix& GetTotalMatrix() const 122 { 123 return totalMatrix_; 124 } 125 126 // pass render context (matrix/alpha/clip) from RT to RS 127 void SetContextMatrix(const SkMatrix& transform, bool sendMsg = true); 128 const SkMatrix& GetContextMatrix() const; 129 130 void SetContextAlpha(float alpha, bool sendMsg = true); 131 float GetContextAlpha() const; 132 133 void SetContextClipRegion(SkRect clipRegion, bool sendMsg = true); 134 const SkRect& GetContextClipRegion() const; 135 136 void SetSecurityLayer(bool isSecurityLayer); 137 bool GetSecurityLayer() const; 138 139 std::shared_ptr<RSDirtyRegionManager> GetDirtyManager() const; 140 SetSrcRect(const RectI & rect)141 void SetSrcRect(const RectI& rect) 142 { 143 srcRect_ = rect; 144 } 145 GetSrcRect()146 const RectI& GetSrcRect() const 147 { 148 return srcRect_; 149 } 150 SetDstRect(const RectI & dstRect)151 void SetDstRect(const RectI& dstRect) 152 { 153 if (dstRect_ != dstRect) { 154 dstRectChanged_ = true; 155 } 156 dstRect_ = dstRect; 157 } 158 GetDstRect()159 const RectI& GetDstRect() const 160 { 161 return dstRect_; 162 } 163 GetTransparentRegion()164 Occlusion::Region& GetTransparentRegion() 165 { 166 return transparentRegion_; 167 } 168 GetOpaqueRegion()169 Occlusion::Region& GetOpaqueRegion() 170 { 171 return opaqueRegion_; 172 } 173 SetGlobalAlpha(float alpha)174 void SetGlobalAlpha(float alpha) 175 { 176 if (globalAlpha_ == alpha) { 177 return; 178 } 179 alphaChanged_ = true; 180 globalAlpha_ = alpha; 181 } 182 GetGlobalAlpha()183 float GetGlobalAlpha() const 184 { 185 return globalAlpha_; 186 } 187 SetOcclusionVisible(bool visible)188 void SetOcclusionVisible(bool visible) 189 { 190 isOcclusionVisible_ = visible; 191 } 192 GetOcclusionVisible()193 bool GetOcclusionVisible() const 194 { 195 return isOcclusionVisible_; 196 } 197 GetVisibleRegion()198 const Occlusion::Region& GetVisibleRegion() const 199 { 200 return visibleRegion_; 201 } 202 SetAbilityBGAlpha(uint8_t alpha)203 void SetAbilityBGAlpha(uint8_t alpha) 204 { 205 abilityBgAlpha_ = alpha; 206 alphaChanged_ = true; 207 } 208 GetAbilityBgAlpha()209 uint8_t GetAbilityBgAlpha() const 210 { 211 return abilityBgAlpha_; 212 } 213 setQosCal(bool qosPidCal)214 void setQosCal(bool qosPidCal) 215 { 216 qosPidCal_ = qosPidCal; 217 } 218 219 void SetVisibleRegionRecursive(const Occlusion::Region& region, 220 VisibleData& visibleVec, 221 std::map<uint32_t, bool>& pidVisMap); 222 GetVisibleDirtyRegion()223 const Occlusion::Region& GetVisibleDirtyRegion() const 224 { 225 return visibleDirtyRegion_; 226 } 227 SetVisibleDirtyRegion(const Occlusion::Region & region)228 void SetVisibleDirtyRegion(const Occlusion::Region& region) 229 { 230 visibleDirtyRegion_ = region; 231 } 232 GetDirtyRegionBelowCurrentLayer()233 const Occlusion::Region& GetDirtyRegionBelowCurrentLayer() const 234 { 235 return dirtyRegionBelowCurrentLayer_; 236 } 237 SetDirtyRegionBelowCurrentLayer(Occlusion::Region & region)238 void SetDirtyRegionBelowCurrentLayer(Occlusion::Region& region) 239 { 240 #ifndef ROSEN_CROSS_PLATFORM 241 Occlusion::Rect dirtyRect{GetOldDirtyInSurface()}; 242 Occlusion::Region dirtyRegion {dirtyRect}; 243 dirtyRegionBelowCurrentLayer_ = dirtyRegion.And(region); 244 dirtyRegionBelowCurrentLayerIsEmpty_ = dirtyRegionBelowCurrentLayer_.IsEmpty(); 245 #endif 246 } 247 GetDstRectChanged()248 bool GetDstRectChanged() const 249 { 250 return dstRectChanged_; 251 } 252 CleanDstRectChanged()253 void CleanDstRectChanged() 254 { 255 dstRectChanged_ = false; 256 } 257 GetAlphaChanged()258 bool GetAlphaChanged() const 259 { 260 return alphaChanged_; 261 } 262 CleanAlphaChanged()263 void CleanAlphaChanged() 264 { 265 alphaChanged_ = false; 266 } 267 SetGloblDirtyRegion(const RectI & rect)268 void SetGloblDirtyRegion(const RectI& rect) 269 { 270 Occlusion::Rect tmpRect { rect.left_, rect.top_, rect.GetRight(), rect.GetBottom() }; 271 Occlusion::Region region { tmpRect }; 272 globalDirtyRegion_ = visibleRegion_.And(region); 273 globalDirtyRegionIsEmpty_ = globalDirtyRegion_.IsEmpty(); 274 } 275 276 #ifndef ROSEN_CROSS_PLATFORM 277 void SetColorSpace(ColorGamut colorSpace); 278 ColorGamut GetColorSpace() const; 279 void SetConsumer(const sptr<Surface>& consumer); 280 GraphicBlendType GetBlendType(); 281 void SetBlendType(GraphicBlendType blendType); 282 #endif 283 284 void UpdateSurfaceDefaultSize(float width, float height); 285 286 // Only SurfaceNode in RS calls "RegisterBufferAvailableListener" 287 // to save callback method sent by RT or UI which depends on the value of "isFromRenderThread". 288 void RegisterBufferAvailableListener( 289 sptr<RSIBufferAvailableCallback> callback, bool isFromRenderThread); 290 291 // Only SurfaceNode in RT calls "ConnectToNodeInRenderService" to send callback method to RS 292 void ConnectToNodeInRenderService(); 293 294 void NotifyRTBufferAvailable(); 295 bool IsNotifyRTBufferAvailable() const; 296 bool IsNotifyRTBufferAvailablePre() const; 297 298 void NotifyUIBufferAvailable(); 299 bool IsNotifyUIBufferAvailable() const; 300 void SetIsNotifyUIBufferAvailable(bool available); 301 302 // UI Thread would not be notified when SurfaceNode created by Video/Camera in RenderService has available buffer. 303 // And RenderThread does not call mainFunc_ if nothing in UI thread is changed 304 // which would cause callback for "clip" on parent SurfaceNode cannot be triggered 305 // for "clip" is executed in RenderThreadVisitor::ProcessSurfaceRenderNode. 306 // To fix this bug, we set callback which would call RSRenderThread::RequestNextVSync() to forcedly "refresh" 307 // RenderThread when SurfaceNode in RenderService has available buffer and execute RSIBufferAvailableCallback. 308 void SetCallbackForRenderThreadRefresh(std::function<void(void)> callback); 309 bool NeedSetCallbackForRenderThreadRefresh(); 310 ParallelVisitLock()311 void ParallelVisitLock() 312 { 313 parallelVisitMutex_.lock(); 314 } 315 ParallelVisitUnlock()316 void ParallelVisitUnlock() 317 { 318 parallelVisitMutex_.unlock(); 319 } 320 SubNodeVisible(const RectI & r)321 bool SubNodeVisible(const RectI& r) const 322 { 323 Occlusion::Rect nodeRect { r.left_, r.top_, r.GetRight(), r.GetBottom() }; 324 // if current node is in occluded region of the surface, it could be skipped in process step 325 return visibleRegion_.IsIntersectWith(nodeRect); 326 } 327 IsTransparent()328 inline bool IsTransparent() const 329 { 330 const uint8_t opacity = 255; 331 return !(GetAbilityBgAlpha() == opacity && ROSEN_EQ(GetGlobalAlpha(), 1.0f)); 332 } 333 IsCurrentNodeInTransparentRegion(const Occlusion::Rect & nodeRect)334 inline bool IsCurrentNodeInTransparentRegion(const Occlusion::Rect& nodeRect) const 335 { 336 return transparentRegion_.IsIntersectWith(nodeRect); 337 } 338 SubNodeIntersectWithDirty(const RectI & r)339 bool SubNodeIntersectWithDirty(const RectI& r) const 340 { 341 Occlusion::Rect nodeRect { r.left_, r.top_, r.GetRight(), r.GetBottom() }; 342 // if current node rect r is in global dirtyregion, it CANNOT be skipped 343 if (!globalDirtyRegionIsEmpty_) { 344 auto globalRect = globalDirtyRegion_.IsIntersectWith(nodeRect); 345 if (globalRect) { 346 return true; 347 } 348 } 349 // if current node is in visible dirtyRegion, it CANNOT be skipped 350 bool localIntersect = visibleDirtyRegion_.IsIntersectWith(nodeRect); 351 if (localIntersect) { 352 return true; 353 } 354 // if current node is transparent 355 if (IsTransparent() || IsCurrentNodeInTransparentRegion(nodeRect)) { 356 return dirtyRegionBelowCurrentLayer_.IsIntersectWith(nodeRect); 357 } 358 return false; 359 } 360 SubNodeNeedDraw(const RectI & r,PartialRenderType opDropType)361 bool SubNodeNeedDraw(const RectI &r, PartialRenderType opDropType) const 362 { 363 if (dirtyManager_ == nullptr) { 364 return true; 365 } 366 if (r.IsEmpty()) { 367 return true; 368 } 369 switch (opDropType) { 370 case PartialRenderType::SET_DAMAGE_AND_DROP_OP: 371 return SubNodeIntersectWithDirty(r); 372 case PartialRenderType::SET_DAMAGE_AND_DROP_OP_OCCLUSION: 373 return SubNodeVisible(r); 374 case PartialRenderType::SET_DAMAGE_AND_DROP_OP_NOT_VISIBLEDIRTY: 375 return SubNodeVisible(r) && SubNodeIntersectWithDirty(r); 376 case PartialRenderType::DISABLED: 377 case PartialRenderType::SET_DAMAGE: 378 default: 379 return true; 380 } 381 return true; 382 } 383 SetCacheSurface(sk_sp<SkSurface> cacheSurface)384 void SetCacheSurface(sk_sp<SkSurface> cacheSurface) 385 { 386 cacheSurface_ = std::move(cacheSurface); 387 } 388 GetCacheSurface()389 sk_sp<SkSurface> GetCacheSurface() const 390 { 391 return cacheSurface_; 392 } 393 ClearCacheSurface()394 void ClearCacheSurface() 395 { 396 cacheSurface_ = nullptr; 397 } 398 SetAppFreeze(bool isAppFreeze)399 void SetAppFreeze(bool isAppFreeze) 400 { 401 isAppFreeze_ = isAppFreeze; 402 } 403 IsAppFreeze()404 bool IsAppFreeze() const 405 { 406 return isAppFreeze_; 407 } 408 GetZorderChanged()409 bool GetZorderChanged() const 410 { 411 return (std::abs(GetRenderProperties().GetPositionZ() - positionZ_) > (std::numeric_limits<float>::epsilon())); 412 } 413 IsZOrderPromoted()414 bool IsZOrderPromoted() const 415 { 416 return GetRenderProperties().GetPositionZ() > positionZ_; 417 } 418 UpdatePositionZ()419 void UpdatePositionZ() 420 { 421 positionZ_ = GetRenderProperties().GetPositionZ(); 422 } 423 HasContainerWindow()424 inline bool HasContainerWindow() const 425 { 426 return hasContainerWindow_; 427 } 428 SetContainerWindow(bool hasContainerWindow,float density)429 void SetContainerWindow(bool hasContainerWindow, float density) 430 { 431 hasContainerWindow_ = hasContainerWindow; 432 // px = vp * density 433 containerTitleHeight_ = ceil(CONTAINER_TITLE_HEIGHT * density); 434 containerContentPadding_ = ceil(CONTENT_PADDING * density); 435 containerBorderWidth_ = ceil(CONTAINER_BORDER_WIDTH * density); 436 containerOutRadius_ = ceil(CONTAINER_OUTER_RADIUS * density); 437 containerInnerRadius_ = ceil(CONTAINER_INNER_RADIUS * density); 438 } 439 IsOpaqueRegionChanged()440 bool IsOpaqueRegionChanged() const 441 { 442 return opaqueRegionChanged_; 443 } 444 IsFocusedWindow(pid_t focusedWindowPid)445 bool IsFocusedWindow(pid_t focusedWindowPid) 446 { 447 return static_cast<pid_t>(GetNodeId() >> 32) == focusedWindowPid; // higher 32 bits of nodeid is pid 448 } 449 ResetOpaqueRegion(const RectI & absRect,const ContainerWindowConfigType containerWindowConfigType,const bool isFocusWindow)450 Occlusion::Region ResetOpaqueRegion(const RectI& absRect, 451 const ContainerWindowConfigType containerWindowConfigType, 452 const bool isFocusWindow) 453 { 454 if (containerWindowConfigType == ContainerWindowConfigType::DISABLED) { 455 Occlusion::Rect opaqueRect{absRect}; 456 Occlusion::Region opaqueRegion = Occlusion::Region{opaqueRect}; 457 return opaqueRegion; 458 } 459 if (isFocusWindow) { 460 Occlusion::Rect opaqueRect{ absRect.left_ + containerContentPadding_ + containerBorderWidth_, 461 absRect.top_ + containerTitleHeight_ + containerInnerRadius_ + containerBorderWidth_, 462 absRect.GetRight() - containerContentPadding_ - containerBorderWidth_, 463 absRect.GetBottom() - containerContentPadding_ - containerBorderWidth_}; 464 Occlusion::Region opaqueRegion{opaqueRect}; 465 return opaqueRegion; 466 } else { 467 if (containerWindowConfigType == ContainerWindowConfigType::ENABLED_LEVEL_0) { 468 Occlusion::Rect opaqueRect{ absRect.left_ + containerContentPadding_ + containerBorderWidth_, 469 absRect.top_ + containerTitleHeight_ + containerBorderWidth_, 470 absRect.GetRight() - containerContentPadding_ - containerBorderWidth_, 471 absRect.GetBottom() - containerContentPadding_ - containerBorderWidth_}; 472 Occlusion::Region opaqueRegion{opaqueRect}; 473 return opaqueRegion; 474 } else if (containerWindowConfigType == ContainerWindowConfigType::ENABLED_UNFOCUSED_WINDOW_LEVEL_1) { 475 Occlusion::Rect opaqueRect{ absRect.left_, 476 absRect.top_ + containerOutRadius_, 477 absRect.GetRight(), 478 absRect.GetBottom() - containerOutRadius_}; 479 Occlusion::Region opaqueRegion{opaqueRect}; 480 return opaqueRegion; 481 } else { 482 Occlusion::Rect opaqueRect1{ absRect.left_ + containerOutRadius_, 483 absRect.top_, 484 absRect.GetRight() - containerOutRadius_, 485 absRect.GetBottom()}; 486 Occlusion::Rect opaqueRect2{ absRect.left_, 487 absRect.top_ + containerOutRadius_, 488 absRect.GetRight(), 489 absRect.GetBottom() - containerOutRadius_}; 490 Occlusion::Region r1{opaqueRect1}; 491 Occlusion::Region r2{opaqueRect2}; 492 Occlusion::Region opaqueRegion = r1.Or(r2); 493 return opaqueRegion; 494 } 495 } 496 } 497 498 void ResetSurfaceOpaqueRegion(const RectI& screeninfo, const RectI& absRect, 499 ContainerWindowConfigType containerWindowConfigType, bool isFocusWindow = true) 500 { 501 Occlusion::Rect absRectR {absRect}; 502 Occlusion::Region oldOpaqueRegion { opaqueRegion_ }; 503 if (IsTransparent()) { 504 opaqueRegion_ = Occlusion::Region(); 505 transparentRegion_ = Occlusion::Region{absRectR}; 506 } else { 507 if (IsAppWindow() && HasContainerWindow()) { 508 opaqueRegion_ = ResetOpaqueRegion(absRect, containerWindowConfigType, isFocusWindow); 509 } else { 510 opaqueRegion_ = Occlusion::Region{absRectR}; 511 } 512 transparentRegion_ = Occlusion::Region{absRectR}; 513 transparentRegion_.SubSelf(opaqueRegion_); 514 } 515 Occlusion::Rect screen{screeninfo}; 516 Occlusion::Region screenRegion{screen}; 517 transparentRegion_.AndSelf(screenRegion); 518 opaqueRegion_.AndSelf(screenRegion); 519 opaqueRegionChanged_ = !oldOpaqueRegion.Xor(opaqueRegion_).IsEmpty(); 520 } 521 522 bool IsStartAnimationFinished() const; 523 void SetStartAnimationFinished(); SetCachedImage(sk_sp<SkImage> image)524 void SetCachedImage(sk_sp<SkImage> image) 525 { 526 SetDirty(); 527 std::lock_guard<std::mutex> lock(cachedImageMutex_); 528 cachedImage_ = image; 529 } 530 GetCachedImage()531 sk_sp<SkImage> GetCachedImage() const 532 { 533 std::lock_guard<std::mutex> lock(cachedImageMutex_); 534 return cachedImage_; 535 } 536 ClearCachedImage()537 void ClearCachedImage() 538 { 539 std::lock_guard<std::mutex> lock(cachedImageMutex_); 540 cachedImage_ = nullptr; 541 } 542 543 private: 544 void ClearChildrenCache(const std::shared_ptr<RSBaseRenderNode>& node); 545 546 std::mutex mutexRT_; 547 std::mutex mutexUI_; 548 std::mutex mutex_; 549 550 std::mutex parallelVisitMutex_; 551 552 SkMatrix contextMatrix_ = SkMatrix::I(); 553 float contextAlpha_ = 1.0f; 554 SkRect contextClipRect_ = SkRect::MakeEmpty(); 555 556 bool isSecurityLayer_ = false; 557 RectI srcRect_; 558 SkMatrix totalMatrix_; 559 int32_t offsetX_ = 0; 560 int32_t offsetY_ = 0; 561 float globalAlpha_ = 1.0f; 562 float positionZ_ = 0.0f; 563 bool qosPidCal_ = false; 564 565 std::string name_; 566 RSSurfaceNodeType nodeType_ = RSSurfaceNodeType::DEFAULT; 567 #ifndef ROSEN_CROSS_PLATFORM 568 ColorGamut colorSpace_ = ColorGamut::COLOR_GAMUT_SRGB; 569 GraphicBlendType blendType_ = GraphicBlendType::GRAPHIC_BLEND_SRCOVER; 570 #endif 571 bool isNotifyRTBufferAvailablePre_ = false; 572 std::atomic<bool> isNotifyRTBufferAvailable_ = false; 573 std::atomic<bool> isNotifyUIBufferAvailable_ = false; 574 std::atomic_bool isBufferAvailable_ = false; 575 sptr<RSIBufferAvailableCallback> callbackFromRT_; 576 sptr<RSIBufferAvailableCallback> callbackFromUI_; 577 std::function<void(void)> callbackForRenderThreadRefresh_ = nullptr; 578 std::vector<NodeId> childSurfaceNodeIds_; 579 friend class RSRenderThreadVisitor; 580 RectI clipRegionFromParent_; 581 Occlusion::Region visibleRegion_; 582 Occlusion::Region visibleDirtyRegion_; 583 bool isOcclusionVisible_ = true; 584 std::shared_ptr<RSDirtyRegionManager> dirtyManager_ = nullptr; 585 RectI dstRect_; 586 bool dstRectChanged_ = false; 587 uint8_t abilityBgAlpha_ = 0; 588 bool alphaChanged_ = false; 589 Occlusion::Region globalDirtyRegion_; 590 591 std::atomic<bool> isAppFreeze_ = false; 592 sk_sp<SkSurface> cacheSurface_ = nullptr; 593 bool globalDirtyRegionIsEmpty_ = false; 594 // if a there a dirty layer under transparent clean layer, transparent layer should refreshed 595 Occlusion::Region dirtyRegionBelowCurrentLayer_; 596 bool dirtyRegionBelowCurrentLayerIsEmpty_ = false; 597 598 // opaque region of the surface 599 Occlusion::Region opaqueRegion_; 600 bool opaqueRegionChanged_ = false; 601 // transparent region of the surface, floating window's container window is always treated as transparent 602 Occlusion::Region transparentRegion_; 603 // temporary const value from ACE container_modal_constants.h, will be replaced by uniform interface 604 bool hasContainerWindow_ = false; // set to false as default, set by arkui 605 const int CONTAINER_TITLE_HEIGHT = 37; // container title height = 37 vp 606 const int CONTENT_PADDING = 4; // container <--> content distance 4 vp 607 const int CONTAINER_BORDER_WIDTH = 1; // container border width 2 vp 608 const int CONTAINER_OUTER_RADIUS = 16; // container outter radius 16 vp 609 const int CONTAINER_INNER_RADIUS = 14; // container inner radius 14 vp 610 int containerTitleHeight_ = 37 * 2; // The density default value is 2 611 int containerContentPadding_ = 4 * 2; // The density default value is 2 612 int containerBorderWidth_ = 1 * 2; // The density default value is 2 613 int containerOutRadius_ = 16 * 2; // The density default value is 2 614 int containerInnerRadius_ = 14 * 2; // The density default value is 2 615 bool startAnimationFinished_ = false; 616 mutable std::mutex cachedImageMutex_; 617 sk_sp<SkImage> cachedImage_; 618 }; 619 } // namespace Rosen 620 } // namespace OHOS 621 622 #endif // RENDER_SERVICE_CLIENT_CORE_PIPELINE_RS_SURFACE_RENDER_NODE_H 623