// Make sure that composition can never be stalled by a virtual display
// consumer that isn't processing buffers fast enough. We have to do this
// in two places:
// * Here, in case the display is composed entirely by HWC.
// * In makeCurrent(), using eglSwapInterval. Some EGL drivers set the
// window's swap interval in eglMakeCurrent, so they'll override the
// interval we set here.
if (mType >= DisplayDevice:ISPLAY_VIRTUAL)
window->setSwapInterval(window, 0);
// Name the display. The name will be replaced shortly if the display
// was created with createDisplay().
switch (mType) {
case DISPLAY_PRIMARY:
mDisplayName = "Built-in Screen";
#ifdef MTK_AOSP_ENHANCEMENT
switch (mFlinger->sPropertiesState.mHwRotation) {
case 90:
mHwOrientation = DisplayState::eOrientation90;
break;
case 180:
mHwOrientation = DisplayState::eOrientation180;
break;
case 270:
mHwOrientation = DisplayState::eOrientation270;
break;
}
#endif
break;
case DISPLAY_EXTERNAL:
mDisplayName = "HDMI Screen";
break;
default:
mDisplayName = "Virtual Screen"; // e.g. Overlay #n
break;
}