正确的log:
type | handle | hint | flag | tr | blnd | format | source crop (l,t,r,b) | frame | name
-----------+----------+------+------+----+------+-------------+--------------------------------+------------------------+------
HWC | 558eb22ed0 | 0002 | 0000 | 00 | 0100 | RGBx_8888 | 0.0, 0.0, 1080.0, 1920.0 | 0, 0, 1080, 1920 | BootAnimation
FB TARGET | 00000000 | 0000 | 0000 | 00 | 0105 | RGBA_8888 | 0.0, 0.0, 1080.0, 1920.0 | 0, 0, 1080, 1920 | HWC_FRAMEBUFFER_TARGET 作者: zangcf 时间: 2016-5-19 18:37
再加上修改这个文件:/media/doraemon/works/android/mtk/6735/vr_mouse/alps_VR_new/frameworks/native/services/surfaceflinger/DisplayHardware/HWComposer.cpp
virtual void setFrame(const Rect& frame) {
//为了显示下一个部分大小,增加可视区域,我们把这里强制增加到第二屏幕的位置。
Rect myframe(frame); //zcfdebug++
if(myframe.bottom==960)myframe.bottom=1920; //zcfdebug++
if(myframe.bottom==1080)myframe.bottom=1920; //zcfdebug++
getLayer()->displayFrame = reinterpret_cast<hwc_rect_t const&>(myframe);
}
virtual void setCrop(const FloatRect& crop) {
FloatRect myCrop(crop);
if(myCrop.bottom==960)myCrop.bottom=1920; //zcfdebug++
if(myCrop.bottom==1080)myCrop.bottom=1920; //zcfdebug++
if (hwcHasApiVersion(mHwc, HWC_DEVICE_API_VERSION_1_3)) {
getLayer()->sourceCropf = reinterpret_cast<hwc_frect_t const&>(myCrop);
} else {
/*
* Since h/w composer didn't support a flot crop rect before version 1.3,
* using integer coordinates instead produces a different output from the GL code in
* Layer::drawWithOpenGL(). The difference can be large if the buffer crop to
* window size ratio is large and a window crop is defined
* (i.e.: if we scale the buffer a lot and we also crop it with a window crop).
*/
hwc_rect_t& r = getLayer()->sourceCrop;
r.left = int(ceilf(myCrop.left));
r.top = int(ceilf(myCrop.top));
r.right = int(floorf(myCrop.right));
r.bottom= int(floorf(myCrop.bottom));
}
}作者: zangcf 时间: 2016-5-19 18:37
上面修改之后,就可以显示完全的log了。