1
0
mirror of https://git.dev.opencascade.org/repos/occt.git synced 2025-09-03 14:10:33 +03:00

0023457: Slow text rendering

Added class Font_FTFont wrapper over FreeType face

Unify collections methods NCollection_Array1, NCollection_Sequence, NCollection_Vector:
declare Upper, Lower, First, Last, ChangeFirst, ChangeLast methods for all these collections.

Added method NCollection_DataMap::Find() with check key is bound + retrieve value within single call interface.

OpenGl_Context::ReleaseResource() method now supports lazy release of shared resources.

Added class OpenGl_Font which implements textured fonts support.
Added class OpenGl_TextFormatter for text formatting using OpenGl_Font.

OpenGl_Text was redesigned to use OpenGl_FontFormatter.

OpenGl_FontMgr class was removed.
All methods related to text rendered removed from OpenGl_Display class.

OpenGl_Trihedron and OpenGl_GraduatedTrihedron classes were redesigned
to use OpenGl_Text.

OpenGl_PrinterContext instance was moved to OpenGl_GraphicDriver fields
(eliminated usage of global instance).

Added test cases into 3rdparty/fonts grid to check different font styles
and perform FPS tests (no automated results - requires manual analysis
or snapshots comparisons).

Removed unused CSF_FTGL dependency.
OpenGl_Text::setupMatrix - do not apply floor for myWinZ
This commit is contained in:
kgv
2013-02-08 15:05:16 +04:00
parent 163ef25006
commit a174a3c54f
72 changed files with 5397 additions and 2606 deletions

View File

@@ -44,8 +44,6 @@
#include <OpenGl_Light.hxx>
#include <Handle_OpenGl_Context.hxx>
#include <Handle_OpenGl_Trihedron.hxx>
#include <Handle_OpenGl_GraduatedTrihedron.hxx>
#include <Handle_OpenGl_Workspace.hxx>
#include <Handle_OpenGl_View.hxx>
#include <Handle_OpenGl_Texture.hxx>
@@ -100,7 +98,10 @@ struct OPENGL_FOG
TEL_COLOUR Color;
};
class OpenGl_GraduatedTrihedron;
class OpenGl_Structure;
class OpenGl_Trihedron;
class Handle(OpenGl_PrinterContext);
class OpenGl_View : public MMgt_TShared
{
@@ -125,11 +126,16 @@ class OpenGl_View : public MMgt_TShared
void SetFog (const Graphic3d_CView& theCView, const Standard_Boolean theFlag);
void TriedronDisplay (const Aspect_TypeOfTriedronPosition APosition, const Quantity_NameOfColor AColor, const Standard_Real AScale, const Standard_Boolean AsWireframe);
void TriedronErase ();
void TriedronDisplay (const Handle(OpenGl_Context)& theCtx,
const Aspect_TypeOfTriedronPosition thePosition,
const Quantity_NameOfColor theColor,
const Standard_Real theScale,
const Standard_Boolean theAsWireframe);
void TriedronErase (const Handle(OpenGl_Context)& theCtx);
void GraduatedTrihedronDisplay (const Graphic3d_CGraduatedTrihedron &ACubic);
void GraduatedTrihedronErase ();
void GraduatedTrihedronDisplay (const Handle(OpenGl_Context)& theCtx,
const Graphic3d_CGraduatedTrihedron& theCubic);
void GraduatedTrihedronErase (const Handle(OpenGl_Context)& theCtx);
Standard_Boolean ProjectObjectToRaster (const Standard_Integer w, const Standard_Integer h,
const Standard_ShortReal x, const Standard_ShortReal y, const Standard_ShortReal z,
@@ -180,19 +186,23 @@ class OpenGl_View : public MMgt_TShared
void SetBackgroundGradient (const Quantity_Color& AColor1, const Quantity_Color& AColor2, const Aspect_GradientFillMethod AType);
void SetBackgroundGradientType (const Aspect_GradientFillMethod AType);
void Render (const Handle(OpenGl_Workspace) &AWorkspace,
const Graphic3d_CView& ACView,
const Aspect_CLayer2d& ACUnderLayer,
const Aspect_CLayer2d& ACOverLayer);
void Render (const Handle(OpenGl_PrinterContext)& thePrintContext,
const Handle(OpenGl_Workspace)& theWorkspace,
const Graphic3d_CView& theCView,
const Aspect_CLayer2d& theCUnderLayer,
const Aspect_CLayer2d& theCOverLayer);
// Type definition
//
DEFINE_STANDARD_RTTI(OpenGl_View)
public:
DEFINE_STANDARD_RTTI(OpenGl_View) // Type definition
protected:
void RenderStructs (const Handle(OpenGl_Workspace) &AWorkspace);
void RedrawLayer2d (const Handle(OpenGl_Workspace) &AWorkspace, const Graphic3d_CView& ACView, const Aspect_CLayer2d& ACLayer);
void RedrawLayer2d (const Handle(OpenGl_PrinterContext)& thePrintContext,
const Handle(OpenGl_Workspace)& theWorkspace,
const Graphic3d_CView& theCView,
const Aspect_CLayer2d& theCLayer);
Handle(OpenGl_Texture) myTextureEnv;
Visual3d_TypeOfSurfaceDetail mySurfaceDetail; //WSSurfaceDetail
@@ -218,8 +228,8 @@ class OpenGl_View : public MMgt_TShared
//}
OPENGL_FOG myFog;
Handle(OpenGl_Trihedron) myTrihedron;
Handle(OpenGl_GraduatedTrihedron) myGraduatedTrihedron;
OpenGl_Trihedron* myTrihedron;
OpenGl_GraduatedTrihedron* myGraduatedTrihedron;
//View_LABViewContext
int myVisualization;