| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright 2015 Google Inc. | 2 * Copyright 2015 Google Inc. |
| 3 * | 3 * |
| 4 * Use of this source code is governed by a BSD-style license that can be | 4 * Use of this source code is governed by a BSD-style license that can be |
| 5 * found in the LICENSE file. | 5 * found in the LICENSE file. |
| 6 */ | 6 */ |
| 7 #ifndef SkPDFCanon_DEFINED | 7 #ifndef SkPDFCanon_DEFINED |
| 8 #define SkPDFCanon_DEFINED | 8 #define SkPDFCanon_DEFINED |
| 9 | 9 |
| 10 #include "SkBitmap.h" | 10 #include "SkBitmap.h" |
| (...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 74 | 74 |
| 75 const SkPDFGraphicState* findGraphicState(const SkPDFGraphicState&) const; | 75 const SkPDFGraphicState* findGraphicState(const SkPDFGraphicState&) const; |
| 76 void addGraphicState(const SkPDFGraphicState*); | 76 void addGraphicState(const SkPDFGraphicState*); |
| 77 | 77 |
| 78 SkPDFObject* findPDFBitmap(const SkImage* image) const; | 78 SkPDFObject* findPDFBitmap(const SkImage* image) const; |
| 79 void addPDFBitmap(uint32_t imageUniqueID, SkPDFObject*); | 79 void addPDFBitmap(uint32_t imageUniqueID, SkPDFObject*); |
| 80 const SkImage* bitmapToImage(const SkBitmap&); | 80 const SkImage* bitmapToImage(const SkBitmap&); |
| 81 | 81 |
| 82 SkTHashMap<uint32_t, bool> fCanEmbedTypeface; | 82 SkTHashMap<uint32_t, bool> fCanEmbedTypeface; |
| 83 | 83 |
| 84 SkAutoTUnref<SkPixelSerializer> fPixelSerializer; | 84 SkPixelSerializer* getPixelSerializer() const { return fPixelSerializer.get(
); } |
| 85 void setPixelSerializer(SkPixelSerializer* ps) { fPixelSerializer.reset(ps)
; } |
| 85 | 86 |
| 86 private: | 87 private: |
| 87 struct FontRec { | 88 struct FontRec { |
| 88 SkPDFFont* fFont; | 89 SkPDFFont* fFont; |
| 89 uint32_t fFontID; | 90 uint32_t fFontID; |
| 90 uint16_t fGlyphID; | 91 uint16_t fGlyphID; |
| 91 }; | 92 }; |
| 92 SkTDArray<FontRec> fFontRecords; | 93 SkTDArray<FontRec> fFontRecords; |
| 93 | 94 |
| 94 SkTDArray<SkPDFFunctionShader*> fFunctionShaderRecords; | 95 SkTDArray<SkPDFFunctionShader*> fFunctionShaderRecords; |
| (...skipping 14 matching lines...) Expand all Loading... |
| 109 uint32_t operator()(const WrapGS& w) const { | 110 uint32_t operator()(const WrapGS& w) const { |
| 110 SkASSERT(w.fPtr); | 111 SkASSERT(w.fPtr); |
| 111 return w.fPtr->hash(); | 112 return w.fPtr->hash(); |
| 112 } | 113 } |
| 113 }; | 114 }; |
| 114 }; | 115 }; |
| 115 SkTHashSet<WrapGS, WrapGS::Hash> fGraphicStateRecords; | 116 SkTHashSet<WrapGS, WrapGS::Hash> fGraphicStateRecords; |
| 116 | 117 |
| 117 SkTHashMap<SkBitmapKey, const SkImage*> fBitmapToImageMap; | 118 SkTHashMap<SkBitmapKey, const SkImage*> fBitmapToImageMap; |
| 118 SkTHashMap<uint32_t /*ImageUniqueID*/, SkPDFObject*> fPDFBitmapMap; | 119 SkTHashMap<uint32_t /*ImageUniqueID*/, SkPDFObject*> fPDFBitmapMap; |
| 120 |
| 121 SkAutoTUnref<SkPixelSerializer> fPixelSerializer; |
| 119 }; | 122 }; |
| 120 #endif // SkPDFCanon_DEFINED | 123 #endif // SkPDFCanon_DEFINED |
| OLD | NEW |