John Reck | 94c40fe | 2014-10-08 09:28:43 -0700 | [diff] [blame] | 1 | /* |
| 2 | * Copyright (C) 2014 The Android Open Source Project |
| 3 | * |
| 4 | * Licensed under the Apache License, Version 2.0 (the "License"); |
| 5 | * you may not use this file except in compliance with the License. |
| 6 | * You may obtain a copy of the License at |
| 7 | * |
| 8 | * http://www.apache.org/licenses/LICENSE-2.0 |
| 9 | * |
| 10 | * Unless required by applicable law or agreed to in writing, software |
| 11 | * distributed under the License is distributed on an "AS IS" BASIS, |
| 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 13 | * See the License for the specific language governing permissions and |
| 14 | * limitations under the License. |
| 15 | */ |
| 16 | |
| 17 | #ifndef TESTCONTEXT_H |
| 18 | #define TESTCONTEXT_H |
| 19 | |
John Reck | 84e390c | 2015-01-05 09:42:52 -0800 | [diff] [blame] | 20 | #include <gui/DisplayEventReceiver.h> |
| 21 | #include <gui/ISurfaceComposer.h> |
| 22 | #include <gui/SurfaceComposerClient.h> |
John Reck | 94c40fe | 2014-10-08 09:28:43 -0700 | [diff] [blame] | 23 | #include <gui/SurfaceControl.h> |
John Reck | 84e390c | 2015-01-05 09:42:52 -0800 | [diff] [blame] | 24 | #include <gui/Surface.h> |
| 25 | #include <ui/DisplayInfo.h> |
| 26 | #include <utils/Looper.h> |
John Reck | 94c40fe | 2014-10-08 09:28:43 -0700 | [diff] [blame] | 27 | |
John Reck | 84e390c | 2015-01-05 09:42:52 -0800 | [diff] [blame] | 28 | namespace android { |
| 29 | namespace uirenderer { |
| 30 | namespace test { |
John Reck | 94c40fe | 2014-10-08 09:28:43 -0700 | [diff] [blame] | 31 | |
John Reck | 84e390c | 2015-01-05 09:42:52 -0800 | [diff] [blame] | 32 | extern DisplayInfo gDisplay; |
| 33 | #define dp(x) ((x) * android::uirenderer::test::gDisplay.density) |
John Reck | 94c40fe | 2014-10-08 09:28:43 -0700 | [diff] [blame] | 34 | |
John Reck | 84e390c | 2015-01-05 09:42:52 -0800 | [diff] [blame] | 35 | class TestContext { |
| 36 | public: |
| 37 | TestContext(); |
| 38 | ~TestContext(); |
| 39 | |
| 40 | sp<Surface> surface(); |
| 41 | |
| 42 | void waitForVsync(); |
| 43 | |
| 44 | private: |
| 45 | sp<SurfaceComposerClient> mSurfaceComposerClient; |
| 46 | sp<SurfaceControl> mSurfaceControl; |
| 47 | DisplayEventReceiver mDisplayEventReceiver; |
| 48 | sp<Looper> mLooper; |
| 49 | }; |
| 50 | |
| 51 | } // namespace test |
| 52 | } // namespace uirenderer |
| 53 | } // namespace android |
John Reck | 94c40fe | 2014-10-08 09:28:43 -0700 | [diff] [blame] | 54 | |
| 55 | #endif |