OLD | NEW |
1 /* | 1 /* |
2 * Copyright 2010 The Android Open Source Project | 2 * Copyright 2010 The Android Open Source Project |
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 | 7 |
8 | 8 |
9 #ifndef SkPDFTypes_DEFINED | 9 #ifndef SkPDFTypes_DEFINED |
10 #define SkPDFTypes_DEFINED | 10 #define SkPDFTypes_DEFINED |
(...skipping 300 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
311 | 311 |
312 This class takes an asset and assumes that it is backed by | 312 This class takes an asset and assumes that it is backed by |
313 long-lived shared data (for example, an open file | 313 long-lived shared data (for example, an open file |
314 descriptor). That is: no memory savings can be made by holding on | 314 descriptor). That is: no memory savings can be made by holding on |
315 to a compressed version instead. | 315 to a compressed version instead. |
316 */ | 316 */ |
317 class SkPDFSharedStream final : public SkPDFObject { | 317 class SkPDFSharedStream final : public SkPDFObject { |
318 public: | 318 public: |
319 // Takes ownership of asset. | 319 // Takes ownership of asset. |
320 SkPDFSharedStream(SkStreamAsset* data) : fAsset(data), fDict(new SkPDFDict)
{ SkASSERT(data); } | 320 SkPDFSharedStream(SkStreamAsset* data) : fAsset(data), fDict(new SkPDFDict)
{ SkASSERT(data); } |
321 SkPDFDict* dict() { return fDict; } | 321 SkPDFDict* dict() { return fDict.get(); } |
322 void emitObject(SkWStream*, | 322 void emitObject(SkWStream*, |
323 const SkPDFObjNumMap&, | 323 const SkPDFObjNumMap&, |
324 const SkPDFSubstituteMap&) const override; | 324 const SkPDFSubstituteMap&) const override; |
325 void addResources(SkPDFObjNumMap*, | 325 void addResources(SkPDFObjNumMap*, |
326 const SkPDFSubstituteMap&) const override; | 326 const SkPDFSubstituteMap&) const override; |
327 | 327 |
328 private: | 328 private: |
329 SkAutoTDelete<SkStreamAsset> fAsset; | 329 SkAutoTDelete<SkStreamAsset> fAsset; |
330 SkAutoTUnref<SkPDFDict> fDict; | 330 SkAutoTUnref<SkPDFDict> fDict; |
331 typedef SkPDFObject INHERITED; | 331 typedef SkPDFObject INHERITED; |
(...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
393 }; | 393 }; |
394 | 394 |
395 #ifdef SK_PDF_IMAGE_STATS | 395 #ifdef SK_PDF_IMAGE_STATS |
396 extern SkAtomic<int> gDrawImageCalls; | 396 extern SkAtomic<int> gDrawImageCalls; |
397 extern SkAtomic<int> gJpegImageObjects; | 397 extern SkAtomic<int> gJpegImageObjects; |
398 extern SkAtomic<int> gRegularImageObjects; | 398 extern SkAtomic<int> gRegularImageObjects; |
399 extern void SkPDFImageDumpStats(); | 399 extern void SkPDFImageDumpStats(); |
400 #endif // SK_PDF_IMAGE_STATS | 400 #endif // SK_PDF_IMAGE_STATS |
401 | 401 |
402 #endif | 402 #endif |
OLD | NEW |