gfx/2d/ScaledFontMac.h

Wed, 31 Dec 2014 06:09:35 +0100

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Wed, 31 Dec 2014 06:09:35 +0100
changeset 0
6474c204b198
permissions
-rw-r--r--

Cloned upstream origin tor-browser at tor-browser-31.3.0esr-4.5-1-build1
revision ID fc1c9ff7c1b2defdbc039f12214767608f46423f for hacking purpose.

     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_SCALEDFONTMAC_H_
     7 #define MOZILLA_GFX_SCALEDFONTMAC_H_
     9 #import <ApplicationServices/ApplicationServices.h>
    10 #include "2D.h"
    12 #include "ScaledFontBase.h"
    14 namespace mozilla {
    15 namespace gfx {
    17 class ScaledFontMac : public ScaledFontBase
    18 {
    19 public:
    20   MOZ_DECLARE_REFCOUNTED_VIRTUAL_TYPENAME(ScaledFontMac)
    21   ScaledFontMac(CGFontRef aFont, Float aSize);
    22   virtual ~ScaledFontMac();
    24   virtual FontType GetType() const { return FontType::MAC; }
    25 #ifdef USE_SKIA
    26   virtual SkTypeface* GetSkTypeface();
    27 #endif
    28   virtual TemporaryRef<Path> GetPathForGlyphs(const GlyphBuffer &aBuffer, const DrawTarget *aTarget);
    29   virtual void CopyGlyphsToBuilder(const GlyphBuffer &aBuffer, PathBuilder *aBuilder, BackendType aBackendType, const Matrix *aTransformHint);
    30   virtual bool GetFontFileData(FontFileDataOutput aDataCallback, void *aBaton);
    32 private:
    33   friend class DrawTargetCG;
    34   CGFontRef mFont;
    35   CTFontRef mCTFont; // only created if CTFontDrawGlyphs is available, otherwise null
    37   typedef void (CTFontDrawGlyphsFuncT)(CTFontRef,
    38                                        const CGGlyph[], const CGPoint[],
    39                                        size_t, CGContextRef);
    41   static bool sSymbolLookupDone;
    43 public:
    44   // function pointer for CTFontDrawGlyphs, if available;
    45   // initialized the first time a ScaledFontMac is created,
    46   // so it will be valid by the time DrawTargetCG wants to use it
    47   static CTFontDrawGlyphsFuncT* CTFontDrawGlyphsPtr;
    48 };
    50 }
    51 }
    53 #endif /* MOZILLA_GFX_SCALEDFONTMAC_H_ */

mercurial