Some font updates
authorromashin
Sat, 19 Apr 2008 18:37:23 +0300
changeset 16801 e1c47edfd4f5f6dc4df9049c1ef0dc88ac0a0a72
parent 16800 b06d549c0105fd2ce055840f70aea7de74232296
child 16802 db1c71ba7da8e48fe488bdc50fe8d4401ed9c157
push id1298
push userpavlov@mozilla.com
push dateSun, 17 Aug 2008 05:03:09 +0000
treeherderautoland@4a506fa751d8 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
milestone2.0a1pre
Some font updates
gfx/thebes/public/gfxQtFonts.h
gfx/thebes/src/gfxQtFonts.cpp
--- a/gfx/thebes/public/gfxQtFonts.h
+++ b/gfx/thebes/public/gfxQtFonts.h
@@ -45,20 +45,24 @@
 #include "gfxContext.h"
 
 #include "nsDataHashtable.h"
 #include "nsClassHashtable.h"
 
 #define ENABLE_FAST_PATH_8BIT 1
 #define ENABLE_FAST_PATH_ALWAYS 1
 
+class QFont;
+
 class gfxQtFont : public gfxFont {
 public:
      gfxQtFont (const nsAString& aName,
                 const gfxFontStyle *aFontStyle);
+     gfxQtFont(QFont *aQFont, const nsAString &aName,
+               const gfxFontStyle *aFontStyle);
      virtual ~gfxQtFont ();
 
      virtual nsString GetUniqueName ();
 
      virtual PRUint32 GetSpaceGlyph ()
      {
 
         NS_ASSERTION (GetStyle ()->size != 0,
--- a/gfx/thebes/src/gfxQtFonts.cpp
+++ b/gfx/thebes/src/gfxQtFonts.cpp
@@ -42,16 +42,17 @@
  *
  * ***** END LICENSE BLOCK ***** */
 
 #include "gfxPlatformQt.h"
 #include "gfxTypes.h"
 #include "gfxQtFonts.h"
 #include "qdebug.h"
 #include "qrect.h"
+#include <QFont>
 #include <locale.h>
 #include <cairo.h>
 #include <QFontMetrics>
 
 
 /**
  * gfxQtFontGroup
  */
@@ -467,16 +468,26 @@ gfxQtFontGroup::MakeTextRun(const PRUnic
 gfxQtFont::gfxQtFont(const nsAString &aName,
                      const gfxFontStyle *aFontStyle)
     : gfxFont(aName, aFontStyle),
       mQFont(nsnull), mCairoFont(nsnull),
       mHasMetrics(PR_FALSE), mAdjustedSize(0)
 {
 }
 
+gfxQtFont::gfxQtFont(QFont *aQFont, const nsAString &aName,
+                     const gfxFontStyle *aFontStyle)
+        : gfxFont(aName, aFontStyle),
+        mQFont(aQFont), mCairoFont(nsnull),
+        mHasMetrics(PR_FALSE), mAdjustedSize(aFontStyle->size)
+{
+//    g_object_ref(mPangoFont);
+//    g_object_set_qdata(G_OBJECT(mPangoFont), GetFontQuark(), this);
+}
+
 gfxQtFont::~gfxQtFont()
 {
 }
 
 const gfxFont::Metrics&
 gfxQtFont::GetMetrics()
 {
      if (mHasMetrics)