1 /*
2 * Copyright (c) 2021-2023 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 <functional>
17
18 #include "rs_interfaces.h"
19 #include "rs_trace.h"
20
21 #include "platform/common/rs_system_properties.h"
22 #include "pipeline/rs_divided_ui_capture.h"
23 #include "offscreen_render/rs_offscreen_render_thread.h"
24 #include "ui/rs_frame_rate_policy.h"
25 #include "ui/rs_proxy_node.h"
26 #include "platform/common/rs_log.h"
27
28 namespace OHOS {
29 namespace Rosen {
GetInstance()30 RSInterfaces &RSInterfaces::GetInstance()
31 {
32 static RSInterfaces instance;
33 return instance;
34 }
35
RSInterfaces()36 RSInterfaces::RSInterfaces() : renderServiceClient_(std::make_unique<RSRenderServiceClient>())
37 {
38 }
39
~RSInterfaces()40 RSInterfaces::~RSInterfaces() noexcept
41 {
42 }
43
SetFocusAppInfo(FocusAppInfo & info)44 int32_t RSInterfaces::SetFocusAppInfo(FocusAppInfo& info)
45 {
46 int32_t pid = info.pid;
47 int32_t uid = info.uid;
48 const std::string bundleName = info.bundleName;
49 const std::string abilityName = info.abilityName;
50 uint64_t focusNodeId = info.focusNodeId;
51 return renderServiceClient_->SetFocusAppInfo(pid, uid, bundleName, abilityName, focusNodeId);
52 }
53
GetDefaultScreenId()54 ScreenId RSInterfaces::GetDefaultScreenId()
55 {
56 return renderServiceClient_->GetDefaultScreenId();
57 }
58
GetActiveScreenId()59 ScreenId RSInterfaces::GetActiveScreenId()
60 {
61 return renderServiceClient_->GetActiveScreenId();
62 }
63
GetAllScreenIds()64 std::vector<ScreenId> RSInterfaces::GetAllScreenIds()
65 {
66 return renderServiceClient_->GetAllScreenIds();
67 }
68
69 #ifndef ROSEN_CROSS_PLATFORM
CreateVirtualScreen(const std::string & name,uint32_t width,uint32_t height,sptr<Surface> surface,ScreenId mirrorId,int flags,std::vector<NodeId> filteredAppVector)70 ScreenId RSInterfaces::CreateVirtualScreen(
71 const std::string &name,
72 uint32_t width,
73 uint32_t height,
74 sptr<Surface> surface,
75 ScreenId mirrorId,
76 int flags,
77 std::vector<NodeId> filteredAppVector)
78 {
79 return renderServiceClient_->CreateVirtualScreen(name, width, height, surface, mirrorId, flags, filteredAppVector);
80 }
81
SetVirtualScreenSurface(ScreenId id,sptr<Surface> surface)82 int32_t RSInterfaces::SetVirtualScreenSurface(ScreenId id, sptr<Surface> surface)
83 {
84 return renderServiceClient_->SetVirtualScreenSurface(id, surface);
85 }
86 #endif
87
RemoveVirtualScreen(ScreenId id)88 void RSInterfaces::RemoveVirtualScreen(ScreenId id)
89 {
90 renderServiceClient_->RemoveVirtualScreen(id);
91 }
92
SetScreenChangeCallback(const ScreenChangeCallback & callback)93 int32_t RSInterfaces::SetScreenChangeCallback(const ScreenChangeCallback &callback)
94 {
95 return renderServiceClient_->SetScreenChangeCallback(callback);
96 }
97
TakeSurfaceCapture(std::shared_ptr<RSSurfaceNode> node,std::shared_ptr<SurfaceCaptureCallback> callback,float scaleX,float scaleY)98 bool RSInterfaces::TakeSurfaceCapture(std::shared_ptr<RSSurfaceNode> node,
99 std::shared_ptr<SurfaceCaptureCallback> callback, float scaleX, float scaleY)
100 {
101 if (!node) {
102 ROSEN_LOGW("node is nullptr");
103 return false;
104 }
105 return renderServiceClient_->TakeSurfaceCapture(node->GetId(), callback, scaleX, scaleY);
106 }
107
TakeSurfaceCapture(std::shared_ptr<RSDisplayNode> node,std::shared_ptr<SurfaceCaptureCallback> callback,float scaleX,float scaleY)108 bool RSInterfaces::TakeSurfaceCapture(std::shared_ptr<RSDisplayNode> node,
109 std::shared_ptr<SurfaceCaptureCallback> callback, float scaleX, float scaleY)
110 {
111 if (!node) {
112 ROSEN_LOGW("node is nullptr");
113 return false;
114 }
115 return renderServiceClient_->TakeSurfaceCapture(node->GetId(), callback, scaleX, scaleY);
116 }
117
TakeSurfaceCapture(NodeId id,std::shared_ptr<SurfaceCaptureCallback> callback,float scaleX,float scaleY)118 bool RSInterfaces::TakeSurfaceCapture(NodeId id,
119 std::shared_ptr<SurfaceCaptureCallback> callback, float scaleX, float scaleY)
120 {
121 return renderServiceClient_->TakeSurfaceCapture(id, callback, scaleX, scaleY);
122 }
123
124 #ifndef ROSEN_ARKUI_X
SetScreenActiveMode(ScreenId id,uint32_t modeId)125 void RSInterfaces::SetScreenActiveMode(ScreenId id, uint32_t modeId)
126 {
127 renderServiceClient_->SetScreenActiveMode(id, modeId);
128 }
129 #endif // !ROSEN_ARKUI_X
SetScreenRefreshRate(ScreenId id,int32_t sceneId,int32_t rate)130 void RSInterfaces::SetScreenRefreshRate(ScreenId id, int32_t sceneId, int32_t rate)
131 {
132 renderServiceClient_->SetScreenRefreshRate(id, sceneId, rate);
133 }
134
SetRefreshRateMode(int32_t refreshRateMode)135 void RSInterfaces::SetRefreshRateMode(int32_t refreshRateMode)
136 {
137 renderServiceClient_->SetRefreshRateMode(refreshRateMode);
138 }
139
SyncFrameRateRange(const FrameRateRange & range)140 void RSInterfaces::SyncFrameRateRange(const FrameRateRange& range)
141 {
142 renderServiceClient_->SyncFrameRateRange(range);
143 }
144
GetScreenCurrentRefreshRate(ScreenId id)145 uint32_t RSInterfaces::GetScreenCurrentRefreshRate(ScreenId id)
146 {
147 return renderServiceClient_->GetScreenCurrentRefreshRate(id);
148 }
149
GetCurrentRefreshRateMode()150 int32_t RSInterfaces::GetCurrentRefreshRateMode()
151 {
152 return renderServiceClient_->GetCurrentRefreshRateMode();
153 }
154
GetScreenSupportedRefreshRates(ScreenId id)155 std::vector<int32_t> RSInterfaces::GetScreenSupportedRefreshRates(ScreenId id)
156 {
157 return renderServiceClient_->GetScreenSupportedRefreshRates(id);
158 }
159
GetShowRefreshRateEnabled()160 bool RSInterfaces::GetShowRefreshRateEnabled()
161 {
162 return renderServiceClient_->GetShowRefreshRateEnabled();
163 }
164
SetShowRefreshRateEnabled(bool enable)165 void RSInterfaces::SetShowRefreshRateEnabled(bool enable)
166 {
167 return renderServiceClient_->SetShowRefreshRateEnabled(enable);
168 }
169
TakeSurfaceCaptureForUI(std::shared_ptr<RSNode> node,std::shared_ptr<SurfaceCaptureCallback> callback,float scaleX,float scaleY)170 bool RSInterfaces::TakeSurfaceCaptureForUI(
171 std::shared_ptr<RSNode> node, std::shared_ptr<SurfaceCaptureCallback> callback, float scaleX, float scaleY)
172 {
173 if (!node) {
174 ROSEN_LOGW("RSInterfaces::TakeSurfaceCaptureForUI rsnode is nullpter return");
175 return false;
176 }
177 if (!((node->GetType() == RSUINodeType::ROOT_NODE) ||
178 (node->GetType() == RSUINodeType::CANVAS_NODE) ||
179 (node->GetType() == RSUINodeType::CANVAS_DRAWING_NODE) ||
180 (node->GetType() == RSUINodeType::SURFACE_NODE))) {
181 ROSEN_LOGE("RSInterfaces::TakeSurfaceCaptureForUI unsupported node type return");
182 return false;
183 }
184 if (RSSystemProperties::GetUniRenderEnabled()) {
185 return renderServiceClient_->TakeSurfaceCapture(node->GetId(), callback, scaleX, scaleY,
186 SurfaceCaptureType::UICAPTURE);
187 } else {
188 return TakeSurfaceCaptureForUIWithoutUni(node->GetId(), callback, scaleX, scaleY);
189 }
190 }
191
192 #ifndef ROSEN_ARKUI_X
SetVirtualScreenResolution(ScreenId id,uint32_t width,uint32_t height)193 int32_t RSInterfaces::SetVirtualScreenResolution(ScreenId id, uint32_t width, uint32_t height)
194 {
195 return renderServiceClient_->SetVirtualScreenResolution(id, width, height);
196 }
197 #endif // !ROSEN_ARKUI_X
SetVirtualMirrorScreenCanvasRotation(ScreenId id,bool canvasRotation)198 bool RSInterfaces::SetVirtualMirrorScreenCanvasRotation(ScreenId id, bool canvasRotation)
199 {
200 return renderServiceClient_->SetVirtualMirrorScreenCanvasRotation(id, canvasRotation);
201 }
202
203 #ifndef ROSEN_ARKUI_X
GetVirtualScreenResolution(ScreenId id)204 RSVirtualScreenResolution RSInterfaces::GetVirtualScreenResolution(ScreenId id)
205 {
206 return renderServiceClient_->GetVirtualScreenResolution(id);
207 }
208
SetScreenPowerStatus(ScreenId id,ScreenPowerStatus status)209 void RSInterfaces::SetScreenPowerStatus(ScreenId id, ScreenPowerStatus status)
210 {
211 RS_LOGI("RSInterfaces::SetScreenPowerStatus: ScreenId: %{public}" PRIu64 ", ScreenPowerStatus: %{public}u", id,
212 static_cast<uint32_t>(status));
213 renderServiceClient_->SetScreenPowerStatus(id, status);
214 }
215 #endif // !ROSEN_ARKUI_X
TakeSurfaceCaptureForUIWithoutUni(NodeId id,std::shared_ptr<SurfaceCaptureCallback> callback,float scaleX,float scaleY)216 bool RSInterfaces::TakeSurfaceCaptureForUIWithoutUni(NodeId id,
217 std::shared_ptr<SurfaceCaptureCallback> callback, float scaleX, float scaleY)
218 {
219 std::function<void()> offscreenRenderTask = [scaleX, scaleY, callback, id, this]() -> void {
220 ROSEN_LOGD(
221 "RSInterfaces::TakeSurfaceCaptureForUIWithoutUni callback->OnOffscreenRender nodeId:"
222 "[%{public}" PRIu64 "]", id);
223 ROSEN_TRACE_BEGIN(HITRACE_TAG_GRAPHIC_AGP, "RSRenderThread::TakeSurfaceCaptureForUIWithoutUni");
224 std::shared_ptr<RSDividedUICapture> rsDividedUICapture =
225 std::make_shared<RSDividedUICapture>(id, scaleX, scaleY);
226 std::shared_ptr<Media::PixelMap> pixelmap = rsDividedUICapture->TakeLocalCapture();
227 ROSEN_TRACE_END(HITRACE_TAG_GRAPHIC_AGP);
228 callback->OnSurfaceCapture(pixelmap);
229 };
230 RSOffscreenRenderThread::Instance().PostTask(offscreenRenderTask);
231 return true;
232 }
233
234 #ifndef ROSEN_ARKUI_X
GetScreenActiveMode(ScreenId id)235 RSScreenModeInfo RSInterfaces::GetScreenActiveMode(ScreenId id)
236 {
237 return renderServiceClient_->GetScreenActiveMode(id);
238 }
239
GetScreenSupportedModes(ScreenId id)240 std::vector<RSScreenModeInfo> RSInterfaces::GetScreenSupportedModes(ScreenId id)
241 {
242 return renderServiceClient_->GetScreenSupportedModes(id);
243 }
244
GetScreenCapability(ScreenId id)245 RSScreenCapability RSInterfaces::GetScreenCapability(ScreenId id)
246 {
247 return renderServiceClient_->GetScreenCapability(id);
248 }
249
GetScreenPowerStatus(ScreenId id)250 ScreenPowerStatus RSInterfaces::GetScreenPowerStatus(ScreenId id)
251 {
252 return renderServiceClient_->GetScreenPowerStatus(id);
253 }
254
GetScreenData(ScreenId id)255 RSScreenData RSInterfaces::GetScreenData(ScreenId id)
256 {
257 return renderServiceClient_->GetScreenData(id);
258 }
259 #endif // !ROSEN_ARKUI_X
GetScreenBacklight(ScreenId id)260 int32_t RSInterfaces::GetScreenBacklight(ScreenId id)
261 {
262 return renderServiceClient_->GetScreenBacklight(id);
263 }
264
SetScreenBacklight(ScreenId id,uint32_t level)265 void RSInterfaces::SetScreenBacklight(ScreenId id, uint32_t level)
266 {
267 RS_LOGD("RSInterfaces::SetScreenBacklight: ScreenId: %{public}" PRIu64 ", level: %{public}u", id, level);
268 renderServiceClient_->SetScreenBacklight(id, level);
269 }
270
GetScreenSupportedColorGamuts(ScreenId id,std::vector<ScreenColorGamut> & mode)271 int32_t RSInterfaces::GetScreenSupportedColorGamuts(ScreenId id, std::vector<ScreenColorGamut>& mode)
272 {
273 return renderServiceClient_->GetScreenSupportedColorGamuts(id, mode);
274 }
275
GetScreenSupportedMetaDataKeys(ScreenId id,std::vector<ScreenHDRMetadataKey> & keys)276 int32_t RSInterfaces::GetScreenSupportedMetaDataKeys(ScreenId id, std::vector<ScreenHDRMetadataKey>& keys)
277 {
278 return renderServiceClient_->GetScreenSupportedMetaDataKeys(id, keys);
279 }
280
GetScreenColorGamut(ScreenId id,ScreenColorGamut & mode)281 int32_t RSInterfaces::GetScreenColorGamut(ScreenId id, ScreenColorGamut& mode)
282 {
283 return renderServiceClient_->GetScreenColorGamut(id, mode);
284 }
285
SetScreenColorGamut(ScreenId id,int32_t modeIdx)286 int32_t RSInterfaces::SetScreenColorGamut(ScreenId id, int32_t modeIdx)
287 {
288 return renderServiceClient_->SetScreenColorGamut(id, modeIdx);
289 }
290
SetScreenGamutMap(ScreenId id,ScreenGamutMap mode)291 int32_t RSInterfaces::SetScreenGamutMap(ScreenId id, ScreenGamutMap mode)
292 {
293 return renderServiceClient_->SetScreenGamutMap(id, mode);
294 }
295
SetScreenCorrection(ScreenId id,ScreenRotation screenRotation)296 int32_t RSInterfaces::SetScreenCorrection(ScreenId id, ScreenRotation screenRotation)
297 {
298 return renderServiceClient_->SetScreenCorrection(id, screenRotation);
299 }
300
GetScreenGamutMap(ScreenId id,ScreenGamutMap & mode)301 int32_t RSInterfaces::GetScreenGamutMap(ScreenId id, ScreenGamutMap& mode)
302 {
303 return renderServiceClient_->GetScreenGamutMap(id, mode);
304 }
305
CreateVSyncReceiver(const std::string & name,const std::shared_ptr<OHOS::AppExecFwk::EventHandler> & looper)306 std::shared_ptr<VSyncReceiver> RSInterfaces::CreateVSyncReceiver(
307 const std::string& name,
308 const std::shared_ptr<OHOS::AppExecFwk::EventHandler> &looper)
309 {
310 return renderServiceClient_->CreateVSyncReceiver(name, looper);
311 }
312
CreateVSyncReceiver(const std::string & name,uint64_t id,const std::shared_ptr<OHOS::AppExecFwk::EventHandler> & looper)313 std::shared_ptr<VSyncReceiver> RSInterfaces::CreateVSyncReceiver(
314 const std::string& name,
315 uint64_t id,
316 const std::shared_ptr<OHOS::AppExecFwk::EventHandler> &looper)
317 {
318 return renderServiceClient_->CreateVSyncReceiver(name, looper, id);
319 }
320
GetScreenHDRCapability(ScreenId id,RSScreenHDRCapability & screenHdrCapability)321 int32_t RSInterfaces::GetScreenHDRCapability(ScreenId id, RSScreenHDRCapability& screenHdrCapability)
322 {
323 return renderServiceClient_->GetScreenHDRCapability(id, screenHdrCapability);
324 }
325
GetPixelFormat(ScreenId id,GraphicPixelFormat & pixelFormat)326 int32_t RSInterfaces::GetPixelFormat(ScreenId id, GraphicPixelFormat& pixelFormat)
327 {
328 return renderServiceClient_->GetPixelFormat(id, pixelFormat);
329 }
330
SetPixelFormat(ScreenId id,GraphicPixelFormat pixelFormat)331 int32_t RSInterfaces::SetPixelFormat(ScreenId id, GraphicPixelFormat pixelFormat)
332 {
333 return renderServiceClient_->SetPixelFormat(id, pixelFormat);
334 }
335
GetScreenSupportedHDRFormats(ScreenId id,std::vector<ScreenHDRFormat> & hdrFormats)336 int32_t RSInterfaces::GetScreenSupportedHDRFormats(ScreenId id, std::vector<ScreenHDRFormat>& hdrFormats)
337 {
338 return renderServiceClient_->GetScreenSupportedHDRFormats(id, hdrFormats);
339 }
340
GetScreenHDRFormat(ScreenId id,ScreenHDRFormat & hdrFormat)341 int32_t RSInterfaces::GetScreenHDRFormat(ScreenId id, ScreenHDRFormat& hdrFormat)
342 {
343 return renderServiceClient_->GetScreenHDRFormat(id, hdrFormat);
344 }
345
SetScreenHDRFormat(ScreenId id,int32_t modeIdx)346 int32_t RSInterfaces::SetScreenHDRFormat(ScreenId id, int32_t modeIdx)
347 {
348 return renderServiceClient_->SetScreenHDRFormat(id, modeIdx);
349 }
350
GetScreenSupportedColorSpaces(ScreenId id,std::vector<GraphicCM_ColorSpaceType> & colorSpaces)351 int32_t RSInterfaces::GetScreenSupportedColorSpaces(ScreenId id, std::vector<GraphicCM_ColorSpaceType>& colorSpaces)
352 {
353 return renderServiceClient_->GetScreenSupportedColorSpaces(id, colorSpaces);
354 }
355
GetScreenColorSpace(ScreenId id,GraphicCM_ColorSpaceType & colorSpace)356 int32_t RSInterfaces::GetScreenColorSpace(ScreenId id, GraphicCM_ColorSpaceType& colorSpace)
357 {
358 return renderServiceClient_->GetScreenColorSpace(id, colorSpace);
359 }
360
SetScreenColorSpace(ScreenId id,GraphicCM_ColorSpaceType colorSpace)361 int32_t RSInterfaces::SetScreenColorSpace(ScreenId id, GraphicCM_ColorSpaceType colorSpace)
362 {
363 return renderServiceClient_->SetScreenColorSpace(id, colorSpace);
364 }
365
GetScreenType(ScreenId id,RSScreenType & screenType)366 int32_t RSInterfaces::GetScreenType(ScreenId id, RSScreenType& screenType)
367 {
368 return renderServiceClient_->GetScreenType(id, screenType);
369 }
370
SetScreenSkipFrameInterval(ScreenId id,uint32_t skipFrameInterval)371 int32_t RSInterfaces::SetScreenSkipFrameInterval(ScreenId id, uint32_t skipFrameInterval)
372 {
373 return renderServiceClient_->SetScreenSkipFrameInterval(id, skipFrameInterval);
374 }
375
SetSystemAnimatedScenes(SystemAnimatedScenes systemAnimatedScenes)376 bool RSInterfaces::SetSystemAnimatedScenes(SystemAnimatedScenes systemAnimatedScenes)
377 {
378 return renderServiceClient_->SetSystemAnimatedScenes(systemAnimatedScenes);
379 }
380
RegisterOcclusionChangeCallback(const OcclusionChangeCallback & callback)381 int32_t RSInterfaces::RegisterOcclusionChangeCallback(const OcclusionChangeCallback& callback)
382 {
383 return renderServiceClient_->RegisterOcclusionChangeCallback(callback);
384 }
385
RegisterSurfaceOcclusionChangeCallback(NodeId id,const SurfaceOcclusionChangeCallback & callback,std::vector<float> & partitionPoints)386 int32_t RSInterfaces::RegisterSurfaceOcclusionChangeCallback(
387 NodeId id, const SurfaceOcclusionChangeCallback& callback, std::vector<float>& partitionPoints)
388 {
389 return renderServiceClient_->RegisterSurfaceOcclusionChangeCallback(id, callback, partitionPoints);
390 }
391
UnRegisterSurfaceOcclusionChangeCallback(NodeId id)392 int32_t RSInterfaces::UnRegisterSurfaceOcclusionChangeCallback(NodeId id)
393 {
394 return renderServiceClient_->UnRegisterSurfaceOcclusionChangeCallback(id);
395 }
396
RegisterHgmConfigChangeCallback(const HgmConfigChangeCallback & callback)397 int32_t RSInterfaces::RegisterHgmConfigChangeCallback(const HgmConfigChangeCallback& callback)
398 {
399 return renderServiceClient_->RegisterHgmConfigChangeCallback(callback);
400 }
401
RegisterHgmRefreshRateModeChangeCallback(const HgmRefreshRateModeChangeCallback & callback)402 int32_t RSInterfaces::RegisterHgmRefreshRateModeChangeCallback(const HgmRefreshRateModeChangeCallback& callback)
403 {
404 return renderServiceClient_->RegisterHgmRefreshRateModeChangeCallback(callback);
405 }
406
SetAppWindowNum(uint32_t num)407 void RSInterfaces::SetAppWindowNum(uint32_t num)
408 {
409 renderServiceClient_->SetAppWindowNum(num);
410 }
411
ShowWatermark(const std::shared_ptr<Media::PixelMap> & watermarkImg,bool isShow)412 void RSInterfaces::ShowWatermark(const std::shared_ptr<Media::PixelMap> &watermarkImg, bool isShow)
413 {
414 renderServiceClient_->ShowWatermark(watermarkImg, isShow);
415 }
416
ResizeVirtualScreen(ScreenId id,uint32_t width,uint32_t height)417 int32_t RSInterfaces::ResizeVirtualScreen(ScreenId id, uint32_t width, uint32_t height)
418 {
419 return renderServiceClient_->ResizeVirtualScreen(id, width, height);
420 }
421
422 #ifndef ROSEN_ARKUI_X
GetMemoryGraphic(int pid)423 MemoryGraphic RSInterfaces::GetMemoryGraphic(int pid)
424 {
425 return renderServiceClient_->GetMemoryGraphic(pid);
426 }
427
GetMemoryGraphics()428 std::vector<MemoryGraphic> RSInterfaces::GetMemoryGraphics()
429 {
430 return renderServiceClient_->GetMemoryGraphics();
431 }
432 #endif // !ROSEN_ARKUI_X
GetTotalAppMemSize(float & cpuMemSize,float & gpuMemSize)433 bool RSInterfaces::GetTotalAppMemSize(float& cpuMemSize, float& gpuMemSize)
434 {
435 return renderServiceClient_->GetTotalAppMemSize(cpuMemSize, gpuMemSize);
436 }
437
ReportJankStats()438 void RSInterfaces::ReportJankStats()
439 {
440 renderServiceClient_->ReportJankStats();
441 }
442
ReportEventResponse(DataBaseRs info)443 void RSInterfaces::ReportEventResponse(DataBaseRs info)
444 {
445 renderServiceClient_->ReportEventResponse(info);
446 }
447
ReportEventComplete(DataBaseRs info)448 void RSInterfaces::ReportEventComplete(DataBaseRs info)
449 {
450 renderServiceClient_->ReportEventComplete(info);
451 }
452
ReportEventJankFrame(DataBaseRs info)453 void RSInterfaces::ReportEventJankFrame(DataBaseRs info)
454 {
455 renderServiceClient_->ReportEventJankFrame(info);
456 }
457
ReportGameStateData(GameStateData info)458 void RSInterfaces::ReportGameStateData(GameStateData info)
459 {
460 renderServiceClient_->ReportGameStateData(info);
461 }
462
EnableCacheForRotation()463 void RSInterfaces::EnableCacheForRotation()
464 {
465 renderServiceClient_->SetCacheEnabledForRotation(true);
466 }
467
NotifyLightFactorStatus(bool isSafe)468 void RSInterfaces::NotifyLightFactorStatus(bool isSafe)
469 {
470 renderServiceClient_->NotifyLightFactorStatus(isSafe);
471 }
472
NotifyPackageEvent(uint32_t listSize,const std::vector<std::string> & packageList)473 void RSInterfaces::NotifyPackageEvent(uint32_t listSize, const std::vector<std::string>& packageList)
474 {
475 renderServiceClient_->NotifyPackageEvent(listSize, packageList);
476 }
477
NotifyRefreshRateEvent(const EventInfo & eventInfo)478 void RSInterfaces::NotifyRefreshRateEvent(const EventInfo& eventInfo)
479 {
480 renderServiceClient_->NotifyRefreshRateEvent(eventInfo);
481 }
482
NotifyTouchEvent(int32_t touchStatus)483 void RSInterfaces::NotifyTouchEvent(int32_t touchStatus)
484 {
485 renderServiceClient_->NotifyTouchEvent(touchStatus);
486 }
487
DisableCacheForRotation()488 void RSInterfaces::DisableCacheForRotation()
489 {
490 renderServiceClient_->SetCacheEnabledForRotation(false);
491 }
492
SetOnRemoteDiedCallback(const OnRemoteDiedCallback & callback)493 void RSInterfaces::SetOnRemoteDiedCallback(const OnRemoteDiedCallback& callback)
494 {
495 renderServiceClient_->SetOnRemoteDiedCallback(callback);
496 }
497
498 #ifdef TP_FEATURE_ENABLE
SetTpFeatureConfig(int32_t feature,const char * config)499 void RSInterfaces::SetTpFeatureConfig(int32_t feature, const char* config)
500 {
501 renderServiceClient_->SetTpFeatureConfig(feature, config);
502 }
503 #endif
504
SetVirtualScreenUsingStatus(bool isVirtualScreenUsingStatus)505 void RSInterfaces::SetVirtualScreenUsingStatus(bool isVirtualScreenUsingStatus)
506 {
507 renderServiceClient_->SetVirtualScreenUsingStatus(isVirtualScreenUsingStatus);
508 }
509 } // namespace Rosen
510 } // namespace OHOS
511