| OLD | NEW | 
|---|
| 1 /* | 1 /* | 
| 2  * Copyright 2011 Google Inc. | 2  * Copyright 2011 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 "SkData.h" | 8 #include "SkData.h" | 
| 9 #include "SkPaint.h" | 9 #include "SkPaint.h" | 
| 10 #include "SkPDFCanon.h" | 10 #include "SkPDFCanon.h" | 
| (...skipping 128 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
| 139             SkData::NewWithoutCopy(psInvert, strlen(psInvert))); | 139             SkData::NewWithoutCopy(psInvert, strlen(psInvert))); | 
| 140 | 140 | 
| 141     auto invertFunction = sk_make_sp<SkPDFStream>(psInvertStream.get()); | 141     auto invertFunction = sk_make_sp<SkPDFStream>(psInvertStream.get()); | 
| 142     invertFunction->insertInt("FunctionType", 4); | 142     invertFunction->insertInt("FunctionType", 4); | 
| 143     invertFunction->insertObject("Domain", domainAndRange); | 143     invertFunction->insertObject("Domain", domainAndRange); | 
| 144     invertFunction->insertObject("Range", std::move(domainAndRange)); | 144     invertFunction->insertObject("Range", std::move(domainAndRange)); | 
| 145     return invertFunction; | 145     return invertFunction; | 
| 146 } | 146 } | 
| 147 | 147 | 
| 148 sk_sp<SkPDFDict> SkPDFGraphicState::GetSMaskGraphicState( | 148 sk_sp<SkPDFDict> SkPDFGraphicState::GetSMaskGraphicState( | 
| 149         SkPDFFormXObject* sMask, | 149         SkPDFObject* sMask, | 
| 150         bool invert, | 150         bool invert, | 
| 151         SkPDFSMaskMode sMaskMode, | 151         SkPDFSMaskMode sMaskMode, | 
| 152         SkPDFCanon* canon) { | 152         SkPDFCanon* canon) { | 
| 153     // The practical chances of using the same mask more than once are unlikely | 153     // The practical chances of using the same mask more than once are unlikely | 
| 154     // enough that it's not worth canonicalizing. | 154     // enough that it's not worth canonicalizing. | 
| 155     auto sMaskDict = sk_make_sp<SkPDFDict>("Mask"); | 155     auto sMaskDict = sk_make_sp<SkPDFDict>("Mask"); | 
| 156     if (sMaskMode == kAlpha_SMaskMode) { | 156     if (sMaskMode == kAlpha_SMaskMode) { | 
| 157         sMaskDict->insertName("S", "Alpha"); | 157         sMaskDict->insertName("S", "Alpha"); | 
| 158     } else if (sMaskMode == kLuminosity_SMaskMode) { | 158     } else if (sMaskMode == kLuminosity_SMaskMode) { | 
| 159         sMaskDict->insertName("S", "Luminosity"); | 159         sMaskDict->insertName("S", "Luminosity"); | 
| (...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
| 204     static_assert(SkPaint::kJoinCount == 3, "paint_join_mismatch"); | 204     static_assert(SkPaint::kJoinCount == 3, "paint_join_mismatch"); | 
| 205     SkASSERT(strokeJoin >= 0 && strokeJoin <= 2); | 205     SkASSERT(strokeJoin >= 0 && strokeJoin <= 2); | 
| 206     dict->insertInt("LJ", strokeJoin); | 206     dict->insertInt("LJ", strokeJoin); | 
| 207 | 207 | 
| 208     dict->insertScalar("LW", fStrokeWidth); | 208     dict->insertScalar("LW", fStrokeWidth); | 
| 209     dict->insertScalar("ML", fStrokeMiter); | 209     dict->insertScalar("ML", fStrokeMiter); | 
| 210     dict->insertBool("SA", true);  // SA = Auto stroke adjustment. | 210     dict->insertBool("SA", true);  // SA = Auto stroke adjustment. | 
| 211     dict->insertName("BM", as_blend_mode(xferMode)); | 211     dict->insertName("BM", as_blend_mode(xferMode)); | 
| 212     dict->emitObject(stream, objNumMap, substitutes); | 212     dict->emitObject(stream, objNumMap, substitutes); | 
| 213 } | 213 } | 
| OLD | NEW | 
|---|