status_t BufferStateLayer::updateTexImage(bool& /*recomputeVisibleRegions*/, nsecs_t latchTime,
nsecs_t /*expectedPresentTime*/) {
const State& s(getDrawingState());
if (!s.buffer) {
if (s.bgColorLayer) {
for (auto& handle : mDrawingState.callbackHandles) {
handle->latchTime = latchTime;
}
}
return NO_ERROR;
}
for (auto& handle : mDrawingState.callbackHandles) {
if (handle->frameNumber == mDrawingState.frameNumber) {
handle->latchTime = latchTime;
}
}
buffer
,有 bgColorLayer
,则更新 latchTime
,返回 NO_ERROR
。frameNumber
相等,则更新 latchTime
。CallbackHandle 的 frameNumber
是在 BufferStateLayer::setTransactionCompletedListeners() 设置的。