OLD | NEW |
1 | 1 |
2 #include "SkPdfObject.h" | 2 #include "SkPdfObject.h" |
3 #include "SkPdfStreamCommonDictionary_autogen.h" | 3 #include "SkPdfStreamCommonDictionary_autogen.h" |
4 | 4 |
5 #include "SkFlate.h" | 5 #include "SkFlate.h" |
6 #include "SkStream.h" | 6 #include "SkStream.h" |
7 #include "SkPdfNativeTokenizer.h" | 7 #include "SkPdfNativeTokenizer.h" |
8 | 8 |
| 9 #include "SkBitmap.h" |
| 10 #include "SkPdfFont.h" |
| 11 |
9 SkPdfObject SkPdfObject::kNull = SkPdfObject::makeNull(); | 12 SkPdfObject SkPdfObject::kNull = SkPdfObject::makeNull(); |
10 | 13 |
11 bool SkPdfObject::applyFlateDecodeFilter() { | 14 bool SkPdfObject::applyFlateDecodeFilter() { |
12 if (!SkFlate::HaveFlate()) { | 15 if (!SkFlate::HaveFlate()) { |
13 // TODO(edisonn): warn, make callers handle it | 16 // TODO(edisonn): warn, make callers handle it |
14 return false; | 17 return false; |
15 } | 18 } |
16 | 19 |
17 const unsigned char* old = fStr.fBuffer; | 20 const unsigned char* old = fStr.fBuffer; |
18 bool deleteOld = isStreamOwned(); | 21 bool deleteOld = isStreamOwned(); |
(...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
79 break; | 82 break; |
80 } | 83 } |
81 } else { | 84 } else { |
82 // TODO(edisonn): report warning | 85 // TODO(edisonn): report warning |
83 } | 86 } |
84 } | 87 } |
85 } | 88 } |
86 | 89 |
87 return true; | 90 return true; |
88 } | 91 } |
| 92 |
| 93 void SkPdfObject::releaseData() { |
| 94 if (fData) { |
| 95 switch (fDataType) { |
| 96 case kFont_Data: |
| 97 delete (SkPdfFont*)fData; |
| 98 break; |
| 99 case kBitmap_Data: |
| 100 delete (SkBitmap*)fData; |
| 101 break; |
| 102 default: |
| 103 SkASSERT(false); |
| 104 break; |
| 105 } |
| 106 } |
| 107 fData = NULL; |
| 108 fDataType = kEmpty_Data; |
| 109 } |
OLD | NEW |