Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1)

Side by Side Diff: src/pdf/SkPDFDevice.cpp

Issue 1374383004: SkPDF: when drawing stroked path, draw using SVG rules for zero-length segments (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: 2015-10-06 (Tuesday) 12:31:14 EDT Created 5 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « gm/path_stroke_with_zero_length.cpp ('k') | src/pdf/SkPDFUtils.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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 }
OLDNEW
« no previous file with comments | « gm/path_stroke_with_zero_length.cpp ('k') | src/pdf/SkPDFUtils.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698