diff options
author | John Reck <jreck@google.com> | 2015-01-05 09:42:52 -0800 |
---|---|---|
committer | John Reck <jreck@google.com> | 2015-01-06 13:50:43 -0800 |
commit | 84e390cc903ae4027276c33371ad5237b550910f (patch) | |
tree | a85b01241a00cebb21dcac66a461e71e499bb0ec /libs/hwui/tests/TestContext.h | |
parent | 2b2ad7ce9f008cc383394cc91389d667575ec45d (diff) | |
download | frameworks_base-84e390cc903ae4027276c33371ad5237b550910f.zip frameworks_base-84e390cc903ae4027276c33371ad5237b550910f.tar.gz frameworks_base-84e390cc903ae4027276c33371ad5237b550910f.tar.bz2 |
Replace sleep() hack with vsync listening
Change-Id: I4eb744d9a5abe40cf4f8bbaafa03e59b7360608a
Diffstat (limited to 'libs/hwui/tests/TestContext.h')
-rw-r--r-- | libs/hwui/tests/TestContext.h | 38 |
1 files changed, 30 insertions, 8 deletions
diff --git a/libs/hwui/tests/TestContext.h b/libs/hwui/tests/TestContext.h index 8a5d530..7b30fc1 100644 --- a/libs/hwui/tests/TestContext.h +++ b/libs/hwui/tests/TestContext.h @@ -17,17 +17,39 @@ #ifndef TESTCONTEXT_H #define TESTCONTEXT_H -#include <ui/DisplayInfo.h> +#include <gui/DisplayEventReceiver.h> +#include <gui/ISurfaceComposer.h> +#include <gui/SurfaceComposerClient.h> #include <gui/SurfaceControl.h> +#include <gui/Surface.h> +#include <ui/DisplayInfo.h> +#include <utils/Looper.h> + +namespace android { +namespace uirenderer { +namespace test { + +extern DisplayInfo gDisplay; +#define dp(x) ((x) * android::uirenderer::test::gDisplay.density) + +class TestContext { +public: + TestContext(); + ~TestContext(); + + sp<Surface> surface(); -extern android::DisplayInfo gDisplay; -#define dp(x) ((x) * gDisplay.density) + void waitForVsync(); -// Initializes all the static globals that are shared across all contexts -// such as display info -void createTestEnvironment(); +private: + sp<SurfaceComposerClient> mSurfaceComposerClient; + sp<SurfaceControl> mSurfaceControl; + DisplayEventReceiver mDisplayEventReceiver; + sp<Looper> mLooper; +}; -// Defaults to fullscreen -android::sp<android::SurfaceControl> createWindow(int width = -1, int height = -1); +} // namespace test +} // namespace uirenderer +} // namespace android #endif |