voidOutput::chooseCompositionStrategy(){ // The base output implementation can only do client composition ATRACE_NAME("Output::chooseCompositionStrategy"); auto& outputState = editState(); outputState.usesClientComposition = true; outputState.usesDeviceComposition = false; outputState.reusedClientComposition = false; } Y:\home\zhoujinjian\android11_rockpi4\frameworks\native\services\surfaceflinger\CompositionEngine\src\Display.cpp voidDisplay::chooseCompositionStrategy(){ ATRACE_CALL(); ALOGV(__FUNCTION__); ATRACE_NAME("Display::chooseCompositionStrategy");
// Default to the base settings -- client composition only. Output::chooseCompositionStrategy();
// If we don't have a HWC display, then we are done if (!mId) { return; }
// Get any composition changes requested by the HWC device, and apply them. std::optional<android::HWComposer::DeviceRequestedChanges> changes; auto& hwc = getCompositionEngine().getHwComposer(); if (status_t result = hwc.getDeviceCompositionChanges(*mId, anyLayersRequireClientComposition(), &changes); result != NO_ERROR) { ALOGE("chooseCompositionStrategy failed for %s: %d (%s)", getName().c_str(), result, strerror(-result)); return; } if (changes) { applyChangedTypesToLayers(changes->changedTypes); applyDisplayRequests(changes->displayRequests); applyLayerRequestsToLayers(changes->layerRequests); applyClientTargetRequests(changes->clientTargetProperty); }
// Determine what type of composition we are doing from the final state auto& state = editState(); state.usesClientComposition = anyLayersRequireClientComposition(); state.usesDeviceComposition = !allLayersRequireClientComposition(); }