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" |
11 #include "SkColor.h" | 11 #include "SkColor.h" |
12 #include "SkClipStack.h" | 12 #include "SkClipStack.h" |
13 #include "SkData.h" | 13 #include "SkData.h" |
14 #include "SkDraw.h" | 14 #include "SkDraw.h" |
15 #include "SkFontHost.h" | 15 #include "SkFontHost.h" |
16 #include "SkGlyphCache.h" | 16 #include "SkGlyphCache.h" |
17 #include "SkPaint.h" | 17 #include "SkPaint.h" |
18 #include "SkPath.h" | 18 #include "SkPath.h" |
19 #include "SkPathOps.h" | 19 #include "SkPathOps.h" |
20 #include "SkPDFFont.h" | 20 #include "SkPDFFont.h" |
21 #include "SkPDFFormXObject.h" | 21 #include "SkPDFFormXObject.h" |
22 #include "SkPDFGraphicState.h" | 22 #include "SkPDFGraphicState.h" |
23 #include "SkPDFImage.h" | 23 #include "SkPDFImage.h" |
24 #include "SkPDFResourceDict.h" | 24 #include "SkPDFResourceDict.h" |
25 #include "SkPDFShader.h" | 25 #include "SkPDFShader.h" |
26 #include "SkPDFStream.h" | 26 #include "SkPDFStream.h" |
27 #include "SkPDFTypes.h" | 27 #include "SkPDFTypes.h" |
28 #include "SkPDFUtils.h" | 28 #include "SkPDFUtils.h" |
29 #include "SkRect.h" | 29 #include "SkRect.h" |
| 30 #include "SkRRect.h" |
30 #include "SkString.h" | 31 #include "SkString.h" |
31 #include "SkTextFormatParams.h" | 32 #include "SkTextFormatParams.h" |
32 #include "SkTemplates.h" | 33 #include "SkTemplates.h" |
33 #include "SkTypefacePriv.h" | 34 #include "SkTypefacePriv.h" |
34 #include "SkTSet.h" | 35 #include "SkTSet.h" |
35 | 36 |
36 #ifdef SK_BUILD_FOR_ANDROID | 37 #ifdef SK_BUILD_FOR_ANDROID |
37 #include "SkTypeface_android.h" | 38 #include "SkTypeface_android.h" |
38 | 39 |
39 struct TypefaceFallbackData { | 40 struct TypefaceFallbackData { |
(...skipping 920 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
960 | 961 |
961 ScopedContentEntry content(this, d, paint); | 962 ScopedContentEntry content(this, d, paint); |
962 if (!content.entry()) { | 963 if (!content.entry()) { |
963 return; | 964 return; |
964 } | 965 } |
965 SkPDFUtils::AppendRectangle(r, &content.entry()->fContent); | 966 SkPDFUtils::AppendRectangle(r, &content.entry()->fContent); |
966 SkPDFUtils::PaintPath(paint.getStyle(), SkPath::kWinding_FillType, | 967 SkPDFUtils::PaintPath(paint.getStyle(), SkPath::kWinding_FillType, |
967 &content.entry()->fContent); | 968 &content.entry()->fContent); |
968 } | 969 } |
969 | 970 |
| 971 void SkPDFDevice::drawRRect(const SkDraw& draw, const SkRRect& rrect, |
| 972 const SkPaint& paint) { |
| 973 SkPath path; |
| 974 path.addRRect(rrect); |
| 975 this->drawPath(draw, path, paint, NULL, true); |
| 976 } |
| 977 |
970 void SkPDFDevice::drawPath(const SkDraw& d, const SkPath& origPath, | 978 void SkPDFDevice::drawPath(const SkDraw& d, const SkPath& origPath, |
971 const SkPaint& paint, const SkMatrix* prePathMatrix, | 979 const SkPaint& paint, const SkMatrix* prePathMatrix, |
972 bool pathIsMutable) { | 980 bool pathIsMutable) { |
973 SkPath modifiedPath; | 981 SkPath modifiedPath; |
974 SkPath* pathPtr = const_cast<SkPath*>(&origPath); | 982 SkPath* pathPtr = const_cast<SkPath*>(&origPath); |
975 | 983 |
976 SkMatrix matrix = *d.fMatrix; | 984 SkMatrix matrix = *d.fMatrix; |
977 if (prePathMatrix) { | 985 if (prePathMatrix) { |
978 if (paint.getPathEffect() || paint.getStyle() != SkPaint::kFill_Style) { | 986 if (paint.getPathEffect() || paint.getStyle() != SkPaint::kFill_Style) { |
979 if (!pathIsMutable) { | 987 if (!pathIsMutable) { |
(...skipping 1287 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2267 } | 2275 } |
2268 | 2276 |
2269 bool SkPDFDevice::onReadPixels(const SkBitmap& bitmap, int x, int y, | 2277 bool SkPDFDevice::onReadPixels(const SkBitmap& bitmap, int x, int y, |
2270 SkCanvas::Config8888) { | 2278 SkCanvas::Config8888) { |
2271 return false; | 2279 return false; |
2272 } | 2280 } |
2273 | 2281 |
2274 bool SkPDFDevice::allowImageFilter(SkImageFilter*) { | 2282 bool SkPDFDevice::allowImageFilter(SkImageFilter*) { |
2275 return false; | 2283 return false; |
2276 } | 2284 } |
OLD | NEW |