gfx/skia/trunk/src/pdf/SkPDFFontImpl.h

Sat, 03 Jan 2015 20:18:00 +0100

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Sat, 03 Jan 2015 20:18:00 +0100
branch
TOR_BUG_3246
changeset 7
129ffea94266
permissions
-rw-r--r--

Conditionally enable double key logic according to:
private browsing mode or privacy.thirdparty.isolate preference and
implement in GetCookieStringCommon and FindCookie where it counts...
With some reservations of how to convince FindCookie users to test
condition and pass a nullptr when disabling double key logic.

michael@0 1
michael@0 2 /*
michael@0 3 * Copyright 2011 Google Inc.
michael@0 4 *
michael@0 5 * Use of this source code is governed by a BSD-style license that can be
michael@0 6 * found in the LICENSE file.
michael@0 7 */
michael@0 8
michael@0 9
michael@0 10 #ifndef SkPDFFontImpl_DEFINED
michael@0 11 #define SkPDFFontImpl_DEFINED
michael@0 12
michael@0 13 #include "SkPDFFont.h"
michael@0 14
michael@0 15 class SkPDFType0Font : public SkPDFFont {
michael@0 16 public:
michael@0 17 virtual ~SkPDFType0Font();
michael@0 18 virtual bool multiByteGlyphs() const { return true; }
michael@0 19 SK_API virtual SkPDFFont* getFontSubset(const SkPDFGlyphSet* usage);
michael@0 20 #ifdef SK_DEBUG
michael@0 21 virtual void emitObject(SkWStream* stream, SkPDFCatalog* catalog,
michael@0 22 bool indirect);
michael@0 23 #endif
michael@0 24
michael@0 25 private:
michael@0 26 friend class SkPDFFont; // to access the constructor
michael@0 27 #ifdef SK_DEBUG
michael@0 28 bool fPopulated;
michael@0 29 typedef SkPDFDict INHERITED;
michael@0 30 #endif
michael@0 31
michael@0 32 SkPDFType0Font(SkAdvancedTypefaceMetrics* info, SkTypeface* typeface);
michael@0 33
michael@0 34 bool populate(const SkPDFGlyphSet* subset);
michael@0 35 };
michael@0 36
michael@0 37 class SkPDFCIDFont : public SkPDFFont {
michael@0 38 public:
michael@0 39 virtual ~SkPDFCIDFont();
michael@0 40 virtual bool multiByteGlyphs() const { return true; }
michael@0 41
michael@0 42 private:
michael@0 43 friend class SkPDFType0Font; // to access the constructor
michael@0 44
michael@0 45 SkPDFCIDFont(SkAdvancedTypefaceMetrics* info, SkTypeface* typeface,
michael@0 46 const SkPDFGlyphSet* subset);
michael@0 47
michael@0 48 bool populate(const SkPDFGlyphSet* subset);
michael@0 49 bool addFontDescriptor(int16_t defaultWidth,
michael@0 50 const SkTDArray<uint32_t>* subset);
michael@0 51 };
michael@0 52
michael@0 53 class SkPDFType1Font : public SkPDFFont {
michael@0 54 public:
michael@0 55 virtual ~SkPDFType1Font();
michael@0 56 virtual bool multiByteGlyphs() const { return false; }
michael@0 57
michael@0 58 private:
michael@0 59 friend class SkPDFFont; // to access the constructor
michael@0 60
michael@0 61 SkPDFType1Font(SkAdvancedTypefaceMetrics* info, SkTypeface* typeface,
michael@0 62 uint16_t glyphID, SkPDFDict* relatedFontDescriptor);
michael@0 63
michael@0 64 bool populate(int16_t glyphID);
michael@0 65 bool addFontDescriptor(int16_t defaultWidth);
michael@0 66 void addWidthInfoFromRange(int16_t defaultWidth,
michael@0 67 const SkAdvancedTypefaceMetrics::WidthRange* widthRangeEntry);
michael@0 68 };
michael@0 69
michael@0 70 class SkPDFType3Font : public SkPDFFont {
michael@0 71 public:
michael@0 72 virtual ~SkPDFType3Font();
michael@0 73 virtual bool multiByteGlyphs() const { return false; }
michael@0 74
michael@0 75 private:
michael@0 76 friend class SkPDFFont; // to access the constructor
michael@0 77
michael@0 78 SkPDFType3Font(SkAdvancedTypefaceMetrics* info, SkTypeface* typeface, uint16_t glyphID);
michael@0 79
michael@0 80 bool populate(int16_t glyphID);
michael@0 81 };
michael@0 82
michael@0 83 #endif

mercurial