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 "SkPDFGraphicState.h" | 10 #include "SkPDFGraphicState.h" |
(...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
61 | 61 |
62 const SkPDFGraphicState* findGraphicState(const SkPDFGraphicState&) const; | 62 const SkPDFGraphicState* findGraphicState(const SkPDFGraphicState&) const; |
63 void addGraphicState(const SkPDFGraphicState*); | 63 void addGraphicState(const SkPDFGraphicState*); |
64 | 64 |
65 sk_sp<SkPDFObject> findPDFBitmap(SkBitmapKey key) const; | 65 sk_sp<SkPDFObject> findPDFBitmap(SkBitmapKey key) const; |
66 void addPDFBitmap(SkBitmapKey key, sk_sp<SkPDFObject>); | 66 void addPDFBitmap(SkBitmapKey key, sk_sp<SkPDFObject>); |
67 | 67 |
68 SkTHashMap<uint32_t, bool> fCanEmbedTypeface; | 68 SkTHashMap<uint32_t, bool> fCanEmbedTypeface; |
69 | 69 |
70 SkPixelSerializer* getPixelSerializer() const { return fPixelSerializer.get(
); } | 70 SkPixelSerializer* getPixelSerializer() const { return fPixelSerializer.get(
); } |
71 void setPixelSerializer(SkPixelSerializer* ps) { fPixelSerializer.reset(ps)
; } | 71 void setPixelSerializer(sk_sp<SkPixelSerializer> ps) { |
| 72 fPixelSerializer = std::move(ps); |
| 73 } |
72 | 74 |
73 sk_sp<SkPDFStream> makeInvertFunction(); | 75 sk_sp<SkPDFStream> makeInvertFunction(); |
74 sk_sp<SkPDFDict> makeNoSmaskGraphicState(); | 76 sk_sp<SkPDFDict> makeNoSmaskGraphicState(); |
75 sk_sp<SkPDFArray> makeRangeObject(); | 77 sk_sp<SkPDFArray> makeRangeObject(); |
76 | 78 |
77 private: | 79 private: |
78 struct FontRec { | 80 struct FontRec { |
79 SkPDFFont* fFont; | 81 SkPDFFont* fFont; |
80 uint32_t fFontID; | 82 uint32_t fFontID; |
81 uint16_t fGlyphID; | 83 uint16_t fGlyphID; |
(...skipping 25 matching lines...) Expand all Loading... |
107 | 109 |
108 // TODO(halcanary): make SkTHashMap<K, sk_sp<V>> work correctly. | 110 // TODO(halcanary): make SkTHashMap<K, sk_sp<V>> work correctly. |
109 SkTHashMap<SkBitmapKey, SkPDFObject*> fPDFBitmapMap; | 111 SkTHashMap<SkBitmapKey, SkPDFObject*> fPDFBitmapMap; |
110 | 112 |
111 sk_sp<SkPixelSerializer> fPixelSerializer; | 113 sk_sp<SkPixelSerializer> fPixelSerializer; |
112 sk_sp<SkPDFStream> fInvertFunction; | 114 sk_sp<SkPDFStream> fInvertFunction; |
113 sk_sp<SkPDFDict> fNoSmaskGraphicState; | 115 sk_sp<SkPDFDict> fNoSmaskGraphicState; |
114 sk_sp<SkPDFArray> fRangeObject; | 116 sk_sp<SkPDFArray> fRangeObject; |
115 }; | 117 }; |
116 #endif // SkPDFCanon_DEFINED | 118 #endif // SkPDFCanon_DEFINED |
OLD | NEW |