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 "SkColorFilter.h" | 8 #include "SkColorFilter.h" |
9 #include "SkDevice.h" | 9 #include "SkDevice.h" |
10 #include "SkDraw.h" | 10 #include "SkDraw.h" |
(...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
66 break; | 66 break; |
67 case kNever_TileUsage: | 67 case kNever_TileUsage: |
68 if (!preserveLCDText) { | 68 if (!preserveLCDText) { |
69 geo = kUnknown_SkPixelGeometry; | 69 geo = kUnknown_SkPixelGeometry; |
70 } | 70 } |
71 break; | 71 break; |
72 } | 72 } |
73 return geo; | 73 return geo; |
74 } | 74 } |
75 | 75 |
| 76 void SkBaseDevice::drawArc(const SkDraw& draw, const SkRect& oval, SkScalar star
tAngle, |
| 77 SkScalar sweepAngle, bool useCenter, const SkPaint& p
aint) { |
| 78 SkPath path; |
| 79 if (useCenter) { |
| 80 path.moveTo(oval.centerX(), oval.centerY()); |
| 81 } |
| 82 path.arcTo(oval, startAngle, sweepAngle, !useCenter); |
| 83 if (useCenter) { |
| 84 path.close(); |
| 85 } |
| 86 this->drawPath(draw, path, paint); |
| 87 } |
| 88 |
76 void SkBaseDevice::drawDRRect(const SkDraw& draw, const SkRRect& outer, | 89 void SkBaseDevice::drawDRRect(const SkDraw& draw, const SkRRect& outer, |
77 const SkRRect& inner, const SkPaint& paint) { | 90 const SkRRect& inner, const SkPaint& paint) { |
78 SkPath path; | 91 SkPath path; |
79 path.addRRect(outer); | 92 path.addRRect(outer); |
80 path.addRRect(inner); | 93 path.addRRect(inner); |
81 path.setFillType(SkPath::kEvenOdd_FillType); | 94 path.setFillType(SkPath::kEvenOdd_FillType); |
82 | 95 |
83 const SkMatrix* preMatrix = nullptr; | 96 const SkMatrix* preMatrix = nullptr; |
84 const bool pathIsMutable = true; | 97 const bool pathIsMutable = true; |
85 this->drawPath(draw, path, paint, preMatrix, pathIsMutable); | 98 this->drawPath(draw, path, paint, preMatrix, pathIsMutable); |
(...skipping 449 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
535 | 548 |
536 // Also log filter quality independent scale factor. | 549 // Also log filter quality independent scale factor. |
537 SK_HISTOGRAM_ENUMERATION("DrawScaleFactor.AnyFilterQuality", scaleFactor, | 550 SK_HISTOGRAM_ENUMERATION("DrawScaleFactor.AnyFilterQuality", scaleFactor, |
538 kLast_ScaleFactor + 1); | 551 kLast_ScaleFactor + 1); |
539 | 552 |
540 // Also log an overall histogram of filter quality. | 553 // Also log an overall histogram of filter quality. |
541 SK_HISTOGRAM_ENUMERATION("FilterQuality", filterQuality, kLast_SkFilterQuali
ty + 1); | 554 SK_HISTOGRAM_ENUMERATION("FilterQuality", filterQuality, kLast_SkFilterQuali
ty + 1); |
542 #endif | 555 #endif |
543 } | 556 } |
544 | 557 |
OLD | NEW |