• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /*
2  * Copyright (c) 2021 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 HDI_BACKEND_HDI_LAYER_INFO_H
17 #define HDI_BACKEND_HDI_LAYER_INFO_H
18 
19 #include <string>
20 #include "iconsumer_surface.h"
21 #include <surface.h>
22 #include <sync_fence.h>
23 #include "graphic_error.h"
24 #include "hdi_display_type.h"
25 
26 namespace OHOS {
27 namespace Rosen {
28 static const std::map<GraphicTransformType, std::string> TransformTypeStrs = {
29     {GRAPHIC_ROTATE_NONE,                    "0 <no rotation>"},
30     {GRAPHIC_ROTATE_90,                      "1 <rotation by 90 degrees>"},
31     {GRAPHIC_ROTATE_180,                     "2 <rotation by 180 degrees>"},
32     {GRAPHIC_ROTATE_270,                     "3 <rotation by 270 degrees>"},
33     {GRAPHIC_FLIP_H,                         "4 <flip horizontally>"},
34     {GRAPHIC_FLIP_V,                         "5 <flip vertically>"},
35     {GRAPHIC_FLIP_H_ROT90,                   "6 <flip horizontally and rotate 90 degrees>"},
36     {GRAPHIC_FLIP_V_ROT90,                   "7 <flip vertically and rotate 90 degrees>"},
37     {GRAPHIC_FLIP_H_ROT180,                  "8 <flip horizontally and rotate 180 degrees>"},
38     {GRAPHIC_FLIP_V_ROT180,                  "9 <flip vertically and rotate 180 degrees>"},
39     {GRAPHIC_FLIP_H_ROT270,                  "10 <flip horizontally and rotate 270 degrees>"},
40     {GRAPHIC_FLIP_V_ROT270,                  "11 <flip vertically and rotate 270 degrees>"},
41     {GRAPHIC_ROTATE_BUTT,                    "12 <uninitialized>"},
42 };
43 
44 static const std::map<GraphicCompositionType, std::string> CompositionTypeStrs = {
45     {GRAPHIC_COMPOSITION_CLIENT,             "0 <client composistion>"},
46     {GRAPHIC_COMPOSITION_DEVICE,             "1 <device composistion>"},
47     {GRAPHIC_COMPOSITION_CURSOR,             "2 <cursor composistion>"},
48     {GRAPHIC_COMPOSITION_VIDEO,              "3 <video composistion>"},
49     {GRAPHIC_COMPOSITION_DEVICE_CLEAR,       "4 <device clear composistion>"},
50     {GRAPHIC_COMPOSITION_CLIENT_CLEAR,       "5 <client clear composistion>"},
51     {GRAPHIC_COMPOSITION_TUNNEL,             "6 <tunnel composistion>"},
52     {GRAPHIC_COMPOSITION_SOLID_COLOR,        "7 <layercolor composition>"},
53     {GRAPHIC_COMPOSITION_BUTT,               "8 <uninitialized>"},
54 };
55 
56 static const std::map<GraphicBlendType, std::string> BlendTypeStrs = {
57     {GRAPHIC_BLEND_NONE,                     "0 <No blending>"},
58     {GRAPHIC_BLEND_CLEAR,                    "1 <CLEAR blending>"},
59     {GRAPHIC_BLEND_SRC,                      "2 <SRC blending>"},
60     {GRAPHIC_BLEND_SRCOVER,                  "3 <SRC_OVER blending>"},
61     {GRAPHIC_BLEND_DSTOVER,                  "4 <DST_OVER blending>"},
62     {GRAPHIC_BLEND_SRCIN,                    "5 <SRC_IN blending>"},
63     {GRAPHIC_BLEND_DSTIN,                    "6 <DST_IN blending>"},
64     {GRAPHIC_BLEND_SRCOUT,                   "7 <SRC_OUT blending>"},
65     {GRAPHIC_BLEND_DSTOUT,                   "8 <DST_OUT blending>"},
66     {GRAPHIC_BLEND_SRCATOP,                  "9 <SRC_ATOP blending>"},
67     {GRAPHIC_BLEND_DSTATOP,                  "10 <DST_ATOP blending>"},
68     {GRAPHIC_BLEND_ADD,                      "11 <ADD blending>"},
69     {GRAPHIC_BLEND_XOR,                      "12 <XOR blending>"},
70     {GRAPHIC_BLEND_DST,                      "13 <DST blending>"},
71     {GRAPHIC_BLEND_AKS,                      "14 <AKS blending>"},
72     {GRAPHIC_BLEND_AKD,                      "15 <AKD blending>"},
73     {GRAPHIC_BLEND_BUTT,                     "16 <Uninitialized>"},
74 };
75 
76 class HdiLayerInfo {
77 public:
78     HdiLayerInfo() = default;
79     virtual ~HdiLayerInfo() = default;
80 
81     enum class LayerMask {
82         LAYER_MASK_NORMAL = 0,
83         LAYER_MASK_HBM_SYNC = 1,   // enable fingerprint
84     };
85 
86     /* rs create and set/get layer info begin */
CreateHdiLayerInfo()87     static std::shared_ptr<HdiLayerInfo> CreateHdiLayerInfo()
88     {
89         return std::make_shared<HdiLayerInfo>();
90     }
91 
SetSurface(const sptr<IConsumerSurface> & surface)92     void SetSurface(const sptr<IConsumerSurface> &surface)
93     {
94         cSurface_ = surface;
95     }
96 
SetBuffer(const sptr<SurfaceBuffer> & sbuffer,const sptr<SyncFence> & acquireFence)97     void SetBuffer(const sptr<SurfaceBuffer> &sbuffer, const sptr<SyncFence> &acquireFence)
98     {
99         sbuffer_ = sbuffer;
100         acquireFence_ = acquireFence;
101     }
102 
SetPreBuffer(const sptr<SurfaceBuffer> & buffer)103     void SetPreBuffer(const sptr<SurfaceBuffer> &buffer)
104     {
105         pbuffer_ = buffer;
106     }
107 
SetZorder(int32_t zOrder)108     void SetZorder(int32_t zOrder)
109     {
110         zOrder_ = static_cast<uint32_t>(zOrder);
111     }
112 
SetType(const GraphicLayerType & layerType)113     void SetType(const GraphicLayerType& layerType)
114     {
115         layerType_ = layerType;
116     }
117 
GetType()118     GraphicLayerType GetType() const
119     {
120         return layerType_;
121     }
122 
SetAlpha(const GraphicLayerAlpha & alpha)123     void SetAlpha(const GraphicLayerAlpha &alpha)
124     {
125         layerAlpha_ = alpha;
126     }
127 
SetTransform(GraphicTransformType type)128     void SetTransform(GraphicTransformType type)
129     {
130         transformType_ = type;
131     }
132 
SetCompositionType(GraphicCompositionType type)133     void SetCompositionType(GraphicCompositionType type)
134     {
135         compositionType_ = type;
136     }
137 
SetVisibleRegions(const std::vector<GraphicIRect> & visibleRegions)138     void SetVisibleRegions(const std::vector<GraphicIRect> &visibleRegions)
139     {
140         std::lock_guard<std::mutex> lock(mutex_);
141         visibleRegions_ = visibleRegions;
142     }
143 
SetDirtyRegions(const std::vector<GraphicIRect> & dirtyRegions)144     void SetDirtyRegions(const std::vector<GraphicIRect> &dirtyRegions)
145     {
146         std::lock_guard<std::mutex> lock(mutex_);
147         dirtyRegions_ = dirtyRegions;
148     }
149 
SetBlendType(GraphicBlendType type)150     void SetBlendType(GraphicBlendType type)
151     {
152         blendType_ = type;
153     }
154 
SetCropRect(const GraphicIRect & crop)155     void SetCropRect(const GraphicIRect &crop)
156     {
157         cropRect_ = crop;
158     }
159 
SetPreMulti(bool preMulti)160     void SetPreMulti(bool preMulti)
161     {
162         preMulti_ = preMulti;
163     }
164 
SetLayerSize(const GraphicIRect & layerRect)165     void SetLayerSize(const GraphicIRect &layerRect)
166     {
167         layerRect_ = layerRect;
168     }
169 
SetBoundSize(const GraphicIRect & boundRect)170     void SetBoundSize(const GraphicIRect &boundRect)
171     {
172         boundRect_ = boundRect;
173     }
174 
SetLayerColor(GraphicLayerColor layerColor)175     void SetLayerColor(GraphicLayerColor layerColor)
176     {
177         layerColor_ = layerColor;
178     }
179 
SetBackgroundColor(GraphicLayerColor backgroundColor)180     void SetBackgroundColor(GraphicLayerColor backgroundColor)
181     {
182         backgroundColor_ = backgroundColor;
183     }
184 
SetCornerRadiusInfoForDRM(const std::vector<float> & drmCornerRadiusInfo)185     void SetCornerRadiusInfoForDRM(const std::vector<float>& drmCornerRadiusInfo)
186     {
187         drmCornerRadiusInfo_ = drmCornerRadiusInfo;
188     }
189 
SetColorTransform(const std::vector<float> & matrix)190     void SetColorTransform(const std::vector<float> &matrix)
191     {
192         colorTransformMatrix_ = matrix;
193     }
194 
SetColorDataSpace(GraphicColorDataSpace colorSpace)195     void SetColorDataSpace(GraphicColorDataSpace colorSpace)
196     {
197         colorSpace_ = colorSpace;
198     }
199 
SetMetaData(const std::vector<GraphicHDRMetaData> & metaData)200     void SetMetaData(const std::vector<GraphicHDRMetaData> &metaData)
201     {
202         metaData_ = metaData;
203     }
204 
SetMetaDataSet(const GraphicHDRMetaDataSet & metaDataSet)205     void SetMetaDataSet(const GraphicHDRMetaDataSet &metaDataSet)
206     {
207         metaDataSet_ = metaDataSet;
208     }
209 
SetMatrix(GraphicMatrix matrix)210     void SetMatrix(GraphicMatrix matrix)
211     {
212         matrix_ = matrix;
213     }
214 
SetGravity(int32_t gravity)215     void SetGravity(int32_t gravity)
216     {
217         gravity_ = gravity;
218     }
219 
SetUniRenderFlag(bool isUniRender)220     void SetUniRenderFlag(bool isUniRender)
221     {
222         isUniRender_ = isUniRender;
223     }
224 
SetTunnelHandleChange(bool change)225     void SetTunnelHandleChange(bool change)
226     {
227         tunnelHandleChange_ = change;
228     }
229 
SetTunnelHandle(const sptr<SurfaceTunnelHandle> & handle)230     void SetTunnelHandle(const sptr<SurfaceTunnelHandle> &handle)
231     {
232         tunnelHandle_ = handle;
233     }
234 
IsSupportedPresentTimestamp()235     bool IsSupportedPresentTimestamp() const
236     {
237         return IsSupportedPresentTimestamp_;
238     }
239 
GetPresentTimestamp()240     const GraphicPresentTimestamp &GetPresentTimestamp()
241     {
242         return presentTimestamp_;
243     }
244 
245     /* rs create and set/get layer info end */
246 
247     /* hdiLayer get layer info begin */
GetSurface()248     sptr<IConsumerSurface> GetSurface() const
249     {
250         return cSurface_;
251     }
252 
GetBuffer()253     sptr<SurfaceBuffer> GetBuffer() const
254     {
255         return sbuffer_;
256     }
257 
GetPreBuffer()258     sptr<SurfaceBuffer> GetPreBuffer() const
259     {
260         return pbuffer_;
261     }
262 
GetZorder()263     uint32_t GetZorder() const
264     {
265         return zOrder_;
266     }
267 
GetAcquireFence()268     sptr<SyncFence> GetAcquireFence() const
269     {
270         return acquireFence_;
271     }
272 
GetAlpha()273     const GraphicLayerAlpha &GetAlpha()
274     {
275         return layerAlpha_;
276     }
277 
GetTransformType()278     GraphicTransformType GetTransformType() const
279     {
280         return transformType_;
281     }
282 
GetCompositionType()283     GraphicCompositionType GetCompositionType() const
284     {
285         return compositionType_;
286     }
287 
GetVisibleRegions()288     const std::vector<GraphicIRect> &GetVisibleRegions()
289     {
290         std::lock_guard<std::mutex> lock(mutex_);
291         return visibleRegions_;
292     }
293 
GetDirtyRegions()294     const std::vector<GraphicIRect> &GetDirtyRegions()
295     {
296         std::lock_guard<std::mutex> lock(mutex_);
297         return dirtyRegions_;
298     }
299 
GetBlendType()300     GraphicBlendType GetBlendType() const
301     {
302         return blendType_;
303     }
304 
GetCropRect()305     const GraphicIRect &GetCropRect()
306     {
307         return cropRect_;
308     }
309 
GetLayerSize()310     const GraphicIRect &GetLayerSize()
311     {
312         return layerRect_;
313     }
314 
GetBoundSize()315     GraphicIRect GetBoundSize() const
316     {
317         return boundRect_;
318     }
319 
GetMatrix()320     GraphicMatrix GetMatrix() const
321     {
322         return matrix_;
323     }
324 
GetGravity()325     int32_t GetGravity() const
326     {
327         return gravity_;
328     }
329 
GetUniRenderFlag()330     bool GetUniRenderFlag() const
331     {
332         return isUniRender_;
333     }
334 
IsPreMulti()335     bool IsPreMulti() const
336     {
337         return preMulti_;
338     }
339 
SetWindowsName(std::vector<std::string> & windowsName)340     void SetWindowsName(std::vector<std::string>& windowsName)
341     {
342         windowsName_ = windowsName;
343     }
344 
GetWindowsName()345     const std::vector<std::string>& GetWindowsName()
346     {
347         return windowsName_;
348     }
349 
GetColorTransform()350     const std::vector<float> &GetColorTransform()
351     {
352         return colorTransformMatrix_;
353     }
354 
GetColorDataSpace()355     GraphicColorDataSpace GetColorDataSpace() const
356     {
357         return colorSpace_;
358     }
359 
GetLayerColor()360     GraphicLayerColor GetLayerColor() const
361     {
362         return layerColor_;
363     }
364 
GetBackgroundColor()365     GraphicLayerColor GetBackgroundColor() const
366     {
367         return backgroundColor_;
368     }
369 
GetCornerRadiusInfoForDRM()370     const std::vector<float>& GetCornerRadiusInfoForDRM() const
371     {
372         return drmCornerRadiusInfo_;
373     }
374 
GetMetaData()375     std::vector<GraphicHDRMetaData> &GetMetaData()
376     {
377         return metaData_;
378     }
379 
GetMetaDataSet()380     GraphicHDRMetaDataSet &GetMetaDataSet()
381     {
382         return metaDataSet_;
383     }
384 
GetTunnelHandleChange()385     bool GetTunnelHandleChange() const
386     {
387         return tunnelHandleChange_;
388     }
389 
GetTunnelHandle()390     sptr<SurfaceTunnelHandle> GetTunnelHandle() const
391     {
392         return tunnelHandle_;
393     }
394 
SetIsSupportedPresentTimestamp(bool isSupported)395     void SetIsSupportedPresentTimestamp(bool isSupported)
396     {
397         IsSupportedPresentTimestamp_ = isSupported;
398     }
399 
SetPresentTimestamp(const GraphicPresentTimestamp & timestamp)400     void SetPresentTimestamp(const GraphicPresentTimestamp &timestamp)
401     {
402         presentTimestamp_ = timestamp;
403     }
404 
GetSdrNit()405     float GetSdrNit() const
406     {
407         return sdrNit_;
408     }
409 
GetDisplayNit()410     float GetDisplayNit() const
411     {
412         return displayNit_;
413     }
414 
GetBrightnessRatio()415     float GetBrightnessRatio() const
416     {
417         return brightnessRatio_;
418     }
419 
SetSdrNit(float sdrNit)420     void SetSdrNit(float sdrNit)
421     {
422         sdrNit_ = sdrNit;
423     }
424 
SetDisplayNit(float displayNit)425     void SetDisplayNit(float displayNit)
426     {
427         displayNit_ = displayNit;
428     }
429 
SetBrightnessRatio(float brightnessRatio)430     void SetBrightnessRatio(float brightnessRatio)
431     {
432         brightnessRatio_ = brightnessRatio;
433     }
434 
GetLayerLinearMatrix()435     const std::vector<float>& GetLayerLinearMatrix() const
436     {
437         return layerLinearMatrix_;
438     }
439 
SetLayerLinearMatrix(const std::vector<float> & layerLinearMatrix)440     void SetLayerLinearMatrix(const std::vector<float>& layerLinearMatrix)
441     {
442         layerLinearMatrix_ = layerLinearMatrix;
443     }
444 
445     // source crop tuning
GetLayerSourceTuning()446     int32_t GetLayerSourceTuning() const
447     {
448         return layerSource_;
449     }
450 
SetLayerSourceTuning(int32_t layerSouce)451     void SetLayerSourceTuning(int32_t layerSouce)
452     {
453         layerSource_ = layerSouce;
454     }
455 
SetRotationFixed(bool rotationFixed)456     void SetRotationFixed(bool rotationFixed)
457     {
458         rotationFixed_ = rotationFixed;
459     }
460 
GetRotationFixed()461     bool GetRotationFixed() const
462     {
463         return rotationFixed_;
464     }
465 
SetLayerArsr(bool arsrTag)466     void SetLayerArsr(bool arsrTag)
467     {
468         arsrTag_ = arsrTag;
469     }
470 
GetLayerArsr()471     bool GetLayerArsr() const
472     {
473         return arsrTag_;
474     }
475 
SetNeedBilinearInterpolation(bool need)476     void SetNeedBilinearInterpolation(bool need)
477     {
478         needBilinearInterpolation_ = need;
479     }
480 
GetNeedBilinearInterpolation()481     bool GetNeedBilinearInterpolation() const
482     {
483         return needBilinearInterpolation_;
484     }
485 
CopyLayerInfo(const std::shared_ptr<HdiLayerInfo> & layerInfo)486     void CopyLayerInfo(const std::shared_ptr<HdiLayerInfo> &layerInfo)
487     {
488         std::lock_guard<std::mutex> lock(mutex_);
489         zOrder_ = layerInfo->GetZorder();
490         layerRect_ = layerInfo->GetLayerSize();
491         boundRect_ = layerInfo->GetBoundSize();
492         visibleRegions_ = layerInfo->GetVisibleRegions();
493         dirtyRegions_ = layerInfo->GetDirtyRegions();
494         cropRect_ = layerInfo->GetCropRect();
495         matrix_ = layerInfo->GetMatrix();
496         gravity_ = layerInfo->GetGravity();
497         layerAlpha_ = layerInfo->GetAlpha();
498         transformType_ = layerInfo->GetTransformType();
499         compositionType_ = layerInfo->GetCompositionType();
500         blendType_ = layerInfo->GetBlendType();
501         colorTransformMatrix_ = layerInfo->GetColorTransform();
502         colorSpace_ = layerInfo->GetColorDataSpace();
503         layerColor_ = layerInfo->GetLayerColor();
504         metaData_ = layerInfo->GetMetaData();
505         metaDataSet_ = layerInfo->GetMetaDataSet();
506         tunnelHandle_ = layerInfo->GetTunnelHandle();
507         tunnelHandleChange_ = layerInfo->GetTunnelHandleChange();
508         sbuffer_ = layerInfo->GetBuffer();
509         pbuffer_= layerInfo->GetPreBuffer();
510         acquireFence_ = layerInfo->GetAcquireFence();
511         preMulti_ = layerInfo->IsPreMulti();
512         sdrNit_ = layerInfo->GetSdrNit();
513         displayNit_ = layerInfo->GetDisplayNit();
514         brightnessRatio_ = layerInfo->GetBrightnessRatio();
515         layerLinearMatrix_ = layerInfo->GetLayerLinearMatrix();
516         layerSource_ = layerInfo->GetLayerSourceTuning();
517         rotationFixed_ = layerInfo->GetRotationFixed();
518         arsrTag_ = layerInfo->GetLayerArsr();
519         needBilinearInterpolation_ = layerInfo->GetNeedBilinearInterpolation();
520     }
521 
Dump(std::string & result)522     void Dump(std::string &result) const
523     {
524         std::lock_guard<std::mutex> lock(mutex_);
525         if (TransformTypeStrs.find(transformType_) != TransformTypeStrs.end() &&
526             CompositionTypeStrs.find(compositionType_) != CompositionTypeStrs.end() &&
527             BlendTypeStrs.find(blendType_) != BlendTypeStrs.end()) {
528             result += " zOrder = " + std::to_string(zOrder_) +
529                 ", visibleNum = " + std::to_string(visibleRegions_.size()) +
530                 ", transformType = " + TransformTypeStrs.at(transformType_) +
531                 ", compositionType = " + CompositionTypeStrs.at(compositionType_) +
532                 ", blendType = " + BlendTypeStrs.at(blendType_) +
533                 ", layerAlpha = [enGlobalAlpha(" + std::to_string(layerAlpha_.enGlobalAlpha) + "), enPixelAlpha(" +
534                 std::to_string(layerAlpha_.enPixelAlpha) + "), alpha0(" +
535                 std::to_string(layerAlpha_.alpha0) + "), alpha1(" +
536                 std::to_string(layerAlpha_.alpha1) + "), gAlpha(" +
537                 std::to_string(layerAlpha_.gAlpha) + ")].\n";
538         }
539         result += " layerRect = [" + std::to_string(layerRect_.x) + ", " +
540             std::to_string(layerRect_.y) + ", " +
541             std::to_string(layerRect_.w) + ", " +
542             std::to_string(layerRect_.h) + "], ";
543         result += "cropRect = [" + std::to_string(cropRect_.x) + ", " +
544             std::to_string(cropRect_.y) + ", " +
545             std::to_string(cropRect_.w) + ", " +
546             std::to_string(cropRect_.h) + "],";
547         for (decltype(visibleRegions_.size()) i = 0; i < visibleRegions_.size(); i++) {
548             result += "visibleRegions[" + std::to_string(i) + "] = [" +
549                 std::to_string(visibleRegions_[i].x) + ", " +
550                 std::to_string(visibleRegions_[i].y) + ", " +
551                 std::to_string(visibleRegions_[i].w) + ", " +
552                 std::to_string(visibleRegions_[i].h) + "], ";
553         }
554         for (decltype(dirtyRegions_.size()) i = 0; i < dirtyRegions_.size(); i++) {
555             result += "dirtyRegions[" + std::to_string(i) + "] = [" +
556                 std::to_string(dirtyRegions_[i].x) + ", " +
557                 std::to_string(dirtyRegions_[i].y) + ", " +
558                 std::to_string(dirtyRegions_[i].w) + ", " +
559                 std::to_string(dirtyRegions_[i].h) + "], ";
560         }
561         result += "layerColor = [R:" + std::to_string(layerColor_.r) + ", G:" +
562             std::to_string(layerColor_.g) + ", B:" +
563             std::to_string(layerColor_.b) + ", A:" +
564             std::to_string(layerColor_.a) + "],";
565         if (cSurface_ != nullptr) {
566             cSurface_->Dump(result);
567         }
568         result += " displayNit = " + std::to_string(displayNit_) +
569             ", brightnessRatio = " + std::to_string(brightnessRatio_) + ", ";
570     }
571 
SetLayerMaskInfo(LayerMask mask)572     RosenError SetLayerMaskInfo(LayerMask mask)
573     {
574         switch (mask) {
575             case LayerMask::LAYER_MASK_NORMAL:
576             case LayerMask::LAYER_MASK_HBM_SYNC:
577                 break;
578             default:
579                 return ROSEN_ERROR_INVALID_ARGUMENTS;
580         }
581 
582         layerMask_ = mask;
583         return ROSEN_ERROR_OK;
584     }
585 
GetLayerMaskInfo()586     LayerMask GetLayerMaskInfo()
587     {
588         return layerMask_;
589     }
590 
GetNodeId()591     inline uint64_t GetNodeId()
592     {
593         return nodeId_;
594     }
595 
SetNodeId(uint64_t nodeId)596     void SetNodeId(uint64_t nodeId)
597     {
598         nodeId_ = nodeId;
599     }
600     /* hdiLayer get layer info end */
601 
602 private:
603     uint32_t zOrder_ = 0;
604     GraphicLayerType layerType_ = GraphicLayerType::GRAPHIC_LAYER_TYPE_GRAPHIC;
605     GraphicIRect layerRect_;
606     GraphicIRect boundRect_; // node's bound width and height related to this layer, used for uni render redraw
607     std::vector<GraphicIRect> visibleRegions_;
608     std::vector<GraphicIRect> dirtyRegions_;
609     GraphicIRect cropRect_;
610     GraphicMatrix matrix_; // matrix used for uni render redraw
611     int32_t gravity_; // used for uni render redraw
612     bool isUniRender_ = false; // true for uni render layer (DisplayNode)
613     GraphicLayerAlpha layerAlpha_;
614     GraphicTransformType transformType_ = GraphicTransformType::GRAPHIC_ROTATE_BUTT;
615     GraphicCompositionType compositionType_;
616     GraphicBlendType blendType_;
617     std::vector<float> colorTransformMatrix_;
618     GraphicLayerColor layerColor_;
619     GraphicLayerColor backgroundColor_;
620     GraphicColorDataSpace colorSpace_ = GraphicColorDataSpace::GRAPHIC_COLOR_DATA_SPACE_UNKNOWN;
621     std::vector<GraphicHDRMetaData> metaData_;
622     GraphicHDRMetaDataSet metaDataSet_;
623     sptr<SurfaceTunnelHandle> tunnelHandle_ = nullptr;
624     std::vector<std::string> windowsName_;
625     bool tunnelHandleChange_ = false;
626     bool IsSupportedPresentTimestamp_ = false;
627     GraphicPresentTimestamp presentTimestamp_ = {GRAPHIC_DISPLAY_PTS_UNSUPPORTED, 0};
628 
629     sptr<IConsumerSurface> cSurface_ = nullptr;
630     sptr<SyncFence> acquireFence_ = SyncFence::InvalidFence();
631     sptr<SurfaceBuffer> sbuffer_ = nullptr;
632     sptr<SurfaceBuffer> pbuffer_ = nullptr;
633     bool preMulti_ = false;
634     bool needBilinearInterpolation_ = false;
635     LayerMask layerMask_ = LayerMask::LAYER_MASK_NORMAL;
636     mutable std::mutex mutex_;
637     int32_t sdrNit_ = 500; // default sdr nit
638     int32_t displayNit_ = 500; // default luminance for sdr
639     float brightnessRatio_ = 1.0f; // default ratio for sdr
640     std::vector<float> layerLinearMatrix_
641         = {1.0f, 0.0f, 0.0f, 0.0f, 1.0f, 0.0f, 0.0f, 0.0f, 1.0f}; // matrix for linear colorspace
642     uint64_t nodeId_ = 0;
643     int32_t layerSource_ = 0; // default layer source tag
644     bool rotationFixed_ = false;
645     bool arsrTag_ = true;
646     std::vector<float> drmCornerRadiusInfo_;
647 };
648 } // namespace Rosen
649 } // namespace OHOS
650 
651 #endif // HDI_BACKEND_HDI_LAYER_INFO_H