• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /*
2  * Copyright (c) 2025 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_RCD_RENDER_PARAMS_H
17 #define RENDER_SERVICE_BASE_PARAMS_RS_RCD_RENDER_PARAMS_H
18 
19 #include "params/rs_render_params.h"
20 
21 namespace OHOS::Rosen {
22 // remove this when rcd node is replaced by hardware composer node in OH 6.0 rcd refactoring
23 class RSB_EXPORT RSRcdRenderParams : public RSRenderParams {
24 public:
25     explicit RSRcdRenderParams(NodeId id);
26     ~RSRcdRenderParams() override = default;
27     void OnSync(const std::unique_ptr<RSRenderParams>& target) override;
28 
29     void SetPathBin(std::string pathBin);
30     std::string GetPathBin() const;
31     void SetBufferSize(int bufferSize);
32     int GetBufferSize() const;
33     void SetCldWidth(int cldWidth);
34     int GetCldWidth() const;
35     void SetCldHeight(int cldWidth);
36     int GetCldHeight() const;
37 
38     void SetSrcRect(RectI srcRect);
39     RectI GetSrcRect() const;
40     void SetDstRect(RectI dstRect);
41     RectI GetDstRect() const;
42 
43     void SetRcdBitmap(std::shared_ptr<Drawing::Bitmap> rcdBitmap);
44     std::shared_ptr<Drawing::Bitmap> GetRcdBitmap() const;
45 
46     void SetRcdEnabled(bool rcdEnabled_);
47     bool GetRcdEnabled() const;
48 
49     void SetResourceChanged(bool resourceChanged);
50     bool GetResourceChanged() const;
51 
52 private:
53     std::string pathBin_;
54     int bufferSize_ = 0;
55     int cldWidth_ = 0;
56     int cldHeight_ = 0;
57 
58     RectI srcRect_;
59     RectI dstRect_;
60 
61     std::shared_ptr<Drawing::Bitmap> rcdBitmap_ = nullptr;
62 
63     bool rcdEnabled_ = false;
64     bool resourceChanged_ = false;
65 };
66 } // namespace OHOS::Rosen
67 #endif // RENDER_SERVICE_BASE_PARAMS_RS_EFFECT_RENDER_PARAMS_H
68