如何显示图像,而不在Android SurfaceFlinger的 [英] how to show an image without surfaceflinger on android

查看:464
本文介绍了如何显示图像,而不在Android SurfaceFlinger的的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何绘制在Android surfacefligner开始前的一些东西?

How to draw some stuff before surfacefligner start on android?

在这种情况下,它的一些传统的Linux与帧缓冲设备,所以直接访问帧缓冲应该没问题。

In this situation, it's some kind of traditional Linux with framebuffer device, so directly access framebuffer should be OK.

如何直接使用HWComposer以及如何直接使用EGL?

How about to use HWComposer directly and how about to use egl directly?

推荐答案

如果SurfaceFlinger的没有运行,你可以打开帧缓冲设备和写入(假设你的的设备上已一帧缓冲设备)。

If SurfaceFlinger isn't running, you can just open the framebuffer device and write to it (assuming you're on a device that has a framebuffer device).

有关这方面的一个例子,看到了复苏的用户界面的实现。密钥文件有 minui / graphics.c 。当前的实现依赖于libpixelflinger。

For an example of this, see the implementation of the "recovery" UI. The key file there is minui/graphics.c. The current implementation relies on libpixelflinger.

使用的OpenGL ES / EGL会比较麻烦一些。一些早期GLES测试,例如圣洛杉矶,使用 FramebufferWindow 类,但使用该框架的公平位。 (FWIW,即将推出的版本预计将取消precate FramebufferWindow并切换使用它们给会谈SurfaceFlinger的新库OpenGL的测试。)

Using OpenGL ES / EGL will be a bit more tricky. Some of the early GLES tests, such as San Angeles, use the FramebufferWindow class, but that uses a fair bit of the framework. (FWIW, an upcoming release is expected to deprecate FramebufferWindow and switch the OpenGL tests that use them to a new library that talks to SurfaceFlinger.)

更新:即将发布的发生了,你可以看到替代FramebufferWindow(WindowSurface)<一href=\"https://android.googlesource.com/platform/frameworks/native/+/lollipop-mr1-release/opengl/tests/lib/WindowSurface.cpp\"相对=nofollow>这里。

Update: the upcoming release happened, and you can see the replacement for FramebufferWindow ("WindowSurface") here.

如果SurfaceFlinger的未运行,你可以直接跟HardwareComposer,使用内部接口。有一些<一href=\"https://android.googlesource.com/platform/frameworks/native/+/lollipop-mr1-release/opengl/tests/hwc/\"相对=nofollow>老测试,运动,但我不知道他们是否仍然有效。在SurfaceFlinger的的code可能是在这一点上一个更好的例子。只有一个进程可以一次打开HardwareComposer,所以SurfaceFlinger的不能运行。

If SurfaceFlinger isn't running you can talk to HardwareComposer directly, using the internal interface. There are some old tests that exercise it, but I don't know if they still work. The code in SurfaceFlinger is probably a better example at this point. Only one process can open HardwareComposer at a time, so SurfaceFlinger must not be running.

这篇关于如何显示图像,而不在Android SurfaceFlinger的的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆