/* * Copyright (C) 2016 Simon Fels * * This program is free software: you can redistribute it and/or modify it * under the terms of the GNU General Public License version 3, as published * by the Free Software Foundation. * * This program is distributed in the hope that it will be useful, but * WITHOUT ANY WARRANTY; without even the implied warranties of * MERCHANTABILITY, SATISFACTORY QUALITY, or FITNESS FOR A PARTICULAR * PURPOSE. See the GNU General Public License for more details. * * You should have received a copy of the GNU General Public License along * with this program. If not, see . * */ #ifndef ANBOX_ANDROID_SURFACE_COMPOSER_H_ #define ANBOX_ANDROID_SURFACE_COMPOSER_H_ #include #include #include #include #include using namespace android; struct framebuffer_device_t; namespace anbox { namespace android { class Framebuffer; class SurfaceComposer : public BinderService, public BnSurfaceComposer, public IBinder::DeathRecipient { public: static char const *getServiceName() { return "SurfaceFlinger"; } SurfaceComposer(); virtual ~SurfaceComposer(); void binderDied(const wp& who) override; sp createConnection(); sp createGraphicBufferAlloc(); sp createDisplayEventConnection(); sp createDisplay(const String8& displayName, bool secure); void destroyDisplay(const sp& display); sp getBuiltInDisplay(int32_t id); void setTransactionState(const Vector& state, const Vector& displays, uint32_t flags); void bootFinished(); bool authenticateSurfaceTexture(const sp& surface) const; void setPowerMode(const sp& display, int mode); status_t getDisplayConfigs(const sp& display, Vector* configs); status_t getDisplayStats(const sp& display, DisplayStatInfo* stats); int getActiveConfig(const sp& display); status_t setActiveConfig(const sp& display, int id); status_t captureScreen(const sp& display, const sp& producer, Rect sourceCrop, uint32_t reqWidth, uint32_t reqHeight, uint32_t minLayerZ, uint32_t maxLayerZ, bool useIdentityTransform, Rotation rotation = eRotateNone); status_t clearAnimationFrameStats(); status_t getAnimationFrameStats(FrameStats* outStats) const; private: sp mPrimaryDisplay; framebuffer_device_t *mFbDev; }; } // namespace android } // namespace anbox #endif