• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
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 #include "params/rs_render_params.h"
17 
18 #include <string>
19 
20 #include "params/rs_surface_render_params.h"
21 #include "pipeline/rs_render_node.h"
22 #include "property/rs_properties.h"
23 #include "property/rs_properties_painter.h"
24 #include "screen_manager/rs_screen_info.h"
25 namespace OHOS::Rosen {
26 namespace {
27 thread_local Drawing::Matrix parentSurfaceMatrix_;
28 }
SetDirtyType(RSRenderParamsDirtyType dirtyType)29 void RSRenderParams::SetDirtyType(RSRenderParamsDirtyType dirtyType)
30 {
31     dirtyType_.set(dirtyType);
32 }
33 
SetAlpha(float alpha)34 void RSRenderParams::SetAlpha(float alpha)
35 {
36     if (alpha_ == alpha) {
37         return;
38     }
39     alpha_ = alpha;
40     needSync_ = true;
41 }
GetAlpha() const42 float RSRenderParams::GetAlpha() const
43 {
44     return alpha_;
45 }
46 
SetAlphaOffScreen(bool alphaOffScreen)47 void RSRenderParams::SetAlphaOffScreen(bool alphaOffScreen)
48 {
49     if (alphaOffScreen_ == alphaOffScreen) {
50         return;
51     }
52     alphaOffScreen_ = alphaOffScreen;
53     needSync_ = true;
54 }
55 
GetAlphaOffScreen() const56 bool RSRenderParams::GetAlphaOffScreen() const
57 {
58     return alphaOffScreen_;
59 }
60 
SetMatrix(const Drawing::Matrix & matrix)61 void RSRenderParams::SetMatrix(const Drawing::Matrix& matrix)
62 {
63     matrix_ = matrix;
64     needSync_ = true;
65     dirtyType_.set(RSRenderParamsDirtyType::MATRIX_DIRTY);
66 }
GetMatrix() const67 const Drawing::Matrix& RSRenderParams::GetMatrix() const
68 {
69     return matrix_;
70 }\
71 
HasUnobscuredUEC() const72 bool RSRenderParams::HasUnobscuredUEC() const
73 {
74     return hasUnobscuredUEC_;
75 }
76 
SetHasUnobscuredUEC(bool flag)77 void RSRenderParams::SetHasUnobscuredUEC(bool flag)
78 {
79     hasUnobscuredUEC_ = flag;
80 }
81 
ApplyAlphaAndMatrixToCanvas(RSPaintFilterCanvas & canvas,bool applyMatrix) const82 void RSRenderParams::ApplyAlphaAndMatrixToCanvas(RSPaintFilterCanvas& canvas, bool applyMatrix) const
83 {
84     if (UNLIKELY(HasSandBox())) {
85         if (applyMatrix) {
86             canvas.SetMatrix(parentSurfaceMatrix_);
87             canvas.ConcatMatrix(matrix_);
88         }
89         canvas.SetAlpha(alpha_);
90     } else {
91         if (applyMatrix) {
92             canvas.ConcatMatrix(matrix_);
93         }
94         if (alpha_ < 1.0f && (drawingCacheType_ == RSDrawingCacheType::FORCED_CACHE || alphaOffScreen_)) {
95             auto rect = RSPropertiesPainter::Rect2DrawingRect(GetLocalDrawRect());
96             Drawing::Brush brush;
97             brush.SetAlpha(static_cast<uint32_t>(std::clamp(alpha_, 0.f, 1.f) * UINT8_MAX));
98             Drawing::SaveLayerOps slr(&rect, &brush);
99             canvas.SaveLayer(slr);
100         } else {
101             canvas.MultiplyAlpha(alpha_);
102         }
103     }
104 }
105 
SetBoundsRect(const Drawing::RectF & boundsRect)106 void RSRenderParams::SetBoundsRect(const Drawing::RectF& boundsRect)
107 {
108     if (boundsRect_ == boundsRect) {
109         return;
110     }
111     boundsRect_ = boundsRect;
112     needSync_ = true;
113 }
114 
GetBounds() const115 const Drawing::Rect& RSRenderParams::GetBounds() const
116 {
117     return boundsRect_;
118 }
119 
SetFrameRect(const Drawing::RectF & frameRect)120 void RSRenderParams::SetFrameRect(const Drawing::RectF& frameRect)
121 {
122     if (frameRect_ == frameRect) {
123         return;
124     }
125 
126     frameRect_ = frameRect;
127     needSync_ = true;
128 }
129 
GetFrameRect() const130 const Drawing::Rect& RSRenderParams::GetFrameRect() const
131 {
132     return frameRect_;
133 }
134 
SetLocalDrawRect(const RectF & localDrawRect)135 bool RSRenderParams::SetLocalDrawRect(const RectF& localDrawRect)
136 {
137     if (localDrawRect_.IsNearEqual(localDrawRect)) {
138         return false;
139     }
140     localDrawRect_ = localDrawRect;
141     needSync_ = true;
142     return true;
143 }
144 
GetLocalDrawRect() const145 const RectF& RSRenderParams::GetLocalDrawRect() const
146 {
147     return localDrawRect_;
148 }
149 
SetHasSandBox(bool hasSandbox)150 void RSRenderParams::SetHasSandBox(bool hasSandbox)
151 {
152     if (hasSandBox_ == hasSandbox) {
153         return;
154     }
155     hasSandBox_ = hasSandbox;
156     needSync_ = true;
157 }
158 
HasSandBox() const159 bool RSRenderParams::HasSandBox() const
160 {
161     return hasSandBox_;
162 }
163 
SetShouldPaint(bool shouldPaint)164 void RSRenderParams::SetShouldPaint(bool shouldPaint)
165 {
166     if (shouldPaint_ == shouldPaint) {
167         return;
168     }
169     shouldPaint_ = shouldPaint;
170     needSync_ = true;
171 }
172 
SetContentEmpty(bool empty)173 void RSRenderParams::SetContentEmpty(bool empty)
174 {
175     if (contentEmpty_ == empty) {
176         return;
177     }
178     contentEmpty_ = empty;
179     needSync_ = true;
180 }
181 
GetShouldPaint() const182 bool RSRenderParams::GetShouldPaint() const
183 {
184     return shouldPaint_ && !contentEmpty_;
185 }
186 
SetChildHasVisibleFilter(bool val)187 void RSRenderParams::SetChildHasVisibleFilter(bool val)
188 {
189     if (childHasVisibleFilter_ == val) {
190         return;
191     }
192     childHasVisibleFilter_ = val;
193     needSync_ = true;
194 }
195 
ChildHasVisibleFilter() const196 bool RSRenderParams::ChildHasVisibleFilter() const
197 {
198     return childHasVisibleFilter_;
199 }
200 
SetChildHasVisibleEffect(bool val)201 void RSRenderParams::SetChildHasVisibleEffect(bool val)
202 {
203     if (childHasVisibleEffect_ == val) {
204         return;
205     }
206     childHasVisibleEffect_ = val;
207     needSync_ = true;
208 }
209 
ChildHasVisibleEffect() const210 bool RSRenderParams::ChildHasVisibleEffect() const
211 {
212     return childHasVisibleEffect_;
213 }
214 
SetCacheSize(Vector2f size)215 void RSRenderParams::SetCacheSize(Vector2f size)
216 {
217     if (cacheSize_ == size) {
218         return;
219     }
220     cacheSize_ = size;
221     needSync_ = true;
222 }
223 
SetDrawingCacheChanged(bool isChanged,bool lastFrameSynced)224 void RSRenderParams::SetDrawingCacheChanged(bool isChanged, bool lastFrameSynced)
225 {
226     if (lastFrameSynced) {
227         if (isDrawingCacheChanged_) { // force sync if cache changed
228             needSync_ = true;
229         }
230         if (isDrawingCacheChanged_ == isChanged) {
231             return;
232         }
233         isDrawingCacheChanged_ = isChanged;
234         needSync_ = true;
235     } else {
236         needSync_ = needSync_ || (isDrawingCacheChanged_ || (isDrawingCacheChanged_ != isChanged));
237         isDrawingCacheChanged_ = isDrawingCacheChanged_ || isChanged;
238     }
239 }
240 
GetDrawingCacheChanged() const241 bool RSRenderParams::GetDrawingCacheChanged() const
242 {
243     return isDrawingCacheChanged_;
244 }
245 
SetNeedUpdateCache(bool needUpdateCache)246 void RSRenderParams::SetNeedUpdateCache(bool needUpdateCache)
247 {
248     isNeedUpdateCache_ = needUpdateCache;
249 }
250 
GetNeedUpdateCache() const251 bool RSRenderParams::GetNeedUpdateCache() const
252 {
253     return isNeedUpdateCache_;
254 }
255 
SetDrawingCacheType(RSDrawingCacheType cacheType)256 void RSRenderParams::SetDrawingCacheType(RSDrawingCacheType cacheType)
257 {
258     if (drawingCacheType_ == cacheType) {
259         return;
260     }
261     dirtyType_.set(RSRenderParamsDirtyType::DRAWING_CACHE_TYPE_DIRTY);
262     drawingCacheType_ = cacheType;
263     needSync_ = true;
264 }
265 
GetDrawingCacheType() const266 RSDrawingCacheType RSRenderParams::GetDrawingCacheType() const
267 {
268     return drawingCacheType_;
269 }
270 
SetDrawingCacheIncludeProperty(bool includeProperty)271 void RSRenderParams::SetDrawingCacheIncludeProperty(bool includeProperty)
272 {
273     if (drawingCacheIncludeProperty_ == includeProperty) {
274         return;
275     }
276     drawingCacheIncludeProperty_ = includeProperty;
277     needSync_ = true;
278 }
279 
GetDrawingCacheIncludeProperty() const280 bool RSRenderParams::GetDrawingCacheIncludeProperty() const
281 {
282     return drawingCacheIncludeProperty_;
283 }
284 
SetRSFreezeFlag(bool freezeFlag)285 void RSRenderParams::SetRSFreezeFlag(bool freezeFlag)
286 {
287     if (freezeFlag_ == freezeFlag) {
288         return;
289     }
290     freezeFlag_ = freezeFlag;
291     needSync_ = true;
292 }
293 
GetRSFreezeFlag() const294 bool RSRenderParams::GetRSFreezeFlag() const
295 {
296     return freezeFlag_;
297 }
298 
OpincUpdateRootFlag(bool suggestFlag)299 void RSRenderParams::OpincUpdateRootFlag(bool suggestFlag)
300 {
301     if (isOpincRootFlag_ == suggestFlag) {
302         return;
303     }
304     isOpincRootFlag_ = suggestFlag;
305     needSync_ = true;
306 }
307 
OpincGetRootFlag() const308 bool RSRenderParams::OpincGetRootFlag() const
309 {
310     return isOpincRootFlag_;
311 }
312 
OpincSetCacheChangeFlag(bool state,bool lastFrameSynced)313 void RSRenderParams::OpincSetCacheChangeFlag(bool state, bool lastFrameSynced)
314 {
315     if (lastFrameSynced) {
316         isOpincStateChanged_ = state;
317         needSync_ = true;
318     } else {
319         needSync_ = needSync_ || (isOpincStateChanged_ || (isOpincStateChanged_ != state));
320         isOpincStateChanged_ = isOpincStateChanged_ || state;
321     }
322 }
323 
OpincGetCacheChangeState()324 bool RSRenderParams::OpincGetCacheChangeState()
325 {
326     bool state = isOpincStateChanged_;
327     isOpincStateChanged_ = false;
328     return state;
329 }
330 
SetShadowRect(Drawing::Rect rect)331 void RSRenderParams::SetShadowRect(Drawing::Rect rect)
332 {
333     if (shadowRect_ == rect) {
334         return;
335     }
336     shadowRect_ = rect;
337     needSync_ = true;
338 }
339 
GetShadowRect() const340 Drawing::Rect RSRenderParams::GetShadowRect() const
341 {
342     return shadowRect_;
343 }
344 
SetNeedSync(bool needSync)345 void RSRenderParams::SetNeedSync(bool needSync)
346 {
347     needSync_ = needSync;
348 }
349 
SetFrameGravity(Gravity gravity)350 void RSRenderParams::SetFrameGravity(Gravity gravity)
351 {
352     if (frameGravity_ == gravity) {
353         return;
354     }
355     frameGravity_ = gravity;
356     needSync_ = true;
357 }
358 
SetNeedFilter(bool needFilter)359 void RSRenderParams::SetNeedFilter(bool needFilter)
360 {
361     if (needFilter_ == needFilter) {
362         return;
363     }
364     needFilter_ = needFilter;
365     needSync_ = true;
366 }
367 
SetNodeType(RSRenderNodeType type)368 void RSRenderParams::SetNodeType(RSRenderNodeType type)
369 {
370     if (renderNodeType_ == type) {
371         return;
372     }
373     renderNodeType_ = type;
374     needSync_ = true;
375 }
376 
SetEffectNodeShouldPaint(bool effectNodeShouldPaint)377 void RSRenderParams::SetEffectNodeShouldPaint(bool effectNodeShouldPaint)
378 {
379     if (effectNodeShouldPaint_ == effectNodeShouldPaint) {
380         return;
381     }
382     effectNodeShouldPaint_ = effectNodeShouldPaint;
383     needSync_ = true;
384 }
385 
SetHasGlobalCorner(bool hasGlobalCorner)386 void RSRenderParams::SetHasGlobalCorner(bool hasGlobalCorner)
387 {
388     if (hasGlobalCorner_ == hasGlobalCorner) {
389         return;
390     }
391     hasGlobalCorner_ = hasGlobalCorner;
392     needSync_ = true;
393 }
394 
SetHasBlurFilter(bool hasBlurFilter)395 void RSRenderParams::SetHasBlurFilter(bool hasBlurFilter)
396 {
397     if (hasBlurFilter_ == hasBlurFilter) {
398         return;
399     }
400     hasBlurFilter_ = hasBlurFilter;
401     needSync_ = true;
402 }
403 
SetGlobalAlpha(float alpha)404 void RSRenderParams::SetGlobalAlpha(float alpha)
405 {
406     if (ROSEN_EQ(globalAlpha_, alpha)) {
407         return;
408     }
409     globalAlpha_ = alpha;
410     needSync_ = true;
411 }
412 
NeedSync() const413 bool RSRenderParams::NeedSync() const
414 {
415     return needSync_;
416 }
417 
OnCanvasDrawingSurfaceChange(const std::unique_ptr<RSRenderParams> & target)418 void RSRenderParams::OnCanvasDrawingSurfaceChange(const std::unique_ptr<RSRenderParams>& target)
419 {
420     if (!canvasDrawingNodeSurfaceChanged_) {
421         return;
422     }
423     target->canvasDrawingNodeSurfaceChanged_ = true;
424     target->surfaceParams_.width = surfaceParams_.width;
425     target->surfaceParams_.height = surfaceParams_.height;
426     if (GetParamsType() == RSRenderParamsType::RS_PARAM_OWNED_BY_DRAWABLE) {
427         return;
428     }
429     canvasDrawingNodeSurfaceChanged_ = false;
430 }
431 
GetCanvasDrawingSurfaceChanged() const432 bool RSRenderParams::GetCanvasDrawingSurfaceChanged() const
433 {
434     return canvasDrawingNodeSurfaceChanged_;
435 }
436 
SetCanvasDrawingSurfaceChanged(bool changeFlag)437 void RSRenderParams::SetCanvasDrawingSurfaceChanged(bool changeFlag)
438 {
439     if (changeFlag) {
440         needSync_ = true;
441     }
442     canvasDrawingNodeSurfaceChanged_ = changeFlag;
443 }
444 
GetForegroundFilterCache() const445 const std::shared_ptr<RSFilter>& RSRenderParams::GetForegroundFilterCache() const
446 {
447     return foregroundFilterCache_;
448 }
449 
SetForegroundFilterCache(const std::shared_ptr<RSFilter> & foregroundFilterCache)450 void RSRenderParams::SetForegroundFilterCache(const std::shared_ptr<RSFilter>& foregroundFilterCache)
451 {
452     if (foregroundFilterCache_ == foregroundFilterCache) {
453         return;
454     }
455     foregroundFilterCache_ = foregroundFilterCache;
456     needSync_ = true;
457 }
458 
GetCanvasDrawingSurfaceParams()459 RSRenderParams::SurfaceParam RSRenderParams::GetCanvasDrawingSurfaceParams()
460 {
461     return surfaceParams_;
462 }
463 
SetCanvasDrawingSurfaceParams(int width,int height)464 void RSRenderParams::SetCanvasDrawingSurfaceParams(int width, int height)
465 {
466     surfaceParams_.width = width;
467     surfaceParams_.height = height;
468 }
469 
OnSync(const std::unique_ptr<RSRenderParams> & target)470 void RSRenderParams::OnSync(const std::unique_ptr<RSRenderParams>& target)
471 {
472     if (dirtyType_.test(RSRenderParamsDirtyType::MATRIX_DIRTY)) {
473         target->matrix_.Swap(matrix_);
474         dirtyType_.reset(RSRenderParamsDirtyType::MATRIX_DIRTY);
475     }
476     if (dirtyType_.test(RSRenderParamsDirtyType::DRAWING_CACHE_TYPE_DIRTY)) {
477         target->drawingCacheType_ = drawingCacheType_;
478         dirtyType_.reset(RSRenderParamsDirtyType::DRAWING_CACHE_TYPE_DIRTY);
479     }
480     target->alpha_ = alpha_;
481     target->boundsRect_ = boundsRect_;
482     target->frameRect_ = frameRect_;
483     target->shouldPaint_ = shouldPaint_;
484     target->contentEmpty_ = contentEmpty_;
485     target->hasSandBox_ = hasSandBox_;
486     target->localDrawRect_ = localDrawRect_;
487     target->id_ = id_;
488     target->cacheSize_ = cacheSize_;
489     target->frameGravity_ = frameGravity_;
490     target->childHasVisibleFilter_ = childHasVisibleFilter_;
491     target->childHasVisibleEffect_ = childHasVisibleEffect_;
492     // use flag in render param and staging render param to determine if cache should be updated
493     // (flag in render param may be not used because of occlusion skip, so we need to update cache in next frame)
494     target->isDrawingCacheChanged_ = target->isDrawingCacheChanged_ || isDrawingCacheChanged_;
495     target->shadowRect_ = shadowRect_;
496     target->drawingCacheIncludeProperty_ = drawingCacheIncludeProperty_;
497     target->dirtyRegionInfoForDFX_ = dirtyRegionInfoForDFX_;
498     target->alphaOffScreen_ = alphaOffScreen_;
499     target->needFilter_ = needFilter_;
500     target->renderNodeType_ = renderNodeType_;
501     target->globalAlpha_ = globalAlpha_;
502     target->effectNodeShouldPaint_ = effectNodeShouldPaint_;
503     target->hasGlobalCorner_ = hasGlobalCorner_;
504     target->hasBlurFilter_ = hasBlurFilter_;
505     target->foregroundFilterCache_ = foregroundFilterCache_;
506     OnCanvasDrawingSurfaceChange(target);
507     target->isOpincRootFlag_ = isOpincRootFlag_;
508     target->isOpincStateChanged_ = target->isOpincStateChanged_ || isOpincStateChanged_;
509     target->startingWindowFlag_ = startingWindowFlag_;
510     target->freezeFlag_ = freezeFlag_;
511     target->absDrawRect_ = absDrawRect_;
512     target->firstLevelNodeId_ = firstLevelNodeId_;
513     target->uifirstRootNodeId_ = uifirstRootNodeId_;
514     target->isFirstLevelCrossNode_ = isFirstLevelCrossNode_;
515     target->cloneSourceDrawable_ = cloneSourceDrawable_;
516     target->isCrossNodeOffscreenOn_ = isCrossNodeOffscreenOn_;
517     target->absRotation_ = absRotation_;
518     target->hasUnobscuredUEC_ = hasUnobscuredUEC_;
519 
520     // [Attention] Only used in PC window resize scene now
521     target->windowKeyframeEnabled_ = windowKeyframeEnabled_;
522     target->linkedRootNodeDrawable_ = linkedRootNodeDrawable_;
523     target->needSwapBuffer_ = needSwapBuffer_;
524     target->cacheNodeFrameRect_ = cacheNodeFrameRect_;
525 
526     needSync_ = false;
527 }
528 
ToString() const529 std::string RSRenderParams::ToString() const
530 {
531     std::string ret = "RSRenderParams:";
532     ret += RENDER_BASIC_PARAM_TO_STRING(id_);
533     if (alpha_ != 1.0f) {
534         ret += RENDER_BASIC_PARAM_TO_STRING(alpha_);
535     }
536     if (hasSandBox_) {
537         ret += RENDER_BASIC_PARAM_TO_STRING(hasSandBox_);
538     }
539     ret += RENDER_RECT_PARAM_TO_STRING(localDrawRect_);
540     ret += RENDER_BASIC_PARAM_TO_STRING(shouldPaint_);
541     ret += RENDER_BASIC_PARAM_TO_STRING(int(frameGravity_));
542     if (foregroundFilterCache_ != nullptr) {
543         ret += foregroundFilterCache_->GetDescription();
544     }
545     return ret;
546 }
547 
SetParentSurfaceMatrix(const Drawing::Matrix & parentSurfaceMatrix)548 void RSRenderParams::SetParentSurfaceMatrix(const Drawing::Matrix& parentSurfaceMatrix)
549 {
550     parentSurfaceMatrix_ = parentSurfaceMatrix;
551 }
GetParentSurfaceMatrix()552 const Drawing::Matrix& RSRenderParams::GetParentSurfaceMatrix()
553 {
554     return parentSurfaceMatrix_;
555 }
556 
SetFirstLevelNode(NodeId firstLevelNodeId)557 bool RSRenderParams::SetFirstLevelNode(NodeId firstLevelNodeId)
558 {
559     if (firstLevelNodeId_ == firstLevelNodeId) {
560         return false;
561     }
562     firstLevelNodeId_ = firstLevelNodeId;
563     needSync_ = true;
564     return true;
565 }
566 
GetFirstLevelNodeId() const567 NodeId RSRenderParams::GetFirstLevelNodeId() const
568 {
569     return firstLevelNodeId_;
570 }
571 
SetUiFirstRootNode(NodeId uifirstRootNodeId)572 bool RSRenderParams::SetUiFirstRootNode(NodeId uifirstRootNodeId)
573 {
574     if (uifirstRootNodeId_ == uifirstRootNodeId) {
575         return false;
576     }
577     uifirstRootNodeId_ = uifirstRootNodeId;
578     needSync_ = true;
579     return true;
580 }
581 
GetUifirstRootNodeId() const582 NodeId RSRenderParams::GetUifirstRootNodeId() const
583 {
584     return uifirstRootNodeId_;
585 }
586 
587 // overrided surface params
GetLayerInfo() const588 const RSLayerInfo& RSRenderParams::GetLayerInfo() const
589 {
590     static const RSLayerInfo defaultLayerInfo = {};
591     return defaultLayerInfo;
592 }
593 
594 // overrided by displayNode
GetScreenInfo() const595 const ScreenInfo& RSRenderParams::GetScreenInfo() const
596 {
597     static ScreenInfo defalutScreenInfo;
598     return defalutScreenInfo;
599 }
600 
GetTotalMatrix()601 const Drawing::Matrix& RSRenderParams::GetTotalMatrix()
602 {
603     static const Drawing::Matrix defaultMatrix;
604     return defaultMatrix;
605 }
606 // virtual display params
GetMirrorSourceDrawable()607 DrawableV2::RSRenderNodeDrawableAdapter::WeakPtr RSRenderParams::GetMirrorSourceDrawable()
608 {
609     static DrawableV2::RSRenderNodeDrawableAdapter::WeakPtr defaultPtr;
610     return defaultPtr;
611 }
612 
GetCloneSourceDrawable() const613 DrawableV2::RSRenderNodeDrawableAdapter::WeakPtr RSRenderParams::GetCloneSourceDrawable() const
614 {
615     return cloneSourceDrawable_;
616 }
617 
SetCloneSourceDrawable(DrawableV2::RSRenderNodeDrawableAdapter::WeakPtr drawable)618 void RSRenderParams::SetCloneSourceDrawable(DrawableV2::RSRenderNodeDrawableAdapter::WeakPtr drawable)
619 {
620     cloneSourceDrawable_ = drawable;
621 }
622 
623 // [Attention] Only used in PC window resize scene now
EnableWindowKeyFrame(bool enable)624 void RSRenderParams::EnableWindowKeyFrame(bool enable)
625 {
626     if (windowKeyframeEnabled_ == enable) {
627         return;
628     }
629 
630     windowKeyframeEnabled_ = enable;
631     needSync_ = true;
632 }
633 
634 // [Attention] Only used in PC window resize scene now
IsWindowKeyFrameEnabled() const635 bool RSRenderParams::IsWindowKeyFrameEnabled() const
636 {
637     return windowKeyframeEnabled_;
638 }
639 
640 // [Attention] Only used in PC window resize scene now
SetLinkedRootNodeDrawable(DrawableV2::RSRenderNodeDrawableAdapter::WeakPtr drawable)641 void RSRenderParams::SetLinkedRootNodeDrawable(DrawableV2::RSRenderNodeDrawableAdapter::WeakPtr drawable)
642 {
643     linkedRootNodeDrawable_ = drawable;
644     needSync_ = true;
645 }
646 
647 // [Attention] Only used in PC window resize scene now
GetLinkedRootNodeDrawable()648 DrawableV2::RSRenderNodeDrawableAdapter::WeakPtr RSRenderParams::GetLinkedRootNodeDrawable()
649 {
650     return linkedRootNodeDrawable_;
651 }
652 
653 // [Attention] Only used in PC window resize scene now
SetNeedSwapBuffer(bool needSwapBuffer)654 void RSRenderParams::SetNeedSwapBuffer(bool needSwapBuffer)
655 {
656     if (needSwapBuffer_ == needSwapBuffer) {
657         return;
658     }
659     needSwapBuffer_ = needSwapBuffer;
660     needSync_ = true;
661 }
662 
663 // [Attention] Only used in PC window resize scene now
GetNeedSwapBuffer() const664 bool RSRenderParams::GetNeedSwapBuffer() const
665 {
666     return needSwapBuffer_;
667 }
668 
669 // [Attention] Only used in PC window resize scene now
SetCacheNodeFrameRect(const Drawing::RectF & cacheNodeFrameRect)670 void RSRenderParams::SetCacheNodeFrameRect(const Drawing::RectF& cacheNodeFrameRect)
671 {
672     if (cacheNodeFrameRect_ == cacheNodeFrameRect) {
673         return;
674     }
675     cacheNodeFrameRect_ = cacheNodeFrameRect;
676     needSync_ = true;
677 }
678 
679 // [Attention] Only used in PC window resize scene now
GetCacheNodeFrameRect() const680 const Drawing::RectF& RSRenderParams::GetCacheNodeFrameRect() const
681 {
682     return cacheNodeFrameRect_;
683 }
684 } // namespace OHOS::Rosen
685