194c40fe92117f301c7758de2861ab0c1d6cfded0John Reck/* 294c40fe92117f301c7758de2861ab0c1d6cfded0John Reck * Copyright (C) 2014 The Android Open Source Project 394c40fe92117f301c7758de2861ab0c1d6cfded0John Reck * 494c40fe92117f301c7758de2861ab0c1d6cfded0John Reck * Licensed under the Apache License, Version 2.0 (the "License"); 594c40fe92117f301c7758de2861ab0c1d6cfded0John Reck * you may not use this file except in compliance with the License. 694c40fe92117f301c7758de2861ab0c1d6cfded0John Reck * You may obtain a copy of the License at 794c40fe92117f301c7758de2861ab0c1d6cfded0John Reck * 894c40fe92117f301c7758de2861ab0c1d6cfded0John Reck * http://www.apache.org/licenses/LICENSE-2.0 994c40fe92117f301c7758de2861ab0c1d6cfded0John Reck * 1094c40fe92117f301c7758de2861ab0c1d6cfded0John Reck * Unless required by applicable law or agreed to in writing, software 1194c40fe92117f301c7758de2861ab0c1d6cfded0John Reck * distributed under the License is distributed on an "AS IS" BASIS, 1294c40fe92117f301c7758de2861ab0c1d6cfded0John Reck * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 1394c40fe92117f301c7758de2861ab0c1d6cfded0John Reck * See the License for the specific language governing permissions and 1494c40fe92117f301c7758de2861ab0c1d6cfded0John Reck * limitations under the License. 1594c40fe92117f301c7758de2861ab0c1d6cfded0John Reck */ 1694c40fe92117f301c7758de2861ab0c1d6cfded0John Reck 1794c40fe92117f301c7758de2861ab0c1d6cfded0John Reck#ifndef TESTCONTEXT_H 1894c40fe92117f301c7758de2861ab0c1d6cfded0John Reck#define TESTCONTEXT_H 1994c40fe92117f301c7758de2861ab0c1d6cfded0John Reck 2084e390cc903ae4027276c33371ad5237b550910fJohn Reck#include <gui/DisplayEventReceiver.h> 2184e390cc903ae4027276c33371ad5237b550910fJohn Reck#include <gui/ISurfaceComposer.h> 2284e390cc903ae4027276c33371ad5237b550910fJohn Reck#include <gui/SurfaceComposerClient.h> 2394c40fe92117f301c7758de2861ab0c1d6cfded0John Reck#include <gui/SurfaceControl.h> 2484e390cc903ae4027276c33371ad5237b550910fJohn Reck#include <gui/Surface.h> 2584e390cc903ae4027276c33371ad5237b550910fJohn Reck#include <ui/DisplayInfo.h> 2684e390cc903ae4027276c33371ad5237b550910fJohn Reck#include <utils/Looper.h> 2784e390cc903ae4027276c33371ad5237b550910fJohn Reck 2884e390cc903ae4027276c33371ad5237b550910fJohn Recknamespace android { 2984e390cc903ae4027276c33371ad5237b550910fJohn Recknamespace uirenderer { 3084e390cc903ae4027276c33371ad5237b550910fJohn Recknamespace test { 3184e390cc903ae4027276c33371ad5237b550910fJohn Reck 3284e390cc903ae4027276c33371ad5237b550910fJohn Reckextern DisplayInfo gDisplay; 3384e390cc903ae4027276c33371ad5237b550910fJohn Reck#define dp(x) ((x) * android::uirenderer::test::gDisplay.density) 3484e390cc903ae4027276c33371ad5237b550910fJohn Reck 35e702c9cd6a2b9b1378f740a79b0e349a9b02660fJohn ReckDisplayInfo getBuiltInDisplay(); 36e702c9cd6a2b9b1378f740a79b0e349a9b02660fJohn Reck 3784e390cc903ae4027276c33371ad5237b550910fJohn Reckclass TestContext { 3884e390cc903ae4027276c33371ad5237b550910fJohn Reckpublic: 3984e390cc903ae4027276c33371ad5237b550910fJohn Reck TestContext(); 4084e390cc903ae4027276c33371ad5237b550910fJohn Reck ~TestContext(); 4184e390cc903ae4027276c33371ad5237b550910fJohn Reck 4284e390cc903ae4027276c33371ad5237b550910fJohn Reck sp<Surface> surface(); 4394c40fe92117f301c7758de2861ab0c1d6cfded0John Reck 4484e390cc903ae4027276c33371ad5237b550910fJohn Reck void waitForVsync(); 4594c40fe92117f301c7758de2861ab0c1d6cfded0John Reck 4684e390cc903ae4027276c33371ad5237b550910fJohn Reckprivate: 4784e390cc903ae4027276c33371ad5237b550910fJohn Reck sp<SurfaceComposerClient> mSurfaceComposerClient; 4884e390cc903ae4027276c33371ad5237b550910fJohn Reck sp<SurfaceControl> mSurfaceControl; 4984e390cc903ae4027276c33371ad5237b550910fJohn Reck DisplayEventReceiver mDisplayEventReceiver; 5084e390cc903ae4027276c33371ad5237b550910fJohn Reck sp<Looper> mLooper; 5184e390cc903ae4027276c33371ad5237b550910fJohn Reck}; 5294c40fe92117f301c7758de2861ab0c1d6cfded0John Reck 5384e390cc903ae4027276c33371ad5237b550910fJohn Reck} // namespace test 5484e390cc903ae4027276c33371ad5237b550910fJohn Reck} // namespace uirenderer 5584e390cc903ae4027276c33371ad5237b550910fJohn Reck} // namespace android 5694c40fe92117f301c7758de2861ab0c1d6cfded0John Reck 5794c40fe92117f301c7758de2861ab0c1d6cfded0John Reck#endif 58