| 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 "SkLazyPtr.h" | 9 #include "SkLazyPtr.h" |
| 10 #include "SkPDFCanon.h" | 10 #include "SkPDFCanon.h" |
| (...skipping 96 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 107 | 107 |
| 108 return strcmp(aXfermodeString, bXfermodeString) == 0; | 108 return strcmp(aXfermodeString, bXfermodeString) == 0; |
| 109 } | 109 } |
| 110 | 110 |
| 111 bool SkPDFGraphicState::equals(const SkPaint& paint) const { | 111 bool SkPDFGraphicState::equals(const SkPaint& paint) const { |
| 112 return equivalent(paint, fPaint); | 112 return equivalent(paint, fPaint); |
| 113 } | 113 } |
| 114 | 114 |
| 115 SkPDFGraphicState::~SkPDFGraphicState() {} | 115 SkPDFGraphicState::~SkPDFGraphicState() {} |
| 116 | 116 |
| 117 void SkPDFGraphicState::emitObject(SkWStream* stream, SkPDFCatalog* catalog) { | 117 void SkPDFGraphicState::emitObject(SkWStream* stream, |
| 118 const SkPDFObjNumMap& objNumMap, |
| 119 const SkPDFSubstituteMap& substitutes) { |
| 118 populateDict(); | 120 populateDict(); |
| 119 SkPDFDict::emitObject(stream, catalog); | 121 SkPDFDict::emitObject(stream, objNumMap, substitutes); |
| 120 } | 122 } |
| 121 | 123 |
| 122 // static | 124 // static |
| 123 SkPDFGraphicState* SkPDFGraphicState::GetGraphicStateForPaint( | 125 SkPDFGraphicState* SkPDFGraphicState::GetGraphicStateForPaint( |
| 124 SkPDFCanon* canon, const SkPaint& paint) { | 126 SkPDFCanon* canon, const SkPaint& paint) { |
| 125 SkASSERT(canon); | 127 SkASSERT(canon); |
| 126 SkPDFGraphicState* pdfGraphicState = canon->findGraphicState(paint); | 128 SkPDFGraphicState* pdfGraphicState = canon->findGraphicState(paint); |
| 127 if (pdfGraphicState) { | 129 if (pdfGraphicState) { |
| 128 return SkRef(pdfGraphicState); | 130 return SkRef(pdfGraphicState); |
| 129 } | 131 } |
| (...skipping 113 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 243 fPaint.getXfermode()->asMode(&xfermode); | 245 fPaint.getXfermode()->asMode(&xfermode); |
| 244 // If we don't support the mode, just use kSrcOver_Mode. | 246 // If we don't support the mode, just use kSrcOver_Mode. |
| 245 if (xfermode < 0 || xfermode > SkXfermode::kLastMode || | 247 if (xfermode < 0 || xfermode > SkXfermode::kLastMode || |
| 246 as_blend_mode(xfermode) == NULL) { | 248 as_blend_mode(xfermode) == NULL) { |
| 247 xfermode = SkXfermode::kSrcOver_Mode; | 249 xfermode = SkXfermode::kSrcOver_Mode; |
| 248 NOT_IMPLEMENTED("unsupported xfermode", false); | 250 NOT_IMPLEMENTED("unsupported xfermode", false); |
| 249 } | 251 } |
| 250 insertName("BM", as_blend_mode(xfermode)); | 252 insertName("BM", as_blend_mode(xfermode)); |
| 251 } | 253 } |
| 252 } | 254 } |
| OLD | NEW |