| 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 |
| 11 | 11 |
| 12 #include "SkRefCnt.h" | 12 #include "SkRefCnt.h" |
| 13 #include "SkScalar.h" | 13 #include "SkScalar.h" |
| 14 #include "SkStream.h" | 14 #include "SkStream.h" |
| 15 #include "SkString.h" | 15 #include "SkString.h" |
| 16 #include "SkTDArray.h" | 16 #include "SkTDArray.h" |
| 17 #include "SkTHash.h" | 17 #include "SkTHash.h" |
| 18 #include "SkTypes.h" | 18 #include "SkTypes.h" |
| 19 | 19 |
| 20 class SkPDFObjNumMap; | 20 class SkPDFObjNumMap; |
| 21 class SkPDFObject; | 21 class SkPDFObject; |
| 22 class SkPDFSubstituteMap; | 22 class SkPDFSubstituteMap; |
| 23 | 23 |
| 24 #ifdef SK_PDF_IMAGE_STATS |
| 25 #include "SkAtomics.h" |
| 26 #endif |
| 27 |
| 24 /** \class SkPDFObject | 28 /** \class SkPDFObject |
| 25 | 29 |
| 26 A PDF Object is the base class for primitive elements in a PDF file. A | 30 A PDF Object is the base class for primitive elements in a PDF file. A |
| 27 common subtype is used to ease the use of indirect object references, | 31 common subtype is used to ease the use of indirect object references, |
| 28 which are common in the PDF format. | 32 which are common in the PDF format. |
| 29 | 33 |
| 30 */ | 34 */ |
| 31 class SkPDFObject : public SkRefCnt { | 35 class SkPDFObject : public SkRefCnt { |
| 32 public: | 36 public: |
| 33 /** Subclasses must implement this method to print the object to the | 37 /** Subclasses must implement this method to print the object to the |
| (...skipping 341 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 375 SkPDFObject* getSubstitute(SkPDFObject* object) const; | 379 SkPDFObject* getSubstitute(SkPDFObject* object) const; |
| 376 | 380 |
| 377 SkPDFObject* operator()(SkPDFObject* o) const { | 381 SkPDFObject* operator()(SkPDFObject* o) const { |
| 378 return this->getSubstitute(o); | 382 return this->getSubstitute(o); |
| 379 } | 383 } |
| 380 | 384 |
| 381 private: | 385 private: |
| 382 SkTHashMap<SkPDFObject*, SkPDFObject*> fSubstituteMap; | 386 SkTHashMap<SkPDFObject*, SkPDFObject*> fSubstituteMap; |
| 383 }; | 387 }; |
| 384 | 388 |
| 389 #ifdef SK_PDF_IMAGE_STATS |
| 390 extern SkAtomic<int> gDrawImageCalls; |
| 391 extern SkAtomic<int> gJpegImageObjects; |
| 392 extern SkAtomic<int> gRegularImageObjects; |
| 393 extern void SkPDFImageDumpStats(); |
| 394 #endif // SK_PDF_IMAGE_STATS |
| 395 |
| 385 #endif | 396 #endif |
| OLD | NEW |