| 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 "SkPDFDevice.h" | 8 #include "SkPDFDevice.h" |
| 9 | 9 |
| 10 #include "SkAnnotation.h" | 10 #include "SkAnnotation.h" |
| (...skipping 1017 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1028 if (SkAnnotation* annotation = paint.getAnnotation()) { | 1028 if (SkAnnotation* annotation = paint.getAnnotation()) { |
| 1029 if (handlePathAnnotation(*pathPtr, d, annotation)) { | 1029 if (handlePathAnnotation(*pathPtr, d, annotation)) { |
| 1030 return; | 1030 return; |
| 1031 } | 1031 } |
| 1032 } | 1032 } |
| 1033 | 1033 |
| 1034 ScopedContentEntry content(this, d.fClipStack, *d.fClip, matrix, paint); | 1034 ScopedContentEntry content(this, d.fClipStack, *d.fClip, matrix, paint); |
| 1035 if (!content.entry()) { | 1035 if (!content.entry()) { |
| 1036 return; | 1036 return; |
| 1037 } | 1037 } |
| 1038 bool consumeDegeratePathSegments = |
| 1039 paint.getStyle() == SkPaint::kFill_Style || |
| 1040 (paint.getStrokeCap() != SkPaint::kRound_Cap && |
| 1041 paint.getStrokeCap() != SkPaint::kSquare_Cap); |
| 1038 SkPDFUtils::EmitPath(*pathPtr, paint.getStyle(), | 1042 SkPDFUtils::EmitPath(*pathPtr, paint.getStyle(), |
| 1043 consumeDegeratePathSegments, |
| 1039 &content.entry()->fContent); | 1044 &content.entry()->fContent); |
| 1040 SkPDFUtils::PaintPath(paint.getStyle(), pathPtr->getFillType(), | 1045 SkPDFUtils::PaintPath(paint.getStyle(), pathPtr->getFillType(), |
| 1041 &content.entry()->fContent); | 1046 &content.entry()->fContent); |
| 1042 } | 1047 } |
| 1043 | 1048 |
| 1044 void SkPDFDevice::drawBitmapRect(const SkDraw& draw, | 1049 void SkPDFDevice::drawBitmapRect(const SkDraw& draw, |
| 1045 const SkBitmap& bitmap, | 1050 const SkBitmap& bitmap, |
| 1046 const SkRect* src, | 1051 const SkRect* src, |
| 1047 const SkRect& dst, | 1052 const SkRect& dst, |
| 1048 const SkPaint& srcPaint, | 1053 const SkPaint& srcPaint, |
| (...skipping 1237 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2286 if (!pdfimage) { | 2291 if (!pdfimage) { |
| 2287 pdfimage.reset(SkPDFCreateBitmapObject(image)); | 2292 pdfimage.reset(SkPDFCreateBitmapObject(image)); |
| 2288 if (!pdfimage) { | 2293 if (!pdfimage) { |
| 2289 return; | 2294 return; |
| 2290 } | 2295 } |
| 2291 fCanon->addPDFBitmap(image->uniqueID(), pdfimage); | 2296 fCanon->addPDFBitmap(image->uniqueID(), pdfimage); |
| 2292 } | 2297 } |
| 2293 SkPDFUtils::DrawFormXObject(this->addXObjectResource(pdfimage.get()), | 2298 SkPDFUtils::DrawFormXObject(this->addXObjectResource(pdfimage.get()), |
| 2294 &content.entry()->fContent); | 2299 &content.entry()->fContent); |
| 2295 } | 2300 } |
| OLD | NEW |