其他分享
首页 > 其他分享> > Android 12(S) 图像显示系统 - 杂谈 - source crop & display frame

Android 12(S) 图像显示系统 - 杂谈 - source crop & display frame

作者:互联网

 

用于GPU合成的GraphicBuffer的size(width & height) -- > 所有走GPU的layer,会绘制到这个buffer中

然后setClientTarget传递给HWC

 

HWC2::Error DrmHwcTwo::HwcDisplay::SetClientTarget(buffer_handle_t target,
                                                   int32_t acquire_fence,
                                                   int32_t dataspace,
                                                   hwc_region_t /*damage*/) {
  supported(__func__);
  UniqueFd uf(acquire_fence);

  client_layer_.set_buffer(target);
  client_layer_.set_acquire_fence(uf.get());
  client_layer_.SetLayerDataspace(dataspace);

  /* TODO: Do not update source_crop every call.
   * It makes sense to do it once after every hotplug event. */
  hwc_drm_bo bo{};
  BufferInfoGetter::GetInstance()->ConvertBoInfo(target, &bo);

  hwc_frect_t source_crop = {.left = 0.0f,
                             .top = 0.0f,
                             .right = bo.width + 0.0f,
                             .bottom = bo.height + 0.0f};
  client_layer_.SetLayerSourceCrop(source_crop);

  return HWC2::Error::None;
}

 

标签:layer,12,_.,buffer,frame,bo,crop,source
来源: https://www.cnblogs.com/roger-yu/p/16528327.html