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 #ifndef RENDER_SERVICE_CLIENT_CORE_PIPELINE_RS_RENDER_RESULT_H
16 #define RENDER_SERVICE_CLIENT_CORE_PIPELINE_RS_RENDER_RESULT_H
17 
18 #include <functional>
19 
20 #include "common/rs_macros.h"
21 #include "common/rs_rect.h"
22 #include "pipeline/rs_draw_cmd_list.h"
23 
24 namespace OHOS {
25 namespace Rosen {
26 class RSRenderResult final {
27 public:
RSRenderResult(const RectI & r,std::shared_ptr<Drawing::DrawCmdList> dcl)28     RSRenderResult(const RectI& r, std::shared_ptr<Drawing::DrawCmdList> dcl) : dirty_(r), drawCmdList_(dcl) {}
29     ~RSRenderResult() = default;
30 
GetDirtyRegion()31     RectI GetDirtyRegion() const
32     {
33         return dirty_;
34     }
GetDrawCmdList()35     std::shared_ptr<Drawing::DrawCmdList> GetDrawCmdList() const
36     {
37         return drawCmdList_;
38     }
39 
40 private:
41     RectI dirty_;
42     std::shared_ptr<Drawing::DrawCmdList> drawCmdList_;
43 };
44 
45 using RenderFinishedCallback = std::function<void(const RSRenderResult&)>;
46 } // namespace Rosen
47 } // namespace OHOS
48 
49 #endif // RENDER_SERVICE_CLIENT_CORE_PIPELINE_RS_RENDER_RESULT_H