OLD | NEW |
1 /* | 1 /* |
2 * Copyright 2013 Google Inc. | 2 * Copyright 2013 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 | 7 |
8 #include "SkPdfNativeObject.h" | 8 #include "SkPdfNativeObject.h" |
9 | 9 |
10 #include "SkBitmap.h" | 10 #include "SkBitmap.h" |
(...skipping 92 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
103 "filter name should be a Name", this, NULL); | 103 "filter name should be a Name", this, NULL); |
104 } | 104 } |
105 } | 105 } |
106 } | 106 } |
107 | 107 |
108 return true; | 108 return true; |
109 } | 109 } |
110 | 110 |
111 void SkPdfNativeObject::releaseData() { | 111 void SkPdfNativeObject::releaseData() { |
112 #ifdef PDF_TRACK_OBJECT_USAGE | 112 #ifdef PDF_TRACK_OBJECT_USAGE |
113 SkPdfReportIf(!fUsed, kInfo_SkPdfIssueSeverity, kNoIssue_SkPdfIssue, | 113 SkPdfReportIf(!fUsed, kInfo_SkPdfIssueSeverity, kUnusedObject_SkPdfIssue, |
114 "Unused object in rendering", this, NULL); | 114 "Unused object in rendering", this, NULL); |
115 #endif // PDF_TRACK_OBJECT_USAGE | 115 #endif // PDF_TRACK_OBJECT_USAGE |
116 | 116 |
117 SkPdfMarkObjectUnused(); | 117 SkPdfMarkObjectUnused(); |
118 | 118 |
119 if (fData) { | 119 if (fData) { |
120 switch (fDataType) { | 120 switch (fDataType) { |
121 case kFont_Data: | 121 case kFont_Data: |
122 delete (SkPdfFont*)fData; | 122 delete (SkPdfFont*)fData; |
123 break; | 123 break; |
124 case kBitmap_Data: | 124 case kBitmap_Data: |
125 delete (SkBitmap*)fData; | 125 delete (SkBitmap*)fData; |
126 break; | 126 break; |
127 default: | 127 default: |
128 SkASSERT(false); | 128 SkASSERT(false); |
129 break; | 129 break; |
130 } | 130 } |
131 } | 131 } |
132 fData = NULL; | 132 fData = NULL; |
133 fDataType = kEmpty_Data; | 133 fDataType = kEmpty_Data; |
134 } | 134 } |
OLD | NEW |