Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

srgb test for OpenGL.

Set <srgbtest> as follows:
 0 default - no change over Frodo.
 1 enable sRGB filtering of textures.
 2 enable sRGB framebuffer support.
 3 enable sRGB filtering of textures and framebuffer support.

Note that font colours etc. will appear quite a bit brighter, as the colour is in linear space rather than sRGB.
  • Loading branch information...
commit 8a76ad7341cfe8111a5062572f2084e6741a63fe 1 parent a17906b
Jonathan Marshall authored
View
3  xbmc/guilib/TextureGL.cpp
@@ -23,6 +23,7 @@
#include "windowing/WindowingFactory.h"
#include "utils/log.h"
#include "utils/GLUtils.h"
+#include "settings/AdvancedSettings.h"
#if defined(HAS_GL) || defined(HAS_GLES)
@@ -91,7 +92,7 @@ void CGLTexture::LoadToGPU()
}
GLenum format = GL_BGRA;
- GLint numcomponents = GL_RGBA;
+ GLint numcomponents = (g_advancedSettings.m_srgbTest & 1) ? GL_SRGB8_ALPHA8_EXT : GL_RGBA;
switch (m_format)
{
View
2  xbmc/rendering/gl/RenderSystemGL.cpp
@@ -230,6 +230,8 @@ bool CRenderSystemGL::ResetRenderSystem(int width, int height, bool fullScreen,
glBlendFunc(GL_SRC_ALPHA, GL_ONE);
glEnable(GL_BLEND); // Turn Blending On
+ if (g_advancedSettings.m_srgbTest & 2)
+ glEnable(GL_FRAMEBUFFER_SRGB);
glDisable(GL_DEPTH_TEST);
return true;
View
4 xbmc/settings/AdvancedSettings.cpp
@@ -322,6 +322,8 @@ void CAdvancedSettings::Initialize()
m_databaseVideo.Reset();
m_logLevelHint = m_logLevel = LOG_LEVEL_NORMAL;
+
+ m_srgbTest = 0;
}
bool CAdvancedSettings::Load()
@@ -421,6 +423,8 @@ void CAdvancedSettings::ParseSettingsFile(const CStdString &file)
XMLUtils::GetBoolean(pElement, "omxdecodestartwithvalidframe", m_omxDecodeStartWithValidFrame);
}
+ XMLUtils::GetUInt(pRootElement, "srgbtest", m_srgbTest, 0, 3);
+
pElement = pRootElement->FirstChildElement("karaoke");
if (pElement)
{
View
2  xbmc/settings/AdvancedSettings.h
@@ -232,6 +232,8 @@ class CAdvancedSettings
CStdString m_musicThumbs;
CStdString m_fanartImages;
+ unsigned int m_srgbTest;
+
bool m_bMusicLibraryHideAllItems;
int m_iMusicLibraryRecentlyAddedItems;
bool m_bMusicLibraryAllItemsOnBottom;
Please sign in to comment.
Something went wrong with that request. Please try again.