[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[ff-cvs] libvob include/vob/jni/Types.hxx include/vob/vo...
From: |
Tuomas J. Lukka |
Subject: |
[ff-cvs] libvob include/vob/jni/Types.hxx include/vob/vo... |
Date: |
Fri, 15 Aug 2003 14:53:38 -0400 |
CVSROOT: /cvsroot/libvob
Module name: libvob
Branch:
Changes by: Tuomas J. Lukka <address@hidden> 03/08/15 14:53:38
Modified files:
include/vob/jni: Types.hxx
include/vob/vobs: Text.hxx
src/jni : Font.cxx Main.cxx
Added files:
include/vob : Font.hxx
Log message:
Reduce compilation time by not including GLMosaicText into all vobs
CVSWeb URLs:
http://savannah.gnu.org/cgi-bin/viewcvs/libvob/libvob/include/vob/Font.hxx?rev=1.1
http://savannah.gnu.org/cgi-bin/viewcvs/libvob/libvob/include/vob/jni/Types.hxx.diff?tr1=1.29&tr2=1.30&r1=text&r2=text
http://savannah.gnu.org/cgi-bin/viewcvs/libvob/libvob/include/vob/vobs/Text.hxx.diff?tr1=1.5&tr2=1.6&r1=text&r2=text
http://savannah.gnu.org/cgi-bin/viewcvs/libvob/libvob/src/jni/Font.cxx.diff?tr1=1.3&tr2=1.4&r1=text&r2=text
http://savannah.gnu.org/cgi-bin/viewcvs/libvob/libvob/src/jni/Main.cxx.diff?tr1=1.21&tr2=1.22&r1=text&r2=text
Patches:
Index: libvob/include/vob/jni/Types.hxx
diff -u libvob/include/vob/jni/Types.hxx:1.29
libvob/include/vob/jni/Types.hxx:1.30
--- libvob/include/vob/jni/Types.hxx:1.29 Mon Aug 4 09:47:50 2003
+++ libvob/include/vob/jni/Types.hxx Fri Aug 15 14:53:38 2003
@@ -28,7 +28,6 @@
#include <jni.h>
-#include <GLMosaicText.hxx>
#include <vob/Vob.hxx>
#include <vob/Types.hxx>
@@ -43,7 +42,13 @@
namespace GLMosaicText {
namespace Mosaic {
template<class Format> class GLMosaicText::Mosaic::Raster;
+ namespace Format {
+ struct Alpha;
+ struct RGBA;
+ }
}
+ template<class X, class Y> class DenseGlyphs;
+ template<class X, class Y> class Renderer;
}
namespace Vob {
@@ -70,6 +75,16 @@
namespace JNI {
struct TexAccum_JNI;
}
+ namespace Font {
+ struct RealFont;
+
+ // XXX Copied from include/vob/vobs/Text.hxx
+ typedef GLMosaicText::Renderer<
+ GLMosaicText::DenseGlyphs<unsigned short,
GLMosaicText::Mosaic::Format::Alpha>,
+ unsigned short>
+ DefaultTextRenderer;
+
+ }
namespace JNI {
PREDBGVAR(dbg);
@@ -104,23 +119,8 @@
// template param
extern ObjectStorer<P> papers;
- // XXX Copied from include/vob/vobs/Text.hxx
- typedef GLMosaicText::Renderer<
- GLMosaicText::DenseGlyphs<unsigned short>,
- unsigned short>
- DefaultTextRenderer;
-
- // XXX MEMLEAK
- struct RealFont {
- GLMosaicText::Font *f;
- DefaultTextRenderer *rend;
- RealFont(GLMosaicText::Font *f) : f(f) {
- rend = new DefaultTextRenderer(f);
- }
- float getGlyphWidth(int c) { return rend->g.getGlyphWidth(c); }
- };
-
- extern ObjectStorer<RealFont> textrenderers;
+ typedef ::Vob::Font::RealFont RF;
+ extern ObjectStorer<RF> textrenderers;
#define START_VOB_JNI_CONVERSION(type, javaName_, jnitype_) \
struct JParameter<type> { \
@@ -257,9 +257,9 @@
out = in;
END_VOB_JNI_CONVERSION
- START_VOB_JNI_CONVERSION_IDDED(DefaultTextRenderer *,
+ START_VOB_JNI_CONVERSION_IDDED(Font::RealFont *,
"GL.Font")
- out = textrenderers[in]->rend;
+ out = textrenderers[in];
END_VOB_JNI_CONVERSION
START_VOB_JNI_CONVERSION_IDDED(::Vob::Paper::Paper *,
Index: libvob/include/vob/vobs/Text.hxx
diff -u libvob/include/vob/vobs/Text.hxx:1.5
libvob/include/vob/vobs/Text.hxx:1.6
--- libvob/include/vob/vobs/Text.hxx:1.5 Wed Jun 11 13:41:56 2003
+++ libvob/include/vob/vobs/Text.hxx Fri Aug 15 14:53:38 2003
@@ -32,6 +32,7 @@
#endif
#include <GLMosaicText.hxx>
+#include <vob/Font.hxx>
#include <vob/Types.hxx>
namespace Vob {
@@ -46,7 +47,7 @@
enum { NTrans = 1 };
- TextRenderer *rend;
+ Font::RealFont *rend;
str text;
float yoffs;
int flags;
@@ -73,7 +74,7 @@
(int)*it << ")\\n";
}
Vertexer<T> vertexer(t);
- GLMosaicText::renderIter(*rend, text.begin(), text.end(),
+ GLMosaicText::renderIter(*(rend->rend), text.begin(), text.end(),
0,yoffs,
vertexer, (flags & 1 ?
GLMosaicText::normalBindTexture_01 :
Index: libvob/src/jni/Font.cxx
diff -u libvob/src/jni/Font.cxx:1.3 libvob/src/jni/Font.cxx:1.4
--- libvob/src/jni/Font.cxx:1.3 Tue Apr 8 16:25:03 2003
+++ libvob/src/jni/Font.cxx Fri Aug 15 14:53:38 2003
@@ -32,10 +32,13 @@
#include <vob/buildmipmaps.hxx>
#include <vob/Debug.hxx>
+#include <vob/Font.hxx>
+
#include "org_nongnu_libvob_gl_GL.h"
#include "vobjnidef.hxx"
+
namespace Vob {
namespace JNI {
@@ -50,7 +53,7 @@
new GLMosaicText::FTFont(utf.c_str(), pt);
GLMosaicText::Font *gf = new GLMosaicText::Font_Bordered(
gf0, border);
- RealFont *f = new RealFont(gf);
+ Font::RealFont *f = new Font::RealFont(gf);
releaseWindow();
return textrenderers.add(f);
}
@@ -75,7 +78,7 @@
int arrayLength = env->GetArrayLength(widths);
jfloat *w = env->GetFloatArrayElements(widths, 0);
- RealFont *font = textrenderers.get(fontId);
+ Font::RealFont *font = textrenderers.get(fontId);
for(int i=0; i<arrayLength; i++) {
w[i] = font->getGlyphWidth(i);
Index: libvob/src/jni/Main.cxx
diff -u libvob/src/jni/Main.cxx:1.21 libvob/src/jni/Main.cxx:1.22
--- libvob/src/jni/Main.cxx:1.21 Sat Aug 2 05:07:11 2003
+++ libvob/src/jni/Main.cxx Fri Aug 15 14:53:38 2003
@@ -35,9 +35,12 @@
#include <vob/buildmipmaps.hxx>
#include <vob/Debug.hxx>
+#include <vob/Font.hxx>
+
#include "org_nongnu_libvob_gl_GL.h"
#include "vobjnidef.hxx"
+
namespace Vob {
namespace JNI {
DBGVAR(dbg, "JNI.general");
@@ -54,7 +57,7 @@
ObjectStorer<ByteVector> bytevectors("bytevectors");
-ObjectStorer<RealFont> textrenderers("Textrenderers");
+ObjectStorer<Font::RealFont> textrenderers("Textrenderers");
ObjectStorer<Os::RenderingSurface> windows("windows");
Os::Window *defaultWindow; // A kludge
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [ff-cvs] libvob include/vob/jni/Types.hxx include/vob/vo...,
Tuomas J. Lukka <=