src/third_party/angle/src/libANGLE/renderer/vulkan/FramebufferVk.cpp
// Potentially make adjustments for pre-rotatation.  Depending on the angle some of the params need
// to be swapped and/or changes made to which axis are flipped.
Potentially make adjustments for pre-rotatation.  Depending on the angle some of the params need
to be swapped and/or changes made to which axis are flipped.
Potentially make adjustments for pre - rotatation . Depending on the angle some of the params need to be swapped and / or changes made to which axis are flipped .
void AdjustBlitResolveParametersForPreRotation(SurfaceRotation framebufferAngle,
                                               SurfaceRotation srcFramebufferAngle,
                                               UtilsVk::BlitResolveParameters *params)
{
    switch (framebufferAngle)
    {
        case SurfaceRotation::Identity:
            break;
        case SurfaceRotation::Rotated90Degrees:
            std::swap(params->stretch[0], params->stretch[1]);
            std::swap(params->srcOffset[0], params->srcOffset[1]);
            std::swap(params->rotatedOffsetFactor[0], params->rotatedOffsetFactor[1]);
            if (srcFramebufferAngle == framebufferAngle)
            {
                std::swap(params->destOffset[0], params->destOffset[1]);
                std::swap(params->stretch[0], params->stretch[1]);
                std::swap(params->flipX, params->flipY);
            }
            break;
        case SurfaceRotation::Rotated180Degrees:
            ASSERT(!params->flipX && params->flipY);
            params->flipX = true;
            params->flipY = false;
            break;
        case SurfaceRotation::Rotated270Degrees:
            std::swap(params->stretch[0], params->stretch[1]);
            std::swap(params->srcOffset[0], params->srcOffset[1]);
            std::swap(params->rotatedOffsetFactor[0], params->rotatedOffsetFactor[1]);
            if (srcFramebufferAngle == framebufferAngle)
            {
                std::swap(params->stretch[0], params->stretch[1]);
            }
            ASSERT(!params->flipX && !params->flipY);
            params->flipX = true;
            params->flipY = true;
            break;
        default:
            UNREACHABLE();
            break;
    }
}
void AdjustBlitResolveParametersForPreRotation ( SurfaceRotation framebufferAngle , SurfaceRotation srcFramebufferAngle , UtilsVk :: BlitResolveParameters * params ) { switch ( framebufferAngle ) { case SurfaceRotation :: Identity : break ; case SurfaceRotation :: Rotated90Degrees : std :: swap ( params -> stretch [ 0 ] , params -> stretch [ 1 ] ) ; std :: swap ( params -> srcOffset [ 0 ] , params -> srcOffset [ 1 ] ) ; std :: swap ( params -> rotatedOffsetFactor [ 0 ] , params -> rotatedOffsetFactor [ 1 ] ) ; if ( srcFramebufferAngle == framebufferAngle ) { std :: swap ( params -> destOffset [ 0 ] , params -> destOffset [ 1 ] ) ; std :: swap ( params -> stretch [ 0 ] , params -> stretch [ 1 ] ) ; std :: swap ( params -> flipX , params -> flipY ) ; } break ; case SurfaceRotation :: Rotated180Degrees : ASSERT ( ! params -> flipX && params -> flipY ) ; params -> flipX = true ; params -> flipY = false ; break ; case SurfaceRotation :: Rotated270Degrees : std :: swap ( params -> stretch [ 0 ] , params -> stretch [ 1 ] ) ; std :: swap ( params -> srcOffset [ 0 ] , params -> srcOffset [ 1 ] ) ; std :: swap ( params -> rotatedOffsetFactor [ 0 ] , params -> rotatedOffsetFactor [ 1 ] ) ; if ( srcFramebufferAngle == framebufferAngle ) { std :: swap ( params -> stretch [ 0 ] , params -> stretch [ 1 ] ) ; } ASSERT ( ! params -> flipX && ! params -> flipY ) ; params -> flipX = true ; params -> flipY = true ; break ; default : UNREACHABLE ( ) ; break ; } }
Potentially make adjustments for pre-rotatation.
Potentially make adjustments for pre - rotatation .