1 /* 2 * Copyright (c) 2022 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 SURFACE_FRAME_OHOS_H 17 #define SURFACE_FRAME_OHOS_H 18 19 #include <surface.h> 20 #include "surface_frame.h" 21 22 namespace OHOS { 23 namespace Rosen { 24 class SurfaceFrameOhos : public SurfaceFrame { 25 public: 26 SurfaceFrameOhos() = default; SurfaceFrameOhos(int32_t width,int32_t height)27 SurfaceFrameOhos(int32_t width, int32_t height) 28 : width_(width), height_(height), releaseFence_(-1) 29 { 30 } 31 32 ~SurfaceFrameOhos() = default; 33 GetReleaseFence()34 int32_t GetReleaseFence() const 35 { 36 return releaseFence_; 37 } 38 SetReleaseFence(const int32_t & fence)39 void SetReleaseFence(const int32_t& fence) 40 { 41 releaseFence_ = fence; 42 } 43 GetWidth()44 int32_t GetWidth() const 45 { 46 return width_; 47 } 48 GetHeight()49 int32_t GetHeight() const 50 { 51 return height_; 52 } 53 protected: 54 int32_t width_ = -1; 55 int32_t height_ = -1; 56 int32_t releaseFence_; 57 }; 58 } // namespace Rosen 59 } // namespace OHOS 60 #endif 61