0

I am studying the graphic system in Android. What I want to do is to change upper and lower side in Android display.

It is like:

upper : 1 -> 2

lower : 2 -> 1

To do this, I studied surfaceflinger source code.

I got noticed that surfaceflinger takes the role to compose all layers and redraw them and give layers to HWComposer.

So I saw Layer->draw source in Layer.cpp to change upper pixel data and lower pixel data. But I could not find a right place where I can change pixel data.

I am testing with odroid u3 platform. Android in odroid uses samsung slsi code.

Guys, which part should I see to change upper and lower side? How can I control display with a pixel unit?

Guido
  • 46,642
  • 28
  • 120
  • 174
Yeol_
  • 93
  • 1
  • 1
  • 9
  • I'm not sure what you mean by "change upper and lower side". Are you trying to draw upside-down? The easiest way to do this would be to change the bit of code that recognizes the current orientation of the device, and invert it. (This is outside SurfaceFlinger.) – fadden Apr 13 '15 at 15:49
  • Oh I mean It is not upside-down. orientation is same but offset is different. offset will be offset= (offset + half of screen offset) % screen offset. so index 0 will be located at half , half offset will be located at index 0. the reason that I do this is to practice for controlling pixels coordinates – Yeol_ Apr 13 '15 at 16:13
  • Oh, I see. This is certainly doable with GL composition, but I don't think you can program the overlay planes to work this way. You'd want to disable HWC composition and then modify the GL compositor to render each half in a separate draw call (probably somewhere around `Layer::drawWithOpenGL()`), or better yet tweak RenderEngine to have an expanded mesh with separate sections for top/bottom, then just supply appropriate texture coordinates (https://android.googlesource.com/platform/frameworks/native/+/lollipop-release/services/surfaceflinger/RenderEngine/GLES20RenderEngine.cpp#297, I think). – fadden Apr 13 '15 at 18:01

0 Answers0