• 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 FRAMEWORKS_FENCE_TEST_UNITTEST_FD_TEST_H
17 #define FRAMEWORKS_FENCE_TEST_UNITTEST_FD_TEST_H
18 
19 #include <iostream>
20 
21 #include <gtest/gtest.h>
22 
23 #include <surface.h>
24 #include "fence.h"
25 
26 namespace OHOS {
27 class FenceFdTest : public testing::Test, public IBufferConsumerListenerClazz {
28 public:
29     static void SetUpTestCase();
30     static void TearDownTestCase();
31 
32     virtual void OnBufferAvailable() override;
33 
34     static inline BufferRequestConfig requestConfig = {
35         .width = 0x100,
36         .height = 0x100,
37         .strideAlignment = 0x8,
38         .format = GRAPHIC_PIXEL_FMT_RGBA_8888,
39         .usage = BUFFER_USAGE_CPU_READ | BUFFER_USAGE_CPU_WRITE | BUFFER_USAGE_MEM_DMA,
40         .timeout = 0,
41     };
42     static inline BufferFlushConfig flushConfig = {
43         .damage = { .w = 0x100, .h = 0x100, },
44     };
45     static inline int64_t timestamp = 0;
46     static inline Rect damage = {};
47     static inline sptr<Surface> csurf = nullptr;
48     static inline sptr<IBufferProducer> producer = nullptr;
49     static inline sptr<Surface> psurf = nullptr;
50 };
51 } // namespace OHOS
52 
53 #endif // FRAMEWORKS_FENCE_TEST_UNITTEST_FD_TEST_H
54