Android surfaceflinger测试应用
SurfaceFlinger test code
任务目标:
在这个测试用例中,调用surfaceflinger的API实现在手机屏幕上绘制一块纯色区域
代码
- surfaceFlinger_test.cpp
#include <cutils/memory.h>
#include <utils/Log.h>
#include <android/native_window.h>
#include <binder/IPCThreadState.h>
#include <binder/ProcessState.h>
#include <binder/IServiceManager.h>
#include <gui/Surface.h>
#include <gui/SurfaceComposerClient.h>
using namespace android;
int main(int argc, char** argv)
{
// set up the thread-pool
sp<ProcessState> proc(ProcessState::self());
ProcessState::self()->startThreadPool();
// create a client to surfaceflinger
sp<SurfaceComposerClient> client = new SurfaceComposerClient();
sp<SurfaceControl> surfaceControl = client->createSurface(String

最低0.47元/天 解锁文章
1564

被折叠的 条评论
为什么被折叠?



