Backed out changeset 690cba3bb817

This commit is contained in:
Bas Schouten 2012-04-03 23:54:14 +02:00
parent b07592468b
commit dca1953deb
6 changed files with 11 additions and 9 deletions

View File

@ -44,6 +44,7 @@
#include <sstream>
#include <vector>
using namespace std;
#include "gfxImageSurface.h"
namespace mozilla {
namespace gfx {
@ -137,6 +138,7 @@ private:
SkBitmap mBitmap;
SkRefPtr<SkCanvas> mCanvas;
SkRefPtr<SkDevice> mDevice;
nsRefPtr<gfxImageSurface> mImageSurface;
vector<SourceSurfaceSkia*> mSnapshots;
};

View File

@ -180,7 +180,7 @@ Factory::CreateScaledFontForNativeFont(const NativeFont &aNativeFont, Float aSiz
#ifdef WIN32
case NATIVE_FONT_GDI_FONT_FACE:
{
return new ScaledFontWin(static_cast<LOGFONT*>(aNativeFont.mFont), aSize);
return new ScaledFontWin(static_cast<gfxGDIFont*>(aNativeFont.mFont), aSize);
}
#endif
case NATIVE_FONT_SKIA_FONT_FACE:

View File

@ -37,6 +37,8 @@
#include "ScaledFontBase.h"
#include "gfxFont.h"
#ifdef USE_SKIA
#include "PathSkia.h"
#include "skia/SkPaint.h"

View File

@ -45,10 +45,11 @@
namespace mozilla {
namespace gfx {
ScaledFontWin::ScaledFontWin(LOGFONT* aFont, Float aSize)
ScaledFontWin::ScaledFontWin(gfxGDIFont* aFont, Float aSize)
: ScaledFontBase(aSize)
, mLogFont(*aFont)
{
LOGFONT lf;
GetObject(aFont->GetHFONT(), sizeof(LOGFONT), &lf);
}
#ifdef USE_SKIA

View File

@ -39,7 +39,7 @@
#define MOZILLA_GFX_SCALEDFONTWIN_H_
#include "ScaledFontBase.h"
#include <windows.h>
#include "gfxGDIFont.h"
namespace mozilla {
namespace gfx {
@ -47,7 +47,7 @@ namespace gfx {
class ScaledFontWin : public ScaledFontBase
{
public:
ScaledFontWin(LOGFONT* aFont, Float aSize);
ScaledFontWin(gfxGDIFont* aFont, Float aSize);
virtual FontType GetType() const { return FONT_GDI; }
#ifdef USE_SKIA
@ -57,7 +57,6 @@ private:
#ifdef USE_SKIA
friend class DrawTargetSkia;
#endif
LOGFONT mLogFont;
};
}

View File

@ -731,9 +731,7 @@ gfxWindowsPlatform::GetScaledFontForFont(gfxFont *aFont)
NativeFont nativeFont;
nativeFont.mType = NATIVE_FONT_GDI_FONT_FACE;
LOGFONT lf;
GetObject(static_cast<gfxGDIFont*>(aFont)->GetHFONT(), sizeof(LOGFONT), &lf);
nativeFont.mFont = &lf;
nativeFont.mFont = aFont;
RefPtr<ScaledFont> scaledFont =
Factory::CreateScaledFontForNativeFont(nativeFont, aFont->GetAdjustedSize());