summaryrefslogtreecommitdiff
path: root/indra/llrender
diff options
context:
space:
mode:
authorErik Kundiman <erik@megapahit.org>2024-06-20 16:16:37 +0800
committerErik Kundiman <erik@megapahit.org>2024-06-20 20:52:45 +0800
commitad5dec92bcb7d11e6a48b6ec6a220a49de985351 (patch)
tree3870c4c7f1c9521c6ad40d1cfe1b1d8fc39882ef /indra/llrender
parent16299d3a3631e4c42367cf40410ad6995e585384 (diff)
parenta65bc46b138b89200586b29fe729cbc7b0f0c8c4 (diff)
Merge remote-tracking branch 'secondlife/release/maint-b' into maint-b
Diffstat (limited to 'indra/llrender')
-rw-r--r--indra/llrender/llfontfreetype.cpp10
-rw-r--r--indra/llrender/llfontfreetypesvg.cpp4
-rw-r--r--indra/llrender/llfontfreetypesvg.h6
-rw-r--r--indra/llrender/llgl.cpp15
-rw-r--r--indra/llrender/llglheaders.h35
5 files changed, 55 insertions, 15 deletions
diff --git a/indra/llrender/llfontfreetype.cpp b/indra/llrender/llfontfreetype.cpp
index 92b373c835..554e70d6a7 100644
--- a/indra/llrender/llfontfreetype.cpp
+++ b/indra/llrender/llfontfreetype.cpp
@@ -52,7 +52,9 @@
#include "llfontbitmapcache.h"
#include "llgl.h"
-#define ENABLE_OT_SVG_SUPPORT
+#if !defined(LL_NO_OTSVG)
+ #define ENABLE_OT_SVG_SUPPORT
+#endif
FT_Render_Mode gFontRenderMode = FT_RENDER_MODE_NORMAL;
@@ -87,7 +89,7 @@ LLFontManager::LLFontManager()
FT_Done_FreeType(gFTLibrary);
}
-#ifdef ENABLE_OT_SVG_SUPPORT
+#if defined(ENABLE_OT_SVG_SUPPORT)
SVG_RendererHooks hooks = {
LLFontFreeTypeSvgRenderer::OnInit,
LLFontFreeTypeSvgRenderer::OnFree,
@@ -483,8 +485,8 @@ LLFontGlyphInfo* LLFontFreetype::addGlyph(llwchar wch, EFontGlyphType glyph_type
continue;
}
glyph_index = FT_Get_Char_Index(pair.first->mFTFace, wch);
- if (glyph_index)
- {
+ if (glyph_index)
+ {
return addGlyphFromFont(pair.first, wch, glyph_index,
glyph_type);
}
diff --git a/indra/llrender/llfontfreetypesvg.cpp b/indra/llrender/llfontfreetypesvg.cpp
index 1672aa4b96..45cbc5dbd7 100644
--- a/indra/llrender/llfontfreetypesvg.cpp
+++ b/indra/llrender/llfontfreetypesvg.cpp
@@ -88,6 +88,7 @@ void LLFontFreeTypeSvgRenderer::OnDataFinalizer(void* objectp)
//static
FT_Error LLFontFreeTypeSvgRenderer::OnPresetGlypthSlot(FT_GlyphSlot glyph_slot, FT_Bool cache, FT_Pointer*)
{
+#ifndef LL_NO_OTSVG
FT_SVG_Document document = static_cast<FT_SVG_Document>(glyph_slot->other);
llassert(!glyph_slot->generic.data || !cache || glyph_slot->glyph_index == ((LLSvgRenderData*)glyph_slot->generic.data)->GlyphIndex);
@@ -174,6 +175,9 @@ FT_Error LLFontFreeTypeSvgRenderer::OnPresetGlypthSlot(FT_GlyphSlot glyph_slot,
}
return FT_Err_Ok;
+#else
+ return FT_Err_Unimplemented_Feature;
+#endif
}
// static
diff --git a/indra/llrender/llfontfreetypesvg.h b/indra/llrender/llfontfreetypesvg.h
index 72ac5293ce..62aefd10b5 100644
--- a/indra/llrender/llfontfreetypesvg.h
+++ b/indra/llrender/llfontfreetypesvg.h
@@ -29,7 +29,11 @@
#include <ft2build.h>
#include FT_TYPES_H
#include FT_MODULE_H
-#include FT_OTSVG_H
+#ifdef FT_OTSVG_H
+ #include FT_OTSVG_H
+#else
+ #define LL_NO_OTSVG
+#endif
// See https://freetype.org/freetype2/docs/reference/ft2-svg_fonts.html
class LLFontFreeTypeSvgRenderer
diff --git a/indra/llrender/llgl.cpp b/indra/llrender/llgl.cpp
index 10920f1de3..99777c5f62 100644
--- a/indra/llrender/llgl.cpp
+++ b/indra/llrender/llgl.cpp
@@ -215,8 +215,6 @@ LLMatrix4 gGLObliqueProjectionInverse;
std::list<LLGLUpdate*> LLGLUpdate::sGLQ;
-#if (LL_WINDOWS || LL_LINUX) && !LL_MESA_HEADLESS
-
#if LL_WINDOWS
// WGL_ARB_create_context
PFNWGLCREATECONTEXTATTRIBSARBPROC wglCreateContextAttribsARB = nullptr;
@@ -236,8 +234,6 @@ PFNWGLBLITCONTEXTFRAMEBUFFERAMDPROC wglBlitContextFramebufferAMD = n
PFNWGLSWAPINTERVALEXTPROC wglSwapIntervalEXT = nullptr;
PFNWGLGETSWAPINTERVALEXTPROC wglGetSwapIntervalEXT = nullptr;
-#endif
-
/*
// GL_VERSION_1_2
@@ -1392,6 +1388,9 @@ void LLGLManager::shutdownGL()
void LLGLManager::initExtensions()
{
+#if LL_LINUX
+ glh_init_extensions("");
+#endif
#if LL_DARWIN
GLint num_extensions = 0;
std::string all_extensions{""};
@@ -1423,10 +1422,9 @@ void LLGLManager::initExtensions()
mInited = TRUE;
/*
-#if (LL_WINDOWS || LL_LINUX) && !LL_MESA_HEADLESS
+#if LL_WINDOWS
LL_DEBUGS("RenderInit") << "GL Probe: Getting symbols" << LL_ENDL;
-#if LL_WINDOWS
// WGL_AMD_gpu_association
wglGetGPUIDsAMD = (PFNWGLGETGPUIDSAMDPROC)GLH_EXT_GET_PROC_ADDRESS("wglGetGPUIDsAMD");
wglGetGPUInfoAMD = (PFNWGLGETGPUINFOAMDPROC)GLH_EXT_GET_PROC_ADDRESS("wglGetGPUInfoAMD");
@@ -1444,8 +1442,6 @@ void LLGLManager::initExtensions()
// WGL_ARB_create_context
wglCreateContextAttribsARB = (PFNWGLCREATECONTEXTATTRIBSARBPROC)GLH_EXT_GET_PROC_ADDRESS("wglCreateContextAttribsARB");
-#endif
-
// Load entire OpenGL API through GetProcAddress, leaving sections beyond mGLVersion unloaded
@@ -2582,6 +2578,7 @@ void parse_gl_version( S32* major, S32* minor, S32* release, std::string* vendor
{
return;
}
+ LL_INFOS() << "GL: " << version << LL_ENDL;
version_string->assign(version);
@@ -2961,5 +2958,3 @@ extern "C"
__declspec(dllexport) int AmdPowerXpressRequestHighPerformance = 1;
}
#endif
-
-
diff --git a/indra/llrender/llglheaders.h b/indra/llrender/llglheaders.h
index a397de499e..0b3258c105 100644
--- a/indra/llrender/llglheaders.h
+++ b/indra/llrender/llglheaders.h
@@ -41,6 +41,22 @@
# include "GL/glh_extensions.h"
# undef __APPLE__
+#elif LL_LINUX
+#define GL_GLEXT_PROTOTYPES
+#define GLX_GLEXT_PROTOTYPES
+
+#include "GL/gl.h"
+#include "GL/glext.h"
+#include "GL/glu.h"
+
+// The __APPLE__ kludge is to make glh_extensions.h not symbol-clash horribly
+# define __APPLE__
+# include "GL/glh_extensions.h"
+# undef __APPLE__
+
+# include "GL/glx.h"
+# include "GL/glxext.h"
+
#elif LL_WINDOWS
//----------------------------------------------------------------------------
// LL_WINDOWS
@@ -1034,6 +1050,25 @@ extern void glGetBufferPointervARB (GLenum, GLenum, GLvoid* *);
#include <OpenGL/gl.h>
#endif // 0
+#elif LL_LINUX
+
+#define GL_GLEXT_PROTOTYPES
+#define GLX_GLEXT_PROTOTYPES
+
+#include "GL/gl.h"
+#include "GL/glu.h"
+#include "GL/glext.h"
+#include "GL/glx.h"
+
+// The __APPLE__ kludge is to make glh_extensions.h not symbol-clash horribly
+# define __APPLE__
+# include "GL/glh_extensions.h"
+# undef __APPLE__
+
+// #include <X11/Xlib.h>
+// #include <X11/Xutil.h>
+#include "GL/glh_extensions.h"
+
#endif // LL_MESA / LL_WINDOWS / LL_DARWIN
// Even when GL_ARB_depth_clamp is available in the driver, the (correct)