Merge m-c to inbound.
[gecko.git] / gfx / 2d / ScaledFontCairo.h
blob4361146a2e94fa9f05b47c737b8433f417563348
1 /* -*- Mode: C++; tab-width: 20; indent-tabs-mode: nil; c-basic-offset: 2 -*-
2 * This Source Code Form is subject to the terms of the Mozilla Public
3 * License, v. 2.0. If a copy of the MPL was not distributed with this
4 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
6 #ifndef MOZILLA_GFX_SCALEDFONTCAIRO_H_
7 #define MOZILLA_GFX_SCALEDFONTCAIRO_H_
9 #include "ScaledFontBase.h"
11 #include "cairo.h"
13 namespace mozilla {
14 namespace gfx {
16 class ScaledFontCairo : public ScaledFontBase
18 public:
20 ScaledFontCairo(cairo_scaled_font_t* aScaledFont, Float aSize);
22 #if defined(USE_SKIA) && defined(MOZ_ENABLE_FREETYPE)
23 virtual SkTypeface* GetSkTypeface();
24 #endif
27 // We need to be able to tell Skia whether or not to use
28 // hinting when rendering text, so that the glyphs it renders
29 // are the same as what layout is expecting. At the moment, only
30 // Skia uses this class when rendering with FreeType, as gfxFT2Font
31 // is the only gfxFont that honours gfxPlatform::FontHintingEnabled().
32 class GlyphRenderingOptionsCairo : public GlyphRenderingOptions
34 public:
35 GlyphRenderingOptionsCairo()
36 : mHinting(FONT_HINTING_NORMAL)
37 , mAutoHinting(false)
41 void SetHinting(FontHinting aHinting) { mHinting = aHinting; }
42 void SetAutoHinting(bool aAutoHinting) { mAutoHinting = aAutoHinting; }
43 FontHinting GetHinting() const { return mHinting; }
44 bool GetAutoHinting() const { return mAutoHinting; }
45 virtual FontType GetType() const { return FONT_CAIRO; }
46 private:
47 FontHinting mHinting;
48 bool mAutoHinting;
54 #endif /* MOZILLA_GFX_SCALEDFONTCAIRO_H_ */