| 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 | 7 |
| 8 #include "SkImage.h" | 8 #include "SkImage.h" |
| 9 #include "SkPDFBitmap.h" | 9 #include "SkPDFBitmap.h" |
| 10 #include "SkPDFCanon.h" | 10 #include "SkPDFCanon.h" |
| 11 #include "SkPDFFont.h" | 11 #include "SkPDFFont.h" |
| 12 #include "SkPDFShader.h" | |
| 13 | 12 |
| 14 //////////////////////////////////////////////////////////////////////////////// | 13 //////////////////////////////////////////////////////////////////////////////// |
| 15 | 14 |
| 16 void SkPDFCanon::reset() { | 15 void SkPDFCanon::reset() { |
| 17 for (int i = 0; i < fFontRecords.count(); ++i) { | 16 for (int i = 0; i < fFontRecords.count(); ++i) { |
| 18 fFontRecords[i].fFont->unref(); | 17 fFontRecords[i].fFont->unref(); |
| 19 } | 18 } |
| 20 fFontRecords.reset(); | 19 fFontRecords.reset(); |
| 21 fFunctionShaderRecords.unrefAll(); | 20 fFunctionShaderRecords.unrefAll(); |
| 22 fFunctionShaderRecords.reset(); | 21 fFunctionShaderRecords.reset(); |
| (...skipping 125 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 148 fNoSmaskGraphicState = SkPDFGraphicState::MakeNoSmaskGraphicState(); | 147 fNoSmaskGraphicState = SkPDFGraphicState::MakeNoSmaskGraphicState(); |
| 149 return fNoSmaskGraphicState; | 148 return fNoSmaskGraphicState; |
| 150 } | 149 } |
| 151 sk_sp<SkPDFArray> SkPDFCanon::makeRangeObject() { | 150 sk_sp<SkPDFArray> SkPDFCanon::makeRangeObject() { |
| 152 if (fRangeObject) { | 151 if (fRangeObject) { |
| 153 return fRangeObject; | 152 return fRangeObject; |
| 154 } | 153 } |
| 155 fRangeObject = SkPDFShader::MakeRangeObject(); | 154 fRangeObject = SkPDFShader::MakeRangeObject(); |
| 156 return fRangeObject; | 155 return fRangeObject; |
| 157 } | 156 } |
| OLD | NEW |