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 1074 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1085 return; | 1085 return; |
1086 } | 1086 } |
1087 SkPDFUtils::EmitPath(*pathPtr, paint.getStyle(), | 1087 SkPDFUtils::EmitPath(*pathPtr, paint.getStyle(), |
1088 &content.entry()->fContent); | 1088 &content.entry()->fContent); |
1089 SkPDFUtils::PaintPath(paint.getStyle(), pathPtr->getFillType(), | 1089 SkPDFUtils::PaintPath(paint.getStyle(), pathPtr->getFillType(), |
1090 &content.entry()->fContent); | 1090 &content.entry()->fContent); |
1091 } | 1091 } |
1092 | 1092 |
1093 void SkPDFDevice::drawBitmapRect(const SkDraw& draw, const SkBitmap& bitmap, | 1093 void SkPDFDevice::drawBitmapRect(const SkDraw& draw, const SkBitmap& bitmap, |
1094 const SkRect* src, const SkRect& dst, | 1094 const SkRect* src, const SkRect& dst, |
1095 const SkPaint& srcPaint, | 1095 const SkPaint& srcPaint, SkCanvas::SrcRectConst
raint constraint) { |
1096 SK_VIRTUAL_CONSTRAINT_TYPE) { | |
1097 SkPaint paint = srcPaint; | 1096 SkPaint paint = srcPaint; |
1098 if (bitmap.isOpaque()) { | 1097 if (bitmap.isOpaque()) { |
1099 replace_srcmode_on_opaque_paint(&paint); | 1098 replace_srcmode_on_opaque_paint(&paint); |
1100 } | 1099 } |
1101 | 1100 |
1102 // TODO: this code path must be updated to respect the flags parameter | 1101 // TODO: this code path must be updated to respect the flags parameter |
1103 SkMatrix matrix; | 1102 SkMatrix matrix; |
1104 SkRect bitmapBounds, tmpSrc, tmpDst; | 1103 SkRect bitmapBounds, tmpSrc, tmpDst; |
1105 SkBitmap tmpBitmap; | 1104 SkBitmap tmpBitmap; |
1106 | 1105 |
(...skipping 1096 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2203 return; | 2202 return; |
2204 } | 2203 } |
2205 SkAutoTUnref<SkPDFObject> image(SkPDFBitmap::Create(fCanon, subsetBitmap)); | 2204 SkAutoTUnref<SkPDFObject> image(SkPDFBitmap::Create(fCanon, subsetBitmap)); |
2206 if (!image) { | 2205 if (!image) { |
2207 return; | 2206 return; |
2208 } | 2207 } |
2209 | 2208 |
2210 SkPDFUtils::DrawFormXObject(this->addXObjectResource(image.get()), | 2209 SkPDFUtils::DrawFormXObject(this->addXObjectResource(image.get()), |
2211 &content.entry()->fContent); | 2210 &content.entry()->fContent); |
2212 } | 2211 } |
OLD | NEW |