mirror of
https://github.com/RetroDECK/ES-DE.git
synced 2025-04-10 19:15:13 +00:00
Combining video pillarboxes with rounded corners will no longer round corners for the actual video frame (except for extreme values)
This commit is contained in:
parent
54125ca7ad
commit
0b33884baa
|
@ -224,13 +224,27 @@ void VideoFFmpegComponent::render(const glm::mat4& parentTrans)
|
||||||
vertices->dimming = mDimming;
|
vertices->dimming = mDimming;
|
||||||
|
|
||||||
if (mVideoCornerRadius > 0.0f) {
|
if (mVideoCornerRadius > 0.0f) {
|
||||||
|
// Don't round the corners for the video frame if pillarboxes are enabled.
|
||||||
|
// For extreme roundings it will still get applied though as we don't want the
|
||||||
|
// video content to render outside the black frame.
|
||||||
|
bool renderVideoCorners {true};
|
||||||
|
if (mDrawPillarboxes) {
|
||||||
|
if (mBlackFrame.getSize().x > mSize.x &&
|
||||||
|
mBlackFrame.getSize().x - mSize.x >= mVideoCornerRadius * 2.0f)
|
||||||
|
renderVideoCorners = false;
|
||||||
|
else if (mBlackFrame.getSize().y > mSize.y &&
|
||||||
|
mBlackFrame.getSize().y - mSize.y >= mVideoCornerRadius * 2.0f)
|
||||||
|
renderVideoCorners = false;
|
||||||
|
}
|
||||||
|
if (renderVideoCorners) {
|
||||||
|
vertices->cornerRadius = mVideoCornerRadius;
|
||||||
// We don't want to apply anti-aliasing to rounded corners as the black frame is
|
// We don't want to apply anti-aliasing to rounded corners as the black frame is
|
||||||
// rendered behind the video and that would generate ugly edge artifacts for any
|
// rendered behind the video and that would generate ugly edge artifacts for any
|
||||||
// videos with lighter content.
|
// videos with lighter content.
|
||||||
vertices->cornerRadius = mVideoCornerRadius;
|
|
||||||
vertices->shaderFlags =
|
vertices->shaderFlags =
|
||||||
vertices->shaderFlags | Renderer::ShaderFlags::ROUNDED_CORNERS_NO_AA;
|
vertices->shaderFlags | Renderer::ShaderFlags::ROUNDED_CORNERS_NO_AA;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
std::unique_lock<std::mutex> pictureLock {mPictureMutex};
|
std::unique_lock<std::mutex> pictureLock {mPictureMutex};
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue